diff --git a/DEPS b/DEPS index cb12485..2930081 100644 --- a/DEPS +++ b/DEPS
@@ -251,11 +251,11 @@ 'reclient_version': 're_client_version:0.176.0.8c46330a-gomaip', # screen-ai CIPD packages - 'screen_ai_linux': 'version:127.19', - 'screen_ai_macos_amd64': 'version:127.19', - 'screen_ai_macos_arm64': 'version:127.19', - 'screen_ai_windows_amd64': 'version:127.19', - 'screen_ai_windows_386': 'version:127.19', + 'screen_ai_linux': 'version:127.21', + 'screen_ai_macos_amd64': 'version:127.21', + 'screen_ai_macos_arm64': 'version:127.21', + 'screen_ai_windows_amd64': 'version:127.21', + 'screen_ai_windows_386': 'version:127.21', # siso CIPD package version. 'siso_version': 'git_revision:3d58d66552de848b17cd585cfa6d5018124892ea', @@ -281,15 +281,15 @@ # 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': '2afa712f41386ee9d15632203c6c7b7fa6d09914', + 'src_internal_revision': 'b449482a12dac1b1b2409704c32f69d7a8677b3a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '15b0d7575e642f7d577d6a9610dbd5f321fc700d', + 'skia_revision': '6ca926db528a7c0346649495ad19457ee76461ed', # 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': 'c206c46cd0bd65b02e85abe5965d82e4beb7d453', + 'v8_revision': '4c9f0bc7cfaa2e503fecdaa71fb9b7b1fd5bf85e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. @@ -305,7 +305,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. - 'boringssl_revision': '704dc8deff291eaf2f9564e2cd949824d181302e', + 'boringssl_revision': '784c2dbf5d3ec7fd662cff39cb4c365e581d91f9', # 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. @@ -361,7 +361,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling CrossBench # and whatever else without interference from each other. - 'crossbench_revision': '610824f7175a8cff107b69cfa56646f724bf9453', + 'crossbench_revision': 'e1e2e0403c30da1b6e3aeffd34ec33e314db94eb', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -377,7 +377,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': '66bddcab5926993be9b03ef601bb94c5c5d1ce2d', + 'devtools_frontend_revision': 'acdf453e69dfe33bb9134f0070b1cdbec23273b1', # 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. @@ -429,7 +429,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling crabbyavif # and whatever else without interference from each other. - 'crabbyavif_revision': 'a75457c637a365910508f3c2c2b986a701b03a2e', + 'crabbyavif_revision': 'e8b91a8b8519ba5381ba56609a721f499fa10301', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Speedometer main # and whatever else without interference from each other. @@ -501,7 +501,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling llvm-libc # and whatever else without interference from each other. - 'llvm_libc_revision': 'a02de4d0d992b110c8b180fdec91258e7b60265f', + 'llvm_libc_revision': 'a35441f9bbcc779f89ffc049ef643a6e6d1b93fe', # If you change this, also update the libc++ revision in # //buildtools/deps_revisions.gni. @@ -1128,7 +1128,7 @@ }, 'src/chrome/release_scripts': { - 'url': Var('chrome_git') + '/chrome/tools/release/scripts' + '@' + 'a81411f66a51ecb8f390eb54748e12bddb5056c5', + 'url': Var('chrome_git') + '/chrome/tools/release/scripts' + '@' + '5ff9f1605f25a18340342ea1719b517b808d3443', 'condition': 'checkout_chrome_release_scripts', }, @@ -1457,7 +1457,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - 'e1b888313a11603d7fa7469c598fed3386e7a530', + '326b1ab67ee6d99d3a2af9abdac9a29688dbc6ce', 'condition': 'checkout_android and checkout_src_internal', }, @@ -1486,7 +1486,7 @@ }, 'src/ios/third_party/material_components_ios/src': { - 'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + '7113d41e999fb2c1013c4f08fb64dc70dcf1fa24', + 'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + '23f7050e7e9ba6747d8a9913ad21c57adeb5612a', 'condition': 'checkout_ios', }, @@ -1616,7 +1616,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'eQJT7QNggpT7m50sQQ5JsJQ-n1ugLT3y8foPDlFP-QUC', + 'version': '5NS6xAPD_EKIXkvaP020Y6IRLfYPkjUjtg8tDyrfAK0C', }, ], 'condition': 'checkout_android and non_git_source', @@ -1922,7 +1922,7 @@ # Tools used when building Chrome for Chrome OS. This affects both the Simple # Chrome workflow, as well as the chromeos-chrome ebuild. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '2026679fbc91392c6964d0bdb0c3c0aae0a4a110', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'e2b890bbaea41cbe3cbf9ae36555dfb654e1659d', 'condition': 'checkout_chromeos', }, @@ -2306,7 +2306,7 @@ Var('chromium_git') + '/chromiumos/platform/libva-fake-driver.git' + '@' + 'a9bcab9cd6b15d4e3634ca44d5e5f7652c612194', 'src/third_party/libvpx/source/libvpx': - Var('chromium_git') + '/webm/libvpx.git' + '@' + '2bfb9f9e0a9cca18cd5a0045e931b49dac390c79', + Var('chromium_git') + '/webm/libvpx.git' + '@' + '95afae324986797afb19a606f3d95ecdf21e99a7', 'src/third_party/libwebm/source': Var('chromium_git') + '/webm/libwebm.git' + '@' + 'b4f01ea3ed6fd00923caa383bb2cf6f7a0b7f633', @@ -2818,7 +2818,7 @@ Var('chromium_git') + '/webpagereplay.git' + '@' + Var('webpagereplay_revision'), 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'b4a81dbae4e8bc104ae982f3c7ff42ae2a7351e4', + Var('webrtc_git') + '/src.git' + '@' + 'fa3b0a5720d09efef183756c44c0fd2f7edeb94c', # 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. @@ -4325,7 +4325,7 @@ 'src/chrome/browser/internal': { 'url': Var('chrome_git') + '/chrome/browser_internal.git' + '@' + - '5649dd0237ac7f75c2779ff757e8666bdb9d2674', + '8cb067a9ea39c3b7f38bad55e4e5e8818319d0b7', 'condition': 'checkout_src_internal', }, @@ -4563,7 +4563,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - '0dac69820e9cefa8adb50d391bf4c76dc9b4f568', + '027500d40853650fa50920850b6fd65758193c29', 'condition': 'checkout_ios and checkout_src_internal', },
diff --git a/ash/capture_mode/action_button_view.cc b/ash/capture_mode/action_button_view.cc index 65ffb1b..5502f84 100644 --- a/ash/capture_mode/action_button_view.cc +++ b/ash/capture_mode/action_button_view.cc
@@ -28,6 +28,7 @@ #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/controls/button/button.h" +#include "ui/views/controls/highlight_path_generator.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/highlight_border.h" @@ -85,6 +86,8 @@ capture_mode_util::SetHighlightBorder( this, kActionButtonRadius, views::HighlightBorder::Type::kHighlightBorderNoShadow); + views::InstallRoundRectHighlightPathGenerator(this, gfx::Insets(), + kActionButtonRadius); if (icon) { image_view_ = AddChildView(
diff --git a/ash/capture_mode/capture_mode_controller.cc b/ash/capture_mode/capture_mode_controller.cc index 4fa8427e..0f981e26 100644 --- a/ash/capture_mode/capture_mode_controller.cc +++ b/ash/capture_mode/capture_mode_controller.cc
@@ -2049,19 +2049,45 @@ } } - if (ShouldSendRegionSearch(capture_type)) { - const gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); - // `OnSearchUrlFetched()` will be invoked with `image` when the server - // response is fetched. - delegate_->SendRegionSearch( - bitmap, user_capture_region_, - base::BindRepeating(&CaptureModeController::OnSearchUrlFetched, - weak_ptr_factory_.GetWeakPtr(), - user_capture_region_, image), - base::BindRepeating(&CaptureModeController::OnLensTextDetectionComplete, - weak_ptr_factory_.GetWeakPtr(), - image_search_token)); + if (!ShouldSendRegionSearch(capture_type)) { + return; } + + // The Lens Web API needs an access token for authentication, so request + // that first. Otherwise, we can start the image search right away. + if (features::IsSunfishLensWebEnabled()) { + const gfx::Image image = gfx::Image::CreateFrom1xBitmap(bitmap); + delegate_->GetPrimaryAccountAccessToken(base::BindRepeating( + &CaptureModeController::OnPrimaryAccountAccessTokenAvailable, + weak_ptr_factory_.GetWeakPtr(), image, image_search_token)); + return; + } + + const gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); + // `OnSearchUrlFetched()` will be invoked with `image` when the server + // response is fetched. + delegate_->SendRegionSearch( + bitmap, user_capture_region_, + base::BindRepeating(&CaptureModeController::OnSearchUrlFetched, + weak_ptr_factory_.GetWeakPtr(), user_capture_region_, + image), + base::BindRepeating(&CaptureModeController::OnLensTextDetectionComplete, + weak_ptr_factory_.GetWeakPtr(), image_search_token)); +} + +// TODO: crbug.com/395939382 - Implement the resource request once a valid +// `access_token` is returned. +void CaptureModeController::OnPrimaryAccountAccessTokenAvailable( + const gfx::Image& original_image, + base::WeakPtr<BaseCaptureModeSession> image_search_token, + const std::string& access_token) { + if (!image_search_token) { + return; + } + + // TODO: crbug.com/395939382 - Navigate to the proper URL once it has been + // returned by the Lens Web API. + ShowSearchResultsPanel(gfx::ImageSkia(), GURL("https://lens.google.com/")); } void CaptureModeController::OnTextDetectionComplete(
diff --git a/ash/capture_mode/capture_mode_controller.h b/ash/capture_mode/capture_mode_controller.h index 03d53d6..97cc3e05 100644 --- a/ash/capture_mode/capture_mode_controller.h +++ b/ash/capture_mode/capture_mode_controller.h
@@ -541,6 +541,13 @@ base::WeakPtr<BaseCaptureModeSession> image_search_token, scoped_refptr<base::RefCountedMemory> jpeg_bytes); + // Called when an access token request completes (successfully or not). Used + // for the Lens Web API POST request. + void OnPrimaryAccountAccessTokenAvailable( + const gfx::Image& original_image, + base::WeakPtr<BaseCaptureModeSession> image_search_token, + const std::string& access_token); + // Called back when on-device text detection is complete to show copy text and // smart actions buttons if needed. `image_search_token` is a weak pointer // which is invalidated every time the selected region or session changes. If
diff --git a/ash/capture_mode/test_capture_mode_delegate.cc b/ash/capture_mode/test_capture_mode_delegate.cc index afc1b5d..a3b18e3 100644 --- a/ash/capture_mode/test_capture_mode_delegate.cc +++ b/ash/capture_mode/test_capture_mode_delegate.cc
@@ -240,6 +240,11 @@ return AshWebViewFactory::Get()->Create(AshWebView::InitParams()); } +void TestCaptureModeDelegate::GetPrimaryAccountAccessToken( + base::RepeatingCallback<void(const std::string& access_token)> callback) { + std::move(callback).Run("TEST"); +} + void TestCaptureModeDelegate::SendRegionSearch( const SkBitmap& image, const gfx::Rect& region,
diff --git a/ash/capture_mode/test_capture_mode_delegate.h b/ash/capture_mode/test_capture_mode_delegate.h index c7f4b00..0a9a594f 100644 --- a/ash/capture_mode/test_capture_mode_delegate.h +++ b/ash/capture_mode/test_capture_mode_delegate.h
@@ -158,6 +158,9 @@ DetectTextInImage, (const SkBitmap& image, OnTextDetectionComplete callback), (override)); + void GetPrimaryAccountAccessToken( + base::RepeatingCallback<void(const std::string& access_token)> callback) + override; void SendRegionSearch(const SkBitmap& image, const gfx::Rect& region, ash::OnSearchUrlFetchedCallback search_callback,
diff --git a/ash/public/cpp/capture_mode/capture_mode_delegate.h b/ash/public/cpp/capture_mode/capture_mode_delegate.h index 101614b..1d74aae 100644 --- a/ash/public/cpp/capture_mode/capture_mode_delegate.h +++ b/ash/public/cpp/capture_mode/capture_mode_delegate.h
@@ -252,6 +252,12 @@ virtual void DetectTextInImage(const SkBitmap& image, OnTextDetectionComplete callback) = 0; + // Gets the OAuth2 access token for the user's primary account, used for + // making a Lens Web API POST request. + virtual void GetPrimaryAccountAccessToken( + base::RepeatingCallback<void(const std::string& access_token)> + callback) = 0; + // Sends the captured `region` and `image` to the backend. Invokes `callback` // when the response is fetched. virtual void SendRegionSearch(const SkBitmap& image,
diff --git a/ash/webui/boca_ui/boca_app_page_handler.cc b/ash/webui/boca_ui/boca_app_page_handler.cc index 6b6bd86..4f168b38 100644 --- a/ash/webui/boca_ui/boca_app_page_handler.cc +++ b/ash/webui/boca_ui/boca_app_page_handler.cc
@@ -689,6 +689,10 @@ UpdateSessionConfig(); } +void BocaAppHandler::OnLocalCaptionClosed() { + remote_->OnLocalCaptionDisabled(); +} + void BocaAppHandler::NotifyLocalCaptionConfigUpdate( mojom::CaptionConfigPtr config) { ::boca::CaptionsConfig local_caption_config;
diff --git a/ash/webui/boca_ui/boca_app_page_handler.h b/ash/webui/boca_ui/boca_app_page_handler.h index 620eb1a..5511fc45 100644 --- a/ash/webui/boca_ui/boca_app_page_handler.h +++ b/ash/webui/boca_ui/boca_app_page_handler.h
@@ -122,6 +122,7 @@ const ::boca::CaptionsConfig& config, const std::string& tachyon_group_id) override; void OnSessionRosterUpdated(const ::boca::Roster& roster) override; + void OnLocalCaptionClosed() override; void NotifyLocalCaptionConfigUpdate(mojom::CaptionConfigPtr config);
diff --git a/ash/webui/boca_ui/boca_app_page_handler_unittest.cc b/ash/webui/boca_ui/boca_app_page_handler_unittest.cc index fc4c2cf..41ac871 100644 --- a/ash/webui/boca_ui/boca_app_page_handler_unittest.cc +++ b/ash/webui/boca_ui/boca_app_page_handler_unittest.cc
@@ -289,6 +289,11 @@ session_config_updated_cb_ = std::move(session_config_updated_cb); } + void SetLocalCaptionDisabledInterceptorCallback( + base::OnceClosure local_caption_disabled_cb) { + local_caption_disabled_cb_ = std::move(local_caption_disabled_cb); + } + private: // mojom::Page: void OnStudentActivityUpdated( @@ -304,10 +309,15 @@ } void OnActiveNetworkStateChanged( std::vector<mojom::NetworkInfoPtr> active_networks) override {} - void OnLocalCaptionDisabled() override {} + void OnLocalCaptionDisabled() override { + if (local_caption_disabled_cb_) { + std::move(local_caption_disabled_cb_).Run(); + } + } ActivityInterceptorCallback student_activity_updated_cb_; SessionConfigInterceptorCallback session_config_updated_cb_; + base::OnceClosure local_caption_disabled_cb_; const mojo::Receiver<mojom::Page> receiver_; }; @@ -1983,5 +1993,12 @@ EXPECT_FALSE(future.Get()); } +TEST_F(BocaAppPageHandlerTest, NotifyWhenLocalCaptionClosed) { + base::test::TestFuture<void> future; + fake_page()->SetLocalCaptionDisabledInterceptorCallback(future.GetCallback()); + boca_app_handler()->OnLocalCaptionClosed(); + EXPECT_TRUE(future.Wait()); +} + } // namespace } // namespace ash::boca
diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc index 32d8707d..06f5b41 100644 --- a/base/json/json_reader.cc +++ b/base/json/json_reader.cc
@@ -31,26 +31,26 @@ const char kSecurityJsonParsingTime[] = "Security.JSONParser.ParsingTime"; ContextPointer& ListAppendList(ContextPointer& ctx) { - auto& value = reinterpret_cast<base::Value&>(ctx); - value.GetList().Append(base::Value::List()); - return reinterpret_cast<ContextPointer&>(value.GetList().back()); + auto& list = reinterpret_cast<base::Value&>(ctx).GetList(); + list.Append(base::Value::List()); + return reinterpret_cast<ContextPointer&>(list.back()); } ContextPointer& ListAppendDict(ContextPointer& ctx) { - auto& value = reinterpret_cast<base::Value&>(ctx); - value.GetList().Append(base::Value::Dict()); - return reinterpret_cast<ContextPointer&>(value.GetList().back()); + auto& list = reinterpret_cast<base::Value&>(ctx).GetList(); + list.Append(base::Value::Dict()); + return reinterpret_cast<ContextPointer&>(list.back()); } void ListAppendNone(ContextPointer& ctx) { - auto& value = reinterpret_cast<base::Value&>(ctx); - value.GetList().Append(base::Value()); + auto& list = reinterpret_cast<base::Value&>(ctx).GetList(); + list.Append(base::Value()); } template <class T, class As = T> void ListAppendValue(ContextPointer& ctx, T v) { - auto& value = reinterpret_cast<base::Value&>(ctx); - value.GetList().Append(As{v}); + auto& list = reinterpret_cast<base::Value&>(ctx).GetList(); + list.Append(As{v}); } ContextPointer& DictSetList(ContextPointer& ctx, rust::Str key) {
diff --git a/base/trace_event/etw_interceptor_win.cc b/base/trace_event/etw_interceptor_win.cc index 18eef6f..bf6072f 100644 --- a/base/trace_event/etw_interceptor_win.cc +++ b/base/trace_event/etw_interceptor_win.cc
@@ -109,7 +109,7 @@ "base", // 0x80000 "devtools.timeline", // 0x100000 "mediastream", // 0x200000 - "unused_bit_22", // 0x400000 + "blink_style", // 0x400000 "unused_bit_23", // 0x800000 "unused_bit_24", // 0x1000000 "unused_bit_25", // 0x2000000
diff --git a/build/config/siso/android.star b/build/config/siso/android.star index 8f4a9c2..73839c0e 100644 --- a/build/config/siso/android.star +++ b/build/config/siso/android.star
@@ -243,7 +243,8 @@ "*.sql", ], "canonicalize_dir": True, - "remote": remote_run, + # Speculatively disabling for https://crbug.com/398058215 + "remote": False, "platform_ref": "large", "timeout": "10m", },
diff --git a/build/util/lastchange.py b/build/util/lastchange.py index 5c3bef2d..a511f58 100755 --- a/build/util/lastchange.py +++ b/build/util/lastchange.py
@@ -314,9 +314,6 @@ help=("Output the revision as a VCS revision ID only (in " "Git, a 40-character commit hash, excluding the " "Cr-Commit-Position).")) - parser.add_argument("--revision-id-prefix", - metavar="PREFIX", - help=("Adds a string prefix to the VCS revision ID.")) parser.add_argument("--print-only", action="store_true", help=("Just print the revision string. Overrides any " "file-output-related options.")) @@ -353,9 +350,6 @@ if args.revision_id_only: revision_string = version_info.revision_id - if args.revision_id_prefix: - revision_string = args.revision_id_prefix + revision_string - if args.print_only: print(revision_string) else:
diff --git a/cc/paint/transfer_cache_unittest.cc b/cc/paint/transfer_cache_unittest.cc index ef9a055..1f94664 100644 --- a/cc/paint/transfer_cache_unittest.cc +++ b/cc/paint/transfer_cache_unittest.cc
@@ -41,8 +41,8 @@ gpu::ContextCreationAttribs attribs; attribs.fail_if_major_perf_caveat = false; attribs.bind_generates_resource = false; - // Enable OOP rasterization. - attribs.enable_oop_rasterization = true; + // Enable GPU rasterization. + attribs.enable_gpu_rasterization = true; attribs.enable_raster_interface = true; attribs.enable_gles2_interface = false;
diff --git a/cc/raster/one_copy_raster_buffer_provider.cc b/cc/raster/one_copy_raster_buffer_provider.cc index d3831f5..c7db429 100644 --- a/cc/raster/one_copy_raster_buffer_provider.cc +++ b/cc/raster/one_copy_raster_buffer_provider.cc
@@ -60,12 +60,23 @@ in_use_resource.set_backing(std::move(backing)); } backing_ = in_use_resource.backing(); + if (!backing_->shared_image()) { + // The backing's SharedImage will be created on a worker thread during the + // execution of this raster; to avoid data races during taking of memory + // dumps on the compositor thread, mark the backing's SharedImage as + // unavailable for access on the compositor thread for the duration of the + // raster. + backing_->can_access_shared_image_on_compositor_thread = false; + } before_raster_sync_token_ = backing_->returned_sync_token; - shared_image_ = backing_->shared_image(); mailbox_texture_is_overlay_candidate_ = client_->tile_overlay_candidate_; } OneCopyRasterBufferProvider::RasterBufferImpl::~RasterBufferImpl() { + // This raster task is complete, so if the backing's SharedImage was created + // on a worker thread during the raster work that has now happened. + backing_->can_access_shared_image_on_compositor_thread = true; + // This SyncToken was created on the worker context after uploading the // texture content. backing_->mailbox_sync_token = after_raster_sync_token_; @@ -74,7 +85,6 @@ // happened if the |after_raster_sync_token_| was set. backing_->returned_sync_token = gpu::SyncToken(); } - backing_->set_shared_image(std::move(shared_image_)); if (should_destroy_shared_image_ && backing_->shared_image()) { backing_->shared_image()->UpdateDestructionSyncToken( before_raster_sync_token_); @@ -96,7 +106,7 @@ // returns another SyncToken generated on the worker thread to synchronize // with after the raster is complete. after_raster_sync_token_ = client_->PlaybackAndCopyOnWorkerThread( - shared_image_, mailbox_texture_is_overlay_candidate_, + backing_, mailbox_texture_is_overlay_candidate_, before_raster_sync_token_, raster_source, raster_full_rect, raster_dirty_rect, transform, resource_size_, format_, color_space_, playback_settings, previous_content_id_, new_content_id, @@ -232,7 +242,7 @@ } gpu::SyncToken OneCopyRasterBufferProvider::PlaybackAndCopyOnWorkerThread( - scoped_refptr<gpu::ClientSharedImage>& shared_image, + ResourcePool::Backing* backing, bool mailbox_texture_is_overlay_candidate, const gpu::SyncToken& sync_token, const RasterSource* raster_source, @@ -262,9 +272,9 @@ if (put_data_in_staging_buffer) { sync_token_after_upload = CopyOnWorkerThread( staging_buffer.get(), raster_source, raster_full_rect, format, - resource_size, shared_image, mailbox_texture_is_overlay_candidate, + resource_size, backing, mailbox_texture_is_overlay_candidate, sync_token, color_space); - } else if (shared_image) { + } else if (backing->shared_image()) { // If we failed to put data in the staging buffer // (https://crbug.com/554541), then we don't have anything to give to copy // into the resource. We report a zero mailbox that will result in @@ -334,7 +344,7 @@ const gfx::Rect& rect_to_copy, viz::SharedImageFormat format, const gfx::Size& resource_size, - scoped_refptr<gpu::ClientSharedImage>& shared_image, + ResourcePool::Backing* backing, bool mailbox_texture_is_overlay_candidate, const gpu::SyncToken& sync_token, const gfx::ColorSpace& color_space) { @@ -345,7 +355,7 @@ bool needs_clear = false; - if (!shared_image) { + if (!backing->shared_image()) { // This SharedImage will have the contents of raster operations copied into // it via the raster interface before being sent off to the display // compositor. @@ -353,10 +363,10 @@ gpu::SHARED_IMAGE_USAGE_RASTER_WRITE; if (mailbox_texture_is_overlay_candidate) usage |= gpu::SHARED_IMAGE_USAGE_SCANOUT; - shared_image = sii->CreateSharedImage( + backing->set_shared_image(sii->CreateSharedImage( {format, resource_size, color_space, usage, "OneCopyRasterTile"}, - gpu::kNullSurfaceHandle); - CHECK(shared_image); + gpu::kNullSurfaceHandle)); + CHECK(backing->shared_image()); // Clear the resource if we're not going to initialize it fully from the // copy due to non-exact resource reuse. See https://crbug.com/1313091 needs_clear = rect_to_copy.size() != resource_size; @@ -395,7 +405,7 @@ ri->BeginQueryEXT(query_target, staging_buffer->query_id); } - uint32_t texture_target = shared_image->GetTextureTarget(); + uint32_t texture_target = backing->shared_image()->GetTextureTarget(); // Clear to ensure the resource is fully initialized and BeginAccess succeeds. if (needs_clear) { @@ -408,14 +418,14 @@ // SkBitmap.cpp doesn't yet have an interface for SkColor4fs // https://bugs.chromium.org/p/skia/issues/detail?id=13329 bitmap.eraseColor(raster_source->background_color().toSkColor()); - ri->WritePixels(shared_image->mailbox(), /*dst_x_offset=*/0, + ri->WritePixels(backing->shared_image()->mailbox(), /*dst_x_offset=*/0, /*dst_y_offset=*/0, texture_target, bitmap.pixmap()); } } if (base::FeatureList::IsEnabled(features::kNonBatchedCopySharedImage)) { ri->CopySharedImage(staging_buffer->client_shared_image->mailbox(), - shared_image->mailbox(), 0, 0, 0, 0, + backing->shared_image()->mailbox(), 0, 0, 0, 0, rect_to_copy.width(), rect_to_copy.height()); } else { int bytes_per_row = viz::ResourceSizes::UncheckedWidthInBytes<int>( @@ -432,7 +442,7 @@ DCHECK_GT(rows_to_copy, 0); ri->CopySharedImage(staging_buffer->client_shared_image->mailbox(), - shared_image->mailbox(), 0, y, 0, y, + backing->shared_image()->mailbox(), 0, y, 0, y, rect_to_copy.width(), rows_to_copy); y += rows_to_copy;
diff --git a/cc/raster/one_copy_raster_buffer_provider.h b/cc/raster/one_copy_raster_buffer_provider.h index 8abd4f5..b4ffb6b6 100644 --- a/cc/raster/one_copy_raster_buffer_provider.h +++ b/cc/raster/one_copy_raster_buffer_provider.h
@@ -71,7 +71,7 @@ // Playback raster source and copy result into |resource|. gpu::SyncToken PlaybackAndCopyOnWorkerThread( - scoped_refptr<gpu::ClientSharedImage>& shared_image, + ResourcePool::Backing* backing, bool mailbox_texture_is_overlay_candidate, const gpu::SyncToken& sync_token, const RasterSource* raster_source, @@ -111,7 +111,7 @@ bool SupportsBackgroundThreadPriority() const override; private: - // These fields may only be used on the compositor thread. + // These fields are safe to access on both the compositor and worker thread. const raw_ptr<OneCopyRasterBufferProvider> client_; raw_ptr<ResourcePool::Backing> backing_; @@ -121,7 +121,6 @@ const gfx::ColorSpace color_space_; const uint64_t previous_content_id_; gpu::SyncToken before_raster_sync_token_; - scoped_refptr<gpu::ClientSharedImage> shared_image_; bool mailbox_texture_is_overlay_candidate_; // A SyncToken to be returned from the worker thread, and waited on before // using the rastered resource. @@ -141,16 +140,15 @@ const RasterSource::PlaybackSettings& playback_settings, uint64_t previous_content_id, uint64_t new_content_id); - gpu::SyncToken CopyOnWorkerThread( - StagingBuffer* staging_buffer, - const RasterSource* raster_source, - const gfx::Rect& rect_to_copy, - viz::SharedImageFormat format, - const gfx::Size& resource_size, - scoped_refptr<gpu::ClientSharedImage>& shared_image, - bool mailbox_texture_is_overlay_candidate, - const gpu::SyncToken& sync_token, - const gfx::ColorSpace& color_space); + gpu::SyncToken CopyOnWorkerThread(StagingBuffer* staging_buffer, + const RasterSource* raster_source, + const gfx::Rect& rect_to_copy, + viz::SharedImageFormat format, + const gfx::Size& resource_size, + ResourcePool::Backing* backing, + bool mailbox_texture_is_overlay_candidate, + const gpu::SyncToken& sync_token, + const gfx::ColorSpace& color_space); const raw_ptr<viz::RasterContextProvider> compositor_context_provider_; const raw_ptr<viz::RasterContextProvider> worker_context_provider_;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/CollaborationActivityMessageCardViewModel.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/CollaborationActivityMessageCardViewModel.java index de912627..975f0dc 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/CollaborationActivityMessageCardViewModel.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/CollaborationActivityMessageCardViewModel.java
@@ -40,7 +40,7 @@ /** * @param context The {@link Context} to use. * @param reviewActionProvider The provider for the review action. - * @param dismissActionProvider The provier for the dismiss action. + * @param dismissActionProvider The provider for the dismiss action. */ public CollaborationActivityMessageCardViewModel( Context context, @@ -77,13 +77,11 @@ * Updates the description text. * * @param context The {@link Context} to use. - * @param tabsAdded The number of tabs added. - * @param tabsChanged The number of tabs changed. + * @param tabsAdded The number of tabs added or changed. * @param tabsClosed The number of tabs closed. */ - public void updateDescriptionText( - Context context, int tabsAdded, int tabsChanged, int tabsClosed) { - PluralData pluralData = getPluralData(tabsAdded, tabsChanged, tabsClosed); + public void updateDescriptionText(Context context, int tabsAdded, int tabsClosed) { + PluralData pluralData = getPluralData(tabsAdded, tabsClosed); String descriptionText; if (pluralData.id == Resources.ID_NULL) { @@ -93,11 +91,7 @@ descriptionText = context.getResources() .getQuantityString( - pluralData.id, - pluralData.quantity, - tabsAdded, - tabsChanged, - tabsClosed); + pluralData.id, pluralData.quantity, tabsAdded, tabsClosed); } mPropertyModel.set(DESCRIPTION_TEXT, descriptionText); @@ -105,52 +99,24 @@ private static class PluralData { public @PluralsRes int id = Resources.ID_NULL; + // Used for deciding pluralization of the noun. public int quantity; } - private PluralData getPluralData(int tabsAdded, int tabsChanged, int tabsClosed) { + private PluralData getPluralData(int tabsAdded, int tabsClosed) { PluralData pluralData = new PluralData(); if (tabsAdded > 0) { pluralData.quantity = tabsAdded; - if (tabsChanged > 0) { - if (tabsClosed > 0) { - pluralData.id = - R.plurals - .tab_grid_dialog_collaboration_activity_tabs_added_changed_closed; - return pluralData; - } - - pluralData.id = R.plurals.tab_grid_dialog_collaboration_activity_tabs_added_changed; - return pluralData; - } - if (tabsClosed > 0) { pluralData.id = R.plurals.tab_grid_dialog_collaboration_activity_tabs_added_closed; - return pluralData; + } else { + pluralData.id = R.plurals.tab_grid_dialog_collaboration_activity_tabs_added; } - - pluralData.id = R.plurals.tab_grid_dialog_collaboration_activity_tabs_added; return pluralData; - } - - if (tabsChanged > 0) { - pluralData.quantity = tabsChanged; - if (tabsClosed > 0) { - pluralData.id = - R.plurals.tab_grid_dialog_collaboration_activity_tabs_changed_closed; - return pluralData; - } - - pluralData.id = R.plurals.tab_grid_dialog_collaboration_activity_tabs_changed; - return pluralData; - } - - if (tabsClosed > 0) { + } else if (tabsClosed > 0) { pluralData.quantity = tabsClosed; pluralData.id = R.plurals.tab_grid_dialog_collaboration_activity_tabs_closed; - return pluralData; } - return pluralData; } }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/CollaborationActivityMessageCardViewModelUnitTest.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/CollaborationActivityMessageCardViewModelUnitTest.java index 675a052..06fc288 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/CollaborationActivityMessageCardViewModelUnitTest.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/CollaborationActivityMessageCardViewModelUnitTest.java
@@ -66,57 +66,22 @@ public void testUpdateTextDescription() { PropertyModel model = mModel.getPropertyModel(); - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 0, /* tabsChanged= */ 0, /* tabsClosed= */ 0); + mModel.updateDescriptionText(mContext, /* tabsAdded= */ 0, /* tabsClosed= */ 0); assertEquals("No tab updates", model.get(DESCRIPTION_TEXT)); - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 1, /* tabsChanged= */ 0, /* tabsClosed= */ 0); - assertEquals("1 tab added", model.get(DESCRIPTION_TEXT)); - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 2, /* tabsChanged= */ 0, /* tabsClosed= */ 0); - assertEquals("2 tabs added", model.get(DESCRIPTION_TEXT)); + mModel.updateDescriptionText(mContext, /* tabsAdded= */ 1, /* tabsClosed= */ 0); + assertEquals("1 new tab", model.get(DESCRIPTION_TEXT)); + mModel.updateDescriptionText(mContext, /* tabsAdded= */ 2, /* tabsClosed= */ 0); + assertEquals("2 new tabs", model.get(DESCRIPTION_TEXT)); - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 0, /* tabsChanged= */ 1, /* tabsClosed= */ 0); - assertEquals("1 tab changed", model.get(DESCRIPTION_TEXT)); - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 0, /* tabsChanged= */ 2, /* tabsClosed= */ 0); - assertEquals("2 tabs changed", model.get(DESCRIPTION_TEXT)); - - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 0, /* tabsChanged= */ 0, /* tabsClosed= */ 1); + mModel.updateDescriptionText(mContext, /* tabsAdded= */ 0, /* tabsClosed= */ 1); assertEquals("1 tab closed", model.get(DESCRIPTION_TEXT)); - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 0, /* tabsChanged= */ 0, /* tabsClosed= */ 2); + mModel.updateDescriptionText(mContext, /* tabsAdded= */ 0, /* tabsClosed= */ 2); assertEquals("2 tabs closed", model.get(DESCRIPTION_TEXT)); - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 1, /* tabsChanged= */ 2, /* tabsClosed= */ 0); - assertEquals("1 tab added, 2 changed", model.get(DESCRIPTION_TEXT)); - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 2, /* tabsChanged= */ 3, /* tabsClosed= */ 0); - assertEquals("2 tabs added, 3 changed", model.get(DESCRIPTION_TEXT)); - - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 1, /* tabsChanged= */ 0, /* tabsClosed= */ 2); - assertEquals("1 tab added, 2 closed", model.get(DESCRIPTION_TEXT)); - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 2, /* tabsChanged= */ 0, /* tabsClosed= */ 3); - assertEquals("2 tabs added, 3 closed", model.get(DESCRIPTION_TEXT)); - - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 0, /* tabsChanged= */ 1, /* tabsClosed= */ 2); - assertEquals("1 tab changed, 2 closed", model.get(DESCRIPTION_TEXT)); - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 0, /* tabsChanged= */ 2, /* tabsClosed= */ 3); - assertEquals("2 tabs changed, 3 closed", model.get(DESCRIPTION_TEXT)); - - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 1, /* tabsChanged= */ 2, /* tabsClosed= */ 3); - assertEquals("1 tab added, 2 changed, 3 closed", model.get(DESCRIPTION_TEXT)); - mModel.updateDescriptionText( - mContext, /* tabsAdded= */ 2, /* tabsChanged= */ 3, /* tabsClosed= */ 4); - assertEquals("2 tabs added, 3 changed, 4 closed", model.get(DESCRIPTION_TEXT)); + mModel.updateDescriptionText(mContext, /* tabsAdded= */ 1, /* tabsClosed= */ 2); + assertEquals("1 new tab, 2 closed", model.get(DESCRIPTION_TEXT)); + mModel.updateDescriptionText(mContext, /* tabsAdded= */ 2, /* tabsClosed= */ 3); + assertEquals("2 new tabs, 3 closed", model.get(DESCRIPTION_TEXT)); } }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediator.java index eb3b866..3dc2c8d 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediator.java
@@ -1358,8 +1358,10 @@ for (PersistentMessage message : messages) { collaborationEventCounts.merge(message.collaborationEvent, 1, Integer::sum); } - int tabsAdded = collaborationEventCounts.getOrDefault(CollaborationEvent.TAB_ADDED, 0); - int tabsChanged = collaborationEventCounts.getOrDefault(CollaborationEvent.TAB_UPDATED, 0); + // Added and updated will both be presented as new changes. + int tabsAdded = + collaborationEventCounts.getOrDefault(CollaborationEvent.TAB_ADDED, 0) + + collaborationEventCounts.getOrDefault(CollaborationEvent.TAB_UPDATED, 0); // Query for tombstoned entries from backend and look for the tab removals. List<PersistentMessage> tombstonedMessages = @@ -1372,7 +1374,7 @@ tabsClosed++; } - if (tabsAdded == 0 && tabsChanged == 0 && tabsClosed == 0) { + if (tabsAdded == 0 && tabsClosed == 0) { removeCollaborationActivityMessageCard(); return; } @@ -1390,8 +1392,7 @@ dismissAllDirtyTabMessagesForCurrentGroup(); }); } - mCollaborationActivityPropertyModel.updateDescriptionText( - mActivity, tabsAdded, tabsChanged, tabsClosed); + mCollaborationActivityPropertyModel.updateDescriptionText(mActivity, tabsAdded, tabsClosed); if (!mDialogController.messageCardExists(MessageType.COLLABORATION_ACTIVITY)) { mDialogController.addMessageCardItem(
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupListBottomSheetView.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupListBottomSheetView.java index a10bdd8..82b81122 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupListBottomSheetView.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupListBottomSheetView.java
@@ -29,6 +29,7 @@ public class TabGroupListBottomSheetView extends LinearLayout implements BottomSheetContent { private final RecyclerView mRecyclerView; private final ViewGroup mContentView; + private final boolean mShowNewGroupRow; /** * @param context The {@link Context} to attach the bottom sheet to. @@ -42,6 +43,7 @@ .inflate(R.layout.tab_group_list_bottom_sheet, /* root= */ null); mRecyclerView = mContentView.findViewById(R.id.tab_group_parity_recycler_view); mRecyclerView.setLayoutManager(new LinearLayoutManager(context)); + mShowNewGroupRow = showNewGroupRow; } @Override @@ -100,7 +102,10 @@ @Override public @NonNull String getSheetContentDescription(Context context) { - return context.getString(R.string.tab_group_list_bottom_sheet_content_description); + return mShowNewGroupRow + ? context.getString( + R.string.tab_group_list_with_add_button_bottom_sheet_content_description) + : context.getString(R.string.tab_group_list_bottom_sheet_content_description); } @Override
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 b9e157a5..a7b50bf 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
@@ -366,44 +366,20 @@ </message> <message name="IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED" desc="This text shows in a message card in the TabGridDialog if there are activity updates about the state of the tab group such as tabs being added, changed, or closed. This text describes that tabs were only added."> {NUMBER_OF_TABS_ADDED, plural, - =1 {<ph name="ONE_ADDED">%1$d<ex>1</ex></ph> tab added} - other {<ph name="MANY_ADDED">%1$d<ex>2</ex></ph> tabs added} - } - </message> - <message name="IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CHANGED" desc="This text shows in a message card in the TabGridDialog if there are activity updates about the state of the tab group such as tabs being added, changed, or closed. This text describes that tabs were added, and changed."> - {NUMBER_OF_TABS_ADDED, plural, - =1 {<ph name="ONE_ADDED">%1$d<ex>1</ex></ph> tab added, <ph name="ANY_CHANGED">%2$d<ex>2</ex></ph> changed} - other {<ph name="MANY_ADDED">%1$d<ex>2</ex></ph> tabs added, <ph name="ANY_CHANGED">%2$d<ex>2</ex></ph> changed} + =1 {<ph name="ONE_ADDED">%1$d<ex>1</ex></ph> new tab} + other {<ph name="MANY_ADDED">%1$d<ex>2</ex></ph> new tabs} } </message> <message name="IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CLOSED" desc="This text shows in a message card in the TabGridDialog if there are activity updates about the state of the tab group such as tabs being added, changed, or closed. This text describes that tabs were added, and closed."> {NUMBER_OF_TABS_ADDED, plural, - =1 {<ph name="ONE_ADDED">%1$d<ex>1</ex></ph> tab added, <ph name="ANY_CLOSED">%3$d<ex>2</ex></ph> closed} - other {<ph name="MANY_ADDED">%1$d<ex>2</ex></ph> tabs added, <ph name="ANY_CLOSED">%3$d<ex>2</ex></ph> closed} - } - </message> - <message name="IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CHANGED_CLOSED" desc="This text shows in a message card in the TabGridDialog if there are activity updates about the state of the tab group such as tabs being added, changed, or closed. This text describes that tabs were added, changed, and closed."> - {NUMBER_OF_TABS_ADDED, plural, - =1 {<ph name="ONE_ADDED">%1$d<ex>1</ex></ph> tab added, <ph name="ANY_CHANGED">%2$d<ex>2</ex></ph> changed, <ph name="ANY_CLOSED">%3$d<ex>2</ex></ph> closed} - other {<ph name="MANY_ADDED">%1$d<ex>2</ex></ph> tabs added, <ph name="ANY_CHANGED">%2$d<ex>2</ex></ph> changed, <ph name="ANY_CLOSED">%3$d<ex>2</ex></ph> closed} - } - </message> - <message name="IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CHANGED" desc="This text shows in a message card in the TabGridDialog if there are activity updates about the state of the tab group such as tabs being added, changed, or closed. This text describes that tabs were only changed."> - {NUMBER_OF_TABS_CHANGED, plural, - =1 {<ph name="ONE_CHANGED">%2$d<ex>1</ex></ph> tab changed} - other {<ph name="MANY_CHANGED">%2$d<ex>2</ex></ph> tabs changed} - } - </message> - <message name="IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CHANGED_CLOSED" desc="This text shows in a message card in the TabGridDialog if there are activity updates about the state of the tab group such as tabs being added, changed, or closed. This text describes that tabs were changed, and closed."> - {NUMBER_OF_TABS_CHANGED, plural, - =1 {<ph name="ONE_CHANGED">%2$d<ex>1</ex></ph> tab changed, <ph name="ANY_CLOSED">%3$d<ex>2</ex></ph> closed} - other {<ph name="MANY_CHANGED">%2$d<ex>2</ex></ph> tabs changed, <ph name="ANY_CLOSED">%3$d<ex>2</ex></ph> closed} + =1 {<ph name="ONE_ADDED">%1$d<ex>1</ex></ph> new tab, <ph name="ANY_CLOSED">%2$d<ex>2</ex></ph> closed} + other {<ph name="MANY_ADDED">%1$d<ex>2</ex></ph> new tabs, <ph name="ANY_CLOSED">%2$d<ex>2</ex></ph> closed} } </message> <message name="IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CLOSED" desc="This text shows in a message card in the TabGridDialog if there are activity updates about the state of the tab group such as tabs being added, changed, or closed. This text describes that tabs were only closed."> {NUMBER_OF_TABS_CLOSED, plural, - =1 {<ph name="ONE_CLOSED">%3$d<ex>1</ex></ph> tab closed} - other {<ph name="MANY_CLOSED">%3$d<ex>2</ex></ph> tabs closed} + =1 {<ph name="ONE_CLOSED">%2$d<ex>1</ex></ph> tab closed} + other {<ph name="MANY_CLOSED">%2$d<ex>2</ex></ph> tabs closed} } </message> @@ -1053,6 +1029,9 @@ <message name="IDS_CREATE_NEW_GROUP_ROW_TITLE" desc="Description text for an option in a bottom sheet to create a new tab group."> New tab group </message> + <message name="IDS_TAB_GROUP_LIST_WITH_ADD_BUTTON_BOTTOM_SHEET_CONTENT_DESCRIPTION" desc="The content description for the bottom sheet containing a list of tab groups and the option to create a new tab group."> + Select tab group or create new tab group + </message> <message name="IDS_TAB_GROUP_LIST_BOTTOM_SHEET_CONTENT_DESCRIPTION" desc="The content description for the bottom sheet containing a list of tab groups."> Select tab group </message>
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED.png.sha1 index ef158a01..a923a47f 100644 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED.png.sha1 +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED.png.sha1
@@ -1 +1 @@ -8f274fa72e997c068908c6c4cab721c8d1c23856 \ No newline at end of file +a8008841b26016e858c235a4400bf1c93b0b1b9d \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CHANGED.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CHANGED.png.sha1 deleted file mode 100644 index 8004d2a..0000000 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CHANGED.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -55c295589b41aced18c820e651edf1eaac147803 \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CHANGED_CLOSED.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CHANGED_CLOSED.png.sha1 deleted file mode 100644 index 3cacafed..0000000 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CHANGED_CLOSED.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -aca70df86e9bc97d2241d45bbd26216dd6599a28 \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CLOSED.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CLOSED.png.sha1 index 7349fc9..88094a0 100644 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CLOSED.png.sha1 +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_ADDED_CLOSED.png.sha1
@@ -1 +1 @@ -266fca2cfa115fe1f1267d94e492dd35e05d70a7 \ No newline at end of file +14d37572e09e0a9f86bdfbb5eccfb1b22cead10d \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CHANGED.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CHANGED.png.sha1 deleted file mode 100644 index eae5590..0000000 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CHANGED.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -a9aa901b3009c0190d8905832ffdd0d8ec8f3735 \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CHANGED_CLOSED.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CHANGED_CLOSED.png.sha1 deleted file mode 100644 index 9ebf0e1b..0000000 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CHANGED_CLOSED.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -54a81a0931e8ade44153d530e799b1e5f2e36aef \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CLOSED.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CLOSED.png.sha1 index fa4fe5a3..f453068 100644 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CLOSED.png.sha1 +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GRID_DIALOG_COLLABORATION_ACTIVITY_TABS_CLOSED.png.sha1
@@ -1 +1 @@ -3198e46c5e334430a0573ff2810c64f78f852dab \ No newline at end of file +5da727223de3e86cf2976f0d9e3f63cd1e1e586f \ 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_LIST_BOTTOM_SHEET_CONTENT_DESCRIPTION.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GROUP_LIST_BOTTOM_SHEET_CONTENT_DESCRIPTION.png.sha1 index 016450e..335cc1a 100644 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GROUP_LIST_BOTTOM_SHEET_CONTENT_DESCRIPTION.png.sha1 +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GROUP_LIST_BOTTOM_SHEET_CONTENT_DESCRIPTION.png.sha1
@@ -1 +1 @@ -b66db7c72758aee3c5544ffa9416b1d357de4ea5 \ No newline at end of file +99e159a68830d410950cc76f47983bf31e1eddf4 \ 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_LIST_WITH_ADD_BUTTON_BOTTOM_SHEET_CONTENT_DESCRIPTION.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GROUP_LIST_WITH_ADD_BUTTON_BOTTOM_SHEET_CONTENT_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..42520c4f --- /dev/null +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_TAB_GROUP_LIST_WITH_ADD_BUTTON_BOTTOM_SHEET_CONTENT_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +37e46dbf50e8b1d2cd0f525ad6ad8f00ef489e79 \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediatorUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediatorUnitTest.java index f845b0230..cf94f7a1 100644 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediatorUnitTest.java +++ b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediatorUnitTest.java
@@ -238,7 +238,7 @@ when(mServiceStatus.isAllowedToCreate()).thenReturn(true); when(mCollaborationService.getServiceStatus()).thenReturn(mServiceStatus); MessagingBackendServiceFactory.setForTesting(mMessagingBackendService); - mockPersistentMessages(/* added= */ 1, /* navigated= */ 2, /* removed= */ 3); + mockPersistentMessages(/* added= */ 1, /* navigated= */ 2, /* removed= */ 4); TrackerFactory.setTrackerForTests(mTracker); HelpAndFeedbackLauncherFactory.setInstanceForTesting(mHelpAndFeedbackLauncher); @@ -1772,10 +1772,10 @@ mModel.get(TabGridDialogProperties.SHARE_BUTTON_STRING_RES)); assertFalse(mModel.get(TabGridDialogProperties.SHOW_IMAGE_TILES)); String text = mMessageCardModelCaptor.getValue().get(DESCRIPTION_TEXT).toString(); - assertTrue(text, text.contains("3")); + assertTrue(text, text.contains("4")); reset(mDialogController); - mockPersistentMessages(/* added= */ 1, /* navigated= */ 2, /* removed= */ 4); + mockPersistentMessages(/* added= */ 1, /* navigated= */ 2, /* removed= */ 5); verify(mMessagingBackendService) .addPersistentMessageObserver(mPersistentMessageObserverCaptor.capture()); mPersistentMessageObserverCaptor @@ -1784,18 +1784,20 @@ verify(mDialogController) .addMessageCardItem(/* position= */ eq(0), mMessageCardModelCaptor.capture()); text = mMessageCardModelCaptor.getValue().get(DESCRIPTION_TEXT).toString(); - assertFalse(text, text.contains("3")); - assertTrue(text, text.contains("4")); + assertFalse(text, text.contains("4")); + assertTrue(text, text.contains("5")); reset(mDialogController); - mockPersistentMessages(/* added= */ 0, /* navigated= */ 2, /* removed= */ 4); + mockPersistentMessages(/* added= */ 0, /* navigated= */ 2, /* removed= */ 5); mPersistentMessageObserverCaptor .getValue() .hidePersistentMessage(makePersistentMessage(CollaborationEvent.TAB_ADDED)); verify(mDialogController) .addMessageCardItem(/* position= */ eq(0), mMessageCardModelCaptor.capture()); text = mMessageCardModelCaptor.getValue().get(DESCRIPTION_TEXT).toString(); - assertFalse(text, text.contains("1")); + // Shows "new" as a combination of added (1 -> 0) and navigated (2 -> 2). + assertFalse(text, text.contains("3")); + assertTrue(text, text.contains("2")); } @Test
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityEphemeralTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityEphemeralTest.java index c01d727..c9e4c07 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityEphemeralTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityEphemeralTest.java
@@ -382,6 +382,10 @@ var tab = activity.getActivityTab(); ChromeTabUtils.waitForTabPageLoaded(tab, mTestPage); + // TODO(sinansahin): Find a better way to test omnibox interactivity because titleBar is + // going to have a click listener to show page info. + if (ChromeFeatureList.sCctNestedSecurityIcon.isEnabled()) return; + var titleBar = activity.findViewById(R.id.title_url_container); Assert.assertFalse(titleBar.hasOnClickListeners()); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityRenderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityRenderTest.java index bfe31aa..52a7463 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityRenderTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityRenderTest.java
@@ -116,7 +116,7 @@ @Rule public final RenderTestRule mRenderTestRule = RenderTestRule.Builder.withPublicCorpus() - .setRevision(5) + .setRevision(6) .setBugComponent(RenderTestRule.Component.UI_BROWSER_MOBILE_CUSTOM_TABS) .build();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivitySecurityIndicatorTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivitySecurityIndicatorTest.java index 0e20739..3bb86a1 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivitySecurityIndicatorTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivitySecurityIndicatorTest.java
@@ -28,6 +28,7 @@ import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar; import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar.CustomTabLocationBar; import org.chromium.chrome.browser.firstrun.FirstRunStatus; +import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.R; @@ -85,6 +86,13 @@ ChromeTabUtils.getUrlStringOnUiThread(currentTab), is(mTestPage)); }); + if (ChromeFeatureList.sCctNestedSecurityIcon.isEnabled()) { + ImageView securityIcon = + mCustomTabActivityTestRule.getActivity().findViewById(R.id.security_icon); + Assert.assertEquals(View.INVISIBLE, securityIcon.getVisibility()); + return; + } + // Test that the security indicator is the tune icon. ImageView securityButton = mCustomTabActivityTestRule.getActivity().findViewById(R.id.security_button);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java index 6eb4cea..8339e66 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
@@ -2945,6 +2945,10 @@ @Test @MediumTest public void omniboxInCct_testNonInteractiveOmniboxWhenIntentNotEligible() { + // TODO: Find a better way to test omnibox interactivity because titleBar is going to have + // a click listener to show page info. + if (ChromeFeatureList.sCctNestedSecurityIcon.isEnabled()) return; + // By default, omnibox in CCT is not permitted and no stubbing is necessary. Intent intent = createMinimalCustomTabIntent(); mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabActivityRenderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabActivityRenderTest.java index 9a726a1..98b754ba 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabActivityRenderTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabActivityRenderTest.java
@@ -63,7 +63,7 @@ @Rule public final RenderTestRule mRenderTestRule = RenderTestRule.Builder.withPublicCorpus() - .setRevision(3) + .setRevision(4) .setBugComponent(RenderTestRule.Component.UI_BROWSER_MOBILE_CUSTOM_TABS) .build();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/TrustedCdnPublisherUrlTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/TrustedCdnPublisherUrlTest.java index c74667a0..d8257711 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/TrustedCdnPublisherUrlTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/TrustedCdnPublisherUrlTest.java
@@ -61,6 +61,7 @@ import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar; import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbar.CustomTabLocationBar; import org.chromium.chrome.browser.firstrun.FirstRunStatus; +import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.offlinepages.ClientId; import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; @@ -446,8 +447,20 @@ } private void verifySecurityIcon(int expectedSecurityIcon) { + // TODO(sinansahin): Clean up once the feature flag is removed. + boolean nestIcon = ChromeFeatureList.sCctNestedSecurityIcon.isEnabled(); + + if (nestIcon + && (expectedSecurityIcon == R.drawable.omnibox_https_valid_page_info + || expectedSecurityIcon == R.drawable.omnibox_info)) { + expectedSecurityIcon = 0; + } + ImageView securityButton = - mCustomTabActivityTestRule.getActivity().findViewById(R.id.security_button); + mCustomTabActivityTestRule + .getActivity() + .findViewById(nestIcon ? R.id.security_icon : R.id.security_button); + // Clean up -- end if (expectedSecurityIcon == 0) { Assert.assertEquals(View.INVISIBLE, securityButton.getVisibility());
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/features/branding/CustomTabBrandingTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/features/branding/CustomTabBrandingTest.java index e9bad03..fac70c5e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/features/branding/CustomTabBrandingTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/features/branding/CustomTabBrandingTest.java
@@ -52,7 +52,7 @@ @Rule public final RenderTestRule mRenderTestRule = RenderTestRule.Builder.withPublicCorpus() - .setRevision(4) + .setRevision(5) .setBugComponent(RenderTestRule.Component.UI_BROWSER_MOBILE_CUSTOM_TABS) .build();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhoneTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhoneTest.java index 823b1db5..241a377 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhoneTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhoneTest.java
@@ -60,7 +60,6 @@ import org.chromium.base.test.util.Criteria; import org.chromium.base.test.util.CriteriaHelper; import org.chromium.base.test.util.DisableIf; -import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Features.EnableFeatures; import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider.ControlsPosition; @@ -430,7 +429,6 @@ @Test @MediumTest - @DisabledTest(message = "crbug.com/1473282") public void testOptionalButton_DrawnWhenVisible() { Drawable drawable = AppCompatResources.getDrawable(
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarUnitTest.java index 557aa29..92008ef 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarUnitTest.java
@@ -232,6 +232,8 @@ @Test public void testToolbarBrandingDelegateImpl_EmptyToBranding() { + if (ChromeFeatureList.sCctNestedSecurityIcon.isEnabled()) return; + assertUrlAndTitleVisible(/* titleVisible= */ false, /* urlVisible= */ true); mLocationBar.showEmptyLocationBar(); assertUrlAndTitleVisible(/* titleVisible= */ false, /* urlVisible= */ false);
diff --git a/chrome/app/profiles_strings.grdp b/chrome/app/profiles_strings.grdp index d964e80..b30a6bc0 100644 --- a/chrome/app/profiles_strings.grdp +++ b/chrome/app/profiles_strings.grdp
@@ -1055,9 +1055,6 @@ other {Addresses ({SELECTED_ITEMS})} } </message> - <message name="IDS_BATCH_UPLOAD_SECTION_TITLE_THEMES" desc="Title of the Themes section in the Batch Upload dialog. This dialog appears when the user clicks on an informational message about items saved only to their device. The title of the dialog is ‘Save items in account’. This section title also acts as the item being selected (the section toggle dictates the state of the selection) since Themes will always have one item."> - Current color theme - </message> <message name="IDS_BATCH_UPLOAD_SECTION_TITLE_THEMES_WITH_DESCRIPTION" desc="Title of the Themes section in the Batch Upload dialog. It contains a fixed title in addition to its only item title description. This dialog appears when the user clicks on an informational message about items saved only to their device. The title of the dialog is ‘Save items in account’. This section title also acts as the item being selected (the section toggle dictates the state of the selection) since Themes will always have one item."> Theme: <ph name="THEME_NAME">$1<ex>Green color</ex></ph> </message>
diff --git a/chrome/app/profiles_strings_grdp/IDS_BATCH_UPLOAD_SECTION_TITLE_THEMES.png.sha1 b/chrome/app/profiles_strings_grdp/IDS_BATCH_UPLOAD_SECTION_TITLE_THEMES.png.sha1 deleted file mode 100644 index c65c3792..0000000 --- a/chrome/app/profiles_strings_grdp/IDS_BATCH_UPLOAD_SECTION_TITLE_THEMES.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -14c7443cfd95ae58e3ba9b24c093a11c12337c79 \ No newline at end of file
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index eea24375..79b538d9 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -1690,10 +1690,14 @@ "webapps/installable/installable_utils.h", "webapps/web_app_offline.cc", "webapps/web_app_offline.h", + "webauthn/chrome_web_authentication_delegate_base.cc", + "webauthn/chrome_web_authentication_delegate_base.h", "webauthn/webauthn_metrics_util.cc", "webauthn/webauthn_metrics_util.h", "webauthn/webauthn_pref_names.cc", "webauthn/webauthn_pref_names.h", + "webauthn/webauthn_switches.cc", + "webauthn/webauthn_switches.h", "webdata_services/web_data_service_factory.cc", "webdata_services/web_data_service_factory.h", "webid/federated_identity_account_keyed_permission_context.cc", @@ -4219,8 +4223,6 @@ "webauthn/password_credential_controller_impl.h", "webauthn/unexportable_key_utils.cc", "webauthn/unexportable_key_utils.h", - "webauthn/webauthn_switches.cc", - "webauthn/webauthn_switches.h", ] #!is_android
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index d1e80dc..9e97a74a 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -2629,6 +2629,17 @@ std::size(kAndroidAppIntegrationModule_ForceCardShown_NonPixel), nullptr}}; +const FeatureEntry::FeatureParam + kAndroidAppIntegrationMultiDataSource_UseSchemaV1[] = { + {"use_schema_v1", "true"}}; + +const FeatureEntry::FeatureVariation + kAndroidAppIntegrationMultiDataSourceVariations[] = { + {"Force to use schema v1", + kAndroidAppIntegrationMultiDataSource_UseSchemaV1, + std::size(kAndroidAppIntegrationMultiDataSource_UseSchemaV1), + nullptr}}; + const FeatureEntry::FeatureParam kAuxiliarySearchDonation_MaxDonation_20[] = { {chrome::android::kAuxiliarySearchMaxBookmarksCountParam.name, "20"}, {chrome::android::kAuxiliarySearchMaxTabsCountParam.name, "20"}}; @@ -4367,6 +4378,24 @@ }; #endif // BUILDFLAG(IS_ANDROID) +const FeatureEntry::FeatureParam + kStandardBoundSessionCredentialsEnabledNoOriginTrialToken[] = { + {"ForceEnableForTesting", "true"}}; +const FeatureEntry::FeatureParam + kStandardBoundSessionCredentialsEnabledOriginTrialToken[] = { + {"ForceEnableForTesting", "false"}}; + +const FeatureEntry::FeatureVariation + kStandardBoundSessionCredentialsVariations[] = { + {"- Without Origin Trial tokens", + kStandardBoundSessionCredentialsEnabledNoOriginTrialToken, + std::size(kStandardBoundSessionCredentialsEnabledNoOriginTrialToken), + nullptr}, + {"- With Origin Trial tokens", + kStandardBoundSessionCredentialsEnabledOriginTrialToken, + std::size(kStandardBoundSessionCredentialsEnabledOriginTrialToken), + nullptr}}; + // RECORDING USER METRICS FOR FLAGS: // ----------------------------------------------------------------------------- // The first line of the entry is the internal name. @@ -6271,8 +6300,10 @@ flag_descriptions::kAndroidAppIntegrationMultiDataSourceName, flag_descriptions::kAndroidAppIntegrationMultiDataSourceDescription, kOsAndroid, - FEATURE_VALUE_TYPE( - chrome::android::kAndroidAppIntegrationMultiDataSource)}, + FEATURE_WITH_PARAMS_VALUE_TYPE( + chrome::android::kAndroidAppIntegrationMultiDataSource, + kAndroidAppIntegrationMultiDataSourceVariations, + "AndroidAppIntegrationMultiDataSource")}, {"android-app-integration-v2", flag_descriptions::kAndroidAppIntegrationV2Name, @@ -10558,12 +10589,19 @@ flag_descriptions::kEnableStandardBoundSessionCredentialsName, flag_descriptions::kEnableStandardBoundSessionCredentialsDescription, kOsMac | kOsWin | kOsLinux, - FEATURE_VALUE_TYPE(net::features::kDeviceBoundSessions)}, + FEATURE_WITH_PARAMS_VALUE_TYPE(net::features::kDeviceBoundSessions, + kStandardBoundSessionCredentialsVariations, + "standard-device-bound-sessions")}, {"enable-standard-device-bound-session-persistence", flag_descriptions::kEnableStandardBoundSessionPersistenceName, flag_descriptions::kEnableStandardBoundSessionPersistenceDescription, kOsMac | kOsWin | kOsLinux, FEATURE_VALUE_TYPE(net::features::kPersistDeviceBoundSessions)}, + {"enable-standard-device-bound-sesssion-refresh-quota", + flag_descriptions::kEnableStandardBoundSessionRefreshQuotaName, + flag_descriptions::kEnableStandardBoundSessionRefreshQuotaDescription, + kOsMac | kOsWin | kOsLinux, + FEATURE_VALUE_TYPE(net::features::kDeviceBoundSessionsRefreshQuota)}, #if BUILDFLAG(IS_CHROMEOS) {"cros-soul-gd", flag_descriptions::kCrosSoulGravediggerName, @@ -10619,11 +10657,6 @@ password_manager::features::kShowSuggestionsOnAutofocus)}, #if BUILDFLAG(IS_ANDROID) - {"fetch-gaia-hash-on-sign-in", - flag_descriptions::kFetchGaiaHashOnSignInName, - flag_descriptions::kFetchGaiaHashOnSignInDescription, kOsAndroid, - FEATURE_VALUE_TYPE(password_manager::features::kFetchGaiaHashOnSignIn)}, - {"android-browser-controls-in-viz", flag_descriptions::kAndroidBrowserControlsInVizName, flag_descriptions::kAndroidBrowserControlsInVizDescription, kOsAndroid, @@ -11730,11 +11763,6 @@ flag_descriptions::kPrivacySandboxAdTopicsContentParityDescription, kOsAll, FEATURE_VALUE_TYPE(privacy_sandbox::kPrivacySandboxAdTopicsContentParity)}, - {"autofill-enable-card-expired-text", - flag_descriptions::kAutofillEnableCardExpiredTextName, - flag_descriptions::kAutofillEnableCardExpiredTextDescription, kOsAll, - FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCardExpiredText)}, - #if BUILDFLAG(IS_ANDROID) {"enable-android-mininal-ui-large-screen", flag_descriptions::kAndroidMinimalUiLargeScreenName,
diff --git a/chrome/browser/ash/arc/auth/arc_robot_auth_code_fetcher_browsertest.cc b/chrome/browser/ash/arc/auth/arc_robot_auth_code_fetcher_browsertest.cc index 8152676b..efc89c3 100644 --- a/chrome/browser/ash/arc/auth/arc_robot_auth_code_fetcher_browsertest.cc +++ b/chrome/browser/ash/arc/auth/arc_robot_auth_code_fetcher_browsertest.cc
@@ -136,8 +136,8 @@ private: // Logs in as a public account user. - ash::PublicAccountLoggedInBrowserTestMixin logged_in_mixin_{ - &mixin_host_, "example@public-accounts.device-local.localhost"}; + ash::PublicAccountLoggedInBrowserTestMixin logged_in_mixin_{&mixin_host_, + "public-account"}; // Whether to connect the CloudPolicyClient. CloudPolicyClientSetup cloud_policy_client_setup_;
diff --git a/chrome/browser/ash/crostini/BUILD.gn b/chrome/browser/ash/crostini/BUILD.gn index ac409b54..4465384 100644 --- a/chrome/browser/ash/crostini/BUILD.gn +++ b/chrome/browser/ash/crostini/BUILD.gn
@@ -14,6 +14,8 @@ static_library("crostini") { sources = [ + "baguette_installer.cc", + "baguette_installer.h", "crostini_disk.cc", "crostini_disk.h", "crostini_export_import.cc",
diff --git a/chrome/browser/ash/crostini/baguette_installer.cc b/chrome/browser/ash/crostini/baguette_installer.cc new file mode 100644 index 0000000..d273a8f --- /dev/null +++ b/chrome/browser/ash/crostini/baguette_installer.cc
@@ -0,0 +1,91 @@ +// Copyright 2025 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/crostini/baguette_installer.h" + +#include <algorithm> +#include <memory> + +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/functional/bind.h" +#include "base/functional/callback.h" +#include "base/functional/callback_forward.h" +#include "base/functional/callback_helpers.h" +#include "base/location.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 "base/threading/thread_restrictions.h" +#include "chrome/browser/ash/crostini/crostini_util.h" +#include "chrome/browser/ash/guest_os/guest_os_dlc_helper.h" + +namespace crostini { + +BaguetteInstaller::BaguetteInstaller() = default; +BaguetteInstaller::~BaguetteInstaller() = default; + +void BaguetteInstaller::Install( + base::OnceCallback<void(InstallResult)> callback) { + installations_.push_back(std::make_unique<guest_os::GuestOsDlcInstallation>( + kToolsDlcName, + base::BindOnce(&BaguetteInstaller::OnInstallDlc, + weak_ptr_factory_.GetWeakPtr(), std::move(callback)), + base::DoNothing())); +} + +void BaguetteInstaller::OnInstallDlc( + base::OnceCallback<void(InstallResult)> callback, + guest_os::GuestOsDlcInstallation::Result result) { + InstallResult response = + result + .transform_error( + [](guest_os::GuestOsDlcInstallation::Error err) { + switch (err) { + case guest_os::GuestOsDlcInstallation::Error::Cancelled: + return InstallResult::Cancelled; + case guest_os::GuestOsDlcInstallation::Error::Offline: + LOG(ERROR) << "Failed to install termina-tools-dlc while " + "offline, assuming " + "network issue."; + return InstallResult::Offline; + case guest_os::GuestOsDlcInstallation::Error::NeedUpdate: + case guest_os::GuestOsDlcInstallation::Error::NeedReboot: + LOG(ERROR) + << "Failed to install termina-tools-dlc because the OS " + "must be updated"; + return InstallResult::NeedUpdate; + case guest_os::GuestOsDlcInstallation::Error::DiskFull: + case guest_os::GuestOsDlcInstallation::Error::Busy: + case guest_os::GuestOsDlcInstallation::Error::Internal: + case guest_os::GuestOsDlcInstallation::Error::Invalid: + case guest_os::GuestOsDlcInstallation::Error::UnknownFailure: + LOG(ERROR) + << "Failed to install termina-tools-dlc: " << err; + return InstallResult::Failure; + } + }) + .error_or(InstallResult::Success); + + if (response == InstallResult::Success) { + // This will eventually download the image from a storage bucket, but for + // now we know it should be located in MyFiles/Downloads + base::ThreadPool::PostTaskAndReplyWithResult( + FROM_HERE, {base::MayBlock()}, base::BindOnce([]() { + // check for file existence + if (!base::PathExists(base::FilePath(kBaguettePath))) { + LOG(ERROR) << "Couldn't find " << kBaguettePath; + return InstallResult::Failure; + } + return InstallResult::Success; + }), + std::move(callback)); + + } else { + std::move(callback).Run(response); + } +} + +} // namespace crostini
diff --git a/chrome/browser/ash/crostini/baguette_installer.h b/chrome/browser/ash/crostini/baguette_installer.h new file mode 100644 index 0000000..fbe77ac2 --- /dev/null +++ b/chrome/browser/ash/crostini/baguette_installer.h
@@ -0,0 +1,59 @@ +// Copyright 2025 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_CROSTINI_BAGUETTE_INSTALLER_H_ +#define CHROME_BROWSER_ASH_CROSTINI_BAGUETTE_INSTALLER_H_ + +#include <memory> +#include <vector> + +#include "base/functional/callback_forward.h" +#include "base/memory/weak_ptr.h" +#include "chrome/browser/ash/guest_os/guest_os_dlc_helper.h" + +// TODO(crbug.com/377377749): add downloader which grabs image file from GS +// bucket based on VERSION-PIN +inline constexpr char kBaguettePath[] = + "/home/chronos/user/MyFiles/Downloads/baguette.img.zst"; + +namespace crostini { + +// This class is responsible for managing (un)instatllation of Baguette - the +// containerless Crostini VM. +class BaguetteInstaller { + public: + BaguetteInstaller(); + ~BaguetteInstaller(); + + BaguetteInstaller(const BaguetteInstaller&) = delete; + BaguetteInstaller& operator=(const BaguetteInstaller&) = delete; + + enum class InstallResult { + // The install succeeded. + Success, + // The install failed for an unspecified reason. + Failure, + // The install failed because it needed to download an image and the device + // is offline. + Offline, + // The device must be updated before termina can be installed. + NeedUpdate, + // The install request was cancelled. + Cancelled, + }; + + void Install(base::OnceCallback<void(InstallResult)> callback); + + private: + void OnInstallDlc(base::OnceCallback<void(InstallResult)> callback, + guest_os::GuestOsDlcInstallation::Result result); + + std::vector<std::unique_ptr<guest_os::GuestOsDlcInstallation>> installations_; + + base::WeakPtrFactory<BaguetteInstaller> weak_ptr_factory_{this}; +}; + +} // namespace crostini + +#endif // CHROME_BROWSER_ASH_CROSTINI_BAGUETTE_INSTALLER_H_
diff --git a/chrome/browser/ash/crostini/crostini_installer.cc b/chrome/browser/ash/crostini/crostini_installer.cc index 0320d01..9de56bf1 100644 --- a/chrome/browser/ash/crostini/crostini_installer.cc +++ b/chrome/browser/ash/crostini/crostini_installer.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include <string> +#include "ash/constants/ash_features.h" #include "base/functional/bind.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" @@ -20,6 +21,7 @@ #include "chrome/browser/ash/crostini/crostini_pref_names.h" #include "chrome/browser/ash/crostini/crostini_types.mojom.h" #include "chrome/browser/ash/crostini/crostini_util.h" +#include "chrome/browser/ash/guest_os/guest_id.h" #include "chrome/browser/ash/guest_os/guest_os_terminal.h" #include "chrome/browser/ash/login/startup_utils.h" #include "chrome/browser/profiles/profile.h" @@ -528,8 +530,14 @@ if (!skip_launching_terminal_for_testing_) { // kInvalidDisplayId will launch terminal on the current active display. + const guest_os::GuestId* container_id; + if (base::FeatureList::IsEnabled(ash::features::kCrostiniContainerless)) { + container_id = &crostini::DefaultBaguetteContainerId(); + } else { + container_id = &crostini::DefaultContainerId(); + } guest_os::LaunchTerminal(profile_, display::kInvalidDisplayId, - crostini::DefaultContainerId()); + *container_id); } } @@ -566,11 +574,17 @@ UpdateInstallingState(InstallerState::kInstallImageLoader); - // Kick off the Crostini Restart sequence. We will be added as an observer. + const guest_os::GuestId* container_id; + if (base::FeatureList::IsEnabled(ash::features::kCrostiniContainerless)) { + container_id = &crostini::DefaultBaguetteContainerId(); + } else { + container_id = &crostini::DefaultContainerId(); + } + restart_id_ = crostini::CrostiniManager::GetForProfile(profile_) ->RestartCrostiniWithOptions( - crostini::DefaultContainerId(), std::move(restart_options_), + *container_id, std::move(restart_options_), base::BindOnce(&CrostiniInstaller::OnCrostiniRestartFinished, weak_ptr_factory_.GetWeakPtr()), this);
diff --git a/chrome/browser/ash/crostini/crostini_manager.cc b/chrome/browser/ash/crostini/crostini_manager.cc index 678fc31..332c0f9b 100644 --- a/chrome/browser/ash/crostini/crostini_manager.cc +++ b/chrome/browser/ash/crostini/crostini_manager.cc
@@ -26,7 +26,9 @@ #include "base/strings/string_split.h" #include "base/strings/stringprintf.h" #include "base/system/sys_info.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 "base/time/clock.h" #include "base/time/default_clock.h" @@ -37,6 +39,7 @@ #include "chrome/browser/ash/bruschetta/bruschetta_util.h" #include "chrome/browser/ash/crostini/ansible/ansible_management_service.h" #include "chrome/browser/ash/crostini/ansible/ansible_management_service_factory.h" +#include "chrome/browser/ash/crostini/baguette_installer.h" #include "chrome/browser/ash/crostini/crostini_features.h" #include "chrome/browser/ash/crostini/crostini_manager_factory.h" #include "chrome/browser/ash/crostini/crostini_metrics_service.h" @@ -294,6 +297,8 @@ // Public function - Restart(); void ContinueRestart(); void LoadComponentFinished(CrostiniResult result); + void OnBaguetteLoaded(CrostiniResult result); + void CreateDiskImageFinished(int64_t disk_size_bytes, CrostiniResult result, const base::FilePath& result_path); @@ -303,6 +308,7 @@ void StartTerminaVmFinished(bool success); void SharePathsFinished(bool success, const std::string& failure_reason); void StartLxdFinished(CrostiniResult result); + void SetUpBaguetteUserFinished(CrostiniResult result); void CreateLxdContainerFinished(CrostiniResult result); void SetUpLxdContainerUserFinished(bool success); // Public function - StartLxdContainerFinished(CrostiniResult result); @@ -593,6 +599,7 @@ // are finished. Because the session tracker update and this method are racing // on the same thread we do the update async once the session tracker is // ready. + // TODO(crbug.com/377377749): might still need to do this for baguette? if (container_id_ == DefaultContainerId()) { crostini_manager_->primary_counter_mount_subscription_ = guest_os::GuestOsSessionTrackerFactory::GetForProfile(profile_) @@ -692,9 +699,17 @@ } StartStage(mojom::InstallerState::kInstallImageLoader); - crostini_manager_->InstallTermina( - base::BindOnce(&CrostiniRestarter::LoadComponentFinished, - weak_ptr_factory_.GetWeakPtr())); + if (base::FeatureList::IsEnabled(ash::features::kCrostiniContainerless)) { + // TODO(crbug.com/377377749): do we need to check for existence of any + // previous installs here, or has that already happened? + crostini_manager_->InstallBaguette( + base::BindOnce(&CrostiniRestarter::LoadComponentFinished, + weak_ptr_factory_.GetWeakPtr())); + } else { + crostini_manager_->InstallTermina( + base::BindOnce(&CrostiniRestarter::LoadComponentFinished, + weak_ptr_factory_.GetWeakPtr())); + } } void CrostiniManager::CrostiniRestarter::LoadComponentFinished( @@ -867,11 +882,22 @@ if (!success) { LOG(WARNING) << "Failed to share paths: " << failure_reason; } - StartStage(mojom::InstallerState::kStartLxd); - crostini_manager_->StartLxd( - container_id_.vm_name, - base::BindOnce(&CrostiniRestarter::StartLxdFinished, - weak_ptr_factory_.GetWeakPtr())); + if (base::FeatureList::IsEnabled(ash::features::kCrostiniContainerless)) { + StartStage(mojom::InstallerState::kConfigureContainer); + // TODO(crbug.com/377377749): eventually username should come from + // requests_[0].options.container_username once vsh knows how to connect to + // the right username + crostini_manager_->SetUpBaguetteUser( + container_id_.vm_name, "chronos", + base::BindOnce(&CrostiniRestarter::SetUpBaguetteUserFinished, + weak_ptr_factory_.GetWeakPtr())); + } else { + StartStage(mojom::InstallerState::kStartLxd); + crostini_manager_->StartLxd( + container_id_.vm_name, + base::BindOnce(&CrostiniRestarter::StartLxdFinished, + weak_ptr_factory_.GetWeakPtr())); + } } void CrostiniManager::CrostiniRestarter::StartLxdFinished( @@ -902,6 +928,16 @@ weak_ptr_factory_.GetWeakPtr())); } +void CrostiniManager::CrostiniRestarter::SetUpBaguetteUserFinished( + CrostiniResult result) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + if (ReturnEarlyIfNeeded()) { + return; + } + + FinishRestart(result); +} + void CrostiniManager::CrostiniRestarter::CreateLxdContainerFinished( CrostiniResult result) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -1424,6 +1460,39 @@ } } +void CrostiniManager::InstallBaguette(CrostiniResultCallback callback) { + if (install_baguette_never_completes_for_testing_) { + LOG(ERROR) + << "Dropping InstallBaguette request. This is only used in tests."; + return; + } + baguette_installer_.Install(base::BindOnce( + [](CrostiniResultCallback callback, + BaguetteInstaller::InstallResult result) { + CrostiniResult res; + if (result == BaguetteInstaller::InstallResult::Success) { + res = CrostiniResult::SUCCESS; + } else if (result == BaguetteInstaller::InstallResult::Offline) { + LOG(ERROR) << "Installing Baguette failed: offline"; + res = CrostiniResult::OFFLINE_WHEN_UPGRADE_REQUIRED; + } else if (result == BaguetteInstaller::InstallResult::Failure) { + LOG(ERROR) << "Installing Baguette failed"; + res = CrostiniResult::LOAD_COMPONENT_FAILED; + } else if (result == BaguetteInstaller::InstallResult::NeedUpdate) { + LOG(ERROR) << "Installing Baguette failed: need update"; + res = CrostiniResult::NEED_UPDATE; + } else if (result == BaguetteInstaller::InstallResult::Cancelled) { + LOG(ERROR) << "Installing Baguette failed: cancelled"; + res = CrostiniResult::INSTALL_BAGUETTE_CANCELLED; + } else { + NOTREACHED() + << "Got unexpected value of BaguetteInstaller::InstallResult"; + } + std::move(callback).Run(res); + }, + std::move(callback))); +} + void CrostiniManager::InstallTermina(CrostiniResultCallback callback) { if (install_termina_never_completes_for_testing_) { LOG(ERROR) @@ -1492,10 +1561,36 @@ // The logical size of the new disk image, in bytes. request.set_disk_size(std::move(disk_size_bytes)); - GetConciergeClient()->CreateDiskImage( - std::move(request), - base::BindOnce(&CrostiniManager::OnCreateDiskImage, - weak_ptr_factory_.GetWeakPtr(), std::move(callback))); + if (base::FeatureList::IsEnabled(ash::features::kCrostiniContainerless)) { + request.set_copy_baguette_image(true); + auto cb = base::BindPostTaskToCurrentDefault( + base::BindOnce(&CrostiniManager::OnCreateDiskImage, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); + + // Blocking calls may not be made from the main thread, but dbus calls + // *MUST* be made from the main thread, so we have to get a bit creative + // with our function routing here. + base::ThreadPool::PostTaskAndReplyWithResult( + FROM_HERE, {base::MayBlock()}, base::BindOnce([]() { + return base::File(base::FilePath(kBaguettePath), + base::File::FLAG_OPEN | base::File::FLAG_READ); + }), + base::BindOnce( + [](vm_tools::concierge::CreateDiskImageRequest request, + chromeos::DBusMethodCallback< + vm_tools::concierge::CreateDiskImageResponse> cb, + base::File source_disk) { + GetConciergeClient()->CreateDiskImageWithFd( + base::ScopedFD(source_disk.TakePlatformFile()), + std::move(request), std::move(cb)); + }, + std::move(request), std::move(cb))); + } else { + GetConciergeClient()->CreateDiskImage( + std::move(request), + base::BindOnce(&CrostiniManager::OnCreateDiskImage, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); + } } void CrostiniManager::StartTerminaVm(std::string name, @@ -1528,12 +1623,20 @@ } vm_tools::concierge::StartVmRequest request; - std::optional<std::string> dlc_id = termina_installer_.GetDlcId(); - if (dlc_id.has_value()) { - request.mutable_vm()->set_dlc_id(*dlc_id); + if (base::FeatureList::IsEnabled(ash::features::kCrostiniContainerless)) { + request.mutable_vm()->set_tools_dlc_id(kToolsDlcName); + request.set_vm_type( + ::vm_tools::concierge::VmInfo_VmType::VmInfo_VmType_BAGUETTE); + } else { + std::optional<std::string> dlc_id = termina_installer_.GetDlcId(); + if (dlc_id.has_value()) { + request.mutable_vm()->set_dlc_id(*dlc_id); + } } request.set_name(std::move(name)); - request.set_start_termina(true); + if (!base::FeatureList::IsEnabled(ash::features::kCrostiniContainerless)) { + request.set_start_termina(true); + } request.set_owner_id(owner_id_); request.set_timeout(static_cast<uint32_t>(kStartVmTimeout.InSeconds())); if (base::FeatureList::IsEnabled(ash::features::kCrostiniGpuSupport)) { @@ -1549,7 +1652,11 @@ vm_tools::concierge::DiskImage* disk_image = request.add_disks(); disk_image->set_path(std::move(disk_path_string)); - disk_image->set_image_type(vm_tools::concierge::DISK_IMAGE_AUTO); + if (base::FeatureList::IsEnabled(ash::features::kCrostiniContainerless)) { + disk_image->set_image_type(vm_tools::concierge::DISK_IMAGE_RAW); + } else { + disk_image->set_image_type(vm_tools::concierge::DISK_IMAGE_AUTO); + } disk_image->set_writable(true); disk_image->set_do_mount(false); @@ -1644,6 +1751,36 @@ std::move(callback))); } +void CrostiniManager::SetUpBaguetteUser( + std::string vm_name, + std::optional<std::string> container_username, + CrostiniResultCallback callback) { + if (vm_name.empty()) { + LOG(ERROR) << "vm_name is required"; + std::move(callback).Run(CrostiniResult::CLIENT_ERROR); + return; + } + + std::string username = + container_username.value_or(DefaultContainerUserNameForProfile(profile_)); + vm_tools::concierge::SetUpVmUserRequest request; + request.set_vm_name(vm_name); + request.set_owner_id(owner_id_); + request.set_username(username); + request.add_group_names("cdrom"); + request.add_group_names("dialout"); + request.add_group_names("floppy"); + request.add_group_names("netdev"); + request.add_group_names("sudo"); + request.add_group_names("tss"); + request.add_group_names("video"); + + GetConciergeClient()->SetUpVmUser( + std::move(request), + base::BindOnce(&CrostiniManager::OnSetUpBaguetteUser, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); +} + namespace { std::string GetImageServer() { @@ -2517,6 +2654,7 @@ create_options.stop_after_lxd_available = options.stop_after_lxd_available; bool obsolete_create_options = true; + // TODO(crbug.com/377377749) dont need this for baguette? AddNewLxdContainerToPrefs(profile_, container_id); RegisterContainer(container_id); if (!RegisterCreateOptions(container_id, options)) { @@ -3175,6 +3313,24 @@ } } +void CrostiniManager::OnSetUpBaguetteUser( + CrostiniResultCallback callback, + std::optional<vm_tools::concierge::SetUpVmUserResponse> response) { + if (!response) { + LOG(ERROR) << "Failed to set up user in vm. Empty response."; + std::move(callback).Run(CrostiniResult::CONTAINER_SETUP_FAILED); + return; + } + + if (response->success()) { + std::move(callback).Run(CrostiniResult::SUCCESS); + } else { + LOG(ERROR) << "Failed to set up baguette user: " + << response->failure_reason(); + std::move(callback).Run(CrostiniResult::CONTAINER_SETUP_FAILED); + } +} + void CrostiniManager::OnCreateLxdContainer( const guest_os::GuestId& container_id, CrostiniResultCallback callback,
diff --git a/chrome/browser/ash/crostini/crostini_manager.h b/chrome/browser/ash/crostini/crostini_manager.h index b2b0761..6388eee 100644 --- a/chrome/browser/ash/crostini/crostini_manager.h +++ b/chrome/browser/ash/crostini/crostini_manager.h
@@ -21,6 +21,7 @@ #include "base/scoped_observation_traits.h" #include "base/time/time.h" #include "base/unguessable_token.h" +#include "chrome/browser/ash/crostini/baguette_installer.h" #include "chrome/browser/ash/crostini/crostini_low_disk_notification.h" #include "chrome/browser/ash/crostini/crostini_simple_types.h" #include "chrome/browser/ash/crostini/crostini_types.mojom-forward.h" @@ -236,6 +237,9 @@ // Installs termina using the DLC service. void InstallTermina(CrostiniResultCallback callback); + // Installs baguette using GS downloader or local file. + void InstallBaguette(CrostiniResultCallback callback); + // Try to cancel a previous InstallTermina call. This is done on a best-effort // basis. The callback passed to InstallTermina is still run upon completion. void CancelInstallTermina(); @@ -292,6 +296,12 @@ // been started. void StartLxd(std::string vm_name, CrostiniResultCallback callback); + // Wrapper for ConciergeClient::SetUpVmUser + // |callback| is called immediately if the arguments are bad. + void SetUpBaguetteUser(std::string vm_name, + std::optional<std::string> container_username, + CrostiniResultCallback callback); + // Checks the arguments for creating an Lxd container via // CiceroneClient::CreateLxdContainer. |callback| is called immediately if the // arguments are bad, or once the container has been created. @@ -708,6 +718,11 @@ CrostiniResultCallback callback, std::optional<vm_tools::cicerone::StartLxdResponse> response); + // Callback for ConciergeClient::SetUpVmUser. + void OnSetUpBaguetteUser( + CrostiniResultCallback callback, + std::optional<vm_tools::concierge::SetUpVmUserResponse> response); + // Callback for ConciergeClient::ExportDiskImage. Called after the Concierge // service method finishes. void OnExportDiskImage( @@ -982,8 +997,10 @@ upgrade_available_notification_; TerminaInstaller termina_installer_; + BaguetteInstaller baguette_installer_; bool install_termina_never_completes_for_testing_ = false; + bool install_baguette_never_completes_for_testing_ = false; std::unique_ptr<CrostiniSshfs> crostini_sshfs_;
diff --git a/chrome/browser/ash/crostini/crostini_simple_types.cc b/chrome/browser/ash/crostini/crostini_simple_types.cc index 4cb6b10..6058c285d 100644 --- a/chrome/browser/ash/crostini/crostini_simple_types.cc +++ b/chrome/browser/ash/crostini/crostini_simple_types.cc
@@ -86,6 +86,9 @@ ENTRY(SIGNAL_NOT_CONNECTED); ENTRY(INSTALL_TERMINA_CANCELLED); ENTRY(START_TIMED_OUT); + ENTRY(START_BAGUETTE_VM_TIMED_OUT); + ENTRY(UNINSTALL_BAGUETTE_FAILED); + ENTRY(INSTALL_BAGUETTE_CANCELLED); } #undef ENTRY return "unknown code";
diff --git a/chrome/browser/ash/crostini/crostini_simple_types.h b/chrome/browser/ash/crostini/crostini_simple_types.h index 6d3742a1..34fc1565 100644 --- a/chrome/browser/ash/crostini/crostini_simple_types.h +++ b/chrome/browser/ash/crostini/crostini_simple_types.h
@@ -117,7 +117,10 @@ DISK_IMAGE_FAILED = 82, DISK_IMAGE_FAILED_NO_SPACE = 83, DISK_IMAGE_CANCELLED = 84, - kMaxValue = DISK_IMAGE_CANCELLED, + START_BAGUETTE_VM_TIMED_OUT = 85, + UNINSTALL_BAGUETTE_FAILED = 86, + INSTALL_BAGUETTE_CANCELLED = 87, + kMaxValue = INSTALL_BAGUETTE_CANCELLED, // When adding a new value, check you've followed the steps in the comment at // the top of this enum. };
diff --git a/chrome/browser/ash/crostini/crostini_util.cc b/chrome/browser/ash/crostini/crostini_util.cc index d8afa97..636de8fe 100644 --- a/chrome/browser/ash/crostini/crostini_util.cc +++ b/chrome/browser/ash/crostini/crostini_util.cc
@@ -53,6 +53,8 @@ namespace crostini { namespace { +// Keep 'penguin' terminal label for backwards-consistent appearance. +constexpr char kBaguetteTerminalLabel[] = "penguin"; constexpr char kCrostiniAppLaunchHistogram[] = "Crostini.AppLaunch"; constexpr char kCrostiniAppLaunchResultHistogram[] = "Crostini.AppLaunchResult"; constexpr char kCrostiniAppLaunchResultHistogramTerminal[] = @@ -451,6 +453,12 @@ return *container_id; } +const guest_os::GuestId& DefaultBaguetteContainerId() { + static const base::NoDestructor<guest_os::GuestId> container_id( + kBaguetteDefaultVmType, kCrostiniDefaultVmName, ""); + return *container_id; +} + bool IsCrostiniWindow(const aura::Window* window) { // TODO(crbug/1158644): Non-Crostini apps (borealis, ...) have also been // identifying as Crostini. For now they're less common, and as they become @@ -503,6 +511,10 @@ std::string FormatForUi(guest_os::GuestId guest_id) { if (guest_id.vm_name == kCrostiniDefaultVmName) { + if (guest_id.container_name.empty()) { + // containerless crostini, aka baguette + return kBaguetteTerminalLabel; + } return guest_id.container_name; } return base::StrCat({guest_id.vm_name, ":", guest_id.container_name});
diff --git a/chrome/browser/ash/crostini/crostini_util.h b/chrome/browser/ash/crostini/crostini_util.h index 0585ce1..4d0e888 100644 --- a/chrome/browser/ash/crostini/crostini_util.h +++ b/chrome/browser/ash/crostini/crostini_util.h
@@ -39,12 +39,15 @@ inline constexpr guest_os::VmType kCrostiniDefaultVmType = guest_os::VmType::TERMINA; +inline constexpr guest_os::VmType kBaguetteDefaultVmType = + guest_os::VmType::BAGUETTE; inline constexpr char kCrostiniDefaultVmName[] = "termina"; inline constexpr char kCrostiniDefaultContainerName[] = "penguin"; inline constexpr char kCrostiniDefaultUsername[] = "emperor"; inline constexpr char kCrostiniDefaultImageServerUrl[] = "https://storage.googleapis.com/cros-containers/%d"; inline constexpr char kCrostiniDlcName[] = "termina-dlc"; +inline constexpr char kToolsDlcName[] = "termina-tools-dlc"; inline constexpr base::FilePath::CharType kHomeDirectory[] = FILE_PATH_LITERAL("/home/chronos/user"); @@ -141,6 +144,7 @@ const guest_os::GuestId& container_id); const guest_os::GuestId& DefaultContainerId(); +const guest_os::GuestId& DefaultBaguetteContainerId(); bool IsCrostiniWindow(const aura::Window* window);
diff --git a/chrome/browser/ash/login/enrollment/auto_enrollment_check_screen.cc b/chrome/browser/ash/login/enrollment/auto_enrollment_check_screen.cc index 1bc88123..a6a0a7b 100644 --- a/chrome/browser/ash/login/enrollment/auto_enrollment_check_screen.cc +++ b/chrome/browser/ash/login/enrollment/auto_enrollment_check_screen.cc
@@ -304,20 +304,9 @@ } bool AutoEnrollmentCheckScreen::ShouldBlockOnServerError() const { - using CheckType = policy::AutoEnrollmentTypeChecker::CheckType; - switch (auto_enrollment_controller_->auto_enrollment_check_type()) { - case CheckType::kForcedReEnrollmentImplicitlyRequired: - // Auto-enrollment is implicitly required so we don't block in server - // errors. - return false; - case CheckType::kForcedReEnrollmentExplicitlyRequired: - case CheckType::kInitialStateDetermination: - // Auto-enrollment is explicitly required so we block on server errors. - return true; - case CheckType::kUnknownDueToMissingSystemClockSync: - case CheckType::kNone: - NOTREACHED(); - } + // TODO(rbug.com/383047722) Replace calls to this function with `true` and + // clean up accordingly. + return true; } } // namespace ash
diff --git a/chrome/browser/ash/login/wizard_controller_browsertest.cc b/chrome/browser/ash/login/wizard_controller_browsertest.cc index e697cdee..4e0dece 100644 --- a/chrome/browser/ash/login/wizard_controller_browsertest.cc +++ b/chrome/browser/ash/login/wizard_controller_browsertest.cc
@@ -1207,9 +1207,6 @@ EXPECT_CALL(*mock_enrollment_screen_, HideImpl()).Times(0); EXPECT_EQ(policy::AutoEnrollmentResult::kNoEnrollment, auto_enrollment_controller()->state()); - EXPECT_EQ(policy::AutoEnrollmentTypeChecker::CheckType:: - kForcedReEnrollmentExplicitlyRequired, - auto_enrollment_controller()->auto_enrollment_check_type()); } // Tests that when EnrollmentStateFetcher reports state keys retrieval error, we
diff --git a/chrome/browser/ash/policy/enrollment/BUILD.gn b/chrome/browser/ash/policy/enrollment/BUILD.gn index 21c1e56..f4b353a7 100644 --- a/chrome/browser/ash/policy/enrollment/BUILD.gn +++ b/chrome/browser/ash/policy/enrollment/BUILD.gn
@@ -10,15 +10,10 @@ sources = [ "account_status_check_fetcher.cc", "account_status_check_fetcher.h", - "auto_enrollment_client.h", - "auto_enrollment_client_impl.cc", - "auto_enrollment_client_impl.h", "auto_enrollment_controller.cc", "auto_enrollment_controller.h", "auto_enrollment_state.cc", "auto_enrollment_state.h", - "auto_enrollment_state_message_processor.cc", - "auto_enrollment_state_message_processor.h", "auto_enrollment_type_checker.cc", "auto_enrollment_type_checker.h", "device_cloud_policy_initializer.cc", @@ -67,7 +62,6 @@ "//chromeos/ash/components/dbus/cryptohome:attestation_proto", "//chromeos/ash/components/dbus/cryptohome:cryptohome_proto", "//chromeos/ash/components/dbus/device_management", - "//chromeos/ash/components/dbus/system_clock", "//chromeos/ash/components/dbus/upstart", "//chromeos/ash/components/system", ] @@ -84,8 +78,6 @@ sources = [ "enrollment_test_helper.cc", "enrollment_test_helper.h", - "fake_auto_enrollment_client.cc", - "fake_auto_enrollment_client.h", ] public_deps = [ "//build:branding_buildflags" ] @@ -110,7 +102,6 @@ sources = [ "account_status_check_fetcher_unittest.cc", - "auto_enrollment_client_impl_unittest.cc", "auto_enrollment_controller_unittest.cc", "auto_enrollment_type_checker_unittest.cc", "enrollment_config_unittest.cc", @@ -144,7 +135,6 @@ "//chromeos/ash/components/dbus/device_management", "//chromeos/ash/components/dbus/oobe_config", "//chromeos/ash/components/dbus/session_manager", - "//chromeos/ash/components/dbus/system_clock", "//chromeos/ash/components/install_attributes:test_support", "//chromeos/ash/components/network", "//chromeos/ash/components/network:test_support", @@ -156,7 +146,6 @@ "//components/prefs", "//components/prefs:test_support", "//content/test:test_support", - "//crypto", "//net", "//services/network:test_support", "//services/network/public/cpp",
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_client.h b/chrome/browser/ash/policy/enrollment/auto_enrollment_client.h deleted file mode 100644 index 7a65752..0000000 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_client.h +++ /dev/null
@@ -1,100 +0,0 @@ -// Copyright 2012 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_POLICY_ENROLLMENT_AUTO_ENROLLMENT_CLIENT_H_ -#define CHROME_BROWSER_ASH_POLICY_ENROLLMENT_AUTO_ENROLLMENT_CLIENT_H_ - -#include <memory> -#include <string> - -#include "base/functional/callback.h" -#include "base/memory/scoped_refptr.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_state.h" - -class PrefService; - -namespace network { -class SharedURLLoaderFactory; -} - -namespace policy::psm { -class RlweDmserverClient; -} - -namespace ash { -class OobeConfiguration; -} // namespace ash - -namespace policy { - -class DeviceManagementService; - -// Interacts with the device management service and determines whether this -// machine should automatically enter the Enterprise Enrollment screen during -// OOBE. -class AutoEnrollmentClient { - public: - // The modulus value is sent in an int64_t field in the protobuf, whose - // maximum value is 2^63-1. So 2^64 and 2^63 can't be represented as moduli - // and the max is 2^62 (when the moduli are restricted to powers-of-2). - static const int kMaximumPower = 62; - - // Used for signaling progress to a consumer. - typedef base::RepeatingCallback<void(AutoEnrollmentState)> ProgressCallback; - - // Creates |AutoEnrollmentClient| instances. - class Factory { - public: - virtual ~Factory() = default; - - // |progress_callback| will be invoked whenever some significant event - // happens as part of the protocol, after Start() is invoked. The result of - // the protocol will be cached in |local_state|. |power_initial| and - // |power_limit| are exponents of power-of-2 values which will be the - // initial modulus and the maximum modulus used by this client. - virtual std::unique_ptr<AutoEnrollmentClient> CreateForFRE( - const ProgressCallback& progress_callback, - DeviceManagementService* device_management_service, - PrefService* local_state, - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - const std::string& server_backed_state_key, - int power_initial, - int power_limit) = 0; - - // |progress_callback| will be invoked whenever some significant event - // happens as part of the protocol, after Start() is invoked. The result of - // the protocol will be cached in |local_state|. - virtual std::unique_ptr<AutoEnrollmentClient> CreateForInitialEnrollment( - const ProgressCallback& progress_callback, - DeviceManagementService* device_management_service, - PrefService* local_state, - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - const std::string& device_serial_number, - const std::string& device_brand_code, - std::unique_ptr<psm::RlweDmserverClient> psm_rlwe_dmserver_client, - ash::OobeConfiguration* oobe_config) = 0; - }; - - virtual ~AutoEnrollmentClient() = default; - - // Starts the auto-enrollment check protocol with the device management - // service. Subsequent calls drop any previous requests. Notice that this - // call can invoke the |progress_callback_| if errors occur. - virtual void Start() = 0; - - // Triggers a retry of the currently pending step. This is intended to be - // called by consumers when they become aware of environment changes (such as - // captive portal setup being complete). - // It is safe to call the retry at any point of the client lifetime: - // 1. If the client is idle, the retry will trigger the auto-enrollment check. - // 2. If the client is in progress, the retry will be ignored. - // 3. If the client failed the check, the retry will trigger the last failed - // step to be re-executed. - // 4. If the client finished, the retry will be ignored. - virtual void Retry() = 0; -}; - -} // namespace policy - -#endif // CHROME_BROWSER_ASH_POLICY_ENROLLMENT_AUTO_ENROLLMENT_CLIENT_H_
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.cc deleted file mode 100644 index d6cc21a4..0000000 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.cc +++ /dev/null
@@ -1,974 +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 "chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.h" - -#include <stdint.h> - -#include <memory> -#include <optional> -#include <string> - -#include "ash/constants/ash_switches.h" -#include "base/check.h" -#include "base/functional/bind.h" -#include "base/functional/callback.h" -#include "base/logging.h" -#include "base/memory/ptr_util.h" -#include "base/memory/raw_ptr.h" -#include "base/memory/scoped_refptr.h" -#include "base/metrics/histogram_functions.h" -#include "base/time/time.h" -#include "base/uuid.h" -#include "base/values.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_state.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_state_message_processor.h" -#include "chrome/browser/ash/policy/enrollment/enrollment_token_provider.h" -#include "chrome/browser/ash/policy/enrollment/psm/rlwe_dmserver_client.h" -#include "chrome/browser/ash/policy/server_backed_state/server_backed_device_state.h" -#include "chrome/common/pref_names.h" -#include "components/policy/core/common/cloud/device_management_service.h" -#include "components/policy/core/common/cloud/dm_auth.h" -#include "components/policy/core/common/cloud/dmserver_job_configurations.h" -#include "components/policy/core/common/cloud/enterprise_metrics.h" -#include "components/policy/proto/device_management_backend.pb.h" -#include "components/prefs/pref_registry_simple.h" -#include "components/prefs/pref_service.h" -#include "components/prefs/scoped_user_pref_update.h" -#include "crypto/sha2.h" -#include "services/network/public/cpp/shared_url_loader_factory.h" -#include "third_party/abseil-cpp/absl/types/variant.h" - -namespace policy { - -namespace { - -namespace em = ::enterprise_management; -namespace psm_rlwe = ::private_membership::rlwe; -using EnrollmentCheckType = - em::DeviceAutoEnrollmentRequest::EnrollmentCheckType; - -// Returns the power of the next power-of-2 starting at |value|. -int NextPowerOf2(int64_t value) { - for (int i = 0; i <= AutoEnrollmentClient::kMaximumPower; ++i) { - if ((INT64_C(1) << i) >= value) - return i; - } - // No other value can be represented in an int64_t. - return AutoEnrollmentClient::kMaximumPower + 1; -} - -// Provides device identifier for Forced Re-Enrollment (FRE), where the -// server-backed state key is used. It will set the identifier for the -// DeviceAutoEnrollmentRequest. -class DeviceIdentifierProviderFRE { - public: - explicit DeviceIdentifierProviderFRE( - const std::string& server_backed_state_key) { - CHECK(!server_backed_state_key.empty()); - server_backed_state_key_hash_ = - crypto::SHA256HashString(server_backed_state_key); - } - - DeviceIdentifierProviderFRE(const DeviceIdentifierProviderFRE&) = delete; - DeviceIdentifierProviderFRE& operator=(const DeviceIdentifierProviderFRE&) = - delete; - - ~DeviceIdentifierProviderFRE() = default; - - // Should return the `EnrollmentCheckType` to be used in the - // DeviceAutoEnrollmentRequest. This specifies the identifier set used on - // the server. - em::DeviceAutoEnrollmentRequest::EnrollmentCheckType GetEnrollmentCheckType() - const { - return em::DeviceAutoEnrollmentRequest::ENROLLMENT_CHECK_TYPE_FRE; - } - - // Should return the hash of this device's identifier. The - // DeviceAutoEnrollmentRequest exchange will check if this hash is in the - // server-side identifier set specified by `GetEnrollmentCheckType()` - const std::string& GetIdHash() const { return server_backed_state_key_hash_; } - - private: - // SHA-256 digest of the stable identifier. - std::string server_backed_state_key_hash_; -}; - -} // namespace - -enum class AutoEnrollmentClientImpl::ServerStateAvailabilitySuccess { - // Indicates that request has been successful and server state availability is - // known. - kSuccess, - // Special case for server state availability result via auto enrollment - // request. - // Indicates that request shall be immediately retried. - kRetry, -}; - -// Base class to handle server state availability requests. -class AutoEnrollmentClientImpl::ServerStateAvailabilityRequester { - public: - using CompletionCallback = - base::OnceCallback<void(ServerStateAvailabilityResult)>; - - virtual ~ServerStateAvailabilityRequester() = default; - - // Initiates request and reports back with `callback` once request is - // finished. - virtual void Start(CompletionCallback callback) = 0; - - // Returns: - // * nullopt if server state is not obtained yet, - // * false if server state has been obtained and the answer is: it is not - // available. - // * true if server state has been obtained and the answer is: it is - // available. - virtual std::optional<bool> GetServerStateIfObtained() const = 0; -}; - -// Responsible for resolving server state availability status via auto -// enrollment requests for force re-enrollment. -class AutoEnrollmentClientImpl::FREServerStateAvailabilityRequester - : public ServerStateAvailabilityRequester { - public: - static void RegisterPrefs(PrefRegistrySimple* registry) { - registry->RegisterBooleanPref(prefs::kShouldAutoEnroll, false); - registry->RegisterIntegerPref(prefs::kAutoEnrollmentPowerLimit, -1); - } - - FREServerStateAvailabilityRequester( - DeviceManagementService* device_management_service, - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - PrefService* local_state, - const std::string& device_id, - const std::string& uma_suffix, - int current_power, - int power_limit, - const std::string& server_backed_state_key) - : device_management_service_(device_management_service), - url_loader_factory_(url_loader_factory), - local_state_(local_state), - device_id_(device_id), - uma_suffix_(uma_suffix), - current_power_(current_power), - power_limit_(power_limit), - device_identifier_provider_fre_(server_backed_state_key) { - DCHECK_LE(current_power_, power_limit_); - } - - FREServerStateAvailabilityRequester( - const FREServerStateAvailabilityRequester&) = delete; - FREServerStateAvailabilityRequester& operator=( - const FREServerStateAvailabilityRequester&) = delete; - - void Start(CompletionCallback callback) override { - StartImpl(std::move(callback)); - } - - std::optional<bool> GetServerStateIfObtained() const override { - const PrefService::Preference* has_server_state_pref = - local_state_->FindPreference(prefs::kShouldAutoEnroll); - const PrefService::Preference* previous_limit_pref = - local_state_->FindPreference(prefs::kAutoEnrollmentPowerLimit); - - if (!has_server_state_pref || has_server_state_pref->IsDefaultValue() || - !previous_limit_pref || previous_limit_pref->IsDefaultValue()) { - return std::nullopt; - } - - DCHECK(has_server_state_pref->GetValue()->is_bool()); - DCHECK(previous_limit_pref->GetValue()->is_int()); - - if (power_limit_ > previous_limit_pref->GetValue()->GetInt()) { - return std::nullopt; - } - - return has_server_state_pref->GetValue()->GetBool(); - } - - private: - void StartImpl(CompletionCallback callback) { - DCHECK(!request_job_); - DCHECK(callback); - DCHECK(!completion_callback_); - - completion_callback_ = std::move(callback); - - // Start the Hash dance timer during the first attempt. - if (hash_dance_time_start_.is_null()) - hash_dance_time_start_ = base::TimeTicks::Now(); - - std::string id_hash = device_identifier_provider_fre_.GetIdHash(); - // Currently AutoEnrollmentClientImpl supports working with hashes that are - // at least 8 bytes long. If this is reduced, the computation of the - // remainder must also be adapted to handle the case of a shorter hash - // gracefully. - DCHECK_GE(id_hash.size(), 8u); - - uint64_t remainder = 0; - const size_t last_byte_index = id_hash.size() - 1; - for (int i = 0; 8 * i < current_power_; ++i) { - uint64_t byte = id_hash[last_byte_index - i] & 0xff; - remainder = remainder | (byte << (8 * i)); - } - remainder = remainder & ((UINT64_C(1) << current_power_) - 1); - - // Record the time when the bucket download request is started. Note that - // the time may be set multiple times. This is fine, only the last request - // is the one where the hash bucket is actually downloaded. - time_start_bucket_download_ = base::TimeTicks::Now(); - - // TODO(crbug.com/40805389): Logging as "WARNING" to make sure it's - // preserved in the logs. - LOG(WARNING) << "Request bucket #" << remainder; - - std::unique_ptr<DMServerJobConfiguration> config = - std::make_unique<DMServerJobConfiguration>( - device_management_service_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT, - device_id_, - /*critical=*/false, DMAuth::NoAuth(), - /*oauth_token=*/std::nullopt, url_loader_factory_, - base::BindOnce( - &FREServerStateAvailabilityRequester::HandleRequestCompletion, - base::Unretained(this))); - - em::DeviceAutoEnrollmentRequest* request = - config->request()->mutable_auto_enrollment_request(); - request->set_remainder(remainder); - request->set_modulus(INT64_C(1) << current_power_); - request->set_enrollment_check_type( - device_identifier_provider_fre_.GetEnrollmentCheckType()); - - request_job_ = device_management_service_->CreateJob(std::move(config)); - } - - void HandleRequestCompletion(DMServerJobResult result) { - DCHECK(request_job_); - DCHECK(completion_callback_); - - request_job_.reset(); - - base::UmaHistogramSparse(kUMAHashDanceRequestStatus + uma_suffix_, - result.dm_status); - - if (result.dm_status != DM_STATUS_SUCCESS) { - LOG(ERROR) << "Auto enrollment error: " << result.dm_status; - - const auto error = - AutoEnrollmentDMServerError::FromDMServerJobResult(result); - if (error.network_error.has_value()) { - base::UmaHistogramSparse(kUMAHashDanceNetworkErrorCode + uma_suffix_, - -error.network_error.value()); - } - - return RunCallback(base::unexpected(error)); - } - - ServerStateAvailabilityResult availability_result = - ServerStateAvailabilitySuccess::kSuccess; - const em::DeviceAutoEnrollmentResponse& enrollment_response = - result.response.auto_enrollment_response(); - if (!result.response.has_auto_enrollment_response()) { - LOG(ERROR) << "Server failed to provide auto-enrollment response."; - availability_result = - base::unexpected(AutoEnrollmentStateAvailabilityResponseError{}); - } else if (enrollment_response.has_expected_modulus()) { - // Server is asking us to retry with a different modulus. - modulus_updates_received_++; - - int64_t modulus = enrollment_response.expected_modulus(); - int power = NextPowerOf2(modulus); - if ((INT64_C(1) << power) != modulus) { - LOG(ERROR) << "Auto enrollment: the server didn't ask for a power-of-2 " - << "modulus. Using the closest power-of-2 instead " - << "(" << modulus << " vs 2^" << power << ")"; - availability_result = - base::unexpected(AutoEnrollmentStateAvailabilityResponseError{}); - } - if (modulus_updates_received_ >= 2) { - LOG(ERROR) << "Auto enrollment error: already retried with an updated " - << "modulus but the server asked for a new one again: " - << power; - availability_result = - base::unexpected(AutoEnrollmentStateAvailabilityResponseError{}); - } else if (power > power_limit_) { - LOG(ERROR) << "Auto enrollment error: the server asked for a larger " - << "modulus than the client accepts (" << power << " vs " - << power_limit_ << ")."; - availability_result = - base::unexpected(AutoEnrollmentStateAvailabilityResponseError{}); - } else { - // Retry at most once with the modulus that the server requested. - if (power <= current_power_) { - LOG(WARNING) << "Auto enrollment: the server asked to use a modulus (" - << power << ") that isn't larger than the first used (" - << current_power_ << "). Retrying anyway."; - } - // Remember this value, so that eventual retries start with the correct - // modulus. - current_power_ = power; - DCHECK(!GetServerStateIfObtained()); - RunCallback(ServerStateAvailabilitySuccess::kRetry); - return; - } - } else { - // Server should have sent down a list of hashes to try. - const bool has_server_state = - IsIdHashInProtobuf(enrollment_response.hashes()); - // Cache the current decision in local_state, so that it is reused in case - // the device reboots before enrolling. - local_state_->SetBoolean(prefs::kShouldAutoEnroll, has_server_state); - local_state_->SetInteger(prefs::kAutoEnrollmentPowerLimit, power_limit_); - local_state_->CommitPendingWrite(); - - // TODO(crbug.com/40805389): Logging as "WARNING" to make sure it's - // preserved in the logs. - LOG(WARNING) << "Received has_state=" << has_server_state; - - availability_result = ServerStateAvailabilitySuccess::kSuccess; - RecordHashDanceSuccessTimeHistogram(); - } - - const bool succeeded_with_result = - availability_result == ServerStateAvailabilitySuccess::kSuccess && - GetServerStateIfObtained(); - const bool failed_without_result = - availability_result != ServerStateAvailabilitySuccess::kSuccess && - !GetServerStateIfObtained(); - DCHECK(succeeded_with_result || failed_without_result); - - // Bucket download done, update UMA. - UpdateBucketDownloadTimingHistograms(); - RunCallback(availability_result); - } - - void RunCallback(ServerStateAvailabilityResult availability_result) { - DCHECK(completion_callback_); - std::move(completion_callback_).Run(availability_result); - } - - bool IsIdHashInProtobuf( - const google::protobuf::RepeatedPtrField<std::string>& hashes) const { - const std::string id_hash = device_identifier_provider_fre_.GetIdHash(); - for (int i = 0; i < hashes.size(); ++i) { - if (hashes.Get(i) == id_hash) - return true; - } - return false; - } - - void UpdateBucketDownloadTimingHistograms() const { - // These values determine bucketing of the histogram, they should not be - // changed. - // The minimum time can't be 0, must be at least 1. - static const base::TimeDelta kMin = base::Milliseconds(1); - static const base::TimeDelta kMax = base::Minutes(5); - static const int kBuckets = 50; - - base::TimeTicks now = base::TimeTicks::Now(); - if (!hash_dance_time_start_.is_null()) { - base::TimeDelta delta = now - hash_dance_time_start_; - base::UmaHistogramCustomTimes(kUMAHashDanceProtocolTime + uma_suffix_, - delta, kMin, kMax, kBuckets); - } - if (!time_start_bucket_download_.is_null()) { - base::TimeDelta delta = now - time_start_bucket_download_; - base::UmaHistogramCustomTimes( - kUMAHashDanceBucketDownloadTime + uma_suffix_, delta, kMin, kMax, - kBuckets); - } - } - - void RecordHashDanceSuccessTimeHistogram() const { - // These values determine bucketing of the histogram, they should not be - // changed. - static const base::TimeDelta kMin = base::Milliseconds(1); - static const base::TimeDelta kMax = base::Seconds(25); - static const int kBuckets = 50; - - base::TimeTicks now = base::TimeTicks::Now(); - if (!hash_dance_time_start_.is_null()) { - base::TimeDelta delta = now - hash_dance_time_start_; - base::UmaHistogramCustomTimes(kUMAHashDanceSuccessTime + uma_suffix_, - delta, kMin, kMax, kBuckets); - } - } - - raw_ptr<DeviceManagementService, DanglingUntriaged> - device_management_service_; - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_; - raw_ptr<PrefService> local_state_; - const std::string device_id_; - const std::string uma_suffix_; - - // Power-of-2 modulus to try next. - int current_power_; - - // Power of the maximum power-of-2 modulus that this client will accept from - // a retry response from the server. - const int power_limit_; - - // Number of requests for a different modulus received from the server. - // Used to determine if the server keeps asking for different moduli. - int modulus_updates_received_ = 0; - - // Times used to determine the duration of the protocol, and the extra time - // needed to complete after the signin was complete. - // If `hash_dance_time_start_` is not null, the protocol is still running. - base::TimeTicks hash_dance_time_start_; - - // The time when the bucket download part of the protocol started. - base::TimeTicks time_start_bucket_download_; - - std::unique_ptr<DeviceManagementService::Job> request_job_; - - const DeviceIdentifierProviderFRE device_identifier_provider_fre_; - - CompletionCallback completion_callback_; -}; - -// Responsible for resolving server state availability status via private -// membership check requests for initial enrollment. -class AutoEnrollmentClientImpl::InitialServerStateAvailabilityRequester - : public ServerStateAvailabilityRequester { - public: - static void RegisterPrefs(PrefRegistrySimple* registry) { - registry->RegisterBooleanPref(prefs::kShouldRetrieveDeviceState, false); - registry->RegisterIntegerPref(prefs::kEnrollmentPsmResult, -1); - registry->RegisterTimePref(prefs::kEnrollmentPsmDeterminationTime, - base::Time()); - } - - explicit InitialServerStateAvailabilityRequester( - std::unique_ptr<psm::RlweDmserverClient> psm_rlwe_dmserver_client, - PrefService* local_state) - : psm_rlwe_dmserver_client_(std::move(psm_rlwe_dmserver_client)), - local_state_(local_state) {} - - InitialServerStateAvailabilityRequester( - const InitialServerStateAvailabilityRequester&) = delete; - InitialServerStateAvailabilityRequester& operator=( - const InitialServerStateAvailabilityRequester&) = delete; - - void Start(CompletionCallback callback) override { - StartImpl(std::move(callback)); - } - - std::optional<bool> GetServerStateIfObtained() const override { - const PrefService::Preference* has_psm_server_state_pref = - local_state_->FindPreference(prefs::kShouldRetrieveDeviceState); - - if (!has_psm_server_state_pref || - has_psm_server_state_pref->IsDefaultValue()) { - return std::nullopt; - } - - DCHECK(has_psm_server_state_pref->GetValue()->is_bool()); - - return has_psm_server_state_pref->GetValue()->GetBool(); - } - - private: - void StartImpl(CompletionCallback callback) { - DCHECK(callback); - DCHECK(!completion_callback_); - DCHECK(!psm_rlwe_dmserver_client_->IsCheckMembershipInProgress()); - - PrepareLocalState(); - - completion_callback_ = std::move(callback); - - psm_rlwe_dmserver_client_->CheckMembership(base::BindOnce( - &InitialServerStateAvailabilityRequester::HandlePsmCompletion, - base::Unretained(this))); - } - - void HandlePsmCompletion( - psm::RlweDmserverClient::ResultHolder psm_result_holder) { - UpdateLocalState(psm_result_holder); - - switch (psm_result_holder.psm_result) { - case psm::RlweResult::kSuccessfulDetermination: - DCHECK(GetServerStateIfObtained()); - RunCallback(ServerStateAvailabilitySuccess::kSuccess); - break; - - case psm::RlweResult::kConnectionError: - case psm::RlweResult::kServerError: - DCHECK(psm_result_holder.dm_server_error.has_value()); - RunCallback( - base::unexpected(psm_result_holder.dm_server_error.value())); - break; - - case psm::RlweResult::kEmptyOprfResponseError: - case psm::RlweResult::kEmptyQueryResponseError: - RunCallback( - base::unexpected(AutoEnrollmentStateAvailabilityResponseError{})); - break; - - case psm::RlweResult::kCreateRlweClientLibraryError: - case psm::RlweResult::kCreateOprfRequestLibraryError: - case psm::RlweResult::kCreateQueryRequestLibraryError: - case psm::RlweResult::kProcessingQueryResponseLibraryError: - DCHECK(!GetServerStateIfObtained()); - RunCallback(base::unexpected(AutoEnrollmentPsmError{})); - break; - } - } - - void RunCallback(ServerStateAvailabilityResult availability_result) { - DCHECK(completion_callback_); - std::move(completion_callback_).Run(availability_result); - } - - void PrepareLocalState() { - // Set the initial PSM execution result as unknown until it finishes - // successfully or due to an error. - // Also, clear the PSM determination timestamp. - local_state_->SetInteger(prefs::kEnrollmentPsmResult, - em::DeviceRegisterRequest::PSM_RESULT_UNKNOWN); - local_state_->ClearPref(prefs::kEnrollmentPsmDeterminationTime); - } - - void UpdateLocalState( - const psm::RlweDmserverClient::ResultHolder& psm_result_holder) { - if (psm_result_holder.IsError()) { - local_state_->SetInteger(prefs::kEnrollmentPsmResult, - em::DeviceRegisterRequest::PSM_RESULT_ERROR); - return; - } - - local_state_->SetBoolean(prefs::kShouldRetrieveDeviceState, - psm_result_holder.membership_result.value()); - local_state_->SetTime( - prefs::kEnrollmentPsmDeterminationTime, - psm_result_holder.membership_determination_time.value()); - local_state_->SetInteger( - prefs::kEnrollmentPsmResult, - psm_result_holder.membership_result.value() - ? em::DeviceRegisterRequest::PSM_RESULT_SUCCESSFUL_WITH_STATE - : em::DeviceRegisterRequest::PSM_RESULT_SUCCESSFUL_WITHOUT_STATE); - } - - // Obtains the device state using PSM protocol. Handles all communications - // related to PSM protocol with DMServer. - std::unique_ptr<psm::RlweDmserverClient> psm_rlwe_dmserver_client_; - - raw_ptr<PrefService> local_state_; - - CompletionCallback completion_callback_; -}; - -// Stubbed out ServerStateAvailabilityRequester that always succeeds and -// indicates that server state should be retrieved. -class AutoEnrollmentClientImpl::TokenBasedEnrollmentStateAvailabilityRequester - : public ServerStateAvailabilityRequester { - public: - explicit TokenBasedEnrollmentStateAvailabilityRequester( - std::optional<std::string> enrollment_token, - PrefService* local_state) - : enrollment_token_(std::move(enrollment_token)), - local_state_(local_state) { - local_state_->SetInteger( - prefs::kEnrollmentPsmResult, - em::DeviceRegisterRequest::PSM_SKIPPED_FOR_FLEX_AUTO_ENROLLMENT); - local_state_->SetBoolean(prefs::kShouldRetrieveDeviceState, true); - } - TokenBasedEnrollmentStateAvailabilityRequester( - const TokenBasedEnrollmentStateAvailabilityRequester&) = delete; - TokenBasedEnrollmentStateAvailabilityRequester& operator=( - const TokenBasedEnrollmentStateAvailabilityRequester&) = delete; - - void Start(CompletionCallback callback) override { - std::move(callback).Run(ServerStateAvailabilitySuccess::kSuccess); - } - - std::optional<bool> GetServerStateIfObtained() const override { - // This should always return true (as this class _should_ only be - // instantiated after determining that an enrollment token is present). - // Check the optional again anyways though for defensive programming - // purposes. - DCHECK(enrollment_token_.has_value()); - return enrollment_token_.has_value(); - } - - private: - const std::optional<std::string> enrollment_token_; - raw_ptr<PrefService> local_state_; -}; - -// Responsible fro resolving server state status for both force re-enrollment -// and initial enrollment. -class AutoEnrollmentClientImpl::ServerStateRetriever { - public: - using CompletionCallback = - base::OnceCallback<void(ServerStateRetrievalResult)>; - - ServerStateRetriever( - DeviceManagementService* device_management_service, - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - PrefService* local_state, - const std::string& device_id, - const std::string& uma_suffix, - std::unique_ptr<AutoEnrollmentStateMessageProcessor> - state_download_message_processor) - : device_management_service_(device_management_service), - url_loader_factory_(url_loader_factory), - local_state_(local_state), - device_id_(device_id), - uma_suffix_(uma_suffix), - state_download_message_processor_( - std::move(state_download_message_processor)) {} - - ServerStateRetriever(const ServerStateRetriever&) = delete; - ServerStateRetriever& operator=(const ServerStateRetriever&) = delete; - - void Start(CompletionCallback callback) { StartImpl(std::move(callback)); } - - std::optional<AutoEnrollmentState> GetAutoEnrollmentStateIfObtained() const { - if (!device_state_available_) { - return std::nullopt; - } - - const DeviceStateMode device_state_mode = GetDeviceStateMode(); - switch (device_state_mode) { - case RESTORE_MODE_NONE: - return AutoEnrollmentResult::kNoEnrollment; - case RESTORE_MODE_DISABLED: - return AutoEnrollmentResult::kDisabled; - case RESTORE_MODE_REENROLLMENT_REQUESTED: - return AutoEnrollmentResult::kSuggestedEnrollment; - case RESTORE_MODE_REENROLLMENT_ENFORCED: - case INITIAL_MODE_ENROLLMENT_ENFORCED: - case RESTORE_MODE_REENROLLMENT_ZERO_TOUCH: - case INITIAL_MODE_ENROLLMENT_ZERO_TOUCH: - case INITIAL_MODE_ENROLLMENT_TOKEN_ENROLLMENT: - return AutoEnrollmentResult::kEnrollment; - } - } - - private: - void StartImpl(CompletionCallback callback) { - DCHECK(!request_job_); - DCHECK(callback); - DCHECK(!completion_callback_); - DCHECK(!device_state_available_); - - completion_callback_ = std::move(callback); - - std::unique_ptr<DMServerJobConfiguration> config = - std::make_unique<DMServerJobConfiguration>( - device_management_service_, - state_download_message_processor_->GetJobType(), device_id_, - /*critical=*/false, DMAuth::NoAuth(), - /*oauth_token=*/std::nullopt, url_loader_factory_, - base::BindRepeating(&ServerStateRetriever::HandleRequestCompletion, - base::Unretained(this))); - - state_download_message_processor_->FillRequest(config->request()); - request_job_ = device_management_service_->CreateJob(std::move(config)); - } - - void HandleRequestCompletion(DMServerJobResult result) { - DCHECK(request_job_); - DCHECK(completion_callback_); - - request_job_.reset(); - - base::UmaHistogramSparse(kUMAHashDanceRequestStatus + uma_suffix_, - result.dm_status); - if (result.dm_status != DM_STATUS_SUCCESS) { - LOG(ERROR) << "Auto enrollment error: " << result.dm_status; - - const auto error = - AutoEnrollmentDMServerError::FromDMServerJobResult(result); - if (error.network_error.has_value()) { - base::UmaHistogramSparse(kUMAHashDanceNetworkErrorCode + uma_suffix_, - -error.network_error.value()); - } - return RunCallback(base::unexpected(error)); - } - - std::optional<AutoEnrollmentStateMessageProcessor::ParsedResponse> - parsed_response_result = - state_download_message_processor_->ParseResponse(result.response); - if (!parsed_response_result) { - return RunCallback( - base::unexpected(AutoEnrollmentStateRetrievalResponseError{})); - } - - AutoEnrollmentStateMessageProcessor::ParsedResponse& parsed_response = - *parsed_response_result; - - base::Value::Dict state; - if (parsed_response.management_domain.has_value()) - state.Set(kDeviceStateManagementDomain, - *parsed_response.management_domain); - - if (!parsed_response.restore_mode.empty()) - state.Set(kDeviceStateMode, parsed_response.restore_mode); - - if (parsed_response.disabled_message.has_value()) - state.Set(kDeviceStateDisabledMessage, *parsed_response.disabled_message); - - if (parsed_response.is_license_packaged_with_device.has_value()) - state.Set(kDeviceStatePackagedLicense, - *parsed_response.is_license_packaged_with_device); - - if (parsed_response.license_type.has_value()) - state.Set(kDeviceStateLicenseType, *parsed_response.license_type); - - if (parsed_response.assigned_upgrade_type.has_value()) { - state.Set(kDeviceStateAssignedUpgradeType, - *parsed_response.assigned_upgrade_type); - } - - // Store the enrollment state obtained from the server to local state. - // Depending on the value, this can be used later to trigger enrollment or - // to disable the device. - local_state_->SetDict(prefs::kServerBackedDeviceState, std::move(state)); - - device_state_available_ = true; - RunCallback(base::ok()); - } - - void RunCallback(ServerStateRetrievalResult result) { - DCHECK(completion_callback_); - std::move(completion_callback_).Run(result); - } - - raw_ptr<DeviceManagementService, DanglingUntriaged> - device_management_service_; - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_; - raw_ptr<PrefService> local_state_; - const std::string device_id_; - const std::string uma_suffix_; - - // Whether the download of server-kept device state completed successfully. - bool device_state_available_ = false; - - std::unique_ptr<DeviceManagementService::Job> request_job_; - - // Fills and parses state retrieval request / response. - std::unique_ptr<AutoEnrollmentStateMessageProcessor> - state_download_message_processor_; - - CompletionCallback completion_callback_; -}; - -AutoEnrollmentClientImpl::FactoryImpl::FactoryImpl() = default; -AutoEnrollmentClientImpl::FactoryImpl::~FactoryImpl() = default; - -std::unique_ptr<AutoEnrollmentClient> -AutoEnrollmentClientImpl::FactoryImpl::CreateForFRE( - const ProgressCallback& progress_callback, - DeviceManagementService* device_management_service, - PrefService* local_state, - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - const std::string& server_backed_state_key, - int power_initial, - int power_limit) { - const std::string device_id = - base::Uuid::GenerateRandomV4().AsLowercaseString(); - return base::WrapUnique(new AutoEnrollmentClientImpl( - progress_callback, - std::make_unique<FREServerStateAvailabilityRequester>( - device_management_service, url_loader_factory, local_state, device_id, - kUMASuffixFRE, power_initial, power_limit, server_backed_state_key), - std::make_unique<ServerStateRetriever>( - device_management_service, url_loader_factory, local_state, device_id, - kUMASuffixFRE, - AutoEnrollmentStateMessageProcessor::CreateForFRE( - server_backed_state_key)))); -} - -std::unique_ptr<AutoEnrollmentClient> -AutoEnrollmentClientImpl::FactoryImpl::CreateForInitialEnrollment( - const ProgressCallback& progress_callback, - DeviceManagementService* device_management_service, - PrefService* local_state, - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - const std::string& device_serial_number, - const std::string& device_brand_code, - std::unique_ptr<psm::RlweDmserverClient> psm_rlwe_dmserver_client, - ash::OobeConfiguration* oobe_config) { - std::unique_ptr<ServerStateAvailabilityRequester> - server_state_availability_requester; - const std::optional<std::string> enrollment_token = - GetEnrollmentToken(oobe_config); - if (enrollment_token.has_value()) { - server_state_availability_requester = - std::make_unique<TokenBasedEnrollmentStateAvailabilityRequester>( - enrollment_token, local_state); - } else { - server_state_availability_requester = - std::make_unique<InitialServerStateAvailabilityRequester>( - std::move(psm_rlwe_dmserver_client), local_state); - } - return base::WrapUnique(new AutoEnrollmentClientImpl( - progress_callback, std::move(server_state_availability_requester), - std::make_unique<ServerStateRetriever>( - device_management_service, url_loader_factory, local_state, - /*device_id=*/base::Uuid::GenerateRandomV4().AsLowercaseString(), - kUMASuffixInitialEnrollment, - AutoEnrollmentStateMessageProcessor::CreateForInitialEnrollment( - device_serial_number, device_brand_code, enrollment_token)))); -} - -// static -void AutoEnrollmentClientImpl::RegisterPrefs(PrefRegistrySimple* registry) { - FREServerStateAvailabilityRequester::RegisterPrefs(registry); - InitialServerStateAvailabilityRequester::RegisterPrefs(registry); -} - -AutoEnrollmentClientImpl::AutoEnrollmentClientImpl( - ProgressCallback callback, - std::unique_ptr<ServerStateAvailabilityRequester> - server_state_availability_requester, - std::unique_ptr<ServerStateRetriever> server_state_retriever) - : progress_callback_(std::move(callback)), - server_state_availability_requester_( - std::move(server_state_availability_requester)), - server_state_retriever_(std::move(server_state_retriever)) { - DCHECK(progress_callback_); -} - -AutoEnrollmentClientImpl::~AutoEnrollmentClientImpl() = default; - -void AutoEnrollmentClientImpl::Start() { - DCHECK_EQ(state_, State::kIdle); - DCHECK(!server_state_retriever_->GetAutoEnrollmentStateIfObtained()); - - RequestServerStateAvailability(); -} - -void AutoEnrollmentClientImpl::Retry() { - switch (state_) { - case State::kIdle: - Start(); - break; - - // Request in progress, nothing to do. - case State::kRequestingServerStateAvailability: - case State::kRequestingStateRetrieval: - break; - - case State::kRequestServerStateAvailabilityError: - RequestServerStateAvailability(); - break; - - case State::kRequestStateRetrievalError: - RequestStateRetrieval(); - break; - - // All possible requests are done and the final device state has been - // reported. Nothing to to do. - case State::kFinished: - break; - case State::kRequestServerStateAvailabilitySuccess: - NOTREACHED() << "kRequestServerStateAvailabilitySuccess supposed to " - "immediately resolve to kRequestingStateRetrieval."; - } -} - -void AutoEnrollmentClientImpl::RequestServerStateAvailability() { - DCHECK(state_ == State::kIdle || - state_ == State::kRequestServerStateAvailabilityError); - state_ = State::kRequestingServerStateAvailability; - - if (server_state_availability_requester_->GetServerStateIfObtained()) { - OnServerStateAvailabilityCompleted( - ServerStateAvailabilitySuccess::kSuccess); - return; - } - - server_state_availability_requester_->Start(base::BindOnce( - &AutoEnrollmentClientImpl::OnServerStateAvailabilityCompleted, - base::Unretained(this))); -} - -void AutoEnrollmentClientImpl::OnServerStateAvailabilityCompleted( - ServerStateAvailabilityResult result) { - DCHECK(state_ == State::kRequestingServerStateAvailability); - - if (!result.has_value()) { - if (absl::holds_alternative<AutoEnrollmentPsmError>(result.error())) { - // At the moment, `AutoEnrollmentClientImpl` will not distinguish - // between any of the PSM errors (except for connection error, and - // server error) and will report final progress with given server state - // even if it's not available. - DCHECK(!server_state_availability_requester_->GetServerStateIfObtained()); - state_ = State::kFinished; - return ReportFinished(); - } - - state_ = State::kRequestServerStateAvailabilityError; - return ReportProgress(base::unexpected(result.error())); - } - - switch (result.value()) { - case ServerStateAvailabilitySuccess::kSuccess: - DCHECK(server_state_availability_requester_->GetServerStateIfObtained()); - if (server_state_availability_requester_->GetServerStateIfObtained() - .value()) { - state_ = State::kRequestServerStateAvailabilitySuccess; - return RequestStateRetrieval(); - } else { - state_ = State::kFinished; - return ReportFinished(); - } - case ServerStateAvailabilitySuccess::kRetry: - state_ = State::kRequestServerStateAvailabilityError; - return Retry(); - } -} - -void AutoEnrollmentClientImpl::RequestStateRetrieval() { - DCHECK(state_ == State::kRequestServerStateAvailabilitySuccess || - state_ == State::kRequestStateRetrievalError); - DCHECK(server_state_availability_requester_->GetServerStateIfObtained()); - DCHECK( - server_state_availability_requester_->GetServerStateIfObtained().value()); - DCHECK(!server_state_retriever_->GetAutoEnrollmentStateIfObtained()); - state_ = State::kRequestingStateRetrieval; - - server_state_retriever_->Start( - base::BindOnce(&AutoEnrollmentClientImpl::OnStateRetrievalCompleted, - base::Unretained(this))); -} - -void AutoEnrollmentClientImpl::OnStateRetrievalCompleted( - ServerStateRetrievalResult result) { - DCHECK(state_ == State::kRequestingStateRetrieval); - - if (!result.has_value()) { - state_ = State::kRequestStateRetrievalError; - return ReportProgress(base::unexpected(result.error())); - } - - DCHECK(server_state_retriever_->GetAutoEnrollmentStateIfObtained()); - state_ = State::kFinished; - ReportFinished(); -} - -void AutoEnrollmentClientImpl::ReportProgress(AutoEnrollmentState state) const { - DCHECK(progress_callback_); - progress_callback_.Run(state); -} - -void AutoEnrollmentClientImpl::ReportFinished() const { - DCHECK_EQ(state_, State::kFinished); - - const auto auto_enrollment_state_result = - server_state_retriever_->GetAutoEnrollmentStateIfObtained(); - if (auto_enrollment_state_result) { - ReportProgress(auto_enrollment_state_result.value()); - } else { - ReportProgress(AutoEnrollmentResult::kNoEnrollment); - } -} - -} // namespace policy
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.h b/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.h deleted file mode 100644 index 33ec0ed..0000000 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.h +++ /dev/null
@@ -1,201 +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 CHROME_BROWSER_ASH_POLICY_ENROLLMENT_AUTO_ENROLLMENT_CLIENT_IMPL_H_ -#define CHROME_BROWSER_ASH_POLICY_ENROLLMENT_AUTO_ENROLLMENT_CLIENT_IMPL_H_ - -#include <memory> -#include <string> - -#include "base/memory/scoped_refptr.h" -#include "base/types/expected.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_client.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_state.h" - -class PrefRegistrySimple; -class PrefService; - -namespace network { -class SharedURLLoaderFactory; -} // namespace network - -namespace policy::psm { -class RlweDmserverClient; -} // namespace policy::psm - -namespace ash { -class OobeConfiguration; -} // namespace ash - -namespace policy { - -class DeviceManagementService; - -// Interacts with the device management service and determines whether this -// machine should automatically enter the Enterprise Enrollment screen during -// OOBE. -class AutoEnrollmentClientImpl final : public AutoEnrollmentClient { - public: - class FactoryImpl : public Factory { - public: - FactoryImpl(); - - FactoryImpl(const FactoryImpl&) = delete; - FactoryImpl& operator=(const FactoryImpl&) = delete; - - ~FactoryImpl() override; - - std::unique_ptr<AutoEnrollmentClient> CreateForFRE( - const ProgressCallback& progress_callback, - DeviceManagementService* device_management_service, - PrefService* local_state, - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - const std::string& server_backed_state_key, - int power_initial, - int power_limit) override; - - std::unique_ptr<AutoEnrollmentClient> CreateForInitialEnrollment( - const ProgressCallback& progress_callback, - DeviceManagementService* device_management_service, - PrefService* local_state, - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - const std::string& device_serial_number, - const std::string& device_brand_code, - std::unique_ptr<psm::RlweDmserverClient> psm_rlwe_dmserver_client, - ash::OobeConfiguration* oobe_config) override; - }; - - // Registers preferences in local state. - static void RegisterPrefs(PrefRegistrySimple* registry); - - AutoEnrollmentClientImpl(const AutoEnrollmentClientImpl&) = delete; - AutoEnrollmentClientImpl& operator=(const AutoEnrollmentClientImpl&) = delete; - - ~AutoEnrollmentClientImpl() override; - - // policy::AutoEnrollmentClient: - void Start() override; - void Retry() override; - - private: - // Base class to handle server state availability requests. - class ServerStateAvailabilityRequester; - - // Responsible for resolving server state availability status via auto - // enrollment requests for force re-enrollment. - class FREServerStateAvailabilityRequester; - - // Responsible for resolving server state availability status via private - // membership check requests for initial enrollment. - class InitialServerStateAvailabilityRequester; - - // Responsible for resolving availability status by checking enrollment - // token presence, to determine whether the device should retrieve server - // state for token-based initial enrollment. - class TokenBasedEnrollmentStateAvailabilityRequester; - - enum class ServerStateAvailabilitySuccess; - using ServerStateAvailabilityResult = - base::expected<ServerStateAvailabilitySuccess, AutoEnrollmentError>; - - // Responsible for resolving server state status for both Forced Re-Enrollment - // (FRE) and Initial Enrollment. - class ServerStateRetriever; - using ServerStateRetrievalResult = base::expected<void, AutoEnrollmentError>; - - enum class State { - // Initial state until `Start` or `Retry` are called. Resolves into - // `kRequestingServerStateAvailability`. - kIdle, - // Indicates server state availability request is in progress. - // Reached from: - // * `kIdle` after `Start`. - // * `kRequestServerStateAvailabilityError` on `Retry`. - // Resolves into: - // * `kRequestServerStateAvailabilitySuccess` if valid response. - // * `kRequestServerStateAvailabilityError` otherwise. - // * `kFinished` if response is valid and server state is not available. - kRequestingServerStateAvailability, - // Indicate connection or server errors during server state availability - // request. - // Reached from: - // * `kRequestingServerStateAvailability` if request fails. - // Resolves into: - // * `kRequestingServerStateAvailability` on `Retry`. - kRequestServerStateAvailabilityError, - // Indicates success of state availability request. - // Reached from: - // * `kRequestingServerStateAvailability` if request is successful and - // server state is available. - // Resolves into: - // * `kRequestingStateRetrieval` unconditionally. - kRequestServerStateAvailabilitySuccess, - // Indicates server state retrieval request is in progress. - // Reached from: - // * `kRequestServerStateAvailabilitySuccess` after server state - // availability request succeeded the state is available. - // * `kRequestStateRetrievalError` on `Retry`. - // Resolves into: - // * `kRequestStateRetrievalError` if request fails due to - // connection error or invalid response. - // * `kFinished` if response is valid and state is retrieved. - kRequestingStateRetrieval, - // Indicate connection or server errors during state retrieval request. - // Reached from: - // * `kRequestingStateRetrieval` if request fails. - // Resolves into: - // * `kRequestingStateRetrieval` on `Retry`. - kRequestStateRetrievalError, - // Indicates the client has finished its requests and has the answer for - // final `AutoEnrollmentState` status. - // Reached from: - // * `kRequestingServerStateAvailability` - // * `kRequestingStateRetrieval` - // Resolves into nothing. It's the final state. - kFinished, - }; - - AutoEnrollmentClientImpl( - ProgressCallback progress_callback, - std::unique_ptr<ServerStateAvailabilityRequester> - server_state_avalability_requester, - std::unique_ptr<ServerStateRetriever> server_state_retriever); - - // Sends an auto-enrollment check or psm membership check request to the - // device management service. - void RequestServerStateAvailability(); - - // Handles result of server state availability request. Proceeds to the next - // step on success. Reports failure otherwise. - void OnServerStateAvailabilityCompleted(ServerStateAvailabilityResult result); - - // Sends a device state download request to the device management service. - void RequestStateRetrieval(); - - // Handles result of server state retrieval request. Proceeds to the next - // step on success. Reports failure otherwise. - void OnStateRetrievalCompleted(ServerStateRetrievalResult result); - - void ReportProgress(AutoEnrollmentState auto_enrollment_state) const; - - void ReportFinished() const; - - State state_ = State::kIdle; - - // Callback to invoke when the protocol generates a relevant event. This can - // be either successful completion or an error that requires external action. - ProgressCallback progress_callback_; - - // Sends server state availability request and parses response. Reports - // results. - std::unique_ptr<ServerStateAvailabilityRequester> - server_state_availability_requester_; - - // Sends server state retrieval request and parses response. Reports results. - std::unique_ptr<ServerStateRetriever> server_state_retriever_; -}; - -} // namespace policy - -#endif // CHROME_BROWSER_ASH_POLICY_ENROLLMENT_AUTO_ENROLLMENT_CLIENT_IMPL_H_
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl_unittest.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl_unittest.cc deleted file mode 100644 index 10a2838..0000000 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl_unittest.cc +++ /dev/null
@@ -1,2094 +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 "chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.h" - -#include <stdint.h> - -#include <memory> -#include <optional> -#include <string> -#include <utility> - -#include "ash/constants/ash_switches.h" -#include "base/functional/bind.h" -#include "base/memory/raw_ptr.h" -#include "base/run_loop.h" -#include "base/strings/stringprintf.h" -#include "base/test/metrics/histogram_tester.h" -#include "base/test/scoped_command_line.h" -#include "base/types/expected.h" -#include "base/values.h" -#include "build/branding_buildflags.h" -#include "chrome/browser/ash/login/oobe_configuration.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_state.h" -#include "chrome/browser/ash/policy/enrollment/enrollment_test_helper.h" -#include "chrome/browser/ash/policy/enrollment/psm/fake_rlwe_dmserver_client.h" -#include "chrome/browser/ash/policy/server_backed_state/server_backed_device_state.h" -#include "chrome/browser/browser_process.h" -#include "chrome/common/pref_names.h" -#include "chrome/test/base/scoped_testing_local_state.h" -#include "chrome/test/base/testing_browser_process.h" -#include "chromeos/ash/components/dbus/oobe_config/fake_oobe_configuration_client.h" -#include "chromeos/ash/components/dbus/oobe_config/oobe_configuration_client.h" -#include "chromeos/ash/components/system/fake_statistics_provider.h" -#include "components/policy/core/common/cloud/cloud_policy_constants.h" -#include "components/policy/core/common/cloud/device_management_service.h" -#include "components/policy/core/common/cloud/enterprise_metrics.h" -#include "components/policy/core/common/cloud/mock_device_management_service.h" -#include "components/prefs/testing_pref_service.h" -#include "content/public/test/browser_task_environment.h" -#include "crypto/sha2.h" -#include "net/base/net_errors.h" -#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" -#include "services/network/test/test_url_loader_factory.h" -#include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace em = enterprise_management; - -// An enum for PSM execution result values. -using PsmExecutionResult = em::DeviceRegisterRequest::PsmExecutionResult; - -// A struct represents the PSM execution result params. -using PsmResultHolder = policy::psm::RlweDmserverClient::ResultHolder; - -namespace policy { - -namespace { - -const char kStateKey[] = "state_key"; -const char kStateKeyHash[] = - "\xde\x74\xcd\xf0\x03\x36\x8c\x21\x79\xba\xb1\x5a\xc4\x32\xee\xd6" - "\xb3\x4a\x5e\xff\x73\x7e\x92\xd9\xf8\x6e\x72\x44\xd0\x97\xc3\xe6"; -const char kDisabledMessage[] = "This device has been disabled."; - -const char kSerialNumber[] = "SN123456"; -const char kBrandCode[] = "AABC"; - -const bool kNotWithLicense = false; -const bool kWithLicense = true; - -const char kNoLicenseType[] = ""; - -// Start and limit powers for the hash dance clients. -const int kPowerStart = 4; -const int kPowerLimit = 8; - -using ::testing::_; -using ::testing::DoAll; -using ::testing::InSequence; -using ::testing::Mock; -using ::testing::SaveArg; - -enum class AutoEnrollmentProtocol { kFRE = 0, kInitialEnrollment = 1 }; - -template <typename Error> -AutoEnrollmentState ToState(Error error) { - return base::unexpected(error); -} - -class AutoEnrollmentClientImplBaseTest : public testing::Test { - public: - AutoEnrollmentClientImplBaseTest(const AutoEnrollmentClientImplBaseTest&) = - delete; - AutoEnrollmentClientImplBaseTest& operator=( - const AutoEnrollmentClientImplBaseTest&) = delete; - - protected: - explicit AutoEnrollmentClientImplBaseTest(AutoEnrollmentProtocol protocol) - : scoped_testing_local_state_(TestingBrowserProcess::GetGlobal()), - local_state_(scoped_testing_local_state_.Get()), - protocol_(protocol) { - CreateClient(kPowerStart, kPowerLimit); - } - - ~AutoEnrollmentClientImplBaseTest() override { - // Flush any deletion tasks. - base::RunLoop().RunUntilIdle(); - } - - void CreateClient(int power_initial, int power_limit) { - state_ = std::nullopt; - service_ = - std::make_unique<FakeDeviceManagementService>(&job_creation_handler_); - service_->ScheduleInitialization(0); - base::RunLoop().RunUntilIdle(); - - auto progress_callback = - base::BindRepeating(&AutoEnrollmentClientImplBaseTest::ProgressCallback, - base::Unretained(this)); - shared_url_loader_factory_ = - base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>( - &url_loader_factory_); - - if (protocol_ == AutoEnrollmentProtocol::kFRE) { - client_ = AutoEnrollmentClientImpl::FactoryImpl().CreateForFRE( - progress_callback, service_.get(), local_state_, - shared_url_loader_factory_, kStateKey, power_initial, power_limit); - } else { - // Store a non-owned smart pointer of `psm::FakelweDmserverClient` in - // `fake_psm_rlwe_dmserver_client_ptr_`. - auto fake_psm_rlwe_dmserver_client = - std::make_unique<psm::FakeRlweDmserverClient>(); - fake_psm_rlwe_dmserver_client_ptr_ = fake_psm_rlwe_dmserver_client.get(); - - client_ = - AutoEnrollmentClientImpl::FactoryImpl().CreateForInitialEnrollment( - progress_callback, service_.get(), local_state_, - shared_url_loader_factory_, kSerialNumber, kBrandCode, - std::move(fake_psm_rlwe_dmserver_client), - enrollment_test_helper_.oobe_configuration()); - } - } - - void ProgressCallback(AutoEnrollmentState state) { state_ = state; } - - void ServerWillFail(int net_error, int response_code) { - EXPECT_CALL(job_creation_handler_, OnJobCreation) - .WillOnce( - DoAll(service_->CaptureJobType(&failed_job_type_), - service_->CaptureRequest(&last_request_), - service_->SendJobResponseAsync(net_error, response_code))) - .RetiresOnSaturation(); - } - - em::DeviceInitialEnrollmentStateResponse::InitialEnrollmentMode - MapRestoreModeToInitialEnrollmentMode( - em::DeviceStateRetrievalResponse::RestoreMode restore_mode) { - using DeviceStateRetrieval = em::DeviceStateRetrievalResponse; - using DeviceInitialEnrollmentState = - em::DeviceInitialEnrollmentStateResponse; - - switch (restore_mode) { - case DeviceStateRetrieval::RESTORE_MODE_NONE: - return DeviceInitialEnrollmentState::INITIAL_ENROLLMENT_MODE_NONE; - case DeviceStateRetrieval::RESTORE_MODE_REENROLLMENT_REQUESTED: - return DeviceInitialEnrollmentState::INITIAL_ENROLLMENT_MODE_NONE; - case DeviceStateRetrieval::RESTORE_MODE_REENROLLMENT_ENFORCED: - return DeviceInitialEnrollmentState:: - INITIAL_ENROLLMENT_MODE_ENROLLMENT_ENFORCED; - case DeviceStateRetrieval::RESTORE_MODE_DISABLED: - return DeviceInitialEnrollmentState::INITIAL_ENROLLMENT_MODE_DISABLED; - case DeviceStateRetrieval::RESTORE_MODE_REENROLLMENT_ZERO_TOUCH: - return DeviceInitialEnrollmentState:: - INITIAL_ENROLLMENT_MODE_ZERO_TOUCH_ENFORCED; - } - } - - std::string MapDeviceRestoreStateToDeviceInitialState( - const std::string& restore_state) const { - if (restore_state == kDeviceStateRestoreModeReEnrollmentEnforced) - return kDeviceStateInitialModeEnrollmentEnforced; - if (restore_state == kDeviceStateRestoreModeReEnrollmentZeroTouch) - return kDeviceStateInitialModeEnrollmentZeroTouch; - NOTREACHED(); - } - - void ServerWillSendState( - const std::string& management_domain, - em::DeviceStateRetrievalResponse::RestoreMode restore_mode, - const std::string& device_disabled_message, - bool is_license_packaged_with_device, - em::DeviceInitialEnrollmentStateResponse::LicensePackagingSKU - license_sku) { - if (protocol_ == AutoEnrollmentProtocol::kFRE) { - ServerWillSendStateForFRE(management_domain, restore_mode, - device_disabled_message, std::nullopt); - } else { - ServerWillSendStateForInitialEnrollment( - management_domain, is_license_packaged_with_device, license_sku, - MapRestoreModeToInitialEnrollmentMode(restore_mode)); - } - } - - void ServerWillSendStateForFRE( - const std::string& management_domain, - em::DeviceStateRetrievalResponse::RestoreMode restore_mode, - const std::string& device_disabled_message, - std::optional<em::DeviceInitialEnrollmentStateResponse> - initial_state_response) { - em::DeviceManagementResponse response; - em::DeviceStateRetrievalResponse* state_response = - response.mutable_device_state_retrieval_response(); - state_response->set_restore_mode(restore_mode); - if (!management_domain.empty()) - state_response->set_management_domain(management_domain); - state_response->mutable_disabled_state()->set_message( - device_disabled_message); - - ASSERT_TRUE(!initial_state_response || - restore_mode == - em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE); - if (initial_state_response) { - state_response->mutable_initial_state_response()->MergeFrom( - *initial_state_response); - } - - EXPECT_CALL(job_creation_handler_, OnJobCreation) - .WillOnce(DoAll(service_->CaptureJobType(&state_retrieval_job_type_), - service_->CaptureRequest(&last_request_), - service_->SendJobOKAsync(response))) - .RetiresOnSaturation(); - } - - void ServerWillSendStateForInitialEnrollment( - const std::string& management_domain, - bool is_license_packaged_with_device, - em::DeviceInitialEnrollmentStateResponse::LicensePackagingSKU license_sku, - em::DeviceInitialEnrollmentStateResponse::InitialEnrollmentMode - initial_enrollment_mode) { - em::DeviceManagementResponse response; - em::DeviceInitialEnrollmentStateResponse* state_response = - response.mutable_device_initial_enrollment_state_response(); - state_response->set_initial_enrollment_mode(initial_enrollment_mode); - if (!management_domain.empty()) - state_response->set_management_domain(management_domain); - state_response->set_is_license_packaged_with_device( - is_license_packaged_with_device); - state_response->set_license_packaging_sku(license_sku); - EXPECT_CALL(job_creation_handler_, OnJobCreation) - .WillOnce(DoAll(service_->CaptureJobType(&state_retrieval_job_type_), - service_->CaptureRequest(&last_request_), - service_->SendJobOKAsync(response))) - .RetiresOnSaturation(); - } - - void ServerWillReplyEmptyStateRetrievalResponse() { - EXPECT_CALL(job_creation_handler_, OnJobCreation) - .WillOnce( - DoAll(service_->CaptureJobType(&state_retrieval_job_type_), - service_->CaptureRequest(&last_request_), - service_->SendJobOKAsync(em::DeviceManagementResponse()))) - .RetiresOnSaturation(); - } - - DeviceManagementService::JobConfiguration::JobType - GetExpectedStateRetrievalJobType() { - return protocol_ == AutoEnrollmentProtocol::kFRE - ? DeviceManagementService::JobConfiguration:: - TYPE_DEVICE_STATE_RETRIEVAL - : DeviceManagementService::JobConfiguration:: - TYPE_INITIAL_ENROLLMENT_STATE_RETRIEVAL; - } - - void ServerWillReplyAsync(DeviceManagementService::JobForTesting* job) { - EXPECT_CALL(job_creation_handler_, OnJobCreation) - .WillOnce(DoAll(service_->CaptureJobType(&last_async_job_type_), - SaveArg<0>(job))); - } - - void ServerRepliesEmptyResponseForAsyncJob( - DeviceManagementService::JobForTesting* job) { - em::DeviceManagementResponse dummy_response; - service_->SendJobOKNow(job, dummy_response); - } - - bool HasServerBackedState() { - return local_state_->GetUserPref(prefs::kServerBackedDeviceState); - } - - void VerifyServerBackedState(const std::string& expected_management_domain, - const std::string& expected_restore_mode, - const std::string& expected_disabled_message, - bool expected_is_license_packaged_with_device, - const std::string& expected_license_type) { - if (protocol_ == AutoEnrollmentProtocol::kFRE) { - VerifyServerBackedStateForFRE(expected_management_domain, - expected_restore_mode, - expected_disabled_message); - } else { - VerifyServerBackedStateForInitialEnrollment( - expected_management_domain, expected_restore_mode, - expected_is_license_packaged_with_device, expected_license_type); - } - } - - void VerifyServerBackedStateForAll( - const std::string& expected_management_domain, - const std::string& expected_restore_mode, - base::Value::Dict& local_state_dict) { - const base::Value* state = - local_state_->GetUserPref(prefs::kServerBackedDeviceState); - ASSERT_TRUE(state); - ASSERT_TRUE(state->is_dict()); - - const base::Value::Dict& state_dict = state->GetDict(); - local_state_dict = state_dict.Clone(); - - const std::string* actual_management_domain = - state_dict.FindString(kDeviceStateManagementDomain); - if (expected_management_domain.empty()) { - EXPECT_FALSE(actual_management_domain); - } else { - EXPECT_TRUE(actual_management_domain); - EXPECT_EQ(expected_management_domain, *actual_management_domain); - } - - if (!expected_restore_mode.empty()) - EXPECT_TRUE(state_dict.FindString(kDeviceStateMode)); - else - EXPECT_EQ(state_dict.Find(kDeviceStateMode), nullptr); - } - - void VerifyServerBackedStateForFRE( - const std::string& expected_management_domain, - const std::string& expected_restore_mode, - const std::string& expected_disabled_message) { - base::Value::Dict state_dict; - VerifyServerBackedStateForAll(expected_management_domain, - expected_restore_mode, state_dict); - - if (!expected_restore_mode.empty()) { - const std::string* actual_restore_mode = - state_dict.FindString(kDeviceStateMode); - EXPECT_TRUE(actual_restore_mode); - EXPECT_EQ(protocol_ == AutoEnrollmentProtocol::kFRE - ? expected_restore_mode - : MapDeviceRestoreStateToDeviceInitialState( - expected_restore_mode), - *actual_restore_mode); - } - - const std::string* actual_disabled_message = - state_dict.FindString(kDeviceStateDisabledMessage); - EXPECT_TRUE(actual_disabled_message); - EXPECT_EQ(expected_disabled_message, *actual_disabled_message); - EXPECT_FALSE(state_dict.FindBool(kDeviceStatePackagedLicense)); - EXPECT_FALSE(state_dict.FindString(kDeviceStateLicenseType)); - } - - void VerifyServerBackedStateForInitialEnrollment( - const std::string& expected_management_domain, - const std::string& expected_restore_mode, - bool expected_is_license_packaged_with_device, - const std::string& expected_license_type) { - base::Value::Dict state_dict; - VerifyServerBackedStateForAll(expected_management_domain, - expected_restore_mode, state_dict); - - EXPECT_FALSE(state_dict.FindString(kDeviceStateDisabledMessage)); - - std::optional<bool> actual_is_license_packaged_with_device; - actual_is_license_packaged_with_device = - state_dict.FindBool(kDeviceStatePackagedLicense); - if (actual_is_license_packaged_with_device.has_value()) { - EXPECT_EQ(expected_is_license_packaged_with_device, - actual_is_license_packaged_with_device.value()); - } else { - EXPECT_FALSE(expected_is_license_packaged_with_device); - } - - const std::string* actual_license_type = - state_dict.FindString(kDeviceStateLicenseType); - EXPECT_TRUE(actual_license_type); - EXPECT_EQ(*actual_license_type, expected_license_type); - } - - const em::DeviceAutoEnrollmentRequest& auto_enrollment_request() { - return last_request_.auto_enrollment_request(); - } - - // Returns |client_| as |AutoEnrollmentClientImpl*|. This is fine because this - // test only creates |client_| using |AutoEnrollmentClientImpl::FactoryImpl|. - AutoEnrollmentClientImpl* client() { - return static_cast<AutoEnrollmentClientImpl*>(client_.get()); - } - - // Releases |client_| and returns the pointer as |AutoEnrollmentClientImpl*|. - // This is fine because this test only creates |client_| using - // |AutoEnrollmentClientImpl::FactoryImpl|. - AutoEnrollmentClientImpl* release_client() { - return static_cast<AutoEnrollmentClientImpl*>(client_.release()); - } - - base::test::ScopedCommandLine command_line_; - ash::system::ScopedFakeStatisticsProvider statistics_provider_; - test::EnrollmentTestHelper enrollment_test_helper_{&command_line_, - &statistics_provider_}; - content::BrowserTaskEnvironment task_environment_{ - base::test::TaskEnvironment::TimeSource::MOCK_TIME}; - base::HistogramTester histogram_tester_; - ScopedTestingLocalState scoped_testing_local_state_; - raw_ptr<TestingPrefServiceSimple> local_state_; - testing::StrictMock<MockJobCreationHandler> job_creation_handler_; - std::unique_ptr<FakeDeviceManagementService> service_; - em::DeviceManagementRequest last_request_; - std::optional<AutoEnrollmentState> state_; - DeviceManagementService::JobConfiguration::JobType failed_job_type_ = - DeviceManagementService::JobConfiguration::TYPE_INVALID; - DeviceManagementService::JobConfiguration::JobType last_async_job_type_ = - DeviceManagementService::JobConfiguration::TYPE_INVALID; - DeviceManagementService::JobConfiguration::JobType state_retrieval_job_type_ = - DeviceManagementService::JobConfiguration::TYPE_INVALID; - - // Sets the final result of PSM protocol for testing. - raw_ptr<psm::FakeRlweDmserverClient, DanglingUntriaged> - fake_psm_rlwe_dmserver_client_ptr_ = nullptr; - - private: - const AutoEnrollmentProtocol protocol_; - network::TestURLLoaderFactory url_loader_factory_; - scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory_; - std::unique_ptr<AutoEnrollmentClient> client_; -}; - -class AutoEnrollmentClientImplFRETest - : public AutoEnrollmentClientImplBaseTest { - protected: - AutoEnrollmentClientImplFRETest() - : AutoEnrollmentClientImplBaseTest(AutoEnrollmentProtocol::kFRE) {} - - void SetUp() override { - ASSERT_FALSE(local_state_->GetUserPref(prefs::kShouldAutoEnroll)); - ASSERT_FALSE(local_state_->GetUserPref(prefs::kAutoEnrollmentPowerLimit)); - - AutoEnrollmentClientImplBaseTest::SetUp(); - } - - void ServerWillReply(int64_t modulus, bool with_hashes, bool with_id_hash) { - em::DeviceManagementResponse response = - GetAutoEnrollmentResponse(modulus, with_hashes, with_id_hash); - - EXPECT_CALL(job_creation_handler_, OnJobCreation) - .WillOnce(DoAll(service_->CaptureJobType(&auto_enrollment_job_type_), - service_->CaptureRequest(&last_request_), - service_->SendJobOKAsync(response))) - .RetiresOnSaturation(); - } - - void ServerWillReplyEmptyAutoEnrollmentResponse() { - EXPECT_CALL(job_creation_handler_, OnJobCreation) - .WillOnce( - DoAll(service_->CaptureJobType(&auto_enrollment_job_type_), - service_->CaptureRequest(&last_request_), - service_->SendJobOKAsync(em::DeviceManagementResponse()))) - .RetiresOnSaturation(); - } - - void ServerReplyAsyncJobWithAutoEnrollmentResponse( - int64_t modulus, - bool with_hashes, - bool with_id_hash, - DeviceManagementService::JobForTesting* job) { - em::DeviceManagementResponse response = - GetAutoEnrollmentResponse(modulus, with_hashes, with_id_hash); - service_->SendJobOKNow(job, response); - } - - bool HasCachedDecision() { - return local_state_->GetUserPref(prefs::kShouldAutoEnroll); - } - - void VerifyCachedResult(bool should_enroll, int power_limit) { - base::Value value_should_enroll(should_enroll); - base::Value value_power_limit(power_limit); - EXPECT_EQ(value_should_enroll, - *local_state_->GetUserPref(prefs::kShouldAutoEnroll)); - EXPECT_EQ(value_power_limit, - *local_state_->GetUserPref(prefs::kAutoEnrollmentPowerLimit)); - } - - // Expects one sample for |kUMAHashDanceNetworkErrorCode| which has value of - // |network_error|. - void ExpectHashDanceNetworkErrorHistogram(int network_error) const { - histogram_tester_.ExpectBucketCount( - std::string(kUMAHashDanceNetworkErrorCode) + kUMASuffixFRE, - network_error, /*expected_count=*/1); - } - - // Expects a sample for |kUMAHashDanceRequestStatus| with count - // |dm_status_count|. - void ExpectHashDanceRequestStatusHistogram(DeviceManagementStatus dm_status, - int dm_status_count) const { - histogram_tester_.ExpectBucketCount( - std::string(kUMAHashDanceRequestStatus) + kUMASuffixFRE, dm_status, - dm_status_count); - } - - // Expects a sample for |kUMAHashDanceProtocolTime| to have value - // |expected_time_recorded|. - // if |success_time_recorded| is true it expects one sample for - // |kUMAHashDanceSuccessTime| to have value |expected_time_recorded|. - // Otherwise, expects no sample for |kUMAHashDanceSuccessTime|. - void ExpectHashDanceExecutionTimeHistogram( - base::TimeDelta expected_time_recorded, - bool success_time_recorded) const { - histogram_tester_.ExpectUniqueTimeSample( - std::string(kUMAHashDanceProtocolTime) + kUMASuffixFRE, - expected_time_recorded, /*expected_bucket_count=*/1); - histogram_tester_.ExpectUniqueTimeSample( - std::string(kUMAHashDanceSuccessTime) + kUMASuffixFRE, - expected_time_recorded, success_time_recorded ? 1 : 0); - } - - void ExpectHashDanceSyncExecutionTimeHistogram(bool success_time_recorded) { - // Note: The expected time is the difference between starting off the - // client, and finishing executing the protocol successfully. In this test, - // the protocol requests are synchronized. Then the recorded time will be - // zero. - ExpectHashDanceExecutionTimeHistogram( - /*expected_time_recorded=*/base::TimeDelta(), success_time_recorded); - } - - DeviceManagementService::JobConfiguration::JobType auto_enrollment_job_type_ = - DeviceManagementService::JobConfiguration::TYPE_INVALID; - - private: - em::DeviceManagementResponse GetAutoEnrollmentResponse( - int64_t modulus, - bool with_hashes, - bool with_id_hash) const { - em::DeviceManagementResponse response; - em::DeviceAutoEnrollmentResponse* enrollment_response = - response.mutable_auto_enrollment_response(); - if (modulus >= 0) - enrollment_response->set_expected_modulus(modulus); - if (with_hashes) { - for (int i = 0; i < 10; ++i) { - std::string state_key = base::StringPrintf("state_key %d", i); - std::string hash = crypto::SHA256HashString(state_key); - enrollment_response->mutable_hashes()->Add()->assign(hash); - } - } - if (with_id_hash) { - enrollment_response->mutable_hashes()->Add()->assign( - kStateKeyHash, crypto::kSHA256Length); - } - - return response; - } -}; - -TEST_F(AutoEnrollmentClientImplFRETest, NetworkFailure) { - ServerWillFail(net::OK, DeviceManagementService::kServiceUnavailable); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_TEMPORARY_UNAVAILABLE, - /*dm_status_count=*/1); - EXPECT_EQ(DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT, - failed_job_type_); - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_TEMPORARY_UNAVAILABLE})); - EXPECT_FALSE(HasCachedDecision()); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, EmptyReply) { - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/false, - /*with_id_hash=*/false); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/1); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - VerifyCachedResult(/*should_enroll=*/false, kPowerLimit); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, EmptyAutoEnrollmentRespose) { - ServerWillReplyEmptyAutoEnrollmentResponse(); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/1); - - // Verify Hash dance protocol overall execution time histogram has been - // recorded correctly. And its success time histogram has not been recorded. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/false); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, ToState(AutoEnrollmentStateAvailabilityResponseError{})); - EXPECT_FALSE(HasCachedDecision()); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, ClientUploadsRightBits) { - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/false, - /*with_id_hash=*/false); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/1); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - - EXPECT_TRUE(auto_enrollment_request().has_remainder()); - EXPECT_TRUE(auto_enrollment_request().has_modulus()); - EXPECT_EQ(16, auto_enrollment_request().modulus()); - EXPECT_EQ(kStateKeyHash[31] & 0xf, auto_enrollment_request().remainder()); - VerifyCachedResult(/*should_enroll=*/false, kPowerLimit); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, AskForMoreThenFail) { - InSequence sequence; - ServerWillReply(/*modulus=*/32, /*with_hashes=*/false, - /*with_id_hash=*/false); - ServerWillFail(net::OK, DeviceManagementService::kServiceUnavailable); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/1); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_TEMPORARY_UNAVAILABLE, - /*dm_status_count=*/1); - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(failed_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_TEMPORARY_UNAVAILABLE})); - EXPECT_FALSE(HasCachedDecision()); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, AskForMoreThenEvenMore) { - InSequence sequence; - ServerWillReply(/*modulus=*/32, /*with_hashes=*/false, - /*with_id_hash=*/false); - ServerWillReply(/*modulus=*/64, /*with_hashes=*/false, - /*with_id_hash=*/false); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - - // Verify Hash dance protocol overall execution time histogram has been - // recorded correctly. And its success time histogram has not been recorded. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/false); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, ToState(AutoEnrollmentStateAvailabilityResponseError{})); - EXPECT_FALSE(HasCachedDecision()); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, AskForLess) { - InSequence sequence; - ServerWillReply(/*modulus=*/8, /*with_hashes=*/false, /*with_id_hash=*/false); - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - ServerWillSendState( - "example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED, - kDisabledMessage, kWithLicense, - em::DeviceInitialEnrollmentStateResponse::CHROME_EDUCATION); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/3); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedState( - "example.com", kDeviceStateRestoreModeReEnrollmentEnforced, - kDisabledMessage, kWithLicense, kDeviceStateLicenseTypeEducation); -} - -TEST_F(AutoEnrollmentClientImplFRETest, AskForSame) { - InSequence sequence; - ServerWillReply(/*modulus=*/16, /*with_hashes=*/false, - /*with_id_hash=*/false); - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - ServerWillSendState( - "example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED, - kDisabledMessage, kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/3); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedState("example.com", - kDeviceStateRestoreModeReEnrollmentEnforced, - kDisabledMessage, kNotWithLicense, kNoLicenseType); -} - -TEST_F(AutoEnrollmentClientImplFRETest, AskForSameTwice) { - InSequence sequence; - ServerWillReply(/*modulus=*/16, /*with_hashes=*/false, - /*with_id_hash=*/false); - ServerWillReply(/*modulus=*/16, /*with_hashes=*/false, - /*with_id_hash=*/false); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - - // Verify Hash dance protocol overall execution time histogram has been - // recorded correctly. And its success time histogram has not been recorded. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/false); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, ToState(AutoEnrollmentStateAvailabilityResponseError{})); - EXPECT_FALSE(HasCachedDecision()); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, AskForTooMuch) { - ServerWillReply(/*modulus=*/512, /*with_hashes=*/false, - /*with_id_hash=*/false); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/1); - - // Verify Hash dance protocol overall execution time histogram has been - // recorded correctly. And its success time histogram has not been recorded. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/false); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, ToState(AutoEnrollmentStateAvailabilityResponseError{})); - EXPECT_FALSE(HasCachedDecision()); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, ServerRepliesWithTooLargeModulus) { - constexpr int64_t max_modulus = - (UINT64_C(1) << (AutoEnrollmentClient::kMaximumPower + 1)) - 1; - ServerWillReply(max_modulus, /*with_hashes=*/false, /*with_id_hash=*/false); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/1); - - // Verify Hash dance protocol overall execution time histogram has been - // recorded correctly. And its success time histogram has not been recorded. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/false); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, ToState(AutoEnrollmentStateAvailabilityResponseError{})); - EXPECT_FALSE(HasCachedDecision()); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, AskNonPowerOf2) { - InSequence sequence; - ServerWillReply(/*modulus=*/100, /*with_hashes=*/false, - /*with_id_hash=*/false); - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/false, - /*with_id_hash=*/false); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - EXPECT_TRUE(auto_enrollment_request().has_remainder()); - EXPECT_TRUE(auto_enrollment_request().has_modulus()); - EXPECT_EQ(128, auto_enrollment_request().modulus()); - EXPECT_EQ(kStateKeyHash[31] & 0x7f, auto_enrollment_request().remainder()); - VerifyCachedResult(/*should_enroll=*/false, kPowerLimit); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, ConsumerDevice) { - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/false); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/1); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - VerifyCachedResult(/*should_enroll=*/false, kPowerLimit); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, ForcedReEnrollment) { - InSequence sequence; - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - ServerWillSendState( - "example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED, - kDisabledMessage, kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedState("example.com", - kDeviceStateRestoreModeReEnrollmentEnforced, - kDisabledMessage, kNotWithLicense, kNoLicenseType); -} - -TEST_F(AutoEnrollmentClientImplFRETest, - ForcedReEnrollmentStateRetrivalfailure) { - InSequence sequence; - - const base::TimeDelta kOneSecondTimeDelta = base::Seconds(1); - - DeviceManagementService::JobForTesting hash_dance_job; - DeviceManagementService::JobForTesting device_state_job; - - // Expect two requests and capture them, in order, when available in - // |hash_dance_job| and |device_state_job|. - ServerWillReplyAsync(&hash_dance_job); - ServerWillReplyAsync(&device_state_job); - - // Expect none of the jobs have been captured. - EXPECT_FALSE(hash_dance_job.IsActive()); - EXPECT_FALSE(device_state_job.IsActive()); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - // Verify the only job that has been captured is the Hash dance request. - EXPECT_EQ(last_async_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - ASSERT_TRUE(hash_dance_job.IsActive()); - EXPECT_FALSE(device_state_job.IsActive()); - - // Advance the time forward one second. - task_environment_.FastForwardBy(kOneSecondTimeDelta); - - // Succeed for Hash dance request i.e. DeviceAutoEnrollmentRequest. - ServerReplyAsyncJobWithAutoEnrollmentResponse( - /*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true, - &hash_dance_job); - - // Advance the time forward one second. - task_environment_.FastForwardBy(kOneSecondTimeDelta); - - // Verify Hash dance success. - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/1); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceExecutionTimeHistogram( - /*expected_time_recorded=*/base::Seconds(1), - /*success_time_recorded=*/true); - - // Verify device state job has been captured. - ASSERT_TRUE(device_state_job.IsActive()); - EXPECT_EQ(last_async_job_type_, GetExpectedStateRetrievalJobType()); - - // Fail for DeviceStateRetrievalRequest request by sending an empty response. - ServerRepliesEmptyResponseForAsyncJob(&device_state_job); - - // Verify that no enrollment has been done, and no state has been retrieved. - EXPECT_EQ(state_, ToState(AutoEnrollmentStateRetrievalResponseError{})); - EXPECT_FALSE(HasServerBackedState()); - - // Verify all jobs have finished. - EXPECT_FALSE(hash_dance_job.IsActive()); - EXPECT_FALSE(device_state_job.IsActive()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, ForcedEnrollmentZeroTouch) { - InSequence sequence; - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - ServerWillSendState( - "example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ZERO_TOUCH, - kDisabledMessage, kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedState("example.com", - kDeviceStateRestoreModeReEnrollmentZeroTouch, - kDisabledMessage, kNotWithLicense, kNoLicenseType); -} - -TEST_F(AutoEnrollmentClientImplFRETest, RequestedReEnrollment) { - InSequence sequence; - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - ServerWillSendState( - "example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_REQUESTED, - kDisabledMessage, kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kSuggestedEnrollment); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedState("example.com", - kDeviceStateRestoreModeReEnrollmentRequested, - kDisabledMessage, kNotWithLicense, kNoLicenseType); -} - -TEST_F(AutoEnrollmentClientImplFRETest, DeviceDisabled) { - InSequence sequence; - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - ServerWillSendState("example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_DISABLED, - kDisabledMessage, kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kDisabled); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedState("example.com", kDeviceStateModeDisabled, - kDisabledMessage, kNotWithLicense, kNoLicenseType); -} - -TEST_F(AutoEnrollmentClientImplFRETest, NoReEnrollment) { - InSequence sequence; - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - ServerWillSendState(std::string(), - em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE, - std::string(), kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedState(std::string(), std::string(), std::string(), - kNotWithLicense, kNoLicenseType); -} - -TEST_F(AutoEnrollmentClientImplFRETest, NoBitsUploaded) { - CreateClient(/*power_initial=*/0, /*power_limit=*/0); - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/false, - /*with_id_hash=*/false); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/1); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - EXPECT_TRUE(auto_enrollment_request().has_remainder()); - EXPECT_TRUE(auto_enrollment_request().has_modulus()); - EXPECT_EQ(1, auto_enrollment_request().modulus()); - EXPECT_EQ(0, auto_enrollment_request().remainder()); - VerifyCachedResult(/*should_enroll=*/false, /*power_limit=*/0); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, ManyBitsUploaded) { - int64_t bottom62 = INT64_C(0x386e7244d097c3e6); - for (int i = 0; i <= 62; ++i) { - CreateClient(/*power_initial=*/i, /*power_limit=*/i); - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/false, - /*with_id_hash=*/false); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/i + 1); - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - EXPECT_TRUE(auto_enrollment_request().has_remainder()); - EXPECT_TRUE(auto_enrollment_request().has_modulus()); - EXPECT_EQ(INT64_C(1) << i, auto_enrollment_request().modulus()); - EXPECT_EQ(bottom62 % (INT64_C(1) << i), - auto_enrollment_request().remainder()); - VerifyCachedResult(/*should_enroll=*/false, /*power_limit=*/i); - EXPECT_FALSE(HasServerBackedState()); - } -} - -TEST_F(AutoEnrollmentClientImplFRETest, MoreThan32BitsUploaded) { - CreateClient(/*power_initial=*/10, /*power_limit=*/37); - InSequence sequence; - ServerWillReply(/*modulus=*/INT64_C(1) << 37, /*with_hashes=*/false, - /*with_id_hash=*/false); - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - ServerWillSendState( - "example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED, - kDisabledMessage, kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/3); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - VerifyCachedResult(/*should_enroll=*/true, /*power_limit=*/37); - VerifyServerBackedState("example.com", - kDeviceStateRestoreModeReEnrollmentEnforced, - kDisabledMessage, kNotWithLicense, kNoLicenseType); -} - -TEST_F(AutoEnrollmentClientImplFRETest, ReuseCachedDecision) { - // No bucket download requests should be issued. - EXPECT_CALL(job_creation_handler_, OnJobCreation).Times(0); - local_state_->SetUserPref(prefs::kShouldAutoEnroll, - std::make_unique<base::Value>(true)); - local_state_->SetUserPref(prefs::kAutoEnrollmentPowerLimit, - std::make_unique<base::Value>(8)); - - // Note that device state will be retrieved every time, regardless of any - // cached information. This is intentional, the idea is that device state on - // the server may change. - ServerWillSendState( - "example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED, - kDisabledMessage, kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/1); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - VerifyServerBackedState("example.com", - kDeviceStateRestoreModeReEnrollmentEnforced, - kDisabledMessage, kNotWithLicense, kNoLicenseType); -} - -TEST_F(AutoEnrollmentClientImplFRETest, RetryIfPowerLargerThanCached) { - local_state_->SetUserPref(prefs::kShouldAutoEnroll, - std::make_unique<base::Value>(false)); - local_state_->SetUserPref(prefs::kAutoEnrollmentPowerLimit, - std::make_unique<base::Value>(8)); - CreateClient(/*power_initial=*/5, /*power_limit=*/10); - - InSequence sequence; - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - ServerWillSendState( - "example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED, - kDisabledMessage, kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - VerifyServerBackedState("example.com", - kDeviceStateRestoreModeReEnrollmentEnforced, - kDisabledMessage, kNotWithLicense, kNoLicenseType); -} - -TEST_F(AutoEnrollmentClientImplFRETest, NetworkChangeRetryAfterErrors) { - ServerWillFail(net::OK, DeviceManagementService::kServiceUnavailable); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_TEMPORARY_UNAVAILABLE, - /*dm_status_count=*/1); - // Don't invoke the callback if there was a network failure. - EXPECT_EQ(DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT, - failed_job_type_); - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_TEMPORARY_UNAVAILABLE})); - EXPECT_FALSE(HasCachedDecision()); - EXPECT_FALSE(HasServerBackedState()); - - // Trigger a retry once the network is back. - InSequence sequence; - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - ServerWillSendState( - "example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED, - kDisabledMessage, kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - client()->Retry(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - EXPECT_TRUE(HasCachedDecision()); - VerifyServerBackedState("example.com", - kDeviceStateRestoreModeReEnrollmentEnforced, - kDisabledMessage, kNotWithLicense, kNoLicenseType); -} - -TEST_F(AutoEnrollmentClientImplFRETest, - NetworkFailureThenRequireUpdatedModulus) { - // This test verifies that if the first request fails due to a network - // problem then the second request will correctly handle an updated - // modulus request from the server. - - ServerWillFail(net::ERR_FAILED, DeviceManagementService::kSuccess); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceNetworkErrorHistogram(-net::ERR_FAILED); - // Callback should signal the connection error. - EXPECT_EQ(DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT, - failed_job_type_); - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_REQUEST_FAILED, - .network_error = net::ERR_FAILED})); - EXPECT_FALSE(HasCachedDecision()); - EXPECT_FALSE(HasServerBackedState()); - Mock::VerifyAndClearExpectations(service_.get()); - - InSequence sequence; - // The default client uploads 4 bits. Make the server ask for 5. - ServerWillReply(/*modulus=*/1 << 5, /*with_hashes=*/false, - /*with_id_hash=*/false); - // Then reply with a valid response and include the hash. - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - // State download triggers. - ServerWillSendState( - "example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED, - kDisabledMessage, kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - - // Trigger a retry. - client()->Retry(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_REQUEST_FAILED, - /*dm_status_count=*/1); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/3); - - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - EXPECT_TRUE(HasCachedDecision()); - VerifyServerBackedState("example.com", - kDeviceStateRestoreModeReEnrollmentEnforced, - kDisabledMessage, kNotWithLicense, kNoLicenseType); - Mock::VerifyAndClearExpectations(service_.get()); - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, - NetworkFailureDuringStateRetrievalRequest) { - // Set up cached server state availability response. The client will use it - // to initiate state retrieval request instead of requesting the server for - // state availability. - local_state_->SetUserPref(prefs::kShouldAutoEnroll, - std::make_unique<base::Value>(true)); - local_state_->SetUserPref(prefs::kAutoEnrollmentPowerLimit, - std::make_unique<base::Value>(8)); - - ServerWillFail(net::ERR_FAILED, DeviceManagementService::kSuccess); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - ExpectHashDanceNetworkErrorHistogram(-net::ERR_FAILED); - EXPECT_EQ(failed_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_REQUEST_FAILED, - .network_error = net::ERR_FAILED})); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, RetryIsSameAsStart) { - // First, the server replies correctly to server state availability and - // server state retrieval requests. - { - // EXPECT_CALL for state availability and state retrieval requests are - // indistinguishable for gMock as there is currently no way to check - // arguments of `MockJobCreationHandler::OnJobCreation`, and that the - // created job is correct and corresponds with the request. The InSequence - // below is still needed as it ensures that the order in which we return - // values matches the order in which they are added. - InSequence sequence; - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, - /*with_id_hash=*/true); - ServerWillSendState(std::string(), - em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE, - std::string(), kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - } - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedState(std::string(), std::string(), std::string(), - kNotWithLicense, kNoLicenseType); - - // Finally, the client does not request the server on retry and - // uses its cached values. - EXPECT_CALL(job_creation_handler_, OnJobCreation).Times(0); - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); -} - -TEST_F(AutoEnrollmentClientImplFRETest, - RetryStateAvailabilityAfterConnectionErrorAndServerError) { - // First, the server fails with a connection error. - ServerWillFail(net::ERR_FAILED, DeviceManagementService::kSuccess); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - ExpectHashDanceNetworkErrorHistogram(-net::ERR_FAILED); - EXPECT_EQ(DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT, - failed_job_type_); - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_REQUEST_FAILED, - .network_error = net::ERR_FAILED, - })); - EXPECT_FALSE(HasCachedDecision()); - EXPECT_FALSE(HasServerBackedState()); - - // Second, the server fails with an internal error. - ServerWillFail(net::OK, DeviceManagementService::kServiceUnavailable); - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - ExpectHashDanceRequestStatusHistogram(DM_STATUS_TEMPORARY_UNAVAILABLE, - /*dm_status_count=*/1); - EXPECT_EQ(DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT, - failed_job_type_); - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_TEMPORARY_UNAVAILABLE})); - EXPECT_FALSE(HasCachedDecision()); - EXPECT_FALSE(HasServerBackedState()); - - // Finally, the server responds with a correct server state availability - // result. - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/false, - /*with_id_hash=*/false); - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/1); - // Verify Hash dance protocol overall execution time and its success time - // histograms were recorded correctly with the same value. - ExpectHashDanceSyncExecutionTimeHistogram(/*success_time_recorded=*/true); - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - VerifyCachedResult(/*should_enroll=*/false, kPowerLimit); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplFRETest, - RetryStateRetrievalAfterConnectionErrorAndServerError) { - // Set up cached server state availability to skip the availability request. - local_state_->SetUserPref(prefs::kShouldAutoEnroll, - std::make_unique<base::Value>(true)); - local_state_->SetUserPref(prefs::kAutoEnrollmentPowerLimit, - std::make_unique<base::Value>(8)); - - // First, the server fails with a connection error. - ServerWillFail(net::ERR_FAILED, DeviceManagementService::kSuccess); - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - ExpectHashDanceNetworkErrorHistogram(-net::ERR_FAILED); - EXPECT_EQ(failed_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_REQUEST_FAILED, - .network_error = net::ERR_FAILED})); - EXPECT_FALSE(HasServerBackedState()); - - // Second, the server fails with an internal error. - ServerWillFail(net::OK, DeviceManagementService::kServiceUnavailable); - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - ExpectHashDanceRequestStatusHistogram(DM_STATUS_TEMPORARY_UNAVAILABLE, - /*dm_status_count=*/1); - EXPECT_EQ(failed_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_TEMPORARY_UNAVAILABLE})); - EXPECT_FALSE(HasServerBackedState()); - - // Third, the server responds with a correct server state. - ServerWillSendState(std::string(), - em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE, - std::string(), kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/1); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedState(std::string(), std::string(), std::string(), - kNotWithLicense, kNoLicenseType); - - // Finally, the client uses its cached result instead of requesting the - // server. - EXPECT_CALL(job_creation_handler_, OnJobCreation).Times(0); - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedState(std::string(), std::string(), std::string(), - kNotWithLicense, kNoLicenseType); -} - -using AutoEnrollmentClientImplFREToInitialEnrollmentTest = - AutoEnrollmentClientImplFRETest; - -TEST_F(AutoEnrollmentClientImplFREToInitialEnrollmentTest, - NoReEnrollmentInitialEnrollmentLicensePackaging) { - InSequence sequence; - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - em::DeviceInitialEnrollmentStateResponse initial_state_response; - initial_state_response.set_is_license_packaged_with_device(kWithLicense); - initial_state_response.set_license_packaging_sku( - em::DeviceInitialEnrollmentStateResponse::CHROME_ENTERPRISE); - ServerWillSendStateForFRE( - /*management_domain=*/std::string(), - em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE, - /*device_disabled_message=*/std::string(), initial_state_response); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedStateForInitialEnrollment( - std::string(), std::string(), kWithLicense, - kDeviceStateLicenseTypeEnterprise); -} - -TEST_F(AutoEnrollmentClientImplFREToInitialEnrollmentTest, - NoReEnrollmentInitialEnrollmentZeroTouch) { - InSequence sequence; - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - em::DeviceInitialEnrollmentStateResponse initial_state_response; - initial_state_response.set_initial_enrollment_mode( - em::DeviceInitialEnrollmentStateResponse:: - INITIAL_ENROLLMENT_MODE_ZERO_TOUCH_ENFORCED); - initial_state_response.set_management_domain("example.com"); - initial_state_response.set_is_license_packaged_with_device(kWithLicense); - initial_state_response.set_license_packaging_sku( - em::DeviceInitialEnrollmentStateResponse::CHROME_ENTERPRISE); - ServerWillSendStateForFRE( - /*management_domain=*/std::string(), - em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE, - /*device_disabled_message=*/std::string(), initial_state_response); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedStateForInitialEnrollment( - "example.com", kDeviceStateInitialModeEnrollmentZeroTouch, kWithLicense, - kDeviceStateLicenseTypeEnterprise); -} - -TEST_F(AutoEnrollmentClientImplFREToInitialEnrollmentTest, - NoReEnrollmentInitialEnrollmentGuaranteed) { - InSequence sequence; - ServerWillReply(/*modulus=*/-1, /*with_hashes=*/true, /*with_id_hash=*/true); - em::DeviceInitialEnrollmentStateResponse initial_state_response; - initial_state_response.set_initial_enrollment_mode( - em::DeviceInitialEnrollmentStateResponse:: - INITIAL_ENROLLMENT_MODE_ENROLLMENT_ENFORCED); - initial_state_response.set_management_domain("example.com"); - initial_state_response.set_is_license_packaged_with_device(kWithLicense); - initial_state_response.set_license_packaging_sku( - em::DeviceInitialEnrollmentStateResponse::CHROME_ENTERPRISE); - ServerWillSendStateForFRE( - /*management_domain=*/std::string(), - em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE, - /*device_disabled_message=*/std::string(), initial_state_response); - client()->Start(); - base::RunLoop().RunUntilIdle(); - ExpectHashDanceRequestStatusHistogram(DM_STATUS_SUCCESS, - /*dm_status_count=*/2); - EXPECT_EQ(auto_enrollment_job_type_, - DeviceManagementService::JobConfiguration::TYPE_AUTO_ENROLLMENT); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - VerifyCachedResult(/*should_enroll=*/true, kPowerLimit); - VerifyServerBackedStateForInitialEnrollment( - "example.com", kDeviceStateInitialModeEnrollmentEnforced, kWithLicense, - kDeviceStateLicenseTypeEnterprise); -} - -class AutoEnrollmentClientImplInitialEnrollmentTest - : public AutoEnrollmentClientImplBaseTest { - protected: - // Indicates the state of the PSM protocol. - enum class StateDiscoveryResult { - // Failed. - kFailure = 0, - // Succeeded, the result was that the server does not have any state for the - // device. - kSuccessNoServerSideState = 1, - // Succeeded, the result was that the server does have a state for the - // device. - kSuccessHasServerSideState = 2, - }; - - AutoEnrollmentClientImplInitialEnrollmentTest() - : AutoEnrollmentClientImplBaseTest( - AutoEnrollmentProtocol::kInitialEnrollment) {} - - void SetUp() override { - // Verify that all PSM prefs have not been set before. - ASSERT_EQ(local_state_->GetUserPref(prefs::kShouldRetrieveDeviceState), - nullptr); - ASSERT_EQ(local_state_->GetUserPref(prefs::kEnrollmentPsmDeterminationTime), - nullptr); - ASSERT_EQ(local_state_->GetUserPref(prefs::kEnrollmentPsmResult), nullptr); - - AutoEnrollmentClientImplBaseTest::SetUp(); - } - - template <typename... Args> - void PsmWillReplyWith(Args&&... args) { - fake_psm_rlwe_dmserver_client_ptr_->WillReplyWith( - PsmResultHolder(std::forward<Args>(args)...)); - } - - // Returns the PSM execution result that has been stored in - // prefs::kEnrollmentPsmResult. If prefs::kEnrollmentPsmResult is not set, or - // its value is invalid compared to PsmExecutionResult enum values, then it - // will return PSM_RESULT_UNKNOWN. Otherwise, it will return the coressponding - // result. - PsmExecutionResult GetPsmExecutionResult() const { - const base::Value* psm_execution_result = - local_state_->GetUserPref(prefs::kEnrollmentPsmResult); - if (!psm_execution_result || - !em::DeviceRegisterRequest::PsmExecutionResult_IsValid( - psm_execution_result->GetInt())) - return em::DeviceRegisterRequest::PSM_RESULT_UNKNOWN; - return static_cast<PsmExecutionResult>(psm_execution_result->GetInt()); - } - - // Returns the PSM determination timestamp that has been stored in - // prefs::kEnrollmentPsmDeterminationTime. - // Note: The function will return a NULL object of base::Time if - // prefs::kEnrollmentPsmDeterminationTime is not set. - base::Time GetPsmDeterminationTimestamp() const { - return local_state_->GetTime(prefs::kEnrollmentPsmDeterminationTime); - } - - StateDiscoveryResult GetStateDiscoveryResult() const { - const base::Value* device_state_value = - local_state_->GetUserPref(prefs::kShouldRetrieveDeviceState); - if (!device_state_value) - return StateDiscoveryResult::kFailure; - return device_state_value->GetBool() - ? StateDiscoveryResult::kSuccessHasServerSideState - : StateDiscoveryResult::kSuccessNoServerSideState; - } - - // Style guide requires the class to be non-copyable/non-movable by default. - AutoEnrollmentClientImplInitialEnrollmentTest( - const AutoEnrollmentClientImplInitialEnrollmentTest&) = delete; - AutoEnrollmentClientImplInitialEnrollmentTest& operator=( - const AutoEnrollmentClientImplInitialEnrollmentTest&) = delete; -}; - -TEST_F(AutoEnrollmentClientImplInitialEnrollmentTest, - RetryLogicAfterNetworkFailureForRlweQueryResponse) { - PsmWillReplyWith(AutoEnrollmentDMServerError{ - .dm_error = policy::DM_STATUS_REQUEST_FAILED, - .network_error = net::ERR_CONNECTION_REFUSED}); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - const StateDiscoveryResult kExpectedStateResult = - StateDiscoveryResult::kFailure; - const PsmExecutionResult kExpectedPsmExecutionResult = - em::DeviceRegisterRequest::PSM_RESULT_ERROR; - EXPECT_EQ(GetStateDiscoveryResult(), kExpectedStateResult); - EXPECT_EQ(GetPsmExecutionResult(), kExpectedPsmExecutionResult); - EXPECT_TRUE(GetPsmDeterminationTimestamp().is_null()); - - // Verify that PSM cached membership result hasn't changed. - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - EXPECT_EQ(GetStateDiscoveryResult(), kExpectedStateResult); - EXPECT_EQ(GetPsmExecutionResult(), kExpectedPsmExecutionResult); - EXPECT_TRUE(GetPsmDeterminationTimestamp().is_null()); - - // Verify initial enrollment state retrieval. - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = policy::DM_STATUS_REQUEST_FAILED, - .network_error = net::ERR_CONNECTION_REFUSED})); -} - -TEST_F(AutoEnrollmentClientImplInitialEnrollmentTest, - RetryLogicAfterServerFailureForRlweQueryResponse) { - PsmWillReplyWith( - AutoEnrollmentDMServerError{.dm_error = DM_STATUS_TEMPORARY_UNAVAILABLE}); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - const StateDiscoveryResult kExpectedStateResult = - StateDiscoveryResult::kFailure; - const PsmExecutionResult kExpectedPsmExecutionResult = - em::DeviceRegisterRequest::PSM_RESULT_ERROR; - EXPECT_EQ(GetStateDiscoveryResult(), kExpectedStateResult); - EXPECT_EQ(GetPsmExecutionResult(), kExpectedPsmExecutionResult); - EXPECT_TRUE(GetPsmDeterminationTimestamp().is_null()); - - // Verify that PSM cached membership result hasn't changed. - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - EXPECT_EQ(GetStateDiscoveryResult(), kExpectedStateResult); - EXPECT_EQ(GetPsmExecutionResult(), kExpectedPsmExecutionResult); - EXPECT_TRUE(GetPsmDeterminationTimestamp().is_null()); - - // Verify initial enrollment state retrieval. - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_TEMPORARY_UNAVAILABLE})); -} - -TEST_F(AutoEnrollmentClientImplInitialEnrollmentTest, - RetryLogicAfterInvalidResponseForRlweQueryResponse) { - PsmWillReplyWith(psm::RlweResult::kEmptyQueryResponseError); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - const StateDiscoveryResult kExpectedStateResult = - StateDiscoveryResult::kFailure; - const PsmExecutionResult kExpectedPsmExecutionResult = - em::DeviceRegisterRequest::PSM_RESULT_ERROR; - EXPECT_EQ(GetStateDiscoveryResult(), kExpectedStateResult); - EXPECT_EQ(GetPsmExecutionResult(), kExpectedPsmExecutionResult); - EXPECT_TRUE(GetPsmDeterminationTimestamp().is_null()); - - // Verify that PSM cached membership result hasn't changed. - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - EXPECT_EQ(GetStateDiscoveryResult(), kExpectedStateResult); - EXPECT_EQ(GetPsmExecutionResult(), kExpectedPsmExecutionResult); - EXPECT_TRUE(GetPsmDeterminationTimestamp().is_null()); - - // Verify initial enrollment state retrieval. - EXPECT_EQ(state_, ToState(AutoEnrollmentStateAvailabilityResponseError{})); -} - -TEST_F(AutoEnrollmentClientImplInitialEnrollmentTest, - RetryLogicAfterMembershipSuccessfullyRetrieved) { - const bool kExpectedMembershipResult = false; - const base::TimeDelta kOneSecondTimeDelta = base::Seconds(1); - const base::Time kExpectedPsmDeterminationTimestamp = - base::Time::NowFromSystemTime() + kOneSecondTimeDelta; - - // Advance the time forward one second. - task_environment_.FastForwardBy(kOneSecondTimeDelta); - - PsmWillReplyWith(kExpectedMembershipResult, - kExpectedPsmDeterminationTimestamp); - - // Fail for DeviceInitialEnrollmentStateRequest if the device has a - // server-backed state. - if (kExpectedMembershipResult) - ServerWillFail(net::OK, DeviceManagementService::kServiceUnavailable); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - const StateDiscoveryResult expected_state_result = - kExpectedMembershipResult - ? StateDiscoveryResult::kSuccessHasServerSideState - : StateDiscoveryResult::kSuccessNoServerSideState; - EXPECT_EQ(GetStateDiscoveryResult(), expected_state_result); - - EXPECT_EQ( - GetPsmExecutionResult(), - kExpectedMembershipResult - ? em::DeviceRegisterRequest::PSM_RESULT_SUCCESSFUL_WITH_STATE - : em::DeviceRegisterRequest::PSM_RESULT_SUCCESSFUL_WITHOUT_STATE); - EXPECT_EQ(kExpectedPsmDeterminationTimestamp, GetPsmDeterminationTimestamp()); - - // Verify that PSM cached membership result hasn't changed. - - // Fail for DeviceInitialEnrollmentStateRequest with connection error, if the - // device has a server-backed state. - if (kExpectedMembershipResult) - ServerWillFail(net::ERR_FAILED, DeviceManagementService::kSuccess); - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - EXPECT_EQ(GetStateDiscoveryResult(), expected_state_result); - - // Verify initial enrollment state retrieval. - if (kExpectedMembershipResult) { - EXPECT_EQ(failed_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_REQUEST_FAILED, - .network_error = net::ERR_FAILED})); - } else { - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - } -} - -TEST_F(AutoEnrollmentClientImplInitialEnrollmentTest, - PsmSucceedAndStateRetrievalSucceed) { - const bool kExpectedMembershipResult = true; - const base::TimeDelta kOneSecondTimeDelta = base::Seconds(1); - const base::Time kExpectedPsmDeterminationTimestamp = - base::Time::NowFromSystemTime() + kOneSecondTimeDelta; - - // Advance the time forward one second. - task_environment_.FastForwardBy(kOneSecondTimeDelta); - - // Succeed for DeviceInitialEnrollmentStateRequest if the device has a - // server-backed state. - if (kExpectedMembershipResult) { - ServerWillSendState( - "example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED, - kDisabledMessage, kWithLicense, - em::DeviceInitialEnrollmentStateResponse::CHROME_ENTERPRISE); - } - - PsmWillReplyWith(kExpectedMembershipResult, - kExpectedPsmDeterminationTimestamp); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - // Verify PSM result. - EXPECT_EQ(GetStateDiscoveryResult(), - kExpectedMembershipResult - ? StateDiscoveryResult::kSuccessHasServerSideState - : StateDiscoveryResult::kSuccessNoServerSideState); - EXPECT_EQ( - GetPsmExecutionResult(), - kExpectedMembershipResult - ? em::DeviceRegisterRequest::PSM_RESULT_SUCCESSFUL_WITH_STATE - : em::DeviceRegisterRequest::PSM_RESULT_SUCCESSFUL_WITHOUT_STATE); - EXPECT_EQ(kExpectedPsmDeterminationTimestamp, GetPsmDeterminationTimestamp()); - - // Verify initial enrollment state retrieval. - if (kExpectedMembershipResult) { - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - VerifyServerBackedState( - "example.com", kDeviceStateRestoreModeReEnrollmentEnforced, - kDisabledMessage, kWithLicense, kDeviceStateLicenseTypeEnterprise); - } else { - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - } -} - -TEST_F(AutoEnrollmentClientImplInitialEnrollmentTest, - PsmSucceedAndStateRetrievalFailed) { - const bool kExpectedMembershipResult = true; - const base::TimeDelta kOneSecondTimeDelta = base::Seconds(1); - const base::Time kExpectedPsmDeterminationTimestamp = - base::Time::NowFromSystemTime() + kOneSecondTimeDelta; - - // Advance the time forward one second. - task_environment_.FastForwardBy(kOneSecondTimeDelta); - - // Fail for DeviceInitialEnrollmentStateRequest if the device has a - // server-backed state. - ServerWillFail(net::OK, DeviceManagementService::kServiceUnavailable); - - PsmWillReplyWith(kExpectedMembershipResult, - kExpectedPsmDeterminationTimestamp); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - // Verify PSM result. - EXPECT_EQ(GetStateDiscoveryResult(), - kExpectedMembershipResult - ? StateDiscoveryResult::kSuccessHasServerSideState - : StateDiscoveryResult::kSuccessNoServerSideState); - EXPECT_EQ( - GetPsmExecutionResult(), - kExpectedMembershipResult - ? em::DeviceRegisterRequest::PSM_RESULT_SUCCESSFUL_WITH_STATE - : em::DeviceRegisterRequest::PSM_RESULT_SUCCESSFUL_WITHOUT_STATE); - EXPECT_EQ(kExpectedPsmDeterminationTimestamp, GetPsmDeterminationTimestamp()); - - // Verify initial enrollment state retrieval. - if (kExpectedMembershipResult) { - EXPECT_EQ(failed_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_TEMPORARY_UNAVAILABLE})); - } else { - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - } -} - -TEST_F(AutoEnrollmentClientImplInitialEnrollmentTest, - PsmSucceedAndStateRetrievalIsEmpty) { - const base::TimeDelta kOneSecondTimeDelta = base::Seconds(1); - const base::Time kExpectedPsmDeterminationTimestamp = - base::Time::NowFromSystemTime() + kOneSecondTimeDelta; - - // Advance the time forward one second. - task_environment_.FastForwardBy(kOneSecondTimeDelta); - - PsmWillReplyWith(/*membership_result=*/true, - kExpectedPsmDeterminationTimestamp); - - ServerWillReplyEmptyStateRetrievalResponse(); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - // Verify PSM result. - EXPECT_EQ(GetStateDiscoveryResult(), - StateDiscoveryResult::kSuccessHasServerSideState); - EXPECT_EQ(GetPsmExecutionResult(), - em::DeviceRegisterRequest::PSM_RESULT_SUCCESSFUL_WITH_STATE); - EXPECT_EQ(kExpectedPsmDeterminationTimestamp, GetPsmDeterminationTimestamp()); - - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, ToState(AutoEnrollmentStateRetrievalResponseError{})); - EXPECT_FALSE(HasServerBackedState()); -} - -TEST_F(AutoEnrollmentClientImplInitialEnrollmentTest, - PsmSucceedAndDeviceDisabled) { - const base::TimeDelta kOneSecondTimeDelta = base::Seconds(1); - const base::Time kExpectedPsmDeterminationTimestamp = - base::Time::NowFromSystemTime() + kOneSecondTimeDelta; - - // Advance the time forward one second. - task_environment_.FastForwardBy(kOneSecondTimeDelta); - - PsmWillReplyWith(/*membership_result=*/true, - kExpectedPsmDeterminationTimestamp); - - ServerWillSendState("example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_DISABLED, - kDisabledMessage, kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST); - client()->Start(); - base::RunLoop().RunUntilIdle(); - - // Verify PSM result. - EXPECT_EQ(GetStateDiscoveryResult(), - StateDiscoveryResult::kSuccessHasServerSideState); - EXPECT_EQ(GetPsmExecutionResult(), - em::DeviceRegisterRequest::PSM_RESULT_SUCCESSFUL_WITH_STATE); - EXPECT_EQ(kExpectedPsmDeterminationTimestamp, GetPsmDeterminationTimestamp()); - - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kDisabled); - VerifyServerBackedState("example.com", kDeviceStateModeDisabled, - kDisabledMessage, kNotWithLicense, kNoLicenseType); -} - -// Essentially the same as PsmSucceedAndStateRetrievalSucceed, but also verifies -// that an enrollment token doesn't impact Zero Touch state determination (in -// case a token is present on a non-Flex device for some reason). -TEST_F(AutoEnrollmentClientImplInitialEnrollmentTest, - EnrollmentTokenIgnoredWhenNotOnFlex) { - enrollment_test_helper_.SetUpEnrollmentTokenConfig(); - const base::TimeDelta kOneSecondTimeDelta = base::Seconds(1); - const base::Time kExpectedPsmDeterminationTimestamp = - base::Time::NowFromSystemTime() + kOneSecondTimeDelta; - - // Advance the time forward one second. - task_environment_.FastForwardBy(kOneSecondTimeDelta); - - ServerWillSendState( - "example.com", - em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED, - kDisabledMessage, kWithLicense, - em::DeviceInitialEnrollmentStateResponse::CHROME_ENTERPRISE); - - PsmWillReplyWith(true, kExpectedPsmDeterminationTimestamp); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - // Verify PSM result. - EXPECT_EQ(GetStateDiscoveryResult(), - StateDiscoveryResult::kSuccessHasServerSideState); - EXPECT_EQ(GetPsmExecutionResult(), - em::DeviceRegisterRequest::PSM_RESULT_SUCCESSFUL_WITH_STATE); - EXPECT_EQ(kExpectedPsmDeterminationTimestamp, GetPsmDeterminationTimestamp()); - - // Verify initial enrollment state retrieval. - EXPECT_FALSE(last_request_.device_initial_enrollment_state_request() - .has_enrollment_token()); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - VerifyServerBackedState( - "example.com", kDeviceStateRestoreModeReEnrollmentEnforced, - kDisabledMessage, kWithLicense, kDeviceStateLicenseTypeEnterprise); -} - -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -TEST_F(AutoEnrollmentClientImplInitialEnrollmentTest, - TokenBasedEnrollmentServerRespondsWithSuccess) { - enrollment_test_helper_.SetUpFlexDevice(); - enrollment_test_helper_.SetUpEnrollmentTokenConfig(); - CreateClient(kPowerStart, kPowerLimit); - ServerWillSendStateForInitialEnrollment( - "example.com", kNotWithLicense, - em::DeviceInitialEnrollmentStateResponse::NOT_EXIST, - em::DeviceInitialEnrollmentStateResponse:: - INITIAL_ENROLLMENT_MODE_TOKEN_ENROLLMENT_ENFORCED); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - EXPECT_EQ(GetPsmExecutionResult(), - em::DeviceRegisterRequest::PSM_SKIPPED_FOR_FLEX_AUTO_ENROLLMENT); - EXPECT_EQ(last_request_.device_initial_enrollment_state_request() - .enrollment_token(), - test::kEnrollmentToken); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kEnrollment); - VerifyServerBackedState("example.com", kDeviceStateInitialModeTokenEnrollment, - /*expected_disabled_message=*/"", kNotWithLicense, - kNoLicenseType); -} - -// Note this isn't an expected production case, if there's a client error -// with the state retrieval request, the server should still return -// TOKEN_ENROLLMENT and all errors should be handled in the subsequent -// enrollment request/response. -TEST_F(AutoEnrollmentClientImplInitialEnrollmentTest, - TokenBasedEnrollmentServerRespondsWithEnrollmentModeNone) { - enrollment_test_helper_.SetUpFlexDevice(); - enrollment_test_helper_.SetUpEnrollmentTokenConfig(); - CreateClient(kPowerStart, kPowerLimit); - ServerWillSendStateForInitialEnrollment( - "", kNotWithLicense, em::DeviceInitialEnrollmentStateResponse::NOT_EXIST, - em::DeviceInitialEnrollmentStateResponse::INITIAL_ENROLLMENT_MODE_NONE); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - EXPECT_EQ(GetPsmExecutionResult(), - em::DeviceRegisterRequest::PSM_SKIPPED_FOR_FLEX_AUTO_ENROLLMENT); - EXPECT_EQ(last_request_.device_initial_enrollment_state_request() - .enrollment_token(), - test::kEnrollmentToken); - EXPECT_EQ(state_retrieval_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - VerifyServerBackedState( - /*expected_management_domain=*/"", /*expected_restore_mode=*/"", - /*expected_disabled_message*/ "", kNotWithLicense, kNoLicenseType); -} - -TEST_F(AutoEnrollmentClientImplInitialEnrollmentTest, - TokenBasedEnrollmentServerRespondsWithError) { - enrollment_test_helper_.SetUpFlexDevice(); - enrollment_test_helper_.SetUpEnrollmentTokenConfig(); - CreateClient(kPowerStart, kPowerLimit); - ServerWillFail(net::OK, DeviceManagementService::kServiceUnavailable); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - EXPECT_EQ(GetPsmExecutionResult(), - em::DeviceRegisterRequest::PSM_SKIPPED_FOR_FLEX_AUTO_ENROLLMENT); - EXPECT_EQ(failed_job_type_, GetExpectedStateRetrievalJobType()); - EXPECT_EQ(state_, ToState(AutoEnrollmentDMServerError{ - .dm_error = DM_STATUS_TEMPORARY_UNAVAILABLE})); -} - -#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) - -class AutoEnrollmentClientImplInitialEnrollmentInternalErrorTest - : public AutoEnrollmentClientImplInitialEnrollmentTest, - public testing::WithParamInterface<psm::RlweResult> { - protected: - void SetUp() override { - ASSERT_NE(GetPsmInternalErrorResult(), - psm::RlweResult::kSuccessfulDetermination); - ASSERT_NE(GetPsmInternalErrorResult(), psm::RlweResult::kConnectionError); - ASSERT_NE(GetPsmInternalErrorResult(), psm::RlweResult::kServerError); - ASSERT_NE(GetPsmInternalErrorResult(), - psm::RlweResult::kEmptyOprfResponseError); - ASSERT_NE(GetPsmInternalErrorResult(), - psm::RlweResult::kEmptyQueryResponseError); - - AutoEnrollmentClientImplInitialEnrollmentTest::SetUp(); - } - - psm::RlweResult GetPsmInternalErrorResult() const { return GetParam(); } -}; - -TEST_P(AutoEnrollmentClientImplInitialEnrollmentInternalErrorTest, PsmFails) { - // This test verifies that after PSM client fails with an internal error, the - // client reports `AutoEnrollmentResult::kNoEnrollment` and retry does not - // change the decision. - - PsmWillReplyWith(GetPsmInternalErrorResult()); - - client()->Start(); - base::RunLoop().RunUntilIdle(); - - const StateDiscoveryResult kExpectedStateResult = - StateDiscoveryResult::kFailure; - const PsmExecutionResult kExpectedPsmExecutionResult = - em::DeviceRegisterRequest::PSM_RESULT_ERROR; - EXPECT_EQ(GetStateDiscoveryResult(), kExpectedStateResult); - EXPECT_EQ(GetPsmExecutionResult(), kExpectedPsmExecutionResult); - EXPECT_TRUE(GetPsmDeterminationTimestamp().is_null()); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); - - // Verify that PSM cached membership result hasn't changed. - - client()->Retry(); - base::RunLoop().RunUntilIdle(); - - EXPECT_EQ(GetStateDiscoveryResult(), kExpectedStateResult); - EXPECT_EQ(GetPsmExecutionResult(), kExpectedPsmExecutionResult); - EXPECT_TRUE(GetPsmDeterminationTimestamp().is_null()); - EXPECT_EQ(state_, AutoEnrollmentResult::kNoEnrollment); -} - -INSTANTIATE_TEST_SUITE_P( - PsmForInitialEnrollmentInternalError, - AutoEnrollmentClientImplInitialEnrollmentInternalErrorTest, - testing::ValuesIn({psm::RlweResult::kCreateRlweClientLibraryError, - psm::RlweResult::kCreateOprfRequestLibraryError, - psm::RlweResult::kCreateQueryRequestLibraryError, - psm::RlweResult::kProcessingQueryResponseLibraryError})); - -} // namespace -} // namespace policy
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.cc index d1b55254..3bd62c83 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.cc +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.cc
@@ -5,36 +5,24 @@ #include "chrome/browser/ash/policy/enrollment/auto_enrollment_controller.h" #include <memory> -#include <string_view> -#include "ash/constants/ash_switches.h" #include "base/check_is_test.h" -#include "base/command_line.h" #include "base/functional/bind.h" #include "base/functional/callback_forward.h" #include "base/logging.h" #include "base/metrics/histogram_functions.h" -#include "base/strings/string_number_conversions.h" #include "base/time/time.h" #include "chrome/browser/ash/login/oobe_configuration.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_client.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.h" #include "chrome/browser/ash/policy/enrollment/auto_enrollment_state.h" #include "chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.h" #include "chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.h" -#include "chrome/browser/ash/policy/enrollment/psm/construct_rlwe_id.h" #include "chrome/browser/ash/policy/enrollment/psm/rlwe_dmserver_client_impl.h" #include "chrome/browser/ash/policy/server_backed_state/server_backed_state_keys_broker.h" #include "chrome/browser/ash/settings/device_settings_service.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/net/system_network_context_manager.h" -#include "chromeos/ash/components/dbus/cryptohome/rpc.pb.h" -#include "chromeos/ash/components/dbus/dbus_thread_manager.h" -#include "chromeos/ash/components/dbus/device_management/install_attributes_client.h" -#include "chromeos/ash/components/dbus/system_clock/system_clock_client.h" -#include "chromeos/ash/components/dbus/system_clock/system_clock_sync_observation.h" #include "chromeos/ash/components/install_attributes/install_attributes.h" #include "chromeos/ash/components/network/network_handler.h" #include "chromeos/ash/components/network/network_state_handler.h" @@ -57,8 +45,6 @@ namespace policy { namespace { -const int kMaxRequestStateKeysTries = 10; - // Maximum time to wait for the auto-enrollment check to reach a decision. // Note that this encompasses all steps `AutoEnrollmentController` performs in // order to determine if the device should be auto-enrolled. @@ -73,62 +59,11 @@ // connections. constexpr base::TimeDelta kSafeguardTimeout = base::Seconds(90); -// Maximum time to wait for time sync before forcing a decision on whether -// Initial Enrollment should be performed. This corresponds to at least seven -// TCP retransmissions attempts to the remote server used to update the system -// clock. -constexpr base::TimeDelta kSystemClockSyncWaitTimeout = base::Seconds(45); - -// A callback that will be invoked when the system clock has been synchronized, -// or if system clock synchronization has failed. -using SystemClockSyncCallback = base::OnceCallback<void( - AutoEnrollmentController::SystemClockSyncState system_clock_sync_state)>; - -// Returns the int value of the `switch_name` argument, clamped to the [0, 62] -// interval. Returns 0 if the argument doesn't exist or isn't an int value. -int GetSanitizedArg(const std::string& switch_name) { - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); - if (!command_line->HasSwitch(switch_name)) { - return 0; - } - std::string value = command_line->GetSwitchValueASCII(switch_name); - int int_value; - if (!base::StringToInt(value, &int_value)) { - LOG(ERROR) << "Switch \"" << switch_name << "\" is not a valid int. " - << "Defaulting to 0."; - return 0; - } - if (int_value < 0) { - LOG(ERROR) << "Switch \"" << switch_name << "\" can't be negative. " - << "Using 0"; - return 0; - } - if (int_value > AutoEnrollmentClient::kMaximumPower) { - LOG(ERROR) << "Switch \"" << switch_name << "\" can't be greater than " - << AutoEnrollmentClient::kMaximumPower << ". Using " - << AutoEnrollmentClient::kMaximumPower << "."; - return AutoEnrollmentClient::kMaximumPower; - } - return int_value; -} - -bool IsSystemClockSynchronized( - AutoEnrollmentController::SystemClockSyncState state) { - switch (state) { - case AutoEnrollmentController::SystemClockSyncState::kSynchronized: - case AutoEnrollmentController::SystemClockSyncState::kSyncFailed: - return true; - case AutoEnrollmentController::SystemClockSyncState::kCanWaitForSync: - case AutoEnrollmentController::SystemClockSyncState::kWaitingForSync: - return false; - } -} - enum class AutoEnrollmentControllerTimeoutReport { // These values are persisted to logs. Entries should not be renumbered and // numeric values should never be reused. kTimeoutCancelled = 0, - kTimeoutFRE = 1, + // kTimeoutFRE_Obsolete = 1, kTimeout = 2, kTimeoutUnified = 3, kMaxValue = kTimeoutUnified @@ -145,54 +80,6 @@ } // namespace -EnrollmentFwmpHelper::EnrollmentFwmpHelper( - ash::InstallAttributesClient* install_attributes_client) - : install_attributes_client_(install_attributes_client) {} - -EnrollmentFwmpHelper::~EnrollmentFwmpHelper() = default; - -void EnrollmentFwmpHelper::DetermineDevDisableBoot( - ResultCallback result_callback) { - // D-Bus services may not be available yet, so we call - // WaitForServiceToBeAvailable. See https://crbug.com/841627. - install_attributes_client_->WaitForServiceToBeAvailable(base::BindOnce( - &EnrollmentFwmpHelper::RequestFirmwareManagementParameters, - weak_ptr_factory_.GetWeakPtr(), std::move(result_callback))); -} - -void EnrollmentFwmpHelper::RequestFirmwareManagementParameters( - ResultCallback result_callback, - bool service_is_ready) { - if (!service_is_ready) { - LOG(ERROR) << "Failed waiting for cryptohome D-Bus service availability."; - return std::move(result_callback).Run(false); - } - - device_management::GetFirmwareManagementParametersRequest request; - install_attributes_client_->GetFirmwareManagementParameters( - request, - base::BindOnce( - &EnrollmentFwmpHelper::OnGetFirmwareManagementParametersReceived, - weak_ptr_factory_.GetWeakPtr(), std::move(result_callback))); -} - -void EnrollmentFwmpHelper::OnGetFirmwareManagementParametersReceived( - ResultCallback result_callback, - std::optional<device_management::GetFirmwareManagementParametersReply> - reply) { - if (!reply.has_value() || reply->error() != - device_management::DeviceManagementErrorCode:: - DEVICE_MANAGEMENT_ERROR_NOT_SET) { - LOG(ERROR) << "Failed to retrieve firmware management parameters."; - return std::move(result_callback).Run(false); - } - - const bool dev_disable_boot = - (reply->fwmp().flags() & cryptohome::DEVELOPER_DISABLE_BOOT); - - std::move(result_callback).Run(dev_disable_boot); -} - AutoEnrollmentController::AutoEnrollmentController( scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory) : AutoEnrollmentController( @@ -219,10 +106,6 @@ : device_settings_service_(device_settings_service), device_management_service_(device_management_service), state_keys_broker_(state_keys_broker), - enrollment_fwmp_helper_(std::make_unique<EnrollmentFwmpHelper>( - ash::InstallAttributesClient::Get())), - auto_enrollment_client_factory_( - std::make_unique<AutoEnrollmentClientImpl::FactoryImpl>()), psm_rlwe_client_factory_(std::move(psm_rlwe_client_factory)), enrollment_state_fetcher_factory_( std::move(enrollment_state_fetcher_factory)), @@ -246,100 +129,42 @@ return; } + // If Unified State Determination is turned off (e.g. by command line switch), + // then enrollment will not be forced. + if (!AutoEnrollmentTypeChecker::IsUnifiedStateDeterminationEnabled()) { + UpdateState(AutoEnrollmentResult::kNoEnrollment); + return; + } + // Arm the belts-and-suspenders timer to avoid hangs. safeguard_timer_.Start(FROM_HERE, kSafeguardTimeout, base::BindOnce(&AutoEnrollmentController::Timeout, weak_ptr_factory_.GetWeakPtr())); - if (AutoEnrollmentTypeChecker::IsUnifiedStateDeterminationEnabled()) { - // Emulate required FRE to prevent users from skipping enrollment. - auto_enrollment_check_type_ = AutoEnrollmentTypeChecker::CheckType:: - kForcedReEnrollmentExplicitlyRequired; - - // TODO(b/353731379): BrowserPolicyConnector::ScheduleServiceInitialization. - if (device_management_service_) { - device_management_service_->ScheduleInitialization(0); - } else { - CHECK_IS_TEST(); - } - - LOG(WARNING) << "Starting state determination"; - enrollment_state_fetcher_ = enrollment_state_fetcher_factory_.Run( - base::BindRepeating(&AutoEnrollmentController::UpdateState, - weak_ptr_factory_.GetWeakPtr()), - g_browser_process->local_state(), psm_rlwe_client_factory_, - device_management_service_, shared_url_loader_factory_, - state_keys_broker_, device_settings_service_, - ash::OobeConfiguration::Get()); - - enrollment_state_fetcher_->Start(); - return; - } - - request_state_keys_tries_ = 0; - - // The system clock sync state is not known yet, and this - // `AutoEnrollmentController` could wait for it if requested. - system_clock_sync_state_ = SystemClockSyncState::kCanWaitForSync; - - LOG(WARNING) << "Starting legacy state determination"; - enrollment_fwmp_helper_->DetermineDevDisableBoot( - base::BindOnce(&AutoEnrollmentController::OnDevDisableBootDetermined, - weak_ptr_factory_.GetWeakPtr())); -} - -void AutoEnrollmentController::OnDevDisableBootDetermined( - bool dev_disable_boot) { - dev_disable_boot_ = dev_disable_boot; - - StartWithSystemClockSyncState(); -} - -void AutoEnrollmentController::StartWithSystemClockSyncState() { - auto_enrollment_check_type_ = - AutoEnrollmentTypeChecker::DetermineAutoEnrollmentCheckType( - IsSystemClockSynchronized(system_clock_sync_state_), - ash::system::StatisticsProvider::GetInstance(), dev_disable_boot_); - if (auto_enrollment_check_type_ == - AutoEnrollmentTypeChecker::CheckType::kNone) { - UpdateState(AutoEnrollmentResult::kNoEnrollment); - return; - } - // If waiting for system clock synchronization has been triggered, wait until - // it finishes (this function will be called again when a result is - // available). - if (system_clock_sync_state_ == SystemClockSyncState::kWaitingForSync) { - return; - } - - if (auto_enrollment_check_type_ == AutoEnrollmentTypeChecker::CheckType:: - kUnknownDueToMissingSystemClockSync) { - DCHECK_EQ(system_clock_sync_state_, SystemClockSyncState::kCanWaitForSync); - system_clock_sync_state_ = SystemClockSyncState::kWaitingForSync; - - LOG(WARNING) << "Waiting for clock sync"; - // Use `client_start_weak_factory_` so the callback is not invoked if - // `Timeout` has been called in the meantime (after `kSafeguardTimeout`). - system_clock_sync_observation_ = - ash::SystemClockSyncObservation::WaitForSystemClockSync( - ash::SystemClockClient::Get(), kSystemClockSyncWaitTimeout, - base::BindOnce(&AutoEnrollmentController::OnSystemClockSyncResult, - client_start_weak_factory_.GetWeakPtr())); - return; - } - - LOG(WARNING) << "Get ownership status to check if it's enrollment recovery"; - device_settings_service_->GetOwnershipStatusAsync( - base::BindOnce(&AutoEnrollmentController::OnOwnershipStatusCheckDone, - client_start_weak_factory_.GetWeakPtr())); -} - -void AutoEnrollmentController::Retry() { - if (client_) { - client_->Retry(); + // TODO(crbug.com/353731379): + // BrowserPolicyConnector::ScheduleServiceInitialization. + if (device_management_service_) { + device_management_service_->ScheduleInitialization(0); } else { - Start(); + CHECK_IS_TEST(); } + + LOG(WARNING) << "Starting state determination"; + enrollment_state_fetcher_ = enrollment_state_fetcher_factory_.Run( + base::BindRepeating(&AutoEnrollmentController::UpdateState, + weak_ptr_factory_.GetWeakPtr()), + g_browser_process->local_state(), psm_rlwe_client_factory_, + device_management_service_, shared_url_loader_factory_, + state_keys_broker_, device_settings_service_, + ash::OobeConfiguration::Get()); + + enrollment_state_fetcher_->Start(); + return; +} + +// TODO(crbug.com/383047722) Remove `Retry` and call `Start` directly. +void AutoEnrollmentController::Retry() { + Start(); } base::CallbackListSubscription @@ -369,156 +194,6 @@ psm_rlwe_client_factory_ = std::move(test_factory); } -void AutoEnrollmentController::SetAutoEnrollmentClientFactoryForTesting( - std::unique_ptr<AutoEnrollmentClient::Factory> - auto_enrollment_client_factory) { - CHECK_IS_TEST(); - auto_enrollment_client_factory_ = std::move(auto_enrollment_client_factory); -} - -void AutoEnrollmentController::OnOwnershipStatusCheckDone( - ash::DeviceSettingsService::OwnershipStatus status) { - switch (status) { - case ash::DeviceSettingsService::OwnershipStatus::kOwnershipNone: - switch (auto_enrollment_check_type_) { - case AutoEnrollmentTypeChecker::CheckType:: - kForcedReEnrollmentExplicitlyRequired: - case AutoEnrollmentTypeChecker::CheckType:: - kForcedReEnrollmentImplicitlyRequired: - ++request_state_keys_tries_; - // For FRE, request state keys first. - LOG(WARNING) << "Requesting state keys. Attempt " - << request_state_keys_tries_ << "."; - state_keys_broker_->RequestStateKeys( - base::BindOnce(&AutoEnrollmentController::StartClientForFRE, - client_start_weak_factory_.GetWeakPtr())); - break; - case AutoEnrollmentTypeChecker::CheckType::kInitialStateDetermination: - LOG(WARNING) << "Start client for initial state determination."; - StartClientForInitialEnrollment(); - break; - case AutoEnrollmentTypeChecker::CheckType:: - kUnknownDueToMissingSystemClockSync: - case AutoEnrollmentTypeChecker::CheckType::kNone: - // The ownership check is only triggered if - // `auto_enrollment_check_type_` indicates that an auto-enrollment - // check should be done. - NOTREACHED(); - } - return; - case ash::DeviceSettingsService::OwnershipStatus::kOwnershipTaken: - LOG(WARNING) << "Device already owned, skipping auto-enrollment check."; - UpdateState(AutoEnrollmentResult::kNoEnrollment); - return; - case ash::DeviceSettingsService::OwnershipStatus::kOwnershipUnknown: - LOG(ERROR) << "Ownership unknown, skipping auto-enrollment check."; - UpdateState(AutoEnrollmentResult::kNoEnrollment); - return; - } -} - -void AutoEnrollmentController::StartClientForFRE( - const std::vector<std::string>& state_keys) { - if (state_keys.empty()) { - LOG(ERROR) << "No state keys available."; - if (auto_enrollment_check_type_ == - AutoEnrollmentTypeChecker::CheckType:: - kForcedReEnrollmentExplicitlyRequired) { - if (request_state_keys_tries_ >= kMaxRequestStateKeysTries) { - if (safeguard_timer_.IsRunning()) { - safeguard_timer_.Stop(); - } - Timeout(); - return; - } - ++request_state_keys_tries_; - // Retry to fetch the state keys. For devices where FRE is required to be - // checked, we can't proceed with empty state keys. - state_keys_broker_->RequestStateKeys( - base::BindOnce(&AutoEnrollmentController::StartClientForFRE, - client_start_weak_factory_.GetWeakPtr())); - } else { - UpdateState(AutoEnrollmentResult::kNoEnrollment); - } - return; - } - - int power_initial = - GetSanitizedArg(ash::switches::kEnterpriseEnrollmentInitialModulus); - int power_limit = - GetSanitizedArg(ash::switches::kEnterpriseEnrollmentModulusLimit); - if (power_initial > power_limit) { - LOG(ERROR) << "Initial auto-enrollment modulus is larger than the limit, " - "clamping to the limit."; - power_initial = power_limit; - } - - device_management_service_->ScheduleInitialization(0); - - client_ = auto_enrollment_client_factory_->CreateForFRE( - base::BindRepeating(&AutoEnrollmentController::UpdateState, - weak_ptr_factory_.GetWeakPtr()), - device_management_service_, g_browser_process->local_state(), - shared_url_loader_factory_, state_keys.front(), power_initial, - power_limit); - - LOG(WARNING) << "Starting auto-enrollment client for FRE."; - client_->Start(); -} - -void AutoEnrollmentController::OnSystemClockSyncResult( - bool system_clock_synchronized) { - system_clock_sync_state_ = system_clock_synchronized - ? SystemClockSyncState::kSynchronized - : SystemClockSyncState::kSyncFailed; - LOG(WARNING) << "System clock " - << (system_clock_synchronized ? "synchronized" - : "failed to synchronize"); - // Only call StartWithSystemClockSyncState() to determine the auto-enrollment - // type if the system clock could synchronize successfully. Otherwise, return - // an error to show to not to proceed with the auto-enrollment checks until - // AutoEnrollmentController::Start() is called again by a network state - // change or network selection. - if (system_clock_sync_state_ == SystemClockSyncState::kSynchronized) { - StartWithSystemClockSyncState(); - } else { - UpdateState(base::unexpected(AutoEnrollmentSystemClockSyncError{})); - } -} - -void AutoEnrollmentController::StartClientForInitialEnrollment() { - device_management_service_->ScheduleInitialization(0); - - ash::system::StatisticsProvider* provider = - ash::system::StatisticsProvider::GetInstance(); - const std::optional<std::string_view> serial_number = - provider->GetMachineID(); - const std::optional<std::string_view> rlz_brand_code = - provider->GetMachineStatistic(ash::system::kRlzBrandCodeKey); - // The Initial State Determination should not be started if the serial number - // or brand code are missing. This is ensured in - // `GetInitialStateDeterminationRequirement`. - CHECK(serial_number); - CHECK(!serial_number->empty()); - CHECK(rlz_brand_code); - CHECK(!rlz_brand_code->empty()); - - const auto plaintext_id = psm::ConstructRlweId(); - client_ = auto_enrollment_client_factory_->CreateForInitialEnrollment( - base::BindRepeating(&AutoEnrollmentController::UpdateState, - weak_ptr_factory_.GetWeakPtr()), - device_management_service_, g_browser_process->local_state(), - shared_url_loader_factory_, std::string(serial_number.value()), - std::string(rlz_brand_code.value()), - std::make_unique<psm::RlweDmserverClientImpl>( - device_management_service_, shared_url_loader_factory_, plaintext_id, - psm_rlwe_client_factory_), - ash::OobeConfiguration::Get()); - - LOG(WARNING) << "Starting auto-enrollment client for Initial Enrollment."; - client_->Start(); -} - void AutoEnrollmentController::UpdateState(AutoEnrollmentState new_state) { LOG(WARNING) << "New auto-enrollment state: " << AutoEnrollmentStateToString(new_state); @@ -622,45 +297,15 @@ } void AutoEnrollmentController::Timeout() { - if (AutoEnrollmentTypeChecker::IsUnifiedStateDeterminationEnabled()) { - // This can actually happen in some cases, for example when state key - // generation is waiting for time sync or the server just doesn't reply and - // keeps the connection open. - LOG(ERROR) << "EnrollmentStateFetcher didn't complete within time limit."; - UpdateState(base::unexpected(AutoEnrollmentSafeguardTimeoutError{})); - ReportTimeoutUMA(AutoEnrollmentControllerTimeoutReport::kTimeoutUnified); - return; - } + // The timer is only started if Unified State Determination is enabled. + CHECK(AutoEnrollmentTypeChecker::IsUnifiedStateDeterminationEnabled()); - // When tightening the FRE flows, as a cautionary measure (to prevent - // interference with consumer devices) timeout was chosen to only enforce FRE - // for EXPLICITLY_REQUIRED. - // TODO(igorcov): Investigate the remaining causes of hitting timeout and - // potentially either remove the timeout altogether or enforce FRE in the - // REQUIRED case as well. - if (client_start_weak_factory_.HasWeakPtrs() && - auto_enrollment_check_type_ != - AutoEnrollmentTypeChecker::CheckType:: - kForcedReEnrollmentExplicitlyRequired) { - // If the callbacks to check ownership status or state keys are still - // pending, there's a bug in the code running on the device. No use in - // retrying anything, need to fix that bug. - LOG(ERROR) << "Failed to start auto-enrollment check, fix the code!"; - UpdateState(AutoEnrollmentResult::kNoEnrollment); - ReportTimeoutUMA(AutoEnrollmentControllerTimeoutReport::kTimeout); - } else { - // This can actually happen in some cases, for example when state key - // generation is waiting for time sync or the server just doesn't reply and - // keeps the connection open. - LOG(ERROR) << "AutoEnrollmentClient didn't complete within time limit."; - UpdateState(base::unexpected(AutoEnrollmentSafeguardTimeoutError{})); - ReportTimeoutUMA(AutoEnrollmentControllerTimeoutReport::kTimeoutFRE); - } - - client_.reset(); - - // Make sure to nuke pending `client_` start sequences. - client_start_weak_factory_.InvalidateWeakPtrs(); + // This can actually happen in some cases, for example when state key + // generation is waiting for time sync or the server just doesn't reply and + // keeps the connection open. + LOG(ERROR) << "EnrollmentStateFetcher didn't complete within time limit."; + UpdateState(base::unexpected(AutoEnrollmentSafeguardTimeoutError{})); + ReportTimeoutUMA(AutoEnrollmentControllerTimeoutReport::kTimeoutUnified); } bool AutoEnrollmentController::IsInProgress() const { @@ -670,25 +315,6 @@ VLOG(1) << "Enrollment state fetcher is already running."; return true; } - - return false; - } - - // If a client is being created or already existing, bail out. - if (client_start_weak_factory_.HasWeakPtrs() || client_) { - VLOG(1) << "Enrollment state client is already running."; - return true; - } - - // The timer runs from `Start()` where controller starts determining state, - // till `UpdateState()` where the controller receives a state or an error. - // Hence it can be used to decide whether the controller is running or not. - // If any of steps between `Start()` and `UpdateState()` are excluded from - // the timing, or the timer is extended to some other steps, the check will - // become wrong. - if (safeguard_timer_.IsRunning()) { - VLOG(1) << "State determination is already running."; - return true; } return false; @@ -706,9 +332,8 @@ } bool AutoEnrollmentController::IsGuestSigninAllowed() const { - return auto_enrollment_check_type_ != - AutoEnrollmentTypeChecker::CheckType:: - kForcedReEnrollmentExplicitlyRequired; + return state_ == AutoEnrollmentResult::kNoEnrollment || + state_ == AutoEnrollmentResult::kSuggestedEnrollment; } } // namespace policy
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.h b/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.h index 43a429c8..9b34f7c2 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.h +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_controller.h
@@ -7,28 +7,21 @@ #include <memory> #include <optional> -#include <string> -#include <vector> #include "base/callback_list.h" #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_client.h" #include "chrome/browser/ash/policy/enrollment/auto_enrollment_state.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.h" #include "chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.h" #include "chrome/browser/ash/policy/enrollment/psm/rlwe_dmserver_client_impl.h" #include "chrome/browser/ash/settings/device_settings_service.h" -#include "chromeos/ash/components/dbus/cryptohome/UserDataAuth.pb.h" #include "chromeos/ash/components/dbus/device_management/device_management_interface.pb.h" #include "chromeos/ash/components/network/network_state_handler_observer.h" namespace ash { -class InstallAttributesClient; class NetworkStateHandler; -class SystemClockSyncObservation; } // namespace ash namespace policy { @@ -36,41 +29,8 @@ class DeviceManagementService; class ServerBackedStateKeysBroker; -// Helper class to obtain FWMP flags. -// See b/268267865. -class EnrollmentFwmpHelper { - public: - using ResultCallback = base::OnceCallback<void(bool)>; - - // `install_attributes_client` has to be not nullptr. It will be used to - // obtain the FWMP flags. - explicit EnrollmentFwmpHelper( - ash::InstallAttributesClient* install_attributes_client); - EnrollmentFwmpHelper(const EnrollmentFwmpHelper&) = delete; - EnrollmentFwmpHelper& operator=(const EnrollmentFwmpHelper&) = delete; - ~EnrollmentFwmpHelper(); - - // Read FWMP.dev_disable_boot (a.k.a. block_devmode) and return the - // value asynchronously via result_callback. - // Return `false` in case of errors (e.g. `install_attributes_client_` or - // FWMP not available). - void DetermineDevDisableBoot(ResultCallback result_callback); - - private: - void RequestFirmwareManagementParameters(ResultCallback result_callback, - bool service_is_ready); - - void OnGetFirmwareManagementParametersReceived( - ResultCallback result_callback, - std::optional<device_management::GetFirmwareManagementParametersReply> - reply); - - raw_ptr<ash::InstallAttributesClient> install_attributes_client_; - base::WeakPtrFactory<EnrollmentFwmpHelper> weak_ptr_factory_{this}; -}; - -// Drives the forced re-enrollment check (for historical reasons called -// auto-enrollment check), running an `AutoEnrollmentClient` if appropriate to +// Drives the enrollment state determinatio (for historical reasons called +// auto-enrollment check), running an `EnrollmentStateFetcher` if appropriate to // make a decision. // The controller tracks network status to retry when the device is going // online in case of a prior failure. @@ -81,19 +41,6 @@ using RlweClientFactory = policy::psm::RlweDmserverClientImpl::RlweClientFactory; - // State of the system clock. - enum class SystemClockSyncState { - // This `AutoEnrollmentController` has not tried to wait for the system - // clock sync state yet. - kCanWaitForSync, - // Currently waiting for the system clock to become synchronized. - kWaitingForSync, - // Waiting for the system clock to become synchronized timed out. - kSyncFailed, - // The system clock is synchronized - kSynchronized - }; - explicit AutoEnrollmentController( scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory); @@ -124,25 +71,10 @@ const std::optional<AutoEnrollmentState>& state() const { return state_; } - // Returns the auto-enrollment check type performed by this client. - // The returned value will be `CheckType::kNone` before calling `Start()`. - AutoEnrollmentTypeChecker::CheckType auto_enrollment_check_type() const { - return auto_enrollment_check_type_; - } - // Sets the factory function that will be used to create the // `psm::RlweClient` for tests. void SetRlweClientFactoryForTesting(RlweClientFactory test_factory); - // Sets the factory that will be used to create the `AutoEnrollmentClient`. - // Ownership is not transferred when calling this - the caller must ensure - // that the `Factory` pointed to by `auto_enrollment_client_factory` remains - // valid while this `AutoEnrollmentController` is using it. - // To use the default factory again, call with nullptr. - void SetAutoEnrollmentClientFactoryForTesting( - std::unique_ptr<AutoEnrollmentClient::Factory> - auto_enrollment_client_factory); - // Sets factory that will be used to create `EnrollmentStateFetcher`. To use // the default factory again, call with `base::NullCallback()`. void SetEnrollmentStateFetcherFactoryForTesting( @@ -171,28 +103,6 @@ scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory); private: - void OnDevDisableBootDetermined(bool dev_disable_boot); - - // Determines the FRE and Initial Enrollment requirement and starts initial - // enrollment if necessary. If Initial Enrollment would be skipped and the - // system clock has not been synchronized yet, triggers waiting for system - // clock sync and will be called again when the system clock state is known. - void StartWithSystemClockSyncState(); - - // Callback for the ownership status check. - void OnOwnershipStatusCheckDone( - ash::DeviceSettingsService::OwnershipStatus status); - - // Starts the auto-enrollment client for forced re-enrollment. - void StartClientForFRE(const std::vector<std::string>& state_keys); - - // Called when the system clock has been synchronized or a timeout has been - // reached while waiting for the system clock sync. - void OnSystemClockSyncResult(bool system_clock_synchronized); - - // Starts the auto-enrollment client for initial enrollment. - void StartClientForInitialEnrollment(); - // Sets `state_` and notifies `progress_callbacks_`. void UpdateState(AutoEnrollmentState state); @@ -213,6 +123,8 @@ // `progress_callbacks_` in case cryptohome does not become available and the // timer is still running. // `service_is_ready` indicates if the cryptohome D-Bus service is ready. + // TODO(crbug.com/400446862) Analyze and (likely) remove this and related + // functions. void StartRemoveFirmwareManagementParameters(bool service_is_ready); // Callback for RemoveFirmwareManagementParameters(). If an error is received @@ -228,6 +140,8 @@ // `progress_callbacks_` in case session manager does not become available // and the timer is still running. // `service_is_ready` indicates if the session manager D-Bus service is ready. + // TODO(crbug.com/400446862) Analyze and (likely) remove this and related + // functions. void StartClearForcedReEnrollmentVpd(bool service_is_ready); // Callback for ClearForcedReEnrollmentVpd(). If an error is received @@ -248,19 +162,9 @@ // Used for retrieving device state keys. raw_ptr<ServerBackedStateKeysBroker> state_keys_broker_; - // Used for checking dev boot status. - std::unique_ptr<EnrollmentFwmpHelper> enrollment_fwmp_helper_; - std::optional<AutoEnrollmentState> state_; ProgressCallbackList progress_callbacks_; - std::unique_ptr<AutoEnrollmentClient> client_; - - // This will be used to create the `client_`. It can be set using - // `SetAutoEnrollmentClientFactoryForTesting`. - std::unique_ptr<AutoEnrollmentClient::Factory> - auto_enrollment_client_factory_; - // Constructs the PSM RLWE client. It will either create a fake or real // implementation of the client. // It is only used for PSM during creating the client for initial enrollment. @@ -286,39 +190,15 @@ // `SetEnrollmentStateFetcherFactoryForTesting`. EnrollmentStateFetcher::Factory enrollment_state_fetcher_factory_; - bool dev_disable_boot_ = false; - - // Which type of auto-enrollment check is being performed by this - // `AutoEnrollmentClient`. - AutoEnrollmentTypeChecker::CheckType auto_enrollment_check_type_ = - AutoEnrollmentTypeChecker::CheckType:: - kForcedReEnrollmentExplicitlyRequired; - // Shared factory for outgoing network requests. scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory_; - // Utility for waiting until the system clock has been synchronized. - std::unique_ptr<ash::SystemClockSyncObservation> - system_clock_sync_observation_; - raw_ptr<ash::NetworkStateHandler> network_state_handler_; // Observes network state and calls `PortalStateChanged` when it changes from // the start until the auto-enrollment state is resolved. Triggers a retry // when the device goes online. ash::NetworkStateHandlerScopedObservation network_state_observation_{this}; - // Current system clock sync state. This is only modified in - // `OnSystemClockSyncResult` after `system_clock_sync_wait_requested_` has - // been set to true. - SystemClockSyncState system_clock_sync_state_ = - SystemClockSyncState::kCanWaitForSync; - - // Keeps track of number of tries to request state keys. - int request_state_keys_tries_ = 0; - - // TODO(igorcov): Merge the two weak_ptr factories in one. - base::WeakPtrFactory<AutoEnrollmentController> client_start_weak_factory_{ - this}; base::WeakPtrFactory<AutoEnrollmentController> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_controller_unittest.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_controller_unittest.cc index 6a91aaf4..21c2f3ad 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_controller_unittest.cc +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_controller_unittest.cc
@@ -20,11 +20,11 @@ #include "base/test/test_future.h" #include "chrome/browser/ash/login/oobe_configuration.h" #include "chrome/browser/ash/policy/enrollment/auto_enrollment_state.h" +#include "chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.h" #include "chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.h" #include "chrome/browser/ash/policy/server_backed_state/server_backed_state_keys_broker.h" #include "chromeos/ash/components/dbus/device_management/fake_install_attributes_client.h" #include "chromeos/ash/components/dbus/session_manager/fake_session_manager_client.h" -#include "chromeos/ash/components/dbus/system_clock/fake_system_clock_client.h" #include "chromeos/ash/components/install_attributes/stub_install_attributes.h" #include "chromeos/ash/components/network/network_state.h" #include "chromeos/ash/components/network/network_state_handler.h" @@ -272,9 +272,6 @@ task_environment_.FastForwardBy(kSafeguardTimeout); })); - EXPECT_EQ(controller.auto_enrollment_check_type(), - AutoEnrollmentTypeChecker::CheckType:: - kForcedReEnrollmentExplicitlyRequired); EXPECT_FALSE(controller.SafeguardTimerForTesting().IsRunning()); EXPECT_EQ(controller.state(), base::unexpected(AutoEnrollmentError( AutoEnrollmentSafeguardTimeoutError{}))); @@ -296,9 +293,6 @@ } task_environment_.FastForwardBy(base::TimeDelta()); - EXPECT_EQ(controller.auto_enrollment_check_type(), - AutoEnrollmentTypeChecker::CheckType:: - kForcedReEnrollmentExplicitlyRequired); EXPECT_FALSE(controller.state().has_value()); EXPECT_TRUE(controller.SafeguardTimerForTesting().IsRunning());
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_state_message_processor.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_state_message_processor.cc deleted file mode 100644 index e15bdbbb..0000000 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_state_message_processor.cc +++ /dev/null
@@ -1,325 +0,0 @@ -// Copyright 2022 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/policy/enrollment/auto_enrollment_state_message_processor.h" - -#include <memory> -#include <optional> -#include <string> - -#include "base/logging.h" -#include "base/strings/strcat.h" -#include "base/strings/string_number_conversions.h" -#include "chrome/browser/ash/policy/server_backed_state/server_backed_device_state.h" -#include "components/policy/proto/device_management_backend.pb.h" - -// TODO(crbug.com/40805389): Logging as "WARNING" throughout the file to make -// sure it's preserved in the logs. - -namespace policy { - -namespace { - -namespace em = ::enterprise_management; - -// Converts a restore mode enum value from the DM protocol for FRE into the -// corresponding prefs string constant. -std::string ConvertRestoreMode( - em::DeviceStateRetrievalResponse::RestoreMode restore_mode) { - switch (restore_mode) { - case em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE: - return std::string(); - case em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_REQUESTED: - return kDeviceStateRestoreModeReEnrollmentRequested; - case em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ENFORCED: - return kDeviceStateRestoreModeReEnrollmentEnforced; - case em::DeviceStateRetrievalResponse::RESTORE_MODE_DISABLED: - return kDeviceStateModeDisabled; - case em::DeviceStateRetrievalResponse::RESTORE_MODE_REENROLLMENT_ZERO_TOUCH: - return kDeviceStateRestoreModeReEnrollmentZeroTouch; - } -} - -// Converts a enterprise_management::LicenseType_LicenseTypeEnum -// for AutoEnrollment to it corresponding string. -std::string ConvertAutoEnrollmentLicenseType( - ::enterprise_management::LicenseType_LicenseTypeEnum license_type) { - switch (license_type) { - case em::LicenseType::UNDEFINED: - return std::string(); - case em::LicenseType::CDM_PERPETUAL: - return kDeviceStateLicenseTypeEnterprise; - case em::LicenseType::CDM_ANNUAL: - return kDeviceStateLicenseTypeEnterprise; - case em::LicenseType::KIOSK: - return kDeviceStateLicenseTypeTerminal; - case em::LicenseType::CDM_PACKAGED: - return kDeviceStateLicenseTypeEnterprise; - } -} - -// Converts an initial enrollment mode enum value from the DM protocol for -// initial enrollment into the corresponding prefs string constant. -std::string ConvertInitialEnrollmentMode( - em::DeviceInitialEnrollmentStateResponse::InitialEnrollmentMode - initial_enrollment_mode) { - switch (initial_enrollment_mode) { - case em::DeviceInitialEnrollmentStateResponse::INITIAL_ENROLLMENT_MODE_NONE: - return std::string(); - case em::DeviceInitialEnrollmentStateResponse:: - INITIAL_ENROLLMENT_MODE_ENROLLMENT_ENFORCED: - return kDeviceStateInitialModeEnrollmentEnforced; - case em::DeviceInitialEnrollmentStateResponse:: - INITIAL_ENROLLMENT_MODE_ZERO_TOUCH_ENFORCED: - return kDeviceStateInitialModeEnrollmentZeroTouch; - case em::DeviceInitialEnrollmentStateResponse:: - INITIAL_ENROLLMENT_MODE_DISABLED: - return kDeviceStateModeDisabled; - case em::DeviceInitialEnrollmentStateResponse:: - INITIAL_ENROLLMENT_MODE_TOKEN_ENROLLMENT_ENFORCED: - return kDeviceStateInitialModeTokenEnrollment; - } -} - -// Converts an assigned upgrade type enum value from the DM protocol for -// initial enrollment into the corresponding prefs string constant. -std::string ConvertAssignedUpgradeType( - em::DeviceInitialEnrollmentStateResponse::AssignedUpgradeType - assigned_upgrade_type) { - switch (assigned_upgrade_type) { - case em::DeviceInitialEnrollmentStateResponse:: - ASSIGNED_UPGRADE_TYPE_UNSPECIFIED: - return std::string(); - case em::DeviceInitialEnrollmentStateResponse:: - ASSIGNED_UPGRADE_TYPE_CHROME_ENTERPRISE: - return kDeviceStateAssignedUpgradeTypeChromeEnterprise; - case em::DeviceInitialEnrollmentStateResponse:: - ASSIGNED_UPGRADE_TYPE_KIOSK_AND_SIGNAGE: - return kDeviceStateAssignedUpgradeTypeKiosk; - } -} - -// Converts a license packaging sku enum value from the DM protocol for initial -// enrollment into the corresponding prefs string constant. -std::string ConvertLicenseType( - em::DeviceInitialEnrollmentStateResponse::LicensePackagingSKU license_sku) { - switch (license_sku) { - case em::DeviceInitialEnrollmentStateResponse::NOT_EXIST: - return std::string(); - case em::DeviceInitialEnrollmentStateResponse::CHROME_ENTERPRISE: - return kDeviceStateLicenseTypeEnterprise; - case em::DeviceInitialEnrollmentStateResponse::CHROME_EDUCATION: - return kDeviceStateLicenseTypeEducation; - case em::DeviceInitialEnrollmentStateResponse::CHROME_TERMINAL: - return kDeviceStateLicenseTypeTerminal; - } -} - -} // namespace - -// Generates a request to download the device state during Initial Enrollment. -class InitialEnrollmentStateMessageProcessor - : public AutoEnrollmentStateMessageProcessor { - public: - InitialEnrollmentStateMessageProcessor( - const std::string& device_serial_number, - const std::string& device_brand_code, - std::optional<std::string> flex_enrollment_token) - : device_serial_number_(device_serial_number), - device_brand_code_(device_brand_code), - flex_enrollment_token_(std::move(flex_enrollment_token)) {} - - DeviceManagementService::JobConfiguration::JobType GetJobType() - const override { - return DeviceManagementService::JobConfiguration:: - TYPE_INITIAL_ENROLLMENT_STATE_RETRIEVAL; - } - - void FillRequest(em::DeviceManagementRequest* request) override { - auto* inner_request = - request->mutable_device_initial_enrollment_state_request(); - inner_request->set_brand_code(device_brand_code_); - inner_request->set_serial_number(device_serial_number_); - if (flex_enrollment_token_.has_value()) { - inner_request->set_enrollment_token(flex_enrollment_token_.value()); - } - } - - std::optional<ParsedResponse> ParseResponse( - const em::DeviceManagementResponse& response) override { - if (!response.has_device_initial_enrollment_state_response()) { - LOG(ERROR) << "Server failed to provide initial enrollment response."; - return std::nullopt; - } - - return ParseInitialEnrollmentStateResponse( - response.device_initial_enrollment_state_response()); - } - - static std::optional<ParsedResponse> ParseInitialEnrollmentStateResponse( - const em::DeviceInitialEnrollmentStateResponse& state_response) { - ParsedResponse parsed_response; - - if (state_response.has_initial_enrollment_mode()) { - parsed_response.restore_mode = ConvertInitialEnrollmentMode( - state_response.initial_enrollment_mode()); - } else { - // Unknown initial enrollment mode - treat as no enrollment. - parsed_response.restore_mode.clear(); - } - - if (state_response.has_management_domain()) - parsed_response.management_domain = state_response.management_domain(); - - if (state_response.has_is_license_packaged_with_device()) { - parsed_response.is_license_packaged_with_device = - state_response.is_license_packaged_with_device(); - } - - if (state_response.has_license_packaging_sku()) { - parsed_response.license_type = - ConvertLicenseType(state_response.license_packaging_sku()); - } - - if (state_response.has_assigned_upgrade_type()) { - parsed_response.assigned_upgrade_type = - ConvertAssignedUpgradeType(state_response.assigned_upgrade_type()); - } - - if (state_response.has_disabled_state()) { - parsed_response.disabled_message = - state_response.disabled_state().message(); - } - - LOG(WARNING) << "Received initial_enrollment_mode=" - << state_response.initial_enrollment_mode() << " (" - << parsed_response.restore_mode << "). "; - - LOG(WARNING) << (state_response.is_license_packaged_with_device() - ? "Device has a packaged license for management." - : "No packaged license. "); - - LOG(WARNING) << (state_response.has_assigned_upgrade_type() - ? base::StrCat( - {"Assigned upgrade type=", - base::NumberToString( - state_response.assigned_upgrade_type()), - " (", - parsed_response.assigned_upgrade_type.value_or( - std::string()), - ")."}) - : "No assigned upgrade type."); - - return parsed_response; - } - - private: - // Serial number of the device. - std::string device_serial_number_; - // 4-character brand code of the device. - std::string device_brand_code_; - - const std::optional<std::string> flex_enrollment_token_; -}; - -// Generates a request to download the device state during Forced Re-Enrollment -// (FRE). -class FREStateMessageProcessor : public AutoEnrollmentStateMessageProcessor { - public: - explicit FREStateMessageProcessor(const std::string& server_backed_state_key) - : server_backed_state_key_(server_backed_state_key) {} - - DeviceManagementService::JobConfiguration::JobType GetJobType() - const override { - return DeviceManagementService::JobConfiguration:: - TYPE_DEVICE_STATE_RETRIEVAL; - } - - void FillRequest(em::DeviceManagementRequest* request) override { - request->mutable_device_state_retrieval_request() - ->set_server_backed_state_key(server_backed_state_key_); - } - - std::optional<ParsedResponse> ParseResponse( - const em::DeviceManagementResponse& response) override { - if (!response.has_device_state_retrieval_response()) { - LOG(ERROR) << "Server failed to provide auto-enrollment response."; - return std::nullopt; - } - - const em::DeviceStateRetrievalResponse& state_response = - response.device_state_retrieval_response(); - const auto restore_mode = state_response.restore_mode(); - - if (restore_mode == em::DeviceStateRetrievalResponse::RESTORE_MODE_NONE && - state_response.has_initial_state_response()) { - LOG(WARNING) << "Received restore_mode=" << restore_mode << " (" - << ConvertRestoreMode(restore_mode) << ")" - << " . Parsing included initial state response."; - - return InitialEnrollmentStateMessageProcessor:: - ParseInitialEnrollmentStateResponse( - state_response.initial_state_response()); - } else { - ParsedResponse parsed_response; - - parsed_response.restore_mode = ConvertRestoreMode(restore_mode); - - if (state_response.has_management_domain()) - parsed_response.management_domain = state_response.management_domain(); - - if (state_response.has_disabled_state()) { - parsed_response.disabled_message = - state_response.disabled_state().message(); - } - - // Package license is not available during the re-enrollment - parsed_response.is_license_packaged_with_device.reset(); - - if (state_response.has_license_type()) { - parsed_response.license_type = ConvertAutoEnrollmentLicenseType( - state_response.license_type().license_type()); - } - - LOG(WARNING) << "Received restore_mode=" << restore_mode << " (" - << parsed_response.restore_mode << ")."; - - return parsed_response; - } - } - - private: - std::string server_backed_state_key_; -}; - -AutoEnrollmentStateMessageProcessor::ParsedResponse::ParsedResponse() = default; - -AutoEnrollmentStateMessageProcessor::ParsedResponse::~ParsedResponse() = - default; - -AutoEnrollmentStateMessageProcessor::ParsedResponse::ParsedResponse( - const ParsedResponse&) = default; - -AutoEnrollmentStateMessageProcessor::~AutoEnrollmentStateMessageProcessor() = - default; - -// static -std::unique_ptr<AutoEnrollmentStateMessageProcessor> -AutoEnrollmentStateMessageProcessor::CreateForFRE( - const std::string& server_backed_state_key) { - return std::make_unique<FREStateMessageProcessor>(server_backed_state_key); -} - -// static -std::unique_ptr<AutoEnrollmentStateMessageProcessor> -AutoEnrollmentStateMessageProcessor::CreateForInitialEnrollment( - const std::string& device_serial_number, - const std::string& device_brand_code, - std::optional<std::string> flex_enrollment_token) { - return std::make_unique<InitialEnrollmentStateMessageProcessor>( - device_serial_number, device_brand_code, - std::move(flex_enrollment_token)); -} - -} // namespace policy
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_state_message_processor.h b/chrome/browser/ash/policy/enrollment/auto_enrollment_state_message_processor.h deleted file mode 100644 index a5d1995..0000000 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_state_message_processor.h +++ /dev/null
@@ -1,69 +0,0 @@ -// Copyright 2022 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_POLICY_ENROLLMENT_AUTO_ENROLLMENT_STATE_MESSAGE_PROCESSOR_H_ -#define CHROME_BROWSER_ASH_POLICY_ENROLLMENT_AUTO_ENROLLMENT_STATE_MESSAGE_PROCESSOR_H_ - -#include <memory> -#include <optional> -#include <string> - -#include "components/policy/core/common/cloud/device_management_service.h" - -namespace enterprise_management { -class DeviceManagementRequest; -class DeviceManagementResponse; -} // namespace enterprise_management - -namespace policy { - -// Subclasses of this class generate the request to download the device state -// (after determining that there is server-side device state) and parse the -// response. -class AutoEnrollmentStateMessageProcessor { - public: - // Returns a message processor for Forced Re-enrollment. - static std::unique_ptr<AutoEnrollmentStateMessageProcessor> CreateForFRE( - const std::string& server_backed_state_key); - - // Returns a message processor for Initial enrollment. - static std::unique_ptr<AutoEnrollmentStateMessageProcessor> - CreateForInitialEnrollment(const std::string& device_serial_number, - const std::string& device_brand_code, - std::optional<std::string> flex_enrollment_token); - - virtual ~AutoEnrollmentStateMessageProcessor(); - - // Parsed fields of DeviceManagementResponse. - struct ParsedResponse { - ParsedResponse(); - ParsedResponse(const ParsedResponse&); - ~ParsedResponse(); - - std::string restore_mode; - std::optional<std::string> management_domain; - std::optional<std::string> disabled_message; - std::optional<bool> is_license_packaged_with_device; - std::optional<std::string> license_type; - std::optional<std::string> assigned_upgrade_type; - }; - - // Returns the request job type. This must match the request filled in - // `FillRequest`. - virtual DeviceManagementService::JobConfiguration::JobType GetJobType() - const = 0; - - // Fills the specific request type in `request`. - virtual void FillRequest( - enterprise_management::DeviceManagementRequest* request) = 0; - - // Parses the `response`. If it is valid, returns an instance of - // ParsedResponse. Otherwise, returns nullopt. - virtual std::optional<ParsedResponse> ParseResponse( - const enterprise_management::DeviceManagementResponse& response) = 0; -}; - -} // namespace policy - -#endif // CHROME_BROWSER_ASH_POLICY_ENROLLMENT_AUTO_ENROLLMENT_STATE_MESSAGE_PROCESSOR_H_
diff --git a/chrome/browser/ash/policy/enrollment/fake_auto_enrollment_client.cc b/chrome/browser/ash/policy/enrollment/fake_auto_enrollment_client.cc deleted file mode 100644 index 65f6633..0000000 --- a/chrome/browser/ash/policy/enrollment/fake_auto_enrollment_client.cc +++ /dev/null
@@ -1,66 +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 "chrome/browser/ash/policy/enrollment/fake_auto_enrollment_client.h" - -#include "chrome/browser/ash/login/oobe_configuration.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_state.h" -#include "chrome/browser/ash/policy/enrollment/psm/rlwe_dmserver_client.h" -#include "services/network/public/cpp/shared_url_loader_factory.h" - -namespace policy { - -FakeAutoEnrollmentClient::FactoryImpl::FactoryImpl( - const base::RepeatingCallback<void(FakeAutoEnrollmentClient*)>& - fake_client_created_callback) - : fake_client_created_callback_(fake_client_created_callback) {} - -FakeAutoEnrollmentClient::FactoryImpl::~FactoryImpl() = default; - -std::unique_ptr<AutoEnrollmentClient> -FakeAutoEnrollmentClient::FactoryImpl::CreateForFRE( - const AutoEnrollmentClient::ProgressCallback& progress_callback, - DeviceManagementService* device_management_service, - PrefService* local_state, - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - const std::string& server_backed_state_key, - int power_initial, - int power_limit) { - std::unique_ptr<FakeAutoEnrollmentClient> fake_client = - std::make_unique<FakeAutoEnrollmentClient>(progress_callback); - fake_client_created_callback_.Run(fake_client.get()); - return fake_client; -} - -std::unique_ptr<AutoEnrollmentClient> -FakeAutoEnrollmentClient::FactoryImpl::CreateForInitialEnrollment( - const AutoEnrollmentClient::ProgressCallback& progress_callback, - DeviceManagementService* device_management_service, - PrefService* local_state, - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - const std::string& device_serial_number, - const std::string& device_brand_code, - std::unique_ptr<psm::RlweDmserverClient> psm_rlwe_dmserver_client, - ash::OobeConfiguration* oobe_config) { - std::unique_ptr<FakeAutoEnrollmentClient> fake_client = - std::make_unique<FakeAutoEnrollmentClient>(progress_callback); - fake_client_created_callback_.Run(fake_client.get()); - return fake_client; -} - -FakeAutoEnrollmentClient::FakeAutoEnrollmentClient( - const ProgressCallback& progress_callback) - : progress_callback_(progress_callback) {} - -FakeAutoEnrollmentClient::~FakeAutoEnrollmentClient() = default; - -void FakeAutoEnrollmentClient::Start() {} - -void FakeAutoEnrollmentClient::Retry() {} - -void FakeAutoEnrollmentClient::SetState(AutoEnrollmentState target_state) { - progress_callback_.Run(target_state); -} - -} // namespace policy
diff --git a/chrome/browser/ash/policy/enrollment/fake_auto_enrollment_client.h b/chrome/browser/ash/policy/enrollment/fake_auto_enrollment_client.h deleted file mode 100644 index 9266836..0000000 --- a/chrome/browser/ash/policy/enrollment/fake_auto_enrollment_client.h +++ /dev/null
@@ -1,91 +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 CHROME_BROWSER_ASH_POLICY_ENROLLMENT_FAKE_AUTO_ENROLLMENT_CLIENT_H_ -#define CHROME_BROWSER_ASH_POLICY_ENROLLMENT_FAKE_AUTO_ENROLLMENT_CLIENT_H_ - -#include <memory> -#include <string> - -#include "base/functional/callback.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_client.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_state.h" - -class PrefService; - -namespace policy::psm { -class RlweDmserverClient; -} - -namespace ash { -class OobeConfiguration; -} // namespace ash - -namespace policy { - -class DeviceManagementService; - -// A fake AutoEnrollmentClient. The test code can control its state. -class FakeAutoEnrollmentClient : public AutoEnrollmentClient { - public: - // A factory that creates |FakeAutoEnrollmentClient|s. - class FactoryImpl : public Factory { - public: - // The factory will notify |fake_client_created_callback| when a - // |AutoEnrollmentClient| has been created through one of its methods. - explicit FactoryImpl( - const base::RepeatingCallback<void(FakeAutoEnrollmentClient*)>& - fake_client_created_callback); - - FactoryImpl(const FactoryImpl&) = delete; - FactoryImpl& operator=(const FactoryImpl&) = delete; - - ~FactoryImpl() override; - - std::unique_ptr<AutoEnrollmentClient> CreateForFRE( - const ProgressCallback& progress_callback, - DeviceManagementService* device_management_service, - PrefService* local_state, - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - const std::string& server_backed_state_key, - int power_initial, - int power_limit) override; - - std::unique_ptr<AutoEnrollmentClient> CreateForInitialEnrollment( - const ProgressCallback& progress_callback, - DeviceManagementService* device_management_service, - PrefService* local_state, - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - const std::string& device_serial_number, - const std::string& device_brand_code, - std::unique_ptr<psm::RlweDmserverClient> psm_rlwe_dmserver_client, - ash::OobeConfiguration* oobe_config) override; - - private: - base::RepeatingCallback<void(FakeAutoEnrollmentClient*)> - fake_client_created_callback_; - }; - - explicit FakeAutoEnrollmentClient(const ProgressCallback& progress_callback); - - FakeAutoEnrollmentClient(const FakeAutoEnrollmentClient&) = delete; - FakeAutoEnrollmentClient& operator=(const FakeAutoEnrollmentClient&) = delete; - - ~FakeAutoEnrollmentClient() override; - - // The methods do not fire state change until `SetState` is called. - void Start() override; - void Retry() override; - - // Sets the state and notifies the |ProgressCallback| passed to the - // constructor. - void SetState(AutoEnrollmentState target_state); - - private: - ProgressCallback progress_callback_; -}; - -} // namespace policy - -#endif // CHROME_BROWSER_ASH_POLICY_ENROLLMENT_FAKE_AUTO_ENROLLMENT_CLIENT_H_
diff --git a/chrome/browser/ash/policy/enrollment/psm/BUILD.gn b/chrome/browser/ash/policy/enrollment/psm/BUILD.gn index c07ca8a..5523d72 100644 --- a/chrome/browser/ash/policy/enrollment/psm/BUILD.gn +++ b/chrome/browser/ash/policy/enrollment/psm/BUILD.gn
@@ -8,8 +8,6 @@ static_library("psm") { sources = [ - "construct_rlwe_id.cc", - "construct_rlwe_id.h", "fake_rlwe_dmserver_client.cc", "fake_rlwe_dmserver_client.h", "rlwe_dmserver_client.h", @@ -51,7 +49,6 @@ testonly = true sources = [ - "construct_rlwe_id_unittest.cc", "rlwe_dmserver_client_impl_unittest.cc", "rlwe_test_support_unittest.cc", ]
diff --git a/chrome/browser/ash/policy/enrollment/psm/construct_rlwe_id.cc b/chrome/browser/ash/policy/enrollment/psm/construct_rlwe_id.cc deleted file mode 100644 index 9214836..0000000 --- a/chrome/browser/ash/policy/enrollment/psm/construct_rlwe_id.cc +++ /dev/null
@@ -1,45 +0,0 @@ -// Copyright 2022 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/policy/enrollment/psm/construct_rlwe_id.h" - -#include <optional> -#include <string> -#include <string_view> - -#include "base/check.h" -#include "base/strings/string_number_conversions.h" -#include "chromeos/ash/components/system/statistics_provider.h" -#include "third_party/private_membership/src/private_membership_rlwe.pb.h" - -namespace psm_rlwe = private_membership::rlwe; - -namespace policy::psm { - -psm_rlwe::RlwePlaintextId ConstructRlweId() { - // Retrieve the device's serial number and RLZ brand code. - ash::system::StatisticsProvider* provider = - ash::system::StatisticsProvider::GetInstance(); - const std::optional<std::string_view> device_serial_number = - provider->GetMachineID(); - const std::optional<std::string_view> device_rlz_brand_code = - provider->GetMachineStatistic(ash::system::kRlzBrandCodeKey); - - // Verify the existence of the device's data. - CHECK(device_serial_number); - CHECK(!device_serial_number->empty()); - CHECK(device_rlz_brand_code); - CHECK(!device_rlz_brand_code->empty()); - - // Construct the encrypted PSM RLWE ID. - psm_rlwe::RlwePlaintextId rlwe_id; - std::string rlz_brand_code_hex = base::HexEncode( - device_rlz_brand_code->data(), device_rlz_brand_code->size()); - rlwe_id.set_sensitive_id(rlz_brand_code_hex + "/" + - std::string(device_serial_number.value())); - - return rlwe_id; -} - -} // namespace policy::psm
diff --git a/chrome/browser/ash/policy/enrollment/psm/construct_rlwe_id.h b/chrome/browser/ash/policy/enrollment/psm/construct_rlwe_id.h deleted file mode 100644 index a92eca60..0000000 --- a/chrome/browser/ash/policy/enrollment/psm/construct_rlwe_id.h +++ /dev/null
@@ -1,25 +0,0 @@ -// Copyright 2022 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_POLICY_ENROLLMENT_PSM_CONSTRUCT_RLWE_ID_H_ -#define CHROME_BROWSER_ASH_POLICY_ENROLLMENT_PSM_CONSTRUCT_RLWE_ID_H_ - -namespace private_membership::rlwe { -class RlwePlaintextId; -} // namespace private_membership::rlwe - -namespace policy::psm { - -// Constructs the encrypted PSM RLWE ID through device's serial number -// and RLZ brand code that will be retrieved through StatisticsProvider. -// For more information, see go/psm-rlwe-id. -// -// Note: The device's serial number and RLZ brand code values must exist and -// able to be retrieved, using their corresponding keys, from the -// StaisticsProvider. Otherwise the implementation will CHECK-fail. -private_membership::rlwe::RlwePlaintextId ConstructRlweId(); - -} // namespace policy::psm - -#endif // CHROME_BROWSER_ASH_POLICY_ENROLLMENT_PSM_CONSTRUCT_RLWE_ID_H_
diff --git a/chrome/browser/ash/policy/enrollment/psm/construct_rlwe_id_unittest.cc b/chrome/browser/ash/policy/enrollment/psm/construct_rlwe_id_unittest.cc deleted file mode 100644 index 6fc7807..0000000 --- a/chrome/browser/ash/policy/enrollment/psm/construct_rlwe_id_unittest.cc +++ /dev/null
@@ -1,42 +0,0 @@ -// Copyright 2022 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/policy/enrollment/psm/construct_rlwe_id.h" - -#include "chromeos/ash/components/system/fake_statistics_provider.h" -#include "chromeos/ash/components/system/statistics_provider.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/private_membership/src/private_membership_rlwe.pb.h" - -namespace psm_rlwe = private_membership::rlwe; - -namespace { -constexpr char kTestSerialNumber[] = "111111"; -constexpr char kTestBrandCode[] = "TEST"; - -// `kTestBrandCode` encoded in hex. -constexpr char kTestBrandCodeHex[] = "54455354"; -} // namespace - -class ConstructRlweIdTest : public testing::Test { - public: - ash::system::ScopedFakeStatisticsProvider fake_statistics_provider_; -}; - -TEST_F(ConstructRlweIdTest, VerifyConstructedRlweId) { - // Sets the values for serial number and RLZ brand code as the values must be - // present to construct the RLWE ID without CHECK-failures. - fake_statistics_provider_.SetMachineStatistic(ash::system::kSerialNumberKey, - kTestSerialNumber); - fake_statistics_provider_.SetMachineStatistic(ash::system::kRlzBrandCodeKey, - kTestBrandCode); - - // RLZ brand code "TEST" (as hex), "/" separator, and serial number "111111". - const std::string kExpectedRlweIdStr = - std::string(kTestBrandCodeHex) + "/" + std::string(kTestSerialNumber); - - // Construct the PSM RLWE ID, and verify its value. - psm_rlwe::RlwePlaintextId rlwe_id = policy::psm::ConstructRlweId(); - EXPECT_EQ(rlwe_id.sensitive_id(), kExpectedRlweIdStr); -}
diff --git a/chrome/browser/ash/scanning/lorgnette_scanner_manager.cc b/chrome/browser/ash/scanning/lorgnette_scanner_manager.cc index 2954013..dc034f08 100644 --- a/chrome/browser/ash/scanning/lorgnette_scanner_manager.cc +++ b/chrome/browser/ash/scanning/lorgnette_scanner_manager.cc
@@ -60,7 +60,9 @@ "|DS-900WN" "|DS-C420W" "|DS-C480W" + "|EM-C7100" "|EM-C800" + "|EM-C8100" "|ES-C320W" "|ES-C380W" "|LM-C400" @@ -80,6 +82,10 @@ "|PX-M7090FX" "|PX-M7110F" "|PX-M7110FP" + "|PX-M7120F" + "|PX-M7120FP" + "|PX-M8000FX" + "|PX-M8010FX" "|PX-M860F" "|PX-M880FX" "|PX-M890FX"
diff --git a/chrome/browser/ash/test/BUILD.gn b/chrome/browser/ash/test/BUILD.gn index c333860..3fb31f6 100644 --- a/chrome/browser/ash/test/BUILD.gn +++ b/chrome/browser/ash/test/BUILD.gn
@@ -10,18 +10,23 @@ testonly = true sources = [ - "kiosk_logged_in_browser_test_mixin.cc", - "kiosk_logged_in_browser_test_mixin.h", + "kiosk_app_logged_in_browser_test_mixin.cc", + "kiosk_app_logged_in_browser_test_mixin.h", "public_account_logged_in_browser_test_mixin.cc", "public_account_logged_in_browser_test_mixin.h", "regular_logged_in_browser_test_mixin.cc", "regular_logged_in_browser_test_mixin.h", + "web_kiosk_app_logged_in_browser_test_mixin.cc", + "web_kiosk_app_logged_in_browser_test_mixin.h", ] deps = [ "//ash/constants", "//base", + "//chrome/browser/ash/settings", + "//chrome/browser/ash/settings:test_support", "//chrome/test:test_support_ui", + "//chromeos/ash/components/settings", "//components/account_id", "//components/prefs", "//components/user_manager:test_support",
diff --git a/chrome/browser/ash/test/DEPS b/chrome/browser/ash/test/DEPS index 092281e9..6ebf30c 100644 --- a/chrome/browser/ash/test/DEPS +++ b/chrome/browser/ash/test/DEPS
@@ -22,6 +22,8 @@ "+ui/message_center", ], ".*_browser_test_mixin\.(h|cc)": [ + "+chrome/browser/ash/settings/scoped_testing_cros_settings.h", + "+chrome/browser/ash/settings/stub_cros_settings_provider.h", "+chrome/test/base/mixin_based_in_process_browser_test.h", ], }
diff --git a/chrome/browser/ash/test/kiosk_app_logged_in_browser_test_mixin.cc b/chrome/browser/ash/test/kiosk_app_logged_in_browser_test_mixin.cc new file mode 100644 index 0000000..9e7314a8 --- /dev/null +++ b/chrome/browser/ash/test/kiosk_app_logged_in_browser_test_mixin.cc
@@ -0,0 +1,58 @@ +// Copyright 2025 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/test/kiosk_app_logged_in_browser_test_mixin.h" + +#include "ash/constants/ash_switches.h" +#include "base/values.h" +#include "chrome/browser/ash/settings/stub_cros_settings_provider.h" +#include "chromeos/ash/components/settings/cros_settings_names.h" +#include "components/account_id/account_id.h" +#include "components/policy/core/common/device_local_account_type.h" +#include "components/prefs/pref_service.h" +#include "components/user_manager/test_helper.h" + +namespace ash { + +KioskAppLoggedInBrowserTestMixin::KioskAppLoggedInBrowserTestMixin( + InProcessBrowserTestMixinHost* host, + std::string_view account_id) + : InProcessBrowserTestMixin(host), + user_id_(policy::GenerateDeviceLocalAccountUserId( + account_id, + policy::DeviceLocalAccountType::kKioskApp)) { + scoped_testing_cros_settings_.device_settings()->Set( + ash::kAccountsPrefDeviceLocalAccounts, + base::Value(base::Value::List().Append( + base::Value::Dict() + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyId, account_id) + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyType, + static_cast<int>(policy::DeviceLocalAccountType::kKioskApp)) + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyEphemeralMode, + static_cast<int>(false)) + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyKioskAppId, + "fake-kiosk-app-id") + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyKioskAppUpdateURL, + "fake-kiosk-url")))); +} + +KioskAppLoggedInBrowserTestMixin::~KioskAppLoggedInBrowserTestMixin() = default; + +void KioskAppLoggedInBrowserTestMixin::SetUpCommandLine( + base::CommandLine* command_line) { + command_line->AppendSwitchASCII(ash::switches::kLoginUser, user_id_); + command_line->AppendSwitchASCII(ash::switches::kLoginProfile, + user_manager::TestHelper::GetFakeUsernameHash( + AccountId::FromUserEmail(user_id_))); + + // Do not automatically start the kiosk app. + command_line->AppendSwitch(ash::switches::kPreventKioskAutolaunchForTesting); +} + +void KioskAppLoggedInBrowserTestMixin::SetUpLocalStatePrefService( + PrefService* local_state) { + user_manager::TestHelper::RegisterKioskAppUser(*local_state, user_id_); +} + +} // namespace ash
diff --git a/chrome/browser/ash/test/kiosk_app_logged_in_browser_test_mixin.h b/chrome/browser/ash/test/kiosk_app_logged_in_browser_test_mixin.h new file mode 100644 index 0000000..43d33ce7 --- /dev/null +++ b/chrome/browser/ash/test/kiosk_app_logged_in_browser_test_mixin.h
@@ -0,0 +1,46 @@ +// Copyright 2025 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_TEST_KIOSK_APP_LOGGED_IN_BROWSER_TEST_MIXIN_H_ +#define CHROME_BROWSER_ASH_TEST_KIOSK_APP_LOGGED_IN_BROWSER_TEST_MIXIN_H_ + +#include <string> +#include <string_view> + +#include "chrome/browser/ash/settings/scoped_testing_cros_settings.h" +#include "chrome/test/base/mixin_based_in_process_browser_test.h" + +namespace ash { + +// Registers a new KioskApp User, and then use the user to enter +// into a kiosk app session. +class KioskAppLoggedInBrowserTestMixin : public InProcessBrowserTestMixin { + public: + // `account_id` is the ID for the KioskApp account. + // AccountId (to be used by, e.g., UserManager) is generated from the + // `account_id`. + KioskAppLoggedInBrowserTestMixin(InProcessBrowserTestMixinHost* host, + std::string_view account_id); + ~KioskAppLoggedInBrowserTestMixin() override; + + // InProcessBrowserTestMixin: + void SetUpCommandLine(base::CommandLine* command_line) override; + void SetUpLocalStatePrefService(PrefService* local_state) override; + + ScopedTestingCrosSettings& scoped_testing_cros_settings() { + return scoped_testing_cros_settings_; + } + + private: + // Email-style ID used as a part of AccountId for the given User, + // generated from the `account_id` passed to the ctor. + const std::string user_id_; + + // Injects CrosSettings value to enable Kiosk user. + ScopedTestingCrosSettings scoped_testing_cros_settings_; +}; + +} // namespace ash + +#endif // CHROME_BROWSER_ASH_TEST_KIOSK_APP_LOGGED_IN_BROWSER_TEST_MIXIN_H_
diff --git a/chrome/browser/ash/test/kiosk_logged_in_browser_test_mixin.cc b/chrome/browser/ash/test/kiosk_logged_in_browser_test_mixin.cc deleted file mode 100644 index 69bb4f5b..0000000 --- a/chrome/browser/ash/test/kiosk_logged_in_browser_test_mixin.cc +++ /dev/null
@@ -1,37 +0,0 @@ -// Copyright 2025 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/test/kiosk_logged_in_browser_test_mixin.h" - -#include "ash/constants/ash_switches.h" -#include "components/account_id/account_id.h" -#include "components/prefs/pref_service.h" -#include "components/user_manager/test_helper.h" - -namespace ash { - -KioskLoggedInBrowserTestMixin::KioskLoggedInBrowserTestMixin( - InProcessBrowserTestMixinHost* host, - std::string_view user_id) - : InProcessBrowserTestMixin(host), user_id_(user_id) {} - -KioskLoggedInBrowserTestMixin::~KioskLoggedInBrowserTestMixin() = default; - -void KioskLoggedInBrowserTestMixin::SetUpCommandLine( - base::CommandLine* command_line) { - command_line->AppendSwitchASCII(ash::switches::kLoginUser, user_id_); - command_line->AppendSwitchASCII(ash::switches::kLoginProfile, - user_manager::TestHelper::GetFakeUsernameHash( - AccountId::FromUserEmail(user_id_))); - - // Do not automatically start the kiosk app. - command_line->AppendSwitch(ash::switches::kPreventKioskAutolaunchForTesting); -} - -void KioskLoggedInBrowserTestMixin::SetUpLocalStatePrefService( - PrefService* local_state) { - user_manager::TestHelper::RegisterKioskAppUser(*local_state, user_id_); -} - -} // namespace ash
diff --git a/chrome/browser/ash/test/kiosk_logged_in_browser_test_mixin.h b/chrome/browser/ash/test/kiosk_logged_in_browser_test_mixin.h deleted file mode 100644 index c02a4ed..0000000 --- a/chrome/browser/ash/test/kiosk_logged_in_browser_test_mixin.h +++ /dev/null
@@ -1,36 +0,0 @@ -// Copyright 2025 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_TEST_KIOSK_LOGGED_IN_BROWSER_TEST_MIXIN_H_ -#define CHROME_BROWSER_ASH_TEST_KIOSK_LOGGED_IN_BROWSER_TEST_MIXIN_H_ - -#include <string> -#include <string_view> - -#include "chrome/test/base/mixin_based_in_process_browser_test.h" - -namespace ash { - -// Registers a new Kiosk User, and then use the user to enter -// into a kiosk session. -class KioskLoggedInBrowserTestMixin : public InProcessBrowserTestMixin { - public: - // `user_id` is the ID for the kiosk app user, which must satisfy - // to be used for Kiosk app user. - // See policy::GetDeviceLocalAccountType for details. - KioskLoggedInBrowserTestMixin(InProcessBrowserTestMixinHost* host, - std::string_view user_id); - ~KioskLoggedInBrowserTestMixin() override; - - // InProcessBrowserTestMixin: - void SetUpCommandLine(base::CommandLine* command_line) override; - void SetUpLocalStatePrefService(PrefService* local_state) override; - - private: - std::string user_id_; -}; - -} // namespace ash - -#endif // CHROME_BROWSER_ASH_TEST_KIOSK_LOGGED_IN_BROWSER_TEST_MIXIN_H_
diff --git a/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.cc b/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.cc index 876ca7e..4601c333 100644 --- a/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.cc +++ b/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.cc
@@ -5,7 +5,11 @@ #include "chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.h" #include "ash/constants/ash_switches.h" +#include "base/values.h" +#include "chrome/browser/ash/settings/stub_cros_settings_provider.h" +#include "chromeos/ash/components/settings/cros_settings_names.h" #include "components/account_id/account_id.h" +#include "components/policy/core/common/device_local_account_type.h" #include "components/prefs/pref_service.h" #include "components/user_manager/test_helper.h" @@ -13,8 +17,20 @@ PublicAccountLoggedInBrowserTestMixin::PublicAccountLoggedInBrowserTestMixin( InProcessBrowserTestMixinHost* host, - std::string user_id) - : InProcessBrowserTestMixin(host), user_id_(std::move(user_id)) {} + std::string_view account_id) + : InProcessBrowserTestMixin(host), + user_id_(policy::GenerateDeviceLocalAccountUserId( + account_id, + policy::DeviceLocalAccountType::kPublicSession)) { + scoped_testing_cros_settings_.device_settings()->Set( + ash::kAccountsPrefDeviceLocalAccounts, + base::Value(base::Value::List().Append( + base::Value::Dict() + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyId, account_id) + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyType, + static_cast<int>( + policy::DeviceLocalAccountType::kPublicSession))))); +} PublicAccountLoggedInBrowserTestMixin:: ~PublicAccountLoggedInBrowserTestMixin() = default;
diff --git a/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.h b/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.h index 3307b91..10f70f8 100644 --- a/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.h +++ b/chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.h
@@ -6,7 +6,9 @@ #define CHROME_BROWSER_ASH_TEST_PUBLIC_ACCOUNT_LOGGED_IN_BROWSER_TEST_MIXIN_H_ #include <string> +#include <string_view> +#include "chrome/browser/ash/settings/scoped_testing_cros_settings.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" namespace ash { @@ -15,11 +17,11 @@ // into a session. class PublicAccountLoggedInBrowserTestMixin : public InProcessBrowserTestMixin { public: - // `user_id` is the ID for the PublicAccount user, which must satisfy - // to be used for a PublicAccount user. - // See policy::GetDeviceLocalAccountType for details. + // `account_id` is the ID for the PublicSession account. + // AccountId (to be used by, e.g., UserManager) is generated from the + // `account_id`. PublicAccountLoggedInBrowserTestMixin(InProcessBrowserTestMixinHost* host, - std::string user_id); + std::string_view account_id); ~PublicAccountLoggedInBrowserTestMixin() override; // InProcessBrowserTestMixin: @@ -27,7 +29,12 @@ void SetUpLocalStatePrefService(PrefService* local_state) override; private: + // Email-style ID used as a part of AccountId for the given User, + // generated from the `account_id` passed to the ctor. const std::string user_id_; + + // Injects CrosSettings value to enable public account user. + ScopedTestingCrosSettings scoped_testing_cros_settings_; }; } // namespace ash
diff --git a/chrome/browser/ash/test/web_kiosk_app_logged_in_browser_test_mixin.cc b/chrome/browser/ash/test/web_kiosk_app_logged_in_browser_test_mixin.cc new file mode 100644 index 0000000..6631873 --- /dev/null +++ b/chrome/browser/ash/test/web_kiosk_app_logged_in_browser_test_mixin.cc
@@ -0,0 +1,60 @@ +// Copyright 2025 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/test/web_kiosk_app_logged_in_browser_test_mixin.h" + +#include "ash/constants/ash_switches.h" +#include "base/values.h" +#include "chrome/browser/ash/settings/stub_cros_settings_provider.h" +#include "chromeos/ash/components/settings/cros_settings_names.h" +#include "components/account_id/account_id.h" +#include "components/policy/core/common/device_local_account_type.h" +#include "components/prefs/pref_service.h" +#include "components/user_manager/test_helper.h" + +namespace ash { + +WebKioskAppLoggedInBrowserTestMixin::WebKioskAppLoggedInBrowserTestMixin( + InProcessBrowserTestMixinHost* host, + std::string_view account_id) + : InProcessBrowserTestMixin(host), + user_id_(policy::GenerateDeviceLocalAccountUserId( + account_id, + policy::DeviceLocalAccountType::kWebKioskApp)) { + scoped_testing_cros_settings_.device_settings()->Set( + ash::kAccountsPrefDeviceLocalAccounts, + base::Value(base::Value::List().Append( + base::Value::Dict() + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyId, account_id) + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyType, + static_cast<int>( + policy::DeviceLocalAccountType::kWebKioskApp)) + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyWebKioskUrl, + "https://fake.web.kiosk.app.url") + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyWebKioskTitle, + "fake-web-kiosk-app-title") + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyWebKioskIconUrl, + "fake-web-kiosk-app-icon-url")))); +} + +WebKioskAppLoggedInBrowserTestMixin::~WebKioskAppLoggedInBrowserTestMixin() = + default; + +void WebKioskAppLoggedInBrowserTestMixin::SetUpCommandLine( + base::CommandLine* command_line) { + command_line->AppendSwitchASCII(ash::switches::kLoginUser, user_id_); + command_line->AppendSwitchASCII(ash::switches::kLoginProfile, + user_manager::TestHelper::GetFakeUsernameHash( + AccountId::FromUserEmail(user_id_))); + + // Do not automatically start the kiosk app. + command_line->AppendSwitch(ash::switches::kPreventKioskAutolaunchForTesting); +} + +void WebKioskAppLoggedInBrowserTestMixin::SetUpLocalStatePrefService( + PrefService* local_state) { + user_manager::TestHelper::RegisterWebKioskAppUser(*local_state, user_id_); +} + +} // namespace ash
diff --git a/chrome/browser/ash/test/web_kiosk_app_logged_in_browser_test_mixin.h b/chrome/browser/ash/test/web_kiosk_app_logged_in_browser_test_mixin.h new file mode 100644 index 0000000..9fb37485 --- /dev/null +++ b/chrome/browser/ash/test/web_kiosk_app_logged_in_browser_test_mixin.h
@@ -0,0 +1,42 @@ +// Copyright 2025 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_TEST_WEB_KIOSK_APP_LOGGED_IN_BROWSER_TEST_MIXIN_H_ +#define CHROME_BROWSER_ASH_TEST_WEB_KIOSK_APP_LOGGED_IN_BROWSER_TEST_MIXIN_H_ + +#include <string> +#include <string_view> + +#include "chrome/browser/ash/settings/scoped_testing_cros_settings.h" +#include "chrome/test/base/mixin_based_in_process_browser_test.h" + +namespace ash { + +// Registers a new WebKioskApp User, and then use the user to enter +// into a kiosk session. +class WebKioskAppLoggedInBrowserTestMixin : public InProcessBrowserTestMixin { + public: + // `account_id` is the ID for the WebKioskApp account. + // AccountId (to be used by, e.g., UserManager) is generated from the + // `account_id`. + WebKioskAppLoggedInBrowserTestMixin(InProcessBrowserTestMixinHost* host, + std::string_view account_id); + ~WebKioskAppLoggedInBrowserTestMixin() override; + + // InProcessBrowserTestMixin: + void SetUpCommandLine(base::CommandLine* command_line) override; + void SetUpLocalStatePrefService(PrefService* local_state) override; + + private: + // Email-style ID used as a part of AccountId for the given User, + // generated from the `account_id` passed to the ctor. + const std::string user_id_; + + // Injects CrosSettings value to enable Web Kiosk user. + ScopedTestingCrosSettings scoped_testing_cros_settings_; +}; + +} // namespace ash + +#endif // CHROME_BROWSER_ASH_TEST_WEB_KIOSK_APP_LOGGED_IN_BROWSER_TEST_MIXIN_H_
diff --git a/chrome/browser/autofill/ui/autofill_image_fetcher_impl.cc b/chrome/browser/autofill/ui/autofill_image_fetcher_impl.cc index 45cb477..ac97922 100644 --- a/chrome/browser/autofill/ui/autofill_image_fetcher_impl.cc +++ b/chrome/browser/autofill/ui/autofill_image_fetcher_impl.cc
@@ -142,9 +142,8 @@ return; } - // TODO(crbug.com/40245547): Fix and change the config back to kDiskCacheOnly. image_fetcher_ = image_fetcher_service->GetImageFetcher( - image_fetcher::ImageFetcherConfig::kNetworkOnly); + image_fetcher::ImageFetcherConfig::kDiskCacheOnly); } } // namespace autofill
diff --git a/chrome/browser/auxiliary_search/java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchDonor.java b/chrome/browser/auxiliary_search/java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchDonor.java index 03b2df60..97bd823 100644 --- a/chrome/browser/auxiliary_search/java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchDonor.java +++ b/chrome/browser/auxiliary_search/java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchDonor.java
@@ -297,6 +297,11 @@ @VisibleForTesting String getSchemaSetPreferenceKey() { + // TODO(https://crbug.com/397457989): Removes here once the new schema is ready to use. + if (AuxiliarySearchUtils.USE_SCHEMA_V1.getValue()) { + return ChromePreferenceKeys.AUXILIARY_SEARCH_IS_SCHEMA_SET; + } + return mSupportMultiDataSource ? ChromePreferenceKeys.AUXILIARY_SEARCH_IS_SCHEMA_V2_SET : ChromePreferenceKeys.AUXILIARY_SEARCH_IS_SCHEMA_SET;
diff --git a/chrome/browser/auxiliary_search/java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchUtils.java b/chrome/browser/auxiliary_search/java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchUtils.java index 28717ca..19a6354 100644 --- a/chrome/browser/auxiliary_search/java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchUtils.java +++ b/chrome/browser/auxiliary_search/java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchUtils.java
@@ -45,6 +45,10 @@ static final BooleanCachedFeatureParam SKIP_SCHEMA_CHECK = ChromeFeatureList.sAndroidAppIntegrationWithFaviconSkipSchemaCheck; + @VisibleForTesting + static final BooleanCachedFeatureParam USE_SCHEMA_V1 = + ChromeFeatureList.sAndroidAppIntegrationMultiDataSourceUseSchemaV1; + /** Convert a Bitmap instance to a byte array. */ @Nullable public static byte[] bitmapToBytes(Bitmap bitmap) {
diff --git a/chrome/browser/auxiliary_search/junit/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchDonorUnitTest.java b/chrome/browser/auxiliary_search/junit/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchDonorUnitTest.java index 3463c01..1ced073 100644 --- a/chrome/browser/auxiliary_search/junit/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchDonorUnitTest.java +++ b/chrome/browser/auxiliary_search/junit/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchDonorUnitTest.java
@@ -453,6 +453,15 @@ @Test @SmallTest + @EnableFeatures({"AndroidAppIntegrationMultiDataSource:use_schema_v1/true"}) + public void testGetSchemaSetPreferenceKey_MultiDataSourceEnabled_UseSchemaV1() { + assertEquals( + ChromePreferenceKeys.AUXILIARY_SEARCH_IS_SCHEMA_SET, + mAuxiliarySearchDonor.getSchemaSetPreferenceKey()); + } + + @Test + @SmallTest @DisableFeatures({ChromeFeatureList.ANDROID_APP_INTEGRATION_MULTI_DATA_SOURCE}) public void testGetSupportedDocumentClasses() { List<Class<?>> list = mAuxiliarySearchDonor.getSupportedDocumentClasses(); @@ -471,6 +480,23 @@ assertTrue(list.contains(TopSiteWebPage.class)); } + @Test + @SmallTest + @EnableFeatures({"AndroidAppIntegrationMultiDataSource:use_schema_v1/true"}) + public void testUseSchemaV1() { + mAuxiliarySearchDonor.resetSchemaSetForTesting(); + SharedPreferencesManager chromeSharedPreferences = ChromeSharedPreferences.getInstance(); + String key = ChromePreferenceKeys.AUXILIARY_SEARCH_IS_SCHEMA_SET; + chromeSharedPreferences.writeBoolean(key, true); + assertFalse(mAuxiliarySearchDonor.getIsSchemaSetForTesting()); + + // Verifies that |mIsSchemaSet| checks the key for schema V1. + mAuxiliarySearchDonor.onConsumerSchemaSearchedImpl(/* success= */ true); + assertTrue(mAuxiliarySearchDonor.getIsSchemaSetForTesting()); + + chromeSharedPreferences.removeKey(key); + } + private SearchResult createSearchResult(int applicationType, @NonNull String schemaType) { GlobalSearchApplicationInfo appInfo = new GlobalSearchApplicationInfo.Builder("namespace", "id", applicationType)
diff --git a/chrome/browser/background/glic/BUILD.gn b/chrome/browser/background/glic/BUILD.gn index d8090ecc..11b07769 100644 --- a/chrome/browser/background/glic/BUILD.gn +++ b/chrome/browser/background/glic/BUILD.gn
@@ -44,6 +44,7 @@ "//chrome/browser/status_icons:status_icons", "//chrome/browser/ui", "//chrome/browser/ui:browser_element_identifiers", + "//chrome/browser/ui:browser_list", "//components/keep_alive_registry", "//ui/base", "//ui/base/accelerators/global_accelerator_listener",
diff --git a/chrome/browser/background/glic/glic_status_icon.cc b/chrome/browser/background/glic/glic_status_icon.cc index 84c57fd..da8b04a 100644 --- a/chrome/browser/background/glic/glic_status_icon.cc +++ b/chrome/browser/background/glic/glic_status_icon.cc
@@ -22,6 +22,7 @@ #include "chrome/browser/status_icons/status_icon_menu_model.h" #include "chrome/browser/status_icons/status_tray.h" #include "chrome/browser/ui/browser_element_identifiers.h" +#include "chrome/browser/ui/browser_list.h" #include "chrome/common/channel_info.h" #include "chrome/common/chrome_features.h" #include "chrome/common/webui_url_constants.h" @@ -108,9 +109,14 @@ std::unique_ptr<StatusIconMenuModel> menu = CreateStatusIconMenu(); context_menu_ = menu.get(); status_icon_->SetContextMenu(std::move(menu)); + + BrowserList::AddObserver(this); + UpdateShowExitInContextMenu(); } GlicStatusIcon::~GlicStatusIcon() { + BrowserList::RemoveObserver(this); + context_menu_ = nullptr; if (status_icon_) { #if !BUILDFLAG(IS_LINUX) @@ -172,6 +178,14 @@ status_icon_->SetImage(GetIconForTheme(observed_theme)); } +void GlicStatusIcon::OnBrowserAdded(Browser* browser) { + UpdateShowExitInContextMenu(); +} + +void GlicStatusIcon::OnBrowserRemoved(Browser* browser) { + UpdateShowExitInContextMenu(); +} + void GlicStatusIcon::UpdateHotkey(const ui::Accelerator& hotkey) { CHECK(context_menu_); context_menu_->SetAcceleratorForCommandId(IDC_GLIC_STATUS_ICON_MENU_SHOW, @@ -183,6 +197,15 @@ !hotkey.IsEmpty()); } +void GlicStatusIcon::UpdateShowExitInContextMenu() { +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) + if (context_menu_) { + context_menu_->SetCommandIdVisible(IDC_GLIC_STATUS_ICON_MENU_EXIT, + BrowserList::GetInstance()->empty()); + } +#endif +} + std::unique_ptr<StatusIconMenuModel> GlicStatusIcon::CreateStatusIconMenu() { std::unique_ptr<StatusIconMenuModel> menu(new StatusIconMenuModel(this)); menu->AddItem(IDC_GLIC_STATUS_ICON_MENU_SHOW,
diff --git a/chrome/browser/background/glic/glic_status_icon.h b/chrome/browser/background/glic/glic_status_icon.h index e81500fcf..b70c75a3 100644 --- a/chrome/browser/background/glic/glic_status_icon.h +++ b/chrome/browser/background/glic/glic_status_icon.h
@@ -9,11 +9,13 @@ #include "base/scoped_observation.h" #include "chrome/browser/status_icons/status_icon_menu_model.h" #include "chrome/browser/status_icons/status_icon_observer.h" +#include "chrome/browser/ui/browser_list_observer.h" #include "ui/native_theme/native_theme_observer.h" class StatusIcon; class StatusIconMenuModel; class StatusTray; +class Browser; namespace glic { @@ -25,7 +27,8 @@ // status icon being clicked or menu item being triggered. class GlicStatusIcon : public StatusIconObserver, public StatusIconMenuModel::Delegate, - public ui::NativeThemeObserver { + public ui::NativeThemeObserver, + public BrowserListObserver { public: explicit GlicStatusIcon(GlicController* controller, StatusTray* status_tray); ~GlicStatusIcon() override; @@ -39,8 +42,14 @@ // ui::NativeThemeObserver: void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override; + // BrowserListObserver: + void OnBrowserAdded(Browser* browser) override; + void OnBrowserRemoved(Browser* browser) override; + void UpdateHotkey(const ui::Accelerator& hotkey); + void UpdateShowExitInContextMenu(); + private: std::unique_ptr<StatusIconMenuModel> CreateStatusIconMenu();
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index c9d3bbcf..1cff463 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -201,7 +201,7 @@ #include "chrome/browser/vr/vr_tab_helper.h" #include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h" #include "chrome/browser/webapps/web_app_offline.h" -#include "chrome/browser/webauthn/chrome_web_authentication_delegate.h" +#include "chrome/browser/webauthn/chrome_web_authentication_delegate_base.h" #include "chrome/browser/webauthn/webauthn_pref_names.h" #include "chrome/common/buildflags.h" #include "chrome/common/channel_info.h" @@ -778,6 +778,7 @@ #if !BUILDFLAG(IS_ANDROID) #include "chrome/browser/screen_ai/screen_ai_install_state.h" +#include "chrome/browser/webauthn/chrome_web_authentication_delegate.h" #endif #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) @@ -6947,6 +6948,24 @@ switches::kIgnoreCertificateErrors); } +content::WebAuthenticationDelegate* +ChromeContentBrowserClient::GetWebAuthenticationDelegate() { + if (!web_authentication_delegate_) { +#if BUILDFLAG(IS_ANDROID) + // Currently, Android is using only the common methods; therefore, the base + // class is instantiated here. If you need custom behavior, you need to + // introduce a class for Android that would inherit behavior from the base + // class. + web_authentication_delegate_ = + std::make_unique<ChromeWebAuthenticationDelegateBase>(); +#else + web_authentication_delegate_ = + std::make_unique<ChromeWebAuthenticationDelegate>(); +#endif // !BUILDFLAG(IS_ANDROID) + } + return web_authentication_delegate_.get(); +} + #if !BUILDFLAG(IS_ANDROID) void ChromeContentBrowserClient::CreateDeviceInfoService( content::RenderFrameHost* render_frame_host, @@ -6977,15 +6996,6 @@ return direct_sockets_delegate_.get(); } -content::WebAuthenticationDelegate* -ChromeContentBrowserClient::GetWebAuthenticationDelegate() { - if (!web_authentication_delegate_) { - web_authentication_delegate_ = - std::make_unique<ChromeWebAuthenticationDelegate>(); - } - return web_authentication_delegate_.get(); -} - std::unique_ptr<content::AuthenticatorRequestClientDelegate> ChromeContentBrowserClient::GetWebAuthenticationRequestDelegate( content::RenderFrameHost* render_frame_host) {
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 2b5748c..0b28b213 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -129,7 +129,7 @@ class ChromeSerialDelegate; class ChromeBluetoothDelegate; class ChromeUsbDelegate; -class ChromeWebAuthenticationDelegate; +class ChromeWebAuthenticationDelegateBase; class HttpAuthCoordinator; class MainThreadStackSamplingProfiler; class WindowsSystemTracingClient; @@ -749,6 +749,7 @@ bool IsSecurityLevelAcceptableForWebAuthn( content::RenderFrameHost* rfh, const url::Origin& caller_origin) override; + content::WebAuthenticationDelegate* GetWebAuthenticationDelegate() override; #if !BUILDFLAG(IS_ANDROID) void CreateDeviceInfoService( content::RenderFrameHost* render_frame_host, @@ -759,7 +760,6 @@ override; content::HidDelegate* GetHidDelegate() override; content::DirectSocketsDelegate* GetDirectSocketsDelegate() override; - content::WebAuthenticationDelegate* GetWebAuthenticationDelegate() override; std::unique_ptr<content::AuthenticatorRequestClientDelegate> GetWebAuthenticationRequestDelegate( content::RenderFrameHost* render_frame_host) override; @@ -1315,10 +1315,11 @@ StartupData startup_data_; + std::unique_ptr<ChromeWebAuthenticationDelegateBase> + web_authentication_delegate_; #if !BUILDFLAG(IS_ANDROID) std::unique_ptr<ChromeHidDelegate> hid_delegate_; std::unique_ptr<ChromeDirectSocketsDelegate> direct_sockets_delegate_; - std::unique_ptr<ChromeWebAuthenticationDelegate> web_authentication_delegate_; #endif std::unique_ptr<ChromeBluetoothDelegate> bluetooth_delegate_; std::unique_ptr<ChromeUsbDelegate> usb_delegate_;
diff --git a/chrome/browser/chromeos/extensions/system_log/system_log_apitest.cc b/chrome/browser/chromeos/extensions/system_log/system_log_apitest.cc index 13ce5af..14cf1485 100644 --- a/chrome/browser/chromeos/extensions/system_log/system_log_apitest.cc +++ b/chrome/browser/chromeos/extensions/system_log/system_log_apitest.cc
@@ -18,7 +18,7 @@ #include "chrome/browser/ash/policy/test_support/embedded_policy_test_server_mixin.h" #include "chrome/browser/ash/settings/scoped_testing_cros_settings.h" #include "chrome/browser/ash/settings/stub_cros_settings_provider.h" -#include "chrome/browser/ash/test/kiosk_logged_in_browser_test_mixin.h" +#include "chrome/browser/ash/test/kiosk_app_logged_in_browser_test_mixin.h" #include "chrome/browser/extensions/chrome_test_extension_loader.h" #include "chrome/browser/extensions/mixin_based_extension_apitest.h" #include "chrome/browser/feedback/system_logs/log_sources/device_event_log_source.h" @@ -295,10 +295,11 @@ /*system_logging_enabled=*/testing::Bool()); // Verifies the systemLog API logs in regular user sessions. -class SystemLogUserSessionApitest : public MixinBasedExtensionApiTest, - public ::testing::WithParamInterface<bool> { +class SystemLogUserSessionApitestBase + : public MixinBasedExtensionApiTest, + public ::testing::WithParamInterface<bool> { public: - SystemLogUserSessionApitest() + SystemLogUserSessionApitestBase() : log_level_(system_logging_enabled() ? "DEBUG" : "EVENT") {} void SetUpCommandLine(base::CommandLine* command_line) override { @@ -328,11 +329,6 @@ bool system_logging_enabled() const { return GetParam(); } - void SetSystemLogPolicy() { - scoped_testing_cros_settings_.device_settings()->SetBoolean( - ash::kDeviceExtensionsSystemLogEnabled, system_logging_enabled()); - } - void ForceInstallExtension() { base::FilePath test_dir_path = base::PathService::CheckedGet(chrome::DIR_TEST_DATA); @@ -349,6 +345,16 @@ ExtensionForceInstallMixin extension_force_install_mixin_{&mixin_host_}; testing::NiceMock<policy::MockConfigurationPolicyProvider> mock_policy_provider_; +}; + +class SystemLogUserSessionApitest : public SystemLogUserSessionApitestBase { + protected: + void SetSystemLogPolicy() { + scoped_testing_cros_settings_.device_settings()->SetBoolean( + ash::kDeviceExtensionsSystemLogEnabled, system_logging_enabled()); + } + + private: ash::ScopedTestingCrosSettings scoped_testing_cros_settings_; }; @@ -396,19 +402,22 @@ /*system_logging_enabled=*/testing::Bool()); // Verifies the systemLog API logs in Kiosk sessions. -class SystemLogKioskSessionApitest : public SystemLogUserSessionApitest { +class SystemLogKioskSessionApitest : public SystemLogUserSessionApitestBase { public: - static constexpr char kKioskUserName[] = - "example@kiosk-apps.device-local.localhost"; - SystemLogKioskSessionApitest() { // Do not create User by LoggedInUserMixin, because // user log-in is handled by KioskBrowserTestMixin. set_chromeos_user_ = false; } + void SetSystemLogPolicy() { + kiosk_mixin_.scoped_testing_cros_settings().device_settings()->SetBoolean( + ash::kDeviceExtensionsSystemLogEnabled, system_logging_enabled()); + } + private: - ash::KioskLoggedInBrowserTestMixin kiosk_mixin_{&mixin_host_, kKioskUserName}; + ash::KioskAppLoggedInBrowserTestMixin kiosk_mixin_{&mixin_host_, + "kiosk-account"}; }; // Logs EVENT or DEBUG extension logs depending on the
diff --git a/chrome/browser/component_updater/iwa_key_distribution_component_installer.cc b/chrome/browser/component_updater/iwa_key_distribution_component_installer.cc index c04e638..d1dda12 100644 --- a/chrome/browser/component_updater/iwa_key_distribution_component_installer.cc +++ b/chrome/browser/component_updater/iwa_key_distribution_component_installer.cc
@@ -52,6 +52,14 @@ << base::to_underlying(err); } +component_updater::OnDemandUpdater::Priority GetOnDemandUpdatePriority() { +#if BUILDFLAG(IS_WIN) + return component_updater::OnDemandUpdater::Priority::FOREGROUND; +#else + return component_updater::OnDemandUpdater::Priority::BACKGROUND; +#endif +} + } // namespace namespace component_updater { @@ -99,8 +107,7 @@ VLOG(1) << "Queueing on-demand update for the Iwa Key Distribution Component"; g_browser_process->component_updater()->GetOnDemandUpdater().OnDemandUpdate( crx_file::id_util::GenerateIdFromHash(kIwaKeyDistributionPublicKeySHA256), - OnDemandUpdater::Priority::BACKGROUND, - base::BindOnce(&OnDemandUpdateCompleted)); + GetOnDemandUpdatePriority(), base::BindOnce(&OnDemandUpdateCompleted)); return true; }
diff --git a/chrome/browser/data_sharing/android/java/src/org/chromium/chrome/browser/data_sharing/InstantMessageDelegateImpl.java b/chrome/browser/data_sharing/android/java/src/org/chromium/chrome/browser/data_sharing/InstantMessageDelegateImpl.java index 83f7947..026ea75 100644 --- a/chrome/browser/data_sharing/android/java/src/org/chromium/chrome/browser/data_sharing/InstantMessageDelegateImpl.java +++ b/chrome/browser/data_sharing/android/java/src/org/chromium/chrome/browser/data_sharing/InstantMessageDelegateImpl.java
@@ -351,13 +351,14 @@ Runnable openManageSharingRunnable = () -> { // TODO(crbug.com/379148260): Use shared #isCollaborationIdValid. - if (!TextUtils.isEmpty(collaborationId)) { - dataSharingTabManager.createOrManageFlow( - activity, - syncId, - new LocalTabGroupId(localId), - /* createGroupFinishedCallback= */ null); - } + if (TextUtils.isEmpty(collaborationId)) return; + if (mTabGroupSyncService.getGroup(syncId) == null) return; + + dataSharingTabManager.createOrManageFlow( + activity, + syncId, + new LocalTabGroupId(localId), + /* createGroupFinishedCallback= */ null); }; fetchAvatarIconFromMessage(
diff --git a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/context_signals_decorator.cc b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/context_signals_decorator.cc index 817cac9..f15ce825 100644 --- a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/context_signals_decorator.cc +++ b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/context_signals_decorator.cc
@@ -92,11 +92,6 @@ signals.Set(device_signals::names::kSystemDnsServers, ToListValue(context_info.system_dns_servers)); - if (context_info.third_party_blocking_enabled) { - signals.Set(device_signals::names::kThirdPartyBlockingEnabled, - context_info.third_party_blocking_enabled.value()); - } - LogSignalsCollectionLatency(kLatencyHistogramVariant, start_time); std::move(done_closure).Run();
diff --git a/chrome/browser/enterprise/platform_auth/extensible_enterprise_sso_provider_mac_browsertest.mm b/chrome/browser/enterprise/platform_auth/extensible_enterprise_sso_provider_mac_browsertest.mm index d4ae6dbc..2da1d8f 100644 --- a/chrome/browser/enterprise/platform_auth/extensible_enterprise_sso_provider_mac_browsertest.mm +++ b/chrome/browser/enterprise/platform_auth/extensible_enterprise_sso_provider_mac_browsertest.mm
@@ -9,6 +9,7 @@ #import "base/run_loop.h" #import "base/strings/sys_string_conversions.h" +#import "base/test/bind.h" #import "base/test/metrics/histogram_tester.h" #import "base/test/mock_callback.h" #import "chrome/browser/enterprise/platform_auth/extensible_enterprise_sso_entra.h" @@ -62,7 +63,7 @@ NSURL* nativeUrl() { return net::NSURLWithGURL(url()); } }; -IN_PROC_BROWSER_TEST_F(ExtensibleEnterpriseSSOTest, DISABLED_SupportedFail) { +IN_PROC_BROWSER_TEST_F(ExtensibleEnterpriseSSOTest, SupportedFail) { base::HistogramTester histogram_tester; // Create a fake request @@ -111,15 +112,11 @@ { base::RunLoop run_loop; net::HttpRequestHeaders response_headers; - base::MockCallback<PlatformAuthProviderManager::GetDataCallback> mock; - EXPECT_CALL(mock, Run(_)) - .WillOnce( - [&run_loop, &response_headers](net::HttpRequestHeaders headers) { - response_headers = headers; - run_loop.Quit(); - }); - - provider.GetData(url(), mock.Get()); + provider.GetData( + url(), base::BindLambdaForTesting([&](net::HttpRequestHeaders headers) { + response_headers = headers; + run_loop.Quit(); + })); run_loop.Run(); // On failure no headers are returned. @@ -138,7 +135,7 @@ } } -IN_PROC_BROWSER_TEST_F(ExtensibleEnterpriseSSOTest, DISABLED_SupportedSuccess) { +IN_PROC_BROWSER_TEST_F(ExtensibleEnterpriseSSOTest, SupportedSuccess) { base::HistogramTester histogram_tester; // Create a fake request @@ -211,15 +208,12 @@ { base::RunLoop run_loop; net::HttpRequestHeaders response_headers; - base::MockCallback<PlatformAuthProviderManager::GetDataCallback> mock; - EXPECT_CALL(mock, Run(_)) - .WillOnce( - [&run_loop, &response_headers](net::HttpRequestHeaders headers) { - response_headers = headers; - run_loop.Quit(); - }); + provider.GetData( + url(), base::BindLambdaForTesting([&](net::HttpRequestHeaders headers) { + response_headers = headers; + run_loop.Quit(); + })); - provider.GetData(url(), mock.Get()); run_loop.Run(); // On success the right headers are returned. @@ -276,15 +270,11 @@ { base::RunLoop run_loop; net::HttpRequestHeaders response_headers; - base::MockCallback<PlatformAuthProviderManager::GetDataCallback> mock; - EXPECT_CALL(mock, Run(_)) - .WillOnce( - [&run_loop, &response_headers](net::HttpRequestHeaders headers) { - response_headers = headers; - run_loop.Quit(); - }); - - provider.GetData(url(), mock.Get()); + provider.GetData( + url(), base::BindLambdaForTesting([&](net::HttpRequestHeaders headers) { + response_headers = headers; + run_loop.Quit(); + })); run_loop.Run(); // On failure no headers are returned. EXPECT_TRUE(response_headers.IsEmpty());
diff --git a/chrome/browser/enterprise/reporting/profile_report_generator_unittest.cc b/chrome/browser/enterprise/reporting/profile_report_generator_unittest.cc index 3d6ae0e..ab6d89af1 100644 --- a/chrome/browser/enterprise/reporting/profile_report_generator_unittest.cc +++ b/chrome/browser/enterprise/reporting/profile_report_generator_unittest.cc
@@ -12,6 +12,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_feature_list.h" +#include "base/test/test_future.h" #include "build/build_config.h" #include "chrome/browser/enterprise/identifiers/profile_id_service_factory.h" #include "chrome/browser/policy/chrome_browser_policy_connector.h" @@ -143,9 +144,11 @@ std::unique_ptr<em::ChromeUserProfileInfo> GenerateReport( const base::FilePath& path) { - std::unique_ptr<em::ChromeUserProfileInfo> report = - generator_.MaybeGenerate(path, ReportType::kFull); - return report; + base::test::TestFuture<std::unique_ptr<em::ChromeUserProfileInfo>> + test_future; + generator_.MaybeGenerate(path, ReportType::kFull, + test_future.GetCallback()); + return test_future.Take(); } std::unique_ptr<em::ChromeUserProfileInfo> GenerateReport() { @@ -217,9 +220,11 @@ params.profile_name = kIdleProfile16; testing_profile_manager()->profile_attributes_storage()->AddProfile( std::move(params)); - std::unique_ptr<em::ChromeUserProfileInfo> response = - generator_.MaybeGenerate(profile_path, ReportType::kFull); - ASSERT_FALSE(response.get()); + base::test::TestFuture<std::unique_ptr<em::ChromeUserProfileInfo>> + test_future; + generator_.MaybeGenerate(profile_path, ReportType::kFull, + test_future.GetCallback()); + ASSERT_FALSE(test_future.Get().get()); } TEST_F(ProfileReportGeneratorTest, UnsignedInProfile) { @@ -260,24 +265,35 @@ } TEST_F(ProfileReportGeneratorTest, ProfileIdObfuscate) { - auto report = generator_.MaybeGenerate(profile()->GetPath(), - ReportType::kProfileReport); + base::test::TestFuture<std::unique_ptr<em::ChromeUserProfileInfo>> + test_future; + generator_.MaybeGenerate(profile()->GetPath(), ReportType::kProfileReport, + test_future.GetCallback()); + + auto report = test_future.Take(); ASSERT_TRUE(report); EXPECT_EQ(GetProfileName(), report->name()); EXPECT_NE(profile()->GetPath().AsUTF8Unsafe(), report->id()); EXPECT_TRUE(report->is_detail_available()); - auto report2 = generator_.MaybeGenerate(profile()->GetPath(), - ReportType::kProfileReport); + test_future.Clear(); + generator_.MaybeGenerate(profile()->GetPath(), ReportType::kProfileReport, + test_future.GetCallback()); + // Profile id is obfuscated with `kProfileReport` type, but the obfuscated // result is consistent. + auto report2 = test_future.Take(); EXPECT_EQ(report->id(), report2->id()); TestingProfile* another_profile = testing_profile_manager()->CreateTestingProfile("another_profile"); - auto report3 = generator_.MaybeGenerate(another_profile->GetPath(), - ReportType::kProfileReport); + + test_future.Clear(); + generator_.MaybeGenerate(another_profile->GetPath(), + ReportType::kProfileReport, + test_future.GetCallback()); // Different profiles' id will be different even after obfuscation. + auto report3 = test_future.Take(); EXPECT_NE(report->id(), report3->id()); }
diff --git a/chrome/browser/enterprise/reporting/report_request_queue_generator_unittest.cc b/chrome/browser/enterprise/reporting/report_request_queue_generator_unittest.cc index 42aa4629..3f78a9c 100644 --- a/chrome/browser/enterprise/reporting/report_request_queue_generator_unittest.cc +++ b/chrome/browser/enterprise/reporting/report_request_queue_generator_unittest.cc
@@ -10,6 +10,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" +#include "base/test/test_future.h" #include "build/build_config.h" #include "chrome/browser/profiles/profile_attributes_init_params.h" #include "chrome/browser/profiles/profile_attributes_storage.h" @@ -160,10 +161,15 @@ } std::vector<std::unique_ptr<ReportRequest>> GenerateRequests( - const ReportRequest& request) { + std::unique_ptr<ReportRequest> request) { histogram_tester_ = std::make_unique<base::HistogramTester>(); - std::queue<std::unique_ptr<ReportRequest>> requests = - report_request_queue_generator_.Generate(request); + + base::test::TestFuture<std::queue<std::unique_ptr<ReportRequest>>> + test_future; + report_request_queue_generator_.Generate(std::move(request), + test_future.GetCallback()); + + auto requests = test_future.Take(); std::vector<std::unique_ptr<ReportRequest>> result; while (!requests.empty()) { result.push_back(std::move(requests.front())); @@ -250,8 +256,7 @@ TEST_F(ReportRequestQueueGeneratorTest, GenerateSingleReport) { CreateActiveProfile(kActiveProfileName1); - auto basic_request = GenerateBasicRequest(); - auto requests = GenerateRequests(*basic_request); + auto requests = GenerateRequests(GenerateBasicRequest()); EXPECT_EQ(1u, requests.size()); VerifyProfiles(requests[0]->GetDeviceReportRequest().browser_report(), @@ -267,8 +272,7 @@ // Because the limitation is so small, no request can be created. CreateActiveProfiles(); - auto basic_request = GenerateBasicRequest(); - auto requests = GenerateRequests(*basic_request); + auto requests = GenerateRequests(GenerateBasicRequest()); EXPECT_EQ(0u, requests.size()); histogram_tester()->ExpectTotalCount("Enterprise.CloudReportingRequestSize", @@ -294,8 +298,7 @@ CreateActiveProfileWithPolicies(kActiveProfileName1, std::move(policy_service)); - auto basic_request = GenerateBasicRequest(); - auto requests = GenerateRequests(*basic_request); + auto requests = GenerateRequests(GenerateBasicRequest()); EXPECT_EQ(1u, requests.size()); auto browser_report = requests[0]->GetDeviceReportRequest().browser_report(); @@ -319,8 +322,7 @@ TEST_F(ReportRequestQueueGeneratorTest, GenerateReport) { auto idle_profile_names = CreateIdleProfiles(); - auto basic_request = GenerateBasicRequest(); - auto requests = GenerateRequests(*basic_request); + auto requests = GenerateRequests(GenerateBasicRequest()); EXPECT_EQ(1u, requests.size()); VerifyProfiles(requests[0]->GetDeviceReportRequest().browser_report(), @@ -332,8 +334,7 @@ TEST_F(ReportRequestQueueGeneratorTest, GenerateActiveProfiles) { auto idle_profile_names = CreateIdleProfiles(); auto active_profile_names = CreateActiveProfiles(); - auto basic_request = GenerateBasicRequest(); - auto requests = GenerateRequests(*basic_request); + auto requests = GenerateRequests(GenerateBasicRequest()); EXPECT_EQ(1u, requests.size()); VerifyProfiles(requests[0]->GetDeviceReportRequest().browser_report(), @@ -344,15 +345,14 @@ TEST_F(ReportRequestQueueGeneratorTest, ReportSeparation) { auto active_profiles = CreateActiveProfilesWithContent(); - auto basic_request = GenerateBasicRequest(); - auto requests = GenerateRequests(*basic_request); + auto requests = GenerateRequests(GenerateBasicRequest()); EXPECT_EQ(1u, requests.size()); // Set the limitation just below the size of the report so that it needs to be // separated into two requests later. SetAndVerifyMaximumRequestSize( requests[0]->GetDeviceReportRequest().ByteSizeLong() - 30); - requests = GenerateRequests(*basic_request); + requests = GenerateRequests(GenerateBasicRequest()); EXPECT_EQ(2u, requests.size()); // The profile order in requests should match the return value of @@ -382,8 +382,7 @@ TEST_F(ReportRequestQueueGeneratorTest, ProfileReportIsTooBig) { CreateActiveProfileWithContent(kActiveProfileName1); - auto basic_request = GenerateBasicRequest(); - auto requests = GenerateRequests(*basic_request); + auto requests = GenerateRequests(GenerateBasicRequest()); EXPECT_EQ(1u, requests.size()); // Set the limitation just below the size of the report. @@ -392,8 +391,7 @@ // Add a smaller Profile. CreateActiveProfile(kActiveProfileName2); - basic_request = GenerateBasicRequest(); - requests = GenerateRequests(*basic_request); + requests = GenerateRequests(GenerateBasicRequest()); EXPECT_EQ(1u, requests.size()); // Only the second Profile is activated while the first one is too big to be
diff --git a/chrome/browser/enterprise/signals/context_info_fetcher.cc b/chrome/browser/enterprise/signals/context_info_fetcher.cc index 3d8208355..ebf69a0 100644 --- a/chrome/browser/enterprise/signals/context_info_fetcher.cc +++ b/chrome/browser/enterprise/signals/context_info_fetcher.cc
@@ -275,8 +275,6 @@ info.chrome_remote_desktop_app_blocked = utils::GetChromeRemoteDesktopAppBlocked( PolicyBlocklistFactory::GetForBrowserContext(browser_context_)); - info.third_party_blocking_enabled = - utils::GetThirdPartyBlockingEnabled(g_browser_process->local_state()); Profile* profile = Profile::FromBrowserContext(browser_context_); info.safe_browsing_protection_level =
diff --git a/chrome/browser/enterprise/signals/context_info_fetcher.h b/chrome/browser/enterprise/signals/context_info_fetcher.h index 9caad88..9b6c198 100644 --- a/chrome/browser/enterprise/signals/context_info_fetcher.h +++ b/chrome/browser/enterprise/signals/context_info_fetcher.h
@@ -49,7 +49,6 @@ std::optional<safe_browsing::PasswordProtectionTrigger> password_protection_warning_trigger; bool chrome_remote_desktop_app_blocked; - std::optional<bool> third_party_blocking_enabled; device_signals::SettingValue os_firewall; std::vector<std::string> system_dns_servers; std::optional<std::string> enterprise_profile_id;
diff --git a/chrome/browser/enterprise/signals/signals_utils.cc b/chrome/browser/enterprise/signals/signals_utils.cc index c574241d..35a2afa 100644 --- a/chrome/browser/enterprise/signals/signals_utils.cc +++ b/chrome/browser/enterprise/signals/signals_utils.cc
@@ -51,15 +51,6 @@ } } -std::optional<bool> GetThirdPartyBlockingEnabled(PrefService* local_state) { - DCHECK(local_state); -#if BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING) - return local_state->GetBoolean(prefs::kThirdPartyBlockingEnabled); -#else - return std::nullopt; -#endif -} - bool GetBuiltInDnsClientEnabled(PrefService* local_state) { DCHECK(local_state); return local_state->GetBoolean(prefs::kBuiltInDnsClientEnabled);
diff --git a/chrome/browser/enterprise/signals/signals_utils.h b/chrome/browser/enterprise/signals/signals_utils.h index 091ecc41..2fa9790 100644 --- a/chrome/browser/enterprise/signals/signals_utils.h +++ b/chrome/browser/enterprise/signals/signals_utils.h
@@ -15,8 +15,6 @@ namespace enterprise_signals { namespace utils { -std::optional<bool> GetThirdPartyBlockingEnabled(PrefService* local_state); - bool GetBuiltInDnsClientEnabled(PrefService* local_state); std::optional<safe_browsing::PasswordProtectionTrigger>
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest_chromeos.cc b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest_chromeos.cc index 2e6a7b9..37d2bd4f 100644 --- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest_chromeos.cc +++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest_chromeos.cc
@@ -13,7 +13,7 @@ #include "chrome/browser/ash/app_mode/kiosk_chrome_app_manager.h" #include "chrome/browser/ash/ownership/fake_owner_settings_service.h" #include "chrome/browser/ash/settings/scoped_cros_settings_test_helper.h" -#include "chrome/browser/ash/test/kiosk_logged_in_browser_test_mixin.h" +#include "chrome/browser/ash/test/kiosk_app_logged_in_browser_test_mixin.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/ui/browser.h" #include "chromeos/ash/components/browser_context_helper/browser_context_helper.h" @@ -70,7 +70,7 @@ ash::BrowserContextHelper::Get()->GetBrowserContextByUser(user)); } - // TODO(hidehiko): consider to move this into KioskLoggedInBrowserTestMixin + // TODO(hidehiko): consider to move this into KioskAppLoggedInBrowserTestMixin // so the test can be exercised in the environment closer to the production. void SetAutoLaunchApp() { auto* manager = ash::KioskChromeAppManager::Get(); @@ -84,8 +84,8 @@ } private: - ash::KioskLoggedInBrowserTestMixin kiosk_mixin_{ - &mixin_host_, "example@kiosk-apps.device-local.localhost"}; + ash::KioskAppLoggedInBrowserTestMixin kiosk_mixin_{&mixin_host_, + "kiosk-account"}; }; IN_PROC_BROWSER_TEST_F(BluetoothLowEnergyApiTestChromeOs,
diff --git a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc index a812d1f..83d297b5 100644 --- a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc +++ b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc
@@ -97,7 +97,6 @@ info.site_isolation_enabled = signals.site_isolation_enabled; info.chrome_remote_desktop_app_blocked = signals.chrome_remote_desktop_app_blocked; - info.third_party_blocking_enabled = signals.third_party_blocking_enabled; info.os_firewall = ToInfoSettingValue(signals.os_firewall); info.system_dns_servers = std::move(signals.system_dns_servers); switch (signals.realtime_url_check_mode) {
diff --git a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc index fe4d93e3..2ccaa04 100644 --- a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc +++ b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc
@@ -465,11 +465,6 @@ void ExpectDefaultThirdPartyBlockingEnabled( const enterprise_reporting_private::ContextInfo& info) { -#if BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING) - EXPECT_TRUE(*info.third_party_blocking_enabled); -#else - EXPECT_FALSE(info.third_party_blocking_enabled.has_value()); -#endif } }; @@ -507,9 +502,6 @@ TEST_P(EnterpriseReportingPrivateGetContextInfoThirdPartyBlockingTest, Test) { bool policyValue = GetParam(); - g_browser_process->local_state()->SetBoolean( - prefs::kThirdPartyBlockingEnabled, policyValue); - enterprise_reporting_private::ContextInfo info = GetContextInfo(); EXPECT_TRUE(info.browser_affiliation_ids.empty()); @@ -526,7 +518,6 @@ EXPECT_EQ(BuiltInDnsClientPlatformDefault(), info.built_in_dns_client_enabled); EXPECT_FALSE(info.chrome_remote_desktop_app_blocked); - EXPECT_EQ(policyValue, *info.third_party_blocking_enabled); } INSTANTIATE_TEST_SUITE_P(
diff --git a/chrome/browser/extensions/api/file_system/file_system_apitest_chromeos.cc b/chrome/browser/extensions/api/file_system/file_system_apitest_chromeos.cc index 903bb6b2..dac9451 100644 --- a/chrome/browser/extensions/api/file_system/file_system_apitest_chromeos.cc +++ b/chrome/browser/extensions/api/file_system/file_system_apitest_chromeos.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/ash/drive/drive_integration_service.h" #include "chrome/browser/ash/drive/drivefs_test_support.h" #include "chrome/browser/ash/file_manager/volume_manager.h" -#include "chrome/browser/ash/test/kiosk_logged_in_browser_test_mixin.h" +#include "chrome/browser/ash/test/kiosk_app_logged_in_browser_test_mixin.h" #include "chrome/browser/extensions/api/file_system/consent_provider_impl.h" #include "chrome/browser/extensions/component_loader.h" #include "chrome/browser/ui/browser.h" @@ -289,8 +289,8 @@ FileSystemApiKioskTestForRequestFileSystem() { set_chromeos_user_ = false; } private: - ash::KioskLoggedInBrowserTestMixin kiosk_mixin_{ - &mixin_host_, "example@kiosk-apps.device-local.localhost"}; + ash::KioskAppLoggedInBrowserTestMixin kiosk_mixin_{&mixin_host_, + "kiosk-app-account"}; }; IN_PROC_BROWSER_TEST_F(FileSystemApiTestForDrive,
diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc index d091582..4818f4f 100644 --- a/chrome/browser/extensions/api/identity/identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/identity_apitest.cc
@@ -107,14 +107,18 @@ #include "url/gurl.h" #if BUILDFLAG(IS_CHROMEOS) -#include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/net/network_portal_detector_test_impl.h" +#include "chrome/browser/ash/test/kiosk_app_logged_in_browser_test_mixin.h" +#include "chrome/browser/ash/test/public_account_logged_in_browser_test_mixin.h" +#include "chrome/browser/ash/test/web_kiosk_app_logged_in_browser_test_mixin.h" +#include "chrome/test/base/mixin_based_in_process_browser_test.h" +#include "chromeos/ash/components/browser_context_helper/browser_context_helper.h" #include "chromeos/ash/components/install_attributes/stub_install_attributes.h" -#include "chromeos/ash/components/login/login_state/login_state.h" #include "chromeos/ash/components/network/network_handler.h" #include "chromeos/ash/components/network/network_state.h" #include "chromeos/ash/components/network/network_state_handler.h" -#include "components/user_manager/scoped_user_manager.h" +#include "components/account_id/account_id.h" +#include "components/user_manager/user_manager.h" #endif using extensions::ExtensionsAPIClient; @@ -1022,9 +1026,18 @@ Browser* browser, std::string* access_token, std::set<std::string>* granted_scopes) { + RunGetAuthTokenFunction(function, args, browser->profile(), access_token, + granted_scopes); + } + + void RunGetAuthTokenFunction(ExtensionFunction* function, + const std::string& args, + Profile* profile, + std::string* access_token, + std::set<std::string>* granted_scopes) { std::optional<base::Value> result_value = - utils::RunFunctionAndReturnSingleResult(function, args, - browser->profile()); + utils::RunFunctionAndReturnSingleResult(function, args, profile); + ASSERT_TRUE(result_value); std::optional<api::identity::GetAuthTokenResult> result = api::identity::GetAuthTokenResult::FromValue(*result_value); @@ -3106,82 +3119,11 @@ } #if BUILDFLAG(IS_CHROMEOS) -enum class DeviceLocalAccountSessionType { kPublic, kAppKiosk, kWebKiosk }; - -class GetAuthTokenFunctionDeviceLocalAccountTestPlatformHelper { - public: - const AccountId kFakeAccountId = AccountId::FromUserEmail("test@test"); - - explicit GetAuthTokenFunctionDeviceLocalAccountTestPlatformHelper( - DeviceLocalAccountSessionType session_type) - : session_type_(session_type) {} - - void SetUpOnMainThread() { - ash::LoginState::Get()->SetLoggedInState( - ash::LoginState::LoggedInState::LOGGED_IN_ACTIVE, - session_type_ == DeviceLocalAccountSessionType::kPublic - ? ash::LoginState::LoggedInUserType::LOGGED_IN_USER_PUBLIC_ACCOUNT - : ash::LoginState::LoggedInUserType::LOGGED_IN_USER_KIOSK); - auto user_manager = std::make_unique<ash::FakeChromeUserManager>(); - user_manager::User* user = nullptr; - switch (session_type_) { - case DeviceLocalAccountSessionType::kPublic: - user = user_manager->AddPublicAccountUser(kFakeAccountId); - break; - case DeviceLocalAccountSessionType::kAppKiosk: - user = user_manager->AddKioskAppUser(kFakeAccountId); - break; - case DeviceLocalAccountSessionType::kWebKiosk: - user = user_manager->AddWebKioskAppUser(kFakeAccountId); - break; - } - ASSERT_TRUE(user); - user_manager->UserLoggedIn(kFakeAccountId, user->username_hash(), - /*browser_restart=*/false, /*is_child=*/false); - scoped_user_manager_ = std::make_unique<user_manager::ScopedUserManager>( - std::move(user_manager)); - } - - void TearDownOnMainThread() { - auto* fake_manager = static_cast<ash::FakeChromeUserManager*>( - user_manager::UserManager::Get()); - // Explicitly removing the user is required; otherwise ProfileHelper keeps - // a dangling pointer to the User. - // TODO(b/208629291): Consider removing all users from ProfileHelper in the - // destructor of `ash::FakeChromeUserManager`. - fake_manager->RemoveUserFromList(kFakeAccountId); - scoped_user_manager_.reset(); - } - - private: - const DeviceLocalAccountSessionType session_type_; - - // Set up fake install attributes to make the device appeared as - // enterprise-managed. - ash::ScopedStubInstallAttributes test_install_attributes_{ - ash::StubInstallAttributes::CreateCloudManaged("example.com", "fake-id")}; - - std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_; -}; - class GetAuthTokenFunctionDeviceLocalAccountTest - : public GetAuthTokenFunctionTest { - public: - explicit GetAuthTokenFunctionDeviceLocalAccountTest( - DeviceLocalAccountSessionType session_type) - : platform_helper_(session_type) {} - - void SetUpOnMainThread() override { - platform_helper_.SetUpOnMainThread(); - GetAuthTokenFunctionTest::SetUpOnMainThread(); - } - - void TearDownOnMainThread() override { - GetAuthTokenFunctionTest::TearDownOnMainThread(); - platform_helper_.TearDownOnMainThread(); - } - + : public InProcessBrowserTestMixinHostSupport<GetAuthTokenFunctionTest> { protected: + GetAuthTokenFunctionDeviceLocalAccountTest() { set_chromeos_user_ = false; } + void RunExtensionAndVerifyNoError(bool is_extension_allowlisted) { scoped_refptr<FakeGetAuthTokenFunction> func( new FakeGetAuthTokenFunction()); @@ -3193,7 +3135,10 @@ std::string access_token; std::set<std::string> granted_scopes; - RunGetAuthTokenFunction(func.get(), "[{}]", browser(), &access_token, + auto* profile = Profile::FromBrowserContext( + ash::BrowserContextHelper::Get()->GetBrowserContextByUser( + user_manager::UserManager::Get()->GetActiveUser())); + RunGetAuthTokenFunction(func.get(), "[{}]", profile, &access_token, &granted_scopes); EXPECT_EQ(std::string(kAccessToken), access_token); EXPECT_EQ(func->GetExtensionTokenKeyForTest()->scopes, granted_scopes); @@ -3212,15 +3157,18 @@ .Build(); } - GetAuthTokenFunctionDeviceLocalAccountTestPlatformHelper platform_helper_; + private: + // Set up fake install attributes to make the device appeared as + // enterprise-managed. + ash::ScopedStubInstallAttributes test_install_attributes_{ + ash::StubInstallAttributes::CreateCloudManaged("example.com", "fake-id")}; }; class GetAuthTokenFunctionPublicSessionTest : public GetAuthTokenFunctionDeviceLocalAccountTest { - protected: - GetAuthTokenFunctionPublicSessionTest() - : GetAuthTokenFunctionDeviceLocalAccountTest( - DeviceLocalAccountSessionType::kPublic) {} + private: + ash::PublicAccountLoggedInBrowserTestMixin mixin_{&mixin_host_, + "public-account"}; }; IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionPublicSessionTest, NonAllowlisted) { @@ -3240,10 +3188,9 @@ class GetAuthTokenFunctionChromeKioskTest : public GetAuthTokenFunctionDeviceLocalAccountTest { - protected: - GetAuthTokenFunctionChromeKioskTest() - : GetAuthTokenFunctionDeviceLocalAccountTest( - DeviceLocalAccountSessionType::kAppKiosk) {} + private: + ash::KioskAppLoggedInBrowserTestMixin mixin_{&mixin_host_, + "kiosk-app-account"}; }; IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionChromeKioskTest, NonAllowlisted) { @@ -3254,10 +3201,9 @@ class GetAuthTokenFunctionWebKioskTest : public GetAuthTokenFunctionDeviceLocalAccountTest { - protected: - GetAuthTokenFunctionWebKioskTest() - : GetAuthTokenFunctionDeviceLocalAccountTest( - DeviceLocalAccountSessionType::kWebKiosk) {} + private: + ash::WebKioskAppLoggedInBrowserTestMixin mixin_{&mixin_host_, + "web-kiosk-app-account"}; }; IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionWebKioskTest, NonAllowlisted) {
diff --git a/chrome/browser/extensions/api/messaging/chrome_messaging_delegate.cc b/chrome/browser/extensions/api/messaging/chrome_messaging_delegate.cc index bc20d1d..b1de784 100644 --- a/chrome/browser/extensions/api/messaging/chrome_messaging_delegate.cc +++ b/chrome/browser/extensions/api/messaging/chrome_messaging_delegate.cc
@@ -18,9 +18,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" -#include "extensions/browser/api/messaging/extension_message_port.h" #include "extensions/browser/api/messaging/native_message_host.h" -#include "extensions/browser/extension_api_frame_id_map.h" #include "extensions/browser/pref_names.h" #include "extensions/common/api/messaging/port_id.h" #include "extensions/common/extension.h" @@ -109,55 +107,6 @@ return contents; } -std::unique_ptr<MessagePort> ChromeMessagingDelegate::CreateReceiverForTab( - base::WeakPtr<MessagePort::ChannelDelegate> channel_delegate, - const ExtensionId& extension_id, - const PortId& receiver_port_id, - content::WebContents* receiver_contents, - int receiver_frame_id, - const std::string& receiver_document_id) { - // Frame ID -1 is every frame in the tab. - bool include_child_frames = - receiver_frame_id == -1 && receiver_document_id.empty(); - - content::RenderFrameHost* receiver_render_frame_host = nullptr; - if (include_child_frames) { - // The target is the active outermost main frame of the WebContents. - receiver_render_frame_host = receiver_contents->GetPrimaryMainFrame(); - } else if (!receiver_document_id.empty()) { - ExtensionApiFrameIdMap::DocumentId document_id = - ExtensionApiFrameIdMap::DocumentIdFromString(receiver_document_id); - - // Return early for invalid documentIds. - if (!document_id) - return nullptr; - - receiver_render_frame_host = - ExtensionApiFrameIdMap::Get()->GetRenderFrameHostByDocumentId( - document_id); - - // If both |document_id| and |receiver_frame_id| are provided they - // should find the same RenderFrameHost, if not return early. - if (receiver_frame_id != -1 && - ExtensionApiFrameIdMap::GetRenderFrameHostById(receiver_contents, - receiver_frame_id) != - receiver_render_frame_host) { - return nullptr; - } - } else { - DCHECK_GT(receiver_frame_id, -1); - receiver_render_frame_host = ExtensionApiFrameIdMap::GetRenderFrameHostById( - receiver_contents, receiver_frame_id); - } - if (!receiver_render_frame_host) { - return nullptr; - } - - return ExtensionMessagePort::CreateForTab( - channel_delegate, receiver_port_id, extension_id, - receiver_render_frame_host, include_child_frames); -} - std::unique_ptr<MessagePort> ChromeMessagingDelegate::CreateReceiverForNativeApp( content::BrowserContext* browser_context,
diff --git a/chrome/browser/extensions/api/messaging/chrome_messaging_delegate.h b/chrome/browser/extensions/api/messaging/chrome_messaging_delegate.h index e76db4d..0df6f53 100644 --- a/chrome/browser/extensions/api/messaging/chrome_messaging_delegate.h +++ b/chrome/browser/extensions/api/messaging/chrome_messaging_delegate.h
@@ -29,13 +29,6 @@ content::WebContents* GetWebContentsByTabId( content::BrowserContext* browser_context, int tab_id) override; - std::unique_ptr<MessagePort> CreateReceiverForTab( - base::WeakPtr<MessagePort::ChannelDelegate> channel_delegate, - const ExtensionId& extension_id, - const PortId& receiver_port_id, - content::WebContents* receiver_contents, - int receiver_frame_id, - const std::string& receiver_document_id) override; std::unique_ptr<MessagePort> CreateReceiverForNativeApp( content::BrowserContext* browser_context, base::WeakPtr<MessagePort::ChannelDelegate> channel_delegate,
diff --git a/chrome/browser/extensions/crx_installer_browsertest.cc b/chrome/browser/extensions/crx_installer_browsertest.cc index 88eab058..6938a25e5 100644 --- a/chrome/browser/extensions/crx_installer_browsertest.cc +++ b/chrome/browser/extensions/crx_installer_browsertest.cc
@@ -83,7 +83,7 @@ #if BUILDFLAG(IS_CHROMEOS) #include "ash/constants/ash_switches.h" -#include "chrome/browser/ash/test/kiosk_logged_in_browser_test_mixin.h" +#include "chrome/browser/ash/test/kiosk_app_logged_in_browser_test_mixin.h" #include "chrome/browser/extensions/extension_assets_manager_chromeos.h" #endif @@ -1006,8 +1006,8 @@ ExtensionCrxInstallerKioskTest() { set_chromeos_user_ = false; } private: - ash::KioskLoggedInBrowserTestMixin kiosk_mixin_{ - &mixin_host_, "example@kiosk-apps.device-local.localhost"}; + ash::KioskAppLoggedInBrowserTestMixin kiosk_mixin_{&mixin_host_, + "kiosk-account"}; }; IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerKioskTest, InstallTest) {
diff --git a/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.cc b/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.cc index f24d3e96..bcd0eed 100644 --- a/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.cc +++ b/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.cc
@@ -7,6 +7,7 @@ #include "base/android/build_info.h" #include "base/functional/callback_helpers.h" #include "chrome/browser/autofill/personal_data_manager_factory.h" +#include "chrome/browser/autofill/strike_database_factory.h" #include "chrome/browser/facilitated_payments/ui/android/facilitated_payments_controller.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/identity_manager_factory.h" @@ -127,6 +128,17 @@ return &driver_factory_.GetOrCreateForFrame(render_frame_host); } +autofill::StrikeDatabase* ChromeFacilitatedPaymentsClient::GetStrikeDatabase() { + content::BrowserContext* context = GetWebContents().GetBrowserContext(); + + Profile* profile = Profile::FromBrowserContext(context); + if (!profile) { + return nullptr; + } + + return autofill::StrikeDatabaseFactory::GetForProfile(profile); +} + void ChromeFacilitatedPaymentsClient:: SetFacilitatedPaymentsControllerForTesting( std::unique_ptr<FacilitatedPaymentsController> mock_controller) {
diff --git a/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.h b/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.h index 2fddc706..1dd4781a 100644 --- a/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.h +++ b/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.h
@@ -16,6 +16,7 @@ namespace autofill { class BankAccount; class Ewallet; +class StrikeDatabase; } // namespace autofill namespace content { @@ -45,7 +46,7 @@ // RiskDataLoader: void LoadRiskData(base::OnceCallback<void(const std::string&)> - on_risk_data_loaded_callback) override; + on_risk_data_loaded_callback) final; payments::facilitated::ContentFacilitatedPaymentsDriver* GetFacilitatedPaymentsDriverForFrame( @@ -59,26 +60,27 @@ // FacilitatedPaymentsClient: // This returns nullptr if the `Profile` associated is null. - autofill::PaymentsDataManager* GetPaymentsDataManager() override; + autofill::PaymentsDataManager* GetPaymentsDataManager() final; // This returns nullptr if the `Profile` associated is null. payments::facilitated::FacilitatedPaymentsNetworkInterface* - GetFacilitatedPaymentsNetworkInterface() override; + GetFacilitatedPaymentsNetworkInterface() final; // This returns std::nullopt if the `Profile` associated is null. - std::optional<CoreAccountInfo> GetCoreAccountInfo() override; - bool IsInLandscapeMode() override; - bool IsFoldable() override; + std::optional<CoreAccountInfo> GetCoreAccountInfo() final; + bool IsInLandscapeMode() final; + bool IsFoldable() final; void ShowPixPaymentPrompt( base::span<const autofill::BankAccount> bank_account_suggestions, - base::OnceCallback<void(int64_t)> on_payment_account_selected) override; + base::OnceCallback<void(int64_t)> on_payment_account_selected) final; void ShowEwalletPaymentPrompt( base::span<const autofill::Ewallet> ewallet_suggestions, - base::OnceCallback<void(int64_t)> on_payment_account_selected) override; - void ShowProgressScreen() override; - void ShowErrorScreen() override; - void DismissPrompt() override; + base::OnceCallback<void(int64_t)> on_payment_account_selected) final; + void ShowProgressScreen() final; + void ShowErrorScreen() final; + void DismissPrompt() final; void SetUiEventListener( base::RepeatingCallback<void(payments::facilitated::UiEvent)> - ui_event_listener) override; + ui_event_listener) final; + autofill::StrikeDatabase* GetStrikeDatabase() final; payments::facilitated::ContentFacilitatedPaymentsDriverFactory driver_factory_;
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index e6c1121..1d18fe1 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -611,11 +611,6 @@ "expiry_milestone": 135 }, { - "name": "autofill-enable-card-expired-text", - "owners": [ "ferny@google.com", "payments-autofill-team@google.com" ], - "expiry_milestone": 140 - }, - { "name": "autofill-enable-card-info-runtime-retrieval", "owners": [ "hvs@google.com", "payments-autofill-team@google.com"], "expiry_milestone": 145 @@ -3906,12 +3901,17 @@ }, { "name": "enable-standard-device-bound-session-credentials", - "owners": [ "drubery@chromium.org", "kristianm@chromium.org"], + "owners": [ "drubery@chromium.org", "thefrog@chromium.org"], "expiry_milestone": 138 }, { "name": "enable-standard-device-bound-session-persistence", - "owners": [ "anunoy@chromium.org", "drubery@chromium.org", "kristianm@chromium.org"], + "owners": [ "anunoy@chromium.org", "drubery@chromium.org", "thefrog@chromium.org"], + "expiry_milestone": 138 + }, + { + "name": "enable-standard-device-bound-sesssion-refresh-quota", + "owners": [ "drubery@chromium.org", "thefrog@chromium.org"], "expiry_milestone": 138 }, { @@ -5103,14 +5103,6 @@ "expiry_milestone": 133 }, { - "name": "https-first-mode-v2", - "owners": [ - "cthomp@chromium.org", - "chrome-secure-web-and-net@chromium.org" - ], - "expiry_milestone": 118 - }, - { "name": "https-first-mode-v2-for-engaged-sites", "owners": [ "meacer@chromium.org",
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 3e3a5ab..2520d65 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -593,12 +593,6 @@ "When enabled, Chrome will sync user data related to buy now pay later."; #endif -const char kAutofillEnableCardExpiredTextName[] = - "Enable 'expired' text for expired cards."; -const char kAutofillEnableCardExpiredTextDescription[] = - "When enabled, cards that have expired will display 'expired' instead of " - "'expires' text."; - const char kAutofillEnableCvcStorageAndFillingName[] = "Enable CVC storage and filling for payments autofill"; const char kAutofillEnableCvcStorageAndFillingDescription[] = @@ -2268,10 +2262,6 @@ "Enable new HTTPS-First Mode settings UI for HTTPS-First Mode in " "Incognito. Must also enable #https-first-mode-incognito."; -const char kHttpsFirstModeV2Name[] = "HTTPS-First Mode V2"; -const char kHttpsFirstModeV2Description[] = - "Enable rearchitected version of HTTPS-First Mode."; - const char kHttpsFirstModeV2ForEngagedSitesName[] = "HTTPS-First Mode V2 For Engaged Sites"; const char kHttpsFirstModeV2ForEngagedSitesDescription[] = @@ -4520,12 +4510,6 @@ const char kFeedDynamicColorsDescription[] = "Allows feed to fully respect dynamic colors if supported by the client."; -const char kFetchGaiaHashOnSignInName[] = - "Enable Fetching Gaia credentials from SharedPreferences."; -const char kFetchGaiaHashOnSignInDescription[] = - "Enable retrieving email, salt, and hashed password from SharedPreferences " - "for password reuse detection when a user signs in."; - const char kFloatingSnackbarName[] = "FloatingSnackbar"; const char kFloatingSnackbarDescription[] = "Enables the snackbar to float on top of the web content."; @@ -8013,6 +7997,12 @@ const char kEnableStandardBoundSessionPersistenceDescription[] = "Enables session persistence for the official version of " "Device Bound Session Credentials."; +const char kEnableStandardBoundSessionRefreshQuotaName[] = + "Device Bound Session Credentials (Standard) Refresh Quota"; +const char kEnableStandardBoundSessionRefreshQuotaDescription[] = + "In production, standard Device Bound Session Credentials will feature a " + "maximum rate of refreshes. This flag disables that quota in order to " + "simplify manual testing."; #if BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI) const char kEnableCertManagementV2UIName[] = "Cert Management V2 UI";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 91a57290..ef8fab7 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -373,9 +373,6 @@ extern const char kAutofillEnableBuyNowPayLaterSyncingDescription[]; #endif -extern const char kAutofillEnableCardExpiredTextName[]; -extern const char kAutofillEnableCardExpiredTextDescription[]; - extern const char kAutofillEnableCvcStorageAndFillingName[]; extern const char kAutofillEnableCvcStorageAndFillingDescription[]; @@ -1300,9 +1297,6 @@ extern const char kHttpsFirstModeIncognitoNewSettingsName[]; extern const char kHttpsFirstModeIncognitoNewSettingsDescription[]; -extern const char kHttpsFirstModeV2Name[]; -extern const char kHttpsFirstModeV2Description[]; - extern const char kHttpsFirstModeV2ForEngagedSitesName[]; extern const char kHttpsFirstModeV2ForEngagedSitesDescription[]; @@ -2666,9 +2660,6 @@ extern const char kFeedDiscoFeedEndpointName[]; extern const char kFeedDiscoFeedEndpointDescription[]; -extern const char kFetchGaiaHashOnSignInName[]; -extern const char kFetchGaiaHashOnSignInDescription[]; - extern const char kFloatingSnackbarName[]; extern const char kFloatingSnackbarDescription[]; @@ -4746,6 +4737,8 @@ extern const char kEnableStandardBoundSessionCredentialsDescription[]; extern const char kEnableStandardBoundSessionPersistenceName[]; extern const char kEnableStandardBoundSessionPersistenceDescription[]; +extern const char kEnableStandardBoundSessionRefreshQuotaName[]; +extern const char kEnableStandardBoundSessionRefreshQuotaDescription[]; #if BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI) extern const char kEnableCertManagementV2UIName[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc index 08a4b60..825c300 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -670,7 +670,7 @@ BASE_FEATURE(kCCTNestedSecurityIcon, "CCTNestedSecurityIcon", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kCCTGoogleBottomBar, "CCTGoogleBottomBar", @@ -708,7 +708,7 @@ BASE_FEATURE(kCCTRevampedBranding, "CCTRevampedBranding", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kCCTTabModalDialog, "CCTTabModalDialog",
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java index 73836b9..642ab2f9 100644 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -677,9 +677,9 @@ public static final CachedFlag sCctOpenInBrowserButtonIfEnabledByEmbedder = newCachedFlag(CCT_OPEN_IN_BROWSER_BUTTON_IF_ENABLED_BY_EMBEDDER, true); public static final CachedFlag sCctRevampedBranding = - newCachedFlag(CCT_REVAMPED_BRANDING, false); + newCachedFlag(CCT_REVAMPED_BRANDING, true); public static final CachedFlag sCctNestedSecurityIcon = - newCachedFlag(CCT_NESTED_SECURITY_ICON, false); + newCachedFlag(CCT_NESTED_SECURITY_ICON, true); public static final CachedFlag sCctTabModalDialog = newCachedFlag(CCT_TAB_MODAL_DIALOG, true); public static final CachedFlag sClankStartupLatencyInjection = newCachedFlag(CLANK_STARTUP_LATENCY_INJECTION, false); @@ -1094,6 +1094,11 @@ public static final BooleanCachedFeatureParam sAndroidAppIntegrationWithFaviconSkipSchemaCheck = newBooleanCachedFeatureParam( ANDROID_APP_INTEGRATION_WITH_FAVICON, "skip_schema_check", false); + + public static final BooleanCachedFeatureParam sAndroidAppIntegrationMultiDataSourceUseSchemaV1 = + newBooleanCachedFeatureParam( + ANDROID_APP_INTEGRATION_MULTI_DATA_SOURCE, "use_schema_v1", false); + public static final IntCachedFeatureParam sCctAuthTabEnableHttpsRedirectsVerificationTimeoutMs = newIntCachedFeatureParam( CCT_AUTH_TAB_ENABLE_HTTPS_REDIRECTS, "verification_timeout_ms", 10_000); @@ -1400,6 +1405,7 @@ sAndroidAppIntegrationModuleShowThirdPartyCard, sAndroidAppIntegrationWithFaviconScheduleDelayTimeMs, sAndroidAppIntegrationWithFaviconSkipSchemaCheck, + sAndroidAppIntegrationMultiDataSourceUseSchemaV1, sAndroidAppIntegrationWithFaviconUseLargeFavicon, sAndroidAppIntegrationWithFaviconZeroStateFaviconNumber, sCctAdaptiveButtonEnableOpenInBrowser,
diff --git a/chrome/browser/glic/BUILD.gn b/chrome/browser/glic/BUILD.gn index b27467c..741b46d 100644 --- a/chrome/browser/glic/BUILD.gn +++ b/chrome/browser/glic/BUILD.gn
@@ -25,7 +25,6 @@ "glic_pref_names.h", "glic_profile_manager.h", "glic_settings_util.h", - "glic_synthetic_trial_manager.h", "glic_tab_data.h", "glic_tab_indicator_helper.h", "glic_ui.h", @@ -100,6 +99,7 @@ "glic_screenshot_capturer.h", "glic_settings_util.cc", "glic_synthetic_trial_manager.cc", + "glic_synthetic_trial_manager.h", "glic_tab_data.cc", "glic_tab_indicator_helper.cc", "glic_ui.cc", @@ -140,6 +140,7 @@ "//components/feature_engagement/public:feature_constants", "//components/guest_view/browser", "//components/language/core/common", + "//components/metrics_services_manager:metrics_services_manager", "//components/pdf/browser:browser", "//components/pdf/common:constants", "//components/sessions", @@ -250,7 +251,6 @@ sources = [ "glic_border_view_interactive_uitest.cc", "glic_fre_controller_interactive_uitest.cc", - "glic_keyed_service_interactive_uitest.cc", "glic_settings_util_interactive_uitest.cc", "glic_tab_indicator_helper_interactive_uitest.cc", "glic_ui_interactive_uitest.cc",
diff --git a/chrome/browser/glic/glic_border_view.cc b/chrome/browser/glic/glic_border_view.cc index feb3648..b4d9d19 100644 --- a/chrome/browser/glic/glic_border_view.cc +++ b/chrome/browser/glic/glic_border_view.cc
@@ -175,9 +175,9 @@ case UpdateBorderReason::kContextAccessIndicatorOn: { // Off to On. Throw away everything we have and start the animation from // the beginning. - border_view_->CancelAnimation(); + border_view_->StopShowing(); if (ShouldShowBorderAnimation()) { - border_view_->StartAnimation(); + border_view_->Show(); } break; } @@ -197,9 +197,9 @@ // This happens when the user has changed the focus from this chrome // window to a different chrome window or a different app. case UpdateBorderReason::kFocusedTabChanged_GainFocus: { - border_view_->CancelAnimation(); + border_view_->StopShowing(); if (ShouldShowBorderAnimation()) { - border_view_->StartAnimation(); + border_view_->Show(); } break; } @@ -400,7 +400,7 @@ bool opacity_ramp_down_done = opacity_ == 0.f && !first_ramp_down_frame_.is_null(); if (opacity_ramp_down_done) { - CancelAnimation(); + StopShowing(); return; } @@ -408,10 +408,10 @@ } void GlicBorderView::OnCompositingShuttingDown(ui::Compositor* compositor) { - CancelAnimation(); + StopShowing(); } -void GlicBorderView::StartAnimation() { +void GlicBorderView::Show() { if (compositor_) { // The user can click on the glic icon after the window is shown. The // animation is already playing at that time. @@ -444,7 +444,7 @@ } } -void GlicBorderView::CancelAnimation() { +void GlicBorderView::StopShowing() { if (!compositor_) { return; } @@ -466,6 +466,12 @@ SetVisible(false); } +bool GlicBorderView::IsShowing() const { + // `compositor_` is set when the border starts to show and unset when the + // border stops to show. + return !!compositor_; +} + float GlicBorderView::GetEffectTimeForTesting() const { return GetEffectTime(); } @@ -487,7 +493,7 @@ void GlicBorderView::ResetEmphasisAndReplay() { // TOOD(crbug.com/398319435): Remove once we know why this is called before - // `StartAnimation()`. + // `Show()`. if (!compositor_) { SCOPED_CRASH_KEY_NUMBER("crbug-398319435", "opacity", opacity_); SCOPED_CRASH_KEY_NUMBER("crbug-398319435", "emphasis", emphasis_);
diff --git a/chrome/browser/glic/glic_border_view.h b/chrome/browser/glic/glic_border_view.h index f15edbf1..524c202 100644 --- a/chrome/browser/glic/glic_border_view.h +++ b/chrome/browser/glic/glic_border_view.h
@@ -40,15 +40,17 @@ // `ui::CompositorObserver`: void OnCompositingShuttingDown(ui::Compositor* compositor) override; - // TODO(liuwilliam): These should be private once we can end-to-end test the - // UI behaviors. - void StartAnimation(); - void CancelAnimation(); + // TODO(crbug.com/390233842): These should be private once we can end-to-end + // test the UI behaviors. + void Show(); + void StopShowing(); - ui::Compositor* compositor_for_testing() const { return compositor_; } + bool IsShowing() const; + // TODO(crbug.com/384712084): Ideally we shouldn't expose these internals for + // testing. The pixel comparison tests were flaky thus reverted. Remove these + // once we set up the Skia Gold tests. float opacity_for_testing() const { return opacity_; } - float emphasis_for_testing() const { return emphasis_; } // Allows tests to alternate some animation APIs, for the deterministic
diff --git a/chrome/browser/glic/glic_border_view_interactive_uitest.cc b/chrome/browser/glic/glic_border_view_interactive_uitest.cc index 18cb298..3f755418c 100644 --- a/chrome/browser/glic/glic_border_view_interactive_uitest.cc +++ b/chrome/browser/glic/glic_border_view_interactive_uitest.cc
@@ -195,8 +195,8 @@ } // Regression test for https://crbug.com/387458471: The border shouldn't be -// visible before StartAnimation is called, and shouldn't be visible after -// CancelAnimation is called. +// visible before Show is called, and shouldn't be visible after +// StopShowing is called. IN_PROC_BROWSER_TEST_F(GlicBorderViewUiTest, Visibility) { auto* border = browser()->window()->AsBrowserView()->glic_border(); ASSERT_TRUE(border); @@ -205,9 +205,9 @@ TesterImpl tester(border, base::TimeTicks::Now()); StartBorderAnimation(browser()); tester.WaitForAnimationStart(); - EXPECT_TRUE(border->compositor_for_testing()); + EXPECT_TRUE(border->IsShowing()); EXPECT_TRUE(border->GetVisible()); - border->CancelAnimation(); + border->StopShowing(); EXPECT_FALSE(border->GetVisible()); } @@ -221,7 +221,7 @@ StartBorderAnimation(browser()); tester.WaitForAnimationStart(); - EXPECT_TRUE(border->compositor_for_testing()); + EXPECT_TRUE(border->IsShowing()); // Manually stepping the animation code to mimic the behavior of the // compositor. As a part of crbug.com/384712084, testing via requesting @@ -262,8 +262,8 @@ 1.f - gfx::Tween::CalculateValue(gfx::Tween::Type::EASE_IN_OUT_2, 0.433), kFloatComparisonTolerance); - border->CancelAnimation(); - EXPECT_FALSE(border->compositor_for_testing()); + border->StopShowing(); + EXPECT_FALSE(border->IsShowing()); } // Ensures that the border animation state is reset after canceling the @@ -275,11 +275,11 @@ TesterImpl tester(border, base::TimeTicks::Now()); StartBorderAnimation(browser()); tester.WaitForAnimationStart(); - EXPECT_TRUE(border->compositor_for_testing()); + EXPECT_TRUE(border->IsShowing()); border->OnAnimationStep(base::TimeTicks::Now()); - border->CancelAnimation(); + border->StopShowing(); - EXPECT_FALSE(border->compositor_for_testing()); + EXPECT_FALSE(border->IsShowing()); EXPECT_FALSE(border->opacity_for_testing()); EXPECT_FALSE(border->emphasis_for_testing()); } @@ -293,7 +293,7 @@ StartBorderAnimation(browser()); tester.WaitForAnimationStart(); - EXPECT_TRUE(border->compositor_for_testing()); + EXPECT_TRUE(border->IsShowing()); // T=0s. border->OnAnimationStep(kDummyTimeStamp); @@ -339,8 +339,8 @@ 1.f - gfx::Tween::CalculateValue(gfx::Tween::Type::EASE_IN_OUT_2, 0.234), kFloatComparisonTolerance); - border->CancelAnimation(); - EXPECT_FALSE(border->compositor_for_testing()); + border->StopShowing(); + EXPECT_FALSE(border->IsShowing()); } // Disabled due to brittleness; see https://crrev.com/c/6289227. @@ -352,7 +352,7 @@ StartBorderAnimation(browser()); tester->WaitForAnimationStart(); - EXPECT_TRUE(border->compositor_for_testing()); + EXPECT_TRUE(border->IsShowing()); // T=0s. border->OnAnimationStep(kDummyTimeStamp); @@ -378,14 +378,14 @@ new_tester->WaitForAnimationStart(); } ASSERT_TRUE(new_border); - EXPECT_TRUE(new_border->compositor_for_testing()); + EXPECT_TRUE(new_border->IsShowing()); // The first `OnAnimationStep()` on the defocused border starts the ramp // down sequence. After 0.5s, the ramp down has finished. border->OnAnimationStep(kDummyTimeStamp); timestamp += base::Seconds(0.5); tester->set_next_time_tick(timestamp); border->OnAnimationStep(kDummyTimeStamp); - EXPECT_FALSE(border->compositor_for_testing()); + EXPECT_FALSE(border->IsShowing()); // T=0 in the new window. new_border->OnAnimationStep(kDummyTimeStamp); @@ -405,8 +405,8 @@ EXPECT_NEAR(new_border->emphasis_for_testing(), 0.431, kFloatComparisonTolerance); - new_border->CancelAnimation(); - EXPECT_FALSE(new_border->compositor_for_testing()); + new_border->StopShowing(); + EXPECT_FALSE(new_border->IsShowing()); } // Ensures that the border fades out before disappearing entirely during @@ -419,7 +419,7 @@ StartBorderAnimation(browser()); tester.WaitForAnimationStart(); - EXPECT_TRUE(border->compositor_for_testing()); + EXPECT_TRUE(border->IsShowing()); // T=0s. border->OnAnimationStep(kDummyTimeStamp); @@ -458,11 +458,11 @@ border->OnAnimationStep(kDummyTimeStamp); // clamp 0.666-(0.193/0.2) = 0.0 EXPECT_NEAR(border->opacity_for_testing(), 0.f, kFloatComparisonTolerance); - // 0.52/0.5 -> 1, however since CancelAnimation has been invoked (this + // 0.52/0.5 -> 1, however since StopShowing has been invoked (this // happens when the opacity ramp down is done in order to clean up), emphasis // is reset to zero and the compositor is reset. EXPECT_NEAR(border->emphasis_for_testing(), 0.f, kFloatComparisonTolerance); - EXPECT_FALSE(border->compositor_for_testing()); + EXPECT_FALSE(border->IsShowing()); } // Ensures that the border fades out before disappearing entirely during opacity @@ -475,7 +475,7 @@ StartBorderAnimation(browser()); tester.WaitForAnimationStart(); - EXPECT_TRUE(border->compositor_for_testing()); + EXPECT_TRUE(border->IsShowing()); // T=0s. border->OnAnimationStep(kDummyTimeStamp); @@ -516,11 +516,11 @@ // clamp 0.6-(0.15/0.2) -> 0 EXPECT_NEAR(border->opacity_for_testing(), 0.f, kFloatComparisonTolerance); // 0.45/0.5=0.9, 1-(1-0.9)**2=0.99. - // However since CancelAnimation has been invoked (this happens when the + // However since StopShowing has been invoked (this happens when the // opacity ramp down is done in order to clean up), emphasis is reset to // zero and the compositor is reset. EXPECT_NEAR(border->emphasis_for_testing(), 0.f, kFloatComparisonTolerance); - EXPECT_FALSE(border->compositor_for_testing()); + EXPECT_FALSE(border->IsShowing()); } // Ensures that the border fades out before disappearing entirely during stable @@ -533,7 +533,7 @@ StartBorderAnimation(browser()); tester.WaitForAnimationStart(); - EXPECT_TRUE(border->compositor_for_testing()); + EXPECT_TRUE(border->IsShowing()); // T=0s. border->OnAnimationStep(kDummyTimeStamp); @@ -576,7 +576,7 @@ timestamp += base::Seconds(5); tester.set_next_time_tick(timestamp); border->OnAnimationStep(kDummyTimeStamp); - EXPECT_FALSE(border->compositor_for_testing()); + EXPECT_FALSE(border->IsShowing()); } IN_PROC_BROWSER_TEST_F(GlicBorderViewUiTest, EnsureTimeWraps) { @@ -618,7 +618,7 @@ StartBorderAnimation(browser()); tester.WaitForAnimationStart(); - EXPECT_TRUE(border->compositor_for_testing()); + EXPECT_TRUE(border->IsShowing()); // T=0s. border->OnAnimationStep(kDummyTimeStamp); @@ -648,8 +648,8 @@ // different tab. EXPECT_EQ(effect_time_before_tab_switching, effect_time_after_tab_switching); - border->CancelAnimation(); - EXPECT_FALSE(border->compositor_for_testing()); + border->StopShowing(); + EXPECT_FALSE(border->IsShowing()); } namespace { @@ -696,7 +696,7 @@ StartBorderAnimation(browser()); tester.WaitForAnimationStart(); - EXPECT_TRUE(border->compositor_for_testing()); + EXPECT_TRUE(border->IsShowing()); // ---- Ramping up ---- // T=0s. @@ -758,7 +758,7 @@ border->OnAnimationStep(kDummyTimeStamp); EXPECT_NEAR(border->opacity_for_testing(), 0.f, kFloatComparisonTolerance); EXPECT_NEAR(border->emphasis_for_testing(), 0.f, kFloatComparisonTolerance); - EXPECT_FALSE(border->compositor_for_testing()); + EXPECT_FALSE(border->IsShowing()); } } // namespace glic
diff --git a/chrome/browser/glic/glic_fre_controller.cc b/chrome/browser/glic/glic_fre_controller.cc index 8d297e11..ea579f9 100644 --- a/chrome/browser/glic/glic_fre_controller.cc +++ b/chrome/browser/glic/glic_fre_controller.cc
@@ -191,6 +191,14 @@ "Minimal data is exchanged, though this may share network state " "with credentialed requests." destination: GOOGLE_OWNED_SERVICE + internal { + contacts { + owners: "//chrome/browser/glic/OWNERS" + } + } + user_data { + type: NONE + } last_reviewed: "2025-02-26" } policy {
diff --git a/chrome/browser/glic/glic_keyed_service.cc b/chrome/browser/glic/glic_keyed_service.cc index 5cf1063f..fe67062 100644 --- a/chrome/browser/glic/glic_keyed_service.cc +++ b/chrome/browser/glic/glic_keyed_service.cc
@@ -23,7 +23,6 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_navigator.h" #include "chrome/browser/ui/browser_navigator_params.h" -#include "chrome/browser/ui/profiles/profile_picker.h" #include "components/guest_view/browser/guest_view_base.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_context.h" @@ -125,18 +124,6 @@ return nullptr; } -void GlicKeyedService::DidSelectProfile(Profile* profile) { - if (!GlicEnabling::IsEnabledForProfile(profile)) { - return; - } - // Toggle glic but prevent close if it is already open for the selected - // profile. - GlicKeyedService* service = - GlicKeyedServiceFactory::GetGlicKeyedService(profile); - service->ToggleUI(nullptr, /*prevent_close=*/true, - InvocationSource::kProfilePicker); -} - base::CallbackListSubscription GlicKeyedService::AddFocusedTabChangedCallback( FocusedTabChangedCallback callback) { return focused_tab_manager_.AddFocusedTabChangedCallback(callback); @@ -205,15 +192,6 @@ window_controller_->Resize(size, duration, std::move(callback)); } -void GlicKeyedService::ShowProfilePicker() { - base::OnceCallback<void(Profile*)> callback = base::BindOnce( - &GlicKeyedService::DidSelectProfile, weak_ptr_factory_.GetWeakPtr()); - // If the panel is not closed it will be on top of the profile picker. - ClosePanel(); - ProfilePicker::Show( - ProfilePicker::Params::ForGlicManager(std::move(callback))); -} - void GlicKeyedService::SetPanelDraggableAreas( const std::vector<gfx::Rect>& draggable_areas) { window_controller_->SetDraggableAreas(draggable_areas);
diff --git a/chrome/browser/glic/glic_keyed_service.h b/chrome/browser/glic/glic_keyed_service.h index 3224413..6a1ef15a 100644 --- a/chrome/browser/glic/glic_keyed_service.h +++ b/chrome/browser/glic/glic_keyed_service.h
@@ -15,7 +15,6 @@ #include "chrome/browser/glic/glic_enums.h" #include "chrome/browser/glic/glic_focused_tab_manager.h" #include "chrome/browser/glic/glic_page_handler.h" -#include "chrome/browser/glic/glic_synthetic_trial_manager.h" #include "components/keyed_service/core/keyed_service.h" class BrowserWindowInterface; @@ -91,16 +90,10 @@ void ResizePanel(const gfx::Size& size, base::TimeDelta duration, base::OnceClosure callback); - void ShowProfilePicker(); void SetPanelDraggableAreas(const std::vector<gfx::Rect>& draggable_areas); void SetContextAccessIndicator(bool show); void NotifyWindowIntentToShow(); - // Accessor for the GlicSyntheticTrialManager singleton. This exists as a - // singleton so that it may be shared across multiple profiles. - raw_ptr<GlicSyntheticTrialManager> synthetic_trial_manager() { - return GlicSyntheticTrialManager::GetInstance(); - } // Callback for changes to focused tab data. using FocusedTabChangedCallback = base::RepeatingCallback<void(FocusedTabData)>; @@ -159,8 +152,6 @@ virtual void TryPreload(); void Reload(); - GlicProfileManager* GetProfileManagerForTesting() { return profile_manager_; } - Profile* profile() const { return profile_; } base::WeakPtr<GlicKeyedService> GetWeakPtr(); @@ -168,9 +159,6 @@ private: GlicPageHandler* GetPageHandler(const content::WebContents* webui_contents); - // Callback from ProfilePicker::Show(). - void DidSelectProfile(Profile* profile); - // List of callbacks to be notified when the client requests a change to the // context access indicator status. base::RepeatingCallbackList<void(bool)>
diff --git a/chrome/browser/glic/glic_keyed_service_interactive_uitest.cc b/chrome/browser/glic/glic_keyed_service_interactive_uitest.cc deleted file mode 100644 index 0152d1a..0000000 --- a/chrome/browser/glic/glic_keyed_service_interactive_uitest.cc +++ /dev/null
@@ -1,31 +0,0 @@ -// Copyright 2025 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/browser_process.h" -#include "chrome/browser/glic/glic_keyed_service_factory.h" -#include "chrome/browser/glic/glic_window_controller.h" -#include "chrome/browser/glic/interactive_glic_test.h" -#include "chrome/test/base/interactive_test_utils.h" -#include "chrome/test/base/ui_test_utils.h" -#include "chrome/test/interaction/interactive_browser_test.h" -#include "content/public/test/browser_test.h" -#include "content/public/test/browser_test_utils.h" - -namespace glic { - -class GlicKeyedServiceUiTest : public test::InteractiveGlicTest { - public: - GlicKeyedServiceUiTest() = default; - ~GlicKeyedServiceUiTest() override = default; -}; - -IN_PROC_BROWSER_TEST_F(GlicKeyedServiceUiTest, - OpeningProfilePickerClosesPanel) { - RunTestSequence(OpenGlicWindow(GlicWindowMode::kDetached), - CheckControllerWidgetMode(GlicWindowMode::kDetached), - Do([&]() { glic_service()->ShowProfilePicker(); }), - CheckControllerHasWidget(false)); -} - -} // namespace glic
diff --git a/chrome/browser/glic/glic_page_handler.cc b/chrome/browser/glic/glic_page_handler.cc index 8d056481..9e57191e 100644 --- a/chrome/browser/glic/glic_page_handler.cc +++ b/chrome/browser/glic/glic_page_handler.cc
@@ -25,10 +25,12 @@ #include "chrome/browser/glic/glic_keyed_service_factory.h" #include "chrome/browser/glic/glic_metrics.h" #include "chrome/browser/glic/glic_pref_names.h" +#include "chrome/browser/glic/glic_profile_manager.h" #include "chrome/browser/glic/glic_synthetic_trial_manager.h" #include "chrome/browser/glic/glic_tab_data.h" #include "chrome/browser/glic/glic_web_client_access.h" #include "chrome/browser/glic/glic_window_controller.h" +#include "chrome/browser/global_features.h" #include "chrome/browser/media/audio_ducker.h" #include "chrome/browser/profiles/profile_attributes_storage.h" #include "chrome/browser/profiles/profile_manager.h" @@ -277,7 +279,9 @@ void DetachPanel() override { glic_service_->DetachPanel(); } - void ShowProfilePicker() override { glic_service_->ShowProfilePicker(); } + void ShowProfilePicker() override { + glic::GlicProfileManager::GetInstance()->ShowProfilePicker(); + } void ResizeWidget(const gfx::Size& size, base::TimeDelta duration, @@ -410,8 +414,9 @@ void SetSyntheticExperimentState(const std::string& trial_name, const std::string& group_name) override { - glic_service_->synthetic_trial_manager()->SetSyntheticExperimentState( - trial_name, group_name); + g_browser_process->GetFeatures() + ->glic_synthetic_trial_manager() + ->SetSyntheticExperimentState(trial_name, group_name); } // GlicWindowController::StateObserver implementation.
diff --git a/chrome/browser/glic/glic_profile_manager.cc b/chrome/browser/glic/glic_profile_manager.cc index 45e576a8..f5f790a 100644 --- a/chrome/browser/glic/glic_profile_manager.cc +++ b/chrome/browser/glic/glic_profile_manager.cc
@@ -17,6 +17,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_list.h" +#include "chrome/browser/ui/profiles/profile_picker.h" #include "chrome/common/chrome_features.h" #include "chrome/common/chrome_switches.h" @@ -63,13 +64,6 @@ GlicProfileManager::~GlicProfileManager() = default; -void GlicProfileManager::CloseGlicWindow() { - if (active_glic_) { - active_glic_->ClosePanel(); - active_glic_.reset(); - } -} - Profile* GlicProfileManager::GetProfileForLaunch() const { if (g_forced_profile_for_launch_) { return g_forced_profile_for_launch_; @@ -134,10 +128,6 @@ return true; } -bool GlicProfileManager::HasActiveGlicService() const { - return active_glic_ != nullptr; -} - void GlicProfileManager::MaybeAutoOpenGlicPanel() { if (did_auto_open_ || !base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kGlicOpenOnStartup)) { @@ -152,6 +142,31 @@ did_auto_open_ = true; } +void GlicProfileManager::ShowProfilePicker() { + base::OnceCallback<void(Profile*)> callback = base::BindOnce( + &GlicProfileManager::DidSelectProfile, weak_ptr_factory_.GetWeakPtr()); + // If the panel is not closed it will be on top of the profile picker. + if (active_glic_) { + active_glic_->ClosePanel(); + } + ProfilePicker::Show( + ProfilePicker::Params::ForGlicManager(std::move(callback))); +} + +void GlicProfileManager::DidSelectProfile(Profile* profile) { + // TODO(crbug.com/399727295) Remove once the profile picker calls this with + // fully initialized profiles. + if (!GlicEnabling::IsEnabledForProfile(profile)) { + return; + } + // Toggle glic but prevent close if it is already open for the selected + // profile. + GlicKeyedService* service = + GlicKeyedServiceFactory::GetGlicKeyedService(profile); + service->ToggleUI(nullptr, /*prevent_close=*/true, + InvocationSource::kProfilePicker); +} + // static void GlicProfileManager::ForceProfileForLaunchForTesting(Profile* profile) { g_forced_profile_for_launch_ = profile;
diff --git a/chrome/browser/glic/glic_profile_manager.h b/chrome/browser/glic/glic_profile_manager.h index 05c75c6..bb7c937 100644 --- a/chrome/browser/glic/glic_profile_manager.h +++ b/chrome/browser/glic/glic_profile_manager.h
@@ -28,9 +28,6 @@ GlicProfileManager(const GlicProfileManager&) = delete; GlicProfileManager& operator=(const GlicProfileManager&) = delete; - // Close the Glic window, if one exists. - void CloseGlicWindow(); - // Return the profile that should be used to open glic. May be null if there // is no eligible profile. Profile* GetProfileForLaunch() const; @@ -41,14 +38,12 @@ // True if the given profile should be considered for preloading. bool ShouldPreloadForProfile(Profile* profile) const; - // Returns true if there is an active Glic service, whether or not that - // service's panel is showing. - bool HasActiveGlicService() const; - // Opens the panel if the "glic-open-on-startup" command line switch was used // and glic has not already opened like this. void MaybeAutoOpenGlicPanel(); + void ShowProfilePicker(); + // Static in order to permit setting forced values before the manager is // constructed. static void ForceProfileForLaunchForTesting(Profile* profile); @@ -56,11 +51,15 @@ base::MemoryPressureMonitor::MemoryPressureLevel* level); private: + // Callback from ProfilePicker::Show(). + void DidSelectProfile(Profile* profile); + base::MemoryPressureMonitor::MemoryPressureLevel GetCurrentPressureLevel() const; base::WeakPtr<GlicKeyedService> active_glic_; bool did_auto_open_ = false; + base::WeakPtrFactory<GlicProfileManager> weak_ptr_factory_{this}; }; } // namespace glic
diff --git a/chrome/browser/glic/glic_synthetic_trial_manager.cc b/chrome/browser/glic/glic_synthetic_trial_manager.cc index ad25707..b64e6ba9 100644 --- a/chrome/browser/glic/glic_synthetic_trial_manager.cc +++ b/chrome/browser/glic/glic_synthetic_trial_manager.cc
@@ -13,39 +13,31 @@ #include "base/functional/bind.h" #include "base/logging.h" -#include "base/memory/singleton.h" #include "base/metrics/histogram_functions.h" -#include "chrome/browser/browser_process.h" #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" #include "components/metrics/metrics_service.h" #include "components/variations/synthetic_trial_registry.h" namespace glic { -// static -GlicSyntheticTrialManager* GlicSyntheticTrialManager::GetInstance() { - return base::Singleton<GlicSyntheticTrialManager>::get(); -} - -GlicSyntheticTrialManager::GlicSyntheticTrialManager() { - metrics::MetricsService* metrics_service = - g_browser_process->metrics_service(); - if (metrics_service) { - metrics_service->AddLogsObserver(this); - } -} +GlicSyntheticTrialManager::GlicSyntheticTrialManager( + metrics_services_manager::MetricsServicesManager* metrics_services_manager) + : metrics_services_manager_(metrics_services_manager) {} GlicSyntheticTrialManager::~GlicSyntheticTrialManager() { - metrics::MetricsService* metrics_service = - g_browser_process->metrics_service(); - if (metrics_service) { - metrics_service->RemoveLogsObserver(this); + if (metrics_service_) { + metrics_service_->RemoveLogsObserver(this); } } void GlicSyntheticTrialManager::SetSyntheticExperimentState( const std::string& trial_name, const std::string& group_name) { + if (!metrics_service_) { + metrics_service_ = metrics_services_manager_->GetMetricsService(); + DCHECK(metrics_service_); + metrics_service_->AddLogsObserver(this); + } // If already registered discard the logs if in a different group. This // avoids combining logs from multiple groups from different profiles. bool conflicting_group_registered =
diff --git a/chrome/browser/glic/glic_synthetic_trial_manager.h b/chrome/browser/glic/glic_synthetic_trial_manager.h index 3dcf6fad..0ed4d4eb 100644 --- a/chrome/browser/glic/glic_synthetic_trial_manager.h +++ b/chrome/browser/glic/glic_synthetic_trial_manager.h
@@ -9,17 +9,20 @@ #include <vector> #include "base/functional/callback_forward.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "components/metrics/metrics_logs_event_manager.h" #include "components/metrics/metrics_service.h" +#include "components/metrics_services_manager/metrics_services_manager.h" #include "components/variations/synthetic_trial_registry.h" namespace glic { class GlicSyntheticTrialManager : metrics::MetricsLogsEventManager::Observer { public: - static GlicSyntheticTrialManager* GetInstance(); - GlicSyntheticTrialManager(); + explicit GlicSyntheticTrialManager( + metrics_services_manager::MetricsServicesManager* + metrics_services_manager); GlicSyntheticTrialManager(const GlicSyntheticTrialManager&) = delete; GlicSyntheticTrialManager& operator=(const GlicSyntheticTrialManager&) = @@ -48,6 +51,9 @@ private: std::map<std::string, std::string> synthetic_field_trial_groups_; std::map<std::string, std::string> staged_synthetic_field_trial_groups_; + raw_ptr<metrics::MetricsService> metrics_service_; + const raw_ptr<metrics_services_manager::MetricsServicesManager> + metrics_services_manager_; base::WeakPtrFactory<GlicSyntheticTrialManager> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/glic/glic_window_controller.cc b/chrome/browser/glic/glic_window_controller.cc index e696933..511afefa 100644 --- a/chrome/browser/glic/glic_window_controller.cc +++ b/chrome/browser/glic/glic_window_controller.cc
@@ -16,6 +16,7 @@ #include "chrome/browser/glic/glic_keyed_service.h" #include "chrome/browser/glic/glic_metrics.h" #include "chrome/browser/glic/glic_pref_names.h" +#include "chrome/browser/glic/glic_profile_manager.h" #include "chrome/browser/glic/glic_view.h" #include "chrome/browser/glic/glic_widget.h" #include "chrome/browser/glic/glic_window_animator.h" @@ -442,6 +443,7 @@ } void GlicWindowController::ShowDetachedForTesting() { + glic::GlicProfileManager::GetInstance()->SetActiveGlic(glic_service_); Show(nullptr, InvocationSource::kOsHotkey); }
diff --git a/chrome/browser/glic/glic_window_controller_interactive_uitest.cc b/chrome/browser/glic/glic_window_controller_interactive_uitest.cc index 8c89274..535635b 100644 --- a/chrome/browser/glic/glic_window_controller_interactive_uitest.cc +++ b/chrome/browser/glic/glic_window_controller_interactive_uitest.cc
@@ -32,6 +32,7 @@ #include "chrome/test/interaction/interactive_browser_test.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" +#include "glic_profile_manager.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/display/test/virtual_display_util.h" @@ -53,8 +54,8 @@ auto SimulateGlicHotkey() { // TODO: Actually implement the hotkey when we know what it is. return Do([this]() { - window_controller().Toggle(nullptr, /*prevent_close=*/false, - InvocationSource::kOsHotkey); + glic_service()->ToggleUI(nullptr, /*prevent_close=*/false, + InvocationSource::kOsHotkey); }); } @@ -339,6 +340,16 @@ SimulateOpenMenuItem(), CheckControllerShowing(true)); } +IN_PROC_BROWSER_TEST_F(GlicWindowControllerUiTest, + OpeningProfilePickerClosesPanel) { + RunTestSequence( + OpenGlicWindow(GlicWindowMode::kDetached), + CheckControllerWidgetMode(GlicWindowMode::kDetached), Do([&]() { + glic::GlicProfileManager::GetInstance()->ShowProfilePicker(); + }), + CheckControllerHasWidget(false)); +} + class GlicWindowControllerWithMemoryPressureUiTest : public GlicWindowControllerUiTest { public:
diff --git a/chrome/browser/global_features.cc b/chrome/browser/global_features.cc index 75c6ad69..d43763b 100644 --- a/chrome/browser/global_features.cc +++ b/chrome/browser/global_features.cc
@@ -19,6 +19,7 @@ #include "chrome/browser/background/glic/glic_background_mode_manager.h" // nogncheck #include "chrome/browser/glic/glic_enabling.h" // nogncheck #include "chrome/browser/glic/glic_profile_manager.h" // nogncheck +#include "chrome/browser/glic/glic_synthetic_trial_manager.h" // nogncheck #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) @@ -70,6 +71,9 @@ glic_background_mode_manager_ = std::make_unique<glic::GlicBackgroundModeManager>( g_browser_process->status_tray()); + synthetic_trial_manager_ = + std::make_unique<glic::GlicSyntheticTrialManager>( + g_browser_process->GetMetricsServicesManager()); } #endif } @@ -80,6 +84,7 @@ glic_background_mode_manager_->Shutdown(); glic_background_mode_manager_.reset(); } + synthetic_trial_manager_.reset(); #endif }
diff --git a/chrome/browser/global_features.h b/chrome/browser/global_features.h index 068eb0a..b9b5a4de 100644 --- a/chrome/browser/global_features.h +++ b/chrome/browser/global_features.h
@@ -23,6 +23,7 @@ namespace glic { class GlicBackgroundModeManager; class GlicProfileManager; +class GlicSyntheticTrialManager; } // namespace glic #endif @@ -69,6 +70,10 @@ glic::GlicBackgroundModeManager* glic_background_mode_manager() { return glic_background_mode_manager_.get(); } + + glic::GlicSyntheticTrialManager* glic_synthetic_trial_manager() { + return synthetic_trial_manager_.get(); + } #endif protected: @@ -98,6 +103,7 @@ std::unique_ptr<glic::GlicProfileManager> glic_profile_manager_; std::unique_ptr<glic::GlicBackgroundModeManager> glic_background_mode_manager_; + std::unique_ptr<glic::GlicSyntheticTrialManager> synthetic_trial_manager_; #endif };
diff --git a/chrome/browser/internal b/chrome/browser/internal index 5649dd0..8cb067a 160000 --- a/chrome/browser/internal +++ b/chrome/browser/internal
@@ -1 +1 @@ -Subproject commit 5649dd0237ac7f75c2779ff757e8666bdb9d2674 +Subproject commit 8cb067a9ea39c3b7f38bad55e4e5e8818319d0b7
diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc index d639caf..f6f30366 100644 --- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc +++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
@@ -49,7 +49,6 @@ #include "chrome/browser/web_applications/sampling_metrics_provider.h" #include "chrome/common/chrome_switches.h" #include "components/metrics/android_metrics_helper.h" -#include "components/performance_manager/public/features.h" #include "components/performance_manager/public/performance_manager.h" #include "components/policy/core/common/management/management_service.h" #include "components/prefs/pref_registry_simple.h" @@ -1155,12 +1154,9 @@ std::make_unique<PowerMetricsReporter>(process_monitor_.get()); } - if (performance_manager::features:: - ShouldUsePerformanceInterventionBackend()) { - performance_intervention_metrics_reporter_ = - std::make_unique<PerformanceInterventionMetricsReporter>( - g_browser_process->local_state()); - } + performance_intervention_metrics_reporter_ = + std::make_unique<PerformanceInterventionMetricsReporter>( + g_browser_process->local_state()); web_app_metrics_provider_ = std::make_unique<web_app::SamplingMetricsProvider>();
diff --git a/chrome/browser/metrics/dwa_browsertest.cc b/chrome/browser/metrics/dwa_browsertest.cc index 0072a38..37c2cb0 100644 --- a/chrome/browser/metrics/dwa_browsertest.cc +++ b/chrome/browser/metrics/dwa_browsertest.cc
@@ -231,6 +231,7 @@ base::test::ScopedFeatureList scoped_feature_list_; }; +// LINT.IfChange(DwaServiceCheck) IN_PROC_BROWSER_TEST_F(DwaBrowserTest, DwaServiceCheck) { test::MetricsConsentOverride metrics_consent(true); Profile* profile = ProfileManager::GetLastUsedProfileIfLoaded(); @@ -260,8 +261,10 @@ ClosePlatformBrowser(browser); } +// LINT.ThenChange(/ios/chrome/browser/metrics/model/dwa_egtest.mm:DwaServiceCheck) // Make sure that DWA is disabled and purged while an incognito window is open. +// LINT.IfChange(RegularBrowserPlusIncognitoCheck) IN_PROC_BROWSER_TEST_F(DwaBrowserTest, RegularBrowserPlusIncognitoCheck) { dwa::DwaRecorder* dwa_recorder = metrics::dwa::DwaRecorder::Get(); test::MetricsConsentOverride metrics_consent(true); @@ -315,8 +318,10 @@ ClosePlatformBrowser(browser1); } +// LINT.ThenChange(/ios/chrome/browser/metrics/model/dwa_egtest.mm:RegularBrowserPlusIncognitoCheck) // Make sure opening a regular browser after Incognito doesn't enable DWA. +// LINT.IfChange(IncognitoPlusRegularBrowserCheck) IN_PROC_BROWSER_TEST_F(DwaBrowserTest, IncognitoPlusRegularBrowserCheck) { dwa::DwaRecorder* dwa_recorder = metrics::dwa::DwaRecorder::Get(); test::MetricsConsentOverride metrics_consent(true); @@ -337,9 +342,11 @@ ClosePlatformBrowser(browser); } +// LINT.ThenChange(/ios/chrome/browser/metrics/model/dwa_egtest.mm:IncognitoPlusRegularBrowserCheck) // This test ensures that disabling MSBB UKM consent disables and purges DWA. // Additionally ensures that DWA is disabled until all UKM consents are enabled. +// LINT.IfChange(UkmMsbbConsentChangeCheck) IN_PROC_BROWSER_TEST_F(DwaBrowserTest, UkmConsentChangeCheck_Msbb) { test::MetricsConsentOverride metrics_consent(true); Profile* profile = ProfileManager::GetLastUsedProfileIfLoaded(); @@ -362,6 +369,7 @@ // consents are enabled. RecordTestMetricsAndAssertMetricsRecorded(); } +// LINT.ThenChange(/ios/chrome/browser/metrics/model/dwa_egtest.mm:UkmMsbbConsentChangeCheck) // Not enabled on Android because on Android, kApps and kExtensions is not // registered through UserSelectableType.
diff --git a/chrome/browser/net/profile_network_context_service.cc b/chrome/browser/net/profile_network_context_service.cc index e0697423..c81d289 100644 --- a/chrome/browser/net/profile_network_context_service.cc +++ b/chrome/browser/net/profile_network_context_service.cc
@@ -136,9 +136,12 @@ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) #include "chrome/browser/enterprise/client_certificates/certificate_provisioning_service_factory.h" +#include "chrome/browser/policy/chrome_browser_policy_connector.h" +#include "components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h" #include "components/enterprise/client_certificates/core/certificate_provisioning_service.h" #include "components/enterprise/client_certificates/core/client_certificates_service.h" #include "components/enterprise/client_certificates/core/features.h" +#include "components/policy/core/browser/browser_policy_connector.h" #endif #if BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI) @@ -265,20 +268,31 @@ std::unique_ptr<net::ClientCertStore> GetWrappedCertStore( Profile* profile, std::unique_ptr<net::ClientCertStore> platform_store) { - if (!profile || !client_certificates::features:: - IsManagedClientCertificateForUserEnabled()) { - return platform_store; + client_certificates::CertificateProvisioningService* + profile_provisioning_service = nullptr; + if (profile && client_certificates::features:: + IsManagedClientCertificateForUserEnabled()) { + profile_provisioning_service = client_certificates:: + CertificateProvisioningServiceFactory::GetForProfile(profile); } - auto* provisioning_service = - client_certificates::CertificateProvisioningServiceFactory::GetForProfile( - profile); - if (!provisioning_service) { + client_certificates::CertificateProvisioningService* + browser_provisioning_service = nullptr; + if (client_certificates::features:: + IsManagedBrowserClientCertificateEnabled()) { + browser_provisioning_service = + g_browser_process->browser_policy_connector() + ->chrome_browser_cloud_management_controller() + ->GetCertificateProvisioningService(); + } + + if (!browser_provisioning_service && !profile_provisioning_service) { return platform_store; } return client_certificates::ClientCertificatesService::Create( - provisioning_service, std::move(platform_store)); + profile_provisioning_service, browser_provisioning_service, + std::move(platform_store)); } #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
diff --git a/chrome/browser/os_crypt/app_bound_encryption_win.cc b/chrome/browser/os_crypt/app_bound_encryption_win.cc index 58ecbc4..25995e90 100644 --- a/chrome/browser/os_crypt/app_bound_encryption_win.cc +++ b/chrome/browser/os_crypt/app_bound_encryption_win.cc
@@ -58,7 +58,7 @@ namespace features { BASE_FEATURE(kAppBoundDataReencrypt, "AppBoundDataReencrypt", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); } // namespace features SupportLevel GetAppBoundEncryptionSupportLevel(PrefService* local_state) {
diff --git a/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc b/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc index 64a4d0f..49d1170 100644 --- a/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc +++ b/chrome/browser/performance_manager/chrome_browser_main_extra_parts_performance_manager.cc
@@ -310,11 +310,8 @@ new performance_manager::user_tuning::BatterySaverModeManager( g_browser_process->local_state())); - if (performance_manager::features:: - ShouldUsePerformanceInterventionBackend()) { - performance_detection_manager_ = base::WrapUnique( - new performance_manager::user_tuning::PerformanceDetectionManager()); - } + performance_detection_manager_ = base::WrapUnique( + new performance_manager::user_tuning::PerformanceDetectionManager()); #endif page_load_metrics_observer_ =
diff --git a/chrome/browser/performance_manager/user_tuning/performance_detection_manager_browsertest.cc b/chrome/browser/performance_manager/user_tuning/performance_detection_manager_browsertest.cc index 93928b76..1b69d18 100644 --- a/chrome/browser/performance_manager/user_tuning/performance_detection_manager_browsertest.cc +++ b/chrome/browser/performance_manager/user_tuning/performance_detection_manager_browsertest.cc
@@ -48,12 +48,6 @@ PerformanceDetectionManagerBrowserTest() = default; ~PerformanceDetectionManagerBrowserTest() override = default; - void SetUp() override { - feature_list_.InitAndEnableFeature( - performance_manager::features::kPerformanceInterventionUI); - InProcessBrowserTest::SetUp(); - } - void SetUpOnMainThread() override { host_resolver()->AddRule("*", "127.0.0.1"); ASSERT_TRUE(embedded_test_server()->Start()); @@ -162,9 +156,7 @@ set_open_about_blank_on_browser_launch(true); feature_list_.InitWithFeatures( - {performance_manager::features::kPerformanceInterventionUI, - performance_manager::features::kPerformanceInterventionDemoMode}, - {}); + {performance_manager::features::kPerformanceInterventionDemoMode}, {}); InProcessBrowserTest::SetUp(); }
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index c95fca6d..c46a6d7f 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc
@@ -379,8 +379,8 @@ #include "chrome/browser/ash/plugin_vm/plugin_vm_pref_names.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" #include "chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h" -#include "chrome/browser/ash/policy/enrollment/auto_enrollment_client_impl.h" #include "chrome/browser/ash/policy/enrollment/enrollment_requisition_manager.h" +#include "chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.h" #include "chrome/browser/ash/policy/external_data/handlers/device_wallpaper_image_external_data_handler.h" #include "chrome/browser/ash/policy/handlers/adb_sideloading_allowance_mode_policy_handler.h" #include "chrome/browser/ash/policy/handlers/minimum_version_policy_handler.h" @@ -1089,6 +1089,14 @@ "webauthn.authenticator_root_secret"; #endif // BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_CHROMEOS) +// Deprecated 03/2025. +inline constexpr char kShouldAutoEnroll[] = "ShouldAutoEnroll"; +inline constexpr char kShouldRetrieveDeviceState[] = + "ShouldRetrieveDeviceState"; +inline constexpr char kAutoEnrollmentPowerLimit[] = "AutoEnrollmentPowerLimit"; +#endif // BUILDFLAG(IS_CHROMEOS) + // Register local state used only for migration (clearing or moving to a new // key). void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) { @@ -1186,6 +1194,13 @@ // Deprecated 02/2025. registry->RegisterStringPref(kRootSecretPrefName, std::string()); #endif // BUILDFLAG(IS_ANDROID) + +#if BUILDFLAG(IS_CHROMEOS) + // Deprecated 03/2025. + registry->RegisterBooleanPref(kShouldRetrieveDeviceState, false); + registry->RegisterBooleanPref(kShouldAutoEnroll, false); + registry->RegisterIntegerPref(kAutoEnrollmentPowerLimit, -1); +#endif } // Register prefs used only for migration (clearing or moving to a new key). @@ -1729,8 +1744,6 @@ extensions::login_api::RegisterLocalStatePrefs(registry); ::onc::RegisterPrefs(registry); policy::AdbSideloadingAllowanceModePolicyHandler::RegisterPrefs(registry); - // TODO(b/265923216): Replace with EnrollmentStateFetcher::RegisterPrefs. - policy::AutoEnrollmentClientImpl::RegisterPrefs(registry); policy::BrowserPolicyConnectorAsh::RegisterPrefs(registry); policy::CrdAdminSessionController::RegisterLocalStatePrefs(registry); policy::DeviceCloudPolicyManagerAsh::RegisterPrefs(registry); @@ -1739,6 +1752,7 @@ policy::DeviceStatusCollector::RegisterPrefs(registry); policy::DeviceWallpaperImageExternalDataHandler::RegisterPrefs(registry); policy::EnrollmentRequisitionManager::RegisterPrefs(registry); + policy::EnrollmentStateFetcher::RegisterPrefs(registry); policy::EuiccStatusUploader::RegisterLocalStatePrefs(registry); policy::MinimumVersionPolicyHandler::RegisterPrefs(registry); policy::TPMAutoUpdateModePolicyHandler::RegisterPrefs(registry); @@ -2420,6 +2434,13 @@ local_state->ClearPref(kRootSecretPrefName); #endif // BUILDFLAG(IS_ANDROID) + // Added 03/2025. +#if BUILDFLAG(IS_CHROMEOS) + local_state->ClearPref(kShouldRetrieveDeviceState); + local_state->ClearPref(kShouldAutoEnroll); + local_state->ClearPref(kAutoEnrollmentPowerLimit); +#endif + // Please don't delete the following line. It is used by PRESUBMIT.py. // END_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS
diff --git a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea_v3.xml b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea_v3.xml index 86f948d..6b6d50b35 100644 --- a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea_v3.xml +++ b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea_v3.xml
@@ -45,6 +45,7 @@ <!-- TODO(crbug.com/392943234) Replace this logo when finalized. --> <ImageView + android:id="@+id/privacy_sandbox_eea_consent_logo" android:layout_height="@dimen/privacy_sandbox_chrome_logo_height" android:layout_width="@dimen/privacy_sandbox_chrome_logo_width" android:layout_gravity="center" @@ -65,6 +66,7 @@ style="@style/TextAppearance.Headline.Primary" /> <org.chromium.ui.widget.TextViewWithLeading + android:id="@+id/privacy_sandbox_consent_description_v3" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/privacy_sandbox_m1_consent_description_v3" @@ -238,6 +240,7 @@ </LinearLayout> <org.chromium.ui.widget.TextViewWithLeading + android:id="@+id/privacy_sandbox_consent_ads_topic_description_v3" android:layout_marginBottom="@dimen/promo_between_text_margin" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -261,6 +264,7 @@ android:orientation="horizontal"> <TextView + android:id="@+id/ad_measurement_dropdown_title" android:layout_weight="1" android:layout_width="0dp" android:layout_height="wrap_content" @@ -299,6 +303,7 @@ android:id="@+id/learn_more_card"> <LinearLayout + android:id="@+id/learn_more_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingVertical="12dp" @@ -316,6 +321,7 @@ </com.google.android.material.card.MaterialCardView> <org.chromium.ui.widget.TextViewWithLeading + android:id="@+id/privacy_sandbox_consent_last_text_v3" android:layout_marginBottom="@dimen/privacy_sandbox_notice_margin_bottom" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -395,6 +401,7 @@ android:visibility="gone"> <LinearLayout + android:id="@+id/privacy_policy_header" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_notice_service.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_notice_service.cc index ba4b8a5..e51f9e7 100644 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_notice_service.cc +++ b/chrome/browser/privacy_sandbox/privacy_sandbox_notice_service.cc
@@ -16,28 +16,6 @@ #include "components/privacy_sandbox/privacy_sandbox_prefs.h" namespace privacy_sandbox { -namespace { - -base::Time GetTimeFromPref(PrefService* prefs, const std::string& pref_name) { - return base::ValueToTime(prefs->GetValue(pref_name)).value_or(base::Time()); -} - -// If prefs from any surface are previously set, we should not set new prefs -// from the migration. -bool ShouldSetMigrationPrefs( - PrefService* prefs, - PrivacySandboxNoticeStorage* notice_storage, - const std::vector<std::string_view>& notice_names) { - for (const auto& notice_name : notice_names) { - auto notice_data = notice_storage->ReadNoticeData(prefs, notice_name); - if (notice_data && notice_data.has_value()) { - return false; - } - } - return true; -} - -} // namespace PrivacySandboxNoticeService::PrivacySandboxNoticeService( PrefService* pref_service) @@ -45,10 +23,6 @@ notice_storage_ = std::make_unique<PrivacySandboxNoticeStorage>(); CHECK(pref_service_); CHECK(notice_storage_); - if (base::FeatureList::IsEnabled( - kPrivacySandboxMigratePrefsToNoticeConsentDataModel)) { - MigratePrivacySandboxPrefsToDataModel(); - } } PrivacySandboxNoticeService::~PrivacySandboxNoticeService() = default; @@ -62,131 +36,4 @@ return notice_storage_.get(); } -// TODO(crbug.com/333406690): Remove this once the old privacy sandbox prefs are -// migrated to the new data model. Old prefs don't differentiate between CCT and -// BrApp, so all Clank related prefs will be classified as BrApp. -void PrivacySandboxNoticeService::MigratePrivacySandboxPrefsToDataModel() { - // TopicsConsentModal - { -#if BUILDFLAG(IS_ANDROID) - std::string topics_notice_name = kTopicsConsentModalClankBrApp; -#else - std::string topics_notice_name = kTopicsConsentModal; -#endif // BUILDFLAG(IS_ANDROID) - - if (ShouldSetMigrationPrefs( - pref_service_, notice_storage_.get(), - {kTopicsConsentModal, kTopicsConsentModalClankBrApp, - kTopicsConsentModalClankCCT})) { - const auto consent_update_time = GetTimeFromPref( - pref_service_, prefs::kPrivacySandboxTopicsConsentLastUpdateTime); - // Topics can be updated through the settings (kSettings) page or a notice - // (kConfirmation). - const auto* update_reason = pref_service_->GetUserPrefValue( - prefs::kPrivacySandboxTopicsConsentLastUpdateReason); - - // Only prefs set from updating a notice are migrated. If the - // `update_reason` isn't set at all we will leave the pref settings to - // their default values. - if (update_reason && - static_cast<TopicsConsentUpdateSource>(update_reason->GetInt()) == - TopicsConsentUpdateSource::kConfirmation) { - // We need to use kPrivacySandboxTopicsConsentGiven as it stores the - // consent status of the user ignoring overrides. - auto* consent_decision_given = pref_service_->GetUserPrefValue( - prefs::kPrivacySandboxTopicsConsentGiven); - if (consent_decision_given) { - PrivacySandboxNoticeData notice_data; - notice_data.notice_action_taken_ = consent_decision_given->GetBool() - ? NoticeActionTaken::kOptIn - : NoticeActionTaken::kOptOut; - notice_data.notice_action_taken_time_ = consent_update_time; - notice_storage_->MigratePrivacySandboxNoticeData( - pref_service_, notice_data, topics_notice_name); - } - } else if (update_reason && static_cast<TopicsConsentUpdateSource>( - update_reason->GetInt()) == - TopicsConsentUpdateSource::kSettings) { - // Prefs set by settings are mapped to 'kUnknownActionPreMigration' - // since it's unknown what action the user took on a notice, if any - PrivacySandboxNoticeData notice_data; - notice_data.notice_action_taken_ = - NoticeActionTaken::kUnknownActionPreMigration; - notice_data.notice_action_taken_time_ = base::Time(); - notice_storage_->MigratePrivacySandboxNoticeData( - pref_service_, notice_data, topics_notice_name); - } - } - } - - // ProtectedAudienceMeasurementNoticeModal - { -#if BUILDFLAG(IS_ANDROID) - std::string pam_notice_name = - kProtectedAudienceMeasurementNoticeModalClankBrApp; -#else - std::string pam_notice_name = kProtectedAudienceMeasurementNoticeModal; -#endif // BUILDFLAG(IS_ANDROID) - - if (ShouldSetMigrationPrefs( - pref_service_, notice_storage_.get(), - {kProtectedAudienceMeasurementNoticeModal, - kProtectedAudienceMeasurementNoticeModalClankBrApp, - kProtectedAudienceMeasurementNoticeModalClankCCT})) { - auto* notice_acknowledged = pref_service_->GetUserPrefValue( - prefs::kPrivacySandboxM1EEANoticeAcknowledged); - if (notice_acknowledged && notice_acknowledged->GetBool()) { - PrivacySandboxNoticeData notice_data; - notice_data.notice_action_taken_ = NoticeActionTaken::kAck; - notice_storage_->MigratePrivacySandboxNoticeData( - pref_service_, notice_data, pam_notice_name); - } - } - } - - // ThreeAdsAPIsNoticeModal - { -#if BUILDFLAG(IS_ANDROID) - std::string three_ads_apis_notice_name = kThreeAdsAPIsNoticeModalClankBrApp; -#else - std::string three_ads_apis_notice_name = kThreeAdsAPIsNoticeModal; -#endif // BUILDFLAG(IS_ANDROID) - if (ShouldSetMigrationPrefs( - pref_service_, notice_storage_.get(), - {kThreeAdsAPIsNoticeModal, kThreeAdsAPIsNoticeModalClankBrApp, - kThreeAdsAPIsNoticeModalClankCCT})) { - auto* notice_acknowledged = pref_service_->GetUserPrefValue( - prefs::kPrivacySandboxM1RowNoticeAcknowledged); - if (notice_acknowledged && notice_acknowledged->GetBool()) { - PrivacySandboxNoticeData notice_data; - notice_data.notice_action_taken_ = NoticeActionTaken::kAck; - notice_storage_->MigratePrivacySandboxNoticeData( - pref_service_, notice_data, three_ads_apis_notice_name); - } - } - } - - // MeasurementNoticeModal - { -#if BUILDFLAG(IS_ANDROID) - std::string measurement_notice_name = kMeasurementNoticeModalClankBrApp; -#else - std::string measurement_notice_name = kMeasurementNoticeModal; -#endif // BUILDFLAG(IS_ANDROID) - if (ShouldSetMigrationPrefs( - pref_service_, notice_storage_.get(), - {kMeasurementNoticeModal, kMeasurementNoticeModalClankBrApp, - kMeasurementNoticeModalClankCCT})) { - auto* notice_acknowledged = pref_service_->GetUserPrefValue( - prefs::kPrivacySandboxM1RestrictedNoticeAcknowledged); - if (notice_acknowledged && notice_acknowledged->GetBool()) { - PrivacySandboxNoticeData notice_data; - notice_data.notice_action_taken_ = NoticeActionTaken::kAck; - notice_storage_->MigratePrivacySandboxNoticeData( - pref_service_, notice_data, measurement_notice_name); - } - } - } -} - } // namespace privacy_sandbox
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_notice_service.h b/chrome/browser/privacy_sandbox/privacy_sandbox_notice_service.h index 86c8f0c..77fba2e5 100644 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_notice_service.h +++ b/chrome/browser/privacy_sandbox/privacy_sandbox_notice_service.h
@@ -25,10 +25,6 @@ void Shutdown() override; private: - // TODO(crbug.com/333406690): Remove this once the old privacy sandbox prefs - // are migrated to the new data model. - void MigratePrivacySandboxPrefsToDataModel(); - raw_ptr<PrefService> pref_service_; std::unique_ptr<PrivacySandboxNoticeStorage> notice_storage_; };
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_notice_service_unittest.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_notice_service_unittest.cc deleted file mode 100644 index 058448a..0000000 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_notice_service_unittest.cc +++ /dev/null
@@ -1,443 +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/privacy_sandbox/privacy_sandbox_notice_service.h" - -#include "base/json/values_util.h" -#include "base/test/scoped_feature_list.h" -#include "base/test/task_environment.h" -#include "base/time/time.h" -#include "components/prefs/testing_pref_service.h" -#include "components/privacy_sandbox/privacy_sandbox_features.h" -#include "components/privacy_sandbox/privacy_sandbox_notice_constants.h" -#include "components/privacy_sandbox/privacy_sandbox_notice_storage.h" -#include "components/privacy_sandbox/privacy_sandbox_prefs.h" -#include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace privacy_sandbox { -namespace { - -// TODO(crbug.com/333408794): Add browser tests ensuring prefs are migrated -// after notice flow completion. -class PrivacySandboxNoticeServiceTest : public testing::Test { - public: - PrivacySandboxNoticeServiceTest() - : task_env_(base::test::TaskEnvironment::TimeSource::MOCK_TIME) { - RegisterProfilePrefs(prefs()->registry()); - scoped_feature_list_.InitAndEnableFeature( - kPrivacySandboxMigratePrefsToNoticeConsentDataModel); - } - - std::string GetTopicsNoticeName() { -#if BUILDFLAG(IS_ANDROID) - return kTopicsConsentModalClankBrApp; -#else - return kTopicsConsentModal; -#endif - } - - std::string GetProtectedAudienceMeasurementNoticeName() { -#if BUILDFLAG(IS_ANDROID) - return kProtectedAudienceMeasurementNoticeModalClankBrApp; -#else - return kProtectedAudienceMeasurementNoticeModal; -#endif - } - - std::string GetThreeAdsAPIsNoticeName() { -#if BUILDFLAG(IS_ANDROID) - return kThreeAdsAPIsNoticeModalClankBrApp; -#else - return kThreeAdsAPIsNoticeModal; -#endif - } - - std::string GetMeasurementNoticeName() { -#if BUILDFLAG(IS_ANDROID) - return kMeasurementNoticeModalClankBrApp; -#else - return kMeasurementNoticeModal; -#endif - } - - TestingPrefServiceSimple* prefs() { return &prefs_; } - - private: - base::test::TaskEnvironment task_env_; - TestingPrefServiceSimple prefs_; - base::test::ScopedFeatureList scoped_feature_list_; -}; - -// If original prefs are set from Settings, then new prefs shouldn't be set and -// should be their default values. -TEST_F(PrivacySandboxNoticeServiceTest, - NoticeActionSetWhenMigratedFromSettings) { - prefs()->SetBoolean(prefs::kPrivacySandboxTopicsConsentGiven, true); - prefs()->SetInteger(prefs::kPrivacySandboxTopicsConsentLastUpdateReason, - static_cast<int>(TopicsConsentUpdateSource::kSettings)); - prefs()->SetTime(prefs::kPrivacySandboxTopicsConsentLastUpdateTime, - base::Time::FromMillisecondsSinceUnixEpoch(100)); - auto notice_service = PrivacySandboxNoticeService(prefs()); - const auto result = notice_service.GetNoticeStorage()->ReadNoticeData( - prefs(), GetTopicsNoticeName()); - EXPECT_EQ(result->GetSchemaVersion(), 1); - EXPECT_EQ(result->notice_action_taken_, - NoticeActionTaken::kUnknownActionPreMigration); - EXPECT_EQ(base::TimeToValue(result->notice_action_taken_time_), "0"); -} - -TEST_F(PrivacySandboxNoticeServiceTest, - PrefsNotSetWhenMigratedFromTopicsWithNoConsentDecision) { - prefs()->SetInteger( - prefs::kPrivacySandboxTopicsConsentLastUpdateReason, - static_cast<int>(TopicsConsentUpdateSource::kConfirmation)); - auto notice_service = privacy_sandbox::PrivacySandboxNoticeService(prefs()); - const auto result = notice_service.GetNoticeStorage()->ReadNoticeData( - prefs(), GetTopicsNoticeName()); - EXPECT_EQ(result, std::nullopt); -} - -TEST_F(PrivacySandboxNoticeServiceTest, - NoticeActionAndTimeSetWhenMigratedFromTopicsWithConsent) { - prefs()->SetInteger( - prefs::kPrivacySandboxTopicsConsentLastUpdateReason, - static_cast<int>(TopicsConsentUpdateSource::kConfirmation)); - prefs()->SetBoolean(prefs::kPrivacySandboxTopicsConsentGiven, true); - prefs()->SetTime(prefs::kPrivacySandboxTopicsConsentLastUpdateTime, - base::Time::FromMillisecondsSinceUnixEpoch(100)); - auto notice_service = PrivacySandboxNoticeService(prefs()); - const auto result = notice_service.GetNoticeStorage()->ReadNoticeData( - prefs(), GetTopicsNoticeName()); - EXPECT_EQ(result->GetSchemaVersion(), 1); - EXPECT_EQ(result->notice_action_taken_, NoticeActionTaken::kOptIn); - EXPECT_EQ(result->notice_action_taken_time_, - base::Time::FromMillisecondsSinceUnixEpoch(100)); -} - -TEST_F(PrivacySandboxNoticeServiceTest, - NoticeActionAndTimeSetWhenMigratedFromTopicsWithoutConsent) { - prefs()->SetInteger( - prefs::kPrivacySandboxTopicsConsentLastUpdateReason, - static_cast<int>(TopicsConsentUpdateSource::kConfirmation)); - prefs()->SetBoolean(prefs::kPrivacySandboxTopicsConsentGiven, false); - prefs()->SetTime(prefs::kPrivacySandboxTopicsConsentLastUpdateTime, - base::Time::FromMillisecondsSinceUnixEpoch(100)); - auto notice_service = PrivacySandboxNoticeService(prefs()); - const auto result = notice_service.GetNoticeStorage()->ReadNoticeData( - prefs(), GetTopicsNoticeName()); - EXPECT_EQ(result->GetSchemaVersion(), 1); - EXPECT_EQ(result->notice_action_taken_, NoticeActionTaken::kOptOut); - EXPECT_EQ(result->notice_action_taken_time_, - base::Time::FromMillisecondsSinceUnixEpoch(100)); -} - -// Clank specific tests. -#if BUILDFLAG(IS_ANDROID) -TEST_F(PrivacySandboxNoticeServiceTest, - DuringMigrationClankBrAppPrefsNotSetWhenTopicsSetFromCCT) { - /* Set old prefs. */ - prefs()->SetInteger( - prefs::kPrivacySandboxTopicsConsentLastUpdateReason, - static_cast<int>(TopicsConsentUpdateSource::kConfirmation)); - prefs()->SetBoolean(prefs::kPrivacySandboxTopicsConsentGiven, false); - prefs()->SetTime(prefs::kPrivacySandboxTopicsConsentLastUpdateTime, - base::Time::FromMillisecondsSinceUnixEpoch(100)); - - /* Set new CCT prefs. */ - PrivacySandboxNoticeStorage notice_storage; - notice_storage.SetNoticeShown(prefs(), kTopicsConsentModalClankCCT, - base::Time::Now()); - const auto result = - notice_storage.ReadNoticeData(prefs(), GetTopicsNoticeName()); - - /* Migration code. */ - auto notice_service = PrivacySandboxNoticeService(prefs()); - EXPECT_EQ(result, std::nullopt); -} - -TEST_F(PrivacySandboxNoticeServiceTest, - DuringMigrationBrAppPrefsNotSetWhenTopicsSetFromDesktop) { - /* Set old prefs. */ - prefs()->SetInteger( - prefs::kPrivacySandboxTopicsConsentLastUpdateReason, - static_cast<int>(TopicsConsentUpdateSource::kConfirmation)); - prefs()->SetBoolean(prefs::kPrivacySandboxTopicsConsentGiven, false); - prefs()->SetTime(prefs::kPrivacySandboxTopicsConsentLastUpdateTime, - base::Time::FromMillisecondsSinceUnixEpoch(100)); - - /* Set new CCT prefs. */ - PrivacySandboxNoticeStorage notice_storage; - notice_storage.SetNoticeShown(prefs(), kTopicsConsentModal, - base::Time::Now()); - const auto result = - notice_storage.ReadNoticeData(prefs(), GetTopicsNoticeName()); - - /* Migration code. */ - auto notice_service = PrivacySandboxNoticeService(prefs()); - EXPECT_EQ(result, std::nullopt); -} -#endif // BUILDFLAG(IS_ANDROID) - -#if !BUILDFLAG(IS_ANDROID) -TEST_F(PrivacySandboxNoticeServiceTest, - DuringMigrationDesktopPrefsNotSetWhenTopicsSetFromBrApp) { - /* Set old prefs. */ - prefs()->SetInteger( - prefs::kPrivacySandboxTopicsConsentLastUpdateReason, - static_cast<int>(TopicsConsentUpdateSource::kConfirmation)); - prefs()->SetBoolean(prefs::kPrivacySandboxTopicsConsentGiven, false); - prefs()->SetTime(prefs::kPrivacySandboxTopicsConsentLastUpdateTime, - base::Time::FromMillisecondsSinceUnixEpoch(100)); - - /* Set new prefs. */ - PrivacySandboxNoticeStorage notice_storage; - notice_storage.SetNoticeShown(prefs(), kTopicsConsentModalClankBrApp, - base::Time::Now()); - const auto result = - notice_storage.ReadNoticeData(prefs(), GetTopicsNoticeName()); - - /* Migration code. */ - auto notice_service = PrivacySandboxNoticeService(prefs()); - EXPECT_EQ(result, std::nullopt); -} - -#endif // !BUILDFLAG(IS_ANDROID) - -TEST_F(PrivacySandboxNoticeServiceTest, - PrefsNotSetWhenMigratedFromProtectedAudienceMeasurementWithNoAck) { - auto notice_service = privacy_sandbox::PrivacySandboxNoticeService(prefs()); - const auto result = notice_service.GetNoticeStorage()->ReadNoticeData( - prefs(), GetProtectedAudienceMeasurementNoticeName()); - EXPECT_EQ(result, std::nullopt); -} - -TEST_F(PrivacySandboxNoticeServiceTest, - NoticeActionSetWhenMigratedFromProtectedAudienceMeasurementWithAck) { - prefs()->SetBoolean(prefs::kPrivacySandboxM1EEANoticeAcknowledged, true); - auto notice_service = PrivacySandboxNoticeService(prefs()); - const auto result = notice_service.GetNoticeStorage()->ReadNoticeData( - prefs(), GetProtectedAudienceMeasurementNoticeName()); - EXPECT_EQ(result->GetSchemaVersion(), 1); - EXPECT_EQ(result->notice_action_taken_, NoticeActionTaken::kAck); - EXPECT_EQ(result->notice_action_taken_time_, base::Time()); -} - -// Clank specific tests. -#if BUILDFLAG(IS_ANDROID) -TEST_F( - PrivacySandboxNoticeServiceTest, - DuringMigrationClankBrAppPrefsNotSetWhenProtectedAudienceMeasurementSetFromCCT) { - /* Set old prefs. */ - prefs()->SetBoolean(prefs::kPrivacySandboxM1EEANoticeAcknowledged, true); - - /* Set new CCT prefs. */ - PrivacySandboxNoticeStorage notice_storage; - notice_storage.SetNoticeShown( - prefs(), kProtectedAudienceMeasurementNoticeModalClankCCT, - base::Time::Now()); - const auto result = notice_storage.ReadNoticeData( - prefs(), GetProtectedAudienceMeasurementNoticeName()); - - /* Migration code. */ - auto notice_service = PrivacySandboxNoticeService(prefs()); - EXPECT_EQ(result, std::nullopt); -} - -TEST_F( - PrivacySandboxNoticeServiceTest, - DuringMigrationPrefsNotSetWhenProtectedAudienceMeasurementSetFromDesktop) { - /* Set old prefs. */ - prefs()->SetBoolean(prefs::kPrivacySandboxM1EEANoticeAcknowledged, true); - - /* Set new prefs. */ - PrivacySandboxNoticeStorage notice_storage; - notice_storage.SetNoticeShown( - prefs(), kProtectedAudienceMeasurementNoticeModal, base::Time::Now()); - const auto result = notice_storage.ReadNoticeData( - prefs(), GetProtectedAudienceMeasurementNoticeName()); - - /* Migration code. */ - auto notice_service = PrivacySandboxNoticeService(prefs()); - EXPECT_EQ(result, std::nullopt); -} -#endif // BUILDFLAG(IS_ANDROID) - -#if !BUILDFLAG(IS_ANDROID) -TEST_F( - PrivacySandboxNoticeServiceTest, - DuringMigrationDesktopPrefsNotSetWhenProtectedAudienceMeasurementSetFromBrApp) { - /* Set old prefs. */ - prefs()->SetBoolean(prefs::kPrivacySandboxM1EEANoticeAcknowledged, true); - - /* Set new prefs. */ - PrivacySandboxNoticeStorage notice_storage; - notice_storage.SetNoticeShown( - prefs(), kProtectedAudienceMeasurementNoticeModalClankBrApp, - base::Time::Now()); - const auto result = notice_storage.ReadNoticeData( - prefs(), GetProtectedAudienceMeasurementNoticeName()); - - /* Migration code. */ - auto notice_service = PrivacySandboxNoticeService(prefs()); - EXPECT_EQ(result, std::nullopt); -} -#endif // !BUILDFLAG(IS_ANDROID) - -TEST_F(PrivacySandboxNoticeServiceTest, - PrefsNotSetWhenMigratedFromThreeAdsAPIsWithNoAck) { - auto notice_service = privacy_sandbox::PrivacySandboxNoticeService(prefs()); - const auto result = notice_service.GetNoticeStorage()->ReadNoticeData( - prefs(), GetThreeAdsAPIsNoticeName()); - EXPECT_EQ(result, std::nullopt); -} - -TEST_F(PrivacySandboxNoticeServiceTest, - NoticeActionSetWhenMigratedFromThreeAdsAPIsWithAck) { - prefs()->SetBoolean(prefs::kPrivacySandboxM1RowNoticeAcknowledged, true); - auto notice_service = PrivacySandboxNoticeService(prefs()); - const auto result = notice_service.GetNoticeStorage()->ReadNoticeData( - prefs(), GetThreeAdsAPIsNoticeName()); - EXPECT_EQ(result->GetSchemaVersion(), 1); - EXPECT_EQ(result->notice_action_taken_, NoticeActionTaken::kAck); - EXPECT_EQ(result->notice_action_taken_time_, base::Time()); -} - -// Clank specific tests. -#if BUILDFLAG(IS_ANDROID) -TEST_F(PrivacySandboxNoticeServiceTest, - DuringMigrationClankBrAppPrefsNotSetWhenThreeAdsAPIsSetFromCCT) { - /* Set old prefs. */ - prefs()->SetBoolean(prefs::kPrivacySandboxM1RowNoticeAcknowledged, true); - - /* Set new CCT prefs. */ - PrivacySandboxNoticeStorage notice_storage; - notice_storage.SetNoticeShown(prefs(), kThreeAdsAPIsNoticeModalClankCCT, - base::Time::Now()); - const auto result = - notice_storage.ReadNoticeData(prefs(), GetThreeAdsAPIsNoticeName()); - - /* Migration code. */ - auto notice_service = PrivacySandboxNoticeService(prefs()); - EXPECT_EQ(result, std::nullopt); -} - -TEST_F(PrivacySandboxNoticeServiceTest, - DuringMigrationPrefsNotSetWhenThreeAdsAPIsSetFromDesktop) { - /* Set old prefs. */ - prefs()->SetBoolean(prefs::kPrivacySandboxM1RowNoticeAcknowledged, true); - - /* Set new CCT prefs. */ - PrivacySandboxNoticeStorage notice_storage; - notice_storage.SetNoticeShown(prefs(), kThreeAdsAPIsNoticeModal, - base::Time::Now()); - const auto result = - notice_storage.ReadNoticeData(prefs(), GetThreeAdsAPIsNoticeName()); - - /* Migration code. */ - auto notice_service = PrivacySandboxNoticeService(prefs()); - EXPECT_EQ(result, std::nullopt); -} -#endif // BUILDFLAG(IS_ANDROID) - -#if !BUILDFLAG(IS_ANDROID) -TEST_F(PrivacySandboxNoticeServiceTest, - DuringMigrationDesktopPrefsNotSetWhenThreeAdsAPIsSetFromBrApp) { - /* Set old prefs. */ - prefs()->SetBoolean(prefs::kPrivacySandboxM1RowNoticeAcknowledged, true); - - /* Set new CCT prefs. */ - PrivacySandboxNoticeStorage notice_storage; - notice_storage.SetNoticeShown(prefs(), kThreeAdsAPIsNoticeModalClankBrApp, - base::Time::Now()); - const auto result = - notice_storage.ReadNoticeData(prefs(), GetThreeAdsAPIsNoticeName()); - - /* Migration code. */ - auto notice_service = PrivacySandboxNoticeService(prefs()); - EXPECT_EQ(result, std::nullopt); -} -#endif // !BUILDFLAG(IS_ANDROID) - -TEST_F(PrivacySandboxNoticeServiceTest, - PrefsNotSetWhenMigratedFromMeasurementWithNoAck) { - auto notice_service = privacy_sandbox::PrivacySandboxNoticeService(prefs()); - const auto result = notice_service.GetNoticeStorage()->ReadNoticeData( - prefs(), GetMeasurementNoticeName()); - EXPECT_EQ(result, std::nullopt); -} - -TEST_F(PrivacySandboxNoticeServiceTest, - NoticeActionSetWhenMigratedFromMeasurementWithAck) { - prefs()->SetBoolean(prefs::kPrivacySandboxM1RestrictedNoticeAcknowledged, - true); - auto notice_service = PrivacySandboxNoticeService(prefs()); - const auto result = notice_service.GetNoticeStorage()->ReadNoticeData( - prefs(), GetMeasurementNoticeName()); - EXPECT_EQ(result->GetSchemaVersion(), 1); - EXPECT_EQ(result->notice_action_taken_, NoticeActionTaken::kAck); - EXPECT_EQ(result->notice_action_taken_time_, base::Time()); -} - -// Clank specific tests. -#if BUILDFLAG(IS_ANDROID) -TEST_F(PrivacySandboxNoticeServiceTest, - DuringMigrationClankBrAppPrefsNotSetWhenMeasurementSetFromCCT) { - /* Set old prefs. */ - prefs()->SetBoolean(prefs::kPrivacySandboxM1RestrictedNoticeAcknowledged, - true); - - /* Set new CCT prefs. */ - PrivacySandboxNoticeStorage notice_storage; - notice_storage.SetNoticeShown(prefs(), kMeasurementNoticeModalClankCCT, - base::Time::Now()); - const auto result = - notice_storage.ReadNoticeData(prefs(), GetMeasurementNoticeName()); - - /* Migration code. */ - auto notice_service = PrivacySandboxNoticeService(prefs()); - EXPECT_EQ(result, std::nullopt); -} - -TEST_F(PrivacySandboxNoticeServiceTest, - DuringMigrationPrefsNotSetWhenMeasurementSetFromDesktop) { - /* Set old prefs. */ - prefs()->SetBoolean(prefs::kPrivacySandboxM1RestrictedNoticeAcknowledged, - true); - - /* Set new CCT prefs. */ - PrivacySandboxNoticeStorage notice_storage; - notice_storage.SetNoticeShown(prefs(), kMeasurementNoticeModal, - base::Time::Now()); - const auto result = - notice_storage.ReadNoticeData(prefs(), GetMeasurementNoticeName()); - - /* Migration code. */ - auto notice_service = PrivacySandboxNoticeService(prefs()); - EXPECT_EQ(result, std::nullopt); -} -#endif // BUILDFLAG(IS_ANDROID) - -#if !BUILDFLAG(IS_ANDROID) -TEST_F(PrivacySandboxNoticeServiceTest, - DuringMigrationDesktopPrefsNotSetWhenMeasurementSetFromBrApp) { - /* Set old prefs. */ - prefs()->SetBoolean(prefs::kPrivacySandboxM1RestrictedNoticeAcknowledged, - true); - - /* Set new CCT prefs. */ - PrivacySandboxNoticeStorage notice_storage; - notice_storage.SetNoticeShown(prefs(), kMeasurementNoticeModalClankBrApp, - base::Time::Now()); - const auto result = - notice_storage.ReadNoticeData(prefs(), GetMeasurementNoticeName()); - - /* Migration code. */ - auto notice_service = PrivacySandboxNoticeService(prefs()); - EXPECT_EQ(result, std::nullopt); -} -#endif // !BUILDFLAG(IS_ANDROID) - -} // namespace -} // namespace privacy_sandbox
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc index 08d4eba9..80d931b8 100644 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc +++ b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc
@@ -934,9 +934,6 @@ break; } case PromptAction::kConsentMoreInfoOpened: { - notice_storage->SetNoticeActionTaken( - pref_service, notice_name, - privacy_sandbox::NoticeActionTaken::kLearnMore, base::Time::Now()); break; } // EEA and ROW notices @@ -958,15 +955,11 @@ break; } case PromptAction::kNoticeMoreInfoOpened: - // Ads API UX Enhancements + // Ads API UX Enhancements case PromptAction::kNoticeSiteSuggestedAdsMoreInfoOpened: case PromptAction::kNoticeAdsMeasurementMoreInfoOpened: { - notice_storage->SetNoticeActionTaken( - pref_service, notice_name, - privacy_sandbox::NoticeActionTaken::kLearnMore, base::Time::Now()); break; } - // Restricted notices case PromptAction::kRestrictedNoticeShown: { DCHECK(privacy_sandbox::IsRestrictedNoticeRequired());
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl_unittest.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl_unittest.cc index bdfd5052..af05a6e1 100644 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl_unittest.cc +++ b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl_unittest.cc
@@ -2698,7 +2698,6 @@ using NoticeAckTest = PrivacySandboxNoticeActionToStorageTests; using NoticeShownTest = PrivacySandboxNoticeActionToStorageTests; using NoticeSettingsTest = PrivacySandboxNoticeActionToStorageTests; -using LearnMoreTest = PrivacySandboxNoticeActionToStorageTests; TEST_P(TopicsConsentTest, DidConsentOptInUpdateNoticeStorage) { // Show then OptIn @@ -2793,26 +2792,6 @@ privacy_sandbox::NoticeStartupState::kFlowCompleted, 1); } -TEST_P(LearnMoreTest, DidLearnMoreActionUpdateNoticeStorage) { - // Show then trigger Learn More - privacy_sandbox_service()->PromptActionOccurred(GetParam().shown_type, - GetParam().surface_type); - privacy_sandbox_service()->PromptActionOccurred(GetParam().prompt_action, - GetParam().surface_type); - // Pref - auto actual = - notice_storage_->ReadNoticeData(prefs(), GetParam().notice_name); - EXPECT_EQ(privacy_sandbox::NoticeActionTaken::kNotSet, - actual->notice_action_taken_); - - // Histogram - CreateService(); - histogram_tester_.ExpectBucketCount( - base::StrCat({"PrivacySandbox.Notice.NoticeStartupState.", - GetParam().notice_name}), - privacy_sandbox::NoticeStartupState::kPromptWaiting, 1); -} - base::test::FeatureRefAndParams ConsentFeature() { return { privacy_sandbox::kPrivacySandboxSettings4, @@ -3017,41 +2996,6 @@ .prompt_action = PromptAction::kRestrictedNoticeOpenSettings, .notice_name = privacy_sandbox::kMeasurementNoticeModalClankCCT}})); -INSTANTIATE_TEST_SUITE_P( - NoticeTestSuite, - LearnMoreTest, - testing::ValuesIn<NoticeTestingParameters>( - // Learn More click - {{.surface_type = SurfaceType::kDesktop, - .feature_flag = ConsentFeature(), - .shown_type = PromptAction::kConsentShown, - .prompt_action = PromptAction::kConsentMoreInfoOpened, - .notice_name = privacy_sandbox::kTopicsConsentModal}, - {.surface_type = SurfaceType::kDesktop, - .feature_flag = ConsentFeature(), - .shown_type = PromptAction::kNoticeShown, - .prompt_action = PromptAction::kNoticeMoreInfoOpened, - .notice_name = - privacy_sandbox::kProtectedAudienceMeasurementNoticeModal}, - {.surface_type = SurfaceType::kDesktop, - .feature_flag = NoticeFeature(), - .shown_type = PromptAction::kNoticeShown, - .prompt_action = PromptAction::kNoticeMoreInfoOpened, - .notice_name = privacy_sandbox::kThreeAdsAPIsNoticeModal}, - // Ads API UX Enhancements - {.surface_type = SurfaceType::kDesktop, - .feature_flag = ConsentFeature(), - .shown_type = PromptAction::kNoticeShown, - .prompt_action = PromptAction::kNoticeSiteSuggestedAdsMoreInfoOpened, - .notice_name = - privacy_sandbox::kProtectedAudienceMeasurementNoticeModal}, - {.surface_type = SurfaceType::kDesktop, - .feature_flag = ConsentFeature(), - .shown_type = PromptAction::kNoticeShown, - .prompt_action = PromptAction::kNoticeAdsMeasurementMoreInfoOpened, - .notice_name = - privacy_sandbox::kProtectedAudienceMeasurementNoticeModal}})); - class PrivacySandboxServiceM1RestrictedNoticeTest : public PrivacySandboxServiceTest { public:
diff --git a/chrome/browser/resources/bookmarks/BUILD.gn b/chrome/browser/resources/bookmarks/BUILD.gn index edc65231..20552d3 100644 --- a/chrome/browser/resources/bookmarks/BUILD.gn +++ b/chrome/browser/resources/bookmarks/BUILD.gn
@@ -15,7 +15,6 @@ "edit_dialog.ts", "folder_node.ts", "item.ts", - "list.ts", "toolbar.ts", ] @@ -32,6 +31,8 @@ "debouncer.ts", "dialog_focus_manager.ts", "dnd_manager.ts", + "list.html.ts", + "list.ts", "mouse_focus_behavior.ts", "reducers.ts", "router.ts", @@ -46,6 +47,7 @@ css_files = [ "folder_node.css", "item.css", + "list.css", "toolbar.css", "shared_style.css", "shared_style_lit.css",
diff --git a/chrome/browser/resources/bookmarks/list.css b/chrome/browser/resources/bookmarks/list.css new file mode 100644 index 0000000..6b144820 --- /dev/null +++ b/chrome/browser/resources/bookmarks/list.css
@@ -0,0 +1,47 @@ +/* Copyright 2025 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=chrome://resources/cr_elements/cr_shared_vars.css.js + * #import=./shared_style_lit.css.js + * #include=shared-style-lit + * #css_wrapper_metadata_end */ + +:host { + color: var(--cr-secondary-text-color); + min-width: 300px; + overflow-y: auto; + padding-bottom: 24px; + padding-inline-end: var(--card-padding-side); + padding-inline-start: calc(var(--card-padding-side) - + var(--splitter-width)); + padding-top: 24px; +} + +#list { + background-color: var(--cr-card-background-color); + border-radius: var(--cr-card-border-radius); + box-shadow: var(--cr-card-shadow); + margin: 0 auto; + max-width: var(--card-max-width); + padding: 8px 0; +} + +.centered-message { + align-items: center; + color: var(--md-loading-message-color); + cursor: default; + display: flex; + font-size: 14px; + font-weight: 500; + height: 100%; + justify-content: center; + user-select: none; + white-space: nowrap; +} + +[role='row']:focus-within { + z-index: 1; +}
diff --git a/chrome/browser/resources/bookmarks/list.html b/chrome/browser/resources/bookmarks/list.html deleted file mode 100644 index caec017..0000000 --- a/chrome/browser/resources/bookmarks/list.html +++ /dev/null
@@ -1,61 +0,0 @@ -<style include="shared-style"> - :host { - color: var(--cr-secondary-text-color); - min-width: 300px; - overflow-y: auto; - padding-bottom: 24px; - padding-inline-end: var(--card-padding-side); - padding-inline-start: calc(var(--card-padding-side) - - var(--splitter-width)); - padding-top: 24px; - } - - #list { - background-color: var(--cr-card-background-color); - border-radius: var(--cr-card-border-radius); - box-shadow: var(--cr-card-shadow); - margin: 0 auto; - max-width: var(--card-max-width); - padding: 8px 0; - } - - .centered-message { - align-items: center; - color: var(--md-loading-message-color); - cursor: default; - display: flex; - font-size: 14px; - font-weight: 500; - height: 100%; - justify-content: center; - user-select: none; - white-space: nowrap; - } - - [role='row']:focus-within { - z-index: 1; - } -</style> -<iron-list id="list" - items="[[displayedList_]]" - hidden$="[[isEmptyList_(displayedList_.length)]]" - role="grid" - aria-label="$i18n{listAxLabel}" - aria-multiselectable="true"> - <template> - <bookmarks-item - id="bookmark_[[index]]" - item-id="[[item.id]]" - draggable="true" - role="row" - tabindex$="[[tabIndex]]" - iron-list-tab-index="[[tabIndex]]" - aria-rowindex$="[[getAriaRowindex_(index)]]" - aria-selected="[[getAriaSelected_(item.id, selectedItems_)]]"> - </bookmarks-item> - </template> -</iron-list> -<div id="message" class="centered-message" - hidden$="[[!isEmptyList_(displayedList_.length)]]"> - [[emptyListMessage_(searchTerm_)]] -</div>
diff --git a/chrome/browser/resources/bookmarks/list.html.ts b/chrome/browser/resources/bookmarks/list.html.ts new file mode 100644 index 0000000..64c13fe --- /dev/null +++ b/chrome/browser/resources/bookmarks/list.html.ts
@@ -0,0 +1,40 @@ +// Copyright 2025 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 {BookmarksListElement} from './list.js'; + +export function getHtml(this: BookmarksListElement) { + // clang-format off + return html`<!--_html_template_start_--> +<cr-lazy-list id="list" + .items="${this.displayedIds_}" + .scrollTarget="${this}" + item-size="40" chunk-size="10" + ?hidden="${this.isEmptyList_()}" + role="grid" + no-restore-focus + aria-label="$i18n{listAxLabel}" + aria-multiselectable="true" + .template=${(id: string, index: number) => html` + <bookmarks-item data-index="${index}" + id="bookmark_${index}" + item-id="${id}" + draggable="true" + role="row" + tabindex="${this.getTabindex_(index)}" + .ironListTabIndex="${this.getTabindex_(index)}" + @keydown="${this.onItemKeydown_}" + @focus="${this.onItemFocus_}" + aria-rowindex="${this.getAriaRowindex_(index)}" + aria-selected="${this.getAriaSelected_(id)}"> + </bookmarks-item>`}> +</cr-lazy-list> +<div id="message" class="centered-message" ?hidden="${!this.isEmptyList_()}"> + ${this.emptyListMessage_()} +</div> +<!--_html_template_end_-->`; + // clang-format on +}
diff --git a/chrome/browser/resources/bookmarks/list.ts b/chrome/browser/resources/bookmarks/list.ts index d23efc9..371f1f51 100644 --- a/chrome/browser/resources/bookmarks/list.ts +++ b/chrome/browser/resources/bookmarks/list.ts
@@ -2,38 +2,36 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://resources/cr_elements/cr_shared_vars.css.js'; -import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; -import './shared_style.css.js'; +import 'chrome://resources/cr_elements/cr_lazy_list/cr_lazy_list.js'; import '/strings.m.js'; import './item.js'; import {getInstance as getAnnouncerInstance} from 'chrome://resources/cr_elements/cr_a11y_announcer/cr_a11y_announcer.js'; -import {ListPropertyUpdateMixin} from 'chrome://resources/cr_elements/list_property_update_mixin.js'; +import type {CrLazyListElement} from 'chrome://resources/cr_elements/cr_lazy_list/cr_lazy_list.js'; import {assert} from 'chrome://resources/js/assert.js'; import {EventTracker} from 'chrome://resources/js/event_tracker.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {isMac} from 'chrome://resources/js/platform.js'; import {PluralStringProxyImpl} from 'chrome://resources/js/plural_string_proxy.js'; -import {getDeepActiveElement} from 'chrome://resources/js/util.js'; -import type {IronListElement} from 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; -import {microTask, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {listenOnce} from 'chrome://resources/js/util.js'; +import {CrLitElement} from 'chrome://resources/lit/v3_0/lit.rollup.js'; +import type {PropertyValues} from 'chrome://resources/lit/v3_0/lit.rollup.js'; import {deselectItems, selectAll, selectItem, updateAnchor} from './actions.js'; import {BookmarksCommandManagerElement} from './command_manager.js'; import {MenuSource} from './constants.js'; import type {BookmarksItemElement} from './item.js'; -import {getTemplate} from './list.html.js'; -import {StoreClientMixin} from './store_client_mixin.js'; -import type {OpenCommandMenuDetail} from './types.js'; +import {getCss} from './list.css.js'; +import {getHtml} from './list.html.js'; +import {StoreClientMixinLit} from './store_client_mixin_lit.js'; +import type {BookmarksPageState, OpenCommandMenuDetail} from './types.js'; import {canReorderChildren, getDisplayedList} from './util.js'; -const BookmarksListElementBase = - StoreClientMixin(ListPropertyUpdateMixin(PolymerElement)); +const BookmarksListElementBase = StoreClientMixinLit(CrLitElement); export interface BookmarksListElement { $: { - list: IronListElement, + list: CrLazyListElement, message: HTMLElement, }; } @@ -43,56 +41,32 @@ return 'bookmarks-list'; } - 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 { - /** - * A list of item ids wrapped in an Object. This is necessary because - * iron-list is unable to distinguish focusing index 6 from focusing id - * '6' so the item we supply to iron-list needs to be non-index-like. - */ - displayedList_: { - type: Array, - value() { - // Use an empty list during initialization so that the databinding to - // hide #list takes effect. - return []; - }, - }, - - displayedIds_: { - type: Array, - observer: 'onDisplayedIdsChanged_', - }, - - searchTerm_: { - type: String, - observer: 'onDisplayedListSourceChange_', - }, - - selectedFolder_: { - type: String, - observer: 'onDisplayedListSourceChange_', - }, - - selectedItems_: Object, + displayedIds_: {type: Array}, + searchTerm_: {type: String}, + selectedFolder_: {type: String}, + selectedItems_: {type: Object}, + focusedIndex_: {type: Number}, }; } - private displayedList_: Array<{id: string}>; - private displayedIds_: string[]; + protected displayedIds_: string[] = []; + private focusedIndex_: number = 0; private eventTracker_: EventTracker = new EventTracker(); - private searchTerm_: string; - private selectedFolder_: string; - private selectedItems_: Set<string>; + private searchTerm_: string = ''; + private selectedFolder_: string = ''; + private selectedItems_: Set<string> = new Set(); - private focusTimeoutId_: number = -1; - - override ready() { - super.ready(); + override firstUpdated() { this.addEventListener('click', () => this.deselectItems_()); this.addEventListener('contextmenu', e => this.onContextMenu_(e)); this.addEventListener( @@ -100,23 +74,21 @@ e => this.onOpenCommandMenu_(e as CustomEvent<OpenCommandMenuDetail>)); } + override updated(changedProperties: PropertyValues<this>) { + super.updated(changedProperties); + + const changedPrivateProperties = + changedProperties as Map<PropertyKey, unknown>; + if (changedPrivateProperties.has('searchTerm_') || + changedPrivateProperties.has('selectedFolder_')) { + this.scrollTop = 0; + } + } + override connectedCallback() { super.connectedCallback(); - - const list = this.$.list; - list.scrollTarget = this; - - this.watch('displayedIds_', function(state) { - return getDisplayedList(state); - }); - this.watch('searchTerm_', state => state.search.term); - this.watch('selectedFolder_', state => state.selectedFolder); - this.watch('selectedItems_', state => state.selection.items); this.updateFromStore(); - this.$.list.addEventListener( - 'keydown', this.onItemKeydown_.bind(this), true); - this.eventTracker_.add( document, 'highlight-items', (e: Event) => this.onHighlightItems_(e as CustomEvent<string[]>)); @@ -132,64 +104,53 @@ this.eventTracker_.remove(document, 'highlight-items'); } + override onStateChanged(state: BookmarksPageState) { + // Grab the last set of values before updating them. + const previousDisplayedIds = this.displayedIds_; + const lastSelected = Array.from(this.selectedItems_)[0]; + this.displayedIds_ = getDisplayedList(state); + this.searchTerm_ = state.search.term; + this.selectedFolder_ = state.selectedFolder; + this.selectedItems_ = state.selection.items; + this.onDisplayedIdsChanged_(previousDisplayedIds, lastSelected); + } + getDropTarget(): HTMLElement { return this.$.message; } - /** - * Updates `displayedList_` using splices to be equivalent to `newValue`. This - * allows the iron-list to delete sublists of items which preserves scroll and - * focus on incremental update. - */ - private async onDisplayedIdsChanged_( - newValue: string[], _oldValue: string[]) { - if (this.focusTimeoutId_ !== -1) { - clearTimeout(this.focusTimeoutId_); - this.focusTimeoutId_ = -1; - } - - const updatedList = newValue.map(id => ({id: id})); - let skipFocus = false; + private onDisplayedIdsChanged_(previous: string[], lastSelected?: string) { let selectIndex = -1; if (this.matches(':focus-within')) { - if (this.selectedItems_.size > 0) { - const selectedId = Array.from(this.selectedItems_)[0]; - skipFocus = newValue.some(id => id === selectedId); + if (lastSelected !== undefined) { selectIndex = - this.displayedList_.findIndex(({id}) => selectedId === id); + previous ? previous.findIndex(id => lastSelected === id) : -1; } - if (selectIndex === -1 && updatedList.length > 0) { + if (selectIndex === -1 && this.displayedIds_.length > 0) { selectIndex = 0; } else { - selectIndex = Math.min(selectIndex, updatedList.length - 1); + selectIndex = Math.min(selectIndex, this.displayedIds_.length - 1); } + this.focusedIndex_ = selectIndex; } - this.updateList( - 'displayedList_', item => (item as {id: string}).id, updatedList); - // Trigger a layout of the iron list. Otherwise some elements may render - // as blank entries. See https://crbug.com/848683 - this.$.list.dispatchEvent( - new CustomEvent('iron-resize', {bubbles: true, composed: true})); - if (!skipFocus && selectIndex > -1) { - this.focusTimeoutId_ = setTimeout(() => { - this.focusTimeoutId_ = -1; - this.$.list.focusItem(selectIndex); - // Focus menu button so 'Undo' is only one tab stop away on delete. - const item = getDeepActiveElement(); - if (item) { - (item as BookmarksItemElement).focusMenuButton(); - } + if (selectIndex > -1) { + // Wait for updateComplete so that it is safe to access this.$.list. + this.updateComplete.then(() => { + listenOnce(this.$.list, 'viewport-filled', async () => { + const element = await this.$.list.ensureItemRendered(selectIndex) as + BookmarksItemElement; + element.focus(); + element.focusMenuButton(); + }); }); } - const label = await PluralStringProxyImpl.getInstance().getPluralString( - 'listChanged', this.displayedList_.length); - getAnnouncerInstance().announce(label); - } - - private onDisplayedListSourceChange_() { - this.scrollTop = 0; + PluralStringProxyImpl.getInstance() + .getPluralString('listChanged', this.displayedIds_.length) + .then(label => { + getAnnouncerInstance().announce(label); + }); } /** @@ -198,13 +159,12 @@ private scrollToId_(itemId: string) { const index = this.displayedIds_.indexOf(itemId); const list = this.$.list; - if (index >= 0 && index < list.firstVisibleIndex || - index > list.lastVisibleIndex) { - list.scrollToIndex(index); + if (index >= 0 && index < list.domItems().length) { + (list.domItems()[index] as HTMLElement).scrollIntoViewIfNeeded(); } } - private emptyListMessage_(): string { + protected emptyListMessage_(): string { let emptyListMessage = 'noSearchResults'; if (!this.searchTerm_) { emptyListMessage = @@ -215,19 +175,14 @@ return loadTimeData.getString(emptyListMessage); } - private isEmptyList_(): boolean { - return this.displayedList_.length === 0; + protected isEmptyList_(): boolean { + return this.displayedIds_.length === 0; } private deselectItems_() { this.dispatch(deselectItems()); } - private getIndexForItemElement_(el: HTMLElement): number { - return (this.$.list.modelForElement(el) as unknown as {index: number}) - .index; - } - private onOpenCommandMenu_(e: CustomEvent<{source: MenuSource}>) { // If the item is not visible, scroll to it before rendering the menu. if (e.detail.source === MenuSource.ITEM) { @@ -253,12 +208,13 @@ const leadId = toHighlight[0]; this.dispatch(selectAll(toHighlight, this.getState(), leadId)); - // Allow iron-list time to render additions to the list. - microTask.run(() => { + // Allow cr-lazy-list time to render additions to the list. + listenOnce(this.$.list, 'viewport-filled', async () => { this.scrollToId_(leadId); const leadIndex = this.displayedIds_.indexOf(leadId); assert(leadIndex !== -1); - this.$.list.focusItem(leadIndex); + const element = await this.$.list.ensureItemRendered(leadIndex); + (element as HTMLElement).focus(); }); } @@ -270,11 +226,11 @@ getAnnouncerInstance().announce(loadTimeData.getString('importEnded')); } - private onItemKeydown_(e: KeyboardEvent) { + protected async onItemKeydown_(e: KeyboardEvent) { let handled = true; const list = this.$.list; let focusMoved = false; - let focusedIndex = this.getIndexForItemElement_(e.target as HTMLElement); + let focusedIndex = Number((e.target as HTMLElement).dataset['index']); const oldFocusedIndex = focusedIndex; const cursorModifier = isMac ? e.metaKey : e.ctrlKey; if (e.key === 'ArrowUp') { @@ -288,7 +244,7 @@ focusedIndex = 0; focusMoved = true; } else if (e.key === 'End') { - focusedIndex = list.items!.length - 1; + focusedIndex = this.displayedIds_.length - 1; focusMoved = true; } else if (e.key === ' ' && cursorModifier) { this.dispatch( @@ -303,8 +259,10 @@ if (focusMoved) { focusedIndex = - Math.min(list.items!.length - 1, Math.max(0, focusedIndex)); - list.focusItem(focusedIndex); + Math.min(this.displayedIds_.length - 1, Math.max(0, focusedIndex)); + this.focusedIndex_ = focusedIndex; + const element = await list.ensureItemRendered(focusedIndex); + (element as HTMLElement).focus(); if (cursorModifier && !e.shiftKey) { this.dispatch(updateAnchor(this.displayedIds_[focusedIndex])); @@ -362,11 +320,26 @@ })); } - private getAriaRowindex_(index: number): number { + protected onItemFocus_(e: Event) { + const renderedItems = this.$.list.domItems(); + const focusedIdx = Array.from(renderedItems).findIndex(item => { + return item === e.target || item.shadowRoot?.activeElement === e.target; + }); + + if (focusedIdx !== -1) { + this.focusedIndex_ = focusedIdx; + } + } + + protected getAriaRowindex_(index: number): number { return index + 1; } - private getAriaSelected_(id: string): boolean { + protected getTabindex_(index: number): number { + return index === this.focusedIndex_ ? 0 : -1; + } + + protected getAriaSelected_(id: string): boolean { return this.selectedItems_.has(id); }
diff --git a/chrome/browser/resources/bookmarks/util.ts b/chrome/browser/resources/bookmarks/util.ts index 2521142e..36ba6ce 100644 --- a/chrome/browser/resources/bookmarks/util.ts +++ b/chrome/browser/resources/bookmarks/util.ts
@@ -161,8 +161,8 @@ */ export function canReorderChildren( state: BookmarksPageState, itemId: string): boolean { - return !isRootNode(itemId) && !state.nodes[itemId].unmodifiable && - state.prefs.canEdit; + return !isRootNode(itemId) && !!state.nodes[itemId] && + !state.nodes[itemId].unmodifiable && state.prefs.canEdit; } export function hasChildFolders(id: string, nodes: NodeMap): boolean {
diff --git a/chrome/browser/resources/side_panel/bookmarks/power_bookmark_row.ts b/chrome/browser/resources/side_panel/bookmarks/power_bookmark_row.ts index 653943c..deef389 100644 --- a/chrome/browser/resources/side_panel/bookmarks/power_bookmark_row.ts +++ b/chrome/browser/resources/side_panel/bookmarks/power_bookmark_row.ts
@@ -402,8 +402,10 @@ event.preventDefault(); event.stopPropagation(); const inputElement = - this.shadowRoot.querySelector<CrInputElement>('#input')!; - this.dispatchEvent(this.createInputChangeEvent_(inputElement.value)); + this.shadowRoot.querySelector<CrInputElement>('#input'); + if (inputElement) { + this.dispatchEvent(this.createInputChangeEvent_(inputElement.value)); + } } protected onInputBlur_(event: Event) {
diff --git a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html index d222dd1..83b002288 100644 --- a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html +++ b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.html
@@ -102,7 +102,7 @@ on-toolbar-overflow="onToolbarOverflow_"> <template id="read-aloud-container" is="dom-if" if="[[isReadAloudEnabled_]]"> <span id="audio-controls" class$="audio-background-when-active-[[isSpeechActive]]"> - <span hidden="[[hideSpinner]]"> + <span hidden="[[hideSpinner_]]"> <picture class="spinner toolbar-button audio-controls"> <source media="(prefers-color-scheme: dark)" srcset="//resources/images/throbber_small_dark.svg">
diff --git a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.ts b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.ts index d21fef6..a8bfe78 100644 --- a/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.ts +++ b/chrome/browser/resources/side_panel/read_anything/read_anything_toolbar.ts
@@ -27,7 +27,7 @@ import {assert} from '//resources/js/assert.js'; import {loadTimeData} from '//resources/js/load_time_data.js'; import type {DomRepeatEvent} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {Debouncer, PolymerElement, timeOut} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {emitEvent, getCurrentSpeechRate, minOverflowLengthToScroll, openMenu, spinnerDebounceTimeout, ToolbarEvent} from './common.js'; import type {SettingsPrefs} from './common.js'; @@ -65,11 +65,13 @@ openMenu: (target: HTMLElement) => void; } + +type ToggleButtonId = + typeof LINK_TOGGLE_BUTTON_ID|typeof IMAGES_TOGGLE_BUTTON_ID; interface ToggleButton { - id: string; + id: ToggleButtonId; icon: string; title: string; - callback: (event: DomRepeatEvent<ToggleButton>) => void; } export const moreOptionsClass = '.more-options-icon'; @@ -217,7 +219,6 @@ title: chrome.readingMode.linksEnabled? loadTimeData.getString('disableLinksLabel'): loadTimeData.getString('enableLinksLabel'), - callback: this.onToggleLinksClick_.bind(this), }, ]; @@ -248,9 +249,9 @@ // plays. private isAudioCurrentlyPlaying: boolean; - private hideSpinner: boolean = true; + protected hideSpinner_: boolean = true; - private debouncer_: Debouncer|null = null; + private spinnerDebouncerCallbackHandle_?: number; // If Read Aloud is playable. Certain states, such as when Read Anything does // not have content or when the speech engine is loading should disable @@ -277,7 +278,6 @@ title: chrome.readingMode.imagesEnabled ? loadTimeData.getString('disableImagesLabel') : loadTimeData.getString('enableImagesLabel'), - callback: this.onToggleImagesClick_.bind(this), }); } } @@ -301,10 +301,13 @@ } override disconnectedCallback() { - super.disconnectedCallback(); if (this.windowResizeCallback_) { window.removeEventListener('resize', this.windowResizeCallback_); } + if (this.spinnerDebouncerCallbackHandle_ !== undefined) { + clearTimeout(this.spinnerDebouncerCallbackHandle_); + } + super.disconnectedCallback(); } private initializeMenuButtons_() { @@ -671,15 +674,16 @@ this.updateFontSize_(false); } - private onToggleButtonClick_(event: DomRepeatEvent<ToggleButton>) { - event.model.item.callback(event); + protected onToggleButtonClick_(event: DomRepeatEvent<ToggleButton>) { + const toggleMenuId = event.model.item.id; + if (toggleMenuId === LINK_TOGGLE_BUTTON_ID) { + this.onToggleLinksClick_(); + } else if (toggleMenuId === IMAGES_TOGGLE_BUTTON_ID) { + this.onToggleImagesClick_(); + } } - private onToggleLinksClick_(event: DomRepeatEvent<ToggleButton>) { - if (!event.target) { - return; - } - + private onToggleLinksClick_() { this.logger_.logTextSettingsChange( ReadAnythingSettingsChange.LINKS_ENABLED_CHANGE); @@ -688,10 +692,7 @@ this.updateLinkToggleButton(); } - private onToggleImagesClick_(event: DomRepeatEvent<ToggleButton>) { - if (!event.target) { - return; - } + private onToggleImagesClick_() { this.logger_.logTextSettingsChange( ReadAnythingSettingsChange.IMAGES_ENABLED_CHANGE); @@ -839,8 +840,7 @@ this.updateFocus_(focusableElements, newIndex); } - - private onSpeechPlayingStateChanged_() { + private resetHideSpinnerDebouncer_() { // Use a debouncer to reduce glitches. Even when audio is fast to respond to // the play button, there are still milliseconds of delay. To prevent the // spinner from quickly appearing and disappearing, we use a debouncer. If @@ -849,11 +849,18 @@ // is scheduled. // TODO (b/339860819) improve debouncer logic so that the spinner disappears // immediately when speech starts playing, or when the pause button is hit. - this.debouncer_ = Debouncer.debounce( - this.debouncer_, timeOut.after(spinnerDebounceTimeout), () => { - this.hideSpinner = - !this.isSpeechActive || this.isAudioCurrentlyPlaying; - }); + if (this.spinnerDebouncerCallbackHandle_ !== undefined) { + clearTimeout(this.spinnerDebouncerCallbackHandle_); + } + this.spinnerDebouncerCallbackHandle_ = setTimeout(() => { + this.hideSpinner_ = !this.isSpeechActive || this.isAudioCurrentlyPlaying; + this.spinnerDebouncerCallbackHandle_ = undefined; + }, spinnerDebounceTimeout); + } + + private onSpeechPlayingStateChanged_() { + this.resetHideSpinnerDebouncer_(); + // If the previously focused item becomes disabled or disappears from the // toolbar because of speech starting or stopping, put the focus on the // play/pause button so keyboard navigation continues working.
diff --git a/chrome/browser/resources/signin/batch_upload/data_section.css b/chrome/browser/resources/signin/batch_upload/data_section.css index 0591d2a..3bb2a08 100644 --- a/chrome/browser/resources/signin/batch_upload/data_section.css +++ b/chrome/browser/resources/signin/batch_upload/data_section.css
@@ -31,10 +31,9 @@ #sectionTitle { color: var(--cr-primary-text-color); - display: flex; font-size: 1rem; font-weight: 500; - justify-content: flex-start; + padding-inline-end: 12px; width: 100%; }
diff --git a/chrome/browser/resources/signin/batch_upload/data_section.html.ts b/chrome/browser/resources/signin/batch_upload/data_section.html.ts index a083f62b..5df82e1 100644 --- a/chrome/browser/resources/signin/batch_upload/data_section.html.ts +++ b/chrome/browser/resources/signin/batch_upload/data_section.html.ts
@@ -11,7 +11,7 @@ return html` <div class="data-section"> <div class="data-section-header"> - <h2 id="sectionTitle">${this.title_}</h2> + <h2 id="sectionTitle" class="text-elide">${this.title_}</h2> <cr-expand-button id="expandButton" no-hover ?hidden="${this.disabled_ || this.isThemeSection()}" ?expanded="${this.expanded_}"
diff --git a/chrome/browser/resources/signin/batch_upload/data_section.ts b/chrome/browser/resources/signin/batch_upload/data_section.ts index f57c63e..1158dc4 100644 --- a/chrome/browser/resources/signin/batch_upload/data_section.ts +++ b/chrome/browser/resources/signin/batch_upload/data_section.ts
@@ -144,8 +144,17 @@ // id may be empty. if (this.dataContainer.sectionTitle && this.dataContainer.sectionTitle.length > 0) { - this.title_ = await PluralStringProxyImpl.getInstance().getPluralString( - this.dataContainer.sectionTitle, this.dataSelectedCount_); + if (this.isThemeSection()) { + // Themes construct its title with the content of its one and only + // item title. + this.title_ = this.i18n( + this.dataContainer.sectionTitle, + this.dataContainer.dataItems[0]!.title); + } else { + this.title_ = + await PluralStringProxyImpl.getInstance().getPluralString( + this.dataContainer.sectionTitle, this.dataSelectedCount_); + } } } }
diff --git a/chrome/browser/storage_access_api/api_browsertest.cc b/chrome/browser/storage_access_api/api_browsertest.cc index f45aaa6..278fdff 100644 --- a/chrome/browser/storage_access_api/api_browsertest.cc +++ b/chrome/browser/storage_access_api/api_browsertest.cc
@@ -36,6 +36,7 @@ #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_types.h" +#include "components/content_settings/core/common/content_settings_utils.h" #include "components/content_settings/core/common/features.h" #include "components/content_settings/core/common/pref_names.h" #include "components/permissions/features.h" @@ -63,6 +64,7 @@ #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/install_default_websocket_handlers.h" +#include "net/test/embedded_test_server/request_handler_util.h" #include "net/test/test_data_directory.h" #include "services/network/public/cpp/features.h" #include "services/network/public/cpp/network_switches.h" @@ -124,6 +126,13 @@ constexpr char kSecFetchStorageAccess[] = "Sec-Fetch-Storage-Access"; +const ContentSettingPatternSource kExpectedSettingDefault( + ContentSettingsPattern::Wildcard(), + ContentSettingsPattern::Wildcard(), + content_settings::ContentSettingToValue(CONTENT_SETTING_ASK), + content_settings::ProviderType::kDefaultProvider, + /*incognito=*/false); + enum class TestType { kFrame, kWorker }; // Helpers to express expected @@ -245,6 +254,21 @@ return http_response; } +// Intercepts requests and sets the 'Popin-Policy' response header to * if +// the query param `allow_popins` is set. +std::unique_ptr<net::test_server::HttpResponse> PopinRequestHandler( + const net::test_server::HttpRequest& request) { + net::test_server::RequestQuery query = + net::test_server::ParseQuery(request.GetURL()); + if (query.find("allow_popins") == query.end()) { + return nullptr; + } + auto http_response = std::make_unique<net::test_server::BasicHttpResponse>(); + http_response->set_content_type("text/html"); + http_response->AddCustomHeader("Popin-Policy", "partitioned=*"); + return http_response; +} + std::string QueryPermission(content::RenderFrameHost* render_frame_host) { return content::EvalJs(render_frame_host, kQueryStorageAccessPermission) .ExtractString(); @@ -317,6 +341,8 @@ return HandleRetryRequest(retry_path_fetch_count_, retry_allowed_origin_, request); })); + https_server_.RegisterRequestHandler( + base::BindRepeating(&PopinRequestHandler)); https_server_.RegisterRequestMonitor(base::BindLambdaForTesting( [&](const net::test_server::HttpRequest& request) { base::AutoLock lock(lock_); @@ -3485,6 +3511,412 @@ EXPECT_EQ(retry_path_fetch_count_, 1); } -// TODO(): Add test cases of 3PC enabled by other mechanisms. +class StorageAccessAPIWindowOpenTestBase + : public StorageAccessAPIBaseBrowserTest { + public: + void SetUpOnMainThread() override { + StorageAccessAPIBaseBrowserTest::SetUpOnMainThread(); + SetBlockThirdPartyCookies(!Are3PCEnabled()); + SetFirstPartyData(); + } + + void TearDownOnMainThread() override { + new_prompt_factory_.reset(); + StorageAccessAPIBaseBrowserTest::TearDownOnMainThread(); + } + + std::vector<base::test::FeatureRefAndParams> GetEnabledFeatures() override { + std::vector<base::test::FeatureRefAndParams> enabled_features( + {{blink::features::kPartitionedPopins, {}}}); + if (AreTrackingProtectionsEnabled()) { + enabled_features.emplace_back( + content_settings::features::kTrackingProtection3pcd, + base::FieldTrialParams{}); + } + return enabled_features; + } + + std::vector<base::test::FeatureRef> GetDisabledFeatures() override { + std::vector<base::test::FeatureRef> disabled_features; + if (!AreTrackingProtectionsEnabled()) { + disabled_features.emplace_back( + content_settings::features::kTrackingProtection3pcd); + } + return disabled_features; + } + + protected: + virtual bool Are3PCEnabled() const = 0; + + virtual bool AreTrackingProtectionsEnabled() const = 0; + + virtual bool ArePermissionPromptsAccepted() const = 0; + + virtual std::string MainFrameHost() const = 0; + + void SetupPromptFactoryForNewWebContents( + content::WebContents* new_web_contents) { + new_prompt_factory_ = + std::make_unique<permissions::MockPermissionPromptFactory>( + permissions::PermissionRequestManager::FromWebContents( + new_web_contents)); + new_prompt_factory_->set_response_type( + ArePermissionPromptsAccepted() + ? permissions::PermissionRequestManager::ACCEPT_ALL + : permissions::PermissionRequestManager::DENY_ALL); + } + + void ExpectNoStorageAccessGrants() { + EXPECT_THAT( + HostContentSettingsMapFactory::GetForProfile(browser()->profile()) + ->GetSettingsForOneType(ContentSettingsType::STORAGE_ACCESS), + UnorderedElementsAre(kExpectedSettingDefault)); + } + + void ExpectOneStorageAccessGrantFor(std::string_view frame_host, + std::string_view embedder_host) { + std::vector<ContentSettingPatternSource> settings = + HostContentSettingsMapFactory::GetForProfile(browser()->profile()) + ->GetSettingsForOneType(ContentSettingsType::STORAGE_ACCESS); + for (ContentSettingPatternSource& setting : settings) { + // We aren't trying to verify metadata so it's easier to clear it. + setting.metadata = content_settings::RuleMetaData(); + } + EXPECT_THAT( + settings, + UnorderedElementsAre( + kExpectedSettingDefault, + ContentSettingPatternSource( + ContentSettingsPattern::FromURLToSchemefulSitePattern( + GetURL(frame_host)), + ContentSettingsPattern::FromURLToSchemefulSitePattern( + GetURL(embedder_host)), + content_settings::ContentSettingToValue( + ArePermissionPromptsAccepted() ? CONTENT_SETTING_ALLOW + : CONTENT_SETTING_BLOCK), + content_settings::ProviderType::kPrefProvider, + /*incognito=*/false))); + } + + content::EvalJsResult DoesFrameHaveLocalStorageForHost( + content::RenderFrameHost* frame, + std::string_view host) { + return content::EvalJs( + frame, content::JsReplace("!!window.localStorage.getItem($1)", host)); + } + + content::EvalJsResult DoesFrameAllowRequestStorageAccessForHost( + content::RenderFrameHost* frame, + std::string_view host) { + return content::EvalJs( + frame, + content::JsReplace("document.requestStorageAccess(" + " {localStorage: true}" + ").then(" + " (handle) => !!handle &&" + " !!handle.localStorage.getItem($1)," + " () => false" + ")", + host)); + } + + private: + void SetFirstPartyData() { + NavigateToPage(kHostA, "/empty.html"); + EXPECT_TRUE(content::ExecJs( + GetPrimaryMainFrame(), + content::JsReplace("window.localStorage.setItem($1, $1);", kHostA))); + NavigateToPage(kHostB, "/empty.html"); + EXPECT_TRUE(content::ExecJs( + GetPrimaryMainFrame(), + content::JsReplace("window.localStorage.setItem($1, $1);", kHostB))); + NavigateToPage(kHostC, "/empty.html"); + EXPECT_TRUE(content::ExecJs( + GetPrimaryMainFrame(), + content::JsReplace("window.localStorage.setItem($1, $1);", kHostC))); + } + + std::unique_ptr<permissions::MockPermissionPromptFactory> new_prompt_factory_; +}; + +class StorageAccessAPIWindowOpenMainFrameTest + : public StorageAccessAPIWindowOpenTestBase, + public testing::WithParamInterface< + std::tuple<bool, bool, bool, std::string>> { + protected: + bool Are3PCEnabled() const override { return std::get<0>(GetParam()); } + + bool AreTrackingProtectionsEnabled() const override { + return std::get<1>(GetParam()); + } + + bool ArePermissionPromptsAccepted() const override { + return std::get<2>(GetParam()); + } + + std::string MainFrameHost() const override { return std::get<3>(GetParam()); } + + bool IsCrossOriginToOpenerFrame() const { return kHostA != MainFrameHost(); } +}; + +// Opens a popup and checks that the RSA call within the main frame fails. +IN_PROC_BROWSER_TEST_P(StorageAccessAPIWindowOpenMainFrameTest, + PopupRSAMainFrameTest) { + // Navigate to site a and open popup of site b. + NavigateToPage(kHostA, "/empty.html"); + content::WebContentsAddedObserver new_tab_observer; + content::TestNavigationObserver nav_observer(nullptr); + nav_observer.StartWatchingNewWebContents(); + EXPECT_TRUE(content::ExecJs( + browser()->tab_strip_model()->GetActiveWebContents(), + content::JsReplace("window.open($1, '_blank', 'popup')", + EchoCookiesURL(MainFrameHost()).spec()))); + content::WebContents* popup_web_contents = new_tab_observer.GetWebContents(); + nav_observer.Wait(); + SetupPromptFactoryForNewWebContents(popup_web_contents); + + // Expect first-party data for popup. + ASSERT_EQ(!IsCrossOriginToOpenerFrame(), + DoesFrameHaveLocalStorageForHost( + popup_web_contents->GetPrimaryMainFrame(), kHostA)); + ASSERT_EQ(IsCrossOriginToOpenerFrame(), + DoesFrameHaveLocalStorageForHost( + popup_web_contents->GetPrimaryMainFrame(), kHostB)); + EXPECT_EQ(ReadCookiesAndContent(popup_web_contents->GetPrimaryMainFrame(), + MainFrameHost()), + CookieBundleWithContent("cross-site=" + MainFrameHost())); + + // Expect no custom content settings related to storage access. + ExpectNoStorageAccessGrants(); + + // Expect no handle returned for popup. + EXPECT_EQ(false, + DoesFrameAllowRequestStorageAccessForHost( + popup_web_contents->GetPrimaryMainFrame(), MainFrameHost())); + + // Expect no custom content settings related to storage access. + ExpectNoStorageAccessGrants(); +} + +// Opens a popin and checks that the RSA call within the main frame can succeed. +IN_PROC_BROWSER_TEST_P(StorageAccessAPIWindowOpenMainFrameTest, + PopinRSAMainFrameTest) { + // Navigate to site a and open popin of site b. + NavigateToPage(kHostA, "/empty.html"); + content::WebContentsAddedObserver new_tab_observer; + content::TestNavigationObserver nav_observer(nullptr); + nav_observer.StartWatchingNewWebContents(); + EXPECT_TRUE(content::ExecJs( + browser()->tab_strip_model()->GetActiveWebContents(), + content::JsReplace( + "window.open($1 + '?allow_popins=true', '_blank', 'popin')", + GetURL(MainFrameHost(), "/empty.html").spec()))); + content::WebContents* popin_web_contents = new_tab_observer.GetWebContents(); + nav_observer.Wait(); + SetupPromptFactoryForNewWebContents(popin_web_contents); + + // Expect no first-party data for cross-origin popin. + ASSERT_EQ(!IsCrossOriginToOpenerFrame(), + DoesFrameHaveLocalStorageForHost( + popin_web_contents->GetPrimaryMainFrame(), kHostA)); + ASSERT_EQ(false, DoesFrameHaveLocalStorageForHost( + popin_web_contents->GetPrimaryMainFrame(), kHostB)); + + // Expect 3p cookies only if enabled. + // TODO(crbug.com/340606651): Popins are granting their own 1p cookie access + // via heuristics. This should be prevented, but would require changing a data + // structure so will likely not be done for the origin trial stage. + const auto& cookie_before = + ReadCookies(popin_web_contents->GetPrimaryMainFrame(), MainFrameHost()); + if (!IsCrossOriginToOpenerFrame() || Are3PCEnabled() || + AreTrackingProtectionsEnabled()) { + EXPECT_EQ(cookie_before, CookieBundle("cross-site=" + MainFrameHost())); + } else { + EXPECT_EQ(cookie_before, kNoCookies); + } + + // Expect no custom content settings related to storage access. + ExpectNoStorageAccessGrants(); + + // Expect handle returned for popin if the popin is same-origin, if it accepts + // all prompts, or if 3pc are enabled and tracking protection is disabled. + EXPECT_EQ(!IsCrossOriginToOpenerFrame() || ArePermissionPromptsAccepted() || + (Are3PCEnabled() && !AreTrackingProtectionsEnabled()), + DoesFrameAllowRequestStorageAccessForHost( + popin_web_contents->GetPrimaryMainFrame(), MainFrameHost())); + + // Expect 3p cookies added only if granted. + const auto& cookie_after = + ReadCookies(popin_web_contents->GetPrimaryMainFrame(), MainFrameHost()); + if (!IsCrossOriginToOpenerFrame() || Are3PCEnabled() || + AreTrackingProtectionsEnabled()) { + EXPECT_EQ(cookie_after, CookieBundle("cross-site=" + MainFrameHost())); + } else { + EXPECT_EQ(cookie_after, kNoCookies); + } + + // Expect custom content settings related to storage access if an explicit + // deny/allow occurred. + if (!IsCrossOriginToOpenerFrame() || + (Are3PCEnabled() && !AreTrackingProtectionsEnabled())) { + ExpectNoStorageAccessGrants(); + } else { + ExpectOneStorageAccessGrantFor(kHostB, kHostA); + } +} + +INSTANTIATE_TEST_SUITE_P( + /*no prefix*/, + StorageAccessAPIWindowOpenMainFrameTest, + testing::Combine(/*3pc_enabled=*/testing::Bool(), + /*tracking_protections_enabled=*/testing::Bool(), + /*permission_prompts_accepted=*/testing::Bool(), + /*main_frame_host=*/testing::Values(kHostA, kHostB)), + [](const testing::TestParamInfo<std::tuple<bool, bool, bool, std::string>>& + info) { + return base::StringPrintf( + "%s_%s_%s_main_%c", + std::get<0>(info.param) ? "3PCEnabled" : "3PCDisabled", + std::get<1>(info.param) ? "TrackingProtectionsEnabled" + : "TrackingProtectionsDisabled", + std::get<2>(info.param) ? "PermissionPromptsAccepted" + : "PermissionPromptsDenied", + std::get<3>(info.param)[0]); + }); + +class StorageAccessAPIWindowOpenSubFrameTest + : public StorageAccessAPIWindowOpenTestBase, + public testing::WithParamInterface< + std::tuple<bool, bool, bool, std::string, std::string>> { + protected: + bool Are3PCEnabled() const override { return std::get<0>(GetParam()); } + + bool AreTrackingProtectionsEnabled() const override { + return std::get<1>(GetParam()); + } + + bool ArePermissionPromptsAccepted() const override { + return std::get<2>(GetParam()); + } + + std::string MainFrameHost() const override { return std::get<3>(GetParam()); } + + std::string SubFrameHost() const { return std::get<4>(GetParam()); } + + bool IsCrossOriginToMainFrame() const { + return MainFrameHost() != SubFrameHost(); + } + + bool IsCrossOriginToOpenerFrame() const { return kHostA != SubFrameHost(); } + + bool IsCrossOriginToOpenerOrMainFrame() const { + return IsCrossOriginToMainFrame() || IsCrossOriginToOpenerFrame(); + } +}; + +// Opens a popin and checks that the RSA call within the sub frame can succeed. +IN_PROC_BROWSER_TEST_P(StorageAccessAPIWindowOpenSubFrameTest, + PopinRSASubFrameTest) { + // Navigate to site a and open popin. + NavigateToPage(kHostA, "/empty.html"); + content::WebContentsAddedObserver new_tab_observer; + content::TestNavigationObserver main_nav_observer(nullptr); + main_nav_observer.StartWatchingNewWebContents(); + EXPECT_TRUE(content::ExecJs( + browser()->tab_strip_model()->GetActiveWebContents(), + content::JsReplace( + "window.open($1 + '?allow_popins=true', '_blank', 'popin')", + GetURL(MainFrameHost(), "/empty.html").spec()))); + content::WebContents* popin_web_contents = new_tab_observer.GetWebContents(); + main_nav_observer.Wait(); + SetupPromptFactoryForNewWebContents(popin_web_contents); + + // Open a subframe in the popin. + content::TestNavigationObserver sub_nav_observer(popin_web_contents, 1); + EXPECT_TRUE(content::ExecJs( + popin_web_contents, + content::JsReplace("const iframe = document.createElement('iframe');" + "iframe.src = $1;" + "document.body.appendChild(iframe);", + GetURL(SubFrameHost(), "/title1.html").spec()))); + sub_nav_observer.Wait(); + content::RenderFrameHost* popin_sub_frame_host = + content::FrameMatchingPredicate( + popin_web_contents->GetPrimaryPage(), + base::BindRepeating([](content::RenderFrameHost* rfh) { + return rfh->GetLastCommittedURL().path_piece() == "/title1.html"; + })); + + // Expect no first-party data for cross-origin popin subframes. + ASSERT_EQ(!IsCrossOriginToOpenerOrMainFrame(), + DoesFrameHaveLocalStorageForHost(popin_sub_frame_host, kHostA)); + ASSERT_EQ(false, + DoesFrameHaveLocalStorageForHost(popin_sub_frame_host, kHostB)); + ASSERT_EQ(false, + DoesFrameHaveLocalStorageForHost(popin_sub_frame_host, kHostC)); + + // Expect 3p cookies only if enabled. + // TODO(crbug.com/340606651): Popins are granting their own 1p cookie access + // via heuristics. This should be prevented, but would require changing a data + // structure so will likely not be done for the origin trial stage. + const auto& cookie_before = ReadCookies(popin_sub_frame_host, SubFrameHost()); + if (!IsCrossOriginToOpenerOrMainFrame() || + (AreTrackingProtectionsEnabled() && !IsCrossOriginToMainFrame()) || + (Are3PCEnabled() && !AreTrackingProtectionsEnabled())) { + EXPECT_EQ(cookie_before, CookieBundle("cross-site=" + SubFrameHost())); + } else { + EXPECT_EQ(cookie_before, kNoCookies); + } + + // Expect no custom content settings related to storage access. + ExpectNoStorageAccessGrants(); + + // Expect handle returned for popin if subframe is same-origin, if it accepts + // all prompts, or if 3pc are enabled and tracking protection is disabled. + EXPECT_EQ(!IsCrossOriginToOpenerFrame() || ArePermissionPromptsAccepted() || + (Are3PCEnabled() && !AreTrackingProtectionsEnabled()), + DoesFrameAllowRequestStorageAccessForHost(popin_sub_frame_host, + SubFrameHost())); + + // Expect 3p cookies added only if granted. + const auto& cookie_after = ReadCookies(popin_sub_frame_host, SubFrameHost()); + if (!IsCrossOriginToOpenerOrMainFrame() || + (AreTrackingProtectionsEnabled() && !IsCrossOriginToMainFrame()) || + (Are3PCEnabled() && !AreTrackingProtectionsEnabled())) { + EXPECT_EQ(cookie_after, CookieBundle("cross-site=" + SubFrameHost())); + } else { + EXPECT_EQ(cookie_after, kNoCookies); + } + + // Expect custom content settings related to storage access if an explicit + // deny/allow occurred. + if (!IsCrossOriginToOpenerFrame() || + (Are3PCEnabled() && !AreTrackingProtectionsEnabled())) { + ExpectNoStorageAccessGrants(); + } else { + ExpectOneStorageAccessGrantFor(SubFrameHost(), kHostA); + } +} + +INSTANTIATE_TEST_SUITE_P( + /*no prefix*/, + StorageAccessAPIWindowOpenSubFrameTest, + testing::Combine( + /*3pc_enabled=*/testing::Bool(), + /*tracking_protections_enabled=*/testing::Bool(), + /*permission_prompts_accepted=*/testing::Bool(), + /*main_frame_host=*/testing::Values(kHostA, kHostB), + /*sub_frame_host=*/testing::Values(kHostA, kHostB, kHostC)), + [](const testing::TestParamInfo< + std::tuple<bool, bool, bool, std::string, std::string>>& info) { + return base::StringPrintf( + "%s_%s_%s_main_%c_sub_%c", + std::get<0>(info.param) ? "3PCEnabled" : "3PCDisabled", + std::get<1>(info.param) ? "TrackingProtectionsEnabled" + : "TrackingProtectionsDisabled", + std::get<2>(info.param) ? "PermissionPromptsAccepted" + : "PermissionPromptsDenied", + std::get<3>(info.param)[0], std::get<4>(info.param)[0]); + }); } // namespace
diff --git a/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc b/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc index 847f9fcb..79fd0a45 100644 --- a/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc +++ b/chrome/browser/storage_access_api/storage_access_grant_permission_context.cc
@@ -39,6 +39,7 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/browser/runtime_feature_state/runtime_feature_state_document_data.h" #include "content/public/browser/storage_partition.h" +#include "content/public/browser/web_contents.h" #include "content/public/common/content_features.h" #include "net/base/schemeful_site.h" #include "net/cookies/cookie_setting_override.h" @@ -337,6 +338,14 @@ CookieSettingsFactory::GetForProfile( Profile::FromBrowserContext(browser_context())); net::CookieSettingOverrides overrides = rfh->GetCookieSettingOverrides(); + if (rfh->ShouldPartitionAsPopin()) { + // TODO(crbug.com/340606651): Popins bypass the heuristics grant as + // otherwise, by virtue of having opened them, they would be granting + // themselves access. Ideally we would want to prevent popins from counting + // when grants are issued, but making a change to that database seems like + // a worse path given popins haven't yet reached origin trial. + overrides.Put(net::CookieSettingOverride::kSkipTPCDHeuristicsGrant); + } if (overrides.Has(net::CookieSettingOverride::kStorageAccessGrantEligible) || overrides.Has( net::CookieSettingOverride::kStorageAccessGrantEligibleViaHeader)) { @@ -540,8 +549,12 @@ content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, const GURL& embedding_origin) const { - // Permission query from top-level frame should be "granted" by default. - if (render_frame_host && render_frame_host->IsInPrimaryMainFrame()) { + // Permission query from top-level frame should be "granted" by default unless + // We are in a partitioned popin. Partitioned popins can be partitioned even + // as a top-frame, so need to continue. See + // https://explainers-by-googlers.github.io/partitioned-popins/ + if (render_frame_host && render_frame_host->IsInPrimaryMainFrame() && + !render_frame_host->ShouldPartitionAsPopin()) { return CONTENT_SETTING_ALLOW; } @@ -680,3 +693,13 @@ // permission being set and should not be called here. NOTREACHED(); } + +GURL StorageAccessGrantPermissionContext::GetEffectiveEmbedderOrigin( + content::RenderFrameHost* rfh) const { + if (!rfh->ShouldPartitionAsPopin()) { + return PermissionContextBase::GetEffectiveEmbedderOrigin(rfh); + } + content::WebContents* web_contents = + content::WebContents::FromRenderFrameHost(rfh); + return web_contents->GetPartitionedPopinEmbedderOrigin(PassKey()); +}
diff --git a/chrome/browser/storage_access_api/storage_access_grant_permission_context.h b/chrome/browser/storage_access_api/storage_access_grant_permission_context.h index ae7a109..fb7aad9 100644 --- a/chrome/browser/storage_access_api/storage_access_grant_permission_context.h +++ b/chrome/browser/storage_access_api/storage_access_grant_permission_context.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_STORAGE_ACCESS_API_STORAGE_ACCESS_GRANT_PERMISSION_CONTEXT_H_ #include "base/memory/weak_ptr.h" +#include "base/types/pass_key.h" #include "components/permissions/permission_context_base.h" #include "net/first_party_sets/first_party_set_metadata.h" @@ -66,6 +67,8 @@ class StorageAccessGrantPermissionContext : public permissions::PermissionContextBase { public: + using PassKey = base::PassKey<StorageAccessGrantPermissionContext>; + explicit StorageAccessGrantPermissionContext( content::BrowserContext* browser_context); @@ -106,6 +109,11 @@ ContentSetting content_setting, bool is_one_time) override; + // If the request is from a context partitioned as a popin we need to set + // the embedding origin to the popin opener's origin. + // See https://explainers-by-googlers.github.io/partitioned-popins/ + GURL GetEffectiveEmbedderOrigin(content::RenderFrameHost* rfh) const override; + // Internal implementation for NotifyPermissionSet. void NotifyPermissionSetInternal( const permissions::PermissionRequestID& id,
diff --git a/chrome/browser/task_manager/providers/web_contents/back_forward_cache_task.cc b/chrome/browser/task_manager/providers/web_contents/back_forward_cache_task.cc index 0ef7081..7042cea 100644 --- a/chrome/browser/task_manager/providers/web_contents/back_forward_cache_task.cc +++ b/chrome/browser/task_manager/providers/web_contents/back_forward_cache_task.cc
@@ -30,12 +30,14 @@ const GURL& site_url = site_instance->GetSiteURL(); const std::u16string name = base::UTF8ToUTF16(site_url.spec()); + const bool is_main_frame = !parent_task; int message_id; - if (!parent_task) { + if (is_main_frame) { message_id = is_incognito ? IDS_TASK_MANAGER_BACK_FORWARD_CACHE_INCOGNITO_PREFIX : IDS_TASK_MANAGER_BACK_FORWARD_CACHE_PREFIX; } else { + // Otherwise, it is a subframe. message_id = is_incognito ? IDS_TASK_MANAGER_BACK_FORWARD_CACHE_INCOGNITO_SUBFRAME_PREFIX @@ -44,7 +46,7 @@ return l10n_util::GetStringFUTF16(message_id, name); } -} // anonymous namespace +} // namespace namespace task_manager {
diff --git a/chrome/browser/task_manager/providers/web_contents/fenced_frame_task.cc b/chrome/browser/task_manager/providers/web_contents/fenced_frame_task.cc index 503c8bcf..7a98670 100644 --- a/chrome/browser/task_manager/providers/web_contents/fenced_frame_task.cc +++ b/chrome/browser/task_manager/providers/web_contents/fenced_frame_task.cc
@@ -40,9 +40,9 @@ } std::u16string FencedFrameTask::GetTitle() const { - const auto message_id = site_instance_->GetBrowserContext()->IsOffTheRecord() - ? IDS_TASK_MANAGER_FENCED_FRAME_INCOGNITO_PREFIX - : IDS_TASK_MANAGER_FENCED_FRAME_PREFIX; + const int message_id = site_instance_->GetBrowserContext()->IsOffTheRecord() + ? IDS_TASK_MANAGER_FENCED_FRAME_INCOGNITO_PREFIX + : IDS_TASK_MANAGER_FENCED_FRAME_PREFIX; const auto title = base::UTF8ToUTF16(site_instance_->GetSiteURL().spec()); return l10n_util::GetStringFUTF16(message_id, title); }
diff --git a/chrome/browser/task_manager/providers/web_contents/guest_task.cc b/chrome/browser/task_manager/providers/web_contents/guest_task.cc index 687a3a7..c7d3360 100644 --- a/chrome/browser/task_manager/providers/web_contents/guest_task.cc +++ b/chrome/browser/task_manager/providers/web_contents/guest_task.cc
@@ -21,8 +21,7 @@ } void GuestTask::UpdateFavicon() { - const gfx::ImageSkia* icon = GetFaviconFromWebContents(web_contents()); - set_icon(icon ? *icon : gfx::ImageSkia()); + DefaultUpdateFaviconImpl(); } Task::Type GuestTask::GetType() const { @@ -33,9 +32,7 @@ content::WebContents* web_contents) const { DCHECK(web_contents); - guest_view::GuestViewBase* guest = - guest_view::GuestViewBase::FromWebContents(web_contents); - + auto* guest = guest_view::GuestViewBase::FromWebContents(web_contents); if (!guest) { // This can happen when an AppWindowContentsImpl is destroyed. It emits a // DidFinishNavigation() events to the WebContentsObservers which triggers a @@ -44,11 +41,9 @@ return title(); } - std::u16string title = l10n_util::GetStringFUTF16( + return l10n_util::GetStringFUTF16( guest->GetTaskPrefix(), RendererTask::GetTitleFromWebContents(web_contents)); - - return title; } } // namespace task_manager
diff --git a/chrome/browser/task_manager/providers/web_contents/isolated_web_app_task.cc b/chrome/browser/task_manager/providers/web_contents/isolated_web_app_task.cc index b47bf61d..4b47138b 100644 --- a/chrome/browser/task_manager/providers/web_contents/isolated_web_app_task.cc +++ b/chrome/browser/task_manager/providers/web_contents/isolated_web_app_task.cc
@@ -70,9 +70,7 @@ } void IsolatedWebAppTask::UpdateFavicon() { - const gfx::ImageSkia* icon = - RendererTask::GetFaviconFromWebContents(web_contents()); - set_icon(icon ? *icon : gfx::ImageSkia()); + DefaultUpdateFaviconImpl(); } } // namespace task_manager
diff --git a/chrome/browser/task_manager/providers/web_contents/printing_task.cc b/chrome/browser/task_manager/providers/web_contents/printing_task.cc index 477a2b7d..f259cae 100644 --- a/chrome/browser/task_manager/providers/web_contents/printing_task.cc +++ b/chrome/browser/task_manager/providers/web_contents/printing_task.cc
@@ -30,9 +30,7 @@ } void PrintingTask::UpdateFavicon() { - const gfx::ImageSkia* icon = - RendererTask::GetFaviconFromWebContents(web_contents()); - set_icon(icon ? *icon : gfx::ImageSkia()); + DefaultUpdateFaviconImpl(); } } // namespace task_manager
diff --git a/chrome/browser/task_manager/providers/web_contents/renderer_task.cc b/chrome/browser/task_manager/providers/web_contents/renderer_task.cc index 5eb53b3..af0ddf1c 100644 --- a/chrome/browser/task_manager/providers/web_contents/renderer_task.cc +++ b/chrome/browser/task_manager/providers/web_contents/renderer_task.cc
@@ -80,12 +80,7 @@ renderer_resources_sampler_( CreateRendererResourcesSampler(render_process_host_)), render_process_id_(render_process_host_->GetDeprecatedID()), - v8_memory_allocated_(0), - v8_memory_used_(0), - webcache_stats_(blink::WebCacheResourceTypeStats()), - profile_name_(GetRendererProfileName(render_process_host_)), - termination_status_(base::TERMINATION_STATUS_STILL_RUNNING), - termination_error_code_(0) { + profile_name_(GetRendererProfileName(render_process_host_)) { OnNetworkBytesRead(0); // Tag the web_contents with a |ContentFaviconDriver| (if needed) so that @@ -251,4 +246,9 @@ return l10n_util::GetStringFUTF16(message_id, title); } +void RendererTask::DefaultUpdateFaviconImpl() { + const gfx::ImageSkia* icon = GetFaviconFromWebContents(web_contents()); + set_icon(icon ? *icon : gfx::ImageSkia()); +} + } // namespace task_manager
diff --git a/chrome/browser/task_manager/providers/web_contents/renderer_task.h b/chrome/browser/task_manager/providers/web_contents/renderer_task.h index df5e400..003f5c3 100644 --- a/chrome/browser/task_manager/providers/web_contents/renderer_task.h +++ b/chrome/browser/task_manager/providers/web_contents/renderer_task.h
@@ -103,6 +103,8 @@ bool is_incognito, bool is_background); + void DefaultUpdateFaviconImpl(); + private: RendererTask(const std::u16string& title, const gfx::ImageSkia* icon, @@ -110,10 +112,10 @@ content::RenderProcessHost* render_process_host); // The WebContents of the task this object represents. - raw_ptr<content::WebContents> web_contents_; + const raw_ptr<content::WebContents> web_contents_; // The render process host of the task this object represents. - raw_ptr<content::RenderProcessHost> render_process_host_; + const raw_ptr<content::RenderProcessHost> render_process_host_; // The Mojo service wrapper that will provide us with the V8 memory usage and // the WebCache resource stats of the render process represented by this @@ -124,18 +126,19 @@ const int render_process_id_; // The allocated and used V8 memory (in bytes). - int64_t v8_memory_allocated_; - int64_t v8_memory_used_; + int64_t v8_memory_allocated_ = 0; + int64_t v8_memory_used_ = 0; // The WebKit resource cache statistics for this renderer. - blink::WebCacheResourceTypeStats webcache_stats_; + blink::WebCacheResourceTypeStats webcache_stats_ = {}; // The profile name associated with the browser context of the render view // host. const std::u16string profile_name_; - base::TerminationStatus termination_status_; - int termination_error_code_; + base::TerminationStatus termination_status_ = + base::TERMINATION_STATUS_STILL_RUNNING; + int termination_error_code_ = 0; base::WeakPtrFactory<RendererTask> weak_ptr_factor_{this}; };
diff --git a/chrome/browser/task_manager/providers/web_contents/tab_contents_task.cc b/chrome/browser/task_manager/providers/web_contents/tab_contents_task.cc index 46674d3..b31d2f9e 100644 --- a/chrome/browser/task_manager/providers/web_contents/tab_contents_task.cc +++ b/chrome/browser/task_manager/providers/web_contents/tab_contents_task.cc
@@ -44,9 +44,7 @@ } void TabContentsTask::UpdateFavicon() { - const gfx::ImageSkia* icon = - RendererTask::GetFaviconFromWebContents(web_contents()); - set_icon(icon ? *icon : gfx::ImageSkia()); + DefaultUpdateFaviconImpl(); } Task::Type TabContentsTask::GetType() const {
diff --git a/chrome/browser/task_manager/providers/web_contents/tool_task.cc b/chrome/browser/task_manager/providers/web_contents/tool_task.cc index 6d067c8..625541a7 100644 --- a/chrome/browser/task_manager/providers/web_contents/tool_task.cc +++ b/chrome/browser/task_manager/providers/web_contents/tool_task.cc
@@ -14,7 +14,7 @@ std::u16string GetTitle(int tool_name) { if (tool_name == 0) { - return std::u16string(u""); + return std::u16string(); } return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_TOOL_PREFIX,
diff --git a/chrome/browser/task_manager/providers/web_contents/web_app_task.cc b/chrome/browser/task_manager/providers/web_contents/web_app_task.cc index d59397f..b41a3391 100644 --- a/chrome/browser/task_manager/providers/web_contents/web_app_task.cc +++ b/chrome/browser/task_manager/providers/web_contents/web_app_task.cc
@@ -26,9 +26,7 @@ } void WebAppTask::UpdateFavicon() { - const gfx::ImageSkia* icon = - RendererTask::GetFaviconFromWebContents(web_contents()); - set_icon(icon ? *icon : gfx::ImageSkia()); + DefaultUpdateFaviconImpl(); } std::u16string WebAppTask::GetPrefixedTitle(
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd index f320a29..1ce6e4c 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -6839,9 +6839,6 @@ <message name ="IDS_COLLABORATION_CANCEL" desc="The label for buttons that cancel any dialogs in data sharing."> Cancel </message> - <message name ="IDS_COLLABORATION_LOADING_BUTTON" desc="Accessibility string that describes the loading animation on a button after it is clicked when processing a request."> - Loading - </message> <!-- Misc --> <message name="IDS_SHARED_IMAGE_TILES_COUNT" desc="The count string for number of tiles that overflows from shared image tiles. |COUNT_NUMBER| will be a number between 1 and 99 (it will be 1-2 digits at most). [CHAR_LIMIT=3]">
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_COLLABORATION_LOADING_BUTTON.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_COLLABORATION_LOADING_BUTTON.png.sha1 deleted file mode 100644 index 33445f0..0000000 --- a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_COLLABORATION_LOADING_BUTTON.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -57d0e10c4b8c5057f7e92e532591350a132baa0b \ No newline at end of file
diff --git a/chrome/browser/ui/ash/capture_mode/BUILD.gn b/chrome/browser/ui/ash/capture_mode/BUILD.gn index ec65bea..5b6966f 100644 --- a/chrome/browser/ui/ash/capture_mode/BUILD.gn +++ b/chrome/browser/ui/ash/capture_mode/BUILD.gn
@@ -37,6 +37,7 @@ "//chrome/browser/lens/core/mojom:mojo_bindings", "//chrome/browser/policy:system_features_disable_list", "//chrome/browser/screen_ai/public:optical_character_recognizer", + "//chrome/browser/signin", "//chrome/browser/ui:browser_navigator_params_headers", "//chrome/browser/ui/ash/system_web_apps", "//chrome/browser/ui/ash/web_view", @@ -44,6 +45,7 @@ "//chrome/browser/ui/webui/ash/cloud_upload", "//chrome/browser/web_applications", "//chrome/common", + "//chromeos/ash/components/browser_context_helper", "//chromeos/ash/components/drivefs/mojom", "//chromeos/ash/components/login/login_state", "//chromeos/ash/experiences/screenshot_area",
diff --git a/chrome/browser/ui/ash/capture_mode/DEPS b/chrome/browser/ui/ash/capture_mode/DEPS index 8b5ab1ce..cd188eb 100644 --- a/chrome/browser/ui/ash/capture_mode/DEPS +++ b/chrome/browser/ui/ash/capture_mode/DEPS
@@ -28,6 +28,7 @@ "+chrome/browser/policy", "+chrome/browser/profiles", "+chrome/browser/screen_ai", + "+chrome/browser/signin", "+chrome/browser/ui/ash/screenshot_area.h", "+chrome/browser/ui/ash/system_web_apps", "+chrome/browser/ui/ash/web_view",
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 d1cf2b1a..4fe9ad5 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
@@ -49,11 +49,13 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/screen_ai/public/optical_character_recognizer.h" +#include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/ui/ash/capture_mode/lens_overlay_image_helper.h" #include "chrome/browser/ui/ash/capture_mode/search_results_view.h" #include "chrome/browser/ui/ash/system_web_apps/system_web_app_ui_utils.h" #include "chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h" #include "chrome/common/pref_names.h" +#include "chromeos/ash/components/browser_context_helper/browser_context_helper.h" #include "chromeos/ash/components/login/login_state/login_state.h" #include "chromeos/ash/experiences/screenshot_area/screenshot_area.h" #include "chromeos/ash/services/recording/public/mojom/recording_service.mojom.h" @@ -62,12 +64,14 @@ #include "components/lens/lens_overlay_permission_utils.h" #include "components/prefs/pref_service.h" #include "components/services/app_service/public/cpp/app_launch_util.h" +#include "components/signin/public/identity_manager/access_token_info.h" #include "content/public/browser/audio_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/download_manager.h" #include "content/public/browser/network_service_instance.h" #include "content/public/browser/service_process_host.h" #include "content/public/browser/video_capture_service.h" +#include "google_apis/gaia/gaia_constants.h" #include "services/network/public/cpp/network_connection_tracker.h" #include "services/screen_ai/public/mojom/screen_ai_service.mojom.h" #include "services/video_capture/public/mojom/video_capture_service.mojom.h" @@ -82,6 +86,8 @@ ChromeCaptureModeDelegate* g_instance = nullptr; +constexpr char kConsumerName[] = "ChromeCaptureModeDelegate"; + ScreenshotArea ConvertToScreenshotArea(const aura::Window* window, const gfx::Rect& bounds) { return window->IsRootWindow() @@ -582,6 +588,36 @@ /*region_bytes=*/image); } +void ChromeCaptureModeDelegate::GetPrimaryAccountAccessToken( + base::RepeatingCallback<void(const std::string& access_token)> callback) { + const user_manager::User* const primary_user = + user_manager::UserManager::Get()->GetPrimaryUser(); + DCHECK(primary_user); + + Profile* profile = Profile::FromBrowserContext( + ash::BrowserContextHelper::Get()->GetBrowserContextByUser(primary_user)); + signin::IdentityManager* identity_manager = + IdentityManagerFactory::GetForProfile(profile); + + if (!identity_manager || + !identity_manager->HasPrimaryAccount(signin::ConsentLevel::kSignin)) { + // TODO: crbug.com/399914333 - Determine error handling for the access + // token. + return; + } + + signin::ScopeSet scopes; + scopes.insert(GaiaConstants::kSupportContentOAuth2Scope); + primary_account_token_fetcher_ = + std::make_unique<signin::PrimaryAccountAccessTokenFetcher>( + kConsumerName, identity_manager, scopes, + base::BindOnce( + &ChromeCaptureModeDelegate::PrimaryAccountAccessTokenAvailable, + base::Unretained(this), std::move(callback)), + signin::PrimaryAccountAccessTokenFetcher::Mode::kImmediate, + signin::ConsentLevel::kSignin); +} + void ChromeCaptureModeDelegate::SendMultimodalSearch( const SkBitmap& image, const gfx::Rect& region, @@ -752,3 +788,21 @@ std::move(pending_ocr_request_callback_).Run(std::nullopt); } } + +void ChromeCaptureModeDelegate::PrimaryAccountAccessTokenAvailable( + base::RepeatingCallback<void(const std::string& access_token)> callback, + GoogleServiceAuthError error, + signin::AccessTokenInfo access_token_info) { + // Reset token fetcher for the next request. + DCHECK(primary_account_token_fetcher_); + primary_account_token_fetcher_.reset(); + + if (error.state() != GoogleServiceAuthError::NONE) { + // TODO: crbug.com/399914333 - Determine error handling for the access + // token. + return; + } + + DCHECK(!access_token_info.token.empty()); + std::move(callback).Run(access_token_info.token); +}
diff --git a/chrome/browser/ui/ash/capture_mode/chrome_capture_mode_delegate.h b/chrome/browser/ui/ash/capture_mode/chrome_capture_mode_delegate.h index a8ff537d..d67a96b 100644 --- a/chrome/browser/ui/ash/capture_mode/chrome_capture_mode_delegate.h +++ b/chrome/browser/ui/ash/capture_mode/chrome_capture_mode_delegate.h
@@ -116,6 +116,9 @@ std::unique_ptr<ash::AshWebView> CreateSearchResultsView() const override; void DetectTextInImage(const SkBitmap& image, ash::OnTextDetectionComplete callback) override; + void GetPrimaryAccountAccessToken( + base::RepeatingCallback<void(const std::string& access_token)> callback) + override; void SendRegionSearch(const SkBitmap& image, const gfx::Rect& region, ash::OnSearchUrlFetchedCallback search_callback, @@ -172,6 +175,11 @@ // Releases the OCR handle and resets pending OCR requests. void ResetOcr(); + void PrimaryAccountAccessTokenAvailable( + base::RepeatingCallback<void(const std::string& access_token)> callback, + GoogleServiceAuthError error, + signin::AccessTokenInfo access_token_info); + // Used to temporarily disable capture mode in certain cases for which neither // a device policy, nor DLP will be triggered. For example, Some extension // APIs can request that a tab operate in a locked fullscreen mode, and in @@ -218,6 +226,9 @@ SEQUENCE_CHECKER(sequence_checker_); + std::unique_ptr<signin::PrimaryAccountAccessTokenFetcher> + primary_account_token_fetcher_; + std::unique_ptr<LensOverlayQueryController> lens_overlay_query_controller_; base::WeakPtrFactory<ChromeCaptureModeDelegate> weak_ptr_factory_{this};
diff --git a/chrome/browser/ui/browser_window/browser_window_features.cc b/chrome/browser/ui/browser_window/browser_window_features.cc index 0cdf3de..d345c50a 100644 --- a/chrome/browser/ui/browser_window/browser_window_features.cc +++ b/chrome/browser/ui/browser_window/browser_window_features.cc
@@ -303,6 +303,10 @@ if (shared_tab_group_feedback_controller_) { shared_tab_group_feedback_controller_->TearDown(); } + + if (chrome_labs_coordinator_) { + chrome_labs_coordinator_->TearDown(); + } } SidePanelUI* BrowserWindowFeatures::side_panel_ui() {
diff --git a/chrome/browser/ui/lens/lens_overlay_gen204_controller.cc b/chrome/browser/ui/lens/lens_overlay_gen204_controller.cc index 606bbcf..a639b81 100644 --- a/chrome/browser/ui/lens/lens_overlay_gen204_controller.cc +++ b/chrome/browser/ui/lens/lens_overlay_gen204_controller.cc
@@ -58,7 +58,10 @@ constexpr char kInteractionFetchLatencyId[] = "lif"; constexpr char kFetchStickyClusterInfoLatencyId[] = "sctr"; constexpr char kInvocationToInitialClusterInfoRequestLatencyId[] = "cstcirs"; -constexpr char kInvocationToInitialFullObjectsRequestLatencyId[] = "cstiors"; +constexpr char kInvocationToInitialFullObjectsRequestSentLatencyId[] = + "cstiors"; +constexpr char kInvocationToInitialFullObjectsResponseReceivedLatencyId[] = + "cstiorr"; constexpr char kInvocationToInitialInteractionRequestLatencyId[] = "cstiirs"; constexpr char kInvocationToInitialPageContentRequestLatencyId[] = "cstipcurs"; constexpr char kInvocationToInitialPartialPageContentRequestLatencyId[] = @@ -118,7 +121,9 @@ case LatencyType::kInvocationToInitialClusterInfoRequestSent: return kInvocationToInitialClusterInfoRequestLatencyId; case LatencyType::kInvocationToInitialFullPageObjectsRequestSent: - return kInvocationToInitialFullObjectsRequestLatencyId; + return kInvocationToInitialFullObjectsRequestSentLatencyId; + case LatencyType::kInvocationToInitialFullPageObjectsResponseReceived: + return kInvocationToInitialFullObjectsResponseReceivedLatencyId; case LatencyType::kInvocationToInitialInteractionRequestSent: return kInvocationToInitialInteractionRequestLatencyId; case LatencyType::kInvocationToInitialPageContentRequestSent:
diff --git a/chrome/browser/ui/lens/lens_overlay_gen204_controller.h b/chrome/browser/ui/lens/lens_overlay_gen204_controller.h index 53bfcab..69b33ed 100644 --- a/chrome/browser/ui/lens/lens_overlay_gen204_controller.h +++ b/chrome/browser/ui/lens/lens_overlay_gen204_controller.h
@@ -31,6 +31,10 @@ // objects request was sent. kInvocationToInitialFullPageObjectsRequestSent = 1, + // From when the overlay was invoked to when the initial full page + // objects response was received. + kInvocationToInitialFullPageObjectsResponseReceived = 10, + // From when the overlay was invoked to when the initial interaction // request was sent. kInvocationToInitialInteractionRequestSent = 2,
diff --git a/chrome/browser/ui/lens/lens_overlay_query_controller.cc b/chrome/browser/ui/lens/lens_overlay_query_controller.cc index 5019864..5f610f4 100644 --- a/chrome/browser/ui/lens/lens_overlay_query_controller.cc +++ b/chrome/browser/ui/lens/lens_overlay_query_controller.cc
@@ -1792,6 +1792,11 @@ base::TimeTicks start_time_ticks, bool is_translate_query, std::string vit_query_param_value) { + SendInitialLatencyGen204IfNotAlreadySent( + LatencyType::kInvocationToInitialFullPageObjectsResponseReceived, + vit_query_param_value, + *latest_full_image_request_data_->request_id_.get()); + SendLatencyGen204IfEnabled( is_translate_query ? lens::LensOverlayGen204Controller::LatencyType:: kFullPageTranslateRequestFetchLatency
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 8897d484..5e4060d4 100644 --- a/chrome/browser/ui/lens/lens_overlay_query_controller_unittest.cc +++ b/chrome/browser/ui/lens/lens_overlay_query_controller_unittest.cc
@@ -490,6 +490,10 @@ ASSERT_EQ(query_controller.latency_gen_204_counter( LatencyType::kInvocationToInitialFullPageObjectsRequestSent), 1); + ASSERT_EQ( + query_controller.latency_gen_204_counter( + LatencyType::kInvocationToInitialFullPageObjectsResponseReceived), + 1); ASSERT_EQ(query_controller.sent_client_logs().lens_overlay_entry_point(), lens::LensOverlayClientLogs::APP_MENU); ASSERT_TRUE(query_controller.sent_client_logs().has_paella_id());
diff --git a/chrome/browser/ui/performance_controls/performance_intervention_button_controller.cc b/chrome/browser/ui/performance_controls/performance_intervention_button_controller.cc index 45b64af6..07ce7a4 100644 --- a/chrome/browser/ui/performance_controls/performance_intervention_button_controller.cc +++ b/chrome/browser/ui/performance_controls/performance_intervention_button_controller.cc
@@ -199,9 +199,7 @@ RecordInterventionTriggerResult(type, trigger_result); - if (trigger_result == InterventionMessageTriggerResult::kShown && - base::FeatureList::IsEnabled( - performance_manager::features::kPerformanceInterventionUI)) { + if (trigger_result == InterventionMessageTriggerResult::kShown) { delegate_->Show(); } }
diff --git a/chrome/browser/ui/safety_hub/disruptive_notification_permissions_manager.cc b/chrome/browser/ui/safety_hub/disruptive_notification_permissions_manager.cc index 75a6c00e..d5dc323 100644 --- a/chrome/browser/ui/safety_hub/disruptive_notification_permissions_manager.cc +++ b/chrome/browser/ui/safety_hub/disruptive_notification_permissions_manager.cc
@@ -7,6 +7,8 @@ #include "base/containers/map_util.h" #include "base/json/values_util.h" #include "base/metrics/histogram_functions.h" +#include "base/metrics/histogram_macros.h" +#include "base/metrics/user_metrics.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/safety_hub/safety_hub_constants.h" @@ -66,6 +68,7 @@ ~DisruptiveNotificationPermissionsManager() = default; void DisruptiveNotificationPermissionsManager::RevokeDisruptiveNotifications() { + int revoked_sites_count = 0; ContentSetting default_notification_setting = hcsm_->GetDefaultContentSetting(ContentSettingsType::NOTIFICATIONS); @@ -132,10 +135,15 @@ if (!recorded_score.has_value()) { continue; } - if (recorded_score.value() < site_engagement_service_->GetScore(url)) { + const double new_score = site_engagement_service_->GetScore(url); + if (recorded_score.value() < new_score) { dict.Set(safety_hub::kRevokedStatusDictKeyStr, safety_hub::kFalsePositiveStr); UpdateContentSettingValue(hcsm_, url, info, std::move(dict)); + UMA_HISTOGRAM_COUNTS_100( + "Settings.SafetyHub.DisruptiveNotificationRevocations." + "FalsePositive.SiteEngagement", + new_score); base::UmaHistogramEnumeration(kRevocationResultHistogram, RevocationResult::kFalsePositive); } else { @@ -167,9 +175,18 @@ default_constraint.set_lifetime(safety_hub_util::GetCleanUpThreshold()); StoreRevokedDisruptiveNotificationPermission(url, default_constraint, *notification_count); + UMA_HISTOGRAM_COUNTS_100( + "Settings.SafetyHub.DisruptiveNotificationRevocations.Proposed." + "NotificationCount", + *notification_count); base::UmaHistogramEnumeration(kRevocationResultHistogram, RevocationResult::kRevoke); + revoked_sites_count++; } + UMA_HISTOGRAM_COUNTS_100( + "Settings.SafetyHub.DisruptiveNotificationRevocations." + "RevokedWebsitesCount", + revoked_sites_count); } bool DisruptiveNotificationPermissionsManager::IsNotificationDisruptive(
diff --git a/chrome/browser/ui/safety_hub/disruptive_notification_permissions_manager_unittest.cc b/chrome/browser/ui/safety_hub/disruptive_notification_permissions_manager_unittest.cc index 532ef04..2328a3a 100644 --- a/chrome/browser/ui/safety_hub/disruptive_notification_permissions_manager_unittest.cc +++ b/chrome/browser/ui/safety_hub/disruptive_notification_permissions_manager_unittest.cc
@@ -28,6 +28,14 @@ constexpr char kRevocationResultHistogram[] = "Settings.SafetyHub.DisruptiveNotificationRevocations.RevocationResult"; +constexpr char kNotificationCountHistogram[] = + "Settings.SafetyHub.DisruptiveNotificationRevocations.Proposed." + "NotificationCount"; +constexpr char kRevokedWebsitesCountHistogram[] = + "Settings.SafetyHub.DisruptiveNotificationRevocations.RevokedWebsitesCount"; +constexpr char kFalsePositiveSiteEngagementHistogram[] = + "Settings.SafetyHub.DisruptiveNotificationRevocations.FalsePositive." + "SiteEngagement"; } // namespace @@ -101,6 +109,8 @@ dict.FindInt(safety_hub::kDailyNotificationCountStr).value_or(0)); t.ExpectBucketCount(kRevocationResultHistogram, RevocationResult::kRevoke, 1); + t.ExpectBucketCount(kRevokedWebsitesCountHistogram, 1, 1); + t.ExpectBucketCount(kNotificationCountHistogram, 3, 1); manager()->RevokeDisruptiveNotifications(); EXPECT_EQ(GetRevokedPermissionsCount(), 1); @@ -109,6 +119,35 @@ RevocationResult::kAlreadyInRevokeList, 1); } +TEST_F(DisruptiveNotificationPermissionsManagerTest, RevokedWebsitesCount) { + base::HistogramTester t; + + GURL first_url("https://www.example.com"); + SetNotificationPermission(first_url, CONTENT_SETTING_ALLOW); + SetDailyAverageNotificationCount(first_url, 3); + site_engagement_service()->ResetBaseScoreForURL(first_url, 0); + + GURL second_url("https://www.chrome.com"); + SetNotificationPermission(second_url, CONTENT_SETTING_ALLOW); + SetDailyAverageNotificationCount(second_url, 1); + site_engagement_service()->ResetBaseScoreForURL(second_url, 0); + + GURL third_url("https://www.anothersite.com"); + SetNotificationPermission(third_url, CONTENT_SETTING_ALLOW); + SetDailyAverageNotificationCount(third_url, 3); + site_engagement_service()->ResetBaseScoreForURL(third_url, 0); + + manager()->RevokeDisruptiveNotifications(); + + EXPECT_EQ(GetRevokedPermissionsCount(), 2); + + t.ExpectBucketCount(kRevocationResultHistogram, RevocationResult::kRevoke, 2); + t.ExpectBucketCount(kRevocationResultHistogram, + RevocationResult::kNotDisruptive, 1); + t.ExpectBucketCount(kRevokedWebsitesCountHistogram, 2, 1); + t.ExpectBucketCount(kNotificationCountHistogram, 3, 2); +} + TEST_F(DisruptiveNotificationPermissionsManagerTest, DontRevokePermissionHighEngagement) { base::HistogramTester t; @@ -277,6 +316,7 @@ t.ExpectBucketCount(kRevocationResultHistogram, RevocationResult::kFalsePositive, 1); + t.ExpectBucketCount(kFalsePositiveSiteEngagementHistogram, 5, 1); } TEST_F(DisruptiveNotificationPermissionsManagerTest, ProposedMetrics) {
diff --git a/chrome/browser/ui/search_engines/template_url_table_model.cc b/chrome/browser/ui/search_engines/template_url_table_model.cc index 923add97..258ab63 100644 --- a/chrome/browser/ui/search_engines/template_url_table_model.cc +++ b/chrome/browser/ui/search_engines/template_url_table_model.cc
@@ -116,8 +116,11 @@ for (TemplateURL* template_url : urls) { // Don't include the expanded set of starter pack keywords if the expansion // feature flag is not enabled. - if (!OmniboxFieldTrial::IsStarterPackExpansionEnabled() && - template_url->starter_pack_id() > TemplateURLStarterPackData::kTabs) { + if ((template_url->starter_pack_id() == + TemplateURLStarterPackData::kGemini && + !OmniboxFieldTrial::IsStarterPackExpansionEnabled()) || + (template_url->starter_pack_id() == TemplateURLStarterPackData::kPage && + !OmniboxFieldTrial::IsStarterPackPageEnabled())) { continue; }
diff --git a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h index 996ff02..f5bc2a73 100644 --- a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h +++ b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h
@@ -37,23 +37,23 @@ // Signals that `id` has been added to the model. This will // *only* be called after the model has been initialized. N.B. Direct pref // updates which happen to add an action WILL NOT call this method. - virtual void OnActionAddedLocally(const actions::ActionId& id) = 0; + virtual void OnActionAddedLocally(const actions::ActionId& id) {} // Signals that the given action with `id` has been removed from the // model. N.B. Direct pref updates which happen to remove an action WILL NOT // call this method. - virtual void OnActionRemovedLocally(const actions::ActionId& id) = 0; + virtual void OnActionRemovedLocally(const actions::ActionId& id) {} // Signals that the given action with `id` has been moved in the model. // N.B. Direct pref updates which happen to move an action WILL NOT call // this method. virtual void OnActionMovedLocally(const actions::ActionId& id, int from_index, - int to_index) = 0; + int to_index) {} // Called when the pinned actions change, in any way for any reason. Unlike // the above methods, this does include pref updates. - virtual void OnActionsChanged() = 0; + virtual void OnActionsChanged() {} protected: virtual ~Observer() = default;
diff --git a/chrome/browser/ui/views/autofill/payments/autofill_error_dialog_view_native_views_browsertest.cc b/chrome/browser/ui/views/autofill/payments/autofill_error_dialog_view_native_views_browsertest.cc index 6ce20e79..6b183ee6 100644 --- a/chrome/browser/ui/views/autofill/payments/autofill_error_dialog_view_native_views_browsertest.cc +++ b/chrome/browser/ui/views/autofill/payments/autofill_error_dialog_view_native_views_browsertest.cc
@@ -52,6 +52,9 @@ } else if (name.find("permanent") != std::string::npos) { autofill_error_dialog_context.type = AutofillErrorDialogType::kVirtualCardPermanentError; + } else if (name.find("bnpl") != std::string::npos) { + autofill_error_dialog_context.type = + AutofillErrorDialogType::kBnplPermanentError; } else { CHECK_NE(name.find("eligibility"), std::string::npos); autofill_error_dialog_context.type = @@ -166,6 +169,28 @@ : 0))); } +// Verify that the dialog is shown, and the metrics for shown are incremented +// correctly for a BNPL error. +IN_PROC_BROWSER_TEST_P(AutofillErrorDialogViewNativeViewsBrowserTest, + InvokeUi_bnpl) { + base::HistogramTester histogram_tester; + + ShowAndVerifyUi(); + + // Verify that the metric for shown is incremented. + EXPECT_THAT(histogram_tester.GetAllSamples("Autofill.ErrorDialogShown"), + BucketsAre(base::Bucket( + AutofillErrorDialogType::kBnplPermanentError, 1))); + EXPECT_THAT( + histogram_tester.GetAllSamples( + "Autofill.ErrorDialogShown.WithServerText"), + BucketsAre(base::Bucket( + AutofillErrorDialogType::kBnplPermanentError, + /*count=*/server_did_return_title() && server_did_return_description() + ? 1 + : 0))); +} + // Ensures closing current tab while dialog being visible is correctly handled, // and the metrics for shown are incremented correctly. IN_PROC_BROWSER_TEST_P(AutofillErrorDialogViewNativeViewsBrowserTest,
diff --git a/chrome/browser/ui/views/autofill/payments/save_card_bubble_views_browsertest.cc b/chrome/browser/ui/views/autofill/payments/save_card_bubble_views_browsertest.cc index 0adf1b2d..fe7fbca 100644 --- a/chrome/browser/ui/views/autofill/payments/save_card_bubble_views_browsertest.cc +++ b/chrome/browser/ui/views/autofill/payments/save_card_bubble_views_browsertest.cc
@@ -28,10 +28,12 @@ #include "chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" +#include "chrome/browser/ui/browser_element_identifiers.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/location_bar/location_bar.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/views/autofill/payments/dialog_view_ids.h" +#include "chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.h" #include "chrome/browser/ui/views/autofill/payments/save_payment_icon_view.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" @@ -83,6 +85,7 @@ #include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" #include "services/network/test/test_url_loader_factory.h" #include "testing/gmock/include/gmock/gmock.h" +#include "ui/base/interaction/element_identifier.h" #include "ui/base/l10n/l10n_util.h" #include "ui/events/base_event_utils.h" #include "ui/views/bubble/bubble_frame_view.h" @@ -92,6 +95,7 @@ #include "ui/views/controls/styled_label.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/throbber.h" +#include "ui/views/interaction/element_tracker_views.h" #include "ui/views/layout/animating_layout_manager.h" #include "ui/views/layout/animating_layout_manager_test_util.h" #include "ui/views/test/ax_event_counter.h" @@ -676,7 +680,8 @@ EXPECT_FALSE(GetSaveCardBubbleViews()); } - void ClickOnDialogViewWithId(DialogViewId view_id) { + template <typename IdType> + void ClickOnDialogViewWithId(IdType view_id) { ClickOnDialogView(FindViewInBubbleById(view_id)); } @@ -713,6 +718,15 @@ return specified_view; } + views::View* FindViewInBubbleById(ui::ElementIdentifier element_identifier) { + SaveCardBubbleViews* save_card_bubble_views = GetSaveCardBubbleViews(); + CHECK(save_card_bubble_views); + + return views::ElementTrackerViews::GetInstance()->GetFirstMatchingView( + element_identifier, views::ElementTrackerViews::GetContextForWidget( + save_card_bubble_views->GetWidget())); + } + void ClickOnCancelButton() { SaveCardBubbleViews* save_card_bubble_views = GetSaveCardBubbleViews(); CHECK(save_card_bubble_views); @@ -943,7 +957,8 @@ ASSERT_TRUE(WaitForObservedEvent()); // Click on the redirect button. - ClickOnDialogViewWithId(DialogViewId::MANAGE_CARDS_BUTTON); + ClickOnDialogViewWithId( + SaveCardManageCardsBubbleViews::kSaveCardBubbleManageCardsButtonId); } private: @@ -2230,7 +2245,9 @@ // Bubble should be showing. EXPECT_TRUE( - FindViewInBubbleById(DialogViewId::MANAGE_CARDS_VIEW)->GetVisible()); + FindViewInBubbleById( + SaveCardManageCardsBubbleViews::kSaveCardBubbleManageCardsViewId) + ->GetVisible()); histogram_tester.ExpectUniqueSample( "Autofill.ManageCardsPrompt", ManageCardsPromptMetric::kManageCardsShown, 1);
diff --git a/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.cc b/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.cc index 6e68289d..0d49f0f 100644 --- a/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.cc +++ b/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.cc
@@ -8,19 +8,27 @@ #include "build/build_config.h" #include "chrome/browser/ui/browser_dialogs.h" +#include "chrome/browser/ui/browser_element_identifiers.h" #include "chrome/browser/ui/views/autofill/payments/dialog_view_ids.h" #include "chrome/browser/ui/views/chrome_typography.h" #include "components/signin/public/base/signin_metrics.h" #include "components/strings/grit/components_strings.h" +#include "ui/base/interaction/element_identifier.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/mojom/dialog_button.mojom.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" +#include "ui/views/view_class_properties.h" namespace autofill { +DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(SaveCardManageCardsBubbleViews, + kSaveCardBubbleManageCardsViewId); +DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(SaveCardManageCardsBubbleViews, + kSaveCardBubbleManageCardsButtonId); + SaveCardManageCardsBubbleViews::SaveCardManageCardsBubbleViews( views::View* anchor_view, content::WebContents* web_contents, @@ -35,9 +43,8 @@ }, base::Unretained(this)), l10n_util::GetStringUTF16(IDS_AUTOFILL_MANAGE_SAVED_PAYMENT_METHODS))); - // TODO(crbug.com/391160867): Use ElementIdentifiers instead of arbitrary - // numeric ID. - extra_view->SetID(DialogViewId::MANAGE_CARDS_BUTTON); + extra_view->SetProperty(views::kElementIdentifierKey, + kSaveCardBubbleManageCardsButtonId); extra_view->SetStyle(ui::ButtonStyle::kTonal); } @@ -45,7 +52,8 @@ SaveCardManageCardsBubbleViews::CreateMainContentView() { std::unique_ptr<views::View> view = SaveCardBubbleViews::CreateMainContentView(); - view->SetID(DialogViewId::MANAGE_CARDS_VIEW); + view->SetProperty(views::kElementIdentifierKey, + kSaveCardBubbleManageCardsViewId); return view; }
diff --git a/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.h b/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.h index 036176ab..c550a41 100644 --- a/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.h +++ b/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.h
@@ -19,6 +19,9 @@ class SaveCardManageCardsBubbleViews : public SaveCardBubbleViews { METADATA_HEADER(SaveCardManageCardsBubbleViews, SaveCardBubbleViews) public: + DECLARE_CLASS_ELEMENT_IDENTIFIER_VALUE(kSaveCardBubbleManageCardsButtonId); + DECLARE_CLASS_ELEMENT_IDENTIFIER_VALUE(kSaveCardBubbleManageCardsViewId); + // Bubble will be anchored to |anchor_view|. SaveCardManageCardsBubbleViews(views::View* anchor_view, content::WebContents* web_contents,
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc index a22aedea..442d1b1 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.cc
@@ -20,6 +20,8 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/base/resource/resource_bundle.h" #include "ui/views/accessibility/view_accessibility.h" +#include "ui/views/border.h" +#include "ui/views/layout/table_layout.h" #include "ui/views/view_utils.h" #if BUILDFLAG(IS_CHROMEOS) @@ -30,7 +32,8 @@ namespace { -const int kDesktopMediaSourceViewGroupId = 1; +constexpr int kDesktopMediaSourceViewGroupId = 1; +constexpr int kItemSpacing = 4; #if BUILDFLAG(IS_CHROMEOS) // Here we are going to display default app icon for app windows without an @@ -58,6 +61,13 @@ return static_cast<DesktopMediaSourceView*>(view); } +// Returns the number of rows, each of size `num_columns`, required to display +// `num_elements`. +size_t NumRows(size_t num_elements, size_t num_columns) { + CHECK_GT(num_columns, 0u); + return (num_elements + num_columns - 1) / num_columns; +} + } // namespace DesktopMediaListView::DesktopMediaListView( @@ -65,14 +75,12 @@ DesktopMediaSourceViewStyle generic_style, DesktopMediaSourceViewStyle single_style, const std::u16string& accessible_name) - : item_spacing_(4), - horizontal_margins_(16), - vertical_margins_(16), - controller_(controller), + : controller_(controller), single_style_(single_style), - generic_style_(generic_style), - active_style_(&single_style_) { - SetStyle(&single_style_); + generic_style_(generic_style) { + SetBorder(views::CreateEmptyBorder(16)); + SetLayoutManager(std::make_unique<views::TableLayout>()); + SetStyle(single_style_); GetViewAccessibility().SetRole(ax::mojom::Role::kGroup); GetViewAccessibility().SetName(accessible_name); @@ -84,47 +92,14 @@ controller_->OnSourceSelectionChanged(); } -gfx::Size DesktopMediaListView::CalculatePreferredSize( - const views::SizeBounds& /*available_size*/) const { - const int total_rows = - (static_cast<int>(children().size()) + active_style_->columns - 1) / - active_style_->columns; - return gfx::Size(active_style_->columns * active_style_->item_size.width() + - (active_style_->columns - 1) * item_spacing_ + - 2 * horizontal_margins_, - total_rows * active_style_->item_size.height() + - (total_rows - 1) * item_spacing_ + - 2 * vertical_margins_); -} - -void DesktopMediaListView::Layout(PassKey) { - // Children lay out in a grid, all with the same size and without padding. - const int width = active_style_->item_size.width(); - const int height = active_style_->item_size.height(); - auto i = children().begin(); - // Child order is left-to-right, top-to-bottom, so lay out row-major. The - // last row may not be full, so the inner loop will need to be careful about - // the child count anyway, so don't bother to compute a row count. - for (int y = 0;; y += (height + item_spacing_)) { - for (int x = 0, col = 0; col < active_style_->columns; - ++col, x += (width + item_spacing_)) { - if (i == children().end()) { - return; - } - (*i++)->SetBounds(x + horizontal_margins_, y + vertical_margins_, width, - height); - } - } -} - bool DesktopMediaListView::OnKeyPressed(const ui::KeyEvent& event) { int position_increment = 0; switch (event.key_code()) { case ui::VKEY_UP: - position_increment = -active_style_->columns; + position_increment = -static_cast<int>(active_style_.columns); break; case ui::VKEY_DOWN: - position_increment = active_style_->columns; + position_increment = static_cast<int>(active_style_.columns); break; case ui::VKEY_LEFT: position_increment = -1; @@ -136,9 +111,7 @@ return false; } - if (position_increment == 0) { - return false; - } + CHECK_NE(position_increment, 0); views::View* selected = GetSelectedView(); views::View* new_selected = nullptr; @@ -187,13 +160,8 @@ void DesktopMediaListView::OnSourceAdded(size_t index) { const DesktopMediaList::Source& source = controller_->GetSource(index); - // We are going to have a second item, apply the generic style. - if (children().size() == 1) { - SetStyle(&generic_style_); - } - DesktopMediaSourceView* source_view = - new DesktopMediaSourceView(this, source.id, *active_style_); + new DesktopMediaSourceView(this, source.id, active_style_); source_view->SetName(source.name); source_view->SetGroup(kDesktopMediaSourceViewGroupId); @@ -213,7 +181,17 @@ } AddChildViewAt(source_view, index); - if ((children().size() - 1) % active_style_->columns == 0) { + if (children().size() == 2) { + // We just added a second item, apply the generic style. + SetStyle(generic_style_); + } else if ((children().size() == 1) || + ((children().size() - 1) % active_style_.columns == 0)) { + auto* const layout = static_cast<views::TableLayout*>(GetLayoutManager()); + if (layout->NumRows() > 0) { + layout->AddPaddingRow(views::TableLayout::kFixedSize, kItemSpacing); + } + layout->AddRows(1, views::TableLayout::kFixedSize, + active_style_.item_size.height()); controller_->OnSourceListLayoutChanged(); } @@ -232,13 +210,14 @@ OnSelectionChanged(); } - if (children().size() % active_style_->columns == 0) { - controller_->OnSourceListLayoutChanged(); - } - - // Apply single-item styling when the second source is removed. if (children().size() == 1) { - SetStyle(&single_style_); + // Apply single-item styling when the second source is removed. + SetStyle(single_style_); + } else if (children().empty() || + (children().size() % active_style_.columns == 0)) { + auto* const layout = static_cast<views::TableLayout*>(GetLayoutManager()); + layout->RemoveRows(layout->NumRows() == 1 ? 1 : 2); // 1 actual, 1 padding + controller_->OnSourceListLayoutChanged(); } PreferredSizeChanged(); @@ -274,12 +253,40 @@ } } -void DesktopMediaListView::SetStyle(DesktopMediaSourceViewStyle* style) { +void DesktopMediaListView::SetStyle(const DesktopMediaSourceViewStyle& style) { + const size_t old_columns = active_style_.columns; + const gfx::Size old_item_size = active_style_.item_size; active_style_ = style; - controller_->SetThumbnailSize(style->image_rect.size()); + + controller_->SetThumbnailSize(active_style_.image_rect.size()); for (views::View* child : children()) { - AsDesktopMediaSourceView(child)->SetStyle(*active_style_); + AsDesktopMediaSourceView(child)->SetStyle(active_style_); + } + + if (active_style_.columns != old_columns || + active_style_.item_size != old_item_size) { + auto* const layout = static_cast<views::TableLayout*>(GetLayoutManager()); + layout->RemoveRows(layout->NumRows()); + layout->RemoveColumns(layout->NumColumns()); + for (size_t col = 0; col < active_style_.columns; ++col) { + if (col) { + layout->AddPaddingColumn(views::TableLayout::kFixedSize, kItemSpacing); + } + layout->AddColumn( + views::LayoutAlignment::kStretch, views::LayoutAlignment::kStretch, 0, + views::TableLayout::ColumnSize::kFixed, + active_style_.item_size.width(), active_style_.item_size.width()); + } + const size_t rows = NumRows(children().size(), active_style_.columns); + for (size_t row = 0; row < rows; ++row) { + if (row) { + layout->AddPaddingRow(views::TableLayout::kFixedSize, kItemSpacing); + } + layout->AddRows(1, views::TableLayout::kFixedSize, + active_style_.item_size.height()); + } + controller_->OnSourceListLayoutChanged(); } }
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.h b/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.h index e9d95ef..8d0080b 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.h +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_list_view.h
@@ -36,9 +36,6 @@ void OnSelectionChanged(); // views::View: - gfx::Size CalculatePreferredSize( - const views::SizeBounds& /*available_size*/) const override; - void Layout(PassKey) override; bool OnKeyPressed(const ui::KeyEvent& event) override; // DesktopMediaListController::ListView: @@ -58,19 +55,15 @@ private: // Change the source style of this list on the fly. - void SetStyle(DesktopMediaSourceViewStyle* style); + void SetStyle(const DesktopMediaSourceViewStyle& style); DesktopMediaSourceView* GetSelectedView(); - const int item_spacing_; - const int horizontal_margins_; - const int vertical_margins_; - raw_ptr<DesktopMediaListController, DanglingUntriaged> controller_; DesktopMediaSourceViewStyle single_style_; DesktopMediaSourceViewStyle generic_style_; - raw_ptr<DesktopMediaSourceViewStyle, DanglingUntriaged> active_style_; + DesktopMediaSourceViewStyle active_style_; }; #endif // CHROME_BROWSER_UI_VIEWS_DESKTOP_CAPTURE_DESKTOP_MEDIA_LIST_VIEW_H_
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.cc index c24d110..89df12a 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.cc +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.cc
@@ -30,11 +30,10 @@ using content::DesktopMediaID; -DesktopMediaSourceViewStyle::DesktopMediaSourceViewStyle( - const DesktopMediaSourceViewStyle& style) = default; +DesktopMediaSourceViewStyle::DesktopMediaSourceViewStyle() = default; DesktopMediaSourceViewStyle::DesktopMediaSourceViewStyle( - int columns, + size_t columns, const gfx::Size& item_size, const gfx::Rect& icon_rect, const gfx::Rect& label_rect, @@ -47,6 +46,12 @@ text_alignment(text_alignment), image_rect(image_rect) {} +DesktopMediaSourceViewStyle::DesktopMediaSourceViewStyle( + const DesktopMediaSourceViewStyle& style) = default; + +DesktopMediaSourceViewStyle& DesktopMediaSourceViewStyle::operator=( + const DesktopMediaSourceViewStyle& style) = default; + DesktopMediaSourceView::DesktopMediaSourceView( DesktopMediaListView* parent, DesktopMediaID source_id,
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h b/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h index 27671d3..e4b3a52 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h
@@ -23,17 +23,20 @@ // Controls the appearance of DesktopMediaSourceView. struct DesktopMediaSourceViewStyle { - DesktopMediaSourceViewStyle(const DesktopMediaSourceViewStyle& style); - DesktopMediaSourceViewStyle(int columns, + DesktopMediaSourceViewStyle(); + DesktopMediaSourceViewStyle(size_t columns, const gfx::Size& item_size, const gfx::Rect& icon_rect, const gfx::Rect& label_rect, gfx::HorizontalAlignment text_alignment, const gfx::Rect& image_rect); + DesktopMediaSourceViewStyle(const DesktopMediaSourceViewStyle& style); + DesktopMediaSourceViewStyle& operator=( + const DesktopMediaSourceViewStyle& style); // This parameter controls how many source items can be displayed in a row. // Source items are instances of DesktopMediaSourceView. - int columns; + size_t columns = 0; // The size of a single source item. gfx::Size item_size; @@ -42,7 +45,7 @@ // source item. gfx::Rect icon_rect; gfx::Rect label_rect; - gfx::HorizontalAlignment text_alignment; + gfx::HorizontalAlignment text_alignment = gfx::ALIGN_LEFT; gfx::Rect image_rect; };
diff --git a/chrome/browser/ui/views/location_bar/intent_picker_view_page_action_controller.h b/chrome/browser/ui/views/location_bar/intent_picker_view_page_action_controller.h index fe8cbf0..49579dd 100644 --- a/chrome/browser/ui/views/location_bar/intent_picker_view_page_action_controller.h +++ b/chrome/browser/ui/views/location_bar/intent_picker_view_page_action_controller.h
@@ -10,7 +10,7 @@ class Browser; -// TODO(musalmaan): Move this file, along with other intent picker +// TODO(crbug.com/376283840): Move this file, along with other intent picker // and tab helper files, to a dedicated directory in a separate CL. /**
diff --git a/chrome/browser/ui/views/page_action/page_action_controller.cc b/chrome/browser/ui/views/page_action/page_action_controller.cc index bcf2fcae..672eaa0 100644 --- a/chrome/browser/ui/views/page_action/page_action_controller.cc +++ b/chrome/browser/ui/views/page_action/page_action_controller.cc
@@ -136,14 +136,6 @@ return subscription; } -void PageActionController::OnActionAddedLocally(const actions::ActionId& id) {} - -void PageActionController::OnActionRemovedLocally(const actions::ActionId& id) { -} - -void PageActionController::OnActionMovedLocally(const actions::ActionId& id, - int from_index, - int to_index) {} void PageActionController::OnActionsChanged() { PinnedActionsModelChanged(); }
diff --git a/chrome/browser/ui/views/page_action/page_action_controller.h b/chrome/browser/ui/views/page_action/page_action_controller.h index 6ec394f7..dbf50b7 100644 --- a/chrome/browser/ui/views/page_action/page_action_controller.h +++ b/chrome/browser/ui/views/page_action/page_action_controller.h
@@ -97,11 +97,6 @@ actions::ActionItem* action_item); // PinnedToolbarActionsModel::Observer - void OnActionAddedLocally(const actions::ActionId& id) override; - void OnActionRemovedLocally(const actions::ActionId& id) override; - void OnActionMovedLocally(const actions::ActionId& id, - int from_index, - int to_index) override; void OnActionsChanged() override; static base::PassKey<PageActionController> PassKeyForTesting() {
diff --git a/chrome/browser/ui/views/performance_controls/performance_intervention_interactive_ui_test.cc b/chrome/browser/ui/views/performance_controls/performance_intervention_interactive_ui_test.cc index da6b4fc..44fc06d1 100644 --- a/chrome/browser/ui/views/performance_controls/performance_intervention_interactive_ui_test.cc +++ b/chrome/browser/ui/views/performance_controls/performance_intervention_interactive_ui_test.cc
@@ -8,7 +8,6 @@ #include "base/functional/bind.h" #include "base/run_loop.h" #include "base/test/metrics/histogram_tester.h" -#include "base/test/scoped_feature_list.h" #include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/feature_engagement/tracker_factory.h" @@ -34,7 +33,6 @@ #include "chrome/test/interaction/interactive_browser_test.h" #include "chrome/test/user_education/interactive_feature_promo_test.h" #include "components/feature_engagement/public/feature_constants.h" -#include "components/performance_manager/public/features.h" #include "components/performance_manager/public/resource_attribution/page_context.h" #include "components/performance_manager/public/user_tuning/prefs.h" #include "components/prefs/pref_service.h" @@ -108,8 +106,6 @@ void SetUp() override { set_open_about_blank_on_browser_launch(true); - feature_list_.InitAndEnableFeature( - performance_manager::features::kPerformanceInterventionUI); InteractiveFeaturePromoTest::SetUp(); } @@ -203,9 +199,6 @@ enabled); }); } - - private: - base::test::ScopedFeatureList feature_list_; }; IN_PROC_BROWSER_TEST_F(PerformanceInterventionInteractiveTest,
diff --git a/chrome/browser/ui/views/profiles/batch_upload_dialog_view_pixel_browsertest.cc b/chrome/browser/ui/views/profiles/batch_upload_dialog_view_pixel_browsertest.cc index 5b4983ed..0862747 100644 --- a/chrome/browser/ui/views/profiles/batch_upload_dialog_view_pixel_browsertest.cc +++ b/chrome/browser/ui/views/profiles/batch_upload_dialog_view_pixel_browsertest.cc
@@ -32,7 +32,8 @@ const char kSignedInImageUrl[] = "SIGNED_IN_IMAGE_URL"; syncer::LocalDataDescription GetFakeLocalData(syncer::DataType type, - int item_count) { + int item_count, + bool long_title) { syncer::LocalDataDescription data_descriptions; data_descriptions.type = type; @@ -59,10 +60,18 @@ NOTREACHED(); } - item.title = - data_name + "_title_" + base::UTF16ToUTF8(base::FormatNumber(i)); - item.subtitle = - data_name + "_subtitle_" + base::UTF16ToUTF8(base::FormatNumber(i)); + // Theme item has a different title as it is shown in the section title. + if (type == syncer::DataType::THEMES) { + item.title = long_title ? "Custom theme name that is very very long long " + "long long long long" + : "Custom theme name"; + } else { + item.title = + data_name + "_title_" + base::UTF16ToUTF8(base::FormatNumber(i)); + item.subtitle = + data_name + "_subtitle_" + base::UTF16ToUTF8(base::FormatNumber(i)); + } + data_descriptions.local_data_models.push_back(std::move(item)); } return data_descriptions; @@ -75,6 +84,9 @@ {2, syncer::DataType::PASSWORDS}, {1, syncer::DataType::CONTACT_INFO}, }; + // Currently only relevant for Themes section as the item title is shown in + // the section title. + bool long_title = false; }; // Allows the test to be named like @@ -142,10 +154,18 @@ // Themes data type section has a specific UI. {.test_suffix = "ThemesSectionOnly", .section_item_count_type = {{1, syncer::DataType::THEMES}}}, + {.test_suffix = "ThemesSectionOnlyWithLongName", + .section_item_count_type = {{1, syncer::DataType::THEMES}}, + .long_title = true}, {.test_suffix = "MultipleSectionsWithThemes", .section_item_count_type = {{5, syncer::DataType::CONTACT_INFO}, {5, syncer::DataType::PASSWORDS}, {1, syncer::DataType::THEMES}}}, + {.test_suffix = "MultipleSectionsWithThemesLongName", + .section_item_count_type = {{5, syncer::DataType::CONTACT_INFO}, + {5, syncer::DataType::PASSWORDS}, + {1, syncer::DataType::THEMES}}, + .long_title = true}, }; } // namespace @@ -156,7 +176,8 @@ public: BatchUploadDialogViewPixelTest() { for (const auto& [count, type] : GetParam().section_item_count_type) { - fake_descriptions_.emplace_back(GetFakeLocalData(type, count)); + fake_descriptions_.emplace_back( + GetFakeLocalData(type, count, GetParam().long_title)); } // The Batch Upload view seems not to be resized properly on changes which
diff --git a/chrome/browser/ui/views/side_panel/side_panel_coordinator.h b/chrome/browser/ui/views/side_panel/side_panel_coordinator.h index bbeaafb..1344b8f 100644 --- a/chrome/browser/ui/views/side_panel/side_panel_coordinator.h +++ b/chrome/browser/ui/views/side_panel/side_panel_coordinator.h
@@ -192,11 +192,6 @@ views::View* starting_from) override; // PinnedToolbarActionsModel::Observer: - void OnActionAddedLocally(const actions::ActionId& id) override {} - void OnActionRemovedLocally(const actions::ActionId& id) override {} - void OnActionMovedLocally(const actions::ActionId& id, - int from_index, - int to_index) override {} void OnActionsChanged() override; SidePanelRegistry* GetActiveContextualRegistry() const;
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button_unittest.cc b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button_unittest.cc index c407b3bc..e2b5082 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button_unittest.cc +++ b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_button_unittest.cc
@@ -130,10 +130,17 @@ } TEST_F(ChromeLabsButtonTest, DotIndicatorTest) { - // TODO(crbug.com/354207075): Verify the dot indicator is hidden when the - // bubble is shown. The older implementation has been removed since it no - // longer works, but want to keep the test as a reminder to write a new one - // when the bug is fixed. + views::Button* labs_button = browser_view()->toolbar()->GetChromeLabsButton(); + ChromeLabsCoordinator* coordinator = + browser_view()->browser()->GetFeatures().chrome_labs_coordinator(); + coordinator->MaybeInstallDotIndicator(); + views::DotIndicator* dot_indicator = coordinator->GetDotIndicator(); + EXPECT_TRUE(dot_indicator->GetVisible()); + ui::MouseEvent e(ui::EventType::kMousePressed, gfx::Point(), gfx::Point(), + ui::EventTimeForNow(), 0, 0); + views::test::ButtonTestApi test_api(labs_button); + test_api.NotifyClick(e); + EXPECT_FALSE(dot_indicator->GetVisible()); } #if BUILDFLAG(IS_CHROMEOS)
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_coordinator.cc b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_coordinator.cc index 300f6be..b8586c3 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_coordinator.cc +++ b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_coordinator.cc
@@ -10,6 +10,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/actions/chrome_action_id.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/toolbar/chrome_labs/chrome_labs_utils.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_bubble_view.h" #include "chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_view_controller.h" @@ -36,9 +37,15 @@ if (!model) { model_ = std::make_unique<ChromeLabsModel>(); } + + pinned_actions_observation_.Observe( + PinnedToolbarActionsModel::Get(browser->profile())); + + MaybeInstallDotIndicator(); } ChromeLabsCoordinator::~ChromeLabsCoordinator() { + TearDown(); if (BubbleExists()) { GetChromeLabsBubbleView()->GetWidget()->CloseWithReason( views::Widget::ClosedReason::kUnspecified); @@ -46,6 +53,10 @@ } } +void ChromeLabsCoordinator::TearDown() { + pinned_actions_observation_.Reset(); +} + bool ChromeLabsCoordinator::BubbleExists() { return chrome_labs_bubble_view_tracker_.view() != nullptr; } @@ -92,8 +103,11 @@ std::move(chrome_labs_bubble_view)); widget->Show(); - // TODO(crbug.com/354207075): Hide the dot indicator here once the bubble has - // been shown. Wait for bug to be fixed before doing this. + // Hide dot indicator once bubble has been shown. + views::DotIndicator* dot_indicator = GetDotIndicator(); + if (dot_indicator) { + dot_indicator->SetVisible(false); + } } void ChromeLabsCoordinator::Hide() { @@ -153,17 +167,14 @@ Show(); } -views::Button* ChromeLabsCoordinator::GetChromeLabsButton() { - ToolbarView* toolbar = - BrowserView::GetBrowserViewForBrowser(browser_)->toolbar(); - CHECK(toolbar); - - // Null when the labs action is not visible in the container. - views::Button* button = - toolbar->pinned_toolbar_actions_container()->GetButtonFor( - kActionShowChromeLabs); - - return button; +PinnedActionToolbarButton* ChromeLabsCoordinator::GetChromeLabsButton() { + BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); + if (browser_view && browser_view->toolbar()) { + return browser_view->toolbar() + ->pinned_toolbar_actions_container() + ->GetButtonFor(kActionShowChromeLabs); + } + return nullptr; } ChromeLabsBubbleView* ChromeLabsCoordinator::GetChromeLabsBubbleView() { @@ -171,3 +182,43 @@ chrome_labs_bubble_view_tracker_.view()) : nullptr; } + +void ChromeLabsCoordinator::MaybeInstallDotIndicator() { + PinnedActionToolbarButton* button = GetChromeLabsButton(); + if (!button) { + return; + } + views::View* anchor = button->GetImageContainerView(); + // Check to ensure there isn't already a dot indicator on the button. + if (GetDotIndicator()) { + return; + } + views::DotIndicator* dot_indicator = views::DotIndicator::Install(anchor); + dot_indicator->SetVisible( + AreNewChromeLabsExperimentsAvailable(model_.get(), browser_->profile())); + + gfx::Rect dot_rect(8, 8); + dot_rect.set_origin(gfx::Point(anchor->GetPreferredSize().width(), + anchor->GetPreferredSize().height()) - + dot_rect.bottom_right().OffsetFromOrigin()); + dot_indicator->SetBoundsRect(dot_rect); +} + +views::DotIndicator* ChromeLabsCoordinator::GetDotIndicator() { + PinnedActionToolbarButton* button = GetChromeLabsButton(); + if (!button) { + return nullptr; + } + views::View* anchor = button->GetImageContainerView(); + // Check to ensure there isn't already a dot indicator on the button. + for (auto& child : anchor->children()) { + if (views::IsViewClass<views::DotIndicator>(child)) { + return views::AsViewClass<views::DotIndicator>(child); + } + } + return nullptr; +} + +void ChromeLabsCoordinator::OnActionsChanged() { + MaybeInstallDotIndicator(); +}
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_coordinator.h b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_coordinator.h index 420c04e..ed03ff8a 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_coordinator.h +++ b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_coordinator.h
@@ -8,20 +8,19 @@ #include "base/memory/raw_ptr.h" #include "build/buildflag.h" #include "chrome/browser/ui/toolbar/chrome_labs/chrome_labs_model.h" +#include "chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h" #include "components/webui/flags/flags_state.h" #include "components/webui/flags/flags_storage.h" +#include "ui/views/controls/dot_indicator.h" #include "ui/views/view_observer.h" #include "ui/views/view_tracker.h" class Browser; class ChromeLabsBubbleView; class ChromeLabsViewController; +class PinnedActionToolbarButton; -namespace views { -class Button; -} - -class ChromeLabsCoordinator { +class ChromeLabsCoordinator : public PinnedToolbarActionsModel::Observer { public: enum class ShowUserType { // The default user type that accounts for most users. @@ -34,7 +33,9 @@ explicit ChromeLabsCoordinator(Browser* browser); ChromeLabsCoordinator(Browser* browser, std::unique_ptr<ChromeLabsModel> model); - ~ChromeLabsCoordinator(); + ~ChromeLabsCoordinator() override; + + void TearDown(); bool BubbleExists(); @@ -45,10 +46,17 @@ // Toggles the visibility of the bubble. void ShowOrHide(); - views::Button* GetChromeLabsButton(); + PinnedActionToolbarButton* GetChromeLabsButton(); ChromeLabsBubbleView* GetChromeLabsBubbleView(); + void MaybeInstallDotIndicator(); + + views::DotIndicator* GetDotIndicator(); + + // PinnedToolbarActionsModel::Observer: + void OnActionsChanged() override; + flags_ui::FlagsState* GetFlagsStateForTesting() { return flags_state_; } ChromeLabsViewController* GetViewControllerForTesting() { @@ -68,6 +76,9 @@ std::unique_ptr<ChromeLabsModel> model_; std::unique_ptr<ChromeLabsViewController> controller_; views::ViewTracker chrome_labs_bubble_view_tracker_; + base::ScopedObservation<PinnedToolbarActionsModel, + PinnedToolbarActionsModel::Observer> + pinned_actions_observation_{this}; #if BUILDFLAG(IS_CHROMEOS) bool is_waiting_to_show_ = false; bool should_circumvent_device_check_for_testing_ = false;
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_unittest.cc b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_unittest.cc index 634c6149..9d88e6b 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_unittest.cc +++ b/chrome/browser/ui/views/toolbar/chrome_labs/chrome_labs_unittest.cc
@@ -139,6 +139,7 @@ void TearDown() override { about_flags::GetCurrentFlagsState()->Reset(); + chrome_labs_coordinator_->TearDown(); TestWithBrowserView::TearDown(); }
diff --git a/chrome/browser/ui/views/toolbar/pinned_action_toolbar_button.h b/chrome/browser/ui/views/toolbar/pinned_action_toolbar_button.h index 7f219d77..1e8a629 100644 --- a/chrome/browser/ui/views/toolbar/pinned_action_toolbar_button.h +++ b/chrome/browser/ui/views/toolbar/pinned_action_toolbar_button.h
@@ -55,6 +55,7 @@ bool ShouldShowEphemerallyInToolbar(); bool IsIconVisible() { return is_icon_visible_; } bool IsPinned() { return pinned_; } + views::View* GetImageContainerView() { return image_container_view(); } bool ShouldSkipExecutionForTesting() { return skip_execution_; }
diff --git a/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container.h b/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container.h index e7dbb44ee..b9bdec1 100644 --- a/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container.h +++ b/chrome/browser/ui/views/toolbar/pinned_toolbar_actions_container.h
@@ -74,9 +74,6 @@ // PinnedToolbarActionsModel::Observer: void OnActionAddedLocally(const actions::ActionId& id) override; void OnActionRemovedLocally(const actions::ActionId& id) override; - void OnActionMovedLocally(const actions::ActionId& id, - int from_index, - int to_index) override {} void OnActionsChanged() override; // views::DragController:
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc index 0d912a7..f7a8dfc 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -86,7 +86,6 @@ #include "chrome/grit/theme_resources.h" #include "components/autofill/core/common/autofill_payments_features.h" #include "components/omnibox/browser/omnibox_view.h" -#include "components/performance_manager/public/features.h" #include "components/prefs/pref_service.h" #include "components/safe_browsing/core/common/features.h" #include "components/send_tab_to_self/features.h" @@ -443,11 +442,8 @@ std::make_unique<BatterySaverButton>(browser_view_)); } - if (performance_manager::features:: - ShouldUsePerformanceInterventionBackend()) { - performance_intervention_button_ = container_view_->AddChildView( - std::make_unique<PerformanceInterventionButton>(browser_view_)); - } + performance_intervention_button_ = container_view_->AddChildView( + std::make_unique<PerformanceInterventionButton>(browser_view_)); if (cast) { cast_ = container_view_->AddChildView(std::move(cast));
diff --git a/chrome/browser/ui/web_applications/web_app_browsertest.cc b/chrome/browser/ui/web_applications/web_app_browsertest.cc index 47e88e2..513a9c5 100644 --- a/chrome/browser/ui/web_applications/web_app_browsertest.cc +++ b/chrome/browser/ui/web_applications/web_app_browsertest.cc
@@ -105,6 +105,7 @@ #include "third_party/blink/public/common/features.h" #include "third_party/blink/public/mojom/manifest/display_mode.mojom-shared.h" #include "third_party/blink/public/mojom/manifest/manifest.mojom.h" +#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom-shared.h" #include "third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom-shared.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/base_window.h" @@ -2259,6 +2260,58 @@ 1); } +// TODO(crbug.com/399906707): Add test for kWebAppManifestTranslations and +// kWebAppManifestTabStrip. +IN_PROC_BROWSER_TEST_F(WebAppBrowserTest, ManifestWithUseCounterFields) { + constexpr char kUseCounterHistogram[] = "Blink.UseCounter.Features"; + + base::HistogramTester histogram_tester; + GURL test_url = https_server()->GetURL( + "/banners/" + "manifest_test_page.html?manifest=manifest_with_use_counter_fields.json"); + NavigateViaLinkClickToURLAndWait(browser(), test_url); + + const webapps::AppId app_id = test::InstallPwaForCurrentUrl(browser()); + + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, blink::mojom::WebFeature::kWebAppManifestStartUrl, + 1); + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, blink::mojom::WebFeature::kWebAppManifestDisplay, + 1); + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, blink::mojom::WebFeature::kWebAppManifestIcons, 1); + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, + blink::mojom::WebFeature::kWebAppManifestScreenshots, 1); + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, blink::mojom::WebFeature::kWebAppManifestScope, 1); + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, blink::mojom::WebFeature::kWebAppManifestLockScreen, + 1); + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, blink::mojom::WebFeature::kWebAppManifestNoteTaking, + 1); + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, + blink::mojom::WebFeature::kWebAppManifestPermissionsPolicy, 1); + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, + blink::mojom::WebFeature::kWebAppManifestPrefer_Related_Applications, 1); + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, blink::mojom::WebFeature::kWebAppManifestThemeColor, + 1); + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, + blink::mojom::WebFeature::kWebAppManifestBackgroundColor, 1); + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, blink::mojom::WebFeature::kWebAppManifestVersion, + 1); + histogram_tester.ExpectBucketCount( + kUseCounterHistogram, + blink::mojom::WebFeature::kWebAppManifestRelated_Applications, 1); +} + IN_PROC_BROWSER_TEST_F(WebAppBrowserTest_Borderless, Borderless) { GURL test_url = https_server()->GetURL( "/banners/"
diff --git a/chrome/browser/ui/webui/certificate_manager/client_cert_sources.cc b/chrome/browser/ui/webui/certificate_manager/client_cert_sources.cc index 13081b9..2fbd3251 100644 --- a/chrome/browser/ui/webui/certificate_manager/client_cert_sources.cc +++ b/chrome/browser/ui/webui/certificate_manager/client_cert_sources.cc
@@ -55,7 +55,10 @@ #endif // BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +#include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/client_certificates/certificate_provisioning_service_factory.h" +#include "chrome/browser/policy/chrome_browser_policy_connector.h" +#include "components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h" #include "components/enterprise/client_certificates/core/certificate_provisioning_service.h" #include "components/enterprise/client_certificates/core/client_certificates_service.h" #include "components/enterprise/client_certificates/core/features.h" @@ -208,35 +211,53 @@ class ClientCertStoreFactoryProvisioned : public ClientCertStoreFactory { public: explicit ClientCertStoreFactoryProvisioned( - client_certificates::CertificateProvisioningService* provisioning_service) - : provisioning_service_(provisioning_service) {} + client_certificates::CertificateProvisioningService* + profile_provisioning_service, + client_certificates::CertificateProvisioningService* + browser_provisioning_service) + : profile_provisioning_service_(profile_provisioning_service), + browser_provisioning_service_(browser_provisioning_service) {} std::unique_ptr<net::ClientCertStore> CreateClientCertStore() override { return client_certificates::ClientCertificatesService::Create( - provisioning_service_, std::make_unique<NullClientCertStore>()); + profile_provisioning_service_, browser_provisioning_service_, + std::make_unique<NullClientCertStore>()); } private: raw_ptr<client_certificates::CertificateProvisioningService> - provisioning_service_; + profile_provisioning_service_; + raw_ptr<client_certificates::CertificateProvisioningService> + browser_provisioning_service_; }; std::unique_ptr<ClientCertStoreLoader> CreateProvisionedClientCertLoader( Profile* profile) { - if (!profile || !client_certificates::features:: - IsManagedClientCertificateForUserEnabled()) { - return nullptr; + client_certificates::CertificateProvisioningService* + profile_provisioning_service = nullptr; + if (profile && client_certificates::features:: + IsManagedClientCertificateForUserEnabled()) { + profile_provisioning_service = client_certificates:: + CertificateProvisioningServiceFactory::GetForProfile(profile); } - auto* provisioning_service = - client_certificates::CertificateProvisioningServiceFactory::GetForProfile( - profile); - if (!provisioning_service) { + + client_certificates::CertificateProvisioningService* + browser_provisioning_service = nullptr; + if (client_certificates::features:: + IsManagedBrowserClientCertificateEnabled()) { + browser_provisioning_service = + g_browser_process->browser_policy_connector() + ->chrome_browser_cloud_management_controller() + ->GetCertificateProvisioningService(); + } + + if (!profile_provisioning_service && !browser_provisioning_service) { return nullptr; } return std::make_unique<ClientCertStoreLoader>( std::make_unique<ClientCertStoreFactoryProvisioned>( - provisioning_service)); + profile_provisioning_service, browser_provisioning_service)); } #endif
diff --git a/chrome/browser/ui/webui/connectors_internals/connectors_internals_page_handler.cc b/chrome/browser/ui/webui/connectors_internals/connectors_internals_page_handler.cc index 7d55d98..10620b1 100644 --- a/chrome/browser/ui/webui/connectors_internals/connectors_internals_page_handler.cc +++ b/chrome/browser/ui/webui/connectors_internals/connectors_internals_page_handler.cc
@@ -31,6 +31,9 @@ #endif // BUILDFLAG(IS_MAC) #if BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES) +#include "chrome/browser/browser_process.h" +#include "chrome/browser/policy/chrome_browser_policy_connector.h" +#include "components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h" #include "components/enterprise/client_certificates/core/client_identity.h" #include "components/enterprise/client_certificates/core/private_key.h" #endif @@ -39,6 +42,11 @@ namespace { +#if BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES) +constexpr char kProfile[] = "Profile"; +constexpr char kBrowser[] = "Browser"; +#endif // BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES) + std::string ConvertPolicyLevelToString(DTCPolicyLevel level) { switch (level) { case DTCPolicyLevel::kBrowser: @@ -48,6 +56,26 @@ } } +#if BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES) +connectors_internals::mojom::ClientIdentityPtr GetIdentity( + client_certificates::CertificateProvisioningService* provisioning_service, + std::vector<std::string>& enabled_levels, + const std::string& enabled_level) { + const auto& status = provisioning_service->GetCurrentStatus(); + if (!(status.is_policy_enabled)) { + return nullptr; + } + enabled_levels.push_back(enabled_level); + + if (!status.identity.has_value()) { + return nullptr; + } + + return utils::ConvertIdentity(status.identity.value(), + status.last_upload_code); +} +#endif // BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES) + } // namespace ConnectorsInternalsPageHandler::ConnectorsInternalsPageHandler( @@ -105,33 +133,40 @@ void ConnectorsInternalsPageHandler::GetClientCertificateState( GetClientCertificateStateCallback callback) { #if BUILDFLAG(ENTERPRISE_CLIENT_CERTIFICATES) - auto* certificate_provisioning_service = + auto* profile_certificate_provisioning_service = client_certificates::CertificateProvisioningServiceFactory::GetForProfile( profile_); - if (!certificate_provisioning_service) { + auto* browser_certificate_provisioning_service = + g_browser_process->browser_policy_connector() + ->chrome_browser_cloud_management_controller() + ->GetCertificateProvisioningService(); + if (!profile_certificate_provisioning_service && + !browser_certificate_provisioning_service) { std::move(callback).Run( connectors_internals::mojom::ClientCertificateState::New( std::vector<std::string>(), nullptr, nullptr)); return; } - const auto& status = certificate_provisioning_service->GetCurrentStatus(); std::vector<std::string> enabled_levels; - if (status.is_policy_enabled) { - enabled_levels.push_back("Profile"); + connectors_internals::mojom::ClientIdentityPtr managed_browser_identity = + nullptr; + if (browser_certificate_provisioning_service) { + managed_browser_identity = GetIdentity( + browser_certificate_provisioning_service, enabled_levels, kBrowser); } connectors_internals::mojom::ClientIdentityPtr managed_profile_identity = nullptr; - if (status.identity.has_value()) { - managed_profile_identity = utils::ConvertIdentity(status.identity.value(), - status.last_upload_code); + if (profile_certificate_provisioning_service) { + managed_profile_identity = GetIdentity( + profile_certificate_provisioning_service, enabled_levels, kProfile); } std::move(callback).Run( connectors_internals::mojom::ClientCertificateState::New( std::move(enabled_levels), std::move(managed_profile_identity), - nullptr)); + std::move(managed_browser_identity))); #else std::move(callback).Run(
diff --git a/chrome/browser/ui/webui/settings/performance_settings_interactive_uitest.cc b/chrome/browser/ui/webui/settings/performance_settings_interactive_uitest.cc index d8d1e63..3d1e69ef 100644 --- a/chrome/browser/ui/webui/settings/performance_settings_interactive_uitest.cc +++ b/chrome/browser/ui/webui/settings/performance_settings_interactive_uitest.cc
@@ -27,7 +27,6 @@ #include "chrome/test/base/ui_test_utils.h" #include "chrome/test/interaction/interactive_browser_test.h" #include "chrome/test/interaction/webcontents_interaction_test_util.h" -#include "components/performance_manager/public/features.h" #include "components/performance_manager/public/user_tuning/prefs.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_test.h" @@ -801,18 +800,8 @@ WaitForElementToHide(kPerformanceSettingsPage, kExceptionDialogEntry)); } -class PerformanceInterventionSettingsInteractiveTest - : public WebUiInteractiveTestMixin<InteractiveBrowserTest> { - public: - void SetUp() override { - scoped_feature_list_.InitWithFeatures( - {performance_manager::features::kPerformanceInterventionUI}, {}); - InteractiveBrowserTest::SetUp(); - } - - private: - base::test::ScopedFeatureList scoped_feature_list_; -}; +using PerformanceInterventionSettingsInteractiveTest = + WebUiInteractiveTestMixin<InteractiveBrowserTest>; IN_PROC_BROWSER_TEST_F(PerformanceInterventionSettingsInteractiveTest, PerformanceInterventionMetricLogOnToggle) {
diff --git a/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_page_handler.cc b/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_page_handler.cc index 19c190cf..35722e4 100644 --- a/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_page_handler.cc +++ b/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_page_handler.cc
@@ -182,11 +182,6 @@ BookmarksSidePanelUI* bookmarks_ui) : receiver_(this, std::move(receiver)), bookmarks_ui_(bookmarks_ui) {} -BookmarksPageHandler::BookmarksPageHandler( - mojo::PendingReceiver<side_panel::mojom::BookmarksPageHandler> receiver, - ReadingListUI* reading_list_ui) - : receiver_(this, std::move(receiver)), reading_list_ui_(reading_list_ui) {} - BookmarksPageHandler::~BookmarksPageHandler() = default; void BookmarksPageHandler::BookmarkCurrentTabInFolder(int64_t folder_id) { @@ -255,10 +250,8 @@ const std::vector<int64_t>& node_ids, side_panel::mojom::ActionSource source, int command_id) { - auto embedder = - bookmarks_ui_ ? bookmarks_ui_->embedder() : reading_list_ui_->embedder(); std::unique_ptr<BookmarkContextMenu> context_menu = ContextMenuFromNodes( - node_ids, embedder, source, + node_ids, bookmarks_ui_->embedder(), source, bookmarks_ui_->GetShoppingListContextMenuController()); if (context_menu && context_menu->IsCommandIdEnabled(command_id)) { context_menu->ExecuteCommand(command_id, 0); @@ -334,9 +327,7 @@ return; } - auto embedder = - bookmarks_ui_ ? bookmarks_ui_->embedder() : reading_list_ui_->embedder(); - + auto embedder = bookmarks_ui_->embedder(); if (embedder) { std::unique_ptr<BookmarkContextMenu> context_menu = ContextMenuFromNodes( {id}, embedder, source,
diff --git a/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_page_handler.h b/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_page_handler.h index aafe220..2e6e88f 100644 --- a/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_page_handler.h +++ b/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_page_handler.h
@@ -11,16 +11,12 @@ #include "mojo/public/cpp/bindings/receiver.h" class BookmarksSidePanelUI; -class ReadingListUI; class BookmarksPageHandler : public side_panel::mojom::BookmarksPageHandler { public: explicit BookmarksPageHandler( mojo::PendingReceiver<side_panel::mojom::BookmarksPageHandler> receiver, BookmarksSidePanelUI* bookmarks_ui); - explicit BookmarksPageHandler( - mojo::PendingReceiver<side_panel::mojom::BookmarksPageHandler> receiver, - ReadingListUI* reading_list_ui); BookmarksPageHandler(const BookmarksPageHandler&) = delete; BookmarksPageHandler& operator=(const BookmarksPageHandler&) = delete; ~BookmarksPageHandler() override; @@ -66,9 +62,6 @@ private: mojo::Receiver<side_panel::mojom::BookmarksPageHandler> receiver_; raw_ptr<BookmarksSidePanelUI> bookmarks_ui_ = nullptr; - // TODO(corising): Remove use of ReadingListUI which is only needed prior to - // kUnifiedSidePanel. - raw_ptr<ReadingListUI> reading_list_ui_ = nullptr; }; #endif // CHROME_BROWSER_UI_WEBUI_SIDE_PANEL_BOOKMARKS_BOOKMARKS_PAGE_HANDLER_H_
diff --git a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h index a904843..53120719 100644 --- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h +++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h
@@ -38,11 +38,6 @@ void ResetToDefault() override; // PinnedToolbarActionsModel::Observer: - void OnActionAddedLocally(const actions::ActionId& id) override {} - void OnActionRemovedLocally(const actions::ActionId& id) override {} - void OnActionMovedLocally(const actions::ActionId& id, - int from_index, - int to_index) override {} void OnActionsChanged() override; private:
diff --git a/chrome/browser/ui/webui/signin/batch_upload_handler.cc b/chrome/browser/ui/webui/signin/batch_upload_handler.cc index 9f214b2b..9c816d4 100644 --- a/chrome/browser/ui/webui/signin/batch_upload_handler.cc +++ b/chrome/browser/ui/webui/signin/batch_upload_handler.cc
@@ -298,7 +298,7 @@ case syncer::DataType::CONTACT_INFO: return IDS_BATCH_UPLOAD_SECTION_TITLE_ADDRESSES; case syncer::DataType::THEMES: - return IDS_BATCH_UPLOAD_SECTION_TITLE_THEMES; + return IDS_BATCH_UPLOAD_SECTION_TITLE_THEMES_WITH_DESCRIPTION; default: NOTREACHED(); }
diff --git a/chrome/browser/ui/webui/signin/batch_upload_ui.cc b/chrome/browser/ui/webui/signin/batch_upload_ui.cc index 3aefa3d..02174c93 100644 --- a/chrome/browser/ui/webui/signin/batch_upload_ui.cc +++ b/chrome/browser/ui/webui/signin/batch_upload_ui.cc
@@ -62,11 +62,11 @@ : ui::MojoWebUIController(web_ui, true) { Profile* profile = Profile::FromWebUI(web_ui); // Set up the chrome://batch-upload source. - content::WebUIDataSource* source = content::WebUIDataSource::CreateAndAdd( + web_ui_source_ = content::WebUIDataSource::CreateAndAdd( profile, chrome::kChromeUIBatchUploadHost); // Add required resources. - webui::SetupWebUIDataSource(source, kBatchUploadResources, + webui::SetupWebUIDataSource(web_ui_source_, kBatchUploadResources, IDR_BATCH_UPLOAD_BATCH_UPLOAD_HTML); static constexpr webui::LocalizedString kLocalizedStrings[] = { @@ -80,10 +80,10 @@ {"selectAllScreenReader", IDS_BATCH_UPLOAD_SCREEN_READER_SELECT_ALL}, {"selectNoneScreenReader", IDS_BATCH_UPLOAD_SCREEN_READER_SELECT_NONE}, }; - source->AddLocalizedStrings(kLocalizedStrings); + web_ui_source_->AddLocalizedStrings(kLocalizedStrings); - source->UseStringsJs(); - source->EnableReplaceI18nInJS(); + web_ui_source_->UseStringsJs(); + web_ui_source_->EnableReplaceI18nInJS(); content::URLDataSource::Add( profile, std::make_unique<FaviconSource>( @@ -110,6 +110,15 @@ local_data_description_list) { int section_title_id = BatchUploadHandler::GetTypeSectionTitleId(local_data_description.type); + // For Themes add the resource in the main `web_ui_source_` since themes has + // a special way to display it's title that requires a non plural localized + // string with a variable. Also add the resource in the + // `plural_string_handler` to simplify initialization of the view. + if (local_data_description.type == syncer::DataType::THEMES) { + web_ui_source_->AddLocalizedString(base::ToString(section_title_id), + section_title_id); + } + plural_string_handler->AddLocalizedString(base::ToString(section_title_id), section_title_id); } @@ -124,6 +133,7 @@ void BatchUploadUI::Clear() { handler_.reset(); + web_ui_source_ = nullptr; } void BatchUploadUI::BindInterface(
diff --git a/chrome/browser/ui/webui/signin/batch_upload_ui.h b/chrome/browser/ui/webui/signin/batch_upload_ui.h index a10e1ee..3c0f623 100644 --- a/chrome/browser/ui/webui/signin/batch_upload_ui.h +++ b/chrome/browser/ui/webui/signin/batch_upload_ui.h
@@ -15,6 +15,7 @@ namespace content { class WebUI; +class WebUIDataSource; } struct AccountInfo; @@ -86,6 +87,8 @@ // Handler implementing Mojo interface to communicate with the WebUI. std::unique_ptr<BatchUploadHandler> handler_; + raw_ptr<content::WebUIDataSource> web_ui_source_ = nullptr; + mojo::Receiver<batch_upload::mojom::PageHandlerFactory> page_factory_receiver_{this};
diff --git a/chrome/browser/web_applications/isolated_web_apps/key_distribution/iwa_key_distribution_info_provider_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/key_distribution/iwa_key_distribution_info_provider_unittest.cc index f4a2120..4d2e565 100644 --- a/chrome/browser/web_applications/isolated_web_apps/key_distribution/iwa_key_distribution_info_provider_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/key_distribution/iwa_key_distribution_info_provider_unittest.cc
@@ -360,8 +360,7 @@ .WillOnce(ReturnRef(on_demand_updater())); EXPECT_CALL(on_demand_updater(), - OnDemandUpdate("iebhnlpddlcpcfpfalldikcoeakpeoah", - Priority::BACKGROUND, _)) + OnDemandUpdate("iebhnlpddlcpcfpfalldikcoeakpeoah", _, _)) .WillOnce(WithoutArgs([&, load_delay] { ASSERT_TRUE(installer_); InstallComponentAsync(installer_, base::Version("2.0.0"), @@ -373,8 +372,7 @@ EXPECT_CALL(component_updater(), GetOnDemandUpdater).Times(0); EXPECT_CALL(on_demand_updater(), - OnDemandUpdate("iebhnlpddlcpcfpfalldikcoeakpeoah", - Priority::BACKGROUND, _)) + OnDemandUpdate("iebhnlpddlcpcfpfalldikcoeakpeoah", _, _)) .Times(0); } @@ -383,8 +381,7 @@ .WillOnce(ReturnRef(on_demand_updater())); EXPECT_CALL(on_demand_updater(), - OnDemandUpdate("iebhnlpddlcpcfpfalldikcoeakpeoah", - Priority::BACKGROUND, _)); + OnDemandUpdate("iebhnlpddlcpcfpfalldikcoeakpeoah", _, _)); } private:
diff --git a/chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager_unittest.cc index fd91dda..90749cd 100644 --- a/chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager_unittest.cc
@@ -1419,8 +1419,7 @@ .WillOnce(ReturnRef(on_demand_updater())); EXPECT_CALL(on_demand_updater(), - OnDemandUpdate(Eq(kIwaKeyDistributionComponentId), - Priority::BACKGROUND, _)) + OnDemandUpdate(Eq(kIwaKeyDistributionComponentId), _, _)) .Times(1); SetUpForceInstallPolicyForOneApp(); @@ -1471,8 +1470,7 @@ .WillOnce(ReturnRef(on_demand_updater())); EXPECT_CALL(on_demand_updater(), - OnDemandUpdate(Eq(kIwaKeyDistributionComponentId), - Priority::BACKGROUND, _)) + OnDemandUpdate(Eq(kIwaKeyDistributionComponentId), _, _)) .Times(1) .WillOnce(WithoutArgs([&] { ASSERT_TRUE(installer); @@ -1604,8 +1602,7 @@ .WillOnce(ReturnRef(on_demand_updater())); EXPECT_CALL(on_demand_updater(), - OnDemandUpdate(Eq(kIwaKeyDistributionComponentId), - Priority::BACKGROUND, _)) + OnDemandUpdate(Eq(kIwaKeyDistributionComponentId), _, _)) .Times(1) .WillOnce(WithoutArgs([&] { ASSERT_TRUE(installer);
diff --git a/chrome/browser/webauthn/chrome_web_authentication_delegate.cc b/chrome/browser/webauthn/chrome_web_authentication_delegate.cc index 7477d22..e032195 100644 --- a/chrome/browser/webauthn/chrome_web_authentication_delegate.cc +++ b/chrome/browser/webauthn/chrome_web_authentication_delegate.cc
@@ -114,8 +114,9 @@ const std::string& rp_id) { // Extensions are always allowed to assert their own extension identifier. // This has special handling in - // ChromeWebAuthenticationDelegate::MaybeGetRelyingPartyIdOverride, the RP ID - // will be prefixed with the extension scheme to isolate it from web origins. + // ChromeWebAuthenticationDelegate::MaybeGetRelyingPartyIdOverride, the + // RP ID will be prefixed with the extension scheme to isolate it from web + // origins. if (extension.id() == rp_id) { return true; } @@ -169,72 +170,6 @@ return false; } -bool IsCmdlineAllowedOrigin(const url::Origin& caller_origin) { - if (!base::CommandLine::ForCurrentProcess()->HasSwitch( - webauthn::switches::kRemoteProxiedRequestsAllowedAdditionalOrigin)) { - return false; - } - // Note that `cmdline_allowed_origin` will be opaque if the flag is not a - // valid URL, which won't match `caller_origin`. - const url::Origin cmdline_allowed_origin = url::Origin::Create( - GURL(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - webauthn::switches::kRemoteProxiedRequestsAllowedAdditionalOrigin))); - return caller_origin == cmdline_allowed_origin; -} - -bool IsGoogleCorpCrdOrigin(content::BrowserContext* browser_context, - const url::Origin& caller_origin) { - // This policy explicitly does not cover external instances of CRD. It - // must not be extended to other origins or be made configurable without going - // through security review. - const Profile* profile = Profile::FromBrowserContext(browser_context); - const PrefService* prefs = profile->GetPrefs(); - const bool google_corp_remote_proxied_request_allowed = - prefs->GetBoolean(webauthn::pref_names::kRemoteProxiedRequestsAllowed); - if (!google_corp_remote_proxied_request_allowed) { - return false; - } - - constexpr const char* const kGoogleCorpCrdOrigins[] = { - "https://remotedesktop.corp.google.com", - "https://remotedesktop-autopush.corp.google.com/", - "https://remotedesktop-daily-6.corp.google.com/", - }; - for (const char* corp_crd_origin : kGoogleCorpCrdOrigins) { - if (caller_origin == url::Origin::Create(GURL(corp_crd_origin))) { - return true; - } - } - // An additional origin can be passed on the command line for testing. - return IsCmdlineAllowedOrigin(caller_origin); -} - -bool IsAllowedByPlatformEnterprisePolicy( - content::BrowserContext* browser_context, - const url::Origin& caller_origin) { - if (!base::FeatureList::IsEnabled( - device::kWebAuthnRemoteDesktopAllowedOriginsPolicy)) { - return false; - } - const Profile* profile = Profile::FromBrowserContext(browser_context); - const PrefService* prefs = profile->GetPrefs(); - const base::Value::List& allowed_origins = - prefs->GetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins); - if (std::ranges::any_of( - allowed_origins, [&caller_origin](const base::Value& origin_value) { - return caller_origin == - url::Origin::Create(GURL(origin_value.GetString())); - })) { - return true; - } - if (!allowed_origins.empty()) { - // An additional origin can be passed on the command line for testing, only - // when the list of origins set by policy is not empty. - return IsCmdlineAllowedOrigin(caller_origin); - } - return false; -} - } // namespace ChromeWebAuthenticationDelegate::ChromeWebAuthenticationDelegate() = default; @@ -261,38 +196,6 @@ return ExtensionCanAssertRpId(*extension, relying_party_id); } -bool ChromeWebAuthenticationDelegate::OriginMayUseRemoteDesktopClientOverride( - content::BrowserContext* browser_context, - const url::Origin& caller_origin) { - // Allow an origin access to the RemoteDesktopClientOverride extension and - // make WebAuthn requests on behalf of other origins, if a any of the - // following are true: - // - The origin is explicitly allowed by a device/platform-level enterprise - // policy. - // - The origin is a Google-internal Chrome Remote Desktop origin and is - // allowed by a corresponding enterprise policy. - // - Either policy is active, and the origin matches the one provided by - // the command-line flag - // `--webauthn-remote-proxied-requests-allowed-additional-origin`, which - // is intended for testing purposes. - - // Check if the origin is explicitly allowed by (device/platform level) - // enterprise policy, (or allowed by the command-line flag for testing). - if (IsAllowedByPlatformEnterprisePolicy(browser_context, caller_origin)) { - // TODO(crbug.com/391132173): Record UMA to track how often this policy is - // used. - return true; - } - - // Check if the origin is a Google Corp Chrome Remote Desktop origin and - // allowed by policy, (or allowed by the command-line flag for testing). - if (IsGoogleCorpCrdOrigin(browser_context, caller_origin)) { - return true; - } - - return false; -} - std::optional<std::string> ChromeWebAuthenticationDelegate::MaybeGetRelyingPartyIdOverride( const std::string& claimed_relying_party_id,
diff --git a/chrome/browser/webauthn/chrome_web_authentication_delegate.h b/chrome/browser/webauthn/chrome_web_authentication_delegate.h index b0d5bb0..899faf0 100644 --- a/chrome/browser/webauthn/chrome_web_authentication_delegate.h +++ b/chrome/browser/webauthn/chrome_web_authentication_delegate.h
@@ -14,14 +14,14 @@ #include "base/memory/weak_ptr.h" #include "build/buildflag.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/webauthn/chrome_web_authentication_delegate_base.h" #include "content/public/browser/authenticator_request_client_delegate.h" -#include "content/public/browser/web_authentication_delegate.h" #include "content/public/browser/web_authentication_request_proxy.h" -// ChromeWebAuthenticationDelegate is the //chrome layer implementation of -// content::WebAuthenticationDelegate. +// ChromeWebAuthenticationDelegate is the //chrome layer implementation +// of content::WebAuthenticationDelegate. class ChromeWebAuthenticationDelegate final - : public content::WebAuthenticationDelegate { + : public ChromeWebAuthenticationDelegateBase { public: // These values are persisted to logs. Entries should not be renumbered and // numeric values should never be reused. @@ -64,9 +64,6 @@ content::BrowserContext* browser_context, const url::Origin& caller_origin, const std::string& relying_party_id) override; - bool OriginMayUseRemoteDesktopClientOverride( - content::BrowserContext* browser_context, - const url::Origin& caller_origin) override; std::optional<std::string> MaybeGetRelyingPartyIdOverride( const std::string& claimed_relying_party_id, const url::Origin& caller_origin) override;
diff --git a/chrome/browser/webauthn/chrome_web_authentication_delegate_base.cc b/chrome/browser/webauthn/chrome_web_authentication_delegate_base.cc new file mode 100644 index 0000000..0f1337e1 --- /dev/null +++ b/chrome/browser/webauthn/chrome_web_authentication_delegate_base.cc
@@ -0,0 +1,203 @@ +// Copyright 2025 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/webauthn/chrome_web_authentication_delegate_base.h" + +#include "base/command_line.h" +#include "base/feature_list.h" +#include "base/notimplemented.h" +#include "build/buildflag.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/webauthn/webauthn_pref_names.h" +#include "chrome/browser/webauthn/webauthn_switches.h" +#include "chrome/common/pref_names.h" +#include "components/prefs/pref_service.h" +#include "device/fido/features.h" + +namespace { + +bool IsCmdlineAllowedOrigin(const url::Origin& caller_origin) { + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + webauthn::switches::kRemoteProxiedRequestsAllowedAdditionalOrigin)) { + return false; + } + // Note that `cmdline_allowed_origin` will be opaque if the flag is not a + // valid URL, which won't match `caller_origin`. + const url::Origin cmdline_allowed_origin = url::Origin::Create( + GURL(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + webauthn::switches::kRemoteProxiedRequestsAllowedAdditionalOrigin))); + return caller_origin == cmdline_allowed_origin; +} + +#if !BUILDFLAG(IS_ANDROID) +bool IsGoogleCorpCrdOrigin(content::BrowserContext* browser_context, + const url::Origin& caller_origin) { + // This policy explicitly does not cover external instances of CRD. It + // must not be extended to other origins or be made configurable without going + // through security review. + const Profile* profile = Profile::FromBrowserContext(browser_context); + const PrefService* prefs = profile->GetPrefs(); + const bool google_corp_remote_proxied_request_allowed = + prefs->GetBoolean(webauthn::pref_names::kRemoteProxiedRequestsAllowed); + if (!google_corp_remote_proxied_request_allowed) { + return false; + } + + constexpr const char* const kGoogleCorpCrdOrigins[] = { + "https://remotedesktop.corp.google.com", + "https://remotedesktop-autopush.corp.google.com/", + "https://remotedesktop-daily-6.corp.google.com/", + }; + for (const char* corp_crd_origin : kGoogleCorpCrdOrigins) { + if (caller_origin == url::Origin::Create(GURL(corp_crd_origin))) { + return true; + } + } + // An additional origin can be passed on the command line for testing. + return IsCmdlineAllowedOrigin(caller_origin); +} +#endif // !BUILDFLAG(IS_ANDROID) + +bool IsAllowedByPlatformEnterprisePolicy( + content::BrowserContext* browser_context, + const url::Origin& caller_origin) { + if (!base::FeatureList::IsEnabled( + device::kWebAuthnRemoteDesktopAllowedOriginsPolicy)) { + return false; + } + const Profile* profile = Profile::FromBrowserContext(browser_context); + const PrefService* prefs = profile->GetPrefs(); + const base::Value::List& allowed_origins = + prefs->GetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins); + if (std::ranges::any_of( + allowed_origins, [&caller_origin](const base::Value& origin_value) { + return caller_origin == + url::Origin::Create(GURL(origin_value.GetString())); + })) { + return true; + } + if (!allowed_origins.empty()) { + // An additional origin can be passed on the command line for testing, only + // when the list of origins set by policy is not empty. + return IsCmdlineAllowedOrigin(caller_origin); + } + return false; +} + +} // namespace + +ChromeWebAuthenticationDelegateBase::ChromeWebAuthenticationDelegateBase() = + default; +ChromeWebAuthenticationDelegateBase::~ChromeWebAuthenticationDelegateBase() = + default; + +bool ChromeWebAuthenticationDelegateBase:: + OriginMayUseRemoteDesktopClientOverride( + content::BrowserContext* browser_context, + const url::Origin& caller_origin) { + // Allow an origin access to the RemoteDesktopClientOverride extension and + // make WebAuthn requests on behalf of other origins, if a any of the + // following are true: + // - The origin is explicitly allowed by a device/platform-level enterprise + // policy. + // - The origin is a Google-internal Chrome Remote Desktop origin and is + // allowed by a corresponding enterprise policy. + // - Either policy is active, and the origin matches the one provided by + // the command-line flag + // `--webauthn-remote-proxied-requests-allowed-additional-origin`, which + // is intended for testing purposes. + + // Check if the origin is explicitly allowed by (device/platform level) + // enterprise policy, (or allowed by the command-line flag for testing). + if (IsAllowedByPlatformEnterprisePolicy(browser_context, caller_origin)) { + // TODO(crbug.com/391132173): Record UMA to track how often this policy is + // used. + return true; + } + +#if !BUILDFLAG(IS_ANDROID) + // Check if the origin is a Google Corp Chrome Remote Desktop origin and + // allowed by policy, (or allowed by the command-line flag for testing). + if (IsGoogleCorpCrdOrigin(browser_context, caller_origin)) { + return true; + } +#endif // BUILDFLAG(IS_ANDROID) + + return false; +} + +bool ChromeWebAuthenticationDelegateBase:: + OverrideCallerOriginAndRelyingPartyIdValidation( + content::BrowserContext* browser_context, + const url::Origin& caller_origin, + const std::string& relying_party_id) { + NOTIMPLEMENTED(); + return false; +} +std::optional<std::string> +ChromeWebAuthenticationDelegateBase::MaybeGetRelyingPartyIdOverride( + const std::string& claimed_relying_party_id, + const url::Origin& caller_origin) { + NOTIMPLEMENTED(); + return std::nullopt; +} +bool ChromeWebAuthenticationDelegateBase::ShouldPermitIndividualAttestation( + content::BrowserContext* browser_context, + const url::Origin& caller_origin, + const std::string& relying_party_id) { + NOTIMPLEMENTED(); + return false; +} +bool ChromeWebAuthenticationDelegateBase::SupportsResidentKeys( + content::RenderFrameHost* render_frame_host) { + NOTIMPLEMENTED(); + return false; +} +bool ChromeWebAuthenticationDelegateBase::IsFocused( + content::WebContents* web_contents) { + NOTIMPLEMENTED(); + return false; +} +void ChromeWebAuthenticationDelegateBase:: + IsUserVerifyingPlatformAuthenticatorAvailableOverride( + content::RenderFrameHost* render_frame_host, + base::OnceCallback<void(std::optional<bool>)> callback) { + NOTIMPLEMENTED(); + std::move(callback).Run(std::nullopt); +} +content::WebAuthenticationRequestProxy* +ChromeWebAuthenticationDelegateBase::MaybeGetRequestProxy( + content::BrowserContext* browser_context, + const url::Origin& caller_origin) { + NOTIMPLEMENTED(); + return nullptr; +} +void ChromeWebAuthenticationDelegateBase::DeletePasskey( + content::WebContents* web_contents, + const std::vector<uint8_t>& passkey_credential_id, + const std::string& relying_party_id) { + NOTIMPLEMENTED(); +} +void ChromeWebAuthenticationDelegateBase::DeleteUnacceptedPasskeys( + content::WebContents* web_contents, + const std::string& relying_party_id, + const std::vector<uint8_t>& user_id, + const std::vector<std::vector<uint8_t>>& all_accepted_credentials_ids) { + NOTIMPLEMENTED(); +} +void ChromeWebAuthenticationDelegateBase::UpdateUserPasskeys( + content::WebContents* web_contents, + const url::Origin& origin, + const std::string& relying_party_id, + std::vector<uint8_t>& user_id, + const std::string& name, + const std::string& display_name) { + NOTIMPLEMENTED(); +} +void ChromeWebAuthenticationDelegateBase::BrowserProvidedPasskeysAvailable( + content::BrowserContext* browser_context, + base::OnceCallback<void(bool)> callback) { + NOTIMPLEMENTED(); + std::move(callback).Run(false); +}
diff --git a/chrome/browser/webauthn/chrome_web_authentication_delegate_base.h b/chrome/browser/webauthn/chrome_web_authentication_delegate_base.h new file mode 100644 index 0000000..58da82e --- /dev/null +++ b/chrome/browser/webauthn/chrome_web_authentication_delegate_base.h
@@ -0,0 +1,77 @@ +// Copyright 2025 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_WEBAUTHN_CHROME_WEB_AUTHENTICATION_DELEGATE_BASE_H_ +#define CHROME_BROWSER_WEBAUTHN_CHROME_WEB_AUTHENTICATION_DELEGATE_BASE_H_ + +#include <cstdint> +#include <optional> +#include <string> +#include <vector> + +#include "base/functional/callback_forward.h" +#include "content/public/browser/web_authentication_delegate.h" +#include "content/public/browser/web_authentication_request_proxy.h" + +// ChromeWebAuthenticationDelegateBase is the base class for //chrome layer's +// implementation of content::WebAuthenticationDelegate. It provides common +// functionality that is shared between the Android and Desktop platforms. +class ChromeWebAuthenticationDelegateBase + : public content::WebAuthenticationDelegate { + public: + ChromeWebAuthenticationDelegateBase(); + + ~ChromeWebAuthenticationDelegateBase() override; + + // This methods are a final overrides of content::WebAuthenticationDelegate, + // providing an implementation that is shared between both Desktop and + // Android platforms. + bool OriginMayUseRemoteDesktopClientOverride( + content::BrowserContext* browser_context, + const url::Origin& caller_origin) final; + + // The following methods are part of content::WebAuthenticationDelegate, but + // their implementation is platform-specific. Therefore, they are not + // implemented in this base class and must be overridden in the subclasses + // that target specific platforms: + bool OverrideCallerOriginAndRelyingPartyIdValidation( + content::BrowserContext* browser_context, + const url::Origin& caller_origin, + const std::string& relying_party_id) override; + std::optional<std::string> MaybeGetRelyingPartyIdOverride( + const std::string& claimed_relying_party_id, + const url::Origin& caller_origin) override; + bool ShouldPermitIndividualAttestation( + content::BrowserContext* browser_context, + const url::Origin& caller_origin, + const std::string& relying_party_id) override; + bool SupportsResidentKeys( + content::RenderFrameHost* render_frame_host) override; + bool IsFocused(content::WebContents* web_contents) override; + void IsUserVerifyingPlatformAuthenticatorAvailableOverride( + content::RenderFrameHost* render_frame_host, + base::OnceCallback<void(std::optional<bool>)> callback) override; + content::WebAuthenticationRequestProxy* MaybeGetRequestProxy( + content::BrowserContext* browser_context, + const url::Origin& caller_origin) override; + void DeletePasskey(content::WebContents* web_contents, + const std::vector<uint8_t>& passkey_credential_id, + const std::string& relying_party_id) override; + void DeleteUnacceptedPasskeys(content::WebContents* web_contents, + const std::string& relying_party_id, + const std::vector<uint8_t>& user_id, + const std::vector<std::vector<uint8_t>>& + all_accepted_credentials_ids) override; + void UpdateUserPasskeys(content::WebContents* web_contents, + const url::Origin& origin, + const std::string& relying_party_id, + std::vector<uint8_t>& user_id, + const std::string& name, + const std::string& display_name) override; + void BrowserProvidedPasskeysAvailable( + content::BrowserContext* browser_context, + base::OnceCallback<void(bool)> callback) override; +}; + +#endif // CHROME_BROWSER_WEBAUTHN_CHROME_WEB_AUTHENTICATION_DELEGATE_BASE_H_
diff --git a/chrome/browser/webauthn/chrome_web_authentication_delegate_base_unittest.cc b/chrome/browser/webauthn/chrome_web_authentication_delegate_base_unittest.cc new file mode 100644 index 0000000..5504d0a --- /dev/null +++ b/chrome/browser/webauthn/chrome_web_authentication_delegate_base_unittest.cc
@@ -0,0 +1,302 @@ +// Copyright 2025 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/webauthn/chrome_web_authentication_delegate_base.h" + +#include "base/test/scoped_command_line.h" +#include "base/test/scoped_feature_list.h" +#include "chrome/browser/webauthn/webauthn_pref_names.h" +#include "chrome/browser/webauthn/webauthn_switches.h" +#include "chrome/common/pref_names.h" +#include "chrome/test/base/chrome_render_view_host_test_harness.h" +#include "components/prefs/pref_service.h" +#include "content/public/browser/browser_context.h" +#include "device/fido/features.h" + +namespace { + +class OriginMayUseRemoteDesktopClientOverrideTest + : public ChromeRenderViewHostTestHarness { + protected: + static constexpr char kCorpCrdOrigin[] = + "https://remotedesktop.corp.google.com"; + static constexpr char kCorpCrdAutopushOrigin[] = + "https://remotedesktop-autopush.corp.google.com/"; + static constexpr char kCorpCrdDailyOrigin[] = + "https://remotedesktop-daily-6.corp.google.com/"; + + const std::array<const char*, 3> kCorpCrdOrigins = { + kCorpCrdOrigin, kCorpCrdAutopushOrigin, kCorpCrdDailyOrigin}; + + static constexpr char kExampleOrigin[] = "https://example.com"; + static constexpr char kAnotherExampleOrigin[] = "https://another.example.com"; + + base::test::ScopedFeatureList scoped_feature_list_; +}; + +#if !BUILDFLAG(IS_ANDROID) +TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, + RemoteProxiedRequestsAllowedPolicy) { + // The "webauthn.remote_proxied_requests_allowed" policy pref should enable + // Google's internal CRD origin to use the RemoteDesktopClientOverride + // extension. + enum class Policy { + kUnset, + kDisabled, + kEnabled, + }; + ChromeWebAuthenticationDelegateBase delegate; + PrefService* prefs = + Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); + for (auto* origin : kCorpCrdOrigins) { + for (const auto policy : + {Policy::kUnset, Policy::kDisabled, Policy::kEnabled}) { + switch (policy) { + case Policy::kUnset: + prefs->ClearPref(webauthn::pref_names::kRemoteProxiedRequestsAllowed); + break; + case Policy::kDisabled: + prefs->SetBoolean(webauthn::pref_names::kRemoteProxiedRequestsAllowed, + false); + break; + case Policy::kEnabled: + prefs->SetBoolean(webauthn::pref_names::kRemoteProxiedRequestsAllowed, + true); + break; + } + + constexpr const char* const crd_origins[] = { + kCorpCrdOrigin, + kCorpCrdAutopushOrigin, + kCorpCrdDailyOrigin, + }; + EXPECT_EQ( + delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(origin))), + base::Contains(crd_origins, origin) && policy == Policy::kEnabled); + } + } +} + +TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, + AdditionalOriginSwitch_WithGooglePolicy) { + // The --webauthn-remote-proxied-requests-allowed-additional-origin switch + // allows passing an additional origin for testing. + ChromeWebAuthenticationDelegateBase delegate; + base::test::ScopedCommandLine scoped_command_line; + scoped_command_line.GetProcessCommandLine()->AppendSwitchASCII( + webauthn::switches::kRemoteProxiedRequestsAllowedAdditionalOrigin, + kExampleOrigin); + + // The flag shouldn't have an effect without the policy enabled. + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kCorpCrdOrigin)))); + + // With the policy enabled, both the hard-coded and flag origin should be + // allowed. + PrefService* prefs = + Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); + prefs->SetBoolean(webauthn::pref_names::kRemoteProxiedRequestsAllowed, true); + EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); + EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kCorpCrdOrigin)))); + + // Other origins still shouldn't be permitted. + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), + url::Origin::Create(GURL("https://other.example.com")))); +} +#endif // !BUILDFLAG(IS_ANDROID) + +TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, + AdditionalOriginSwitch_WithAllowedOriginsPolicy) { + // The --webauthn-remote-proxied-requests-allowed-additional-origin switch + // allows passing an additional origin for testing. This origin will be + // allowed if the kWebAuthnRemoteDesktopAllowedOriginsPolicy preference is set + // to a non-empty list of origins. If the policy is set, the command-line + // origin is treated as another allowed origin in addition to those specified + // by the policy. + ChromeWebAuthenticationDelegateBase delegate; + base::test::ScopedCommandLine scoped_command_line; + scoped_command_line.GetProcessCommandLine()->AppendSwitchASCII( + webauthn::switches::kRemoteProxiedRequestsAllowedAdditionalOrigin, + kExampleOrigin); + scoped_feature_list_.InitAndEnableFeature( + device::kWebAuthnRemoteDesktopAllowedOriginsPolicy); + + // Initially, no origins should be allowed because the allowed origins pref + // hasn't been set yet. + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kAnotherExampleOrigin)))); + + // Set the allowed origins pref to include another origin. + PrefService* prefs = + Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); + prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, + base::Value::List().Append(kAnotherExampleOrigin)); + + // Both the origin specified by the command-line switch and the origin in the + // allowed origins pref should be allowed. + EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); + EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kAnotherExampleOrigin)))); + + // Google Corp CRD origins are not affected by either the switch or this + // policy. + for (auto* origin : kCorpCrdOrigins) { + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(origin)))); + } + + // Origins not listed in either the switch or the policy remain disallowed. + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), + url::Origin::Create(GURL("https://very.other.example.com")))); +} + +TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, + AdditionalOriginSwitch_WithExplicitlyEmptyAllowedOriginsPolicy) { + // The --webauthn-remote-proxied-requests-allowed-additional-origin switch + // should be ignored when the allowed origins policy list is empty. + ChromeWebAuthenticationDelegateBase delegate; + base::test::ScopedCommandLine scoped_command_line; + scoped_command_line.GetProcessCommandLine()->AppendSwitchASCII( + webauthn::switches::kRemoteProxiedRequestsAllowedAdditionalOrigin, + kExampleOrigin); + scoped_feature_list_.InitAndEnableFeature( + device::kWebAuthnRemoteDesktopAllowedOriginsPolicy); + + PrefService* prefs = + Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); + + // Test with policy unset. + prefs->ClearPref(webauthn::pref_names::kRemoteDesktopAllowedOrigins); + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); + + // Test with policy explicitly empty. + prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, + base::Value::List()); + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); +} + +TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, + AllowedOriginsPolicy_InvalidURLs) { + ChromeWebAuthenticationDelegateBase delegate; + scoped_feature_list_.InitAndEnableFeature( + device::kWebAuthnRemoteDesktopAllowedOriginsPolicy); + + PrefService* prefs = + Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); + + const std::vector<std::string> invalid_origins = { + "invalid", + "http://", + "example.com", // Missing scheme + "https://example.com:invalidport", + }; + + base::Value::List invalid_origins_list; + for (const auto& origin : invalid_origins) { + invalid_origins_list.Append(origin); + } + prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, + std::move(invalid_origins_list)); + + // None of the above invalid origins should grant access. + for (const auto& origin : invalid_origins) { + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(origin)))); + } + + // A valid one, added for good measure, should still work. + prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, + base::Value::List().Append(kExampleOrigin)); + EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); +} + +TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, + AllowedOriginsPolicy_FeatureDisabled) { + ChromeWebAuthenticationDelegateBase delegate; + // Feature explicitly disabled. + scoped_feature_list_.InitAndDisableFeature( + device::kWebAuthnRemoteDesktopAllowedOriginsPolicy); + + PrefService* prefs = + Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); + prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, + base::Value::List().Append(kExampleOrigin)); + + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); +} + +TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, + AllowedOriginsPolicy_MultipleValidURLs) { + ChromeWebAuthenticationDelegateBase delegate; + scoped_feature_list_.InitAndEnableFeature( + device::kWebAuthnRemoteDesktopAllowedOriginsPolicy); + + PrefService* prefs = + Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); + base::Value::List valid_origins; + valid_origins.Append(kExampleOrigin); + valid_origins.Append(kAnotherExampleOrigin); + prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, + std::move(valid_origins)); + + // Both origins specified in the policy should grant access. + EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); + EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL(kAnotherExampleOrigin)))); + + // An unrelated origin should not be allowed. + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), + url::Origin::Create(GURL("https://very.other.example.com")))); +} + +TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, + AllowedOriginsPolicy_SchemePortPathMismatch) { + ChromeWebAuthenticationDelegateBase delegate; + scoped_feature_list_.InitAndEnableFeature( + device::kWebAuthnRemoteDesktopAllowedOriginsPolicy); + PrefService* prefs = + Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); + + // Scheme mismatch. + prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, + base::Value::List().Append("https://example.com")); + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL("http://example.com")))); + + // Port mismatch. + prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, + base::Value::List().Append("https://example.com:1234")); + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL("https://example.com")))); + EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), + url::Origin::Create(GURL("https://example.com:5678")))); + + // Path mismatch (should be allowed because paths are ignored). + prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, + base::Value::List().Append("https://example.com/path")); + EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), url::Origin::Create(GURL("https://example.com")))); + EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( + browser_context(), + url::Origin::Create(GURL("https://example.com/otherpath")))); +} + +} // namespace
diff --git a/chrome/browser/webauthn/chrome_web_authentication_delegate_unittest.cc b/chrome/browser/webauthn/chrome_web_authentication_delegate_unittest.cc index 8da23769..06dd86b 100644 --- a/chrome/browser/webauthn/chrome_web_authentication_delegate_unittest.cc +++ b/chrome/browser/webauthn/chrome_web_authentication_delegate_unittest.cc
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/webauthn/chrome_web_authentication_delegate.h" - #include <cstdint> #include <memory> #include <optional> @@ -34,7 +32,6 @@ #include "content/public/browser/browser_context.h" #include "content/public/test/web_contents_tester.h" #include "device/fido/cable/cable_discovery_data.h" -#include "device/fido/features.h" #include "device/fido/fido_request_handler_base.h" #include "extensions/browser/extension_registry.h" #include "extensions/common/extension_builder.h" @@ -509,285 +506,4 @@ } } -class OriginMayUseRemoteDesktopClientOverrideTest - : public ChromeWebAuthenticationDelegateTest { - protected: - static constexpr char kCorpCrdOrigin[] = - "https://remotedesktop.corp.google.com"; - static constexpr char kCorpCrdAutopushOrigin[] = - "https://remotedesktop-autopush.corp.google.com/"; - static constexpr char kCorpCrdDailyOrigin[] = - "https://remotedesktop-daily-6.corp.google.com/"; - - const std::array<const char*, 3> kCorpCrdOrigins = { - kCorpCrdOrigin, kCorpCrdAutopushOrigin, kCorpCrdDailyOrigin}; - - static constexpr char kExampleOrigin[] = "https://example.com"; - static constexpr char kAnotherExampleOrigin[] = "https://another.example.com"; - - base::test::ScopedFeatureList scoped_feature_list_; -}; - -TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, - RemoteProxiedRequestsAllowedPolicy) { - // The "webauthn.remote_proxied_requests_allowed" policy pref should enable - // Google's internal CRD origin to use the RemoteDesktopClientOverride - // extension. - enum class Policy { - kUnset, - kDisabled, - kEnabled, - }; - ChromeWebAuthenticationDelegate delegate; - PrefService* prefs = - Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); - for (auto* origin : kCorpCrdOrigins) { - for (const auto policy : - {Policy::kUnset, Policy::kDisabled, Policy::kEnabled}) { - switch (policy) { - case Policy::kUnset: - prefs->ClearPref(webauthn::pref_names::kRemoteProxiedRequestsAllowed); - break; - case Policy::kDisabled: - prefs->SetBoolean(webauthn::pref_names::kRemoteProxiedRequestsAllowed, - false); - break; - case Policy::kEnabled: - prefs->SetBoolean(webauthn::pref_names::kRemoteProxiedRequestsAllowed, - true); - break; - } - - constexpr const char* const crd_origins[] = { - kCorpCrdOrigin, - kCorpCrdAutopushOrigin, - kCorpCrdDailyOrigin, - }; - EXPECT_EQ( - delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(origin))), - base::Contains(crd_origins, origin) && policy == Policy::kEnabled); - } - } -} - -TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, - AdditionalOriginSwitch_WithGooglePolicy) { - // The --webauthn-remote-proxied-requests-allowed-additional-origin switch - // allows passing an additional origin for testing. - ChromeWebAuthenticationDelegate delegate; - base::test::ScopedCommandLine scoped_command_line; - scoped_command_line.GetProcessCommandLine()->AppendSwitchASCII( - webauthn::switches::kRemoteProxiedRequestsAllowedAdditionalOrigin, - kExampleOrigin); - - // The flag shouldn't have an effect without the policy enabled. - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kCorpCrdOrigin)))); - - // With the policy enabled, both the hard-coded and flag origin should be - // allowed. - PrefService* prefs = - Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); - prefs->SetBoolean(webauthn::pref_names::kRemoteProxiedRequestsAllowed, true); - EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); - EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kCorpCrdOrigin)))); - - // Other origins still shouldn't be permitted. - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), - url::Origin::Create(GURL("https://other.example.com")))); -} - -TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, - AdditionalOriginSwitch_WithAllowedOriginsPolicy) { - // The --webauthn-remote-proxied-requests-allowed-additional-origin switch - // allows passing an additional origin for testing. This origin will be - // allowed if the kWebAuthnRemoteDesktopAllowedOriginsPolicy preference is set - // to a non-empty list of origins. If the policy is set, the command-line - // origin is treated as another allowed origin in addition to those specified - // by the policy. - ChromeWebAuthenticationDelegate delegate; - base::test::ScopedCommandLine scoped_command_line; - scoped_command_line.GetProcessCommandLine()->AppendSwitchASCII( - webauthn::switches::kRemoteProxiedRequestsAllowedAdditionalOrigin, - kExampleOrigin); - scoped_feature_list_.InitAndEnableFeature( - device::kWebAuthnRemoteDesktopAllowedOriginsPolicy); - - // Initially, no origins should be allowed because the allowed origins pref - // hasn't been set yet. - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kAnotherExampleOrigin)))); - - // Set the allowed origins pref to include another origin. - PrefService* prefs = - Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); - prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, - base::Value::List().Append(kAnotherExampleOrigin)); - - // Both the origin specified by the command-line switch and the origin in the - // allowed origins pref should be allowed. - EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); - EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kAnotherExampleOrigin)))); - - // Google Corp CRD origins are not affected by either the switch or this - // policy. - for (auto* origin : kCorpCrdOrigins) { - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(origin)))); - } - - // Origins not listed in either the switch or the policy remain disallowed. - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), - url::Origin::Create(GURL("https://very.other.example.com")))); -} - -TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, - AdditionalOriginSwitch_WithExplicitlyEmptyAllowedOriginsPolicy) { - // The --webauthn-remote-proxied-requests-allowed-additional-origin switch - // should be ignored when the allowed origins policy list is empty. - ChromeWebAuthenticationDelegate delegate; - base::test::ScopedCommandLine scoped_command_line; - scoped_command_line.GetProcessCommandLine()->AppendSwitchASCII( - webauthn::switches::kRemoteProxiedRequestsAllowedAdditionalOrigin, - kExampleOrigin); - scoped_feature_list_.InitAndEnableFeature( - device::kWebAuthnRemoteDesktopAllowedOriginsPolicy); - - PrefService* prefs = - Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); - - // Test with policy unset. - prefs->ClearPref(webauthn::pref_names::kRemoteDesktopAllowedOrigins); - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); - - // Test with policy explicitly empty. - prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, - base::Value::List()); - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); -} - -TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, - AllowedOriginsPolicy_InvalidURLs) { - ChromeWebAuthenticationDelegate delegate; - scoped_feature_list_.InitAndEnableFeature( - device::kWebAuthnRemoteDesktopAllowedOriginsPolicy); - - PrefService* prefs = - Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); - - const std::vector<std::string> invalid_origins = { - "invalid", - "http://", - "example.com", // Missing scheme - "https://example.com:invalidport", - }; - - base::Value::List invalid_origins_list; - for (const auto& origin : invalid_origins) { - invalid_origins_list.Append(origin); - } - prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, - std::move(invalid_origins_list)); - - // None of the above invalid origins should grant access. - for (const auto& origin : invalid_origins) { - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(origin)))); - } - - // A valid one, added for good measure, should still work. - prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, - base::Value::List().Append(kExampleOrigin)); - EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); -} - -TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, - AllowedOriginsPolicy_FeatureDisabled) { - ChromeWebAuthenticationDelegate delegate; - // Feature explicitly disabled. - scoped_feature_list_.InitAndDisableFeature( - device::kWebAuthnRemoteDesktopAllowedOriginsPolicy); - - PrefService* prefs = - Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); - prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, - base::Value::List().Append(kExampleOrigin)); - - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); -} - -TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, - AllowedOriginsPolicy_MultipleValidURLs) { - ChromeWebAuthenticationDelegate delegate; - scoped_feature_list_.InitAndEnableFeature( - device::kWebAuthnRemoteDesktopAllowedOriginsPolicy); - - PrefService* prefs = - Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); - base::Value::List valid_origins; - valid_origins.Append(kExampleOrigin); - valid_origins.Append(kAnotherExampleOrigin); - prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, - std::move(valid_origins)); - - // Both origins specified in the policy should grant access. - EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kExampleOrigin)))); - EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL(kAnotherExampleOrigin)))); - - // An unrelated origin should not be allowed. - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), - url::Origin::Create(GURL("https://very.other.example.com")))); -} - -TEST_F(OriginMayUseRemoteDesktopClientOverrideTest, - AllowedOriginsPolicy_SchemePortPathMismatch) { - ChromeWebAuthenticationDelegate delegate; - scoped_feature_list_.InitAndEnableFeature( - device::kWebAuthnRemoteDesktopAllowedOriginsPolicy); - PrefService* prefs = - Profile::FromBrowserContext(GetBrowserContext())->GetPrefs(); - - // Scheme mismatch. - prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, - base::Value::List().Append("https://example.com")); - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL("http://example.com")))); - - // Port mismatch. - prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, - base::Value::List().Append("https://example.com:1234")); - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL("https://example.com")))); - EXPECT_FALSE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), - url::Origin::Create(GURL("https://example.com:5678")))); - - // Path mismatch (should be allowed because paths are ignored). - prefs->SetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins, - base::Value::List().Append("https://example.com/path")); - EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), url::Origin::Create(GURL("https://example.com")))); - EXPECT_TRUE(delegate.OriginMayUseRemoteDesktopClientOverride( - browser_context(), - url::Origin::Create(GURL("https://example.com/otherpath")))); -} - } // namespace
diff --git a/chrome/browser/webauthn/enclave_authenticator_browsertest.cc b/chrome/browser/webauthn/enclave_authenticator_browsertest.cc index b7f4d7f..d054f1e 100644 --- a/chrome/browser/webauthn/enclave_authenticator_browsertest.cc +++ b/chrome/browser/webauthn/enclave_authenticator_browsertest.cc
@@ -508,7 +508,7 @@ rp: { name: "www.example.com" }, user: { id: new Uint8Array([1]), - name: "bar@example.com", + name: "test@gmail.com", displayName: "Foo Bar" }, pubKeyCredParams: [{type: "public-key", alg: -7}], @@ -518,6 +518,36 @@ e => window.domAutomationController.send('error ' + e)); })())"; +static constexpr char kMakeCredentialConditionalCreateWithExcludeList[] = + R"((() => { + const base64ToArrayBuffer = (base64) => { + const bytes = window.atob(base64); + const len = bytes.length; + const ret = new Uint8Array(len); + for (var i = 0; i < len; i++) { + ret[i] = bytes.charCodeAt(i); + } + return ret.buffer; + } + return navigator.credentials.create({ + mediation: "conditional", + publicKey: { + rp: { name: "www.example.com" }, + user: { + id: new Uint8Array([1]), + name: "test@gmail.com", + displayName: "Foo Bar" + }, + pubKeyCredParams: [{type: "public-key", alg: -7}], + challenge: new Uint8Array([0]), + excludeCredentials: [{type: "public-key", + transports: [], + id: base64ToArrayBuffer("$1")}], + } + }).then(c => window.domAutomationController.send('webauthn: ' + c.id), + e => window.domAutomationController.send('error ' + e)); +})())"; + bool IsReady(GPMEnclaveController::AccountState state) { switch (state) { case GPMEnclaveController::AccountState::kReady: @@ -4091,12 +4121,25 @@ saved_form.signon_realm = https_server_.GetURL("example.com", "/").spec(); saved_form.url = https_server_.GetURL("example.com", "/password/prefilled_username.html"); - saved_form.username_value = u"bar@example.com"; + saved_form.username_value = base::UTF8ToUTF16(std::string(kEmail)); saved_form.password_value = u"hunter1"; saved_form.date_last_used = last_used; password_store()->AddLogin(saved_form); } + sync_pb::WebauthnCredentialSpecifics InjectPasskey() { + sync_pb::WebauthnCredentialSpecifics passkey; + CHECK(passkey.ParseFromArray(kTestProtobuf, sizeof(kTestProtobuf))); + // Sync ID and credential ID must be 16 bytes long. + passkey.set_sync_id(base::RandBytesAsString(16)); + passkey.set_credential_id(base::RandBytesAsString(16)); + passkey.set_user_id(base::RandBytesAsString(16)); + passkey.set_user_name(kEmail); + passkey.set_user_display_name(kEmail); + passkey_model()->AddNewPasskeyForTesting(passkey); + return passkey; + } + base::test::ScopedFeatureList scoped_feature_list_; }; @@ -4131,6 +4174,24 @@ } IN_PROC_BROWSER_TEST_P(EnclaveAuthenticatorConditionalCreateBrowserTest, + ConditionalCreate_FailsWithoutBootstrappedEnclave) { + ASSERT_TRUE(ui_test_utils::NavigateToURL( + browser(), https_server_.GetURL("www.example.com", "/title1.html"))); + + InjectPassword(base::Time::Now()); + + content::WebContents* web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + content::DOMMessageQueue message_queue(web_contents); + content::ExecuteScriptAsync(web_contents, kMakeCredentialConditionalCreate); + delegate_observer()->WaitForUI(); + + std::string script_result; + ASSERT_TRUE(message_queue.WaitForMessage(&script_result)); + EXPECT_THAT(script_result, testing::HasSubstr("NotAllowedError")); +} + +IN_PROC_BROWSER_TEST_P(EnclaveAuthenticatorConditionalCreateBrowserTest, ConditionalCreate_FailsWithoutMatchingPassword) { ASSERT_TRUE(ui_test_utils::NavigateToURL( browser(), https_server_.GetURL("www.example.com", "/title1.html"))); @@ -4147,6 +4208,41 @@ ASSERT_TRUE(message_queue.WaitForMessage(&script_result)); EXPECT_THAT(script_result, testing::HasSubstr("NotAllowedError")); } + +IN_PROC_BROWSER_TEST_P(EnclaveAuthenticatorConditionalCreateBrowserTest, + ConditionalCreate_ExcludeListMatch) { + ASSERT_TRUE(ui_test_utils::NavigateToURL( + browser(), https_server_.GetURL("www.example.com", "/title1.html"))); + + BootstrapEnclave(); + sync_pb::WebauthnCredentialSpecifics passkey = InjectPasskey(); + + content::WebContents* web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + content::DOMMessageQueue message_queue(web_contents); + std::string script = base::ReplaceStringPlaceholders( + kMakeCredentialConditionalCreateWithExcludeList, + {base::Base64Encode(passkey.credential_id())}, + /*offsets=*/nullptr); + content::ExecuteScriptAsync(web_contents, script); + delegate_observer()->WaitForUI(); + + // It shouldn't be possible to test the matches on an exclude list without + // also having an upgrade eligible password for the request. I.e., without an + // upgrade-eligible password, this create() request results in the generic + // NotAllowedError, rather than the exclude-list specific InvalidStateError. + std::string script_result; + ASSERT_TRUE(message_queue.WaitForMessage(&script_result)); + EXPECT_THAT(script_result, testing::HasSubstr("NotAllowedError")); + + // With an upgrade eligible password, we signal the exclude list match with an + // InvalidStateError. + InjectPassword(base::Time::Now()); + content::ExecuteScriptAsync(web_contents, script); + ASSERT_TRUE(message_queue.WaitForMessage(&script_result)); + EXPECT_THAT(script_result, testing::HasSubstr("InvalidStateError")); +} + } // namespace #endif // !defined(MEMORY_SANITIZER)
diff --git a/chrome/browser/webauthn/gpm_enclave_controller.cc b/chrome/browser/webauthn/gpm_enclave_controller.cc index 183e3ab..862ad3f 100644 --- a/chrome/browser/webauthn/gpm_enclave_controller.cc +++ b/chrome/browser/webauthn/gpm_enclave_controller.cc
@@ -974,14 +974,8 @@ case AccountState::kRecoverable: case AccountState::kIrrecoverable: - if (base::FeatureList::IsEnabled( - device::kWebAuthnNeverSkipTrustThisComputer) || - model_->priority_phone_name.has_value()) { - device::enclave::RecordEvent(device::enclave::Event::kOnboarding); - model_->SetStep(Step::kTrustThisComputerAssertion); - } else { - RecoverSecurityDomain(); - } + device::enclave::RecordEvent(device::enclave::Event::kOnboarding); + model_->SetStep(Step::kTrustThisComputerAssertion); break; case AccountState::kLoading:
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index 07917748..3772d5e3 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1741088714-fdcf65377f76b094998ab2c0ca222f45d0f47b71-673f1988184476555d9ebe2e8ea268e5900d5dc6.profdata +chrome-android32-main-1741111187-6c08bc6497ed860ba4cf1303bc0f6ba5ebec955d-2d602b9707b9aab83906ca20756404b51a0b7c22.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt index d8849f6..e46e0a2 100644 --- a/chrome/build/android-arm64.pgo.txt +++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@ -chrome-android64-main-1741089797-e328dfc2e540a04ef984897fca593408ea3605cd-28b5f775033cb398a2d250028cc9489145d55255.profdata +chrome-android64-main-1741110989-fe8521e6473bc4ed5150b62e1ba0ead98b9922c1-3bbb70f1162afa6e8f87737b1e9ac865a0d8a302.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index ed1a35d91..e4904574 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1741045993-780b669d45462dc79a68873e9092915fbf23efea-284be74f3fcbb7868cb37a8f85da41d5aab9aca5.profdata +chrome-linux-main-1741111187-51254b64810931f07c96c8d0ffd4e25585288243-2d602b9707b9aab83906ca20756404b51a0b7c22.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index ff422841..7a2c65aa 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1741096688-a9de7a39fbb0b1ccbef5282952fefc04b303d049-7e283e4fc02168f6dce0728479c176d23ad85d64.profdata +chrome-mac-arm-main-1741103983-f1362b8f0f27a2c5746775fff156f93a564d6c93-90bfc3d59c327a925ca3a286343bc896e0bdbf24.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index bcf101cd..d8d1c1c6 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1741078434-64bb5cb02d71486fd43b5a56877b9ce91b850b9d-5eb7ce52b65b1873666deb1a685b83d7e074b85b.profdata +chrome-win32-main-1741088714-0964945f121b37c383714b49c77a9973246dc054-673f1988184476555d9ebe2e8ea268e5900d5dc6.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index ac066e4..9190c50 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1741078434-72b6e3663dee4a46bcaab30a8fa62c2dbbb7de38-5eb7ce52b65b1873666deb1a685b83d7e074b85b.profdata +chrome-win64-main-1741088714-4ca03fa191c73de8e4e9df488ce97e82a0cfd370-673f1988184476555d9ebe2e8ea268e5900d5dc6.profdata
diff --git a/chrome/chrome_paks.gni b/chrome/chrome_paks.gni index 8f146e2..98745f8 100644 --- a/chrome/chrome_paks.gni +++ b/chrome/chrome_paks.gni
@@ -540,12 +540,6 @@ "//chrome/browser/resources/signin/signout_confirmation:resources", ] } - - if (enable_webui_generate_code_cache) { - sources += - [ "$root_gen_dir/ui/webui/resources/webui_code_cache_resources.pak" ] - deps += [ "//ui/webui/resources:code_cache_resources" ] - } } }
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 67beb79..616ca6d 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h
@@ -2906,17 +2906,6 @@ // "xkb:us::eng". inline constexpr char kHardwareKeyboardLayout[] = "intl.hardware_keyboard"; -// A boolean pref of the auto-enrollment decision. Its value is only valid if -// it's not the default value; otherwise, no auto-enrollment decision has been -// made yet. -inline constexpr char kShouldAutoEnroll[] = "ShouldAutoEnroll"; - -// A boolean pref of the private-set-membership decision. Its value is only -// valid if it's not the default value; otherwise, no private-set-membership -// decision has been made yet. -inline constexpr char kShouldRetrieveDeviceState[] = - "ShouldRetrieveDeviceState"; - // An integer pref. Its valid values are defined in // enterprise_management::DeviceRegisterRequest::PsmExecutionResult enum which // indicates all possible PSM execution results in the Chrome OS enrollment @@ -2928,12 +2917,6 @@ inline constexpr char kEnrollmentPsmDeterminationTime[] = "EnrollmentPsmDeterminationTime"; -// An integer pref with the maximum number of bits used by the client in a -// previous auto-enrollment request. If the client goes through an auto update -// during OOBE and reboots into a version of the OS with a larger maximum -// modulus, then it will retry auto-enrollment using the updated value. -inline constexpr char kAutoEnrollmentPowerLimit[] = "AutoEnrollmentPowerLimit"; - // The local state pref that stores device activity times before reporting // them to the policy server. inline constexpr char kDeviceActivityTimes[] = "device_status.activity_times";
diff --git a/chrome/release_scripts b/chrome/release_scripts index a81411f..5ff9f16 160000 --- a/chrome/release_scripts +++ b/chrome/release_scripts
@@ -1 +1 @@ -Subproject commit a81411f66a51ecb8f390eb54748e12bddb5056c5 +Subproject commit 5ff9f1605f25a18340342ea1719b517b808d3443
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 897364b1..a913cf66 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -6087,7 +6087,6 @@ "../browser/preloading/prefetch/prefetch_service/prefetch_origin_decider_unittest.cc", "../browser/preloading/preloading_prefs_unittest.cc", "../browser/privacy/privacy_metrics_service_unittest.cc", - "../browser/privacy_sandbox/privacy_sandbox_notice_service_unittest.cc", "../browser/privacy_sandbox/privacy_sandbox_policy_handler_unittest.cc", "../browser/privacy_sandbox/privacy_sandbox_service_impl_unittest.cc", "../browser/privacy_sandbox/privacy_sandbox_settings_delegate_unittest.cc", @@ -6194,6 +6193,7 @@ "../browser/visibility_timer_tab_helper_unittest.cc", "../browser/visited_url_ranking/url_deduplication/search_engine_url_strip_handler_unittest.cc", "../browser/vr/vr_tab_helper_unittest.cc", + "../browser/webauthn/chrome_web_authentication_delegate_base_unittest.cc", "../browser/webid/federated_identity_account_keyed_permission_context_unittest.cc", "../browser/webid/federated_identity_api_permission_context_unittest.cc", "../browser/webid/federated_identity_auto_reauthn_permission_context_unittest.cc",
diff --git a/chrome/test/chromedriver/chrome/chrome_impl.cc b/chrome/test/chromedriver/chrome/chrome_impl.cc index 9b359e7..c6bdc01 100644 --- a/chrome/test/chromedriver/chrome/chrome_impl.cc +++ b/chrome/test/chromedriver/chrome/chrome_impl.cc
@@ -241,6 +241,9 @@ *web_view = view.get(); return Status(kOk); } + if (!view->IsTab()) { + continue; + } WebView* active_page = nullptr; if (!view->GetActivePage(&active_page).IsError()) { if (active_page->GetId() == id) {
diff --git a/chrome/test/chromedriver/chrome/web_view_impl.cc b/chrome/test/chromedriver/chrome/web_view_impl.cc index af7ed32..25fb240 100644 --- a/chrome/test/chromedriver/chrome/web_view_impl.cc +++ b/chrome/test/chromedriver/chrome/web_view_impl.cc
@@ -651,6 +651,10 @@ } Status WebViewImpl::GetActivePage(WebView** web_view) { + auto* page_tracker = GetTab()->GetPageTracker(); + if (!page_tracker) { + return Status(kUnknownError, "page tracker not found"); + } return GetTab()->GetPageTracker()->GetActivePage(web_view); }
diff --git a/chrome/test/chromedriver/session.cc b/chrome/test/chromedriver/session.cc index 07561d8..64975f7d1 100644 --- a/chrome/test/chromedriver/session.cc +++ b/chrome/test/chromedriver/session.cc
@@ -150,13 +150,18 @@ return Status(kNoSuchWindow, "target window already closed", status); } - Timeout timeout; - status = tab->WaitForPendingActivePage(timeout); - if (status.IsError()) { - return status; - } + if (tab->IsTab()) { + Timeout timeout; + status = tab->WaitForPendingActivePage(timeout); + if (status.IsError()) { + return status; + } - status = tab->GetActivePage(web_view); + status = tab->GetActivePage(web_view); + } else { + // If target window is not a tab (eg. webview), return it as is. + *web_view = tab; + } return status; }
diff --git a/chrome/test/data/banners/manifest_with_use_counter_fields.json b/chrome/test/data/banners/manifest_with_use_counter_fields.json new file mode 100644 index 0000000..58ffa6a7 --- /dev/null +++ b/chrome/test/data/banners/manifest_with_use_counter_fields.json
@@ -0,0 +1,46 @@ +{ + "name": "Manifest with use counter fields", + "icons": [ + { + "src": "launcher-icon-1x.png", + "sizes": "48x48", + "type": "image/png" + } + ], + "screenshots": [ + { + "src": "screenshot1-portrait.jpeg", + "type": "image/jpeg", + "sizes": "409x728", + "form_factor": "narrow", + "label": "a narrow screenshot" + } + ], + "start_url": "different_manifest_test_page.html", + "display": "fullscreen", + "scope": "/banners/scope_a/", + "lock_screen": { + "notifications": true + }, + "note_taking": { + "new_note_url": "/banners/scope_a/new_note.html" + }, + "prefer_related_applications": true, + "related_applications": [ + { + "platform": "play", + "id": "com.example.hiking-app" + }, + { + "platform": "windows", + "url": "https://example.com" + } + ], + "theme_color": "#FFFFFF", + "background_color": "#000000", + "permissions_policy": { + "geolocation": ["https://example.com"], + "microphone": ["https://example.com"] + }, + "version": "1.0.0" +}
diff --git a/chrome/test/data/webui/bookmarks/command_manager_test.ts b/chrome/test/data/webui/bookmarks/command_manager_test.ts index f87ea2d..9d1418f 100644 --- a/chrome/test/data/webui/bookmarks/command_manager_test.ts +++ b/chrome/test/data/webui/bookmarks/command_manager_test.ts
@@ -5,11 +5,10 @@ import type {BookmarksFolderNodeElement, BookmarksItemElement, BookmarksListElement, SelectFolderAction, SelectItemsAction} from 'chrome://bookmarks/bookmarks.js'; import {BookmarkManagerApiProxyImpl, BookmarksApiProxyImpl, BookmarksCommandManagerElement, Command, createBookmark, DialogFocusManager, getDisplayedList, MenuSource, selectFolder, setDebouncerForTesting} from 'chrome://bookmarks/bookmarks.js'; import {isMac} from 'chrome://resources/js/platform.js'; -import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertDeepEquals, assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {pressAndReleaseKeyOn} from 'chrome://webui-test/keyboard_mock_interactions.js'; import type {ModifiersParam} from 'chrome://webui-test/keyboard_mock_interactions.js'; -import {microtasksFinished} from 'chrome://webui-test/test_util.js'; +import {eventToPromise, microtasksFinished} from 'chrome://webui-test/test_util.js'; import {TestBookmarkManagerApiProxy} from './test_bookmark_manager_api_proxy.js'; import {TestBookmarksApiProxy} from './test_bookmarks_api_proxy.js'; @@ -480,7 +479,7 @@ let store: TestStore; let bookmarkManagerProxy: TestBookmarkManagerApiProxy; - setup(function() { + setup(async function() { store = new TestStore({ nodes: testTree(createFolder( '1', @@ -510,13 +509,13 @@ rootNode.itemId = '1'; rootNode.depth = 0; document.body.appendChild(rootNode); - flush(); document.body.appendChild(document.createElement('cr-toast-manager')); + await eventToPromise('viewport-filled', list.$.list); items = list.shadowRoot!.querySelectorAll<BookmarksItemElement>( 'bookmarks-item'); // Wait for the flushed properties to propagate to the item elements' DOMs. - return microtasksFinished(); + await microtasksFinished(); }); function simulateDoubleClick(element: HTMLElement, config?: MouseEventInit) {
diff --git a/chrome/test/data/webui/bookmarks/dnd_manager_test.ts b/chrome/test/data/webui/bookmarks/dnd_manager_test.ts index 8889e70f..891eaf15 100644 --- a/chrome/test/data/webui/bookmarks/dnd_manager_test.ts +++ b/chrome/test/data/webui/bookmarks/dnd_manager_test.ts
@@ -8,6 +8,7 @@ import {assertDeepEquals, assertEquals, assertFalse, assertNotReached, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {middleOfNode, topLeftOfNode} from 'chrome://webui-test/mouse_mock_interactions.js'; import {flushTasks} from 'chrome://webui-test/polymer_test_util.js'; +import {eventToPromise} from 'chrome://webui-test/test_util.js'; import {TestBookmarkManagerApiProxy} from './test_bookmark_manager_api_proxy.js'; import {TestBookmarksBrowserProxy} from './test_browser_proxy.js'; @@ -35,7 +36,7 @@ } function getListItem(id: string) { - const items = list.root!.querySelectorAll('bookmarks-item'); + const items = list.shadowRoot.querySelectorAll('bookmarks-item'); for (let i = 0; i < items.length; i++) { if (items[i]!.itemId === id) { return items[i] as BookmarksItemElement; @@ -150,9 +151,14 @@ // Wait for the API listener to call the browser proxy, since this // indicates initialization is done. - return testBrowserProxy.whenCalled('getIncognitoAvailability').then(() => { - flush(); - }); + return Promise + .all([ + testBrowserProxy.whenCalled('getIncognitoAvailability'), + eventToPromise('viewport-filled', list.$.list), + ]) + .then(() => { + flush(); + }); }); test('dragInfo isDraggingFolderToDescendant', function() { @@ -371,7 +377,7 @@ // displayed lists. store.data.selectedFolder = '111'; store.notifyObservers(); - flush(); + await eventToPromise('viewport-filled', list.$.list); bookmarkManagerApi.onDragEnter.callListeners(createDragData(['11'])); dragTarget = getListItem('1111');
diff --git a/chrome/test/data/webui/bookmarks/list_test.ts b/chrome/test/data/webui/bookmarks/list_test.ts index 18cb596..39a441f 100644 --- a/chrome/test/data/webui/bookmarks/list_test.ts +++ b/chrome/test/data/webui/bookmarks/list_test.ts
@@ -4,10 +4,8 @@ import type {BookmarksAppElement, BookmarksItemElement, BookmarksListElement, SelectItemsAction} from 'chrome://bookmarks/bookmarks.js'; import {BrowserProxyImpl, Command, MenuSource, removeBookmark} from 'chrome://bookmarks/bookmarks.js'; -import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertDeepEquals, assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; -import {flushTasks, waitAfterNextRender} from 'chrome://webui-test/polymer_test_util.js'; -import {microtasksFinished} from 'chrome://webui-test/test_util.js'; +import {eventToPromise, microtasksFinished} from 'chrome://webui-test/test_util.js'; import {TestBookmarksBrowserProxy} from './test_browser_proxy.js'; import {TestStore} from './test_store.js'; @@ -37,7 +35,7 @@ list.style.position = 'absolute'; replaceBody(list); - flush(); + return eventToPromise('viewport-filled', list.$.list); }); test('renders correct <bookmark-item> elements', function() { @@ -75,23 +73,23 @@ assertEquals('deselect-items', lastAction.name); }); - test('adds, deletes, and moves update displayedList_', function() { + test('adds, deletes, and moves update displayedList_', async () => { list.setDisplayedIdsForTesting(['1', '7', '3', '5']); - flush(); + await eventToPromise('viewport-filled', list.$.list); let items = list.shadowRoot!.querySelectorAll('bookmarks-item'); assertDeepEquals( ['1', '7', '3', '5'], Array.from(items).filter(i => !i.hidden).map(i => i.itemId)); list.setDisplayedIdsForTesting(['1', '3', '5']); - flush(); + await eventToPromise('viewport-filled', list.$.list); items = list.shadowRoot!.querySelectorAll('bookmarks-item'); assertDeepEquals( ['1', '3', '5'], Array.from(items).filter(i => !i.hidden).map(i => i.itemId)); list.setDisplayedIdsForTesting(['1', '3', '7', '5']); - flush(); + await eventToPromise('viewport-filled', list.$.list); items = list.shadowRoot!.querySelectorAll('bookmarks-item'); assertDeepEquals( ['1', '3', '7', '5'], @@ -114,7 +112,7 @@ let store: TestStore; let items: NodeListOf<BookmarksItemElement>; - setup(function() { + setup(async function() { store = new TestStore({ nodes: testTree(createFolder( '10', @@ -136,7 +134,7 @@ list.style.position = 'absolute'; replaceBody(list); - flush(); + await eventToPromise('viewport-filled', list.$.list); items = list.shadowRoot!.querySelectorAll('bookmarks-item'); }); @@ -199,8 +197,11 @@ assertEquals('9', store.data.selection.anchor); // customClick does not set focus like a real click does. - list.$.list.focusItem(4); - await waitAfterNextRender(list); + await list.$.list.ensureItemRendered(4); + const item = list.$.list.domItems()[4]; + assertTrue(!!item); + (item as HTMLElement).focus(); + await microtasksFinished(); assertEquals( '9', (list.shadowRoot?.activeElement as BookmarksItemElement | null) @@ -218,12 +219,12 @@ store.endBatchUpdate(); // Let `list` update its dom. - await waitAfterNextRender(list); + await eventToPromise('viewport-filled', list.$.list); // `list` internally uses setTimeout to trigger focus after deletion. Using - // `flushTasks` here should force assertions to run after focus has been - // updated. - await flushTasks(); + // `microtasksFinished` here should force assertions to run after focus has + // been updated. + await microtasksFinished(); // The element immediately preceding the deleted '9' should now be focused. assertEquals( @@ -256,7 +257,7 @@ replaceBody(app); - flush(); + return microtasksFinished(); }); test('show context menu', async () => {
diff --git a/chrome/updater/test/run_all_unittests.cc b/chrome/updater/test/run_all_unittests.cc index 1d516d5..7b3d83ba 100644 --- a/chrome/updater/test/run_all_unittests.cc +++ b/chrome/updater/test/run_all_unittests.cc
@@ -2,10 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/390223051): Remove C-library calls to fix the errors. -#pragma allow_unsafe_libc_calls -#endif +#include <cstdlib> +#include <string_view> #include "base/base_paths.h" #include "base/check.h" @@ -30,8 +28,6 @@ #if BUILDFLAG(IS_WIN) #include <shlobj.h> -#include <cstdlib> -#include <cstring> #include <memory> #include <string> @@ -214,20 +210,23 @@ // Set up the _NT_ALT_SYMBOL_PATH to get symbolized stack traces in logs. ScopedSymbolPath scoped_symbol_path_system(/*is_system=*/true); ScopedSymbolPath scoped_symbol_path_user(/*is_system=*/false); -#endif +#endif // BUILDFLAG(IS_WIN) // Assume all test bots have the {ISOLATED_OUTDIR} environment variable set. // Otherwise, don't run branded updater tests on a developer's system because // doing so breaks the updater on the system. - if (!std::getenv("ISOLATED_OUTDIR") && - std::strcmp(PRODUCT_FULLNAME_STRING, "ChromiumUpdater")) { - LOG(ERROR) << "Running branded updater tests breaks the updater for the " - "branded browser. This is unavoidable in the current " - "implementation. If you don't care about broken updaters and " - "want to run the branded updater tests locally, define an " - "environment variable ISOLATED_OUTDIR and set it to a local " - "directory."; - return -1; + using std::operator""sv; + if constexpr ("ChromiumUpdater"sv.compare(PRODUCT_FULLNAME_STRING)) { + if (!std::getenv("ISOLATED_OUTDIR")) { + LOG(ERROR) + << "Running branded updater tests breaks the updater for " + "the branded browser. This is unavoidable in the current " + "implementation. If you don't care about broken updaters and " + "want to run the branded updater tests locally, define an " + "environment variable ISOLATED_OUTDIR and set it to a local " + "directory."; + return -1; + } } // Use the {ISOLATED_OUTDIR} as a log destination for the test suite.
diff --git a/chromeos/ash/components/boca/boca_session_manager.cc b/chromeos/ash/components/boca/boca_session_manager.cc index 872818952..75727003 100644 --- a/chromeos/ash/components/boca/boca_session_manager.cc +++ b/chromeos/ash/components/boca/boca_session_manager.cc
@@ -98,6 +98,8 @@ void BocaSessionManager::Observer::OnLocalCaptionConfigUpdated( const ::boca::CaptionsConfig& config) {} +void BocaSessionManager::Observer::OnLocalCaptionClosed() {} + void BocaSessionManager::Observer::OnSessionRosterUpdated( const ::boca::Roster& roster) {} @@ -310,13 +312,15 @@ observer.OnLocalCaptionConfigUpdated(std::move(caption_config)); } is_local_caption_enabled_ = caption_config.captions_enabled(); - if (is_producer_) { - notification_handler_.HandleCaptionNotification( - message_center::MessageCenter::Get(), is_local_caption_enabled_, - GetSessionConfigSafe(current_session_.get()) - .captions_config() - .captions_enabled()); + HandleCaptionNotification(); +} + +void BocaSessionManager::NotifyLocalCaptionClosed() { + for (auto& observer : observers_) { + observer.OnLocalCaptionClosed(); } + is_local_caption_enabled_ = false; + HandleCaptionNotification(); } void BocaSessionManager::NotifyAppReload() { @@ -523,11 +527,7 @@ current_session_ ? current_session_->tachyon_group_id() : std::string()); } - if (is_producer_) { - notification_handler_.HandleCaptionNotification( - message_center::MessageCenter::Get(), is_local_caption_enabled_, - current_session_caption_config.captions_enabled()); - } + HandleCaptionNotification(); } } @@ -628,4 +628,15 @@ } } +void BocaSessionManager::HandleCaptionNotification() { + if (!is_producer_) { + return; + } + notification_handler_.HandleCaptionNotification( + message_center::MessageCenter::Get(), is_local_caption_enabled_, + GetSessionConfigSafe(current_session_.get()) + .captions_config() + .captions_enabled()); +} + } // namespace ash::boca
diff --git a/chromeos/ash/components/boca/boca_session_manager.h b/chromeos/ash/components/boca/boca_session_manager.h index 6849693..3a4dda43 100644 --- a/chromeos/ash/components/boca/boca_session_manager.h +++ b/chromeos/ash/components/boca/boca_session_manager.h
@@ -124,6 +124,10 @@ virtual void OnLocalCaptionConfigUpdated( const ::boca::CaptionsConfig& config); + // Notifies when local caption is disabled from a source other than the boca + // app. + virtual void OnLocalCaptionClosed(); + // Notifies when session roster updated. Will emit when only elements order // changed in the vector too. Deferred to events consumer to decide on // the actual action. @@ -173,6 +177,8 @@ // Local events. virtual void NotifyLocalCaptionEvents(::boca::CaptionsConfig caption_config); + virtual void NotifyLocalCaptionClosed(); + // Triggered by SWA delegate to notify app reload events. virtual void NotifyAppReload(); @@ -215,6 +221,7 @@ void StartSendingStudentHeartbeatRequests(); void StopSendingStudentHeartbeatRequests(); void SendStudentHeartbeatRequest(); + void HandleCaptionNotification(); const bool is_producer_; bool is_app_opened_ = false;
diff --git a/chromeos/ash/components/boca/boca_session_manager_unittest.cc b/chromeos/ash/components/boca/boca_session_manager_unittest.cc index 3c319c5..fd27234 100644 --- a/chromeos/ash/components/boca/boca_session_manager_unittest.cc +++ b/chromeos/ash/components/boca/boca_session_manager_unittest.cc
@@ -101,6 +101,7 @@ ((const std::map<std::string, ::boca::StudentStatus>& activities)), (override)); MOCK_METHOD(void, OnAppReloaded, (), (override)); + MOCK_METHOD(void, OnLocalCaptionClosed, (), (override)); }; class MockBocaAppClient : public BocaAppClient { @@ -821,6 +822,13 @@ BocaAppClient::Get()->GetSessionManager()->NotifyLocalCaptionEvents(config); } +TEST_F(BocaSessionManagerTest, NotifyLocalCaptionClosed) { + EXPECT_CALL(*boca_app_client(), GetIdentityManager()) + .WillOnce(Return(identity_manager())); + EXPECT_CALL(*observer(), OnLocalCaptionClosed()).Times(1); + BocaAppClient::Get()->GetSessionManager()->NotifyLocalCaptionClosed(); +} + TEST_F(BocaSessionManagerTest, NotifyAppReloadEvent) { EXPECT_CALL(*boca_app_client(), GetIdentityManager()) .WillOnce(Return(identity_manager()));
diff --git a/chromeos/ash/components/dbus/concierge/concierge_client.cc b/chromeos/ash/components/dbus/concierge/concierge_client.cc index 6c0d4cf1..2c23b64d 100644 --- a/chromeos/ash/components/dbus/concierge/concierge_client.cc +++ b/chromeos/ash/components/dbus/concierge/concierge_client.cc
@@ -310,6 +310,13 @@ CallMethod(concierge::kMuteVmAudioMethod, request, std::move(callback)); } + void SetUpVmUser( + const vm_tools::concierge::SetUpVmUserRequest& request, + chromeos::DBusMethodCallback<vm_tools::concierge::SetUpVmUserResponse> + callback) override { + CallMethod(concierge::kSetUpVmUserMethod, request, std::move(callback)); + } + void Init(dbus::Bus* bus) override { concierge_proxy_ = bus->GetObjectProxy( concierge::kVmConciergeServiceName,
diff --git a/chromeos/ash/components/dbus/concierge/concierge_client.h b/chromeos/ash/components/dbus/concierge/concierge_client.h index 8747d15..cf4327c 100644 --- a/chromeos/ash/components/dbus/concierge/concierge_client.h +++ b/chromeos/ash/components/dbus/concierge/concierge_client.h
@@ -318,6 +318,13 @@ chromeos::DBusMethodCallback<vm_tools::concierge::SuccessFailureResponse> callback) = 0; + // Sets up a vm user via maitred. + // |callback| is called after the method call finishes. + virtual void SetUpVmUser( + const vm_tools::concierge::SetUpVmUserRequest& request, + chromeos::DBusMethodCallback<vm_tools::concierge::SetUpVmUserResponse> + callback) = 0; + // Creates and initializes the global instance. |bus| must not be null. static void Initialize(dbus::Bus* bus);
diff --git a/chromeos/ash/components/dbus/concierge/fake_concierge_client.cc b/chromeos/ash/components/dbus/concierge/fake_concierge_client.cc index 21f9305..4f6560b 100644 --- a/chromeos/ash/components/dbus/concierge/fake_concierge_client.cc +++ b/chromeos/ash/components/dbus/concierge/fake_concierge_client.cc
@@ -453,6 +453,14 @@ FROM_HERE, base::BindOnce(std::move(callback), mute_vm_audio_response_)); } +void FakeConciergeClient::SetUpVmUser( + const vm_tools::concierge::SetUpVmUserRequest& request, + chromeos::DBusMethodCallback<vm_tools::concierge::SetUpVmUserResponse> + callback) { + base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), set_up_vm_user_response_)); +} + void FakeConciergeClient::NotifyVmStarted( const vm_tools::concierge::VmStartedSignal& signal) { // Now GetVmInfo can return success.
diff --git a/chromeos/ash/components/dbus/concierge/fake_concierge_client.h b/chromeos/ash/components/dbus/concierge/fake_concierge_client.h index 8769f6f..26e4b13 100644 --- a/chromeos/ash/components/dbus/concierge/fake_concierge_client.h +++ b/chromeos/ash/components/dbus/concierge/fake_concierge_client.h
@@ -179,6 +179,11 @@ chromeos::DBusMethodCallback<vm_tools::concierge::SuccessFailureResponse> callback) override; + void SetUpVmUser( + const vm_tools::concierge::SetUpVmUserRequest& request, + chromeos::DBusMethodCallback<vm_tools::concierge::SetUpVmUserResponse> + callback) override; + const base::ObserverList<Observer>& observer_list() const { return observer_list_; } @@ -373,12 +378,19 @@ aggressive_balloon_response) { aggressive_balloon_response_ = aggressive_balloon_response; } + void set_mute_vm_audio_response( std::optional<vm_tools::concierge::SuccessFailureResponse> mute_vm_audio_response) { mute_vm_audio_response_ = mute_vm_audio_response; } + void set_set_up_vm_user_response( + std::optional<vm_tools::concierge::SetUpVmUserResponse> + set_up_vm_user_response) { + set_up_vm_user_response_ = set_up_vm_user_response; + } + void set_send_create_disk_image_response_delay(base::TimeDelta delay) { send_create_disk_image_response_delay_ = delay; } @@ -499,6 +511,8 @@ aggressive_balloon_response_; std::optional<vm_tools::concierge::SuccessFailureResponse> mute_vm_audio_response_; + std::optional<vm_tools::concierge::SetUpVmUserResponse> + set_up_vm_user_response_; base::TimeDelta send_create_disk_image_response_delay_; base::TimeDelta send_start_vm_response_delay_;
diff --git a/clank b/clank index e1b8883..326b1ab 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit e1b888313a11603d7fa7469c598fed3386e7a530 +Subproject commit 326b1ab67ee6d99d3a2af9abdac9a29688dbc6ce
diff --git a/components/autofill/core/browser/ml_model/autofill_ai/autofill_ai_model_cache_impl.cc b/components/autofill/core/browser/ml_model/autofill_ai/autofill_ai_model_cache_impl.cc index f356323..0e39a5ff 100644 --- a/components/autofill/core/browser/ml_model/autofill_ai/autofill_ai_model_cache_impl.cc +++ b/components/autofill/core/browser/ml_model/autofill_ai/autofill_ai_model_cache_impl.cc
@@ -41,7 +41,7 @@ {base::MayBlock(), base::TaskPriority::BEST_EFFORT, base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}); db_ = db_provider->GetDB<CacheEntryWithMetadata>( - leveldb_proto::ProtoDbType::STRIKE_DATABASE, + leveldb_proto::ProtoDbType::AUTOFILL_AI_MODEL_CACHE, profile_path.Append(kAutofillAiModelCacheDatabaseFileName), database_task_runner);
diff --git a/components/autofill/core/browser/payments/autofill_error_dialog_context.cc b/components/autofill/core/browser/payments/autofill_error_dialog_context.cc index a252f49..5102c788 100644 --- a/components/autofill/core/browser/payments/autofill_error_dialog_context.cc +++ b/components/autofill/core/browser/payments/autofill_error_dialog_context.cc
@@ -28,6 +28,16 @@ return autofill_error_dialog_context; } +AutofillErrorDialogContext +AutofillErrorDialogContext::WithBnplPermanentOrTemporaryError( + bool is_permanent_error) { + AutofillErrorDialogContext autofill_error_dialog_context; + autofill_error_dialog_context.type = + is_permanent_error ? AutofillErrorDialogType::kBnplPermanentError + : AutofillErrorDialogType::kBnplTemporaryError; + return autofill_error_dialog_context; +} + AutofillErrorDialogContext::AutofillErrorDialogContext() = default; AutofillErrorDialogContext::AutofillErrorDialogContext(
diff --git a/components/autofill/core/browser/payments/autofill_error_dialog_context.h b/components/autofill/core/browser/payments/autofill_error_dialog_context.h index db4d4585..c1e6de7 100644 --- a/components/autofill/core/browser/payments/autofill_error_dialog_context.h +++ b/components/autofill/core/browser/payments/autofill_error_dialog_context.h
@@ -45,8 +45,12 @@ // Error shown when the server returns a permanent error for unmasking a // runtime retrieval enrolled card. kCardInfoRetrievalPermanentError = 10, + // Error shown when the server returns a temporary error for a BNPL flow. + kBnplTemporaryError = 11, + // Error shown when the server returns a permanent error for a BNPL flow. + kBnplPermanentError = 12, // kMaxValue is required for logging histograms. - kMaxValue = kCardInfoRetrievalPermanentError, + kMaxValue = kBnplPermanentError, }; // The context for the autofill error dialog. @@ -63,6 +67,12 @@ static AutofillErrorDialogContext WithCardInfoRetrievalPermanentOrTemporaryError(bool is_permanent_error); + // Returns an AutofillErrorDialogContext that is type + // kBnplPermanentError if `is_permanent_error` is true, and type + // kBnplTemporaryError if `is_permanent_error` is false. + static AutofillErrorDialogContext WithBnplPermanentOrTemporaryError( + bool is_permanent_error); + AutofillErrorDialogContext(); AutofillErrorDialogContext(const AutofillErrorDialogContext& other); AutofillErrorDialogContext(AutofillErrorDialogContext&& other);
diff --git a/components/autofill/core/browser/ui/payments/autofill_error_dialog_controller_impl.cc b/components/autofill/core/browser/ui/payments/autofill_error_dialog_controller_impl.cc index c65e06b..a09fd51 100644 --- a/components/autofill/core/browser/ui/payments/autofill_error_dialog_controller_impl.cc +++ b/components/autofill/core/browser/ui/payments/autofill_error_dialog_controller_impl.cc
@@ -101,6 +101,10 @@ #else NOTREACHED(); #endif // BUILDFLAG(IS_IOS) + case AutofillErrorDialogType::kBnplTemporaryError: + case AutofillErrorDialogType::kBnplPermanentError: + return l10n_util::GetStringUTF16(IDS_AUTOFILL_BNPL_ERROR_DIALOG_TITLE); + case AutofillErrorDialogType::kTypeUnknown: NOTREACHED(); } @@ -158,6 +162,12 @@ #else NOTREACHED(); #endif // BUILDFLAG(IS_IOS) + case AutofillErrorDialogType::kBnplTemporaryError: + return l10n_util::GetStringUTF16( + IDS_AUTOFILL_BNPL_TEMPORARY_ERROR_DESCRIPTION); + case AutofillErrorDialogType::kBnplPermanentError: + return l10n_util::GetStringUTF16( + IDS_AUTOFILL_BNPL_PERMANENT_ERROR_DESCRIPTION); case AutofillErrorDialogType::kTypeUnknown: NOTREACHED(); }
diff --git a/components/autofill/core/browser/ui/payments/autofill_error_dialog_controller_impl_unittest.cc b/components/autofill/core/browser/ui/payments/autofill_error_dialog_controller_impl_unittest.cc index 14e7460..a674924a 100644 --- a/components/autofill/core/browser/ui/payments/autofill_error_dialog_controller_impl_unittest.cc +++ b/components/autofill/core/browser/ui/payments/autofill_error_dialog_controller_impl_unittest.cc
@@ -131,6 +131,44 @@ IDS_AUTOFILL_ERROR_DIALOG_NEGATIVE_BUTTON_LABEL)); } +// Test to verify the title, description and button label for autofill error +// dialog for temporary failure in a BNPL flow. +TEST_F(AutofillErrorDialogControllerImplTest, BnplTemporaryError) { + AutofillErrorDialogContext context = + AutofillErrorDialogContext::WithBnplPermanentOrTemporaryError( + /*is_permanent_error=*/false); + + ShowPrompt(context); + + EXPECT_EQ(controller()->GetTitle(), + l10n_util::GetStringUTF16(IDS_AUTOFILL_BNPL_ERROR_DIALOG_TITLE)); + EXPECT_EQ( + controller()->GetDescription(), + l10n_util::GetStringUTF16(IDS_AUTOFILL_BNPL_TEMPORARY_ERROR_DESCRIPTION)); + EXPECT_EQ(controller()->GetButtonLabel(), + l10n_util::GetStringUTF16( + IDS_AUTOFILL_ERROR_DIALOG_NEGATIVE_BUTTON_LABEL)); +} + +// Test to verify the title, description and button label for autofill error +// dialog for permanent failure in a BNPL flow. +TEST_F(AutofillErrorDialogControllerImplTest, BnplPermanentError) { + AutofillErrorDialogContext context = + AutofillErrorDialogContext::WithBnplPermanentOrTemporaryError( + /*is_permanent_error=*/true); + + ShowPrompt(context); + + EXPECT_EQ(controller()->GetTitle(), + l10n_util::GetStringUTF16(IDS_AUTOFILL_BNPL_ERROR_DIALOG_TITLE)); + EXPECT_EQ( + controller()->GetDescription(), + l10n_util::GetStringUTF16(IDS_AUTOFILL_BNPL_PERMANENT_ERROR_DESCRIPTION)); + EXPECT_EQ(controller()->GetButtonLabel(), + l10n_util::GetStringUTF16( + IDS_AUTOFILL_ERROR_DIALOG_NEGATIVE_BUTTON_LABEL)); +} + // Param of the AutofillErrorDialogControllerImplTest: // -- bool server_did_return_decline_details; class AutofillErrorDialogControllerImplParameterizedTest
diff --git a/components/autofill/core/common/autofill_payments_features.cc b/components/autofill/core/common/autofill_payments_features.cc index 4ab8e23c..e81ee7ba 100644 --- a/components/autofill/core/common/autofill_payments_features.cc +++ b/components/autofill/core/common/autofill_payments_features.cc
@@ -80,10 +80,6 @@ base::FEATURE_ENABLED_BY_DEFAULT); #endif -BASE_FEATURE(kAutofillEnableCardExpiredText, - "AutofillEnableCardExpiredText", - base::FEATURE_ENABLED_BY_DEFAULT); - // When enabled, runtime retrieval of CVC along with card number and expiry // from issuer for enrolled cards will be enabled during form fill. BASE_FEATURE(kAutofillEnableCardInfoRuntimeRetrieval,
diff --git a/components/autofill/core/common/autofill_payments_features.h b/components/autofill/core/common/autofill_payments_features.h index c1799380..d840d26 100644 --- a/components/autofill/core/common/autofill_payments_features.h +++ b/components/autofill/core/common/autofill_payments_features.h
@@ -37,7 +37,6 @@ BASE_DECLARE_FEATURE(kAutofillEnableCardBenefitsIph); COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kAutofillEnableCardBenefitsSync); -COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kAutofillEnableCardExpiredText); COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kAutofillEnableCardProductName); COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kAutofillEnableCardInfoRuntimeRetrieval);
diff --git a/components/autofill_payments_strings.grdp b/components/autofill_payments_strings.grdp index 0820e22..73c63edb 100644 --- a/components/autofill_payments_strings.grdp +++ b/components/autofill_payments_strings.grdp
@@ -1059,6 +1059,15 @@ <message name="IDS_AUTOFILL_BNPL_TOS_LINK_TEXT" desc="The text informing the user the benefits of linking their BNPL account in the Buy-Now-Pay-Later Terms of Service dialog."> Keeping your account linked helps you pay faster with <ph name="BNPL_ISSUER_NAME">$1</ph>, but you can unlink it by going to <ph name="IDS_AUTOFILL_BNPL_TOS_LINK_TEXT_WALLET_LINK_TEXT">$2<ex>wallet.google.com</ex></ph> </message> + <message name="IDS_AUTOFILL_BNPL_ERROR_DIALOG_TITLE" desc="The title text of an error dialog informing the user that something went wrong in the Buy Now Pay Later flow."> + Something went wrong + </message> + <message name="IDS_AUTOFILL_BNPL_TEMPORARY_ERROR_DESCRIPTION" desc="The description text of an error dialog informing the user that a temporary error occurred in the Buy Now Pay Later flow."> + Pay over time isn't available right now. Try again later. + </message> + <message name="IDS_AUTOFILL_BNPL_PERMANENT_ERROR_DESCRIPTION" desc="The description text of an error dialog informing the user that a permanent error occurred in the Buy Now Pay Later flow."> + Contact the provider for more information + </message> <!-- Credit card benefits-related strings --> <message name="IDS_AUTOFILL_CREDIT_CARD_BENEFIT_TEXT_FOR_SUGGESTIONS" desc="benefit text string shown in suggestion dropdown indicating that the credit card has an applicable benefit for this purchase with `terms apply` appended.">
diff --git a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_BNPL_ERROR_DIALOG_TITLE.png.sha1 b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_BNPL_ERROR_DIALOG_TITLE.png.sha1 new file mode 100644 index 0000000..30148393 --- /dev/null +++ b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_BNPL_ERROR_DIALOG_TITLE.png.sha1
@@ -0,0 +1 @@ +b5deafcee4280835ce6f873fb19d68b775e959d6 \ No newline at end of file
diff --git a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_BNPL_PERMANENT_ERROR_DESCRIPTION.png.sha1 b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_BNPL_PERMANENT_ERROR_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..36c4d63 --- /dev/null +++ b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_BNPL_PERMANENT_ERROR_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +e6a7d624973eff128f537a52e6c3ce8652538e87 \ No newline at end of file
diff --git a/components/autofill_payments_strings_grdp/IDS_AUTOFILL_BNPL_TEMPORARY_ERROR_DESCRIPTION.png.sha1 b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_BNPL_TEMPORARY_ERROR_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..30148393 --- /dev/null +++ b/components/autofill_payments_strings_grdp/IDS_AUTOFILL_BNPL_TEMPORARY_ERROR_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +b5deafcee4280835ce6f873fb19d68b775e959d6 \ No newline at end of file
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/CompressContactIconsWorkerTask.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/CompressContactIconsWorkerTask.java index 4697d80..aa5b17f 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/CompressContactIconsWorkerTask.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/CompressContactIconsWorkerTask.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.contacts_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.content.ContentResolver; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; @@ -12,6 +14,7 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.task.AsyncTask; import org.chromium.blink.mojom.ContactIconBlob; +import org.chromium.build.annotations.NullMarked; import java.io.ByteArrayOutputStream; import java.util.HashMap; @@ -19,6 +22,7 @@ import java.util.Set; /** A worker task to retrieve images for contacts. */ +@NullMarked public class CompressContactIconsWorkerTask extends AsyncTask<Void> { private ContentResolver mContentResolver; private Set<String> mNoIconIds; @@ -73,8 +77,11 @@ if (drawable != null && drawable instanceof BitmapDrawable) { icon = ((BitmapDrawable) drawable).getBitmap(); } else if (!contact.isSelf()) { + // Passing a null callback doesn't break as long as only doInBackground() is + // called. icon = - new FetchIconWorkerTask(contact.getId(), mContentResolver, null) + new FetchIconWorkerTask( + contact.getId(), mContentResolver, assumeNonNull(null)) .doInBackground(); } }
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactDetails.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactDetails.java index a82dd86..0a7bd6a 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactDetails.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactDetails.java
@@ -7,10 +7,9 @@ import android.content.res.Resources; import android.graphics.drawable.Drawable; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - import org.chromium.blink.mojom.ContactIconBlob; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.payments.mojom.PaymentAddress; import java.util.ArrayList; @@ -18,6 +17,7 @@ import java.util.List; /** A class to keep track of the metadata associated with a contact. */ +@NullMarked public class ContactDetails implements Comparable<ContactDetails> { // The identifier for the information from the signed in user. Must not be a valid id in the // context of the Android Contacts list. @@ -28,12 +28,12 @@ * email and phone numbers are returned and the rest is indicated with "+n more" strings). */ public static class AbbreviatedContactDetails { - public String primaryEmail; - public String overflowEmailCount; - public String primaryTelephoneNumber; - public String overflowTelephoneNumberCount; - public String primaryAddress; - public String overflowAddressCount; + public @Nullable String primaryEmail; + public @Nullable String overflowEmailCount; + public @Nullable String primaryTelephoneNumber; + public @Nullable String overflowTelephoneNumberCount; + public @Nullable String primaryAddress; + public @Nullable String overflowAddressCount; } // The unique id for the contact. @@ -59,7 +59,7 @@ // The avatar icon for the owner of the device. Non-null only if the ContactDetails representing // the owner were synthesized (not when a pre-existing contact tile was moved to the top). - @Nullable private Drawable mSelfIcon; + private @Nullable Drawable mSelfIcon; /** * The ContactDetails constructor. @@ -73,9 +73,9 @@ public ContactDetails( String id, String displayName, - List<String> emails, - List<String> phoneNumbers, - List<PaymentAddress> addresses) { + @Nullable List<String> emails, + @Nullable List<String> phoneNumbers, + @Nullable List<PaymentAddress> addresses) { mDisplayName = displayName != null ? displayName : ""; mEmails = emails != null ? emails : new ArrayList<String>(); mPhoneNumbers = phoneNumbers != null ? phoneNumbers : new ArrayList<String>(); @@ -141,8 +141,7 @@ * Fetch the cached icon for this contact. Returns null if this is not the 'self' contact, all * other contact avatars should be retrieved through the {@link FetchIconWorkerTask}. */ - @Nullable - public Drawable getSelfIcon() { + public @Nullable Drawable getSelfIcon() { return mSelfIcon; } @@ -232,7 +231,7 @@ boolean includeAddresses, boolean includeEmails, boolean includeTels, - @NonNull Resources resources) { + Resources resources) { AbbreviatedContactDetails results = new AbbreviatedContactDetails(); results.overflowAddressCount = "";
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactView.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactView.java index 3f43839..f31fd27d 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactView.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactView.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.contacts_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; @@ -17,6 +19,9 @@ import androidx.core.graphics.drawable.RoundedBitmapDrawable; import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory; +import org.chromium.build.annotations.Initializer; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.components.browser_ui.widget.selectable_list.SelectableItemView; import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate; import org.chromium.ui.modaldialog.ModalDialogManager; @@ -26,6 +31,7 @@ import java.util.List; /** A container class for a view showing a contact in the Contacts Picker. */ +@NullMarked public class ContactView extends SelectableItemView<ContactDetails> { // Our context. private Context mContext; @@ -54,10 +60,10 @@ private ImageView mStar; // The dialog manager to use to show contact details. - private ModalDialogManager mManager; + private @Nullable ModalDialogManager mManager; // The property model listing the contents of the contact details dialog. - private PropertyModel mModel; + private @Nullable PropertyModel mModel; /** Constructor for inflating from XML. */ public ContactView(Context context, AttributeSet attrs) { @@ -105,11 +111,13 @@ @Override public boolean onLongClick(View view) { + assumeNonNull(mCategoryView.getModalDialogManager()); mManager = mCategoryView.getModalDialogManager(); ModalDialogProperties.Controller controller = new ModalDialogProperties.Controller() { @Override public void onClick(PropertyModel model, int buttonType) { + assumeNonNull(mManager); mManager.dismissDialog(model, buttonType); mModel = null; mManager = null; @@ -158,13 +166,14 @@ * @param categoryView The category view showing the images. Used to access common functionality * and sizes and retrieve the {@link SelectionDelegate}. */ + @Initializer public void setCategoryView(PickerCategoryView categoryView) { mCategoryView = categoryView; mSelectionDelegate = mCategoryView.getSelectionDelegate(); setSelectionDelegate(mSelectionDelegate); } - private void updateTextViewVisibilityAndContent(TextView view, String text) { + private void updateTextViewVisibilityAndContent(TextView view, @Nullable String text) { view.setVisibility(TextUtils.isEmpty(text) ? View.GONE : View.VISIBLE); view.setText(text); } @@ -176,7 +185,8 @@ * @param contactDetails The details about the contact represented by this ContactView. * @param icon The icon to show for the contact (or null if not loaded yet). */ - public void initialize(ContactDetails contactDetails, Bitmap icon) { + @Initializer + public void initialize(ContactDetails contactDetails, @Nullable Bitmap icon) { resetTile(); mContactDetails = contactDetails; @@ -218,7 +228,7 @@ * * @param icon The icon to display. */ - public void setIconBitmap(Bitmap icon) { + public void setIconBitmap(@Nullable Bitmap icon) { Resources resources = mContext.getResources(); RoundedBitmapDrawable drawable = RoundedBitmapDrawableFactory.create(resources, icon); drawable.setCircular(true);
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactViewHolder.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactViewHolder.java index 6bb156e..06c2e344 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactViewHolder.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactViewHolder.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.contacts_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.content.ContentResolver; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; @@ -13,8 +15,12 @@ import org.chromium.base.ResettersForTesting; import org.chromium.base.task.AsyncTask; +import org.chromium.build.annotations.Initializer; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; /** Holds on to a {@link ContactView} that displays information about a contact. */ +@NullMarked public class ContactViewHolder extends ViewHolder implements FetchIconWorkerTask.IconRetrievedCallback { // Our parent category. @@ -30,13 +36,13 @@ private ContactDetails mContact; // A worker task for asynchronously retrieving icons off the main thread. - private FetchIconWorkerTask mWorkerTask; + private @Nullable FetchIconWorkerTask mWorkerTask; // The size the contact icon will be displayed at (one side of a square). private final int mIconSize; // The icon to use when testing. - private static Bitmap sIconForTest; + private static @Nullable Bitmap sIconForTest; /** * The PickerBitmapViewHolder. @@ -64,6 +70,7 @@ * * @param contact The contact details to show. */ + @Initializer public void setContactDetails(ContactDetails contact) { mContact = contact; @@ -90,6 +97,7 @@ /** Cancels the worker task to retrieve the icon. */ public void cancelIconRetrieval() { + assumeNonNull(mWorkerTask); mWorkerTask.cancel(true); mWorkerTask = null; } @@ -97,7 +105,7 @@ // FetchIconWorkerTask.IconRetrievedCallback: @Override - public void iconRetrieved(Bitmap icon, String contactId) { + public void iconRetrieved(@Nullable Bitmap icon, String contactId) { if (mCategoryView.getIconCache().getBitmap(contactId) == null) { mCategoryView.getIconCache().putBitmap(contactId, icon); }
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsFetcherWorkerTask.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsFetcherWorkerTask.java index 439cf8dc..02e3143 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsFetcherWorkerTask.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsFetcherWorkerTask.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.contacts_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; @@ -12,6 +14,8 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.task.AsyncTask; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.payments.mojom.PaymentAddress; import java.util.ArrayList; @@ -20,7 +24,8 @@ import java.util.Map; /** A worker task to retrieve images for contacts. */ -class ContactsFetcherWorkerTask extends AsyncTask<ArrayList<ContactDetails>> { +@NullMarked +class ContactsFetcherWorkerTask extends AsyncTask<@Nullable ArrayList<ContactDetails>> { private static final String[] PROJECTION = { ContactsContract.Contacts._ID, ContactsContract.Contacts.LOOKUP_KEY, @@ -86,7 +91,7 @@ * @return The icon representing a contact. */ @Override - protected ArrayList<ContactDetails> doInBackground() { + protected @Nullable ArrayList<ContactDetails> doInBackground() { assert !ThreadUtils.runningOnUiThread(); if (isCancelled()) return null; @@ -112,6 +117,7 @@ ArrayList<String> list = new ArrayList<String>(); String key = ""; String value; + assumeNonNull(cursor); while (cursor.moveToNext()) { String id = cursor.getString(cursor.getColumnIndexOrThrow(idColumn)); value = cursor.getString(cursor.getColumnIndexOrThrow(dataColumn)); @@ -174,6 +180,7 @@ null, null, addressSortOrder); + assumeNonNull(cursor); ArrayList<PaymentAddress> list = new ArrayList<>(); String key = ""; @@ -267,6 +274,7 @@ null, null, ContactsContract.Contacts.SORT_KEY_PRIMARY + " ASC"); + assumeNonNull(cursor); if (!cursor.moveToFirst()) { cursor.close(); return new ArrayList<ContactDetails>(); @@ -280,9 +288,10 @@ cursor.getString( cursor.getColumnIndexOrThrow( ContactsContract.Contacts.DISPLAY_NAME_PRIMARY)); - List<String> email = mIncludeEmails ? emailMap.get(id) : null; - List<String> tel = mIncludeTel ? phoneMap.get(id) : null; - List<PaymentAddress> address = mIncludeAddresses ? addressMap.get(id) : null; + List<String> email = mIncludeEmails ? assumeNonNull(emailMap).get(id) : null; + List<String> tel = mIncludeTel ? assumeNonNull(phoneMap).get(id) : null; + List<PaymentAddress> address = + mIncludeAddresses ? assumeNonNull(addressMap).get(id) : null; if (mIncludeNames || email != null || tel != null || address != null) { contacts.add(new ContactDetails(id, name, email, tel, address)); @@ -299,11 +308,12 @@ * @param contacts The contacts retrieved. */ @Override - protected void onPostExecute(ArrayList<ContactDetails> contacts) { + protected void onPostExecute(@Nullable ArrayList<ContactDetails> contacts) { assert ThreadUtils.runningOnUiThread(); if (isCancelled()) return; + assumeNonNull(contacts); mCallback.contactsRetrieved(contacts); } }
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerDialog.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerDialog.java index 56c8471..8b9af63 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerDialog.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerDialog.java
@@ -4,6 +4,9 @@ package org.chromium.components.browser_ui.contacts_picker; +import static org.chromium.build.NullUtil.assertNonNull; + +import org.chromium.build.annotations.NullMarked; import org.chromium.components.browser_ui.widget.FullscreenAlertDialog; import org.chromium.content_public.browser.ContactsPickerListener; import org.chromium.ui.base.WindowAndroid; @@ -12,6 +15,7 @@ * UI for the contacts picker that shows on the Android platform as a result of <input type=file * accept=contacts > form element. */ +@NullMarked public class ContactsPickerDialog extends FullscreenAlertDialog implements ContactsPickerToolbar.ContactsToolbarDelegate { // The category we're showing contacts for. @@ -43,7 +47,7 @@ boolean includeAddresses, boolean includeIcons, String formattedOrigin) { - super(windowAndroid.getContext().get()); + super(assertNonNull(windowAndroid.getContext().get())); // Initialize the main content view. mCategoryView =
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerFeatureList.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerFeatureList.java index 76af02a1d..ed058c8 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerFeatureList.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerFeatureList.java
@@ -4,12 +4,15 @@ package org.chromium.components.browser_ui.contacts_picker; +import org.chromium.build.annotations.NullMarked; + /** * Lists base::Features that can be accessed through {@link ContactsPickerFeatureMap}. * * <p>Should be kept in sync with |kFeaturesExposedToJava| in * //components/browser_ui/contacts_picker/android/contacts_picker_feature_map.cc */ +@NullMarked public abstract class ContactsPickerFeatureList { public static final String CONTACTS_PICKER_SELECT_ALL = "ContactsPickerSelectAll"; }
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerFeatureMap.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerFeatureMap.java index ae11c6a..59e38e2 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerFeatureMap.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerFeatureMap.java
@@ -8,9 +8,11 @@ import org.jni_zero.NativeMethods; import org.chromium.base.FeatureMap; +import org.chromium.build.annotations.NullMarked; /** Java accessor for base::Features listed in {@link ContactsPickerFeatureList} */ @JNINamespace("browser_ui") +@NullMarked public final class ContactsPickerFeatureMap extends FeatureMap { private static final ContactsPickerFeatureMap sInstance = new ContactsPickerFeatureMap();
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerToolbar.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerToolbar.java index 0024f58..b5f5d74c 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerToolbar.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/ContactsPickerToolbar.java
@@ -4,9 +4,13 @@ package org.chromium.components.browser_ui.contacts_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.content.Context; import android.util.AttributeSet; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.components.browser_ui.widget.selectable_list.SelectableListToolbar; import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate; import org.chromium.ui.widget.ButtonCompat; @@ -14,6 +18,7 @@ import java.util.List; /** Handles toolbar functionality for the {@ContactsPickerDialog}. */ +@NullMarked public class ContactsPickerToolbar extends SelectableListToolbar<ContactDetails> { /** A delegate that handles dialog actions. */ public interface ContactsToolbarDelegate { @@ -22,7 +27,7 @@ } // A delegate to notify when the dialog should close. - private ContactsToolbarDelegate mDelegate; + private @Nullable ContactsToolbarDelegate mDelegate; // Whether any filter chips are selected. Default to true because all filter chips are selected // by default when opening the dialog. @@ -55,6 +60,7 @@ if (isSearching()) { super.onSearchNavigationBack(); } else { + assumeNonNull(mDelegate); mDelegate.onNavigationBackCallback(); } }
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/FetchIconWorkerTask.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/FetchIconWorkerTask.java index 357c6380..8c75529 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/FetchIconWorkerTask.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/FetchIconWorkerTask.java
@@ -14,11 +14,14 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.task.AsyncTask; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import java.io.ByteArrayInputStream; /** A worker task to retrieve images for contacts. */ -class FetchIconWorkerTask extends AsyncTask<Bitmap> { +@NullMarked +class FetchIconWorkerTask extends AsyncTask<@Nullable Bitmap> { /** An interface to use to communicate back the results to the client. */ public interface IconRetrievedCallback { /** @@ -27,7 +30,7 @@ * @param icon The icon retrieved. * @param contactId The id of the contact the icon refers to. */ - void iconRetrieved(Bitmap icon, String contactId); + void iconRetrieved(@Nullable Bitmap icon, String contactId); } // The ID of the contact to look up. @@ -75,7 +78,7 @@ * @return The icon representing a contact (returned as Bitmap). */ @Override - protected Bitmap doInBackground() { + protected @Nullable Bitmap doInBackground() { assert !ThreadUtils.runningOnUiThread(); if (isCancelled()) return null; @@ -116,7 +119,7 @@ * @param icon The icon retrieved. */ @Override - protected void onPostExecute(Bitmap icon) { + protected void onPostExecute(@Nullable Bitmap icon) { assert ThreadUtils.runningOnUiThread(); if (isCancelled()) return;
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/PickerAdapter.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/PickerAdapter.java index 781484d4..15206112 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/PickerAdapter.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/PickerAdapter.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.contacts_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.content.ContentResolver; import android.content.Context; import android.text.TextUtils; @@ -13,12 +15,15 @@ import androidx.annotation.CallSuper; import androidx.annotation.IntDef; -import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView.Adapter; import org.chromium.base.task.AsyncTask; +import org.chromium.build.annotations.Initializer; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.NullUnmarked; +import org.chromium.build.annotations.Nullable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -32,6 +37,7 @@ * <p>This class is abstract and embedders must specialize it to provide access to the active user's * contact information. */ +@NullMarked public abstract class PickerAdapter extends Adapter<RecyclerView.ViewHolder> implements ContactsFetcherWorkerTask.ContactsRetrievedCallback, TopView.ChipToggledCallback { @@ -88,7 +94,7 @@ private PickerCategoryView mCategoryView; // The view at the top of the RecyclerView (disclaimer and select all functionality). - private TopView mTopView; + private @Nullable TopView mTopView; // The origin the data will be shared with, formatted for display with the scheme omitted. private String mFormattedOrigin; @@ -97,19 +103,19 @@ private ContentResolver mContentResolver; // The full list of all registered contacts on the device. - private ArrayList<ContactDetails> mContactDetails; + private @Nullable ArrayList<ContactDetails> mContactDetails; // The email address of the owner of the device. - @Nullable private String mOwnerEmail; + private @Nullable String mOwnerEmail; // The async worker task to use for fetching the contact details. - private ContactsFetcherWorkerTask mWorkerTask; + private @Nullable ContactsFetcherWorkerTask mWorkerTask; // Whether the user has switched to search mode. private boolean mSearchMode; // A list of search result indices into the larger data set. - private ArrayList<Integer> mSearchResults; + private @Nullable ArrayList<Integer> mSearchResults; // Whether to include addresses in the returned results. private static boolean sIncludeAddresses; @@ -127,10 +133,10 @@ private static boolean sIncludeIcons; // A list of contacts to use for testing (instead of querying Android). - private static ArrayList<ContactDetails> sTestContacts; + private static @Nullable ArrayList<ContactDetails> sTestContacts; // An owner email to use when testing. - private static String sTestOwnerEmail; + private static @Nullable String sTestOwnerEmail; /** * The PickerAdapter constructor. @@ -139,6 +145,7 @@ * @param context The current context. * @param formattedOrigin The origin the data will be shared with. */ + @Initializer @CallSuper public void init(PickerCategoryView categoryView, Context context, String formattedOrigin) { mContext = context; @@ -162,6 +169,7 @@ mCategoryView.siteWantsAddresses()); mWorkerTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } else { + assumeNonNull(sTestContacts); contactsRetrieved(sTestContacts); } } @@ -190,6 +198,7 @@ mSearchResults = new ArrayList<Integer>(); Integer count = 0; String query_lower = query.toLowerCase(Locale.getDefault()); + assumeNonNull(mContactDetails); for (ContactDetails contact : mContactDetails) { if (contact.getDisplayName().toLowerCase(Locale.getDefault()).contains(query_lower) || contact.getContactDetailsAsString( @@ -209,16 +218,19 @@ * * @return The contact list as an array. */ - public ArrayList<ContactDetails> getAllContacts() { + public @Nullable ArrayList<ContactDetails> getAllContacts() { return mContactDetails; } - protected String getOwnerEmail() { + protected @Nullable String getOwnerEmail() { return mOwnerEmail; } protected void update() { - if (mTopView != null) mTopView.updateContactCount(mContactDetails.size()); + if (mTopView != null) { + assumeNonNull(mContactDetails); + mTopView.updateContactCount(mContactDetails.size()); + } notifyDataSetChanged(); } @@ -231,8 +243,7 @@ * * @return the email address of the current user/owner. */ - @Nullable - protected abstract String findOwnerEmail(); + protected abstract @Nullable String findOwnerEmail(); /** * Called to add an entry which represents the current user to the given list. As with {@link @@ -245,7 +256,6 @@ protected abstract void addOwnerInfoToContacts(ArrayList<ContactDetails> contacts); // ContactsFetcherWorkerTask.ContactsRetrievedCallback: - @Override public void contactsRetrieved(ArrayList<ContactDetails> contacts) { mOwnerEmail = sTestOwnerEmail != null ? sTestOwnerEmail : findOwnerEmail(); @@ -264,7 +274,9 @@ } @Override - public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + // onCreateViewHolder() should not return null, but this implementation does for some ViewTypes. + @NullUnmarked + public RecyclerView.@Nullable ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { switch (viewType) { case ViewType.SELECT_ALL_CHECKBOX: mTopView = @@ -309,6 +321,7 @@ // There's no need to bind the Select All view. return; case ViewType.CONTACT_DETAILS: + assumeNonNull(mContactDetails); ContactViewHolder contactHolder = (ContactViewHolder) holder; ContactDetails contact; if (!mSearchMode || mSearchResults == null) { @@ -406,7 +419,8 @@ * @return Returns true if processing is complete, false if waiting on asynchronous fetching of * missing data for the owner info. */ - private static boolean processOwnerInfo(ArrayList<ContactDetails> contacts, String ownerEmail) { + private static boolean processOwnerInfo( + ArrayList<ContactDetails> contacts, @Nullable String ownerEmail) { if (ownerEmail == null) { return true; }
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/PickerCategoryView.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/PickerCategoryView.java index 6850061..cb83a992 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/PickerCategoryView.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/PickerCategoryView.java
@@ -4,9 +4,13 @@ package org.chromium.components.browser_ui.contacts_picker; +import static org.chromium.build.NullUtil.assertNonNull; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; +import android.os.Handler; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; @@ -17,6 +21,9 @@ import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.task.AsyncTask; +import org.chromium.build.annotations.Initializer; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.components.browser_ui.util.BitmapCache; import org.chromium.components.browser_ui.util.ConversionUtils; import org.chromium.components.browser_ui.util.GlobalDiscardableReferencePool; @@ -41,6 +48,7 @@ * A class for keeping track of common data associated with showing contact details in the contacts * picker, for example the RecyclerView. */ +@NullMarked public class PickerCategoryView extends OptimizedFrameLayout implements View.OnClickListener, RecyclerView.RecyclerListener, @@ -78,7 +86,7 @@ private RecyclerView mRecyclerView; // The view at the top (showing the explanation and Select All checkbox). - private TopView mTopView; + private @Nullable TopView mTopView; // The {@link PickerAdapter} for the RecyclerView. private PickerAdapter mPickerAdapter; @@ -99,7 +107,7 @@ private ImageView mSearchButton; // Keeps track of the set of last selected contacts in the UI. - Set<ContactDetails> mPreviousSelection; + @Nullable Set<ContactDetails> mPreviousSelection; // The Done text button that confirms the selection choice. private Button mDoneButton; @@ -149,7 +157,7 @@ boolean shouldIncludeIcons, String formattedOrigin, ContactsPickerToolbar.ContactsToolbarDelegate delegate) { - super(windowAndroid.getContext().get(), null); + super(assertNonNull(windowAndroid.getContext().get()), null); mWindowAndroid = windowAndroid; Context context = windowAndroid.getContext().get(); @@ -227,6 +235,7 @@ * @param dialog The dialog showing us. * @param listener The listener who should be notified of actions. */ + @Initializer public void initialize(ContactsPickerDialog dialog, ContactsPickerListener listener) { mDialog = dialog; mListener = listener; @@ -290,13 +299,15 @@ selection.add(item); } mToolbar.hideSearchView(); + assumeNonNull(mPreviousSelection); for (ContactDetails item : mPreviousSelection) { selection.add(item); } // Post a runnable to update the selection so that the update occurs after the search fully // finishes, ensuring the number roll shows the right number. - getHandler().post(() -> mSelectionDelegate.setSelectedItems(selection)); + Handler handler = assumeNonNull(getHandler()); + handler.post(() -> mSelectionDelegate.setSelectedItems(selection)); } @Override @@ -380,7 +391,7 @@ return mBitmapCache; } - ModalDialogManager getModalDialogManager() { + @Nullable ModalDialogManager getModalDialogManager() { return mWindowAndroid.getModalDialogManager(); } @@ -404,11 +415,9 @@ if (mSiteWantsIcons && PickerAdapter.includesIcons()) { // Fetch missing icons and compress them first. + Context context = assumeNonNull(mWindowAndroid.getContext().get()); new CompressContactIconsWorkerTask( - mWindowAndroid.getContext().get().getContentResolver(), - mBitmapCache, - selectedContacts, - this) + context.getContentResolver(), mBitmapCache, selectedContacts, this) .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); return; } @@ -427,7 +436,7 @@ * @param selected The property values that are currently selected. * @return The list of property values to share. */ - private <T> List<T> getContactPropertyValues( + private <T> @Nullable List<T> getContactPropertyValues( boolean isIncluded, boolean isEnabled, List<T> selected) { if (!isIncluded) { // The property wasn't requested in the API so return null. @@ -487,10 +496,10 @@ */ private void executeAction( @ContactsPickerListener.ContactsPickerAction int action, - List<ContactsPickerListener.Contact> contacts, + @Nullable List<ContactsPickerListener.Contact> contacts, int umaId) { int selectCount = contacts != null ? contacts.size() : 0; - int contactCount = mPickerAdapter.getAllContacts().size(); + int contactCount = assumeNonNull(mPickerAdapter.getAllContacts()).size(); int percentageShared = contactCount > 0 ? (100 * selectCount) / contactCount : 0; int propertiesSiteRequested = ContactsPickerProperties.PROPERTIES_NONE; @@ -585,7 +594,7 @@ return mSelectionDelegate; } - public TopView getTopViewForTesting() { + public @Nullable TopView getTopViewForTesting() { return mTopView; } @@ -608,11 +617,11 @@ noIconIds = new HashSet<>(); } - public Bitmap getBitmap(String id) { + public @Nullable Bitmap getBitmap(String id) { return bitmapCache.getBitmap(id); } - public void putBitmap(String id, Bitmap icon) { + public void putBitmap(String id, @Nullable Bitmap icon) { if (icon == null) { noIconIds.add(id); } else {
diff --git a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/TopView.java b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/TopView.java index 6ec6db5b..0e784d7 100644 --- a/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/TopView.java +++ b/components/browser_ui/contacts_picker/android/java/src/org/chromium/components/browser_ui/contacts_picker/TopView.java
@@ -13,12 +13,17 @@ import android.widget.RelativeLayout; import android.widget.TextView; +import org.chromium.build.annotations.Initializer; +import org.chromium.build.annotations.NullMarked; import org.chromium.components.browser_ui.widget.chips.ChipView; import org.chromium.ui.text.SpanApplier; import java.text.NumberFormat; -/** A container class for the Disclaimer and Select All functionality (and both associated labels). */ +/** + * A container class for the Disclaimer and Select All functionality (and both associated labels). + */ +@NullMarked public class TopView extends RelativeLayout implements CompoundButton.OnCheckedChangeListener, View.OnClickListener { /** An interface for communicating when the Select All checkbox is toggled. */ @@ -70,7 +75,7 @@ // A Chip for filtering out telephones. private ChipView mIconsFilterChip; - // The callback to use to notify when the filter chips are toggled. + // The callback to use to notify when the filter chips are toggled. @ private ChipToggledCallback mChipToggledCallback; // Whether to temporarily ignore clicks on the checkbox. @@ -194,6 +199,7 @@ * * @param origin The origin string to display. */ + @Initializer public void setSiteString(String origin) { TextView explanation = findViewById(R.id.explanation); StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD); @@ -208,11 +214,13 @@ * * @param callback The callback to use. */ + @Initializer public void registerSelectAllCallback(SelectAllToggleCallback callback) { mSelectAllCallback = callback; } /** Register a callback to use to notify when the filter chips are toggled. */ + @Initializer public void registerChipToggledCallback(ChipToggledCallback callback) { mChipToggledCallback = callback; } @@ -299,6 +307,8 @@ @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { - if (!mIgnoreCheck) mSelectAllCallback.onSelectAllToggled(mSelectAllBox.isChecked()); + if (!mIgnoreCheck) { + mSelectAllCallback.onSelectAllToggled(mSelectAllBox.isChecked()); + } } }
diff --git a/components/browser_ui/modaldialog/android/BUILD.gn b/components/browser_ui/modaldialog/android/BUILD.gn index 953c491b..27b6893 100644 --- a/components/browser_ui/modaldialog/android/BUILD.gn +++ b/components/browser_ui/modaldialog/android/BUILD.gn
@@ -24,6 +24,7 @@ "java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogFeatureMap.java", "java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogView.java", "java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewBinder.java", + "java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewUtils.java", "java/src/org/chromium/components/browser_ui/modaldialog/TabModalPresenter.java", ]
diff --git a/components/browser_ui/modaldialog/android/java/res/values/dimens.xml b/components/browser_ui/modaldialog/android/java/res/values/dimens.xml index b00b6b3..c851559 100644 --- a/components/browser_ui/modaldialog/android/java/res/values/dimens.xml +++ b/components/browser_ui/modaldialog/android/java/res/values/dimens.xml
@@ -6,6 +6,8 @@ --> <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="UnusedResources"> + <dimen name="modal_dialog_control_vertical_padding_filled">16dp</dimen> + <dimen name="modal_dialog_control_horizontal_padding_filled">16dp</dimen> <dimen name="modal_dialog_button_with_icon_start_padding">12dp</dimen> <dimen name="modal_dialog_button_with_icon_text_padding">8dp</dimen> <dimen name="modal_dialog_max_height">560dp</dimen> @@ -20,4 +22,5 @@ <dimen name="modal_dialog_max_width_major">@dimen/abc_dialog_min_width_major</dimen> <dimen name="modal_dialog_max_width_minor">@dimen/abc_dialog_min_width_minor</dimen> <dimen name="modal_dialog_button_group_padding">18dp</dimen> + <dimen name="modal_dialog_spinner_size">24dp</dimen> </resources>
diff --git a/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogView.java b/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogView.java index 98ada69..2fba0e1 100644 --- a/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogView.java +++ b/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogView.java
@@ -7,8 +7,10 @@ import static org.chromium.build.NullUtil.assumeNonNull; import android.content.Context; +import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.Drawable; +import android.graphics.drawable.LayerDrawable; import android.text.TextUtils; import android.text.method.LinkMovementMethod; import android.util.AttributeSet; @@ -22,7 +24,9 @@ import android.widget.LinearLayout; import android.widget.TextView; +import androidx.annotation.ColorInt; import androidx.annotation.VisibleForTesting; +import androidx.swiperefreshlayout.widget.CircularProgressDrawable; import org.chromium.base.Callback; import org.chromium.base.ResettersForTesting; @@ -30,11 +34,13 @@ import org.chromium.build.annotations.NullMarked; import org.chromium.build.annotations.Nullable; import org.chromium.components.browser_ui.styles.ChromeColors; +import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.components.browser_ui.widget.BoundedLinearLayout; import org.chromium.components.browser_ui.widget.FadingEdgeScrollView; import org.chromium.ui.UiUtils; import org.chromium.ui.base.DeviceFormFactor; import org.chromium.ui.modaldialog.ModalDialogProperties; +import org.chromium.ui.modaldialog.ModalDialogProperties.ButtonStyles; import org.chromium.ui.modaldialog.ModalDialogProperties.ButtonType; import org.chromium.ui.widget.ButtonCompat; @@ -80,6 +86,9 @@ // this kind of tap-jacking protection. private long mButtonTapProtectionDurationMs; private boolean mBlockTouchInput; + private @Nullable CircularProgressDrawable mSpinner; + private float mTextScaleX; + private @Nullable LayerDrawable mSpinnerButtonBackground; private int mHorizontalMargin = NOT_SPECIFIED; private int mVerticalMargin = NOT_SPECIFIED; @@ -554,12 +563,97 @@ } /** + * @param isLoading Whether the button should play a loading spinner. + * @param buttonStyles The button styles applied to this implementation of the modal dialog. + * @param buttonType The button type that the spinner should be applied to. + */ + void setLoadingButtonState( + boolean isLoading, @ButtonStyles int buttonStyles, @ButtonType int buttonType) { + Context context = getContext(); + Button button = getButton(buttonType); + + if (isLoading) { + // Set a fixed button width before hiding the button text and starting the spinner + // animation. + int buttonWidth = button.getWidth(); + var layoutParams = button.getLayoutParams(); + layoutParams.width = buttonWidth; + button.setLayoutParams(layoutParams); + mTextScaleX = button.getTextScaleX(); + button.setTextScaleX(0); + + @ColorInt int spinnerColor = getSpinnerColor(context, buttonType, buttonStyles); + // TODO(crbug.com/392152746): Implement a custom spinner button to replace the defaults + // that controls its own state to prevent conflicting stored properties. + assert mSpinner == null : "A button is already in the loading phase"; + mSpinner = new CircularProgressDrawable(context); + mSpinner.setStyle(CircularProgressDrawable.DEFAULT); + mSpinner.setColorSchemeColors(spinnerColor); + + Drawable buttonBackgroundDrawable = button.getBackground(); + mSpinnerButtonBackground = + new LayerDrawable(new Drawable[] {buttonBackgroundDrawable, mSpinner}); + button.setBackground(mSpinnerButtonBackground); + mSpinner.start(); + } else { + // Reset the button width to be variable based on the content and show the button text, + // and stop the spinner animation. + var layoutParams = button.getLayoutParams(); + layoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT; + button.setLayoutParams(layoutParams); + + if (mTextScaleX != 0.0f) { + button.setTextScaleX(mTextScaleX); + mTextScaleX = 0.0f; + } + + if (mSpinnerButtonBackground != null) { + Drawable buttonBackgroundDrawable = mSpinnerButtonBackground.getDrawable(0); + button.setBackground(buttonBackgroundDrawable); + mSpinnerButtonBackground = null; + } + + assert mSpinner != null; + if (mSpinner != null) { + mSpinner.stop(); + mSpinner = null; + } + } + } + + /** * @param shouldBlockInputs Whether all inputs on the modal dialog should be blocked. */ void blockInputs(boolean shouldBlockInputs) { mBlockTouchInput = shouldBlockInputs; } + private @ColorInt int getSpinnerColor( + Context context, @ButtonType int buttonType, @ButtonStyles int buttonStyles) { + @ColorInt + int colorForOutlineBackground = SemanticColorUtils.getDefaultIconColorAccent1(context); + @ColorInt int colorForFilledBackground = SemanticColorUtils.getDefaultBgColor(context); + + switch (buttonStyles) { + case ButtonStyles.PRIMARY_OUTLINE_NEGATIVE_OUTLINE: + return colorForOutlineBackground; + case ButtonStyles.PRIMARY_FILLED_NEGATIVE_OUTLINE: + return buttonType == ButtonType.POSITIVE + ? colorForFilledBackground + : colorForOutlineBackground; + case ButtonStyles.PRIMARY_OUTLINE_NEGATIVE_FILLED: + return buttonType == ButtonType.NEGATIVE + ? colorForFilledBackground + : colorForOutlineBackground; + case ButtonStyles.PRIMARY_FILLED_NO_NEGATIVE: + return colorForFilledBackground; + default: + assert false + : "unknown button style encountered when determining spinner color scheme"; + return Color.TRANSPARENT; + } + } + @Override public boolean dispatchTouchEvent(MotionEvent e) { if (mBlockTouchInput) return true;
diff --git a/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewBinder.java b/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewBinder.java index 924028b6..119474c 100644 --- a/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewBinder.java +++ b/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewBinder.java
@@ -9,6 +9,7 @@ import org.chromium.build.annotations.NullMarked; import org.chromium.ui.modaldialog.ModalDialogProperties; +import org.chromium.ui.modaldialog.ModalDialogProperties.ButtonType; import org.chromium.ui.modaldialog.ModalDialogProperties.ModalDialogButtonSpec; import org.chromium.ui.modelutil.PropertyKey; import org.chromium.ui.modelutil.PropertyModel; @@ -125,6 +126,16 @@ view.setVerticalMargin(model.get(ModalDialogProperties.VERTICAL_MARGIN)); } else if (ModalDialogProperties.PADDING == propertyKey) { view.setPadding(model.get(ModalDialogProperties.PADDING)); + } else if (ModalDialogProperties.POSITIVE_BUTTON_LOADING == propertyKey) { + view.setLoadingButtonState( + model.get(ModalDialogProperties.POSITIVE_BUTTON_LOADING), + model.get(ModalDialogProperties.BUTTON_STYLES), + ButtonType.POSITIVE); + } else if (ModalDialogProperties.NEGATIVE_BUTTON_LOADING == propertyKey) { + view.setLoadingButtonState( + model.get(ModalDialogProperties.NEGATIVE_BUTTON_LOADING), + model.get(ModalDialogProperties.BUTTON_STYLES), + ButtonType.NEGATIVE); } else if (ModalDialogProperties.BLOCK_INPUTS == propertyKey) { view.blockInputs(model.get(ModalDialogProperties.BLOCK_INPUTS)); } else if (ModalDialogProperties.CHANGE_CUSTOM_VIEW_OR_BUTTONS == propertyKey) {
diff --git a/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewTest.java b/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewTest.java index b87fd24c..14cca80 100644 --- a/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewTest.java +++ b/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewTest.java
@@ -19,12 +19,15 @@ import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; import android.app.Activity; import android.content.res.ColorStateList; import android.content.res.Resources; +import android.graphics.drawable.Drawable; +import android.graphics.drawable.LayerDrawable; import android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.style.ForegroundColorSpan; @@ -40,6 +43,7 @@ import android.widget.ScrollView; import android.widget.TextView; +import androidx.swiperefreshlayout.widget.CircularProgressDrawable; import androidx.test.espresso.action.ViewActions; import androidx.test.filters.MediumTest; @@ -65,7 +69,6 @@ import org.chromium.components.browser_ui.modaldialog.test.R; import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.components.browser_ui.widget.DualControlLayout; -import org.chromium.components.browser_ui.widget.ModalDialogViewUtils; import org.chromium.components.browser_ui.widget.SpinnerButtonWrapper; import org.chromium.ui.modaldialog.ModalDialogProperties; import org.chromium.ui.modaldialog.ModalDialogProperties.ModalDialogButtonSpec; @@ -772,6 +775,140 @@ @Test @MediumTest @Feature({"ModalDialog"}) + public void testBlockActionAnimationOnPositiveButton() { + final var callbackHelper = new CallbackHelper(); + var controller = + new ModalDialogProperties.Controller() { + @Override + public void onClick(PropertyModel model, int buttonType) { + callbackHelper.notifyCalled(); + } + + @Override + public void onDismiss(PropertyModel model, int dismissalCause) {} + }; + + PropertyModel model = + createModel( + mModelBuilder + .with( + ModalDialogProperties.BUTTON_STYLES, + ModalDialogProperties.ButtonStyles + .PRIMARY_FILLED_NEGATIVE_OUTLINE) + .with( + ModalDialogProperties.POSITIVE_BUTTON_TEXT, + sResources, + R.string.ok) + .with( + ModalDialogProperties.NEGATIVE_BUTTON_TEXT, + sResources, + R.string.cancel) + .with(ModalDialogProperties.CONTROLLER, controller)); + onView(withId(R.id.positive_button)) + .check(matches(allOf(isDisplayed(), isEnabled(), withText(R.string.ok)))); + onView(withId(R.id.negative_button)) + .check(matches(allOf(isDisplayed(), isEnabled(), withText(R.string.cancel)))); + + Button positiveButton = mModalDialogView.findViewById(R.id.positive_button); + int baseWidth = positiveButton.getWidth(); + + // Enable button blocking action state by mocking a pending action for the positive button. + ThreadUtils.runOnUiThreadBlocking( + () -> { + model.set(ModalDialogProperties.POSITIVE_BUTTON_LOADING, true); + model.set(ModalDialogProperties.BLOCK_INPUTS, true); + }); + assertButtonBlockActionStateProperties( + /* shouldBlock= */ true, positiveButton, baseWidth, /* isButtonFilled= */ true); + + // Assert that clicks on the modal dialog are disabled + onView(withId(R.id.positive_button)).perform(click()); + Assert.assertEquals(0, callbackHelper.getCallCount()); + + // Disable button blocking action state for the positive button. + ThreadUtils.runOnUiThreadBlocking( + () -> { + model.set(ModalDialogProperties.POSITIVE_BUTTON_LOADING, false); + model.set(ModalDialogProperties.BLOCK_INPUTS, false); + }); + assertButtonBlockActionStateProperties( + /* shouldBlock= */ false, positiveButton, baseWidth, /* isButtonFilled= */ true); + + // Assert that clicks on the modal dialog are not disabled + onView(withId(R.id.positive_button)).perform(click()); + Assert.assertEquals(1, callbackHelper.getCallCount()); + } + + @Test + @MediumTest + @Feature({"ModalDialog"}) + public void testBlockActionAnimationOnNegativeButton() { + final var callbackHelper = new CallbackHelper(); + var controller = + new ModalDialogProperties.Controller() { + @Override + public void onClick(PropertyModel model, int buttonType) { + callbackHelper.notifyCalled(); + } + + @Override + public void onDismiss(PropertyModel model, int dismissalCause) {} + }; + + PropertyModel model = + createModel( + mModelBuilder + .with( + ModalDialogProperties.BUTTON_STYLES, + ModalDialogProperties.ButtonStyles + .PRIMARY_FILLED_NEGATIVE_OUTLINE) + .with( + ModalDialogProperties.POSITIVE_BUTTON_TEXT, + sResources, + R.string.ok) + .with( + ModalDialogProperties.NEGATIVE_BUTTON_TEXT, + sResources, + R.string.cancel) + .with(ModalDialogProperties.CONTROLLER, controller)); + onView(withId(R.id.positive_button)) + .check(matches(allOf(isDisplayed(), isEnabled(), withText(R.string.ok)))); + onView(withId(R.id.negative_button)) + .check(matches(allOf(isDisplayed(), isEnabled(), withText(R.string.cancel)))); + + Button negativeButton = mModalDialogView.findViewById(R.id.negative_button); + int baseWidth = negativeButton.getWidth(); + + // Enable button blocking action state by mocking a pending action for the negative button. + ThreadUtils.runOnUiThreadBlocking( + () -> { + model.set(ModalDialogProperties.NEGATIVE_BUTTON_LOADING, true); + model.set(ModalDialogProperties.BLOCK_INPUTS, true); + }); + assertButtonBlockActionStateProperties( + /* shouldBlock= */ true, negativeButton, baseWidth, /* isButtonFilled= */ false); + + // Assert that clicks on the modal dialog are disabled + onView(withId(R.id.negative_button)).perform(click()); + Assert.assertEquals(0, callbackHelper.getCallCount()); + + // Disable button blocking action state for the negative button. + ThreadUtils.runOnUiThreadBlocking( + () -> { + model.set(ModalDialogProperties.NEGATIVE_BUTTON_LOADING, false); + model.set(ModalDialogProperties.BLOCK_INPUTS, false); + }); + assertButtonBlockActionStateProperties( + /* shouldBlock= */ false, negativeButton, baseWidth, /* isButtonFilled= */ false); + + // Assert that clicks on the modal dialog are not disabled + onView(withId(R.id.negative_button)).perform(click()); + Assert.assertEquals(1, callbackHelper.getCallCount()); + } + + @Test + @MediumTest + @Feature({"ModalDialog"}) public void testModalDialogCustomPositiveSpinnerButtonWidget() { final var callbackHelper = new CallbackHelper(); var controller = @@ -943,6 +1080,31 @@ Assert.assertEquals(0, callbackHelper.getCallCount()); } + private void assertButtonBlockActionStateProperties( + boolean shouldBlock, Button button, int baseWidth, boolean isButtonFilled) { + if (shouldBlock) { + // Assert that the correct text and width states are present + Assert.assertEquals(baseWidth, button.getWidth()); + Assert.assertEquals(0, button.getTextScaleX(), 0.0); + + // Assert that the correct spinner properties are enabled + Assert.assertThat(button.getBackground(), instanceOf(LayerDrawable.class)); + CircularProgressDrawable spinner = + (CircularProgressDrawable) + ((LayerDrawable) button.getBackground()).getDrawable(1); + int colorScheme = + isButtonFilled + ? SemanticColorUtils.getDefaultBgColor(sActivity) + : SemanticColorUtils.getDefaultIconColorAccent1(sActivity); + Assert.assertEquals(colorScheme, spinner.getColorSchemeColors()[0]); + } else { + // Assert that all the original properties are restored + Assert.assertEquals(baseWidth, button.getWidth()); + Assert.assertEquals(1, button.getTextScaleX(), 0.0); + Assert.assertThat(button.getBackground(), instanceOf(Drawable.class)); + } + } + private static Matcher<View> touchFilterEnabled() { return new TypeSafeMatcher<View>() { @Override
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/ModalDialogViewUtils.java b/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewUtils.java similarity index 93% rename from components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/ModalDialogViewUtils.java rename to components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewUtils.java index 523aa48..5e6a5274 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/ModalDialogViewUtils.java +++ b/components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/ModalDialogViewUtils.java
@@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package org.chromium.components.browser_ui.widget; +package org.chromium.components.browser_ui.modaldialog; import android.content.Context; import android.content.res.Resources; import android.view.View; import org.chromium.build.annotations.NullMarked; +import org.chromium.components.browser_ui.widget.DualControlLayout; /** Set of shared helper functions for UI related to the {@link ModalDialogView}. */ @NullMarked
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/BitmapScalerTask.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/BitmapScalerTask.java index 6b13e51..dadbed5 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/BitmapScalerTask.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/BitmapScalerTask.java
@@ -11,17 +11,20 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.task.AsyncTask; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import java.util.ArrayList; import java.util.List; /** A worker task to scale bitmaps in the background. */ -class BitmapScalerTask extends AsyncTask<Bitmap> { +@NullMarked +class BitmapScalerTask extends AsyncTask<@Nullable Bitmap> { private final LruCache<String, PickerCategoryView.Thumbnail> mCache; private final String mFilePath; private final int mSize; private final Bitmap mBitmap; - private final String mVideoDuration; + private final @Nullable String mVideoDuration; private final float mRatio; /** A BitmapScalerTask constructor. */ @@ -29,7 +32,7 @@ LruCache<String, PickerCategoryView.Thumbnail> cache, Bitmap bitmap, String filePath, - String videoDuration, + @Nullable String videoDuration, int size, float ratio) { mCache = cache; @@ -46,7 +49,7 @@ * @return A sorted list of images (by last-modified first). */ @Override - protected Bitmap doInBackground() { + protected @Nullable Bitmap doInBackground() { assert !ThreadUtils.runningOnUiThread(); if (isCancelled()) return null; @@ -64,7 +67,7 @@ * @param bitmap The resulting scaled bitmap. */ @Override - protected void onPostExecute(Bitmap bitmap) { + protected void onPostExecute(@Nullable Bitmap bitmap) { if (isCancelled()) { return; }
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/BitmapUtils.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/BitmapUtils.java index 7cf706b..5ccb41e 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/BitmapUtils.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/BitmapUtils.java
@@ -12,6 +12,8 @@ import android.util.Pair; import org.chromium.base.metrics.RecordHistogram; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import java.io.FileDescriptor; import java.io.IOException; @@ -19,6 +21,7 @@ import java.util.List; /** A collection of utility functions for dealing with bitmaps. */ +@NullMarked class BitmapUtils { // Constants used to log UMA enum histogram, must stay in sync with the // ExifOrientation enum in enums.xml. Further actions can only be appended, @@ -73,7 +76,7 @@ * image is returned. * @return The resulting bitmap and its ratio. */ - public static Pair<Bitmap, Float> decodeBitmapFromFileDescriptor( + public static @Nullable Pair<Bitmap, Float> decodeBitmapFromFileDescriptor( FileDescriptor descriptor, int size, boolean fullWidth) { BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true;
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/DecodeVideoTask.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/DecodeVideoTask.java index e135a866..1b65e0f77 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/DecodeVideoTask.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/DecodeVideoTask.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.photo_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.content.ContentResolver; import android.content.res.AssetFileDescriptor; import android.graphics.Bitmap; @@ -15,6 +17,8 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.task.AsyncTask; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import java.io.FileNotFoundException; import java.io.IOException; @@ -24,7 +28,8 @@ import java.util.Locale; /** A worker task to decode video and extract information from it off of the UI thread. */ -class DecodeVideoTask extends AsyncTask<List<Bitmap>> { +@NullMarked +class DecodeVideoTask extends AsyncTask<@Nullable List<Bitmap>> { /** The possible error states while decoding. */ @Retention(RetentionPolicy.SOURCE) @IntDef({ @@ -53,8 +58,8 @@ */ void videoDecodedCallback( Uri uri, - List<Bitmap> bitmaps, - String duration, + @Nullable List<Bitmap> bitmaps, + @Nullable String duration, boolean fullWidth, @DecodingResult int decodingStatus, float ratio); @@ -85,7 +90,7 @@ private @DecodingResult int mDecodingResult; // The duration of the video. - private String mDuration; + private @Nullable String mDuration; // The ratio of the first frame of the video. private float mRatio; @@ -125,7 +130,7 @@ * @param durationMs The duration in milliseconds. * @return The duration in human-readable form. */ - public static String formatDuration(Long durationMs) { + public static @Nullable String formatDuration(Long durationMs) { if (durationMs == null) return null; long duration = durationMs / 1000; @@ -147,7 +152,7 @@ * @return A list of bitmaps (video thumbnails). */ @Override - protected List<Bitmap> doInBackground() { + protected @Nullable List<Bitmap> doInBackground() { assert !ThreadUtils.runningOnUiThread(); if (isCancelled()) return null; @@ -159,6 +164,7 @@ // https://developer.android.com/sdk/api_diff/29/changes/android.media.MediaMetadataRetriever MediaMetadataRetriever retriever = null; try (AssetFileDescriptor afd = mContentResolver.openAssetFileDescriptor(mUri, "r")) { + assumeNonNull(afd); retriever = new MediaMetadataRetriever(); retriever.setDataSource(afd.getFileDescriptor()); String duration = @@ -206,7 +212,7 @@ * @param results A pair of bitmap (video thumbnail) and the duration of the video. */ @Override - protected void onPostExecute(List<Bitmap> results) { + protected void onPostExecute(@Nullable List<Bitmap> results) { if (isCancelled()) { return; }
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/DecoderServiceHost.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/DecoderServiceHost.java index 745c469..37bc042 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/DecoderServiceHost.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/DecoderServiceHost.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.photo_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.content.ComponentName; import android.content.ContentResolver; import android.content.Context; @@ -18,8 +20,6 @@ import android.os.ParcelFileDescriptor; import android.os.SystemClock; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import org.chromium.base.Log; @@ -31,6 +31,8 @@ import org.chromium.base.task.AsyncTask; import org.chromium.base.task.PostTask; import org.chromium.base.task.TaskTraits; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.components.browser_ui.util.ConversionUtils; import java.util.ArrayList; @@ -40,6 +42,7 @@ import java.util.PriorityQueue; /** A class to communicate with the {@link DecoderService}. */ +@NullMarked public class DecoderServiceHost extends IDecoderServiceCallback.Stub implements DecodeVideoTask.VideoDecodingCallback { // A tag for logging error messages. @@ -76,10 +79,10 @@ private int mFailedVideoDecodesUnknown; // A worker task for asynchronously handling video decode requests. - private DecodeVideoTask mWorkerTask; + private @Nullable DecodeVideoTask mWorkerTask; // The current processing request. - private DecoderServiceParams mProcessingRequest; + private @Nullable DecoderServiceParams mProcessingRequest; // The callbacks used to notify the clients when the service is ready. private final List<DecoderStatusCallback> mCallbacks = new ArrayList<DecoderStatusCallback>(); @@ -88,10 +91,10 @@ static int sLastDecodingOrdinal = 0; // A callback to use for testing to see if decoder is ready. - static DecoderStatusCallback sStatusCallbackForTesting; + static @Nullable DecoderStatusCallback sStatusCallbackForTesting; // Used to create intents for launching the {@link DecoderService} service. - private static Supplier<Intent> sIntentSupplier; + private static @Nullable Supplier<Intent> sIntentSupplier; /** * Sets a factory for creating intents that launch the {@link DecoderService} service. This must @@ -100,14 +103,14 @@ * @param intentSupplier a factory that creates a new Intent. Will be called every time the * PhotoPicker is launched. */ - public static void setIntentSupplier(@NonNull Supplier<Intent> intentSupplier) { + public static void setIntentSupplier(Supplier<Intent> intentSupplier) { sIntentSupplier = intentSupplier; } // This is true after {#link bindService()} has been called for {@link mConnection}. It // indicates that {@link unbindService()} should be called. private boolean mBindServiceCalled; - IDecoderService mIRemoteService; + @Nullable IDecoderService mIRemoteService; private ServiceConnection mConnection = new ServiceConnection() { @Override @@ -150,8 +153,8 @@ String filePath, boolean isVideo, boolean fullWidth, - List<Bitmap> bitmaps, - String videoDuration, + @Nullable List<Bitmap> bitmaps, + @Nullable String videoDuration, float ratio); } @@ -238,11 +241,12 @@ mCallbacks.add(sStatusCallbackForTesting); } mContext = context; - mContentResolver = mContext.getContentResolver(); + mContentResolver = context.getContentResolver(); } /** Initiate binding with the {@link DecoderService}. */ public void bind() { + assumeNonNull(sIntentSupplier); Intent intent = sIntentSupplier.get(); intent.setAction(IDecoderService.class.getName()); mContext.bindService(intent, mConnection, Context.BIND_AUTO_CREATE); @@ -288,7 +292,7 @@ * * @return Next pending request (of highest priority). */ - private DecoderServiceParams getNextPending() { + private @Nullable DecoderServiceParams getNextPending() { if (mPendingRequests.isEmpty()) { return null; } @@ -378,8 +382,8 @@ @Override public void videoDecodedCallback( Uri uri, - List<Bitmap> bitmaps, - String duration, + @Nullable List<Bitmap> bitmaps, + @Nullable String duration, boolean fullWidth, @DecodeVideoTask.DecodingResult int decodingResult, float ratio) { @@ -402,6 +406,7 @@ break; } + assumeNonNull(uri.getPath()); closeRequest(uri.getPath(), true, fullWidth, bitmaps, duration, -1, ratio); } @@ -438,6 +443,7 @@ } catch (OutOfMemoryError e) { mFailedImageDecodesMemory++; } finally { + assumeNonNull(filePath); closeRequest( filePath, /* isVideo= */ false, @@ -471,11 +477,13 @@ boolean isVideo, boolean fullWidth, @Nullable List<Bitmap> bitmaps, - String videoDuration, + @Nullable String videoDuration, long decodeTime, float ratio) { // If this assert triggers, it means that simultaneous requests have been sent for // decoding, which should not happen. + assumeNonNull(mProcessingRequest); + assumeNonNull(mProcessingRequest.mUri.getPath()); assert mProcessingRequest.mUri.getPath().equals(filePath); long endRpcCall = SystemClock.elapsedRealtime(); if (isVideo && bitmaps != null) { @@ -557,6 +565,8 @@ // decoding requests will likely be dropped but note that there may be video requests // remaining (which don't require this connection to be open). Log.e(TAG, "Connection to decoder service unexpectedly terminated."); + assumeNonNull(mProcessingRequest); + assumeNonNull(mProcessingRequest.mUri.getPath()); closeRequestWithError(mProcessingRequest.mUri.getPath()); return; } @@ -571,14 +581,17 @@ AssetFileDescriptor afd = null; try { afd = mContentResolver.openAssetFileDescriptor(params.mUri, "r"); + assumeNonNull(afd); } catch (Exception e) { // FileNotFoundException, IllegalStateException, IllegalArgumentException. Log.e(TAG, "Unable to obtain FileDescriptor", e); + assumeNonNull(params.mUri.getPath()); closeRequestWithError(params.mUri.getPath()); return; } pfd = afd.getParcelFileDescriptor(); if (pfd == null) { + assumeNonNull(params.mUri.getPath()); closeRequestWithError(params.mUri.getPath()); return; } @@ -594,6 +607,7 @@ } catch (Exception e) { // RemoteException, IOException. Log.e(TAG, "IPC Failed", e); + assumeNonNull(params.mUri.getPath()); closeRequestWithError(params.mUri.getPath()); } StreamUtil.closeQuietly(pfd); @@ -612,6 +626,7 @@ Iterator it = mPendingRequests.iterator(); while (it.hasNext()) { DecoderServiceParams param = (DecoderServiceParams) it.next(); + assumeNonNull(param.mUri.getPath()); if (param.mUri.getPath().equals(filePath)) it.remove(); } }
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTask.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTask.java index f56adcb..bc278a2 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTask.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTask.java
@@ -17,6 +17,8 @@ import org.chromium.base.Log; import org.chromium.base.ThreadUtils; import org.chromium.base.task.AsyncTask; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.net.MimeTypeFilter; import org.chromium.ui.base.WindowAndroid; @@ -26,7 +28,8 @@ import java.util.List; /** A worker task to enumerate image files on disk. */ -class FileEnumWorkerTask extends AsyncTask<List<PickerBitmap>> { +@NullMarked +class FileEnumWorkerTask extends AsyncTask<@Nullable List<PickerBitmap>> { // A tag for logging error messages. private static final String TAG = "PhotoPicker"; @@ -37,7 +40,7 @@ * * @param files The list of images, or null if the function fails. */ - void filesEnumeratedCallback(List<PickerBitmap> files); + void filesEnumeratedCallback(@Nullable List<PickerBitmap> files); } private final WindowAndroid mWindowAndroid; @@ -101,7 +104,7 @@ * @return A sorted list of images (by last-modified first). */ @Override - protected List<PickerBitmap> doInBackground() { + protected @Nullable List<PickerBitmap> doInBackground() { ThreadUtils.assertOnBackgroundThread(); if (isCancelled()) return null; @@ -241,7 +244,7 @@ * @param files The resulting list of files on disk. */ @Override - protected void onPostExecute(List<PickerBitmap> files) { + protected void onPostExecute(@Nullable List<PickerBitmap> files) { if (isCancelled()) { return; } @@ -253,7 +256,7 @@ * Creates a cursor containing the image files to show. Can be overridden in tests to provide * fake data. */ - protected Cursor createImageCursor( + protected @Nullable Cursor createImageCursor( Uri contentUri, String[] selectColumns, String whereClause,
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/ImageDecoder.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/ImageDecoder.java index 02050704..ec3e1dc 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/ImageDecoder.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/ImageDecoder.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.photo_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.graphics.Bitmap; import android.os.Bundle; import android.os.ParcelFileDescriptor; @@ -14,6 +16,7 @@ import org.jni_zero.NativeMethods; import org.chromium.base.Log; +import org.chromium.build.annotations.NullMarked; import java.io.FileDescriptor; import java.io.IOException; @@ -22,6 +25,7 @@ * A helper to accept requests to take image file contents and decode them. As this is intended to * be run in a separate, sandboxed process, it also requires calling code to initialize the sandbox. */ +@NullMarked public class ImageDecoder extends IDecoderService.Stub { // The keys for the bundle when passing data to and from this service. public static final String KEY_FILE_DESCRIPTOR = "file_descriptor"; @@ -69,6 +73,7 @@ return; } + assumeNonNull(pfd); FileDescriptor fd = pfd.getFileDescriptor(); long begin = SystemClock.elapsedRealtime(); @@ -88,6 +93,7 @@ sendReply(callback, bundle); // Sends SUCCESS == false; return; } + assumeNonNull(decodedBitmap); // The most widely supported, easiest, and reasonably efficient method is to // decode to an immutable bitmap and just return the bitmap over binder. It
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerDelegateBase.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerDelegateBase.java index 9fa501f..5d211c5 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerDelegateBase.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerDelegateBase.java
@@ -4,6 +4,7 @@ package org.chromium.components.browser_ui.photo_picker; +import org.chromium.build.annotations.NullMarked; import org.chromium.ui.base.PhotoPickerDelegate; /** @@ -11,6 +12,7 @@ * * <p>Routes queries, of which flavor of the Media Picker to run, to the feature flag params. */ +@NullMarked public abstract class PhotoPickerDelegateBase implements PhotoPickerDelegate { protected PhotoPickerDelegateBase() {}
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerDialog.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerDialog.java index 36d00fb5..df4c0a94 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerDialog.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerDialog.java
@@ -4,11 +4,15 @@ package org.chromium.components.browser_ui.photo_picker; +import static org.chromium.build.NullUtil.assertNonNull; + import android.content.ContentResolver; import android.net.Uri; import androidx.activity.OnBackPressedCallback; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.components.browser_ui.widget.FullscreenAlertDialog; import org.chromium.ui.base.PhotoPicker; import org.chromium.ui.base.PhotoPickerListener; @@ -20,6 +24,7 @@ * UI for the photo chooser that shows on the Android platform as a result of <input type=file * accept=image > form element. */ +@NullMarked public class PhotoPickerDialog extends FullscreenAlertDialog implements PhotoPickerToolbar.PhotoPickerToolbarDelegate, PhotoPicker { @@ -50,7 +55,8 @@ // PhotoPickerListener: @Override - public void onPhotoPickerUserAction(@PhotoPickerAction int action, Uri[] photos) { + public void onPhotoPickerUserAction( + @PhotoPickerAction int action, Uri @Nullable [] photos) { mExternalIntentSelected = false; if (action == PhotoPickerAction.LAUNCH_GALLERY || action == PhotoPickerAction.LAUNCH_CAMERA) { @@ -87,7 +93,7 @@ PhotoPickerListener listener, boolean multiSelectionAllowed, List<String> mimeTypes) { - super(windowAndroid.getContext().get()); + super(assertNonNull(windowAndroid.getContext().get())); mListenerWrapper = new PhotoPickerListenerWrapper(listener);
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerDialogTest.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerDialogTest.java index e008e9a..b4d3546 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerDialogTest.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerDialogTest.java
@@ -38,6 +38,7 @@ import org.chromium.base.test.util.MinAndroidSdkLevel; import org.chromium.base.test.util.TestAnimations.EnableAnimations; import org.chromium.base.test.util.UrlUtils; +import org.chromium.build.annotations.Nullable; import org.chromium.components.browser_ui.widget.RecyclerViewTestUtils; import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate; import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate.SelectionObserver; @@ -224,7 +225,7 @@ // PhotoPickerDialog.PhotoPickerListener: @Override - public void onPhotoPickerUserAction(@PhotoPickerAction int action, Uri[] photos) { + public void onPhotoPickerUserAction(@PhotoPickerAction int action, Uri @Nullable [] photos) { mLastActionRecorded = action; mLastSelectedPhotos = photos != null ? photos.clone() : null; if (mLastSelectedPhotos != null) Arrays.sort(mLastSelectedPhotos);
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerFeatures.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerFeatures.java index b31f483..19a7bb3 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerFeatures.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerFeatures.java
@@ -10,9 +10,11 @@ import org.jni_zero.NativeMethods; import org.chromium.base.Features; +import org.chromium.build.annotations.NullMarked; /** Provides an API for querying the status of Photo Picker features. */ @JNINamespace("photo_picker::features") +@NullMarked public class PhotoPickerFeatures extends Features { public static final String MEDIA_PICKER_ADOPTION_NAME = "MediaPickerAdoption";
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerToolbar.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerToolbar.java index 568f740..433bdc62 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerToolbar.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PhotoPickerToolbar.java
@@ -4,16 +4,21 @@ package org.chromium.components.browser_ui.photo_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.content.Context; import android.util.AttributeSet; import android.widget.Button; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.components.browser_ui.widget.selectable_list.SelectableListToolbar; import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate; import java.util.List; /** Handles toolbar functionality for the Photo Picker class. */ +@NullMarked public class PhotoPickerToolbar extends SelectableListToolbar<PickerBitmap> { /** A delegate that handles dialog actions. */ public interface PhotoPickerToolbarDelegate { @@ -22,7 +27,7 @@ } // A delegate to notify when the dialog should close. - PhotoPickerToolbarDelegate mDelegate; + @Nullable PhotoPickerToolbarDelegate mDelegate; public PhotoPickerToolbar(Context context, AttributeSet attrs) { super(context, attrs); @@ -47,6 +52,7 @@ @Override public void onNavigationBack() { super.onNavigationBack(); + assumeNonNull(mDelegate); mDelegate.onNavigationBackCallback(); }
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerAdapter.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerAdapter.java index 5841a043..02c24c1 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerAdapter.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerAdapter.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.photo_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -12,10 +14,13 @@ import androidx.recyclerview.widget.RecyclerView.Adapter; import androidx.recyclerview.widget.RecyclerView.ViewHolder; +import org.chromium.build.annotations.NullMarked; + import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** A data adapter for the Photo Picker. */ +@NullMarked public class PickerAdapter extends Adapter<ViewHolder> { // The possible types of actions required during decoding. @IntDef({DecodeActions.NO_ACTION, DecodeActions.FROM_CACHE, DecodeActions.DECODE}) @@ -71,6 +76,7 @@ @Override public int getItemCount() { + assumeNonNull(mCategoryView.getPickerBitmaps()); return mCategoryView.getPickerBitmaps().size(); }
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerBitmap.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerBitmap.java index 771ec34..453beb8 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerBitmap.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerBitmap.java
@@ -4,16 +4,22 @@ package org.chromium.components.browser_ui.photo_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.net.Uri; import androidx.annotation.IntDef; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; + import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.text.DateFormat; import java.util.Date; /** A class to keep track of the meta data associated with a an image in the photo picker. */ +@NullMarked public class PickerBitmap implements Comparable<PickerBitmap> { // The possible types of tiles involved in the viewer. Note that the values for PICTURE and // VIDEO matter, because they are used to prioritize still images over videos in the priority @@ -28,7 +34,7 @@ } // The URI of the bitmap to show. - private Uri mUri; + private @Nullable Uri mUri; // When the bitmap was last modified on disk. private long mLastModified; @@ -43,7 +49,7 @@ * @param lastModified When the bitmap was last modified on disk. * @param type The type of tile involved. */ - public PickerBitmap(Uri uri, long lastModified, @TileTypes int type) { + public PickerBitmap(@Nullable Uri uri, long lastModified, @TileTypes int type) { // PICTURE must have a lower value than VIDEO, in order for the priority queue in // PickerCategoryView to prioritize still images ahead of video. assert TileTypes.PICTURE < TileTypes.VIDEO; @@ -58,7 +64,7 @@ * * @return The URI for this PickerBitmap object. */ - public Uri getUri() { + public @Nullable Uri getUri() { return mUri; } @@ -68,7 +74,9 @@ * @return The filename (without the extension and path). */ public String getFilenameWithoutExtension() { + assumeNonNull(mUri); String filePath = mUri.getPath(); + assumeNonNull(filePath); int index = filePath.lastIndexOf("/"); if (index == -1) return filePath; return filePath.substring(index + 1, filePath.length());
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerBitmapView.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerBitmapView.java index b459b7f..545b52bd 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerBitmapView.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerBitmapView.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.photo_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.content.Context; @@ -24,11 +26,13 @@ import android.widget.ImageView; import android.widget.TextView; -import androidx.annotation.Nullable; import androidx.appcompat.content.res.AppCompatResources; import androidx.core.widget.ImageViewCompat; import org.chromium.base.ResettersForTesting; +import org.chromium.build.annotations.Initializer; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.components.browser_ui.util.TraceEventVectorDrawableCompat; import org.chromium.components.browser_ui.widget.selectable_list.SelectableItemViewBase; import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate; @@ -36,6 +40,7 @@ import java.util.List; /** A container class for a view showing a photo in the Photo Picker. */ +@NullMarked public class PickerBitmapView extends SelectableItemViewBase<PickerBitmap> { // The length of the image selection animation (in ms). private static final int ANIMATION_DURATION = 100; @@ -47,7 +52,7 @@ private static final int IMAGE_FRAME_DISPLAY = 250; // An animation listener to verify correct selection behavior with tests. - private static AnimationListener sAnimationListenerForTest; + private static @Nullable AnimationListener sAnimationListenerForTest; // Our context. private Context mContext; @@ -59,7 +64,7 @@ private SelectionDelegate<PickerBitmap> mSelectionDelegate; // The request details (meta-data) for the bitmap shown. - private PickerBitmap mBitmapDetails; + private @Nullable PickerBitmap mBitmapDetails; // The image view containing the bitmap. private ImageView mIconView; @@ -165,6 +170,8 @@ @Override public final void onClick(View view) { if (view == mPlayButton || view == mPlayButtonLarge) { + assumeNonNull(mBitmapDetails); + assumeNonNull(mBitmapDetails.getUri()); mCategoryView.startVideoPlaybackAsync(mBitmapDetails.getUri()); } else { super.onClick(view); @@ -200,7 +207,7 @@ } @Override - protected boolean toggleSelectionForItem(PickerBitmap item) { + protected boolean toggleSelectionForItem(@Nullable PickerBitmap item) { if (isGalleryTile() || isCameraTile()) return false; if (mCategoryView.isZoomSwitchingInEffect()) return false; return super.toggleSelectionForItem(item); @@ -333,6 +340,7 @@ info.setCheckable(true); info.setChecked(isChecked()); + assumeNonNull(mBitmapDetails); CharSequence text = mBitmapDetails.getFilenameWithoutExtension() + " " @@ -346,6 +354,7 @@ * @param categoryView The category view showing the images. Used to access common functionality * and sizes and retrieve the {@link SelectionDelegate}. */ + @Initializer public void setCategoryView(PickerCategoryView categoryView) { mCategoryView = categoryView; mSelectionDelegate = mCategoryView.getSelectionDelegate(); @@ -362,10 +371,11 @@ * @param placeholder Whether the image given is a placeholder or the actual image. * @param ratio The aspect ratio of the image, if it were shown full-width. */ + @Initializer public void initialize( PickerBitmap bitmapDetails, @Nullable List<Bitmap> thumbnails, - String videoDuration, + @Nullable String videoDuration, boolean placeholder, float ratio) { resetTile(); @@ -426,7 +436,8 @@ * @param ratio The aspect ratio of the image, if it were shown using the full screen width. * @return True if no image was loaded before (e.g. not even a low-res image). */ - public boolean setThumbnailBitmap(List<Bitmap> thumbnails, String videoDuration, float ratio) { + public boolean setThumbnailBitmap( + @Nullable List<Bitmap> thumbnails, @Nullable String videoDuration, float ratio) { assert thumbnails == null || thumbnails.size() > 0; // There are four cases to consider: @@ -435,7 +446,7 @@ // 3) Videos: one thumbnail is shown first (videoDuration non-null, thumbnail.size() = 1). // 4) Then, as more video frames are decoded (thumbnail.size() > 1). // Only the last case needs to branch into the AnimationDrawable part. - if (videoDuration == null || thumbnails.size() == 1) { + if (videoDuration == null || assumeNonNull(thumbnails).size() == 1) { mIconView.setImageBitmap(thumbnails == null ? null : thumbnails.get(0)); } else { final AnimationDrawable animationDrawable = new AnimationDrawable(); @@ -492,6 +503,8 @@ /** Updates the selection controls for this view. */ private void updateSelectionState(boolean animateBorderChanges) { + assumeNonNull(mBitmapDetails); + boolean special = !isPictureTile(); boolean anySelection = mSelectionDelegate != null && mSelectionDelegate.isSelectionEnabled(); @@ -540,14 +553,17 @@ } private boolean isGalleryTile() { + assumeNonNull(mBitmapDetails); return mBitmapDetails.type() == PickerBitmap.TileTypes.GALLERY; } private boolean isCameraTile() { + assumeNonNull(mBitmapDetails); return mBitmapDetails.type() == PickerBitmap.TileTypes.CAMERA; } private boolean isPictureTile() { + assumeNonNull(mBitmapDetails); return mBitmapDetails.type() == PickerBitmap.TileTypes.PICTURE || mBitmapDetails.type() == PickerBitmap.TileTypes.VIDEO; }
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerBitmapViewHolder.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerBitmapViewHolder.java index e780036f..b6b0fbb 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerBitmapViewHolder.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerBitmapViewHolder.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.photo_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.content.res.Resources; import android.graphics.Bitmap; import android.os.SystemClock; @@ -13,11 +15,15 @@ import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.task.AsyncTask; +import org.chromium.build.annotations.Initializer; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import java.util.ArrayList; import java.util.List; /** Holds on to a {@link PickerBitmapView} that displays information about a picker bitmap. */ +@NullMarked public class PickerBitmapViewHolder extends ViewHolder implements DecoderServiceHost.ImagesDecodedCallback { // Our parent category. @@ -46,8 +52,8 @@ String filePath, boolean isVideo, boolean fullWidth, - List<Bitmap> bitmaps, - String videoDuration, + @Nullable List<Bitmap> bitmaps, + @Nullable String videoDuration, float ratio) { if (bitmaps == null || bitmaps.size() == 0) return; @@ -109,11 +115,13 @@ * @param position The position of the item to fetch. * @return The decoding action required to display the item. */ + @Initializer public @PickerAdapter.DecodeActions int displayItem( PickerCategoryView categoryView, int position) { mCategoryView = categoryView; List<PickerBitmap> pickerBitmaps = mCategoryView.getPickerBitmaps(); + assumeNonNull(pickerBitmaps); mBitmapDetails = pickerBitmaps.get(position); if (mBitmapDetails.type() == PickerBitmap.TileTypes.CAMERA @@ -122,6 +130,7 @@ return PickerAdapter.DecodeActions.NO_ACTION; } + assumeNonNull(mBitmapDetails.getUri()); String filePath = mBitmapDetails.getUri().getPath(); PickerCategoryView.Thumbnail original = mCategoryView.isInMagnifyingMode() @@ -163,14 +172,14 @@ mItemView.initialize(mBitmapDetails, null, null, true, -1); } - mCategoryView - .getDecoderServiceHost() - .decodeImage( - mBitmapDetails.getUri(), - mBitmapDetails.type(), - width, - mCategoryView.isInMagnifyingMode(), - this); + DecoderServiceHost decoderServiceHost = mCategoryView.getDecoderServiceHost(); + assumeNonNull(decoderServiceHost); + decoderServiceHost.decodeImage( + mBitmapDetails.getUri(), + mBitmapDetails.type(), + width, + mCategoryView.isInMagnifyingMode(), + this); return PickerAdapter.DecodeActions.DECODE; } @@ -178,12 +187,13 @@ * Returns the file path of the current request, or null if no request is in progress for this * holder. */ - public String getFilePath() { + public @Nullable String getFilePath() { if (mBitmapDetails == null || (mBitmapDetails.type() != PickerBitmap.TileTypes.PICTURE && mBitmapDetails.type() != PickerBitmap.TileTypes.VIDEO)) { return null; } + assumeNonNull(mBitmapDetails.getUri()); return mBitmapDetails.getUri().getPath(); } }
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerCategoryView.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerCategoryView.java index 6448d59..b7473acc 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerCategoryView.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerCategoryView.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.photo_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.content.ContentResolver; import android.content.Context; import android.content.DialogInterface; @@ -31,6 +33,9 @@ import org.chromium.base.DiscardableReferencePool.DiscardableReference; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.task.AsyncTask; +import org.chromium.build.annotations.Initializer; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.components.browser_ui.util.ConversionUtils; import org.chromium.components.browser_ui.util.GlobalDiscardableReferencePool; import org.chromium.components.browser_ui.widget.selectable_list.SelectableListLayout; @@ -49,6 +54,7 @@ * A class for keeping track of common data associated with showing photos in the photo picker, for * example the RecyclerView and the bitmap caches. */ +@NullMarked public class PickerCategoryView extends RelativeLayout implements FileEnumWorkerTask.FilesEnumeratedCallback, RecyclerView.RecyclerListener, @@ -70,14 +76,18 @@ public static class Thumbnail { public List<Bitmap> bitmaps; public Boolean fullWidth; - public String videoDuration; + public @Nullable String videoDuration; // The calculated ratio of the originals for the bitmaps above, were they to be shown // un-cropped. NOTE: The |bitmaps| above may already have been cropped and as such might // have a different ratio. public float ratioOriginal; - Thumbnail(List<Bitmap> bitmaps, String videoDuration, Boolean fullWidth, float ratio) { + Thumbnail( + List<Bitmap> bitmaps, + @Nullable String videoDuration, + Boolean fullWidth, + float ratio) { this.bitmaps = bitmaps; this.videoDuration = videoDuration; this.fullWidth = fullWidth; @@ -86,7 +96,7 @@ } // The dialog that owns us. - private PhotoPickerDialog mDialog; + private @Nullable PhotoPickerDialog mDialog; // The view containing the RecyclerView and the toolbar, etc. private SelectableListLayout<PickerBitmap> mSelectableListLayout; @@ -98,7 +108,7 @@ private ContentResolver mContentResolver; // The list of images on disk, sorted by last-modified first. - private List<PickerBitmap> mPickerBitmaps; + private @Nullable List<PickerBitmap> mPickerBitmaps; // True if multi-selection is allowed in the picker. private boolean mMultiSelectionAllowed; @@ -107,7 +117,7 @@ private PhotoPickerListener mListener; // The host class for the decoding service. - private DecoderServiceHost mDecoderServiceHost; + private @Nullable DecoderServiceHost mDecoderServiceHost; // The RecyclerView showing the images. private RecyclerView mRecyclerView; @@ -127,13 +137,13 @@ // A low-resolution cache for thumbnails, lazily created. Helpful for cache misses from the // high-resolution cache to avoid showing gray squares (we show pixelated versions instead until // image can be loaded off disk, which is much less jarring). - private DiscardableReference<LruCache<String, Thumbnail>> mLowResThumbnails; + private @Nullable DiscardableReference<LruCache<String, Thumbnail>> mLowResThumbnails; // A high-resolution cache for thumbnails, lazily created. - private DiscardableReference<LruCache<String, Thumbnail>> mHighResThumbnails; + private @Nullable DiscardableReference<LruCache<String, Thumbnail>> mHighResThumbnails; // A cache for full-screen versions of images, lazily created. - private DiscardableReference<LruCache<String, Thumbnail>> mFullScreenBitmaps; + private @Nullable DiscardableReference<LruCache<String, Thumbnail>> mFullScreenBitmaps; // The size of the low-res cache. private int mCacheSizeLarge; @@ -167,7 +177,7 @@ private int mSpecialTileHeight; // A worker task for asynchronously enumerating files off the main thread. - private FileEnumWorkerTask mWorkerTask; + private @Nullable FileEnumWorkerTask mWorkerTask; // The timestamp for the start of the enumeration of files on disk. private long mEnumStartTime; @@ -179,7 +189,7 @@ private List<String> mMimeTypes; // A list of files to use for testing (instead of reading files on disk). - private static List<PickerBitmap> sTestFiles; + private static @Nullable List<PickerBitmap> sTestFiles; // The Video Player. private final PickerVideoPlayer mVideoPlayer; @@ -202,6 +212,7 @@ super(windowAndroid.getContext().get()); mWindowAndroid = windowAndroid; Context context = mWindowAndroid.getContext().get(); + assumeNonNull(context); mContentResolver = contentResolver; mMultiSelectionAllowed = multiSelectionAllowed; @@ -316,6 +327,7 @@ * @param listener The listener who should be notified of actions. * @param mimeTypes A list of mime types to show in the dialog. */ + @Initializer public void initialize( PhotoPickerDialog dialog, PhotoPickerListener listener, List<String> mimeTypes) { mDialog = dialog; @@ -337,7 +349,7 @@ // FileEnumWorkerTask.FilesEnumeratedCallback: @Override - public void filesEnumeratedCallback(List<PickerBitmap> files) { + public void filesEnumeratedCallback(@Nullable List<PickerBitmap> files) { if (files == null) { return; } @@ -372,6 +384,7 @@ PickerBitmapViewHolder bitmapHolder = (PickerBitmapViewHolder) holder; String filePath = bitmapHolder.getFilePath(); if (filePath != null) { + assumeNonNull(getDecoderServiceHost()); getDecoderServiceHost().cancelDecodeImage(filePath); } } @@ -421,6 +434,7 @@ mMagnifyingMode = !mMagnifyingMode; Context context = mWindowAndroid.getContext().get(); + assumeNonNull(context); if (mMagnifyingMode) { mZoom.setImageResource(R.drawable.zoom_out); mZoom.setContentDescription( @@ -493,11 +507,11 @@ return mSelectionDelegate; } - public List<PickerBitmap> getPickerBitmaps() { + public @Nullable List<PickerBitmap> getPickerBitmaps() { return mPickerBitmaps; } - public DecoderServiceHost getDecoderServiceHost() { + public @Nullable DecoderServiceHost getDecoderServiceHost() { return mDecoderServiceHost; } @@ -507,7 +521,7 @@ GlobalDiscardableReferencePool.getReferencePool() .put(new LruCache<String, Thumbnail>(mCacheSizeSmall)); } - return mLowResThumbnails.get(); + return assumeNonNull(mLowResThumbnails.get()); } public LruCache<String, Thumbnail> getHighResThumbnails() { @@ -516,7 +530,7 @@ GlobalDiscardableReferencePool.getReferencePool() .put(new LruCache<String, Thumbnail>(mCacheSizeLarge)); } - return mHighResThumbnails.get(); + return assumeNonNull(mHighResThumbnails.get()); } public LruCache<String, Thumbnail> getFullScreenBitmaps() { @@ -525,7 +539,7 @@ GlobalDiscardableReferencePool.getReferencePool() .put(new LruCache<String, Thumbnail>(mCacheSizeFullScreen)); } - return mFullScreenBitmaps.get(); + return assumeNonNull(mFullScreenBitmaps.get()); } public boolean isMultiSelectAllowed() { @@ -546,6 +560,7 @@ private void calculateGridMetrics() { DisplayMetrics displayMetrics = new DisplayMetrics(); Context context = mWindowAndroid.getContext().get(); + assumeNonNull(context); WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); windowManager.getDefaultDisplay().getMetrics(displayMetrics); @@ -597,6 +612,7 @@ Uri[] photos = new Uri[selectedFiles.size()]; int i = 0; for (PickerBitmap bitmap : selectedFiles) { + assumeNonNull(bitmap.getUri()); photos[i++] = bitmap.getUri(); } @@ -655,7 +671,7 @@ * @param umaId The UMA value to record with the action. */ private void executeAction( - @PhotoPickerListener.PhotoPickerAction int action, Uri[] photos, int umaId) { + @PhotoPickerListener.PhotoPickerAction int action, Uri @Nullable [] photos, int umaId) { mListener.onPhotoPickerUserAction(action, photos); if (mDialog != null) mDialog.dismiss(); recordFinalUmaStats(umaId);
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerVideoPlayer.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerVideoPlayer.java index 3809e45..d5e7282 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerVideoPlayer.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/PickerVideoPlayer.java
@@ -4,6 +4,8 @@ package org.chromium.components.browser_ui.photo_picker; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.animation.Animator; import android.content.Context; import android.content.res.Configuration; @@ -36,6 +38,8 @@ import org.chromium.base.ResettersForTesting; import org.chromium.base.task.PostTask; import org.chromium.base.task.TaskTraits; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.ui.UiUtils; import org.chromium.ui.base.ViewUtils; @@ -43,6 +47,7 @@ import java.lang.annotation.RetentionPolicy; /** Encapsulates the video player functionality of the Photo Picker dialog. */ +@NullMarked public class PickerVideoPlayer extends FrameLayout implements View.OnClickListener, SeekBar.OnSeekBarChangeListener, @@ -95,7 +100,7 @@ } // The callback to use for reporting playback progress in tests. - private static VideoPlaybackStatusCallback sProgressCallback; + private static @Nullable VideoPlaybackStatusCallback sProgressCallback; // The amount of time (in milliseconds) to skip when fast forwarding/rewinding. private static final int SKIP_LENGTH_IN_MS = 10000; @@ -119,7 +124,7 @@ private static boolean sShortAnimationTimesForTesting; // The Window for the dialog the player is shown in. - private Window mWindow; + private @Nullable Window mWindow; // The Context to use. private Context mContext; @@ -134,7 +139,7 @@ private final VideoView mVideoView; // The MediaPlayer object used to control the VideoView. - private MediaPlayer mMediaPlayer; + private @Nullable MediaPlayer mMediaPlayer; // The container view for all the UI elements overlaid on top of the video. private final View mVideoOverlayContainer; @@ -256,6 +261,7 @@ // size. Post a task, so that size adjustments happen after layout of the video controls has // completed (so that the calculations for the view have had time to account for the // existence of the nav bar and status bar -- or lack thereof). + assumeNonNull(getHandler()); getHandler().post(() -> adjustVideoLayoutParamsToOrientation()); super.onConfigurationChanged(newConfig); } @@ -266,12 +272,13 @@ * @param uri The uri of the video to start playing. * @param window The window for the dialog. */ - public void startVideoPlaybackAsync(Uri uri, Window window) { + public void startVideoPlaybackAsync(Uri uri, @Nullable Window window) { mWindow = window; syncNavBarColorToPlaybackStatus(/* playerOpening= */ true); // Make the filename (uri) of the video visible at the top and de-emphasize the scheme part. SpannableString fileName = new SpannableString(uri.toString()); + assumeNonNull(uri.getScheme()); fileName.setSpan( new TextAppearanceSpan(mContext, R.style.TextAppearance_TextMedium_Secondary), 0, @@ -299,6 +306,7 @@ mMediaPlayer.setOnInfoListener( (MediaPlayer player, int what, int extra) -> { if (what == MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) { + assumeNonNull(sProgressCallback); sProgressCallback.onVideoPlaying(); return true; } @@ -352,6 +360,7 @@ */ private void syncNavBarColorToPlaybackStatus(boolean playerOpening) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + assumeNonNull(mWindow); if (playerOpening) { if (mPreviousNavBarColorsSaved) { return; // Don't overwrite previously saved colors. @@ -444,6 +453,7 @@ } private boolean onDoubleTapVideo(float x) { + assumeNonNull(mMediaPlayer); int videoPos = mMediaPlayer.getCurrentPosition(); int duration = mMediaPlayer.getDuration(); @@ -480,6 +490,7 @@ @Override public void onSystemUiVisibilityChange(int visibility) { if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { + assumeNonNull(mWindow); mWindow.getDecorView().setOnSystemUiVisibilityChangeListener(null); onExitFullScreenMode(); @@ -488,6 +499,7 @@ // from the top of the screen, the system sends the visibility change event before // the resize has happened, so the new video size isn't known yet. Syncing // immediately would make the overlay controls appear in the wrong location. + assumeNonNull(getHandler()); getHandler().post(() -> adjustVideoLayoutParamsToOrientation()); return; } @@ -536,6 +548,7 @@ private void videoSeekTo(int position) { if (Build.VERSION.SDK_INT >= 26) { + assumeNonNull(mMediaPlayer); mMediaPlayer.seekTo(position, MediaPlayer.SEEK_CLOSEST); } else { // On older versions, sync to nearest previous key frame. @@ -763,6 +776,7 @@ } private void startVideoPlayback() { + assumeNonNull(mMediaPlayer); mMediaPlayer.start(); switchToPauseButton(); showAndMaybeHideVideoControls(/* animateIn= */ false, FadeOut.FADE_OUT_PLAY_QUICKLY); @@ -771,6 +785,7 @@ private void stopVideoPlayback() { stopPlaybackMonitor(); + assumeNonNull(mMediaPlayer); mMediaPlayer.pause(); switchToPlayButton(); showAndMaybeHideVideoControls(/* animateIn= */ false, FadeOut.NO_FADE_OUT); @@ -798,6 +813,7 @@ private void toggleMute() { mAudioOn = !mAudioOn; + assumeNonNull(mMediaPlayer); if (mAudioOn) { mMediaPlayer.setVolume(1f, 1f); mMuteButton.setImageResource(R.drawable.ic_volume_on_white_24dp); @@ -829,6 +845,7 @@ private void toggleAndroidSystemUiForFullscreen() { mFullScreenToggledInApp = true; + assumeNonNull(mWindow); View decorView = mWindow.getDecorView(); if (!mFullScreenEnabled) { decorView.setOnSystemUiVisibilityChangeListener(this);
diff --git a/components/browser_ui/styles/android/java/res/values/dimens.xml b/components/browser_ui/styles/android/java/res/values/dimens.xml index 2704bae..6270fe1 100644 --- a/components/browser_ui/styles/android/java/res/values/dimens.xml +++ b/components/browser_ui/styles/android/java/res/values/dimens.xml
@@ -13,11 +13,6 @@ <!-- Button bar dimensions --> <dimen name="button_bar_stacked_margin">8dp</dimen> - <!-- Modal dialog--> - <dimen name="modal_dialog_control_vertical_padding_filled">16dp</dimen> - <dimen name="modal_dialog_control_horizontal_padding_filled">16dp</dimen> - <dimen name="modal_dialog_spinner_size">24dp</dimen> - <!-- Alert dialog --> <dimen name="dialog_padding_top">@dimen/abc_dialog_padding_top_material</dimen> <dimen name="dialog_padding_sides">@dimen/abc_dialog_padding_material</dimen>
diff --git a/components/browser_ui/widget/android/BUILD.gn b/components/browser_ui/widget/android/BUILD.gn index d5416022..8eba585 100644 --- a/components/browser_ui/widget/android/BUILD.gn +++ b/components/browser_ui/widget/android/BUILD.gn
@@ -30,7 +30,6 @@ "java/src/org/chromium/components/browser_ui/widget/MaterialSwitchWithText.java", "java/src/org/chromium/components/browser_ui/widget/MaterialSwitchWithTitleAndSummary.java", "java/src/org/chromium/components/browser_ui/widget/MenuOrKeyboardActionController.java", - "java/src/org/chromium/components/browser_ui/widget/ModalDialogViewUtils.java", "java/src/org/chromium/components/browser_ui/widget/MoreProgressButton.java", "java/src/org/chromium/components/browser_ui/widget/NumberRollView.java", "java/src/org/chromium/components/browser_ui/widget/PaddedFrameLayout.java", @@ -296,7 +295,6 @@ ] deps = [ "shared_with_webview:java_resources", - "//chrome/browser/ui/android/strings:ui_strings_grd", "//components/browser_ui/strings/android:browser_ui_strings_grd", "//components/browser_ui/styles/android:java_resources", "//third_party/android_deps:material_design_java",
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/ActionConfirmationDialog.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/ActionConfirmationDialog.java index a2857f3..4cf6160 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/ActionConfirmationDialog.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/ActionConfirmationDialog.java
@@ -8,28 +8,24 @@ import android.content.res.Resources; import android.view.LayoutInflater; import android.view.View; -import android.widget.Button; import android.widget.CheckBox; import android.widget.TextView; -import androidx.annotation.ColorInt; import androidx.annotation.IntDef; import androidx.annotation.StringRes; import androidx.core.util.Function; import org.chromium.base.CallbackController; -import org.chromium.base.supplier.OneshotSupplier; -import org.chromium.base.supplier.OneshotSupplierImpl; import org.chromium.base.task.PostTask; import org.chromium.base.task.TaskTraits; import org.chromium.build.annotations.NullMarked; import org.chromium.build.annotations.Nullable; -import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.components.browser_ui.widget.StrictButtonPressController.ButtonClickResult; import org.chromium.ui.modaldialog.DialogDismissalCause; import org.chromium.ui.modaldialog.ModalDialogManager; import org.chromium.ui.modaldialog.ModalDialogManager.ModalDialogType; import org.chromium.ui.modaldialog.ModalDialogProperties; +import org.chromium.ui.modaldialog.ModalDialogProperties.ButtonStyles; import org.chromium.ui.modaldialog.ModalDialogProperties.ButtonType; import org.chromium.ui.modelutil.PropertyModel; @@ -167,6 +163,11 @@ // scrim. mPropertyModel.set(ModalDialogProperties.BLOCK_INPUTS, true); mPropertyModel.set(ModalDialogProperties.CANCEL_ON_TOUCH_OUTSIDE, false); + mPropertyModel.set( + buttonClickResult == ButtonClickResult.POSITIVE + ? ModalDialogProperties.POSITIVE_BUTTON_LOADING + : ModalDialogProperties.NEGATIVE_BUTTON_LOADING, + true); mBarrierDismissRunnable = () -> dismissDialog(getDialogDismissalCause(buttonClickResult)); @@ -318,74 +319,19 @@ DismissHandlerImpl dismissHandler = new DismissHandlerImpl( mModalDialogManager, confirmationDialogHandler, stopShowingDelegate); - OneshotSupplierImpl<PropertyModel> modelSupplier = new OneshotSupplierImpl<>(); - View buttonBarView = - createCustomButtonBarView(mContext, modelSupplier, positiveText, negativeText); PropertyModel model = new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS) .with(ModalDialogProperties.CONTROLLER, dismissHandler) .with(ModalDialogProperties.TITLE, titleText) + .with(ModalDialogProperties.POSITIVE_BUTTON_TEXT, positiveText) + .with(ModalDialogProperties.NEGATIVE_BUTTON_TEXT, negativeText) .with(ModalDialogProperties.CANCEL_ON_TOUCH_OUTSIDE, true) + .with( + ModalDialogProperties.BUTTON_STYLES, + ButtonStyles.PRIMARY_FILLED_NEGATIVE_OUTLINE) .with(ModalDialogProperties.CUSTOM_VIEW, customView) - .with(ModalDialogProperties.CUSTOM_BUTTON_BAR_VIEW, buttonBarView) .build(); - modelSupplier.set(model); dismissHandler.setPropertyModel(model); mModalDialogManager.showDialog(model, ModalDialogType.APP); } - - private static View createCustomButtonBarView( - Context context, - OneshotSupplier<PropertyModel> modelSupplier, - String positiveText, - String negativeText) { - SpinnerButtonWrapper positiveButtonSpinner = - createSpinnerButton( - context, modelSupplier, /* isPositiveButton= */ true, positiveText); - SpinnerButtonWrapper negativeButtonSpinner = - createSpinnerButton( - context, modelSupplier, /* isPositiveButton= */ false, negativeText); - return ModalDialogViewUtils.createCustomButtonBarView( - context, positiveButtonSpinner, negativeButtonSpinner); - } - - private static SpinnerButtonWrapper createSpinnerButton( - Context context, - OneshotSupplier<PropertyModel> modelSupplier, - boolean isPositiveButton, - String buttonText) { - int layoutButtonType = - isPositiveButton - ? DualControlLayout.ButtonType.PRIMARY_FILLED - : DualControlLayout.ButtonType.SECONDARY_TEXT; - @ColorInt - int spinnerColor = - isPositiveButton - ? SemanticColorUtils.getDefaultBgColor(context) - : SemanticColorUtils.getDefaultIconColorAccent1(context); - int dialogButtonType = - isPositiveButton - ? ModalDialogProperties.ButtonType.POSITIVE - : ModalDialogProperties.ButtonType.NEGATIVE; - - Button button = - DualControlLayout.createButtonForLayout( - context, layoutButtonType, buttonText, null); - SpinnerButtonWrapper spinnerButtonWrapper = - SpinnerButtonWrapper.createSpinnerButtonWrapper( - context, - button, - R.string.collaboration_loading_button, - R.dimen.modal_dialog_spinner_size, - spinnerColor, - () -> { - // There is no need to use #onAvailable() for the modelSupplier as the - // model will always be readily available since the use of a {@link - // OneshotSupplier} is to resolve a dependency ordering issue. - PropertyModel model = modelSupplier.get(); - model.get(ModalDialogProperties.CONTROLLER) - .onClick(model, dialogButtonType); - }); - return spinnerButtonWrapper; - } }
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/ActionConfirmationDialogUnitTest.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/ActionConfirmationDialogUnitTest.java index 6cf8675..fe161017 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/ActionConfirmationDialogUnitTest.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/ActionConfirmationDialogUnitTest.java
@@ -44,7 +44,6 @@ import org.robolectric.shadows.ShadowLooper; import org.chromium.base.test.BaseRobolectricTestRunner; -import org.chromium.chrome.R; import org.chromium.components.browser_ui.widget.ActionConfirmationDialog.ConfirmationDialogHandler; import org.chromium.components.browser_ui.widget.ActionConfirmationDialog.DialogDismissType; import org.chromium.components.browser_ui.widget.ActionConfirmationDialog.DismissHandler; @@ -73,7 +72,7 @@ @Before public void setUp() { Activity activity = Robolectric.buildActivity(Activity.class).setup().get(); - activity.setTheme(R.style.Theme_BrowserUI_DayNight); + activity.setTheme(R.style.Theme_AppCompat); mContext = activity; configureDismissType(DialogDismissType.DISMISS_IMMEDIATELY); } @@ -124,6 +123,7 @@ PropertyModel propertyModel = mPropertyModelArgumentCaptor.getValue(); assertEquals("Title", propertyModel.get(ModalDialogProperties.TITLE)); + assertEquals("Confirm", propertyModel.get(ModalDialogProperties.POSITIVE_BUTTON_TEXT)); View customView = propertyModel.get(ModalDialogProperties.CUSTOM_VIEW); TextView descriptionTextView = customView.findViewById(R.id.description_text_view); assertEquals("Learn more", descriptionTextView.getText()); @@ -348,6 +348,8 @@ /* stopShowing= */ eq(false)); assertTrue(propertyModel.get(ModalDialogProperties.BLOCK_INPUTS)); assertFalse(propertyModel.get(ModalDialogProperties.CANCEL_ON_TOUCH_OUTSIDE)); + assertTrue(propertyModel.get(ModalDialogProperties.POSITIVE_BUTTON_LOADING)); + assertFalse(propertyModel.get(ModalDialogProperties.NEGATIVE_BUTTON_LOADING)); // Signal the condition is met first. mDimissLaterRunnable.run(); @@ -390,6 +392,8 @@ /* stopShowing= */ eq(false)); assertTrue(propertyModel.get(ModalDialogProperties.BLOCK_INPUTS)); assertFalse(propertyModel.get(ModalDialogProperties.CANCEL_ON_TOUCH_OUTSIDE)); + assertFalse(propertyModel.get(ModalDialogProperties.POSITIVE_BUTTON_LOADING)); + assertTrue(propertyModel.get(ModalDialogProperties.NEGATIVE_BUTTON_LOADING)); // Button spinner min-time first. shadowOf(Looper.getMainLooper()).runOneTask(); @@ -432,6 +436,8 @@ /* stopShowing= */ eq(false)); assertTrue(propertyModel.get(ModalDialogProperties.BLOCK_INPUTS)); assertFalse(propertyModel.get(ModalDialogProperties.CANCEL_ON_TOUCH_OUTSIDE)); + assertFalse(propertyModel.get(ModalDialogProperties.POSITIVE_BUTTON_LOADING)); + assertTrue(propertyModel.get(ModalDialogProperties.NEGATIVE_BUTTON_LOADING)); // Flush the min-button duration. shadowOf(Looper.getMainLooper()).runOneTask();
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/selectable_list/CheckableSelectableItemView.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/selectable_list/CheckableSelectableItemView.java index d94bf56..05408da97 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/selectable_list/CheckableSelectableItemView.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/selectable_list/CheckableSelectableItemView.java
@@ -80,7 +80,7 @@ * Set drawable for the start icon view. Note that you may need to use this method instead of * mIconView#setImageDrawable to ensure icon view is correctly set in selection mode. */ - public void setIconDrawable(Drawable iconDrawable) { + public void setIconDrawable(@Nullable Drawable iconDrawable) { mIconDrawable = iconDrawable; updateView(false); }
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/selectable_list/SelectableItemView.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/selectable_list/SelectableItemView.java index b84a748..ee4b01c 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/selectable_list/SelectableItemView.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/selectable_list/SelectableItemView.java
@@ -113,7 +113,7 @@ * Set drawable for the start icon view. Note that you may need to use this method instead of * mIconView#setImageDrawable to ensure icon view is correctly set in selection mode. */ - protected void setStartIconDrawable(Drawable iconDrawable) { + protected void setStartIconDrawable(@Nullable Drawable iconDrawable) { setIconDrawable(iconDrawable); }
diff --git a/components/collaboration/internal/messaging/storage/protocol/message.proto b/components/collaboration/internal/messaging/storage/protocol/message.proto index 454f834c..f7fb5c5 100644 --- a/components/collaboration/internal/messaging/storage/protocol/message.proto +++ b/components/collaboration/internal/messaging/storage/protocol/message.proto
@@ -52,10 +52,7 @@ // Collaboration message related data. message CollaborationData { - // Store the triggering user name. - optional string triggering_user_name = 1; - - reserved 2; + reserved 1, 2; } message Message {
diff --git a/components/data_sharing/internal/BUILD.gn b/components/data_sharing/internal/BUILD.gn index da89d85f..0bbb60a9 100644 --- a/components/data_sharing/internal/BUILD.gn +++ b/components/data_sharing/internal/BUILD.gn
@@ -37,8 +37,6 @@ "group_data_store.h", "logger_impl.cc", "logger_impl.h", - "partial_failure_sdk_delegate_wrapper.cc", - "partial_failure_sdk_delegate_wrapper.h", "preview_server_proxy.cc", "preview_server_proxy.h", ] @@ -98,7 +96,6 @@ "group_data_proto_utils_unittest.cc", "group_data_store_unittest.cc", "logger_impl_unittest.cc", - "partial_failure_sdk_delegate_wrapper_unittest.cc", "preview_server_proxy_unittest.cc", ]
diff --git a/components/data_sharing/internal/group_data_model.cc b/components/data_sharing/internal/group_data_model.cc index 786695f..cfe0248 100644 --- a/components/data_sharing/internal/group_data_model.cc +++ b/components/data_sharing/internal/group_data_model.cc
@@ -6,6 +6,7 @@ #include <iterator> +#include "base/check.h" #include "base/files/file_path.h" #include "base/functional/bind.h" #include "base/functional/callback_forward.h" @@ -53,6 +54,7 @@ collaboration_group_sync_bridge_(collaboration_group_sync_bridge), sdk_delegate_(sdk_delegate) { CHECK(collaboration_group_sync_bridge_); + CHECK(sdk_delegate_); collaboration_group_sync_bridge_->AddObserver(this); if (collaboration_group_sync_bridge_->IsDataLoaded()) { @@ -296,7 +298,7 @@ collaboration_group_specifics_opt->consistency_token()); } - sdk_delegate_.ReadGroups( + sdk_delegate_->ReadGroups( params, base::BindOnce(&GroupDataModel::OnGroupsFetchedFromSDK, weak_ptr_factory_.GetWeakPtr(), group_versions, base::Time::Now()));
diff --git a/components/data_sharing/internal/group_data_model.h b/components/data_sharing/internal/group_data_model.h index 2ffb07a0..5d6348d 100644 --- a/components/data_sharing/internal/group_data_model.h +++ b/components/data_sharing/internal/group_data_model.h
@@ -13,7 +13,6 @@ #include "base/time/time.h" #include "components/data_sharing/internal/collaboration_group_sync_bridge.h" #include "components/data_sharing/internal/group_data_store.h" -#include "components/data_sharing/internal/partial_failure_sdk_delegate_wrapper.h" #include "components/data_sharing/public/data_sharing_sdk_delegate.h" #include "components/data_sharing/public/group_data.h" #include "components/data_sharing/public/protocol/data_sharing_sdk.pb.h" @@ -137,7 +136,7 @@ std::vector<GroupEvent> group_events_since_startup_; raw_ptr<CollaborationGroupSyncBridge> collaboration_group_sync_bridge_; - PartialFailureSDKDelegateWrapper sdk_delegate_; + raw_ptr<DataSharingSDKDelegate> sdk_delegate_; // Used only for tests to notify that GroupDataStore has been loaded (either // successfully or unsuccessfully).
diff --git a/components/data_sharing/internal/partial_failure_sdk_delegate_wrapper.cc b/components/data_sharing/internal/partial_failure_sdk_delegate_wrapper.cc deleted file mode 100644 index f7252fe2..0000000 --- a/components/data_sharing/internal/partial_failure_sdk_delegate_wrapper.cc +++ /dev/null
@@ -1,182 +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 "components/data_sharing/internal/partial_failure_sdk_delegate_wrapper.h" - -#include "base/functional/callback.h" -#include "base/types/expected.h" -#include "components/data_sharing/public/data_sharing_sdk_delegate.h" -#include "components/data_sharing/public/group_data.h" -#include "components/data_sharing/public/protocol/data_sharing_sdk.pb.h" -#include "third_party/abseil-cpp/absl/status/status.h" - -namespace data_sharing { - -PartialFailureSDKDelegateWrapper::PartialFailureSDKDelegateWrapper( - DataSharingSDKDelegate* sdk_delegate) - : sdk_delegate_(sdk_delegate) { - CHECK(sdk_delegate_); -} - -PartialFailureSDKDelegateWrapper::~PartialFailureSDKDelegateWrapper() = default; - -void PartialFailureSDKDelegateWrapper::Initialize( - DataSharingNetworkLoader* data_sharing_network_loader) { - sdk_delegate_->Initialize(data_sharing_network_loader); -} - -void PartialFailureSDKDelegateWrapper::CreateGroup( - const data_sharing_pb::CreateGroupParams& params, - base::OnceCallback< - void(const base::expected<data_sharing_pb::CreateGroupResult, - absl::Status>&)> callback) { - sdk_delegate_->CreateGroup(params, std::move(callback)); -} - -void PartialFailureSDKDelegateWrapper::ReadGroups( - const data_sharing_pb::ReadGroupsParams& params, - base::OnceCallback<void( - const base::expected<data_sharing_pb::ReadGroupsResult, absl::Status>&)> - callback) { - // Request should contain at least one group. - CHECK_GT(params.group_ids_size(), 0); - // Only one ongoing ReadGroups() call is supported. - CHECK(ongoing_read_groups_callback_.is_null()); - ongoing_read_groups_callback_ = std::move(callback); - - ongoing_read_groups_groups_count_ = params.group_ids_size(); - CHECK_EQ(params.group_ids_size(), params.group_params_size()); - for (int i = 0; i < params.group_ids_size(); ++i) { - const std::string& group_id = params.group_ids(i); - data_sharing_pb::ReadGroupsParams single_read_group_params; - single_read_group_params.add_group_ids(group_id); - *single_read_group_params.add_group_params() = - params.group_params(i); - sdk_delegate_->ReadGroups( - single_read_group_params, - base::BindOnce( - &PartialFailureSDKDelegateWrapper::OnSingleReadGroupCompleted, - weak_ptr_factory_.GetWeakPtr(), GroupId(group_id))); - } -} - -void PartialFailureSDKDelegateWrapper::OnSingleReadGroupCompleted( - const GroupId& group_id, - const base::expected<data_sharing_pb::ReadGroupsResult, absl::Status>& - result) { - finished_read_group_results_[group_id] = result; - ongoing_read_groups_groups_count_--; - if (ongoing_read_groups_groups_count_ == 0) { - OnAllOngoingReadGroupsCompleted(); - } -} - -void PartialFailureSDKDelegateWrapper::OnAllOngoingReadGroupsCompleted() { - CHECK(ongoing_read_groups_callback_); - // Determine if the whole ReadGroups() call should be reported as success or - // failure. It makes sense to propagate individual group successful reads or - // known permanent failures, but if everything failed with a transient error, - // then the whole ReadGroups() call should fail with a transient error. - bool has_successful_read_group_result = false; - bool has_permanent_failure = false; - for (const auto& [_, result] : finished_read_group_results_) { - if (result.has_value()) { - has_successful_read_group_result = true; - } - if (!result.has_value() && - (result.error().code() == absl::StatusCode::kNotFound || - result.error().code() == absl::StatusCode::kPermissionDenied)) { - has_permanent_failure = true; - } - } - - if (!has_successful_read_group_result && !has_permanent_failure) { - // Pick and report first error. - // At least one group was requested (see CHECK() in ReadGroups()), so there - // should be at least one result. - CHECK_GT(finished_read_group_results_.size(), 0u); - CHECK(!finished_read_group_results_.begin()->second.has_value()); - std::move(ongoing_read_groups_callback_) - .Run(base::unexpected( - finished_read_group_results_.begin()->second.error())); - finished_read_group_results_.clear(); - return; - } - - data_sharing_pb::ReadGroupsResult read_groups_result; - for (const auto& [group_id, result] : finished_read_group_results_) { - if (result.has_value() && result.value().group_data_size() == 1) { - // Need to check that group_data_size() == 1 to guard against protocol - // violations. - *read_groups_result.add_group_data() = result.value().group_data(0); - } else { - auto* failed_read_group_result = - read_groups_result.add_failed_read_group_results(); - failed_read_group_result->set_group_id(group_id.value()); - if (result.has_value()) { - // Protocol violation: see if block above. Report as transient error. - failed_read_group_result->set_failure_reason( - data_sharing_pb::FailedReadGroupResult::TRANSIENT_ERROR); - } else if (result.error().code() == absl::StatusCode::kNotFound) { - failed_read_group_result->set_failure_reason( - data_sharing_pb::FailedReadGroupResult::GROUP_NOT_FOUND); - } else if (result.error().code() == absl::StatusCode::kPermissionDenied) { - failed_read_group_result->set_failure_reason( - data_sharing_pb::FailedReadGroupResult::USER_NOT_MEMBER); - } else { - // The rest is not distinguished and reported as a transient error. - failed_read_group_result->set_failure_reason( - data_sharing_pb::FailedReadGroupResult::TRANSIENT_ERROR); - } - } - } - std::move(ongoing_read_groups_callback_).Run(read_groups_result); - finished_read_group_results_.clear(); -} - -void PartialFailureSDKDelegateWrapper::AddMember( - const data_sharing_pb::AddMemberParams& params, - base::OnceCallback<void(const absl::Status&)> callback) { - sdk_delegate_->AddMember(params, std::move(callback)); -} - -void PartialFailureSDKDelegateWrapper::RemoveMember( - const data_sharing_pb::RemoveMemberParams& params, - base::OnceCallback<void(const absl::Status&)> callback) { - sdk_delegate_->RemoveMember(params, std::move(callback)); -} - -void PartialFailureSDKDelegateWrapper::LeaveGroup( - const data_sharing_pb::LeaveGroupParams& params, - base::OnceCallback<void(const absl::Status&)> callback) { - sdk_delegate_->LeaveGroup(params, std::move(callback)); -} - -void PartialFailureSDKDelegateWrapper::DeleteGroup( - const data_sharing_pb::DeleteGroupParams& params, - base::OnceCallback<void(const absl::Status&)> callback) { - sdk_delegate_->DeleteGroup(params, std::move(callback)); -} - -void PartialFailureSDKDelegateWrapper::LookupGaiaIdByEmail( - const data_sharing_pb::LookupGaiaIdByEmailParams& params, - base::OnceCallback< - void(const base::expected<data_sharing_pb::LookupGaiaIdByEmailResult, - absl::Status>&)> callback) { - sdk_delegate_->LookupGaiaIdByEmail(params, std::move(callback)); -} - -void PartialFailureSDKDelegateWrapper::Shutdown() { - sdk_delegate_->Shutdown(); -} - -void PartialFailureSDKDelegateWrapper::AddAccessToken( - const data_sharing_pb::AddAccessTokenParams& params, - base::OnceCallback< - void(const base::expected<data_sharing_pb::AddAccessTokenResult, - absl::Status>&)> callback) { - sdk_delegate_->AddAccessToken(params, std::move(callback)); -} - -} // namespace data_sharing
diff --git a/components/data_sharing/internal/partial_failure_sdk_delegate_wrapper.h b/components/data_sharing/internal/partial_failure_sdk_delegate_wrapper.h deleted file mode 100644 index 8ec4b90..0000000 --- a/components/data_sharing/internal/partial_failure_sdk_delegate_wrapper.h +++ /dev/null
@@ -1,107 +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 COMPONENTS_DATA_SHARING_INTERNAL_PARTIAL_FAILURE_SDK_DELEGATE_WRAPPER_H_ -#define COMPONENTS_DATA_SHARING_INTERNAL_PARTIAL_FAILURE_SDK_DELEGATE_WRAPPER_H_ - -#include <map> - -#include "base/functional/callback.h" -#include "base/memory/raw_ptr.h" -#include "base/memory/weak_ptr.h" -#include "base/types/expected.h" -#include "components/data_sharing/public/data_sharing_sdk_delegate.h" -#include "components/data_sharing/public/group_data.h" - -namespace data_sharing { - -// Wraps another SDK delegate and adds support for ReadGroups() partial -// failures: instead of issuing a single SDK::ReadGroups() call with multiple -// group_ids, it issues multiple SDK::ReadGroups() calls, each one requesting a -// single group_id. The rest of the methods are simply forwarded to the wrapped -// SDK delegate. -// WARNING: this class only supports single ongoing ReadGroups() call at a time. -// TODO(crbug.com/377914193): Remove this class once SDK supports partial -// failures natively. -class PartialFailureSDKDelegateWrapper : public DataSharingSDKDelegate { - public: - explicit PartialFailureSDKDelegateWrapper( - DataSharingSDKDelegate* sdk_delegate); - - PartialFailureSDKDelegateWrapper(const PartialFailureSDKDelegateWrapper&) = - delete; - PartialFailureSDKDelegateWrapper& operator=( - const PartialFailureSDKDelegateWrapper&) = delete; - PartialFailureSDKDelegateWrapper(PartialFailureSDKDelegateWrapper&&) = delete; - PartialFailureSDKDelegateWrapper& operator=( - PartialFailureSDKDelegateWrapper&&) = delete; - - ~PartialFailureSDKDelegateWrapper() override; - - void Initialize( - DataSharingNetworkLoader* data_sharing_network_loader) override; - - void CreateGroup(const data_sharing_pb::CreateGroupParams& params, - base::OnceCallback<void( - const base::expected<data_sharing_pb::CreateGroupResult, - absl::Status>&)> callback) override; - - void ReadGroups(const data_sharing_pb::ReadGroupsParams& params, - base::OnceCallback<void( - const base::expected<data_sharing_pb::ReadGroupsResult, - absl::Status>&)> callback) override; - - void AddMember( - const data_sharing_pb::AddMemberParams& params, - base::OnceCallback<void(const absl::Status&)> callback) override; - - void RemoveMember( - const data_sharing_pb::RemoveMemberParams& params, - base::OnceCallback<void(const absl::Status&)> callback) override; - - void LeaveGroup( - const data_sharing_pb::LeaveGroupParams& params, - base::OnceCallback<void(const absl::Status&)> callback) override; - - void DeleteGroup( - const data_sharing_pb::DeleteGroupParams& params, - base::OnceCallback<void(const absl::Status&)> callback) override; - - void LookupGaiaIdByEmail( - const data_sharing_pb::LookupGaiaIdByEmailParams& params, - base::OnceCallback< - void(const base::expected<data_sharing_pb::LookupGaiaIdByEmailResult, - absl::Status>&)> callback) override; - - void Shutdown() override; - void AddAccessToken( - const data_sharing_pb::AddAccessTokenParams& params, - base::OnceCallback< - void(const base::expected<data_sharing_pb::AddAccessTokenResult, - absl::Status>&)> callback) override; - - private: - void OnSingleReadGroupCompleted( - const GroupId& group_id, - const base::expected<data_sharing_pb::ReadGroupsResult, absl::Status>& - result); - void OnAllOngoingReadGroupsCompleted(); - - raw_ptr<DataSharingSDKDelegate> sdk_delegate_; - - size_t ongoing_read_groups_groups_count_ = 0; - base::OnceCallback<void( - const base::expected<data_sharing_pb::ReadGroupsResult, absl::Status>&)> - ongoing_read_groups_callback_; - std::map<GroupId, - base::expected<data_sharing_pb::ReadGroupsResult, absl::Status>> - finished_read_group_results_; - - base::WeakPtrFactory<PartialFailureSDKDelegateWrapper> weak_ptr_factory_{ - this}; -}; - -} // namespace data_sharing - -#endif // COMPONENTS_DATA_SHARING_INTERNAL_PARTIAL_FAILURE_SDK_DELEGATE_WRAPPER_H_
diff --git a/components/data_sharing/internal/partial_failure_sdk_delegate_wrapper_unittest.cc b/components/data_sharing/internal/partial_failure_sdk_delegate_wrapper_unittest.cc deleted file mode 100644 index 6ee05b9..0000000 --- a/components/data_sharing/internal/partial_failure_sdk_delegate_wrapper_unittest.cc +++ /dev/null
@@ -1,151 +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 "components/data_sharing/internal/partial_failure_sdk_delegate_wrapper.h" - -#include "base/test/bind.h" -#include "base/test/task_environment.h" -#include "base/types/expected.h" -#include "components/data_sharing/test_support/fake_data_sharing_sdk_delegate.h" -#include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace data_sharing { -namespace { - -data_sharing_pb::ReadGroupsParams CreateReadGroupsParams( - const std::vector<GroupId>& group_ids) { - data_sharing_pb::ReadGroupsParams read_groups_params; - for (const GroupId& group_id : group_ids) { - read_groups_params.add_group_ids(group_id.value()); - data_sharing_pb::ReadGroupsParams::GroupParams* group_params = - read_groups_params.add_group_params(); - group_params->set_group_id(group_id.value()); - } - return read_groups_params; -} - -class PartialFailureSDKDelegateWrapperTest : public testing::Test { - public: - PartialFailureSDKDelegateWrapperTest() - : sdk_delegate_wrapper_(&actual_sdk_delegate_) {} - ~PartialFailureSDKDelegateWrapperTest() override = default; - - FakeDataSharingSDKDelegate& actual_sdk_delegate() { - return actual_sdk_delegate_; - } - - PartialFailureSDKDelegateWrapper& sdk_delegate_wrapper() { - return sdk_delegate_wrapper_; - } - - base::expected<data_sharing_pb::ReadGroupsResult, absl::Status> - ReadGroupsViaWrapper(const data_sharing_pb::ReadGroupsParams& params) { - base::expected<data_sharing_pb::ReadGroupsResult, absl::Status> - read_groups_result; - base::RunLoop run_loop; - sdk_delegate_wrapper().ReadGroups( - params, - base::BindLambdaForTesting( - [&](const base::expected<data_sharing_pb::ReadGroupsResult, - absl::Status>& read_groups_result_arg) { - read_groups_result = std::move(read_groups_result_arg); - run_loop.Quit(); - })); - run_loop.Run(); - return read_groups_result; - } - - private: - base::test::TaskEnvironment task_environment_; - - FakeDataSharingSDKDelegate actual_sdk_delegate_; - PartialFailureSDKDelegateWrapper sdk_delegate_wrapper_; -}; - -TEST_F(PartialFailureSDKDelegateWrapperTest, ShouldReadSingleGroup) { - const std::string display_name = "group_display_name"; - const GroupId group_id = - actual_sdk_delegate().AddGroupAndReturnId(display_name); - - base::expected<data_sharing_pb::ReadGroupsResult, absl::Status> - read_groups_result = - ReadGroupsViaWrapper(CreateReadGroupsParams({group_id})); - - ASSERT_TRUE(read_groups_result.has_value()); - ASSERT_EQ(read_groups_result->group_data_size(), 1); - EXPECT_EQ(read_groups_result->group_data(0).display_name(), display_name); -} - -TEST_F(PartialFailureSDKDelegateWrapperTest, ShouldReadMultipleGroups) { - const std::string display_name1 = "group_display_name_1"; - const GroupId group_id1 = - actual_sdk_delegate().AddGroupAndReturnId(display_name1); - const std::string display_name2 = "group_display_name_2"; - const GroupId group_id2 = - actual_sdk_delegate().AddGroupAndReturnId(display_name2); - - base::expected<data_sharing_pb::ReadGroupsResult, absl::Status> - read_groups_result = - ReadGroupsViaWrapper(CreateReadGroupsParams({group_id1, group_id2})); - - ASSERT_TRUE(read_groups_result.has_value()); - ASSERT_EQ(read_groups_result->group_data_size(), 2); - EXPECT_EQ(read_groups_result->group_data(0).display_name(), display_name1); - EXPECT_EQ(read_groups_result->group_data(1).display_name(), display_name2); -} - -TEST_F(PartialFailureSDKDelegateWrapperTest, ShouldHandlePartialFailure) { - const std::string display_name1 = "group_display_name_1"; - const GroupId group_id1 = - actual_sdk_delegate().AddGroupAndReturnId(display_name1); - const GroupId group_id2 = GroupId("non_existent_group_id"); - - base::expected<data_sharing_pb::ReadGroupsResult, absl::Status> - read_groups_result = - ReadGroupsViaWrapper(CreateReadGroupsParams({group_id1, group_id2})); - - ASSERT_TRUE(read_groups_result.has_value()); - ASSERT_EQ(read_groups_result->group_data_size(), 1); - EXPECT_EQ(read_groups_result->group_data(0).display_name(), display_name1); - ASSERT_EQ(read_groups_result->failed_read_group_results_size(), 1); - EXPECT_EQ(read_groups_result->failed_read_group_results(0).group_id(), - group_id2.value()); - EXPECT_EQ(read_groups_result->failed_read_group_results(0).failure_reason(), - data_sharing_pb::FailedReadGroupResult::GROUP_NOT_FOUND); -} - -// Regression test for crbug.com/391629890: the wrapper didn't cleanup results -// from previous calls to ReadGroups(), leading to incorrect results for -// subsequent calls (such as returning groups that were not requested). -TEST_F(PartialFailureSDKDelegateWrapperTest, ShouldHandleSubsequentReadGroups) { - const std::string display_name1 = "group_display_name_1"; - const GroupId group_id1 = - actual_sdk_delegate().AddGroupAndReturnId(display_name1); - - base::expected<data_sharing_pb::ReadGroupsResult, absl::Status> - read_groups_result1 = - ReadGroupsViaWrapper(CreateReadGroupsParams({group_id1})); - ASSERT_TRUE(read_groups_result1.has_value()); - ASSERT_EQ(read_groups_result1->group_data_size(), 1); - ASSERT_EQ(read_groups_result1->group_data(0).display_name(), display_name1); - - const std::string display_name2 = "group_display_name_2"; - const GroupId group_id2 = - actual_sdk_delegate().AddGroupAndReturnId(display_name2); - - base::expected<data_sharing_pb::ReadGroupsResult, absl::Status> - read_groups_result2 = - ReadGroupsViaWrapper(CreateReadGroupsParams({group_id2})); - ASSERT_TRUE(read_groups_result2.has_value()); - // Actual expectation: first group is not returned. - ASSERT_EQ(read_groups_result2->group_data_size(), 1); - EXPECT_EQ(read_groups_result2->group_data(0).display_name(), display_name2); -} - -// TODO(crbug.com/377914193): add tests for full and partial transient failures -// once FakeDataSharingSDKDelegate supports faking them. - -} // namespace -} // namespace data_sharing
diff --git a/components/data_sharing/test_support/fake_data_sharing_sdk_delegate.cc b/components/data_sharing/test_support/fake_data_sharing_sdk_delegate.cc index 3c89a97..0252819 100644 --- a/components/data_sharing/test_support/fake_data_sharing_sdk_delegate.cc +++ b/components/data_sharing/test_support/fake_data_sharing_sdk_delegate.cc
@@ -6,6 +6,7 @@ #include "base/strings/string_number_conversions.h" #include "base/task/single_thread_task_runner.h" +#include "components/data_sharing/public/protocol/data_sharing_sdk.pb.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/status/status.h" @@ -107,13 +108,10 @@ if (groups_.find(group_id) != groups_.end()) { *result.add_group_data() = groups_[group_id]; } else { - // Partial failure is not supported in this fake to simplify testing. - base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask( - FROM_HERE, - base::BindOnce(std::move(callback), base::unexpected(absl::Status( - absl::StatusCode::kNotFound, - "Groups not found")))); - return; + auto* failed_group = result.add_failed_read_group_results(); + failed_group->set_group_id(group_params.group_id()); + failed_group->set_failure_reason( + data_sharing_pb::FailedReadGroupResult::GROUP_NOT_FOUND); } }
diff --git a/components/device_signals/core/common/signals_constants.cc b/components/device_signals/core/common/signals_constants.cc index 5481168..992eee7e 100644 --- a/components/device_signals/core/common/signals_constants.cc +++ b/components/device_signals/core/common/signals_constants.cc
@@ -128,10 +128,6 @@ // the device. const char kSystemDnsServers[] = "systemDnsServers"; -// Name of the signal for getting information about whether third party -// blocking is enabled on the device. -const char kThirdPartyBlockingEnabled[] = "thirdPartyBlockingEnabled"; - // Name of the signal for the trigger which generated the device signals. const char kTrigger[] = "trigger";
diff --git a/components/device_signals/core/common/signals_constants.h b/components/device_signals/core/common/signals_constants.h index 36b5f2e..8181834 100644 --- a/components/device_signals/core/common/signals_constants.h +++ b/components/device_signals/core/common/signals_constants.h
@@ -44,7 +44,6 @@ extern const char kSerialNumber[]; extern const char kSiteIsolationEnabled[]; extern const char kSystemDnsServers[]; -extern const char kThirdPartyBlockingEnabled[]; extern const char kTrigger[]; extern const char kUserEnrollmentDomain[]; extern const char kWindowsMachineDomain[];
diff --git a/components/enterprise/browser/reporting/chrome_profile_request_generator.cc b/components/enterprise/browser/reporting/chrome_profile_request_generator.cc index 6fca6bb..b920d85 100644 --- a/components/enterprise/browser/reporting/chrome_profile_request_generator.cc +++ b/components/enterprise/browser/reporting/chrome_profile_request_generator.cc
@@ -5,7 +5,10 @@ #include "components/enterprise/browser/reporting/chrome_profile_request_generator.h" #include <utility> +#include <variant> +#include "base/barrier_callback.h" +#include "base/check.h" #include "base/functional/callback.h" #include "components/enterprise/browser/reporting/os_report_generator.h" #include "components/enterprise/browser/reporting/report_type.h" @@ -15,6 +18,32 @@ namespace em = enterprise_management; +namespace { + +void ParseReports( + base::OnceCallback<void(std::unique_ptr<em::BrowserReport>, + std::unique_ptr<em::ChromeUserProfileInfo>)> + callback, + std::vector<std::variant<std::unique_ptr<em::BrowserReport>, + std::unique_ptr<em::ChromeUserProfileInfo>>> + reports) { + std::unique_ptr<em::BrowserReport> browser_report; + std::unique_ptr<enterprise_management::ChromeUserProfileInfo> profile_report; + for (auto& variant : reports) { + if (std::holds_alternative<std::unique_ptr<em::BrowserReport>>(variant)) { + browser_report = + std::move(std::get<std::unique_ptr<em::BrowserReport>>(variant)); + } else { + profile_report = std::move( + std::get<std::unique_ptr<em::ChromeUserProfileInfo>>(variant)); + } + } + + std::move(callback).Run(std::move(browser_report), std::move(profile_report)); +} + +} // namespace + ChromeProfileRequestGenerator::ChromeProfileRequestGenerator( const base::FilePath& profile_path, ReportingDelegateFactory* delegate_factory) @@ -30,11 +59,35 @@ auto request = std::make_unique<ReportRequest>(ReportType::kProfileReport); request->GetChromeProfileReportRequest().set_allocated_os_report( GetOSReport().release()); + + auto barrier_callback = base::BarrierCallback< + std::variant<std::unique_ptr<em::BrowserReport>, + std::unique_ptr<em::ChromeUserProfileInfo>>>( + 2, base::BindOnce( + ParseReports, + base::BindOnce(&ChromeProfileRequestGenerator::OnReportsReady, + weak_ptr_factory_.GetWeakPtr(), std::move(request), + std::move(callback)))); + browser_report_generator_.Generate( ReportType::kProfileReport, - base::BindOnce(&ChromeProfileRequestGenerator::OnBrowserReportReady, - weak_ptr_factory_.GetWeakPtr(), std::move(request), - std::move(callback))); + base::BindOnce( + [](std::unique_ptr<em::BrowserReport> browser_report) + -> std::variant<std::unique_ptr<em::BrowserReport>, + std::unique_ptr<em::ChromeUserProfileInfo>> { + return std::move(browser_report); + }) + .Then(barrier_callback)); + + profile_report_generator_.MaybeGenerate( + profile_path_, ReportType::kProfileReport, + base::BindOnce( + [](std::unique_ptr<em::ChromeUserProfileInfo> profile_report) + -> std::variant<std::unique_ptr<em::BrowserReport>, + std::unique_ptr<em::ChromeUserProfileInfo>> { + return std::move(profile_report); + }) + .Then(barrier_callback)); } void ChromeProfileRequestGenerator::ToggleExtensionReport( @@ -42,13 +95,11 @@ profile_report_generator_.SetExtensionsEnabledCallback(std::move(callback)); } -void ChromeProfileRequestGenerator::OnBrowserReportReady( +void ChromeProfileRequestGenerator::OnReportsReady( std::unique_ptr<ReportRequest> request, ReportCallback callback, - std::unique_ptr<em::BrowserReport> browser_report) { - auto profile_report = profile_report_generator_.MaybeGenerate( - profile_path_, ReportType::kProfileReport); - + std::unique_ptr<em::BrowserReport> browser_report, + std::unique_ptr<em::ChromeUserProfileInfo> profile_report) { browser_report->add_chrome_user_profile_infos()->Swap(profile_report.get()); request->GetChromeProfileReportRequest().set_allocated_browser_report(
diff --git a/components/enterprise/browser/reporting/chrome_profile_request_generator.h b/components/enterprise/browser/reporting/chrome_profile_request_generator.h index f9579e3c..45387325 100644 --- a/components/enterprise/browser/reporting/chrome_profile_request_generator.h +++ b/components/enterprise/browser/reporting/chrome_profile_request_generator.h
@@ -38,10 +38,12 @@ ProfileReportGenerator::ExtensionsEnabledCallback callback); private: - void OnBrowserReportReady( + void OnReportsReady( std::unique_ptr<ReportRequest> request, ReportCallback callback, - std::unique_ptr<enterprise_management::BrowserReport> browser_report); + std::unique_ptr<enterprise_management::BrowserReport> browser_report, + std::unique_ptr<enterprise_management::ChromeUserProfileInfo> + profile_report); const base::FilePath profile_path_;
diff --git a/components/enterprise/browser/reporting/profile_report_generator.cc b/components/enterprise/browser/reporting/profile_report_generator.cc index 9d4ae93..d3593ba 100644 --- a/components/enterprise/browser/reporting/profile_report_generator.cc +++ b/components/enterprise/browser/reporting/profile_report_generator.cc
@@ -43,11 +43,14 @@ extensions_enabled_callback_ = std::move(callback); } -std::unique_ptr<em::ChromeUserProfileInfo> -ProfileReportGenerator::MaybeGenerate(const base::FilePath& path, - ReportType report_type) { +void ProfileReportGenerator::MaybeGenerate( + const base::FilePath& path, + ReportType report_type, + base::OnceCallback<void(std::unique_ptr<em::ChromeUserProfileInfo>)> + callback) { if (!delegate_->Init(path)) { - return nullptr; + std::move(callback).Run(nullptr); + return; } report_ = std::make_unique<em::ChromeUserProfileInfo>(); @@ -99,7 +102,7 @@ } } - return std::move(report_); + std::move(callback).Run(std::move(report_)); } void ProfileReportGenerator::GetChromePolicyInfo() {
diff --git a/components/enterprise/browser/reporting/profile_report_generator.h b/components/enterprise/browser/reporting/profile_report_generator.h index 3e8c716d..a7523a7c 100644 --- a/components/enterprise/browser/reporting/profile_report_generator.h +++ b/components/enterprise/browser/reporting/profile_report_generator.h
@@ -83,12 +83,15 @@ // Pass a callback to enable/disable extension report with dynamic condition. void SetExtensionsEnabledCallback(ExtensionsEnabledCallback callback); - // Generates a report for the profile associated with |path| and |name| if - // it's activated, and returns the report. The report is null if it can't be - // generated. - std::unique_ptr<enterprise_management::ChromeUserProfileInfo> MaybeGenerate( + // Generates a report for the profile associated with `path` if + // it's activated, and returns the report by invoking `callback` with its + // value. The report is null if it can't be generated. + void MaybeGenerate( const base::FilePath& path, - ReportType report_type); + ReportType report_type, + base::OnceCallback< + void(std::unique_ptr<enterprise_management::ChromeUserProfileInfo>)> + callback); protected: void GetChromePolicyInfo();
diff --git a/components/enterprise/browser/reporting/report_generator.cc b/components/enterprise/browser/reporting/report_generator.cc index a54d7478..98cf737 100644 --- a/components/enterprise/browser/reporting/report_generator.cc +++ b/components/enterprise/browser/reporting/report_generator.cc
@@ -108,8 +108,8 @@ if (report_type != ReportType::kBrowserVersion) { // Generate a queue of requests containing detailed profile information. - std::move(callback).Run( - report_request_queue_generator_.Generate(*basic_request)); + report_request_queue_generator_.Generate(std::move(basic_request), + std::move(callback)); return; }
diff --git a/components/enterprise/browser/reporting/report_request_queue_generator.cc b/components/enterprise/browser/reporting/report_request_queue_generator.cc index 3680a8d..d3cbf65d 100644 --- a/components/enterprise/browser/reporting/report_request_queue_generator.cc +++ b/components/enterprise/browser/reporting/report_request_queue_generator.cc
@@ -4,6 +4,10 @@ #include "components/enterprise/browser/reporting/report_request_queue_generator.h" +#include <utility> +#include <vector> + +#include "base/barrier_callback.h" #include "base/files/file_path.h" #include "base/functional/bind.h" #include "base/functional/callback.h" @@ -12,6 +16,10 @@ namespace enterprise_reporting { +using IndexedProfileReport = + std::pair<int, + std::unique_ptr<enterprise_management::ChromeUserProfileInfo>>; + namespace { const size_t kMaximumReportSize = @@ -30,6 +38,13 @@ // are needed if there are many reports exceed this limitation. const int kRequestCountMetricMaxValue = 21; +IndexedProfileReport ToIndexedReportPair( + int index, + std::unique_ptr<enterprise_management::ChromeUserProfileInfo> + profile_report) { + return std::pair(index, std::move(profile_report)); +} + } // namespace ReportRequestQueueGenerator::ReportRequestQueueGenerator( @@ -53,90 +68,133 @@ maximum_report_size_ = maximum_report_size; } -ReportRequestQueue ReportRequestQueueGenerator::Generate( - const ReportRequest& basic_request) { - ReportRequestQueue requests; +void ReportRequestQueueGenerator::Generate( + std::unique_ptr<ReportRequest> basic_request, + base::OnceCallback<void(ReportRequestQueue)> callback) { + if (!basic_request) { + OnAllProfileReportsGenerated(std::move(basic_request), std::move(callback), + std::vector<IndexedProfileReport>()); + return; + } + size_t basic_request_size = - basic_request.GetDeviceReportRequest().ByteSizeLong(); + basic_request->GetDeviceReportRequest().ByteSizeLong(); base::UmaHistogramMemoryKB(kBasicRequestSizeMetricsName, basic_request_size / 1024); + if (basic_request_size > maximum_report_size_) { + OnAllProfileReportsGenerated(std::move(basic_request), std::move(callback), + std::vector<IndexedProfileReport>()); + return; + } + + int profile_infos_size = basic_request->GetDeviceReportRequest() + .browser_report() + .chrome_user_profile_infos_size(); + const auto* basic_request_ptr = basic_request.get(); + auto barrier_callback = base::BarrierCallback<IndexedProfileReport>( + profile_infos_size, + base::BindOnce(&ReportRequestQueueGenerator::OnAllProfileReportsGenerated, + weak_factory_.GetWeakPtr(), std::move(basic_request), + std::move(callback))); + + for (int index = 0; index < profile_infos_size; index++) { + GenerateProfileReportWithIndex(index, basic_request_ptr, barrier_callback); + } +} + +void ReportRequestQueueGenerator::GenerateProfileReportWithIndex( + int profile_index, + const ReportRequest* basic_request, + base::OnceCallback<void(IndexedProfileReport)> callback) { + DCHECK_LT(profile_index, basic_request->GetDeviceReportRequest() + .browser_report() + .chrome_user_profile_infos_size()); + + auto basic_profile = basic_request->GetDeviceReportRequest() + .browser_report() + .chrome_user_profile_infos(profile_index); + profile_report_generator_.MaybeGenerate( + base::FilePath::FromUTF8Unsafe(basic_profile.id()), ReportType::kFull, + base::BindOnce(ToIndexedReportPair, profile_index) + .Then(std::move(callback))); +} + +void ReportRequestQueueGenerator::OnAllProfileReportsGenerated( + std::unique_ptr<ReportRequest> basic_request, + base::OnceCallback<void(ReportRequestQueue)> callback, + std::vector<IndexedProfileReport> indexed_reports) { + ReportRequestQueue requests; + + size_t basic_request_size = + basic_request->GetDeviceReportRequest().ByteSizeLong(); if (basic_request_size <= maximum_report_size_) { - requests.push(basic_request.Clone()); - int profile_infos_size = basic_request.GetDeviceReportRequest() - .browser_report() - .chrome_user_profile_infos_size(); - for (int index = 0; index < profile_infos_size; index++) { - GenerateProfileReportWithIndex(index, basic_request, &requests); + requests.push(basic_request->Clone()); + } + + for (auto& indexed_report : indexed_reports) { + auto profile_index = std::get<int>(indexed_report); + auto profile_report = std::move( + std::get<std::unique_ptr<enterprise_management::ChromeUserProfileInfo>>( + indexed_report)); + + // Skip if Profile is not loaded and there is no full report. + if (!profile_report) { + continue; } + auto basic_profile = basic_request->GetDeviceReportRequest() + .browser_report() + .chrome_user_profile_infos(profile_index); + // Use size diff to calculate estimated request size after full profile + // report is added. There are still few bytes difference but close enough. + size_t profile_report_incremental_size = + profile_report->ByteSizeLong() - basic_profile.ByteSizeLong(); + size_t current_request_size = + requests.back()->GetDeviceReportRequest().ByteSizeLong(); + + if (current_request_size + profile_report_incremental_size <= + maximum_report_size_) { + // The new full Profile report can be appended into the current request. + requests.back() + ->GetDeviceReportRequest() + .mutable_browser_report() + ->mutable_chrome_user_profile_infos(profile_index) + ->Swap(profile_report.get()); + } else if (basic_request_size + profile_report_incremental_size <= + maximum_report_size_) { + // The new full Profile report is too big to be appended into the current + // request, move it to the next request if possible. Record metrics for + // the current request's size. + base::UmaHistogramMemoryKB( + kRequestSizeMetricsName, + requests.back()->GetDeviceReportRequest().ByteSizeLong() / 1024); + requests.push(basic_request->Clone()); + requests.back() + ->GetDeviceReportRequest() + .mutable_browser_report() + ->mutable_chrome_user_profile_infos(profile_index) + ->Swap(profile_report.get()); + } else { + // The new full Profile report is too big to be uploaded, skip this + // Profile report. But we still add the report size into metrics so + // that we could understand the situation better. + base::UmaHistogramMemoryKB( + kRequestSizeMetricsName, + (basic_request_size + profile_report_incremental_size) / 1024); + } + } + + base::UmaHistogramExactLinear(kRequestCountMetricsName, requests.size(), + kRequestCountMetricMaxValue); + + if (!requests.empty()) { base::UmaHistogramMemoryKB( kRequestSizeMetricsName, requests.back()->GetDeviceReportRequest().ByteSizeLong() / 1024); } - base::UmaHistogramExactLinear(kRequestCountMetricsName, requests.size(), - kRequestCountMetricMaxValue); - return requests; -} - -void ReportRequestQueueGenerator::GenerateProfileReportWithIndex( - int profile_index, - const ReportRequest& basic_request, - ReportRequestQueue* requests) { - DCHECK_LT(profile_index, basic_request.GetDeviceReportRequest() - .browser_report() - .chrome_user_profile_infos_size()); - - size_t basic_request_size = - basic_request.GetDeviceReportRequest().ByteSizeLong(); - auto basic_profile = basic_request.GetDeviceReportRequest() - .browser_report() - .chrome_user_profile_infos(profile_index); - auto profile_report = profile_report_generator_.MaybeGenerate( - base::FilePath::FromUTF8Unsafe(basic_profile.id()), ReportType::kFull); - - // Return if Profile is not loaded and there is no full report. - if (!profile_report) - return; - - // Use size diff to calculate estimated request size after full profile report - // is added. There are still few bytes difference but close enough. - size_t profile_report_incremental_size = - profile_report->ByteSizeLong() - basic_profile.ByteSizeLong(); - size_t current_request_size = - requests->back()->GetDeviceReportRequest().ByteSizeLong(); - - if (current_request_size + profile_report_incremental_size <= - maximum_report_size_) { - // The new full Profile report can be appended into the current request. - requests->back() - ->GetDeviceReportRequest() - .mutable_browser_report() - ->mutable_chrome_user_profile_infos(profile_index) - ->Swap(profile_report.get()); - } else if (basic_request_size + profile_report_incremental_size <= - maximum_report_size_) { - // The new full Profile report is too big to be appended into the current - // request, move it to the next request if possible. Record metrics for the - // current request's size. - base::UmaHistogramMemoryKB( - kRequestSizeMetricsName, - requests->back()->GetDeviceReportRequest().ByteSizeLong() / 1024); - requests->push(basic_request.Clone()); - requests->back() - ->GetDeviceReportRequest() - .mutable_browser_report() - ->mutable_chrome_user_profile_infos(profile_index) - ->Swap(profile_report.get()); - } else { - // The new full Profile report is too big to be uploaded, skip this - // Profile report. But we still add the report size into metrics so - // that we could understand the situation better. - base::UmaHistogramMemoryKB( - kRequestSizeMetricsName, - (basic_request_size + profile_report_incremental_size) / 1024); - } + std::move(callback).Run(std::move(requests)); } } // namespace enterprise_reporting
diff --git a/components/enterprise/browser/reporting/report_request_queue_generator.h b/components/enterprise/browser/reporting/report_request_queue_generator.h index 2b76506..abdaf32 100644 --- a/components/enterprise/browser/reporting/report_request_queue_generator.h +++ b/components/enterprise/browser/reporting/report_request_queue_generator.h
@@ -5,6 +5,10 @@ #ifndef COMPONENTS_ENTERPRISE_BROWSER_REPORTING_REPORT_REQUEST_QUEUE_GENERATOR_H_ #define COMPONENTS_ENTERPRISE_BROWSER_REPORTING_REPORT_REQUEST_QUEUE_GENERATOR_H_ +#include <memory> + +#include "base/functional/callback.h" +#include "base/memory/weak_ptr.h" #include "build/build_config.h" #include "components/enterprise/browser/reporting/profile_report_generator.h" #include "components/enterprise/browser/reporting/report_request.h" @@ -35,19 +39,35 @@ void SetMaximumReportSizeForTesting(size_t maximum_report_size); // Generate a queue of requests including full profile info based on given - // basic request. - ReportRequestQueue Generate(const ReportRequest& basic_request); + // basic request. Will invoke `callback` with the queue when done. + void Generate(std::unique_ptr<ReportRequest> basic_request, + base::OnceCallback<void(ReportRequestQueue)> callback); private: - // Generate request with full profile info at |profile_index| according to - // |basic_request|, then store it into |requests|. - void GenerateProfileReportWithIndex(int profile_index, - const ReportRequest& basic_request, - ReportRequestQueue* requests); + using IndexedProfileReport = + std::pair<int, + std::unique_ptr<enterprise_management::ChromeUserProfileInfo>>; + + // Generate request with full profile info at `profile_index` according to + // `basic_request`. Will invoke `callback` when done. + void GenerateProfileReportWithIndex( + int profile_index, + const ReportRequest* basic_request, + base::OnceCallback<void(IndexedProfileReport)> callback); + + // Called when all Profile reports were generated. `basic_request` is carried + // over to ensure it remains alive while individual reports are being + // generated. + void OnAllProfileReportsGenerated( + std::unique_ptr<ReportRequest> basic_request, + base::OnceCallback<void(ReportRequestQueue)> callback, + std::vector<IndexedProfileReport> indexed_reports); private: size_t maximum_report_size_; ProfileReportGenerator profile_report_generator_; + + base::WeakPtrFactory<ReportRequestQueueGenerator> weak_factory_{this}; }; } // namespace enterprise_reporting
diff --git a/components/enterprise/client_certificates/core/client_certificates_service.cc b/components/enterprise/client_certificates/core/client_certificates_service.cc index 3c5ff5c7..db89193 100644 --- a/components/enterprise/client_certificates/core/client_certificates_service.cc +++ b/components/enterprise/client_certificates/core/client_certificates_service.cc
@@ -50,7 +50,8 @@ class ClientCertificatesServiceImpl : public ClientCertificatesService { public: ClientCertificatesServiceImpl( - CertificateProvisioningService* certificate_provisioning_service, + CertificateProvisioningService* profile_certificate_provisioning_service, + CertificateProvisioningService* browser_certificate_provisioning_service, std::unique_ptr<net::ClientCertStore> platform_certificate_store); ~ClientCertificatesServiceImpl() override; @@ -66,26 +67,36 @@ std::vector<net::ClientCertIdentityList> client_certs_lists); const raw_ptr<CertificateProvisioningService> - certificate_provisioning_service_; + profile_certificate_provisioning_service_; + const raw_ptr<CertificateProvisioningService> + browser_certificate_provisioning_service_; std::unique_ptr<net::ClientCertStore> platform_certificate_store_; base::WeakPtrFactory<ClientCertificatesServiceImpl> weak_factory_{this}; }; std::unique_ptr<ClientCertificatesService> ClientCertificatesService::Create( - CertificateProvisioningService* certificate_provisioning_service, + CertificateProvisioningService* profile_certificate_provisioning_service, + CertificateProvisioningService* browser_certificate_provisioning_service, std::unique_ptr<net::ClientCertStore> platform_certificate_store) { return std::make_unique<ClientCertificatesServiceImpl>( - certificate_provisioning_service, std::move(platform_certificate_store)); + profile_certificate_provisioning_service, + browser_certificate_provisioning_service, + std::move(platform_certificate_store)); } ClientCertificatesServiceImpl::ClientCertificatesServiceImpl( - CertificateProvisioningService* certificate_provisioning_service, + CertificateProvisioningService* profile_certificate_provisioning_service, + CertificateProvisioningService* browser_certificate_provisioning_service, std::unique_ptr<net::ClientCertStore> platform_certificate_store) - : certificate_provisioning_service_(certificate_provisioning_service), + : profile_certificate_provisioning_service_( + profile_certificate_provisioning_service), + browser_certificate_provisioning_service_( + browser_certificate_provisioning_service), platform_certificate_store_(std::move(platform_certificate_store)) { - CHECK(certificate_provisioning_service_); CHECK(platform_certificate_store_); + CHECK(profile_certificate_provisioning_service_ || + browser_certificate_provisioning_service_); } ClientCertificatesServiceImpl::~ClientCertificatesServiceImpl() = default; @@ -94,14 +105,25 @@ scoped_refptr<const net::SSLCertRequestInfo> cert_request_info, ClientCertListCallback callback) { auto barrier_callback = base::BarrierCallback<net::ClientCertIdentityList>( - 2U, base::BindOnce(&ClientCertificatesServiceImpl::FlattenLists, + 3U, base::BindOnce(&ClientCertificatesServiceImpl::FlattenLists, weak_factory_.GetWeakPtr(), std::move(callback))); platform_certificate_store_->GetClientCerts(cert_request_info, barrier_callback); - certificate_provisioning_service_->GetManagedIdentity( - base::BindOnce(ConvertIdentityToList, barrier_callback)); + if (browser_certificate_provisioning_service_) { + browser_certificate_provisioning_service_->GetManagedIdentity( + base::BindOnce(ConvertIdentityToList, barrier_callback)); + } else { + barrier_callback.Run(net::ClientCertIdentityList()); + } + + if (profile_certificate_provisioning_service_) { + profile_certificate_provisioning_service_->GetManagedIdentity( + base::BindOnce(ConvertIdentityToList, barrier_callback)); + } else { + barrier_callback.Run(net::ClientCertIdentityList()); + } } void ClientCertificatesServiceImpl::FlattenLists(
diff --git a/components/enterprise/client_certificates/core/client_certificates_service.h b/components/enterprise/client_certificates/core/client_certificates_service.h index b3191e81c6..bf0da13 100644 --- a/components/enterprise/client_certificates/core/client_certificates_service.h +++ b/components/enterprise/client_certificates/core/client_certificates_service.h
@@ -16,10 +16,12 @@ class ClientCertificatesService : public net::ClientCertStore { public: // Returns an instance of the service which will aggregate certificates from - // both the managed `certificate_provisioning_service` and the OS' + // the managed `profile_certificate_provisioning_service`, + // `browser_certificate_provisioning_service`, and the OS' // `platform_certificate_store`. static std::unique_ptr<ClientCertificatesService> Create( - CertificateProvisioningService* certificate_provisioning_service, + CertificateProvisioningService* profile_certificate_provisioning_service, + CertificateProvisioningService* browser_certificate_provisioning_service, std::unique_ptr<net::ClientCertStore> platform_certificate_store); };
diff --git a/components/enterprise/client_certificates/core/client_certificates_service_unittest.cc b/components/enterprise/client_certificates/core/client_certificates_service_unittest.cc index b06d73c..929637b 100644 --- a/components/enterprise/client_certificates/core/client_certificates_service_unittest.cc +++ b/components/enterprise/client_certificates/core/client_certificates_service_unittest.cc
@@ -69,7 +69,8 @@ base::test::TaskEnvironment task_environment_; - MockCertificateProvisioningService mock_provisioning_service_; + MockCertificateProvisioningService mock_profile_provisioning_service_; + MockCertificateProvisioningService mock_browser_provisioning_service_; }; // Tests that only the platform identity is returned when there are no managed @@ -81,11 +82,14 @@ auto mocked_store = CreateMockedStore(std::move(platform_identities)); - EXPECT_CALL(mock_provisioning_service_, GetManagedIdentity(_)) + EXPECT_CALL(mock_profile_provisioning_service_, GetManagedIdentity(_)) + .WillOnce(RunOnceCallback<0>(std::nullopt)); + EXPECT_CALL(mock_browser_provisioning_service_, GetManagedIdentity(_)) .WillOnce(RunOnceCallback<0>(std::nullopt)); - auto service = ClientCertificatesService::Create(&mock_provisioning_service_, - std::move(mocked_store)); + auto service = ClientCertificatesService::Create( + &mock_profile_provisioning_service_, &mock_browser_provisioning_service_, + std::move(mocked_store)); auto request_info = base::MakeRefCounted<net::SSLCertRequestInfo>(); base::test::TestFuture<net::ClientCertIdentityList> test_future; @@ -96,9 +100,60 @@ EXPECT_EQ(certs[0]->certificate(), platform_cert.get()); } -// Tests that both the platform identity and managed identity are returned. +// Tests that only the platform identity is returned when there are no managed +// identities and only the browser provisioning service was present. TEST_F(ClientCertificatesServiceTest, - GetClientCerts_WithManagedIdentity_NoSSLKey) { + GetClientCertsNoManagedIdentity_MissingProfileProvisioningService) { + auto platform_cert = LoadTestPlatformCert(); + auto platform_identities = + net::FakeClientCertIdentityListFromCertificateList({platform_cert}); + + auto mocked_store = CreateMockedStore(std::move(platform_identities)); + + EXPECT_CALL(mock_browser_provisioning_service_, GetManagedIdentity(_)) + .WillOnce(RunOnceCallback<0>(std::nullopt)); + + auto service = ClientCertificatesService::Create( + nullptr, &mock_browser_provisioning_service_, std::move(mocked_store)); + + auto request_info = base::MakeRefCounted<net::SSLCertRequestInfo>(); + base::test::TestFuture<net::ClientCertIdentityList> test_future; + service->GetClientCerts(request_info, test_future.GetCallback()); + + const auto& certs = test_future.Get(); + ASSERT_EQ(certs.size(), 1U); + EXPECT_EQ(certs[0]->certificate(), platform_cert.get()); +} + +// Tests that only the platform identity is returned when there are no managed +// identities and only the profile provisioning service was present. +TEST_F(ClientCertificatesServiceTest, + GetClientCertsNoManagedIdentity_MissingBrowserProvisioningService) { + auto platform_cert = LoadTestPlatformCert(); + auto platform_identities = + net::FakeClientCertIdentityListFromCertificateList({platform_cert}); + + auto mocked_store = CreateMockedStore(std::move(platform_identities)); + + EXPECT_CALL(mock_profile_provisioning_service_, GetManagedIdentity(_)) + .WillOnce(RunOnceCallback<0>(std::nullopt)); + + auto service = ClientCertificatesService::Create( + &mock_profile_provisioning_service_, nullptr, std::move(mocked_store)); + + auto request_info = base::MakeRefCounted<net::SSLCertRequestInfo>(); + base::test::TestFuture<net::ClientCertIdentityList> test_future; + service->GetClientCerts(request_info, test_future.GetCallback()); + + const auto& certs = test_future.Get(); + ASSERT_EQ(certs.size(), 1U); + EXPECT_EQ(certs[0]->certificate(), platform_cert.get()); +} + +// Tests that both the platform identity and managed profile identity are +// returned. +TEST_F(ClientCertificatesServiceTest, + GetClientCerts_WithManagedProfileIdentity_NoSSLKey) { auto platform_cert = LoadTestPlatformCert(); auto platform_identities = net::FakeClientCertIdentityListFromCertificateList({platform_cert}); @@ -109,11 +164,14 @@ ClientIdentity managed_identity( "managed", base::MakeRefCounted<StrictMock<MockPrivateKey>>(), managed_cert); - EXPECT_CALL(mock_provisioning_service_, GetManagedIdentity(_)) + EXPECT_CALL(mock_profile_provisioning_service_, GetManagedIdentity(_)) .WillOnce(RunOnceCallback<0>(managed_identity)); + EXPECT_CALL(mock_browser_provisioning_service_, GetManagedIdentity(_)) + .WillOnce(RunOnceCallback<0>(std::nullopt)); - auto service = ClientCertificatesService::Create(&mock_provisioning_service_, - std::move(mocked_store)); + auto service = ClientCertificatesService::Create( + &mock_profile_provisioning_service_, &mock_browser_provisioning_service_, + std::move(mocked_store)); auto request_info = base::MakeRefCounted<net::SSLCertRequestInfo>(); base::test::TestFuture<net::ClientCertIdentityList> test_future; @@ -124,8 +182,76 @@ EXPECT_EQ(certs[0]->certificate(), platform_cert.get()); } -// Tests that both the platform identity and managed identity are returned when -// the managed identity has a valid key to be used with TLS. +// Tests that both the platform identity and managed browser identity are +// returned. +TEST_F(ClientCertificatesServiceTest, + GetClientCerts_WithManagedBrowserIdentity_NoSSLKey) { + auto platform_cert = LoadTestPlatformCert(); + auto platform_identities = + net::FakeClientCertIdentityListFromCertificateList({platform_cert}); + + auto mocked_store = CreateMockedStore(std::move(platform_identities)); + + auto managed_cert = LoadTestManagedCert(); + ClientIdentity managed_identity( + "managed", base::MakeRefCounted<StrictMock<MockPrivateKey>>(), + managed_cert); + EXPECT_CALL(mock_profile_provisioning_service_, GetManagedIdentity(_)) + .WillOnce(RunOnceCallback<0>(std::nullopt)); + EXPECT_CALL(mock_browser_provisioning_service_, GetManagedIdentity(_)) + .WillOnce(RunOnceCallback<0>(managed_identity)); + + auto service = ClientCertificatesService::Create( + &mock_profile_provisioning_service_, &mock_browser_provisioning_service_, + std::move(mocked_store)); + + auto request_info = base::MakeRefCounted<net::SSLCertRequestInfo>(); + base::test::TestFuture<net::ClientCertIdentityList> test_future; + service->GetClientCerts(request_info, test_future.GetCallback()); + + const auto& certs = test_future.Get(); + ASSERT_EQ(certs.size(), 1U); + EXPECT_EQ(certs[0]->certificate(), platform_cert.get()); +} + +// Tests that the platform identity, managed profile, and managed browser +// identity are returned. +TEST_F(ClientCertificatesServiceTest, + GetClientCerts_WithAllManagedIdentities_NoSSLKey) { + auto platform_cert = LoadTestPlatformCert(); + auto platform_identities = + net::FakeClientCertIdentityListFromCertificateList({platform_cert}); + + auto mocked_store = CreateMockedStore(std::move(platform_identities)); + + auto managed_cert = LoadTestManagedCert(); + ClientIdentity managed_identity1( + "managed1", base::MakeRefCounted<StrictMock<MockPrivateKey>>(), + managed_cert); + ClientIdentity managed_identity2( + "managed2", base::MakeRefCounted<StrictMock<MockPrivateKey>>(), + managed_cert); + EXPECT_CALL(mock_profile_provisioning_service_, GetManagedIdentity(_)) + .WillOnce(RunOnceCallback<0>(managed_identity1)); + EXPECT_CALL(mock_browser_provisioning_service_, GetManagedIdentity(_)) + .WillOnce(RunOnceCallback<0>(managed_identity2)); + + auto service = ClientCertificatesService::Create( + &mock_profile_provisioning_service_, &mock_browser_provisioning_service_, + std::move(mocked_store)); + + auto request_info = base::MakeRefCounted<net::SSLCertRequestInfo>(); + base::test::TestFuture<net::ClientCertIdentityList> test_future; + service->GetClientCerts(request_info, test_future.GetCallback()); + + const auto& certs = test_future.Get(); + ASSERT_EQ(certs.size(), 1U); + EXPECT_EQ(certs[0]->certificate(), platform_cert.get()); +} + +// Tests that the platform identity and both the managed profile and browser +// identities are returned when the managed identity has a valid key to be used +// with TLS. TEST_F(ClientCertificatesServiceTest, GetClientCerts_WithManagedIdentity) { auto platform_cert = LoadTestPlatformCert(); auto platform_identities = @@ -138,25 +264,34 @@ // Make sure the mocked PrivateKey has a SSLPrivateKey. // net::CreateFailSigningSSLPrivateKey is being used as signing won't be // tested here. - auto mock_private_key = base::MakeRefCounted<StrictMock<MockPrivateKey>>( + auto mock_private_key1 = base::MakeRefCounted<StrictMock<MockPrivateKey>>( PrivateKeySource::kUnexportableKey, net::CreateFailSigningSSLPrivateKey()); - ClientIdentity managed_identity("managed", std::move(mock_private_key), - managed_cert); - EXPECT_CALL(mock_provisioning_service_, GetManagedIdentity(_)) - .WillOnce(RunOnceCallback<0>(managed_identity)); + auto mock_private_key2 = base::MakeRefCounted<StrictMock<MockPrivateKey>>( + PrivateKeySource::kUnexportableKey, + net::CreateFailSigningSSLPrivateKey()); + ClientIdentity managed_identity1("managed1", std::move(mock_private_key1), + managed_cert); + ClientIdentity managed_identity2("managed2", std::move(mock_private_key2), + managed_cert); + EXPECT_CALL(mock_profile_provisioning_service_, GetManagedIdentity(_)) + .WillOnce(RunOnceCallback<0>(managed_identity1)); + EXPECT_CALL(mock_browser_provisioning_service_, GetManagedIdentity(_)) + .WillOnce(RunOnceCallback<0>(managed_identity2)); - auto service = ClientCertificatesService::Create(&mock_provisioning_service_, - std::move(mocked_store)); + auto service = ClientCertificatesService::Create( + &mock_profile_provisioning_service_, &mock_browser_provisioning_service_, + std::move(mocked_store)); auto request_info = base::MakeRefCounted<net::SSLCertRequestInfo>(); base::test::TestFuture<net::ClientCertIdentityList> test_future; service->GetClientCerts(request_info, test_future.GetCallback()); const auto& certs = test_future.Get(); - ASSERT_EQ(certs.size(), 2U); + ASSERT_EQ(certs.size(), 3U); EXPECT_EQ(certs[0]->certificate(), platform_cert.get()); EXPECT_EQ(certs[1]->certificate(), managed_cert.get()); + EXPECT_EQ(certs[2]->certificate(), managed_cert.get()); } } // namespace client_certificates
diff --git a/components/enterprise/client_certificates/core/features.cc b/components/enterprise/client_certificates/core/features.cc index 9c6c7dfc..e9fa351 100644 --- a/components/enterprise/client_certificates/core/features.cc +++ b/components/enterprise/client_certificates/core/features.cc
@@ -18,7 +18,7 @@ "ManagedBrowserClientCertificateEnabled", base::FEATURE_DISABLED_BY_DEFAULT); -bool IskManagedBrowserClientCertificateEnabled() { +bool IsManagedBrowserClientCertificateEnabled() { return base::FeatureList::IsEnabled(kManagedBrowserClientCertificateEnabled); }
diff --git a/components/enterprise/common/proto/synced/browser_events.proto b/components/enterprise/common/proto/synced/browser_events.proto index 78f2b9c..b467d868 100644 --- a/components/enterprise/common/proto/synced/browser_events.proto +++ b/components/enterprise/common/proto/synced/browser_events.proto
@@ -424,7 +424,7 @@ } // A message for reporting dangerous download events. -// Next ID: 35. +// Next ID: 40. message SafeBrowsingDangerousDownloadEvent { reserved 5, 11, 12, 13, 14, 15, 16; @@ -543,6 +543,21 @@ // The referrers of the webpage that sent the user to the url that triggered // the event. repeated UrlInfo referrers = 34; + + // Per-threat Risk Info, powered by Safe Browsing. + repeated RiskInfo risk_infos = 35; + + // Top-level risk level for the content. + RiskLevel risk_level = 36; + + // URL info of the URL of the tab. + UrlInfo tab_url_info = 37; + + // The sha256 hash of the PEdata based on Safe Browsing's PEHash. + string pehash_sha256 = 38; + + // Whether the content is encrypted. + bool is_encrypted = 39; } // Types of data transferring operations that may have triggered the event to @@ -638,7 +653,7 @@ } // A DLP (Data Loss Prevention) event where sensitive data may have leaked. -// Next ID: 32. +// Next ID: 34. message DlpSensitiveDataEvent { reserved 6, 9, 10, 11, 12, 13, 15, 25; @@ -731,6 +746,13 @@ // The total scan time in milliseconds on the server side before reporting // this event. int64 server_scan_latency_millis = 31; + + // URL info of the URL that triggered the event. + UrlInfo url_info = 32; + + // The referrers of the webpage that sent the user to the url that triggered + // the event. + repeated UrlInfo referrers = 33; } // Event where a large file could not be scanned for analysis e.g. malware or @@ -824,7 +846,7 @@ // Event that indicates that content was transferred. // -// Next ID: 17. +// Next ID: 22. message ContentTransferEvent { // The id of the scan. This will be shared by all events that are triggered // from a single scan. @@ -907,6 +929,21 @@ // The referrers of the webpage that sent the user to the url that triggered // the event. repeated UrlInfo referrers = 16; + + // Per-threat Risk Info, powered by Safe Browsing. + repeated RiskInfo risk_infos = 17; + + // Top-level risk level for the content. + RiskLevel risk_level = 18; + + // URL info of the URL of the tab. + UrlInfo tab_url_info = 19; + + // The sha256 hash of the PEdata based on Safe Browsing's PEHash. + string pehash_sha256 = 20; + + // Whether the content is encrypted. + bool is_encrypted = 21; } // Event sent when a user successfully logs in to a website, as determined by
diff --git a/components/facilitated_payments/core/browser/BUILD.gn b/components/facilitated_payments/core/browser/BUILD.gn index df7a5f4..79460c24 100644 --- a/components/facilitated_payments/core/browser/BUILD.gn +++ b/components/facilitated_payments/core/browser/BUILD.gn
@@ -23,6 +23,7 @@ "network_api/facilitated_payments_network_interface.h", "pix_manager.cc", "pix_manager.h", + "strike_databases/payment_link_suggestion_strike_database.h", ] public_deps = [
diff --git a/components/facilitated_payments/core/browser/ewallet_manager.cc b/components/facilitated_payments/core/browser/ewallet_manager.cc index b14c1c2..6a50f89f 100644 --- a/components/facilitated_payments/core/browser/ewallet_manager.cc +++ b/components/facilitated_payments/core/browser/ewallet_manager.cc
@@ -19,6 +19,7 @@ #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 "components/facilitated_payments/core/browser/network_api/facilitated_payments_network_interface.h" +#include "components/facilitated_payments/core/browser/strike_databases/payment_link_suggestion_strike_database.h" #include "components/facilitated_payments/core/features/features.h" #include "components/facilitated_payments/core/metrics/facilitated_payments_metrics.h" #include "components/facilitated_payments/core/utils/facilitated_payments_ui_utils.h" @@ -101,6 +102,13 @@ return; } + if (auto* strike_database = GetOrCreateStrikeDatabase()) { + if (strike_database->ShouldBlockFeature()) { + LogEwalletFlowExitedReason(EwalletFlowExitedReason::kMaxStrikes, scheme_); + return; + } + } + base::span<const autofill::Ewallet> ewallet_accounts = payments_data_manager->GetEwalletAccounts(); supported_ewallets_.reserve(ewallet_accounts.size()); @@ -174,6 +182,10 @@ } void EwalletManager::OnEwalletAccountSelected(int64_t selected_instrument_id) { + if (auto* strike_database = GetOrCreateStrikeDatabase()) { + strike_database->ClearStrikes(); + } + LogEwalletFopSelected(GetAvailableEwalletsConfiguration()); LogEwalletFopSelectorResultUkm(/*accepted=*/true, ukm_source_id_, scheme_); @@ -335,6 +347,9 @@ } case UiEvent::kScreenClosedByUser: { if (ui_state_ == UiState::kFopSelector) { + if (auto* strike_database = GetOrCreateStrikeDatabase()) { + strike_database->AddStrike(); + } LogEwalletFlowExitedReason( EwalletFlowExitedReason::kFopSelectorClosedByUser, scheme_); LogEwalletFopSelectorResultUkm(/*accepted=*/false, ukm_source_id_, @@ -385,4 +400,15 @@ } } +PaymentLinkSuggestionStrikeDatabase* +EwalletManager::GetOrCreateStrikeDatabase() { + if (!strike_database_) { + if (auto* strike_database = client_->GetStrikeDatabase()) { + strike_database_ = std::make_unique<PaymentLinkSuggestionStrikeDatabase>( + strike_database); + } + } + return strike_database_.get(); +} + } // namespace payments::facilitated
diff --git a/components/facilitated_payments/core/browser/ewallet_manager.h b/components/facilitated_payments/core/browser/ewallet_manager.h index a9407ba..3769ef73 100644 --- a/components/facilitated_payments/core/browser/ewallet_manager.h +++ b/components/facilitated_payments/core/browser/ewallet_manager.h
@@ -17,6 +17,7 @@ #include "components/autofill/core/browser/payments/payments_autofill_client.h" #include "components/facilitated_payments/core/browser/facilitated_payments_api_client.h" #include "components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_request_details.h" +#include "components/facilitated_payments/core/browser/strike_databases/payment_link_suggestion_strike_database.h" #include "components/facilitated_payments/core/utils/facilitated_payments_ui_utils.h" #include "components/facilitated_payments/core/utils/facilitated_payments_utils.h" #include "components/facilitated_payments/core/validation/payment_link_validator.h" @@ -136,6 +137,10 @@ // being shown. void DismissProgressScreen(); + // Retrieves the strike database for payment link suggestion. This can return + // nullptr so check before using. + PaymentLinkSuggestionStrikeDatabase* GetOrCreateStrikeDatabase(); + // A list of eWallets that support the payment link provided in // TriggerEwalletPushPayment(). // @@ -192,6 +197,9 @@ // A timer to make UI changes. base::OneShotTimer ui_timer_; + // Strike database used to check whether to prompt the FOP selector or not. + std::unique_ptr<PaymentLinkSuggestionStrikeDatabase> strike_database_; + base::WeakPtrFactory<EwalletManager> weak_ptr_factory_{this}; };
diff --git a/components/facilitated_payments/core/browser/ewallet_manager_unittest.cc b/components/facilitated_payments/core/browser/ewallet_manager_unittest.cc index 19f5207..a8142ea5 100644 --- a/components/facilitated_payments/core/browser/ewallet_manager_unittest.cc +++ b/components/facilitated_payments/core/browser/ewallet_manager_unittest.cc
@@ -13,6 +13,7 @@ #include "base/test/task_environment.h" #include "components/autofill/core/browser/data_manager/payments/test_payments_data_manager.h" #include "components/autofill/core/browser/data_model/payments/ewallet.h" +#include "components/autofill/core/browser/strike_databases/payments/test_strike_database.h" #include "components/autofill/core/browser/test_utils/autofill_test_utils.h" #include "components/autofill/core/common/autofill_prefs.h" #include "components/facilitated_payments/core/browser/ewallet_manager.h" @@ -22,6 +23,7 @@ #include "components/facilitated_payments/core/browser/mock_facilitated_payments_client.h" #include "components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_response_details.h" #include "components/facilitated_payments/core/browser/network_api/mock_facilitated_payments_network_interface.h" +#include "components/facilitated_payments/core/browser/strike_databases/payment_link_suggestion_strike_database.h" #include "components/facilitated_payments/core/metrics/facilitated_payments_metrics.h" #include "components/facilitated_payments/core/utils/facilitated_payments_ui_utils.h" #include "components/optimization_guide/core/mock_optimization_guide_decider.h" @@ -68,6 +70,7 @@ pref_service_ = autofill::test::PrefServiceForTesting(); payments_data_manager_.SetPrefService(pref_service_.get()); payments_data_manager_.SetSyncServiceForTest(&sync_service_); + test_strike_database_ = std::make_unique<autofill::TestStrikeDatabase>(); ON_CALL(client_, GetPaymentsDataManager) .WillByDefault(testing::Return(&payments_data_manager_)); ON_CALL(client_, GetFacilitatedPaymentsNetworkInterface) @@ -76,6 +79,8 @@ ON_CALL(client_, IsFoldable).WillByDefault(testing::Return(false)); ON_CALL(client_, GetCoreAccountInfo) .WillByDefault(testing::Return(CreateLoggedInAccountInfo())); + ON_CALL(client_, GetStrikeDatabase) + .WillByDefault(testing::Return(test_strike_database_.get())); ON_CALL(optimization_guide_decider_, CanApplyOptimization( testing::_, testing::_, @@ -115,6 +120,7 @@ autofill::TestPaymentsDataManager payments_data_manager_; MockFacilitatedPaymentsNetworkInterface payments_network_interface_; ukm::TestAutoSetUkmRecorder ukm_recorder_; + std::unique_ptr<autofill::TestStrikeDatabase> test_strike_database_; }; // Verify that metrics are logged correctly when a supported payment link is @@ -1419,4 +1425,85 @@ EXPECT_EQ(test_api(*ewallet_manager_).ui_state(), UiState::kErrorScreen); } +// Test that API availability is invoked if strike limitation is not reached. +TEST_F(EwalletManagerTest, + TriggerEwalletPushPayment_NotEnoughStrike_ApiAvailabilityInvoked) { + GURL page_url("https://example.com/"); + payments_data_manager_.AddEwalletForTest(autofill::Ewallet( + /*instrument_id=*/100, u"nickname", + /*display_icon_url=*/page_url, u"ewallet_name", u"account_display_name", + /*supported_payment_link_uris=*/ + {u"^shopeepay:\\/\\/shopeepay\\.com\\.my\\?code=.*$", + u"^tngd:\\/\\/tngdigital\\.com\\.my\\?code=.*$"}, + /*is_fido_enrolled=*/true)); + GURL supported_payment_link( + "shopeepay://shopeepay.com.my?code=https://shopeepay.com.my/" + "281011051692389958586862838?merchant=Walmart&amount=101¤cy=usd"); + PaymentLinkSuggestionStrikeDatabase strike_database = + PaymentLinkSuggestionStrikeDatabase(test_strike_database_.get()); + strike_database.AddStrikes(1); + + EXPECT_CALL(GetApiClient(), IsAvailable); + + ewallet_manager_->TriggerEwalletPushPayment( + supported_payment_link, page_url, ukm::UkmRecorder::GetNewSourceID()); +} + +// Test that API availability is not invoked if strike limitation is reached. +TEST_F(EwalletManagerTest, + TriggerEwalletPushPayment_MaxStrike_ApiAvailabilityNotInvoked) { + base::HistogramTester histogram_tester; + GURL page_url("https://example.com/"); + payments_data_manager_.AddEwalletForTest( + autofill::Ewallet(/*instrument_id=*/100, u"nickname", + /*display_icon_url=*/GURL("http://www.example.com"), + u"ewallet_name", u"account_display_name", + /*supported_payment_link_uris=*/ + {u"^shopeepay:\\/\\/shopeepay\\.com\\.my\\?code=.*$", + u"^tngd:\\/\\/tngdigital\\.com\\.my\\?code=.*$"}, + /*is_fido_enrolled=*/true)); + GURL supported_payment_link( + "shopeepay://shopeepay.com.my?code=https://shopeepay.com.my/" + "281011051692389958586862838?merchant=Walmart&amount=101¤cy=usd"); + PaymentLinkSuggestionStrikeDatabase strike_database = + PaymentLinkSuggestionStrikeDatabase(test_strike_database_.get()); + strike_database.AddStrikes(5); + + EXPECT_CALL(GetApiClient(), IsAvailable).Times(0); + + ewallet_manager_->TriggerEwalletPushPayment( + supported_payment_link, page_url, ukm::UkmRecorder::GetNewSourceID()); + + histogram_tester.ExpectUniqueSample( + "FacilitatedPayments.Ewallet.PayflowExitedReason.ShopeePay", + /*sample=*/EwalletFlowExitedReason::kMaxStrikes, + /*expected_bucket_count=*/1); +} + +TEST_F(EwalletManagerTest, + OnPaymentPromptResult_FopSelectorAccepted_ClearsStrikes) { + payments_data_manager_.AddEwalletForTest( + autofill::Ewallet(/*instrument_id=*/100, u"nickname", + /*display_icon_url=*/GURL("http://www.example.com"), + u"ewallet_name", u"account_display_name", + /*supported_payment_link_uris=*/ + {u"^shopeepay:\\/\\/shopeepay\\.com\\.my\\?code=.*$", + u"^tngd:\\/\\/tngdigital\\.com\\.my\\?code=.*$"}, + /*is_fido_enrolled=*/true)); + GURL supported_payment_link( + "shopeepay://shopeepay.com.my?code=https://shopeepay.com.my/" + "281011051692389958586862838?merchant=Walmart&amount=101¤cy=usd"); + PaymentLinkSuggestionStrikeDatabase strike_database = + PaymentLinkSuggestionStrikeDatabase(test_strike_database_.get()); + strike_database.AddStrikes(2); + + ewallet_manager_->TriggerEwalletPushPayment( + supported_payment_link, GURL("https://www.example.com"), + ukm::UkmRecorder::GetNewSourceID()); + test_api(*ewallet_manager_) + .OnEwalletAccountSelected(/*selected_instrument_id=*/100L); + + EXPECT_EQ(0, strike_database.GetStrikes()); +} + } // namespace payments::facilitated
diff --git a/components/facilitated_payments/core/browser/facilitated_payments_client.h b/components/facilitated_payments/core/browser/facilitated_payments_client.h index 44ee39d..c99507f 100644 --- a/components/facilitated_payments/core/browser/facilitated_payments_client.h +++ b/components/facilitated_payments/core/browser/facilitated_payments_client.h
@@ -18,6 +18,7 @@ namespace autofill { class BankAccount; class PaymentsDataManager; +class StrikeDatabase; } // namespace autofill namespace payments::facilitated { @@ -79,6 +80,10 @@ // Enables features to pass a callback to listen to UI events. virtual void SetUiEventListener( base::RepeatingCallback<void(UiEvent)> ui_event_listener); + + // Gets the StrikeDatabase associated with the client. Note: Nullptr may be + // returned so check before use. + virtual autofill::StrikeDatabase* GetStrikeDatabase() = 0; }; } // namespace payments::facilitated
diff --git a/components/facilitated_payments/core/browser/mock_facilitated_payments_client.h b/components/facilitated_payments/core/browser/mock_facilitated_payments_client.h index f213d48..ba08678 100644 --- a/components/facilitated_payments/core/browser/mock_facilitated_payments_client.h +++ b/components/facilitated_payments/core/browser/mock_facilitated_payments_client.h
@@ -18,6 +18,7 @@ namespace autofill { class PaymentsDataManager; +class StrikeDatabase; } // namespace autofill namespace payments::facilitated { @@ -61,6 +62,7 @@ MOCK_METHOD(void, ShowProgressScreen, (), (override)); MOCK_METHOD(void, ShowErrorScreen, (), (override)); MOCK_METHOD(void, DismissPrompt, (), (override)); + MOCK_METHOD(autofill::StrikeDatabase*, GetStrikeDatabase, (), (override)); }; } // namespace payments::facilitated
diff --git a/components/facilitated_payments/core/browser/strike_databases/payment_link_suggestion_strike_database.h b/components/facilitated_payments/core/browser/strike_databases/payment_link_suggestion_strike_database.h new file mode 100644 index 0000000..a3e5d9e --- /dev/null +++ b/components/facilitated_payments/core/browser/strike_databases/payment_link_suggestion_strike_database.h
@@ -0,0 +1,36 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_FACILITATED_PAYMENTS_CORE_BROWSER_STRIKE_DATABASES_PAYMENT_LINK_SUGGESTION_STRIKE_DATABASE_H_ +#define COMPONENTS_FACILITATED_PAYMENTS_CORE_BROWSER_STRIKE_DATABASES_PAYMENT_LINK_SUGGESTION_STRIKE_DATABASE_H_ + +#include <cstddef> +#include <optional> +#include <string_view> + +#include "base/time/time.h" +#include "components/autofill/core/browser/strike_databases/simple_autofill_strike_database.h" +#include "components/autofill/core/browser/strike_databases/strike_database.h" + +namespace payments::facilitated { + +// Max 5 strikes and one strike expires every 60 days. +struct PaymentLinkSuggestionStrikeDatabaseTraits { + static constexpr std::string_view kName = "PaymentLinkSuggestion"; + static constexpr std::optional<size_t> kMaxStrikeEntities = std::nullopt; + static constexpr std::optional<size_t> kMaxStrikeEntitiesAfterCleanup = + std::nullopt; + static constexpr size_t kMaxStrikeLimit = 5; + static constexpr base::TimeDelta kExpiryTimeDelta = base::Days(60); + static constexpr bool kUniqueIdRequired = false; +}; + +// Strike database for payment link suggestions. +using PaymentLinkSuggestionStrikeDatabase = + autofill::SimpleAutofillStrikeDatabase< + PaymentLinkSuggestionStrikeDatabaseTraits>; + +} // namespace payments::facilitated + +#endif // COMPONENTS_FACILITATED_PAYMENTS_CORE_BROWSER_STRIKE_DATABASES_PAYMENT_LINK_SUGGESTION_STRIKE_DATABASE_H_
diff --git a/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h b/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h index 0a709e8..8ec2746 100644 --- a/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h +++ b/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h
@@ -73,7 +73,8 @@ kFopSelectorClosedByUser = 12, // The device is a foldable device which we don't support yet. kFoldableDevice = 13, - kMaxValue = kFoldableDevice + kMaxStrikes = 14, + kMaxValue = kMaxStrikes }; // LINT.ThenChange(/tools/metrics/histograms/metadata/facilitated_payments/enums.xml:FacilitatedPayments.EwalletFlowExitedReason)
diff --git a/components/facilitated_payments/core/metrics/facilitated_payments_metrics_unittest.cc b/components/facilitated_payments/core/metrics/facilitated_payments_metrics_unittest.cc index 55f41d7..09b0d683 100644 --- a/components/facilitated_payments/core/metrics/facilitated_payments_metrics_unittest.cc +++ b/components/facilitated_payments/core/metrics/facilitated_payments_metrics_unittest.cc
@@ -286,7 +286,8 @@ EwalletFlowExitedReason::kUserLoggedOut, EwalletFlowExitedReason::kFopSelectorClosedNotByUser, EwalletFlowExitedReason::kFopSelectorClosedByUser, - EwalletFlowExitedReason::kFoldableDevice), + EwalletFlowExitedReason::kFoldableDevice, + EwalletFlowExitedReason::kMaxStrikes), testing::Values(PaymentLinkValidator::Scheme::kDuitNow, PaymentLinkValidator::Scheme::kShopeePay, PaymentLinkValidator::Scheme::kTngd)));
diff --git a/components/feature_engagement/public/feature_constants.cc b/components/feature_engagement/public/feature_constants.cc index e0d2a32..b5c2762c 100644 --- a/components/feature_engagement/public/feature_constants.cc +++ b/components/feature_engagement/public/feature_constants.cc
@@ -649,7 +649,7 @@ base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kIPHiOSLensOverlayEntrypointTipFeature, "IPH_iOSLensOverlayEntrypointTip", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kIPHiOSLensOverlayEscapeHatchTipFeature, "IPH_iOSLensOverlayEscapeHatchTip", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/components/ip_protection/common/ip_protection_core_impl.cc b/components/ip_protection/common/ip_protection_core_impl.cc index 2ee3b28..24d8f38 100644 --- a/components/ip_protection/common/ip_protection_core_impl.cc +++ b/components/ip_protection/common/ip_protection_core_impl.cc
@@ -88,9 +88,9 @@ is_ip_protection_enabled_(is_ip_protection_enabled), ipp_over_quic_(net::features::kIpPrivacyUseQuicProxies.Get()), mdl_type_(network::features::kSplitMaskedDomainList.Get() - ? (ip_protection_incognito ? MdlType::kDefault + ? (ip_protection_incognito ? MdlType::kIncognito : MdlType::kRegularBrowsing) - : MdlType::kDefault) { + : MdlType::kIncognito) { net::NetworkChangeNotifier::AddNetworkChangeObserver(this); }
diff --git a/components/ip_protection/common/ip_protection_data_types.cc b/components/ip_protection/common/ip_protection_data_types.cc index 1a889a8..e76ee40 100644 --- a/components/ip_protection/common/ip_protection_data_types.cc +++ b/components/ip_protection/common/ip_protection_data_types.cc
@@ -64,7 +64,7 @@ std::vector<MdlType> mdl_types; if (!resource.exclude_default_group()) { - mdl_types.emplace_back(MdlType::kDefault); + mdl_types.emplace_back(MdlType::kIncognito); } if (resource.experiments_size() != 0 &&
diff --git a/components/ip_protection/common/ip_protection_data_types.h b/components/ip_protection/common/ip_protection_data_types.h index a3fcf33..9d8ca21b 100644 --- a/components/ip_protection/common/ip_protection_data_types.h +++ b/components/ip_protection/common/ip_protection_data_types.h
@@ -129,8 +129,8 @@ // The type of MDL that is being represented. This is used to determine which // MDL to use for a given matching request. enum class MdlType { - // The default MDL type which is for IPP in incognito browsing. - kDefault, + // The MDL type for IPP in incognito browsing. This is the default MDL type. + kIncognito, // The MDL type for IPP experiments within regular browsing. kRegularBrowsing, @@ -140,7 +140,7 @@ // // A given MDL resource may represent multiple MDL types. For example, a // resource that is in the default MDL group and the regular browsing MDL group -// would return both kDefault and kRegularBrowsing. Also, an empty vector +// would return both kIncognito and kRegularBrowsing. Also, an empty vector // indicates that the resource does not represent any MDL types which is // unexpected and will be logged as such. std::vector<MdlType> FromMdlResourceProto(
diff --git a/components/ip_protection/common/ip_protection_proxy_delegate_unittest.cc b/components/ip_protection/common/ip_protection_proxy_delegate_unittest.cc index 3c01560..2117cdb9 100644 --- a/components/ip_protection/common/ip_protection_proxy_delegate_unittest.cc +++ b/components/ip_protection/common/ip_protection_proxy_delegate_unittest.cc
@@ -84,7 +84,7 @@ bool ip_protection_incognito = true) : masked_domain_list_manager_(masked_domain_list_manager) { mdl_type_ = - ip_protection_incognito ? MdlType::kDefault : MdlType::kRegularBrowsing; + ip_protection_incognito ? MdlType::kIncognito : MdlType::kRegularBrowsing; } bool IsMdlPopulated() override {
diff --git a/components/ip_protection/common/masked_domain_list.cc b/components/ip_protection/common/masked_domain_list.cc index ae9a234..8f25f90 100644 --- a/components/ip_protection/common/masked_domain_list.cc +++ b/components/ip_protection/common/masked_domain_list.cc
@@ -267,7 +267,7 @@ for (const ResourceOwner& owner : mdl.resource_owners()) { for (const auto& resource : owner.owned_resources()) { for (MdlType mdl_type : FromMdlResourceProto(resource)) { - auto& builder = mdl_type == MdlType::kDefault + auto& builder = mdl_type == MdlType::kIncognito ? default_builder : regular_browsing_builder; builder.AddOwner(resource.domain(), owner_id.ValueOrDie(),
diff --git a/components/ip_protection/common/masked_domain_list_manager.cc b/components/ip_protection/common/masked_domain_list_manager.cc index f4fe278a..7f6e9fe7 100644 --- a/components/ip_protection/common/masked_domain_list_manager.cc +++ b/components/ip_protection/common/masked_domain_list_manager.cc
@@ -102,7 +102,7 @@ network_anonymization_key.GetTopFrameSite(); if (UseFlatbuffer()) { - MaskedDomainList* mdl = mdl_type == MdlType::kDefault + MaskedDomainList* mdl = mdl_type == MdlType::kIncognito ? default_mdl_.get() : regular_browsing_mdl_.get(); // If the MDL is not initialized yet, or initialization failed, nothing
diff --git a/components/ip_protection/common/masked_domain_list_manager.h b/components/ip_protection/common/masked_domain_list_manager.h index 6b40da20..9584844 100644 --- a/components/ip_protection/common/masked_domain_list_manager.h +++ b/components/ip_protection/common/masked_domain_list_manager.h
@@ -59,7 +59,7 @@ // proxy 1st party requests because no same-origin check is performed. bool Matches(const GURL& request_url, const net::NetworkAnonymizationKey& network_anonymization_key, - MdlType mdl_type = MdlType::kDefault) const; + MdlType mdl_type) const; // Use the Masked Domain List and exclusion list to generate the allow list // and the 1P bypass rules.
diff --git a/components/ip_protection/common/masked_domain_list_manager_unittest.cc b/components/ip_protection/common/masked_domain_list_manager_unittest.cc index 6b3fe86..201d0ac 100644 --- a/components/ip_protection/common/masked_domain_list_manager_unittest.cc +++ b/components/ip_protection/common/masked_domain_list_manager_unittest.cc
@@ -314,16 +314,20 @@ UpdateMaskedDomainList(mdl1, mdl_manager); EXPECT_TRUE(mdl_manager.IsPopulated()); - EXPECT_TRUE(mdl_manager.Matches(kHttpsRequestUrl1, kEmptyNak)); - EXPECT_FALSE(mdl_manager.Matches(kHttpsRequestUrl2, kEmptyNak)); + EXPECT_TRUE( + mdl_manager.Matches(kHttpsRequestUrl1, kEmptyNak, MdlType::kIncognito)); + EXPECT_FALSE( + mdl_manager.Matches(kHttpsRequestUrl2, kEmptyNak, MdlType::kIncognito)); histogram_tester.ExpectTotalCount(kFirstUpdateTimeHistogram, 1); // Second update. Removes old rules, adds new ones. UpdateMaskedDomainList(mdl2, mdl_manager); EXPECT_TRUE(mdl_manager.IsPopulated()); - EXPECT_FALSE(mdl_manager.Matches(kHttpsRequestUrl1, kEmptyNak)); - EXPECT_TRUE(mdl_manager.Matches(kHttpsRequestUrl2, kEmptyNak)); + EXPECT_TRUE( + mdl_manager.Matches(kHttpsRequestUrl2, kEmptyNak, MdlType::kIncognito)); + EXPECT_FALSE( + mdl_manager.Matches(kHttpsRequestUrl1, kEmptyNak, MdlType::kIncognito)); histogram_tester.ExpectTotalCount(kFirstUpdateTimeHistogram, 1); } @@ -332,10 +336,10 @@ const auto kHttpCrossSiteNak = net::NetworkAnonymizationKey::CreateCrossSite( net::SchemefulSite(GURL("http://top.com"))); - EXPECT_TRUE( - allow_list_no_bypass_.Matches(kHttpRequestUrl, kHttpCrossSiteNak)); - EXPECT_TRUE(allow_list_first_party_bypass_.Matches(kHttpRequestUrl, - kHttpCrossSiteNak)); + EXPECT_TRUE(allow_list_no_bypass_.Matches(kHttpRequestUrl, kHttpCrossSiteNak, + MdlType::kIncognito)); + EXPECT_TRUE(allow_list_first_party_bypass_.Matches( + kHttpRequestUrl, kHttpCrossSiteNak, MdlType::kIncognito)); } TEST_P(MaskedDomainListManagerTest, ShouldMatchWss) { @@ -343,9 +347,10 @@ const auto kHttpCrossSiteNak = net::NetworkAnonymizationKey::CreateCrossSite( net::SchemefulSite(GURL("http://top.com"))); - EXPECT_TRUE(allow_list_no_bypass_.Matches(kWssRequestUrl, kHttpCrossSiteNak)); - EXPECT_TRUE(allow_list_first_party_bypass_.Matches(kWssRequestUrl, - kHttpCrossSiteNak)); + EXPECT_TRUE(allow_list_no_bypass_.Matches(kWssRequestUrl, kHttpCrossSiteNak, + MdlType::kIncognito)); + EXPECT_TRUE(allow_list_first_party_bypass_.Matches( + kWssRequestUrl, kHttpCrossSiteNak, MdlType::kIncognito)); } TEST_P(MaskedDomainListManagerTest, ShouldMatchWs) { @@ -353,9 +358,10 @@ const auto kHttpCrossSiteNak = net::NetworkAnonymizationKey::CreateCrossSite( net::SchemefulSite(GURL("http://top.com"))); - EXPECT_TRUE(allow_list_no_bypass_.Matches(kWsRequestUrl, kHttpCrossSiteNak)); - EXPECT_TRUE( - allow_list_first_party_bypass_.Matches(kWsRequestUrl, kHttpCrossSiteNak)); + EXPECT_TRUE(allow_list_no_bypass_.Matches(kWsRequestUrl, kHttpCrossSiteNak, + MdlType::kIncognito)); + EXPECT_TRUE(allow_list_first_party_bypass_.Matches( + kWsRequestUrl, kHttpCrossSiteNak, MdlType::kIncognito)); } TEST_P(MaskedDomainListManagerTest, ShouldMatchThirdPartyToTopLevelFrame) { @@ -369,15 +375,15 @@ // Regardless of whether the NAK is cross-site, the request URL should be // considered third-party because the request URL doesn't match the top-level // site. - EXPECT_TRUE(allow_list_no_bypass_.Matches(kHttpsThirdPartyRequestUrl, - kHttpsCrossSiteNak)); - EXPECT_TRUE(allow_list_first_party_bypass_.Matches(kHttpsThirdPartyRequestUrl, - kHttpsCrossSiteNak)); + EXPECT_TRUE(allow_list_no_bypass_.Matches( + kHttpsThirdPartyRequestUrl, kHttpsCrossSiteNak, MdlType::kIncognito)); + EXPECT_TRUE(allow_list_first_party_bypass_.Matches( + kHttpsThirdPartyRequestUrl, kHttpsCrossSiteNak, MdlType::kIncognito)); - EXPECT_TRUE(allow_list_no_bypass_.Matches(kHttpsThirdPartyRequestUrl, - kHttpsSameSiteNak)); - EXPECT_TRUE(allow_list_first_party_bypass_.Matches(kHttpsThirdPartyRequestUrl, - kHttpsSameSiteNak)); + EXPECT_TRUE(allow_list_no_bypass_.Matches( + kHttpsThirdPartyRequestUrl, kHttpsSameSiteNak, MdlType::kIncognito)); + EXPECT_TRUE(allow_list_first_party_bypass_.Matches( + kHttpsThirdPartyRequestUrl, kHttpsSameSiteNak, MdlType::kIncognito)); } TEST_P(MaskedDomainListManagerTest, @@ -389,14 +395,14 @@ const auto kHttpsCrossSiteNak = net::NetworkAnonymizationKey::CreateCrossSite( net::SchemefulSite(kHttpsFirstPartyRequestUrl)); - EXPECT_TRUE(allow_list_no_bypass_.Matches(kHttpsFirstPartyRequestUrl, - kHttpsSameSiteNak)); + EXPECT_TRUE(allow_list_no_bypass_.Matches( + kHttpsFirstPartyRequestUrl, kHttpsSameSiteNak, MdlType::kIncognito)); EXPECT_FALSE(allow_list_first_party_bypass_.Matches( - kHttpsFirstPartyRequestUrl, kHttpsSameSiteNak)); - EXPECT_TRUE(allow_list_no_bypass_.Matches(kHttpsFirstPartyRequestUrl, - kHttpsCrossSiteNak)); + kHttpsFirstPartyRequestUrl, kHttpsSameSiteNak, MdlType::kIncognito)); + EXPECT_TRUE(allow_list_no_bypass_.Matches( + kHttpsFirstPartyRequestUrl, kHttpsCrossSiteNak, MdlType::kIncognito)); EXPECT_FALSE(allow_list_first_party_bypass_.Matches( - kHttpsFirstPartyRequestUrl, kHttpsCrossSiteNak)); + kHttpsFirstPartyRequestUrl, kHttpsCrossSiteNak, MdlType::kIncognito)); } TEST_P(MaskedDomainListManagerTest, @@ -404,9 +410,10 @@ const auto kHttpsRequestUrl = GURL(base::StrCat({"https://", kTestDomain})); const auto kEmptyNak = net::NetworkAnonymizationKey(); - EXPECT_TRUE(allow_list_no_bypass_.Matches(kHttpsRequestUrl, kEmptyNak)); - EXPECT_FALSE( - allow_list_first_party_bypass_.Matches(kHttpsRequestUrl, kEmptyNak)); + EXPECT_TRUE(allow_list_no_bypass_.Matches(kHttpsRequestUrl, kEmptyNak, + MdlType::kIncognito)); + EXPECT_FALSE(allow_list_first_party_bypass_.Matches( + kHttpsRequestUrl, kEmptyNak, MdlType::kIncognito)); } TEST_P(MaskedDomainListManagerTest, @@ -416,10 +423,10 @@ net::SchemefulSite(), /*is_cross_site=*/true, base::UnguessableToken::Create()); - EXPECT_FALSE( - allow_list_no_bypass_.Matches(kHttpsOtherRequestUrl, kNakWithNonce)); - EXPECT_FALSE(allow_list_first_party_bypass_.Matches(kHttpsOtherRequestUrl, - kNakWithNonce)); + EXPECT_FALSE(allow_list_no_bypass_.Matches( + kHttpsOtherRequestUrl, kNakWithNonce, MdlType::kIncognito)); + EXPECT_FALSE(allow_list_first_party_bypass_.Matches( + kHttpsOtherRequestUrl, kNakWithNonce, MdlType::kIncognito)); } TEST_P(MaskedDomainListManagerTest, ShouldMatchWithFencedFrameNakIfUrlMatches) { @@ -428,9 +435,10 @@ net::SchemefulSite(), /*is_cross_site=*/true, base::UnguessableToken::Create()); - EXPECT_TRUE(allow_list_no_bypass_.Matches(kHttpsRequestUrl, kNakWithNonce)); - EXPECT_TRUE( - allow_list_first_party_bypass_.Matches(kHttpsRequestUrl, kNakWithNonce)); + EXPECT_TRUE(allow_list_no_bypass_.Matches(kHttpsRequestUrl, kNakWithNonce, + MdlType::kIncognito)); + EXPECT_TRUE(allow_list_first_party_bypass_.Matches( + kHttpsRequestUrl, kNakWithNonce, MdlType::kIncognito)); } TEST_P(MaskedDomainListManagerTest, CustomSchemeTopLevelSite) { @@ -444,16 +452,16 @@ GURL("chrome-extension://abcdefghijklmnopqrstuvwxyzabcdef/"))); ASSERT_FALSE(kExtensionUrlNak.IsTransient()); - EXPECT_TRUE( - allow_list_no_bypass_.Matches(kHttpsRequestUrl, kExtensionUrlNak)); + EXPECT_TRUE(allow_list_no_bypass_.Matches(kHttpsRequestUrl, kExtensionUrlNak, + MdlType::kIncognito)); { base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitAndEnableFeatureWithParameters( net::features::kEnableIpProtectionProxy, {{net::features::kIpPrivacyRestrictTopLevelSiteSchemes.name, "true"}}); - EXPECT_FALSE(allow_list_first_party_bypass_.Matches(kHttpsRequestUrl, - kExtensionUrlNak)); + EXPECT_FALSE(allow_list_first_party_bypass_.Matches( + kHttpsRequestUrl, kExtensionUrlNak, MdlType::kIncognito)); } { @@ -461,8 +469,8 @@ scoped_feature_list.InitAndEnableFeatureWithParameters( net::features::kEnableIpProtectionProxy, {{net::features::kIpPrivacyRestrictTopLevelSiteSchemes.name, "false"}}); - EXPECT_TRUE(allow_list_first_party_bypass_.Matches(kHttpsRequestUrl, - kExtensionUrlNak)); + EXPECT_TRUE(allow_list_first_party_bypass_.Matches( + kHttpsRequestUrl, kExtensionUrlNak, MdlType::kIncognito)); } } @@ -474,15 +482,16 @@ net::SchemefulSite(GURL("data:text/html,<html></html>"))); ASSERT_TRUE(kDataUrlNak.IsTransient()); - EXPECT_TRUE(allow_list_no_bypass_.Matches(kHttpsRequestUrl, kDataUrlNak)); + EXPECT_TRUE(allow_list_no_bypass_.Matches(kHttpsRequestUrl, kDataUrlNak, + MdlType::kIncognito)); { base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitAndEnableFeatureWithParameters( net::features::kEnableIpProtectionProxy, {{net::features::kIpPrivacyRestrictTopLevelSiteSchemes.name, "true"}}); - EXPECT_FALSE( - allow_list_first_party_bypass_.Matches(kHttpsRequestUrl, kDataUrlNak)); + EXPECT_FALSE(allow_list_first_party_bypass_.Matches( + kHttpsRequestUrl, kDataUrlNak, MdlType::kIncognito)); } { @@ -490,8 +499,8 @@ scoped_feature_list.InitAndEnableFeatureWithParameters( net::features::kEnableIpProtectionProxy, {{net::features::kIpPrivacyRestrictTopLevelSiteSchemes.name, "false"}}); - EXPECT_TRUE( - allow_list_first_party_bypass_.Matches(kHttpsRequestUrl, kDataUrlNak)); + EXPECT_TRUE(allow_list_first_party_bypass_.Matches( + kHttpsRequestUrl, kDataUrlNak, MdlType::kIncognito)); } } @@ -523,10 +532,10 @@ UpdateMaskedDomainList(mdl, mdl_manager); - // The default MDL resource should ONLY match for mdl type kDefault. + // The default MDL resource should ONLY match for mdl type kIncognito. EXPECT_TRUE( mdl_manager.Matches(GURL(base::StrCat({"https://", default_mdl_domain})), - net::NetworkAnonymizationKey(), MdlType::kDefault)); + net::NetworkAnonymizationKey(), MdlType::kIncognito)); EXPECT_FALSE(mdl_manager.Matches( GURL(base::StrCat({"https://", default_mdl_domain})), net::NetworkAnonymizationKey(), MdlType::kRegularBrowsing)); @@ -534,7 +543,7 @@ // The regular MDL resource should ONLY match for mdl type kRegularBrowsing. EXPECT_FALSE( mdl_manager.Matches(GURL(base::StrCat({"https://", regular_mdl_domain})), - net::NetworkAnonymizationKey(), MdlType::kDefault)); + net::NetworkAnonymizationKey(), MdlType::kIncognito)); EXPECT_TRUE(mdl_manager.Matches( GURL(base::StrCat({"https://", regular_mdl_domain})), net::NetworkAnonymizationKey(), MdlType::kRegularBrowsing)); @@ -599,11 +608,12 @@ net::NetworkAnonymizationKey::CreateCrossSite( net::SchemefulSite(GURL(base::StrCat({"https://", match_test.top})))); - EXPECT_EQ(match_test.matches, allow_list_no_bypass.Matches( - request_url, network_anonymization_key)); + EXPECT_EQ(match_test.matches, + allow_list_no_bypass.Matches(request_url, network_anonymization_key, + MdlType::kIncognito)); EXPECT_EQ(match_test.matches_with_bypass, - allow_list_first_party_bypass.Matches(request_url, - network_anonymization_key)); + allow_list_first_party_bypass.Matches( + request_url, network_anonymization_key, MdlType::kIncognito)); } INSTANTIATE_TEST_SUITE_P( @@ -680,19 +690,24 @@ // excluded. for (auto const& [domain, subdomains] : tld_map_with_domains) { EXPECT_TRUE(mdl_manager.Matches(GURL(base::StrCat({"https://", domain})), - net::NetworkAnonymizationKey())); + net::NetworkAnonymizationKey(), + MdlType::kIncognito)); EXPECT_TRUE(mdl_manager.Matches(GURL(base::StrCat({"wss://", domain})), - net::NetworkAnonymizationKey())); + net::NetworkAnonymizationKey(), + MdlType::kIncognito)); EXPECT_TRUE(mdl_manager.Matches(GURL(base::StrCat({"ws://", domain})), - net::NetworkAnonymizationKey())); + net::NetworkAnonymizationKey(), + MdlType::kIncognito)); for (auto const& subdomain : subdomains) { - EXPECT_TRUE( - mdl_manager.Matches(GURL(base::StrCat({"https://", subdomain})), - net::NetworkAnonymizationKey())); + EXPECT_TRUE(mdl_manager.Matches( + GURL(base::StrCat({"https://", subdomain})), + net::NetworkAnonymizationKey(), MdlType::kIncognito)); EXPECT_TRUE(mdl_manager.Matches(GURL(base::StrCat({"wss://", subdomain})), - net::NetworkAnonymizationKey())); + net::NetworkAnonymizationKey(), + MdlType::kIncognito)); EXPECT_TRUE(mdl_manager.Matches(GURL(base::StrCat({"ws://", subdomain})), - net::NetworkAnonymizationKey())); + net::NetworkAnonymizationKey(), + MdlType::kIncognito)); } } @@ -705,13 +720,14 @@ net::NetworkAnonymizationKey nak; // If the domain is excluded, it should not be matched on and vice versa. - EXPECT_EQ(should_match, mdl_manager.Matches( - GURL(base::StrCat({"https://", domain})), nak)); + EXPECT_EQ(should_match, + mdl_manager.Matches(GURL(base::StrCat({"https://", domain})), nak, + MdlType::kIncognito)); for (auto const& subdomain : subdomains) { EXPECT_EQ(should_match, mdl_manager.Matches(GURL(base::StrCat({"https://", subdomain})), - nak)); + nak, MdlType::kIncognito)); } } }
diff --git a/components/ip_protection/common/url_matcher_with_bypass.h b/components/ip_protection/common/url_matcher_with_bypass.h index b8ab0a3..ae6dd4d 100644 --- a/components/ip_protection/common/url_matcher_with_bypass.h +++ b/components/ip_protection/common/url_matcher_with_bypass.h
@@ -57,7 +57,7 @@ UrlMatcherWithBypassResult Matches( const GURL& resource_url, const std::optional<net::SchemefulSite>& top_frame_site, - MdlType mdl_type = MdlType::kDefault, + MdlType mdl_type, bool skip_bypass_check = false) const; // Builds a matcher to match to the public suffix list domains.
diff --git a/components/ip_protection/common/url_matcher_with_bypass_unittest.cc b/components/ip_protection/common/url_matcher_with_bypass_unittest.cc index ed2c7d12c..7a282ace 100644 --- a/components/ip_protection/common/url_matcher_with_bypass_unittest.cc +++ b/components/ip_protection/common/url_matcher_with_bypass_unittest.cc
@@ -56,10 +56,11 @@ // The resource is in the default group, so it should match when matching for // that group. - EXPECT_EQ(matcher.Matches(GURL("http://example.com"), - /*top_frame_site=*/std::nullopt, MdlType::kDefault, - /*skip_bypass_check=*/true), - UrlMatcherWithBypassResult::kMatchAndNoBypass); + EXPECT_EQ( + matcher.Matches(GURL("http://example.com"), + /*top_frame_site=*/std::nullopt, MdlType::kIncognito, + /*skip_bypass_check=*/true), + UrlMatcherWithBypassResult::kMatchAndNoBypass); } TEST_F(UrlMatcherWithBypassTest, MatchesDefaultGroupExcluded) { @@ -78,10 +79,11 @@ // The resource is not in the default group, so it should not match when // matching for the default group. - EXPECT_EQ(matcher.Matches(GURL("http://example.com"), - /*top_frame_site=*/std::nullopt, MdlType::kDefault, - /*skip_bypass_check=*/true), - UrlMatcherWithBypassResult::kNoMatch); + EXPECT_EQ( + matcher.Matches(GURL("http://example.com"), + /*top_frame_site=*/std::nullopt, MdlType::kIncognito, + /*skip_bypass_check=*/true), + UrlMatcherWithBypassResult::kNoMatch); // The resource is in the regular browsing group, so it should match when // matching for that group. @@ -107,10 +109,11 @@ // The resource is in the default group, so it should match when matching for // that group. - EXPECT_EQ(matcher.Matches(GURL("http://example.com"), - /*top_frame_site=*/std::nullopt, MdlType::kDefault, - /*skip_bypass_check=*/true), - UrlMatcherWithBypassResult::kMatchAndNoBypass); + EXPECT_EQ( + matcher.Matches(GURL("http://example.com"), + /*top_frame_site=*/std::nullopt, MdlType::kIncognito, + /*skip_bypass_check=*/true), + UrlMatcherWithBypassResult::kMatchAndNoBypass); // The resource is in the regular browsing group, so it should match when // matching for that group. @@ -136,10 +139,11 @@ // The resource is not in any MDL type, so it should not match when matching // for any MDL type. GURL resource_url("http://example.com"); - EXPECT_EQ(matcher.Matches(resource_url, - /*top_frame_site=*/std::nullopt, MdlType::kDefault, - /*skip_bypass_check=*/true), - UrlMatcherWithBypassResult::kNoMatch); + EXPECT_EQ( + matcher.Matches(resource_url, + /*top_frame_site=*/std::nullopt, MdlType::kIncognito, + /*skip_bypass_check=*/true), + UrlMatcherWithBypassResult::kNoMatch); EXPECT_EQ(matcher.Matches(resource_url, /*top_frame_site=*/std::nullopt, @@ -208,10 +212,11 @@ matcher.AddRules(resource_owner, /*excluded_domains=*/{}, /*create_bypass_matcher=*/false); - EXPECT_EQ(matcher.Matches(GURL("http://example.com"), - /*top_frame_site=*/std::nullopt, MdlType::kDefault, - /*skip_bypass_check=*/true), - UrlMatcherWithBypassResult::kMatchAndNoBypass); + EXPECT_EQ( + matcher.Matches(GURL("http://example.com"), + /*top_frame_site=*/std::nullopt, MdlType::kIncognito, + /*skip_bypass_check=*/true), + UrlMatcherWithBypassResult::kMatchAndNoBypass); } TEST_F(UrlMatcherWithBypassTest, @@ -228,7 +233,7 @@ EXPECT_EQ(matcher.Matches(GURL("http://example.com"), net::SchemefulSite(GURL("http://top.frame.com")), - MdlType::kDefault, + MdlType::kIncognito, /*skip_bypass_check=*/false), UrlMatcherWithBypassResult::kMatchAndNoBypass); } @@ -259,7 +264,7 @@ // test.com rule. EXPECT_EQ(matcher.Matches(GURL("https://test.com"), net::SchemefulSite(GURL("https://a.com")), - MdlType::kDefault, + MdlType::kIncognito, /*skip_bypass_check=*/false), UrlMatcherWithBypassResult::kMatchAndBypass); @@ -268,7 +273,7 @@ // b.com since it's a more specific domain that that should have a rule. EXPECT_EQ(matcher.Matches(GURL("https://sub.test.com"), net::SchemefulSite(GURL("https://b.com")), - MdlType::kDefault, + MdlType::kIncognito, /*skip_bypass_check=*/false), UrlMatcherWithBypassResult::kMatchAndBypass); @@ -276,7 +281,7 @@ // its own matcher, it matches to the a.com *.test.com rule. EXPECT_EQ(matcher.Matches(GURL("https://ssub.test.com"), net::SchemefulSite(GURL("https://a.com")), - MdlType::kDefault, + MdlType::kIncognito, /*skip_bypass_check=*/false), UrlMatcherWithBypassResult::kMatchAndBypass); } @@ -309,7 +314,7 @@ // match the test.com rule. EXPECT_EQ(matcher.Matches(GURL("https://abtesting.com"), net::SchemefulSite(GURL("https://a.com")), - MdlType::kDefault, + MdlType::kIncognito, /*skip_bypass_check=*/false), UrlMatcherWithBypassResult::kMatchAndBypass); @@ -319,7 +324,7 @@ // containing "test.com" being first (due to "abtesting.com"). EXPECT_EQ(matcher.Matches(GURL("https://sub.test.com"), net::SchemefulSite(GURL("https://b.com")), - MdlType::kDefault, + MdlType::kIncognito, /*skip_bypass_check=*/false), UrlMatcherWithBypassResult::kMatchAndBypass); } @@ -353,8 +358,9 @@ const MatchTest& p = GetParam(); GURL request_url(base::StrCat({"https://", p.req})); net::SchemefulSite top_frame_site(GURL(base::StrCat({"https://", p.top}))); - EXPECT_EQ(p.result, matcher.Matches(request_url, top_frame_site, - MdlType::kDefault, p.skip_bypass_check)); + EXPECT_EQ(p.result, + matcher.Matches(request_url, top_frame_site, MdlType::kIncognito, + p.skip_bypass_check)); } const std::vector<MatchTest> kMatchTests = {
diff --git a/components/leveldb_proto/public/shared_proto_database_client_list.cc b/components/leveldb_proto/public/shared_proto_database_client_list.cc index ec661876..39a101db 100644 --- a/components/leveldb_proto/public/shared_proto_database_client_list.cc +++ b/components/leveldb_proto/public/shared_proto_database_client_list.cc
@@ -129,6 +129,8 @@ return "CommerceParcelTrackingDatabase"; case ProtoDbType::CLIENT_CERTIFICATES_DATABASE: return "ClientCertificatesDatabase"; + case ProtoDbType::AUTOFILL_AI_MODEL_CACHE: + return "AutofillAiModelCache"; case ProtoDbType::LAST: NOTREACHED(); }
diff --git a/components/leveldb_proto/public/shared_proto_database_client_list.h b/components/leveldb_proto/public/shared_proto_database_client_list.h index b138a2c..2985510 100644 --- a/components/leveldb_proto/public/shared_proto_database_client_list.h +++ b/components/leveldb_proto/public/shared_proto_database_client_list.h
@@ -75,6 +75,7 @@ DISCOUNTS_DATABASE = 48, COMMERCE_PARCEL_TRACKING_DATABASE = 49, CLIENT_CERTIFICATES_DATABASE = 50, + AUTOFILL_AI_MODEL_CACHE = 51, LAST, };
diff --git a/components/omnibox/browser/featured_search_provider.cc b/components/omnibox/browser/featured_search_provider.cc index 6248df3..d562b8b 100644 --- a/components/omnibox/browser/featured_search_provider.cc +++ b/components/omnibox/browser/featured_search_provider.cc
@@ -205,8 +205,10 @@ turl->is_active() == TemplateURLData::ActiveStatus::kTrue) { // Don't add the expanded set of starter pack engines unless the feature // is enabled. - if (!OmniboxFieldTrial::IsStarterPackExpansionEnabled() && - turl->starter_pack_id() > TemplateURLStarterPackData::kTabs) { + if ((turl->starter_pack_id() == TemplateURLStarterPackData::kGemini && + !OmniboxFieldTrial::IsStarterPackExpansionEnabled()) || + (turl->starter_pack_id() == TemplateURLStarterPackData::kPage && + !OmniboxFieldTrial::IsStarterPackPageEnabled())) { continue; } AddStarterPackMatch(*turl, input);
diff --git a/components/omnibox/browser/featured_search_provider_unittest.cc b/components/omnibox/browser/featured_search_provider_unittest.cc index 47d033c..02e2058 100644 --- a/components/omnibox/browser/featured_search_provider_unittest.cc +++ b/components/omnibox/browser/featured_search_provider_unittest.cc
@@ -55,6 +55,7 @@ const std::string kHistoryUrl = TemplateURLStarterPackData::history.destination_url; const std::string kTabsUrl = TemplateURLStarterPackData::tabs.destination_url; +const std::string kPageUrl = TemplateURLStarterPackData::page.destination_url; const std::string kGeminiUrl = TemplateURLStarterPackData::Gemini.destination_url; @@ -295,7 +296,8 @@ TEST_F(FeaturedSearchProviderTest, StarterPackExpansionRelevance) { base::test::ScopedFeatureList features; - features.InitAndEnableFeature(omnibox::kStarterPackExpansion); + features.InitWithFeatures( + {omnibox::kStarterPackExpansion, omnibox::kStarterPackPage}, {}); AddStarterPackEntriesToTemplateUrlService(); @@ -318,6 +320,7 @@ kGeminiUrl, kBookmarksUrl, kHistoryUrl, + kPageUrl, kTabsUrl, }); for (size_t i = 0; i < matches.size(); i++) {
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc index 916d6fa..cf680a8 100644 --- a/components/omnibox/browser/omnibox_field_trial.cc +++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -1145,6 +1145,10 @@ bool IsStarterPackIPHEnabled() { return base::FeatureList::IsEnabled(omnibox::kStarterPackIPH); } + +bool IsStarterPackPageEnabled() { + return base::FeatureList::IsEnabled(omnibox::kStarterPackPage); +} // <- Site Search Starter Pack } // namespace OmniboxFieldTrial
diff --git a/components/omnibox/browser/omnibox_field_trial.h b/components/omnibox/browser/omnibox_field_trial.h index 7aed430f..296219c 100644 --- a/components/omnibox/browser/omnibox_field_trial.h +++ b/components/omnibox/browser/omnibox_field_trial.h
@@ -743,13 +743,17 @@ // DB or TemplateURLService's copy of the URL. extern const base::FeatureParam<std::string> kGeminiUrlOverride; -// Whether the expansion pack for the site search starter pack is enabled. +// Whether the expansion pack (the StarterPackID::kGemini keyword/engine) for +// the site search starter pack is enabled. bool IsStarterPackExpansionEnabled(); // When true, enables an informational IPH message at the bottom of the Omnibox // directing users to certain starter pack engines. bool IsStarterPackIPHEnabled(); +// Whether the starter pack page scope is enabled. +bool IsStarterPackPageEnabled(); + // <- Site Search Starter Pack // --------------------------------------------------------- // Android Hub Search -->
diff --git a/components/omnibox/common/omnibox_features.cc b/components/omnibox/common/omnibox_features.cc index 7920eee..b3c9608 100644 --- a/components/omnibox/common/omnibox_features.cc +++ b/components/omnibox/common/omnibox_features.cc
@@ -320,6 +320,9 @@ // users to certain starter pack engines. BASE_FEATURE(kStarterPackIPH, "StarterPackIPH", DISABLED); +// Enables the @page starter pack scope. +BASE_FEATURE(kStarterPackPage, "StarterPackPage", DISABLED); + // If enabled, |SearchProvider| will not function in Zero Suggest. BASE_FEATURE(kAblateSearchProviderWarmup, "AblateSearchProviderWarmup",
diff --git a/components/omnibox/common/omnibox_features.h b/components/omnibox/common/omnibox_features.h index 037892e..54c7f99 100644 --- a/components/omnibox/common/omnibox_features.h +++ b/components/omnibox/common/omnibox_features.h
@@ -115,6 +115,7 @@ // Site search/Keyword mode related features. BASE_DECLARE_FEATURE(kStarterPackExpansion); BASE_DECLARE_FEATURE(kStarterPackIPH); +BASE_DECLARE_FEATURE(kStarterPackPage); // Search and Suggest requests and params. BASE_DECLARE_FEATURE(kAblateSearchProviderWarmup);
diff --git a/components/omnibox_strings.grdp b/components/omnibox_strings.grdp index d3bb3c8..30cf0e71 100644 --- a/components/omnibox_strings.grdp +++ b/components/omnibox_strings.grdp
@@ -328,6 +328,12 @@ <message name="IDS_SEARCH_ENGINES_STARTER_PACK_GEMINI_KEYWORD" desc = "The keyword required to trigger Ask Gemini in keyword mode. This will be prepended with an '@'."> Gemini </message> + <message name="IDS_SEARCH_ENGINES_STARTER_PACK_PAGE_NAME" desc = "The name of the search engine to search with the current page context as it appears on chrome://settings/searchEngines." translateable="false"> + Page + </message> + <message name="IDS_SEARCH_ENGINES_STARTER_PACK_PAGE_KEYWORD" desc = "The keyword required to trigger page context search in keyword mode. This will be prepended with an '@'." translateable="false"> + Page + </message> <message name="IDS_OMNIBOX_INSTANT_KEYWORD_ASK_TEXT" desc="Text shown in an omnibox suggestion ready for instant keyword search when the destination is suitable for asking. For example, starter pack suggestions like @gemini will Ask Gemini."> <ph name="KEYWORD">$1<ex>@gemini</ex></ph> - Ask <ph name="KEYWORD_SHORT_NAME">$2<ex>Gemini</ex></ph> </message>
diff --git a/components/optimization_guide/proto/model_quality_service.proto b/components/optimization_guide/proto/model_quality_service.proto index e24fbd5..b3cae77 100644 --- a/components/optimization_guide/proto/model_quality_service.proto +++ b/components/optimization_guide/proto/model_quality_service.proto
@@ -14,6 +14,7 @@ import "components/optimization_guide/proto/model_quality_metadata.proto"; import "components/optimization_guide/proto/features/compose.proto"; import "components/optimization_guide/proto/features/default.proto"; +import "components/optimization_guide/proto/features/enhanced_calendar.proto"; import "components/optimization_guide/proto/features/forms_annotations.proto"; import "components/optimization_guide/proto/features/forms_classifications.proto"; import "components/optimization_guide/proto/features/forms_predictions.proto"; @@ -73,6 +74,8 @@ NotificationContentDetectionLoggingData notification_content_detection = 20; + EnhancedCalendarLoggingData enhanced_calendar = 21; + DefaultLoggingData default = 1000; } }
diff --git a/components/password_manager/core/browser/features/password_features.cc b/components/password_manager/core/browser/features/password_features.cc index 666cfac..4d2e1c5 100644 --- a/components/password_manager/core/browser/features/password_features.cc +++ b/components/password_manager/core/browser/features/password_features.cc
@@ -50,7 +50,7 @@ #if BUILDFLAG(IS_ANDROID) BASE_FEATURE(kFetchGaiaHashOnSignIn, "FetchGaiaHashOnSignIn", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); #endif BASE_FEATURE(kFillOnAccountSelect,
diff --git a/components/performance_manager/features.cc b/components/performance_manager/features.cc index a08853c..b517611 100644 --- a/components/performance_manager/features.cc +++ b/components/performance_manager/features.cc
@@ -54,18 +54,10 @@ &kPerformanceControlsBatteryPerformanceSurvey, "battery_lookback", base::Days(8)}; -BASE_FEATURE(kPerformanceInterventionUI, - "PerformanceInterventionUI", - base::FEATURE_ENABLED_BY_DEFAULT); - BASE_FEATURE(kPerformanceInterventionDemoMode, "PerformanceInterventionDemoMode", base::FEATURE_DISABLED_BY_DEFAULT); -bool ShouldUsePerformanceInterventionBackend() { - return base::FeatureList::IsEnabled(kPerformanceInterventionUI); -} - #if BUILDFLAG(IS_CHROMEOS) BASE_FEATURE(kUnthrottledTabProcessReporting, "UnthrottledTabProcessReporting",
diff --git a/components/performance_manager/public/features.h b/components/performance_manager/public/features.h index c78530e80..03c5c924 100644 --- a/components/performance_manager/public/features.h +++ b/components/performance_manager/public/features.h
@@ -61,21 +61,11 @@ extern const base::FeatureParam<base::TimeDelta> kPerformanceControlsBatterySurveyLookback; -// Round 3 Performance Controls features - -// This enables the performance detection backend. -BASE_DECLARE_FEATURE(kPerformanceIntervention); - -// This enables the performance intervention UI -BASE_DECLARE_FEATURE(kPerformanceInterventionUI); - // This enables performance intervention to run in demo mode. While in demo // mode, performance intervention will ignore rate throttling and CPU thresholds // to make it easier to trigger performance intervention for testing purposes. BASE_DECLARE_FEATURE(kPerformanceInterventionDemoMode); -bool ShouldUsePerformanceInterventionBackend(); - #endif BASE_DECLARE_FEATURE(kPMProcessPriorityPolicy);
diff --git a/components/permissions/permission_context_base.cc b/components/permissions/permission_context_base.cc index 4e3094e..26b8fc7 100644 --- a/components/permissions/permission_context_base.cc +++ b/components/permissions/permission_context_base.cc
@@ -110,8 +110,7 @@ request_data .WithRequestingOrigin( request_data.requesting_origin.DeprecatedGetOriginAsURL()) - .WithEmbeddingOrigin( - PermissionUtil::GetLastCommittedOriginAsURL(rfh->GetMainFrame())); + .WithEmbeddingOrigin(GetEffectiveEmbedderOrigin(rfh)); if (!request_data.requesting_origin.is_valid() || !request_data.embedding_origin.is_valid()) { @@ -267,6 +266,11 @@ return request->second.first.get(); } +GURL PermissionContextBase::GetEffectiveEmbedderOrigin( + content::RenderFrameHost* rfh) const { + return PermissionUtil::GetLastCommittedOriginAsURL(rfh->GetMainFrame()); +} + content::PermissionResult PermissionContextBase::GetPermissionStatus( content::RenderFrameHost* render_frame_host, const GURL& requesting_origin,
diff --git a/components/permissions/permission_context_base.h b/components/permissions/permission_context_base.h index e0e8783..b374443 100644 --- a/components/permissions/permission_context_base.h +++ b/components/permissions/permission_context_base.h
@@ -225,6 +225,10 @@ const PermissionRequest* FindPermissionRequest( const PermissionRequestID& id) const; + // Implementors can override this method to use a different embedding origin. + // TODO(crbug.com/40220500): This should return a url::Origin instead. + virtual GURL GetEffectiveEmbedderOrigin(content::RenderFrameHost* rfh) const; + base::ObserverList<permissions::Observer> permission_observers_; // Set by subclasses to inform the base class that they will handle adding
diff --git a/components/privacy_sandbox/privacy_sandbox_features.cc b/components/privacy_sandbox/privacy_sandbox_features.cc index 5a7503fc..f3587ca0 100644 --- a/components/privacy_sandbox/privacy_sandbox_features.cc +++ b/components/privacy_sandbox/privacy_sandbox_features.cc
@@ -215,10 +215,6 @@ "PrivacySandboxAdTopicsContentParity", base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kPrivacySandboxMigratePrefsToNoticeConsentDataModel, - "PrivacySandboxMigratePrefsToNoticeConsentDataModel", - base::FEATURE_DISABLED_BY_DEFAULT); - BASE_FEATURE(kPrivacySandboxPrivacyPolicy, "PrivacySandboxPrivacyPolicy", base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/components/privacy_sandbox/privacy_sandbox_features.h b/components/privacy_sandbox/privacy_sandbox_features.h index 01eaaef..46bfa408 100644 --- a/components/privacy_sandbox/privacy_sandbox_features.h +++ b/components/privacy_sandbox/privacy_sandbox_features.h
@@ -242,9 +242,6 @@ COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) BASE_DECLARE_FEATURE(kPrivacySandboxAdTopicsContentParity); -COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) -BASE_DECLARE_FEATURE(kPrivacySandboxMigratePrefsToNoticeConsentDataModel); - // If true, provides a link to the Privacy Policy on the Topics Consent notice. COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) BASE_DECLARE_FEATURE(kPrivacySandboxPrivacyPolicy);
diff --git a/components/privacy_sandbox/privacy_sandbox_notice_storage.cc b/components/privacy_sandbox/privacy_sandbox_notice_storage.cc index 2ad23c0..88941cdb 100644 --- a/components/privacy_sandbox/privacy_sandbox_notice_storage.cc +++ b/components/privacy_sandbox/privacy_sandbox_notice_storage.cc
@@ -78,13 +78,12 @@ switch (action) { case NoticeActionTaken::kNotSet: case NoticeActionTaken::kUnknownActionPreMigration: + case NoticeActionTaken::kLearnMore_Deprecated: return ""; case NoticeActionTaken::kAck: return "Ack"; case NoticeActionTaken::kClosed: return "Closed"; - case NoticeActionTaken::kLearnMore: - return "LearnMore"; case NoticeActionTaken::kOptIn: return "OptIn"; case NoticeActionTaken::kOptOut: @@ -269,7 +268,7 @@ switch (action) { case NoticeActionTaken::kNotSet: case NoticeActionTaken::kUnknownActionPreMigration: - case NoticeActionTaken::kLearnMore: + case NoticeActionTaken::kLearnMore_Deprecated: case NoticeActionTaken::kOther: return std::nullopt; case NoticeActionTaken::kAck: @@ -359,7 +358,7 @@ } else { // Notice has been shown, action handling below. switch (notice_data->notice_action_taken_) { case NoticeActionTaken::kNotSet: - case NoticeActionTaken::kLearnMore: + case NoticeActionTaken::kLearnMore_Deprecated: startup_state = NoticeStartupState::kPromptWaiting; break; case NoticeActionTaken::kOptIn: @@ -493,6 +492,9 @@ NoticeActionTaken notice_action_taken, base::Time notice_action_taken_time) { CheckNoticeNameEligibility(notice); + // TODO(crbug.com/392088228): Remove once migration is complete. + CHECK(notice_action_taken != NoticeActionTaken::kLearnMore_Deprecated) + << "kLearnMore_Deprecated action is deprecated and should not be used."; ScopedDictPrefUpdate update(pref_service, kPrivacySandboxNoticeDataPath); auto notice_data = ReadNoticeData(pref_service, notice); @@ -521,12 +523,6 @@ base::StrCat({"PrivacySandbox.Notice.NoticeAction.", notice}), notice_action_taken); - // Don't store LearnMore action in prefs since this doesn't affect the prompt - // flow. - if (notice_action_taken == NoticeActionTaken::kLearnMore) { - return; - } - update.Get().SetByDottedPath( CreatePrefPath(notice, kPrivacySandboxNoticeActionTaken), static_cast<int>(notice_action_taken));
diff --git a/components/privacy_sandbox/privacy_sandbox_notice_storage.h b/components/privacy_sandbox/privacy_sandbox_notice_storage.h index 38ad620..b0a2683 100644 --- a/components/privacy_sandbox/privacy_sandbox_notice_storage.h +++ b/components/privacy_sandbox/privacy_sandbox_notice_storage.h
@@ -16,7 +16,8 @@ namespace privacy_sandbox { -// Startup states +// Startup states. These values are persisted to logs. Entries should not be +// renumbered and numeric values should never be reused. // LINT.IfChange(NoticeStartupState) enum class NoticeStartupState { // Incorrect or unknown states, for example if the notice hasn't been shown @@ -41,7 +42,8 @@ }; // LINT.ThenChange(//tools/metrics/histograms/enums.xml:PrivacySandboxNoticeStartupState) -// Different notice actions. +// Different notice actions. These values are persisted to logs. Entries should +// not be renumbered and numeric values should never be reused. // LINT.IfChange(NoticeActionTaken) enum class NoticeActionTaken { // No Ack action set. @@ -50,8 +52,8 @@ kAck = 1, // Action taken clicking the 'x' button. kClosed = 2, - // Action taken clicking the learn more button. - kLearnMore = 3, + // TODO(crbug.com/392088228): In the process of deprecating, do not use. + kLearnMore_Deprecated = 3, // Opted in/Consented to the notice using 'Turn it on' or some other form of // explicit consent. kOptIn = 4, @@ -93,7 +95,8 @@ kMaxValue = kTimedOut, }; -// Different notice action outcomes. +// Different notice action outcomes. These values are persisted to logs. Entries +// should not be renumbered and numeric values should never be reused. // LINT.IfChange(NoticeActionBehavior) enum class NoticeActionBehavior { // Action taken on notice set successfully.
diff --git a/components/privacy_sandbox/privacy_sandbox_notice_storage_unittest.cc b/components/privacy_sandbox/privacy_sandbox_notice_storage_unittest.cc index 34dcdec..e32fe69 100644 --- a/components/privacy_sandbox/privacy_sandbox_notice_storage_unittest.cc +++ b/components/privacy_sandbox/privacy_sandbox_notice_storage_unittest.cc
@@ -84,13 +84,12 @@ switch (action) { case NoticeActionTaken::kNotSet: case NoticeActionTaken::kUnknownActionPreMigration: + case NoticeActionTaken::kLearnMore_Deprecated: return ""; case NoticeActionTaken::kAck: return "Ack"; case NoticeActionTaken::kClosed: return "Closed"; - case NoticeActionTaken::kLearnMore: - return "LearnMore"; case NoticeActionTaken::kOptIn: return "OptIn"; case NoticeActionTaken::kOptOut: @@ -281,11 +280,11 @@ // Tries to override action, should not override and emits histograms. notice_storage()->SetNoticeActionTaken( - prefs(), notice_name, NoticeActionTaken::kLearnMore, base::Time::Now()); + prefs(), notice_name, NoticeActionTaken::kSettings, base::Time::Now()); EXPECT_EQ(NoticeActionTaken::kAck, actual->notice_action_taken_); histogram_tester_.ExpectBucketCount( "PrivacySandbox.Notice.NoticeAction.TopicsConsentDesktopModal", - NoticeActionTaken::kLearnMore, 0); + NoticeActionTaken::kSettings, 0); histogram_tester_.ExpectBucketCount( "PrivacySandbox.Notice.NoticeActionTakenBehavior." "TopicsConsentDesktopModal", @@ -630,7 +629,7 @@ {NoticeActionTaken::kNotSet, std::nullopt}, {NoticeActionTaken::kAck, NoticeEvent::kAck}, {NoticeActionTaken::kClosed, NoticeEvent::kClosed}, - {NoticeActionTaken::kLearnMore, std::nullopt}, + {NoticeActionTaken::kLearnMore_Deprecated, std::nullopt}, {NoticeActionTaken::kOptIn, NoticeEvent::kOptIn}, {NoticeActionTaken::kOptOut, NoticeEvent::kOptOut}, {NoticeActionTaken::kOther, std::nullopt},
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h index 95d1f83..334ad23 100644 --- a/components/search_engines/search_engine_type.h +++ b/components/search_engines/search_engine_type.h
@@ -92,6 +92,7 @@ SEARCH_ENGINE_STARTER_PACK_GEMINI = 73, SEARCH_ENGINE_LILO = 74, SEARCH_ENGINE_STARTPAGE = 75, + SEARCH_ENGINE_STARTER_PACK_PAGE = 76, SEARCH_ENGINE_MAX // Bounding value needed for UMA histogram macro. }; @@ -106,6 +107,7 @@ KEYWORD_MODE_STARTER_PACK_HISTORY = 3, KEYWORD_MODE_STARTER_PACK_TABS = 4, KEYWORD_MODE_STARTER_PACK_GEMINI = 5, + KEYWORD_MODE_STARTER_PACK_PAGE = 6, KEYWORD_MODE_ENGINE_TYPE_MAX // Bounding value needed for UMA histogram // macro.
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc index dff1202c..0b45429 100644 --- a/components/search_engines/template_url.cc +++ b/components/search_engines/template_url.cc
@@ -1828,6 +1828,8 @@ return KEYWORD_MODE_STARTER_PACK_TABS; case TemplateURLStarterPackData::kGemini: return KEYWORD_MODE_STARTER_PACK_GEMINI; + case TemplateURLStarterPackData::kPage: + return KEYWORD_MODE_STARTER_PACK_PAGE; default: // In theory, this code path should never be reached. However, it's // possible that when expanding the starter pack, a new entry may
diff --git a/components/search_engines/template_url_starter_pack_data.cc b/components/search_engines/template_url_starter_pack_data.cc index cdcc0dff..6f0da96 100644 --- a/components/search_engines/template_url_starter_pack_data.cc +++ b/components/search_engines/template_url_starter_pack_data.cc
@@ -5,6 +5,7 @@ #include "components/search_engines/template_url_starter_pack_data.h" #include "base/strings/utf_string_conversions.h" +#include "components/omnibox/common/omnibox_features.h" #include "components/search_engines/search_engine_type.h" #include "components/search_engines/template_url_data.h" #include "components/search_engines/template_url_data_util.h" @@ -14,7 +15,7 @@ namespace TemplateURLStarterPackData { // Update this whenever a change is made to any starter pack data. -const int kCurrentDataVersion = 11; +const int kCurrentDataVersion = 12; // Only update this if there's an incompatible change that requires force // updating the user's starter pack data. This will overwrite any of the @@ -64,11 +65,18 @@ .type = SEARCH_ENGINE_STARTER_PACK_GEMINI, }; +const StarterPackEngine page = { + .name_message_id = IDS_SEARCH_ENGINES_STARTER_PACK_PAGE_NAME, + .keyword_message_id = IDS_SEARCH_ENGINES_STARTER_PACK_PAGE_KEYWORD, + .favicon_url = nullptr, + .search_url = "chrome://page/?q={searchTerms}", + .destination_url = "chrome://page", + .id = StarterPackID::kPage, + .type = SEARCH_ENGINE_STARTER_PACK_PAGE, +}; + const StarterPackEngine* engines[] = { - &bookmarks, - &history, - &tabs, - &Gemini, + &bookmarks, &history, &tabs, &Gemini, &page, }; int GetDataVersion() {
diff --git a/components/search_engines/template_url_starter_pack_data.h b/components/search_engines/template_url_starter_pack_data.h index bbb33f5..6b393b7 100644 --- a/components/search_engines/template_url_starter_pack_data.h +++ b/components/search_engines/template_url_starter_pack_data.h
@@ -26,6 +26,7 @@ kHistory = 2, kTabs = 3, kGemini = 4, + kPage = 5, kMaxStarterPackID } StarterPackID; @@ -48,6 +49,7 @@ extern const StarterPackEngine history; extern const StarterPackEngine tabs; extern const StarterPackEngine Gemini; +extern const StarterPackEngine page; // Returns the current version of the starterpack data, so callers can know when // they need to re-merge.
diff --git a/components/services/storage/dom_storage/features.cc b/components/services/storage/dom_storage/features.cc index f093685..290d84f 100644 --- a/components/services/storage/dom_storage/features.cc +++ b/components/services/storage/dom_storage/features.cc
@@ -10,12 +10,4 @@ "CoalesceStorageAreaCommits", base::FEATURE_ENABLED_BY_DEFAULT); -BASE_FEATURE(kDeleteOrphanLocalStorageOnStartup, - "DeleteOrphanLocalStorageOnStartup", - base::FEATURE_ENABLED_BY_DEFAULT); - -BASE_FEATURE(kDeleteStaleLocalStorageOnStartup, - "DeleteStaleLocalStorageOnStartup", - base::FEATURE_ENABLED_BY_DEFAULT); - } // namespace storage
diff --git a/components/services/storage/dom_storage/features.h b/components/services/storage/dom_storage/features.h index 78b5304..f42fc5a 100644 --- a/components/services/storage/dom_storage/features.h +++ b/components/services/storage/dom_storage/features.h
@@ -11,15 +11,6 @@ BASE_DECLARE_FEATURE(kCoalesceStorageAreaCommits); -// Clears local storage for opaque origins used in prior browsing sessions as -// they will no longer be reachable. See crbug.com/40281870 for more info. -// If kDeleteStaleLocalStorageOnStartup is off this has no impact. -BASE_DECLARE_FEATURE(kDeleteOrphanLocalStorageOnStartup); - -// Clears local storage last accessed/modified more than 400 days ago on -// startup. See crbug.com/40281870 for more info. -BASE_DECLARE_FEATURE(kDeleteStaleLocalStorageOnStartup); - } // namespace storage #endif // COMPONENTS_SERVICES_STORAGE_DOM_STORAGE_FEATURES_H_
diff --git a/components/services/storage/dom_storage/local_storage_impl.cc b/components/services/storage/dom_storage/local_storage_impl.cc index b903146..8f4ca9f 100644 --- a/components/services/storage/dom_storage/local_storage_impl.cc +++ b/components/services/storage/dom_storage/local_storage_impl.cc
@@ -724,9 +724,8 @@ tried_to_recreate_during_open_ = false; // Clear stale storage areas after a delay to prevent blocking session - // restoration. See crbug.com/40281870 for more info. - if (database_ && !in_memory_ && - base::FeatureList::IsEnabled(kDeleteStaleLocalStorageOnStartup)) { + // restoration. + if (database_ && !in_memory_) { base::SequencedTaskRunner::GetCurrentDefault()->PostDelayedTask( FROM_HERE, base::BindOnce(&LocalStorageImpl::DeleteStaleStorageAreas, @@ -1041,9 +1040,7 @@ // If the storage area has not been accessed or modified within 400 days // it can be cleared. stale_storage_keys.push_back(storage_key); - } else if (base::FeatureList::IsEnabled( - kDeleteOrphanLocalStorageOnStartup) && - (storage_key.nonce().has_value() || + } else if ((storage_key.nonce().has_value() || storage_key.top_level_site().opaque()) && (base::Time::Now() - accessed_or_modified_time) >= base::Days(1)) { @@ -1053,11 +1050,9 @@ orphans_found++; } } - if (base::FeatureList::IsEnabled(kDeleteOrphanLocalStorageOnStartup)) { - // These are counted independently to better track errors in rollout. - base::UmaHistogramCounts100000( - "LocalStorage.OrphanStorageAreasOnStartupCount", orphans_found); - } + // These are counted independently to better track errors in rollout. + base::UmaHistogramCounts100000( + "LocalStorage.OrphanStorageAreasOnStartupCount", orphans_found); // Delete stale storage areas and count results. DeleteStorageKeys(
diff --git a/components/services/storage/dom_storage/local_storage_impl_unittest.cc b/components/services/storage/dom_storage/local_storage_impl_unittest.cc index 823250c..fbf465b 100644 --- a/components/services/storage/dom_storage/local_storage_impl_unittest.cc +++ b/components/services/storage/dom_storage/local_storage_impl_unittest.cc
@@ -1257,26 +1257,8 @@ EXPECT_TRUE(area.is_connected()); } -class LocalStorageImplStaleDeletionTest - : public LocalStorageImplTest, - public testing::WithParamInterface<std::tuple<bool, bool>> { +class LocalStorageImplStaleDeletionTest : public LocalStorageImplTest { public: - LocalStorageImplStaleDeletionTest() { - feature_list_.InitWithFeatureStates( - {{kDeleteStaleLocalStorageOnStartup, - ShouldDeleteStaleLocalStorageOnStartup()}, - {kDeleteOrphanLocalStorageOnStartup, - ShouldDeleteOrphanLocalStorageOnStartup()}}); - } - - bool ShouldDeleteStaleLocalStorageOnStartup() { - return std::get<0>(GetParam()); - } - - bool ShouldDeleteOrphanLocalStorageOnStartup() { - return std::get<1>(GetParam()); - } - void UpdateAccessMetaData(const blink::StorageKey& storage_key, const base::Time& last_accessed) { storage::LocalStorageAreaAccessMetaData data; @@ -1294,17 +1276,9 @@ SetDatabaseEntry("META:" + storage_key.SerializeForLocalStorage(), data.SerializeAsString()); } - - private: - base::test::ScopedFeatureList feature_list_; }; -INSTANTIATE_TEST_SUITE_P( - /* no prefix */, - LocalStorageImplStaleDeletionTest, - testing::Combine(testing::Bool(), testing::Bool())); - -TEST_P(LocalStorageImplStaleDeletionTest, StaleStorageAreaDeletion) { +TEST_F(LocalStorageImplStaleDeletionTest, StaleStorageAreaDeletion) { const auto storage_key1 = blink::StorageKey::CreateFromStringForTesting("http://foo.com"); const auto storage_key2 = @@ -1359,22 +1333,18 @@ context()->OverrideDeleteStaleStorageAreasDelayForTesting(base::Days(0)); context()->ForceFakeOpenStorageAreaForTesting(storage_key3); WaitForDatabaseOpen(); + RunUntilIdle(); // We should see that only the data for storage_key4 was cleared. - const size_t expected_size = - ShouldDeleteStaleLocalStorageOnStartup() ? 13u : 16u; EXPECT_TRUE(base::test::RunUntil( - [&]() { return GetDatabaseContents().size() == expected_size; })); - - if (ShouldDeleteStaleLocalStorageOnStartup()) { - for (const auto& entry : GetDatabaseContents()) { - EXPECT_EQ(entry.first.find(storage_key4.origin().Serialize()), - std::string::npos); - } + [&]() { return GetDatabaseContents().size() == 13u; })); + for (const auto& entry : GetDatabaseContents()) { + EXPECT_EQ(entry.first.find(storage_key4.origin().Serialize()), + std::string::npos); } } -TEST_P(LocalStorageImplStaleDeletionTest, Orphan) { +TEST_F(LocalStorageImplStaleDeletionTest, Orphan) { // Nothing should be orphaned initially. mojo::Remote<blink::mojom::StorageArea> area; { @@ -1449,17 +1419,9 @@ context()->OverrideDeleteStaleStorageAreasDelayForTesting(base::Days(0)); WaitForDatabaseOpen(); RunUntilIdle(); - EXPECT_EQ((ShouldDeleteStaleLocalStorageOnStartup() && - ShouldDeleteOrphanLocalStorageOnStartup()) - ? 1 - : 0, - histograms.GetTotalSum( - "LocalStorage.OrphanStorageAreasOnStartupCount")); - EXPECT_EQ((ShouldDeleteStaleLocalStorageOnStartup() && - ShouldDeleteOrphanLocalStorageOnStartup()) - ? 4u - : 7u, - GetDatabaseContents().size()); + EXPECT_EQ(1, histograms.GetTotalSum( + "LocalStorage.OrphanStorageAreasOnStartupCount")); + EXPECT_EQ(4u, GetDatabaseContents().size()); } // Third party bucket doesn't qualify, even if it's old. @@ -1482,11 +1444,7 @@ RunUntilIdle(); EXPECT_EQ(0, histograms.GetTotalSum( "LocalStorage.OrphanStorageAreasOnStartupCount")); - EXPECT_EQ((ShouldDeleteStaleLocalStorageOnStartup() && - ShouldDeleteOrphanLocalStorageOnStartup()) - ? 7u - : 10u, - GetDatabaseContents().size()); + EXPECT_EQ(7u, GetDatabaseContents().size()); UpdateAccessMetaData(third_party_key, base::Time::Now() - base::Days(2)); UpdateWriteMetaData(third_party_key, base::Time::Now() - base::Days(2), 0); @@ -1497,11 +1455,7 @@ RunUntilIdle(); EXPECT_EQ(0, histograms.GetTotalSum( "LocalStorage.OrphanStorageAreasOnStartupCount")); - EXPECT_EQ((ShouldDeleteStaleLocalStorageOnStartup() && - ShouldDeleteOrphanLocalStorageOnStartup()) - ? 7u - : 10u, - GetDatabaseContents().size()); + EXPECT_EQ(7u, GetDatabaseContents().size()); } // Third party nonce bucket does qualify, but only if it's old. @@ -1525,11 +1479,7 @@ RunUntilIdle(); EXPECT_EQ(0, histograms.GetTotalSum( "LocalStorage.OrphanStorageAreasOnStartupCount")); - EXPECT_EQ((ShouldDeleteStaleLocalStorageOnStartup() && - ShouldDeleteOrphanLocalStorageOnStartup()) - ? 10u - : 13u, - GetDatabaseContents().size()); + EXPECT_EQ(10u, GetDatabaseContents().size()); UpdateAccessMetaData(third_party_nonce_key, base::Time::Now() - base::Days(2)); @@ -1540,17 +1490,9 @@ context()->OverrideDeleteStaleStorageAreasDelayForTesting(base::Days(0)); WaitForDatabaseOpen(); RunUntilIdle(); - EXPECT_EQ((ShouldDeleteStaleLocalStorageOnStartup() && - ShouldDeleteOrphanLocalStorageOnStartup()) - ? 1 - : 0, - histograms.GetTotalSum( - "LocalStorage.OrphanStorageAreasOnStartupCount")); - EXPECT_EQ((ShouldDeleteStaleLocalStorageOnStartup() && - ShouldDeleteOrphanLocalStorageOnStartup()) - ? 7u - : 13u, - GetDatabaseContents().size()); + EXPECT_EQ(1, histograms.GetTotalSum( + "LocalStorage.OrphanStorageAreasOnStartupCount")); + EXPECT_EQ(7u, GetDatabaseContents().size()); } }
diff --git a/components/ukm/observers/ukm_consent_state_observer.cc b/components/ukm/observers/ukm_consent_state_observer.cc index d7f1d03..11fbdbfe 100644 --- a/components/ukm/observers/ukm_consent_state_observer.cc +++ b/components/ukm/observers/ukm_consent_state_observer.cc
@@ -249,7 +249,7 @@ // explain why it has IsDwaAllowedForAllProfiles. bool UkmConsentStateObserver::IsDwaAllowedForAllProfiles() { const UkmConsentState ukm_consent_state = GetUkmConsentState(); -#if BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) return ukm_consent_state.Has(ukm::MSBB); #else return ukm_consent_state.HasAll({ukm::MSBB, ukm::APPS, ukm::EXTENSIONS});
diff --git a/components/update_client/update_client_unittest.cc b/components/update_client/update_client_unittest.cc index 7daf2271..880b2202 100644 --- a/components/update_client/update_client_unittest.cc +++ b/components/update_client/update_client_unittest.cc
@@ -405,12 +405,10 @@ InSequence seq; EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kUpToDate; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; @@ -617,13 +615,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kChecking && item.id == "jebgalgnebhfojomionfpkfelancnnkf"; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kCanUpdate && item.id == "jebgalgnebhfojomionfpkfelancnnkf"; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kDownloading && item.id == "jebgalgnebhfojomionfpkfelancnnkf"; @@ -637,21 +633,18 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kUpdated && item.id == "jebgalgnebhfojomionfpkfelancnnkf"; - }))) - .Times(1); + }))); } { InSequence seq; EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kChecking && item.id == "abagagagagagagagagagagagagagagag"; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kUpToDate && item.id == "abagagagagagagagagagagagagagagag"; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; @@ -861,13 +854,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kChecking && item.id == "jebgalgnebhfojomionfpkfelancnnkf"; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kCanUpdate && item.id == "jebgalgnebhfojomionfpkfelancnnkf"; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kDownloading && item.id == "jebgalgnebhfojomionfpkfelancnnkf"; @@ -881,21 +872,19 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kUpdated && item.id == "jebgalgnebhfojomionfpkfelancnnkf"; - }))) - .Times(1); + }))); } { InSequence seq; EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kChecking && item.id == "abagagagagagagagagagagagagagagag"; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.state == ComponentState::kUpdateError && item.id == "abagagagagagagagagagagagagagagag"; }))) - .Times(1) + .WillOnce(Invoke([](const CrxUpdateItem& item) { EXPECT_EQ(ComponentState::kUpdateError, item.state); EXPECT_EQ(5, static_cast<int>(item.error_category)); @@ -1097,13 +1086,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kDownloading; @@ -1112,21 +1099,18 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdating; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdated; - }))) - .Times(1); + }))); } { InSequence seq; EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdateError; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; @@ -1226,13 +1210,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdateError; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; @@ -1473,13 +1455,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kDownloading; @@ -1489,7 +1469,7 @@ return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; }))) - .Times(1) + .WillOnce(Invoke([](const CrxUpdateItem& item) { EXPECT_EQ(ComponentState::kUpdateError, item.state); EXPECT_EQ(1, static_cast<int>(item.error_category)); @@ -1502,13 +1482,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kDownloading; @@ -1517,13 +1495,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdating; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdated; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; @@ -1829,13 +1805,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kDownloading; @@ -1844,8 +1818,7 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdating; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdating; @@ -1854,18 +1827,15 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdated; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kDownloading; @@ -1874,8 +1844,7 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdating; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdating; @@ -1884,8 +1853,7 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdated; - }))) - .Times(1); + }))); } update_client->AddObserver(&observer); @@ -2034,7 +2002,7 @@ base::MakeRefCounted<MockInstaller>(); EXPECT_CALL(*installer, OnUpdateError(_)).Times(0); - EXPECT_CALL(*installer, DoInstall(_)).Times(1); + EXPECT_CALL(*installer, DoInstall(_)); EXPECT_CALL(*installer, GetInstalledFile(_)).Times(0); EXPECT_CALL(*installer, Uninstall()).Times(0); @@ -2175,13 +2143,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kDownloading; @@ -2190,13 +2156,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdating; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; @@ -2486,13 +2450,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kDownloading; @@ -2501,24 +2463,20 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdating; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdated; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kDownloading; @@ -2537,8 +2495,7 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdated; - }))) - .Times(1); + }))); } update_client->AddObserver(&observer); @@ -2865,13 +2822,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kDownloading; @@ -2880,24 +2835,20 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdating; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdated; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kDownloading; @@ -2906,13 +2857,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdating; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdated; - }))) - .Times(1); + }))); } update_client->AddObserver(&observer); @@ -3069,23 +3018,19 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpToDate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpToDate; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items1; @@ -3290,13 +3235,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kDownloading; @@ -3305,13 +3248,12 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdating; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdated; }))) - .Times(1) + .WillOnce(Invoke([](const CrxUpdateItem& item) { ASSERT_TRUE(item.component); const auto* test_installer = @@ -3428,7 +3370,7 @@ return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; }))) - .Times(1) + .WillOnce(Invoke([](const CrxUpdateItem& item) { // Tests that the state of the component when the CrxComponent data // is not provided. In this case, the optional |item.component| @@ -3545,13 +3487,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpToDate; - }))) - .Times(1); + }))); std::vector<CrxUpdateItem> items1; auto receiver1 = base::MakeRefCounted<MockCrxStateChangeReceiver>(); @@ -3781,23 +3721,19 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kDownloading; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; @@ -4071,13 +4007,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kDownloading; @@ -4091,18 +4025,15 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdated; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kDownloading; @@ -4116,8 +4047,7 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdateError; - }))) - .Times(1); + }))); } update_client->AddObserver(&observer); @@ -4390,33 +4320,27 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpToDate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpToDate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpToDate; - }))) - .Times(1); + }))); } update_client->AddObserver(&observer); @@ -4667,31 +4591,26 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; - }))) - .Times(1); + }))); } { InSequence seq; EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kDownloading; @@ -4700,13 +4619,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdating; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdated; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; @@ -4911,13 +4828,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kDownloading; @@ -4927,7 +4842,7 @@ return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; }))) - .Times(1) + .WillOnce(Invoke([](const CrxUpdateItem& item) { EXPECT_EQ(ComponentState::kUpdateError, item.state); EXPECT_EQ(1, static_cast<int>(item.error_category)); @@ -5038,13 +4953,12 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; }))) - .Times(1) + .WillOnce(Invoke([](const CrxUpdateItem& item) { EXPECT_EQ(ComponentState::kUpdateError, item.state); EXPECT_EQ(5, static_cast<int>(item.error_category)); @@ -5201,13 +5115,12 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; }))) - .Times(1) + .WillOnce(Invoke([](const CrxUpdateItem& item) { EXPECT_EQ(ComponentState::kUpdateError, item.state); EXPECT_EQ(5, static_cast<int>(item.error_category)); @@ -5220,13 +5133,12 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "abagagagagagagagagagagagagagagag" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "abagagagagagagagagagagagagagagag" && item.state == ComponentState::kUpdateError; }))) - .Times(1) + .WillOnce(Invoke([](const CrxUpdateItem& item) { EXPECT_EQ(ComponentState::kUpdateError, item.state); EXPECT_EQ(5, static_cast<int>(item.error_category)); @@ -5239,13 +5151,12 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "ihfokbkgjpifnbbojhneepfflplebdkc" && item.state == ComponentState::kUpdateError; }))) - .Times(1) + .WillOnce(Invoke([](const CrxUpdateItem& item) { EXPECT_EQ(ComponentState::kUpdateError, item.state); EXPECT_EQ(5, static_cast<int>(item.error_category)); @@ -5258,13 +5169,12 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "gjpmebpgbhcamgdgjcmnjfhggjpgcimm" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "gjpmebpgbhcamgdgjcmnjfhggjpgcimm" && item.state == ComponentState::kUpdateError; }))) - .Times(1) + .WillOnce(Invoke([](const CrxUpdateItem& item) { EXPECT_EQ(ComponentState::kUpdateError, item.state); EXPECT_EQ(5, static_cast<int>(item.error_category)); @@ -6056,13 +5966,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kDownloading; @@ -6072,8 +5980,7 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; @@ -6237,19 +6144,17 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; }))) - .Times(1) + .WillOnce(Invoke([&cancel] { cancel.Run(); })); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; @@ -6361,13 +6266,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpToDate; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; auto receiver = base::MakeRefCounted<MockCrxStateChangeReceiver>(); @@ -6512,13 +6415,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; auto receiver = base::MakeRefCounted<MockCrxStateChangeReceiver>(); @@ -6625,23 +6526,19 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpToDate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpToDate; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; auto receiver = base::MakeRefCounted<MockCrxStateChangeReceiver>(); @@ -6762,13 +6659,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpToDate; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; @@ -6850,8 +6745,7 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; auto receiver = base::MakeRefCounted<MockCrxStateChangeReceiver>(); @@ -7023,18 +6917,15 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; - }))) - .Times(1); + }))); } std::vector<CrxUpdateItem> items; auto receiver = base::MakeRefCounted<MockCrxStateChangeReceiver>(); @@ -7233,13 +7124,11 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kDownloading; @@ -7248,8 +7137,7 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdating; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdating; @@ -7258,24 +7146,20 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdateError; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kChecking; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kCanUpdate; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdating; - }))) - .Times(1); + }))); EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdating; @@ -7284,8 +7168,7 @@ EXPECT_CALL(observer, OnEvent(Truly([](const CrxUpdateItem& item) { return item.id == "jebgalgnebhfojomionfpkfelancnnkf" && item.state == ComponentState::kUpdated; - }))) - .Times(1); + }))); } update_client->AddObserver(&observer);
diff --git a/components/user_manager/test_helper.cc b/components/user_manager/test_helper.cc index dd2e916..e55e0ed 100644 --- a/components/user_manager/test_helper.cc +++ b/components/user_manager/test_helper.cc
@@ -42,6 +42,18 @@ } // static +void TestHelper::RegisterWebKioskAppUser(PrefService& local_state, + std::string_view user_id) { + auto type = policy::GetDeviceLocalAccountType(user_id); + CHECK_EQ(type, policy::DeviceLocalAccountType::kWebKioskApp) + << user_id << " did not satisfy to be used for a web kiosk user. " + << "See policy::GetDeviceLocalAccountType for details"; + ScopedListPrefUpdate update(&local_state, + prefs::kDeviceLocalAccountsWithSavedData); + update->Append(user_id); +} + +// static void TestHelper::RegisterPublicAccountUser(PrefService& local_state, std::string_view user_id) { auto type = policy::GetDeviceLocalAccountType(user_id);
diff --git a/components/user_manager/test_helper.h b/components/user_manager/test_helper.h index df5d3485..b7fb44f6 100644 --- a/components/user_manager/test_helper.h +++ b/components/user_manager/test_helper.h
@@ -34,6 +34,10 @@ static void RegisterKioskAppUser(PrefService& local_state, std::string_view user_id); + // Records the `user_id` as a Web-Kiosk app user to the given `local_state`. + static void RegisterWebKioskAppUser(PrefService& local_state, + std::string_view user_id); + // Records the `user_id` as a Public Account user to the given `local_state`. static void RegisterPublicAccountUser(PrefService& local_state, std::string_view user_id);
diff --git a/components/viz/service/display_embedder/skia_output_device_dcomp.cc b/components/viz/service/display_embedder/skia_output_device_dcomp.cc index 6d034b12..7d3365f 100644 --- a/components/viz/service/display_embedder/skia_output_device_dcomp.cc +++ b/components/viz/service/display_embedder/skia_output_device_dcomp.cc
@@ -187,11 +187,19 @@ // Remove entries from |overlays_| for textures that weren't scheduled as an // overlay this frame. if (!overlays_.empty()) { - base::EraseIf(overlays_, [this](auto& entry) { - const gpu::Mailbox& mailbox = entry.first; - return !scheduled_overlay_mailboxes_.contains(mailbox); - }); + if (result.swap_result == gfx::SwapResult::SWAP_ACK) { + // If swap did not succeed, then the overlay images could still be in the + // visual tree. It's not safe for us to end overlay access on DComp + // textures since DWM could potentially still read from them. The images + // held back in the swap failure case will either be cleaned up on next + // successful swap or after GPU process restart. + base::EraseIf(overlays_, [this](auto& entry) { + const gpu::Mailbox& mailbox = entry.first; + return !scheduled_overlay_mailboxes_.contains(mailbox); + }); + } scheduled_overlay_mailboxes_.clear(); + for (auto& [mailbox, overlay_data] : overlays_) { if (auto overlay_image = overlay_data.GetOverlayAccess()) { if (overlay_image->type() ==
diff --git a/components/viz/test/test_in_process_context_provider.cc b/components/viz/test/test_in_process_context_provider.cc index 57c353f6..260e246 100644 --- a/components/viz/test/test_in_process_context_provider.cc +++ b/components/viz/test/test_in_process_context_provider.cc
@@ -68,7 +68,7 @@ if (type_ == TestContextType::kGLES2) { attribs.enable_gles2_interface = true; attribs.enable_raster_interface = false; - attribs.enable_oop_rasterization = false; + attribs.enable_gpu_rasterization = false; gles2_context_ = std::make_unique<gpu::GLInProcessContext>(); auto result = gles2_context_->Initialize( @@ -82,7 +82,7 @@ attribs.enable_gles2_interface = false; attribs.enable_raster_interface = true; - attribs.enable_oop_rasterization = is_gpu_raster; + attribs.enable_gpu_rasterization = is_gpu_raster; raster_context_ = std::make_unique<gpu::RasterInProcessContext>(); auto result = raster_context_->Initialize(
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm index d09df29..f70d59f 100644 --- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm +++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -290,7 +290,7 @@ // full string in the renderer. std::u16string _availableText; size_t _availableTextOffset; - NSUInteger _availableTextChangeCounter; + NSUInteger _availableTextChangeNumber; gfx::Range _textSelectionRange; // The composition range, cached from the RenderWidgetHostView. This is only @@ -480,7 +480,7 @@ NSRect textRectInViewCoordinates = [self convertRect:textRectInWindowCoordinates fromView:nil]; - NSUInteger capturedChangeCounter = _availableTextChangeCounter; + NSUInteger capturedChangeNumber = _availableTextChangeNumber; [self.spellChecker showCorrectionIndicatorOfType:NSCorrectionIndicatorTypeDefault @@ -491,7 +491,7 @@ completionHandler:^(NSString* acceptedString) { [self didAcceptReplacementString:acceptedString forTextCheckingResult:candidateResult - withChangeNumber:capturedChangeCounter]; + withChangeNumber:capturedChangeNumber]; }]; } @@ -503,8 +503,11 @@ // Call it to report whether they initially accepted or rejected the // suggestion, but also if they edit, revert, etc. later. - if (acceptedString == nil) + // Exit if there's no replacement string, or if the web contents changed + // in between our spell checker request and this response. + if (acceptedString == nil || _availableTextChangeNumber != changeNumber) { return; + } NSRange availableTextRange = NSMakeRange(_availableTextOffset, _availableText.length()); @@ -528,18 +531,6 @@ language:nil]) return; - // Gather some info in case -doubleClickAtIndex: throws an exception. - // This change will eventually be reverted. - NSString* info = [NSString - stringWithFormat:@"%lu == %lu %lu %@ %@ %@ %@", changeNumber, - _availableTextChangeCounter, attString.string.length, - NSStringFromRange(availableTextRange), - NSStringFromRange(correction.range), - NSStringFromRange(trailingRange), - NSStringFromRange(trailingRangeInAvailableText)]; - SCOPED_CRASH_KEY_STRING256("RenderWidgetHostViewCocoa", "didAcceptTR", - base::SysNSStringToUTF8(info)); - if ([attString doubleClickAtIndex:trailingRangeInAvailableText.location] .location < trailingRangeInAvailableText.location) return; @@ -660,7 +651,7 @@ range:(gfx::Range)range { _availableText = text; _availableTextOffset = offset; - _availableTextChangeCounter++; + _availableTextChangeNumber++; _textSelectionRange = range; _substitutionWasApplied = NO; [NSSpellChecker.sharedSpellChecker dismissCorrectionIndicatorForView:self];
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc index 37891097..d0ea177 100644 --- a/content/browser/compositor/viz_process_transport_factory.cc +++ b/content/browser/compositor/viz_process_transport_factory.cc
@@ -79,7 +79,7 @@ attributes.lose_context_when_out_of_memory = true; attributes.enable_gles2_interface = false; attributes.enable_raster_interface = true; - attributes.enable_oop_rasterization = supports_gpu_rasterization; + attributes.enable_gpu_rasterization = supports_gpu_rasterization; gpu::SharedMemoryLimits memory_limits = gpu::SharedMemoryLimits::ForDisplayCompositor();
diff --git a/content/browser/media/android/browser_gpu_video_accelerator_factories.cc b/content/browser/media/android/browser_gpu_video_accelerator_factories.cc index 115cc58a..4ed696b 100644 --- a/content/browser/media/android/browser_gpu_video_accelerator_factories.cc +++ b/content/browser/media/android/browser_gpu_video_accelerator_factories.cc
@@ -26,7 +26,7 @@ gpu::ContextCreationAttribs attributes; attributes.bind_generates_resource = false; attributes.enable_raster_interface = true; - attributes.enable_oop_rasterization = true; + attributes.enable_gpu_rasterization = true; attributes.enable_gles2_interface = false; attributes.enable_grcontext = false;
diff --git a/content/browser/renderer_host/private_network_access_util.cc b/content/browser/renderer_host/private_network_access_util.cc index ca15f25..64daeb2 100644 --- a/content/browser/renderer_host/private_network_access_util.cc +++ b/content/browser/renderer_host/private_network_access_util.cc
@@ -13,6 +13,7 @@ #include "content/public/common/content_switches.h" #include "content/public/common/url_constants.h" #include "services/network/public/cpp/cross_origin_embedder_policy.h" +#include "services/network/public/cpp/features.h" #include "services/network/public/cpp/ip_address_space_util.h" #include "services/network/public/mojom/client_security_state.mojom.h" #include "services/network/public/mojom/ip_address_space.mojom.h" @@ -74,7 +75,8 @@ } Policy DerivePolicyForNonSecureContext(AddressSpace ip_address_space) { - if (base::FeatureList::IsEnabled(features::kLocalNetworkAccessChecks)) { + if (base::FeatureList::IsEnabled( + network::features::kLocalNetworkAccessChecks)) { // LNA blocks all local network access requests coming from non-secure // contexts. // See: @@ -120,7 +122,8 @@ } Policy DerivePolicyForSecureContext(AddressSpace ip_address_space) { - if (base::FeatureList::IsEnabled(features::kLocalNetworkAccessChecks)) { + if (base::FeatureList::IsEnabled( + network::features::kLocalNetworkAccessChecks)) { // See: // https://github.com/explainers-by-googlers/local-network-access?tab=readme-ov-file#permission-prompts return Policy::kPermissionBlock; @@ -185,7 +188,8 @@ ? DerivePolicyForSecureContext(ip_address_space) : DerivePolicyForNonSecureContext(ip_address_space); - if (base::FeatureList::IsEnabled(features::kLocalNetworkAccessChecks)) { + if (base::FeatureList::IsEnabled( + network::features::kLocalNetworkAccessChecks)) { return policy; } else { return ApplyFeatureStateToPolicy(feature_state, policy);
diff --git a/content/browser/renderer_host/private_network_access_util_unittest.cc b/content/browser/renderer_host/private_network_access_util_unittest.cc index de539ab..f622ae5 100644 --- a/content/browser/renderer_host/private_network_access_util_unittest.cc +++ b/content/browser/renderer_host/private_network_access_util_unittest.cc
@@ -15,6 +15,7 @@ #include "content/common/features.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" +#include "services/network/public/cpp/features.h" #include "services/network/public/mojom/client_security_state.mojom.h" #include "services/network/public/mojom/ip_address_space.mojom.h" #include "testing/gmock/include/gmock/gmock.h" @@ -449,7 +450,7 @@ TEST(PrivateNetworkAccessUtilTest, DerivePolicyLocalNetworkAccess) { base::test::ScopedFeatureList feature_list( - features::kLocalNetworkAccessChecks); + network::features::kLocalNetworkAccessChecks); std::map<DerivePolicyInput, Policy> expected = DefaultPolicyMap(); for (auto& entry : expected) {
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h index 52e39d9..7daf9cae 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -3242,7 +3242,7 @@ // popin and this host is not within a fenced frame (as this prevents the // popin from impacting partitioning). // See https://explainers-by-googlers.github.io/partitioned-popins/ - bool ShouldPartitionAsPopin() const; + bool ShouldPartitionAsPopin() const override; void SimulateDiscardShutdownKeepAliveTimeoutForTesting();
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 2bc557c..5a13f11b 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -3367,7 +3367,6 @@ switches::kDisableBackgroundTimerThrottling, switches::kDisableBestEffortTasks, switches::kDisableBreakpad, - switches::kDisableDatabases, switches::kDisableFileSystem, switches::kDisableFrameRateLimit, switches::kDisableGpuMemoryBufferVideoFrames, @@ -3545,12 +3544,6 @@ renderer_cmd); } - // Disable databases in incognito mode. - if (GetBrowserContext()->IsOffTheRecord() && - !browser_cmd.HasSwitch(switches::kDisableDatabases)) { - renderer_cmd->AppendSwitch(switches::kDisableDatabases); - } - #if BUILDFLAG(IS_ANDROID) if (browser_cmd.HasSwitch(switches::kDisableGpuCompositing)) { renderer_cmd->AppendSwitch(switches::kDisableGpuCompositing);
diff --git a/content/browser/web_contents/partitioned_popins_controller_browsertest.cc b/content/browser/web_contents/partitioned_popins_controller_browsertest.cc index bbff21b..ad8db42 100644 --- a/content/browser/web_contents/partitioned_popins_controller_browsertest.cc +++ b/content/browser/web_contents/partitioned_popins_controller_browsertest.cc
@@ -9,6 +9,7 @@ #include "base/strings/string_util.h" #include "base/test/scoped_feature_list.h" #include "content/browser/renderer_host/render_frame_host_impl.h" +#include "content/browser/web_contents/web_contents_impl.h" #include "content/common/frame.mojom-shared.h" #include "content/common/frame.mojom.h" #include "content/public/browser/web_contents.h" @@ -165,6 +166,15 @@ CHECK_EQ(EvalJs(popin_web_contents, "window.popinContextType()"), "partitioned"); + // Check that the popin considers itself to be embedded by the origin of + // the opener. + CHECK_EQ(static_cast<WebContentsImpl*>(popin_web_contents) + ->GetPartitionedPopinEmbedderOriginForTesting(), + execution_target.render_frame_host() + ->GetMainFrame() + ->GetLastCommittedOrigin() + .GetURL()); + return popin_web_contents; }
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index b45b321..2a2c35e 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -899,6 +899,33 @@ return opened_partitioned_popin_.get(); } +GURL WebContentsImpl::GetPartitionedPopinEmbedderOrigin( + base::PassKey<StorageAccessGrantPermissionContext>) const { + return GetPartitionedPopinEmbedderOriginImpl(); +} + +GURL WebContentsImpl::GetPartitionedPopinEmbedderOriginForTesting() const { + return GetPartitionedPopinEmbedderOriginImpl(); +} + +GURL WebContentsImpl::GetPartitionedPopinEmbedderOriginImpl() const { + // This should only be checked for popins. + CHECK(IsPartitionedPopin()); + + // If the opener is still around and has not navigated then we want to use the + // embedder origin it would have used for its own iframe. + if (partitioned_popin_opener_ && + partitioned_popin_opener_->GetMainFrame()->GetLastCommittedOrigin() == + partitioned_popin_opener_properties_->top_frame_origin) { + return PermissionUtil::GetLastCommittedOriginAsURL( + partitioned_popin_opener_->GetMainFrame()); + } + // If we end up here there was a race condition between a permissions check + // and this popin being closed or navigated, so we should fallback to using + // the origin we partitioned by. + return partitioned_popin_opener_properties_->top_frame_origin.GetURL(); +} + void WebContents::SetScreenOrientationDelegate( ScreenOrientationDelegate* delegate) { ScreenOrientationProvider::SetDelegate(delegate); @@ -3401,8 +3428,6 @@ !command_line.HasSwitch(switches::kDisableRemoteFonts); prefs.local_storage_enabled = !command_line.HasSwitch(switches::kDisableLocalStorage); - prefs.databases_enabled = - !command_line.HasSwitch(switches::kDisableDatabases); prefs.webgl1_enabled = !command_line.HasSwitch(switches::kDisable3DAPIs) && !command_line.HasSwitch(switches::kDisableWebGL);
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index ea5598aa..4ec45639 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h
@@ -1595,6 +1595,17 @@ WebContents* GetOpenedPartitionedPopin() const override; + // Returns the origin of the popin's opener if this is a partitioned popin. + // CHECKS if this is not a partitioned popin, as it should never be called + // in that case. This is used in permissions checks. + // See https://explainers-by-googlers.github.io/partitioned-popins/ + GURL GetPartitionedPopinEmbedderOrigin( + base::PassKey<StorageAccessGrantPermissionContext>) const override; + + // Same as GetPartitionedPopinEmbedderOrigin but for testing to bypass + // PassKey requirements. + GURL GetPartitionedPopinEmbedderOriginForTesting() const; + private: using FrameTreeIterationCallback = base::FunctionRef<void(FrameTree&)>; using RenderViewHostIterationCallback = @@ -2174,6 +2185,9 @@ // the VizCompositorThread for input handling with InputVizard. void SetupRenderInputRouterDelegateConnection(); + // See GetPartitionedPopinEmbedderOrigin for details. + GURL GetPartitionedPopinEmbedderOriginImpl() const; + // Data for core operation --------------------------------------------------- // Delegate for notifying our owner about stuff. Not owned by us.
diff --git a/content/browser/webauth/webauth_request_security_checker.cc b/content/browser/webauth/webauth_request_security_checker.cc index 7303eaf..70bbeb0a 100644 --- a/content/browser/webauth/webauth_request_security_checker.cc +++ b/content/browser/webauth/webauth_request_security_checker.cc
@@ -356,7 +356,6 @@ } url::Origin relying_party_origin = caller_origin; -#if !BUILDFLAG(IS_ANDROID) if (remote_desktop_client_override) { if (!GetContentClient() ->browser() @@ -370,7 +369,6 @@ } relying_party_origin = remote_desktop_client_override->origin; } -#endif // !BUILDFLAG(IS_ANDROID) if (OriginIsAllowedToClaimRelyingPartyId(relying_party_id, relying_party_origin)) { @@ -400,7 +398,6 @@ const blink::mojom::RemoteDesktopClientOverridePtr& remote_desktop_client_override, std::string* out_appid) { -#if !BUILDFLAG(IS_ANDROID) if (remote_desktop_client_override) { if (!GetContentClient() ->browser() @@ -412,7 +409,6 @@ } caller_origin = remote_desktop_client_override->origin; } -#endif // !BUILDFLAG(IS_ANDROID) // Step 1: "If the AppID is not an HTTPS URL, and matches the FacetID of the // caller, no additional processing is necessary and the operation may
diff --git a/content/browser/webid/OWNERS b/content/browser/webid/OWNERS index aafd07b..34e927a 100644 --- a/content/browser/webid/OWNERS +++ b/content/browser/webid/OWNERS
@@ -1,8 +1,8 @@ -# Primary -yigu@chromium.org - +# for FedCM changes cbiesinger@chromium.org npm@chromium.org +yigu@chromium.org +tanzachary@chromium.org # for digital credentials changes mamir@chromium.org
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 5c11f1b..f9caf73 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -451,7 +451,6 @@ {wrf::EnableAutomationControlled, switches::kEnableAutomation, true}, {wrf::EnableAutomationControlled, switches::kHeadless, true}, {wrf::EnableAutomationControlled, switches::kRemoteDebuggingPipe, true}, - {wrf::EnableDatabase, switches::kDisableDatabases, false}, {wrf::EnableFileSystem, switches::kDisableFileSystem, false}, {wrf::EnableNetInfoDownlinkMax, switches::kEnableNetworkInformationDownlinkMax, true},
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContactsDialogHost.java b/content/public/android/java/src/org/chromium/content/browser/ContactsDialogHost.java index 8e294f5..b060a32d 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ContactsDialogHost.java +++ b/content/public/android/java/src/org/chromium/content/browser/ContactsDialogHost.java
@@ -4,6 +4,8 @@ package org.chromium.content.browser; +import static org.chromium.build.NullUtil.assumeNonNull; + import android.Manifest; import android.content.pm.PackageManager; import android.text.TextUtils; @@ -120,7 +122,7 @@ @Override public void onContactsPickerUserAction( @ContactsPickerAction int action, - List<Contact> contacts, + @Nullable List<Contact> contacts, int percentageShared, int propertiesSiteRequested, int propertiesUserRejected) { @@ -134,6 +136,7 @@ break; case ContactsPickerAction.CONTACTS_SELECTED: + assumeNonNull(contacts); for (Contact contact : contacts) { ContactsDialogHostJni.get() .addContact(
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/ContactsPickerListener.java b/content/public/android/java/src/org/chromium/content_public/browser/ContactsPickerListener.java index 6f2d9cd..6081458 100644 --- a/content/public/android/java/src/org/chromium/content_public/browser/ContactsPickerListener.java +++ b/content/public/android/java/src/org/chromium/content_public/browser/ContactsPickerListener.java
@@ -22,18 +22,18 @@ public interface ContactsPickerListener { /** A container class for exchanging contact details. */ public static class Contact { - public final List<String> names; - public final List<String> emails; - public final List<String> tel; + public final @Nullable List<String> names; + public final @Nullable List<String> emails; + public final @Nullable List<String> tel; public final @Nullable List<ByteBuffer> serializedAddresses; public final @Nullable List<ByteBuffer> serializedIcons; public Contact( - List<String> contactNames, - List<String> contactEmails, - List<String> contactTel, - List<PaymentAddress> contactAddresses, - List<ContactIconBlob> contactIcons) { + @Nullable List<String> contactNames, + @Nullable List<String> contactEmails, + @Nullable List<String> contactTel, + @Nullable List<PaymentAddress> contactAddresses, + @Nullable List<ContactIconBlob> contactIcons) { names = contactNames; emails = contactEmails; tel = contactTel; @@ -87,7 +87,7 @@ */ void onContactsPickerUserAction( @ContactsPickerAction int action, - List<Contact> contacts, + @Nullable List<Contact> contacts, int percentageShared, int propertiesSiteRequested, int propertiesUserRejected);
diff --git a/content/public/browser/BUILD.gn b/content/public/browser/BUILD.gn index 90d7ced..96a94a0 100644 --- a/content/public/browser/BUILD.gn +++ b/content/public/browser/BUILD.gn
@@ -478,6 +478,9 @@ "vpn_service_proxy.h", "weak_document_ptr.cc", "weak_document_ptr.h", + "web_authentication_delegate.cc", + "web_authentication_delegate.h", + "web_authentication_request_proxy.h", "web_contents.cc", "web_contents.h", "web_contents_capability_type.h", @@ -722,9 +725,6 @@ # Android provides its own native implementation of that API. "authenticator_request_client_delegate.cc", "authenticator_request_client_delegate.h", - "web_authentication_delegate.cc", - "web_authentication_delegate.h", - "web_authentication_request_proxy.h", ] }
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc index eacc673..54014f1d 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc
@@ -51,6 +51,7 @@ #include "content/public/browser/tracing_delegate.h" #include "content/public/browser/url_loader_request_interceptor.h" #include "content/public/browser/vpn_service_proxy.h" +#include "content/public/browser/web_authentication_delegate.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view_delegate.h" #include "content/public/common/alternative_error_page_override_info.mojom.h" @@ -96,7 +97,6 @@ #include "content/public/browser/tts_environment_android.h" #else #include "content/public/browser/authenticator_request_client_delegate.h" -#include "content/public/browser/web_authentication_delegate.h" #include "third_party/blink/public/mojom/installedapp/related_application.mojom.h" #endif @@ -1278,13 +1278,13 @@ return true; } -#if !BUILDFLAG(IS_ANDROID) WebAuthenticationDelegate* ContentBrowserClient::GetWebAuthenticationDelegate() { static base::NoDestructor<WebAuthenticationDelegate> delegate; return delegate.get(); } +#if !BUILDFLAG(IS_ANDROID) std::unique_ptr<AuthenticatorRequestClientDelegate> ContentBrowserClient::GetWebAuthenticationRequestDelegate( RenderFrameHost* render_frame_host) {
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 9746621..f3750ed03 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h
@@ -270,6 +270,7 @@ class VideoOverlayWindow; class VideoPictureInPictureWindowController; class VpnServiceProxy; +class WebAuthenticationDelegate; class WebContents; class WebContentsViewDelegate; class WebUIBrowserInterfaceBrokerRegistry; @@ -286,7 +287,6 @@ class TtsEnvironmentAndroid; #else class AuthenticatorRequestClientDelegate; -class WebAuthenticationDelegate; #endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_CHROMEOS) @@ -2331,12 +2331,12 @@ content::RenderFrameHost* rfh, const url::Origin& caller_origin); -#if !BUILDFLAG(IS_ANDROID) // Returns an embedder-provided subclass of WebAuthenticationDelegate. This // allows the embedder to customize the implementation of the Web // Authentication API. virtual WebAuthenticationDelegate* GetWebAuthenticationDelegate(); +#if !BUILDFLAG(IS_ANDROID) // Returns an AuthenticatorRequestClientDelegate subclass instance to provide // embedder-specific configuration for a single Web Authentication API request // being serviced in a given RenderFrame. The instance is guaranteed to be
diff --git a/content/public/browser/render_frame_host.h b/content/public/browser/render_frame_host.h index 779be81e..efdd7be 100644 --- a/content/public/browser/render_frame_host.h +++ b/content/public/browser/render_frame_host.h
@@ -1155,6 +1155,12 @@ virtual const network::CrossOriginEmbedderPolicy& GetCrossOriginEmbedderPolicy() const = 0; + // Returns true if this RenderFrameHost is in a partitioned popin and is not + // within a fenced frame (as this prevents the popin from impacting + // partitioning). + // See https://explainers-by-googlers.github.io/partitioned-popins/ + virtual bool ShouldPartitionAsPopin() const = 0; + private: // This interface should only be implemented inside content. friend class RenderFrameHostImpl;
diff --git a/content/public/browser/web_authentication_delegate.cc b/content/public/browser/web_authentication_delegate.cc index 1b8d76f..593e067 100644 --- a/content/public/browser/web_authentication_delegate.cc +++ b/content/public/browser/web_authentication_delegate.cc
@@ -13,13 +13,16 @@ #include "base/functional/callback.h" #include "build/buildflag.h" #include "content/browser/renderer_host/frame_tree_node.h" -#include "content/browser/webauth/authenticator_environment.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_authentication_request_proxy.h" #include "content/public/browser/web_contents.h" #include "url/origin.h" +#if !BUILDFLAG(IS_ANDROID) +#include "content/browser/webauth/authenticator_environment.h" +#endif // !BUILDFLAG(IS_ANDROID) + namespace content { WebAuthenticationDelegate::WebAuthenticationDelegate() = default; @@ -57,6 +60,7 @@ bool WebAuthenticationDelegate::SupportsResidentKeys( RenderFrameHost* render_frame_host) { +#if !BUILDFLAG(IS_ANDROID) // The testing API supports resident keys, but for real requests //content // doesn't by default. FrameTreeNode* frame_tree_node = @@ -65,6 +69,7 @@ frame_tree_node)) { return true; } +#endif // !BUILDFLAG(IS_ANDROID) return false; } @@ -76,6 +81,7 @@ IsUserVerifyingPlatformAuthenticatorAvailableOverride( RenderFrameHost* render_frame_host, base::OnceCallback<void(std::optional<bool>)> callback) { +#if !BUILDFLAG(IS_ANDROID) FrameTreeNode* frame_tree_node = static_cast<RenderFrameHostImpl*>(render_frame_host)->frame_tree_node(); if (AuthenticatorEnvironment::GetInstance()->IsVirtualAuthenticatorEnabledFor( @@ -85,6 +91,7 @@ ->HasVirtualUserVerifyingPlatformAuthenticator(frame_tree_node)); return; } +#endif // !BUILDFLAG(IS_ANDROID) std::move(callback).Run(std::nullopt); }
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h index 4f3914d..cd8631b3 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h
@@ -67,6 +67,8 @@ #include "third_party/jni_zero/jni_zero.h" #endif +class StorageAccessGrantPermissionContext; + namespace base { class FilePath; } // namespace base @@ -1640,6 +1642,13 @@ // be bound. virtual net::handles::NetworkHandle GetTargetNetwork() = 0; + // Returns the origin of the popin's opener if this is a partitioned popin. + // CHECKS if this is not a partitioned popin, as it should never be called + // in that case. This is used in permissions checks. + // See https://explainers-by-googlers.github.io/partitioned-popins/ + virtual GURL GetPartitionedPopinEmbedderOrigin( + base::PassKey<StorageAccessGrantPermissionContext>) const = 0; + private: // This interface should only be implemented inside content. friend class WebContentsImpl;
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 3e22a32e..74b807a 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -267,7 +267,7 @@ // See crbug.com/40285083 for more info. BASE_FEATURE(kDeleteStaleSessionCookiesOnStartup, "DeleteStaleSessionCookiesOnStartup", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); // When a device bound session // (https://github.com/w3c/webappsec-dbsc/blob/main/README.md) is @@ -611,19 +611,6 @@ "LazyInitializeMediaControls", base::FEATURE_ENABLED_BY_DEFAULT); -// Enables Local Network Access checks. -// Blocks local network requests without user permission to prevent exploitation -// of vulnerable local devices. -// -// This feature is being built as a replacement for Private Network Access -// (PNA), and if this is on PNA features may stop working. -// -// Public explainer: -// https://github.com/explainers-by-googlers/local-network-access -BASE_FEATURE(kLocalNetworkAccessChecks, - "LocalNetworkAccessChecks", - base::FEATURE_DISABLED_BY_DEFAULT); - BASE_FEATURE(kLogJsConsoleMessages, "LogJsConsoleMessages", #if BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_DESKTOP_ANDROID)
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 535fbae..1fcd9b4 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -146,7 +146,6 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kIsolateOrigins); CONTENT_EXPORT extern const char kIsolateOriginsFieldTrialParamName[]; CONTENT_EXPORT BASE_DECLARE_FEATURE(kLazyInitializeMediaControls); -CONTENT_EXPORT BASE_DECLARE_FEATURE(kLocalNetworkAccessChecks); CONTENT_EXPORT BASE_DECLARE_FEATURE(kLogJsConsoleMessages); CONTENT_EXPORT BASE_DECLARE_FEATURE(kLowerPAMemoryLimitForNonMainRenderers); CONTENT_EXPORT BASE_DECLARE_FEATURE(kMBIMode);
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index ba01217..6412f376 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc
@@ -112,9 +112,6 @@ // features. const char kDisableBlinkFeatures[] = "disable-blink-features"; -// Disables HTML5 DB support. -const char kDisableDatabases[] = "disable-databases"; - // Disable the per-domain blocking for 3D APIs after GPU reset. // This switch is intended only for tests. const char kDisableDomainBlockingFor3DAPIs[] =
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 7a323100..dc2ba9e 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h
@@ -43,7 +43,6 @@ CONTENT_EXPORT extern const char kDisableBackgroundTimerThrottling[]; CONTENT_EXPORT extern const char kDisableBackForwardCache[]; CONTENT_EXPORT extern const char kDisableBlinkFeatures[]; -CONTENT_EXPORT extern const char kDisableDatabases[]; CONTENT_EXPORT extern const char kDisableDisplayList2dCanvas[]; extern const char kDisableDomainBlockingFor3DAPIs[]; CONTENT_EXPORT extern const char kDisableInProcessStackTraces[];
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index eda1a7a3..86399ed2 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc
@@ -286,7 +286,7 @@ bool support_locking, bool support_gles2_interface, bool support_raster_interface, - bool support_oop_rasterization, + bool support_gpu_rasterization, bool support_grcontext, bool automatic_flushes, viz::command_buffer_metrics::ContextType type, @@ -307,7 +307,7 @@ attributes.enable_grcontext = support_grcontext; // Using RasterDecoder for OOP-R backend, so we need support_raster_interface // and !support_gles2_interface. - attributes.enable_oop_rasterization = support_oop_rasterization && + attributes.enable_gpu_rasterization = support_gpu_rasterization && support_raster_interface && !support_gles2_interface; return base::MakeRefCounted<viz::ContextProviderCommandBuffer>(
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc index 72a30a1..4b9fce8 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -732,12 +732,12 @@ // acceleration mode, either on top of real GPU, or on top of SwiftShader // (for testing). This may change in the future if we move Skia software // rendering to be OOP as well. - attributes.enable_oop_rasterization = + attributes.enable_gpu_rasterization = attributes.enable_raster_interface && gpu_info.skia_backend_type != gpu::SkiaBackendType::kNone; - attributes.enable_gles2_interface = !attributes.enable_oop_rasterization; + attributes.enable_gles2_interface = !attributes.enable_gpu_rasterization; attributes.enable_grcontext = - !attributes.enable_oop_rasterization && web_attributes.support_grcontext; + !attributes.enable_gpu_rasterization && web_attributes.support_grcontext; attributes.gpu_preference = web_attributes.prefer_low_power_gpu ? gl::GpuPreference::kLowPower
diff --git a/device/fido/features.cc b/device/fido/features.cc index ef939a8..3b8e10c 100644 --- a/device/fido/features.cc +++ b/device/fido/features.cc
@@ -148,11 +148,6 @@ "WebAuthenticationPasskeyUpgrade", base::FEATURE_ENABLED_BY_DEFAULT); -// Default enabled in M133. Remove in or after M136. -BASE_FEATURE(kWebAuthnNeverSkipTrustThisComputer, - "WebAuthenticationNeverSkipTrustThisComputer", - base::FEATURE_ENABLED_BY_DEFAULT); - // Disabled by default. BASE_FEATURE(kWebAuthnEnclaveAttestation, "WebAuthenticationEnclaveAttestation",
diff --git a/device/fido/features.h b/device/fido/features.h index 2f9260d..605163a 100644 --- a/device/fido/features.h +++ b/device/fido/features.h
@@ -111,11 +111,6 @@ COMPONENT_EXPORT(DEVICE_FIDO) BASE_DECLARE_FEATURE(kWebAuthnPasskeyUpgrade); -// Stops Chrome from skipping the "Trust this computer" screen if the user -// doesn't have phones. -COMPONENT_EXPORT(DEVICE_FIDO) -BASE_DECLARE_FEATURE(kWebAuthnNeverSkipTrustThisComputer); - // Checks attestation from the enclave service. COMPONENT_EXPORT(DEVICE_FIDO) BASE_DECLARE_FEATURE(kWebAuthnEnclaveAttestation);
diff --git a/docs/ios/build_instructions.md b/docs/ios/build_instructions.md index d0bc14a..2d41c9ff 100644 --- a/docs/ios/build_instructions.md +++ b/docs/ios/build_instructions.md
@@ -286,11 +286,16 @@ The iOS build supports compiling the blink web platform. To compile blink set a gn arg in your `.setup-gn` file. Note the blink web platform is -experimental code and should only be used for analysis. +experimental code and should only be used for analysis. We currently +disable V8 pointer compression and the caged heap because of virtual +memory allocation issues experienced on physical iOS devices. ``` [gn_args] use_blink = true +ios_content_shell_bundle_identifier="REPLACE_YOUR_BUNDLE_IDENTIFIER_HERE" +cppgc_enable_caged_heap = false +v8_enable_pointer_compression = false ``` Note that only certain targets support blink. `content_shell` being the most useful.
diff --git a/docs/updater/dev_manual.md b/docs/updater/dev_manual.md index 36f9f00..816a023e 100644 --- a/docs/updater/dev_manual.md +++ b/docs/updater/dev_manual.md
@@ -173,6 +173,65 @@ first by functionality (or feature), and second by platform name. For example, the source code contains `updater\net` instead of `updater\mac\net`. +### Strings and file paths + +Strings in `Posix` are 8-bit encoded characters, usually (but not always) using +`UTF8` encoding. + +Strings in `Windows` can be 8-bit or 16-bit characters, usually `UTF8` or +`UTF16` respectively. The `updater` project uses 16-bit strings for most +Windows-specific literals, since that is the Chromium coding style for Windows, +and there are some Windows APIs that only have the `W` variant that require +16-bit strings. + +The `updater` project uses 8-bit literals and 8-bit characters for +cross-platform code, and uses conversion functions such as `base::UTF8ToWide` +and `base::WideToUTF8` to convert to and from 8-bit strings for Windows-specific +code paths that are called from the cross-platform code. + +Using the `ASCII` functions is not allowed in the `updater` codebase, unless +there is no alternative native or `UTF8` function. + +#### Appending strings to a file path + +When appending strings to a `FilePath`, there are several functions available, +such as: +* `Append`: appends a string using the native format +* `AppendUTF8`: appends a UTF8-encoded string +* `AppendASCII`: appends an ASCII-encoded string. ASCII is a subset of UTF8. + This function is not used in the `updater` project. + +These are the rules to follow when appending strings to a `FilePath`: + +1. Use `base::FilePath::Append` for platform-specific code + * Since `Append` does not do any conversions, it is the safest function to + use for platform-specific code, since the characters can retain their + native format without undergoing any conversions. +2. Use `base::FilePath::Append` for cross-platform code where + `FILE_PATH_LITERAL` can be used to wrap the literals + * Since `Append` does not do any conversions, it is the most efficient + function to use in this case. +3. Use `base::FilePath::AppendUTF8` for all other cross-platform code + * cross-platform code is expected to use UTF8 literals or UTF8 strings + only. + +#### Creating a file path from a string + +These are the rules to follow when constructing a `FilePath` from a string: + +1. Use the `base::FilePath` constructor for platform-specific code + * Since the `base::FilePath` constructor does not do any conversions, it + is the safest function to use for platform-specific code, since the + characters can retain their native format without undergoing any + conversions. +2. Use the `base::FilePath` constructor for cross-platform code where + `FILE_PATH_LITERAL` can be used to wrap the literals + * Since the `base::FilePath` constructor does not do any conversions, it + is the most efficient function to use in this case. +3. Use `base::FilePath::FromUTF8Unsafe` for all other cross-platform code + * cross-platform code is expected to use UTF8 literals or UTF8 strings + only. + ### Mind the dependencies To enforce layering, there are enforced rules about what can be included in
diff --git a/extensions/browser/api/messaging/message_service.cc b/extensions/browser/api/messaging/message_service.cc index 3f0615e..83790747 100644 --- a/extensions/browser/api/messaging/message_service.cc +++ b/extensions/browser/api/messaging/message_service.cc
@@ -772,10 +772,8 @@ receiver_contents->GetPrimaryMainFrame()); const PortId receiver_port_id = source_port_id.GetOppositePortId(); - std::unique_ptr<MessagePort> receiver = - messaging_delegate_->CreateReceiverForTab( - weak_factory_.GetWeakPtr(), extension_id, receiver_port_id, - receiver_contents, frame_id, document_id); + std::unique_ptr<MessagePort> receiver = CreateReceiverForTab( + extension_id, receiver_port_id, receiver_contents, frame_id, document_id); if (!receiver.get()) { opener_port->DispatchOnDisconnect(kReceivingEndDoesntExistError); return; @@ -818,6 +816,55 @@ false /* did_enqueue */); } +std::unique_ptr<MessagePort> MessageService::CreateReceiverForTab( + const ExtensionId& extension_id, + const PortId& receiver_port_id, + content::WebContents* receiver_contents, + int receiver_frame_id, + const std::string& receiver_document_id) { + // Frame ID -1 is every frame in the tab. + bool include_child_frames = + receiver_frame_id == -1 && receiver_document_id.empty(); + + content::RenderFrameHost* receiver_render_frame_host = nullptr; + if (include_child_frames) { + // The target is the active outermost main frame of the WebContents. + receiver_render_frame_host = receiver_contents->GetPrimaryMainFrame(); + } else if (!receiver_document_id.empty()) { + ExtensionApiFrameIdMap::DocumentId document_id = + ExtensionApiFrameIdMap::DocumentIdFromString(receiver_document_id); + + // Return early for invalid documentIds. + if (!document_id) { + return nullptr; + } + + receiver_render_frame_host = + ExtensionApiFrameIdMap::Get()->GetRenderFrameHostByDocumentId( + document_id); + + // If both |document_id| and |receiver_frame_id| are provided they + // should find the same RenderFrameHost, if not return early. + if (receiver_frame_id != -1 && + ExtensionApiFrameIdMap::GetRenderFrameHostById(receiver_contents, + receiver_frame_id) != + receiver_render_frame_host) { + return nullptr; + } + } else { + DCHECK_GT(receiver_frame_id, -1); + receiver_render_frame_host = ExtensionApiFrameIdMap::GetRenderFrameHostById( + receiver_contents, receiver_frame_id); + } + if (!receiver_render_frame_host) { + return nullptr; + } + + return ExtensionMessagePort::CreateForTab( + weak_factory_.GetWeakPtr(), receiver_port_id, extension_id, + receiver_render_frame_host, include_child_frames); +} + void MessageService::OpenChannelImpl(BrowserContext* browser_context, std::unique_ptr<OpenChannelParams> params, const Extension* target_extension,
diff --git a/extensions/browser/api/messaging/message_service.h b/extensions/browser/api/messaging/message_service.h index faef3c836..cc88984 100644 --- a/extensions/browser/api/messaging/message_service.h +++ b/extensions/browser/api/messaging/message_service.h
@@ -180,6 +180,16 @@ mojo::PendingAssociatedRemote<extensions::mojom::MessagePort> port, mojo::PendingAssociatedReceiver<extensions::mojom::MessagePortHost> port_host); + + // Creates a MessagePort for the tab with the given `web_contents`. + // Returns nullptr if the tab is not available. + std::unique_ptr<MessagePort> CreateReceiverForTab( + const ExtensionId& extension_id, + const PortId& receiver_port_id, + content::WebContents* receiver_contents, + int receiver_frame_id, + const std::string& receiver_document_id); + void OpenChannelToNativeAppImpl( const ChannelEndpoint& source, const PortId& source_port_id,
diff --git a/extensions/browser/api/messaging/messaging_delegate.cc b/extensions/browser/api/messaging/messaging_delegate.cc index 40e7c23..9e0415c 100644 --- a/extensions/browser/api/messaging/messaging_delegate.cc +++ b/extensions/browser/api/messaging/messaging_delegate.cc
@@ -31,17 +31,6 @@ return nullptr; } -std::unique_ptr<MessagePort> MessagingDelegate::CreateReceiverForTab( - base::WeakPtr<MessagePort::ChannelDelegate> channel_delegate, - const ExtensionId& extension_id, - const PortId& receiver_port_id, - content::WebContents* receiver_contents, - int receiver_frame_id, - const std::string& receiver_document_id) { - NOTIMPLEMENTED(); - return nullptr; -} - std::unique_ptr<MessagePort> MessagingDelegate::CreateReceiverForNativeApp( content::BrowserContext* browser_context, base::WeakPtr<MessagePort::ChannelDelegate> channel_delegate,
diff --git a/extensions/browser/api/messaging/messaging_delegate.h b/extensions/browser/api/messaging/messaging_delegate.h index c58545b..24a02be9 100644 --- a/extensions/browser/api/messaging/messaging_delegate.h +++ b/extensions/browser/api/messaging/messaging_delegate.h
@@ -53,17 +53,6 @@ content::BrowserContext* browser_context, int tab_id); - // Creates a MessagePort for the tab with the given ID and populates - // |receiver_browser_context| with the tab's BrowserContext. Returns nullptr - // if the tab is not available. - virtual std::unique_ptr<MessagePort> CreateReceiverForTab( - base::WeakPtr<MessagePort::ChannelDelegate> channel_delegate, - const ExtensionId& extension_id, - const PortId& receiver_port_id, - content::WebContents* receiver_contents, - int receiver_frame_id, - const std::string& receiver_document_id); - // Creates a MessagePort for a native app. If the port cannot be created, // returns nullptr and may populate |error_out|. virtual std::unique_ptr<MessagePort> CreateReceiverForNativeApp(
diff --git a/gpu/command_buffer/common/context_creation_attribs.h b/gpu/command_buffer/common/context_creation_attribs.h index 53fb0fe..6f3bfd8 100644 --- a/gpu/command_buffer/common/context_creation_attribs.h +++ b/gpu/command_buffer/common/context_creation_attribs.h
@@ -46,7 +46,7 @@ bool enable_gles2_interface = true; bool enable_grcontext = false; bool enable_raster_interface = false; - bool enable_oop_rasterization = false; + bool enable_gpu_rasterization = false; ContextType context_type = CONTEXT_TYPE_OPENGLES2; };
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc index 50bc175..3ccdebc1 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
@@ -954,8 +954,8 @@ FAIL_INIT_IF_NOT(!attrib_helper.fail_if_major_perf_caveat || !feature_info_->feature_flags().is_swiftshader_for_webgl, "fail_if_major_perf_caveat + swiftshader"); - FAIL_INIT_IF_NOT(!attrib_helper.enable_oop_rasterization, - "oop rasterization not supported"); + FAIL_INIT_IF_NOT(!attrib_helper.enable_gpu_rasterization, + "GPU rasterization not supported"); FAIL_INIT_IF_NOT(!IsES31ForTestingContextType(attrib_helper.context_type) || feature_info_->gl_version_info().IsAtLeastGLES(3, 1), "ES 3.1 context type requires an ES 3.1 ANGLE context");
diff --git a/gpu/command_buffer/service/raster_decoder.cc b/gpu/command_buffer/service/raster_decoder.cc index c49fd23..8bcc432 100644 --- a/gpu/command_buffer/service/raster_decoder.cc +++ b/gpu/command_buffer/service/raster_decoder.cc
@@ -1078,7 +1078,7 @@ query_manager_ = std::make_unique<RasterQueryManager>(shared_context_state_); - if (attrib_helper.enable_oop_rasterization) { + if (attrib_helper.enable_gpu_rasterization) { DCHECK(gr_context() || graphite_context()); use_gpu_raster_ = true; paint_cache_ = std::make_unique<cc::ServicePaintCache>();
diff --git a/gpu/command_buffer/service/raster_decoder_unittest.cc b/gpu/command_buffer/service/raster_decoder_unittest.cc index 68f580d..ebad30b 100644 --- a/gpu/command_buffer/service/raster_decoder_unittest.cc +++ b/gpu/command_buffer/service/raster_decoder_unittest.cc
@@ -284,7 +284,7 @@ GpuPreferences(), nullptr /* memory_tracker */, &shared_image_manager_, context_state_, true /* is_privileged */)); ContextCreationAttribs attribs; - attribs.enable_oop_rasterization = true; + attribs.enable_gpu_rasterization = true; attribs.enable_raster_interface = true; CHECK_EQ(decoder->Initialize(context_state_->surface(), context_state_->context(), true,
diff --git a/gpu/command_buffer/tests/fuzzer_main.cc b/gpu/command_buffer/tests/fuzzer_main.cc index 280adeba..e05b77f 100644 --- a/gpu/command_buffer/tests/fuzzer_main.cc +++ b/gpu/command_buffer/tests/fuzzer_main.cc
@@ -253,7 +253,7 @@ attrib_helper.context_type = CONTEXT_TYPE_OPENGLES2; } #endif - attrib_helper.enable_oop_rasterization = it.GetBit(); + attrib_helper.enable_gpu_rasterization = it.GetBit(); #if defined(GPU_FUZZER_USE_STUB) std::vector<std::string_view> enabled_extensions;
diff --git a/gpu/ipc/client/raster_in_process_context_tests.cc b/gpu/ipc/client/raster_in_process_context_tests.cc index 7a81ae9..30a01e5d 100644 --- a/gpu/ipc/client/raster_in_process_context_tests.cc +++ b/gpu/ipc/client/raster_in_process_context_tests.cc
@@ -43,7 +43,7 @@ ContextCreationAttribs attributes; attributes.bind_generates_resource = false; - attributes.enable_oop_rasterization = true; + attributes.enable_gpu_rasterization = true; attributes.enable_gles2_interface = false; attributes.enable_raster_interface = true;
diff --git a/gpu/ipc/common/context_creation_attribs_mojom_traits.cc b/gpu/ipc/common/context_creation_attribs_mojom_traits.cc index f13ebf5..0d68f6a87 100644 --- a/gpu/ipc/common/context_creation_attribs_mojom_traits.cc +++ b/gpu/ipc/common/context_creation_attribs_mojom_traits.cc
@@ -24,7 +24,7 @@ out->enable_gles2_interface = data.enable_gles2_interface(); out->enable_grcontext = data.enable_grcontext(); out->enable_raster_interface = data.enable_raster_interface(); - out->enable_oop_rasterization = data.enable_oop_rasterization(); + out->enable_gpu_rasterization = data.enable_gpu_rasterization(); return true; }
diff --git a/gpu/ipc/common/context_creation_attribs_mojom_traits.h b/gpu/ipc/common/context_creation_attribs_mojom_traits.h index ef6dad6..22513bb 100644 --- a/gpu/ipc/common/context_creation_attribs_mojom_traits.h +++ b/gpu/ipc/common/context_creation_attribs_mojom_traits.h
@@ -99,9 +99,9 @@ return attribs.enable_raster_interface; } - static bool enable_oop_rasterization( + static bool enable_gpu_rasterization( const gpu::ContextCreationAttribs& attribs) { - return attribs.enable_oop_rasterization; + return attribs.enable_gpu_rasterization; } static gpu::ContextType context_type(
diff --git a/gpu/ipc/common/gpu_channel.mojom b/gpu/ipc/common/gpu_channel.mojom index 2e647fab..2448e6c 100644 --- a/gpu/ipc/common/gpu_channel.mojom +++ b/gpu/ipc/common/gpu_channel.mojom
@@ -61,7 +61,7 @@ bool enable_gles2_interface = true; bool enable_grcontext = false; bool enable_raster_interface = false; - bool enable_oop_rasterization = false; + bool enable_gpu_rasterization = false; ContextType context_type = kOpenGLES2; };
diff --git a/infra/config/console-header.star b/infra/config/console-header.star index 28b6f71..ffb0556f 100644 --- a/infra/config/console-header.star +++ b/infra/config/console-header.star
@@ -834,20 +834,22 @@ text = "Tree Closers", url = "https://chromium-status.appspot.com/", ), - console_ids = ["chromium/Tree Closers"], + console_ids = [ + "chromium/chromium tree closers", + "chromium/android tree closers", + "chromium/chromiumos tree closers", + "chromium/chromium.gpu tree closers", + "chromium/ios tree closers", + ], ), headers.console_group( - title = headers.link( - text = "Gardener Rotations", - url = "https://chromium-status.appspot.com/", - ), console_ids = [ - "chromium/android rotation", - "chromium/angle rotation", - "chromium/cft rotation", "chromium/chromium rotation", - "chromium/chromium.gpu rotation", + "chromium/android rotation", + "chromium/cft rotation", "chrome/chrome.perf", + "chromium/chromium.gpu rotation", + "chromium/angle rotation", "chromium/dawn rotation", "chromium/fuchsia rotation", "chromium/ios rotation",
diff --git "a/infra/config/generated/builders/ci/Android Release \050Nexus 5X\051/gn-args.json" "b/infra/config/generated/builders/ci/Android Release \050Nexus 5X\051/gn-args.json" index 0ab89c0..3e79f6b 100644 --- "a/infra/config/generated/builders/ci/Android Release \050Nexus 5X\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/Android Release \050Nexus 5X\051/gn-args.json"
@@ -10,6 +10,7 @@ "symbol_level": 1, "target_cpu": "arm64", "target_os": "android", + "use_reclient": false, "use_remoteexec": true, "use_siso": true, "use_static_angle": true
diff --git "a/infra/config/generated/builders/ci/Android Release \050Nexus 5X\051/properties.json" "b/infra/config/generated/builders/ci/Android Release \050Nexus 5X\051/properties.json" index c8804dd..6471ca62 100644 --- "a/infra/config/generated/builders/ci/Android Release \050Nexus 5X\051/properties.json" +++ "b/infra/config/generated/builders/ci/Android Release \050Nexus 5X\051/properties.json"
@@ -55,18 +55,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Android Release (Nexus 5X)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git "a/infra/config/generated/builders/ci/Android Release \050Nexus 5X\051/shadow-properties.json" "b/infra/config/generated/builders/ci/Android Release \050Nexus 5X\051/shadow-properties.json" index 673c7c0..78dedff8 100644 --- "a/infra/config/generated/builders/ci/Android Release \050Nexus 5X\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/Android Release \050Nexus 5X\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git "a/infra/config/generated/builders/ci/Android Release \050Pixel 2\051/gn-args.json" "b/infra/config/generated/builders/ci/Android Release \050Pixel 2\051/gn-args.json" index 0ab89c0..3e79f6b 100644 --- "a/infra/config/generated/builders/ci/Android Release \050Pixel 2\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/Android Release \050Pixel 2\051/gn-args.json"
@@ -10,6 +10,7 @@ "symbol_level": 1, "target_cpu": "arm64", "target_os": "android", + "use_reclient": false, "use_remoteexec": true, "use_siso": true, "use_static_angle": true
diff --git "a/infra/config/generated/builders/ci/Android Release \050Pixel 2\051/properties.json" "b/infra/config/generated/builders/ci/Android Release \050Pixel 2\051/properties.json" index f11717d..0e8cad29 100644 --- "a/infra/config/generated/builders/ci/Android Release \050Pixel 2\051/properties.json" +++ "b/infra/config/generated/builders/ci/Android Release \050Pixel 2\051/properties.json"
@@ -59,18 +59,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Android Release (Pixel 2)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git "a/infra/config/generated/builders/ci/Android Release \050Pixel 2\051/shadow-properties.json" "b/infra/config/generated/builders/ci/Android Release \050Pixel 2\051/shadow-properties.json" index 673c7c0..78dedff8 100644 --- "a/infra/config/generated/builders/ci/Android Release \050Pixel 2\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/Android Release \050Pixel 2\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/CFI Linux CF/gn-args.json b/infra/config/generated/builders/ci/CFI Linux CF/gn-args.json index a5b957d..0e6f3ff 100644 --- a/infra/config/generated/builders/ci/CFI Linux CF/gn-args.json +++ b/infra/config/generated/builders/ci/CFI Linux CF/gn-args.json
@@ -10,6 +10,7 @@ "use_cfi_diag": true, "use_cfi_icall": true, "use_cfi_recover": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true, "use_thin_lto": true
diff --git a/infra/config/generated/builders/ci/CFI Linux CF/properties.json b/infra/config/generated/builders/ci/CFI Linux CF/properties.json index ecedc427..25163199 100644 --- a/infra/config/generated/builders/ci/CFI Linux CF/properties.json +++ b/infra/config/generated/builders/ci/CFI Linux CF/properties.json
@@ -47,18 +47,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/CFI Linux CF/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/CFI Linux CF/shadow-properties.json b/infra/config/generated/builders/ci/CFI Linux CF/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/CFI Linux CF/shadow-properties.json +++ b/infra/config/generated/builders/ci/CFI Linux CF/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/CFI Linux ToT/gn-args.json b/infra/config/generated/builders/ci/CFI Linux ToT/gn-args.json index a2cff7a..01b10876 100644 --- a/infra/config/generated/builders/ci/CFI Linux ToT/gn-args.json +++ b/infra/config/generated/builders/ci/CFI Linux ToT/gn-args.json
@@ -11,6 +11,7 @@ "use_cfi_cast": true, "use_cfi_diag": true, "use_cfi_icall": true, + "use_reclient": false, "use_siso": true, "use_thin_lto": true }
diff --git a/infra/config/generated/builders/ci/CFI Linux ToT/properties.json b/infra/config/generated/builders/ci/CFI Linux ToT/properties.json index c6679fd..1be3d62 100644 --- a/infra/config/generated/builders/ci/CFI Linux ToT/properties.json +++ b/infra/config/generated/builders/ci/CFI Linux ToT/properties.json
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/CFI Linux ToT/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/CFI Linux ToT/shadow-properties.json b/infra/config/generated/builders/ci/CFI Linux ToT/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/CFI Linux ToT/shadow-properties.json +++ b/infra/config/generated/builders/ci/CFI Linux ToT/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/CrWinAsan\050dll\051/gn-args.json" "b/infra/config/generated/builders/ci/CrWinAsan\050dll\051/gn-args.json" index 9c41c11..88cad37 100644 --- "a/infra/config/generated/builders/ci/CrWinAsan\050dll\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/CrWinAsan\050dll\051/gn-args.json"
@@ -9,6 +9,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_siso": true, "v8_enable_verify_heap": true }
diff --git "a/infra/config/generated/builders/ci/CrWinAsan\050dll\051/properties.json" "b/infra/config/generated/builders/ci/CrWinAsan\050dll\051/properties.json" index 0324017..3a216035 100644 --- "a/infra/config/generated/builders/ci/CrWinAsan\050dll\051/properties.json" +++ "b/infra/config/generated/builders/ci/CrWinAsan\050dll\051/properties.json"
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/CrWinAsan(dll)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git "a/infra/config/generated/builders/ci/CrWinAsan\050dll\051/shadow-properties.json" "b/infra/config/generated/builders/ci/CrWinAsan\050dll\051/shadow-properties.json" index c479fd8..54c02663 100644 --- "a/infra/config/generated/builders/ci/CrWinAsan\050dll\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/CrWinAsan\050dll\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/CrWinAsan/gn-args.json b/infra/config/generated/builders/ci/CrWinAsan/gn-args.json index cb3fa676..b4de18c4 100644 --- a/infra/config/generated/builders/ci/CrWinAsan/gn-args.json +++ b/infra/config/generated/builders/ci/CrWinAsan/gn-args.json
@@ -10,6 +10,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_siso": true, "v8_enable_verify_heap": true }
diff --git a/infra/config/generated/builders/ci/CrWinAsan/properties.json b/infra/config/generated/builders/ci/CrWinAsan/properties.json index ada847e..493da931 100644 --- a/infra/config/generated/builders/ci/CrWinAsan/properties.json +++ b/infra/config/generated/builders/ci/CrWinAsan/properties.json
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/CrWinAsan/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/CrWinAsan/shadow-properties.json b/infra/config/generated/builders/ci/CrWinAsan/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/CrWinAsan/shadow-properties.json +++ b/infra/config/generated/builders/ci/CrWinAsan/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/GPU Linux Builder \050dbg\051/gn-args.json" "b/infra/config/generated/builders/ci/GPU Linux Builder \050dbg\051/gn-args.json" index f1d02bd9..6eda569 100644 --- "a/infra/config/generated/builders/ci/GPU Linux Builder \050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/GPU Linux Builder \050dbg\051/gn-args.json"
@@ -7,6 +7,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git "a/infra/config/generated/builders/ci/GPU Linux Builder \050dbg\051/properties.json" "b/infra/config/generated/builders/ci/GPU Linux Builder \050dbg\051/properties.json" index b4d7893..51e2da04 100644 --- "a/infra/config/generated/builders/ci/GPU Linux Builder \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/ci/GPU Linux Builder \050dbg\051/properties.json"
@@ -84,18 +84,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/GPU Linux Builder (dbg)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git "a/infra/config/generated/builders/ci/GPU Linux Builder \050dbg\051/shadow-properties.json" "b/infra/config/generated/builders/ci/GPU Linux Builder \050dbg\051/shadow-properties.json" index 673c7c0..78dedff8 100644 --- "a/infra/config/generated/builders/ci/GPU Linux Builder \050dbg\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/GPU Linux Builder \050dbg\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/GPU Linux Builder/gn-args.json b/infra/config/generated/builders/ci/GPU Linux Builder/gn-args.json index 145d7af01..a206fb4a 100644 --- a/infra/config/generated/builders/ci/GPU Linux Builder/gn-args.json +++ b/infra/config/generated/builders/ci/GPU Linux Builder/gn-args.json
@@ -8,6 +8,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/GPU Linux Builder/properties.json b/infra/config/generated/builders/ci/GPU Linux Builder/properties.json index 3d38661..8b411b1 100644 --- a/infra/config/generated/builders/ci/GPU Linux Builder/properties.json +++ b/infra/config/generated/builders/ci/GPU Linux Builder/properties.json
@@ -107,18 +107,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/GPU Linux Builder/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/GPU Linux Builder/shadow-properties.json b/infra/config/generated/builders/ci/GPU Linux Builder/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/GPU Linux Builder/shadow-properties.json +++ b/infra/config/generated/builders/ci/GPU Linux Builder/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git "a/infra/config/generated/builders/ci/GPU Mac Builder \050dbg\051/gn-args.json" "b/infra/config/generated/builders/ci/GPU Mac Builder \050dbg\051/gn-args.json" index 098d862..13f9d2b3 100644 --- "a/infra/config/generated/builders/ci/GPU Mac Builder \050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/GPU Mac Builder \050dbg\051/gn-args.json"
@@ -7,6 +7,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "mac", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git "a/infra/config/generated/builders/ci/GPU Mac Builder \050dbg\051/properties.json" "b/infra/config/generated/builders/ci/GPU Mac Builder \050dbg\051/properties.json" index 824dfe6b..16ed6fe3 100644 --- "a/infra/config/generated/builders/ci/GPU Mac Builder \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/ci/GPU Mac Builder \050dbg\051/properties.json"
@@ -122,18 +122,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/GPU Mac Builder (dbg)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git "a/infra/config/generated/builders/ci/GPU Mac Builder \050dbg\051/shadow-properties.json" "b/infra/config/generated/builders/ci/GPU Mac Builder \050dbg\051/shadow-properties.json" index 673c7c0..78dedff8 100644 --- "a/infra/config/generated/builders/ci/GPU Mac Builder \050dbg\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/GPU Mac Builder \050dbg\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/GPU Mac Builder/gn-args.json b/infra/config/generated/builders/ci/GPU Mac Builder/gn-args.json index 7d56e91..901c0064 100644 --- a/infra/config/generated/builders/ci/GPU Mac Builder/gn-args.json +++ b/infra/config/generated/builders/ci/GPU Mac Builder/gn-args.json
@@ -8,6 +8,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "mac", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/GPU Mac Builder/properties.json b/infra/config/generated/builders/ci/GPU Mac Builder/properties.json index 172cb72..5b4ba307a 100644 --- a/infra/config/generated/builders/ci/GPU Mac Builder/properties.json +++ b/infra/config/generated/builders/ci/GPU Mac Builder/properties.json
@@ -123,18 +123,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/GPU Mac Builder/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/GPU Mac Builder/shadow-properties.json b/infra/config/generated/builders/ci/GPU Mac Builder/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/GPU Mac Builder/shadow-properties.json +++ b/infra/config/generated/builders/ci/GPU Mac Builder/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git "a/infra/config/generated/builders/ci/GPU Win x64 Builder \050dbg\051/gn-args.json" "b/infra/config/generated/builders/ci/GPU Win x64 Builder \050dbg\051/gn-args.json" index 4ab17024..786ccd71 100644 --- "a/infra/config/generated/builders/ci/GPU Win x64 Builder \050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/GPU Win x64 Builder \050dbg\051/gn-args.json"
@@ -7,6 +7,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git "a/infra/config/generated/builders/ci/GPU Win x64 Builder \050dbg\051/properties.json" "b/infra/config/generated/builders/ci/GPU Win x64 Builder \050dbg\051/properties.json" index f1d1883..dfd763d 100644 --- "a/infra/config/generated/builders/ci/GPU Win x64 Builder \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/ci/GPU Win x64 Builder \050dbg\051/properties.json"
@@ -84,18 +84,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/GPU Win x64 Builder (dbg)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git "a/infra/config/generated/builders/ci/GPU Win x64 Builder \050dbg\051/shadow-properties.json" "b/infra/config/generated/builders/ci/GPU Win x64 Builder \050dbg\051/shadow-properties.json" index 673c7c0..78dedff8 100644 --- "a/infra/config/generated/builders/ci/GPU Win x64 Builder \050dbg\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/GPU Win x64 Builder \050dbg\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/GPU Win x64 Builder/gn-args.json b/infra/config/generated/builders/ci/GPU Win x64 Builder/gn-args.json index c7056d84..5ede0132 100644 --- a/infra/config/generated/builders/ci/GPU Win x64 Builder/gn-args.json +++ b/infra/config/generated/builders/ci/GPU Win x64 Builder/gn-args.json
@@ -9,6 +9,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/GPU Win x64 Builder/properties.json b/infra/config/generated/builders/ci/GPU Win x64 Builder/properties.json index d1adca1..5044b56 100644 --- a/infra/config/generated/builders/ci/GPU Win x64 Builder/properties.json +++ b/infra/config/generated/builders/ci/GPU Win x64 Builder/properties.json
@@ -91,18 +91,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/GPU Win x64 Builder/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/GPU Win x64 Builder/shadow-properties.json b/infra/config/generated/builders/ci/GPU Win x64 Builder/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/GPU Win x64 Builder/shadow-properties.json +++ b/infra/config/generated/builders/ci/GPU Win x64 Builder/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/Linux ASan LSan Builder/gn-args.json b/infra/config/generated/builders/ci/Linux ASan LSan Builder/gn-args.json index ee89f687..9b1f1e5 100644 --- a/infra/config/generated/builders/ci/Linux ASan LSan Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Linux ASan LSan Builder/gn-args.json
@@ -9,6 +9,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/Linux ASan LSan Builder/properties.json b/infra/config/generated/builders/ci/Linux ASan LSan Builder/properties.json index f44d0ce..c66876e 100644 --- a/infra/config/generated/builders/ci/Linux ASan LSan Builder/properties.json +++ b/infra/config/generated/builders/ci/Linux ASan LSan Builder/properties.json
@@ -87,18 +87,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Linux ASan LSan Builder/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/Linux ASan LSan Builder/shadow-properties.json b/infra/config/generated/builders/ci/Linux ASan LSan Builder/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/Linux ASan LSan Builder/shadow-properties.json +++ b/infra/config/generated/builders/ci/Linux ASan LSan Builder/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/Linux CFI/gn-args.json b/infra/config/generated/builders/ci/Linux CFI/gn-args.json index ba3946c..f7fa97b 100644 --- a/infra/config/generated/builders/ci/Linux CFI/gn-args.json +++ b/infra/config/generated/builders/ci/Linux CFI/gn-args.json
@@ -9,6 +9,7 @@ "use_cfi_cast": true, "use_cfi_diag": true, "use_cfi_icall": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true, "use_thin_lto": true
diff --git a/infra/config/generated/builders/ci/Linux CFI/properties.json b/infra/config/generated/builders/ci/Linux CFI/properties.json index 709f999..2971011 100644 --- a/infra/config/generated/builders/ci/Linux CFI/properties.json +++ b/infra/config/generated/builders/ci/Linux CFI/properties.json
@@ -49,18 +49,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Linux CFI/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/Linux CFI/shadow-properties.json b/infra/config/generated/builders/ci/Linux CFI/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/Linux CFI/shadow-properties.json +++ b/infra/config/generated/builders/ci/Linux CFI/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/gn-args.json b/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/gn-args.json index 6f5e469..1ef807b 100644 --- a/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/gn-args.json
@@ -8,6 +8,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "chromeos", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/properties.json b/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/properties.json index 6ab8527b..de1aad59 100644 --- a/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/properties.json +++ b/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/properties.json
@@ -93,18 +93,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/shadow-properties.json b/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/shadow-properties.json +++ b/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/gn-args.json b/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/gn-args.json index f07f119..ff69331d 100644 --- a/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/gn-args.json
@@ -7,6 +7,7 @@ "msan_track_origins": 2, "target_cpu": "x64", "target_os": "chromeos", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/properties.json b/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/properties.json index c743997..11d67249 100644 --- a/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/properties.json +++ b/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/properties.json
@@ -91,18 +91,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/shadow-properties.json b/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/shadow-properties.json +++ b/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/Linux MSan Builder/gn-args.json b/infra/config/generated/builders/ci/Linux MSan Builder/gn-args.json index da71aed..ecf30d6 100644 --- a/infra/config/generated/builders/ci/Linux MSan Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Linux MSan Builder/gn-args.json
@@ -8,6 +8,7 @@ "msan_track_origins": 2, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/Linux MSan Builder/properties.json b/infra/config/generated/builders/ci/Linux MSan Builder/properties.json index 6238948..e8d13bc 100644 --- a/infra/config/generated/builders/ci/Linux MSan Builder/properties.json +++ b/infra/config/generated/builders/ci/Linux MSan Builder/properties.json
@@ -85,18 +85,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Linux MSan Builder/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/Linux MSan Builder/shadow-properties.json b/infra/config/generated/builders/ci/Linux MSan Builder/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/Linux MSan Builder/shadow-properties.json +++ b/infra/config/generated/builders/ci/Linux MSan Builder/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/Linux MSan Tests/properties.json b/infra/config/generated/builders/ci/Linux MSan Tests/properties.json index 56b1335..774ab08 100644 --- a/infra/config/generated/builders/ci/Linux MSan Tests/properties.json +++ b/infra/config/generated/builders/ci/Linux MSan Tests/properties.json
@@ -75,18 +75,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Linux MSan Tests/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 80 },
diff --git a/infra/config/generated/builders/ci/Linux MSan Tests/shadow-properties.json b/infra/config/generated/builders/ci/Linux MSan Tests/shadow-properties.json index 22e4eb0..c833aa2 100644 --- a/infra/config/generated/builders/ci/Linux MSan Tests/shadow-properties.json +++ b/infra/config/generated/builders/ci/Linux MSan Tests/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 80 }
diff --git a/infra/config/generated/builders/ci/Linux TSan Builder/gn-args.json b/infra/config/generated/builders/ci/Linux TSan Builder/gn-args.json index a389864c..42c3f12 100644 --- a/infra/config/generated/builders/ci/Linux TSan Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Linux TSan Builder/gn-args.json
@@ -7,6 +7,7 @@ "is_tsan": true, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/Linux TSan Builder/properties.json b/infra/config/generated/builders/ci/Linux TSan Builder/properties.json index 03e79d0..e649ed3f 100644 --- a/infra/config/generated/builders/ci/Linux TSan Builder/properties.json +++ b/infra/config/generated/builders/ci/Linux TSan Builder/properties.json
@@ -85,18 +85,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Linux TSan Builder/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/Linux TSan Builder/shadow-properties.json b/infra/config/generated/builders/ci/Linux TSan Builder/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/Linux TSan Builder/shadow-properties.json +++ b/infra/config/generated/builders/ci/Linux TSan Builder/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/Linux TSan Tests/properties.json b/infra/config/generated/builders/ci/Linux TSan Tests/properties.json index 5c61896f..4b3ae91 100644 --- a/infra/config/generated/builders/ci/Linux TSan Tests/properties.json +++ b/infra/config/generated/builders/ci/Linux TSan Tests/properties.json
@@ -75,18 +75,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Linux TSan Tests/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 80 },
diff --git a/infra/config/generated/builders/ci/Linux TSan Tests/shadow-properties.json b/infra/config/generated/builders/ci/Linux TSan Tests/shadow-properties.json index 22e4eb0..c833aa2 100644 --- a/infra/config/generated/builders/ci/Linux TSan Tests/shadow-properties.json +++ b/infra/config/generated/builders/ci/Linux TSan Tests/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 80 }
diff --git a/infra/config/generated/builders/ci/Linux UBSan Builder/gn-args.json b/infra/config/generated/builders/ci/Linux UBSan Builder/gn-args.json index 93e56b7..d2134d4 100644 --- a/infra/config/generated/builders/ci/Linux UBSan Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Linux UBSan Builder/gn-args.json
@@ -8,6 +8,7 @@ "is_ubsan_no_recover": true, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/Linux UBSan Builder/properties.json b/infra/config/generated/builders/ci/Linux UBSan Builder/properties.json index e6c01c1..e1760ff 100644 --- a/infra/config/generated/builders/ci/Linux UBSan Builder/properties.json +++ b/infra/config/generated/builders/ci/Linux UBSan Builder/properties.json
@@ -85,18 +85,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Linux UBSan Builder/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/Linux UBSan Builder/shadow-properties.json b/infra/config/generated/builders/ci/Linux UBSan Builder/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/Linux UBSan Builder/shadow-properties.json +++ b/infra/config/generated/builders/ci/Linux UBSan Builder/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/Linux UBSan Tests/properties.json b/infra/config/generated/builders/ci/Linux UBSan Tests/properties.json index 995f236..dcb5d8d 100644 --- a/infra/config/generated/builders/ci/Linux UBSan Tests/properties.json +++ b/infra/config/generated/builders/ci/Linux UBSan Tests/properties.json
@@ -75,18 +75,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Linux UBSan Tests/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 80 },
diff --git a/infra/config/generated/builders/ci/Linux UBSan Tests/shadow-properties.json b/infra/config/generated/builders/ci/Linux UBSan Tests/shadow-properties.json index 22e4eb0..c833aa2 100644 --- a/infra/config/generated/builders/ci/Linux UBSan Tests/shadow-properties.json +++ b/infra/config/generated/builders/ci/Linux UBSan Tests/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 80 }
diff --git a/infra/config/generated/builders/ci/Mac ASan 64 Builder/gn-args.json b/infra/config/generated/builders/ci/Mac ASan 64 Builder/gn-args.json index 1e77f0c..14cb3cf 100644 --- a/infra/config/generated/builders/ci/Mac ASan 64 Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Mac ASan 64 Builder/gn-args.json
@@ -7,6 +7,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "mac", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/Mac ASan 64 Builder/properties.json b/infra/config/generated/builders/ci/Mac ASan 64 Builder/properties.json index de66a96..36f4315 100644 --- a/infra/config/generated/builders/ci/Mac ASan 64 Builder/properties.json +++ b/infra/config/generated/builders/ci/Mac ASan 64 Builder/properties.json
@@ -85,18 +85,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/Mac ASan 64 Builder/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/Mac ASan 64 Builder/shadow-properties.json b/infra/config/generated/builders/ci/Mac ASan 64 Builder/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/Mac ASan 64 Builder/shadow-properties.json +++ b/infra/config/generated/builders/ci/Mac ASan 64 Builder/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git "a/infra/config/generated/builders/ci/ToTAndroid \050dbg\051/gn-args.json" "b/infra/config/generated/builders/ci/ToTAndroid \050dbg\051/gn-args.json" index 2da00ba..05361e3 100644 --- "a/infra/config/generated/builders/ci/ToTAndroid \050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/ToTAndroid \050dbg\051/gn-args.json"
@@ -7,6 +7,7 @@ "llvm_force_head_revision": true, "target_cpu": "arm", "target_os": "android", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTAndroid \050dbg\051/properties.json" "b/infra/config/generated/builders/ci/ToTAndroid \050dbg\051/properties.json" index ad4b64a..92a7a54 100644 --- "a/infra/config/generated/builders/ci/ToTAndroid \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/ci/ToTAndroid \050dbg\051/properties.json"
@@ -50,18 +50,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTAndroid (dbg)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git "a/infra/config/generated/builders/ci/ToTAndroid \050dbg\051/shadow-properties.json" "b/infra/config/generated/builders/ci/ToTAndroid \050dbg\051/shadow-properties.json" index c479fd8..54c02663 100644 --- "a/infra/config/generated/builders/ci/ToTAndroid \050dbg\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/ToTAndroid \050dbg\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTAndroid x64/gn-args.json b/infra/config/generated/builders/ci/ToTAndroid x64/gn-args.json index 75864bc5..4da45b5 100644 --- a/infra/config/generated/builders/ci/ToTAndroid x64/gn-args.json +++ b/infra/config/generated/builders/ci/ToTAndroid x64/gn-args.json
@@ -8,6 +8,7 @@ "llvm_force_head_revision": true, "target_cpu": "x64", "target_os": "android", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTAndroid x64/properties.json b/infra/config/generated/builders/ci/ToTAndroid x64/properties.json index 5b8099f0..671df7e 100644 --- a/infra/config/generated/builders/ci/ToTAndroid x64/properties.json +++ b/infra/config/generated/builders/ci/ToTAndroid x64/properties.json
@@ -50,18 +50,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTAndroid x64/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTAndroid x64/shadow-properties.json b/infra/config/generated/builders/ci/ToTAndroid x64/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTAndroid x64/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTAndroid x64/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTAndroid x86/gn-args.json b/infra/config/generated/builders/ci/ToTAndroid x86/gn-args.json index f9f8815..efd74f8 100644 --- a/infra/config/generated/builders/ci/ToTAndroid x86/gn-args.json +++ b/infra/config/generated/builders/ci/ToTAndroid x86/gn-args.json
@@ -8,6 +8,7 @@ "llvm_force_head_revision": true, "target_cpu": "x86", "target_os": "android", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTAndroid x86/properties.json b/infra/config/generated/builders/ci/ToTAndroid x86/properties.json index 344aa65..2fcdd0c 100644 --- a/infra/config/generated/builders/ci/ToTAndroid x86/properties.json +++ b/infra/config/generated/builders/ci/ToTAndroid x86/properties.json
@@ -50,18 +50,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTAndroid x86/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTAndroid x86/shadow-properties.json b/infra/config/generated/builders/ci/ToTAndroid x86/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTAndroid x86/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTAndroid x86/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTAndroid/gn-args.json b/infra/config/generated/builders/ci/ToTAndroid/gn-args.json index cfb18b1b..69ac61b 100644 --- a/infra/config/generated/builders/ci/ToTAndroid/gn-args.json +++ b/infra/config/generated/builders/ci/ToTAndroid/gn-args.json
@@ -12,6 +12,7 @@ "symbol_level": 1, "target_cpu": "arm", "target_os": "android", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTAndroid/properties.json b/infra/config/generated/builders/ci/ToTAndroid/properties.json index 796c1a8..2f232a1 100644 --- a/infra/config/generated/builders/ci/ToTAndroid/properties.json +++ b/infra/config/generated/builders/ci/ToTAndroid/properties.json
@@ -50,18 +50,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTAndroid/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTAndroid/shadow-properties.json b/infra/config/generated/builders/ci/ToTAndroid/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTAndroid/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTAndroid/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTAndroid64/gn-args.json b/infra/config/generated/builders/ci/ToTAndroid64/gn-args.json index 16aa1d4e..5649fc3 100644 --- a/infra/config/generated/builders/ci/ToTAndroid64/gn-args.json +++ b/infra/config/generated/builders/ci/ToTAndroid64/gn-args.json
@@ -7,6 +7,7 @@ "llvm_force_head_revision": true, "target_cpu": "arm64", "target_os": "android", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTAndroid64/properties.json b/infra/config/generated/builders/ci/ToTAndroid64/properties.json index 2a8cd18..c0117500 100644 --- a/infra/config/generated/builders/ci/ToTAndroid64/properties.json +++ b/infra/config/generated/builders/ci/ToTAndroid64/properties.json
@@ -50,18 +50,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTAndroid64/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTAndroid64/shadow-properties.json b/infra/config/generated/builders/ci/ToTAndroid64/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTAndroid64/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTAndroid64/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTAndroidCoverage x86/gn-args.json b/infra/config/generated/builders/ci/ToTAndroidCoverage x86/gn-args.json index 8b404c7..4a5475a 100644 --- a/infra/config/generated/builders/ci/ToTAndroidCoverage x86/gn-args.json +++ b/infra/config/generated/builders/ci/ToTAndroidCoverage x86/gn-args.json
@@ -9,6 +9,7 @@ "target_cpu": "x86", "target_os": "android", "use_clang_coverage": true, + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTAndroidCoverage x86/properties.json b/infra/config/generated/builders/ci/ToTAndroidCoverage x86/properties.json index e023b65..78023b1 100644 --- a/infra/config/generated/builders/ci/ToTAndroidCoverage x86/properties.json +++ b/infra/config/generated/builders/ci/ToTAndroidCoverage x86/properties.json
@@ -50,18 +50,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTAndroidCoverage x86/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTAndroidCoverage x86/shadow-properties.json b/infra/config/generated/builders/ci/ToTAndroidCoverage x86/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTAndroidCoverage x86/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTAndroidCoverage x86/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTAndroidOfficial/gn-args.json b/infra/config/generated/builders/ci/ToTAndroidOfficial/gn-args.json index 5f4d945..d305e3b 100644 --- a/infra/config/generated/builders/ci/ToTAndroidOfficial/gn-args.json +++ b/infra/config/generated/builders/ci/ToTAndroidOfficial/gn-args.json
@@ -12,6 +12,7 @@ "symbol_level": 1, "target_cpu": "arm64", "target_os": "android", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTAndroidOfficial/properties.json b/infra/config/generated/builders/ci/ToTAndroidOfficial/properties.json index 6d4f0c2..28e359c 100644 --- a/infra/config/generated/builders/ci/ToTAndroidOfficial/properties.json +++ b/infra/config/generated/builders/ci/ToTAndroidOfficial/properties.json
@@ -51,18 +51,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTAndroidOfficial/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTAndroidOfficial/shadow-properties.json b/infra/config/generated/builders/ci/ToTAndroidOfficial/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTAndroidOfficial/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTAndroidOfficial/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTChromeOS \050dbg\051/gn-args.json" "b/infra/config/generated/builders/ci/ToTChromeOS \050dbg\051/gn-args.json" index 90256cf..f067ad36 100644 --- "a/infra/config/generated/builders/ci/ToTChromeOS \050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/ToTChromeOS \050dbg\051/gn-args.json"
@@ -5,6 +5,7 @@ "llvm_force_head_revision": true, "target_cpu": "x64", "target_os": "chromeos", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTChromeOS \050dbg\051/properties.json" "b/infra/config/generated/builders/ci/ToTChromeOS \050dbg\051/properties.json" index c35d0ab..52f7325 100644 --- "a/infra/config/generated/builders/ci/ToTChromeOS \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/ci/ToTChromeOS \050dbg\051/properties.json"
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTChromeOS (dbg)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git "a/infra/config/generated/builders/ci/ToTChromeOS \050dbg\051/shadow-properties.json" "b/infra/config/generated/builders/ci/ToTChromeOS \050dbg\051/shadow-properties.json" index c479fd8..54c02663 100644 --- "a/infra/config/generated/builders/ci/ToTChromeOS \050dbg\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/ToTChromeOS \050dbg\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTChromeOS/gn-args.json b/infra/config/generated/builders/ci/ToTChromeOS/gn-args.json index 740aa81..f2b728e 100644 --- a/infra/config/generated/builders/ci/ToTChromeOS/gn-args.json +++ b/infra/config/generated/builders/ci/ToTChromeOS/gn-args.json
@@ -6,6 +6,7 @@ "llvm_force_head_revision": true, "target_cpu": "x64", "target_os": "chromeos", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTChromeOS/properties.json b/infra/config/generated/builders/ci/ToTChromeOS/properties.json index c54a9d79..372e23c0 100644 --- a/infra/config/generated/builders/ci/ToTChromeOS/properties.json +++ b/infra/config/generated/builders/ci/ToTChromeOS/properties.json
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTChromeOS/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTChromeOS/shadow-properties.json b/infra/config/generated/builders/ci/ToTChromeOS/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTChromeOS/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTChromeOS/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTFuchsia x64/gn-args.json b/infra/config/generated/builders/ci/ToTFuchsia x64/gn-args.json index 9865922..d2c42b52 100644 --- a/infra/config/generated/builders/ci/ToTFuchsia x64/gn-args.json +++ b/infra/config/generated/builders/ci/ToTFuchsia x64/gn-args.json
@@ -8,6 +8,7 @@ "llvm_force_head_revision": true, "target_cpu": "x64", "target_os": "fuchsia", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTFuchsia x64/properties.json b/infra/config/generated/builders/ci/ToTFuchsia x64/properties.json index f97652e..b0695adc 100644 --- a/infra/config/generated/builders/ci/ToTFuchsia x64/properties.json +++ b/infra/config/generated/builders/ci/ToTFuchsia x64/properties.json
@@ -48,18 +48,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTFuchsia x64/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTFuchsia x64/shadow-properties.json b/infra/config/generated/builders/ci/ToTFuchsia x64/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTFuchsia x64/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTFuchsia x64/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/gn-args.json b/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/gn-args.json index 2a4731a..012a0ed 100644 --- a/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/gn-args.json +++ b/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/gn-args.json
@@ -8,6 +8,7 @@ "target_cpu": "arm64", "target_os": "fuchsia", "test_host_cpu": "arm64", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/properties.json b/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/properties.json index 605679e..1f71cb0 100644 --- a/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/properties.json +++ b/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/properties.json
@@ -50,18 +50,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/shadow-properties.json b/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTFuchsiaOfficial arm64/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTLinux \050dbg\051/gn-args.json" "b/infra/config/generated/builders/ci/ToTLinux \050dbg\051/gn-args.json" index 7694925..ccdd971 100644 --- "a/infra/config/generated/builders/ci/ToTLinux \050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/ToTLinux \050dbg\051/gn-args.json"
@@ -6,6 +6,7 @@ "llvm_force_head_revision": true, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTLinux \050dbg\051/properties.json" "b/infra/config/generated/builders/ci/ToTLinux \050dbg\051/properties.json" index 7ded6454..c310b47 100644 --- "a/infra/config/generated/builders/ci/ToTLinux \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/ci/ToTLinux \050dbg\051/properties.json"
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTLinux (dbg)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git "a/infra/config/generated/builders/ci/ToTLinux \050dbg\051/shadow-properties.json" "b/infra/config/generated/builders/ci/ToTLinux \050dbg\051/shadow-properties.json" index c479fd8..54c02663 100644 --- "a/infra/config/generated/builders/ci/ToTLinux \050dbg\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/ToTLinux \050dbg\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinux/gn-args.json b/infra/config/generated/builders/ci/ToTLinux/gn-args.json index 1d836eb1..3a92478 100644 --- a/infra/config/generated/builders/ci/ToTLinux/gn-args.json +++ b/infra/config/generated/builders/ci/ToTLinux/gn-args.json
@@ -8,6 +8,7 @@ "symbol_level": 2, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinux/properties.json b/infra/config/generated/builders/ci/ToTLinux/properties.json index 868be4d..d8b26805 100644 --- a/infra/config/generated/builders/ci/ToTLinux/properties.json +++ b/infra/config/generated/builders/ci/ToTLinux/properties.json
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTLinux/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTLinux/shadow-properties.json b/infra/config/generated/builders/ci/ToTLinux/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTLinux/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTLinux/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinuxASan/gn-args.json b/infra/config/generated/builders/ci/ToTLinuxASan/gn-args.json index 078264c..1169e3d2 100644 --- a/infra/config/generated/builders/ci/ToTLinuxASan/gn-args.json +++ b/infra/config/generated/builders/ci/ToTLinuxASan/gn-args.json
@@ -9,6 +9,7 @@ "llvm_force_head_revision": true, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinuxASan/properties.json b/infra/config/generated/builders/ci/ToTLinuxASan/properties.json index a79b09c..a4e0602f 100644 --- a/infra/config/generated/builders/ci/ToTLinuxASan/properties.json +++ b/infra/config/generated/builders/ci/ToTLinuxASan/properties.json
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTLinuxASan/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTLinuxASan/shadow-properties.json b/infra/config/generated/builders/ci/ToTLinuxASan/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTLinuxASan/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTLinuxASan/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/gn-args.json b/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/gn-args.json index 12497923..226665d 100644 --- a/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/gn-args.json +++ b/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/gn-args.json
@@ -14,6 +14,7 @@ "target_cpu": "x64", "target_os": "linux", "use_libfuzzer": true, + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/properties.json b/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/properties.json index af53103..05d149a6 100644 --- a/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/properties.json +++ b/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/properties.json
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/shadow-properties.json b/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTLinuxASanLibfuzzer/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinuxCoverage/gn-args.json b/infra/config/generated/builders/ci/ToTLinuxCoverage/gn-args.json index 381c24f..b422bab 100644 --- a/infra/config/generated/builders/ci/ToTLinuxCoverage/gn-args.json +++ b/infra/config/generated/builders/ci/ToTLinuxCoverage/gn-args.json
@@ -8,6 +8,7 @@ "target_cpu": "x64", "target_os": "linux", "use_clang_coverage": true, + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinuxMSan/gn-args.json b/infra/config/generated/builders/ci/ToTLinuxMSan/gn-args.json index f23ff6af..2d4519ae 100644 --- a/infra/config/generated/builders/ci/ToTLinuxMSan/gn-args.json +++ b/infra/config/generated/builders/ci/ToTLinuxMSan/gn-args.json
@@ -8,6 +8,7 @@ "msan_track_origins": 2, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinuxMSan/properties.json b/infra/config/generated/builders/ci/ToTLinuxMSan/properties.json index 86cca15a..51ab44d 100644 --- a/infra/config/generated/builders/ci/ToTLinuxMSan/properties.json +++ b/infra/config/generated/builders/ci/ToTLinuxMSan/properties.json
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTLinuxMSan/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTLinuxMSan/shadow-properties.json b/infra/config/generated/builders/ci/ToTLinuxMSan/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTLinuxMSan/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTLinuxMSan/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinuxPGO/gn-args.json b/infra/config/generated/builders/ci/ToTLinuxPGO/gn-args.json index 0a38ee9..84f90cc4 100644 --- a/infra/config/generated/builders/ci/ToTLinuxPGO/gn-args.json +++ b/infra/config/generated/builders/ci/ToTLinuxPGO/gn-args.json
@@ -7,6 +7,7 @@ "symbol_level": 0, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_siso": true, "v8_is_on_release_branch": true }
diff --git a/infra/config/generated/builders/ci/ToTLinuxPGO/properties.json b/infra/config/generated/builders/ci/ToTLinuxPGO/properties.json index 0d2e9b51..d7ba0dc 100644 --- a/infra/config/generated/builders/ci/ToTLinuxPGO/properties.json +++ b/infra/config/generated/builders/ci/ToTLinuxPGO/properties.json
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTLinuxPGO/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTLinuxPGO/shadow-properties.json b/infra/config/generated/builders/ci/ToTLinuxPGO/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTLinuxPGO/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTLinuxPGO/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinuxTSan/gn-args.json b/infra/config/generated/builders/ci/ToTLinuxTSan/gn-args.json index 60fa633..f9b50fa 100644 --- a/infra/config/generated/builders/ci/ToTLinuxTSan/gn-args.json +++ b/infra/config/generated/builders/ci/ToTLinuxTSan/gn-args.json
@@ -7,6 +7,7 @@ "llvm_force_head_revision": true, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinuxTSan/properties.json b/infra/config/generated/builders/ci/ToTLinuxTSan/properties.json index e0fa7d9a..bb2d175b 100644 --- a/infra/config/generated/builders/ci/ToTLinuxTSan/properties.json +++ b/infra/config/generated/builders/ci/ToTLinuxTSan/properties.json
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTLinuxTSan/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTLinuxTSan/shadow-properties.json b/infra/config/generated/builders/ci/ToTLinuxTSan/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTLinuxTSan/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTLinuxTSan/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/gn-args.json b/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/gn-args.json index f9c78047..d1aad91 100644 --- a/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/gn-args.json +++ b/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/gn-args.json
@@ -9,6 +9,7 @@ "llvm_force_head_revision": true, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/properties.json b/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/properties.json index a933bb8..b5de12a0 100644 --- a/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/properties.json +++ b/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/properties.json
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/shadow-properties.json b/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTLinuxUBSanVptr/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTMac \050dbg\051/gn-args.json" "b/infra/config/generated/builders/ci/ToTMac \050dbg\051/gn-args.json" index c960b9f..3c4797b1 100644 --- "a/infra/config/generated/builders/ci/ToTMac \050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/ToTMac \050dbg\051/gn-args.json"
@@ -6,6 +6,7 @@ "llvm_force_head_revision": true, "target_cpu": "x64", "target_os": "mac", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTMac \050dbg\051/properties.json" "b/infra/config/generated/builders/ci/ToTMac \050dbg\051/properties.json" index bca49036..b1cf4012 100644 --- "a/infra/config/generated/builders/ci/ToTMac \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/ci/ToTMac \050dbg\051/properties.json"
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTMac (dbg)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git "a/infra/config/generated/builders/ci/ToTMac \050dbg\051/shadow-properties.json" "b/infra/config/generated/builders/ci/ToTMac \050dbg\051/shadow-properties.json" index c479fd8..54c02663 100644 --- "a/infra/config/generated/builders/ci/ToTMac \050dbg\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/ToTMac \050dbg\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTMac/gn-args.json b/infra/config/generated/builders/ci/ToTMac/gn-args.json index bbd67a39b..1498171 100644 --- a/infra/config/generated/builders/ci/ToTMac/gn-args.json +++ b/infra/config/generated/builders/ci/ToTMac/gn-args.json
@@ -8,6 +8,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "mac", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTMac/properties.json b/infra/config/generated/builders/ci/ToTMac/properties.json index 4ed1ae7..a79f9af1 100644 --- a/infra/config/generated/builders/ci/ToTMac/properties.json +++ b/infra/config/generated/builders/ci/ToTMac/properties.json
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTMac/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTMac/shadow-properties.json b/infra/config/generated/builders/ci/ToTMac/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTMac/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTMac/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTMacASan/gn-args.json b/infra/config/generated/builders/ci/ToTMacASan/gn-args.json index a6e1d2d..31c3fd2 100644 --- a/infra/config/generated/builders/ci/ToTMacASan/gn-args.json +++ b/infra/config/generated/builders/ci/ToTMacASan/gn-args.json
@@ -9,6 +9,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "mac", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTMacASan/properties.json b/infra/config/generated/builders/ci/ToTMacASan/properties.json index d8ad55c..a568d9a 100644 --- a/infra/config/generated/builders/ci/ToTMacASan/properties.json +++ b/infra/config/generated/builders/ci/ToTMacASan/properties.json
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTMacASan/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTMacASan/shadow-properties.json b/infra/config/generated/builders/ci/ToTMacASan/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTMacASan/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTMacASan/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTMacArm64/gn-args.json b/infra/config/generated/builders/ci/ToTMacArm64/gn-args.json index cb1f338..c1dc62e 100644 --- a/infra/config/generated/builders/ci/ToTMacArm64/gn-args.json +++ b/infra/config/generated/builders/ci/ToTMacArm64/gn-args.json
@@ -7,6 +7,7 @@ "symbol_level": 1, "target_cpu": "arm64", "target_os": "mac", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTMacArm64/properties.json b/infra/config/generated/builders/ci/ToTMacArm64/properties.json index ee67b09..53e9430 100644 --- a/infra/config/generated/builders/ci/ToTMacArm64/properties.json +++ b/infra/config/generated/builders/ci/ToTMacArm64/properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTMacArm64/shadow-properties.json b/infra/config/generated/builders/ci/ToTMacArm64/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTMacArm64/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTMacArm64/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTMacArm64PGO/gn-args.json b/infra/config/generated/builders/ci/ToTMacArm64PGO/gn-args.json index 1d5ca04..601f58cb 100644 --- a/infra/config/generated/builders/ci/ToTMacArm64PGO/gn-args.json +++ b/infra/config/generated/builders/ci/ToTMacArm64PGO/gn-args.json
@@ -7,6 +7,7 @@ "symbol_level": 0, "target_cpu": "arm64", "target_os": "mac", + "use_reclient": false, "use_siso": true, "v8_is_on_release_branch": true }
diff --git a/infra/config/generated/builders/ci/ToTMacArm64PGO/properties.json b/infra/config/generated/builders/ci/ToTMacArm64PGO/properties.json index ee67b09..53e9430 100644 --- a/infra/config/generated/builders/ci/ToTMacArm64PGO/properties.json +++ b/infra/config/generated/builders/ci/ToTMacArm64PGO/properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTMacArm64PGO/shadow-properties.json b/infra/config/generated/builders/ci/ToTMacArm64PGO/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTMacArm64PGO/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTMacArm64PGO/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTMacCoverage/gn-args.json b/infra/config/generated/builders/ci/ToTMacCoverage/gn-args.json index c2dfd98..908f4581b 100644 --- a/infra/config/generated/builders/ci/ToTMacCoverage/gn-args.json +++ b/infra/config/generated/builders/ci/ToTMacCoverage/gn-args.json
@@ -8,6 +8,7 @@ "target_cpu": "arm64", "target_os": "mac", "use_clang_coverage": true, + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTMacPGO/gn-args.json b/infra/config/generated/builders/ci/ToTMacPGO/gn-args.json index a9c66fb5..da0588b 100644 --- a/infra/config/generated/builders/ci/ToTMacPGO/gn-args.json +++ b/infra/config/generated/builders/ci/ToTMacPGO/gn-args.json
@@ -7,6 +7,7 @@ "symbol_level": 0, "target_cpu": "x64", "target_os": "mac", + "use_reclient": false, "use_siso": true, "v8_is_on_release_branch": true }
diff --git a/infra/config/generated/builders/ci/ToTMacPGO/properties.json b/infra/config/generated/builders/ci/ToTMacPGO/properties.json index ee67b09..53e9430 100644 --- a/infra/config/generated/builders/ci/ToTMacPGO/properties.json +++ b/infra/config/generated/builders/ci/ToTMacPGO/properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTMacPGO/shadow-properties.json b/infra/config/generated/builders/ci/ToTMacPGO/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTMacPGO/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTMacPGO/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTWin\050dbg\051/gn-args.json" "b/infra/config/generated/builders/ci/ToTWin\050dbg\051/gn-args.json" index 0030461..ae6bac7 100644 --- "a/infra/config/generated/builders/ci/ToTWin\050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/ToTWin\050dbg\051/gn-args.json"
@@ -6,6 +6,7 @@ "llvm_force_head_revision": true, "target_cpu": "x86", "target_os": "win", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTWin\050dbg\051/properties.json" "b/infra/config/generated/builders/ci/ToTWin\050dbg\051/properties.json" index 9011925..7c69aec 100644 --- "a/infra/config/generated/builders/ci/ToTWin\050dbg\051/properties.json" +++ "b/infra/config/generated/builders/ci/ToTWin\050dbg\051/properties.json"
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTWin(dbg)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git "a/infra/config/generated/builders/ci/ToTWin\050dbg\051/shadow-properties.json" "b/infra/config/generated/builders/ci/ToTWin\050dbg\051/shadow-properties.json" index c479fd8..54c02663 100644 --- "a/infra/config/generated/builders/ci/ToTWin\050dbg\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/ToTWin\050dbg\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTWin\050dll\051/gn-args.json" "b/infra/config/generated/builders/ci/ToTWin\050dll\051/gn-args.json" index e888872..bf864c0 100644 --- "a/infra/config/generated/builders/ci/ToTWin\050dll\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/ToTWin\050dll\051/gn-args.json"
@@ -8,6 +8,7 @@ "symbol_level": 1, "target_cpu": "x86", "target_os": "win", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTWin\050dll\051/properties.json" "b/infra/config/generated/builders/ci/ToTWin\050dll\051/properties.json" index 6fed4711..46a5a86 100644 --- "a/infra/config/generated/builders/ci/ToTWin\050dll\051/properties.json" +++ "b/infra/config/generated/builders/ci/ToTWin\050dll\051/properties.json"
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTWin(dll)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git "a/infra/config/generated/builders/ci/ToTWin\050dll\051/shadow-properties.json" "b/infra/config/generated/builders/ci/ToTWin\050dll\051/shadow-properties.json" index c479fd8..54c02663 100644 --- "a/infra/config/generated/builders/ci/ToTWin\050dll\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/ToTWin\050dll\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTWin/gn-args.json b/infra/config/generated/builders/ci/ToTWin/gn-args.json index 2ad6cab7..f9569db 100644 --- a/infra/config/generated/builders/ci/ToTWin/gn-args.json +++ b/infra/config/generated/builders/ci/ToTWin/gn-args.json
@@ -8,6 +8,7 @@ "symbol_level": 1, "target_cpu": "x86", "target_os": "win", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTWin/properties.json b/infra/config/generated/builders/ci/ToTWin/properties.json index cf4641c..cf929e31 100644 --- a/infra/config/generated/builders/ci/ToTWin/properties.json +++ b/infra/config/generated/builders/ci/ToTWin/properties.json
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTWin/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTWin/shadow-properties.json b/infra/config/generated/builders/ci/ToTWin/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTWin/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTWin/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTWin64\050dbg\051/gn-args.json" "b/infra/config/generated/builders/ci/ToTWin64\050dbg\051/gn-args.json" index b8b3439e..f343006 100644 --- "a/infra/config/generated/builders/ci/ToTWin64\050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/ToTWin64\050dbg\051/gn-args.json"
@@ -6,6 +6,7 @@ "llvm_force_head_revision": true, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTWin64\050dbg\051/properties.json" "b/infra/config/generated/builders/ci/ToTWin64\050dbg\051/properties.json" index 68f73fd9..b15607b 100644 --- "a/infra/config/generated/builders/ci/ToTWin64\050dbg\051/properties.json" +++ "b/infra/config/generated/builders/ci/ToTWin64\050dbg\051/properties.json"
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTWin64(dbg)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git "a/infra/config/generated/builders/ci/ToTWin64\050dbg\051/shadow-properties.json" "b/infra/config/generated/builders/ci/ToTWin64\050dbg\051/shadow-properties.json" index c479fd8..54c02663 100644 --- "a/infra/config/generated/builders/ci/ToTWin64\050dbg\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/ToTWin64\050dbg\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTWin64\050dll\051/gn-args.json" "b/infra/config/generated/builders/ci/ToTWin64\050dll\051/gn-args.json" index 2d95e74d..3f9e2f851 100644 --- "a/infra/config/generated/builders/ci/ToTWin64\050dll\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/ToTWin64\050dll\051/gn-args.json"
@@ -7,6 +7,7 @@ "llvm_force_head_revision": true, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/ToTWin64\050dll\051/properties.json" "b/infra/config/generated/builders/ci/ToTWin64\050dll\051/properties.json" index 36d089a..4b79e98 100644 --- "a/infra/config/generated/builders/ci/ToTWin64\050dll\051/properties.json" +++ "b/infra/config/generated/builders/ci/ToTWin64\050dll\051/properties.json"
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTWin64(dll)/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git "a/infra/config/generated/builders/ci/ToTWin64\050dll\051/shadow-properties.json" "b/infra/config/generated/builders/ci/ToTWin64\050dll\051/shadow-properties.json" index c479fd8..54c02663 100644 --- "a/infra/config/generated/builders/ci/ToTWin64\050dll\051/shadow-properties.json" +++ "b/infra/config/generated/builders/ci/ToTWin64\050dll\051/shadow-properties.json"
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTWin64/gn-args.json b/infra/config/generated/builders/ci/ToTWin64/gn-args.json index 800c94c5..5d138e2 100644 --- a/infra/config/generated/builders/ci/ToTWin64/gn-args.json +++ b/infra/config/generated/builders/ci/ToTWin64/gn-args.json
@@ -8,6 +8,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTWin64/properties.json b/infra/config/generated/builders/ci/ToTWin64/properties.json index 2dbd4ff4..8990adfa 100644 --- a/infra/config/generated/builders/ci/ToTWin64/properties.json +++ b/infra/config/generated/builders/ci/ToTWin64/properties.json
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTWin64/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTWin64/shadow-properties.json b/infra/config/generated/builders/ci/ToTWin64/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTWin64/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTWin64/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTWin64PGO/gn-args.json b/infra/config/generated/builders/ci/ToTWin64PGO/gn-args.json index 3c37037..eb53c524 100644 --- a/infra/config/generated/builders/ci/ToTWin64PGO/gn-args.json +++ b/infra/config/generated/builders/ci/ToTWin64PGO/gn-args.json
@@ -7,6 +7,7 @@ "symbol_level": 0, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_siso": true, "v8_is_on_release_branch": true }
diff --git a/infra/config/generated/builders/ci/ToTWin64PGO/properties.json b/infra/config/generated/builders/ci/ToTWin64PGO/properties.json index be048354..a344099 100644 --- a/infra/config/generated/builders/ci/ToTWin64PGO/properties.json +++ b/infra/config/generated/builders/ci/ToTWin64PGO/properties.json
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTWin64PGO/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTWin64PGO/shadow-properties.json b/infra/config/generated/builders/ci/ToTWin64PGO/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTWin64PGO/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTWin64PGO/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/gn-args.json b/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/gn-args.json index ae6046d9..875ec293 100644 --- a/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/gn-args.json +++ b/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/gn-args.json
@@ -12,6 +12,7 @@ "target_cpu": "x64", "target_os": "win", "use_libfuzzer": true, + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/properties.json b/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/properties.json index ae691bd..aa65da5 100644 --- a/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/properties.json +++ b/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/properties.json
@@ -45,18 +45,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/shadow-properties.json b/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTWinASanLibfuzzer/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTWinArm64PGO/gn-args.json b/infra/config/generated/builders/ci/ToTWinArm64PGO/gn-args.json index b7bb119c..251ebe0 100644 --- a/infra/config/generated/builders/ci/ToTWinArm64PGO/gn-args.json +++ b/infra/config/generated/builders/ci/ToTWinArm64PGO/gn-args.json
@@ -7,6 +7,7 @@ "symbol_level": 0, "target_cpu": "arm64", "target_os": "win", + "use_reclient": false, "use_siso": true, "v8_is_on_release_branch": true }
diff --git a/infra/config/generated/builders/ci/ToTWinArm64PGO/properties.json b/infra/config/generated/builders/ci/ToTWinArm64PGO/properties.json index b4041682..7e9be4d 100644 --- a/infra/config/generated/builders/ci/ToTWinArm64PGO/properties.json +++ b/infra/config/generated/builders/ci/ToTWinArm64PGO/properties.json
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTWinArm64PGO/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTWinArm64PGO/shadow-properties.json b/infra/config/generated/builders/ci/ToTWinArm64PGO/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTWinArm64PGO/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTWinArm64PGO/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTWindowsCoverage/gn-args.json b/infra/config/generated/builders/ci/ToTWindowsCoverage/gn-args.json index f5281ab..1d27648 100644 --- a/infra/config/generated/builders/ci/ToTWindowsCoverage/gn-args.json +++ b/infra/config/generated/builders/ci/ToTWindowsCoverage/gn-args.json
@@ -8,6 +8,7 @@ "target_cpu": "x64", "target_os": "win", "use_clang_coverage": true, + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTiOS/gn-args.json b/infra/config/generated/builders/ci/ToTiOS/gn-args.json index 26d9facf..a9a5c99 100644 --- a/infra/config/generated/builders/ci/ToTiOS/gn-args.json +++ b/infra/config/generated/builders/ci/ToTiOS/gn-args.json
@@ -10,6 +10,7 @@ "target_cpu": "x64", "target_environment": "simulator", "target_os": "ios", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTiOS/properties.json b/infra/config/generated/builders/ci/ToTiOS/properties.json index 0aa1237..8c9c722 100644 --- a/infra/config/generated/builders/ci/ToTiOS/properties.json +++ b/infra/config/generated/builders/ci/ToTiOS/properties.json
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTiOS/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTiOS/shadow-properties.json b/infra/config/generated/builders/ci/ToTiOS/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTiOS/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTiOS/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTiOSDevice/gn-args.json b/infra/config/generated/builders/ci/ToTiOSDevice/gn-args.json index bc6dbe2..a0404ea 100644 --- a/infra/config/generated/builders/ci/ToTiOSDevice/gn-args.json +++ b/infra/config/generated/builders/ci/ToTiOSDevice/gn-args.json
@@ -8,6 +8,7 @@ "target_cpu": "arm64", "target_environment": "device", "target_os": "ios", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ToTiOSDevice/properties.json b/infra/config/generated/builders/ci/ToTiOSDevice/properties.json index 747c1ba..dce4f7c 100644 --- a/infra/config/generated/builders/ci/ToTiOSDevice/properties.json +++ b/infra/config/generated/builders/ci/ToTiOSDevice/properties.json
@@ -46,18 +46,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ToTiOSDevice/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/ToTiOSDevice/shadow-properties.json b/infra/config/generated/builders/ci/ToTiOSDevice/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/ToTiOSDevice/shadow-properties.json +++ b/infra/config/generated/builders/ci/ToTiOSDevice/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/WebKit Linux ASAN/gn-args.json b/infra/config/generated/builders/ci/WebKit Linux ASAN/gn-args.json index eac6f63..83cdff2 100644 --- a/infra/config/generated/builders/ci/WebKit Linux ASAN/gn-args.json +++ b/infra/config/generated/builders/ci/WebKit Linux ASAN/gn-args.json
@@ -9,6 +9,7 @@ "proprietary_codecs": true, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/WebKit Linux ASAN/properties.json b/infra/config/generated/builders/ci/WebKit Linux ASAN/properties.json index 8b89498..783caaa 100644 --- a/infra/config/generated/builders/ci/WebKit Linux ASAN/properties.json +++ b/infra/config/generated/builders/ci/WebKit Linux ASAN/properties.json
@@ -50,18 +50,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/WebKit Linux ASAN/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/WebKit Linux ASAN/shadow-properties.json b/infra/config/generated/builders/ci/WebKit Linux ASAN/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/WebKit Linux ASAN/shadow-properties.json +++ b/infra/config/generated/builders/ci/WebKit Linux ASAN/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/WebKit Linux Leak/gn-args.json b/infra/config/generated/builders/ci/WebKit Linux Leak/gn-args.json index e8672db..255906cd2 100644 --- a/infra/config/generated/builders/ci/WebKit Linux Leak/gn-args.json +++ b/infra/config/generated/builders/ci/WebKit Linux Leak/gn-args.json
@@ -7,6 +7,7 @@ "proprietary_codecs": true, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/WebKit Linux Leak/properties.json b/infra/config/generated/builders/ci/WebKit Linux Leak/properties.json index bb5e295..7c650db 100644 --- a/infra/config/generated/builders/ci/WebKit Linux Leak/properties.json +++ b/infra/config/generated/builders/ci/WebKit Linux Leak/properties.json
@@ -49,18 +49,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/WebKit Linux Leak/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/WebKit Linux Leak/shadow-properties.json b/infra/config/generated/builders/ci/WebKit Linux Leak/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/WebKit Linux Leak/shadow-properties.json +++ b/infra/config/generated/builders/ci/WebKit Linux Leak/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/WebKit Linux MSAN/gn-args.json b/infra/config/generated/builders/ci/WebKit Linux MSAN/gn-args.json index 01d241c5..ac2d68d 100644 --- a/infra/config/generated/builders/ci/WebKit Linux MSAN/gn-args.json +++ b/infra/config/generated/builders/ci/WebKit Linux MSAN/gn-args.json
@@ -9,6 +9,7 @@ "proprietary_codecs": true, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/WebKit Linux MSAN/properties.json b/infra/config/generated/builders/ci/WebKit Linux MSAN/properties.json index e29a4bf..8e9c13e 100644 --- a/infra/config/generated/builders/ci/WebKit Linux MSAN/properties.json +++ b/infra/config/generated/builders/ci/WebKit Linux MSAN/properties.json
@@ -50,18 +50,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/WebKit Linux MSAN/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/WebKit Linux MSAN/shadow-properties.json b/infra/config/generated/builders/ci/WebKit Linux MSAN/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/WebKit Linux MSAN/shadow-properties.json +++ b/infra/config/generated/builders/ci/WebKit Linux MSAN/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/android-archive-rel/gn-args.json b/infra/config/generated/builders/ci/android-archive-rel/gn-args.json index 94a9bf9..dbecf74 100644 --- a/infra/config/generated/builders/ci/android-archive-rel/gn-args.json +++ b/infra/config/generated/builders/ci/android-archive-rel/gn-args.json
@@ -8,6 +8,7 @@ "symbol_level": 1, "target_cpu": "arm", "target_os": "android", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/android-archive-rel/properties.json b/infra/config/generated/builders/ci/android-archive-rel/properties.json index c03fd0b7..eac6ac1 100644 --- a/infra/config/generated/builders/ci/android-archive-rel/properties.json +++ b/infra/config/generated/builders/ci/android-archive-rel/properties.json
@@ -62,18 +62,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/android-archive-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/android-archive-rel/shadow-properties.json b/infra/config/generated/builders/ci/android-archive-rel/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/android-archive-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-archive-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/android-arm64-archive-rel/gn-args.json b/infra/config/generated/builders/ci/android-arm64-archive-rel/gn-args.json index 86231e6..1073494 100644 --- a/infra/config/generated/builders/ci/android-arm64-archive-rel/gn-args.json +++ b/infra/config/generated/builders/ci/android-arm64-archive-rel/gn-args.json
@@ -8,6 +8,7 @@ "symbol_level": 1, "target_cpu": "arm64", "target_os": "android", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/android-arm64-archive-rel/properties.json b/infra/config/generated/builders/ci/android-arm64-archive-rel/properties.json index 506947c..43bacc6 100644 --- a/infra/config/generated/builders/ci/android-arm64-archive-rel/properties.json +++ b/infra/config/generated/builders/ci/android-arm64-archive-rel/properties.json
@@ -57,18 +57,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/android-arm64-archive-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/android-arm64-archive-rel/shadow-properties.json b/infra/config/generated/builders/ci/android-arm64-archive-rel/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/android-arm64-archive-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-arm64-archive-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/android-code-coverage-native/gn-args.json b/infra/config/generated/builders/ci/android-code-coverage-native/gn-args.json index a83ae98..b07af4f 100644 --- a/infra/config/generated/builders/ci/android-code-coverage-native/gn-args.json +++ b/infra/config/generated/builders/ci/android-code-coverage-native/gn-args.json
@@ -13,6 +13,7 @@ "target_cpu": "arm64", "target_os": "android", "use_clang_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true, "use_static_angle": true
diff --git a/infra/config/generated/builders/ci/android-code-coverage-native/properties.json b/infra/config/generated/builders/ci/android-code-coverage-native/properties.json index e019426..75cc29e 100644 --- a/infra/config/generated/builders/ci/android-code-coverage-native/properties.json +++ b/infra/config/generated/builders/ci/android-code-coverage-native/properties.json
@@ -64,18 +64,15 @@ "export_coverage_to_zoss": true, "use_clang_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/android-code-coverage-native/shadow-properties.json b/infra/config/generated/builders/ci/android-code-coverage-native/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/android-code-coverage-native/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-code-coverage-native/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/android-code-coverage/gn-args.json b/infra/config/generated/builders/ci/android-code-coverage/gn-args.json index b5501cd..d0bfeb9 100644 --- a/infra/config/generated/builders/ci/android-code-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/android-code-coverage/gn-args.json
@@ -14,6 +14,7 @@ "target_cpu": "arm64", "target_os": "android", "use_jacoco_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true, "use_static_angle": true
diff --git a/infra/config/generated/builders/ci/android-code-coverage/properties.json b/infra/config/generated/builders/ci/android-code-coverage/properties.json index 0af7b37..1575ce2 100644 --- a/infra/config/generated/builders/ci/android-code-coverage/properties.json +++ b/infra/config/generated/builders/ci/android-code-coverage/properties.json
@@ -64,18 +64,15 @@ "generate_blame_list": true, "use_java_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/android-code-coverage/shadow-properties.json b/infra/config/generated/builders/ci/android-code-coverage/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/android-code-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-code-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/android-cronet-code-coverage-java/gn-args.json b/infra/config/generated/builders/ci/android-cronet-code-coverage-java/gn-args.json index 3ecc3698..a6b721e 100644 --- a/infra/config/generated/builders/ci/android-cronet-code-coverage-java/gn-args.json +++ b/infra/config/generated/builders/ci/android-cronet-code-coverage-java/gn-args.json
@@ -20,6 +20,7 @@ "use_jacoco_coverage": true, "use_partition_alloc": false, "use_platform_icu_alternatives": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true, "use_thin_lto": false
diff --git a/infra/config/generated/builders/ci/android-cronet-code-coverage-java/properties.json b/infra/config/generated/builders/ci/android-cronet-code-coverage-java/properties.json index 62382f49..d6ede3e6 100644 --- a/infra/config/generated/builders/ci/android-cronet-code-coverage-java/properties.json +++ b/infra/config/generated/builders/ci/android-cronet-code-coverage-java/properties.json
@@ -57,18 +57,15 @@ "export_coverage_to_zoss": true, "use_java_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/android-cronet-code-coverage-java/shadow-properties.json b/infra/config/generated/builders/ci/android-cronet-code-coverage-java/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/android-cronet-code-coverage-java/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-cronet-code-coverage-java/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/android-cronet-code-coverage-native/gn-args.json b/infra/config/generated/builders/ci/android-cronet-code-coverage-native/gn-args.json index cec7487..476e049 100644 --- a/infra/config/generated/builders/ci/android-cronet-code-coverage-native/gn-args.json +++ b/infra/config/generated/builders/ci/android-cronet-code-coverage-native/gn-args.json
@@ -20,6 +20,7 @@ "use_hashed_jni_names": true, "use_partition_alloc": false, "use_platform_icu_alternatives": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true, "use_thin_lto": false
diff --git a/infra/config/generated/builders/ci/android-cronet-code-coverage-native/properties.json b/infra/config/generated/builders/ci/android-cronet-code-coverage-native/properties.json index 96cb09a..bb98e8b44 100644 --- a/infra/config/generated/builders/ci/android-cronet-code-coverage-native/properties.json +++ b/infra/config/generated/builders/ci/android-cronet-code-coverage-native/properties.json
@@ -58,18 +58,15 @@ "export_coverage_to_zoss": true, "use_clang_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/android-cronet-code-coverage-native/shadow-properties.json b/infra/config/generated/builders/ci/android-cronet-code-coverage-native/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/android-cronet-code-coverage-native/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-cronet-code-coverage-native/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/gn-args.json b/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/gn-args.json index 024107c..63a4c96 100644 --- a/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/gn-args.json +++ b/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/gn-args.json
@@ -13,6 +13,7 @@ "system_webview_shell_package_name": "org.chromium.my_webview_shell", "target_cpu": "x64", "target_os": "android", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/properties.json b/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/properties.json index e1fb14c..529a95f 100644 --- a/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/properties.json +++ b/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/properties.json
@@ -51,18 +51,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/shadow-properties.json b/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-desktop-15-x64-fyi-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/gn-args.json b/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/gn-args.json index 250843d..a2614e4e 100644 --- a/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/gn-args.json +++ b/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/gn-args.json
@@ -9,6 +9,7 @@ "symbol_level": 1, "target_cpu": "arm64", "target_os": "android", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/properties.json b/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/properties.json index 6b7ac58..7fdf6bb 100644 --- a/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/properties.json +++ b/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/properties.json
@@ -63,18 +63,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/shadow-properties.json b/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-desktop-arm64-archive-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/gn-args.json b/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/gn-args.json index fcf34e79..eed6c395b 100644 --- a/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/gn-args.json +++ b/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/gn-args.json
@@ -10,6 +10,7 @@ "system_webview_package_name": "com.google.android.webview.debug", "target_cpu": "arm64", "target_os": "android", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/properties.json b/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/properties.json index 3a3be70..417efe0 100644 --- a/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/properties.json +++ b/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/properties.json
@@ -52,18 +52,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/shadow-properties.json b/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-desktop-arm64-compile-dbg/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/gn-args.json b/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/gn-args.json index 47dcb9b6..cdb9f493 100644 --- a/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/gn-args.json +++ b/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/gn-args.json
@@ -12,6 +12,7 @@ "system_webview_package_name": "com.google.android.webview.debug", "target_cpu": "arm64", "target_os": "android", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/properties.json b/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/properties.json index c962966..81637bb 100644 --- a/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/properties.json +++ b/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/properties.json
@@ -52,18 +52,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/shadow-properties.json b/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-desktop-arm64-compile-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/gn-args.json b/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/gn-args.json index 45c763b0..22c27e0b 100644 --- a/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/gn-args.json +++ b/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/gn-args.json
@@ -9,6 +9,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "android", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/properties.json b/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/properties.json index 41567cb..e8fc142 100644 --- a/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/properties.json +++ b/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/properties.json
@@ -63,18 +63,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/shadow-properties.json b/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-desktop-x64-archive-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/gn-args.json b/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/gn-args.json index fc40edc..31c2adb 100644 --- a/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/gn-args.json +++ b/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/gn-args.json
@@ -11,6 +11,7 @@ "system_webview_shell_package_name": "org.chromium.my_webview_shell", "target_cpu": "x64", "target_os": "android", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/properties.json b/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/properties.json index 7bc0702..7682c6c 100644 --- a/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/properties.json +++ b/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/properties.json
@@ -52,18 +52,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/shadow-properties.json b/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-desktop-x64-compile-dbg/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/gn-args.json b/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/gn-args.json index 024107c..63a4c96 100644 --- a/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/gn-args.json +++ b/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/gn-args.json
@@ -13,6 +13,7 @@ "system_webview_shell_package_name": "org.chromium.my_webview_shell", "target_cpu": "x64", "target_os": "android", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/properties.json b/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/properties.json index 5a1e8efa..f4eb552 100644 --- a/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/properties.json +++ b/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/properties.json
@@ -96,18 +96,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/shadow-properties.json b/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-desktop-x64-compile-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/android-official/gn-args.json b/infra/config/generated/builders/ci/android-official/gn-args.json index 0a21a57..b1aef9f5 100644 --- a/infra/config/generated/builders/ci/android-official/gn-args.json +++ b/infra/config/generated/builders/ci/android-official/gn-args.json
@@ -5,6 +5,7 @@ "symbol_level": 2, "target_cpu": "arm", "target_os": "android", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/android-official/properties.json b/infra/config/generated/builders/ci/android-official/properties.json index de4cf926..25e732f8 100644 --- a/infra/config/generated/builders/ci/android-official/properties.json +++ b/infra/config/generated/builders/ci/android-official/properties.json
@@ -53,18 +53,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/android-official/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/android-official/shadow-properties.json b/infra/config/generated/builders/ci/android-official/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/android-official/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-official/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/android-webview-code-coverage-native/gn-args.json b/infra/config/generated/builders/ci/android-webview-code-coverage-native/gn-args.json index a83ae98..b07af4f 100644 --- a/infra/config/generated/builders/ci/android-webview-code-coverage-native/gn-args.json +++ b/infra/config/generated/builders/ci/android-webview-code-coverage-native/gn-args.json
@@ -13,6 +13,7 @@ "target_cpu": "arm64", "target_os": "android", "use_clang_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true, "use_static_angle": true
diff --git a/infra/config/generated/builders/ci/android-webview-code-coverage-native/properties.json b/infra/config/generated/builders/ci/android-webview-code-coverage-native/properties.json index 1ab2510..ac468ea 100644 --- a/infra/config/generated/builders/ci/android-webview-code-coverage-native/properties.json +++ b/infra/config/generated/builders/ci/android-webview-code-coverage-native/properties.json
@@ -57,18 +57,15 @@ ], "use_clang_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/android-webview-code-coverage-native/shadow-properties.json b/infra/config/generated/builders/ci/android-webview-code-coverage-native/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/android-webview-code-coverage-native/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-webview-code-coverage-native/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/android-webview-code-coverage/gn-args.json b/infra/config/generated/builders/ci/android-webview-code-coverage/gn-args.json index b5501cd..d0bfeb9 100644 --- a/infra/config/generated/builders/ci/android-webview-code-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/android-webview-code-coverage/gn-args.json
@@ -14,6 +14,7 @@ "target_cpu": "arm64", "target_os": "android", "use_jacoco_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true, "use_static_angle": true
diff --git a/infra/config/generated/builders/ci/android-webview-code-coverage/properties.json b/infra/config/generated/builders/ci/android-webview-code-coverage/properties.json index 396f859..c3f581c 100644 --- a/infra/config/generated/builders/ci/android-webview-code-coverage/properties.json +++ b/infra/config/generated/builders/ci/android-webview-code-coverage/properties.json
@@ -56,18 +56,15 @@ ], "use_java_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/android-webview-code-coverage/shadow-properties.json b/infra/config/generated/builders/ci/android-webview-code-coverage/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/android-webview-code-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-webview-code-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/android-x86-code-coverage/gn-args.json b/infra/config/generated/builders/ci/android-x86-code-coverage/gn-args.json index 8482065..9f24241 100644 --- a/infra/config/generated/builders/ci/android-x86-code-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/android-x86-code-coverage/gn-args.json
@@ -14,6 +14,7 @@ "target_cpu": "x86", "target_os": "android", "use_jacoco_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/android-x86-code-coverage/properties.json b/infra/config/generated/builders/ci/android-x86-code-coverage/properties.json index 9a83e89..14205b94 100644 --- a/infra/config/generated/builders/ci/android-x86-code-coverage/properties.json +++ b/infra/config/generated/builders/ci/android-x86-code-coverage/properties.json
@@ -55,18 +55,15 @@ "export_coverage_to_zoss": true, "use_java_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/android-x86-code-coverage/shadow-properties.json b/infra/config/generated/builders/ci/android-x86-code-coverage/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/android-x86-code-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/android-x86-code-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/chromeos-js-code-coverage/gn-args.json b/infra/config/generated/builders/ci/chromeos-js-code-coverage/gn-args.json index e1b5ad6e..1c1004d 100644 --- a/infra/config/generated/builders/ci/chromeos-js-code-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/chromeos-js-code-coverage/gn-args.json
@@ -9,6 +9,7 @@ "target_cpu": "x64", "target_os": "chromeos", "use_javascript_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/chromeos-js-code-coverage/properties.json b/infra/config/generated/builders/ci/chromeos-js-code-coverage/properties.json index bfa7e91..884ee79 100644 --- a/infra/config/generated/builders/ci/chromeos-js-code-coverage/properties.json +++ b/infra/config/generated/builders/ci/chromeos-js-code-coverage/properties.json
@@ -59,18 +59,15 @@ "export_coverage_to_zoss": true, "use_javascript_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/chromeos-js-code-coverage/shadow-properties.json b/infra/config/generated/builders/ci/chromeos-js-code-coverage/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/chromeos-js-code-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/chromeos-js-code-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/fuchsia-code-coverage/gn-args.json b/infra/config/generated/builders/ci/fuchsia-code-coverage/gn-args.json index 7cbe8f0..69029d9c 100644 --- a/infra/config/generated/builders/ci/fuchsia-code-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/fuchsia-code-coverage/gn-args.json
@@ -9,6 +9,7 @@ "target_cpu": "x64", "target_os": "fuchsia", "use_clang_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/fuchsia-code-coverage/properties.json b/infra/config/generated/builders/ci/fuchsia-code-coverage/properties.json index f2face1..246998da 100644 --- a/infra/config/generated/builders/ci/fuchsia-code-coverage/properties.json +++ b/infra/config/generated/builders/ci/fuchsia-code-coverage/properties.json
@@ -59,18 +59,15 @@ ], "use_clang_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/fuchsia-code-coverage/shadow-properties.json b/infra/config/generated/builders/ci/fuchsia-code-coverage/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/fuchsia-code-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/fuchsia-code-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/gn-args.json b/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/gn-args.json index 2654527d..9fc2162 100644 --- a/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/gn-args.json +++ b/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/gn-args.json
@@ -8,6 +8,7 @@ "target_cpu": "arm64", "target_os": "fuchsia", "test_host_cpu": "arm64", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/properties.json b/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/properties.json index fd03229..a040889 100644 --- a/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/properties.json +++ b/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/properties.json
@@ -53,18 +53,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/shadow-properties.json b/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/shadow-properties.json +++ b/infra/config/generated/builders/ci/fuchsia-fyi-arm64-dbg/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/gn-args.json b/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/gn-args.json index 56e1b371..b35a3c7 100644 --- a/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/gn-args.json +++ b/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/gn-args.json
@@ -7,6 +7,7 @@ "is_lsan": true, "target_cpu": "x64", "target_os": "fuchsia", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/properties.json b/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/properties.json index cd408b2..337e2b4 100644 --- a/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/properties.json +++ b/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/properties.json
@@ -52,18 +52,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/shadow-properties.json b/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/shadow-properties.json +++ b/infra/config/generated/builders/ci/fuchsia-fyi-x64-asan/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/gn-args.json b/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/gn-args.json index 278df80..d2fb7ad 100644 --- a/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/gn-args.json +++ b/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/gn-args.json
@@ -7,6 +7,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "fuchsia", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/properties.json b/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/properties.json index 7e9746e..1564319 100644 --- a/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/properties.json +++ b/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/properties.json
@@ -51,18 +51,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/shadow-properties.json b/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/shadow-properties.json +++ b/infra/config/generated/builders/ci/fuchsia-fyi-x64-dbg-persistent-emulator/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/ios-asan/gn-args.json b/infra/config/generated/builders/ci/ios-asan/gn-args.json index 0b96e9b..fb39839 100644 --- a/infra/config/generated/builders/ci/ios-asan/gn-args.json +++ b/infra/config/generated/builders/ci/ios-asan/gn-args.json
@@ -8,6 +8,7 @@ "target_cpu": "x64", "target_environment": "simulator", "target_os": "ios", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/ios-asan/properties.json b/infra/config/generated/builders/ci/ios-asan/properties.json index f9796db..fc3073a1 100644 --- a/infra/config/generated/builders/ci/ios-asan/properties.json +++ b/infra/config/generated/builders/ci/ios-asan/properties.json
@@ -55,18 +55,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/ios-asan/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/ios-asan/shadow-properties.json b/infra/config/generated/builders/ci/ios-asan/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/ios-asan/shadow-properties.json +++ b/infra/config/generated/builders/ci/ios-asan/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/ios-simulator-code-coverage/gn-args.json b/infra/config/generated/builders/ci/ios-simulator-code-coverage/gn-args.json index dd53ea01..0e452d1 100644 --- a/infra/config/generated/builders/ci/ios-simulator-code-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/ios-simulator-code-coverage/gn-args.json
@@ -7,6 +7,7 @@ "target_cpu": "x64", "target_os": "ios", "use_clang_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/ios-simulator-code-coverage/properties.json b/infra/config/generated/builders/ci/ios-simulator-code-coverage/properties.json index b2195b0a..e929cc1 100644 --- a/infra/config/generated/builders/ci/ios-simulator-code-coverage/properties.json +++ b/infra/config/generated/builders/ci/ios-simulator-code-coverage/properties.json
@@ -61,18 +61,15 @@ "export_coverage_to_zoss": true, "use_clang_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/ios-simulator-code-coverage/shadow-properties.json b/infra/config/generated/builders/ci/ios-simulator-code-coverage/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/ios-simulator-code-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/ios-simulator-code-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/linux-archive-rel/gn-args.json b/infra/config/generated/builders/ci/linux-archive-rel/gn-args.json index 8e184aa..59c483c8 100644 --- a/infra/config/generated/builders/ci/linux-archive-rel/gn-args.json +++ b/infra/config/generated/builders/ci/linux-archive-rel/gn-args.json
@@ -6,6 +6,7 @@ "is_debug": false, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/linux-archive-rel/properties.json b/infra/config/generated/builders/ci/linux-archive-rel/properties.json index 2f047f2..8cb26c5f 100644 --- a/infra/config/generated/builders/ci/linux-archive-rel/properties.json +++ b/infra/config/generated/builders/ci/linux-archive-rel/properties.json
@@ -60,18 +60,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/linux-archive-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/linux-archive-rel/shadow-properties.json b/infra/config/generated/builders/ci/linux-archive-rel/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/linux-archive-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/linux-archive-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/linux-chromeos-archive-rel/gn-args.json b/infra/config/generated/builders/ci/linux-chromeos-archive-rel/gn-args.json index f8fe23ac..a80c438 100644 --- a/infra/config/generated/builders/ci/linux-chromeos-archive-rel/gn-args.json +++ b/infra/config/generated/builders/ci/linux-chromeos-archive-rel/gn-args.json
@@ -6,6 +6,7 @@ "target_cpu": "x64", "target_os": "chromeos", "use_cups": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/linux-chromeos-archive-rel/properties.json b/infra/config/generated/builders/ci/linux-chromeos-archive-rel/properties.json index ff8b76c..854caefb 100644 --- a/infra/config/generated/builders/ci/linux-chromeos-archive-rel/properties.json +++ b/infra/config/generated/builders/ci/linux-chromeos-archive-rel/properties.json
@@ -53,18 +53,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/linux-chromeos-archive-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/linux-chromeos-archive-rel/shadow-properties.json b/infra/config/generated/builders/ci/linux-chromeos-archive-rel/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/linux-chromeos-archive-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/linux-chromeos-archive-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/linux-chromeos-code-coverage/gn-args.json b/infra/config/generated/builders/ci/linux-chromeos-code-coverage/gn-args.json index be891ab..f0cc4787 100644 --- a/infra/config/generated/builders/ci/linux-chromeos-code-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/linux-chromeos-code-coverage/gn-args.json
@@ -8,6 +8,7 @@ "target_cpu": "x64", "target_os": "chromeos", "use_clang_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/linux-chromeos-code-coverage/properties.json b/infra/config/generated/builders/ci/linux-chromeos-code-coverage/properties.json index b25adf6..1ceb98b 100644 --- a/infra/config/generated/builders/ci/linux-chromeos-code-coverage/properties.json +++ b/infra/config/generated/builders/ci/linux-chromeos-code-coverage/properties.json
@@ -61,18 +61,15 @@ "export_coverage_to_zoss": true, "use_clang_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/linux-chromeos-code-coverage/shadow-properties.json b/infra/config/generated/builders/ci/linux-chromeos-code-coverage/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/linux-chromeos-code-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/linux-chromeos-code-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/linux-code-coverage/gn-args.json b/infra/config/generated/builders/ci/linux-code-coverage/gn-args.json index 719d6e0..ac28ca1 100644 --- a/infra/config/generated/builders/ci/linux-code-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/linux-code-coverage/gn-args.json
@@ -10,6 +10,7 @@ "target_cpu": "x64", "target_os": "linux", "use_clang_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/linux-code-coverage/properties.json b/infra/config/generated/builders/ci/linux-code-coverage/properties.json index 676deba..99c1275 100644 --- a/infra/config/generated/builders/ci/linux-code-coverage/properties.json +++ b/infra/config/generated/builders/ci/linux-code-coverage/properties.json
@@ -60,18 +60,15 @@ "export_coverage_to_zoss": true, "use_clang_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/linux-code-coverage/shadow-properties.json b/infra/config/generated/builders/ci/linux-code-coverage/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/linux-code-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/linux-code-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/linux-fuzz-coverage/gn-args.json b/infra/config/generated/builders/ci/linux-fuzz-coverage/gn-args.json index 861eaa0..868f9f1 100644 --- a/infra/config/generated/builders/ci/linux-fuzz-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/linux-fuzz-coverage/gn-args.json
@@ -11,6 +11,7 @@ "target_os": "linux", "use_clang_coverage": true, "use_libfuzzer": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/linux-fuzz-coverage/properties.json b/infra/config/generated/builders/ci/linux-fuzz-coverage/properties.json index 8e66bac..d2dff8b 100644 --- a/infra/config/generated/builders/ci/linux-fuzz-coverage/properties.json +++ b/infra/config/generated/builders/ci/linux-fuzz-coverage/properties.json
@@ -44,18 +44,15 @@ ] } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/linux-fuzz-coverage/shadow-properties.json b/infra/config/generated/builders/ci/linux-fuzz-coverage/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/linux-fuzz-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/linux-fuzz-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/linux-js-code-coverage/gn-args.json b/infra/config/generated/builders/ci/linux-js-code-coverage/gn-args.json index 60098816..e1961b6 100644 --- a/infra/config/generated/builders/ci/linux-js-code-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/linux-js-code-coverage/gn-args.json
@@ -9,6 +9,7 @@ "target_cpu": "x64", "target_os": "linux", "use_javascript_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/linux-js-code-coverage/properties.json b/infra/config/generated/builders/ci/linux-js-code-coverage/properties.json index fb4e754..68ed04d3 100644 --- a/infra/config/generated/builders/ci/linux-js-code-coverage/properties.json +++ b/infra/config/generated/builders/ci/linux-js-code-coverage/properties.json
@@ -57,18 +57,15 @@ "export_coverage_to_zoss": true, "use_javascript_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/linux-js-code-coverage/shadow-properties.json b/infra/config/generated/builders/ci/linux-js-code-coverage/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/linux-js-code-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/linux-js-code-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/linux-official/gn-args.json b/infra/config/generated/builders/ci/linux-official/gn-args.json index 5f488f8..072b745d 100644 --- a/infra/config/generated/builders/ci/linux-official/gn-args.json +++ b/infra/config/generated/builders/ci/linux-official/gn-args.json
@@ -3,6 +3,7 @@ "is_official_build": true, "target_cpu": "x64", "target_os": "linux", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/linux-official/properties.json b/infra/config/generated/builders/ci/linux-official/properties.json index dd8f55f6a..071a0a3c 100644 --- a/infra/config/generated/builders/ci/linux-official/properties.json +++ b/infra/config/generated/builders/ci/linux-official/properties.json
@@ -49,18 +49,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/linux-official/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/linux-official/shadow-properties.json b/infra/config/generated/builders/ci/linux-official/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/linux-official/shadow-properties.json +++ b/infra/config/generated/builders/ci/linux-official/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/gn-args.json b/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/gn-args.json index a100ef4..a8cf965 100644 --- a/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/gn-args.json +++ b/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/gn-args.json
@@ -8,6 +8,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/properties.json b/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/properties.json index 5574d41..9db2691 100644 --- a/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/properties.json +++ b/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/properties.json
@@ -47,18 +47,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted" }, "$recipe_engine/resultdb/test_presentation": {
diff --git a/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/shadow-properties.json b/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/shadow-properties.json index c479fd8..54c02663 100644 --- a/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/linux-win-cross-clang-tot-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted" } } \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-x64-fuzzilli-coverage/gn-args.json b/infra/config/generated/builders/ci/linux-x64-fuzzilli-coverage/gn-args.json index 5d1e3fa..e260045 100644 --- a/infra/config/generated/builders/ci/linux-x64-fuzzilli-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/linux-x64-fuzzilli-coverage/gn-args.json
@@ -4,6 +4,7 @@ "target_cpu": "x64", "target_os": "linux", "use_clang_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true, "v8_enable_backtrace": true,
diff --git a/infra/config/generated/builders/ci/linux-x64-fuzzilli-coverage/properties.json b/infra/config/generated/builders/ci/linux-x64-fuzzilli-coverage/properties.json index 346e0577..4bd697f 100644 --- a/infra/config/generated/builders/ci/linux-x64-fuzzilli-coverage/properties.json +++ b/infra/config/generated/builders/ci/linux-x64-fuzzilli-coverage/properties.json
@@ -44,18 +44,15 @@ ] } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/linux-x64-fuzzilli-coverage/shadow-properties.json b/infra/config/generated/builders/ci/linux-x64-fuzzilli-coverage/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/linux-x64-fuzzilli-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/linux-x64-fuzzilli-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/mac-archive-rel/gn-args.json b/infra/config/generated/builders/ci/mac-archive-rel/gn-args.json index c25e0f7..b1600ea 100644 --- a/infra/config/generated/builders/ci/mac-archive-rel/gn-args.json +++ b/infra/config/generated/builders/ci/mac-archive-rel/gn-args.json
@@ -7,6 +7,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "mac", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/mac-archive-rel/properties.json b/infra/config/generated/builders/ci/mac-archive-rel/properties.json index 1d3a5112..a1c11e0 100644 --- a/infra/config/generated/builders/ci/mac-archive-rel/properties.json +++ b/infra/config/generated/builders/ci/mac-archive-rel/properties.json
@@ -56,18 +56,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/mac-archive-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/mac-archive-rel/shadow-properties.json b/infra/config/generated/builders/ci/mac-archive-rel/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/mac-archive-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/mac-archive-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/mac-arm64-archive-rel/gn-args.json b/infra/config/generated/builders/ci/mac-arm64-archive-rel/gn-args.json index f8669cd..8886443 100644 --- a/infra/config/generated/builders/ci/mac-arm64-archive-rel/gn-args.json +++ b/infra/config/generated/builders/ci/mac-arm64-archive-rel/gn-args.json
@@ -7,6 +7,7 @@ "symbol_level": 1, "target_cpu": "arm64", "target_os": "mac", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/mac-arm64-archive-rel/properties.json b/infra/config/generated/builders/ci/mac-arm64-archive-rel/properties.json index 99ece41..f2484c6 100644 --- a/infra/config/generated/builders/ci/mac-arm64-archive-rel/properties.json +++ b/infra/config/generated/builders/ci/mac-arm64-archive-rel/properties.json
@@ -56,18 +56,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/mac-arm64-archive-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/mac-arm64-archive-rel/shadow-properties.json b/infra/config/generated/builders/ci/mac-arm64-archive-rel/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/mac-arm64-archive-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/mac-arm64-archive-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/mac-code-coverage/gn-args.json b/infra/config/generated/builders/ci/mac-code-coverage/gn-args.json index ee8826b..0f371c1 100644 --- a/infra/config/generated/builders/ci/mac-code-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/mac-code-coverage/gn-args.json
@@ -10,6 +10,7 @@ "target_cpu": "x64", "target_os": "mac", "use_clang_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/mac-code-coverage/properties.json b/infra/config/generated/builders/ci/mac-code-coverage/properties.json index f49d1c4..ce8ee97 100644 --- a/infra/config/generated/builders/ci/mac-code-coverage/properties.json +++ b/infra/config/generated/builders/ci/mac-code-coverage/properties.json
@@ -59,18 +59,15 @@ "export_coverage_to_zoss": true, "use_clang_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/mac-code-coverage/shadow-properties.json b/infra/config/generated/builders/ci/mac-code-coverage/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/mac-code-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/mac-code-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/mac-lsan-fyi-rel/gn-args.json b/infra/config/generated/builders/ci/mac-lsan-fyi-rel/gn-args.json index 23ff67c6..793ea89d 100644 --- a/infra/config/generated/builders/ci/mac-lsan-fyi-rel/gn-args.json +++ b/infra/config/generated/builders/ci/mac-lsan-fyi-rel/gn-args.json
@@ -7,6 +7,7 @@ "is_lsan": true, "target_cpu": "x64", "target_os": "mac", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/mac-lsan-fyi-rel/properties.json b/infra/config/generated/builders/ci/mac-lsan-fyi-rel/properties.json index dc9edb6..cf15118 100644 --- a/infra/config/generated/builders/ci/mac-lsan-fyi-rel/properties.json +++ b/infra/config/generated/builders/ci/mac-lsan-fyi-rel/properties.json
@@ -48,18 +48,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/mac-lsan-fyi-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/mac-lsan-fyi-rel/shadow-properties.json b/infra/config/generated/builders/ci/mac-lsan-fyi-rel/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/mac-lsan-fyi-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/mac-lsan-fyi-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/mac-official/gn-args.json b/infra/config/generated/builders/ci/mac-official/gn-args.json index 62eae43a..2d270e36 100644 --- a/infra/config/generated/builders/ci/mac-official/gn-args.json +++ b/infra/config/generated/builders/ci/mac-official/gn-args.json
@@ -4,6 +4,7 @@ "save_reproducers_on_lld_crash": true, "target_cpu": "arm64", "target_os": "mac", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/mac-official/properties.json b/infra/config/generated/builders/ci/mac-official/properties.json index 846c704..e2c1b77 100644 --- a/infra/config/generated/builders/ci/mac-official/properties.json +++ b/infra/config/generated/builders/ci/mac-official/properties.json
@@ -49,18 +49,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/mac-official/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/mac-official/shadow-properties.json b/infra/config/generated/builders/ci/mac-official/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/mac-official/shadow-properties.json +++ b/infra/config/generated/builders/ci/mac-official/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/mac-rel-cft/gn-args.json b/infra/config/generated/builders/ci/mac-rel-cft/gn-args.json index a3dded0..fca3314 100644 --- a/infra/config/generated/builders/ci/mac-rel-cft/gn-args.json +++ b/infra/config/generated/builders/ci/mac-rel-cft/gn-args.json
@@ -9,6 +9,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "mac", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/mac-rel-cft/properties.json b/infra/config/generated/builders/ci/mac-rel-cft/properties.json index cad3a89..9a32e7f 100644 --- a/infra/config/generated/builders/ci/mac-rel-cft/properties.json +++ b/infra/config/generated/builders/ci/mac-rel-cft/properties.json
@@ -50,18 +50,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/mac-rel-cft/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/mac-rel-cft/shadow-properties.json b/infra/config/generated/builders/ci/mac-rel-cft/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/mac-rel-cft/shadow-properties.json +++ b/infra/config/generated/builders/ci/mac-rel-cft/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/gn-args.json b/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/gn-args.json index 9f5da6be..d41fee8 100644 --- a/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/gn-args.json +++ b/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/gn-args.json
@@ -7,6 +7,7 @@ "is_ubsan_no_recover": true, "target_cpu": "x64", "target_os": "mac", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/properties.json b/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/properties.json index 0266edd6..dfe7e3d1 100644 --- a/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/properties.json +++ b/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/properties.json
@@ -48,18 +48,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/shadow-properties.json b/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/mac-ubsan-fyi-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/win-archive-rel/gn-args.json b/infra/config/generated/builders/ci/win-archive-rel/gn-args.json index be9de26..5e7f86a 100644 --- a/infra/config/generated/builders/ci/win-archive-rel/gn-args.json +++ b/infra/config/generated/builders/ci/win-archive-rel/gn-args.json
@@ -6,6 +6,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/win-archive-rel/properties.json b/infra/config/generated/builders/ci/win-archive-rel/properties.json index b6bf111..6ed5c139 100644 --- a/infra/config/generated/builders/ci/win-archive-rel/properties.json +++ b/infra/config/generated/builders/ci/win-archive-rel/properties.json
@@ -56,18 +56,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/win-archive-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/win-archive-rel/shadow-properties.json b/infra/config/generated/builders/ci/win-archive-rel/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/win-archive-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/win-archive-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/win-arm64-archive-rel/gn-args.json b/infra/config/generated/builders/ci/win-arm64-archive-rel/gn-args.json index 0748c87..bdeaf50 100644 --- a/infra/config/generated/builders/ci/win-arm64-archive-rel/gn-args.json +++ b/infra/config/generated/builders/ci/win-arm64-archive-rel/gn-args.json
@@ -6,6 +6,7 @@ "symbol_level": 1, "target_cpu": "arm64", "target_os": "win", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/win-arm64-archive-rel/properties.json b/infra/config/generated/builders/ci/win-arm64-archive-rel/properties.json index 77fde06..92df674 100644 --- a/infra/config/generated/builders/ci/win-arm64-archive-rel/properties.json +++ b/infra/config/generated/builders/ci/win-arm64-archive-rel/properties.json
@@ -57,18 +57,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/win-arm64-archive-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/win-arm64-archive-rel/shadow-properties.json b/infra/config/generated/builders/ci/win-arm64-archive-rel/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/win-arm64-archive-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/win-arm64-archive-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/win-asan/gn-args.json b/infra/config/generated/builders/ci/win-asan/gn-args.json index bfb83bb..00e103e 100644 --- a/infra/config/generated/builders/ci/win-asan/gn-args.json +++ b/infra/config/generated/builders/ci/win-asan/gn-args.json
@@ -8,6 +8,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_remoteexec": true, "use_siso": true, "v8_enable_verify_heap": true
diff --git a/infra/config/generated/builders/ci/win-asan/properties.json b/infra/config/generated/builders/ci/win-asan/properties.json index 0ac9105..1a4236a 100644 --- a/infra/config/generated/builders/ci/win-asan/properties.json +++ b/infra/config/generated/builders/ci/win-asan/properties.json
@@ -49,18 +49,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/win-asan/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/win-asan/shadow-properties.json b/infra/config/generated/builders/ci/win-asan/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/win-asan/shadow-properties.json +++ b/infra/config/generated/builders/ci/win-asan/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/win-official/gn-args.json b/infra/config/generated/builders/ci/win-official/gn-args.json index c2e0758b..f359c93 100644 --- a/infra/config/generated/builders/ci/win-official/gn-args.json +++ b/infra/config/generated/builders/ci/win-official/gn-args.json
@@ -4,6 +4,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/win-official/properties.json b/infra/config/generated/builders/ci/win-official/properties.json index 5ed22dd..ad12e8a 100644 --- a/infra/config/generated/builders/ci/win-official/properties.json +++ b/infra/config/generated/builders/ci/win-official/properties.json
@@ -49,18 +49,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/win-official/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/win-official/shadow-properties.json b/infra/config/generated/builders/ci/win-official/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/win-official/shadow-properties.json +++ b/infra/config/generated/builders/ci/win-official/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/win-rel-cft/gn-args.json b/infra/config/generated/builders/ci/win-rel-cft/gn-args.json index a21c50a6..865e87dc 100644 --- a/infra/config/generated/builders/ci/win-rel-cft/gn-args.json +++ b/infra/config/generated/builders/ci/win-rel-cft/gn-args.json
@@ -9,6 +9,7 @@ "symbol_level": 1, "target_cpu": "x64", "target_os": "win", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/win-rel-cft/properties.json b/infra/config/generated/builders/ci/win-rel-cft/properties.json index 41b0fdfe..e3c5e513 100644 --- a/infra/config/generated/builders/ci/win-rel-cft/properties.json +++ b/infra/config/generated/builders/ci/win-rel-cft/properties.json
@@ -50,18 +50,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/win-rel-cft/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/win-rel-cft/shadow-properties.json b/infra/config/generated/builders/ci/win-rel-cft/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/win-rel-cft/shadow-properties.json +++ b/infra/config/generated/builders/ci/win-rel-cft/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/builders/ci/win10-code-coverage/gn-args.json b/infra/config/generated/builders/ci/win10-code-coverage/gn-args.json index 78a0983..ad88081 100644 --- a/infra/config/generated/builders/ci/win10-code-coverage/gn-args.json +++ b/infra/config/generated/builders/ci/win10-code-coverage/gn-args.json
@@ -10,6 +10,7 @@ "target_cpu": "x64", "target_os": "win", "use_clang_coverage": true, + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/win10-code-coverage/properties.json b/infra/config/generated/builders/ci/win10-code-coverage/properties.json index ed64632..51448a09 100644 --- a/infra/config/generated/builders/ci/win10-code-coverage/properties.json +++ b/infra/config/generated/builders/ci/win10-code-coverage/properties.json
@@ -59,18 +59,15 @@ "export_coverage_to_zoss": true, "use_clang_coverage": true }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/win10-code-coverage/shadow-properties.json b/infra/config/generated/builders/ci/win10-code-coverage/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/win10-code-coverage/shadow-properties.json +++ b/infra/config/generated/builders/ci/win10-code-coverage/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/win32-archive-rel/gn-args.json b/infra/config/generated/builders/ci/win32-archive-rel/gn-args.json index 34e48a2..399af1a 100644 --- a/infra/config/generated/builders/ci/win32-archive-rel/gn-args.json +++ b/infra/config/generated/builders/ci/win32-archive-rel/gn-args.json
@@ -6,6 +6,7 @@ "symbol_level": 1, "target_cpu": "x86", "target_os": "win", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/win32-archive-rel/properties.json b/infra/config/generated/builders/ci/win32-archive-rel/properties.json index a2bf884..54fee183 100644 --- a/infra/config/generated/builders/ci/win32-archive-rel/properties.json +++ b/infra/config/generated/builders/ci/win32-archive-rel/properties.json
@@ -56,18 +56,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/win32-archive-rel/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 250 },
diff --git a/infra/config/generated/builders/ci/win32-archive-rel/shadow-properties.json b/infra/config/generated/builders/ci/win32-archive-rel/shadow-properties.json index 673c7c0..78dedff8 100644 --- a/infra/config/generated/builders/ci/win32-archive-rel/shadow-properties.json +++ b/infra/config/generated/builders/ci/win32-archive-rel/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 250 }
diff --git a/infra/config/generated/builders/ci/win32-official/gn-args.json b/infra/config/generated/builders/ci/win32-official/gn-args.json index ba40a2d..e4afa7a 100644 --- a/infra/config/generated/builders/ci/win32-official/gn-args.json +++ b/infra/config/generated/builders/ci/win32-official/gn-args.json
@@ -3,6 +3,7 @@ "is_official_build": true, "target_cpu": "x86", "target_os": "win", + "use_reclient": false, "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/ci/win32-official/properties.json b/infra/config/generated/builders/ci/win32-official/properties.json index dc7538d..abd03ba 100644 --- a/infra/config/generated/builders/ci/win32-official/properties.json +++ b/infra/config/generated/builders/ci/win32-official/properties.json
@@ -49,18 +49,15 @@ "targets_spec_directory": "src/infra/config/generated/builders/ci/win32-official/targets" } }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-trusted", "remote_jobs": 500 },
diff --git a/infra/config/generated/builders/ci/win32-official/shadow-properties.json b/infra/config/generated/builders/ci/win32-official/shadow-properties.json index 4325ef4..dc0a10e9 100644 --- a/infra/config/generated/builders/ci/win32-official/shadow-properties.json +++ b/infra/config/generated/builders/ci/win32-official/shadow-properties.json
@@ -1,16 +1,13 @@ { - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "metrics_project": "chromium-reclient-metrics", - "scandeps_server": true - }, "$build/siso": { "configs": [ "builder" ], + "enable_cloud_monitoring": true, "enable_cloud_profiler": true, "enable_cloud_trace": true, "experiments": [], + "metrics_project": "chromium-reclient-metrics", "project": "rbe-chromium-untrusted", "remote_jobs": 500 }
diff --git a/infra/config/generated/luci/commit-queue.cfg b/infra/config/generated/luci/commit-queue.cfg index 3ec5455..0099dfb4 100644 --- a/infra/config/generated/luci/commit-queue.cfg +++ b/infra/config/generated/luci/commit-queue.cfg
@@ -38,6 +38,13 @@ owner_whitelist_group: "project-chromium-robot-committers" } builders { + name: "chrome/try/android-arm32-orderfile" + includable_only: true + result_visibility: COMMENT_LEVEL_RESTRICTED + owner_whitelist_group: "googlers" + owner_whitelist_group: "project-chromium-robot-committers" + } + builders { name: "chrome/try/android-arm32-pgo" includable_only: true result_visibility: COMMENT_LEVEL_RESTRICTED @@ -45,6 +52,13 @@ owner_whitelist_group: "project-chromium-robot-committers" } builders { + name: "chrome/try/android-arm64-orderfile" + includable_only: true + result_visibility: COMMENT_LEVEL_RESTRICTED + owner_whitelist_group: "googlers" + owner_whitelist_group: "project-chromium-robot-committers" + } + builders { name: "chrome/try/android-arm64-pgo" includable_only: true result_visibility: COMMENT_LEVEL_RESTRICTED @@ -7332,6 +7346,7 @@ ref_regexp_exclude: "refs/branch-heads/6834" ref_regexp_exclude: "refs/branch-heads/6943" ref_regexp_exclude: "refs/branch-heads/6998" + ref_regexp_exclude: "refs/branch-heads/7049" } } verifiers {
diff --git a/infra/config/generated/luci/cr-buildbucket.cfg b/infra/config/generated/luci/cr-buildbucket.cfg index 86b2a80..7708856 100644 --- a/infra/config/generated/luci/cr-buildbucket.cfg +++ b/infra/config/generated/luci/cr-buildbucket.cfg
@@ -29062,18 +29062,15 @@ } properties: '{' - ' "$build/reclient": {' - ' "instance": "rbe-chromium-trusted",' - ' "metrics_project": "chromium-reclient-metrics",' - ' "scandeps_server": true' - ' },' ' "$build/siso": {' ' "configs": [' ' "builder"' ' ],' + ' "enable_cloud_monitoring": true,' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' ' "experiments": [],' + ' "metrics_project": "chromium-reclient-metrics",' ' "project": "rbe-chromium-trusted"' ' },' ' "$recipe_engine/resultdb/test_presentation": {' @@ -29142,18 +29139,15 @@ pool: "luci.chromium.try" properties: '{' - ' "$build/reclient": {' - ' "instance": "rbe-chromium-untrusted",' - ' "metrics_project": "chromium-reclient-metrics",' - ' "scandeps_server": true' - ' },' ' "$build/siso": {' ' "configs": [' ' "builder"' ' ],' + ' "enable_cloud_monitoring": true,' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' ' "experiments": [],' + ' "metrics_project": "chromium-reclient-metrics",' ' "project": "rbe-chromium-untrusted"' ' }' '}' @@ -30246,18 +30240,15 @@ } properties: '{' - ' "$build/reclient": {' - ' "instance": "rbe-chromium-trusted",' - ' "metrics_project": "chromium-reclient-metrics",' - ' "scandeps_server": true' - ' },' ' "$build/siso": {' ' "configs": [' ' "builder"' ' ],' + ' "enable_cloud_monitoring": true,' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' ' "experiments": [],' + ' "metrics_project": "chromium-reclient-metrics",' ' "project": "rbe-chromium-trusted"' ' },' ' "$recipe_engine/resultdb/test_presentation": {' @@ -30327,18 +30318,15 @@ pool: "luci.chromium.try" properties: '{' - ' "$build/reclient": {' - ' "instance": "rbe-chromium-untrusted",' - ' "metrics_project": "chromium-reclient-metrics",' - ' "scandeps_server": true' - ' },' ' "$build/siso": {' ' "configs": [' ' "builder"' ' ],' + ' "enable_cloud_monitoring": true,' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' ' "experiments": [],' + ' "metrics_project": "chromium-reclient-metrics",' ' "project": "rbe-chromium-untrusted"' ' }' '}' @@ -31544,18 +31532,15 @@ } properties: '{' - ' "$build/reclient": {' - ' "instance": "rbe-chromium-trusted",' - ' "metrics_project": "chromium-reclient-metrics",' - ' "scandeps_server": true' - ' },' ' "$build/siso": {' ' "configs": [' ' "builder"' ' ],' + ' "enable_cloud_monitoring": true,' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' ' "experiments": [],' + ' "metrics_project": "chromium-reclient-metrics",' ' "project": "rbe-chromium-trusted"' ' },' ' "$recipe_engine/resultdb/test_presentation": {' @@ -31624,18 +31609,15 @@ pool: "luci.chromium.try" properties: '{' - ' "$build/reclient": {' - ' "instance": "rbe-chromium-untrusted",' - ' "metrics_project": "chromium-reclient-metrics",' - ' "scandeps_server": true' - ' },' ' "$build/siso": {' ' "configs": [' ' "builder"' ' ],' + ' "enable_cloud_monitoring": true,' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' ' "experiments": [],' + ' "metrics_project": "chromium-reclient-metrics",' ' "project": "rbe-chromium-untrusted"' ' }' '}' @@ -56484,18 +56466,15 @@ } properties: '{' - ' "$build/reclient": {' - ' "instance": "rbe-chromium-trusted",' - ' "metrics_project": "chromium-reclient-metrics",' - ' "scandeps_server": true' - ' },' ' "$build/siso": {' ' "configs": [' ' "builder"' ' ],' + ' "enable_cloud_monitoring": true,' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' ' "experiments": [],' + ' "metrics_project": "chromium-reclient-metrics",' ' "project": "rbe-chromium-trusted",' ' "remote_jobs": 500' ' },' @@ -56559,18 +56538,15 @@ pool: "luci.chromium.try" properties: '{' - ' "$build/reclient": {' - ' "instance": "rbe-chromium-untrusted",' - ' "metrics_project": "chromium-reclient-metrics",' - ' "scandeps_server": true' - ' },' ' "$build/siso": {' ' "configs": [' ' "builder"' ' ],' + ' "enable_cloud_monitoring": true,' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' ' "experiments": [],' + ' "metrics_project": "chromium-reclient-metrics",' ' "project": "rbe-chromium-untrusted",' ' "remote_jobs": 500' ' }' @@ -56615,18 +56591,15 @@ } properties: '{' - ' "$build/reclient": {' - ' "instance": "rbe-chromium-trusted",' - ' "metrics_project": "chromium-reclient-metrics",' - ' "scandeps_server": true' - ' },' ' "$build/siso": {' ' "configs": [' ' "builder"' ' ],' + ' "enable_cloud_monitoring": true,' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' ' "experiments": [],' + ' "metrics_project": "chromium-reclient-metrics",' ' "project": "rbe-chromium-trusted",' ' "remote_jobs": 500' ' },' @@ -56690,18 +56663,15 @@ pool: "luci.chromium.try" properties: '{' - ' "$build/reclient": {' - ' "instance": "rbe-chromium-untrusted",' - ' "metrics_project": "chromium-reclient-metrics",' - ' "scandeps_server": true' - ' },' ' "$build/siso": {' ' "configs": [' ' "builder"' ' ],' + ' "enable_cloud_monitoring": true,' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' ' "experiments": [],' + ' "metrics_project": "chromium-reclient-metrics",' ' "project": "rbe-chromium-untrusted",' ' "remote_jobs": 500' ' }'
diff --git a/infra/config/generated/luci/luci-milo.cfg b/infra/config/generated/luci/luci-milo.cfg index ea3b562..7e9248b 100644 --- a/infra/config/generated/luci/luci-milo.cfg +++ b/infra/config/generated/luci/luci-milo.cfg
@@ -334,6 +334,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -1243,6 +1247,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -1980,6 +1988,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -2512,6 +2524,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -2872,6 +2888,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -3302,942 +3322,6 @@ builder_view_only: true } consoles { - id: "Tree Closers" - name: "Tree Closers" - repo_url: "https://chromium.googlesource.com/chromium/src" - refs: "regexp:refs/heads/main" - manifest_name: "REVISION" - builders { - name: "buildbucket/luci.chromium.ci/android-official" - category: "chromium|android" - short_name: "off" - } - builders { - name: "buildbucket/luci.chromium.ci/android-archive-rel" - category: "chromium|android" - short_name: "rel" - } - builders { - name: "buildbucket/luci.chromium.ci/android-arm64-archive-rel" - category: "chromium|android|arm" - short_name: "arm64" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-official" - category: "chromium|linux" - short_name: "off" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-archive-rel" - category: "chromium|linux" - short_name: "rel" - } - builders { - name: "buildbucket/luci.chromium.ci/mac-official" - category: "chromium|mac" - short_name: "off" - } - builders { - name: "buildbucket/luci.chromium.ci/mac-archive-rel" - category: "chromium|mac" - short_name: "rel" - } - builders { - name: "buildbucket/luci.chromium.ci/mac-arm64-archive-rel" - category: "chromium|mac|arm" - short_name: "rel" - } - builders { - name: "buildbucket/luci.chromium.ci/win32-official" - category: "chromium|win|off" - short_name: "32" - } - builders { - name: "buildbucket/luci.chromium.ci/win32-archive-rel" - category: "chromium|win|rel" - short_name: "32" - } - builders { - name: "buildbucket/luci.chromium.ci/win-archive-rel" - category: "chromium|win|rel" - short_name: "64" - } - builders { - name: "buildbucket/luci.chromium.ci/Android arm Builder (dbg)" - category: "chromium.android|builder|arm" - short_name: "32" - } - builders { - name: "buildbucket/luci.chromium.ci/Android arm64 Builder All Targets (dbg)" - category: "chromium.android|builder|arm" - short_name: "64" - } - builders { - name: "buildbucket/luci.chromium.ci/Deterministic Android (dbg)" - category: "chromium.android|builder|det" - short_name: "dbg" - } - builders { - name: "buildbucket/luci.chromium.ci/Deterministic Android" - category: "chromium.android|builder|det" - short_name: "rel" - } - builders { - name: "buildbucket/luci.chromium.ci/android-x86-rel" - category: "chromium.android|builder|x86" - short_name: "x86" - } - builders { - name: "buildbucket/luci.chromium.ci/android-14-tablet-landscape-arm64-rel" - category: "chromium.android|builder_tester|arm64" - short_name: "14T-L" - } - builders { - name: "buildbucket/luci.chromium.ci/android-12-x64-rel" - category: "chromium.android|builder_tester|x64" - short_name: "12" - } - builders { - name: "buildbucket/luci.chromium.ci/android-13-x64-rel" - category: "chromium.android|builder_tester|x64" - short_name: "13" - } - builders { - name: "buildbucket/luci.chromium.ci/android-10-x86-rel" - category: "chromium.android|builder_tester|x86" - short_name: "10" - } - builders { - name: "buildbucket/luci.chromium.ci/android-11-x86-rel" - category: "chromium.android|builder_tester|x86" - short_name: "11" - } - builders { - name: "buildbucket/luci.chromium.ci/android-pie-x86-rel" - category: "chromium.android|builder_tester|x86" - short_name: "P" - } - builders { - name: "buildbucket/luci.chromium.ci/android-cast-arm-dbg" - category: "chromium.android|cast" - short_name: "and32dbg" - } - builders { - name: "buildbucket/luci.chromium.ci/android-cast-arm-rel" - category: "chromium.android|cast" - short_name: "and32rel" - } - builders { - name: "buildbucket/luci.chromium.ci/android-cast-arm64-dbg" - category: "chromium.android|cast" - short_name: "and64dbg" - } - builders { - name: "buildbucket/luci.chromium.ci/android-cast-arm64-rel" - category: "chromium.android|cast" - short_name: "and64rel" - } - builders { - name: "buildbucket/luci.chromium.ci/android-14-arm64-rel" - category: "chromium.android|on_cq" - short_name: "14" - } - builders { - name: "buildbucket/luci.chromium.ci/android-pie-arm64-rel" - category: "chromium.android|on_cq" - short_name: "P" - } - builders { - name: "buildbucket/luci.chromium.ci/android-12l-x64-rel-cq" - category: "chromium.android|on_cq|x64" - short_name: "12L" - } - builders { - name: "buildbucket/luci.chromium.ci/android-webview-13-x64-hostside-rel" - category: "chromium.android|on_cq|x64" - short_name: "13-hs" - } - builders { - name: "buildbucket/luci.chromium.ci/android-15-x64-rel" - category: "chromium.android|on_cq|x64" - short_name: "15" - } - builders { - name: "buildbucket/luci.chromium.ci/android-oreo-x86-rel" - category: "chromium.android|on_cq|x86" - short_name: "O" - } - builders { - name: "buildbucket/luci.chromium.ci/android-desktop-x64-compile-rel" - category: "chromium.android.desktop|builder|x64" - short_name: "rel" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-chromeos-dbg" - category: "chromium.chromiumos|default" - short_name: "dbg" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-chromeos-rel" - category: "chromium.chromiumos|default" - short_name: "rel" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-cfm-rel" - category: "chromium.chromiumos|default|cfm" - short_name: "cfm" - } - builders { - name: "buildbucket/luci.chromium.ci/chromeos-arm-generic-dbg" - category: "chromium.chromiumos|simple|debug" - short_name: "arm" - } - builders { - name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-dbg" - category: "chromium.chromiumos|simple|debug|x64" - short_name: "dbg" - } - builders { - name: "buildbucket/luci.chromium.ci/chromeos-arm64-generic-rel" - category: "chromium.chromiumos|simple|release" - short_name: "a64" - } - builders { - name: "buildbucket/luci.chromium.ci/chromeos-arm-generic-rel" - category: "chromium.chromiumos|simple|release" - short_name: "arm" - } - builders { - name: "buildbucket/luci.chromium.ci/chromeos-jacuzzi-rel" - category: "chromium.chromiumos|simple|release" - short_name: "jcz" - } - builders { - name: "buildbucket/luci.chromium.ci/chromeos-octopus-rel" - category: "chromium.chromiumos|simple|release" - short_name: "oct" - } - builders { - name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-asan-rel" - category: "chromium.chromiumos|simple|release|x64" - short_name: "asn" - } - builders { - name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-cfi-thin-lto-rel" - category: "chromium.chromiumos|simple|release|x64" - short_name: "cfi" - } - builders { - name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-rel" - category: "chromium.chromiumos|simple|release|x64" - short_name: "compile" - } - builders { - name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-rel-gtest" - category: "chromium.chromiumos|simple|release|x64" - short_name: "gtest" - } - builders { - name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-rel-tast" - category: "chromium.chromiumos|simple|release|x64" - short_name: "tast" - } - builders { - name: "buildbucket/luci.chromium.ci/fuchsia-arm64-cast-receiver-rel" - category: "chromium.fuchsia|cast-receiver" - short_name: "arm64" - } - builders { - name: "buildbucket/luci.chromium.ci/fuchsia-x64-cast-receiver-rel" - category: "chromium.fuchsia|cast-receiver" - short_name: "x64" - } - builders { - name: "buildbucket/luci.chromium.ci/fuchsia-x64-cast-receiver-dbg" - category: "chromium.fuchsia|cast-receiver" - short_name: "x64-dbg" - } - builders { - name: "buildbucket/luci.chromium.ci/Deterministic Fuchsia (dbg)" - category: "chromium.fuchsia|det" - short_name: "x64" - } - builders { - name: "buildbucket/luci.chromium.ci/Android Release (Nexus 5X)" - category: "chromium.gpu|Android" - short_name: "N5X" - } - builders { - name: "buildbucket/luci.chromium.ci/Android Release (Pixel 2)" - category: "chromium.gpu|Android" - short_name: "P2" - } - builders { - name: "buildbucket/luci.chromium.ci/GPU Linux Builder" - category: "chromium.gpu|Linux" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux Release (NVIDIA)" - category: "chromium.gpu|Linux" - } - builders { - name: "buildbucket/luci.chromium.ci/GPU Mac Builder" - category: "chromium.gpu|Mac" - } - builders { - name: "buildbucket/luci.chromium.ci/Mac Release (Intel)" - category: "chromium.gpu|Mac" - } - builders { - name: "buildbucket/luci.chromium.ci/Mac Retina Release (AMD)" - category: "chromium.gpu|Mac" - } - builders { - name: "buildbucket/luci.chromium.ci/GPU Win x64 Builder" - category: "chromium.gpu|Windows" - } - builders { - name: "buildbucket/luci.chromium.ci/Win10 x64 Release (NVIDIA)" - category: "chromium.gpu|Windows" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-oi-rel" - category: "chromium.linux|OriginIsolation" - short_name: "oi" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-bfcache-rel" - category: "chromium.linux|bfcache" - short_name: "bfc" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-cast-arm-rel" - category: "chromium.linux|cast" - short_name: "arm32rel" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-cast-arm64-rel" - category: "chromium.linux|cast" - short_name: "arm64rel" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-cast-x64-dbg" - category: "chromium.linux|cast" - short_name: "x64dbg" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-cast-x64-rel" - category: "chromium.linux|cast" - short_name: "x64rel" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux Builder (dbg)" - category: "chromium.linux|debug|builder" - short_name: "64" - } - builders { - name: "buildbucket/luci.chromium.ci/Deterministic Linux (dbg)" - category: "chromium.linux|debug|builder" - short_name: "det" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux Tests (dbg)(1)" - category: "chromium.linux|debug|tester" - short_name: "64" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux Builder" - category: "chromium.linux|release" - short_name: "bld" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux Builder (Wayland)" - category: "chromium.linux|release" - short_name: "bld-wl" - } - builders { - name: "buildbucket/luci.chromium.ci/Deterministic Linux" - category: "chromium.linux|release" - short_name: "det" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-gcc-rel" - category: "chromium.linux|release" - short_name: "gcc" - } - builders { - name: "buildbucket/luci.chromium.ci/Network Service Linux" - category: "chromium.linux|release" - short_name: "nsl" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-extended-tracing-rel" - category: "chromium.linux|release" - short_name: "trc" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux Tests" - category: "chromium.linux|release" - short_name: "tst" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux Tests (Wayland)" - category: "chromium.linux|release" - short_name: "tst-wl" - } - builders { - name: "buildbucket/luci.chromium.ci/mac14-tests-dbg" - category: "chromium.mac|debug" - short_name: "14" - } - builders { - name: "buildbucket/luci.chromium.ci/Mac Builder (dbg)" - category: "chromium.mac|debug" - short_name: "bld" - } - builders { - name: "buildbucket/luci.chromium.ci/mac-arm64-dbg" - category: "chromium.mac|debug|arm64" - short_name: "bld" - } - builders { - name: "buildbucket/luci.chromium.ci/ios-device" - category: "chromium.mac|ios|default" - short_name: "dev" - } - builders { - name: "buildbucket/luci.chromium.ci/ios-simulator-full-configs" - category: "chromium.mac|ios|default" - short_name: "ful" - } - builders { - name: "buildbucket/luci.chromium.ci/ios-simulator-noncq" - category: "chromium.mac|ios|default" - short_name: "non" - } - builders { - name: "buildbucket/luci.chromium.ci/ios-simulator" - category: "chromium.mac|ios|default" - short_name: "sim" - } - builders { - name: "buildbucket/luci.chromium.ci/Mac11 Tests" - category: "chromium.mac|mac" - short_name: "11" - } - builders { - name: "buildbucket/luci.chromium.ci/Mac12 Tests" - category: "chromium.mac|mac" - short_name: "12" - } - builders { - name: "buildbucket/luci.chromium.ci/Mac13 Tests" - category: "chromium.mac|mac" - short_name: "13" - } - builders { - name: "buildbucket/luci.chromium.ci/mac14-tests" - category: "chromium.mac|mac" - short_name: "14" - } - builders { - name: "buildbucket/luci.chromium.ci/Mac Builder" - category: "chromium.mac|release" - short_name: "bld" - } - builders { - name: "buildbucket/luci.chromium.ci/mac-arm64-on-arm64-rel" - category: "chromium.mac|release|arm64" - short_name: "a64" - } - builders { - name: "buildbucket/luci.chromium.ci/mac-arm64-rel" - category: "chromium.mac|release|arm64" - short_name: "bld" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux CFI" - category: "chromium.memory|cfi" - short_name: "lnx" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-codeql-generator" - category: "chromium.memory|codeql-linux" - short_name: "cdql-lnx" - } - builders { - name: "buildbucket/luci.chromium.ci/linux-codeql-query-runner" - category: "chromium.memory|codeql-linux-queries" - short_name: "cdql-lnx-qrs" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux Chromium OS ASan LSan Builder" - category: "chromium.memory|cros|asan" - short_name: "bld" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux Chromium OS ASan LSan Tests (1)" - category: "chromium.memory|cros|asan" - short_name: "tst" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux ChromiumOS MSan Builder" - category: "chromium.memory|cros|msan" - short_name: "bld" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux ChromiumOS MSan Tests" - category: "chromium.memory|cros|msan" - short_name: "tst" - } - builders { - name: "buildbucket/luci.chromium.ci/ios-asan" - category: "chromium.memory|iOS" - short_name: "asn" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux TSan Builder" - category: "chromium.memory|linux|TSan v2" - short_name: "bld" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux TSan Tests" - category: "chromium.memory|linux|TSan v2" - short_name: "tst" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux ASan LSan Tests (1)" - category: "chromium.memory|linux|asan lsan" - short_name: "tst" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux MSan Builder" - category: "chromium.memory|linux|msan" - short_name: "bld" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux MSan Tests" - category: "chromium.memory|linux|msan" - short_name: "tst" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux UBSan Builder" - category: "chromium.memory|linux|ubsan" - short_name: "bld" - } - builders { - name: "buildbucket/luci.chromium.ci/Linux UBSan Tests" - category: "chromium.memory|linux|ubsan" - short_name: "tst" - } - builders { - name: "buildbucket/luci.chromium.ci/WebKit Linux ASAN" - category: "chromium.memory|linux|webkit" - short_name: "asn" - } - builders { - name: "buildbucket/luci.chromium.ci/WebKit Linux Leak" - category: "chromium.memory|linux|webkit" - short_name: "lk" - } - builders { - name: "buildbucket/luci.chromium.ci/WebKit Linux MSAN" - category: "chromium.memory|linux|webkit" - short_name: "msn" - } - builders { - name: "buildbucket/luci.chromium.ci/Mac ASan 64 Builder" - category: "chromium.memory|mac" - short_name: "bld" - } - builders { - name: "buildbucket/luci.chromium.ci/Mac ASan 64 Tests (1)" - category: "chromium.memory|mac" - short_name: "tst" - } - builders { - name: "buildbucket/luci.chromium.ci/win-asan" - category: "chromium.memory|win" - short_name: "asn" - } - builders { - name: "buildbucket/luci.chromium.ci/Win Builder (dbg)" - category: "chromium.win|debug|builder" - short_name: "32" - } - builders { - name: "buildbucket/luci.chromium.ci/Win x64 Builder (dbg)" - category: "chromium.win|debug|builder" - short_name: "64" - } - builders { - name: "buildbucket/luci.chromium.ci/win-arm64-dbg" - category: "chromium.win|debug|builder" - short_name: "a64" - } - builders { - name: "buildbucket/luci.chromium.ci/Windows deterministic" - category: "chromium.win|misc" - short_name: "det" - } - builders { - name: "buildbucket/luci.chromium.ci/WebKit Win10" - category: "chromium.win|misc" - short_name: "wbk" - } - builders { - name: "buildbucket/luci.chromium.ci/Win Builder" - category: "chromium.win|release|builder" - short_name: "32" - } - builders { - name: "buildbucket/luci.chromium.ci/Win x64 Builder" - category: "chromium.win|release|builder" - short_name: "64" - } - builders { - name: "buildbucket/luci.chromium.ci/win-arm64-rel" - category: "chromium.win|release|builder" - short_name: "a64" - } - builders { - name: "buildbucket/luci.chromium.ci/Win10 Tests x64" - category: "chromium.win|release|tester" - short_name: "w10" - } - header { - oncalls { - name: "Chromium" - url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-build-sheriff" - } - oncalls { - name: "Android" - url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-android-sheriff" - } - oncalls { - name: "iOS" - url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-ios" - } - oncalls { - name: "ChromeOS" - url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chromeos-gardeners" - } - oncalls { - name: "Fuchsia" - url: "https://chrome-ops-rotation-proxy.appspot.com/current/grotation:chrome-fuchsia-engprod" - } - oncalls { - name: "GPU" - url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-gpu-pixel-wrangler-weekly" - } - oncalls { - name: "ANGLE" - url: "https://chrome-ops-rotation-proxy.appspot.com/current/grotation:angle-wrangler" - } - oncalls { - name: "Trooper" - url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-ops-client-infra" - show_primary_secondary_labels: true - } - links { - name: "Builds" - links { - text: "continuous" - url: "https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html" - alt: "Continuous browser snapshots" - } - links { - text: "symbols" - url: "https://www.chromium.org/developers/how-tos/debugging-on-windows" - alt: "Windows Symbols" - } - links { - text: "status" - url: "https://chromium-status.appspot.com/" - alt: "Current tree status" - } - } - links { - name: "Dashboards" - links { - text: "perf" - url: "https://chromeperf.appspot.com/" - alt: "Chrome perf dashboard" - } - links { - text: "LUCI Analysis" - url: "https://luci-analysis.appspot.com" - alt: "New flake portal" - } - } - links { - name: "Chromium" - links { - text: "source" - url: "https://chromium.googlesource.com/chromium/src" - alt: "Chromium source code repository" - } - links { - text: "reviews" - url: "https://chromium-review.googlesource.com" - alt: "Chromium code review tool" - } - links { - text: "bugs" - url: "https://crbug.com" - alt: "Chromium bug tracker" - } - links { - text: "coverage" - url: "https://analysis.chromium.org/coverage/p/chromium" - alt: "Chromium code coverage dashboard" - } - links { - text: "dev" - url: "https://dev.chromium.org/Home" - alt: "Chromium developer home page" - } - links { - text: "support" - url: "https://support.google.com/chrome/#topic=7438008" - alt: "Google Chrome help center" - } - } - links { - name: "Consoles" - links { - text: "android" - url: "/p/chromium/g/chromium.android" - alt: "Chromium Android console" - } - links { - text: "android.desktop" - url: "/p/chromium/g/chromium.android.desktop" - alt: "Chromium Android Desktop console" - } - links { - text: "angle" - url: "/p/chromium/g/chromium.angle" - alt: "Chromium ANGLE console" - } - links { - text: "blink.infra" - url: "/p/chromium/g/blink.infra" - alt: "Chromium Blink Infra console" - } - links { - text: "checks" - url: "/p/chromium/g/checks" - alt: "Checks console" - } - links { - text: "chromiumos" - url: "/p/chromium/g/chromium.chromiumos" - alt: "ChromiumOS console" - } - links { - text: "clang" - url: "/p/chromium/g/chromium.clang" - alt: "Chromium Clang console" - } - links { - text: "dawn" - url: "/p/chromium/g/chromium.dawn" - alt: "Chromium Dawn console" - } - links { - text: "enterprise companion" - url: "/p/chromium/g/chromium.enterprise_companion" - alt: "Chromium Enterprise Companion App console" - } - links { - text: "flakiness" - url: "/p/chromium/g/chromium.flakiness" - alt: "Chromium Flakiness console" - } - links { - text: "fuchsia" - url: "/p/chromium/g/chromium.fuchsia" - alt: "Chromium Fuchsia console" - } - links { - text: "fuzz" - url: "/p/chromium/g/chromium.fuzz" - alt: "Chromium Fuzz console" - } - links { - text: "fyi" - url: "/p/chromium/g/chromium.fyi" - alt: "Chromium FYI console" - } - links { - text: "gpu" - url: "/p/chromium/g/chromium.gpu" - alt: "Chromium GPU console" - } - links { - text: "infra" - url: "/p/chromium/g/chromium.infra" - alt: "Chromium Infra console" - } - links { - text: "memory.fyi" - url: "/p/chromium/g/chromium.memory.fyi" - alt: "Chromium Memory FYI console" - } - links { - text: "perf" - url: "/p/chrome/g/chrome.perf/console" - alt: "Chromium Perf console" - } - links { - text: "perf.fyi" - url: "/p/chrome/g/chrome.perf.fyi/console" - alt: "Chromium Perf FYI console" - } - links { - text: "swangle" - url: "/p/chromium/g/chromium.swangle" - alt: "Chromium SWANGLE console" - } - links { - text: "updater" - url: "/p/chromium/g/chromium.updater" - alt: "Chromium Updater console" - } - links { - text: "webrtc" - url: "/p/chromium/g/chromium.webrtc" - alt: "Chromium WebRTC console" - } - } - links { - name: "Branch Consoles" - links { - text: "m126" - url: "/p/chromium-m126/g/main/console" - } - links { - text: "m132" - url: "/p/chromium-m132/g/main/console" - } - links { - text: "m133" - url: "/p/chromium-m133/g/main/console" - } - links { - text: "m134" - url: "/p/chromium-m134/g/main/console" - } - links { - text: "trunk" - url: "/p/chromium/g/main/console" - alt: "Trunk (ToT) console" - } - } - links { - name: "Tryservers" - links { - text: "android" - url: "/p/chromium/g/tryserver.chromium.android/builders" - alt: "Android" - } - links { - text: "angle" - url: "/p/chromium/g/tryserver.chromium.angle/builders" - alt: "Angle" - } - links { - text: "blink" - url: "/p/chromium/g/tryserver.blink/builders" - alt: "Blink" - } - links { - text: "chrome" - url: "/p/chrome/g/tryserver.chrome/builders" - alt: "Chrome" - } - links { - text: "chromiumos" - url: "/p/chromium/g/tryserver.chromium.chromiumos/builders" - alt: "ChromiumOS" - } - links { - text: "fuchsia" - url: "/p/chromium/g/tryserver.chromium.fuchsia/builders" - alt: "Fuchsia" - } - links { - text: "fuzz" - url: "/p/chromium/g/tryserver.chromium.fuzz/builders" - alt: "Fuzz" - } - links { - text: "linux" - url: "/p/chromium/g/tryserver.chromium.linux/builders" - alt: "Linux" - } - links { - text: "mac" - url: "/p/chromium/g/tryserver.chromium.mac/builders" - alt: "Mac" - } - links { - text: "swangle" - url: "/p/chromium/g/tryserver.chromium.swangle/builders" - alt: "SWANGLE" - } - links { - text: "tricium" - url: "/p/chromium/g/tryserver.chromium.tricium/builders" - alt: "Tricium" - } - links { - text: "win" - url: "/p/chromium/g/tryserver.chromium.win/builders" - alt: "Win" - } - } - links { - name: "Navigate" - links { - text: "about" - url: "http://dev.chromium.org/developers/testing/chromium-build-infrastructure/tour-of-the-chromium-buildbot" - alt: "Tour of the console" - } - links { - text: "customize" - url: "https://chromium.googlesource.com/chromium/src/+/refs/heads/main/infra/config/generated/luci/luci-milo.cfg" - alt: "Customize this console" - } - } - console_groups { - title { - text: "Tree Closers" - url: "https://chromium-status.appspot.com/" - } - console_ids: "chromium/Tree Closers" - } - console_groups { - title { - text: "Gardener Rotations" - url: "https://chromium-status.appspot.com/" - } - console_ids: "chromium/android rotation" - console_ids: "chromium/angle rotation" - console_ids: "chromium/cft rotation" - console_ids: "chromium/chromium rotation" - console_ids: "chromium/chromium.gpu rotation" - console_ids: "chrome/chrome.perf" - console_ids: "chromium/dawn rotation" - console_ids: "chromium/fuchsia rotation" - console_ids: "chromium/ios rotation" - } - tree_status_host: "chromium-status.appspot.com" - tree_name: "chromium" - } -} -consoles { id: "android rotation" name: "android rotation" repo_url: "https://chromium.googlesource.com/chromium/src" @@ -4653,6 +3737,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -4739,19 +3827,471 @@ text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/Tree Closers" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" + } + console_groups { + console_ids: "chromium/chromium rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" + console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" + console_ids: "chromium/dawn rotation" + console_ids: "chromium/fuchsia rotation" + console_ids: "chromium/ios rotation" + } + tree_status_host: "chromium-status.appspot.com" + tree_name: "chromium" + } +} +consoles { + id: "android tree closers" + name: "android tree closers" + repo_url: "https://chromium.googlesource.com/chromium/src" + refs: "regexp:refs/heads/main" + manifest_name: "REVISION" + builders { + name: "buildbucket/luci.chromium.ci/Android arm Builder (dbg)" + category: "chromium.android|builder|arm" + short_name: "32" + } + builders { + name: "buildbucket/luci.chromium.ci/Android arm64 Builder All Targets (dbg)" + category: "chromium.android|builder|arm" + short_name: "64" + } + builders { + name: "buildbucket/luci.chromium.ci/Deterministic Android (dbg)" + category: "chromium.android|builder|det" + short_name: "dbg" + } + builders { + name: "buildbucket/luci.chromium.ci/Deterministic Android" + category: "chromium.android|builder|det" + short_name: "rel" + } + builders { + name: "buildbucket/luci.chromium.ci/android-x86-rel" + category: "chromium.android|builder|x86" + short_name: "x86" + } + builders { + name: "buildbucket/luci.chromium.ci/android-14-tablet-landscape-arm64-rel" + category: "chromium.android|builder_tester|arm64" + short_name: "14T-L" + } + builders { + name: "buildbucket/luci.chromium.ci/android-12-x64-rel" + category: "chromium.android|builder_tester|x64" + short_name: "12" + } + builders { + name: "buildbucket/luci.chromium.ci/android-13-x64-rel" + category: "chromium.android|builder_tester|x64" + short_name: "13" + } + builders { + name: "buildbucket/luci.chromium.ci/android-10-x86-rel" + category: "chromium.android|builder_tester|x86" + short_name: "10" + } + builders { + name: "buildbucket/luci.chromium.ci/android-11-x86-rel" + category: "chromium.android|builder_tester|x86" + short_name: "11" + } + builders { + name: "buildbucket/luci.chromium.ci/android-pie-x86-rel" + category: "chromium.android|builder_tester|x86" + short_name: "P" + } + builders { + name: "buildbucket/luci.chromium.ci/android-cast-arm-dbg" + category: "chromium.android|cast" + short_name: "and32dbg" + } + builders { + name: "buildbucket/luci.chromium.ci/android-cast-arm-rel" + category: "chromium.android|cast" + short_name: "and32rel" + } + builders { + name: "buildbucket/luci.chromium.ci/android-cast-arm64-dbg" + category: "chromium.android|cast" + short_name: "and64dbg" + } + builders { + name: "buildbucket/luci.chromium.ci/android-cast-arm64-rel" + category: "chromium.android|cast" + short_name: "and64rel" + } + builders { + name: "buildbucket/luci.chromium.ci/android-14-arm64-rel" + category: "chromium.android|on_cq" + short_name: "14" + } + builders { + name: "buildbucket/luci.chromium.ci/android-pie-arm64-rel" + category: "chromium.android|on_cq" + short_name: "P" + } + builders { + name: "buildbucket/luci.chromium.ci/android-12l-x64-rel-cq" + category: "chromium.android|on_cq|x64" + short_name: "12L" + } + builders { + name: "buildbucket/luci.chromium.ci/android-webview-13-x64-hostside-rel" + category: "chromium.android|on_cq|x64" + short_name: "13-hs" + } + builders { + name: "buildbucket/luci.chromium.ci/android-15-x64-rel" + category: "chromium.android|on_cq|x64" + short_name: "15" + } + builders { + name: "buildbucket/luci.chromium.ci/android-oreo-x86-rel" + category: "chromium.android|on_cq|x86" + short_name: "O" + } + builders { + name: "buildbucket/luci.chromium.ci/android-desktop-x64-compile-rel" + category: "chromium.android.desktop|builder|x64" + short_name: "rel" + } + header { + oncalls { + name: "Chromium" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-build-sheriff" + } + oncalls { + name: "Android" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-android-sheriff" + } + oncalls { + name: "iOS" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-ios" + } + oncalls { + name: "ChromeOS" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chromeos-gardeners" + } + oncalls { + name: "Fuchsia" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/grotation:chrome-fuchsia-engprod" + } + oncalls { + name: "GPU" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-gpu-pixel-wrangler-weekly" + } + oncalls { + name: "ANGLE" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/grotation:angle-wrangler" + } + oncalls { + name: "Trooper" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-ops-client-infra" + show_primary_secondary_labels: true + } + links { + name: "Builds" + links { + text: "continuous" + url: "https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html" + alt: "Continuous browser snapshots" + } + links { + text: "symbols" + url: "https://www.chromium.org/developers/how-tos/debugging-on-windows" + alt: "Windows Symbols" + } + links { + text: "status" + url: "https://chromium-status.appspot.com/" + alt: "Current tree status" + } + } + links { + name: "Dashboards" + links { + text: "perf" + url: "https://chromeperf.appspot.com/" + alt: "Chrome perf dashboard" + } + links { + text: "LUCI Analysis" + url: "https://luci-analysis.appspot.com" + alt: "New flake portal" + } + } + links { + name: "Chromium" + links { + text: "source" + url: "https://chromium.googlesource.com/chromium/src" + alt: "Chromium source code repository" + } + links { + text: "reviews" + url: "https://chromium-review.googlesource.com" + alt: "Chromium code review tool" + } + links { + text: "bugs" + url: "https://crbug.com" + alt: "Chromium bug tracker" + } + links { + text: "coverage" + url: "https://analysis.chromium.org/coverage/p/chromium" + alt: "Chromium code coverage dashboard" + } + links { + text: "dev" + url: "https://dev.chromium.org/Home" + alt: "Chromium developer home page" + } + links { + text: "support" + url: "https://support.google.com/chrome/#topic=7438008" + alt: "Google Chrome help center" + } + } + links { + name: "Consoles" + links { + text: "android" + url: "/p/chromium/g/chromium.android" + alt: "Chromium Android console" + } + links { + text: "android.desktop" + url: "/p/chromium/g/chromium.android.desktop" + alt: "Chromium Android Desktop console" + } + links { + text: "angle" + url: "/p/chromium/g/chromium.angle" + alt: "Chromium ANGLE console" + } + links { + text: "blink.infra" + url: "/p/chromium/g/blink.infra" + alt: "Chromium Blink Infra console" + } + links { + text: "checks" + url: "/p/chromium/g/checks" + alt: "Checks console" + } + links { + text: "chromiumos" + url: "/p/chromium/g/chromium.chromiumos" + alt: "ChromiumOS console" + } + links { + text: "clang" + url: "/p/chromium/g/chromium.clang" + alt: "Chromium Clang console" + } + links { + text: "dawn" + url: "/p/chromium/g/chromium.dawn" + alt: "Chromium Dawn console" + } + links { + text: "enterprise companion" + url: "/p/chromium/g/chromium.enterprise_companion" + alt: "Chromium Enterprise Companion App console" + } + links { + text: "flakiness" + url: "/p/chromium/g/chromium.flakiness" + alt: "Chromium Flakiness console" + } + links { + text: "fuchsia" + url: "/p/chromium/g/chromium.fuchsia" + alt: "Chromium Fuchsia console" + } + links { + text: "fuzz" + url: "/p/chromium/g/chromium.fuzz" + alt: "Chromium Fuzz console" + } + links { + text: "fyi" + url: "/p/chromium/g/chromium.fyi" + alt: "Chromium FYI console" + } + links { + text: "gpu" + url: "/p/chromium/g/chromium.gpu" + alt: "Chromium GPU console" + } + links { + text: "infra" + url: "/p/chromium/g/chromium.infra" + alt: "Chromium Infra console" + } + links { + text: "memory.fyi" + url: "/p/chromium/g/chromium.memory.fyi" + alt: "Chromium Memory FYI console" + } + links { + text: "perf" + url: "/p/chrome/g/chrome.perf/console" + alt: "Chromium Perf console" + } + links { + text: "perf.fyi" + url: "/p/chrome/g/chrome.perf.fyi/console" + alt: "Chromium Perf FYI console" + } + links { + text: "swangle" + url: "/p/chromium/g/chromium.swangle" + alt: "Chromium SWANGLE console" + } + links { + text: "updater" + url: "/p/chromium/g/chromium.updater" + alt: "Chromium Updater console" + } + links { + text: "webrtc" + url: "/p/chromium/g/chromium.webrtc" + alt: "Chromium WebRTC console" + } + } + links { + name: "Branch Consoles" + links { + text: "m126" + url: "/p/chromium-m126/g/main/console" + } + links { + text: "m132" + url: "/p/chromium-m132/g/main/console" + } + links { + text: "m133" + url: "/p/chromium-m133/g/main/console" + } + links { + text: "m134" + url: "/p/chromium-m134/g/main/console" + } + links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { + text: "trunk" + url: "/p/chromium/g/main/console" + alt: "Trunk (ToT) console" + } + } + links { + name: "Tryservers" + links { + text: "android" + url: "/p/chromium/g/tryserver.chromium.android/builders" + alt: "Android" + } + links { + text: "angle" + url: "/p/chromium/g/tryserver.chromium.angle/builders" + alt: "Angle" + } + links { + text: "blink" + url: "/p/chromium/g/tryserver.blink/builders" + alt: "Blink" + } + links { + text: "chrome" + url: "/p/chrome/g/tryserver.chrome/builders" + alt: "Chrome" + } + links { + text: "chromiumos" + url: "/p/chromium/g/tryserver.chromium.chromiumos/builders" + alt: "ChromiumOS" + } + links { + text: "fuchsia" + url: "/p/chromium/g/tryserver.chromium.fuchsia/builders" + alt: "Fuchsia" + } + links { + text: "fuzz" + url: "/p/chromium/g/tryserver.chromium.fuzz/builders" + alt: "Fuzz" + } + links { + text: "linux" + url: "/p/chromium/g/tryserver.chromium.linux/builders" + alt: "Linux" + } + links { + text: "mac" + url: "/p/chromium/g/tryserver.chromium.mac/builders" + alt: "Mac" + } + links { + text: "swangle" + url: "/p/chromium/g/tryserver.chromium.swangle/builders" + alt: "SWANGLE" + } + links { + text: "tricium" + url: "/p/chromium/g/tryserver.chromium.tricium/builders" + alt: "Tricium" + } + links { + text: "win" + url: "/p/chromium/g/tryserver.chromium.win/builders" + alt: "Win" + } + } + links { + name: "Navigate" + links { + text: "about" + url: "http://dev.chromium.org/developers/testing/chromium-build-infrastructure/tour-of-the-chromium-buildbot" + alt: "Tour of the console" + } + links { + text: "customize" + url: "https://chromium.googlesource.com/chromium/src/+/refs/heads/main/infra/config/generated/luci/luci-milo.cfg" + alt: "Customize this console" + } } console_groups { title { - text: "Gardener Rotations" + text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/android rotation" - console_ids: "chromium/angle rotation" - console_ids: "chromium/cft rotation" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" + } + console_groups { console_ids: "chromium/chromium rotation" - console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" console_ids: "chromium/dawn rotation" console_ids: "chromium/fuchsia rotation" console_ids: "chromium/ios rotation" @@ -5066,6 +4606,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -5152,19 +4696,19 @@ text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/Tree Closers" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" } console_groups { - title { - text: "Gardener Rotations" - url: "https://chromium-status.appspot.com/" - } - console_ids: "chromium/android rotation" - console_ids: "chromium/angle rotation" - console_ids: "chromium/cft rotation" console_ids: "chromium/chromium rotation" - console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" console_ids: "chromium/dawn rotation" console_ids: "chromium/fuchsia rotation" console_ids: "chromium/ios rotation" @@ -5416,6 +4960,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -5771,6 +5319,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -5857,19 +5409,19 @@ text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/Tree Closers" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" } console_groups { - title { - text: "Gardener Rotations" - url: "https://chromium-status.appspot.com/" - } - console_ids: "chromium/android rotation" - console_ids: "chromium/angle rotation" - console_ids: "chromium/cft rotation" console_ids: "chromium/chromium rotation" - console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" console_ids: "chromium/dawn rotation" console_ids: "chromium/fuchsia rotation" console_ids: "chromium/ios rotation" @@ -6124,6 +5676,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -6544,6 +6100,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -7523,6 +7083,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -7609,19 +7173,766 @@ text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/Tree Closers" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" + } + console_groups { + console_ids: "chromium/chromium rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" + console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" + console_ids: "chromium/dawn rotation" + console_ids: "chromium/fuchsia rotation" + console_ids: "chromium/ios rotation" + } + tree_status_host: "chromium-status.appspot.com" + tree_name: "chromium" + } +} +consoles { + id: "chromium tree closers" + name: "chromium tree closers" + repo_url: "https://chromium.googlesource.com/chromium/src" + refs: "regexp:refs/heads/main" + manifest_name: "REVISION" + builders { + name: "buildbucket/luci.chromium.ci/android-official" + category: "chromium|android" + short_name: "off" + } + builders { + name: "buildbucket/luci.chromium.ci/android-archive-rel" + category: "chromium|android" + short_name: "rel" + } + builders { + name: "buildbucket/luci.chromium.ci/android-arm64-archive-rel" + category: "chromium|android|arm" + short_name: "arm64" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-archive-rel" + category: "chromium|linux" + short_name: "rel" + } + builders { + name: "buildbucket/luci.chromium.ci/mac-official" + category: "chromium|mac" + short_name: "off" + } + builders { + name: "buildbucket/luci.chromium.ci/mac-archive-rel" + category: "chromium|mac" + short_name: "rel" + } + builders { + name: "buildbucket/luci.chromium.ci/mac-arm64-archive-rel" + category: "chromium|mac|arm" + short_name: "rel" + } + builders { + name: "buildbucket/luci.chromium.ci/win32-official" + category: "chromium|win|off" + short_name: "32" + } + builders { + name: "buildbucket/luci.chromium.ci/win32-archive-rel" + category: "chromium|win|rel" + short_name: "32" + } + builders { + name: "buildbucket/luci.chromium.ci/win-archive-rel" + category: "chromium|win|rel" + short_name: "64" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-chromeos-dbg" + category: "chromium.chromiumos|default" + short_name: "dbg" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-chromeos-rel" + category: "chromium.chromiumos|default" + short_name: "rel" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-cfm-rel" + category: "chromium.chromiumos|default|cfm" + short_name: "cfm" + } + builders { + name: "buildbucket/luci.chromium.ci/chromeos-arm-generic-dbg" + category: "chromium.chromiumos|simple|debug" + short_name: "arm" + } + builders { + name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-dbg" + category: "chromium.chromiumos|simple|debug|x64" + short_name: "dbg" + } + builders { + name: "buildbucket/luci.chromium.ci/chromeos-arm64-generic-rel" + category: "chromium.chromiumos|simple|release" + short_name: "a64" + } + builders { + name: "buildbucket/luci.chromium.ci/chromeos-arm-generic-rel" + category: "chromium.chromiumos|simple|release" + short_name: "arm" + } + builders { + name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-asan-rel" + category: "chromium.chromiumos|simple|release|x64" + short_name: "asn" + } + builders { + name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-cfi-thin-lto-rel" + category: "chromium.chromiumos|simple|release|x64" + short_name: "cfi" + } + builders { + name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-rel" + category: "chromium.chromiumos|simple|release|x64" + short_name: "compile" + } + builders { + name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-rel-gtest" + category: "chromium.chromiumos|simple|release|x64" + short_name: "gtest" + } + builders { + name: "buildbucket/luci.chromium.ci/fuchsia-arm64-cast-receiver-rel" + category: "chromium.fuchsia|cast-receiver" + short_name: "arm64" + } + builders { + name: "buildbucket/luci.chromium.ci/fuchsia-x64-cast-receiver-rel" + category: "chromium.fuchsia|cast-receiver" + short_name: "x64" + } + builders { + name: "buildbucket/luci.chromium.ci/fuchsia-x64-cast-receiver-dbg" + category: "chromium.fuchsia|cast-receiver" + short_name: "x64-dbg" + } + builders { + name: "buildbucket/luci.chromium.ci/Deterministic Fuchsia (dbg)" + category: "chromium.fuchsia|det" + short_name: "x64" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-oi-rel" + category: "chromium.linux|OriginIsolation" + short_name: "oi" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-bfcache-rel" + category: "chromium.linux|bfcache" + short_name: "bfc" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-cast-arm-rel" + category: "chromium.linux|cast" + short_name: "arm32rel" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-cast-arm64-rel" + category: "chromium.linux|cast" + short_name: "arm64rel" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-cast-x64-dbg" + category: "chromium.linux|cast" + short_name: "x64dbg" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-cast-x64-rel" + category: "chromium.linux|cast" + short_name: "x64rel" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux Builder (dbg)" + category: "chromium.linux|debug|builder" + short_name: "64" + } + builders { + name: "buildbucket/luci.chromium.ci/Deterministic Linux (dbg)" + category: "chromium.linux|debug|builder" + short_name: "det" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux Tests (dbg)(1)" + category: "chromium.linux|debug|tester" + short_name: "64" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux Builder" + category: "chromium.linux|release" + short_name: "bld" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux Builder (Wayland)" + category: "chromium.linux|release" + short_name: "bld-wl" + } + builders { + name: "buildbucket/luci.chromium.ci/Deterministic Linux" + category: "chromium.linux|release" + short_name: "det" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-gcc-rel" + category: "chromium.linux|release" + short_name: "gcc" + } + builders { + name: "buildbucket/luci.chromium.ci/Network Service Linux" + category: "chromium.linux|release" + short_name: "nsl" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-extended-tracing-rel" + category: "chromium.linux|release" + short_name: "trc" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux Tests" + category: "chromium.linux|release" + short_name: "tst" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux Tests (Wayland)" + category: "chromium.linux|release" + short_name: "tst-wl" + } + builders { + name: "buildbucket/luci.chromium.ci/Mac Builder (dbg)" + category: "chromium.mac|debug" + short_name: "bld" + } + builders { + name: "buildbucket/luci.chromium.ci/mac-arm64-dbg" + category: "chromium.mac|debug|arm64" + short_name: "bld" + } + builders { + name: "buildbucket/luci.chromium.ci/ios-device" + category: "chromium.mac|ios|default" + short_name: "dev" + } + builders { + name: "buildbucket/luci.chromium.ci/ios-simulator-full-configs" + category: "chromium.mac|ios|default" + short_name: "ful" + } + builders { + name: "buildbucket/luci.chromium.ci/ios-simulator-noncq" + category: "chromium.mac|ios|default" + short_name: "non" + } + builders { + name: "buildbucket/luci.chromium.ci/ios-simulator" + category: "chromium.mac|ios|default" + short_name: "sim" + } + builders { + name: "buildbucket/luci.chromium.ci/Mac11 Tests" + category: "chromium.mac|mac" + short_name: "11" + } + builders { + name: "buildbucket/luci.chromium.ci/Mac12 Tests" + category: "chromium.mac|mac" + short_name: "12" + } + builders { + name: "buildbucket/luci.chromium.ci/Mac13 Tests" + category: "chromium.mac|mac" + short_name: "13" + } + builders { + name: "buildbucket/luci.chromium.ci/Mac Builder" + category: "chromium.mac|release" + short_name: "bld" + } + builders { + name: "buildbucket/luci.chromium.ci/mac-arm64-on-arm64-rel" + category: "chromium.mac|release|arm64" + short_name: "a64" + } + builders { + name: "buildbucket/luci.chromium.ci/mac-arm64-rel" + category: "chromium.mac|release|arm64" + short_name: "bld" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux CFI" + category: "chromium.memory|cfi" + short_name: "lnx" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux Chromium OS ASan LSan Builder" + category: "chromium.memory|cros|asan" + short_name: "bld" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux Chromium OS ASan LSan Tests (1)" + category: "chromium.memory|cros|asan" + short_name: "tst" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux ChromiumOS MSan Builder" + category: "chromium.memory|cros|msan" + short_name: "bld" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux ChromiumOS MSan Tests" + category: "chromium.memory|cros|msan" + short_name: "tst" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux TSan Builder" + category: "chromium.memory|linux|TSan v2" + short_name: "bld" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux TSan Tests" + category: "chromium.memory|linux|TSan v2" + short_name: "tst" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux ASan LSan Tests (1)" + category: "chromium.memory|linux|asan lsan" + short_name: "tst" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux MSan Builder" + category: "chromium.memory|linux|msan" + short_name: "bld" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux MSan Tests" + category: "chromium.memory|linux|msan" + short_name: "tst" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux UBSan Builder" + category: "chromium.memory|linux|ubsan" + short_name: "bld" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux UBSan Tests" + category: "chromium.memory|linux|ubsan" + short_name: "tst" + } + builders { + name: "buildbucket/luci.chromium.ci/WebKit Linux ASAN" + category: "chromium.memory|linux|webkit" + short_name: "asn" + } + builders { + name: "buildbucket/luci.chromium.ci/WebKit Linux Leak" + category: "chromium.memory|linux|webkit" + short_name: "lk" + } + builders { + name: "buildbucket/luci.chromium.ci/WebKit Linux MSAN" + category: "chromium.memory|linux|webkit" + short_name: "msn" + } + builders { + name: "buildbucket/luci.chromium.ci/Mac ASan 64 Builder" + category: "chromium.memory|mac" + short_name: "bld" + } + builders { + name: "buildbucket/luci.chromium.ci/Mac ASan 64 Tests (1)" + category: "chromium.memory|mac" + short_name: "tst" + } + builders { + name: "buildbucket/luci.chromium.ci/win-asan" + category: "chromium.memory|win" + short_name: "asn" + } + builders { + name: "buildbucket/luci.chromium.ci/Win Builder (dbg)" + category: "chromium.win|debug|builder" + short_name: "32" + } + builders { + name: "buildbucket/luci.chromium.ci/Win x64 Builder (dbg)" + category: "chromium.win|debug|builder" + short_name: "64" + } + builders { + name: "buildbucket/luci.chromium.ci/win-arm64-dbg" + category: "chromium.win|debug|builder" + short_name: "a64" + } + builders { + name: "buildbucket/luci.chromium.ci/Windows deterministic" + category: "chromium.win|misc" + short_name: "det" + } + builders { + name: "buildbucket/luci.chromium.ci/WebKit Win10" + category: "chromium.win|misc" + short_name: "wbk" + } + builders { + name: "buildbucket/luci.chromium.ci/Win Builder" + category: "chromium.win|release|builder" + short_name: "32" + } + builders { + name: "buildbucket/luci.chromium.ci/Win x64 Builder" + category: "chromium.win|release|builder" + short_name: "64" + } + builders { + name: "buildbucket/luci.chromium.ci/win-arm64-rel" + category: "chromium.win|release|builder" + short_name: "a64" + } + builders { + name: "buildbucket/luci.chromium.ci/Win10 Tests x64" + category: "chromium.win|release|tester" + short_name: "w10" + } + header { + oncalls { + name: "Chromium" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-build-sheriff" + } + oncalls { + name: "Android" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-android-sheriff" + } + oncalls { + name: "iOS" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-ios" + } + oncalls { + name: "ChromeOS" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chromeos-gardeners" + } + oncalls { + name: "Fuchsia" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/grotation:chrome-fuchsia-engprod" + } + oncalls { + name: "GPU" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-gpu-pixel-wrangler-weekly" + } + oncalls { + name: "ANGLE" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/grotation:angle-wrangler" + } + oncalls { + name: "Trooper" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-ops-client-infra" + show_primary_secondary_labels: true + } + links { + name: "Builds" + links { + text: "continuous" + url: "https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html" + alt: "Continuous browser snapshots" + } + links { + text: "symbols" + url: "https://www.chromium.org/developers/how-tos/debugging-on-windows" + alt: "Windows Symbols" + } + links { + text: "status" + url: "https://chromium-status.appspot.com/" + alt: "Current tree status" + } + } + links { + name: "Dashboards" + links { + text: "perf" + url: "https://chromeperf.appspot.com/" + alt: "Chrome perf dashboard" + } + links { + text: "LUCI Analysis" + url: "https://luci-analysis.appspot.com" + alt: "New flake portal" + } + } + links { + name: "Chromium" + links { + text: "source" + url: "https://chromium.googlesource.com/chromium/src" + alt: "Chromium source code repository" + } + links { + text: "reviews" + url: "https://chromium-review.googlesource.com" + alt: "Chromium code review tool" + } + links { + text: "bugs" + url: "https://crbug.com" + alt: "Chromium bug tracker" + } + links { + text: "coverage" + url: "https://analysis.chromium.org/coverage/p/chromium" + alt: "Chromium code coverage dashboard" + } + links { + text: "dev" + url: "https://dev.chromium.org/Home" + alt: "Chromium developer home page" + } + links { + text: "support" + url: "https://support.google.com/chrome/#topic=7438008" + alt: "Google Chrome help center" + } + } + links { + name: "Consoles" + links { + text: "android" + url: "/p/chromium/g/chromium.android" + alt: "Chromium Android console" + } + links { + text: "android.desktop" + url: "/p/chromium/g/chromium.android.desktop" + alt: "Chromium Android Desktop console" + } + links { + text: "angle" + url: "/p/chromium/g/chromium.angle" + alt: "Chromium ANGLE console" + } + links { + text: "blink.infra" + url: "/p/chromium/g/blink.infra" + alt: "Chromium Blink Infra console" + } + links { + text: "checks" + url: "/p/chromium/g/checks" + alt: "Checks console" + } + links { + text: "chromiumos" + url: "/p/chromium/g/chromium.chromiumos" + alt: "ChromiumOS console" + } + links { + text: "clang" + url: "/p/chromium/g/chromium.clang" + alt: "Chromium Clang console" + } + links { + text: "dawn" + url: "/p/chromium/g/chromium.dawn" + alt: "Chromium Dawn console" + } + links { + text: "enterprise companion" + url: "/p/chromium/g/chromium.enterprise_companion" + alt: "Chromium Enterprise Companion App console" + } + links { + text: "flakiness" + url: "/p/chromium/g/chromium.flakiness" + alt: "Chromium Flakiness console" + } + links { + text: "fuchsia" + url: "/p/chromium/g/chromium.fuchsia" + alt: "Chromium Fuchsia console" + } + links { + text: "fuzz" + url: "/p/chromium/g/chromium.fuzz" + alt: "Chromium Fuzz console" + } + links { + text: "fyi" + url: "/p/chromium/g/chromium.fyi" + alt: "Chromium FYI console" + } + links { + text: "gpu" + url: "/p/chromium/g/chromium.gpu" + alt: "Chromium GPU console" + } + links { + text: "infra" + url: "/p/chromium/g/chromium.infra" + alt: "Chromium Infra console" + } + links { + text: "memory.fyi" + url: "/p/chromium/g/chromium.memory.fyi" + alt: "Chromium Memory FYI console" + } + links { + text: "perf" + url: "/p/chrome/g/chrome.perf/console" + alt: "Chromium Perf console" + } + links { + text: "perf.fyi" + url: "/p/chrome/g/chrome.perf.fyi/console" + alt: "Chromium Perf FYI console" + } + links { + text: "swangle" + url: "/p/chromium/g/chromium.swangle" + alt: "Chromium SWANGLE console" + } + links { + text: "updater" + url: "/p/chromium/g/chromium.updater" + alt: "Chromium Updater console" + } + links { + text: "webrtc" + url: "/p/chromium/g/chromium.webrtc" + alt: "Chromium WebRTC console" + } + } + links { + name: "Branch Consoles" + links { + text: "m126" + url: "/p/chromium-m126/g/main/console" + } + links { + text: "m132" + url: "/p/chromium-m132/g/main/console" + } + links { + text: "m133" + url: "/p/chromium-m133/g/main/console" + } + links { + text: "m134" + url: "/p/chromium-m134/g/main/console" + } + links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { + text: "trunk" + url: "/p/chromium/g/main/console" + alt: "Trunk (ToT) console" + } + } + links { + name: "Tryservers" + links { + text: "android" + url: "/p/chromium/g/tryserver.chromium.android/builders" + alt: "Android" + } + links { + text: "angle" + url: "/p/chromium/g/tryserver.chromium.angle/builders" + alt: "Angle" + } + links { + text: "blink" + url: "/p/chromium/g/tryserver.blink/builders" + alt: "Blink" + } + links { + text: "chrome" + url: "/p/chrome/g/tryserver.chrome/builders" + alt: "Chrome" + } + links { + text: "chromiumos" + url: "/p/chromium/g/tryserver.chromium.chromiumos/builders" + alt: "ChromiumOS" + } + links { + text: "fuchsia" + url: "/p/chromium/g/tryserver.chromium.fuchsia/builders" + alt: "Fuchsia" + } + links { + text: "fuzz" + url: "/p/chromium/g/tryserver.chromium.fuzz/builders" + alt: "Fuzz" + } + links { + text: "linux" + url: "/p/chromium/g/tryserver.chromium.linux/builders" + alt: "Linux" + } + links { + text: "mac" + url: "/p/chromium/g/tryserver.chromium.mac/builders" + alt: "Mac" + } + links { + text: "swangle" + url: "/p/chromium/g/tryserver.chromium.swangle/builders" + alt: "SWANGLE" + } + links { + text: "tricium" + url: "/p/chromium/g/tryserver.chromium.tricium/builders" + alt: "Tricium" + } + links { + text: "win" + url: "/p/chromium/g/tryserver.chromium.win/builders" + alt: "Win" + } + } + links { + name: "Navigate" + links { + text: "about" + url: "http://dev.chromium.org/developers/testing/chromium-build-infrastructure/tour-of-the-chromium-buildbot" + alt: "Tour of the console" + } + links { + text: "customize" + url: "https://chromium.googlesource.com/chromium/src/+/refs/heads/main/infra/config/generated/luci/luci-milo.cfg" + alt: "Customize this console" + } } console_groups { title { - text: "Gardener Rotations" + text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/android rotation" - console_ids: "chromium/angle rotation" - console_ids: "chromium/cft rotation" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" + } + console_groups { console_ids: "chromium/chromium rotation" - console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" console_ids: "chromium/dawn rotation" console_ids: "chromium/fuchsia rotation" console_ids: "chromium/ios rotation" @@ -7871,6 +8182,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -8565,6 +8880,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -8930,6 +9249,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -9275,6 +9598,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -9709,6 +10036,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -10124,6 +10455,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -10595,6 +10930,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -11005,6 +11344,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -11590,6 +11933,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -12145,6 +12492,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -12231,19 +12582,19 @@ text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/Tree Closers" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" } console_groups { - title { - text: "Gardener Rotations" - url: "https://chromium-status.appspot.com/" - } - console_ids: "chromium/android rotation" - console_ids: "chromium/angle rotation" - console_ids: "chromium/cft rotation" console_ids: "chromium/chromium rotation" - console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" console_ids: "chromium/dawn rotation" console_ids: "chromium/fuchsia rotation" console_ids: "chromium/ios rotation" @@ -12748,6 +13099,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -13218,6 +13573,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -13590,6 +13949,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -14099,6 +14462,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -14711,6 +15078,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -15117,6 +15488,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -15848,6 +16223,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -15934,19 +16313,399 @@ text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/Tree Closers" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" + } + console_groups { + console_ids: "chromium/chromium rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" + console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" + console_ids: "chromium/dawn rotation" + console_ids: "chromium/fuchsia rotation" + console_ids: "chromium/ios rotation" + } + tree_status_host: "chromium-status.appspot.com" + tree_name: "chromium" + } +} +consoles { + id: "chromium.gpu tree closers" + name: "chromium.gpu tree closers" + repo_url: "https://chromium.googlesource.com/chromium/src" + refs: "regexp:refs/heads/main" + manifest_name: "REVISION" + builders { + name: "buildbucket/luci.chromium.ci/Android Release (Nexus 5X)" + category: "chromium.gpu|Android" + short_name: "N5X" + } + builders { + name: "buildbucket/luci.chromium.ci/Android Release (Pixel 2)" + category: "chromium.gpu|Android" + short_name: "P2" + } + builders { + name: "buildbucket/luci.chromium.ci/GPU Linux Builder" + category: "chromium.gpu|Linux" + } + builders { + name: "buildbucket/luci.chromium.ci/Linux Release (NVIDIA)" + category: "chromium.gpu|Linux" + } + builders { + name: "buildbucket/luci.chromium.ci/GPU Mac Builder" + category: "chromium.gpu|Mac" + } + builders { + name: "buildbucket/luci.chromium.ci/Mac Release (Intel)" + category: "chromium.gpu|Mac" + } + builders { + name: "buildbucket/luci.chromium.ci/Mac Retina Release (AMD)" + category: "chromium.gpu|Mac" + } + builders { + name: "buildbucket/luci.chromium.ci/GPU Win x64 Builder" + category: "chromium.gpu|Windows" + } + builders { + name: "buildbucket/luci.chromium.ci/Win10 x64 Release (NVIDIA)" + category: "chromium.gpu|Windows" + } + header { + oncalls { + name: "Chromium" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-build-sheriff" + } + oncalls { + name: "Android" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-android-sheriff" + } + oncalls { + name: "iOS" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-ios" + } + oncalls { + name: "ChromeOS" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chromeos-gardeners" + } + oncalls { + name: "Fuchsia" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/grotation:chrome-fuchsia-engprod" + } + oncalls { + name: "GPU" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-gpu-pixel-wrangler-weekly" + } + oncalls { + name: "ANGLE" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/grotation:angle-wrangler" + } + oncalls { + name: "Trooper" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-ops-client-infra" + show_primary_secondary_labels: true + } + links { + name: "Builds" + links { + text: "continuous" + url: "https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html" + alt: "Continuous browser snapshots" + } + links { + text: "symbols" + url: "https://www.chromium.org/developers/how-tos/debugging-on-windows" + alt: "Windows Symbols" + } + links { + text: "status" + url: "https://chromium-status.appspot.com/" + alt: "Current tree status" + } + } + links { + name: "Dashboards" + links { + text: "perf" + url: "https://chromeperf.appspot.com/" + alt: "Chrome perf dashboard" + } + links { + text: "LUCI Analysis" + url: "https://luci-analysis.appspot.com" + alt: "New flake portal" + } + } + links { + name: "Chromium" + links { + text: "source" + url: "https://chromium.googlesource.com/chromium/src" + alt: "Chromium source code repository" + } + links { + text: "reviews" + url: "https://chromium-review.googlesource.com" + alt: "Chromium code review tool" + } + links { + text: "bugs" + url: "https://crbug.com" + alt: "Chromium bug tracker" + } + links { + text: "coverage" + url: "https://analysis.chromium.org/coverage/p/chromium" + alt: "Chromium code coverage dashboard" + } + links { + text: "dev" + url: "https://dev.chromium.org/Home" + alt: "Chromium developer home page" + } + links { + text: "support" + url: "https://support.google.com/chrome/#topic=7438008" + alt: "Google Chrome help center" + } + } + links { + name: "Consoles" + links { + text: "android" + url: "/p/chromium/g/chromium.android" + alt: "Chromium Android console" + } + links { + text: "android.desktop" + url: "/p/chromium/g/chromium.android.desktop" + alt: "Chromium Android Desktop console" + } + links { + text: "angle" + url: "/p/chromium/g/chromium.angle" + alt: "Chromium ANGLE console" + } + links { + text: "blink.infra" + url: "/p/chromium/g/blink.infra" + alt: "Chromium Blink Infra console" + } + links { + text: "checks" + url: "/p/chromium/g/checks" + alt: "Checks console" + } + links { + text: "chromiumos" + url: "/p/chromium/g/chromium.chromiumos" + alt: "ChromiumOS console" + } + links { + text: "clang" + url: "/p/chromium/g/chromium.clang" + alt: "Chromium Clang console" + } + links { + text: "dawn" + url: "/p/chromium/g/chromium.dawn" + alt: "Chromium Dawn console" + } + links { + text: "enterprise companion" + url: "/p/chromium/g/chromium.enterprise_companion" + alt: "Chromium Enterprise Companion App console" + } + links { + text: "flakiness" + url: "/p/chromium/g/chromium.flakiness" + alt: "Chromium Flakiness console" + } + links { + text: "fuchsia" + url: "/p/chromium/g/chromium.fuchsia" + alt: "Chromium Fuchsia console" + } + links { + text: "fuzz" + url: "/p/chromium/g/chromium.fuzz" + alt: "Chromium Fuzz console" + } + links { + text: "fyi" + url: "/p/chromium/g/chromium.fyi" + alt: "Chromium FYI console" + } + links { + text: "gpu" + url: "/p/chromium/g/chromium.gpu" + alt: "Chromium GPU console" + } + links { + text: "infra" + url: "/p/chromium/g/chromium.infra" + alt: "Chromium Infra console" + } + links { + text: "memory.fyi" + url: "/p/chromium/g/chromium.memory.fyi" + alt: "Chromium Memory FYI console" + } + links { + text: "perf" + url: "/p/chrome/g/chrome.perf/console" + alt: "Chromium Perf console" + } + links { + text: "perf.fyi" + url: "/p/chrome/g/chrome.perf.fyi/console" + alt: "Chromium Perf FYI console" + } + links { + text: "swangle" + url: "/p/chromium/g/chromium.swangle" + alt: "Chromium SWANGLE console" + } + links { + text: "updater" + url: "/p/chromium/g/chromium.updater" + alt: "Chromium Updater console" + } + links { + text: "webrtc" + url: "/p/chromium/g/chromium.webrtc" + alt: "Chromium WebRTC console" + } + } + links { + name: "Branch Consoles" + links { + text: "m126" + url: "/p/chromium-m126/g/main/console" + } + links { + text: "m132" + url: "/p/chromium-m132/g/main/console" + } + links { + text: "m133" + url: "/p/chromium-m133/g/main/console" + } + links { + text: "m134" + url: "/p/chromium-m134/g/main/console" + } + links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { + text: "trunk" + url: "/p/chromium/g/main/console" + alt: "Trunk (ToT) console" + } + } + links { + name: "Tryservers" + links { + text: "android" + url: "/p/chromium/g/tryserver.chromium.android/builders" + alt: "Android" + } + links { + text: "angle" + url: "/p/chromium/g/tryserver.chromium.angle/builders" + alt: "Angle" + } + links { + text: "blink" + url: "/p/chromium/g/tryserver.blink/builders" + alt: "Blink" + } + links { + text: "chrome" + url: "/p/chrome/g/tryserver.chrome/builders" + alt: "Chrome" + } + links { + text: "chromiumos" + url: "/p/chromium/g/tryserver.chromium.chromiumos/builders" + alt: "ChromiumOS" + } + links { + text: "fuchsia" + url: "/p/chromium/g/tryserver.chromium.fuchsia/builders" + alt: "Fuchsia" + } + links { + text: "fuzz" + url: "/p/chromium/g/tryserver.chromium.fuzz/builders" + alt: "Fuzz" + } + links { + text: "linux" + url: "/p/chromium/g/tryserver.chromium.linux/builders" + alt: "Linux" + } + links { + text: "mac" + url: "/p/chromium/g/tryserver.chromium.mac/builders" + alt: "Mac" + } + links { + text: "swangle" + url: "/p/chromium/g/tryserver.chromium.swangle/builders" + alt: "SWANGLE" + } + links { + text: "tricium" + url: "/p/chromium/g/tryserver.chromium.tricium/builders" + alt: "Tricium" + } + links { + text: "win" + url: "/p/chromium/g/tryserver.chromium.win/builders" + alt: "Win" + } + } + links { + name: "Navigate" + links { + text: "about" + url: "http://dev.chromium.org/developers/testing/chromium-build-infrastructure/tour-of-the-chromium-buildbot" + alt: "Tour of the console" + } + links { + text: "customize" + url: "https://chromium.googlesource.com/chromium/src/+/refs/heads/main/infra/config/generated/luci/luci-milo.cfg" + alt: "Customize this console" + } } console_groups { title { - text: "Gardener Rotations" + text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/android rotation" - console_ids: "chromium/angle rotation" - console_ids: "chromium/cft rotation" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" + } + console_groups { console_ids: "chromium/chromium rotation" - console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" console_ids: "chromium/dawn rotation" console_ids: "chromium/fuchsia rotation" console_ids: "chromium/ios rotation" @@ -16562,6 +17321,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -16951,6 +17714,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -17380,6 +18147,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -17825,6 +18596,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -18275,6 +19050,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -18625,6 +19404,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -19095,6 +19878,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -19476,6 +20263,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -19861,6 +20652,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -20411,6 +21206,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -20791,6 +21590,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -21212,6 +22015,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -21622,6 +22429,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -21977,6 +22788,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -22063,19 +22878,376 @@ text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/Tree Closers" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" + } + console_groups { + console_ids: "chromium/chromium rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" + console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" + console_ids: "chromium/dawn rotation" + console_ids: "chromium/fuchsia rotation" + console_ids: "chromium/ios rotation" + } + tree_status_host: "chromium-status.appspot.com" + tree_name: "chromium" + } +} +consoles { + id: "chromiumos tree closers" + name: "chromiumos tree closers" + repo_url: "https://chromium.googlesource.com/chromium/src" + refs: "regexp:refs/heads/main" + manifest_name: "REVISION" + builders { + name: "buildbucket/luci.chromium.ci/chromeos-jacuzzi-rel" + category: "chromium.chromiumos|simple|release" + short_name: "jcz" + } + builders { + name: "buildbucket/luci.chromium.ci/chromeos-octopus-rel" + category: "chromium.chromiumos|simple|release" + short_name: "oct" + } + builders { + name: "buildbucket/luci.chromium.ci/chromeos-amd64-generic-rel-tast" + category: "chromium.chromiumos|simple|release|x64" + short_name: "tast" + } + header { + oncalls { + name: "Chromium" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-build-sheriff" + } + oncalls { + name: "Android" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-android-sheriff" + } + oncalls { + name: "iOS" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-ios" + } + oncalls { + name: "ChromeOS" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chromeos-gardeners" + } + oncalls { + name: "Fuchsia" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/grotation:chrome-fuchsia-engprod" + } + oncalls { + name: "GPU" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-gpu-pixel-wrangler-weekly" + } + oncalls { + name: "ANGLE" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/grotation:angle-wrangler" + } + oncalls { + name: "Trooper" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-ops-client-infra" + show_primary_secondary_labels: true + } + links { + name: "Builds" + links { + text: "continuous" + url: "https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html" + alt: "Continuous browser snapshots" + } + links { + text: "symbols" + url: "https://www.chromium.org/developers/how-tos/debugging-on-windows" + alt: "Windows Symbols" + } + links { + text: "status" + url: "https://chromium-status.appspot.com/" + alt: "Current tree status" + } + } + links { + name: "Dashboards" + links { + text: "perf" + url: "https://chromeperf.appspot.com/" + alt: "Chrome perf dashboard" + } + links { + text: "LUCI Analysis" + url: "https://luci-analysis.appspot.com" + alt: "New flake portal" + } + } + links { + name: "Chromium" + links { + text: "source" + url: "https://chromium.googlesource.com/chromium/src" + alt: "Chromium source code repository" + } + links { + text: "reviews" + url: "https://chromium-review.googlesource.com" + alt: "Chromium code review tool" + } + links { + text: "bugs" + url: "https://crbug.com" + alt: "Chromium bug tracker" + } + links { + text: "coverage" + url: "https://analysis.chromium.org/coverage/p/chromium" + alt: "Chromium code coverage dashboard" + } + links { + text: "dev" + url: "https://dev.chromium.org/Home" + alt: "Chromium developer home page" + } + links { + text: "support" + url: "https://support.google.com/chrome/#topic=7438008" + alt: "Google Chrome help center" + } + } + links { + name: "Consoles" + links { + text: "android" + url: "/p/chromium/g/chromium.android" + alt: "Chromium Android console" + } + links { + text: "android.desktop" + url: "/p/chromium/g/chromium.android.desktop" + alt: "Chromium Android Desktop console" + } + links { + text: "angle" + url: "/p/chromium/g/chromium.angle" + alt: "Chromium ANGLE console" + } + links { + text: "blink.infra" + url: "/p/chromium/g/blink.infra" + alt: "Chromium Blink Infra console" + } + links { + text: "checks" + url: "/p/chromium/g/checks" + alt: "Checks console" + } + links { + text: "chromiumos" + url: "/p/chromium/g/chromium.chromiumos" + alt: "ChromiumOS console" + } + links { + text: "clang" + url: "/p/chromium/g/chromium.clang" + alt: "Chromium Clang console" + } + links { + text: "dawn" + url: "/p/chromium/g/chromium.dawn" + alt: "Chromium Dawn console" + } + links { + text: "enterprise companion" + url: "/p/chromium/g/chromium.enterprise_companion" + alt: "Chromium Enterprise Companion App console" + } + links { + text: "flakiness" + url: "/p/chromium/g/chromium.flakiness" + alt: "Chromium Flakiness console" + } + links { + text: "fuchsia" + url: "/p/chromium/g/chromium.fuchsia" + alt: "Chromium Fuchsia console" + } + links { + text: "fuzz" + url: "/p/chromium/g/chromium.fuzz" + alt: "Chromium Fuzz console" + } + links { + text: "fyi" + url: "/p/chromium/g/chromium.fyi" + alt: "Chromium FYI console" + } + links { + text: "gpu" + url: "/p/chromium/g/chromium.gpu" + alt: "Chromium GPU console" + } + links { + text: "infra" + url: "/p/chromium/g/chromium.infra" + alt: "Chromium Infra console" + } + links { + text: "memory.fyi" + url: "/p/chromium/g/chromium.memory.fyi" + alt: "Chromium Memory FYI console" + } + links { + text: "perf" + url: "/p/chrome/g/chrome.perf/console" + alt: "Chromium Perf console" + } + links { + text: "perf.fyi" + url: "/p/chrome/g/chrome.perf.fyi/console" + alt: "Chromium Perf FYI console" + } + links { + text: "swangle" + url: "/p/chromium/g/chromium.swangle" + alt: "Chromium SWANGLE console" + } + links { + text: "updater" + url: "/p/chromium/g/chromium.updater" + alt: "Chromium Updater console" + } + links { + text: "webrtc" + url: "/p/chromium/g/chromium.webrtc" + alt: "Chromium WebRTC console" + } + } + links { + name: "Branch Consoles" + links { + text: "m126" + url: "/p/chromium-m126/g/main/console" + } + links { + text: "m132" + url: "/p/chromium-m132/g/main/console" + } + links { + text: "m133" + url: "/p/chromium-m133/g/main/console" + } + links { + text: "m134" + url: "/p/chromium-m134/g/main/console" + } + links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { + text: "trunk" + url: "/p/chromium/g/main/console" + alt: "Trunk (ToT) console" + } + } + links { + name: "Tryservers" + links { + text: "android" + url: "/p/chromium/g/tryserver.chromium.android/builders" + alt: "Android" + } + links { + text: "angle" + url: "/p/chromium/g/tryserver.chromium.angle/builders" + alt: "Angle" + } + links { + text: "blink" + url: "/p/chromium/g/tryserver.blink/builders" + alt: "Blink" + } + links { + text: "chrome" + url: "/p/chrome/g/tryserver.chrome/builders" + alt: "Chrome" + } + links { + text: "chromiumos" + url: "/p/chromium/g/tryserver.chromium.chromiumos/builders" + alt: "ChromiumOS" + } + links { + text: "fuchsia" + url: "/p/chromium/g/tryserver.chromium.fuchsia/builders" + alt: "Fuchsia" + } + links { + text: "fuzz" + url: "/p/chromium/g/tryserver.chromium.fuzz/builders" + alt: "Fuzz" + } + links { + text: "linux" + url: "/p/chromium/g/tryserver.chromium.linux/builders" + alt: "Linux" + } + links { + text: "mac" + url: "/p/chromium/g/tryserver.chromium.mac/builders" + alt: "Mac" + } + links { + text: "swangle" + url: "/p/chromium/g/tryserver.chromium.swangle/builders" + alt: "SWANGLE" + } + links { + text: "tricium" + url: "/p/chromium/g/tryserver.chromium.tricium/builders" + alt: "Tricium" + } + links { + text: "win" + url: "/p/chromium/g/tryserver.chromium.win/builders" + alt: "Win" + } + } + links { + name: "Navigate" + links { + text: "about" + url: "http://dev.chromium.org/developers/testing/chromium-build-infrastructure/tour-of-the-chromium-buildbot" + alt: "Tour of the console" + } + links { + text: "customize" + url: "https://chromium.googlesource.com/chromium/src/+/refs/heads/main/infra/config/generated/luci/luci-milo.cfg" + alt: "Customize this console" + } } console_groups { title { - text: "Gardener Rotations" + text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/android rotation" - console_ids: "chromium/angle rotation" - console_ids: "chromium/cft rotation" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" + } + console_groups { console_ids: "chromium/chromium rotation" - console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" console_ids: "chromium/dawn rotation" console_ids: "chromium/fuchsia rotation" console_ids: "chromium/ios rotation" @@ -22560,6 +23732,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -22646,19 +23822,19 @@ text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/Tree Closers" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" } console_groups { - title { - text: "Gardener Rotations" - url: "https://chromium-status.appspot.com/" - } - console_ids: "chromium/android rotation" - console_ids: "chromium/angle rotation" - console_ids: "chromium/cft rotation" console_ids: "chromium/chromium rotation" - console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" console_ids: "chromium/dawn rotation" console_ids: "chromium/fuchsia rotation" console_ids: "chromium/ios rotation" @@ -22924,6 +24100,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -23010,19 +24190,19 @@ text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/Tree Closers" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" } console_groups { - title { - text: "Gardener Rotations" - url: "https://chromium-status.appspot.com/" - } - console_ids: "chromium/android rotation" - console_ids: "chromium/angle rotation" - console_ids: "chromium/cft rotation" console_ids: "chromium/chromium rotation" - console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" console_ids: "chromium/dawn rotation" console_ids: "chromium/fuchsia rotation" console_ids: "chromium/ios rotation" @@ -23304,6 +24484,10 @@ url: "/p/chromium-m134/g/main/console" } links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { text: "trunk" url: "/p/chromium/g/main/console" alt: "Trunk (ToT) console" @@ -23390,19 +24574,386 @@ text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/Tree Closers" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" + } + console_groups { + console_ids: "chromium/chromium rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" + console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" + console_ids: "chromium/dawn rotation" + console_ids: "chromium/fuchsia rotation" + console_ids: "chromium/ios rotation" + } + tree_status_host: "chromium-status.appspot.com" + tree_name: "chromium" + } +} +consoles { + id: "ios tree closers" + name: "ios tree closers" + repo_url: "https://chromium.googlesource.com/chromium/src" + refs: "regexp:refs/heads/main" + manifest_name: "REVISION" + builders { + name: "buildbucket/luci.chromium.ci/ios-device" + category: "chromium.mac|ios|default" + short_name: "dev" + } + builders { + name: "buildbucket/luci.chromium.ci/ios-simulator-full-configs" + category: "chromium.mac|ios|default" + short_name: "ful" + } + builders { + name: "buildbucket/luci.chromium.ci/ios-simulator-noncq" + category: "chromium.mac|ios|default" + short_name: "non" + } + builders { + name: "buildbucket/luci.chromium.ci/ios-simulator" + category: "chromium.mac|ios|default" + short_name: "sim" + } + builders { + name: "buildbucket/luci.chromium.ci/ios-asan" + category: "chromium.memory|iOS" + short_name: "asn" + } + header { + oncalls { + name: "Chromium" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-build-sheriff" + } + oncalls { + name: "Android" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-android-sheriff" + } + oncalls { + name: "iOS" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-ios" + } + oncalls { + name: "ChromeOS" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chromeos-gardeners" + } + oncalls { + name: "Fuchsia" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/grotation:chrome-fuchsia-engprod" + } + oncalls { + name: "GPU" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-gpu-pixel-wrangler-weekly" + } + oncalls { + name: "ANGLE" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/grotation:angle-wrangler" + } + oncalls { + name: "Trooper" + url: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-ops-client-infra" + show_primary_secondary_labels: true + } + links { + name: "Builds" + links { + text: "continuous" + url: "https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html" + alt: "Continuous browser snapshots" + } + links { + text: "symbols" + url: "https://www.chromium.org/developers/how-tos/debugging-on-windows" + alt: "Windows Symbols" + } + links { + text: "status" + url: "https://chromium-status.appspot.com/" + alt: "Current tree status" + } + } + links { + name: "Dashboards" + links { + text: "perf" + url: "https://chromeperf.appspot.com/" + alt: "Chrome perf dashboard" + } + links { + text: "LUCI Analysis" + url: "https://luci-analysis.appspot.com" + alt: "New flake portal" + } + } + links { + name: "Chromium" + links { + text: "source" + url: "https://chromium.googlesource.com/chromium/src" + alt: "Chromium source code repository" + } + links { + text: "reviews" + url: "https://chromium-review.googlesource.com" + alt: "Chromium code review tool" + } + links { + text: "bugs" + url: "https://crbug.com" + alt: "Chromium bug tracker" + } + links { + text: "coverage" + url: "https://analysis.chromium.org/coverage/p/chromium" + alt: "Chromium code coverage dashboard" + } + links { + text: "dev" + url: "https://dev.chromium.org/Home" + alt: "Chromium developer home page" + } + links { + text: "support" + url: "https://support.google.com/chrome/#topic=7438008" + alt: "Google Chrome help center" + } + } + links { + name: "Consoles" + links { + text: "android" + url: "/p/chromium/g/chromium.android" + alt: "Chromium Android console" + } + links { + text: "android.desktop" + url: "/p/chromium/g/chromium.android.desktop" + alt: "Chromium Android Desktop console" + } + links { + text: "angle" + url: "/p/chromium/g/chromium.angle" + alt: "Chromium ANGLE console" + } + links { + text: "blink.infra" + url: "/p/chromium/g/blink.infra" + alt: "Chromium Blink Infra console" + } + links { + text: "checks" + url: "/p/chromium/g/checks" + alt: "Checks console" + } + links { + text: "chromiumos" + url: "/p/chromium/g/chromium.chromiumos" + alt: "ChromiumOS console" + } + links { + text: "clang" + url: "/p/chromium/g/chromium.clang" + alt: "Chromium Clang console" + } + links { + text: "dawn" + url: "/p/chromium/g/chromium.dawn" + alt: "Chromium Dawn console" + } + links { + text: "enterprise companion" + url: "/p/chromium/g/chromium.enterprise_companion" + alt: "Chromium Enterprise Companion App console" + } + links { + text: "flakiness" + url: "/p/chromium/g/chromium.flakiness" + alt: "Chromium Flakiness console" + } + links { + text: "fuchsia" + url: "/p/chromium/g/chromium.fuchsia" + alt: "Chromium Fuchsia console" + } + links { + text: "fuzz" + url: "/p/chromium/g/chromium.fuzz" + alt: "Chromium Fuzz console" + } + links { + text: "fyi" + url: "/p/chromium/g/chromium.fyi" + alt: "Chromium FYI console" + } + links { + text: "gpu" + url: "/p/chromium/g/chromium.gpu" + alt: "Chromium GPU console" + } + links { + text: "infra" + url: "/p/chromium/g/chromium.infra" + alt: "Chromium Infra console" + } + links { + text: "memory.fyi" + url: "/p/chromium/g/chromium.memory.fyi" + alt: "Chromium Memory FYI console" + } + links { + text: "perf" + url: "/p/chrome/g/chrome.perf/console" + alt: "Chromium Perf console" + } + links { + text: "perf.fyi" + url: "/p/chrome/g/chrome.perf.fyi/console" + alt: "Chromium Perf FYI console" + } + links { + text: "swangle" + url: "/p/chromium/g/chromium.swangle" + alt: "Chromium SWANGLE console" + } + links { + text: "updater" + url: "/p/chromium/g/chromium.updater" + alt: "Chromium Updater console" + } + links { + text: "webrtc" + url: "/p/chromium/g/chromium.webrtc" + alt: "Chromium WebRTC console" + } + } + links { + name: "Branch Consoles" + links { + text: "m126" + url: "/p/chromium-m126/g/main/console" + } + links { + text: "m132" + url: "/p/chromium-m132/g/main/console" + } + links { + text: "m133" + url: "/p/chromium-m133/g/main/console" + } + links { + text: "m134" + url: "/p/chromium-m134/g/main/console" + } + links { + text: "m135" + url: "/p/chromium-m135/g/main/console" + } + links { + text: "trunk" + url: "/p/chromium/g/main/console" + alt: "Trunk (ToT) console" + } + } + links { + name: "Tryservers" + links { + text: "android" + url: "/p/chromium/g/tryserver.chromium.android/builders" + alt: "Android" + } + links { + text: "angle" + url: "/p/chromium/g/tryserver.chromium.angle/builders" + alt: "Angle" + } + links { + text: "blink" + url: "/p/chromium/g/tryserver.blink/builders" + alt: "Blink" + } + links { + text: "chrome" + url: "/p/chrome/g/tryserver.chrome/builders" + alt: "Chrome" + } + links { + text: "chromiumos" + url: "/p/chromium/g/tryserver.chromium.chromiumos/builders" + alt: "ChromiumOS" + } + links { + text: "fuchsia" + url: "/p/chromium/g/tryserver.chromium.fuchsia/builders" + alt: "Fuchsia" + } + links { + text: "fuzz" + url: "/p/chromium/g/tryserver.chromium.fuzz/builders" + alt: "Fuzz" + } + links { + text: "linux" + url: "/p/chromium/g/tryserver.chromium.linux/builders" + alt: "Linux" + } + links { + text: "mac" + url: "/p/chromium/g/tryserver.chromium.mac/builders" + alt: "Mac" + } + links { + text: "swangle" + url: "/p/chromium/g/tryserver.chromium.swangle/builders" + alt: "SWANGLE" + } + links { + text: "tricium" + url: "/p/chromium/g/tryserver.chromium.tricium/builders" + alt: "Tricium" + } + links { + text: "win" + url: "/p/chromium/g/tryserver.chromium.win/builders" + alt: "Win" + } + } + links { + name: "Navigate" + links { + text: "about" + url: "http://dev.chromium.org/developers/testing/chromium-build-infrastructure/tour-of-the-chromium-buildbot" + alt: "Tour of the console" + } + links { + text: "customize" + url: "https://chromium.googlesource.com/chromium/src/+/refs/heads/main/infra/config/generated/luci/luci-milo.cfg" + alt: "Customize this console" + } } console_groups { title { - text: "Gardener Rotations" + text: "Tree Closers" url: "https://chromium-status.appspot.com/" } - console_ids: "chromium/android rotation" - console_ids: "chromium/angle rotation" - console_ids: "chromium/cft rotation" + console_ids: "chromium/chromium tree closers" + console_ids: "chromium/android tree closers" + console_ids: "chromium/chromiumos tree closers" + console_ids: "chromium/chromium.gpu tree closers" + console_ids: "chromium/ios tree closers" + } + console_groups { console_ids: "chromium/chromium rotation" - console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/android rotation" + console_ids: "chromium/cft rotation" console_ids: "chrome/chrome.perf" + console_ids: "chromium/chromium.gpu rotation" + console_ids: "chromium/angle rotation" console_ids: "chromium/dawn rotation" console_ids: "chromium/fuchsia rotation" console_ids: "chromium/ios rotation"
diff --git a/infra/config/generated/luci/realms.cfg b/infra/config/generated/luci/realms.cfg index c611a81..a8560eb 100644 --- a/infra/config/generated/luci/realms.cfg +++ b/infra/config/generated/luci/realms.cfg
@@ -554,6 +554,7 @@ principals: "project:chromium-m132" principals: "project:chromium-m133" principals: "project:chromium-m134" + principals: "project:chromium-m135" principals: "user:chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" principals: "user:findit-for-me@appspot.gserviceaccount.com" } @@ -604,6 +605,7 @@ principals: "project:chromium-m132" principals: "project:chromium-m133" principals: "project:chromium-m134" + principals: "project:chromium-m135" principals: "user:chromium-orchestrator@chops-service-accounts.iam.gserviceaccount.com" principals: "user:infra-try-recipes-tester@chops-service-accounts.iam.gserviceaccount.com" }
diff --git a/infra/config/lib/builders.star b/infra/config/lib/builders.star index aae65411..27c71ac 100644 --- a/infra/config/lib/builders.star +++ b/infra/config/lib/builders.star
@@ -119,7 +119,7 @@ ), ) -def _rotation(name, console_name): +def _rotation(name, console_name, tree_closer_console): if not name: fail("Rotations must be created with a name") return branches.value( @@ -127,6 +127,7 @@ value = struct( name = name, console_name = console_name, + tree_closer_console = tree_closer_console, ), ) @@ -134,16 +135,16 @@ # New rotations can be added, but won't automatically show up in SoM without # changes to SoM code. gardener_rotations = struct( - ANDROID = _rotation("android", "android rotation"), - ANGLE = _rotation("angle", "angle rotation"), - CHROMIUM = _rotation("chromium", "chromium rotation"), - CFT = _rotation("cft", "cft rotation"), - DAWN = _rotation("dawn", "dawn rotation"), - FUCHSIA = _rotation("fuchsia", "fuchsia rotation"), - CHROMIUM_CLANG = _rotation("chromium.clang", "chromium.clang rotation"), - CHROMIUM_GPU = _rotation("chromium.gpu", "chromium.gpu rotation"), - IOS = _rotation("ios", "ios rotation"), - CHROMIUMOS = _rotation("chromiumos", "chromiumos rotation"), # This group is not on SoM. + ANDROID = _rotation("android", "android rotation", "android tree closers"), + ANGLE = _rotation("angle", "angle rotation", None), + CHROMIUM = _rotation("chromium", "chromium rotation", "chromium tree closers"), + CFT = _rotation("cft", "cft rotation", None), + DAWN = _rotation("dawn", "dawn rotation", None), + FUCHSIA = _rotation("fuchsia", "fuchsia rotation", None), + CHROMIUM_CLANG = _rotation("chromium.clang", "chromium.clang rotation", None), + CHROMIUM_GPU = _rotation("chromium.gpu", "chromium.gpu rotation", "chromium.gpu tree closers"), + IOS = _rotation("ios", "ios rotation", "ios tree closers"), + CHROMIUMOS = _rotation("chromiumos", "chromiumos rotation", "chromiumos tree closers"), # This group is not on SoM. ) # Free disk space in a machine reserved for build tasks.
diff --git a/infra/config/lib/ci.star b/infra/config/lib/ci.star index c1297530..43887385 100644 --- a/infra/config/lib/ci.star +++ b/infra/config/lib/ci.star
@@ -126,7 +126,7 @@ merged_resultdb_bigquery_exports.extend(resultdb_bigquery_exports or []) branch_gardener_rotations = list({ - builders.rotation(platform_settings.gardener_rotation, None): None + builders.rotation(platform_settings.gardener_rotation, None, None): None for platform, platform_settings in settings.platforms.items() if branches.matches(branch_selector, platform = platform) and platform_settings.gardener_rotation }) @@ -196,13 +196,13 @@ category = overview_console_category, short_name = entry.short_name, ) - if tree_closing and notifiers.tree_closer_branch(): - luci.console_view_entry( - builder = builder, - console_view = "Tree Closers", - category = overview_console_category, - short_name = entry.short_name, - ) + if tree_closing and notifiers.tree_closer_branch(): + luci.console_view_entry( + builder = builder, + console_view = rotation.tree_closer_console, + category = overview_console_category, + short_name = entry.short_name, + ) def _gpu_linux_builder(*, name, **kwargs): """Defines a GPU-related linux builder.
diff --git a/infra/config/milestones.json b/infra/config/milestones.json index b17d716a..1df88f5de 100644 --- a/infra/config/milestones.json +++ b/infra/config/milestones.json
@@ -18,5 +18,10 @@ "name": "m134", "project": "chromium-m134", "ref": "refs/branch-heads/6998" + }, + "135": { + "name": "m135", + "project": "chromium-m135", + "ref": "refs/branch-heads/7049" } }
diff --git a/infra/config/subprojects/chrome/try.star b/infra/config/subprojects/chrome/try.star index d9947ef5..51c2f94 100644 --- a/infra/config/subprojects/chrome/try.star +++ b/infra/config/subprojects/chrome/try.star
@@ -79,6 +79,18 @@ ### Optional builders ### chrome_internal_verifier( + # TODO(https://crbug.com/400712231): Turn on branches for this bot. + #branch_selector = branches.selector.ANDROID_BRANCHES, + builder = "android-arm32-orderfile", +) + +chrome_internal_verifier( + # TODO(https://crbug.com/400712231): Turn on branches for this bot. + #branch_selector = branches.selector.ANDROID_BRANCHES, + builder = "android-arm64-orderfile", +) + +chrome_internal_verifier( branch_selector = branches.selector.ANDROID_BRANCHES, builder = "android-arm32-pgo", )
diff --git a/infra/config/subprojects/chromium/ci.star b/infra/config/subprojects/chromium/ci.star index 88b042d..a9fcb25c 100644 --- a/infra/config/subprojects/chromium/ci.star +++ b/infra/config/subprojects/chromium/ci.star
@@ -153,13 +153,13 @@ # TODO(crbug.com/40873502): Replace the header of this and the # register_gardener_rotation_consoles with the default header when it's verified # the name should also be changed to a shared constant with console-header -consoles.console_view(name = "Tree Closers", branch_selector = branches.selector.MAIN, header = DEV_HEADER) - def register_gardener_rotation_consoles(): rotations = [getattr(builders.gardener_rotations, a) for a in dir(builders.gardener_rotations)] for rotation in rotations: if rotation: consoles.console_view(name = rotation.console_name, header = DEV_HEADER) + if rotation.tree_closer_console: + consoles.console_view(name = rotation.tree_closer_console, header = DEV_HEADER) register_gardener_rotation_consoles()
diff --git a/infra/config/subprojects/chromium/ci/chromium.android.desktop.fyi.star b/infra/config/subprojects/chromium/ci/chromium.android.desktop.fyi.star index 1bc5583..3da6c7d 100644 --- a/infra/config/subprojects/chromium/ci/chromium.android.desktop.fyi.star +++ b/infra/config/subprojects/chromium/ci/chromium.android.desktop.fyi.star
@@ -21,6 +21,7 @@ execution_timeout = ci.DEFAULT_EXECUTION_TIMEOUT, health_spec = health_spec.DEFAULT, priority = ci.DEFAULT_FYI_PRIORITY, + reclient_enabled = False, service_account = ci.DEFAULT_SERVICE_ACCOUNT, shadow_service_account = ci.DEFAULT_SHADOW_SERVICE_ACCOUNT, siso_enabled = True,
diff --git a/infra/config/subprojects/chromium/ci/chromium.android.desktop.star b/infra/config/subprojects/chromium/ci/chromium.android.desktop.star index 4593fff..cf8217e 100644 --- a/infra/config/subprojects/chromium/ci/chromium.android.desktop.star +++ b/infra/config/subprojects/chromium/ci/chromium.android.desktop.star
@@ -22,6 +22,7 @@ contact_team_email = "clank-engprod@google.com", execution_timeout = ci.DEFAULT_EXECUTION_TIMEOUT, health_spec = health_spec.DEFAULT, + reclient_enabled = False, service_account = ci.DEFAULT_SERVICE_ACCOUNT, shadow_service_account = ci.DEFAULT_SHADOW_SERVICE_ACCOUNT, siso_enabled = True,
diff --git a/infra/config/subprojects/chromium/ci/chromium.cft.star b/infra/config/subprojects/chromium/ci/chromium.cft.star index 31ed2310..a7ea6be 100644 --- a/infra/config/subprojects/chromium/ci/chromium.cft.star +++ b/infra/config/subprojects/chromium/ci/chromium.cft.star
@@ -21,6 +21,7 @@ tree_closing = False, execution_timeout = ci.DEFAULT_EXECUTION_TIMEOUT, health_spec = health_spec.DEFAULT, + reclient_enabled = False, service_account = ci.DEFAULT_SERVICE_ACCOUNT, shadow_service_account = ci.DEFAULT_SHADOW_SERVICE_ACCOUNT, siso_enabled = True,
diff --git a/infra/config/subprojects/chromium/ci/chromium.clang.star b/infra/config/subprojects/chromium/ci/chromium.clang.star index 640b3e6..55b4e4e 100644 --- a/infra/config/subprojects/chromium/ci/chromium.clang.star +++ b/infra/config/subprojects/chromium/ci/chromium.clang.star
@@ -38,6 +38,7 @@ properties = { "perf_dashboard_machine_group": "ChromiumClang", }, + reclient_enabled = False, service_account = ci.DEFAULT_SERVICE_ACCOUNT, shadow_service_account = ci.DEFAULT_SHADOW_SERVICE_ACCOUNT, siso_enabled = True,
diff --git a/infra/config/subprojects/chromium/ci/chromium.coverage.star b/infra/config/subprojects/chromium/ci/chromium.coverage.star index 64f80825..c2e3f29 100644 --- a/infra/config/subprojects/chromium/ci/chromium.coverage.star +++ b/infra/config/subprojects/chromium/ci/chromium.coverage.star
@@ -45,6 +45,7 @@ execution_timeout = 20 * time.hour, health_spec = health_spec.DEFAULT, priority = ci.DEFAULT_FYI_PRIORITY, + reclient_enabled = False, service_account = ci.DEFAULT_SERVICE_ACCOUNT, shadow_service_account = ci.DEFAULT_SHADOW_SERVICE_ACCOUNT, siso_enabled = True,
diff --git a/infra/config/subprojects/chromium/ci/chromium.fuchsia.fyi.star b/infra/config/subprojects/chromium/ci/chromium.fuchsia.fyi.star index e67d457..476062b 100644 --- a/infra/config/subprojects/chromium/ci/chromium.fuchsia.fyi.star +++ b/infra/config/subprojects/chromium/ci/chromium.fuchsia.fyi.star
@@ -22,6 +22,7 @@ execution_timeout = 10 * time.hour, health_spec = health_spec.DEFAULT, notifies = ["cr-fuchsia"], + reclient_enabled = False, service_account = ci.DEFAULT_SERVICE_ACCOUNT, shadow_service_account = ci.DEFAULT_SHADOW_SERVICE_ACCOUNT, siso_enabled = True,
diff --git a/infra/config/subprojects/chromium/ci/chromium.gpu.star b/infra/config/subprojects/chromium/ci/chromium.gpu.star index 7d71472..acc9d85 100644 --- a/infra/config/subprojects/chromium/ci/chromium.gpu.star +++ b/infra/config/subprojects/chromium/ci/chromium.gpu.star
@@ -23,6 +23,7 @@ contact_team_email = "chrome-gpu-infra@google.com", execution_timeout = ci.DEFAULT_EXECUTION_TIMEOUT, health_spec = health_spec.DEFAULT, + reclient_enabled = False, service_account = ci.DEFAULT_SERVICE_ACCOUNT, shadow_service_account = ci.DEFAULT_SHADOW_SERVICE_ACCOUNT, siso_enabled = True,
diff --git a/infra/config/subprojects/chromium/ci/chromium.memory.fyi.star b/infra/config/subprojects/chromium/ci/chromium.memory.fyi.star index a76f24680..4d9ef24 100644 --- a/infra/config/subprojects/chromium/ci/chromium.memory.fyi.star +++ b/infra/config/subprojects/chromium/ci/chromium.memory.fyi.star
@@ -20,6 +20,7 @@ execution_timeout = ci.DEFAULT_EXECUTION_TIMEOUT, health_spec = health_spec.DEFAULT, priority = ci.DEFAULT_FYI_PRIORITY, + reclient_enabled = False, service_account = ci.DEFAULT_SERVICE_ACCOUNT, shadow_service_account = ci.DEFAULT_SHADOW_SERVICE_ACCOUNT, siso_enabled = True,
diff --git a/infra/config/subprojects/chromium/ci/chromium.memory.star b/infra/config/subprojects/chromium/ci/chromium.memory.star index b1c9539..6fc66075 100644 --- a/infra/config/subprojects/chromium/ci/chromium.memory.star +++ b/infra/config/subprojects/chromium/ci/chromium.memory.star
@@ -30,6 +30,7 @@ contact_team_email = "chrome-sanitizer-builder-owners@google.com", execution_timeout = ci.DEFAULT_EXECUTION_TIMEOUT, health_spec = health_spec.DEFAULT, + reclient_enabled = False, service_account = ci.DEFAULT_SERVICE_ACCOUNT, shadow_service_account = ci.DEFAULT_SHADOW_SERVICE_ACCOUNT, siso_enabled = True,
diff --git a/infra/config/subprojects/chromium/ci/chromium.star b/infra/config/subprojects/chromium/ci/chromium.star index 0f97088..6533f85 100644 --- a/infra/config/subprojects/chromium/ci/chromium.star +++ b/infra/config/subprojects/chromium/ci/chromium.star
@@ -29,6 +29,7 @@ main_console_view = "main", execution_timeout = ci.DEFAULT_EXECUTION_TIMEOUT, health_spec = health_spec.DEFAULT, + reclient_enabled = False, service_account = ci.DEFAULT_SERVICE_ACCOUNT, shadow_service_account = ci.DEFAULT_SHADOW_SERVICE_ACCOUNT, siso_enabled = True,
diff --git a/internal b/internal index 2afa712..b449482 160000 --- a/internal +++ b/internal
@@ -1 +1 @@ -Subproject commit 2afa712f41386ee9d15632203c6c7b7fa6d09914 +Subproject commit b449482a12dac1b1b2409704c32f69d7a8677b3a
diff --git a/ios/chrome/app/strings/ios_strings.grd b/ios/chrome/app/strings/ios_strings.grd index 31e1a96..485c403 100644 --- a/ios/chrome/app/strings/ios_strings.grd +++ b/ios/chrome/app/strings/ios_strings.grd
@@ -525,7 +525,7 @@ No thanks </message> <message name="IDS_IOS_AUTO_DELETION_IPH_TITLE" desc="The title of the half-sheet IPH that appears to prompt the user if they would like to enable the auto-deletion feature."> - Auto delete your downlaods + Auto delete your downloads </message> <message name="IDS_IOS_BACK_FORWARD_SWIPE_IPH" desc="The text for the full screen in-product help for side swipe on the current tab to navigate."> You can swipe the edge to go back or forward. @@ -2127,7 +2127,7 @@ Choose what to do with the existing browsing data on this device, like passwords, history and more. </message> <message name="IDS_IOS_ENTERPRISE_PROFILE_CREATION_ACCOUNT_KEEP_BROWSING_DATA_DISABLED_DESCRIPTION" desc="Message displayed on the managed profile creation screen in a table view item telling the user that their existing browsing data will not be available in the managed profile, but will be available after they signout from it, or sign in with personal account."> - Existing browsing data won't be moved to you work account. You can still access it by signing out or adding a personal account. + Existing browsing data won't be moved to your work account. You can still access it by signing out or adding a personal account. </message> <message name="IDS_IOS_ENTERPRISE_PROFILE_CREATION_ACCOUNT_KEEP_BROWSING_DATA_LABEL" desc="Message displayed on the managed profile creation screen in a table view item asking the user if they want to keep their existing browsing data separate from the managed profile they will create."> Keep data separate? @@ -7252,4 +7252,4 @@ </message> </messages> </release> -</grit> \ No newline at end of file +</grit>
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_AUTO_DELETION_IPH_TITLE.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_AUTO_DELETION_IPH_TITLE.png.sha1 index ae385a8..71b7d52 100644 --- a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_AUTO_DELETION_IPH_TITLE.png.sha1 +++ b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_AUTO_DELETION_IPH_TITLE.png.sha1
@@ -1 +1 @@ -3aa1dfc1138d9555e27b31eb68f4f19f594b2dfb \ No newline at end of file +a12ba3bfd3722be545367504d8e027ac64c93a79 \ No newline at end of file
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_ENTERPRISE_PROFILE_CREATION_ACCOUNT_KEEP_BROWSING_DATA_DISABLED_DESCRIPTION.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_ENTERPRISE_PROFILE_CREATION_ACCOUNT_KEEP_BROWSING_DATA_DISABLED_DESCRIPTION.png.sha1 index b1ff167f..0f0623d 100644 --- a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_ENTERPRISE_PROFILE_CREATION_ACCOUNT_KEEP_BROWSING_DATA_DISABLED_DESCRIPTION.png.sha1 +++ b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_ENTERPRISE_PROFILE_CREATION_ACCOUNT_KEEP_BROWSING_DATA_DISABLED_DESCRIPTION.png.sha1
@@ -1 +1 @@ -a9969fe57af36c4778c8a6d4a1ec9c8ae52bb011 \ No newline at end of file +274a6c6a1122e9ebe0c42046b30cc77b94173d43 \ No newline at end of file
diff --git a/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate_unittest.mm b/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate_unittest.mm index 6f0202f3..0f9d328 100644 --- a/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate_unittest.mm +++ b/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate_unittest.mm
@@ -18,7 +18,7 @@ #import "ios/chrome/browser/collaboration/model/collaboration_service_factory.h" #import "ios/chrome/browser/data_sharing/model/data_sharing_service_factory.h" #import "ios/chrome/browser/favicon/model/ios_chrome_favicon_loader_factory.h" -#import "ios/chrome/browser/favicon/model/mock_favicon_loader.h" +#import "ios/chrome/browser/favicon/model/test_favicon_loader.h" #import "ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.h" #import "ios/chrome/browser/share_kit/model/fake_share_kit_flow_view_controller.h" #import "ios/chrome/browser/share_kit/model/share_kit_service_factory.h" @@ -79,9 +79,9 @@ return std::make_unique<MockCollaborationService>(); } -std::unique_ptr<KeyedService> BuildMockFaviconLoader( +std::unique_ptr<KeyedService> BuildTestFaviconLoader( web::BrowserState* context) { - return std::make_unique<MockFaviconLoader>(); + return std::make_unique<TestFaviconLoader>(); } } // namespace @@ -120,7 +120,7 @@ base::BindRepeating(&BuildTestShareKitService)); test_cbs_builder.AddTestingFactory( IOSChromeFaviconLoaderFactory::GetInstance(), - base::BindRepeating(&BuildMockFaviconLoader)); + base::BindRepeating(&BuildTestFaviconLoader)); profile_ = std::move(test_cbs_builder).Build(); browser_ = std::make_unique<TestBrowser>(profile_.get()); @@ -154,19 +154,8 @@ mock_collaboration_service_ = static_cast<MockCollaborationService*>( CollaborationServiceFactory::GetForProfile(profile_.get())); - mock_favicon_loader_ = static_cast<MockFaviconLoader*>( - IOSChromeFaviconLoaderFactory::GetForProfile(profile_.get())); collaboration_status_.sync_status = SyncStatus::kSyncWithoutTabGroup; - - EXPECT_CALL(*mock_favicon_loader_, FaviconForPageUrl(_, _, _, _, _)) - .WillRepeatedly([](auto, auto, auto, auto, - FaviconLoader::FaviconAttributesCompletionBlock - favicon_block_handler) { - favicon_block_handler([FaviconAttributes - attributesWithImage:[UIImage - imageNamed:@"default_world_favicon"]]); - }); } // Init the delegate for a flow. @@ -248,7 +237,6 @@ base::test::ScopedFeatureList scoped_feature_list_; raw_ptr<tab_groups::TabGroupSyncService> tab_group_sync_service_; raw_ptr<MockCollaborationService> mock_collaboration_service_; - raw_ptr<MockFaviconLoader> mock_favicon_loader_; std::unique_ptr<IOSCollaborationControllerDelegate> delegate_; raw_ptr<WebStateList> web_state_list_; id application_commands_mock_;
diff --git a/ios/chrome/browser/credential_provider/model/BUILD.gn b/ios/chrome/browser/credential_provider/model/BUILD.gn index 903b1ac..24b15135 100644 --- a/ios/chrome/browser/credential_provider/model/BUILD.gn +++ b/ios/chrome/browser/credential_provider/model/BUILD.gn
@@ -101,6 +101,7 @@ "//components/webauthn/core/browser:test_support", "//ios/chrome/app/strings", "//ios/chrome/browser/favicon/model", + "//ios/chrome/browser/favicon/model:test_support", "//ios/chrome/browser/history/model", "//ios/chrome/browser/infobars/model", "//ios/chrome/browser/shared/model/application_context",
diff --git a/ios/chrome/browser/credential_provider/model/credential_provider_service_unittest.mm b/ios/chrome/browser/credential_provider/model/credential_provider_service_unittest.mm index d10bfd6..13152cd9 100644 --- a/ios/chrome/browser/credential_provider/model/credential_provider_service_unittest.mm +++ b/ios/chrome/browser/credential_provider/model/credential_provider_service_unittest.mm
@@ -17,7 +17,6 @@ #import "base/test/scoped_feature_list.h" #import "base/test/task_environment.h" #import "components/affiliations/core/browser/fake_affiliation_service.h" -#import "components/favicon/core/large_icon_service.h" #import "components/password_manager/core/browser/password_form.h" #import "components/password_manager/core/browser/password_store/password_store_change.h" #import "components/password_manager/core/browser/password_store/test_password_store.h" @@ -33,7 +32,7 @@ #import "google_apis/gaia/gaia_id.h" #import "ios/chrome/browser/credential_provider/model/credential_provider_util.h" #import "ios/chrome/browser/credential_provider/model/features.h" -#import "ios/chrome/browser/favicon/model/favicon_loader.h" +#import "ios/chrome/browser/favicon/model/mock_favicon_loader.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/shared/public/features/features.h" #import "ios/chrome/common/app_group/app_group_constants.h" @@ -75,70 +74,6 @@ return passkey; } -// Needed since FaviconLoader has no fake currently. -class MockLargeIconService : public favicon::LargeIconService { - public: - MOCK_METHOD(base::CancelableTaskTracker::TaskId, - GetLargeIconRawBitmapOrFallbackStyleForPageUrl, - (const GURL&, - int, - int, - favicon_base::LargeIconCallback, - base::CancelableTaskTracker*), - (override)); - MOCK_METHOD(base::CancelableTaskTracker::TaskId, - GetLargeIconImageOrFallbackStyleForPageUrl, - (const GURL&, - int, - int, - favicon_base::LargeIconImageCallback, - base::CancelableTaskTracker*), - (override)); - MOCK_METHOD(base::CancelableTaskTracker::TaskId, - GetLargeIconRawBitmapForPageUrl, - (const GURL&, - int, - std::optional<int>, - LargeIconService::NoBigEnoughIconBehavior, - favicon_base::LargeIconCallback, - base::CancelableTaskTracker*), - (override)); - MOCK_METHOD(base::CancelableTaskTracker::TaskId, - GetLargeIconRawBitmapOrFallbackStyleForIconUrl, - (const GURL&, - int, - int, - favicon_base::LargeIconCallback, - base::CancelableTaskTracker*), - (override)); - MOCK_METHOD(base::CancelableTaskTracker::TaskId, - GetIconRawBitmapOrFallbackStyleForPageUrl, - (const GURL&, - int, - favicon_base::LargeIconCallback, - base::CancelableTaskTracker*), - (override)); - MOCK_METHOD(void, - GetLargeIconOrFallbackStyleFromGoogleServerSkippingLocalCache, - (const GURL&, - bool, - const net::NetworkTrafficAnnotationTag&, - favicon_base::GoogleFaviconServerCallback), - (override)); - MOCK_METHOD(void, - GetLargeIconFromCacheFallbackToGoogleServer, - (const GURL& page_url, - StandardIconSize min_source_size_in_pixel, - std::optional<StandardIconSize> size_in_pixel_to_resize_to, - NoBigEnoughIconBehavior no_big_enough_icon_behavior, - bool should_trim_page_url_path, - const net::NetworkTrafficAnnotationTag& traffic_annotation, - favicon_base::LargeIconCallback callback, - base::CancelableTaskTracker* tracker), - (override)); - MOCK_METHOD(void, TouchIconFromGoogleServer, (const GURL&), (override)); -}; - class CredentialProviderServiceTest : public PlatformTest { public: CredentialProviderServiceTest() = default; @@ -203,8 +138,7 @@ signin::IdentityTestEnvironment identity_test_environment_; syncer::TestSyncService sync_service_; affiliations::FakeAffiliationService affiliation_service_; - MockLargeIconService large_icon_service_; - FaviconLoader favicon_loader_ = FaviconLoader(&large_icon_service_); + MockFaviconLoader favicon_loader_; std::unique_ptr<CredentialProviderService> credential_provider_service_; }; @@ -481,9 +415,7 @@ ASSERT_EQ(credential_store_.credentials.count, 0u); // Add password with valid URL to store. - EXPECT_CALL(large_icon_service_, - GetLargeIconRawBitmapOrFallbackStyleForPageUrl(_, _, _, _, _)) - .Times(1); + EXPECT_CALL(favicon_loader_, FaviconForPageUrl(_, _, _, _, _)).Times(1); password_manager::PasswordForm valid_password_form; valid_password_form.url = GURL("http://g.com"); valid_password_form.username_value = u"user1"; @@ -495,9 +427,7 @@ // Don't add password with invalid URL to store. // No favicon should be fetched for invalid URLs. - EXPECT_CALL(large_icon_service_, - GetLargeIconRawBitmapOrFallbackStyleForPageUrl(_, _, _, _, _)) - .Times(0); + EXPECT_CALL(favicon_loader_, FaviconForPageUrl(_, _, _, _, _)).Times(0); password_manager::PasswordForm invalid_password_form; invalid_password_form.url = GURL(""); invalid_password_form.username_value = u"user2"; @@ -509,9 +439,7 @@ // Add password with valid Android facet URI to store. // No favicon should be fetched for Android URI. - EXPECT_CALL(large_icon_service_, - GetLargeIconRawBitmapOrFallbackStyleForPageUrl(_, _, _, _, _)) - .Times(0); + EXPECT_CALL(favicon_loader_, FaviconForPageUrl(_, _, _, _, _)).Times(0); password_manager::PasswordForm android_password_form; android_password_form.url = GURL(android_password_form.signon_realm); android_password_form.signon_realm = "android://hash@com.example.my.app"; @@ -532,9 +460,7 @@ ASSERT_EQ(credential_store_.credentials.count, 0u); // Add password with valid URL to store. - EXPECT_CALL(large_icon_service_, - GetLargeIconRawBitmapOrFallbackStyleForPageUrl(_, _, _, _, _)) - .Times(1); + EXPECT_CALL(favicon_loader_, FaviconForPageUrl(_, _, _, _, _)).Times(1); password_manager::PasswordForm valid_password_form; valid_password_form.url = GURL("http://g.com"); valid_password_form.username_value = u"user1"; @@ -546,9 +472,7 @@ // Don't add password with invalid URL to store. // No favicon should be fetched for invalid URLs. - EXPECT_CALL(large_icon_service_, - GetLargeIconRawBitmapOrFallbackStyleForPageUrl(_, _, _, _, _)) - .Times(0); + EXPECT_CALL(favicon_loader_, FaviconForPageUrl(_, _, _, _, _)).Times(0); password_manager::PasswordForm invalid_password_form; invalid_password_form.url = GURL(""); invalid_password_form.username_value = u"user2"; @@ -560,9 +484,7 @@ // Add password with valid Android facet URI to store. // No favicon should be fetched for Android URI. - EXPECT_CALL(large_icon_service_, - GetLargeIconRawBitmapOrFallbackStyleForPageUrl(_, _, _, _, _)) - .Times(0); + EXPECT_CALL(favicon_loader_, FaviconForPageUrl(_, _, _, _, _)).Times(0); password_manager::PasswordForm android_password_form; android_password_form.url = GURL(android_password_form.signon_realm); android_password_form.signon_realm = "android://hash@com.example.my.app"; @@ -757,9 +679,7 @@ ASSERT_EQ(credential_store_.credentials.count, 0u); // Add passkey with valid URL to store. - EXPECT_CALL(large_icon_service_, - GetLargeIconRawBitmapOrFallbackStyleForPageUrl(_, _, _, _, _)) - .Times(1); + EXPECT_CALL(favicon_loader_, FaviconForPageUrl(_, _, _, _, _)).Times(1); sync_pb::WebauthnCredentialSpecifics valid_passkey = CreatePasskey( "g.com", {1, 2, 3, 4}, "passkey_username", "passkey_display_name"); test_passkey_model_->AddNewPasskeyForTesting(valid_passkey); @@ -769,9 +689,7 @@ // Add passkey with invalid URL to store. // No favicon should be fetched for invalid URLs. - EXPECT_CALL(large_icon_service_, - GetLargeIconRawBitmapOrFallbackStyleForPageUrl(_, _, _, _, _)) - .Times(0); + EXPECT_CALL(favicon_loader_, FaviconForPageUrl(_, _, _, _, _)).Times(0); sync_pb::WebauthnCredentialSpecifics invalid_passkey = CreatePasskey( "", {1, 2, 3, 4}, "passkey_username", "passkey_display_name"); test_passkey_model_->AddNewPasskeyForTesting(invalid_passkey); @@ -781,9 +699,7 @@ // Don't add hidden passkeys to the store. // No favicon should be fetched for hidden passkeys. - EXPECT_CALL(large_icon_service_, - GetLargeIconRawBitmapOrFallbackStyleForPageUrl(_, _, _, _, _)) - .Times(0); + EXPECT_CALL(favicon_loader_, FaviconForPageUrl(_, _, _, _, _)).Times(0); sync_pb::WebauthnCredentialSpecifics hidden_passkey = CreatePasskey( "g.com", {1, 2, 3, 4}, "passkey_username", "passkey_display_name"); hidden_passkey.set_hidden(true); @@ -793,9 +709,7 @@ ASSERT_EQ(credential_store_.credentials.count, 2u); // Add 2nd passkey with valid URL to store. - EXPECT_CALL(large_icon_service_, - GetLargeIconRawBitmapOrFallbackStyleForPageUrl(_, _, _, _, _)) - .Times(1); + EXPECT_CALL(favicon_loader_, FaviconForPageUrl(_, _, _, _, _)).Times(1); sync_pb::WebauthnCredentialSpecifics valid_passkey2 = CreatePasskey( "g.com", {1, 2, 3, 4}, "passkey_username2", "passkey_display_name2"); test_passkey_model_->AddNewPasskeyForTesting(valid_passkey2); @@ -810,9 +724,7 @@ ASSERT_EQ(credential_store_.credentials.count, 0u); // Add passkey with valid URL to store. - EXPECT_CALL(large_icon_service_, - GetLargeIconRawBitmapOrFallbackStyleForPageUrl(_, _, _, _, _)) - .Times(1); + EXPECT_CALL(favicon_loader_, FaviconForPageUrl(_, _, _, _, _)).Times(1); sync_pb::WebauthnCredentialSpecifics passkey = CreatePasskey( "g.com", {1, 2, 3, 4}, "passkey_username", "passkey_display_name"); test_passkey_model_->AddNewPasskeyForTesting(passkey);
diff --git a/ios/chrome/browser/favicon/model/BUILD.gn b/ios/chrome/browser/favicon/model/BUILD.gn index 3d10734..570072b 100644 --- a/ios/chrome/browser/favicon/model/BUILD.gn +++ b/ios/chrome/browser/favicon/model/BUILD.gn
@@ -9,7 +9,8 @@ "favicon_client_impl.h", "favicon_client_impl.mm", "favicon_loader.h", - "favicon_loader.mm", + "favicon_loader_impl.h", + "favicon_loader_impl.mm", "favicon_service_factory.cc", "favicon_service_factory.h", "ios_chrome_favicon_loader_factory.h", @@ -56,11 +57,14 @@ sources = [ "mock_favicon_loader.h", "mock_favicon_loader.mm", + "test_favicon_loader.h", + "test_favicon_loader.mm", ] deps = [ ":model", "//base", "//ios/chrome/common/ui/favicon", + "//ios/chrome/common/ui/resources", "//testing/gmock", "//url", ] @@ -69,7 +73,7 @@ source_set("unit_tests") { testonly = true sources = [ - "favicon_loader_unittest.mm", + "favicon_loader_impl_unittest.mm", "large_icon_cache_unittest.cc", ] deps = [
diff --git a/ios/chrome/browser/favicon/model/favicon_loader.h b/ios/chrome/browser/favicon/model/favicon_loader.h index fbcc022..df9fae4 100644 --- a/ios/chrome/browser/favicon/model/favicon_loader.h +++ b/ios/chrome/browser/favicon/model/favicon_loader.h
@@ -5,32 +5,25 @@ #ifndef IOS_CHROME_BROWSER_FAVICON_MODEL_FAVICON_LOADER_H_ #define IOS_CHROME_BROWSER_FAVICON_MODEL_FAVICON_LOADER_H_ -#import <Foundation/Foundation.h> - -#import "base/memory/raw_ptr.h" +#include "base/memory/raw_ptr.h" #include "base/task/cancelable_task_tracker.h" #include "components/keyed_service/core/keyed_service.h" class GURL; @class FaviconAttributes; -namespace favicon { -class LargeIconService; -} - -// A class that manages asynchronously loading favicons or fallback attributes -// from LargeIconService and caching them, given a URL. +// A class that manages asynchronously loading favicons. class FaviconLoader : public KeyedService { public: // Type for completion block for FaviconForURL(). - typedef void (^FaviconAttributesCompletionBlock)(FaviconAttributes*); + using FaviconAttributesCompletionBlock = void (^)(FaviconAttributes*); - explicit FaviconLoader(favicon::LargeIconService* large_icon_service); + FaviconLoader() = default; FaviconLoader(const FaviconLoader&) = delete; FaviconLoader& operator=(const FaviconLoader&) = delete; - ~FaviconLoader() override; + ~FaviconLoader() override = default; // Tries to find a FaviconAttributes in `favicon_cache_` with `page_url`: // If found, invokes `favicon_block_handler` and exits. @@ -56,7 +49,7 @@ float size_in_points, float min_size_in_points, bool fallback_to_google_server, - FaviconAttributesCompletionBlock favicon_block_handler); + FaviconAttributesCompletionBlock favicon_block_handler) = 0; // Tries to find a FaviconAttributes in `favicon_cache_` with `page_url`: // If found, invokes `favicon_block_handler` and exits. @@ -69,7 +62,7 @@ virtual void FaviconForPageUrlOrHost( const GURL& page_url, float size_in_points, - FaviconAttributesCompletionBlock favicon_block_handler); + FaviconAttributesCompletionBlock favicon_block_handler) = 0; // Tries to find a FaviconAttributes in `favicon_cache_` with `icon_url`: // If found, invokes `favicon_block_handler` and exits. @@ -83,27 +76,13 @@ const GURL& icon_url, float size_in_points, float min_size_in_points, - FaviconAttributesCompletionBlock favicon_block_handler); + FaviconAttributesCompletionBlock favicon_block_handler) = 0; // Cancel all incomplete requests. - virtual void CancellAllRequests(); + virtual void CancellAllRequests() = 0; // Return a weak pointer to the current object. - base::WeakPtr<FaviconLoader> AsWeakPtr(); - - private: - // The LargeIconService used to retrieve favicon. - raw_ptr<favicon::LargeIconService> large_icon_service_; - - // Tracks tasks sent to FaviconService. - base::CancelableTaskTracker cancelable_task_tracker_; - // Holds cached favicons. This NSCache is populated as favicons or fallback - // attributes are retrieved from `large_icon_service_`. Contents will be - // removed during low-memory conditions based on its inherent LRU removal - // algorithm. Keyed by NSString of URL (page URL or icon URL) spec. - NSCache<NSString*, FaviconAttributes*>* favicon_cache_; - - base::WeakPtrFactory<FaviconLoader> weak_ptr_factory_{this}; + virtual base::WeakPtr<FaviconLoader> AsWeakPtr() = 0; }; #endif // IOS_CHROME_BROWSER_FAVICON_MODEL_FAVICON_LOADER_H_
diff --git a/ios/chrome/browser/favicon/model/favicon_loader.mm b/ios/chrome/browser/favicon/model/favicon_loader.mm deleted file mode 100644 index 767f38ec..0000000 --- a/ios/chrome/browser/favicon/model/favicon_loader.mm +++ /dev/null
@@ -1,263 +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. - -#import "ios/chrome/browser/favicon/model/favicon_loader.h" - -#import <UIKit/UIKit.h> - -#import "base/apple/foundation_util.h" -#import "base/functional/bind.h" -#import "base/strings/sys_string_conversions.h" -#import "components/favicon/core/fallback_url_util.h" -#import "components/favicon/core/large_icon_service.h" -#import "components/favicon_base/fallback_icon_style.h" -#import "components/favicon_base/favicon_callback.h" -#import "components/favicon_base/favicon_types.h" -#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h" -#import "ios/chrome/common/ui/favicon/favicon_attributes.h" -#import "net/traffic_annotation/network_traffic_annotation.h" -#import "skia/ext/skia_utils_ios.h" -#import "url/gurl.h" - -namespace { -const CGFloat kFallbackIconDefaultTextColor = 0xAAAAAA; - -// NetworkTrafficAnnotationTag for fetching favicon from a Google server. -const net::NetworkTrafficAnnotationTag kTrafficAnnotation = - net::DefineNetworkTrafficAnnotation("favicon_loader_get_large_icon", R"( - semantics { - sender: "FaviconLoader" - description: - "Sends a request to a Google server to retrieve the favicon bitmap." - trigger: - "A request can be sent if Chrome does not have a favicon." - data: "Page URL and desired icon size." - destination: GOOGLE_OWNED_SERVICE - } - policy { - cookies_allowed: NO - setting: "This feature cannot be disabled by settings." - policy_exception_justification: "Not implemented." - } - )"); -} // namespace - -FaviconLoader::FaviconLoader(favicon::LargeIconService* large_icon_service) - : large_icon_service_(large_icon_service), - favicon_cache_([[NSCache alloc] init]) {} -FaviconLoader::~FaviconLoader() {} - -// TODO(pinkerton): How do we update the favicon if it's changed on the web? -// We can possibly just rely on this class being purged or the app being killed -// to reset it, but then how do we ensure the FaviconService is updated? -void FaviconLoader::FaviconForPageUrl( - const GURL& page_url, - float size_in_points, - float min_size_in_points, - bool fallback_to_google_server, // retrieve favicon from Google Server if - // GetLargeIconOrFallbackStyle() doesn't - // return valid favicon. - FaviconAttributesCompletionBlock favicon_block_handler) { - DCHECK(favicon_block_handler); - NSString* key = - [NSString stringWithFormat:@"%d %@", (int)round(size_in_points), - base::SysUTF8ToNSString(page_url.spec())]; - FaviconAttributes* value = [favicon_cache_ objectForKey:key]; - if (value) { - favicon_block_handler(value); - return; - } - - const CGFloat scale = UIScreen.mainScreen.scale; - GURL block_page_url(page_url); - auto favicon_block = ^(const favicon_base::LargeIconResult& result) { - // GetLargeIconOrFallbackStyle() either returns a valid favicon (which can - // be the default favicon) or fallback attributes. - if (result.bitmap.is_valid()) { - scoped_refptr<base::RefCountedMemory> data = - result.bitmap.bitmap_data.get(); - // The favicon code assumes favicons are PNG-encoded. - UIImage* favicon = [UIImage - imageWithData:[NSData dataWithBytes:data->front() length:data->size()] - scale:scale]; - FaviconAttributes* attributes = - [FaviconAttributes attributesWithImage:favicon]; - [favicon_cache_ setObject:attributes forKey:key]; - - DCHECK(favicon.size.width <= size_in_points && - favicon.size.height <= size_in_points); - favicon_block_handler(attributes); - return; - } else if (fallback_to_google_server) { - void (^favicon_loaded_from_server_block)( - favicon_base::GoogleFaviconServerRequestStatus status) = - ^(const favicon_base::GoogleFaviconServerRequestStatus status) { - // Update the time when the icon was last requested - postpone thus - // the automatic eviction of the favicon from the favicon database. - large_icon_service_->TouchIconFromGoogleServer(block_page_url); - - // Favicon should be loaded to the db that backs LargeIconService - // now. Fetch it again. Even if the request was not successful, the - // fallback style will be used. - FaviconForPageUrl( - block_page_url, size_in_points, min_size_in_points, - /*continueToGoogleServer=*/false, favicon_block_handler); - }; - - large_icon_service_ - ->GetLargeIconOrFallbackStyleFromGoogleServerSkippingLocalCache( - block_page_url, - /*should_trim_page_url_path=*/false, kTrafficAnnotation, - base::BindRepeating(favicon_loaded_from_server_block)); - return; - } - - // Did not get valid favicon back and are not attempting to retrieve one - // from a Google Server. - DCHECK(result.fallback_icon_style); - FaviconAttributes* attributes = [FaviconAttributes - attributesWithMonogram:base::SysUTF16ToNSString( - favicon::GetFallbackIconText(block_page_url)) - textColor:UIColorFromRGB(kFallbackIconDefaultTextColor) - backgroundColor:UIColor.clearColor - defaultBackgroundColor:result.fallback_icon_style-> - is_default_background_color]; - favicon_block_handler(attributes); - }; - - // First, synchronously return a fallback image. - favicon_block_handler([FaviconAttributes attributesWithDefaultImage]); - - // Now fetch the image synchronously. - DCHECK(large_icon_service_); - large_icon_service_->GetLargeIconRawBitmapOrFallbackStyleForPageUrl( - page_url, scale * min_size_in_points, scale * size_in_points, - base::BindRepeating(favicon_block), &cancelable_task_tracker_); -} - -void FaviconLoader::FaviconForPageUrlOrHost( - const GURL& page_url, - float size_in_points, - FaviconAttributesCompletionBlock favicon_block_handler) { - DCHECK(favicon_block_handler); - NSString* key = [NSString - stringWithFormat:@"%d %@ with fallback", (int)round(size_in_points), - base::SysUTF8ToNSString(page_url.spec())]; - FaviconAttributes* value = [favicon_cache_ objectForKey:key]; - if (value) { - favicon_block_handler(value); - return; - } - - const CGFloat scale = UIScreen.mainScreen.scale; - GURL block_page_url(page_url); - auto favicon_block = ^(const favicon_base::LargeIconResult& result) { - // GetLargeIconOrFallbackStyle() either returns a valid favicon (which can - // be the default favicon) or fallback attributes. - if (result.bitmap.is_valid()) { - scoped_refptr<base::RefCountedMemory> data = - result.bitmap.bitmap_data.get(); - // The favicon code assumes favicons are PNG-encoded. - UIImage* favicon = [UIImage - imageWithData:[NSData dataWithBytes:data->front() length:data->size()] - scale:scale]; - FaviconAttributes* attributes = - [FaviconAttributes attributesWithImage:favicon]; - [favicon_cache_ setObject:attributes forKey:key]; - - DCHECK(favicon.size.width <= size_in_points && - favicon.size.height <= size_in_points); - favicon_block_handler(attributes); - return; - } - - // Did not get valid favicon back and are not attempting to retrieve one - // from a Google Server. - DCHECK(result.fallback_icon_style); - FaviconAttributes* attributes = [FaviconAttributes - attributesWithMonogram:base::SysUTF16ToNSString( - favicon::GetFallbackIconText(block_page_url)) - textColor:UIColorFromRGB(kFallbackIconDefaultTextColor) - backgroundColor:UIColor.clearColor - defaultBackgroundColor:result.fallback_icon_style-> - is_default_background_color]; - favicon_block_handler(attributes); - }; - - // First, synchronously return a fallback image. - favicon_block_handler([FaviconAttributes attributesWithDefaultImage]); - - // Now fetch the image synchronously. - DCHECK(large_icon_service_); - large_icon_service_->GetIconRawBitmapOrFallbackStyleForPageUrl( - page_url, scale * size_in_points, base::BindRepeating(favicon_block), - &cancelable_task_tracker_); -} - -void FaviconLoader::FaviconForIconUrl( - const GURL& icon_url, - float size_in_points, - float min_size_in_points, - FaviconAttributesCompletionBlock favicon_block_handler) { - DCHECK(favicon_block_handler); - NSString* key = - [NSString stringWithFormat:@"%d %@", (int)round(size_in_points), - base::SysUTF8ToNSString(icon_url.spec())]; - FaviconAttributes* value = [favicon_cache_ objectForKey:key]; - if (value) { - favicon_block_handler(value); - return; - } - - const CGFloat scale = UIScreen.mainScreen.scale; - const CGFloat favicon_size_in_pixels = scale * size_in_points; - const CGFloat min_favicon_size_in_pixels = scale * min_size_in_points; - GURL block_icon_url(icon_url); - auto favicon_block = ^(const favicon_base::LargeIconResult& result) { - // GetLargeIconOrFallbackStyle() either returns a valid favicon (which can - // be the default favicon) or fallback attributes. - if (result.bitmap.is_valid()) { - scoped_refptr<base::RefCountedMemory> data = - result.bitmap.bitmap_data.get(); - // The favicon code assumes favicons are PNG-encoded. - UIImage* favicon = [UIImage - imageWithData:[NSData dataWithBytes:data->front() length:data->size()] - scale:scale]; - FaviconAttributes* attributes = - [FaviconAttributes attributesWithImage:favicon]; - [favicon_cache_ setObject:attributes forKey:key]; - favicon_block_handler(attributes); - return; - } - // Did not get valid favicon back and are not attempting to retrieve one - // from a Google Server - DCHECK(result.fallback_icon_style); - FaviconAttributes* attributes = [FaviconAttributes - attributesWithMonogram:base::SysUTF16ToNSString( - favicon::GetFallbackIconText(block_icon_url)) - textColor:UIColorFromRGB(kFallbackIconDefaultTextColor) - backgroundColor:UIColor.clearColor - defaultBackgroundColor:result.fallback_icon_style-> - is_default_background_color]; - favicon_block_handler(attributes); - }; - - // First, return a fallback synchronously. - favicon_block_handler([FaviconAttributes - attributesWithImage:[UIImage imageNamed:@"default_world_favicon"]]); - - // Now call the service for a better async icon. - DCHECK(large_icon_service_); - large_icon_service_->GetLargeIconRawBitmapOrFallbackStyleForIconUrl( - icon_url, min_favicon_size_in_pixels, favicon_size_in_pixels, - base::BindRepeating(favicon_block), &cancelable_task_tracker_); -} - -void FaviconLoader::CancellAllRequests() { - cancelable_task_tracker_.TryCancelAll(); -} - -base::WeakPtr<FaviconLoader> FaviconLoader::AsWeakPtr() { - return weak_ptr_factory_.GetWeakPtr(); -}
diff --git a/ios/chrome/browser/favicon/model/favicon_loader_impl.h b/ios/chrome/browser/favicon/model/favicon_loader_impl.h new file mode 100644 index 0000000..f841d1e --- /dev/null +++ b/ios/chrome/browser/favicon/model/favicon_loader_impl.h
@@ -0,0 +1,94 @@ +// Copyright 2025 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_CHROME_BROWSER_FAVICON_MODEL_FAVICON_LOADER_IMPL_H_ +#define IOS_CHROME_BROWSER_FAVICON_MODEL_FAVICON_LOADER_IMPL_H_ + +#import <Foundation/Foundation.h> + +#include "base/sequence_checker.h" +#include "ios/chrome/browser/favicon/model/favicon_loader.h" + +@class FaviconLoaderCacheKey; + +namespace favicon { +class LargeIconService; +} // namespace favicon + +namespace favicon_base { +struct LargeIconResult; +enum class GoogleFaviconServerRequestStatus; +} // namespace favicon_base + +// A concrete implementation of the FaviconLoader service. +// +// It manages asynchronously loading favicons or fallback attributes +// from LargeIconService and caching them, given a URL. +class FaviconLoaderImpl final : public FaviconLoader { + public: + explicit FaviconLoaderImpl(favicon::LargeIconService* large_icon_service); + + ~FaviconLoaderImpl() final; + + // FaviconLoader implementation. + void FaviconForPageUrl( + const GURL& page_url, + float size_in_points, + float min_size_in_points, + bool fallback_to_google_server, + FaviconAttributesCompletionBlock favicon_block_handler) final; + void FaviconForPageUrlOrHost( + const GURL& page_url, + float size_in_points, + FaviconAttributesCompletionBlock favicon_block_handler) final; + void FaviconForIconUrl( + const GURL& icon_url, + float size_in_points, + float min_size_in_points, + FaviconAttributesCompletionBlock favicon_block_handler) final; + void CancellAllRequests() final; + base::WeakPtr<FaviconLoader> AsWeakPtr() final; + + private: + // Class representing the parameters for fetching a favicon. + class Request; + + // Implements fetching the favicon according to `request`. + void FetchFavicon(Request request); + + // Invoked when fetching the favicon from LargeIconService completes. + void OnFaviconFetched(CGFloat scale, + Request request, + const favicon_base::LargeIconResult& result); + + // Invoked when callback to google servers completes. + void OnGoogleServerFallbackCompleted( + Request request, + favicon_base::GoogleFaviconServerRequestStatus status); + + // Returns the cached attributes (if present) for `key`. + FaviconAttributes* GetCachedAttributes(FaviconLoaderCacheKey* key) const; + + // Stores `attributes` into the cache with a key derived from `key`. + void StoreAttributesInCache(FaviconAttributes* attributes, + FaviconLoaderCacheKey* key); + + SEQUENCE_CHECKER(sequence_checker_); + + // The LargeIconService used to retrieve favicon. + raw_ptr<favicon::LargeIconService> large_icon_service_; + + // Tracks tasks sent to FaviconService. + base::CancelableTaskTracker cancelable_task_tracker_; + + // Holds cached favicons. This NSCache is populated as favicons or fallback + // attributes are retrieved from `large_icon_service_`. Contents will be + // removed during low-memory conditions based on its inherent LRU removal + // algorithm. Keyed by NSString of URL (page URL or icon URL) spec. + NSCache<FaviconLoaderCacheKey*, FaviconAttributes*>* favicon_cache_; + + base::WeakPtrFactory<FaviconLoaderImpl> weak_ptr_factory_{this}; +}; + +#endif // IOS_CHROME_BROWSER_FAVICON_MODEL_FAVICON_LOADER_IMPL_H_
diff --git a/ios/chrome/browser/favicon/model/favicon_loader_impl.mm b/ios/chrome/browser/favicon/model/favicon_loader_impl.mm new file mode 100644 index 0000000..327446d --- /dev/null +++ b/ios/chrome/browser/favicon/model/favicon_loader_impl.mm
@@ -0,0 +1,380 @@ +// 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. + +#import "ios/chrome/browser/favicon/model/favicon_loader_impl.h" + +#import <UIKit/UIKit.h> + +#import <functional> +#import <string> + +#import "base/apple/foundation_util.h" +#import "base/functional/bind.h" +#import "base/strings/sys_string_conversions.h" +#import "components/favicon/core/fallback_url_util.h" +#import "components/favicon/core/large_icon_service.h" +#import "components/favicon_base/fallback_icon_style.h" +#import "components/favicon_base/favicon_callback.h" +#import "components/favicon_base/favicon_types.h" +#import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h" +#import "ios/chrome/common/ui/favicon/favicon_attributes.h" +#import "net/traffic_annotation/network_traffic_annotation.h" +#import "skia/ext/skia_utils_ios.h" +#import "url/gurl.h" + +namespace { + +const CGFloat kFallbackIconDefaultTextColor = 0xAAAAAA; + +// NetworkTrafficAnnotationTag for fetching favicon from a Google server. +const net::NetworkTrafficAnnotationTag kTrafficAnnotation = + net::DefineNetworkTrafficAnnotation("favicon_loader_get_large_icon", R"( + semantics { + sender: "FaviconLoader" + description: + "Sends a request to a Google server to retrieve the favicon bitmap." + trigger: + "A request can be sent if Chrome does not have a favicon." + data: "Page URL and desired icon size." + destination: GOOGLE_OWNED_SERVICE + } + policy { + cookies_allowed: NO + setting: "This feature cannot be disabled by settings." + policy_exception_justification: "Not implemented." + } + )"); + +} // namespace + +// Class used as a key in the NSCache dictionary. +// +// Allow to cache data for a pair of an URL and the favicon size. +@interface FaviconLoaderCacheKey : NSObject + +- (instancetype)initWithURL:(const GURL&)URL + sizeInPoints:(float)sizeInPoints NS_DESIGNATED_INITIALIZER; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +@implementation FaviconLoaderCacheKey { + std::string _URLSpec; + int _sizeInPoints; +} + +- (instancetype)initWithURL:(const GURL&)URL sizeInPoints:(float)sizeInPoints { + if ((self = [super init])) { + _URLSpec = URL.is_valid() ? URL.spec() : std::string(); + _sizeInPoints = static_cast<int>(round(sizeInPoints)); + } + return self; +} + +- (BOOL)isEqual:(NSObject*)object { + FaviconLoaderCacheKey* other = + base::apple::ObjCCast<FaviconLoaderCacheKey>(object); + return [self isEqualToCacheKey:other]; +} + +- (NSUInteger)hash { + const size_t h1 = std::hash<std::string>{}(_URLSpec); + const size_t h2 = std::hash<int>{}(_sizeInPoints); + return h1 ^ (h2 << 1); +} + +- (BOOL)isEqualToCacheKey:(FaviconLoaderCacheKey*)other { + if (!other) { + return NO; + } + + if (self == other) { + return YES; + } + + return _sizeInPoints == other->_sizeInPoints && _URLSpec == other->_URLSpec; +} + +@end + +// Class representing the parameters for fetching a favicon. +class FaviconLoaderImpl::Request { + public: + using Completion = FaviconLoader::FaviconAttributesCompletionBlock; + + // The different types of requests. + enum class Type { + kFaviconForPageUrl, + kFaviconForPageUrlWithFallback, + kFaviconForPageUrlOrHost, + kFaviconForIconUrl, + }; + + Request(Request&&) = default; + + ~Request() = default; + + // Constructs an identical Request without fallback to google servers. + Request WithoutFallback() { + DCHECK_EQ(type_, Type::kFaviconForPageUrlWithFallback); + return Request{Type::kFaviconForPageUrl, url_, size_in_points_, + min_size_in_points_, completion_}; + } + + // Constructs a Request to fetch favicon for a page URL, optionally with + // fallback to google servers. + static Request ForPageUrl(const GURL& page_url, + float size_in_points, + float min_size_in_points, + bool fallback_to_google_server, + Completion completion) { + const Type type = fallback_to_google_server + ? Type::kFaviconForPageUrlWithFallback + : Type::kFaviconForPageUrl; + return Request{type, page_url, size_in_points, min_size_in_points, + completion}; + } + + // Constructs a Request to fetch favicon for a page URL or just an host. + static Request ForPageUrlOrHost(const GURL& page_url, + float size_in_points, + Completion completion) { + return Request{Type::kFaviconForPageUrlOrHost, page_url, size_in_points, + /*min_size_in_points=*/0.0, completion}; + } + + // Constructs a Request to fetch favicon from an icon url directly. + static Request ForIconUrl(const GURL& icon_url, + float size_in_points, + float min_size_in_points, + Completion completion) { + return Request{Type::kFaviconForIconUrl, icon_url, size_in_points, + min_size_in_points, completion}; + } + + // Return the request's type. + Type type() const { return type_; } + + // Returns the requet's URL. + const GURL& url() const { return url_; } + + // Returns the size in points for the favicon. + float size_in_points() const { return size_in_points_; } + + // Returns the minimum size in points for the favicon. + float min_size_in_points() const { return min_size_in_points_; } + + // Returns the key to use when locating the favicon in the cache. + FaviconLoaderCacheKey* key() const { + return [[FaviconLoaderCacheKey alloc] + initWithURL:url_ + sizeInPoints:static_cast<int>(round(size_in_points_))]; + } + + // Returns the default fallback favicon if no icon is found in the cache. + FaviconAttributes* fallback() const { + switch (type_) { + case Type::kFaviconForPageUrl: + case Type::kFaviconForPageUrlWithFallback: + case Type::kFaviconForPageUrlOrHost: + return [FaviconAttributes attributesWithDefaultImage]; + + case Type::kFaviconForIconUrl: + return [FaviconAttributes + attributesWithImage:[UIImage imageNamed:@"default_world_favicon"]]; + } + } + + // Invokes the request's completion block with `attributes`. + void completion(FaviconAttributes* attributes) { completion_(attributes); } + + private: + Request(Type type, + const GURL& url, + float size_in_points, + float min_size_in_points, + Completion completion) + : type_(type), + url_(url), + size_in_points_(size_in_points), + min_size_in_points_(min_size_in_points), + completion_(completion) { + DCHECK(completion_); + } + + const Type type_; + const GURL url_; + const float size_in_points_; + const float min_size_in_points_; + const Completion completion_; +}; + +FaviconLoaderImpl::FaviconLoaderImpl( + favicon::LargeIconService* large_icon_service) + : large_icon_service_(large_icon_service), + favicon_cache_([[NSCache alloc] init]) {} + +FaviconLoaderImpl::~FaviconLoaderImpl() = default; + +void FaviconLoaderImpl::FaviconForPageUrl( + const GURL& page_url, + float size_in_points, + float min_size_in_points, + bool fallback_to_google_server, + FaviconAttributesCompletionBlock completion) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(completion); + FetchFavicon(Request::ForPageUrl(page_url, size_in_points, min_size_in_points, + fallback_to_google_server, completion)); +} + +void FaviconLoaderImpl::FaviconForPageUrlOrHost( + const GURL& page_url, + float size_in_points, + FaviconAttributesCompletionBlock completion) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(completion); + FetchFavicon(Request::ForPageUrlOrHost(page_url, size_in_points, completion)); +} + +void FaviconLoaderImpl::FaviconForIconUrl( + const GURL& icon_url, + float size_in_points, + float min_size_in_points, + FaviconAttributesCompletionBlock completion) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(completion); + FetchFavicon(Request::ForIconUrl(icon_url, size_in_points, min_size_in_points, + completion)); +} + +void FaviconLoaderImpl::CancellAllRequests() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + cancelable_task_tracker_.TryCancelAll(); +} + +base::WeakPtr<FaviconLoader> FaviconLoaderImpl::AsWeakPtr() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + return weak_ptr_factory_.GetWeakPtr(); +} + +void FaviconLoaderImpl::FetchFavicon(Request request) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + // First check whether the favicon is present in the cache. + if (FaviconAttributes* cached_value = GetCachedAttributes(request.key())) { + request.completion(cached_value); + return; + } + + // If the favicon was not cached, then return a fallback image synchronously. + request.completion(request.fallback()); + + // Fetch asynchronously a better favicon using the LargeIconServvice. + DCHECK(large_icon_service_); + const GURL url = request.url(); + const CGFloat scale = UIScreen.mainScreen.scale; + const CGFloat size_in_pixels = scale * request.size_in_points(); + const CGFloat min_size_in_pixels = scale * request.min_size_in_points(); + + auto callback = + base::BindOnce(&FaviconLoaderImpl::OnFaviconFetched, + weak_ptr_factory_.GetWeakPtr(), scale, std::move(request)); + + switch (request.type()) { + case Request::Type::kFaviconForPageUrl: + case Request::Type::kFaviconForPageUrlWithFallback: + large_icon_service_->GetLargeIconRawBitmapOrFallbackStyleForPageUrl( + url, min_size_in_pixels, size_in_pixels, std::move(callback), + &cancelable_task_tracker_); + break; + + case Request::Type::kFaviconForPageUrlOrHost: + large_icon_service_->GetIconRawBitmapOrFallbackStyleForPageUrl( + url, size_in_pixels, std::move(callback), &cancelable_task_tracker_); + break; + + case Request::Type::kFaviconForIconUrl: + large_icon_service_->GetLargeIconRawBitmapOrFallbackStyleForIconUrl( + url, min_size_in_pixels, size_in_pixels, std::move(callback), + &cancelable_task_tracker_); + break; + } +} + +void FaviconLoaderImpl::OnFaviconFetched( + CGFloat scale, + Request request, + const favicon_base::LargeIconResult& result) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + // LargeIconResult is either a valid favicon (which can be the default + // favicon) or fallback attributes. + if (result.bitmap.is_valid()) { + scoped_refptr<base::RefCountedMemory> data = + result.bitmap.bitmap_data.get(); + + // The favicon code assumes favicons are PNG-encoded. + UIImage* favicon = [UIImage + imageWithData:[NSData dataWithBytes:data->front() length:data->size()] + scale:scale]; + FaviconAttributes* attributes = + [FaviconAttributes attributesWithImage:favicon]; + StoreAttributesInCache(attributes, request.key()); + + DCHECK(favicon.size.width <= request.size_in_points() && + favicon.size.height <= request.size_in_points()); + request.completion(attributes); + return; + } + + if (request.type() == Request::Type::kFaviconForPageUrlWithFallback) { + const GURL url = request.url(); + large_icon_service_ + ->GetLargeIconOrFallbackStyleFromGoogleServerSkippingLocalCache( + url, + /*should_trim_page_url_path=*/false, kTrafficAnnotation, + base::BindOnce(&FaviconLoaderImpl::OnGoogleServerFallbackCompleted, + weak_ptr_factory_.GetWeakPtr(), std::move(request))); + return; + } + + // Did not get valid favicon back and are not attempting to retrieve one + // from a Google Server. + DCHECK(result.fallback_icon_style); + FaviconAttributes* attributes = [FaviconAttributes + attributesWithMonogram:base::SysUTF16ToNSString( + favicon::GetFallbackIconText(request.url())) + textColor:UIColorFromRGB(kFallbackIconDefaultTextColor) + backgroundColor:UIColor.clearColor + defaultBackgroundColor:result.fallback_icon_style-> + is_default_background_color]; + request.completion(attributes); +} + +void FaviconLoaderImpl::OnGoogleServerFallbackCompleted( + Request request, + favicon_base::GoogleFaviconServerRequestStatus status) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + // Update the time when the icon was last requested - postpone thus + // the automatic eviction of the favicon from the favicon database. + large_icon_service_->TouchIconFromGoogleServer(request.url()); + + // Favicon should be loaded to the db that backs LargeIconService + // now. Fetch it again. Even if the request was not successful, the + // fallback style will be used. + FetchFavicon(request.WithoutFallback()); +} + +FaviconAttributes* FaviconLoaderImpl::GetCachedAttributes( + FaviconLoaderCacheKey* key) const { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + return [favicon_cache_ objectForKey:key]; +} + +void FaviconLoaderImpl::StoreAttributesInCache(FaviconAttributes* attributes, + FaviconLoaderCacheKey* key) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + [favicon_cache_ setObject:attributes forKey:key]; +}
diff --git a/ios/chrome/browser/favicon/model/favicon_loader_impl_unittest.mm b/ios/chrome/browser/favicon/model/favicon_loader_impl_unittest.mm new file mode 100644 index 0000000..2396287 --- /dev/null +++ b/ios/chrome/browser/favicon/model/favicon_loader_impl_unittest.mm
@@ -0,0 +1,194 @@ +// 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. + +#import "ios/chrome/browser/favicon/model/favicon_loader_impl.h" + +#import "base/functional/callback_helpers.h" +#import "components/favicon/core/large_icon_service_impl.h" +#import "components/favicon_base/fallback_icon_style.h" +#import "components/favicon_base/favicon_types.h" +#import "ios/chrome/common/ui/favicon/favicon_attributes.h" +#import "testing/gtest/include/gtest/gtest.h" +#import "testing/platform_test.h" +#import "third_party/skia/include/core/SkBitmap.h" +#import "ui/gfx/codec/png_codec.h" +#import "url/gurl.h" + +namespace { + +// Dummy URL for the favicon case. +const char kTestFaviconURL[] = "http://test/favicon"; +// Dummy URL for the fallback case. +const char kTestFallbackURL[] = "http://test/fallback"; + +// Size of dummy favicon image. +const CGFloat kTestFaviconSize = 57; + +// FaviconLoaderImplTest is parameterized on this enum to test both +// FaviconLoaderImpl::FaviconForPageUrl and +// FaviconLoaderImpl::FaviconForIconUrl. +enum FaviconUrlType { TEST_PAGE_URL, TEST_ICON_URL }; + +// FakeLargeIconService mimics a LargeIconService that returns a LargeIconResult +// with a test favicon image for kTestFaviconURL and a LargeIconResult +// initialized with FallbackIconStyle. +class FakeLargeIconService : public favicon::LargeIconServiceImpl { + public: + FakeLargeIconService() + : favicon::LargeIconServiceImpl( + /*favicon_service=*/nullptr, + /*image_fetcher=*/nullptr, + /*desired_size_in_dip_for_server_requests=*/0, + /*icon_type_for_server_requests=*/ + favicon_base::IconType::kTouchIcon, + /*google_server_client_param=*/"test_chrome") {} + + // Returns LargeIconResult with valid bitmap if `page_url` is + // `kTestFaviconURL`, or LargeIconResult with fallback style. + base::CancelableTaskTracker::TaskId + GetLargeIconRawBitmapOrFallbackStyleForPageUrl( + const GURL& page_url, + int min_source_size_in_pixel, + int desired_size_in_pixel, + favicon_base::LargeIconCallback callback, + base::CancelableTaskTracker* tracker) override { + if (page_url.spec() == kTestFaviconURL) { + favicon_base::FaviconRawBitmapResult bitmapResult; + bitmapResult.expired = false; + + // Create bitmap. + SkBitmap bitmap; + bitmap.allocN32Pixels(30, 30); + std::optional<std::vector<uint8_t>> data = + gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, + /*discard_transparency=*/false); + bitmapResult.bitmap_data = + base::MakeRefCounted<base::RefCountedBytes>(std::move(data.value())); + + favicon_base::LargeIconResult result(bitmapResult); + std::move(callback).Run(result); + } else { + auto fallback = std::make_unique<favicon_base::FallbackIconStyle>(); + favicon_base::LargeIconResult result(std::move(fallback)); + fallback = NULL; + std::move(callback).Run(result); + } + + return 1; + } + + // Returns the same as `GetLargeIconRawBitmapOrFallbackStyleForPageUrl`. + base::CancelableTaskTracker::TaskId + GetLargeIconRawBitmapOrFallbackStyleForIconUrl( + const GURL& icon_url, + int min_source_size_in_pixel, + int desired_size_in_pixel, + favicon_base::LargeIconCallback callback, + base::CancelableTaskTracker* tracker) override { + return GetLargeIconRawBitmapOrFallbackStyleForPageUrl( + icon_url, min_source_size_in_pixel, desired_size_in_pixel, + std::move(callback), tracker); + } +}; + +class FaviconLoaderImplTest + : public PlatformTest, + public ::testing::WithParamInterface<FaviconUrlType> { + public: + // Callback passed to FaviconForUrl(...). + using Callback = base::RepeatingCallback<void(FaviconAttributes*)>; + + FaviconLoaderImplTest() : favicon_loader_(&large_icon_service_) {} + + FaviconLoaderImplTest(const FaviconLoaderImplTest&) = delete; + FaviconLoaderImplTest& operator=(const FaviconLoaderImplTest&) = delete; + + // Invokes FaviconForPageUrl(...) or FaviconForIconUrl(...) depending on + // the TEST_P param. Since FakeLargeIconService is synchronous, the method + // itself is also synchronous. + void FaviconForUrl(const GURL& url, const Callback& callback) { + if (GetParam() == TEST_PAGE_URL) { + favicon_loader_.FaviconForPageUrl(url, kTestFaviconSize, kTestFaviconSize, + /*fallback_to_google_server=*/false, + base::CallbackToBlock(callback)); + } else { + favicon_loader_.FaviconForIconUrl(url, kTestFaviconSize, kTestFaviconSize, + base::CallbackToBlock(callback)); + } + } + + private: + FakeLargeIconService large_icon_service_; + FaviconLoaderImpl favicon_loader_; +}; + +// Tests that image is returned when a favicon is retrieved from +// LargeIconService. +TEST_P(FaviconLoaderImplTest, FaviconForPageUrl) { + int call_count = 0; + FaviconForUrl( + GURL(kTestFaviconURL), + base::BindRepeating( + [](int& counter, FaviconAttributes* attrs) { + ++counter; + EXPECT_TRUE(attrs.faviconImage); + }, std::ref(call_count))); + EXPECT_GE(call_count, 1); +} + +// Tests that fallback data is provided when no favicon is retrieved from +// LargeIconService. +TEST_P(FaviconLoaderImplTest, FallbackIcon) { + int call_count = 0; + FaviconForUrl( + GURL(kTestFallbackURL), + base::BindRepeating( + [](int& counter, FaviconAttributes* attrs) { + ++counter; + if (counter == 1) { + // Check that a placeholder image is received. + EXPECT_TRUE(attrs.faviconImage); + } else if (counter == 2) { + // Check that a monogram is used as a fallback. + EXPECT_FALSE(attrs.faviconImage); + EXPECT_TRUE(attrs.monogramString); + EXPECT_TRUE(attrs.textColor); + EXPECT_TRUE(attrs.backgroundColor); + } + }, std::ref(call_count))); + EXPECT_EQ(call_count, 2); +} + +// Tests that when favicon is in cache, the callback is synchronously called. +TEST_P(FaviconLoaderImplTest, Cache) { + // Favicon retrieval that should put it in the cache. + { + int call_count = 0; + FaviconForUrl( + GURL(kTestFaviconURL), + base::BindRepeating( + [](int& counter, FaviconAttributes* attrs) { + ++counter; + }, std::ref(call_count))); + ASSERT_EQ(call_count, 2); + } + + // The callback should be immediately executed. + int call_count = 0; + FaviconForUrl( + GURL(kTestFaviconURL), + base::BindRepeating( + [](int& counter, FaviconAttributes* attrs) { + ++counter; + EXPECT_TRUE(attrs.faviconImage); + }, std::ref(call_count))); + EXPECT_EQ(call_count, 1); +} + +INSTANTIATE_TEST_SUITE_P(ProgrammaticFaviconLoaderImplTest, + FaviconLoaderImplTest, + ::testing::Values(FaviconUrlType::TEST_PAGE_URL, + FaviconUrlType::TEST_ICON_URL)); + +} // namespace
diff --git a/ios/chrome/browser/favicon/model/favicon_loader_unittest.mm b/ios/chrome/browser/favicon/model/favicon_loader_unittest.mm deleted file mode 100644 index d4018f5a..0000000 --- a/ios/chrome/browser/favicon/model/favicon_loader_unittest.mm +++ /dev/null
@@ -1,180 +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. - -#import "ios/chrome/browser/favicon/model/favicon_loader.h" - -#import "components/favicon/core/large_icon_service_impl.h" -#import "components/favicon_base/fallback_icon_style.h" -#import "components/favicon_base/favicon_types.h" -#import "ios/chrome/common/ui/favicon/favicon_attributes.h" -#import "testing/gtest/include/gtest/gtest.h" -#import "testing/platform_test.h" -#import "third_party/skia/include/core/SkBitmap.h" -#import "ui/gfx/codec/png_codec.h" -#import "url/gurl.h" - -namespace { - -// Dummy URL for the favicon case. -const char kTestFaviconURL[] = "http://test/favicon"; -// Dummy URL for the fallback case. -const char kTestFallbackURL[] = "http://test/fallback"; - -// Size of dummy favicon image. -const CGFloat kTestFaviconSize = 57; - -// FaviconLoaderTest is parameterized on this enum to test both -// FaviconLoader::FaviconForPageUrl and FaviconLoader::FaviconForIconUrl. -enum FaviconUrlType { TEST_PAGE_URL, TEST_ICON_URL }; - -// FakeLargeIconService mimics a LargeIconService that returns a LargeIconResult -// with a test favicon image for kTestFaviconURL and a LargeIconResult -// initialized with FallbackIconStyle. -class FakeLargeIconService : public favicon::LargeIconServiceImpl { - public: - FakeLargeIconService() - : favicon::LargeIconServiceImpl( - /*favicon_service=*/nullptr, - /*image_fetcher=*/nullptr, - /*desired_size_in_dip_for_server_requests=*/0, - /*icon_type_for_server_requests=*/ - favicon_base::IconType::kTouchIcon, - /*google_server_client_param=*/"test_chrome") {} - - // Returns LargeIconResult with valid bitmap if `page_url` is - // `kTestFaviconURL`, or LargeIconResult with fallback style. - base::CancelableTaskTracker::TaskId - GetLargeIconRawBitmapOrFallbackStyleForPageUrl( - const GURL& page_url, - int min_source_size_in_pixel, - int desired_size_in_pixel, - favicon_base::LargeIconCallback callback, - base::CancelableTaskTracker* tracker) override { - if (page_url.spec() == kTestFaviconURL) { - favicon_base::FaviconRawBitmapResult bitmapResult; - bitmapResult.expired = false; - - // Create bitmap. - SkBitmap bitmap; - bitmap.allocN32Pixels(30, 30); - std::optional<std::vector<uint8_t>> data = - gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, - /*discard_transparency=*/false); - bitmapResult.bitmap_data = - base::MakeRefCounted<base::RefCountedBytes>(std::move(data.value())); - - favicon_base::LargeIconResult result(bitmapResult); - std::move(callback).Run(result); - } else { - auto fallback = std::make_unique<favicon_base::FallbackIconStyle>(); - favicon_base::LargeIconResult result(std::move(fallback)); - fallback = NULL; - std::move(callback).Run(result); - } - - return 1; - } - - // Returns the same as `GetLargeIconRawBitmapOrFallbackStyleForPageUrl`. - base::CancelableTaskTracker::TaskId - GetLargeIconRawBitmapOrFallbackStyleForIconUrl( - const GURL& icon_url, - int min_source_size_in_pixel, - int desired_size_in_pixel, - favicon_base::LargeIconCallback callback, - base::CancelableTaskTracker* tracker) override { - return GetLargeIconRawBitmapOrFallbackStyleForPageUrl( - icon_url, min_source_size_in_pixel, desired_size_in_pixel, - std::move(callback), tracker); - } -}; - -class FaviconLoaderTest : public PlatformTest, - public ::testing::WithParamInterface<FaviconUrlType> { - public: - FaviconLoaderTest(const FaviconLoaderTest&) = delete; - FaviconLoaderTest& operator=(const FaviconLoaderTest&) = delete; - - protected: - FaviconLoaderTest() : favicon_loader_(&large_icon_service_) {} - - FakeLargeIconService large_icon_service_; - FaviconLoader favicon_loader_; - - // Returns FaviconLoader::FaviconForPageUrl or - // FaviconLoader::FaviconForIconUrl depending on the TEST_P param. - void FaviconForUrl(const GURL& url, - FaviconLoader::FaviconAttributesCompletionBlock callback) { - if (GetParam() == TEST_PAGE_URL) { - favicon_loader_.FaviconForPageUrl(url, kTestFaviconSize, kTestFaviconSize, - /*fallback_to_google_server=*/false, - callback); - } else { - favicon_loader_.FaviconForIconUrl(url, kTestFaviconSize, kTestFaviconSize, - callback); - } - } -}; - -// Tests that image is returned when a favicon is retrieved from -// LargeIconService. -TEST_P(FaviconLoaderTest, FaviconForPageUrl) { - __block bool callback_executed = false; - auto confirmation_block = ^(FaviconAttributes* favicon_attributes) { - callback_executed = true; - EXPECT_TRUE(favicon_attributes.faviconImage); - }; - FaviconForUrl(GURL(kTestFaviconURL), confirmation_block); - EXPECT_TRUE(callback_executed); -} - -// Tests that fallback data is provided when no favicon is retrieved from -// LargeIconService. -TEST_P(FaviconLoaderTest, FallbackIcon) { - __block int callback_executed_count = 0; - auto confirmation_block = ^(FaviconAttributes* favicon_attributes) { - if (callback_executed_count == 0) { - // Check that a placeholder image is received. - EXPECT_TRUE(favicon_attributes.faviconImage); - } else { - // Check that a monogram is used as a fallback. - EXPECT_FALSE(favicon_attributes.faviconImage); - EXPECT_TRUE(favicon_attributes.monogramString); - EXPECT_TRUE(favicon_attributes.textColor); - EXPECT_TRUE(favicon_attributes.backgroundColor); - } - - ++callback_executed_count; - }; - FaviconForUrl(GURL(kTestFallbackURL), confirmation_block); - EXPECT_EQ(callback_executed_count, 2); -} - -// Tests that when favicon is in cache, the callback is synchronously called. -TEST_P(FaviconLoaderTest, Cache) { - // Favicon retrieval that should put it in the cache. - FaviconForUrl(GURL(kTestFaviconURL), ^(FaviconAttributes* attributes){ - }); - __block bool callback_executed = false; - __block UIImage* faviconImage = nil; - __block int callback_executed_count = 0; - auto confirmation_block = ^(FaviconAttributes* faviconAttributes) { - callback_executed = true; - faviconImage = faviconAttributes.faviconImage; - ++callback_executed_count; - }; - FaviconForUrl(GURL(kTestFaviconURL), confirmation_block); - EXPECT_EQ(callback_executed_count, 1); - // The callback should be immediately executed. - EXPECT_TRUE(callback_executed); - // The cached image should be available immediately. - EXPECT_TRUE(faviconImage); -} - -INSTANTIATE_TEST_SUITE_P(ProgrammaticFaviconLoaderTest, - FaviconLoaderTest, - ::testing::Values(FaviconUrlType::TEST_PAGE_URL, - FaviconUrlType::TEST_ICON_URL)); - -} // namespace
diff --git a/ios/chrome/browser/favicon/model/ios_chrome_favicon_loader_factory.mm b/ios/chrome/browser/favicon/model/ios_chrome_favicon_loader_factory.mm index 330780d..b0a0fb0 100644 --- a/ios/chrome/browser/favicon/model/ios_chrome_favicon_loader_factory.mm +++ b/ios/chrome/browser/favicon/model/ios_chrome_favicon_loader_factory.mm
@@ -5,7 +5,7 @@ #import "ios/chrome/browser/favicon/model/ios_chrome_favicon_loader_factory.h" #import "components/keyed_service/core/service_access_type.h" -#import "ios/chrome/browser/favicon/model/favicon_loader.h" +#import "ios/chrome/browser/favicon/model/favicon_loader_impl.h" #import "ios/chrome/browser/favicon/model/ios_chrome_large_icon_service_factory.h" #import "ios/chrome/browser/shared/model/profile/profile_ios.h" @@ -13,7 +13,7 @@ std::unique_ptr<KeyedService> BuildFaviconLoader(web::BrowserState* context) { ProfileIOS* profile = ProfileIOS::FromBrowserState(context); - return std::make_unique<FaviconLoader>( + return std::make_unique<FaviconLoaderImpl>( IOSChromeLargeIconServiceFactory::GetForProfile(profile)); }
diff --git a/ios/chrome/browser/favicon/model/mock_favicon_loader.h b/ios/chrome/browser/favicon/model/mock_favicon_loader.h index 4c144e81..deeb526 100644 --- a/ios/chrome/browser/favicon/model/mock_favicon_loader.h +++ b/ios/chrome/browser/favicon/model/mock_favicon_loader.h
@@ -5,28 +5,40 @@ #ifndef IOS_CHROME_BROWSER_FAVICON_MODEL_MOCK_FAVICON_LOADER_H_ #define IOS_CHROME_BROWSER_FAVICON_MODEL_MOCK_FAVICON_LOADER_H_ -#import "ios/chrome/browser/favicon/model/favicon_loader.h" -#import "ios/chrome/common/ui/favicon/favicon_attributes.h" -#import "testing/gmock/include/gmock/gmock.h" -#import "url/gurl.h" +#include "ios/chrome/browser/favicon/model/test_favicon_loader.h" +#include "testing/gmock/include/gmock/gmock.h" -class MockFaviconLoader : public FaviconLoader { +// A test double for FaviconLoader that allow mocking methods. +// +// If possible prefer to use TestFaviconLoader if you only need a +// test double that successfully returns a valid favicon for all +// invocations. +class MockFaviconLoader : public TestFaviconLoader { public: MockFaviconLoader(); ~MockFaviconLoader() override; - MOCK_METHOD( - void, - FaviconForPageUrl, - (const GURL&, float, float, bool, FaviconAttributesCompletionBlock), - (override)); + // Mockable methods. + MOCK_METHOD(void, + FaviconForPageUrl, + (const GURL& page_url, + float size_in_points, + float min_size_in_points, + bool fallback_to_google_server, + FaviconAttributesCompletionBlock favicon_block_handler), + (override)); MOCK_METHOD(void, FaviconForPageUrlOrHost, - (const GURL&, float, FaviconAttributesCompletionBlock), + (const GURL& page_url, + float size_in_points, + FaviconAttributesCompletionBlock favicon_block_handler), (override)); MOCK_METHOD(void, FaviconForIconUrl, - (const GURL&, float, float, FaviconAttributesCompletionBlock), + (const GURL& icon_url, + float size_in_points, + float min_size_in_points, + FaviconAttributesCompletionBlock favicon_block_handler), (override)); MOCK_METHOD(void, CancellAllRequests, (), (override)); };
diff --git a/ios/chrome/browser/favicon/model/mock_favicon_loader.mm b/ios/chrome/browser/favicon/model/mock_favicon_loader.mm index e481467b..de683b6 100644 --- a/ios/chrome/browser/favicon/model/mock_favicon_loader.mm +++ b/ios/chrome/browser/favicon/model/mock_favicon_loader.mm
@@ -4,6 +4,6 @@ #import "ios/chrome/browser/favicon/model/mock_favicon_loader.h" -MockFaviconLoader::MockFaviconLoader() : FaviconLoader(nil) {} +MockFaviconLoader::MockFaviconLoader() = default; MockFaviconLoader::~MockFaviconLoader() = default;
diff --git a/ios/chrome/browser/favicon/model/test_favicon_loader.h b/ios/chrome/browser/favicon/model/test_favicon_loader.h new file mode 100644 index 0000000..78282dacc --- /dev/null +++ b/ios/chrome/browser/favicon/model/test_favicon_loader.h
@@ -0,0 +1,43 @@ +// Copyright 2025 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_CHROME_BROWSER_FAVICON_MODEL_TEST_FAVICON_LOADER_H_ +#define IOS_CHROME_BROWSER_FAVICON_MODEL_TEST_FAVICON_LOADER_H_ + +#include "ios/chrome/browser/favicon/model/favicon_loader.h" + +// A test implementation of FaviconLoader that always return the same +// image for all requests. +class TestFaviconLoader : public FaviconLoader { + public: + TestFaviconLoader(); + + ~TestFaviconLoader() override; + + // FaviconLoader implementation. + void FaviconForPageUrl( + const GURL& page_url, + float size_in_points, + float min_size_in_points, + bool fallback_to_google_server, + FaviconAttributesCompletionBlock favicon_block_handler) override; + void FaviconForPageUrlOrHost( + const GURL& page_url, + float size_in_points, + FaviconAttributesCompletionBlock favicon_block_handler) override; + void FaviconForIconUrl( + const GURL& icon_url, + float size_in_points, + float min_size_in_points, + FaviconAttributesCompletionBlock favicon_block_handler) override; + void CancellAllRequests() override; + base::WeakPtr<FaviconLoader> AsWeakPtr() override; + + private: + __strong FaviconAttributes* default_attributes_; + + base::WeakPtrFactory<TestFaviconLoader> weak_ptr_factory_{this}; +}; + +#endif // IOS_CHROME_BROWSER_FAVICON_MODEL_TEST_FAVICON_LOADER_H_
diff --git a/ios/chrome/browser/favicon/model/test_favicon_loader.mm b/ios/chrome/browser/favicon/model/test_favicon_loader.mm new file mode 100644 index 0000000..b6a0209 --- /dev/null +++ b/ios/chrome/browser/favicon/model/test_favicon_loader.mm
@@ -0,0 +1,48 @@ +// Copyright 2025 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/chrome/browser/favicon/model/test_favicon_loader.h" + +#import <UIKit/UIKit.h> + +#import "ios/chrome/common/ui/favicon/favicon_attributes.h" + +TestFaviconLoader::TestFaviconLoader() { + default_attributes_ = [FaviconAttributes + attributesWithImage:[UIImage imageNamed:@"default_world_favicon"]]; +} + +TestFaviconLoader::~TestFaviconLoader() = default; + +void TestFaviconLoader::FaviconForPageUrl( + const GURL& page_url, + float size_in_points, + float min_size_in_points, + bool fallback_to_google_server, + FaviconAttributesCompletionBlock favicon_block_handler) { + favicon_block_handler(default_attributes_); +} + +void TestFaviconLoader::FaviconForPageUrlOrHost( + const GURL& page_url, + float size_in_points, + FaviconAttributesCompletionBlock favicon_block_handler) { + favicon_block_handler(default_attributes_); +} + +void TestFaviconLoader::FaviconForIconUrl( + const GURL& icon_url, + float size_in_points, + float min_size_in_points, + FaviconAttributesCompletionBlock favicon_block_handler) { + favicon_block_handler(default_attributes_); +} + +void TestFaviconLoader::CancellAllRequests() { + // Nothing to do, all requests are resolved synchronously. +} + +base::WeakPtr<FaviconLoader> TestFaviconLoader::AsWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); +}
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm index e8dfaa4..f02b3340 100644 --- a/ios/chrome/browser/flags/about_flags.mm +++ b/ios/chrome/browser/flags/about_flags.mm
@@ -2474,11 +2474,6 @@ FEATURE_WITH_PARAMS_VALUE_TYPE(first_run::kBestFeaturesScreenInFirstRun, kBestFeaturesScreenInFirstRunVariations, "BestFeaturesScreenInFirstRun")}, - {"autofill-enable-card-expired-text", - flag_descriptions::kAutofillEnableCardExpiredTextName, - flag_descriptions::kAutofillEnableCardExpiredTextDescription, - flags_ui::kOsIos, - FEATURE_VALUE_TYPE(autofill::features::kAutofillEnableCardExpiredText)}, {"ios-passkeys-m2", flag_descriptions::kIOSPasskeysM2Name, flag_descriptions::kIOSPasskeysM2Description, flags_ui::kOsIos, FEATURE_VALUE_TYPE(kIOSPasskeysM2)},
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc index cdd4182a..32806931 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
@@ -76,12 +76,6 @@ "When enabled, card benefits offered by issuers will be synced from " "the Payments server."; -const char kAutofillEnableCardExpiredTextName[] = - "Enable 'expired' text for expired cards."; -const char kAutofillEnableCardExpiredTextDescription[] = - "When enabled, cards that have expired will display 'expired' instead of " - "'expires' text."; - const char kAutofillEnableDynamicallyLoadingFieldsForAddressInputName[] = "Enable dynamically loading fields for address input"; const char kAutofillEnableDynamicallyLoadingFieldsForAddressInputDescription[] =
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h index 0f1be53..1f0f068c7 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
@@ -54,9 +54,8 @@ extern const char kAutofillEnableCardBenefitsSyncName[]; extern const char kAutofillEnableCardBenefitsSyncDescription[]; -extern const char kAutofillEnableCardExpiredTextName[]; -extern const char kAutofillEnableCardExpiredTextDescription[]; - +// Title and description for the flag to enable dynamically loading the fields +// for address input based on the country value. extern const char kAutofillEnableDynamicallyLoadingFieldsForAddressInputName[]; extern const char kAutofillEnableDynamicallyLoadingFieldsForAddressInputDescription[];
diff --git a/ios/chrome/browser/lens/ui_bundled/features.mm b/ios/chrome/browser/lens/ui_bundled/features.mm index 106bb58..6f40652 100644 --- a/ios/chrome/browser/lens/ui_bundled/features.mm +++ b/ios/chrome/browser/lens/ui_bundled/features.mm
@@ -46,7 +46,7 @@ BASE_FEATURE(kLensClearcutBackgroundUploadEnabled, "LensClearcutBackgroundUploadEnabled", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kLensClearcutLoggerFastQosEnabled, "LensClearcutLoggerFastQosEnabled", @@ -58,7 +58,7 @@ BASE_FEATURE(kLensInkMultiSampleModeDisabled, "LensInkMultiSampleModeDisabled", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kLensGestureTextSelectionDisabled, "LensGestureTextSelectionDisabled",
diff --git a/ios/chrome/browser/metrics/model/BUILD.gn b/ios/chrome/browser/metrics/model/BUILD.gn index 5355ab5d..2a31a40 100644 --- a/ios/chrome/browser/metrics/model/BUILD.gn +++ b/ios/chrome/browser/metrics/model/BUILD.gn
@@ -352,6 +352,7 @@ testonly = true sources = [ "demographics_egtest.mm", + "dwa_egtest.mm", "tab_usage_recorder_egtest.mm", "ukm_egtest.mm", ] @@ -360,6 +361,7 @@ ":tab_usage_recorder_metrics", "//base/test:test_support", "//components/metrics/demographics", + "//components/metrics/dwa", "//components/strings", "//components/ukm", "//ios/chrome/browser/authentication/ui_bundled:eg_test_support+eg2", @@ -399,6 +401,7 @@ "//base/test:test_support", "//components/metrics", "//components/metrics/demographics:test_support", + "//components/metrics/dwa", "//components/metrics_services_manager", "//components/network_time", "//components/prefs", @@ -422,6 +425,7 @@ deps = [ "//base", "//base/test:test_support", + "//components/metrics/dwa", "//ios/chrome/test:eg_test_support+eg2", "//ios/chrome/test/earl_grey:eg_test_support+eg2", "//ios/testing/earl_grey:eg_test_support+eg2",
diff --git a/ios/chrome/browser/metrics/model/dwa_egtest.mm b/ios/chrome/browser/metrics/model/dwa_egtest.mm new file mode 100644 index 0000000..4a5f5d6 --- /dev/null +++ b/ios/chrome/browser/metrics/model/dwa_egtest.mm
@@ -0,0 +1,406 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "base/ios/ios_util.h" +#import "components/metrics/dwa/dwa_recorder.h" +#import "ios/chrome/browser/authentication/ui_bundled/signin_earl_grey.h" +#import "ios/chrome/browser/authentication/ui_bundled/signin_earl_grey_ui_test_util.h" +#import "ios/chrome/browser/metrics/model/metrics_app_interface.h" +#import "ios/chrome/browser/signin/model/fake_system_identity.h" +#import "ios/chrome/test/earl_grey/chrome_actions.h" +#import "ios/chrome/test/earl_grey/chrome_earl_grey.h" +#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" +#import "ios/chrome/test/earl_grey/chrome_matchers.h" +#import "ios/chrome/test/earl_grey/chrome_test_case.h" +#import "ios/testing/earl_grey/app_launch_configuration.h" +#import "ios/testing/earl_grey/earl_grey_test.h" +using chrome_test_util::GoogleServicesSettingsButton; +using chrome_test_util::SettingsDoneButton; + +@interface DWATestCase : ChromeTestCase + +@end + +@implementation DWATestCase + ++ (void)setUpForTestCase { + [super setUpForTestCase]; +} + +- (void)setUp { + [super setUp]; + + // These tests enable history synchronization via Recent Tabs. + // If the list contains too many tabs, the button at the bottom of + // the view moves offscreen, and its animation causes the tests to freeze, + // similar to crbug.com/640977. + if (![ChromeTestCase forceRestartAndWipe]) { + [ChromeEarlGrey clearBrowsingHistory]; + } + + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:NO], + @"setUp: Failed to assert that DWA was not enabled."); + + // Sign in to Chrome and enable history sync. + + // Note: URL-keyed anonymized data collection is turned on as part of the + // flow to Sign in to Chrome and enable history sync. This matches the main + // user flow that enables DWA. + [SigninEarlGreyUI signinWithFakeIdentity:[FakeSystemIdentity fakeIdentity1] + enableHistorySync:YES]; + [ChromeEarlGrey waitForSyncTransportStateActiveWithTimeout: + syncher::kSyncDWAOperationsTimeout]; + + // Grant metrics consent and update MetricsServicesManager. + [MetricsAppInterface overrideMetricsAndCrashReportingForTesting]; + + GREYAssert(![MetricsAppInterface setMetricsAndCrashReportingForTesting:YES], + @"setUp: Unpaired set/reset of user consent."); + + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:YES], + @"setUp: Failed to assert that DWA was enabled."); + GREYAssert([MetricsAppInterface DWARecorderAllowedForAllProfiles:YES], + @"setUp: Failed to assert that DWA was allowed for all profiles."); +} + +- (void)tearDownHelper { + [ChromeEarlGrey waitForSyncTransportStateActiveWithTimeout: + syncher::kSyncDWAOperationsTimeout]; + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:YES], + @"tearDownHelper: Failed to assert that DWA was enabled."); + [MetricsAppInterface clearDWARecorder]; + [self assertDwaRecorderIsEmpty]; + + // Revoke metrics consent and update MetricsServicesManager. + GREYAssert([MetricsAppInterface setMetricsAndCrashReportingForTesting:NO], + @"tearDownHelper: Unpaired set/reset of user consent."); + [MetricsAppInterface stopOverridingMetricsAndCrashReportingForTesting]; + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:NO], + @"tearDownHelper: Failed to assert that DWA was not enabled."); + + // Sign out of Chrome. + + // Note: URL-keyed anonymized data collection is turned off as part of the + // flow to Sign out of Chrome. This matches the main user flow that disables + // DWA. + [SigninEarlGrey signOut]; + + [ChromeEarlGrey clearFakeSyncServerData]; + + [super tearDownHelper]; +} + +// Enable the DWA feature +- (AppLaunchConfiguration)appConfigurationForTestCase { + AppLaunchConfiguration config = [super appConfigurationForTestCase]; + + config.features_enabled.push_back(metrics::dwa::kDwaFeature); + + return config; +} + +#pragma mark - Helpers + +// Waits for a new incognito tab to be opened. +- (void)openNewIncognitoTab { + const NSUInteger incognitoTabCount = [ChromeEarlGrey incognitoTabCount]; + [ChromeEarlGrey openNewIncognitoTab]; + [ChromeEarlGrey waitForIncognitoTabCount:(incognitoTabCount + 1)]; + GREYAssert([ChromeEarlGrey isIncognitoMode], + @"openNewIncognitoTab: Failed to switch to incognito mode."); +} + +// Waits for the current incognito tab to be closed. +- (void)closeCurrentIncognitoTab { + const NSUInteger incognitoTabCount = [ChromeEarlGrey incognitoTabCount]; + [ChromeEarlGrey closeCurrentTab]; + [ChromeEarlGrey waitForIncognitoTabCount:(incognitoTabCount - 1)]; +} + +// Waits for all incognito tabs to be closed. +- (void)closeAllIncognitoTabs { + [ChromeEarlGrey closeAllIncognitoTabs]; + [ChromeEarlGrey waitForIncognitoTabCount:0]; + + // The user is dropped into the tab grid after closing the last incognito tab. + // Therefore this test must manually switch back to showing the normal tabs. + [[EarlGrey + selectElementWithMatcher:chrome_test_util::TabGridOpenTabsPanelButton()] + performAction:grey_tap()]; + [[EarlGrey selectElementWithMatcher:chrome_test_util::TabGridDoneButton()] + performAction:grey_tap()]; + GREYAssert(![ChromeEarlGrey isIncognitoMode], + @"closeAllIncognitoTabs: Failed to switch to normal mode."); +} + +// Waits for a new tab to be opened. +- (void)openNewRegularTab { + const NSUInteger tabCount = [ChromeEarlGrey mainTabCount]; + [ChromeEarlGrey openNewTab]; + [ChromeEarlGrey waitForMainTabCount:(tabCount + 1)]; +} + +// Records a test DWA entry metric and a pageload event. +- (void)recordTestDWAEntryMetricAndPageLoadEvent { + [MetricsAppInterface recordTestDWAEntryMetric]; + [MetricsAppInterface DWARecorderOnPageLoadCall]; + [MetricsAppInterface recordTestDWAEntryMetric]; +} + +// Toggle "Make searches and browsing better" switch on. +- (void)turnOnMsbbSwitch { + // Wait for the Msbb switch to appear. + [ChromeEarlGrey waitForUIElementToAppearWithMatcher: + chrome_test_util::TableViewSwitchCell( + @"betterSearchAndBrowsingItem_switch", NO)]; + [[EarlGrey + selectElementWithMatcher:chrome_test_util::TableViewSwitchCell( + @"betterSearchAndBrowsingItem_switch", NO)] + performAction:chrome_test_util::TurnTableViewSwitchOn(YES)]; +} + +// Toggle "Make searches and browsing better" switch off. +- (void)turnOffMsbbSwitch { + [ChromeEarlGrey waitForUIElementToAppearWithMatcher: + chrome_test_util::TableViewSwitchCell( + @"betterSearchAndBrowsingItem_switch", YES)]; + [[[EarlGrey + selectElementWithMatcher:chrome_test_util::TableViewSwitchCell( + @"betterSearchAndBrowsingItem_switch", YES)] + usingSearchAction:grey_scrollToContentEdge(kGREYContentEdgeBottom) + onElementWithMatcher:chrome_test_util::GoogleServicesSettingsView()] + performAction:chrome_test_util::TurnTableViewSwitchOn(NO)]; +} + +// Assertions to check that the DWA recorder is enabled and allowed for all +// profiles. +- (void)assertDwaIsEnabledAndAllowed { + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:YES], + @"Failed to assert that DWA was enabled."); + GREYAssert([MetricsAppInterface DWARecorderAllowedForAllProfiles:YES], + @"Failed to assert that DWA was " + @"allowed for all profiles."); +} + +// Assertions to check that the DWA recorder has page load events and entries. +- (void)assertDwaRecorderHasMetrics { + GREYAssert([MetricsAppInterface DWARecorderHasPageLoadEvents:YES], + @"DWA Recorder should have " + @"pageload events."); + GREYAssert([MetricsAppInterface DWARecorderHasEntries:YES], + @"DWA Recorder should have " + @"entries."); +} + +// Assertions to check that the DWA recorder is not enabled and not allowed for +// all profiles. +- (void)assertDwaIsDisabledAndDisallowed { + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:NO], + @"Failed to assert that DWA was not enabled."); + GREYAssert([MetricsAppInterface DWARecorderAllowedForAllProfiles:NO], + @"Failed to assert that DWA was not " + @"allowed for all profiles."); +} + +// Assertions to check that the DWA recorder has no page load events or entries. +- (void)assertDwaRecorderIsEmpty { + GREYAssert([MetricsAppInterface DWARecorderHasPageLoadEvents:NO], + @"DWA Recorder should not have any " + @"pageload events."); + GREYAssert([MetricsAppInterface DWARecorderHasEntries:NO], + @"DWA Recorder should not have any " + @"entries."); +} + +#pragma mark - Tests + +// The tests in this file should correspond to the tests in +// //chrome/browser/metrics/dwa_browsertest.cc + +// LINT.IfChange(DwaServiceCheck) +- (void)testDwaServiceCheck { + // [Note: Tests begin with an open regular tab. This tab is opened in setUp. + // DWA should be enabled with first regular browser. + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:YES], + @"Failed to assert that DWA was enabled."); + + // Records a DWA entry metric. + [MetricsAppInterface recordTestDWAEntryMetric]; + + GREYAssert([MetricsAppInterface DWARecorderHasEntries:YES], + @"Failed to record test entry metric."); + + GREYAssert([MetricsAppInterface DWARecorderHasPageLoadEvents:NO], + @"DWA Recorder should not have pageload events."); + + GREYAssert([MetricsAppInterface hasUnsentDWALogs:NO], + @"DWA Service should not have unsent logs."); + + [MetricsAppInterface DWARecorderOnPageLoadCall]; + GREYAssert([MetricsAppInterface DWARecorderHasEntries:NO], + @"DWA Recorder should not have any entries."); + + GREYAssert([MetricsAppInterface DWARecorderHasPageLoadEvents:YES], + @"DWA Recorder should have pageload events."); + + GREYAssert([MetricsAppInterface hasUnsentDWALogs:NO], + @"DWA Service should not have unsent logs."); + + [MetricsAppInterface DWAServiceFlushCall]; + [self assertDwaRecorderIsEmpty]; + GREYAssert([MetricsAppInterface hasUnsentDWALogs:YES], + @"DWA Service should have unsent logs."); +} +// LINT.ThenChange(/chrome/browser/metrics/dwa_browsertest.cc:DwaServiceCheck) + +// Make sure that DWA is disabled and purged while an incognito window is open. +// LINT.IfChange(RegularBrowserPlusIncognitoCheck) +- (void)testRegularBrowserPlusIncognitoCheck { + // Note: Tests begin with an open regular tab. This tab is opened in setUp. + // DWA should be enabled with first regular browser. + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:YES], + @"Failed to assert that DWA " + @"was enabled."); + [MetricsAppInterface recordTestDWAEntryMetric]; + GREYAssert([MetricsAppInterface DWARecorderHasEntries:YES], + @"Failed to record test " + @"entry metric."); + + // Opening an incognito browser should disable DwaRecorder and metrics + // should be purged. + [self openNewIncognitoTab]; + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:NO], + @"Failed to assert that DWA " + @"was not enabled."); + GREYAssert([MetricsAppInterface DWARecorderHasEntries:NO], + @"DWA Recorder should not " + @"have any entries."); + [MetricsAppInterface recordTestDWAEntryMetric]; + GREYAssert([MetricsAppInterface DWARecorderHasEntries:NO], + @"DWA Recorder should not " + @"have any entries."); + + // Opening another regular tab mustn't enabled DWA. + [self openNewRegularTab]; + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:NO], + @"Failed to assert that DWA was not enabled."); + [MetricsAppInterface recordTestDWAEntryMetric]; + GREYAssert([MetricsAppInterface DWARecorderHasEntries:NO], + @"DWA Recorder should not " + @"have any entries."); + + // Opening and closing another incognito browser must not enable DWA. + [self openNewIncognitoTab]; + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:NO], + @"Failed to assert that DWA was not enabled."); + [MetricsAppInterface recordTestDWAEntryMetric]; + GREYAssert([MetricsAppInterface DWARecorderHasEntries:NO], + @"DWA Recorder should not " + @"have any entries."); + + [self closeCurrentIncognitoTab]; + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:NO], + @"Failed to assert that DWA was not enabled."); + [MetricsAppInterface recordTestDWAEntryMetric]; + GREYAssert([MetricsAppInterface DWARecorderHasEntries:NO], + @"DWA Recorder should not " + @"have any entries."); + + // TODO(crbug.com/41271925): Due to continuous animations, it is not feasible + // (i) to use the tab switcher to switch between modes or (ii) to omit the + // below code block and simply call [ChromeEarlGrey closeAllIncognitoTabs]; + // from incognito mode. + [self openNewRegularTab]; + [ChromeEarlGrey closeCurrentTab]; + [ChromeEarlGrey closeCurrentTab]; + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:NO], + @"Failed to assert that DWA " + @"was not enabled."); + [MetricsAppInterface recordTestDWAEntryMetric]; + GREYAssert([MetricsAppInterface DWARecorderHasEntries:NO], + @"DWA Recorder should not " + @"have any entries."); + + // At this point, there is one open regular tab and one open incognito tab. + [ChromeEarlGrey closeAllIncognitoTabs]; + // All incognito tabs have been closed, so DWA should be enabled. + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:YES], + @"Failed to assert that DWA " + @"was enabled."); + GREYAssert([MetricsAppInterface DWARecorderHasEntries:NO], + @"DWA Recorder should not " + @"have any entries."); + [MetricsAppInterface recordTestDWAEntryMetric]; + GREYAssert([MetricsAppInterface DWARecorderHasEntries:YES], + @"Failed to record test " + @"entry metric."); +} +// LINT.ThenChange(/chrome/browser/metrics/dwa_browsertest.cc:RegularBrowserPlusIncognitoCheck) + +// Make sure opening a regular browser after Incognito doesn't enable DWA. +// LINT.IfChange(IncognitoBrowserPlusRegularCheck) +- (void)testIncognitoBrowserPlusRegularCheck { + // Note: Tests begin with an open regular tab. This tab is opened in setUp. + + // TODO(crbug.com/41271925): Due to continuous animations, it is not feasible + // to close the regular tab that is already open. The functions closeAllTabs, + // closeCurrentTab, and closeAllTabsInCurrentMode close the tab and then hang. + // As a workaround, we open an incognito tab and then close the regular tab to + // get to a state in which a single incognito tab is open. + + // Opening an incognito browser should disable DwaRecorder and metrics should + // be purged. + [self openNewIncognitoTab]; + [ChromeEarlGrey closeAllNormalTabs]; + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:NO], + @"Failed to assert that DWA was not enabled."); + + // Opening another regular browser must not enable DWA. + [self openNewRegularTab]; + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:NO], + @"Failed to assert that DWA was not enabled."); + + // All incognito tabs have been closed, so DWA should be enabled. + [ChromeEarlGrey closeAllIncognitoTabs]; + GREYAssert([MetricsAppInterface checkDWARecordingEnabled:YES], + @"Failed to assert that DWA was enabled."); +} +// LINT.ThenChange(/chrome/browser/metrics/dwa_browsertest.cc:IncognitoBrowserPlusRegularCheck) + +// TODO(crbug.com/400413009): This test is flaky. +// Tests that disabling MSBB UKM consent disables and purges DWA. +// Additionally tests that DWA is disabled until all UKM consents are enabled. +// LINT.IfChange(UkmMsbbConsentChangeCheck) +- (void)FLAKY_testUkmMsbbConsentChangeCheck { + // Note: Tests begin with an open regular tab. This tab is opened in setUp. + [self recordTestDWAEntryMetricAndPageLoadEvent]; + [self assertDwaIsEnabledAndAllowed]; + [self assertDwaRecorderHasMetrics]; + + [ChromeEarlGreyUI openSettingsMenu]; + + // Open Google services settings. + [ChromeEarlGreyUI tapSettingsMenuButton:GoogleServicesSettingsButton()]; + + // Toggle "Make searches and browsing better" switch off. + [self turnOffMsbbSwitch]; + [self assertDwaIsDisabledAndDisallowed]; + [self assertDwaRecorderIsEmpty]; + + // Toggle "Make searches and browsing better" switch on. + [self turnOnMsbbSwitch]; + [self assertDwaIsEnabledAndAllowed]; + [self assertDwaRecorderIsEmpty]; + + // Validate DWA entries and page load events are able to be recorded when all + // consents are enabled. + [self recordTestDWAEntryMetricAndPageLoadEvent]; + [self assertDwaRecorderHasMetrics]; + + [[EarlGrey selectElementWithMatcher:SettingsDoneButton()] + performAction:grey_tap()]; +} +// LINT.ThenChange(/chrome/browser/metrics/dwa_browsertest.cc:UkmMsbbConsentChangeCheck) + +@end
diff --git a/ios/chrome/browser/metrics/model/metrics_app_interface.h b/ios/chrome/browser/metrics/model/metrics_app_interface.h index 70e379ba..75f631f 100644 --- a/ios/chrome/browser/metrics/model/metrics_app_interface.h +++ b/ios/chrome/browser/metrics/model/metrics_app_interface.h
@@ -15,6 +15,9 @@ // Constant for timeout while waiting for asynchronous sync and UKM operations. constexpr base::TimeDelta kSyncUKMOperationsTimeout = base::Seconds(10); +// Constant for timeout while waiting for asynchronous sync and DWA operations. +constexpr base::TimeDelta kSyncDWAOperationsTimeout = base::Seconds(60); + } // namespace syncher // MetricsAppInterface contains the app-side implementation for helpers. These @@ -87,6 +90,33 @@ // Returns YES if the UMA log has user demographics. + (BOOL)UMALogHasUserDemographics; +// Returns whether DWA recording is `enabled`. ++ (BOOL)checkDWARecordingEnabled:(BOOL)enabled; + +// Returns YES if the DWA recorder has entries. ++ (BOOL)DWARecorderHasEntries:(BOOL)state; + +// Returns YES if the DWA recorder has pageload events. ++ (BOOL)DWARecorderHasPageLoadEvents:(BOOL)state; + +// Returns YES if the DWA service has logs to send. ++ (BOOL)hasUnsentDWALogs:(BOOL)state; + +// Invokes the DWA recorder's OnPageLoad method. ++ (void)DWARecorderOnPageLoadCall; + +// Records a new entry metric for DWA. ++ (void)recordTestDWAEntryMetric; + +// Returns true iff DWA is allowed for all profiles. ++ (BOOL)DWARecorderAllowedForAllProfiles:(BOOL)state; + +// Flushes the DWA service with a periodic trigger. ++ (void)DWAServiceFlushCall; + +// Purges DWA recorder. ++ (void)clearDWARecorder; + // Creates a chrome_test_util::HistogramTester that will record every histogram // sent during test. + (NSError*)setupHistogramTester [[nodiscard]];
diff --git a/ios/chrome/browser/metrics/model/metrics_app_interface.mm b/ios/chrome/browser/metrics/model/metrics_app_interface.mm index f6c80b1..b6f5020 100644 --- a/ios/chrome/browser/metrics/model/metrics_app_interface.mm +++ b/ios/chrome/browser/metrics/model/metrics_app_interface.mm
@@ -11,6 +11,9 @@ #import "base/test/ios/wait_util.h" #import "base/test/metrics/user_action_tester.h" #import "components/metrics/demographics/demographic_metrics_test_utils.h" +#import "components/metrics/dwa/dwa_entry_builder.h" +#import "components/metrics/dwa/dwa_recorder.h" +#import "components/metrics/dwa/dwa_service.h" #import "components/metrics/metrics_service.h" #import "components/metrics_services_manager/metrics_services_manager.h" #import "components/network_time/network_time_tracker.h" @@ -38,6 +41,10 @@ return GetApplicationContext()->GetMetricsServicesManager()->GetUkmService(); } +metrics::dwa::DwaService* GetDwaService() { + return GetApplicationContext()->GetMetricsServicesManager()->GetDwaService(); +} + metrics::MetricsService* GetMetricsService() { return GetApplicationContext()->GetMetricsService(); } @@ -164,6 +171,68 @@ return log && log->has_user_demographics(); } ++ (BOOL)checkDWARecordingEnabled:(BOOL)enabled { + ConditionBlock condition = ^{ + return metrics::dwa::DwaRecorder::Get()->IsEnabled() == enabled; + }; + return base::test::ios::WaitUntilConditionOrTimeout( + syncher::kSyncDWAOperationsTimeout, condition); +} + ++ (BOOL)DWARecorderAllowedForAllProfiles:(BOOL)state { + ConditionBlock condition = ^{ + return GetApplicationContext() + ->GetMetricsServicesManager() + ->IsDwaAllowedForAllProfiles() == state; + }; + return base::test::ios::WaitUntilConditionOrTimeout( + syncher::kSyncDWAOperationsTimeout, condition); +} + ++ (BOOL)DWARecorderHasEntries:(BOOL)state { + ConditionBlock condition = ^{ + return metrics::dwa::DwaRecorder::Get()->HasEntries() == state; + }; + return base::test::ios::WaitUntilConditionOrTimeout( + syncher::kSyncDWAOperationsTimeout, condition); +} + ++ (BOOL)DWARecorderHasPageLoadEvents:(BOOL)state { + ConditionBlock condition = ^{ + return metrics::dwa::DwaRecorder::Get()->HasPageLoadEvents() == state; + }; + return base::test::ios::WaitUntilConditionOrTimeout( + syncher::kSyncDWAOperationsTimeout, condition); +} + ++ (BOOL)hasUnsentDWALogs:(BOOL)state { + ConditionBlock condition = ^{ + return GetDwaService()->unsent_log_store()->has_unsent_logs() == state; + }; + return base::test::ios::WaitUntilConditionOrTimeout( + syncher::kSyncDWAOperationsTimeout, condition); +} + ++ (void)recordTestDWAEntryMetric { + dwa::DwaEntryBuilder builder("Kangaroo.Jumped"); + builder.SetContent("https://adtech.com"); + builder.SetMetric("Length", 5); + builder.Record(metrics::dwa::DwaRecorder::Get()); +} + ++ (void)DWARecorderOnPageLoadCall { + metrics::dwa::DwaRecorder::Get()->OnPageLoad(); +} + ++ (void)DWAServiceFlushCall { + GetDwaService()->Flush( + metrics::MetricsLogsEventManager::CreateReason::kPeriodic); +} + ++ (void)clearDWARecorder { + metrics::dwa::DwaRecorder::Get()->Purge(); +} + + (NSError*)setupHistogramTester { if (g_histogram_tester) { return testing::NSErrorWithLocalizedDescription(
diff --git a/ios/chrome/browser/policy/model/reporting/profile_report_generator_ios_unittest.mm b/ios/chrome/browser/policy/model/reporting/profile_report_generator_ios_unittest.mm index ba1b679a..0e5aeb31 100644 --- a/ios/chrome/browser/policy/model/reporting/profile_report_generator_ios_unittest.mm +++ b/ios/chrome/browser/policy/model/reporting/profile_report_generator_ios_unittest.mm
@@ -11,6 +11,7 @@ #import "base/run_loop.h" #import "base/strings/sys_string_conversions.h" #import "base/test/bind.h" +#import "base/test/test_future.h" #import "components/enterprise/browser/reporting/report_type.h" #import "components/policy/core/common/mock_policy_service.h" #import "components/policy/core/common/policy_map.h" @@ -95,8 +96,11 @@ std::unique_ptr<em::ChromeUserProfileInfo> GenerateReport() { const base::FilePath path = profile_->GetStatePath(); - std::unique_ptr<em::ChromeUserProfileInfo> report = - generator_.MaybeGenerate(path, ReportType::kFull); + base::test::TestFuture<std::unique_ptr<em::ChromeUserProfileInfo>> + test_future; + generator_.MaybeGenerate(path, ReportType::kFull, + test_future.GetCallback()); + auto report = test_future.Take(); if (!report) { return nullptr;
diff --git a/ios/chrome/browser/reading_list/ui_bundled/BUILD.gn b/ios/chrome/browser/reading_list/ui_bundled/BUILD.gn index 6ed3fd1..76381cd 100644 --- a/ios/chrome/browser/reading_list/ui_bundled/BUILD.gn +++ b/ios/chrome/browser/reading_list/ui_bundled/BUILD.gn
@@ -197,6 +197,7 @@ "//components/url_formatter", "//ios/chrome/browser/authentication/ui_bundled/cells", "//ios/chrome/browser/favicon/model", + "//ios/chrome/browser/favicon/model:test_support", "//ios/chrome/browser/feature_engagement/model", "//ios/chrome/browser/net/model:crurl", "//ios/chrome/browser/reading_list/model",
diff --git a/ios/chrome/browser/reading_list/ui_bundled/reading_list_mediator_unittest.mm b/ios/chrome/browser/reading_list/ui_bundled/reading_list_mediator_unittest.mm index dba8ea3..4bb630a 100644 --- a/ios/chrome/browser/reading_list/ui_bundled/reading_list_mediator_unittest.mm +++ b/ios/chrome/browser/reading_list/ui_bundled/reading_list_mediator_unittest.mm
@@ -10,8 +10,6 @@ #import "base/task/sequenced_task_runner.h" #import "base/task/single_thread_task_runner.h" #import "base/test/simple_test_clock.h" -#import "components/favicon/core/large_icon_service_impl.h" -#import "components/favicon/core/test/mock_favicon_service.h" #import "components/favicon_base/favicon_types.h" #import "components/reading_list/core/fake_reading_list_model_storage.h" #import "components/reading_list/core/reading_list_model_impl.h" @@ -19,8 +17,7 @@ #import "components/sync/model/wipe_model_upon_sync_disabled_behavior.h" #import "components/sync/test/test_sync_service.h" #import "components/url_formatter/url_formatter.h" -#import "ios/chrome/browser/favicon/model/favicon_loader.h" -#import "ios/chrome/browser/favicon/model/ios_chrome_large_icon_service_factory.h" +#import "ios/chrome/browser/favicon/model/test_favicon_loader.h" #import "ios/chrome/browser/reading_list/ui_bundled/reading_list_list_item_accessibility_delegate.h" #import "ios/chrome/browser/reading_list/ui_bundled/reading_list_list_item_custom_action_factory.h" #import "ios/chrome/browser/reading_list/ui_bundled/reading_list_list_item_factory.h" @@ -59,18 +56,6 @@ storage_ptr->TriggerLoadCompletion(); sync_service_ = std::make_unique<syncer::TestSyncService>(); - EXPECT_CALL(mock_favicon_service_, - GetLargestRawFaviconForPageURL(_, _, _, _, _)) - .WillRepeatedly([](auto, auto, auto, - favicon_base::FaviconRawBitmapCallback callback, - base::CancelableTaskTracker* tracker) { - return tracker->PostTask( - base::SingleThreadTaskRunner::GetCurrentDefault().get(), - FROM_HERE, - base::BindOnce(std::move(callback), - favicon_base::FaviconRawBitmapResult())); - }); - no_title_entry_url_ = GURL("http://chromium.org/unread3"); // The first 3 have the same update time on purpose. model_->AddOrReplaceEntry(GURL("http://chromium.org/unread1"), "unread1", @@ -92,18 +77,11 @@ reading_list::ADDED_VIA_CURRENT_APP, /*estimated_read_time=*/base::TimeDelta()); model_->SetReadStatusIfExists(GURL("http://chromium.org/read2"), true); - large_icon_service_.reset(new favicon::LargeIconServiceImpl( - &mock_favicon_service_, /*image_fetcher=*/nullptr, - /*desired_size_in_dip_for_server_requests=*/24, - /*icon_type_for_server_requests=*/ - favicon_base::IconType::kTouchIcon, - /*google_server_client_param=*/"test_chrome")); - favicon_loader.reset(new FaviconLoader(large_icon_service_.get())); mediator_ = [[ReadingListMediator alloc] initWithModel:model_.get() syncService:sync_service_.get() - faviconLoader:favicon_loader.get() + faviconLoader:&favicon_loader_ listItemFactory:[[ReadingListListItemFactory alloc] init]]; } @@ -113,17 +91,13 @@ ReadingListMediatorTest& operator=(const ReadingListMediatorTest&) = delete; protected: - testing::StrictMock<favicon::MockFaviconService> mock_favicon_service_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<ReadingListModelImpl> model_; std::unique_ptr<syncer::TestSyncService> sync_service_; ReadingListMediator* mediator_; base::SimpleTestClock clock_; GURL no_title_entry_url_; - std::unique_ptr<FaviconLoader> favicon_loader; - std::unique_ptr<favicon::LargeIconServiceImpl> large_icon_service_; - - private: - web::WebTaskEnvironment task_environment_; + TestFaviconLoader favicon_loader_; }; TEST_P(ReadingListMediatorTest, fillItems) {
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_consumer.h b/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_consumer.h index 8726578..d23d547 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_consumer.h +++ b/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_consumer.h
@@ -7,8 +7,7 @@ // State of on-device encryption. typedef NS_ENUM(NSInteger, PasswordSettingsOnDeviceEncryptionState) { - // User can not opt-in in their current state, so the section should not be - // shown. + // User can not opt-in in their current state. PasswordSettingsOnDeviceEncryptionStateNotShown = 0, // On-device encryption is on. PasswordSettingsOnDeviceEncryptionStateOptedIn, @@ -20,47 +19,35 @@ // the password settings submenu. @protocol PasswordSettingsConsumer -// Indicates whether the delete flow can be started. Should be NO when no -// credentials saved, and YES otherwise. -- (void)setCanDeleteAllCredentials:(BOOL)canDeleteAllCredentials; +// User-modifiable preferences. -// Indicates whether the export flow can be started. Should be NO when an -// export is already in progress, and YES when idle. -- (void)setCanExportPasswords:(BOOL)canExportPasswords; +- (void)setSavingPasswordsEnabled:(BOOL)enabled + managedByPolicy:(BOOL)managedByPolicy; -// Indicates whether automatic passkey upgrades setting is `enabled`. - (void)setAutomaticPasskeyUpgradesEnabled:(BOOL)enabled; -// Indicates whether or not the "Offer to save passwords and passkeys" feature -// is `enabled` and if it is managed by an enterprise policy. -- (void)setSavePasswordsEnabled:(BOOL)enabled - managedByPolicy:(BOOL)managedByPolicy; +// Read-only data. -// Indicates whether saving passkeys is `enabled`. -- (void)setSavePasskeysEnabled:(BOOL)enabled; +- (void)setUserEmail:(NSString*)userEmail; -// The count of local passwords passed along with the user eligibility to see -// the move passwords to account section. -- (void)setLocalPasswordsCount:(int)count withUserEligibility:(BOOL)eligibility; +// This is enabled by default and can only be modified by an enterprise policy. +- (void)setSavingPasskeysEnabled:(BOOL)enabled; -// Indicates the signed-in account. -- (void)setSignedInAccount:(NSString*)account; +// State machines triggering UI changes. -// Indicates whether or not Chromium has been enabled as a credential provider -// at the iOS level. -- (void)setPasswordsInOtherAppsEnabled:(BOOL)enabled; +- (void)setCanDeleteAllCredentials:(BOOL)canDeleteAllCredentials; -// Indicates the on-device encryption state according to the sync service. +- (void)setCanExportPasswords:(BOOL)canExportPasswords; + +- (void)setCanBulkMove:(BOOL)canBulkMove localPasswordsCount:(int)count; + - (void)setOnDeviceEncryptionState: (PasswordSettingsOnDeviceEncryptionState)onDeviceEncryptionState; -// Update the delete all credentials section based on the current state. -- (void)updateDeleteAllCredentialsSection; +- (void)setPasswordsInOtherAppsEnabled:(BOOL)enabled; -// Enables/disables the "Export Passwords..." button based on the current state. -- (void)updateExportPasswordsButton; - -// Sets up button for changing GPM Pin. +// TODO(crbug.com/399398237): Refactor into `setCanChangeGPMPin` and act on sync +// changes (e.g. NO should be passed when sync state changes to signed out). - (void)setupChangeGPMPinButton; @end
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_mediator.mm b/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_mediator.mm index 9d6fa7dcf..00e9625 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_mediator.mm +++ b/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_mediator.mm
@@ -178,20 +178,20 @@ self.exporterIsReady = self.passwordExporter.exportState == ExportState::IDLE; [self savedPasswordsDidChange]; - [self.consumer setSavePasswordsEnabled:_prefService->GetBoolean( - kCredentialsEnableService) - managedByPolicy:_prefService->IsManagedPreference( - kCredentialsEnableService)]; + [self.consumer setSavingPasswordsEnabled:_prefService->GetBoolean( + kCredentialsEnableService) + managedByPolicy:_prefService->IsManagedPreference( + kCredentialsEnableService)]; - [self.consumer setSignedInAccount:base::SysUTF8ToNSString( - _syncService->GetAccountInfo().email)]; + [self.consumer setUserEmail:base::SysUTF8ToNSString( + _syncService->GetAccountInfo().email)]; [self.consumer setAutomaticPasskeyUpgradesEnabled:_prefService->GetBoolean( kAutomaticPasskeyUpgrades)]; - [self.consumer setSavePasskeysEnabled:_prefService->GetBoolean( - kCredentialsEnablePasskeys)]; + [self.consumer setSavingPasskeysEnabled:_prefService->GetBoolean( + kCredentialsEnablePasskeys)]; [self passwordAutoFillStatusDidChange]; @@ -302,7 +302,7 @@ // This is invoked by the exporter when its state changes, so we have to // re-read that state before pushing to the consumer. self.exporterIsReady = self.passwordExporter.exportState == ExportState::IDLE; - [self pushExportStateToConsumerAndUpdate]; + [self pushExportStateToConsumer]; } #pragma mark - PasswordSettingsDelegate @@ -361,8 +361,8 @@ - (void)savedPasswordsDidChange { self.hasSavedPasswords = !_savedPasswordsPresenter->GetSavedPasswords().empty(); - [self pushDeleteStateToConsumerAndUpdate]; - [self pushExportStateToConsumerAndUpdate]; + [self pushDeleteStateToConsumer]; + [self pushExportStateToConsumer]; [self updateShowBulkMovePasswordsToAccount]; } @@ -384,13 +384,13 @@ setAutomaticPasskeyUpgradesEnabled:_prefService->GetBoolean( kAutomaticPasskeyUpgrades)]; } else if (preferenceName == kCredentialsEnablePasskeys) { - [self.consumer setSavePasskeysEnabled:_prefService->GetBoolean( - kCredentialsEnablePasskeys)]; + [self.consumer setSavingPasskeysEnabled:_prefService->GetBoolean( + kCredentialsEnablePasskeys)]; } else { - [self.consumer setSavePasswordsEnabled:_prefService->GetBoolean( - kCredentialsEnableService) - managedByPolicy:_prefService->IsManagedPreference( - kCredentialsEnableService)]; + [self.consumer setSavingPasswordsEnabled:_prefService->GetBoolean( + kCredentialsEnableService) + managedByPolicy:_prefService->IsManagedPreference( + kCredentialsEnableService)]; } } @@ -414,8 +414,8 @@ - (void)onSyncStateChanged { [self.consumer setOnDeviceEncryptionState:[self onDeviceEncryptionState]]; - [self.consumer setSignedInAccount:base::SysUTF8ToNSString( - _syncService->GetAccountInfo().email)]; + [self.consumer setUserEmail:base::SysUTF8ToNSString( + _syncService->GetAccountInfo().email)]; [self updateShowBulkMovePasswordsToAccount]; } @@ -433,9 +433,8 @@ return PasswordSettingsOnDeviceEncryptionStateNotShown; } -// Pushes the current state of the credential deletion button to the consumer -// and update its delete all data button. -- (void)pushDeleteStateToConsumerAndUpdate { +// Pushes the current state of the credential deletion button to the consumer. +- (void)pushDeleteStateToConsumer { if (_savedPasswordsPresenter) { [self.consumer setCanDeleteAllCredentials:!_savedPasswordsPresenter @@ -443,24 +442,21 @@ .empty() || !_savedPasswordsPresenter->GetBlockedSites() .empty()]; - [self.consumer updateDeleteAllCredentialsSection]; } } -// Pushes the current state of the exporter to the consumer and updates its -// export passwords button. -- (void)pushExportStateToConsumerAndUpdate { +// Pushes the current state of the exporter to the consumer. +- (void)pushExportStateToConsumer { [self.consumer setCanExportPasswords:self.hasSavedPasswords && self.exporterIsReady]; - [self.consumer updateExportPasswordsButton]; } // Computes the amount of local passwords and passes that on to the consumer. - (void)updateShowBulkMovePasswordsToAccount { - [self.consumer setLocalPasswordsCount:[self computeLocalPasswordsCount] - withUserEligibility:password_manager::features_util:: - IsAccountStorageEnabled( - _prefService, _syncService)]; + [self.consumer setCanBulkMove:password_manager::features_util:: + IsAccountStorageEnabled(_prefService, + _syncService) + localPasswordsCount:[self computeLocalPasswordsCount]]; } // Returns the amount of local passwords.
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_mediator_unittest.mm b/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_mediator_unittest.mm index 3b4883f..a2b3e161 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_mediator_unittest.mm +++ b/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_mediator_unittest.mm
@@ -287,7 +287,7 @@ mediator_); [syncObserver onSyncStateChanged]; - [[consumer_ verify] setLocalPasswordsCount:0 withUserEligibility:NO]; + [[consumer_ verify] setCanBulkMove:NO localPasswordsCount:0]; } // Tests that update GPM Pin button is shown for a user that has GPM Pin @@ -354,19 +354,19 @@ AddPassword("https://www.example.com/1", u"password1", PasswordForm::Store::kNotSet); - [[consumer_ verify] setLocalPasswordsCount:1 withUserEligibility:NO]; + [[consumer_ verify] setCanBulkMove:NO localPasswordsCount:1]; AddPassword("https://www.example.com/2", u"password2", PasswordForm::Store::kProfileStore); - [[consumer_ verify] setLocalPasswordsCount:2 withUserEligibility:NO]; + [[consumer_ verify] setCanBulkMove:NO localPasswordsCount:2]; // Count should not be increased for an account store password. AddPassword("https://www.example.com/3", u"password3", PasswordForm::Store::kAccountStore); - [[consumer_ verify] setLocalPasswordsCount:2 withUserEligibility:NO]; + [[consumer_ verify] setCanBulkMove:NO localPasswordsCount:2]; if (syncer::IsWebauthnCredentialSyncEnabled()) { // Count should not be increased for a passkey. AddPasskey(); - [[consumer_ verify] setLocalPasswordsCount:2 withUserEligibility:NO]; + [[consumer_ verify] setCanBulkMove:NO localPasswordsCount:2]; } }
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_view_controller.mm b/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_view_controller.mm index 9f19c887..672b575 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_view_controller.mm +++ b/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_view_controller.mm
@@ -190,11 +190,11 @@ @property(nonatomic, assign) BOOL automaticPasskeyUpgradesEnabled; // Indicates whether or not "Offer to Save Passwords" is set to enabled. -@property(nonatomic, assign, getter=isSavePasswordsEnabled) - BOOL savePasswordsEnabled; +@property(nonatomic, assign, getter=isSavingPasswordsEnabled) + BOOL savingPasswordsEnabled; // Whether saving passkeys is enabled. -@property(nonatomic, assign) BOOL savePasskeysEnabled; +@property(nonatomic, assign) BOOL savingPasskeysEnabled; // The amount of local passwords present on device. @property(nonatomic, assign) int localPasswordsCount; @@ -203,8 +203,8 @@ // be shown. @property(nonatomic, assign) BOOL showBulkMovePasswordsToAccount; -// Indicates the signed in account. -@property(nonatomic, copy) NSString* signedInAccount; +// Indicates the email of the signed in account. +@property(nonatomic, copy) NSString* userEmail; // On-device encryption state according to the sync service. @property(nonatomic, assign) @@ -596,7 +596,7 @@ IDS_IOS_PASSWORD_SETTINGS_BULK_UPLOAD_PASSWORDS_SECTION_DESCRIPTION); std::u16string result = base::i18n::MessageFormatter::FormatWithNamedArgs( pattern, "COUNT", self.localPasswordsCount, "EMAIL", - base::SysNSStringToUTF16(self.signedInAccount)); + base::SysNSStringToUTF16(self.userEmail)); _bulkMovePasswordsToAccountDescriptionItem.detailText = base::SysUTF16ToNSString(result); @@ -801,32 +801,15 @@ #pragma mark - PasswordSettingsConsumer -// The `setCanExportPasswords` method required for the PasswordSettingsConsumer -// protocol is provided by property synthesis. - -- (void)setAutomaticPasskeyUpgradesEnabled:(BOOL)enabled { - if (_automaticPasskeyUpgradesEnabled == enabled) { - return; - } - - _automaticPasskeyUpgradesEnabled = enabled; - - if (self.modelLoadStatus == ModelNotLoaded) { - return; - } - - [self updateAutomaticPasskeyUpgradesSwitch]; -} - -- (void)setSavePasswordsEnabled:(BOOL)enabled - managedByPolicy:(BOOL)managedByPolicy { - BOOL enabledChanged = _savePasswordsEnabled != enabled; +- (void)setSavingPasswordsEnabled:(BOOL)enabled + managedByPolicy:(BOOL)managedByPolicy { + BOOL enabledChanged = _savingPasswordsEnabled != enabled; BOOL managedChanged = _managedByPolicy != managedByPolicy; if (!enabledChanged && !managedChanged) { return; } - _savePasswordsEnabled = enabled; + _savingPasswordsEnabled = enabled; _managedByPolicy = managedByPolicy; if (self.modelLoadStatus == ModelNotLoaded) { @@ -855,23 +838,44 @@ [self updateAutomaticPasskeyUpgradesSwitch]; } -- (void)setSavePasskeysEnabled:(BOOL)enabled { - if (_savePasskeysEnabled == enabled) { +- (void)setAutomaticPasskeyUpgradesEnabled:(BOOL)enabled { + if (_automaticPasskeyUpgradesEnabled == enabled) { return; } - _savePasskeysEnabled = enabled; - - if (self.modelLoadStatus == ModelNotLoaded) { - return; - } - + _automaticPasskeyUpgradesEnabled = enabled; [self updateAutomaticPasskeyUpgradesSwitch]; } -- (void)setLocalPasswordsCount:(int)count - withUserEligibility:(BOOL)eligibility { - BOOL showSection = count > 0 && eligibility; +- (void)setSavingPasskeysEnabled:(BOOL)enabled { + if (_savingPasskeysEnabled == enabled) { + return; + } + + _savingPasskeysEnabled = enabled; + [self updateAutomaticPasskeyUpgradesSwitch]; +} + +- (void)setCanDeleteAllCredentials:(BOOL)canDeleteAllCredentials { + if (_canDeleteAllCredentials == canDeleteAllCredentials) { + return; + } + + _canDeleteAllCredentials = canDeleteAllCredentials; + [self updateDeleteAllCredentialsSection]; +} + +- (void)setCanExportPasswords:(BOOL)canExportPasswords { + if (_canExportPasswords == canExportPasswords) { + return; + } + + _canExportPasswords = canExportPasswords; + [self updateExportPasswordsButton]; +} + +- (void)setCanBulkMove:(BOOL)canBulkMove localPasswordsCount:(int)count { + BOOL showSection = count > 0 && canBulkMove; if (_localPasswordsCount == count && _showBulkMovePasswordsToAccount == showSection) { @@ -917,56 +921,6 @@ [self updateOnDeviceEncryptionSectionWithOldState:oldState]; } -- (void)updateDeleteAllCredentialsSection { - if (self.modelLoadStatus == ModelNotLoaded || - !base::FeatureList::IsEnabled( - password_manager::features::kIOSEnableDeleteAllSavedCredentials)) { - return; - } - if (self.canDeleteAllCredentials) { - _deleteCredentialsItem.textColor = [UIColor colorNamed:kRedColor]; - _deleteCredentialsItem.accessibilityTraits &= - ~UIAccessibilityTraitNotEnabled; - - _deleteCredentialsFooterItem.text = l10n_util::GetNSString( - IDS_IOS_PASSWORD_SETTINGS_CREDENTIAL_DELETION_TEXT); - } else { - // Disable, rather than remove, because the button will go back and forth - // between enabled/disabled status as the flow progresses. - _deleteCredentialsItem.textColor = [UIColor colorNamed:kTextSecondaryColor]; - _deleteCredentialsItem.accessibilityTraits |= - UIAccessibilityTraitNotEnabled; - - _deleteCredentialsFooterItem.text = l10n_util::GetNSString( - IDS_IOS_PASSWORD_SETTINGS_NO_CREDENTIAL_DELETION_TEXT); - } - - NSIndexSet* section = [NSIndexSet - indexSetWithIndex:[self.tableViewModel - sectionForSectionIdentifier: - SectionIdentifierDeleteCredentialsButton]]; - [self.tableView reloadSections:section - withRowAnimation:UITableViewRowAnimationAutomatic]; -} - -- (void)updateExportPasswordsButton { - // This can be invoked before the item is ready when passwords are received - // too early. - if (self.modelLoadStatus == ModelNotLoaded) { - return; - } - if (self.canExportPasswords) { - _exportPasswordsItem.textColor = [UIColor colorNamed:kBlueColor]; - _exportPasswordsItem.accessibilityTraits &= ~UIAccessibilityTraitNotEnabled; - } else { - // Disable, rather than remove, because the button will go back and forth - // between enabled/disabled status as the flow progresses. - _exportPasswordsItem.textColor = [UIColor colorNamed:kTextSecondaryColor]; - _exportPasswordsItem.accessibilityTraits |= UIAccessibilityTraitNotEnabled; - } - [self reconfigureCellsForItems:@[ _exportPasswordsItem ]]; -} - - (void)setupChangeGPMPinButton { _shouldSetupChangePinButton = YES; if (self.modelLoadStatus == ModelNotLoaded) { @@ -1029,15 +983,16 @@ // current state of `isSavePasswordEnabled`. - (void)updateManagedSavePasswordsItem { self.managedSavePasswordsItem.statusText = - self.isSavePasswordsEnabled ? l10n_util::GetNSString(IDS_IOS_SETTING_ON) - : l10n_util::GetNSString(IDS_IOS_SETTING_OFF); + self.isSavingPasswordsEnabled + ? l10n_util::GetNSString(IDS_IOS_SETTING_ON) + : l10n_util::GetNSString(IDS_IOS_SETTING_OFF); [self reconfigureCellsForItems:@[ self.managedSavePasswordsItem ]]; } // Updates the appearance of the Save Passwords switch to reflect the current // state of `isSavePasswordEnabled`. - (void)updateSavePasswordsSwitch { - self.savePasswordsItem.on = self.isSavePasswordsEnabled; + self.savePasswordsItem.on = self.isSavingPasswordsEnabled; if (self.modelLoadStatus != ModelLoadComplete) { return; @@ -1424,8 +1379,60 @@ // Automatic passkey upgrades switch should be displayed if the feature is // enabled and both saving passkeys and password setting is enabled. - (BOOL)shouldDisplayPasskeyUpgradesSwitch { - return AutomaticPasskeyUpgradeFeatureEnabled() && _savePasswordsEnabled && - _savePasskeysEnabled; + return AutomaticPasskeyUpgradeFeatureEnabled() && _savingPasswordsEnabled && + _savingPasskeysEnabled; +} + +- (void)updateDeleteAllCredentialsSection { + if (self.modelLoadStatus == ModelNotLoaded || + !base::FeatureList::IsEnabled( + password_manager::features::kIOSEnableDeleteAllSavedCredentials)) { + return; + } + + if (self.canDeleteAllCredentials) { + _deleteCredentialsItem.textColor = [UIColor colorNamed:kRedColor]; + _deleteCredentialsItem.accessibilityTraits &= + ~UIAccessibilityTraitNotEnabled; + + _deleteCredentialsFooterItem.text = l10n_util::GetNSString( + IDS_IOS_PASSWORD_SETTINGS_CREDENTIAL_DELETION_TEXT); + } else { + // Disable, rather than remove, because the button will go back and forth + // between enabled/disabled status as the flow progresses. + _deleteCredentialsItem.textColor = [UIColor colorNamed:kTextSecondaryColor]; + _deleteCredentialsItem.accessibilityTraits |= + UIAccessibilityTraitNotEnabled; + + _deleteCredentialsFooterItem.text = l10n_util::GetNSString( + IDS_IOS_PASSWORD_SETTINGS_NO_CREDENTIAL_DELETION_TEXT); + } + + NSIndexSet* section = [NSIndexSet + indexSetWithIndex:[self.tableViewModel + sectionForSectionIdentifier: + SectionIdentifierDeleteCredentialsButton]]; + [self.tableView reloadSections:section + withRowAnimation:UITableViewRowAnimationAutomatic]; +} + +- (void)updateExportPasswordsButton { + // This can be invoked before the item is ready when passwords are received + // too early. + if (self.modelLoadStatus == ModelNotLoaded) { + return; + } + + if (self.canExportPasswords) { + _exportPasswordsItem.textColor = [UIColor colorNamed:kBlueColor]; + _exportPasswordsItem.accessibilityTraits &= ~UIAccessibilityTraitNotEnabled; + } else { + // Disable, rather than remove, because the button will go back and forth + // between enabled/disabled status as the flow progresses. + _exportPasswordsItem.textColor = [UIColor colorNamed:kTextSecondaryColor]; + _exportPasswordsItem.accessibilityTraits |= UIAccessibilityTraitNotEnabled; + } + [self reconfigureCellsForItems:@[ _exportPasswordsItem ]]; } @end
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_view_controller_unittest.mm b/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_view_controller_unittest.mm index 84b7a00..b431a78 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_view_controller_unittest.mm +++ b/ios/chrome/browser/settings/ui_bundled/password/password_settings/password_settings_view_controller_unittest.mm
@@ -101,7 +101,7 @@ TEST_F(PasswordSettingsViewControllerTest, DisplaysOfferToSavePasswordsManagedByPolicy) { - [controller() setSavePasswordsEnabled:NO managedByPolicy:YES]; + [controller() setSavingPasswordsEnabled:NO managedByPolicy:YES]; TableViewInfoButtonItem* managedSavePasswordsItem = static_cast<TableViewInfoButtonItem*>(GetTableViewItem(/*section=*/0, 0)); EXPECT_NSEQ(managedSavePasswordsItem.text, @@ -110,7 +110,7 @@ TEST_F(PasswordSettingsViewControllerTest, DisplaysMovePasswordsToAccountButtonWithLocalPasswords) { - [controller() setLocalPasswordsCount:2 withUserEligibility:YES]; + [controller() setCanBulkMove:YES localPasswordsCount:2]; TableViewDetailTextItem* movePasswordsToAccountDescriptionItem = static_cast<TableViewDetailTextItem*>( @@ -257,8 +257,8 @@ // Re-create the controller so that the enabled flag is picked up. CreateController(); - [controller() setSavePasswordsEnabled:YES managedByPolicy:NO]; - [controller() setSavePasskeysEnabled:YES]; + [controller() setSavingPasswordsEnabled:YES managedByPolicy:NO]; + [controller() setSavingPasskeysEnabled:YES]; TableViewSwitchItem* automaticPasskeyUpgradesSwitch = static_cast<TableViewSwitchItem*>( @@ -359,7 +359,6 @@ TEST_F(PasswordSettingsViewControllerTest, ExportButtonDisabledWhenUserNotEligible) { [controller() setCanExportPasswords:NO]; - [controller() updateExportPasswordsButton]; EXPECT_TRUE(GetTableViewItem(ExpectedSectionAfterAlwaysVisibleTopSections(), /*item=*/0) .accessibilityTraits & @@ -369,7 +368,6 @@ TEST_F(PasswordSettingsViewControllerTest, ExportButtonEnabledWhenUserEligible) { [controller() setCanExportPasswords:YES]; - [controller() updateExportPasswordsButton]; EXPECT_FALSE(GetTableViewItem(ExpectedSectionAfterAlwaysVisibleTopSections(), /*item=*/0) .accessibilityTraits & @@ -385,7 +383,6 @@ // Re-create the controller so that the enabled flag is picked up. CreateController(); [controller() setCanDeleteAllCredentials:NO]; - [controller() updateDeleteAllCredentialsSection]; EXPECT_TRUE( GetTableViewItem(ExpectedSectionAfterAlwaysVisibleTopSections() + 1, /*item=*/0) @@ -402,7 +399,6 @@ // Re-create the controller so that the enabled flag is picked up. CreateController(); [controller() setCanDeleteAllCredentials:YES]; - [controller() updateDeleteAllCredentialsSection]; EXPECT_FALSE( GetTableViewItem(ExpectedSectionAfterAlwaysVisibleTopSections() + 1, /*item=*/0)
diff --git a/ios/chrome/browser/shared/public/features/features.mm b/ios/chrome/browser/shared/public/features/features.mm index f9e31755..addf910f 100644 --- a/ios/chrome/browser/shared/public/features/features.mm +++ b/ios/chrome/browser/shared/public/features/features.mm
@@ -241,11 +241,11 @@ BASE_FEATURE(kLensOverlayEnableLocationBarEntrypoint, "LensOverlayEnableLocationBarEntrypoint", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kLensOverlayEnableLocationBarEntrypointOnSRP, "LensOverlayEnableLocationBarEntrypointOnSRP", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kLensOverlayEnableSameTabNavigation, "EnableLensOverlaySameTabNavigation",
diff --git a/ios/chrome/test/earl_grey/BUILD.gn b/ios/chrome/test/earl_grey/BUILD.gn index 1167094..c23794f1 100644 --- a/ios/chrome/test/earl_grey/BUILD.gn +++ b/ios/chrome/test/earl_grey/BUILD.gn
@@ -92,6 +92,7 @@ "//components/content_settings/core/browser", "//components/feature_engagement/public", "//components/metrics/demographics", + "//components/metrics/dwa", "//components/password_manager/core/common", "//components/prefs", "//components/safe_browsing/core/common",
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.h b/ios/chrome/test/earl_grey/chrome_earl_grey.h index 89a37c0..683a9971d 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey.h +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.h
@@ -730,6 +730,9 @@ // Returns YES if UKM feature is enabled. - (BOOL)isUKMEnabled [[nodiscard]]; +// Returns YES if DWA feature is enabled. +- (BOOL)isDWAEnabled [[nodiscard]]; + // Returns YES if kTestFeature is enabled. - (BOOL)isTestFeatureEnabled;
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.mm b/ios/chrome/test/earl_grey/chrome_earl_grey.mm index 7e58b40..8994bd0 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey.mm +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.mm
@@ -1372,6 +1372,10 @@ return [ChromeEarlGreyAppInterface isUKMEnabled]; } +- (BOOL)isDWAEnabled { + return [ChromeEarlGreyAppInterface isDWAEnabled]; +} + - (BOOL)isTestFeatureEnabled { return [ChromeEarlGreyAppInterface isTestFeatureEnabled]; }
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.h b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.h index b6f22cd6..36a7316 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.h +++ b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.h
@@ -528,6 +528,9 @@ // Returns YES if kTestFeature is enabled. + (BOOL)isTestFeatureEnabled; +// Returns YES if DWA feature is enabled. ++ (BOOL)isDWAEnabled [[nodiscard]]; + // Returns YES if DemographicMetricsReporting feature is enabled. + (BOOL)isDemographicMetricsReportingEnabled [[nodiscard]];
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 3c15dce..fe9043d 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
@@ -24,6 +24,7 @@ #import "components/browsing_data/core/pref_names.h" #import "components/content_settings/core/browser/host_content_settings_map.h" #import "components/metrics/demographics/demographic_metrics_provider.h" +#import "components/metrics/dwa/dwa_recorder.h" #import "components/password_manager/core/common/password_manager_features.h" #import "components/prefs/pref_service.h" #import "components/safe_browsing/core/common/features.h" @@ -1175,6 +1176,10 @@ return base::FeatureList::IsEnabled(ukm::kUkmFeature); } ++ (BOOL)isDWAEnabled { + return base::FeatureList::IsEnabled(metrics::dwa::kDwaFeature); +} + + (BOOL)isTestFeatureEnabled { return base::FeatureList::IsEnabled(kTestFeature); }
diff --git a/ios/components/security_interstitials/safe_browsing/safe_browsing_tab_helper.mm b/ios/components/security_interstitials/safe_browsing/safe_browsing_tab_helper.mm index dc51367e..cb269deb 100644 --- a/ios/components/security_interstitials/safe_browsing/safe_browsing_tab_helper.mm +++ b/ios/components/security_interstitials/safe_browsing/safe_browsing_tab_helper.mm
@@ -183,14 +183,11 @@ } void SafeBrowsingTabHelper::PolicyDecider::SetCommittedRedirectChain() { - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - committed_redirect_chain_.clear(); - for (auto& query : to_be_committed_redirect_chain_) { - committed_redirect_chain_.push_back(std::move(query)); - } - to_be_committed_redirect_chain_.clear(); + committed_redirect_chain_.clear(); + for (auto& query : to_be_committed_redirect_chain_) { + committed_redirect_chain_.push_back(std::move(query)); } + to_be_committed_redirect_chain_.clear(); } void SafeBrowsingTabHelper::PolicyDecider::ReloadPage() { @@ -352,17 +349,12 @@ web::WebStatePolicyDecider::PolicyDecision::Allow()); } - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - if (!pending_main_frame_query_) { - base::UmaHistogramBoolean("SafeBrowsing.IOS.RepeatedResponseCalled", - true); - return std::move(callback).Run( - web::WebStatePolicyDecider::PolicyDecision::Allow()); - } - } else { - DCHECK(pending_main_frame_query_); + if (!pending_main_frame_query_) { + base::UmaHistogramBoolean("SafeBrowsing.IOS.RepeatedResponseCalled", true); + return std::move(callback).Run( + web::WebStatePolicyDecider::PolicyDecision::Allow()); } + base::UmaHistogramBoolean("SafeBrowsing.IOS.RepeatedResponseCalled", false); // When there's a server redirect, a ShouldAllowRequest call sometimes @@ -385,16 +377,11 @@ pending_main_frame_redirect_chain_.clear(); } - std::optional<web::WebStatePolicyDecider::PolicyDecision> decision; - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - // Logic only needs to check if sync queries in the redirect chain are - // completed since async queries can respond after navigation. - decision = RedirectChainDecisionWithFilter( - RedirectChain::kPendingMainFrame, RedirectChainFilter::kSyncQueries); - } else { - decision = MainFrameRedirectChainDecision(); - } + // Logic only needs to check if sync queries in the redirect chain are + // completed since async queries can respond after navigation. + std::optional<web::WebStatePolicyDecider::PolicyDecision> decision = + RedirectChainDecisionWithFilter(RedirectChain::kPendingMainFrame, + RedirectChainFilter::kSyncQueries); if (decision) { RecordCheckCompletedOnResponseMetric(/*check_completed=*/true); @@ -756,17 +743,14 @@ } void SafeBrowsingTabHelper::PolicyDecider::UpdateToBeCommittedRedirectChain() { - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - to_be_committed_redirect_chain_.clear(); - to_be_committed_redirect_chain_.push_back( - std::move(*pending_main_frame_query_)); - pending_main_frame_query_.reset(); - for (auto& query : pending_main_frame_redirect_chain_) { - to_be_committed_redirect_chain_.push_back(std::move(query)); - } - pending_main_frame_redirect_chain_.clear(); + to_be_committed_redirect_chain_.clear(); + to_be_committed_redirect_chain_.push_back( + std::move(*pending_main_frame_query_)); + pending_main_frame_query_.reset(); + for (auto& query : pending_main_frame_redirect_chain_) { + to_be_committed_redirect_chain_.push_back(std::move(query)); } + pending_main_frame_redirect_chain_.clear(); } #pragma mark SafeBrowsingTabHelper::PolicyDecider::MainFrameUrlQuery
diff --git a/ios/components/security_interstitials/safe_browsing/safe_browsing_tab_helper_unittest.mm b/ios/components/security_interstitials/safe_browsing/safe_browsing_tab_helper_unittest.mm index a6bf3c857..ef351b5d 100644 --- a/ios/components/security_interstitials/safe_browsing/safe_browsing_tab_helper_unittest.mm +++ b/ios/components/security_interstitials/safe_browsing/safe_browsing_tab_helper_unittest.mm
@@ -43,10 +43,6 @@ SafeBrowsingTabHelperTest() : browser_state_(std::make_unique<web::FakeBrowserState>()), client_(/*pref_service=*/nullptr) { - use_async_safe_browsing_ = IsAsyncEnabled(); - scoped_feature_list_.InitWithFeatureState( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck, - use_async_safe_browsing_); SafeBrowsingQueryManager::CreateForWebState(&web_state_, &client_); SafeBrowsingTabHelper::CreateForWebState(&web_state_, &client_); SafeBrowsingUrlAllowList::CreateForWebState(&web_state_); @@ -57,15 +53,6 @@ web_state_.SetBrowserState(browser_state_.get()); } - // Converts testing paramater to a boolean which represents if the feature - // should be enabled or disabled for test run. - bool IsAsyncEnabled() { - return GetParam() == SafeBrowsingDecisionTimingWithAsync:: - kBeforeResponseAsyncEnabled || - GetParam() == - SafeBrowsingDecisionTimingWithAsync::kAfterResponseAsyncEnabled; - } - // Whether Safe Browsing decisions arrive before calls to // ShouldAllowResponseUrl(). bool SafeBrowsingDecisionArrivesBeforeResponse() const { @@ -169,17 +156,14 @@ // Helper function to run all sync callbacks first then async callbacks. void RunSyncCallbacksThenAsyncCallbacks() { - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - base::SequencedTaskRunner::GetCurrentDefault()->PostTask( - FROM_HERE, base::BindOnce(^() { - client_.run_sync_callbacks(); - })); - base::SequencedTaskRunner::GetCurrentDefault()->PostTask( - FROM_HERE, base::BindOnce(^() { - client_.run_async_callbacks(); - })); - } + base::SequencedTaskRunner::GetCurrentDefault()->PostTask( + FROM_HERE, base::BindOnce(^() { + client_.run_sync_callbacks(); + })); + base::SequencedTaskRunner::GetCurrentDefault()->PostTask( + FROM_HERE, base::BindOnce(^() { + client_.run_async_callbacks(); + })); // TODO(crbug.com/359420122): Remove when clean up is complete. if (SafeBrowsingDecisionArrivesBeforeResponse()) { @@ -193,8 +177,6 @@ web::FakeWebState web_state_; raw_ptr<web::FakeNavigationManager> navigation_manager_ = nullptr; FakeSafeBrowsingClient client_; - bool use_async_safe_browsing_; - base::test::ScopedFeatureList scoped_feature_list_; }; // Tests the case of a single navigation request and response, for a URL that is @@ -212,16 +194,13 @@ // Tests the case of a single navigation request and response, for a URL that is // safe where the async query completes before the sync query. TEST_P(SafeBrowsingTabHelperTest, SingleSafeRequestAndResponseAsyncQueryFirst) { - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - GURL url("http://chromium.test"); - EXPECT_TRUE(ShouldAllowRequestUrl(url).ShouldAllowNavigation()); - RunAsyncCallbacksThenSyncCallbacks(); + GURL url("http://chromium.test"); + EXPECT_TRUE(ShouldAllowRequestUrl(url).ShouldAllowNavigation()); + RunAsyncCallbacksThenSyncCallbacks(); - web::WebStatePolicyDecider::PolicyDecision response_decision = - ShouldAllowResponseUrl(url); - EXPECT_TRUE(response_decision.ShouldAllowNavigation()); - } + web::WebStatePolicyDecider::PolicyDecision response_decision = + ShouldAllowResponseUrl(url); + EXPECT_TRUE(response_decision.ShouldAllowNavigation()); } // Tests the case of a single navigation request and response, for a URL that is @@ -240,16 +219,13 @@ // unsafe where the async query is completed before the sync query. TEST_P(SafeBrowsingTabHelperTest, SingleUnsafeRequestAndResponseAsyncQueryFirst) { - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - GURL url("http://" + FakeSafeBrowsingService::kUnsafeHost); - EXPECT_TRUE(ShouldAllowRequestUrl(url).ShouldAllowNavigation()); - RunAsyncCallbacksThenSyncCallbacks(); + GURL url("http://" + FakeSafeBrowsingService::kUnsafeHost); + EXPECT_TRUE(ShouldAllowRequestUrl(url).ShouldAllowNavigation()); + RunAsyncCallbacksThenSyncCallbacks(); - web::WebStatePolicyDecider::PolicyDecision response_decision = - ShouldAllowResponseUrl(url); - EXPECT_TRUE(response_decision.ShouldCancelNavigation()); - } + web::WebStatePolicyDecider::PolicyDecision response_decision = + ShouldAllowResponseUrl(url); + EXPECT_TRUE(response_decision.ShouldCancelNavigation()); } // Tests the case of a single safe navigation where the response URL has a @@ -442,26 +418,23 @@ // in the chain is found as unsafe from sync queries and the rest are safe. TEST_P(SafeBrowsingTabHelperTest, RedirectChainFirstRequestUnsafeWithAsyncChecks) { - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - GURL url1("http://" + FakeSafeBrowsingService::kUnsafeHost); - GURL url2("http://chromium2.test"); - GURL url3("http://chromium3.test"); - EXPECT_TRUE(ShouldAllowRequestUrl(url1).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); + GURL url1("http://" + FakeSafeBrowsingService::kUnsafeHost); + GURL url2("http://chromium2.test"); + GURL url3("http://chromium3.test"); + EXPECT_TRUE(ShouldAllowRequestUrl(url1).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); - EXPECT_TRUE(ShouldAllowRequestUrl(url2).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); - SimulateMainFrameRedirect(); + EXPECT_TRUE(ShouldAllowRequestUrl(url2).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); + SimulateMainFrameRedirect(); - EXPECT_TRUE(ShouldAllowRequestUrl(url3).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); - SimulateMainFrameRedirect(); + EXPECT_TRUE(ShouldAllowRequestUrl(url3).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); + SimulateMainFrameRedirect(); - web::WebStatePolicyDecider::PolicyDecision response_decision = - ShouldAllowResponseUrl(url3); - EXPECT_TRUE(response_decision.ShouldCancelNavigation()); - } + web::WebStatePolicyDecider::PolicyDecision response_decision = + ShouldAllowResponseUrl(url3); + EXPECT_TRUE(response_decision.ShouldCancelNavigation()); } // Tests the case of a redirection chain, where the middle URL in the chain is @@ -490,27 +463,24 @@ // in the chain is found as unsafe from sync queries and the rest are safe. TEST_P(SafeBrowsingTabHelperTest, RedirectChainMiddleRequestUnsafeWithAsyncCheck) { - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - GURL url1("http://chromium1.test"); - GURL url2("http://" + FakeSafeBrowsingService::kUnsafeHost); - GURL url3("http://chromium3.test"); - EXPECT_TRUE(ShouldAllowRequestUrl(url1).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); + GURL url1("http://chromium1.test"); + GURL url2("http://" + FakeSafeBrowsingService::kUnsafeHost); + GURL url3("http://chromium3.test"); + EXPECT_TRUE(ShouldAllowRequestUrl(url1).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); - EXPECT_TRUE(ShouldAllowRequestUrl(url2).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); - SimulateMainFrameRedirect(); + EXPECT_TRUE(ShouldAllowRequestUrl(url2).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); + SimulateMainFrameRedirect(); - EXPECT_TRUE(ShouldAllowRequestUrl(url3).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); + EXPECT_TRUE(ShouldAllowRequestUrl(url3).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); - SimulateMainFrameRedirect(); + SimulateMainFrameRedirect(); - web::WebStatePolicyDecider::PolicyDecision response_decision = - ShouldAllowResponseUrl(url3); - EXPECT_TRUE(response_decision.ShouldCancelNavigation()); - } + web::WebStatePolicyDecider::PolicyDecision response_decision = + ShouldAllowResponseUrl(url3); + EXPECT_TRUE(response_decision.ShouldCancelNavigation()); } // Tests the case of a redirection chain, where the final URL in the chain is @@ -539,26 +509,23 @@ // in the chain is found as unsafe from sync queries and the rest are safe. TEST_P(SafeBrowsingTabHelperTest, RedirectChainFinalRequestUnsafeWithAsyncCheck) { - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - GURL url1("http://chromium1.test"); - GURL url2("http://chromium3.test"); - GURL url3("http://" + FakeSafeBrowsingService::kUnsafeHost); - EXPECT_TRUE(ShouldAllowRequestUrl(url1).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); + GURL url1("http://chromium1.test"); + GURL url2("http://chromium3.test"); + GURL url3("http://" + FakeSafeBrowsingService::kUnsafeHost); + EXPECT_TRUE(ShouldAllowRequestUrl(url1).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); - EXPECT_TRUE(ShouldAllowRequestUrl(url2).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); - SimulateMainFrameRedirect(); + EXPECT_TRUE(ShouldAllowRequestUrl(url2).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); + SimulateMainFrameRedirect(); - EXPECT_TRUE(ShouldAllowRequestUrl(url3).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); - SimulateMainFrameRedirect(); + EXPECT_TRUE(ShouldAllowRequestUrl(url3).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); + SimulateMainFrameRedirect(); - web::WebStatePolicyDecider::PolicyDecision response_decision = - ShouldAllowResponseUrl(url3); - EXPECT_TRUE(response_decision.ShouldCancelNavigation()); - } + web::WebStatePolicyDecider::PolicyDecision response_decision = + ShouldAllowResponseUrl(url3); + EXPECT_TRUE(response_decision.ShouldCancelNavigation()); } // Tests the case of a redirection chain, where the all URLs in the chain are @@ -587,26 +554,23 @@ // the chain are found as unsafe from sync queries. TEST_P(SafeBrowsingTabHelperTest, RedirectChainAllRequestsUnsafeWithAsyncCheck) { - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - GURL url1("http://" + FakeSafeBrowsingService::kUnsafeHost + "/1"); - GURL url2("http://" + FakeSafeBrowsingService::kUnsafeHost + "/2"); - GURL url3("http://" + FakeSafeBrowsingService::kUnsafeHost + "/3"); - EXPECT_TRUE(ShouldAllowRequestUrl(url1).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); + GURL url1("http://" + FakeSafeBrowsingService::kUnsafeHost + "/1"); + GURL url2("http://" + FakeSafeBrowsingService::kUnsafeHost + "/2"); + GURL url3("http://" + FakeSafeBrowsingService::kUnsafeHost + "/3"); + EXPECT_TRUE(ShouldAllowRequestUrl(url1).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); - EXPECT_TRUE(ShouldAllowRequestUrl(url2).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); - SimulateMainFrameRedirect(); + EXPECT_TRUE(ShouldAllowRequestUrl(url2).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); + SimulateMainFrameRedirect(); - EXPECT_TRUE(ShouldAllowRequestUrl(url3).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); - SimulateMainFrameRedirect(); + EXPECT_TRUE(ShouldAllowRequestUrl(url3).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); + SimulateMainFrameRedirect(); - web::WebStatePolicyDecider::PolicyDecision response_decision = - ShouldAllowResponseUrl(url3); - EXPECT_TRUE(response_decision.ShouldCancelNavigation()); - } + web::WebStatePolicyDecider::PolicyDecision response_decision = + ShouldAllowResponseUrl(url3); + EXPECT_TRUE(response_decision.ShouldCancelNavigation()); } // Tests that when there are consecutive requests without a redirect, the @@ -658,27 +622,24 @@ // interrupted by an unrelated request. TEST_P(SafeBrowsingTabHelperTest, InterruptedUnsafeRedirectChainWithAsyncCheck) { - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - GURL url1("http://" + FakeSafeBrowsingService::kUnsafeHost + "/1"); - GURL url2("http://" + FakeSafeBrowsingService::kUnsafeHost + "/2"); - GURL url3("http://chromium3.test"); - EXPECT_TRUE(ShouldAllowRequestUrl(url1).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); + GURL url1("http://" + FakeSafeBrowsingService::kUnsafeHost + "/1"); + GURL url2("http://" + FakeSafeBrowsingService::kUnsafeHost + "/2"); + GURL url3("http://chromium3.test"); + EXPECT_TRUE(ShouldAllowRequestUrl(url1).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); - EXPECT_TRUE(ShouldAllowRequestUrl(url2).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); - SimulateMainFrameRedirect(); + EXPECT_TRUE(ShouldAllowRequestUrl(url2).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); + SimulateMainFrameRedirect(); - // Interrupt the redirection chain with a brand new unrelated query. This - // should be treated as safe. - EXPECT_TRUE(ShouldAllowRequestUrl(url3).ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); + // Interrupt the redirection chain with a brand new unrelated query. This + // should be treated as safe. + EXPECT_TRUE(ShouldAllowRequestUrl(url3).ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); - web::WebStatePolicyDecider::PolicyDecision response_decision = - ShouldAllowResponseUrl(url3); - EXPECT_TRUE(response_decision.ShouldAllowNavigation()); - } + web::WebStatePolicyDecider::PolicyDecision response_decision = + ShouldAllowResponseUrl(url3); + EXPECT_TRUE(response_decision.ShouldAllowNavigation()); } // Tests the case of a redirection chain where a safe URL redirects to itself. @@ -836,45 +797,41 @@ // reloads the page. TEST_P(SafeBrowsingTabHelperTest, UnsafeCommittedRedirectChainReloadAndResponse) { - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - GURL url("http://" + FakeSafeBrowsingService::kAsyncUnsafeHost); - ASSERT_FALSE(navigation_manager_->ReloadWasCalled()); - EXPECT_TRUE(ShouldAllowRequestUrl(url).ShouldAllowNavigation()); - base::SequencedTaskRunner::GetCurrentDefault()->PostTask( - FROM_HERE, base::BindOnce(^() { - client_.run_sync_callbacks(); - })); + GURL url("http://" + FakeSafeBrowsingService::kAsyncUnsafeHost); + ASSERT_FALSE(navigation_manager_->ReloadWasCalled()); + EXPECT_TRUE(ShouldAllowRequestUrl(url).ShouldAllowNavigation()); + base::SequencedTaskRunner::GetCurrentDefault()->PostTask( + FROM_HERE, base::BindOnce(^() { + client_.run_sync_callbacks(); + })); - // TODO(crbug.com/359420122): Remove when clean up is complete. - if (SafeBrowsingDecisionArrivesBeforeResponse()) { - base::RunLoop().RunUntilIdle(); - } - - web::WebStatePolicyDecider::PolicyDecision response_decision = - ShouldAllowResponseUrl(url); - EXPECT_TRUE(response_decision.ShouldAllowNavigation()); - - // Simulate page loading and navigation being finished. - web::FakeNavigationContext context; - context.SetHasCommitted(true); - web_state_.OnNavigationFinished(&context); - - client_.run_async_callbacks(); - // TODO(crbug.com/359420122): Remove when clean up is complete. + // TODO(crbug.com/359420122): Remove when clean up is complete. + if (SafeBrowsingDecisionArrivesBeforeResponse()) { base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(navigation_manager_->ReloadWasCalled()); - - // Simulate forced reload and triggers blocking page logic. - auto main_frame_reload_request_decision = - ShouldAllowRequestUrl(url, /*for_main_frame=*/true, - ui::PageTransition::PAGE_TRANSITION_RELOAD); - EXPECT_TRUE(main_frame_reload_request_decision.ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); - auto main_frame_reload_response_decision = ShouldAllowResponseUrl(url); - EXPECT_TRUE(main_frame_reload_response_decision.ShouldCancelNavigation()); - EXPECT_TRUE(main_frame_reload_response_decision.ShouldDisplayError()); } + + web::WebStatePolicyDecider::PolicyDecision response_decision = + ShouldAllowResponseUrl(url); + EXPECT_TRUE(response_decision.ShouldAllowNavigation()); + + // Simulate page loading and navigation being finished. + web::FakeNavigationContext context; + context.SetHasCommitted(true); + web_state_.OnNavigationFinished(&context); + + client_.run_async_callbacks(); + // TODO(crbug.com/359420122): Remove when clean up is complete. + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(navigation_manager_->ReloadWasCalled()); + + // Simulate forced reload and triggers blocking page logic. + auto main_frame_reload_request_decision = ShouldAllowRequestUrl( + url, /*for_main_frame=*/true, ui::PageTransition::PAGE_TRANSITION_RELOAD); + EXPECT_TRUE(main_frame_reload_request_decision.ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); + auto main_frame_reload_response_decision = ShouldAllowResponseUrl(url); + EXPECT_TRUE(main_frame_reload_response_decision.ShouldCancelNavigation()); + EXPECT_TRUE(main_frame_reload_response_decision.ShouldDisplayError()); } // Tests sync check and ShouldAllowResponse() complete, and async @@ -882,45 +839,41 @@ // the navigation to go through and reloads when the page commits. TEST_P(SafeBrowsingTabHelperTest, UnsafeToBeCommittedRedirectChainReloadAndResponse) { - if (base::FeatureList::IsEnabled( - safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) { - GURL url("http://" + FakeSafeBrowsingService::kAsyncUnsafeHost); - ASSERT_FALSE(navigation_manager_->ReloadWasCalled()); - EXPECT_TRUE(ShouldAllowRequestUrl(url).ShouldAllowNavigation()); - base::SequencedTaskRunner::GetCurrentDefault()->PostTask( - FROM_HERE, base::BindOnce(^() { - client_.run_sync_callbacks(); - })); + GURL url("http://" + FakeSafeBrowsingService::kAsyncUnsafeHost); + ASSERT_FALSE(navigation_manager_->ReloadWasCalled()); + EXPECT_TRUE(ShouldAllowRequestUrl(url).ShouldAllowNavigation()); + base::SequencedTaskRunner::GetCurrentDefault()->PostTask( + FROM_HERE, base::BindOnce(^() { + client_.run_sync_callbacks(); + })); - // TODO(crbug.com/359420122): Remove when clean up is complete. - if (SafeBrowsingDecisionArrivesBeforeResponse()) { - base::RunLoop().RunUntilIdle(); - } - web::WebStatePolicyDecider::PolicyDecision response_decision = - ShouldAllowResponseUrl(url); - EXPECT_TRUE(response_decision.ShouldAllowNavigation()); - - client_.run_async_callbacks(); - // TODO(crbug.com/359420122): Remove when clean up is complete. + // TODO(crbug.com/359420122): Remove when clean up is complete. + if (SafeBrowsingDecisionArrivesBeforeResponse()) { base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(navigation_manager_->ReloadWasCalled()); - - // Simulate page loading and navigation being finished. - web::FakeNavigationContext context; - context.SetHasCommitted(true); - web_state_.OnNavigationFinished(&context); - EXPECT_TRUE(navigation_manager_->ReloadWasCalled()); - - // Simulate reload and triggers blocking page logic. - auto main_frame_reload_request_decision = - ShouldAllowRequestUrl(url, /*for_main_frame=*/true, - ui::PageTransition::PAGE_TRANSITION_RELOAD); - EXPECT_TRUE(main_frame_reload_request_decision.ShouldAllowNavigation()); - RunSyncCallbacksThenAsyncCallbacks(); - auto main_frame_reload_response_decision = ShouldAllowResponseUrl(url); - EXPECT_TRUE(main_frame_reload_response_decision.ShouldCancelNavigation()); - EXPECT_TRUE(main_frame_reload_response_decision.ShouldDisplayError()); } + web::WebStatePolicyDecider::PolicyDecision response_decision = + ShouldAllowResponseUrl(url); + EXPECT_TRUE(response_decision.ShouldAllowNavigation()); + + client_.run_async_callbacks(); + // TODO(crbug.com/359420122): Remove when clean up is complete. + base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(navigation_manager_->ReloadWasCalled()); + + // Simulate page loading and navigation being finished. + web::FakeNavigationContext context; + context.SetHasCommitted(true); + web_state_.OnNavigationFinished(&context); + EXPECT_TRUE(navigation_manager_->ReloadWasCalled()); + + // Simulate reload and triggers blocking page logic. + auto main_frame_reload_request_decision = ShouldAllowRequestUrl( + url, /*for_main_frame=*/true, ui::PageTransition::PAGE_TRANSITION_RELOAD); + EXPECT_TRUE(main_frame_reload_request_decision.ShouldAllowNavigation()); + RunSyncCallbacksThenAsyncCallbacks(); + auto main_frame_reload_response_decision = ShouldAllowResponseUrl(url); + EXPECT_TRUE(main_frame_reload_response_decision.ShouldCancelNavigation()); + EXPECT_TRUE(main_frame_reload_response_decision.ShouldDisplayError()); } INSTANTIATE_TEST_SUITE_P(
diff --git a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1 index ec5c909..39c1aeb 100644 --- a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -9a3d0661ccb6fcd16b393e301b457d452becb767 \ No newline at end of file +71b104d2f0b8f6243ada5d4e15c3afd9b1e0990e \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1 b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1 index 14a3f8e9..5b71888 100644 --- a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1
@@ -1 +1 @@ -c90afcb875e201406556b819aab0f564901f92a3 \ No newline at end of file +3a0704d9c52f7cbce573b2da112576db0330517c \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 index ae80ffe6..0bbd9f4 100644 --- a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -7ef2496d1d1060d915a7d687cdf4162797b00762 \ No newline at end of file +076eaf84dcd40b954d7faf4ef4cb85a4b1de3dbf \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1 b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1 index 2eacc2d..b921611c23 100644 --- a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1
@@ -1 +1 @@ -b565df46cec9a69a0a0832f06929a69a88dee330 \ No newline at end of file +f2edb445f105520d0917ebce95e025226e6bbb5a \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 index 0a5271d..f0f6f9ef 100644 --- a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -08703a39399cb14a7cd860faa6b72e3aa2ef9dca \ No newline at end of file +73259852a9373410a2d7b594359700b8c12a43f5 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1 b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1 index e3f28f4..b08f94a 100644 --- a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1
@@ -1 +1 @@ -ac581da2569c28582949481389342f25dee18fc4 \ No newline at end of file +29655f3f20e037925d660f023ca71674cd90f306 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1 index 9d1dad9f..73b0e896 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -42a5439ebcd2cf10324a8f184fccc86718fc7dc9 \ No newline at end of file +a35d704a12de9de306ae0c42b6dac3cb8d842331 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1 index cfa4284..1855c4f6 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -ad189f1cf6a98330286d9e851a99dd8ebb616e81 \ No newline at end of file +e93fb0cd997beb34b87e3fdfc9695ff9cd0a371a \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1 index 84f423d..673a51f 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -41e3a08b291eb31e1a276da1dec2a9e02a92f7a4 \ No newline at end of file +100a03808171ce69ae4fb31537bf3e470fdc249e \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 0ab059c8..37a8664 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -2c39be176e97297076a6ef99bb501651d9baa502 \ No newline at end of file +2854f876f3f6248c2fced158aefaf64c57cde258 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 index 800031b..430509c 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -d2d082d37786cd2c734307024db651b3eb114d28 \ No newline at end of file +205fc311cbdc798ac45fd7922e9b7a5e127815aa \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1 index 71d6803..e68c592 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -c57fb59cd958041a9928f037bc0db1e1e6e34373 \ No newline at end of file +70217101a1b830771aef3f0016ec4e81c5672ea3 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 index 27b376b..92666b7d 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -cf9e258dacdacc5f480f83ff02b96e4c79fb539c \ No newline at end of file +2f562997f555cf9b5985f861aada768180ed5722 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 63ed5856..a2b972f 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -2f27e1fa9756f5831449671c9310a322483b5ded \ No newline at end of file +07f635b9881c9d8bc626b391bf0b821ca5db1bcb \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 index f2ccc88..df0a5011 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -d53a3f7cae1f795708242f4a29d10bb09201b1a5 \ No newline at end of file +21d000a168a5a59ea9166fe4af0e17f8782466aa \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1 index 9c4ddbc4..71eabcf 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -945c58621d16b7a8484f8c4ec049a764d2bf970d \ No newline at end of file +cfbcfe7763de604de62e87a6afd43b21b8c79338 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 index c4b6f677..3fcfbeeb 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -3aa66d05de9a2612d8b78842ad12e9ff5af75baa \ No newline at end of file +a14d7753de544ac62ccf8726fca05ebe8a9b080d \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1 index bfc5e61..525c94e 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -029c899ca7c33e86a51937dccf7998e65563a7f8 \ No newline at end of file +b5e0e1e4773ddac0a9b999fc8e8cbdb5f8c0a548 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 index 634a82d0..5d95102 100644 --- a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -82bb68e2d747eed5011cbbf612aa12842cca5bc5 \ No newline at end of file +edc296ba99d702dae326b69f0c2ef4c4b06e1f2d \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 index ad08f8cb..f24637e2 100644 --- a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -9ac5a0473d19c0c6a7827574a7338f751db7ec54 \ No newline at end of file +9220d347419e371a2835f2c503accd4081efd936 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 index 606eeb7..73783441 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -9308289fa0e78408f2da698a77b1ff12473e64b0 \ No newline at end of file +3e6e22950f66b827a99fd2d91417a4bf74db6864 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1 index f706d0e4..9000d662 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -c788810eab2880861f325e5311d3d55c5689b19e \ No newline at end of file +ec586a9011d14c07e32755557b687d9c0cbf1898 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 index ef00267..145ed00 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -cf1844560936583be44e9b1f54a452e793349c81 \ No newline at end of file +b5a211dfcdf0c30352e94aee9fba504a879f6f66 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 9359ef0..eea530e 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -9e4f2e6ed8e43b29af86b48a88ad9b4bb1df0423 \ No newline at end of file +a9640b2c56ec77370954d057b2ceb5494106037c \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 index 8bc7bc0c..ab058fd 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -c5e53376e1445c46c393147daf547dbc26ffcd74 \ No newline at end of file +1caf0f4210ba390efb92ebebe06266312c415881 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1 index 3b3305f..c6349b5 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -20c6054744707cf6909405ddeb1f4b38618e5dc7 \ No newline at end of file +5487c84861aebf81a7e491fc8284a48d3c247b89 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 index d7dae43..213f68f 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -31224ae2a285a344a8658771cd2c1e4a005eedec \ No newline at end of file +1c81aa63fbf745ab8bcfed166a382936bc786692 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1 index f358ab3..1e53e52 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -07e9c9d7d572fcfad903aef20301e21fc36d1cb7 \ No newline at end of file +a0b03443a5104613d4bde60729cd35a75ba67643 \ No newline at end of file
diff --git a/ios/third_party/material_components_ios/src b/ios/third_party/material_components_ios/src index 7113d41..23f7050 160000 --- a/ios/third_party/material_components_ios/src +++ b/ios/third_party/material_components_ios/src
@@ -1 +1 @@ -Subproject commit 7113d41e999fb2c1013c4f08fb64dc70dcf1fa24 +Subproject commit 23f7050e7e9ba6747d8a9913ad21c57adeb5612a
diff --git a/ios_internal b/ios_internal index 0dac698..027500d 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit 0dac69820e9cefa8adb50d391bf4c76dc9b4f568 +Subproject commit 027500d40853650fa50920850b6fd65758193c29
diff --git a/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc b/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc index f362a12..4d85e3d 100644 --- a/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc +++ b/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc
@@ -1060,6 +1060,15 @@ input_since_keyframe_count_ = 0; client_->RequireBitstreamBuffers(kNumInputBuffers, input_visible_size_, bitstream_buffer_size_); + + if (mf_video_processor_) { + hr = mf_video_processor_->UpdateOutputSize(input_visible_size_); + if (FAILED(hr)) { + NotifyErrorStatus( + {EncoderStatus::Codes::kSystemAPICallError, + "Couldn't update Video processor output size: " + PrintHr(hr)}); + } + } } void MediaFoundationVideoEncodeAccelerator::Destroy() { @@ -1796,7 +1805,8 @@ if (base::FeatureList::IsEnabled(kMediaFoundationD3DVideoProcessing)) { is_supported_format = std::ranges::find(kSupportedPixelFormatsD3DVideoProcessing, - frame->format()) != kSupportedPixelFormats.end(); + frame->format()) != + kSupportedPixelFormatsD3DVideoProcessing.end(); } else { is_supported_format = std::ranges::find(kSupportedPixelFormats, frame->format()) != @@ -2064,10 +2074,20 @@ if (mf_video_processor_) { // This sample needs color space conversion - ComMFSample vp_input_sample = std::move(input_sample); - hr = mf_video_processor_->Convert(vp_input_sample.Get(), frame->format(), - &input_sample); + ComMFSample vp_output_sample; + hr = mf_video_processor_->Convert(input_sample.Get(), frame->format(), + &vp_output_sample); + // input_sample is the sample that will be fed to the encoder, but + // its buffers are from the original color format. Remove those + // buffers and replace them with the buffer that has been + // converted to the target color format. RETURN_ON_HR_FAILURE(hr, "Failed to convert input frame", hr); + hr = input_sample->RemoveAllBuffers(); + RETURN_ON_HR_FAILURE(hr, "Failed to remove buffers from sample", hr); + ComMFMediaBuffer vp_output_buffer; + hr = vp_output_sample->GetBufferByIndex(0, &vp_output_buffer); + RETURN_ON_HR_FAILURE(hr, "Failed to get output buffer from sample", hr); + hr = input_sample->AddBuffer(vp_output_buffer.Get()); } return S_OK; @@ -2089,15 +2109,20 @@ // - MFVP will output a different texture that can be used // as encoder input with no synchronization issues. HRESULT hr; + ComMFSample vp_output_sample; if (frame->HasSharedImage()) { - ComMFSample vp_input_sample = std::move(input_sample); - hr = mf_video_processor_->Convert(vp_input_sample.Get(), frame->format(), - &input_sample); + hr = mf_video_processor_->Convert(input_sample.Get(), frame->format(), + &vp_output_sample); } else { - input_sample = nullptr; - hr = mf_video_processor_->Convert(frame, &input_sample); + hr = mf_video_processor_->Convert(frame, &vp_output_sample); } RETURN_ON_HR_FAILURE(hr, "Failed to convert input frame", hr); + hr = input_sample->RemoveAllBuffers(); + RETURN_ON_HR_FAILURE(hr, "Failed to remove buffers from sample", hr); + ComMFMediaBuffer vp_output_buffer; + hr = vp_output_sample->GetBufferByIndex(0, &vp_output_buffer); + RETURN_ON_HR_FAILURE(hr, "Failed to get output buffer from sample", hr); + hr = input_sample->AddBuffer(vp_output_buffer.Get()); return S_OK; } @@ -2785,10 +2810,13 @@ // If the encoding client quickly supplies multiple shared texture // frames, there could be multiple shared images being resolved at // the same time. This sample needs to be linked with the correct - // frame in the queue. + // frame in the queue. In some circumstances, the client may supply + // multiple VideoFrames backed by the same mailbox, so ensure a + // queued frame being resolved gets completed. auto it = pending_input_queue_.begin(); for (; it != pending_input_queue_.end(); it++) { - if (it->shared_image_token == frame->shared_image()->mailbox()) { + if (it->shared_image_token == frame->shared_image()->mailbox() && + it->resolving_shared_image) { it->input_sample = sample; it->resolving_shared_image = false; break;
diff --git a/media/gpu/windows/mf_video_processor_accelerator.cc b/media/gpu/windows/mf_video_processor_accelerator.cc index 886dfbd..450bb48 100644 --- a/media/gpu/windows/mf_video_processor_accelerator.cc +++ b/media/gpu/windows/mf_video_processor_accelerator.cc
@@ -246,6 +246,27 @@ return S_OK; } +HRESULT MediaFoundationVideoProcessorAccelerator::UpdateOutputSize( + gfx::Size output_visible_size) { + DCHECK(video_processor_); + ComMFMediaType output_media_type; + HRESULT hr = video_processor_->GetOutputCurrentType(0, &output_media_type); + RETURN_ON_HR_FAILURE(hr, "Couldn't get output type", hr); + ComMFMediaType new_output_media_type; + hr = MFCreateMediaType(&new_output_media_type); + RETURN_ON_HR_FAILURE(hr, "Couldn't create new output media type", hr); + hr = output_media_type->CopyAllItems(new_output_media_type.Get()); + RETURN_ON_HR_FAILURE(hr, "Couldn't clone output media type", hr); + hr = MFSetAttributeSize(new_output_media_type.Get(), MF_MT_FRAME_SIZE, + output_visible_size.width(), + output_visible_size.height()); + RETURN_ON_HR_FAILURE(hr, "Couldn't set new output size", hr); + hr = video_processor_->SetOutputType(0, new_output_media_type.Get(), 0); + RETURN_ON_HR_FAILURE(hr, "Couldn't set new output type on video processor", + hr); + return S_OK; +} + HRESULT MediaFoundationVideoProcessorAccelerator::AdjustInputTypeIfNeeded( IMFSample* sample, VideoPixelFormat input_format) {
diff --git a/media/gpu/windows/mf_video_processor_accelerator.h b/media/gpu/windows/mf_video_processor_accelerator.h index 819d8917..5ca8fe08 100644 --- a/media/gpu/windows/mf_video_processor_accelerator.h +++ b/media/gpu/windows/mf_video_processor_accelerator.h
@@ -57,6 +57,7 @@ HRESULT Convert(IMFSample* sample, VideoPixelFormat input_format, IMFSample** sample_out); + HRESULT UpdateOutputSize(gfx::Size output_visible_size); private: bool InitializeVideoProcessor(const Config& config);
diff --git a/media/gpu/windows/mf_video_processor_accelerator_unittest.cc b/media/gpu/windows/mf_video_processor_accelerator_unittest.cc index df4d32a..d62cf58 100644 --- a/media/gpu/windows/mf_video_processor_accelerator_unittest.cc +++ b/media/gpu/windows/mf_video_processor_accelerator_unittest.cc
@@ -541,6 +541,76 @@ }); } +TEST_F(MFVideoProcessorAcceleratorTest, UpdateOutputSize) { + CheckForVideoDevice(); + + const UINT kWidth = 128; + const UINT kHeight = 128; + const UINT kUpdatedWidth = 256; + const UINT kUpdatedHeight = 256; + + std::unique_ptr<MediaFoundationVideoProcessorAccelerator> video_processor; + video_processor = std::make_unique<MediaFoundationVideoProcessorAccelerator>( + gpu::GpuPreferences(), gpu::GpuDriverBugWorkarounds()); + MediaFoundationVideoProcessorAccelerator::Config config; + config.input_format = VideoPixelFormat::PIXEL_FORMAT_XRGB; + config.input_visible_size = {kWidth, kHeight}; + config.input_color_space = gfx::ColorSpace::CreateREC709(); + config.output_format = VideoPixelFormat::PIXEL_FORMAT_NV12; + config.output_visible_size = {kWidth, kHeight}; + config.output_color_space = gfx::ColorSpace::CreateREC709(); + ASSERT_TRUE(video_processor->Initialize(config, dxgi_device_man_, + std::make_unique<NullMediaLog>())); + + std::vector<BYTE> image = + CreateRGBCheckerboard(kWidth, kHeight, kGreen, kMagenta); + Microsoft::WRL::ComPtr<ID3D11Texture2D> texture; + ASSERT_HRESULT_SUCCEEDED(CreateTexture( + kWidth, kHeight, 4, DXGI_FORMAT_B8G8R8A8_UNORM, image.data(), &texture)); + + // Flush graphics pipeline so initial texture data is available when + // texture is accessed through shared handle. + Microsoft::WRL::ComPtr<ID3D11DeviceContext> d3d11_context; + d3d11_device_->GetImmediateContext(&d3d11_context); + d3d11_context->Flush(); + + auto frame = TextureToMappableVideoFrame(texture.Get(), kWidth, kHeight); + + Microsoft::WRL::ComPtr<IMFSample> sample; + ASSERT_HRESULT_SUCCEEDED(video_processor->Convert(frame, &sample)); + + Microsoft::WRL::ComPtr<IMFMediaBuffer> media_buffer; + ASSERT_HRESULT_SUCCEEDED(sample->GetBufferByIndex(0, &media_buffer)); + Microsoft::WRL::ComPtr<IMFDXGIBuffer> dxgi_buffer; + ASSERT_HRESULT_SUCCEEDED(media_buffer.As(&dxgi_buffer)); + Microsoft::WRL::ComPtr<ID3D11Texture2D> output_texture; + ASSERT_HRESULT_SUCCEEDED( + dxgi_buffer->GetResource(IID_PPV_ARGS(&output_texture))); + ValidateResult(output_texture.Get(), kWidth, kHeight, [](BYTE* image) { + EXPECT_NEAR(image[0], kLumaGreen, 1); + EXPECT_NEAR(image[2], kLumaMagenta, 1); + }); + + ASSERT_HRESULT_SUCCEEDED( + video_processor->UpdateOutputSize({kUpdatedWidth, kUpdatedHeight})); + + Microsoft::WRL::ComPtr<IMFSample> sample1; + ASSERT_HRESULT_SUCCEEDED(video_processor->Convert(frame, &sample1)); + + Microsoft::WRL::ComPtr<IMFMediaBuffer> media_buffer1; + ASSERT_HRESULT_SUCCEEDED(sample1->GetBufferByIndex(0, &media_buffer1)); + Microsoft::WRL::ComPtr<IMFDXGIBuffer> dxgi_buffer1; + ASSERT_HRESULT_SUCCEEDED(media_buffer1.As(&dxgi_buffer1)); + Microsoft::WRL::ComPtr<ID3D11Texture2D> output_texture1; + ASSERT_HRESULT_SUCCEEDED( + dxgi_buffer1->GetResource(IID_PPV_ARGS(&output_texture1))); + ValidateResult(output_texture1.Get(), kUpdatedWidth, kUpdatedHeight, + [](BYTE* image) { + EXPECT_NEAR(image[0], kLumaGreen, 1); + EXPECT_NEAR(image[5], kLumaMagenta, 1); + }); +} + class MockEncoderClient : public VideoEncodeAccelerator::Client { public: void RequireBitstreamBuffers(unsigned int input_count,
diff --git a/net/android/java/src/org/chromium/net/MimeTypeFilter.java b/net/android/java/src/org/chromium/net/MimeTypeFilter.java index 7cd3f87..7beb3832 100644 --- a/net/android/java/src/org/chromium/net/MimeTypeFilter.java +++ b/net/android/java/src/org/chromium/net/MimeTypeFilter.java
@@ -56,7 +56,7 @@ } /** Returns true if either the uri or the mimeType is accepted by the MimeTypeFilter */ - public boolean accept(Uri uri, @Nullable String mimeType) { + public boolean accept(@Nullable Uri uri, @Nullable String mimeType) { if (uri != null) { String fileExtension = MimeTypeMap.getFileExtensionFromUrl(uri.toString()).toLowerCase(Locale.US);
diff --git a/net/device_bound_sessions/session.cc b/net/device_bound_sessions/session.cc index 16bb4a95..d5e1a1e 100644 --- a/net/device_bound_sessions/session.cc +++ b/net/device_bound_sessions/session.cc
@@ -96,15 +96,21 @@ net::SchemefulSite(), /*session_id=*/std::nullopt}); } + // If there is an origin in the scope, verify it is valid. Default to the + // fetcher URL if the origin is missing from the scope. + GURL scope_origin_as_url = params.scope.origin.empty() + ? params.fetcher_url + : GURL(params.scope.origin); + url::Origin scope_origin = url::Origin::Create(scope_origin_as_url); + if (scope_origin.opaque()) { + return base::unexpected( + SessionError{SessionError::ErrorType::kInvalidScopeOrigin, + net::SchemefulSite(), /*session_id=*/std::nullopt}); + } + // Check if the scope-origin is samesite with fetcher URL. - if (!params.scope.origin.empty() && !params.fetcher_url.host().empty() && - params.fetcher_url.host() != params.scope.origin && - net::registry_controlled_domains::GetDomainAndRegistry( - params.fetcher_url, - net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES) != - net::registry_controlled_domains::GetDomainAndRegistry( - params.scope.origin, - net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES)) { + if (net::SchemefulSite(scope_origin_as_url) != + net::SchemefulSite(params.fetcher_url)) { return base::unexpected( SessionError{SessionError::ErrorType::kScopeOriginSameSiteMismatch, net::SchemefulSite(), /*session_id=*/std::nullopt}); @@ -137,8 +143,7 @@ } std::unique_ptr<Session> session(new Session( - Id(params.session_id), url::Origin::Create(params.fetcher_url), - candidate_refresh_endpoint)); + Id(params.session_id), scope_origin, candidate_refresh_endpoint)); for (const auto& spec : params.scope.specifications) { if (!spec.domain.empty() && !spec.path.empty()) { const auto inclusion_result = @@ -420,6 +425,7 @@ case kPersistentHttpError: case kScopeOriginSameSiteMismatch: case kRefreshUrlSameSiteMismatch: + case kInvalidScopeOrigin: // We do not want to back off on many network connection errors // (e.g. internet disconnected), so we do not hit our maximum
diff --git a/net/device_bound_sessions/session_error.cc b/net/device_bound_sessions/session_error.cc index 05bb371..1641cbc 100644 --- a/net/device_bound_sessions/session_error.cc +++ b/net/device_bound_sessions/session_error.cc
@@ -35,6 +35,7 @@ case kPersistentHttpError: case kScopeOriginSameSiteMismatch: case kRefreshUrlSameSiteMismatch: + case kInvalidScopeOrigin: return true; case kNetError:
diff --git a/net/device_bound_sessions/session_error.h b/net/device_bound_sessions/session_error.h index abf7b25..62ddf48 100644 --- a/net/device_bound_sessions/session_error.h +++ b/net/device_bound_sessions/session_error.h
@@ -32,7 +32,8 @@ kPersistentHttpError = 14, kScopeOriginSameSiteMismatch = 15, kRefreshUrlSameSiteMismatch = 16, - kMaxValue = kRefreshUrlSameSiteMismatch + kInvalidScopeOrigin = 17, + kMaxValue = kInvalidScopeOrigin }; // LINT.ThenChange(//tools/metrics/histograms/metadata/net/enums.xml:DeviceBoundSessionError)
diff --git a/net/device_bound_sessions/session_service_impl_unittest.cc b/net/device_bound_sessions/session_service_impl_unittest.cc index 4d6a1384..5408bef 100644 --- a/net/device_bound_sessions/session_service_impl_unittest.cc +++ b/net/device_bound_sessions/session_service_impl_unittest.cc
@@ -42,14 +42,14 @@ constexpr char kRefreshUrlString[] = "https://example.com/refresh"; const GURL kTestRefreshUrl(kRefreshUrlString); const std::string kSessionId = "SessionId"; -const std::string kOrigin = "example.com"; +const std::string kOrigin = "https://example.com"; constexpr char kUrlString2[] = "https://example2.com"; const GURL kTestUrl2(kUrlString2); constexpr char kRefreshUrlString2[] = "https://example2.com/refresh"; const GURL kTestRefreshUrl2(kRefreshUrlString); const std::string kSessionId2 = "SessionId2"; -const std::string kOrigin2 = "example2.com"; +const std::string kOrigin2 = "https://example2.com"; const std::string kChallenge = "challenge"; @@ -407,8 +407,8 @@ GURL url_a("https://a_example.com"); GURL url_b("https://b_example.com"); - AddSessionsForTesting({{kSessionId, url_a.spec(), "a_example.com"}, - {kSessionId, url_b.spec(), "b_example.com"}}); + AddSessionsForTesting({{kSessionId, url_a.spec(), "https://a_example.com"}, + {kSessionId, url_b.spec(), "https://b_example.com"}}); SchemefulSite site_a(url_a); SchemefulSite site_b(url_b); @@ -985,7 +985,7 @@ future.GetCallback<const std::vector<SessionKey>&>()); SessionParams::Scope scope; - scope.origin = "example.com"; + scope.origin = "https://example.com"; auto session_or_error = Session::CreateIfValid(SessionParams( "session_id", kTestUrl, "https://example.com/refresh", std::move(scope), /*creds=*/{}, unexportable_keys::UnexportableKeyId()));
diff --git a/net/device_bound_sessions/session_store_impl_unittest.cc b/net/device_bound_sessions/session_store_impl_unittest.cc index ca34583..0aa2d27 100644 --- a/net/device_bound_sessions/session_store_impl_unittest.cc +++ b/net/device_bound_sessions/session_store_impl_unittest.cc
@@ -67,7 +67,7 @@ unexportable_keys::UnexportableKeyService& key_service, const std::string& url_string, const std::string& session_id, - const std::string& origin = "foo.test") { + const std::string& origin = "https://foo.test") { SessionParams::Scope scope; scope.origin = origin; std::string cookie_attr = "Secure; Domain=" + GURL(url_string).host(); @@ -254,11 +254,11 @@ CreateStoreAndLoadSessions(); SessionCfgList cfgs = { {"https://a.foo.test/index.html", "session0", - "foo.test"}, // schemeful site 1 + "https://foo.test"}, // schemeful site 1 {"https://b.foo.test/index.html", "session1", - "foo.test"}, // schemeful site 1 + "https://foo.test"}, // schemeful site 1 {"https://c.bar.test/index.html", "session2", - "bar.test"}, // schemeful site 2 + "https://bar.test"}, // schemeful site 2 }; SessionStore::SessionsMap expected_sessions = CreateAndSaveSessions(cfgs, unexportable_key_service(), store()); @@ -354,11 +354,11 @@ // Create and save some sessions. SessionCfgList cfgs = { {"https://a.foo.test/index.html", "session0", - "foo.test"}, // schemeful site 1 + "https://foo.test"}, // schemeful site 1 {"https://b.foo.test/index.html", "session1", - "foo.test"}, // schemeful site 1 + "https://foo.test"}, // schemeful site 1 {"https://c.bar.test/index.html", "session2", - "bar.test"}, // schemeful site 2 + "https://bar.test"}, // schemeful site 2 }; SessionStore::SessionsMap expected_sessions = CreateAndSaveSessions(cfgs, unexportable_key_service(), store()); @@ -390,9 +390,9 @@ TEST_F(SessionStoreImplTest, LoadSavedSessions) { CreateStoreAndLoadSessions(); SessionCfgList cfgs = { - {"https://a.foo.test/index.html", "session0", "foo.test"}, - {"https://b.foo.test/index.html", "session1", "foo.test"}, - {"https://c.bar.test/index.html", "session2", "bar.test"}, + {"https://a.foo.test/index.html", "session0", "https://foo.test"}, + {"https://b.foo.test/index.html", "session1", "https://foo.test"}, + {"https://c.bar.test/index.html", "session2", "https://bar.test"}, }; SessionStore::SessionsMap saved_sessions = @@ -411,14 +411,16 @@ TEST_F(SessionStoreImplTest, PruneLoadedEntryWithInvalidSite) { // Create an entry with an invalid site. - proto::Session sproto = CreateSessionProto( - unexportable_key_service(), "https://foo.test", "session_id", "foo.test"); + proto::Session sproto = + CreateSessionProto(unexportable_key_service(), "https://foo.test", + "session_id", "https://foo.test"); proto::SiteSessions site_proto; (*site_proto.mutable_sessions())["session_id"] = std::move(sproto); // Create an entry with a valid site. - proto::Session sproto2 = CreateSessionProto( - unexportable_key_service(), "https://bar.test", "session_id", "bar.test"); + proto::Session sproto2 = + CreateSessionProto(unexportable_key_service(), "https://bar.test", + "session_id", "https://bar.test"); proto::SiteSessions site2_proto; (*site2_proto.mutable_sessions())["session_id"] = std::move(sproto2); auto site2 = net::SchemefulSite(GURL("https://bar.test)")); @@ -452,11 +454,11 @@ // Create an entry with 1 valid and 1 invalid session. proto::Session sproto1 = CreateSessionProto(unexportable_key_service(), "https://foo.example.test", - "session_1", "foo.example.test"); + "session_1", "https://foo.example.test"); // Create an invalid session. proto::Session sproto2 = CreateSessionProto(unexportable_key_service(), "https://bar.example.test", - "session_2", "bar.example.test"); + "session_2", "https://bar.example.test"); sproto2.set_refresh_url("invalid_url"); // Create a site proto (proto table's value field) consisting of the above 2 @@ -487,7 +489,7 @@ // Create a Session proto with missing wrapped key field. proto::Session sproto = CreateSessionProto(unexportable_key_service(), "https://foo.example.test", - "session_id", "foo.example.test"); + "session_id", "https://foo.example.test"); sproto.clear_wrapped_key(); // Create a single entry table with the above session data.
diff --git a/net/device_bound_sessions/session_unittest.cc b/net/device_bound_sessions/session_unittest.cc index 46bc27f4..909a7d2 100644 --- a/net/device_bound_sessions/session_unittest.cc +++ b/net/device_bound_sessions/session_unittest.cc
@@ -46,7 +46,7 @@ SessionParams CreateValidParams() { SessionParams::Scope scope; - scope.origin = "example.test"; + scope.origin = "https://example.test"; std::vector<SessionParams::Credential> cookie_credentials( {SessionParams::Credential{"test_cookie", "Secure; Domain=example.test"}}); @@ -108,6 +108,15 @@ SessionError::ErrorType::kInvalidRefreshUrl); } +TEST_F(SessionTest, InvalidScopeOrigin) { + auto params = CreateValidParams(); + params.scope.origin = "hello world"; + auto session_or_error = Session::CreateIfValid(params); + ASSERT_FALSE(session_or_error.has_value()); + EXPECT_EQ(session_or_error.error().type, + SessionError::ErrorType::kInvalidScopeOrigin); +} + TEST_F(SessionTest, ScopeOriginSameSiteMismatch) { auto params = CreateValidParams(); params.fetcher_url = kTestUrlForWrongETLD; @@ -119,7 +128,6 @@ TEST_F(SessionTest, SameSiteMismatchRefreshUrl) { auto params = CreateValidParams(); - params.fetcher_url = GURL("http://example.test/index.html"); params.refresh_url = kUrlStringForWrongETLD; auto session_or_error = Session::CreateIfValid(params); ASSERT_FALSE(session_or_error.has_value()); @@ -133,6 +141,7 @@ auto params = CreateValidParams(); params.fetcher_url = GURL("http://example.test/index.html"); params.refresh_url = "http://example.test/registration"; + params.scope.origin = "http://example.test"; auto session_or_error = Session::CreateIfValid(params); ASSERT_FALSE(session_or_error.has_value()); EXPECT_EQ(session_or_error.error().type, @@ -144,7 +153,7 @@ auto params = CreateValidParams(); params.fetcher_url = GURL("http://localhost:8080/index.html"); params.refresh_url = "http://localhost:8080/registration"; - params.scope.origin = "localhost"; + params.scope.origin = "http://localhost:8080"; EXPECT_TRUE(Session::CreateIfValid(params).has_value()); } } @@ -376,6 +385,61 @@ EXPECT_TRUE(is_deferred); } +TEST_F(SessionTest, DeferredNarrowerScopeOrigin) { + auto params = CreateValidParams(); + params.scope.origin = "https://sub.example.test"; + auto session_or_error = Session::CreateIfValid(params); + ASSERT_TRUE(session_or_error.has_value()); + std::unique_ptr<Session> session = std::move(*session_or_error); + ASSERT_TRUE(session); + net::TestDelegate delegate; + // Create a request matching the scope origin. + std::unique_ptr<URLRequest> request = + context_->CreateRequest(GURL("https://sub.example.test/index.html"), IDLE, + &delegate, kDummyAnnotation); + request->set_site_for_cookies(SiteForCookies::FromUrl(kTestUrl)); + + bool is_deferred = + session->ShouldDeferRequest(request.get(), FirstPartySetMetadata()); + EXPECT_TRUE(is_deferred); +} + +TEST_F(SessionTest, NotDeferredNarrowerScopeOrigin) { + auto params = CreateValidParams(); + params.scope.origin = "https://sub.example.test"; + auto session_or_error = Session::CreateIfValid(params); + ASSERT_TRUE(session_or_error.has_value()); + std::unique_ptr<Session> session = std::move(*session_or_error); + ASSERT_TRUE(session); + net::TestDelegate delegate; + // Create a request with a broader scope than the scope origin. + std::unique_ptr<URLRequest> request = + context_->CreateRequest(kTestUrl, IDLE, &delegate, kDummyAnnotation); + request->set_site_for_cookies(SiteForCookies::FromUrl(kTestUrl)); + + bool is_deferred = + session->ShouldDeferRequest(request.get(), FirstPartySetMetadata()); + EXPECT_FALSE(is_deferred); +} + +TEST_F(SessionTest, DeferredMissingScopeOrigin) { + auto params = CreateValidParams(); + params.scope.origin = ""; + auto session_or_error = Session::CreateIfValid(params); + ASSERT_TRUE(session_or_error.has_value()); + std::unique_ptr<Session> session = std::move(*session_or_error); + ASSERT_TRUE(session); + net::TestDelegate delegate; + // Create a request matching the fetcher URL. + std::unique_ptr<URLRequest> request = + context_->CreateRequest(kTestUrl, IDLE, &delegate, kDummyAnnotation); + request->set_site_for_cookies(SiteForCookies::FromUrl(kTestUrl)); + + bool is_deferred = + session->ShouldDeferRequest(request.get(), FirstPartySetMetadata()); + EXPECT_TRUE(is_deferred); +} + class InsecureDelegate : public CookieAccessDelegate { public: bool ShouldTreatUrlAsTrustworthy(const GURL& url) const override {
diff --git a/net/http/transport_security_state_static.pins b/net/http/transport_security_state_static.pins index 89050fc..90e23f3 100644 --- a/net/http/transport_security_state_static.pins +++ b/net/http/transport_security_state_static.pins
@@ -43,9 +43,9 @@ # hash function for preloaded entries again (we have already done so once). # -# Last updated: 2025-03-03 12:53 UTC +# Last updated: 2025-03-04 12:54 UTC PinsListTimestamp -1741006424 +1741092851 TestSPKI sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
diff --git a/net/http/transport_security_state_static_pins.json b/net/http/transport_security_state_static_pins.json index 9cd6045..ee55d12 100644 --- a/net/http/transport_security_state_static_pins.json +++ b/net/http/transport_security_state_static_pins.json
@@ -31,7 +31,7 @@ // the 'static_spki_hashes' and 'bad_static_spki_hashes' fields in 'pinsets' // refer to, and the timestamp at which the pins list was last updated. // -// Last updated: 2025-03-03 12:53 UTC +// Last updated: 2025-03-04 12:54 UTC // { "pinsets": [
diff --git a/pdf/pdf_features.cc b/pdf/pdf_features.cc index 54e8fb5..e216295 100644 --- a/pdf/pdf_features.cc +++ b/pdf/pdf_features.cc
@@ -18,7 +18,7 @@ "AccessiblePDFForm", base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kPdfCr23, "PdfCr23", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kPdfCr23, "PdfCr23", base::FEATURE_ENABLED_BY_DEFAULT); // "Incremental loading" refers to loading the PDF as it arrives. // TODO(crbug.com/40123601): Remove this once incremental loading is fixed.
diff --git a/services/network/build/scripts/templates/permissions_policy_features_generated.cc.tmpl b/services/network/build/scripts/templates/permissions_policy_features_generated.cc.tmpl index eb33744..7775e0e 100644 --- a/services/network/build/scripts/templates/permissions_policy_features_generated.cc.tmpl +++ b/services/network/build/scripts/templates/permissions_policy_features_generated.cc.tmpl
@@ -83,4 +83,4 @@ return *feature_list; } -} // namespace blink +} // namespace network
diff --git a/services/network/build/scripts/tests/permissions_policy_default_value_control/output/permissions_policy_features_generated.cc.ref b/services/network/build/scripts/tests/permissions_policy_default_value_control/output/permissions_policy_features_generated.cc.ref index 67ea869..0bd9d904 100644 --- a/services/network/build/scripts/tests/permissions_policy_default_value_control/output/permissions_policy_features_generated.cc.ref +++ b/services/network/build/scripts/tests/permissions_policy_default_value_control/output/permissions_policy_features_generated.cc.ref
@@ -57,4 +57,4 @@ return *feature_list; } -} // namespace blink +} // namespace network
diff --git a/services/network/device_bound_session_manager_unittest.cc b/services/network/device_bound_session_manager_unittest.cc index f75d7a71..c4c6d769 100644 --- a/services/network/device_bound_session_manager_unittest.cc +++ b/services/network/device_bound_session_manager_unittest.cc
@@ -91,7 +91,7 @@ TEST_F(DeviceBoundSessionManagerTest, ObserverNotifiesChangeOnlyOnSite) { ScopedTestRegistrationFetcher scoped_fetcher = ScopedTestRegistrationFetcher::CreateWithSuccess( - "SessionId", "https://example.com/refresh", "example.com"); + "SessionId", "https://example.com/refresh", "https://example.com"); GURL url("https://example.com"); net::SchemefulSite site(url);
diff --git a/services/network/first_party_sets/first_party_sets_access_delegate.cc b/services/network/first_party_sets/first_party_sets_access_delegate.cc index daf85cd..240c93e9 100644 --- a/services/network/first_party_sets/first_party_sets_access_delegate.cc +++ b/services/network/first_party_sets/first_party_sets_access_delegate.cc
@@ -206,23 +206,12 @@ CHECK(ready_event_.has_value()); // !wait_for_init_ implies (pending_queries == nullptr). CHECK(wait_for_init_ || pending_queries_ == nullptr); - // !wait_for_init_ implies !first_async_query_timer_.has_value(). - CHECK(wait_for_init_ || !first_async_query_timer_.has_value()); UmaHistogramTimes( "Cookie.FirstPartySets.InitializationDuration." "ContextReadyToServeQueries2", construction_timer_.Elapsed()); - base::UmaHistogramCounts10000( - "Cookie.FirstPartySets.ContextDelayedQueriesCount", - pending_queries_ ? pending_queries_->size() : 0); - - base::UmaHistogramTimes("Cookie.FirstPartySets.ContextMostDelayedQueryDelta", - first_async_query_timer_.has_value() - ? first_async_query_timer_->Elapsed() - : base::TimeDelta()); - if (!pending_queries_) { return; } @@ -243,9 +232,6 @@ CHECK(!ready_event_.has_value()); CHECK(wait_for_init_); - if (!first_async_query_timer_.has_value()) - first_async_query_timer_ = {base::ElapsedTimer()}; - pending_queries_->push_back(std::move(run_query)); }
diff --git a/services/network/first_party_sets/first_party_sets_access_delegate.h b/services/network/first_party_sets/first_party_sets_access_delegate.h index afc4db8..2dee12b49 100644 --- a/services/network/first_party_sets/first_party_sets_access_delegate.h +++ b/services/network/first_party_sets/first_party_sets_access_delegate.h
@@ -143,11 +143,6 @@ mojo::Receiver<mojom::FirstPartySetsAccessDelegate> receiver_ GUARDED_BY_CONTEXT(sequence_checker_){this}; - // Timer starting when the first async query was enqueued, if any. Used for - // metrics. - std::optional<base::ElapsedTimer> first_async_query_timer_ - GUARDED_BY_CONTEXT(sequence_checker_); - // Timer starting when the instance is constructed. Used for metrics. base::ElapsedTimer construction_timer_ GUARDED_BY_CONTEXT(sequence_checker_);
diff --git a/services/network/first_party_sets/first_party_sets_access_delegate_unittest.cc b/services/network/first_party_sets/first_party_sets_access_delegate_unittest.cc index caddaa28..01ad4e0a 100644 --- a/services/network/first_party_sets/first_party_sets_access_delegate_unittest.cc +++ b/services/network/first_party_sets/first_party_sets_access_delegate_unittest.cc
@@ -10,7 +10,6 @@ #include "base/containers/flat_set.h" #include "base/functional/callback_helpers.h" -#include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/test/test_future.h" @@ -59,11 +58,6 @@ const int64_t kClearAtRunId(2); const int64_t kBrowserRunId(3); -const char kDelayedQueriesCountHistogram[] = - "Cookie.FirstPartySets.ContextDelayedQueriesCount"; -const char kMostDelayedQuerDeltaHistogram[] = - "Cookie.FirstPartySets.ContextMostDelayedQueryDelta"; - mojom::FirstPartySetsAccessDelegateParamsPtr CreateFirstPartySetsAccessDelegateParams(bool enabled) { auto params = mojom::FirstPartySetsAccessDelegateParams::New(); @@ -611,7 +605,6 @@ TEST_F(AsyncNonwaitingFirstPartySetsAccessDelegateTest, QueryBeforeReady_ComputeMetadata) { - base::HistogramTester histogram_tester; EXPECT_EQ( std::make_optional( std::make_pair(net::FirstPartySetMetadata(), @@ -629,17 +622,10 @@ net::FirstPartySetsCacheFilter::MatchInfo())), delegate().ComputeMetadata(kSet1AssociatedSite1, &kSet1AssociatedSite1, base::NullCallback())); - - histogram_tester.ExpectUniqueSample( - kDelayedQueriesCountHistogram, /*sample=*/0, /*expected_bucket_count=*/1); - histogram_tester.ExpectUniqueSample(kMostDelayedQuerDeltaHistogram, - /*sample=*/0, - /*expected_bucket_count=*/1); } TEST_F(AsyncNonwaitingFirstPartySetsAccessDelegateTest, QueryBeforeReady_FindEntries) { - base::HistogramTester histogram_tester; EXPECT_THAT( delegate().FindEntries({kSet1AssociatedSite1, kSet2AssociatedSite1}, base::NullCallback()), @@ -659,16 +645,10 @@ net::FirstPartySetEntry(kSet2Primary, net::SiteType::kAssociated, 0)}, })); - histogram_tester.ExpectUniqueSample( - kDelayedQueriesCountHistogram, /*sample=*/0, /*expected_bucket_count=*/1); - histogram_tester.ExpectUniqueSample(kMostDelayedQuerDeltaHistogram, - /*sample=*/0, - /*expected_bucket_count=*/1); } TEST_F(AsyncNonwaitingFirstPartySetsAccessDelegateTest, OverrideSets_ComputeMetadata) { - base::HistogramTester histogram_tester; delegate_remote()->NotifyReady(CreateFirstPartySetsReadyEvent( net::FirstPartySetsContextConfig::Create( { @@ -691,16 +671,10 @@ net::FirstPartySetEntry(kSet3Primary, net::SiteType::kAssociated, 0)), net::FirstPartySetsCacheFilter::MatchInfo())); - histogram_tester.ExpectUniqueSample( - kDelayedQueriesCountHistogram, /*sample=*/0, /*expected_bucket_count=*/1); - histogram_tester.ExpectUniqueSample(kMostDelayedQuerDeltaHistogram, - /*sample=*/0, - /*expected_bucket_count=*/1); } TEST_F(AsyncNonwaitingFirstPartySetsAccessDelegateTest, OverrideSets_FindEntries) { - base::HistogramTester histogram_tester; delegate_remote()->NotifyReady(CreateFirstPartySetsReadyEvent( net::FirstPartySetsContextConfig::Create( { @@ -714,11 +688,6 @@ EXPECT_THAT(FindEntriesAndWait({kSet3Primary}), UnorderedElementsAre(Pair(kSet3Primary, _))); - histogram_tester.ExpectUniqueSample( - kDelayedQueriesCountHistogram, /*sample=*/0, /*expected_bucket_count=*/1); - histogram_tester.ExpectUniqueSample(kMostDelayedQuerDeltaHistogram, - /*sample=*/0, - /*expected_bucket_count=*/1); } } // namespace network
diff --git a/services/network/first_party_sets/first_party_sets_manager.cc b/services/network/first_party_sets/first_party_sets_manager.cc index 06b3a21..aa2d54f 100644 --- a/services/network/first_party_sets/first_party_sets_manager.cc +++ b/services/network/first_party_sets/first_party_sets_manager.cc
@@ -153,15 +153,6 @@ "Cookie.FirstPartySets.InitializationDuration.ReadyToServeQueries2", construction_timer_.Elapsed()); - base::UmaHistogramTimes("Cookie.FirstPartySets.Network.MostDelayedQueryDelta", - first_async_query_timer_.has_value() - ? first_async_query_timer_->Elapsed() - : base::TimeDelta()); - - base::UmaHistogramCounts10000( - "Cookie.FirstPartySets.Network.DelayedQueriesCount", - pending_queries_ ? pending_queries_->size() : 0); - if (!pending_queries_) { return; } @@ -188,9 +179,6 @@ CHECK(!sets_.has_value()); CHECK(pending_queries_); - if (!first_async_query_timer_.has_value()) - first_async_query_timer_ = {base::ElapsedTimer()}; - pending_queries_->push_back(std::move(run_query)); }
diff --git a/services/network/first_party_sets/first_party_sets_manager.h b/services/network/first_party_sets/first_party_sets_manager.h index 004c7a5..6120b4aa 100644 --- a/services/network/first_party_sets/first_party_sets_manager.h +++ b/services/network/first_party_sets/first_party_sets_manager.h
@@ -141,11 +141,6 @@ std::unique_ptr<base::circular_deque<base::OnceClosure>> pending_queries_ GUARDED_BY_CONTEXT(sequence_checker_); - // Timer starting when the first async query was enqueued, if any. Used for - // metrics. - std::optional<base::ElapsedTimer> first_async_query_timer_ - GUARDED_BY_CONTEXT(sequence_checker_); - // Timer starting when the instance is constructed. Used for metrics. base::ElapsedTimer construction_timer_ GUARDED_BY_CONTEXT(sequence_checker_);
diff --git a/services/network/first_party_sets/first_party_sets_manager_unittest.cc b/services/network/first_party_sets/first_party_sets_manager_unittest.cc index 4235a34..39e8405 100644 --- a/services/network/first_party_sets/first_party_sets_manager_unittest.cc +++ b/services/network/first_party_sets/first_party_sets_manager_unittest.cc
@@ -11,7 +11,6 @@ #include "base/containers/flat_set.h" #include "base/functional/callback_helpers.h" -#include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/test/test_future.h" @@ -32,11 +31,6 @@ using ::testing::Pair; using ::testing::UnorderedElementsAre; -const char* kDelayedQueriesCountHistogram = - "Cookie.FirstPartySets.Network.DelayedQueriesCount"; -const char* kMostDelayedQueryDeltaHistogram = - "Cookie.FirstPartySets.Network.MostDelayedQueryDelta"; - namespace network { class WaitingFeatureInitializer { @@ -77,12 +71,10 @@ return result.has_value() ? result.value() : future.Get(); } - base::HistogramTester& histogram_tester() { return histogram_tester_; } FirstPartySetsManager& manager() { return manager_; } private: base::test::TaskEnvironment env_; - base::HistogramTester histogram_tester_; FirstPartySetsManager manager_; }; @@ -112,9 +104,6 @@ }, net::FirstPartySetsContextConfig(), base::NullCallback()), Optional(IsEmpty())); - - histogram_tester().ExpectTotalCount(kDelayedQueriesCountHistogram, 1); - histogram_tester().ExpectTotalCount(kMostDelayedQueryDeltaHistogram, 1); } TEST_F(FirstPartySetsManagerDisabledTest, FindEntries) { @@ -157,8 +146,6 @@ std::nullopt)), Pair(aaaa, net::FirstPartySetEntry(example_test, net::SiteType::kAssociated, 0)))); - histogram_tester().ExpectTotalCount(kDelayedQueriesCountHistogram, 1); - histogram_tester().ExpectTotalCount(kMostDelayedQueryDeltaHistogram, 1); } TEST_F(FirstPartySetsManagerEnabledTest, SetCompleteSets_Idempotent) { @@ -260,8 +247,6 @@ EXPECT_EQ(future.Get(), net::FirstPartySetMetadata(entry, entry)); } - histogram_tester().ExpectTotalCount(kDelayedQueriesCountHistogram, 1); - histogram_tester().ExpectTotalCount(kMostDelayedQueryDeltaHistogram, 1); } TEST_F(AsyncWaitingFirstPartySetsManagerTest, QueryBeforeReady_FindEntries) { @@ -317,12 +302,6 @@ manager().ComputeMetadata(associatedSite, &associatedSite, net::FirstPartySetsContextConfig(), base::NullCallback())); - - histogram_tester().ExpectUniqueSample( - kDelayedQueriesCountHistogram, /*sample=*/0, /*expected_bucket_count=*/1); - histogram_tester().ExpectUniqueSample(kMostDelayedQueryDeltaHistogram, - /*sample=*/0, - /*expected_bucket_count=*/1); } TEST_F(AsyncNonwaitingFirstPartySetsManagerTest, QueryBeforeReady_FindEntries) {
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc index 6b15452..f677f6b 100644 --- a/services/network/public/cpp/features.cc +++ b/services/network/public/cpp/features.cc
@@ -229,6 +229,19 @@ "PrivateNetworkAccessPermissionPrompt", base::FEATURE_ENABLED_BY_DEFAULT); +// Enables Local Network Access checks. +// Blocks local network requests without user permission to prevent exploitation +// of vulnerable local devices. +// +// This feature is being built as a replacement for Private Network Access +// (PNA), and if this is on PNA features may stop working. +// +// Public explainer: +// https://github.com/explainers-by-googlers/local-network-access +BASE_FEATURE(kLocalNetworkAccessChecks, + "LocalNetworkAccessChecks", + base::FEATURE_DISABLED_BY_DEFAULT); + // If enabled, then the network service will parse the Cookie-Indices header. // This does not currently control changing cache behavior according to the // value of this header.
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h index e2aa138..9ca96cc 100644 --- a/services/network/public/cpp/features.h +++ b/services/network/public/cpp/features.h
@@ -78,6 +78,8 @@ COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kPrivateNetworkAccessPermissionPrompt); +COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kLocalNetworkAccessChecks); + // If enabled, then the network service will parse the Cookie-Indices header. // This does not currently control changing cache behavior according to the // value of this header.
diff --git a/services/tracing/public/cpp/perfetto/perfetto_tracing_backend.cc b/services/tracing/public/cpp/perfetto/perfetto_tracing_backend.cc index 2f1902b..65d7705 100644 --- a/services/tracing/public/cpp/perfetto/perfetto_tracing_backend.cc +++ b/services/tracing/public/cpp/perfetto/perfetto_tracing_backend.cc
@@ -8,6 +8,7 @@ #include "base/command_line.h" #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" +#include "base/feature_list.h" #include "base/memory/ptr_util.h" #include "base/memory/raw_ptr.h" #include "base/memory/shared_memory_switch.h" @@ -22,6 +23,7 @@ #include "mojo/public/cpp/system/data_pipe_drainer.h" #include "services/tracing/public/cpp/perfetto/shared_memory.h" #include "services/tracing/public/cpp/perfetto/trace_packet_tokenizer.h" +#include "services/tracing/public/cpp/tracing_features.h" #include "services/tracing/public/mojom/perfetto_service.mojom.h" #include "services/tracing/public/mojom/tracing_service.mojom.h" #include "third_party/perfetto/include/perfetto/base/task_runner.h" @@ -40,15 +42,6 @@ namespace tracing { namespace { -// TODO(crbug.com/40574593): Find a good compromise between performance and -// data granularity (mainly relevant to running with small buffer sizes -// when we use background tracing) on Android. -#if BUILDFLAG(IS_ANDROID) -constexpr size_t kDefaultSMBPageSizeBytes = 4 * 1024; -#else -constexpr size_t kDefaultSMBPageSizeBytes = 32 * 1024; -#endif - constexpr char kErrorTracingFailed[] = "Tracing failed"; } // namespace @@ -686,9 +679,9 @@ uint32_t shmem_size_hint = args.shmem_size_hint_bytes; uint32_t shmem_page_size_hint = args.shmem_page_size_hint_bytes; if (shmem_size_hint == 0) - shmem_size_hint = kDefaultSharedMemorySize; + shmem_size_hint = features::kPerfettoSharedMemorySizeBytes.Get(); if (shmem_page_size_hint == 0) - shmem_page_size_hint = kDefaultSMBPageSizeBytes; + shmem_page_size_hint = features::kPerfettoSMBPageSizeBytes.Get(); if (args.use_producer_provided_smb) { auto* command_line = base::CommandLine::ForCurrentProcess();
diff --git a/services/tracing/public/cpp/perfetto/shared_memory.h b/services/tracing/public/cpp/perfetto/shared_memory.h index 4c5539f3..161c128 100644 --- a/services/tracing/public/cpp/perfetto/shared_memory.h +++ b/services/tracing/public/cpp/perfetto/shared_memory.h
@@ -14,9 +14,6 @@ namespace tracing { -// TODO(crbug.com/40574594): Figure out a good buffer size. -inline constexpr size_t kDefaultSharedMemorySize = 4 * 1024 * 1024; // 4 KB - // This wraps //base's shmem implementation for Perfetto to consume. class COMPONENT_EXPORT(TRACING_CPP) ChromeBaseSharedMemory : public perfetto::SharedMemory {
diff --git a/services/tracing/public/cpp/trace_startup.cc b/services/tracing/public/cpp/trace_startup.cc index e85b3c2..c2b4baa 100644 --- a/services/tracing/public/cpp/trace_startup.cc +++ b/services/tracing/public/cpp/trace_startup.cc
@@ -167,7 +167,8 @@ } #endif // DCHECK_IS_ON() - auto shm = base::UnsafeSharedMemoryRegion::Create(kDefaultSharedMemorySize); + auto shm = base::UnsafeSharedMemoryRegion::Create( + features::kPerfettoSharedMemorySizeBytes.Get()); if (!shm.IsValid()) { return base::UnsafeSharedMemoryRegion(); }
diff --git a/services/tracing/public/cpp/trace_startup_shared_memory_unittest.cc b/services/tracing/public/cpp/trace_startup_shared_memory_unittest.cc index ddd2877e..18122c0b 100644 --- a/services/tracing/public/cpp/trace_startup_shared_memory_unittest.cc +++ b/services/tracing/public/cpp/trace_startup_shared_memory_unittest.cc
@@ -20,6 +20,7 @@ #include "services/tracing/public/cpp/perfetto/shared_memory.h" #include "services/tracing/public/cpp/trace_startup.h" #include "services/tracing/public/cpp/trace_startup_config.h" +#include "services/tracing/public/cpp/tracing_features.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/multiprocess_func_list.h" @@ -41,7 +42,7 @@ auto shared_memory = CreateTracingOutputSharedMemory(); ASSERT_TRUE(shared_memory.IsValid()); - EXPECT_EQ(kDefaultSharedMemorySize, shared_memory.GetSize()); + EXPECT_EQ(kDefaultSharedMemorySizeBytes, shared_memory.GetSize()); } MULTIPROCESS_TEST_MAIN(InitFromLaunchParameters) { @@ -82,7 +83,7 @@ auto shmem_region = base::shared_memory::UnsafeSharedMemoryRegionFrom( command_line->GetSwitchValueASCII(switches::kTraceBufferHandle)); EXPECT_TRUE(shmem_region->IsValid()); - EXPECT_EQ(kDefaultSharedMemorySize, shmem_region->GetSize()); + EXPECT_EQ(kDefaultSharedMemorySizeBytes, shmem_region->GetSize()); return 0; }
diff --git a/services/tracing/public/cpp/tracing_features.cc b/services/tracing/public/cpp/tracing_features.cc index 4a91bf8..8d595b8c 100644 --- a/services/tracing/public/cpp/tracing_features.cc +++ b/services/tracing/public/cpp/tracing_features.cc
@@ -20,6 +20,14 @@ namespace features { +namespace { + +BASE_FEATURE(kPerfettoBackendParams, + "kPerfettoBackendParams", + base::FEATURE_DISABLED_BY_DEFAULT); + +} // namespace + // Runs the tracing service as an in-process browser service. BASE_FEATURE(kTracingServiceInProcess, "TracingServiceInProcess", @@ -44,6 +52,21 @@ "EnablePerfettoSystemBackgroundTracing", base::FEATURE_DISABLED_BY_DEFAULT); +// Controls the preferred size of each page in the shmem buffer. +BASE_FEATURE_PARAM(int, + kPerfettoSMBPageSizeBytes, + &kPerfettoBackendParams, + "page_size_bytes", + tracing::kDefaultSMBPageSizeBytes); + +// Controls the size of the shared memory buffer between the current process and +// the service backend(s) +BASE_FEATURE_PARAM(int, + kPerfettoSharedMemorySizeBytes, + &kPerfettoBackendParams, + "shared_memory_size_bytes", + tracing::kDefaultSharedMemorySizeBytes); + } // namespace features namespace tracing {
diff --git a/services/tracing/public/cpp/tracing_features.h b/services/tracing/public/cpp/tracing_features.h index e15debf..43c501e9 100644 --- a/services/tracing/public/cpp/tracing_features.h +++ b/services/tracing/public/cpp/tracing_features.h
@@ -10,6 +10,7 @@ #include "base/component_export.h" #include "base/feature_list.h" +#include "base/metrics/field_trial_params.h" namespace features { @@ -24,10 +25,29 @@ extern const COMPONENT_EXPORT(TRACING_CPP) base::Feature kEnablePerfettoSystemBackgroundTracing; +COMPONENT_EXPORT(TRACING_CPP) +BASE_DECLARE_FEATURE_PARAM(int, kPerfettoSMBPageSizeBytes); + +COMPONENT_EXPORT(TRACING_CPP) +BASE_DECLARE_FEATURE_PARAM(int, kPerfettoSharedMemorySizeBytes); + } // namespace features namespace tracing { +// TODO(crbug.com/40574594): Figure out a good buffer size. +inline constexpr size_t kDefaultSharedMemorySizeBytes = + 4 * 1024 * 1024; // 4 MB + +// TODO(crbug.com/40574593): Find a good compromise between performance and +// data granularity (mainly relevant to running with small buffer sizes +// when we use background tracing) on Android. +#if BUILDFLAG(IS_ANDROID) +inline constexpr size_t kDefaultSMBPageSizeBytes = 4 * 1024; +#else +inline constexpr size_t kDefaultSMBPageSizeBytes = 32 * 1024; +#endif + // Returns true if the system tracing Perfetto producer should be setup. This // can be influenced by the feature above or other situations (like debug // android builds).
diff --git a/services/viz/public/cpp/gpu/context_provider_command_buffer.cc b/services/viz/public/cpp/gpu/context_provider_command_buffer.cc index ff3f568..1dd94b5 100644 --- a/services/viz/public/cpp/gpu/context_provider_command_buffer.cc +++ b/services/viz/public/cpp/gpu/context_provider_command_buffer.cc
@@ -413,7 +413,7 @@ return gr_context_->get(); } - if (attributes_.enable_oop_rasterization) { + if (attributes_.enable_gpu_rasterization) { return nullptr; }
diff --git a/storage/browser/quota/quota_database.cc b/storage/browser/quota/quota_database.cc index 8f66476..c8acdaf 100644 --- a/storage/browser/quota/quota_database.cc +++ b/storage/browser/quota/quota_database.cc
@@ -815,51 +815,56 @@ return base::unexpected(open_error); } - // clang-format off - static constexpr char kSqlExpired[] = - "SELECT " BUCKET_INFO_FIELDS_SELECTOR - "FROM buckets " - "WHERE expiration > 0 AND expiration < ?"; - // clang-format on - last_operation_ = "GetExpired"; - - sql::Statement statement_expired( - db_->GetCachedStatement(SQL_FROM_HERE, kSqlExpired)); - statement_expired.BindTime(0, GetNow()); - std::set<BucketInfo> expired_buckets = - BucketInfosFromSqlStatement(statement_expired); - - // Return early if we don't need to gather stale buckets as well. + // We only clear stale/orphan buckets once after a delay since startup. If we + // have already done so, or should not do so yet, then we just want to clear + // expired buckets here and not do the full query. if (already_evicted_stale_storage_ || - !base::FeatureList::IsEnabled(features::kEvictStaleQuotaStorage) || GetNow() < evict_stale_buckets_after_) { - return expired_buckets; - } - already_evicted_stale_storage_ = true; + // clang-format off + static constexpr char kSqlExpired[] = + "SELECT " BUCKET_INFO_FIELDS_SELECTOR + "FROM buckets " + "WHERE expiration > 0 AND expiration < ?"; + // clang-format on + last_operation_ = "GetExpired"; - // We gather stale buckets in a different fetch round so that we can count - // the amount found for metrics and filter out persistent buckets. After - // launch it may be worth merging these queries. + sql::Statement statement( + db_->GetCachedStatement(SQL_FROM_HERE, kSqlExpired)); + statement.BindTime(0, GetNow()); + return BucketInfosFromSqlStatement(statement); + } + + already_evicted_stale_storage_ = true; // clang-format off - static constexpr char kSqlStale[] = + static constexpr char kSqlExpiredAndStaleAndOrphan[] = "SELECT " BUCKET_INFO_FIELDS_SELECTOR "FROM buckets " - "WHERE type = ? AND persistent = 0 AND " - "last_accessed < ? AND last_modified < ?"; + "WHERE (expiration > 0 AND expiration < ?) OR " + " (type = ? AND persistent = 0 AND " + " last_accessed < ? AND last_modified < ?) OR " + " (storage_key REGEXP '.*\\^(1|4).*' AND " + " last_accessed < ? AND last_modified < ?)"; // clang-format on - last_operation_ = "GetStale"; + last_operation_ = "GetExpiredAndOrphanAndStale"; - sql::Statement statement_stale( - db_->GetCachedStatement(SQL_FROM_HERE, kSqlStale)); - statement_stale.BindInt( - 0, static_cast<int>(blink::mojom::StorageType::kTemporary)); + sql::Statement statement( + db_->GetCachedStatement(SQL_FROM_HERE, kSqlExpiredAndStaleAndOrphan)); + base::Time expiration_cutoff = GetNow(); + statement.BindTime(0, expiration_cutoff); + statement.BindInt(1, static_cast<int>(blink::mojom::StorageType::kTemporary)); base::Time stale_cutoff = GetNow() - base::Days(400); - statement_stale.BindTime(1, stale_cutoff); - statement_stale.BindTime(2, stale_cutoff); + statement.BindTime(2, stale_cutoff); + statement.BindTime(3, stale_cutoff); + base::Time orphan_cutoff = GetNow() - base::Days(1); + statement.BindTime(4, orphan_cutoff); + statement.BindTime(5, orphan_cutoff); + // Filter and count returned buckets. QuotaErrorOr<BucketInfo> bucket; - uint64_t buckets_found = 0; - while ((bucket = BucketInfoFromSqlStatement(statement_stale)).has_value()) { + std::set<BucketInfo> expired_buckets; + uint64_t stale_buckets_found = 0; + uint64_t orphan_buckets_found = 0; + while ((bucket = BucketInfoFromSqlStatement(statement)).has_value()) { // Only the default bucket is persisted by `navigator.storage.persist()`. const GURL read_gurl = bucket->storage_key.origin().GetURL(); if (bucket->is_default() && special_storage_policy && @@ -867,43 +872,18 @@ special_storage_policy->IsStorageUnlimited(read_gurl))) { continue; } + if (bucket->storage_key.nonce() || + bucket->storage_key.top_level_site().opaque()) { + orphan_buckets_found++; + } else if (bucket->expiration.is_null() || + bucket->expiration > expiration_cutoff) { + stale_buckets_found++; + } expired_buckets.insert(*bucket); - buckets_found++; } - base::UmaHistogramCounts100000("Quota.StaleBucketCount", buckets_found); - - // Return early if we don't need to gather orphan buckets as well. - if (!base::FeatureList::IsEnabled(features::kEvictOrphanQuotaStorage)) { - return expired_buckets; - } - - // We gather orphan buckets in a different fetch round so that we can count - // the amount found. After launch it may be worth merging these queries. - // We only need to check for ^1 and ^4 are these are indicators for the - // presence of a nonce in the storage key. - // For more on StorageKey encoding see EncodedAttribute in - // third_party/blink/common/storage_key/storage_key.cc - // clang-format off - static constexpr char kSqlOrphan[] = - "SELECT " BUCKET_INFO_FIELDS_SELECTOR - "FROM buckets " - "WHERE storage_key REGEXP '.*\\^(1|4).*' AND " - "last_accessed < ? AND last_modified < ?"; - // clang-format on - last_operation_ = "GetOrphan"; - sql::Statement statement_orphan( - db_->GetCachedStatement(SQL_FROM_HERE, kSqlOrphan)); - base::Time orphan_cutoff = GetNow() - base::Days(1); - statement_orphan.BindTime(0, orphan_cutoff); - statement_orphan.BindTime(1, orphan_cutoff); - - buckets_found = 0; - while ((bucket = BucketInfoFromSqlStatement(statement_orphan)).has_value()) { - expired_buckets.insert(*bucket); - buckets_found++; - } - base::UmaHistogramCounts100000("Quota.OrphanBucketCount", buckets_found); - + base::UmaHistogramCounts100000("Quota.StaleBucketCount", stale_buckets_found); + base::UmaHistogramCounts100000("Quota.OrphanBucketCount", + orphan_buckets_found); return expired_buckets; }
diff --git a/storage/browser/quota/quota_database_unittest.cc b/storage/browser/quota/quota_database_unittest.cc index 463e093..017c589f6 100644 --- a/storage/browser/quota/quota_database_unittest.cc +++ b/storage/browser/quota/quota_database_unittest.cc
@@ -79,15 +79,11 @@ // Test parameter indicates if the database should be created for incognito // mode, if stale buckets should be evicted, and if orphan buckets should be // evicted. -class QuotaDatabaseTest - : public testing::TestWithParam<std::tuple<bool, bool, bool>> { +class QuotaDatabaseTest : public testing::TestWithParam<bool> { public: QuotaDatabaseTest() { clock_ = std::make_unique<base::SimpleTestClock>(); QuotaDatabase::SetClockForTesting(clock_.get()); - feature_list_.InitWithFeatureStates( - {{features::kEvictStaleQuotaStorage, evict_stale_buckets()}, - {features::kEvictOrphanQuotaStorage, evict_orphan_buckets()}}); } protected: @@ -100,11 +96,7 @@ void TearDown() override { ASSERT_TRUE(temp_directory_.Delete()); } - bool use_in_memory_db() const { return std::get<0>(GetParam()); } - - bool evict_stale_buckets() const { return std::get<1>(GetParam()); } - - bool evict_orphan_buckets() const { return std::get<2>(GetParam()); } + bool use_in_memory_db() const { return GetParam(); } base::SimpleTestClock* clock() { return clock_.get(); } @@ -200,7 +192,6 @@ private: base::test::SingleThreadTaskEnvironment task_environment_; base::ScopedTempDir temp_directory_; - base::test::ScopedFeatureList feature_list_; std::unique_ptr<base::SimpleTestClock> clock_; }; @@ -1259,12 +1250,12 @@ // long as it's our first check. clock()->SetNow(base::Time::Now() + base::Minutes(1)); ASSERT_OK_AND_ASSIGN(stale_buckets, db.GetExpiredBuckets(nullptr)); - EXPECT_EQ(evict_stale_buckets() ? 2U : 1U, stale_buckets.size()); + EXPECT_EQ(2U, stale_buckets.size()); ASSERT_OK_AND_ASSIGN(stale_buckets, db.GetExpiredBuckets(nullptr)); EXPECT_EQ(1u, stale_buckets.size()); db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(stale_buckets, db.GetExpiredBuckets(nullptr)); - EXPECT_EQ(evict_stale_buckets() ? 2U : 1U, stale_buckets.size()); + EXPECT_EQ(2U, stale_buckets.size()); // 399 days ago isn't enough to be stale. EXPECT_EQ(db.SetBucketLastAccessTime(named_bucket.id, @@ -1281,7 +1272,7 @@ clock()->SetNow(base::Time::Now() + base::Days(1)); db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(stale_buckets, db.GetExpiredBuckets(nullptr)); - EXPECT_EQ(evict_stale_buckets() ? 2U : 1U, stale_buckets.size()); + EXPECT_EQ(2U, stale_buckets.size()); // A default bucket can be stale. EXPECT_EQ(db.SetBucketLastAccessTime(default_bucket.id, @@ -1292,7 +1283,7 @@ QuotaError::kNone); db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(stale_buckets, db.GetExpiredBuckets(nullptr)); - EXPECT_EQ(evict_stale_buckets() ? 3U : 1U, stale_buckets.size()); + EXPECT_EQ(3U, stale_buckets.size()); // A persistent bucket cannot be stale. EXPECT_EQ(db.SetBucketLastAccessTime(persistent_bucket.id, @@ -1303,31 +1294,31 @@ QuotaError::kNone); db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(stale_buckets, db.GetExpiredBuckets(nullptr)); - EXPECT_EQ(evict_stale_buckets() ? 3U : 1U, stale_buckets.size()); + EXPECT_EQ(3U, stale_buckets.size()); // Special storage policies are respected for default buckets. auto policy = base::MakeRefCounted<MockSpecialStoragePolicy>(); policy->AddUnlimited(default_bucket.storage_key.origin().GetURL()); db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(stale_buckets, db.GetExpiredBuckets(policy.get())); - EXPECT_EQ(evict_stale_buckets() ? 2U : 1U, stale_buckets.size()); + EXPECT_EQ(2U, stale_buckets.size()); policy = base::MakeRefCounted<MockSpecialStoragePolicy>(); policy->AddDurable(default_bucket.storage_key.origin().GetURL()); db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(stale_buckets, db.GetExpiredBuckets(policy.get())); - EXPECT_EQ(evict_stale_buckets() ? 2U : 1U, stale_buckets.size()); + EXPECT_EQ(2U, stale_buckets.size()); // Special storage policies are not respected for named buckets. policy = base::MakeRefCounted<MockSpecialStoragePolicy>(); policy->AddUnlimited(named_bucket.storage_key.origin().GetURL()); db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(stale_buckets, db.GetExpiredBuckets(policy.get())); - EXPECT_EQ(evict_stale_buckets() ? 3U : 1U, stale_buckets.size()); + EXPECT_EQ(3U, stale_buckets.size()); policy = base::MakeRefCounted<MockSpecialStoragePolicy>(); policy->AddDurable(named_bucket.storage_key.origin().GetURL()); db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(stale_buckets, db.GetExpiredBuckets(policy.get())); - EXPECT_EQ(evict_stale_buckets() ? 3U : 1U, stale_buckets.size()); + EXPECT_EQ(3U, stale_buckets.size()); } TEST_P(QuotaDatabaseTest, Orphan) { @@ -1397,10 +1388,8 @@ EXPECT_EQ(0, histograms.GetTotalSum("Quota.OrphanBucketCount")); db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(buckets, db.GetExpiredBuckets(nullptr)); - EXPECT_EQ((evict_stale_buckets() && evict_orphan_buckets()) ? 1U : 0U, - buckets.size()); - EXPECT_EQ((evict_stale_buckets() && evict_orphan_buckets()) ? 1 : 0, - histograms.GetTotalSum("Quota.OrphanBucketCount")); + EXPECT_EQ(1U, buckets.size()); + EXPECT_EQ(1, histograms.GetTotalSum("Quota.OrphanBucketCount")); } // Third party bucket doesn't qualify, even if it's old. @@ -1416,10 +1405,8 @@ db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(std::set<BucketInfo> buckets, db.GetExpiredBuckets(nullptr)); - EXPECT_EQ((evict_stale_buckets() && evict_orphan_buckets()) ? 1U : 0U, - buckets.size()); - EXPECT_EQ((evict_stale_buckets() && evict_orphan_buckets()) ? 1 : 0, - histograms.GetTotalSum("Quota.OrphanBucketCount")); + EXPECT_EQ(1U, buckets.size()); + EXPECT_EQ(1, histograms.GetTotalSum("Quota.OrphanBucketCount")); EXPECT_EQ(db.SetBucketLastAccessTime(third_party_bucket.id, base::Time::Now() - base::Days(2)), @@ -1429,10 +1416,8 @@ QuotaError::kNone); db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(buckets, db.GetExpiredBuckets(nullptr)); - EXPECT_EQ((evict_stale_buckets() && evict_orphan_buckets()) ? 1 : 0U, - buckets.size()); - EXPECT_EQ((evict_stale_buckets() && evict_orphan_buckets()) ? 2 : 0, - histograms.GetTotalSum("Quota.OrphanBucketCount")); + EXPECT_EQ(1U, buckets.size()); + EXPECT_EQ(2, histograms.GetTotalSum("Quota.OrphanBucketCount")); } // Third party nonce bucket does qualify, but only if it's old and we haven't @@ -1451,10 +1436,8 @@ db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(std::set<BucketInfo> buckets, db.GetExpiredBuckets(nullptr)); - EXPECT_EQ((evict_stale_buckets() && evict_orphan_buckets()) ? 1U : 0U, - buckets.size()); - EXPECT_EQ((evict_stale_buckets() && evict_orphan_buckets()) ? 1 : 0, - histograms.GetTotalSum("Quota.OrphanBucketCount")); + EXPECT_EQ(1U, buckets.size()); + EXPECT_EQ(1, histograms.GetTotalSum("Quota.OrphanBucketCount")); EXPECT_EQ(db.SetBucketLastAccessTime(third_party_nonce_bucket.id, base::Time::Now() - base::Days(2)), @@ -1464,14 +1447,11 @@ QuotaError::kNone); ASSERT_OK_AND_ASSIGN(buckets, db.GetExpiredBuckets(nullptr)); EXPECT_EQ(0U, buckets.size()); - EXPECT_EQ((evict_stale_buckets() && evict_orphan_buckets()) ? 1 : 0, - histograms.GetTotalSum("Quota.OrphanBucketCount")); + EXPECT_EQ(1, histograms.GetTotalSum("Quota.OrphanBucketCount")); db.SetAlreadyEvictedStaleStorageForTesting(false); ASSERT_OK_AND_ASSIGN(buckets, db.GetExpiredBuckets(nullptr)); - EXPECT_EQ((evict_stale_buckets() && evict_orphan_buckets()) ? 2U : 0U, - buckets.size()); - EXPECT_EQ((evict_stale_buckets() && evict_orphan_buckets()) ? 3 : 0, - histograms.GetTotalSum("Quota.OrphanBucketCount")); + EXPECT_EQ(2U, buckets.size()); + EXPECT_EQ(3, histograms.GetTotalSum("Quota.OrphanBucketCount")); } } @@ -1510,11 +1490,6 @@ EXPECT_EQ(non_default_id, lru_result.begin()->id); } -INSTANTIATE_TEST_SUITE_P( - All, - QuotaDatabaseTest, - testing::Combine(/*use_in_memory_db=*/testing::Bool(), - /*evict_stale_buckets=*/testing::Bool(), - /*evict_orphan_buckets=*/testing::Bool())); +INSTANTIATE_TEST_SUITE_P(All, QuotaDatabaseTest, testing::Bool()); } // namespace storage
diff --git a/storage/browser/quota/quota_features.cc b/storage/browser/quota/quota_features.cc index 8cb0f67..90eb086 100644 --- a/storage/browser/quota/quota_features.cc +++ b/storage/browser/quota/quota_features.cc
@@ -36,14 +36,6 @@ &kStorageQuotaSettings, "ShouldRemainAvailableRatio", 0.1 /* 10% */ }; -BASE_FEATURE(kEvictOrphanQuotaStorage, - "EvictOrphanQuotaStorage", - base::FEATURE_ENABLED_BY_DEFAULT); - -BASE_FEATURE(kEvictStaleQuotaStorage, - "EvictStaleQuotaStorage", - base::FEATURE_ENABLED_BY_DEFAULT); - // A kill switch for the new reported quota being a static value. BASE_FEATURE(kStaticStorageQuota, "StaticStorageQuota",
diff --git a/storage/browser/quota/quota_features.h b/storage/browser/quota/quota_features.h index c003a5c..d258255 100644 --- a/storage/browser/quota/quota_features.h +++ b/storage/browser/quota/quota_features.h
@@ -21,17 +21,6 @@ extern const base::FeatureParam<double> kShouldRemainAvailableBytes; extern const base::FeatureParam<double> kShouldRemainAvailableRatio; -// Clears quota storage for opaque origins used in prior browsing sessions as -// they will no longer be reachable. See crbug.com/40281870 for more info. -// If kEvictStaleQuotaStorage is off this has no impact. -COMPONENT_EXPORT(STORAGE_BROWSER) -BASE_DECLARE_FEATURE(kEvictOrphanQuotaStorage); - -// Clears quota storage last accessed/modified more than 400 days ago. -// See crbug.com/40281870 for more info. -COMPONENT_EXPORT(STORAGE_BROWSER) -BASE_DECLARE_FEATURE(kEvictStaleQuotaStorage); - COMPONENT_EXPORT(STORAGE_BROWSER) BASE_DECLARE_FEATURE(kStaticStorageQuota); } // namespace features
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 0e210a1..cdf7831 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -754,21 +754,6 @@ ] } ], - "AppBoundDataReencrypt": [ - { - "platforms": [ - "windows" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "AppBoundDataReencrypt" - ] - } - ] - } - ], "AppCloseRefreshClankStudy": [ { "platforms": [ @@ -6544,7 +6529,9 @@ "min_os_version": "16151.0.0", "hardware_classes": [ "brya", - "corsola" + "corsola", + "geralt", + "nissa" ] } ] @@ -8174,7 +8161,9 @@ "DirectCompositorThreadIpc": [ { "platforms": [ - "linux" + "chromeos", + "linux", + "mac" ], "experiments": [ { @@ -9989,21 +9978,6 @@ ] } ], - "FetchGaiaHashOnSignIn": [ - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "FetchGaiaHashOnSignIn" - ] - } - ] - } - ], "FetchLaterAPI": [ { "platforms": [ @@ -14363,6 +14337,29 @@ ] } ], + "MemorySaverModeRenderTuning": [ + { + "platforms": [ + "android", + "android_webview", + "chromeos", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "params": { + "available_memory_threshold_mb": "740" + }, + "enable_features": [ + "MemorySaverModeRenderTuning" + ] + } + ] + } + ], "MerchantTrust": [ { "platforms": [ @@ -16768,24 +16765,6 @@ ] } ], - "PdfCr23": [ - { - "platforms": [ - "chromeos", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "PdfCr23" - ] - } - ] - } - ], "PdfInkSignatures": [ { "platforms": [ @@ -23032,47 +23011,6 @@ ] } ], - "StaleStorageCleanup": [ - { - "platforms": [ - "android", - "chromeos", - "ios", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "DeleteOrphanLocalStorageOnStartup", - "DeleteStaleLocalStorageOnStartup", - "EvictOrphanQuotaStorage", - "EvictStaleQuotaStorage" - ] - }, - { - "name": "Auto_Dogfood", - "enable_features": [ - "DeleteOrphanLocalStorageOnStartup", - "DeleteStaleLocalStorageOnStartup", - "EvictOrphanQuotaStorage", - "EvictStaleQuotaStorage" - ] - }, - { - "name": "Opt_In_Dogfood", - "enable_features": [ - "DeleteOrphanLocalStorageOnStartup", - "DeleteStaleLocalStorageOnStartup", - "EvictOrphanQuotaStorage", - "EvictStaleQuotaStorage" - ] - } - ] - } - ], "StandardizedBrowserZoom": [ { "platforms": [
diff --git a/third_party/android_deps/autorolled/build.gradle.template b/third_party/android_deps/autorolled/build.gradle.template index c274c59..2419ac6 100644 --- a/third_party/android_deps/autorolled/build.gradle.template +++ b/third_party/android_deps/autorolled/build.gradle.template
@@ -20,7 +20,7 @@ dependencies { // Use testCompile to have is_robolectric = true set on targets. - testCompileLatest "org.robolectric:robolectric:latest" + testCompileLatest "org.robolectric:robolectric:+" } task setUpRepository(type: BuildConfigGenerator) {
diff --git a/third_party/androidx/build.gradle b/third_party/androidx/build.gradle index cc43ebef..18ed101 100644 --- a/third_party/androidx/build.gradle +++ b/third_party/androidx/build.gradle
@@ -296,7 +296,7 @@ google() maven { // This URL is generated by the fetch_all_androidx.py script. - url 'https://androidx.dev/snapshots/builds/13154669/artifacts/repository' + url 'https://androidx.dev/snapshots/builds/13156333/artifacts/repository' } mavenCentral() }
diff --git a/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom b/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom index ff34492..3e3d569 100644 --- a/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom +++ b/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom
@@ -903,6 +903,7 @@ kRowRuleStyle = 844, kGapRulePaintOrder = 845, kRowRuleWidth = 846, + kRowRuleColor = 847, // 1. Add new features above this line (don't change the assigned numbers of // the existing items).
diff --git a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom index dfe7b1e9..ff0184f8 100644 --- a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom +++ b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom
@@ -4720,6 +4720,21 @@ kCSSVarFallbackCycle = 5334, kCSSAttrFallbackCycle = 5335, kCSSRainbowGradientPattern = 5336, + kWebAppManifestStartUrl = 5337, + kWebAppManifestDisplay = 5338, + kWebAppManifestIcons = 5339, + kWebAppManifestScreenshots = 5340, + kWebAppManifestScope = 5341, + kWebAppManifestLockScreen = 5342, + kWebAppManifestNoteTaking = 5343, + kWebAppManifestPermissionsPolicy = 5344, + kWebAppManifestPrefer_Related_Applications = 5345, + kWebAppManifestThemeColor = 5346, + kWebAppManifestBackgroundColor = 5347, + kWebAppManifestTranslations = 5348, + kWebAppManifestTabStrip = 5349, + kWebAppManifestVersion = 5350, + kWebAppManifestRelated_Applications = 5351, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots. Also don't add extra
diff --git a/third_party/blink/renderer/core/animation/color_property_functions.cc b/third_party/blink/renderer/core/animation/color_property_functions.cc index ae2cf51..4c2a1e7 100644 --- a/third_party/blink/renderer/core/animation/color_property_functions.cc +++ b/third_party/blink/renderer/core/animation/color_property_functions.cc
@@ -42,7 +42,11 @@ case CSSPropertyID::kOutlineColor: return OptionalStyleColor(style.OutlineColor()); case CSSPropertyID::kColumnRuleColor: + // TODO(crbug.com/357648037): Look into supporting multiple colors and + // deprecating the legacy method. return OptionalStyleColor(style.ColumnRuleColor().GetLegacyValue()); + case CSSPropertyID::kRowRuleColor: + return OptionalStyleColor(style.RowRuleColor().GetLegacyValue()); case CSSPropertyID::kTextEmphasisColor: return OptionalStyleColor(style.TextEmphasisColor()); case CSSPropertyID::kWebkitTextFillColor: @@ -101,6 +105,9 @@ case CSSPropertyID::kColumnRuleColor: return OptionalStyleColor( style.InternalVisitedColumnRuleColor().GetLegacyValue()); + case CSSPropertyID::kRowRuleColor: + // TODO(crbug.com/357648037): Update to use multiple values. + return OptionalStyleColor(style.RowRuleColor().GetLegacyValue()); case CSSPropertyID::kTextEmphasisColor: return OptionalStyleColor(style.InternalVisitedTextEmphasisColor()); case CSSPropertyID::kWebkitTextFillColor: @@ -178,6 +185,9 @@ case CSSPropertyID::kColumnRuleColor: builder.SetColumnRuleColor(GapDataList<StyleColor>(style_color)); return; + case CSSPropertyID::kRowRuleColor: + builder.SetRowRuleColor(GapDataList<StyleColor>(style_color)); + return; case CSSPropertyID::kWebkitTextStrokeColor: builder.SetTextStrokeColor(style_color); return;
diff --git a/third_party/blink/renderer/core/animation/css_color_interpolation_type.cc b/third_party/blink/renderer/core/animation/css_color_interpolation_type.cc index beb32c9..5cd82b3b 100644 --- a/third_party/blink/renderer/core/animation/css_color_interpolation_type.cc +++ b/third_party/blink/renderer/core/animation/css_color_interpolation_type.cc
@@ -111,8 +111,7 @@ InterpolableColor* CSSColorInterpolationType::MaybeCreateInterpolableColor( const CSSValue& value, - mojom::blink::ColorScheme color_scheme, - const ui::ColorProvider* color_provider) { + const StyleResolverState* state) { if (auto* color_value = DynamicTo<cssvalue::CSSColor>(value)) { return CreateInterpolableColor(color_value->Value()); } @@ -125,6 +124,13 @@ // animation. if (!StyleColor::IsColorKeyword(identifier_value->GetValueID())) return nullptr; + + mojom::blink::ColorScheme color_scheme = + state ? state->StyleBuilder().UsedColorScheme() + : mojom::blink::ColorScheme::kLight; + const ui::ColorProvider* color_provider = + state ? state->GetDocument().GetColorProviderForPainting(color_scheme) + : nullptr; return CreateInterpolableColor(identifier_value->GetValueID(), color_scheme, color_provider); } @@ -255,14 +261,8 @@ } } - mojom::blink::ColorScheme color_scheme = - state ? state->StyleBuilder().UsedColorScheme() - : mojom::blink::ColorScheme::kLight; - const ui::ColorProvider* color_provider = - state ? state->GetDocument().GetColorProviderForPainting(color_scheme) - : nullptr; InterpolableColor* interpolable_color = - MaybeCreateInterpolableColor(value, color_scheme, color_provider); + MaybeCreateInterpolableColor(value, state); if (!interpolable_color) { return nullptr; }
diff --git a/third_party/blink/renderer/core/animation/css_color_interpolation_type.h b/third_party/blink/renderer/core/animation/css_color_interpolation_type.h index 0798d1f..d56293b 100644 --- a/third_party/blink/renderer/core/animation/css_color_interpolation_type.h +++ b/third_party/blink/renderer/core/animation/css_color_interpolation_type.h
@@ -50,8 +50,7 @@ const ui::ColorProvider* color_provider); static InterpolableColor* MaybeCreateInterpolableColor( const CSSValue&, - mojom::blink::ColorScheme color_scheme, - const ui::ColorProvider* color_provider); + const StyleResolverState*); static BaseInterpolableColor* CreateBaseInterpolableColor( const StyleColor&,
diff --git a/third_party/blink/renderer/core/animation/css_filter_list_interpolation_type.cc b/third_party/blink/renderer/core/animation/css_filter_list_interpolation_type.cc index 3078871..f8f2cf2 100644 --- a/third_party/blink/renderer/core/animation/css_filter_list_interpolation_type.cc +++ b/third_party/blink/renderer/core/animation/css_filter_list_interpolation_type.cc
@@ -196,14 +196,8 @@ wtf_size_t length = list.length(); auto* interpolable_list = MakeGarbageCollected<InterpolableList>(length); for (wtf_size_t i = 0; i < length; i++) { - mojom::blink::ColorScheme color_scheme = - state ? state->StyleBuilder().UsedColorScheme() - : mojom::blink::ColorScheme::kLight; - const ui::ColorProvider* color_provider = - state ? state->GetDocument().GetColorProviderForPainting(color_scheme) - : nullptr; - InterpolableFilter* result = InterpolableFilter::MaybeConvertCSSValue( - list.Item(i), color_scheme, color_provider); + InterpolableFilter* result = + InterpolableFilter::MaybeConvertCSSValue(list.Item(i), state); if (!result) { return nullptr; }
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 b9fa633..7e5e99a 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
@@ -252,6 +252,7 @@ case CSSPropertyID::kTextDecorationColor: case CSSPropertyID::kTextEmphasisColor: case CSSPropertyID::kColumnRuleColor: + case CSSPropertyID::kRowRuleColor: case CSSPropertyID::kWebkitTextStrokeColor: applicable_types->push_back( std::make_unique<CSSColorInterpolationType>(used_property));
diff --git a/third_party/blink/renderer/core/animation/css_paint_interpolation_type.cc b/third_party/blink/renderer/core/animation/css_paint_interpolation_type.cc index ae7065d..19178f46 100644 --- a/third_party/blink/renderer/core/animation/css_paint_interpolation_type.cc +++ b/third_party/blink/renderer/core/animation/css_paint_interpolation_type.cc
@@ -133,15 +133,8 @@ const CSSValue& value, const StyleResolverState* state, ConversionCheckers&) const { - mojom::blink::ColorScheme color_scheme = - state ? state->StyleBuilder().UsedColorScheme() - : mojom::blink::ColorScheme::kLight; - const ui::ColorProvider* color_provider = - state ? state->GetDocument().GetColorProviderForPainting(color_scheme) - : nullptr; InterpolableValue* interpolable_color = - CSSColorInterpolationType::MaybeCreateInterpolableColor( - value, color_scheme, color_provider); + CSSColorInterpolationType::MaybeCreateInterpolableColor(value, state); if (!interpolable_color) return nullptr; return InterpolationValue(interpolable_color);
diff --git a/third_party/blink/renderer/core/animation/css_shadow_list_interpolation_type.cc b/third_party/blink/renderer/core/animation/css_shadow_list_interpolation_type.cc index 9a4bd62..b9ea63f 100644 --- a/third_party/blink/renderer/core/animation/css_shadow_list_interpolation_type.cc +++ b/third_party/blink/renderer/core/animation/css_shadow_list_interpolation_type.cc
@@ -137,15 +137,8 @@ const auto& value_list = To<CSSValueList>(value); return ListInterpolationFunctions::CreateList( value_list.length(), [&value_list, state](wtf_size_t index) { - mojom::blink::ColorScheme color_scheme = - state ? state->StyleBuilder().UsedColorScheme() - : mojom::blink::ColorScheme::kLight; - const ui::ColorProvider* color_provider = - state - ? state->GetDocument().GetColorProviderForPainting(color_scheme) - : nullptr; return InterpolationValue(InterpolableShadow::MaybeConvertCSSValue( - value_list.Item(index), color_scheme, color_provider)); + value_list.Item(index), state)); }); }
diff --git a/third_party/blink/renderer/core/animation/interpolable_filter.cc b/third_party/blink/renderer/core/animation/interpolable_filter.cc index bfc3537d7..2f487b88 100644 --- a/third_party/blink/renderer/core/animation/interpolable_filter.cc +++ b/third_party/blink/renderer/core/animation/interpolable_filter.cc
@@ -148,8 +148,7 @@ // static InterpolableFilter* InterpolableFilter::MaybeConvertCSSValue( const CSSValue& css_value, - mojom::blink::ColorScheme color_scheme, - const ui::ColorProvider* color_provider) { + const StyleResolverState* state) { if (css_value.IsURIValue()) return nullptr; @@ -180,8 +179,7 @@ break; case FilterOperation::OperationType::kDropShadow: - value = InterpolableShadow::MaybeConvertCSSValue( - filter.Item(0), color_scheme, color_provider); + value = InterpolableShadow::MaybeConvertCSSValue(filter.Item(0), state); break; default:
diff --git a/third_party/blink/renderer/core/animation/interpolable_filter.h b/third_party/blink/renderer/core/animation/interpolable_filter.h index 2759da5..fdf1070 100644 --- a/third_party/blink/renderer/core/animation/interpolable_filter.h +++ b/third_party/blink/renderer/core/animation/interpolable_filter.h
@@ -35,10 +35,8 @@ double zoom, mojom::blink::ColorScheme color_scheme, const ui::ColorProvider* color_provider); - static InterpolableFilter* MaybeConvertCSSValue( - const CSSValue&, - mojom::blink::ColorScheme color_scheme, - const ui::ColorProvider* color_provider); + static InterpolableFilter* MaybeConvertCSSValue(const CSSValue&, + const StyleResolverState*); // Create an InterpolableFilter representing the 'initial value for // interpolation' for the given OperationType.
diff --git a/third_party/blink/renderer/core/animation/interpolable_shadow.cc b/third_party/blink/renderer/core/animation/interpolable_shadow.cc index d8b01b3..479658d 100644 --- a/third_party/blink/renderer/core/animation/interpolable_shadow.cc +++ b/third_party/blink/renderer/core/animation/interpolable_shadow.cc
@@ -24,12 +24,17 @@ } InterpolableColor* MaybeConvertColor(const CSSValue* value, - mojom::blink::ColorScheme color_scheme, - const ui::ColorProvider* color_provider) { + const StyleResolverState* state) { if (value) { - return CSSColorInterpolationType::MaybeCreateInterpolableColor( - *value, color_scheme, color_provider); + return CSSColorInterpolationType::MaybeCreateInterpolableColor(*value, + state); } + mojom::blink::ColorScheme color_scheme = + state ? state->StyleBuilder().UsedColorScheme() + : mojom::blink::ColorScheme::kLight; + const ui::ColorProvider* color_provider = + state ? state->GetDocument().GetColorProviderForPainting(color_scheme) + : nullptr; return CSSColorInterpolationType::CreateInterpolableColor( StyleColor::CurrentColor(), color_scheme, color_provider); } @@ -83,8 +88,7 @@ // static InterpolableShadow* InterpolableShadow::MaybeConvertCSSValue( const CSSValue& value, - mojom::blink::ColorScheme color_scheme, - const ui::ColorProvider* color_provider) { + const StyleResolverState* state) { const auto* shadow = DynamicTo<CSSShadowValue>(value); if (!shadow) { return nullptr; @@ -102,8 +106,7 @@ InterpolableLength* y = MaybeConvertLength(shadow->y.Get()); InterpolableLength* blur = MaybeConvertLength(shadow->blur.Get()); InterpolableLength* spread = MaybeConvertLength(shadow->spread.Get()); - InterpolableColor* color = - MaybeConvertColor(shadow->color, color_scheme, color_provider); + InterpolableColor* color = MaybeConvertColor(shadow->color, state); // If any of the conversations failed, we can't represent this CSSValue. if (!x || !y || !blur || !spread || !color) {
diff --git a/third_party/blink/renderer/core/animation/interpolable_shadow.h b/third_party/blink/renderer/core/animation/interpolable_shadow.h index 80017d7d..c8d4cc03 100644 --- a/third_party/blink/renderer/core/animation/interpolable_shadow.h +++ b/third_party/blink/renderer/core/animation/interpolable_shadow.h
@@ -40,10 +40,8 @@ const ui::ColorProvider* color_provider); static InterpolableShadow* CreateNeutral(); - static InterpolableShadow* MaybeConvertCSSValue( - const CSSValue&, - mojom::blink::ColorScheme color_scheme, - const ui::ColorProvider* color_provider); + static InterpolableShadow* MaybeConvertCSSValue(const CSSValue&, + const StyleResolverState*); // Helpers for CSSListInterpolationFunctions. static PairwiseInterpolationValue MaybeMergeSingles(InterpolableValue* start,
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5 index 0d06285..c0663bad 100644 --- a/third_party/blink/renderer/core/css/css_properties.json5 +++ b/third_party/blink/renderer/core/css/css_properties.json5
@@ -6523,6 +6523,22 @@ invalidate: ["paint"], }, { + name: "row-rule-color", + property_methods: ["ParseSingleValue", "CSSValueFromComputedStyleInternal", "ColorIncludingFallback"], + interpolable: true, + field_group: "*", + field_template: "external", + include_paths: ["third_party/blink/renderer/core/style/gap_data_list.h", + "third_party/blink/renderer/core/css/style_color.h"], + default_value: "GapDataList<StyleColor>::DefaultGapColorDataList()", + type_name: "GapDataList<StyleColor>", + keywords: ["currentcolor"], + typedom_types: ["Keyword"], + converter: "ConvertGapDecorationColorDataList", + invalidate: ["paint"], + runtime_flag: "CSSGapDecoration", + }, + { name: "column-rule-style", property_methods: ["ParseSingleValue", "CSSValueFromComputedStyleInternal"], field_group: "*",
diff --git a/third_party/blink/renderer/core/css/css_property_equality.cc b/third_party/blink/renderer/core/css/css_property_equality.cc index d0c6c6b5..998fb2c 100644 --- a/third_party/blink/renderer/core/css/css_property_equality.cc +++ b/third_party/blink/renderer/core/css/css_property_equality.cc
@@ -817,6 +817,8 @@ return a.ColumnRuleColor() == b.ColumnRuleColor() && a.InternalVisitedColumnRuleColor() == b.InternalVisitedColumnRuleColor(); + case CSSPropertyID::kRowRuleColor: + return a.RowRuleColor() == b.RowRuleColor(); case CSSPropertyID::kColumnRuleWidth: return a.ColumnRuleWidth() == b.ColumnRuleWidth(); case CSSPropertyID::kRowRuleWidth:
diff --git a/third_party/blink/renderer/core/css/css_selector.cc b/third_party/blink/renderer/core/css/css_selector.cc index 480290df..4e78362b 100644 --- a/third_party/blink/renderer/core/css/css_selector.cc +++ b/third_party/blink/renderer/core/css/css_selector.cc
@@ -24,16 +24,13 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/css/css_selector.h" #include <algorithm> +#include <iterator> #include <memory> +#include "base/compiler_specific.h" #include "style_rule.h" #include "third_party/blink/renderer/core/css/css_markup.h" #include "third_party/blink/renderer/core/css/css_selector_list.h" @@ -714,13 +711,11 @@ const NameToPseudoStruct* pseudo_type_map; const NameToPseudoStruct* pseudo_type_map_end; if (has_arguments) { - pseudo_type_map = kPseudoTypeWithArgumentsMap; - pseudo_type_map_end = - kPseudoTypeWithArgumentsMap + std::size(kPseudoTypeWithArgumentsMap); + pseudo_type_map = std::begin(kPseudoTypeWithArgumentsMap); + pseudo_type_map_end = std::end(kPseudoTypeWithArgumentsMap); } else { - pseudo_type_map = kPseudoTypeWithoutArgumentsMap; - pseudo_type_map_end = kPseudoTypeWithoutArgumentsMap + - std::size(kPseudoTypeWithoutArgumentsMap); + pseudo_type_map = std::begin(kPseudoTypeWithoutArgumentsMap); + pseudo_type_map_end = std::end(kPseudoTypeWithoutArgumentsMap); } const NameToPseudoStruct* match = std::lower_bound( pseudo_type_map, pseudo_type_map_end, name, @@ -2046,8 +2041,8 @@ for (unsigned i = 0; i < size - 1; i++) { // strcmp/strncmp would be much better here, but unfortunately they aren't // constexpr. - const char* current_string = map[i].string; - const char* next_string = map[i + 1].string; + const char* current_string = UNSAFE_TODO(map[i].string); + const char* next_string = UNSAFE_TODO(map[i + 1].string); while (true) { if (*current_string > *next_string) { return false; @@ -2061,8 +2056,8 @@ if (!*next_string) { return false; } - current_string++; - next_string++; + UNSAFE_TODO(current_string++); + UNSAFE_TODO(next_string++); } } return true;
diff --git a/third_party/blink/renderer/core/css/css_selector_list.cc b/third_party/blink/renderer/core/css/css_selector_list.cc index ba5155d2..46d9cdbe 100644 --- a/third_party/blink/renderer/core/css/css_selector_list.cc +++ b/third_party/blink/renderer/core/css/css_selector_list.cc
@@ -24,14 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/css/css_selector_list.h" #include <memory> + +#include "base/compiler_specific.h" #include "third_party/blink/renderer/core/css/css_selector.h" #include "third_party/blink/renderer/platform/wtf/text/string_builder.h" @@ -57,7 +54,8 @@ AdditionalBytes(sizeof(CSSSelector) * (length - 1)), base::PassKey<CSSSelectorList>()); for (unsigned i = 0; i < length; ++i) { - new (&list->first_selector_[i]) CSSSelector(first_selector_[i]); + UNSAFE_TODO(new (&list->first_selector_[i]) + CSSSelector(first_selector_[i])); } return list; @@ -67,7 +65,9 @@ const CSSSelector* selector_list) { HeapVector<CSSSelector> selectors; for (const CSSSelector* selector = selector_list; selector; - selector = selector->IsLastInSelectorList() ? nullptr : (selector + 1)) { + selector = selector->IsLastInSelectorList() + ? nullptr + : UNSAFE_TODO(selector + 1)) { selectors.push_back(*selector); } return selectors; @@ -78,7 +78,8 @@ CSSSelector* selector_array) { std::uninitialized_move(selector_vector.begin(), selector_vector.end(), selector_array); - selector_array[selector_vector.size() - 1].SetLastInSelectorList(true); + UNSAFE_TODO(selector_array[selector_vector.size() - 1]) + .SetLastInSelectorList(true); } CSSSelectorList* CSSSelectorList::AdoptSelectorVector( @@ -100,7 +101,7 @@ } const CSSSelector* current = First(); while (!current->IsLastInSelectorList()) { - ++current; + UNSAFE_TODO(++current); } return SelectorIndex(*current) + 1; } @@ -120,7 +121,8 @@ HeapVector<CSSSelector>& result) { bool renested_any = false; for (const CSSSelector* current = selector_list; current; - current = current->IsLastInSelectorList() ? nullptr : ++current) { + current = current->IsLastInSelectorList() ? nullptr + : UNSAFE_TODO(++current)) { std::optional<CSSSelector> renested = current->Renest(new_parent); renested_any |= renested.has_value(); result.push_back(renested.value_or(*current)); @@ -165,8 +167,8 @@ } for (int i = 0;; ++i) { - visitor->Trace(first_selector_[i]); - if (first_selector_[i].IsLastInSelectorList()) { + visitor->Trace(UNSAFE_TODO(first_selector_[i])); + if (UNSAFE_TODO(first_selector_[i].IsLastInSelectorList())) { break; } }
diff --git a/third_party/blink/renderer/core/css/css_variable_data.cc b/third_party/blink/renderer/core/css/css_variable_data.cc index cfb8c56..e34ba44 100644 --- a/third_party/blink/renderer/core/css/css_variable_data.cc +++ b/third_party/blink/renderer/core/css/css_variable_data.cc
@@ -2,15 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/css/css_variable_data.h" #include <algorithm> +#include "base/compiler_specific.h" #include "third_party/blink/renderer/core/css/css_syntax_definition.h" #include "third_party/blink/renderer/core/css/parser/css_parser_context.h" #include "third_party/blink/renderer/core/css/parser/css_parser_token_stream.h" @@ -163,10 +159,10 @@ has_dashed_functions_(has_dashed_functions) { if (is_8bit_) { std::ranges::copy(original_text.Span8(), - reinterpret_cast<LChar*>(this + 1)); + UNSAFE_TODO(reinterpret_cast<LChar*>(this + 1))); } else { std::ranges::copy(original_text.Span16(), - reinterpret_cast<UChar*>(this + 1)); + UNSAFE_TODO(reinterpret_cast<UChar*>(this + 1))); } }
diff --git a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc index b1b513c8..c491325 100644 --- a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc +++ b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
@@ -2426,6 +2426,38 @@ style.ColumnRuleColor(), style, value_phase); } +const CSSValue* RowRuleColor::ParseSingleValue( + CSSParserTokenStream& stream, + const CSSParserContext& context, + const CSSParserLocalContext&) const { + return css_parsing_utils::ConsumeGapDecorationPropertyList( + stream, context, CSSGapDecorationPropertyType::kColor); +} + +const blink::Color RowRuleColor::ColorIncludingFallback( + bool visited_link, + const ComputedStyle& style, + bool* is_current_color) const { + DCHECK(!visited_link); + const StyleColor& row_rule_color = style.RowRuleColor().GetLegacyValue(); + // TODO(crbug.com/357648037): Update to force any colors that appear in a list + // value. + if (style.ShouldForceColor(row_rule_color)) { + return style.GetInternalForcedCurrentColor(is_current_color); + } + return row_rule_color.Resolve(style.GetCurrentColor(), + style.UsedColorScheme(), is_current_color); +} + +const CSSValue* RowRuleColor::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const LayoutObject*, + bool allow_visited_style, + CSSValuePhase value_phase) const { + return ComputedStyleUtils::ValueForGapDecorationColorDataList( + style.RowRuleColor(), style, value_phase); +} + const CSSValue* ColumnRuleStyle::ParseSingleValue( CSSParserTokenStream& stream, const CSSParserContext& context,
diff --git a/third_party/blink/renderer/core/css/rule_set.cc b/third_party/blink/renderer/core/css/rule_set.cc index f9669ee0..2a5c7b0 100644 --- a/third_party/blink/renderer/core/css/rule_set.cc +++ b/third_party/blink/renderer/core/css/rule_set.cc
@@ -28,17 +28,13 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/css/rule_set.h" #include <memory> #include <type_traits> #include <vector> +#include "base/compiler_specific.h" #include "base/containers/contains.h" #include "base/substring_set_matcher/substring_set_matcher.h" #include "third_party/blink/public/common/features.h" @@ -205,10 +201,10 @@ // captures most of the benefits. (It is fairly common, especially with // nesting, to have the same sets of parents in consecutive rules.) if (bloom_hash_size_ > 0 && bloom_hash_pos_ >= bloom_hash_size_ && - std::equal( + UNSAFE_TODO(std::equal( bloom_hash_backing.begin() + bloom_hash_pos_ - bloom_hash_size_, bloom_hash_backing.begin() + bloom_hash_pos_, - bloom_hash_backing.begin() + bloom_hash_pos_)) { + bloom_hash_backing.begin() + bloom_hash_pos_))) { bloom_hash_backing.resize(bloom_hash_pos_); bloom_hash_pos_ -= bloom_hash_size_; } @@ -218,7 +214,8 @@ Vector<uint16_t>& new_backing, unsigned new_position) { unsigned new_pos = new_backing.size(); - new_backing.insert(new_backing.size(), old_backing.data() + bloom_hash_pos_, + new_backing.insert(new_backing.size(), + UNSAFE_TODO(old_backing.data() + bloom_hash_pos_), bloom_hash_size_); bloom_hash_pos_ = new_pos; position_ = new_position; @@ -422,7 +419,7 @@ static void MarkAsCoveredByBucketing(CSSSelector& selector, Func&& should_mark_func) { for (CSSSelector* s = &selector;; - ++s) { // Termination condition within loop. + UNSAFE_TODO(++s)) { // Termination condition within loop. if (should_mark_func(*s)) { s->SetCoveredByBucketing(true); } @@ -446,7 +443,7 @@ static void UnmarkAsCoveredByBucketing(CSSSelector& selector) { for (CSSSelector* s = &selector;; - ++s) { // Termination condition within loop. + UNSAFE_TODO(++s)) { // Termination condition within loop. s->SetCoveredByBucketing(false); if (s->IsLastInComplexSelector() || s->Relation() != CSSSelector::kSubSelector) { @@ -999,7 +996,7 @@ return parent; } } - } while (!(selector++)->IsLastInSelectorList()); + } while (!UNSAFE_TODO((selector++)->IsLastInSelectorList())); return nullptr; }
diff --git a/third_party/blink/renderer/core/css/selector_query.cc b/third_party/blink/renderer/core/css/selector_query.cc index 8fd4472..1d2f04c 100644 --- a/third_party/blink/renderer/core/css/selector_query.cc +++ b/third_party/blink/renderer/core/css/selector_query.cc
@@ -24,16 +24,12 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/css/selector_query.h" #include <memory> #include <utility> +#include "base/compiler_specific.h" #include "base/memory/ptr_util.h" #include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom-blink.h" #include "third_party/blink/renderer/core/css/check_pseudo_has_cache_scope.h" @@ -431,8 +427,8 @@ Element& element) const { SelectorChecker checker(SelectorChecker::kQueryingRules); for (unsigned offset : selector_start_offsets_) { - if (SelectorMatches(*(selector_list_->First() + offset), element, root_node, - checker)) { + if (SelectorMatches(UNSAFE_TODO(*(selector_list_->First() + offset)), + element, root_node, checker)) { return true; } }
diff --git a/third_party/blink/renderer/core/css/style_rule.cc b/third_party/blink/renderer/core/css/style_rule.cc index 0d645ba..f1f66d24 100644 --- a/third_party/blink/renderer/core/css/style_rule.cc +++ b/third_party/blink/renderer/core/css/style_rule.cc
@@ -19,13 +19,9 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/css/style_rule.h" +#include "base/compiler_specific.h" #include "third_party/blink/renderer/core/css/cascade_layer.h" #include "third_party/blink/renderer/core/css/css_container_rule.h" #include "third_party/blink/renderer/core/css/css_counter_style_rule.h" @@ -500,7 +496,8 @@ StyleRule::StyleRule(const StyleRule& other, size_t flattened_size) : StyleRuleBase(kStyle), properties_(other.Properties().MutableCopy()) { for (unsigned i = 0; i < flattened_size; ++i) { - new (&SelectorArray()[i]) CSSSelector(other.SelectorArray()[i]); + UNSAFE_TODO(new (&SelectorArray()[i]) + CSSSelector(other.SelectorArray()[i])); } if (other.child_rules_ != nullptr) { // Since we are getting copied, we also need to copy any child rules @@ -523,9 +520,8 @@ selector->~CSSSelector(); if (is_last) { break; - } else { - ++selector; } + UNSAFE_TODO(++selector); } } @@ -556,7 +552,7 @@ const CSSSelector* current = SelectorArray(); do { visitor->Trace(*current); - } while (!(current++)->IsLastInSelectorList()); + } while (!(UNSAFE_TODO(current++))->IsLastInSelectorList()); StyleRuleBase::TraceAfterDispatch(visitor); }
diff --git a/third_party/blink/renderer/core/dom/element_data.cc b/third_party/blink/renderer/core/dom/element_data.cc index c1a8341e..853ad907 100644 --- a/third_party/blink/renderer/core/dom/element_data.cc +++ b/third_party/blink/renderer/core/dom/element_data.cc
@@ -28,13 +28,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/dom/element_data.h" +#include "base/compiler_specific.h" #include "third_party/blink/renderer/core/css/css_property_value_set.h" #include "third_party/blink/renderer/core/dom/qualified_name.h" #include "third_party/blink/renderer/platform/wtf/size_assertions.h" @@ -135,12 +131,12 @@ const Vector<Attribute, kAttributePrealloc>& attributes) : ElementData(attributes.size()) { for (unsigned i = 0; i < bit_field_.get<ArraySize>(); ++i) - new (&attribute_array_[i]) Attribute(attributes[i]); + UNSAFE_TODO(new (&attribute_array_[i]) Attribute(attributes[i])); } ShareableElementData::~ShareableElementData() { for (unsigned i = 0; i < bit_field_.get<ArraySize>(); ++i) - attribute_array_[i].~Attribute(); + UNSAFE_TODO(attribute_array_[i]).~Attribute(); } ShareableElementData::ShareableElementData(const UniqueElementData& other) @@ -153,8 +149,10 @@ other.presentation_attribute_style_->ImmutableCopyIfNeeded(); } - for (unsigned i = 0; i < bit_field_.get<ArraySize>(); ++i) - new (&attribute_array_[i]) Attribute(other.attribute_vector_.at(i)); + for (unsigned i = 0; i < bit_field_.get<ArraySize>(); ++i) { + UNSAFE_TODO(new (&attribute_array_[i]) + Attribute(other.attribute_vector_.at(i))); + } } ShareableElementData* ShareableElementData::CreateWithAttributes( @@ -189,8 +187,9 @@ unsigned length = other.Attributes().size(); attribute_vector_.reserve(length); - for (unsigned i = 0; i < length; ++i) - attribute_vector_.UncheckedAppend(other.attribute_array_[i]); + for (unsigned i = 0; i < length; ++i) { + attribute_vector_.UncheckedAppend(UNSAFE_TODO(other.attribute_array_[i])); + } } ShareableElementData* UniqueElementData::MakeShareableCopy() const {
diff --git a/third_party/blink/renderer/core/dom/element_data_cache.cc b/third_party/blink/renderer/core/dom/element_data_cache.cc index a9a0807..aa56bc7 100644 --- a/third_party/blink/renderer/core/dom/element_data_cache.cc +++ b/third_party/blink/renderer/core/dom/element_data_cache.cc
@@ -24,13 +24,9 @@ * */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/dom/element_data_cache.h" +#include "base/compiler_specific.h" #include "third_party/blink/renderer/core/dom/element_data.h" namespace blink { @@ -43,9 +39,10 @@ inline bool HasSameAttributes( const Vector<Attribute, kAttributePrealloc>& attributes, ShareableElementData& element_data) { - return std::equal( - attributes.begin(), attributes.end(), element_data.attribute_array_, - element_data.attribute_array_ + element_data.Attributes().size()); + return std::equal(attributes.begin(), attributes.end(), + element_data.attribute_array_, + UNSAFE_TODO(element_data.attribute_array_ + + element_data.Attributes().size())); } ShareableElementData*
diff --git a/third_party/blink/renderer/core/dom/events/event_listener_map.cc b/third_party/blink/renderer/core/dom/events/event_listener_map.cc index de4a43a..5845e61 100644 --- a/third_party/blink/renderer/core/dom/events/event_listener_map.cc +++ b/third_party/blink/renderer/core/dom/events/event_listener_map.cc
@@ -30,14 +30,10 @@ * */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/dom/events/event_listener_map.h" #include "base/bits.h" +#include "base/compiler_specific.h" #include "base/debug/crash_logging.h" #include "third_party/blink/renderer/bindings/core/v8/v8_event_listener_options.h" #include "third_party/blink/renderer/core/dom/events/add_event_listener_options_resolved.h" @@ -162,7 +158,7 @@ RegisteredEventListener** registered_listener) { EventListenerVector::iterator end = listener_vector->end(); for (EventListenerVector::iterator iter = listener_vector->begin(); - iter != end; ++iter) { + iter != end; UNSAFE_TODO(++iter)) { if ((*iter)->Matches(listener, options)) { (*iter)->SetRemoved(); *registered_listener = *iter;
diff --git a/third_party/blink/renderer/core/dom/node_rare_data.cc b/third_party/blink/renderer/core/dom/node_rare_data.cc index 1f92406..7f47d1e 100644 --- a/third_party/blink/renderer/core/dom/node_rare_data.cc +++ b/third_party/blink/renderer/core/dom/node_rare_data.cc
@@ -110,7 +110,7 @@ dom_parts_->clear(); } else { // This is the very slow case - multiple parts for a single node. - PartsList new_list; + TemporaryPartsList new_list; for (auto p : *dom_parts_) { if (p != &part) { new_list.push_back(p);
diff --git a/third_party/blink/renderer/core/dom/node_rare_data.h b/third_party/blink/renderer/core/dom/node_rare_data.h index 2bf5e83c..339e70a 100644 --- a/third_party/blink/renderer/core/dom/node_rare_data.h +++ b/third_party/blink/renderer/core/dom/node_rare_data.h
@@ -42,7 +42,8 @@ class Part; class ScrollTimeline; -using PartsList = HeapDeque<Member<Part>>; +using PartsList = GCedHeapDeque<Member<Part>>; +using TemporaryPartsList = HeapDeque<Member<Part>>; class NodeMutationObserverData final : public GarbageCollected<NodeMutationObserverData> {
diff --git a/third_party/blink/renderer/core/frame/pausable_script_executor.cc b/third_party/blink/renderer/core/frame/pausable_script_executor.cc index 9b344e09..2d674ce 100644 --- a/third_party/blink/renderer/core/frame/pausable_script_executor.cc +++ b/third_party/blink/renderer/core/frame/pausable_script_executor.cc
@@ -2,18 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/frame/pausable_script_executor.h" #include <memory> #include <utility> #include <vector> -#include "base/check.h" +#include "base/compiler_specific.h" #include "base/functional/callback.h" #include "base/logging.h" #include "base/numerics/safe_conversions.h" @@ -190,8 +185,10 @@ v8::Local<v8::Value> argv[]) : function_(isolate, function), receiver_(isolate, receiver) { args_.reserve(base::checked_cast<wtf_size_t>(argc)); - for (int i = 0; i < argc; ++i) - args_.push_back(TraceWrapperV8Reference<v8::Value>(isolate, argv[i])); + for (int i = 0; i < argc; ++i) { + args_.push_back( + TraceWrapperV8Reference<v8::Value>(isolate, UNSAFE_TODO(argv[i]))); + } } v8::LocalVector<v8::Value> V8FunctionExecutor::Execute(
diff --git a/third_party/blink/renderer/core/html/canvas/canvas_image_source.h b/third_party/blink/renderer/core/html/canvas/canvas_image_source.h index 683b4e0..f19ad8f 100644 --- a/third_party/blink/renderer/core/html/canvas/canvas_image_source.h +++ b/third_party/blink/renderer/core/html/canvas/canvas_image_source.h
@@ -30,7 +30,6 @@ #include "base/memory/scoped_refptr.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/graphics/flush_reason.h" -#include "third_party/blink/renderer/platform/graphics/graphics_types.h" #include "third_party/blink/renderer/platform/graphics/image_orientation.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" #include "ui/gfx/geometry/size_f.h" @@ -52,6 +51,10 @@ class CORE_EXPORT CanvasImageSource { public: + enum AlphaDisposition { + kPremultiplyAlpha, + kDontChangeAlpha, + }; virtual scoped_refptr<Image> GetSourceImageForCanvas( FlushReason, SourceImageStatus*,
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 0383085..3de879d8 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
@@ -1828,10 +1828,13 @@ *status = kNormalSourceImageStatus; + if (alpha_disposition == kDontChangeAlpha) { + return image; + } // If the alpha_disposition is already correct, or the image is opaque, this // is a no-op. - return StaticBitmapImageTransform::GetWithAlphaDisposition( - reason, std::move(image), alpha_disposition); + return StaticBitmapImageTransform::GetWithAlphaPremultiplied( + reason, std::move(image)); } bool HTMLCanvasElement::WouldTaintOrigin() const {
diff --git a/third_party/blink/renderer/core/html/forms/internal_popup_menu.cc b/third_party/blink/renderer/core/html/forms/internal_popup_menu.cc index 20a3a9d..971e46b 100644 --- a/third_party/blink/renderer/core/html/forms/internal_popup_menu.cc +++ b/third_party/blink/renderer/core/html/forms/internal_popup_menu.cc
@@ -20,7 +20,7 @@ #include "third_party/blink/renderer/core/dom/element_traversal.h" #include "third_party/blink/renderer/core/dom/events/scoped_event_queue.h" #include "third_party/blink/renderer/core/exported/web_view_impl.h" -#include "third_party/blink/renderer/core/frame/local_frame.h" +#include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/frame/web_frame_widget_impl.h" #include "third_party/blink/renderer/core/geometry/dom_rect.h"
diff --git a/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc b/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc index eea1993e..acdc5da 100644 --- a/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc +++ b/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc
@@ -766,15 +766,15 @@ const gfx::SizeF&, const AlphaDisposition alpha_disposition) { *status = kNormalSourceImageStatus; - if (!image_) + if (!image_) { return nullptr; - - scoped_refptr<StaticBitmapImage> image = image_; - + } + if (alpha_disposition == kDontChangeAlpha) { + return image_; + } // If the alpha_disposition is already correct, or the image is opaque, this // is a no-op. - return StaticBitmapImageTransform::GetWithAlphaDisposition( - reason, std::move(image), alpha_disposition); + return StaticBitmapImageTransform::GetWithAlphaPremultiplied(reason, image_); } gfx::SizeF ImageBitmap::ElementSize(
diff --git a/third_party/blink/renderer/core/input/mouse_event_manager.cc b/third_party/blink/renderer/core/input/mouse_event_manager.cc index 755b3e6..db39191 100644 --- a/third_party/blink/renderer/core/input/mouse_event_manager.cc +++ b/third_party/blink/renderer/core/input/mouse_event_manager.cc
@@ -475,39 +475,35 @@ } void MouseEventManager::NodeChildrenWillBeRemoved(ContainerNode& container) { - if (RuntimeEnabledFeatures::BoundaryEventDispatchTracksNodeRemovalEnabled()) { - return; - } - if (container == mousedown_element_) { - return; - } - if (!mousedown_element_ || - !container.IsShadowIncludingInclusiveAncestorOf(*mousedown_element_)) { - return; - } - mousedown_element_ = nullptr; + HandleRemoveSubtree(container, /*inclusive=*/false); } void MouseEventManager::NodeWillBeRemoved(Node& node_to_be_removed) { - if (mousedown_element_ && - node_to_be_removed.IsShadowIncludingInclusiveAncestorOf( - *mousedown_element_)) { + HandleRemoveSubtree(node_to_be_removed, /*inclusive=*/true); +} + +void MouseEventManager::HandleRemoveSubtree(Node& node, bool inclusive) { + Node* remaining_node = inclusive ? node.parentNode() : &node; + if (mousedown_element_ && (inclusive || mousedown_element_ != node) && + node.IsShadowIncludingInclusiveAncestorOf(*mousedown_element_)) { // We don't dispatch click events if the mousedown node is removed // before a mouseup event. It is compatible with IE and Firefox. mousedown_element_ = nullptr; } - if (mouse_press_node_ && - node_to_be_removed.IsShadowIncludingInclusiveAncestorOf( - *mouse_press_node_)) { + if (mouse_press_node_ && (inclusive || mouse_press_node_ != node) && + node.IsShadowIncludingInclusiveAncestorOf(*mouse_press_node_)) { // If the mouse_press_node_ is removed, we should dispatch future default // keyboard actions (i.e. scrolling) to the still connected parent. - mouse_press_node_ = node_to_be_removed.parentNode(); + mouse_press_node_ = remaining_node; } if (RuntimeEnabledFeatures::BoundaryEventDispatchTracksNodeRemovalEnabled() && - element_under_mouse_ && - node_to_be_removed.IsShadowIncludingInclusiveAncestorOf( - *element_under_mouse_)) { - element_under_mouse_ = node_to_be_removed.parentElement(); + element_under_mouse_ && (inclusive || element_under_mouse_ != node) && + node.IsShadowIncludingInclusiveAncestorOf(*element_under_mouse_)) { + Element* remaining_element = DynamicTo<Element>(remaining_node); + if (!remaining_element) { + remaining_element = remaining_node->parentElement(); + } + element_under_mouse_ = remaining_element; original_element_under_mouse_removed_ = true; } }
diff --git a/third_party/blink/renderer/core/input/mouse_event_manager.h b/third_party/blink/renderer/core/input/mouse_event_manager.h index 25405ac..e9d0cca 100644 --- a/third_party/blink/renderer/core/input/mouse_event_manager.h +++ b/third_party/blink/renderer/core/input/mouse_event_manager.h
@@ -182,6 +182,7 @@ void ClearDragDataTransfer(); DataTransfer* CreateDraggingDataTransfer() const; + void HandleRemoveSubtree(Node& node, bool inclusive); void ResetDragSource(); bool HoverStateDirty();
diff --git a/third_party/blink/renderer/core/input/mouse_event_manager_test.cc b/third_party/blink/renderer/core/input/mouse_event_manager_test.cc index d524627..33e9919 100644 --- a/third_party/blink/renderer/core/input/mouse_event_manager_test.cc +++ b/third_party/blink/renderer/core/input/mouse_event_manager_test.cc
@@ -18,11 +18,6 @@ namespace blink { -namespace { -// Long enough to ensure scroll animation should be complete. -const double kScrollAnimationDuration = 100.0; -} // namespace - class MouseEventManagerTest : public SimTest { protected: EventHandler& GetEventHandler() { @@ -51,57 +46,6 @@ } }; -// TODO(crbug.com/1325058): Re-enable this test -TEST_F(MouseEventManagerTest, DISABLED_MousePressNodeRemoved) { - SimRequest request("https://example.com/test.html", "text/html"); - LoadURL("https://example.com/test.html"); - request.Complete(R"HTML( - <!DOCTYPE html> - <style> - #scroller { - overflow: auto; - height: 100px; - } - #target { - width: 100px; - height: 100px; - background: green; - } - .spacer, body { - height: 200vh; - } - </style> - <body> - <div id="scroller"> - <div id="target"></div> - <div class="spacer"></div> - </div> - </body> - )HTML"); - Compositor().BeginFrame(); - EXPECT_FLOAT_EQ( - GetDocument().getElementById(AtomicString("scroller"))->scrollTop(), 0.0); - - // Click on the target node to set the mouse_press_node_. - GetEventHandler().HandleMousePressEvent(CreateTestMouseEvent( - WebInputEvent::Type::kMouseDown, gfx::PointF(50, 50))); - - // Now remove this node. - GetDocument().getElementById(AtomicString("target"))->remove(); - Compositor().BeginFrame(); - - // Now press the down key. This should still scroll the nested scroller as it - // was still the scroller that was clicked in. - SendKeyDown(VKEY_DOWN); - Compositor().ResetLastFrameTime(); - // Start scroll animation. - Compositor().BeginFrame(); - // Jump to end of scroll animation. - Compositor().BeginFrame(kScrollAnimationDuration); - EXPECT_GT(GetDocument().getElementById(AtomicString("scroller"))->scrollTop(), - 0.0); -} - TEST_F(MouseEventManagerTest, HoverEffectAfterNav) { LocalFrame* frame = MainFrame().GetFrame();
diff --git a/third_party/blink/renderer/core/intersection_observer/intersection_observer_test.cc b/third_party/blink/renderer/core/intersection_observer/intersection_observer_test.cc index 2244e9ca..9af39fa 100644 --- a/third_party/blink/renderer/core/intersection_observer/intersection_observer_test.cc +++ b/third_party/blink/renderer/core/intersection_observer/intersection_observer_test.cc
@@ -13,6 +13,7 @@ #include "third_party/blink/renderer/bindings/core/v8/v8_union_double_doublesequence.h" #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/exported/web_view_impl.h" +#include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/frame/web_local_frame_impl.h" #include "third_party/blink/renderer/core/intersection_observer/element_intersection_observer_data.h"
diff --git a/third_party/blink/renderer/core/layout/forms/layout_fieldset.cc b/third_party/blink/renderer/core/layout/forms/layout_fieldset.cc index 7bd9d4f..6a43ff8 100644 --- a/third_party/blink/renderer/core/layout/forms/layout_fieldset.cc +++ b/third_party/blink/renderer/core/layout/forms/layout_fieldset.cc
@@ -143,6 +143,8 @@ child_style_builder.SetColumnRuleColor( GapDataList<StyleColor>(StyleColor(LayoutObject::ResolveColor( StyleRef(), GetCSSPropertyColumnRuleColor())))); + child_style_builder.SetRowRuleColor(GapDataList<StyleColor>(StyleColor( + LayoutObject::ResolveColor(StyleRef(), GetCSSPropertyRowRuleColor())))); child_style_builder.SetColumnRuleStyle(StyleRef().ColumnRuleStyle()); child_style_builder.SetRowRuleStyle(StyleRef().RowRuleStyle()); child_style_builder.SetColumnRuleWidth(
diff --git a/third_party/blink/renderer/core/layout/gap_fragment_data.h b/third_party/blink/renderer/core/layout/gap_fragment_data.h index c90e69be7..4aa48d9 100644 --- a/third_party/blink/renderer/core/layout/gap_fragment_data.h +++ b/third_party/blink/renderer/core/layout/gap_fragment_data.h
@@ -13,6 +13,26 @@ class GapFragmentData { public: + // GapIntersection points are used to paint gap decorations. An + // intersection point occurs: + // 1. At the center of an intersection between a gap and the container edge. + // 2. At the center of an intersection between gaps in different directions. + // https://drafts.csswg.org/css-gaps-1/#layout-painting + class GapIntersection { + public: + GapIntersection(LayoutUnit column_offset, LayoutUnit row_offset) + : column_offset(column_offset), row_offset(row_offset) {} + + LayoutUnit column_offset; + LayoutUnit row_offset; + + // Represents whether the intersection point is blocked before or after + // due to the presence of a spanning item. + bool is_blocked_before = false; + bool is_blocked_after = false; + }; + + // TODO(samomekarajr): Take this out when done with the new implementation. // GapBoundary represents the start and end offsets of a single gap. struct GapBoundary { DISALLOW_NEW();
diff --git a/third_party/blink/renderer/core/layout/grid/grid_data.h b/third_party/blink/renderer/core/layout/grid/grid_data.h index 6a035300f..a12f305 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_data.h +++ b/third_party/blink/renderer/core/layout/grid/grid_data.h
@@ -230,44 +230,61 @@ Vector<GridTreeNode, 16> tree_data_; }; +using GridLayoutTreePtr = scoped_refptr<const GridLayoutTree>; + // This class represents a subtree in a `GridLayoutTree` and mostly serves two // purposes: provide seamless iteration over the tree structure and compare // input subtrees to invalidate a subgrid's cached layout result. -class GridLayoutSubtree - : public GridSubtree<GridLayoutSubtree, - scoped_refptr<const GridLayoutTree>> { +class GridLayoutSubtree : public GridSubtree<GridLayoutTree> { DISALLOW_NEW(); public: GridLayoutSubtree() = default; - explicit GridLayoutSubtree(scoped_refptr<const GridLayoutTree> layout_tree, + explicit GridLayoutSubtree(GridLayoutTreePtr layout_tree, wtf_size_t subtree_root = 0) - : GridSubtree(std::move(layout_tree), subtree_root) {} + : layout_tree_(std::move(layout_tree)) { + SetSubtreeRoot(LayoutTree(), subtree_root); + } - GridLayoutSubtree(const scoped_refptr<const GridLayoutTree>& layout_tree, - wtf_size_t parent_end_index, - wtf_size_t subtree_root) - : GridSubtree(layout_tree, parent_end_index, subtree_root) {} + GridLayoutSubtree FirstChild() const { + return GridLayoutSubtree(layout_tree_, + GridSubtree::FirstChild(LayoutTree())); + } + + GridLayoutSubtree NextSibling() const { + return GridLayoutSubtree(layout_tree_, + GridSubtree::NextSibling(LayoutTree())); + } // This method is meant to be used for layout invalidation, so we only care // about comparing the layout data of both subtrees. bool operator==(const GridLayoutSubtree& other) const { - return (grid_tree_ && other.grid_tree_) - ? grid_tree_->AreSubtreesEqual(subtree_root_, *other.grid_tree_, - other.subtree_root_) - : !grid_tree_ && !other.grid_tree_; + return (layout_tree_ && other.layout_tree_) + ? layout_tree_->AreSubtreesEqual( + subtree_root_, *other.layout_tree_, other.subtree_root_) + : !layout_tree_ && !other.layout_tree_; } bool HasUnresolvedGeometry() const { - DCHECK(grid_tree_); - return grid_tree_->HasUnresolvedGeometry(subtree_root_); + return LayoutTree().HasUnresolvedGeometry(subtree_root_); } const GridLayoutData& LayoutData() const { - DCHECK(grid_tree_); - return grid_tree_->LayoutData(subtree_root_); + return LayoutTree().LayoutData(subtree_root_); } + + private: + GridLayoutSubtree(const GridLayoutTreePtr& layout_tree, GridSubtree subtree) + : GridSubtree(std::move(subtree)), layout_tree_(layout_tree) {} + + const GridLayoutTree& LayoutTree() const { + DCHECK(layout_tree_); + return *layout_tree_; + } + + // Pointer to the layout tree shared by multiple subtree instances. + GridLayoutTreePtr layout_tree_{nullptr}; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc index d9619b0..cf6783f 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc
@@ -1321,7 +1321,7 @@ } void GridLayoutAlgorithm::ComputeGridItemBaselines( - const scoped_refptr<const GridLayoutTree>& layout_tree, + const GridLayoutTreePtr& layout_tree, const GridSizingSubtree& sizing_subtree, GridTrackSizingDirection track_direction, SizingConstraint sizing_constraint) const { @@ -1803,7 +1803,7 @@ } void GridLayoutAlgorithm::ComputeBaselineAlignment( - const scoped_refptr<const GridLayoutTree>& layout_tree, + const GridLayoutTreePtr& layout_tree, const GridSizingSubtree& sizing_subtree, const SubgriddedItemData& opt_subgrid_data, const std::optional<GridTrackSizingDirection>& opt_track_direction,
diff --git a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.h b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.h index 45cd3a7..fe619659 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.h
@@ -102,11 +102,10 @@ // Determines the major/minor alignment baselines for each row/column based on // each item in `grid_items`, and stores the results in `track_collection`. - void ComputeGridItemBaselines( - const scoped_refptr<const GridLayoutTree>& layout_tree, - const GridSizingSubtree& sizing_subtree, - GridTrackSizingDirection track_direction, - SizingConstraint sizing_constraint) const; + void ComputeGridItemBaselines(const GridLayoutTreePtr& layout_tree, + const GridSizingSubtree& sizing_subtree, + GridTrackSizingDirection track_direction, + SizingConstraint sizing_constraint) const; std::unique_ptr<GridLayoutTrackCollection> CreateSubgridTrackCollection( const SubgriddedItemData& subgrid_data, @@ -150,7 +149,7 @@ // Performs the final baseline alignment pass of a grid sizing subtree. void ComputeBaselineAlignment( - const scoped_refptr<const GridLayoutTree>& layout_tree, + const GridLayoutTreePtr& layout_tree, const GridSizingSubtree& sizing_subtree, const SubgriddedItemData& opt_subgrid_data, const std::optional<GridTrackSizingDirection>& opt_track_direction,
diff --git a/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.cc b/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.cc index 01fedd5..82e04d3 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.cc +++ b/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.cc
@@ -18,7 +18,7 @@ return tree_copy; } -scoped_refptr<const GridLayoutTree> GridSizingTree::FinalizeTree() const { +GridLayoutTreePtr GridSizingTree::FinalizeTree() const { Vector<GridLayoutTree::GridTreeNode, 16> layout_tree_data; layout_tree_data.ReserveInitialCapacity(tree_data_.size());
diff --git a/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h b/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h index 85648e6..823a3034 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h +++ b/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h
@@ -124,7 +124,7 @@ // Creates a copy of the current grid geometry for the entire tree in a new // `GridLayoutTree` instance, which doesn't hold the grid items. - scoped_refptr<const GridLayoutTree> FinalizeTree() const; + GridLayoutTreePtr FinalizeTree() const; wtf_size_t Size() const { return tree_data_.size(); } GridTreeNode& TreeRootData() const { return At(0); } @@ -164,8 +164,7 @@ // This class represents a subtree in a `GridSizingTree` and provides seamless // traversal over the tree and access to the sizing tree's lookup methods. -class GridSizingSubtree - : public GridSubtree<GridSizingSubtree, const GridSizingTree*> { +class GridSizingSubtree : public GridSubtree<GridSizingTree> { STACK_ALLOCATED(); public: @@ -173,58 +172,71 @@ explicit GridSizingSubtree(const GridSizingTree& sizing_tree, wtf_size_t subtree_root = 0) - : GridSubtree(&sizing_tree, subtree_root) {} + : sizing_tree_(&sizing_tree) { + SetSubtreeRoot(sizing_tree, subtree_root); + } - GridSizingSubtree(const GridSizingTree* sizing_tree, - wtf_size_t parent_end_index, - wtf_size_t subtree_root) - : GridSubtree(sizing_tree, parent_end_index, subtree_root) {} + GridSizingSubtree FirstChild() const { + return GridSizingSubtree(sizing_tree_, + GridSubtree::FirstChild(SizingTree())); + } + + GridSizingSubtree NextSibling() const { + return GridSizingSubtree(sizing_tree_, + GridSubtree::NextSibling(SizingTree())); + } SubgriddedItemData LookupSubgriddedItemData( const GridItemData& grid_item) const { - DCHECK(grid_tree_); - return grid_tree_->LookupSubgriddedItemData(grid_item); + return SizingTree().LookupSubgriddedItemData(grid_item); } wtf_size_t LookupSubgridIndex(const GridItemData& subgrid_data) const { - DCHECK(grid_tree_); DCHECK(subgrid_data.IsSubgrid()); - return grid_tree_->LookupSubgridIndex(subgrid_data.node); + return SizingTree().LookupSubgridIndex(subgrid_data.node); } GridSizingSubtree SubgridSizingSubtree( const GridItemData& subgrid_data) const { - DCHECK(grid_tree_); DCHECK(subgrid_data.IsSubgrid()); + const auto& sizing_tree = SizingTree(); return GridSizingSubtree( - *grid_tree_, - /*subtree_root=*/grid_tree_->LookupSubgridIndex(subgrid_data.node)); + sizing_tree, + /*subtree_root=*/sizing_tree.LookupSubgridIndex(subgrid_data.node)); } // This method is only intended to be used to validate that the given grid // node is the respective root of the current subtree. bool HasValidRootFor(const BlockNode& grid_node) const { - return grid_tree_ && - grid_tree_->LookupSubgridIndex(grid_node) == subtree_root_; + return sizing_tree_ && + sizing_tree_->LookupSubgridIndex(grid_node) == subtree_root_; } - GridItems& GetGridItems() const { - DCHECK(grid_tree_); - return grid_tree_->At(subtree_root_).GetGridItems(); - } - - GridLayoutData& LayoutData() const { - DCHECK(grid_tree_); - return grid_tree_->At(subtree_root_).layout_data; - } + GridItems& GetGridItems() const { return SubtreeRoot().GetGridItems(); } + GridLayoutData& LayoutData() const { return SubtreeRoot().layout_data; } GridSizingTrackCollection& SizingCollection( GridTrackSizingDirection track_direction) const { - DCHECK(grid_tree_); - return grid_tree_->At(subtree_root_) - .layout_data.SizingCollection(track_direction); + return SubtreeRoot().layout_data.SizingCollection(track_direction); } + + private: + GridSizingSubtree(const GridSizingTree* sizing_tree, GridSubtree subtree) + : GridSubtree(std::move(subtree)), sizing_tree_(sizing_tree) {} + + const GridSizingTree& SizingTree() const { + DCHECK(sizing_tree_); + return *sizing_tree_; + } + + GridSizingTree::GridTreeNode& SubtreeRoot() const { + DCHECK(sizing_tree_); + return sizing_tree_->At(subtree_root_); + } + + // Pointer to the sizing tree shared by multiple subtree instances. + const GridSizingTree* sizing_tree_{nullptr}; }; inline constexpr GridSizingSubtree kNoGridSizingSubtree;
diff --git a/third_party/blink/renderer/core/layout/grid/grid_subtree.h b/third_party/blink/renderer/core/layout/grid/grid_subtree.h index af2f8e3..fa18f6d 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_subtree.h +++ b/third_party/blink/renderer/core/layout/grid/grid_subtree.h
@@ -43,54 +43,47 @@ // next sibling for the subtree at index 5, by adding its subtree size (5 + 2) // it's equal to its parent's next sibling (aka parent's end index), so we can // determine that such subtree doesn't have a next sibling. -template <typename SubtreeType, typename GridTreePtr> +template <typename GridTree> class GridSubtree { public: - explicit operator bool() const { return static_cast<bool>(grid_tree_); } - - SubtreeType FirstChild() const { - return SubtreeType(grid_tree_, /* parent_end_index */ NextSiblingIndex(), - /* subtree_root */ subtree_root_ + 1); - } - - SubtreeType NextSibling() const { - return SubtreeType(grid_tree_, /* parent_end_index */ parent_end_index_, - /* subtree_root */ NextSiblingIndex()); - } + explicit operator bool() const { return subtree_root_ != kNotFound; } protected: GridSubtree() = default; - explicit GridSubtree(GridTreePtr grid_tree, wtf_size_t subtree_root) - : grid_tree_(std::move(grid_tree)), subtree_root_(subtree_root) { - parent_end_index_ = NextSiblingIndex(); + void SetSubtreeRoot(const GridTree& grid_tree, wtf_size_t subtree_root) { + subtree_root_ = subtree_root; + parent_end_index_ = NextSiblingIndex(grid_tree); } - GridSubtree(GridTreePtr grid_tree, - wtf_size_t parent_end_index, - wtf_size_t subtree_root) { - DCHECK_LE(subtree_root, parent_end_index); - - // If the subtree root is beyond the parent's end index, we will keep this - // instance as a null subtree to indicate the end iterator for siblings. - if (subtree_root < parent_end_index) { - grid_tree_ = std::move(grid_tree); - parent_end_index_ = parent_end_index; - subtree_root_ = subtree_root; - } + GridSubtree FirstChild(const GridTree& grid_tree) const { + return GridSubtree( + /*parent_end_index=*/NextSiblingIndex(grid_tree), + /*subtree_root=*/subtree_root_ + 1); } - // Pointer to the tree shared by multiple subtree instances. - GC_PLUGIN_IGNORE("GC API violation: https://crbug.com/389707047") - GridTreePtr grid_tree_{nullptr}; + GridSubtree NextSibling(const GridTree& grid_tree) const { + return GridSubtree(/*parent_end_index=*/parent_end_index_, + /*subtree_root=*/NextSiblingIndex(grid_tree)); + } // Index of this subtree's root node. wtf_size_t subtree_root_{kNotFound}; private: - wtf_size_t NextSiblingIndex() const { - DCHECK(grid_tree_); - const wtf_size_t subtree_size = grid_tree_->SubtreeSize(subtree_root_); + GridSubtree(wtf_size_t parent_end_index, wtf_size_t subtree_root) { + DCHECK_LE(subtree_root, parent_end_index); + + // If the subtree root is beyond the parent's end index, we will keep this + // instance as a null subtree to indicate the end iterator for siblings. + if (subtree_root < parent_end_index) { + parent_end_index_ = parent_end_index; + subtree_root_ = subtree_root; + } + } + + wtf_size_t NextSiblingIndex(const GridTree& grid_tree) const { + const auto subtree_size = grid_tree.SubtreeSize(subtree_root_); DCHECK_GT(subtree_size, 0u); return subtree_root_ + subtree_size;
diff --git a/third_party/blink/renderer/core/loader/document_loader_auto_speculation_rules_test.cc b/third_party/blink/renderer/core/loader/document_loader_auto_speculation_rules_test.cc index e87eac3b..ff802fec 100644 --- a/third_party/blink/renderer/core/loader/document_loader_auto_speculation_rules_test.cc +++ b/third_party/blink/renderer/core/loader/document_loader_auto_speculation_rules_test.cc
@@ -10,6 +10,7 @@ #include "third_party/blink/public/common/loader/javascript_framework_detection.h" #include "third_party/blink/public/mojom/loader/javascript_framework_detection.mojom-shared.h" #include "third_party/blink/renderer/core/frame/frame_test_helpers.h" +#include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/loader/document_loader.h" #include "third_party/blink/renderer/core/speculation_rules/auto_speculation_rules_test_helper.h" #include "third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h"
diff --git a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc index 3cad5c8..8d763cf 100644 --- a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc +++ b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
@@ -279,10 +279,13 @@ *status = image ? kNormalSourceImageStatus : kInvalidSourceImageStatus; + if (alpha_disposition == kDontChangeAlpha) { + return image; + } // If the alpha_disposition is already correct, or the image is opaque, this // is a no-op. - return StaticBitmapImageTransform::GetWithAlphaDisposition( - reason, std::move(image), alpha_disposition); + return StaticBitmapImageTransform::GetWithAlphaPremultiplied( + reason, std::move(image)); } ScriptPromise<ImageBitmap> OffscreenCanvas::CreateImageBitmap(
diff --git a/third_party/blink/renderer/core/paint/box_decoration_data.h b/third_party/blink/renderer/core/paint/box_decoration_data.h index 71956336..305be12 100644 --- a/third_party/blink/renderer/core/paint/box_decoration_data.h +++ b/third_party/blink/renderer/core/paint/box_decoration_data.h
@@ -142,7 +142,7 @@ } bool ComputeShouldPaintGapDecorations() const { - return style_.HasColumnRule(); + return style_.HasColumnRule() || style_.HasRowRule(); } bool BorderObscuresBackgroundEdge() const;
diff --git a/third_party/blink/renderer/core/paint/box_fragment_painter.cc b/third_party/blink/renderer/core/paint/box_fragment_painter.cc index 8ecb30f..b0e8a6b 100644 --- a/third_party/blink/renderer/core/paint/box_fragment_painter.cc +++ b/third_party/blink/renderer/core/paint/box_fragment_painter.cc
@@ -1357,21 +1357,21 @@ Color rule_color; EBorderStyle rule_style; LayoutUnit rule_thickness; + // TODO(crbug.com/357648037): We are currently only painting gaps with a + // single color, but we should update this to paint with all values + // potentially set by the author. if (track_direction == kForColumns) { - // TODO(crbug.com/357648037): We are currently only painting gaps with a - // single color, but we should update this to paint with all values - // potentially set by the author. rule_color = LayoutObject::ResolveColor(style, GetCSSPropertyColumnRuleColor()); rule_style = ComputedStyle::CollapsedBorderStyle( style.ColumnRuleStyle().GetLegacyValue()); rule_thickness = LayoutUnit(style.ColumnRuleWidth().GetLegacyValue()); } else { - // TODO(crbug.com/357648037): Using hard coded values. These values should - // be retrieved from the style engine once row rules are implemented. - rule_color = Color(0, 128, 0); - rule_style = EBorderStyle::kSolid; - rule_thickness = LayoutUnit(); + rule_color = + LayoutObject::ResolveColor(style, GetCSSPropertyRowRuleColor()); + rule_style = ComputedStyle::CollapsedBorderStyle( + style.RowRuleStyle().GetLegacyValue()); + rule_thickness = LayoutUnit(style.RowRuleWidth().GetLegacyValue()); } const PhysicalRect local_rect = box_fragment_.LocalRect(); @@ -1391,18 +1391,19 @@ LayoutUnit block_start; LayoutUnit block_size; + const LayoutUnit center = (gap.start_offset + gap.end_offset) / 2; if (track_direction == kForColumns) { // For columns, paint a vertical strip at the center of the gap. - const LayoutUnit center = (gap.start_offset + gap.end_offset) / 2; inline_start = center - (rule_thickness / 2); inline_size = rule_thickness; block_start = cross_track_offset; block_size = cross_track_size; } else { + // For rows, paint a horizontal strip at the center of the gap. inline_start = cross_track_offset; inline_size = cross_track_size; - block_start = gap.start_offset; - block_size = gap.end_offset - gap.start_offset; + block_start = center - (rule_thickness / 2); + block_size = rule_thickness; } const LogicalRect gap_logical(inline_start, block_start, inline_size,
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc index 255ea93..4f5781a 100644 --- a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc +++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
@@ -1499,7 +1499,7 @@ !object.IsLayoutView(); } -// Scale transforms need effects, so that they can be considered for +// Scale transforms need effects so that they can be considered for // promotion to render surfaces if possible to improve quality of // renerdering. See crbug.com/40084005. bool FragmentPaintPropertyTreeBuilder::NeedsEffectFor2DScaleTransform() const { @@ -1507,6 +1507,11 @@ object_.IsLayoutReplaced()) { return false; } + if (object_.StyleRef().HasWillChangeTransformHint() || + object_.StyleRef().IsRunningTransformAnimationOnCompositor()) { + return false; + } + return has_scale2d_transform_ && !has_non_scale2d_transform_; } @@ -3967,6 +3972,17 @@ if (!properties || !properties->Transform()) return false; + if (auto* effect = properties->Effect()) { + // If there is already potentially an optimization to allocate a render + // surface for a scale transform (see crbug.com/40084005), we can't use + // the fast path. (However, we intentionally allow the fast path to + // happen when changing *to* a scale transform, to avoid performance + // problems detecting this situation. + if (effect->Has2DScaleTransform()) { + return false; + } + } + return true; }
diff --git a/third_party/blink/renderer/core/style/computed_style.h b/third_party/blink/renderer/core/style/computed_style.h index c1ca72f5..65fbb16 100644 --- a/third_party/blink/renderer/core/style/computed_style.h +++ b/third_party/blink/renderer/core/style/computed_style.h
@@ -262,6 +262,7 @@ friend class css_longhand::LightingColor; friend class css_longhand::OutlineColor; friend class css_longhand::Resize; + friend class css_longhand::RowRuleColor; friend class css_longhand::StopColor; friend class css_longhand::Stroke; friend class css_longhand::TextDecorationColor; @@ -987,6 +988,17 @@ BorderStyleIsVisible(ColumnRuleStyle().GetLegacyValue()); } + bool RowRuleIsTransparent() const { + return RowRuleColor() + .GetLegacyValue() + .Resolve(GetCurrentColor(), UsedColorScheme()) + .IsFullyTransparent(); + } + bool HasRowRule() const { + return RowRuleWidth().GetLegacyValue() && !RowRuleIsTransparent() && + BorderStyleIsVisible(RowRuleStyle().GetLegacyValue()); + } + // Flex utility functions. bool ResolvedIsColumnFlexDirection() const { if (IsDeprecatedFlexbox()) {
diff --git a/third_party/blink/renderer/core/svg/animation/smil_animation_sandwich.cc b/third_party/blink/renderer/core/svg/animation/smil_animation_sandwich.cc index 857761f9..7622f34d 100644 --- a/third_party/blink/renderer/core/svg/animation/smil_animation_sandwich.cc +++ b/third_party/blink/renderer/core/svg/animation/smil_animation_sandwich.cc
@@ -23,15 +23,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/animation/smil_animation_sandwich.h" #include <algorithm> +#include "base/compiler_specific.h" #include "base/not_fatal_until.h" #include "third_party/blink/renderer/core/svg/animation/smil_animation_value.h" #include "third_party/blink/renderer/core/svg/svg_animation_element.h" @@ -105,7 +101,7 @@ // in the sandwich. auto sandwich_start = active_.end(); while (sandwich_start != active_.begin()) { - --sandwich_start; + UNSAFE_TODO(--sandwich_start); if ((*sandwich_start)->OverwritesUnderlyingAnimationValue()) break; } @@ -120,7 +116,7 @@ SMILAnimationValue animation_value = animation->CreateAnimationValue(); for (auto sandwich_it = sandwich_start; sandwich_it != active_.end(); - sandwich_it++) { + UNSAFE_TODO(sandwich_it++)) { (*sandwich_it)->ApplyAnimation(animation_value); }
diff --git a/third_party/blink/renderer/core/svg/animation/svg_smil_element.cc b/third_party/blink/renderer/core/svg/animation/svg_smil_element.cc index 807f6025..f55d26dc 100644 --- a/third_party/blink/renderer/core/svg/animation/svg_smil_element.cc +++ b/third_party/blink/renderer/core/svg/animation/svg_smil_element.cc
@@ -23,16 +23,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/animation/svg_smil_element.h" #include <algorithm> #include "base/auto_reset.h" +#include "base/compiler_specific.h" #include "base/time/time.h" #include "third_party/blink/public/platform/task_type.h" #include "third_party/blink/renderer/bindings/core/v8/js_event_handler_for_content_attribute.h" @@ -82,7 +78,7 @@ auto position = std::lower_bound(instance_times_.begin(), instance_times_.end(), time_with_origin); // Don't add it if we already have one of those. - for (auto it = position; it != instance_times_.end(); ++it) { + for (auto it = position; it != instance_times_.end(); UNSAFE_TODO(++it)) { if (position->Time() != time) break; // If they share both time and origin, we don't need to add it, @@ -809,7 +805,7 @@ const size_t kMaxIterations = std::max(begin_times_.size() * 4, 1000000u); size_t current_iteration = 0; for (auto search_start = begin_times_.begin(); - search_start != begin_times_.end(); ++search_start) { + search_start != begin_times_.end(); UNSAFE_TODO(++search_start)) { // Find the (next) instance time in the 'begin' list that is greater or // equal to |begin_after|. auto begin_item = std::lower_bound(
diff --git a/third_party/blink/renderer/core/svg/properties/svg_list_property.cc b/third_party/blink/renderer/core/svg/properties/svg_list_property.cc index 692082f..c3bdb1e 100644 --- a/third_party/blink/renderer/core/svg/properties/svg_list_property.cc +++ b/third_party/blink/renderer/core/svg/properties/svg_list_property.cc
@@ -28,13 +28,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/properties/svg_list_property.h" +#include "base/compiler_specific.h" #include "third_party/blink/renderer/platform/wtf/text/string_builder.h" namespace blink { @@ -83,7 +79,7 @@ auto it_end = values_.end(); while (it != it_end) { builder.Append((*it)->ValueAsString()); - ++it; + UNSAFE_TODO(++it); if (it != it_end) builder.Append(' '); }
diff --git a/third_party/blink/renderer/core/svg/svg_animation_element.cc b/third_party/blink/renderer/core/svg/svg_animation_element.cc index 91753f0..5956528 100644 --- a/third_party/blink/renderer/core/svg/svg_animation_element.cc +++ b/third_party/blink/renderer/core/svg/svg_animation_element.cc
@@ -22,13 +22,9 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/svg_animation_element.h" +#include "base/compiler_specific.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/svg/animation/element_smil_animations.h" @@ -139,7 +135,7 @@ SkipOptionalSVGSpaces(ptr, end); if (ptr < end && *ptr == ';') - ptr++; + UNSAFE_TODO(ptr++); SkipOptionalSVGSpaces(ptr, end); // The values of cpx1 cpy1 cpx2 cpy2 must all be in the range 0 to 1.
diff --git a/third_party/blink/renderer/core/svg/svg_geometry_element.cc b/third_party/blink/renderer/core/svg/svg_geometry_element.cc index ebb1629..69c39dc 100644 --- a/third_party/blink/renderer/core/svg/svg_geometry_element.cc +++ b/third_party/blink/renderer/core/svg/svg_geometry_element.cc
@@ -30,6 +30,8 @@ #include "third_party/blink/renderer/core/svg/svg_geometry_element.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_dom_point_init.h" +#include "third_party/blink/renderer/core/geometry/dom_point.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_path.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_shape.h" #include "third_party/blink/renderer/core/layout/svg/svg_layout_support.h" @@ -79,7 +81,12 @@ SVGGraphicsElement::Trace(visitor); } -bool SVGGeometryElement::isPointInFill(SVGPointTearOff* point) const { +bool SVGGeometryElement::isPointInFill(const DOMPointInit* point) const { + // If either of the x or y properties on point are infinite or NaN, then the + // method must return false. + if (!std::isfinite(point->x()) || !std::isfinite(point->y())) { + return false; + } GetDocument().UpdateStyleAndLayoutForNode(this, DocumentUpdateReason::kJavaScript); @@ -91,10 +98,17 @@ // Path::Contains will reject points with a non-finite component. WindRule fill_rule = layout_object->StyleRef().FillRule(); - return AsPath().Contains(point->Target()->Value(), fill_rule); + const gfx::PointF local_point(ClampTo<float>(point->x()), + ClampTo<float>(point->y())); + return AsPath().Contains(local_point, fill_rule); } -bool SVGGeometryElement::isPointInStroke(SVGPointTearOff* point) const { +bool SVGGeometryElement::isPointInStroke(const DOMPointInit* point) const { + // If either of the x or y properties on point are infinite or NaN, then the + // method must return false. + if (!std::isfinite(point->x()) || !std::isfinite(point->y())) { + return false; + } GetDocument().UpdateStyleAndLayoutForNode(this, DocumentUpdateReason::kJavaScript); @@ -108,7 +122,8 @@ AffineTransform root_transform; Path path = AsPath(); - gfx::PointF local_point = point->Target()->Value(); + gfx::PointF local_point(ClampTo<float>(point->x()), + ClampTo<float>(point->y())); if (layout_shape.HasNonScalingStroke()) { const AffineTransform transform = layout_shape.ComputeNonScalingStrokeTransform();
diff --git a/third_party/blink/renderer/core/svg/svg_geometry_element.h b/third_party/blink/renderer/core/svg/svg_geometry_element.h index 7e0c175..4f9f029 100644 --- a/third_party/blink/renderer/core/svg/svg_geometry_element.h +++ b/third_party/blink/renderer/core/svg/svg_geometry_element.h
@@ -35,6 +35,7 @@ namespace blink { +class DOMPointInit; class Path; class SVGAnimatedNumber; class SVGPointTearOff; @@ -44,8 +45,8 @@ public: virtual Path AsPath() const = 0; - bool isPointInFill(SVGPointTearOff*) const; - bool isPointInStroke(SVGPointTearOff*) const; + bool isPointInFill(const DOMPointInit*) const; + bool isPointInStroke(const DOMPointInit*) const; Path ToClipPath() const;
diff --git a/third_party/blink/renderer/core/svg/svg_geometry_element.idl b/third_party/blink/renderer/core/svg/svg_geometry_element.idl index 02711605..02e51a1 100644 --- a/third_party/blink/renderer/core/svg/svg_geometry_element.idl +++ b/third_party/blink/renderer/core/svg/svg_geometry_element.idl
@@ -34,9 +34,8 @@ interface SVGGeometryElement : SVGGraphicsElement { [SameObject] readonly attribute SVGAnimatedNumber pathLength; - // TODO(foolip): SVGPoint should be DOMPoint. - [HighEntropy, Measure] boolean isPointInFill(SVGPoint point); - [HighEntropy, Measure] boolean isPointInStroke(SVGPoint point); + [HighEntropy, Measure] boolean isPointInFill(optional DOMPointInit point = {}); + [HighEntropy, Measure] boolean isPointInStroke(optional DOMPointInit point = {}); [HighEntropy, Measure, RaisesException] float getTotalLength(); [HighEntropy, Measure, RaisesException] SVGPoint getPointAtLength(float distance); };
diff --git a/third_party/blink/renderer/core/svg/svg_length_list.cc b/third_party/blink/renderer/core/svg/svg_length_list.cc index b39b348..e73f14fe 100644 --- a/third_party/blink/renderer/core/svg/svg_length_list.cc +++ b/third_party/blink/renderer/core/svg/svg_length_list.cc
@@ -18,13 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/svg_length_list.h" +#include "base/compiler_specific.h" #include "third_party/blink/renderer/core/svg/svg_parser_utilities.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/wtf/text/character_visitor.h" @@ -55,10 +51,10 @@ const CharType* start = ptr; // TODO(shanmuga.m): Enable calc for SVGLengthList while (ptr < end && *ptr != ',' && !IsHTMLSpace<CharType>(*ptr)) - ptr++; + UNSAFE_TODO(ptr++); if (ptr == start) break; - String value_string(base::span(start, ptr)); + String value_string(UNSAFE_TODO(base::span(start, ptr))); if (value_string.empty()) break;
diff --git a/third_party/blink/renderer/core/svg/svg_number.cc b/third_party/blink/renderer/core/svg/svg_number.cc index 874331c..1199108 100644 --- a/third_party/blink/renderer/core/svg/svg_number.cc +++ b/third_party/blink/renderer/core/svg/svg_number.cc
@@ -28,11 +28,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/svg_number.h" #include "third_party/blink/renderer/core/svg/animation/smil_animation_effect_parameters.h" @@ -125,7 +120,7 @@ ptr - start); if (ptr < end && *ptr == '%') { number /= 100; - ptr++; + UNSAFE_TODO(ptr++); } if (SkipOptionalSVGSpaces(ptr, end)) return SVGParsingError(SVGParseStatus::kTrailingGarbage, ptr - start);
diff --git a/third_party/blink/renderer/core/svg/svg_number_list.cc b/third_party/blink/renderer/core/svg/svg_number_list.cc index 5530283d..617b0ceb 100644 --- a/third_party/blink/renderer/core/svg/svg_number_list.cc +++ b/third_party/blink/renderer/core/svg/svg_number_list.cc
@@ -18,11 +18,6 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/svg_number_list.h" #include "third_party/blink/renderer/core/svg/svg_parser_utilities.h"
diff --git a/third_party/blink/renderer/core/svg/svg_parser_utilities.cc b/third_party/blink/renderer/core/svg/svg_parser_utilities.cc index b9a32e2..f9873d1 100644 --- a/third_party/blink/renderer/core/svg/svg_parser_utilities.cc +++ b/third_party/blink/renderer/core/svg/svg_parser_utilities.cc
@@ -20,14 +20,11 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/svg_parser_utilities.h" #include <limits> + +#include "base/compiler_specific.h" #include "third_party/blink/renderer/platform/wtf/math_extras.h" #include "third_party/blink/renderer/platform/wtf/text/character_visitor.h" @@ -54,9 +51,9 @@ // read the sign int sign = 1; if (ptr < end && *ptr == '+') - ptr++; + UNSAFE_TODO(ptr++); else if (ptr < end && *ptr == '-') { - ptr++; + UNSAFE_TODO(ptr++); sign = -1; } @@ -67,15 +64,15 @@ // read the integer part, build right-to-left const CharType* digits_start = ptr; while (ptr < end && *ptr >= '0' && *ptr <= '9') - ++ptr; // Advance to first non-digit. + UNSAFE_TODO(++ptr); // Advance to first non-digit. FloatType integer = 0; if (ptr != digits_start) { - const CharType* ptr_scan_int_part = ptr - 1; + const CharType* ptr_scan_int_part = UNSAFE_TODO(ptr - 1); FloatType multiplier = 1; while (ptr_scan_int_part >= digits_start) { - integer += - multiplier * static_cast<FloatType>(*(ptr_scan_int_part--) - '0'); + integer += multiplier * static_cast<FloatType>( + *(UNSAFE_TODO(ptr_scan_int_part--)) - '0'); multiplier *= 10; } // Bail out early if this overflows. @@ -85,7 +82,7 @@ FloatType decimal = 0; if (ptr < end && *ptr == '.') { // read the decimals - ptr++; + UNSAFE_TODO(ptr++); // There must be a least one digit following the . if (ptr >= end || *ptr < '0' || *ptr > '9') @@ -94,7 +91,7 @@ FloatType frac = 1; while (ptr < end && *ptr >= '0' && *ptr <= '9') { frac *= static_cast<FloatType>(0.1); - decimal += (*(ptr++) - '0') * frac; + decimal += (*(UNSAFE_TODO(ptr++)) - '0') * frac; } } @@ -106,16 +103,16 @@ number *= sign; // read the exponent part - if (ptr + 1 < end && (*ptr == 'e' || *ptr == 'E') && - (ptr[1] != 'x' && ptr[1] != 'm')) { - ptr++; + if (UNSAFE_TODO(ptr + 1) < end && (*ptr == 'e' || *ptr == 'E') && + (UNSAFE_TODO(ptr[1]) != 'x' && UNSAFE_TODO(ptr[1]) != 'm')) { + UNSAFE_TODO(ptr++); // read the sign of the exponent bool exponent_is_negative = false; if (*ptr == '+') - ptr++; + UNSAFE_TODO(ptr++); else if (*ptr == '-') { - ptr++; + UNSAFE_TODO(ptr++); exponent_is_negative = true; } @@ -127,7 +124,7 @@ while (ptr < end && *ptr >= '0' && *ptr <= '9') { exponent *= static_cast<FloatType>(10); exponent += *ptr - '0'; - ptr++; + UNSAFE_TODO(ptr++); } // TODO(fs): This is unnecessarily strict - the position of the decimal // point is not taken into account when limiting |exponent|.
diff --git a/third_party/blink/renderer/core/svg/svg_path_byte_stream_builder.cc b/third_party/blink/renderer/core/svg/svg_path_byte_stream_builder.cc index 23c97ef..52d25546 100644 --- a/third_party/blink/renderer/core/svg/svg_path_byte_stream_builder.cc +++ b/third_party/blink/renderer/core/svg/svg_path_byte_stream_builder.cc
@@ -17,13 +17,9 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/svg_path_byte_stream_builder.h" +#include "base/compiler_specific.h" #include "base/notreached.h" #include "third_party/blink/renderer/core/svg/svg_path_byte_stream.h" #include "third_party/blink/renderer/core/svg/svg_path_data.h" @@ -46,7 +42,7 @@ data.value = value; wtf_size_t type_size = sizeof(ByteType<DataType>); DCHECK_LE(current_offset_ + type_size, sizeof(bytes_)); - memcpy(bytes_ + current_offset_, data.bytes, type_size); + UNSAFE_TODO(memcpy(bytes_ + current_offset_, data.bytes, type_size)); current_offset_ += type_size; }
diff --git a/third_party/blink/renderer/core/svg/svg_path_string_source.cc b/third_party/blink/renderer/core/svg/svg_path_string_source.cc index 60cb8c7..58e17e98 100644 --- a/third_party/blink/renderer/core/svg/svg_path_string_source.cc +++ b/third_party/blink/renderer/core/svg/svg_path_string_source.cc
@@ -18,13 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/svg_path_string_source.h" +#include "base/compiler_specific.h" #include "base/notreached.h" #include "third_party/blink/renderer/core/svg/svg_parser_utilities.h" #include "ui/gfx/geometry/point_f.h" @@ -49,7 +45,7 @@ return false; } - ptr++; + UNSAFE_TODO(ptr++); SkipOptionalSVGSpacesOrDelimiter(ptr, end); return true; @@ -138,10 +134,10 @@ if (is_8bit_source_) { current_.character8_ = source.Characters8(); - end_.character8_ = current_.character8_ + source.length(); + end_.character8_ = UNSAFE_TODO(current_.character8_ + source.length()); } else { current_.character16_ = source.Characters16(); - end_.character16_ = current_.character16_ + source.length(); + end_.character16_ = UNSAFE_TODO(current_.character16_ + source.length()); } EatWhitespace(); } @@ -204,9 +200,9 @@ } // Consume command letter. if (is_8bit_source_) - current_.character8_++; + UNSAFE_TODO(current_.character8_++); else - current_.character16_++; + UNSAFE_TODO(current_.character16_++); } else if (command == kPathSegUnknown) { // Possibly an implicit command. DCHECK_NE(previous_command_, kPathSegUnknown); @@ -217,9 +213,9 @@ } else { // Valid explicit command. if (is_8bit_source_) - current_.character8_++; + UNSAFE_TODO(current_.character8_++); else - current_.character16_++; + UNSAFE_TODO(current_.character16_++); } segment.command = previous_command_ = command;
diff --git a/third_party/blink/renderer/core/svg/svg_point_list.cc b/third_party/blink/renderer/core/svg/svg_point_list.cc index cf27b9fe..54c42e6 100644 --- a/third_party/blink/renderer/core/svg/svg_point_list.cc +++ b/third_party/blink/renderer/core/svg/svg_point_list.cc
@@ -18,13 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/svg_point_list.h" +#include "base/compiler_specific.h" #include "third_party/blink/renderer/core/svg/animation/smil_animation_effect_parameters.h" #include "third_party/blink/renderer/core/svg/svg_parser_utilities.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" @@ -57,7 +53,7 @@ break; if (*ptr == ',') { - ++ptr; + UNSAFE_TODO(++ptr); SkipOptionalSVGSpaces(ptr, end); // ',' requires the list to be continued
diff --git a/third_party/blink/renderer/core/svg/svg_rect.cc b/third_party/blink/renderer/core/svg/svg_rect.cc index 9f5094c..37c9cc4d 100644 --- a/third_party/blink/renderer/core/svg/svg_rect.cc +++ b/third_party/blink/renderer/core/svg/svg_rect.cc
@@ -19,11 +19,6 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/svg_rect.h" #include "third_party/blink/renderer/core/svg/animation/smil_animation_effect_parameters.h"
diff --git a/third_party/blink/renderer/core/svg/svg_string_list.cc b/third_party/blink/renderer/core/svg/svg_string_list.cc index b1607771..52e400b 100644 --- a/third_party/blink/renderer/core/svg/svg_string_list.cc +++ b/third_party/blink/renderer/core/svg/svg_string_list.cc
@@ -18,13 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/svg_string_list.h" +#include "base/compiler_specific.h" #include "base/notreached.h" #include "third_party/blink/renderer/core/svg/svg_parser_utilities.h" #include "third_party/blink/renderer/platform/wtf/text/character_visitor.h" @@ -60,11 +56,13 @@ char list_delimiter) { while (ptr < end) { const CharType* start = ptr; - while (ptr < end && *ptr != list_delimiter && !IsHTMLSpace<CharType>(*ptr)) - ptr++; + while (ptr < end && *ptr != list_delimiter && + !IsHTMLSpace<CharType>(*ptr)) { + UNSAFE_TODO(ptr++); + } if (ptr == start) break; - values_.push_back(String(base::span(start, ptr))); + values_.push_back(String(UNSAFE_TODO(base::span(start, ptr)))); SkipOptionalSVGSpacesOrDelimiter(ptr, end, list_delimiter); } } @@ -95,9 +93,9 @@ Vector<String>::const_iterator it_end = values_.end(); if (it != it_end) { builder.Append(*it); - ++it; + UNSAFE_TODO(++it); - for (; it != it_end; ++it) { + for (; it != it_end; UNSAFE_TODO(++it)) { builder.Append(list_delimiter); builder.Append(*it); }
diff --git a/third_party/blink/renderer/core/svg/svg_text_content_element.cc b/third_party/blink/renderer/core/svg/svg_text_content_element.cc index 5a99fbc..59878fc3 100644 --- a/third_party/blink/renderer/core/svg/svg_text_content_element.cc +++ b/third_party/blink/renderer/core/svg/svg_text_content_element.cc
@@ -20,6 +20,7 @@ #include "third_party/blink/renderer/core/svg/svg_text_content_element.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_dom_point_init.h" #include "third_party/blink/renderer/core/css/css_property_names.h" #include "third_party/blink/renderer/core/css_value_keywords.h" #include "third_party/blink/renderer/core/editing/frame_selection.h" @@ -230,14 +231,20 @@ } int SVGTextContentElement::getCharNumAtPosition( - SVGPointTearOff* point, + DOMPointInit* point, ExceptionState& exception_state) { + // If either of the x or y properties on point are infinite or NaN, then the + // method must return -1. + if (!std::isfinite(point->x()) || !std::isfinite(point->y())) { + return -1; + } GetDocument().UpdateStyleAndLayoutForNode(this, DocumentUpdateReason::kJavaScript); auto* layout_object = GetLayoutObject(); if (IsNGTextOrInline(layout_object)) { - return SvgTextQuery(*layout_object) - .CharacterNumberAtPosition(point->Target()->Value()); + const gfx::PointF local_point(ClampTo<float>(point->x()), + ClampTo<float>(point->y())); + return SvgTextQuery(*layout_object).CharacterNumberAtPosition(local_point); } return -1; }
diff --git a/third_party/blink/renderer/core/svg/svg_text_content_element.h b/third_party/blink/renderer/core/svg/svg_text_content_element.h index 9bc7854..e465b2a 100644 --- a/third_party/blink/renderer/core/svg/svg_text_content_element.h +++ b/third_party/blink/renderer/core/svg/svg_text_content_element.h
@@ -28,6 +28,7 @@ namespace blink { +class DOMPointInit; class ExceptionState; class LineLayoutItem; class SVGAnimatedLength; @@ -58,7 +59,7 @@ SVGPointTearOff* getEndPositionOfChar(unsigned charnum, ExceptionState&); SVGRectTearOff* getExtentOfChar(unsigned charnum, ExceptionState&); float getRotationOfChar(unsigned charnum, ExceptionState&); - int getCharNumAtPosition(SVGPointTearOff*, ExceptionState&); + int getCharNumAtPosition(DOMPointInit*, ExceptionState&); void selectSubString(unsigned charnum, unsigned nchars, ExceptionState&); static SVGTextContentElement* ElementFromLineLayoutItem(
diff --git a/third_party/blink/renderer/core/svg/svg_text_content_element.idl b/third_party/blink/renderer/core/svg/svg_text_content_element.idl index a51524b7..49676f57 100644 --- a/third_party/blink/renderer/core/svg/svg_text_content_element.idl +++ b/third_party/blink/renderer/core/svg/svg_text_content_element.idl
@@ -38,11 +38,10 @@ long getNumberOfChars(); [HighEntropy, Measure] float getComputedTextLength(); [HighEntropy, Measure, RaisesException] float getSubStringLength(unsigned long charnum, unsigned long nchars); - // TODO(foolip): SVGPoint/SVGRect should be DOMPoint/DOMRect. [HighEntropy, Measure, RaisesException] SVGPoint getStartPositionOfChar(unsigned long charnum); [HighEntropy, Measure, RaisesException] SVGPoint getEndPositionOfChar(unsigned long charnum); [HighEntropy, Measure, RaisesException] SVGRect getExtentOfChar(unsigned long charnum); [RaisesException] float getRotationOfChar(unsigned long charnum); - [RaisesException] long getCharNumAtPosition(SVGPoint point); + [RaisesException] long getCharNumAtPosition(optional DOMPointInit point = {}); [RaisesException] void selectSubString(unsigned long charnum, unsigned long nchars); };
diff --git a/third_party/blink/renderer/core/svg/svg_transform_list.cc b/third_party/blink/renderer/core/svg/svg_transform_list.cc index 1a75d7c..759a9f6 100644 --- a/third_party/blink/renderer/core/svg/svg_transform_list.cc +++ b/third_party/blink/renderer/core/svg/svg_transform_list.cc
@@ -21,15 +21,11 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/svg_transform_list.h" #include <array> +#include "base/compiler_specific.h" #include "third_party/blink/renderer/core/css/css_function_value.h" #include "third_party/blink/renderer/core/css/css_identifier_value.h" #include "third_party/blink/renderer/core/css/css_numeric_literal_value.h" @@ -143,7 +139,7 @@ break; if (SkipOptionalSVGSpaces(ptr, end) && *ptr == ',') { - ++ptr; + UNSAFE_TODO(++ptr); trailing_delimiter = true; } } @@ -367,7 +363,7 @@ if (!SkipOptionalSVGSpaces(ptr, end) || *ptr != '(') return SVGParsingError(SVGParseStatus::kExpectedStartOfArguments, ptr - start); - ptr++; + UNSAFE_TODO(ptr++); TransformArguments arguments; SVGParseStatus status = @@ -380,12 +376,12 @@ if (!SkipOptionalSVGSpaces(ptr, end) || *ptr != ')') return SVGParsingError(SVGParseStatus::kExpectedEndOfArguments, ptr - start); - ptr++; + UNSAFE_TODO(ptr++); Append(CreateTransformFromValues(transform_type, arguments)); if (SkipOptionalSVGSpaces(ptr, end) && *ptr == ',') { - ++ptr; + UNSAFE_TODO(++ptr); delim_parsed = true; } }
diff --git a/third_party/blink/renderer/core/svg/svg_zoom_and_pan.cc b/third_party/blink/renderer/core/svg/svg_zoom_and_pan.cc index 489fcb8..8449ab8 100644 --- a/third_party/blink/renderer/core/svg/svg_zoom_and_pan.cc +++ b/third_party/blink/renderer/core/svg/svg_zoom_and_pan.cc
@@ -19,11 +19,6 @@ * Boston, MA 02110-1301, USA. */ -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - #include "third_party/blink/renderer/core/svg/svg_zoom_and_pan.h" #include "third_party/blink/renderer/platform/wtf/text/character_visitor.h"
diff --git a/third_party/blink/renderer/core/timing/DEPS b/third_party/blink/renderer/core/timing/DEPS index 65a862d5..2b89254 100644 --- a/third_party/blink/renderer/core/timing/DEPS +++ b/third_party/blink/renderer/core/timing/DEPS
@@ -13,5 +13,8 @@ ], "performance_mark_test.cc": [ "+components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.h", - ] + ], + "animation_frame_timing_info.h": [ + "+components/viz/common/frame_sinks/begin_frame_args.h", + ], }
diff --git a/third_party/blink/renderer/core/timing/animation_frame_timing_info.cc b/third_party/blink/renderer/core/timing/animation_frame_timing_info.cc index 9551731..9ba9fe9 100644 --- a/third_party/blink/renderer/core/timing/animation_frame_timing_info.cc +++ b/third_party/blink/renderer/core/timing/animation_frame_timing_info.cc
@@ -29,6 +29,13 @@ CHECK(security_origin_); } +void ScriptTimingInfo::SetSourceLocation(const ScriptSourceLocation& location) { + source_location_ = location; + if (KURL(location.url).ProtocolIsData()) { + source_location_.url = "data:"; + } +} + void ScriptTimingInfo::Trace(Visitor* visitor) const { visitor->Trace(window_); }
diff --git a/third_party/blink/renderer/core/timing/animation_frame_timing_info.h b/third_party/blink/renderer/core/timing/animation_frame_timing_info.h index 701f230..ac49137 100644 --- a/third_party/blink/renderer/core/timing/animation_frame_timing_info.h +++ b/third_party/blink/renderer/core/timing/animation_frame_timing_info.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_TIMING_ANIMATION_FRAME_TIMING_INFO_H_ #include "base/time/time.h" -#include "third_party/blink/renderer/core/frame/local_dom_window.h" +#include "components/viz/common/frame_sinks/begin_frame_args.h" #include "third_party/blink/renderer/platform/bindings/source_location.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" @@ -16,6 +16,7 @@ class ExecutionContext; class SourceLocation; +class LocalDOMWindow; class ScriptTimingInfo : public GarbageCollected<ScriptTimingInfo> { public: @@ -62,13 +63,7 @@ const ScriptSourceLocation& GetSourceLocation() const { return source_location_; } - void SetSourceLocation(const ScriptSourceLocation& location) { - source_location_ = location; - if (KURL(location.url).ProtocolIsData()) { - source_location_.url = "data:"; - } - } - + void SetSourceLocation(const ScriptSourceLocation& location); const AtomicString& ClassLikeName() const { return class_like_name_; } void SetClassLikeName(const AtomicString& name) { class_like_name_ = name; } const AtomicString& PropertyLikeName() const { return property_like_name_; }
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 5b66df5..ce4e4e55 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
@@ -2335,7 +2335,7 @@ } else { image = image_source->GetSourceImageForCanvas( FlushReason::kDrawImage, &source_image_status, default_object_size, - kDontChangeAlpha); + CanvasImageSource::kDontChangeAlpha); if (source_image_status == kUndecodableSourceImageStatus) { exception_state.ThrowDOMException( DOMExceptionCode::kInvalidStateError, @@ -2535,9 +2535,9 @@ gfx::SizeF default_object_size(Width(), Height()); scoped_refptr<Image> image_for_rendering = - image_source->GetSourceImageForCanvas(FlushReason::kCreatePattern, - &status, default_object_size, - kDontChangeAlpha); + image_source->GetSourceImageForCanvas( + FlushReason::kCreatePattern, &status, default_object_size, + CanvasImageSource::kDontChangeAlpha); switch (status) { case kNormalSourceImageStatus: @@ -2664,7 +2664,7 @@ SourceImageStatus source_image_status = kInvalidSourceImageStatus; scoped_refptr<Image> image = image_source->GetSourceImageForCanvas( FlushReason::kDrawMesh, &source_image_status, - gfx::SizeF(Width(), Height()), kDontChangeAlpha); + gfx::SizeF(Width(), Height()), CanvasImageSource::kDontChangeAlpha); switch (source_image_status) { case kUndecodableSourceImageStatus: exception_state.ThrowDOMException(
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_api_test.cc b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_api_test.cc index 145a11d..6893ef7 100644 --- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_api_test.cc +++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_api_test.cc
@@ -50,7 +50,6 @@ #include "third_party/blink/renderer/platform/bindings/exception_code.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/graphics/graphics_types.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/heap/persistent.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
diff --git a/third_party/blink/renderer/modules/delegated_ink/delegated_ink_trail_presenter_unittest.cc b/third_party/blink/renderer/modules/delegated_ink/delegated_ink_trail_presenter_unittest.cc index ba889332..4556169 100644 --- a/third_party/blink/renderer/modules/delegated_ink/delegated_ink_trail_presenter_unittest.cc +++ b/third_party/blink/renderer/modules/delegated_ink/delegated_ink_trail_presenter_unittest.cc
@@ -9,7 +9,7 @@ #include "third_party/blink/renderer/bindings/modules/v8/v8_ink_trail_style.h" #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/events/pointer_event.h" -#include "third_party/blink/renderer/core/frame/local_frame.h" +#include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/html/html_iframe_element.h" #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" #include "third_party/blink/renderer/core/testing/sim/sim_request.h"
diff --git a/third_party/blink/renderer/modules/manifest/manifest_manager.cc b/third_party/blink/renderer/modules/manifest/manifest_manager.cc index a92a85f..cddb01b 100644 --- a/third_party/blink/renderer/modules/manifest/manifest_manager.cc +++ b/third_party/blink/renderer/modules/manifest/manifest_manager.cc
@@ -290,6 +290,70 @@ } void ManifestManager::RecordMetrics(const mojom::blink::Manifest& manifest) { + UseCounter::Count(GetSupplementable(), WebFeature::kWebAppManifestStartUrl); + UseCounter::Count(GetSupplementable(), WebFeature::kWebAppManifestScope); + + if (manifest.display != mojom::blink::DisplayMode::kUndefined) { + UseCounter::Count(GetSupplementable(), WebFeature::kWebAppManifestDisplay); + } + + if (!manifest.icons.empty()) { + UseCounter::Count(GetSupplementable(), WebFeature::kWebAppManifestIcons); + } + + if (!manifest.screenshots.empty()) { + UseCounter::Count(GetSupplementable(), + WebFeature::kWebAppManifestScreenshots); + } + + if (!manifest.lock_screen.is_null()) { + UseCounter::Count(GetSupplementable(), + WebFeature::kWebAppManifestLockScreen); + } + + if (!manifest.note_taking.is_null()) { + UseCounter::Count(GetSupplementable(), + WebFeature::kWebAppManifestNoteTaking); + } + + if (!manifest.permissions_policy.empty()) { + UseCounter::Count(GetSupplementable(), + WebFeature::kWebAppManifestPermissionsPolicy); + } + + if (manifest.prefer_related_applications) { + UseCounter::Count(GetSupplementable(), + WebFeature::kWebAppManifestPrefer_Related_Applications); + } + + if (manifest.has_theme_color) { + UseCounter::Count(GetSupplementable(), + WebFeature::kWebAppManifestThemeColor); + } + + if (manifest.has_background_color) { + UseCounter::Count(GetSupplementable(), + WebFeature::kWebAppManifestBackgroundColor); + } + + if (!manifest.translations.empty()) { + UseCounter::Count(GetSupplementable(), + WebFeature::kWebAppManifestTranslations); + } + + if (!manifest.tab_strip.is_null()) { + UseCounter::Count(GetSupplementable(), WebFeature::kWebAppManifestTabStrip); + } + + if (!manifest.version.empty()) { + UseCounter::Count(GetSupplementable(), WebFeature::kWebAppManifestVersion); + } + + if (!manifest.related_applications.empty()) { + UseCounter::Count(GetSupplementable(), + WebFeature::kWebAppManifestRelated_Applications); + } + if (manifest.has_custom_id) { UseCounter::Count(GetSupplementable(), WebFeature::kWebAppManifestIdField); }
diff --git a/third_party/blink/renderer/modules/shapedetection/shape_detector.cc b/third_party/blink/renderer/modules/shapedetection/shape_detector.cc index 9657649..7519cf7 100644 --- a/third_party/blink/renderer/modules/shapedetection/shape_detector.cc +++ b/third_party/blink/renderer/modules/shapedetection/shape_detector.cc
@@ -94,7 +94,7 @@ SourceImageStatus source_image_status = kInvalidSourceImageStatus; scoped_refptr<Image> image = canvas_image_source->GetSourceImageForCanvas( FlushReason::kShapeDetector, &source_image_status, size, - kDontChangeAlpha); + CanvasImageSource::kDontChangeAlpha); if (!image || source_image_status != kNormalSourceImageStatus) { exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, "Invalid element or state.");
diff --git a/third_party/blink/renderer/modules/storage_access/document_storage_access.cc b/third_party/blink/renderer/modules/storage_access/document_storage_access.cc index 79681be..cebddbec 100644 --- a/third_party/blink/renderer/modules/storage_access/document_storage_access.cc +++ b/third_party/blink/renderer/modules/storage_access/document_storage_access.cc
@@ -17,6 +17,7 @@ #include "third_party/blink/renderer/bindings/modules/v8/v8_storage_access_types.h" #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/core/loader/cookie_jar.h" +#include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/modules/storage_access/storage_access_handle.h" namespace blink { @@ -282,12 +283,14 @@ return promise; } - if (GetSupplementable()->IsInOutermostMainFrame()) { + // If this is the outermost frame we no longer need to make a request and + // can resolve the promise unless we are in a partitioned popin. Partitioned + // popins can be partitioned even as a top-frame, so need to continue. + // See https://explainers-by-googlers.github.io/partitioned-popins/ + if (GetSupplementable()->IsInOutermostMainFrame() && + !GetSupplementable()->GetPage()->IsPartitionedPopin()) { FireRequestStorageAccessHistogram( RequestStorageResult::APPROVED_PRIMARY_FRAME); - - // If this is the outermost frame we no longer need to make a request and - // can resolve the promise. resolver->Resolve(); return promise; }
diff --git a/third_party/blink/renderer/modules/webaudio/BUILD.gn b/third_party/blink/renderer/modules/webaudio/BUILD.gn index 014a258..74d787c 100644 --- a/third_party/blink/renderer/modules/webaudio/BUILD.gn +++ b/third_party/blink/renderer/modules/webaudio/BUILD.gn
@@ -180,14 +180,10 @@ "stereo_panner_handler.h", "stereo_panner_node.cc", "stereo_panner_node.h", - "wave_shaper_dsp_kernel.cc", - "wave_shaper_dsp_kernel.h", "wave_shaper_handler.cc", "wave_shaper_handler.h", "wave_shaper_node.cc", "wave_shaper_node.h", - "wave_shaper_processor.cc", - "wave_shaper_processor.h", ] if (is_win) {
diff --git a/third_party/blink/renderer/modules/webaudio/wave_shaper_dsp_kernel.cc b/third_party/blink/renderer/modules/webaudio/wave_shaper_dsp_kernel.cc deleted file mode 100644 index 0939a03..0000000 --- a/third_party/blink/renderer/modules/webaudio/wave_shaper_dsp_kernel.cc +++ /dev/null
@@ -1,393 +0,0 @@ -/* - * Copyright (C) 2011, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - */ - -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. -#pragma allow_unsafe_buffers -#endif - -#include "third_party/blink/renderer/modules/webaudio/wave_shaper_dsp_kernel.h" - -#include <algorithm> -#include <memory> - -#include "build/build_config.h" -#include "third_party/blink/renderer/platform/audio/audio_utilities.h" -#include "third_party/blink/renderer/platform/audio/vector_math.h" -#include "third_party/blink/renderer/platform/wtf/math_extras.h" -#include "third_party/blink/renderer/platform/wtf/threading.h" - -#if defined(ARCH_CPU_X86_FAMILY) -#include <xmmintrin.h> -#elif defined(CPU_ARM_NEON) -#include <arm_neon.h> -#endif - -namespace blink { - -WaveShaperDSPKernel::WaveShaperDSPKernel(WaveShaperProcessor* processor) - : AudioDSPKernel(processor), - // 4 times render size to handle 4x oversampling. - virtual_index_(4 * RenderQuantumFrames()), - index_(4 * RenderQuantumFrames()), - v1_(4 * RenderQuantumFrames()), - v2_(4 * RenderQuantumFrames()), - f_(4 * RenderQuantumFrames()) { - if (processor->Oversample() != WaveShaperProcessor::kOverSampleNone) { - LazyInitializeOversampling(); - } -} - -void WaveShaperDSPKernel::LazyInitializeOversampling() { - if (!temp_buffer_) { - temp_buffer_ = std::make_unique<AudioFloatArray>(RenderQuantumFrames() * 2); - temp_buffer2_ = - std::make_unique<AudioFloatArray>(RenderQuantumFrames() * 4); - up_sampler_ = std::make_unique<UpSampler>(RenderQuantumFrames()); - down_sampler_ = std::make_unique<DownSampler>(RenderQuantumFrames() * 2); - up_sampler2_ = std::make_unique<UpSampler>(RenderQuantumFrames() * 2); - down_sampler2_ = std::make_unique<DownSampler>(RenderQuantumFrames() * 4); - } -} - -void WaveShaperDSPKernel::Process(const float* source, - float* destination, - uint32_t frames_to_process) { - switch (GetWaveShaperProcessor()->Oversample()) { - case WaveShaperProcessor::kOverSampleNone: - ProcessCurve(source, destination, frames_to_process); - break; - case WaveShaperProcessor::kOverSample2x: - ProcessCurve2x(source, destination, frames_to_process); - break; - case WaveShaperProcessor::kOverSample4x: - ProcessCurve4x(source, destination, frames_to_process); - break; - - default: - NOTREACHED(); - } -} - -double WaveShaperDSPKernel::WaveShaperCurveValue(float input, - const float* curve_data, - int curve_length) const { - // Calculate a virtual index based on input -1 -> +1 with -1 being curve[0], - // +1 being curve[curveLength - 1], and 0 being at the center of the curve - // data. Then linearly interpolate between the two points in the curve. - double virtual_index = 0.5 * (input + 1) * (curve_length - 1); - double output; - if (virtual_index < 0) { - // input < -1, so use curve[0] - output = curve_data[0]; - } else if (virtual_index >= curve_length - 1) { - // input >= 1, so use last curve value - output = curve_data[curve_length - 1]; - } else { - // The general case where -1 <= input < 1, where 0 <= virtualIndex < - // curveLength - 1, so interpolate between the nearest samples on the - // curve. - unsigned index1 = static_cast<unsigned>(virtual_index); - unsigned index2 = index1 + 1; - double interpolation_factor = virtual_index - index1; - - double value1 = curve_data[index1]; - double value2 = curve_data[index2]; - - output = - (1.0 - interpolation_factor) * value1 + interpolation_factor * value2; - } - - return output; -} - -void WaveShaperDSPKernel::WaveShaperCurveValues(float* destination, - const float* source, - uint32_t frames_to_process, - const float* curve_data, - int curve_length) const { - DCHECK_LE(frames_to_process, virtual_index_.size()); - // Index into the array computed from the source value. - float* virtual_index = virtual_index_.Data(); - - // virtual_index[k] = - // ClampTo(0.5 * (source[k] + 1) * (curve_length - 1), - // 0.0f, - // static_cast<float>(curve_length - 1)) - - // Add 1 to source puttting result in virtual_index - vector_math::Vsadd(source, 1, 1, virtual_index, 1, frames_to_process); - - // Scale virtual_index in place by (curve_lenth -1)/2 - vector_math::Vsmul(virtual_index, 1, 0.5 * (curve_length - 1), virtual_index, - 1, frames_to_process); - - // Clip virtual_index, in place. - vector_math::Vclip(virtual_index, 1, 0, curve_length - 1, virtual_index, 1, - frames_to_process); - - // index = floor(virtual_index) - DCHECK_LE(frames_to_process, index_.size()); - float* index = index_.Data(); - - // v1 and v2 hold the curve_data corresponding to the closest curve - // values to the source sample. To save memory, v1 will use the - // destination array. - DCHECK_LE(frames_to_process, v1_.size()); - DCHECK_LE(frames_to_process, v2_.size()); - float* v1 = v1_.Data(); - float* v2 = v2_.Data(); - - // Interpolation factor: virtual_index - index. - DCHECK_LE(frames_to_process, f_.size()); - float* f = f_.Data(); - - int max_index = curve_length - 1; - unsigned k = 0; -#if defined(ARCH_CPU_X86_FAMILY) - { - int loop_limit = frames_to_process / 4; - - // one = 1 - __m128i one = _mm_set1_epi32(1); - - // Do 4 eleemnts at a time - for (int loop = 0; loop < loop_limit; ++loop, k += 4) { - // v = virtual_index[k] - __m128 v = _mm_loadu_ps(virtual_index + k); - - // index1 = static_cast<int>(v); - __m128i index1 = _mm_cvttps_epi32(v); - - // v = static_cast<float>(index1) and save result to index[k:k+3] - v = _mm_cvtepi32_ps(index1); - _mm_storeu_ps(&index[k], v); - - // index2 = index2 + 1; - __m128i index2 = _mm_add_epi32(index1, one); - - // Convert index1/index2 to arrays of 32-bit int values that are our - // array indices to use to get the curve data. - int32_t* i1 = reinterpret_cast<int32_t*>(&index1); - int32_t* i2 = reinterpret_cast<int32_t*>(&index2); - - // Get the curve_data values and save them in v1 and v2, - // carfully clamping the values. If the input is NaN, index1 - // could be 0x8000000. - v1[k] = curve_data[ClampTo(i1[0], 0, max_index)]; - v2[k] = curve_data[ClampTo(i2[0], 0, max_index)]; - v1[k + 1] = curve_data[ClampTo(i1[1], 0, max_index)]; - v2[k + 1] = curve_data[ClampTo(i2[1], 0, max_index)]; - v1[k + 2] = curve_data[ClampTo(i1[2], 0, max_index)]; - v2[k + 2] = curve_data[ClampTo(i2[2], 0, max_index)]; - v1[k + 3] = curve_data[ClampTo(i1[3], 0, max_index)]; - v2[k + 3] = curve_data[ClampTo(i2[3], 0, max_index)]; - } - } -#elif defined(CPU_ARM_NEON) - { - int loop_limit = frames_to_process / 4; - - // Neon constants: - // zero = 0 - // one = 1 - // max = max_index - int32x4_t zero = vdupq_n_s32(0); - int32x4_t one = vdupq_n_s32(1); - int32x4_t max = vdupq_n_s32(max_index); - - for (int loop = 0; loop < loop_limit; ++loop, k += 4) { - // v = virtual_index - float32x4_t v = vld1q_f32(virtual_index + k); - - // index1 = static_cast<int32_t>(v), then clamp to a valid index range for - // curve_data - int32x4_t index1 = vcvtq_s32_f32(v); - index1 = vmaxq_s32(vminq_s32(index1, max), zero); - - // v = static_cast<float>(v) and save it away for later use. - v = vcvtq_f32_s32(index1); - vst1q_f32(&index[k], v); - - // index2 = index1 + 1, then clamp to a valid range for curve_data. - int32x4_t index2 = vaddq_s32(index1, one); - index2 = vmaxq_s32(vminq_s32(index2, max), zero); - - // Save index1/2 so we can get the individual parts. Aligned to - // 16 bytes for vst1q instruction. - int32_t i1[4] __attribute__((aligned(16))); - int32_t i2[4] __attribute__((aligned(16))); - vst1q_s32(i1, index1); - vst1q_s32(i2, index2); - - // Get curve elements corresponding to the indices. - v1[k] = curve_data[i1[0]]; - v2[k] = curve_data[i2[0]]; - v1[k + 1] = curve_data[i1[1]]; - v2[k + 1] = curve_data[i2[1]]; - v1[k + 2] = curve_data[i1[2]]; - v2[k + 2] = curve_data[i2[2]]; - v1[k + 3] = curve_data[i1[3]]; - v2[k + 3] = curve_data[i2[3]]; - } - } -#endif - - // Compute values for index1 and load the curve_data corresponding to indices. - for (; k < frames_to_process; ++k) { - unsigned index1 = - ClampTo(static_cast<unsigned>(virtual_index[k]), 0, max_index); - unsigned index2 = ClampTo(index1 + 1, 0, max_index); - index[k] = index1; - v1[k] = curve_data[index1]; - v2[k] = curve_data[index2]; - } - - // f[k] = virtual_index[k] - index[k] - vector_math::Vsub(virtual_index, 1, index, 1, f, 1, frames_to_process); - - // Do the linear interpolation of the curve data: - // destination[k] = v1[k] + f[k]*(v2[k] - v1[k]) - // - // 1. v2[k] = v2[k] - v1[k] - // 2. v2[k] = f[k]*v2[k] = f[k]*(v2[k] - v1[k]) - // 3. destination[k] = destination[k] + v2[k] - // = v1[k] + f[k]*(v2[k] - v1[k]) - vector_math::Vsub(v2, 1, v1, 1, v2, 1, frames_to_process); - vector_math::Vmul(f, 1, v2, 1, v2, 1, frames_to_process); - vector_math::Vadd(v2, 1, v1, 1, destination, 1, frames_to_process); -} - -void WaveShaperDSPKernel::ProcessCurve(const float* source, - float* destination, - uint32_t frames_to_process) { - DCHECK(source); - DCHECK(destination); - DCHECK(GetWaveShaperProcessor()); - - Vector<float>* curve = GetWaveShaperProcessor()->Curve(); - if (!curve) { - // Act as "straight wire" pass-through if no curve is set. - memcpy(destination, source, sizeof(float) * frames_to_process); - return; - } - - float* curve_data = curve->data(); - int curve_length = curve->size(); - - DCHECK(curve_data); - - if (!curve_data || !curve_length) { - memcpy(destination, source, sizeof(float) * frames_to_process); - return; - } - - // Apply waveshaping curve. - WaveShaperCurveValues(destination, source, frames_to_process, curve_data, - curve_length); -} - -void WaveShaperDSPKernel::ProcessCurve2x(const float* source, - float* destination, - uint32_t frames_to_process) { - DCHECK_EQ(frames_to_process, RenderQuantumFrames()); - - float* temp_p = temp_buffer_->Data(); - - up_sampler_->Process(source, temp_p, frames_to_process); - - // Process at 2x up-sampled rate. - ProcessCurve(temp_p, temp_p, frames_to_process * 2); - - down_sampler_->Process(temp_p, destination, frames_to_process * 2); -} - -void WaveShaperDSPKernel::ProcessCurve4x(const float* source, - float* destination, - uint32_t frames_to_process) { - DCHECK_EQ(frames_to_process, RenderQuantumFrames()); - - float* temp_p = temp_buffer_->Data(); - float* temp_p2 = temp_buffer2_->Data(); - - up_sampler_->Process(source, temp_p, frames_to_process); - up_sampler2_->Process(temp_p, temp_p2, frames_to_process * 2); - - // Process at 4x up-sampled rate. - ProcessCurve(temp_p2, temp_p2, frames_to_process * 4); - - down_sampler2_->Process(temp_p2, temp_p, frames_to_process * 4); - down_sampler_->Process(temp_p, destination, frames_to_process * 2); -} - -void WaveShaperDSPKernel::Reset() { - if (up_sampler_) { - up_sampler_->Reset(); - down_sampler_->Reset(); - up_sampler2_->Reset(); - down_sampler2_->Reset(); - } -} - -bool WaveShaperDSPKernel::RequiresTailProcessing() const { - // Always return true even if the tail time and latency might both be zero. - return true; -} - -double WaveShaperDSPKernel::TailTime() const { - return tail_time_; -} - -double WaveShaperDSPKernel::LatencyTime() const { - size_t latency_frames = 0; - WaveShaperDSPKernel* kernel = const_cast<WaveShaperDSPKernel*>(this); - - switch (kernel->GetWaveShaperProcessor()->Oversample()) { - case WaveShaperProcessor::kOverSampleNone: - break; - case WaveShaperProcessor::kOverSample2x: - latency_frames += up_sampler_->LatencyFrames(); - latency_frames += down_sampler_->LatencyFrames(); - break; - case WaveShaperProcessor::kOverSample4x: { - // Account for first stage upsampling. - latency_frames += up_sampler_->LatencyFrames(); - latency_frames += down_sampler_->LatencyFrames(); - - // Account for second stage upsampling. - // and divide by 2 to get back down to the regular sample-rate. - size_t latency_frames2 = - (up_sampler2_->LatencyFrames() + down_sampler2_->LatencyFrames()) / 2; - latency_frames += latency_frames2; - break; - } - default: - NOTREACHED(); - } - - return static_cast<double>(latency_frames) / SampleRate(); -} - -} // namespace blink
diff --git a/third_party/blink/renderer/modules/webaudio/wave_shaper_dsp_kernel.h b/third_party/blink/renderer/modules/webaudio/wave_shaper_dsp_kernel.h deleted file mode 100644 index 0eaf8cf..0000000 --- a/third_party/blink/renderer/modules/webaudio/wave_shaper_dsp_kernel.h +++ /dev/null
@@ -1,122 +0,0 @@ -/* - * Copyright (C) 2011, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - */ - -#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_WAVE_SHAPER_DSP_KERNEL_H_ -#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_WAVE_SHAPER_DSP_KERNEL_H_ - -#include <memory> - -#include "third_party/blink/renderer/modules/webaudio/wave_shaper_processor.h" -#include "third_party/blink/renderer/platform/audio/audio_array.h" -#include "third_party/blink/renderer/platform/audio/audio_dsp_kernel.h" -#include "third_party/blink/renderer/platform/audio/down_sampler.h" -#include "third_party/blink/renderer/platform/audio/up_sampler.h" - -namespace blink { - -class WaveShaperProcessor; - -// WaveShaperDSPKernel is an AudioDSPKernel and is responsible for non-linear -// distortion on one channel. - -class WaveShaperDSPKernel final : public AudioDSPKernel { - public: - explicit WaveShaperDSPKernel(WaveShaperProcessor*); - - // AudioDSPKernel - void Process(const float* source, - float* dest, - uint32_t frames_to_process) override; - void Reset() override; - double TailTime() const override; - double LatencyTime() const override; - bool RequiresTailProcessing() const final; - - // Oversampling requires more resources, so let's only allocate them if - // needed. - void LazyInitializeOversampling(); - - // Computes value of the WaveShaper - double WaveShaperCurveValue(float input, - const float* curve_data, - int curve_length) const; - - // Like WaveShaperCurveValue, but computes the values for a vector of inputs. - void WaveShaperCurveValues(float* destination, - const float* input, - uint32_t frames_to_process, - const float* curve_data, - int curve_length) const; - // Set the tail time - void SetTailTime(double time) { tail_time_ = time; } - - protected: - // Apply the shaping curve. - void ProcessCurve(const float* source, - float* dest, - uint32_t frames_to_process); - - // Use up-sampling, process at the higher sample-rate, then down-sample. - void ProcessCurve2x(const float* source, - float* dest, - uint32_t frames_to_process); - void ProcessCurve4x(const float* source, - float* dest, - uint32_t frames_to_process); - - WaveShaperProcessor* GetWaveShaperProcessor() { - return static_cast<WaveShaperProcessor*>(Processor()); - } - - // Oversampling. - std::unique_ptr<AudioFloatArray> temp_buffer_; - std::unique_ptr<AudioFloatArray> temp_buffer2_; - std::unique_ptr<UpSampler> up_sampler_; - std::unique_ptr<DownSampler> down_sampler_; - std::unique_ptr<UpSampler> up_sampler2_; - std::unique_ptr<DownSampler> down_sampler2_; - - private: - // Tail time for the WaveShaper. This basically can have two values: 0 and - // infinity. It only takes the value of infinity if the wave shaper curve is - // such that a zero input produces a non-zero output. In this case, the node - // has an infinite tail so that silent input continues to produce non-silent - // output. - double tail_time_ = 0; - - // Work arrays needed by WaveShaperCurveValues(). Mutable so this - // const function can modify these arrays. There's no state or - // anything kept here. See WaveShaperCurveValues() for details on - // what these hold. - mutable AudioFloatArray virtual_index_; - mutable AudioFloatArray index_; - mutable AudioFloatArray v1_; - mutable AudioFloatArray v2_; - mutable AudioFloatArray f_; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_WAVE_SHAPER_DSP_KERNEL_H_
diff --git a/third_party/blink/renderer/modules/webaudio/wave_shaper_handler.cc b/third_party/blink/renderer/modules/webaudio/wave_shaper_handler.cc index 63f75e65f..2bbf4628 100644 --- a/third_party/blink/renderer/modules/webaudio/wave_shaper_handler.cc +++ b/third_party/blink/renderer/modules/webaudio/wave_shaper_handler.cc
@@ -2,37 +2,682 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifdef UNSAFE_BUFFERS_BUILD +// TODO(crbug.com/351564777): Remove this and convert code to safer constructs. +#pragma allow_unsafe_buffers +// TODO(crbug.com/390223051): Remove C-library calls to fix the errors. +#pragma allow_unsafe_libc_calls +#endif + #include "third_party/blink/renderer/modules/webaudio/wave_shaper_handler.h" +#include <algorithm> #include <memory> +#include "base/memory/scoped_refptr.h" +#include "base/synchronization/lock.h" +#include "build/build_config.h" +#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h" #include "third_party/blink/renderer/modules/webaudio/audio_node.h" +#include "third_party/blink/renderer/modules/webaudio/audio_node_input.h" +#include "third_party/blink/renderer/modules/webaudio/audio_node_output.h" #include "third_party/blink/renderer/modules/webaudio/base_audio_context.h" -#include "third_party/blink/renderer/modules/webaudio/wave_shaper_processor.h" +#include "third_party/blink/renderer/platform/audio/audio_array.h" +#include "third_party/blink/renderer/platform/audio/audio_dsp_kernel.h" +#include "third_party/blink/renderer/platform/audio/audio_dsp_kernel_processor.h" +#include "third_party/blink/renderer/platform/audio/audio_utilities.h" +#include "third_party/blink/renderer/platform/audio/down_sampler.h" +#include "third_party/blink/renderer/platform/audio/up_sampler.h" +#include "third_party/blink/renderer/platform/audio/vector_math.h" +#include "third_party/blink/renderer/platform/wtf/math_extras.h" +#include "third_party/blink/renderer/platform/wtf/threading.h" + +#if defined(ARCH_CPU_X86_FAMILY) +#include <xmmintrin.h> +#elif defined(CPU_ARM_NEON) +#include <arm_neon.h> +#endif namespace blink { namespace { constexpr unsigned kNumberOfChannels = 1; +constexpr unsigned kDefaultNumberOfOutputChannels = 1; } // namespace -WaveShaperHandler::WaveShaperHandler(AudioNode& node, float sample_rate) - : AudioBasicProcessorHandler( - NodeType::kNodeTypeWaveShaper, - node, - sample_rate, - std::make_unique<WaveShaperProcessor>( - sample_rate, - kNumberOfChannels, - node.context()->GetDeferredTaskHandler().RenderQuantumFrames())) { - Initialize(); -} +// WaveShaperProcessor is an AudioDSPKernelProcessor which uses +// WaveShaperDSPKernel objects to implement non-linear distortion effects. +class WaveShaperProcessor final : public AudioDSPKernelProcessor { + public: + WaveShaperProcessor(float sample_rate, + unsigned number_of_channels, + unsigned render_quantum_frames) + : AudioDSPKernelProcessor(sample_rate, + number_of_channels, + render_quantum_frames) {} + + ~WaveShaperProcessor() override { + if (IsInitialized()) { + Uninitialize(); + } + } + + std::unique_ptr<AudioDSPKernel> CreateKernel() override { + return std::make_unique<WaveShaperDSPKernel>(this); + } + + void Process(const AudioBus* source, + AudioBus* destination, + uint32_t frames_to_process) override { + if (!IsInitialized()) { + destination->Zero(); + return; + } + + DCHECK_EQ(source->NumberOfChannels(), destination->NumberOfChannels()); + + // The audio thread can't block on this lock, so we call tryLock() instead. + base::AutoTryLock try_locker(process_lock_); + if (try_locker.is_acquired()) { + DCHECK_EQ(source->NumberOfChannels(), kernels_.size()); + // For each channel of our input, process using the corresponding + // WaveShaperDSPKernel into the output channel. + for (unsigned i = 0; i < kernels_.size(); ++i) { + kernels_[i]->Process(source->Channel(i)->Data(), + destination->Channel(i)->MutableData(), + frames_to_process); + } + } else { + // Too bad - the tryLock() failed. We must be in the middle of a + // setCurve() call. + destination->Zero(); + } + } + + void SetCurve(const float* curve_data, unsigned curve_length) { + DCHECK(IsMainThread()); + + // This synchronizes with process(). + base::AutoLock process_locker(process_lock_); + + if (curve_length == 0 || !curve_data) { + curve_ = nullptr; + return; + } + + // Copy the curve data, if any, to our internal buffer. + curve_ = std::make_unique<Vector<float>>(curve_length); + memcpy(curve_->data(), curve_data, sizeof(float) * curve_length); + + DCHECK_GE(kernels_.size(), 1ULL); + + // Compute the curve output for a zero input, and set the tail time for all + // the kernels. + WaveShaperDSPKernel* kernel = + static_cast<WaveShaperDSPKernel*>(kernels_[0].get()); + double output = kernel->WaveShaperCurveValue(0.0, curve_data, curve_length); + double tail_time = + output == 0 ? 0 : std::numeric_limits<double>::infinity(); + + for (auto& k : kernels_) { + kernel = static_cast<WaveShaperDSPKernel*>(k.get()); + kernel->SetTailTime(tail_time); + } + } + + Vector<float>* Curve() const { return curve_.get(); } + + void SetOversample(WaveShaperHandler::OverSampleType oversample) { + // This synchronizes with process(). + base::AutoLock process_locker(process_lock_); + + oversample_ = oversample; + + if (oversample != WaveShaperHandler::kOverSampleNone) { + for (auto& i : kernels_) { + WaveShaperDSPKernel* kernel = + static_cast<WaveShaperDSPKernel*>(i.get()); + kernel->LazyInitializeOversampling(); + } + } + } + + WaveShaperHandler::OverSampleType Oversample() const { return oversample_; } + + private: + // WaveShaperDSPKernel is an AudioDSPKernel and is responsible for non-linear + // distortion on one channel. + class WaveShaperDSPKernel final : public AudioDSPKernel { + public: + explicit WaveShaperDSPKernel(WaveShaperProcessor* processor) + : AudioDSPKernel(processor), + // 4 times render size to handle 4x oversampling. + virtual_index_(4 * RenderQuantumFrames()), + index_(4 * RenderQuantumFrames()), + v1_(4 * RenderQuantumFrames()), + v2_(4 * RenderQuantumFrames()), + f_(4 * RenderQuantumFrames()) { + if (processor->Oversample() != WaveShaperHandler::kOverSampleNone) { + LazyInitializeOversampling(); + } + } + + // AudioDSPKernel + void Process(const float* source, + float* destination, + uint32_t frames_to_process) override { + switch (GetWaveShaperProcessor()->Oversample()) { + case WaveShaperHandler::kOverSampleNone: + ProcessCurve(source, destination, frames_to_process); + break; + case WaveShaperHandler::kOverSample2x: + ProcessCurve2x(source, destination, frames_to_process); + break; + case WaveShaperHandler::kOverSample4x: + ProcessCurve4x(source, destination, frames_to_process); + break; + + default: + NOTREACHED(); + } + } + void Reset() override { + if (up_sampler_) { + up_sampler_->Reset(); + down_sampler_->Reset(); + up_sampler2_->Reset(); + down_sampler2_->Reset(); + } + } + double TailTime() const override { return tail_time_; } + double LatencyTime() const override { + size_t latency_frames = 0; + WaveShaperDSPKernel* kernel = const_cast<WaveShaperDSPKernel*>(this); + + switch (kernel->GetWaveShaperProcessor()->Oversample()) { + case WaveShaperHandler::kOverSampleNone: + break; + case WaveShaperHandler::kOverSample2x: + latency_frames += up_sampler_->LatencyFrames(); + latency_frames += down_sampler_->LatencyFrames(); + break; + case WaveShaperHandler::kOverSample4x: { + // Account for first stage upsampling. + latency_frames += up_sampler_->LatencyFrames(); + latency_frames += down_sampler_->LatencyFrames(); + + // Account for second stage upsampling. + // and divide by 2 to get back down to the regular sample-rate. + size_t latency_frames2 = (up_sampler2_->LatencyFrames() + + down_sampler2_->LatencyFrames()) / + 2; + latency_frames += latency_frames2; + break; + } + default: + NOTREACHED(); + } + + return static_cast<double>(latency_frames) / SampleRate(); + } + + bool RequiresTailProcessing() const override { + // Always return true even if the tail time and latency might both be + // zero. + return true; + } + + // Oversampling requires more resources, so let's only allocate them if + // needed. + void LazyInitializeOversampling() { + if (!temp_buffer_) { + temp_buffer_ = + std::make_unique<AudioFloatArray>(RenderQuantumFrames() * 2); + temp_buffer2_ = + std::make_unique<AudioFloatArray>(RenderQuantumFrames() * 4); + up_sampler_ = std::make_unique<UpSampler>(RenderQuantumFrames()); + down_sampler_ = + std::make_unique<DownSampler>(RenderQuantumFrames() * 2); + up_sampler2_ = std::make_unique<UpSampler>(RenderQuantumFrames() * 2); + down_sampler2_ = + std::make_unique<DownSampler>(RenderQuantumFrames() * 4); + } + } + + // Computes value of the WaveShaper + double WaveShaperCurveValue(float input, + const float* curve_data, + int curve_length) const { + // Calculate a virtual index based on input -1 -> +1 with -1 being + // curve[0], +1 being curve[curveLength - 1], and 0 being at the center of + // the curve data. Then linearly interpolate between the two points in the + // curve. + double virtual_index = 0.5 * (input + 1) * (curve_length - 1); + double output; + if (virtual_index < 0) { + // input < -1, so use curve[0] + output = curve_data[0]; + } else if (virtual_index >= curve_length - 1) { + // input >= 1, so use last curve value + output = curve_data[curve_length - 1]; + } else { + // The general case where -1 <= input < 1, where 0 <= virtualIndex < + // curveLength - 1, so interpolate between the nearest samples on the + // curve. + unsigned index1 = static_cast<unsigned>(virtual_index); + unsigned index2 = index1 + 1; + double interpolation_factor = virtual_index - index1; + + double value1 = curve_data[index1]; + double value2 = curve_data[index2]; + + output = (1.0 - interpolation_factor) * value1 + + interpolation_factor * value2; + } + + return output; + } + + // Like WaveShaperCurveValue, but computes the values for a vector of + // inputs. + void WaveShaperCurveValues(float* destination, + const float* source, + uint32_t frames_to_process, + const float* curve_data, + int curve_length) const { + DCHECK_LE(frames_to_process, virtual_index_.size()); + // Index into the array computed from the source value. + float* virtual_index = virtual_index_.Data(); + + // virtual_index[k] = + // ClampTo(0.5 * (source[k] + 1) * (curve_length - 1), + // 0.0f, + // static_cast<float>(curve_length - 1)) + + // Add 1 to source puttting result in virtual_index + vector_math::Vsadd(source, 1, 1, virtual_index, 1, frames_to_process); + + // Scale virtual_index in place by (curve_lenth -1)/2 + vector_math::Vsmul(virtual_index, 1, 0.5 * (curve_length - 1), + virtual_index, 1, frames_to_process); + + // Clip virtual_index, in place. + vector_math::Vclip(virtual_index, 1, 0, curve_length - 1, virtual_index, + 1, frames_to_process); + + // index = floor(virtual_index) + DCHECK_LE(frames_to_process, index_.size()); + float* index = index_.Data(); + + // v1 and v2 hold the curve_data corresponding to the closest curve + // values to the source sample. To save memory, v1 will use the + // destination array. + DCHECK_LE(frames_to_process, v1_.size()); + DCHECK_LE(frames_to_process, v2_.size()); + float* v1 = v1_.Data(); + float* v2 = v2_.Data(); + + // Interpolation factor: virtual_index - index. + DCHECK_LE(frames_to_process, f_.size()); + float* f = f_.Data(); + + int max_index = curve_length - 1; + unsigned k = 0; +#if defined(ARCH_CPU_X86_FAMILY) + { + int loop_limit = frames_to_process / 4; + + // one = 1 + __m128i one = _mm_set1_epi32(1); + + // Do 4 eleemnts at a time + for (int loop = 0; loop < loop_limit; ++loop, k += 4) { + // v = virtual_index[k] + __m128 v = _mm_loadu_ps(virtual_index + k); + + // index1 = static_cast<int>(v); + __m128i index1 = _mm_cvttps_epi32(v); + + // v = static_cast<float>(index1) and save result to index[k:k+3] + v = _mm_cvtepi32_ps(index1); + _mm_storeu_ps(&index[k], v); + + // index2 = index2 + 1; + __m128i index2 = _mm_add_epi32(index1, one); + + // Convert index1/index2 to arrays of 32-bit int values that are our + // array indices to use to get the curve data. + int32_t* i1 = reinterpret_cast<int32_t*>(&index1); + int32_t* i2 = reinterpret_cast<int32_t*>(&index2); + + // Get the curve_data values and save them in v1 and v2, + // carfully clamping the values. If the input is NaN, index1 + // could be 0x8000000. + v1[k] = curve_data[ClampTo(i1[0], 0, max_index)]; + v2[k] = curve_data[ClampTo(i2[0], 0, max_index)]; + v1[k + 1] = curve_data[ClampTo(i1[1], 0, max_index)]; + v2[k + 1] = curve_data[ClampTo(i2[1], 0, max_index)]; + v1[k + 2] = curve_data[ClampTo(i1[2], 0, max_index)]; + v2[k + 2] = curve_data[ClampTo(i2[2], 0, max_index)]; + v1[k + 3] = curve_data[ClampTo(i1[3], 0, max_index)]; + v2[k + 3] = curve_data[ClampTo(i2[3], 0, max_index)]; + } + } +#elif defined(CPU_ARM_NEON) + { + int loop_limit = frames_to_process / 4; + + // Neon constants: + // zero = 0 + // one = 1 + // max = max_index + int32x4_t zero = vdupq_n_s32(0); + int32x4_t one = vdupq_n_s32(1); + int32x4_t max = vdupq_n_s32(max_index); + + for (int loop = 0; loop < loop_limit; ++loop, k += 4) { + // v = virtual_index + float32x4_t v = vld1q_f32(virtual_index + k); + + // index1 = static_cast<int32_t>(v), then clamp to a valid index range + // for curve_data + int32x4_t index1 = vcvtq_s32_f32(v); + index1 = vmaxq_s32(vminq_s32(index1, max), zero); + + // v = static_cast<float>(v) and save it away for later use. + v = vcvtq_f32_s32(index1); + vst1q_f32(&index[k], v); + + // index2 = index1 + 1, then clamp to a valid range for curve_data. + int32x4_t index2 = vaddq_s32(index1, one); + index2 = vmaxq_s32(vminq_s32(index2, max), zero); + + // Save index1/2 so we can get the individual parts. Aligned to + // 16 bytes for vst1q instruction. + int32_t i1[4] __attribute__((aligned(16))); + int32_t i2[4] __attribute__((aligned(16))); + vst1q_s32(i1, index1); + vst1q_s32(i2, index2); + + // Get curve elements corresponding to the indices. + v1[k] = curve_data[i1[0]]; + v2[k] = curve_data[i2[0]]; + v1[k + 1] = curve_data[i1[1]]; + v2[k + 1] = curve_data[i2[1]]; + v1[k + 2] = curve_data[i1[2]]; + v2[k + 2] = curve_data[i2[2]]; + v1[k + 3] = curve_data[i1[3]]; + v2[k + 3] = curve_data[i2[3]]; + } + } +#endif + + // Compute values for index1 and load the curve_data corresponding to + // indices. + for (; k < frames_to_process; ++k) { + unsigned index1 = + ClampTo(static_cast<unsigned>(virtual_index[k]), 0, max_index); + unsigned index2 = ClampTo(index1 + 1, 0, max_index); + index[k] = index1; + v1[k] = curve_data[index1]; + v2[k] = curve_data[index2]; + } + + // f[k] = virtual_index[k] - index[k] + vector_math::Vsub(virtual_index, 1, index, 1, f, 1, frames_to_process); + + // Do the linear interpolation of the curve data: + // destination[k] = v1[k] + f[k]*(v2[k] - v1[k]) + // + // 1. v2[k] = v2[k] - v1[k] + // 2. v2[k] = f[k]*v2[k] = f[k]*(v2[k] - v1[k]) + // 3. destination[k] = destination[k] + v2[k] + // = v1[k] + f[k]*(v2[k] - v1[k]) + vector_math::Vsub(v2, 1, v1, 1, v2, 1, frames_to_process); + vector_math::Vmul(f, 1, v2, 1, v2, 1, frames_to_process); + vector_math::Vadd(v2, 1, v1, 1, destination, 1, frames_to_process); + } + + // Set the tail time + void SetTailTime(double time) { tail_time_ = time; } + + private: + // Apply the shaping curve. + void ProcessCurve(const float* source, + float* destination, + uint32_t frames_to_process) { + DCHECK(source); + DCHECK(destination); + DCHECK(GetWaveShaperProcessor()); + + Vector<float>* curve = GetWaveShaperProcessor()->Curve(); + if (!curve) { + // Act as "straight wire" pass-through if no curve is set. + memcpy(destination, source, sizeof(float) * frames_to_process); + return; + } + + float* curve_data = curve->data(); + int curve_length = curve->size(); + + DCHECK(curve_data); + + if (!curve_data || !curve_length) { + memcpy(destination, source, sizeof(float) * frames_to_process); + return; + } + + // Apply waveshaping curve. + WaveShaperCurveValues(destination, source, frames_to_process, curve_data, + curve_length); + } + + // Use up-sampling, process at the higher sample-rate, then down-sample. + void ProcessCurve2x(const float* source, + float* destination, + uint32_t frames_to_process) { + DCHECK_EQ(frames_to_process, RenderQuantumFrames()); + + float* temp_p = temp_buffer_->Data(); + + up_sampler_->Process(source, temp_p, frames_to_process); + + // Process at 2x up-sampled rate. + ProcessCurve(temp_p, temp_p, frames_to_process * 2); + + down_sampler_->Process(temp_p, destination, frames_to_process * 2); + } + + void ProcessCurve4x(const float* source, + float* destination, + uint32_t frames_to_process) { + DCHECK_EQ(frames_to_process, RenderQuantumFrames()); + + float* temp_p = temp_buffer_->Data(); + float* temp_p2 = temp_buffer2_->Data(); + + up_sampler_->Process(source, temp_p, frames_to_process); + up_sampler2_->Process(temp_p, temp_p2, frames_to_process * 2); + + // Process at 4x up-sampled rate. + ProcessCurve(temp_p2, temp_p2, frames_to_process * 4); + + down_sampler2_->Process(temp_p2, temp_p, frames_to_process * 4); + down_sampler_->Process(temp_p, destination, frames_to_process * 2); + } + + WaveShaperProcessor* GetWaveShaperProcessor() { + return static_cast<WaveShaperProcessor*>(Processor()); + } + + // Oversampling. + std::unique_ptr<AudioFloatArray> temp_buffer_; + std::unique_ptr<AudioFloatArray> temp_buffer2_; + std::unique_ptr<UpSampler> up_sampler_; + std::unique_ptr<DownSampler> down_sampler_; + std::unique_ptr<UpSampler> up_sampler2_; + std::unique_ptr<DownSampler> down_sampler2_; + + // Tail time for the WaveShaper. This basically can have two values: 0 and + // infinity. It only takes the value of infinity if the wave shaper curve + // is such that a zero input produces a non-zero output. In this case, the + // node has an infinite tail so that silent input continues to produce + // non-silent output. + double tail_time_ = 0; + + // Work arrays needed by WaveShaperCurveValues(). Mutable so this + // const function can modify these arrays. There's no state or + // anything kept here. See WaveShaperCurveValues() for details on + // what these hold. + mutable AudioFloatArray virtual_index_; + mutable AudioFloatArray index_; + mutable AudioFloatArray v1_; + mutable AudioFloatArray v2_; + mutable AudioFloatArray f_; + }; + + // m_curve represents the non-linear shaping curve. + std::unique_ptr<Vector<float>> curve_; + + WaveShaperHandler::OverSampleType oversample_ = + WaveShaperHandler::kOverSampleNone; +}; scoped_refptr<WaveShaperHandler> WaveShaperHandler::Create(AudioNode& node, float sample_rate) { return base::AdoptRef(new WaveShaperHandler(node, sample_rate)); } +void WaveShaperHandler::SetCurve(const float* curve_data, + unsigned curve_length) { + GetWaveShaperProcessor()->SetCurve(curve_data, curve_length); +} + +Vector<float>* WaveShaperHandler::Curve() { + return GetWaveShaperProcessor()->Curve(); +} + +void WaveShaperHandler::SetOversample(OverSampleType oversample) { + GetWaveShaperProcessor()->SetOversample(oversample); +} + +WaveShaperHandler::OverSampleType WaveShaperHandler::Oversample() { + return GetWaveShaperProcessor()->Oversample(); +} + +WaveShaperHandler::WaveShaperHandler(AudioNode& node, float sample_rate) + : AudioHandler(NodeType::kNodeTypeWaveShaper, node, sample_rate), + processor_(std::make_unique<WaveShaperProcessor>( + sample_rate, + kNumberOfChannels, + node.context()->GetDeferredTaskHandler().RenderQuantumFrames())) { + AddInput(); + AddOutput(kDefaultNumberOfOutputChannels); + + Initialize(); +} + +void WaveShaperHandler::Process(uint32_t frames_to_process) { + AudioBus* destination_bus = Output(0).Bus(); + + if (!IsInitialized() || !Processor() || + Processor()->NumberOfChannels() != NumberOfChannels()) { + destination_bus->Zero(); + } else { + scoped_refptr<AudioBus> source_bus = Input(0).Bus(); + + // FIXME: if we take "tail time" into account, then we can avoid calling + // processor()->process() once the tail dies down. + if (!Input(0).IsConnected()) { + source_bus->Zero(); + } + + Processor()->Process(source_bus.get(), destination_bus, frames_to_process); + } +} + +void WaveShaperHandler::ProcessOnlyAudioParams(uint32_t frames_to_process) { + if (!IsInitialized() || !Processor()) { + return; + } + + Processor()->ProcessOnlyAudioParams(frames_to_process); +} + +void WaveShaperHandler::Initialize() { + if (IsInitialized()) { + return; + } + + DCHECK(Processor()); + Processor()->Initialize(); + + AudioHandler::Initialize(); +} + +void WaveShaperHandler::Uninitialize() { + if (!IsInitialized()) { + return; + } + + DCHECK(Processor()); + Processor()->Uninitialize(); + + AudioHandler::Uninitialize(); +} + +void WaveShaperHandler::CheckNumberOfChannelsForInput(AudioNodeInput* input) { + DCHECK(Context()->IsAudioThread()); + Context()->AssertGraphOwner(); + + DCHECK_EQ(input, &Input(0)); + DCHECK(Processor()); + + unsigned number_of_channels = input->NumberOfChannels(); + + if (IsInitialized() && number_of_channels != Output(0).NumberOfChannels()) { + // We're already initialized but the channel count has changed. + Uninitialize(); + } + + if (!IsInitialized()) { + // This will propagate the channel count to any nodes connected further down + // the chain... + Output(0).SetNumberOfChannels(number_of_channels); + + // Re-initialize the processor with the new channel count. + Processor()->SetNumberOfChannels(number_of_channels); + Initialize(); + } + + AudioHandler::CheckNumberOfChannelsForInput(input); +} + +bool WaveShaperHandler::RequiresTailProcessing() const { + return processor_->RequiresTailProcessing(); +} + +double WaveShaperHandler::TailTime() const { + return processor_->TailTime(); +} + +double WaveShaperHandler::LatencyTime() const { + return processor_->LatencyTime(); +} + +void WaveShaperHandler::PullInputs(uint32_t frames_to_process) { + // Render directly into output bus for in-place processing + Input(0).Pull(Output(0).Bus(), frames_to_process); +} + +unsigned WaveShaperHandler::NumberOfChannels() { + return Output(0).NumberOfChannels(); +} + +WaveShaperProcessor* WaveShaperHandler::GetWaveShaperProcessor() { + return static_cast<WaveShaperProcessor*>(Processor()); +} + } // namespace blink
diff --git a/third_party/blink/renderer/modules/webaudio/wave_shaper_handler.h b/third_party/blink/renderer/modules/webaudio/wave_shaper_handler.h index 460f550..4d2b0acd 100644 --- a/third_party/blink/renderer/modules/webaudio/wave_shaper_handler.h +++ b/third_party/blink/renderer/modules/webaudio/wave_shaper_handler.h
@@ -11,13 +11,39 @@ namespace blink { class AudioNode; +class AudioProcessor; +class WaveShaperProcessor; -class WaveShaperHandler : public AudioBasicProcessorHandler { +class WaveShaperHandler final : public AudioHandler { public: + enum OverSampleType { kOverSampleNone, kOverSample2x, kOverSample4x }; + static scoped_refptr<WaveShaperHandler> Create(AudioNode&, float sample_rate); + void SetCurve(const float* curve_data, unsigned curve_length); + Vector<float>* Curve(); + void SetOversample(OverSampleType oversample); + OverSampleType Oversample(); + private: WaveShaperHandler(AudioNode& iirfilter_node, float sample_rate); + + // AudioHandler + void Process(uint32_t frames_to_process) override; + void ProcessOnlyAudioParams(uint32_t frames_to_process) override; + void Initialize() override; + void Uninitialize() override; + void CheckNumberOfChannelsForInput(AudioNodeInput*) override; + bool RequiresTailProcessing() const override; + double TailTime() const override; + double LatencyTime() const override; + void PullInputs(uint32_t frames_to_process) override; + + unsigned NumberOfChannels(); + AudioProcessor* Processor() { return processor_.get(); } + WaveShaperProcessor* GetWaveShaperProcessor(); + + std::unique_ptr<AudioProcessor> processor_; }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webaudio/wave_shaper_node.cc b/third_party/blink/renderer/modules/webaudio/wave_shaper_node.cc index 9f28ca8..ab8df291 100644 --- a/third_party/blink/renderer/modules/webaudio/wave_shaper_node.cc +++ b/third_party/blink/renderer/modules/webaudio/wave_shaper_node.cc
@@ -33,8 +33,6 @@ #include "third_party/blink/renderer/bindings/modules/v8/v8_wave_shaper_options.h" #include "third_party/blink/renderer/modules/webaudio/audio_graph_tracer.h" #include "third_party/blink/renderer/modules/webaudio/base_audio_context.h" -#include "third_party/blink/renderer/modules/webaudio/wave_shaper_handler.h" -#include "third_party/blink/renderer/modules/webaudio/wave_shaper_processor.h" #include "third_party/blink/renderer/platform/bindings/exception_messages.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" @@ -70,9 +68,8 @@ return node; } -WaveShaperProcessor* WaveShaperNode::GetWaveShaperProcessor() const { - return static_cast<WaveShaperProcessor*>( - static_cast<WaveShaperHandler&>(Handler()).Processor()); +WaveShaperHandler& WaveShaperNode::GetWaveShaperHandler() const { + return static_cast<WaveShaperHandler&>(Handler()); } void WaveShaperNode::SetCurveImpl(const float* curve_data, @@ -103,7 +100,7 @@ // Initialize() and Uninitialize(), changing the number of kernels. DeferredTaskHandler::GraphAutoLocker context_locker(context()); - GetWaveShaperProcessor()->SetCurve(curve_data, length); + GetWaveShaperHandler().SetCurve(curve_data, length); } void WaveShaperNode::setCurve(NotShared<DOMFloat32Array> curve, @@ -125,7 +122,7 @@ } NotShared<DOMFloat32Array> WaveShaperNode::curve() { - Vector<float>* curve = GetWaveShaperProcessor()->Curve(); + Vector<float>* curve = GetWaveShaperHandler().Curve(); if (!curve) { return NotShared<DOMFloat32Array>(nullptr); } @@ -148,30 +145,26 @@ switch (type.AsEnum()) { case V8OverSampleType::Enum::kNone: - GetWaveShaperProcessor()->SetOversample( - WaveShaperProcessor::kOverSampleNone); + GetWaveShaperHandler().SetOversample(WaveShaperHandler::kOverSampleNone); return; case V8OverSampleType::Enum::k2X: - GetWaveShaperProcessor()->SetOversample( - WaveShaperProcessor::kOverSample2x); + GetWaveShaperHandler().SetOversample(WaveShaperHandler::kOverSample2x); return; case V8OverSampleType::Enum::k4X: - GetWaveShaperProcessor()->SetOversample( - WaveShaperProcessor::kOverSample4x); + GetWaveShaperHandler().SetOversample(WaveShaperHandler::kOverSample4x); return; } NOTREACHED(); } V8OverSampleType WaveShaperNode::oversample() const { - switch (const_cast<WaveShaperNode*>(this) - ->GetWaveShaperProcessor() - ->Oversample()) { - case WaveShaperProcessor::kOverSampleNone: + switch ( + const_cast<WaveShaperNode*>(this)->GetWaveShaperHandler().Oversample()) { + case WaveShaperHandler::kOverSampleNone: return V8OverSampleType(V8OverSampleType::Enum::kNone); - case WaveShaperProcessor::kOverSample2x: + case WaveShaperHandler::kOverSample2x: return V8OverSampleType(V8OverSampleType::Enum::k2X); - case WaveShaperProcessor::kOverSample4x: + case WaveShaperHandler::kOverSample4x: return V8OverSampleType(V8OverSampleType::Enum::k4X); } NOTREACHED();
diff --git a/third_party/blink/renderer/modules/webaudio/wave_shaper_node.h b/third_party/blink/renderer/modules/webaudio/wave_shaper_node.h index 8ddd3e1..8e3bd1f 100644 --- a/third_party/blink/renderer/modules/webaudio/wave_shaper_node.h +++ b/third_party/blink/renderer/modules/webaudio/wave_shaper_node.h
@@ -29,6 +29,7 @@ #include "third_party/blink/renderer/core/typed_arrays/array_buffer_view_helpers.h" #include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h" #include "third_party/blink/renderer/modules/webaudio/audio_node.h" +#include "third_party/blink/renderer/modules/webaudio/wave_shaper_handler.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" #include "third_party/blink/renderer/platform/wtf/vector.h" @@ -38,7 +39,6 @@ class ExceptionState; class V8OverSampleType; class WaveShaperOptions; -class WaveShaperProcessor; class WaveShaperNode final : public AudioNode { DEFINE_WRAPPERTYPEINFO(); @@ -67,7 +67,7 @@ void SetCurveImpl(const float* curve_data, size_t curve_length, ExceptionState&); - WaveShaperProcessor* GetWaveShaperProcessor() const; + WaveShaperHandler& GetWaveShaperHandler() const; }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webaudio/wave_shaper_processor.cc b/third_party/blink/renderer/modules/webaudio/wave_shaper_processor.cc deleted file mode 100644 index ece698a..0000000 --- a/third_party/blink/renderer/modules/webaudio/wave_shaper_processor.cc +++ /dev/null
@@ -1,130 +0,0 @@ -/* - * Copyright (C) 2011, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - */ - -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/390223051): Remove C-library calls to fix the errors. -#pragma allow_unsafe_libc_calls -#endif - -#include "third_party/blink/renderer/modules/webaudio/wave_shaper_processor.h" - -#include <memory> - -#include "base/synchronization/lock.h" -#include "third_party/blink/renderer/modules/webaudio/wave_shaper_dsp_kernel.h" - -namespace blink { - -WaveShaperProcessor::WaveShaperProcessor(float sample_rate, - unsigned number_of_channels, - unsigned render_quantum_frames) - : AudioDSPKernelProcessor(sample_rate, - number_of_channels, - render_quantum_frames) {} - -WaveShaperProcessor::~WaveShaperProcessor() { - if (IsInitialized()) { - Uninitialize(); - } -} - -std::unique_ptr<AudioDSPKernel> WaveShaperProcessor::CreateKernel() { - return std::make_unique<WaveShaperDSPKernel>(this); -} - -void WaveShaperProcessor::SetCurve(const float* curve_data, - unsigned curve_length) { - DCHECK(IsMainThread()); - - // This synchronizes with process(). - base::AutoLock process_locker(process_lock_); - - if (curve_length == 0 || !curve_data) { - curve_ = nullptr; - return; - } - - // Copy the curve data, if any, to our internal buffer. - curve_ = std::make_unique<Vector<float>>(curve_length); - memcpy(curve_->data(), curve_data, sizeof(float) * curve_length); - - DCHECK_GE(kernels_.size(), 1ULL); - - // Compute the curve output for a zero input, and set the tail time for all - // the kernels. - WaveShaperDSPKernel* kernel = - static_cast<WaveShaperDSPKernel*>(kernels_[0].get()); - double output = kernel->WaveShaperCurveValue(0.0, curve_data, curve_length); - double tail_time = output == 0 ? 0 : std::numeric_limits<double>::infinity(); - - for (auto& k : kernels_) { - kernel = static_cast<WaveShaperDSPKernel*>(k.get()); - kernel->SetTailTime(tail_time); - } -} - -void WaveShaperProcessor::SetOversample(OverSampleType oversample) { - // This synchronizes with process(). - base::AutoLock process_locker(process_lock_); - - oversample_ = oversample; - - if (oversample != kOverSampleNone) { - for (auto& i : kernels_) { - WaveShaperDSPKernel* kernel = static_cast<WaveShaperDSPKernel*>(i.get()); - kernel->LazyInitializeOversampling(); - } - } -} - -void WaveShaperProcessor::Process(const AudioBus* source, - AudioBus* destination, - uint32_t frames_to_process) { - if (!IsInitialized()) { - destination->Zero(); - return; - } - - DCHECK_EQ(source->NumberOfChannels(), destination->NumberOfChannels()); - - // The audio thread can't block on this lock, so we call tryLock() instead. - base::AutoTryLock try_locker(process_lock_); - if (try_locker.is_acquired()) { - DCHECK_EQ(source->NumberOfChannels(), kernels_.size()); - // For each channel of our input, process using the corresponding - // WaveShaperDSPKernel into the output channel. - for (unsigned i = 0; i < kernels_.size(); ++i) { - kernels_[i]->Process(source->Channel(i)->Data(), - destination->Channel(i)->MutableData(), - frames_to_process); - } - } else { - // Too bad - the tryLock() failed. We must be in the middle of a setCurve() - // call. - destination->Zero(); - } -} - -} // namespace blink
diff --git a/third_party/blink/renderer/modules/webaudio/wave_shaper_processor.h b/third_party/blink/renderer/modules/webaudio/wave_shaper_processor.h deleted file mode 100644 index 64cb553..0000000 --- a/third_party/blink/renderer/modules/webaudio/wave_shaper_processor.h +++ /dev/null
@@ -1,73 +0,0 @@ -/* - * Copyright (C) 2011, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - */ - -#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_WAVE_SHAPER_PROCESSOR_H_ -#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_WAVE_SHAPER_PROCESSOR_H_ - -#include <memory> - -#include "base/memory/scoped_refptr.h" -#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h" -#include "third_party/blink/renderer/modules/webaudio/audio_node.h" -#include "third_party/blink/renderer/platform/audio/audio_dsp_kernel.h" -#include "third_party/blink/renderer/platform/audio/audio_dsp_kernel_processor.h" - -namespace blink { - -// WaveShaperProcessor is an AudioDSPKernelProcessor which uses -// WaveShaperDSPKernel objects to implement non-linear distortion effects. - -class WaveShaperProcessor final : public AudioDSPKernelProcessor { - public: - enum OverSampleType { kOverSampleNone, kOverSample2x, kOverSample4x }; - - WaveShaperProcessor(float sample_rate, - unsigned number_of_channels, - unsigned render_quantum_frames); - - ~WaveShaperProcessor() override; - - std::unique_ptr<AudioDSPKernel> CreateKernel() override; - - void Process(const AudioBus* source, - AudioBus* destination, - uint32_t frames_to_process) override; - - void SetCurve(const float* curve_data, unsigned curve_length); - Vector<float>* Curve() const { return curve_.get(); } - - void SetOversample(OverSampleType); - OverSampleType Oversample() const { return oversample_; } - - private: - // m_curve represents the non-linear shaping curve. - std::unique_ptr<Vector<float>> curve_; - - OverSampleType oversample_ = kOverSampleNone; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_WAVE_SHAPER_PROCESSOR_H_
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc index 1eb821b..79597c8 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
@@ -6080,7 +6080,8 @@ SourceImageStatus source_image_status = kInvalidSourceImageStatus; scoped_refptr<Image> image = context_host->GetSourceImageForCanvas( FlushReason::kWebGLTexImage, &source_image_status, - gfx::SizeF(*params.width, *params.height), kDontChangeAlpha); + gfx::SizeF(*params.width, *params.height), + CanvasImageSource::kDontChangeAlpha); if (source_image_status != kNormalSourceImageStatus) return;
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_queue.cc b/third_party/blink/renderer/modules/webgpu/gpu_queue.cc index 7c0a680..5353056 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_queue.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_queue.cc
@@ -250,7 +250,7 @@ SourceImageStatus source_image_status = kInvalidSourceImageStatus; auto image_for_canvas = canvas_image_source->GetSourceImageForCanvas( FlushReason::kWebGPUExternalImage, &source_image_status, image_size, - kDontChangeAlpha); + CanvasImageSource::kDontChangeAlpha); if (source_image_status != kNormalSourceImageStatus) { // Canvas back resource is broken, zero size, incomplete or invalid. // but developer can do nothing. Return nullptr and issue an noop.
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn index af6f538c..f147d32 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1090,6 +1090,7 @@ "graphics/mutator_client.h", "graphics/offscreen_canvas_placeholder.cc", "graphics/offscreen_canvas_placeholder.h", + "graphics/opacity_mode.h", "graphics/overlay_scrollbar_clip_behavior.h", "graphics/paint/clip_paint_property_node.cc", "graphics/paint/clip_paint_property_node.h",
diff --git a/third_party/blink/renderer/platform/blink_platform_unittests_bundle_data.filelist b/third_party/blink/renderer/platform/blink_platform_unittests_bundle_data.filelist index 7b23015..8926d3f 100644 --- a/third_party/blink/renderer/platform/blink_platform_unittests_bundle_data.filelist +++ b/third_party/blink/renderer/platform/blink_platform_unittests_bundle_data.filelist
@@ -6,12 +6,12 @@ # instructions on how to regenerate. Otherwise, do not edit. ../../web_tests/external/wpt/css/css-fonts/resources/COLR-palettes-test-font.ttf ../../web_tests/external/wpt/css/css-fonts/resources/vs/MPLUS1-Regular_without-cmap14-subset.ttf -../../web_tests/external/wpt/css/css-fonts/resources/vs/NotoSansJP-Regular_with-cmap14-subset.ttf ../../web_tests/external/wpt/css/css-fonts/resources/vs/NotoColorEmoji-Regular_subset.ttf -../../web_tests/external/wpt/css/css-fonts/resources/vs/NotoSansMath-Regular_without-cmap14-subset.ttf ../../web_tests/external/wpt/css/css-fonts/resources/vs/NotoEmoji-Regular_subset.ttf -../../web_tests/external/wpt/css/css-fonts/resources/vs/STIXTwoMath-Regular_with-cmap14-subset.ttf ../../web_tests/external/wpt/css/css-fonts/resources/vs/NotoEmoji-Regular_without-cmap14-subset.ttf +../../web_tests/external/wpt/css/css-fonts/resources/vs/NotoSansJP-Regular_with-cmap14-subset.ttf +../../web_tests/external/wpt/css/css-fonts/resources/vs/NotoSansMath-Regular_without-cmap14-subset.ttf +../../web_tests/external/wpt/css/css-fonts/resources/vs/STIXTwoMath-Regular_with-cmap14-subset.ttf ../../web_tests/external/wpt/fonts/AD.woff ../../web_tests/external/wpt/fonts/Ahem.ttf ../../web_tests/external/wpt/fonts/CanvasTest-ascent256.ttf @@ -437,6 +437,7 @@ ../../web_tests/images/resources/invalid.jpg ../../web_tests/images/resources/invalid_vp8_vp8x.webp ../../web_tests/images/resources/jpeg-height-exif-orientation.jpg +../../web_tests/images/resources/jpeg-with-c2pa-adobe-20220124-C.jpg ../../web_tests/images/resources/jpegfuzz/12-55.jpg ../../web_tests/images/resources/jpegfuzz/182.jpg ../../web_tests/images/resources/jpegfuzz/2-dht.jpg
diff --git a/third_party/blink/renderer/platform/fonts/plain_text_node.cc b/third_party/blink/renderer/platform/fonts/plain_text_node.cc index d63fcb5b..373f4825 100644 --- a/third_party/blink/renderer/platform/fonts/plain_text_node.cc +++ b/third_party/blink/renderer/platform/fonts/plain_text_node.cc
@@ -245,4 +245,41 @@ } } +float PlainTextNode::AccumulateInlineSize(gfx::RectF* glyph_bounds) const { + const bool is_rtl = IsRtl(base_direction_); + float inline_size = 0; + for (const auto& item : item_list_) { + const ShapeResult* shape_result = item.GetShapeResult(); + if (!shape_result) { + continue; + } + // For every shape_result we need to accumulate its width to adjust the + // glyph_bounds. When the word_result is in RTL we accumulate in the + // opposite direction (negative). + if (is_rtl) { + inline_size -= shape_result->Width(); + } + if (glyph_bounds) { + gfx::RectF adjusted_bounds = item.ink_bounds_; + // Translate glyph bounds to the current glyph position which + // is the total width before this glyph. + adjusted_bounds.set_x(adjusted_bounds.x() + inline_size); + glyph_bounds->Union(adjusted_bounds); + } + if (!is_rtl) { + inline_size += shape_result->Width(); + } + } + + // Finally, convert width back to positive if run is RTL. + if (is_rtl) { + inline_size = -inline_size; + if (glyph_bounds) { + glyph_bounds->set_x(glyph_bounds->x() + inline_size); + } + } + + return inline_size; +} + } // namespace blink
diff --git a/third_party/blink/renderer/platform/fonts/plain_text_node.h b/third_party/blink/renderer/platform/fonts/plain_text_node.h index a8c7e512..7796b603 100644 --- a/third_party/blink/renderer/platform/fonts/plain_text_node.h +++ b/third_party/blink/renderer/platform/fonts/plain_text_node.h
@@ -85,6 +85,8 @@ PlainTextNode(const PlainTextNode&) = delete; PlainTextNode& operator=(const PlainTextNode&) = delete; + float AccumulateInlineSize(gfx::RectF* glyph_bounds) const; + // The text contains: // - Normalized whitespace // - No BiDi override controls
diff --git a/third_party/blink/renderer/platform/fonts/plain_text_painter.cc b/third_party/blink/renderer/platform/fonts/plain_text_painter.cc index 98e366a..c498ad3 100644 --- a/third_party/blink/renderer/platform/fonts/plain_text_painter.cc +++ b/third_party/blink/renderer/platform/fonts/plain_text_painter.cc
@@ -63,8 +63,8 @@ float PlainTextPainter::ComputeInlineSize(const TextRun& run, const Font& font, gfx::RectF* glyph_bounds) { - // TODO(crbug.com/389726691): Implement this without Font::Width(). - return font.Width(run, glyph_bounds); + FontCachePurgePreventer purge_preventer; + return CreateNode(run, font).AccumulateInlineSize(glyph_bounds); } float PlainTextPainter::ComputeSubInlineSize(const TextRun& run,
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_host.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_host.cc index d4e7523b..bad92612 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_host.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_host.cc
@@ -153,8 +153,8 @@ InitializeLayerWithCSSProperties(cc_layer_.get()); cc_layer_->SetIsDrawable(true); cc_layer_->SetHitTestable(true); - cc_layer_->SetContentsOpaque(opacity_mode_ == kOpaque); - cc_layer_->SetBlendBackgroundColor(opacity_mode_ != kOpaque); + cc_layer_->SetContentsOpaque(is_opaque_); + cc_layer_->SetBlendBackgroundColor(!is_opaque_); } return cc_layer_.get(); } @@ -245,10 +245,10 @@ } void CanvasResourceHost::SetOpacityMode(OpacityMode opacity_mode) { - opacity_mode_ = opacity_mode; + is_opaque_ = opacity_mode == kOpaque; if (cc_layer_) { - cc_layer_->SetContentsOpaque(opacity_mode_ == kOpaque); - cc_layer_->SetBlendBackgroundColor(opacity_mode_ != kOpaque); + cc_layer_->SetContentsOpaque(is_opaque_); + cc_layer_->SetBlendBackgroundColor(!is_opaque_); } }
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_host.h b/third_party/blink/renderer/platform/graphics/canvas_resource_host.h index 402afb0..79b13499 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_host.h +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_host.h
@@ -10,7 +10,7 @@ #include "cc/layers/texture_layer.h" #include "cc/layers/texture_layer_client.h" #include "third_party/blink/renderer/platform/graphics/flush_reason.h" -#include "third_party/blink/renderer/platform/graphics/graphics_types.h" +#include "third_party/blink/renderer/platform/graphics/opacity_mode.h" #include "third_party/blink/renderer/platform/platform_export.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/hdr_metadata.h" @@ -141,6 +141,7 @@ bool is_displayed_ = false; bool context_lost_ = false; bool shared_bitmap_gpu_channel_lost_ = false; + bool is_opaque_ = false; unsigned frames_since_last_commit_ = 0; std::unique_ptr<SharedContextRateLimiter> rate_limiter_; std::unique_ptr<CanvasResourceProvider> resource_provider_; @@ -152,7 +153,6 @@ // this superclass of CanvasRenderingContextHost, is only used by 2D // canvases. scoped_refptr<cc::TextureLayer> cc_layer_; - OpacityMode opacity_mode_ = kNonOpaque; }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc index c356bc5..f5576b8e 100644 --- a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc +++ b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
@@ -19,7 +19,6 @@ #include "third_party/blink/renderer/platform/graphics/canvas_resource_provider.h" #include "third_party/blink/renderer/platform/graphics/color_behavior.h" #include "third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.h" -#include "third_party/blink/renderer/platform/graphics/graphics_types.h" #include "third_party/blink/renderer/platform/graphics/image_orientation.h" #include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h" #include "third_party/blink/renderer/platform/wtf/functional.h" @@ -80,11 +79,11 @@ } // namespace ImageLayerBridge::ImageLayerBridge(OpacityMode opacity_mode) - : opacity_mode_(opacity_mode) { + : is_opaque_(opacity_mode == kOpaque) { layer_ = cc::TextureLayer::CreateForMailbox(this); layer_->SetIsDrawable(true); layer_->SetHitTestable(true); - if (opacity_mode_ == kOpaque) { + if (is_opaque_) { layer_->SetContentsOpaque(true); layer_->SetBlendBackgroundColor(false); } @@ -106,14 +105,14 @@ image_ = std::move(image); if (image_) { - if (opacity_mode_ == kNonOpaque) { - layer_->SetContentsOpaque(image_->CurrentFrameKnownToBeOpaque()); - layer_->SetBlendBackgroundColor(!image_->CurrentFrameKnownToBeOpaque()); - } - if (opacity_mode_ == kOpaque) { + const bool image_is_opaque = image_->CurrentFrameKnownToBeOpaque(); + if (is_opaque_) { // If we in opaque mode but image might have transparency we need to // ensure its opacity is not used. - layer_->SetForceTextureToOpaque(!image_->CurrentFrameKnownToBeOpaque()); + layer_->SetForceTextureToOpaque(!image_is_opaque); + } else { + layer_->SetContentsOpaque(image_is_opaque); + layer_->SetBlendBackgroundColor(!image_is_opaque); } if (!has_presented_since_last_set_image_ && image_->IsTextureBacked()) { // If the layer bridge is not presenting, the GrContext may not be getting
diff --git a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h index d95500bc..b44a034 100644 --- a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h +++ b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h
@@ -7,7 +7,7 @@ #include "cc/layers/texture_layer_client.h" #include "components/viz/common/resources/shared_image_format.h" -#include "third_party/blink/renderer/platform/graphics/graphics_types.h" +#include "third_party/blink/renderer/platform/graphics/opacity_mode.h" #include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/platform_export.h" @@ -88,7 +88,7 @@ bool disposed_ = false; bool has_presented_since_last_set_image_ = false; - OpacityMode opacity_mode_ = kNonOpaque; + bool is_opaque_ = false; }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/graphics/graphics_types.h b/third_party/blink/renderer/platform/graphics/graphics_types.h index bef88a84..338a851 100644 --- a/third_party/blink/renderer/platform/graphics/graphics_types.h +++ b/third_party/blink/renderer/platform/graphics/graphics_types.h
@@ -39,11 +39,6 @@ using DynamicRangeLimit = ::cc::PaintFlags::DynamicRangeLimitMixture; -enum AlphaDisposition { - kPremultiplyAlpha, - kDontChangeAlpha, -}; - enum InterpolationQuality { kInterpolationNone = static_cast<int>(cc::PaintFlags::FilterQuality::kNone), kInterpolationLow = static_cast<int>(cc::PaintFlags::FilterQuality::kLow), @@ -51,11 +46,6 @@ static_cast<int>(cc::PaintFlags::FilterQuality::kMedium), }; -enum OpacityMode { - kNonOpaque, - kOpaque, -}; - enum AntiAliasingMode { kNotAntiAliased, kAntiAliased }; enum TextPaintOrder { kFillStroke, kStrokeFill };
diff --git a/third_party/blink/renderer/platform/graphics/opacity_mode.h b/third_party/blink/renderer/platform/graphics/opacity_mode.h new file mode 100644 index 0000000..5449a0f --- /dev/null +++ b/third_party/blink/renderer/platform/graphics/opacity_mode.h
@@ -0,0 +1,13 @@ +// Copyright 2025 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_GRAPHICS_OPACITY_MODE_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_OPACITY_MODE_H_ + +enum OpacityMode { + kNonOpaque, + kOpaque, +}; + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_OPACITY_MODE_H_
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image_transform.cc b/third_party/blink/renderer/platform/graphics/static_bitmap_image_transform.cc index 5617a49d..af73988 100644 --- a/third_party/blink/renderer/platform/graphics/static_bitmap_image_transform.cc +++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image_transform.cc
@@ -361,19 +361,12 @@ } scoped_refptr<StaticBitmapImage> -StaticBitmapImageTransform::GetWithAlphaDisposition( +StaticBitmapImageTransform::GetWithAlphaPremultiplied( FlushReason flush_reason, - scoped_refptr<StaticBitmapImage> source, - AlphaDisposition alpha_disposition) { + scoped_refptr<StaticBitmapImage> source) { if (!source) { return nullptr; } - switch (alpha_disposition) { - case kPremultiplyAlpha: - break; - case kDontChangeAlpha: - return source; - } StaticBitmapImageTransform::Params options; options.source_rect = gfx::Rect(GetSourceSize(source, options)); options.dest_size = GetSourceSize(source, options);
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image_transform.h b/third_party/blink/renderer/platform/graphics/static_bitmap_image_transform.h index 37f2b6fb..e3b5d28 100644 --- a/third_party/blink/renderer/platform/graphics/static_bitmap_image_transform.h +++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image_transform.h
@@ -65,12 +65,11 @@ FlushReason, scoped_refptr<StaticBitmapImage> image); - // If `image` has unpremultiplied alpha, the multipl alpha. If `image` is + // If `image` has unpremultiplied alpha, then multiply alpha. If `image` is // opaque or already premultiplied, return `image. - static scoped_refptr<StaticBitmapImage> GetWithAlphaDisposition( + static scoped_refptr<StaticBitmapImage> GetWithAlphaPremultiplied( FlushReason, - scoped_refptr<StaticBitmapImage> image, - AlphaDisposition); + scoped_refptr<StaticBitmapImage> image); // Convert `image` to the specified color space. static scoped_refptr<StaticBitmapImage> ConvertToColorSpace(
diff --git a/third_party/blink/renderer/platform/heap/BUILD.gn b/third_party/blink/renderer/platform/heap/BUILD.gn index 7dd432a..4f3c3d3 100644 --- a/third_party/blink/renderer/platform/heap/BUILD.gn +++ b/third_party/blink/renderer/platform/heap/BUILD.gn
@@ -44,6 +44,7 @@ "collection_support/heap_linked_stack.h", "collection_support/heap_vector.h", "collection_support/heap_vector_backing.h", + "collection_support/utils.h", "cross_thread_handle.h", "cross_thread_handle_internal.h", "cross_thread_persistent.h",
diff --git a/third_party/blink/renderer/platform/heap/collection_support/heap_deque.h b/third_party/blink/renderer/platform/heap/collection_support/heap_deque.h index eecdb6da..33e77a20c 100644 --- a/third_party/blink/renderer/platform/heap/collection_support/heap_deque.h +++ b/third_party/blink/renderer/platform/heap/collection_support/heap_deque.h
@@ -7,6 +7,7 @@ // Include heap_vector.h to also make general VectorTraits available. #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" +#include "third_party/blink/renderer/platform/heap/collection_support/utils.h" #include "third_party/blink/renderer/platform/heap/forward.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/heap/heap_allocator_impl.h" @@ -15,30 +16,33 @@ namespace blink { -template <typename T> -class HeapDeque final : public GarbageCollected<HeapDeque<T>>, - public Deque<T, 0, HeapAllocator> { - DISALLOW_NEW(); - +template <internal::HeapCollectionType CollectionType, typename T> +class BasicHeapDeque final + : public std::conditional_t< + CollectionType == internal::HeapCollectionType::kGCed, + GarbageCollected<BasicHeapDeque<CollectionType, T>>, + internal::DisallowNewBaseForHeapCollections>, + public Deque<T, 0, HeapAllocator> { public: - HeapDeque() = default; + BasicHeapDeque() = default; - explicit HeapDeque(wtf_size_t size) : Deque<T, 0, HeapAllocator>(size) {} + explicit BasicHeapDeque(wtf_size_t size) : Deque<T, 0, HeapAllocator>(size) {} - HeapDeque(wtf_size_t size, const T& val) + BasicHeapDeque(wtf_size_t size, const T& val) : Deque<T, 0, HeapAllocator>(size, val) {} - HeapDeque(const HeapDeque<T>& other) : Deque<T, 0, HeapAllocator>(other) {} + BasicHeapDeque(const BasicHeapDeque<CollectionType, T>& other) + : Deque<T, 0, HeapAllocator>(other) {} - HeapDeque& operator=(const HeapDeque& other) { + BasicHeapDeque& operator=(const BasicHeapDeque& other) { Deque<T, 0, HeapAllocator>::operator=(other); return *this; } - HeapDeque(HeapDeque&& other) noexcept + BasicHeapDeque(BasicHeapDeque&& other) noexcept : Deque<T, 0, HeapAllocator>(std::move(other)) {} - HeapDeque& operator=(HeapDeque&& other) noexcept { + BasicHeapDeque& operator=(BasicHeapDeque&& other) noexcept { Deque<T, 0, HeapAllocator>::operator=(std::move(other)); return *this; } @@ -51,18 +55,34 @@ struct TypeConstraints { constexpr TypeConstraints() { static_assert(WTF::IsMemberType<T>::value, - "HeapDeque supports only Member."); - static_assert(std::is_trivially_destructible_v<HeapDeque>, - "HeapDeque must be trivially destructible."); + "BasicHeapDeque supports only Member."); + static_assert(std::is_trivially_destructible_v<BasicHeapDeque>, + "BasicHeapDeque must be trivially destructible."); static_assert( WTF::IsTraceable<T>::value, - "For vectors without traceable elements, use Deque<> instead " + "For deques without traceable elements, use Deque<> instead " "of HeapDeque<>"); } }; NO_UNIQUE_ADDRESS TypeConstraints type_constraints_; }; +// On-stack for in-field version of WTF::Deque for referring to GarbageCollected +// or DISALLOW_NEW() objects with Trace() methods. +template <typename T> +using HeapDeque = BasicHeapDeque<internal::HeapCollectionType::kDisallowNew, T>; + +static_assert(WTF::IsDisallowNew<HeapDeque<int>>); +ASSERT_SIZE(Deque<int>, HeapDeque<int>); + +// GCed version of WTF::Deque for referring to GarbageCollected or +// DISALLOW_NEW() objects with Trace() methods. +template <typename T> +using GCedHeapDeque = BasicHeapDeque<internal::HeapCollectionType::kGCed, T>; + +static_assert(!WTF::IsDisallowNew<GCedHeapDeque<int>>); +ASSERT_SIZE(Deque<int>, GCedHeapDeque<int>); + } // namespace blink namespace WTF {
diff --git a/third_party/blink/renderer/platform/heap/collection_support/utils.h b/third_party/blink/renderer/platform/heap/collection_support/utils.h new file mode 100644 index 0000000..3959434 --- /dev/null +++ b/third_party/blink/renderer/platform/heap/collection_support/utils.h
@@ -0,0 +1,24 @@ +// Copyright 2025 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_HEAP_COLLECTION_SUPPORT_UTILS_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_UTILS_H_ + +#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + +namespace blink::internal { + +// Internal only. Specifies whether a collection type should be GarbageCollected +// or DISALLOW_NEW(). +enum class HeapCollectionType { kGCed, kDisallowNew }; + +// Internal only. Base class for DISALLOW_NEW() objects. Used for on-stack and +// field collections. +class DisallowNewBaseForHeapCollections { + DISALLOW_NEW(); +}; + +} // namespace blink::internal + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_COLLECTION_SUPPORT_UTILS_H_
diff --git a/third_party/blink/renderer/platform/heap/test/concurrent_marking_test.cc b/third_party/blink/renderer/platform/heap/test/concurrent_marking_test.cc index 081d2a6..3110528 100644 --- a/third_party/blink/renderer/platform/heap/test/concurrent_marking_test.cc +++ b/third_party/blink/renderer/platform/heap/test/concurrent_marking_test.cc
@@ -395,39 +395,41 @@ // HeapDeque template <typename T> -struct MethodAdapter<HeapDeque<T>> : public MethodAdapterBase<HeapDeque<T>> { +struct MethodAdapter<GCedHeapDeque<T>> + : public MethodAdapterBase<GCedHeapDeque<T>> { template <typename U> - static void insert(HeapDeque<T>& deque, U&& u) { + static void insert(GCedHeapDeque<T>& deque, U&& u) { deque.push_back(std::forward<U>(u)); } - static void erase(HeapDeque<T>& deque, typename HeapDeque<T>::iterator&& it) { + static void erase(GCedHeapDeque<T>& deque, + typename GCedHeapDeque<T>::iterator&& it) { deque.pop_back(); } - static void Swap(HeapDeque<T>& a, HeapDeque<T>& b) { a.Swap(b); } + static void Swap(GCedHeapDeque<T>& a, GCedHeapDeque<T>& b) { a.Swap(b); } }; TEST_F(ConcurrentMarkingTest, AddToDeque) { - AddToCollection<HeapDeque<Member<IntegerObject>>>(); + AddToCollection<GCedHeapDeque<Member<IntegerObject>>>(); } TEST_F(ConcurrentMarkingTest, RemoveFromBeginningOfDeque) { - RemoveFromBeginningOfCollection<HeapDeque<Member<IntegerObject>>>(); + RemoveFromBeginningOfCollection<GCedHeapDeque<Member<IntegerObject>>>(); } TEST_F(ConcurrentMarkingTest, RemoveFromMiddleOfDeque) { - RemoveFromMiddleOfCollection<HeapDeque<Member<IntegerObject>>>(); + RemoveFromMiddleOfCollection<GCedHeapDeque<Member<IntegerObject>>>(); } TEST_F(ConcurrentMarkingTest, RemoveFromEndOfDeque) { - RemoveFromEndOfCollection<HeapDeque<Member<IntegerObject>>>(); + RemoveFromEndOfCollection<GCedHeapDeque<Member<IntegerObject>>>(); } TEST_F(ConcurrentMarkingTest, ClearDeque) { - ClearCollection<HeapDeque<Member<IntegerObject>>>(); + ClearCollection<GCedHeapDeque<Member<IntegerObject>>>(); } TEST_F(ConcurrentMarkingTest, SwapDeque) { - SwapCollections<HeapDeque<Member<IntegerObject>>>(); + SwapCollections<GCedHeapDeque<Member<IntegerObject>>>(); } TEST_F(ConcurrentMarkingTest, PopFromDeque) { - PopFromCollection<HeapDeque<Member<IntegerObject>>>(); + PopFromCollection<GCedHeapDeque<Member<IntegerObject>>>(); } namespace {
diff --git a/third_party/blink/renderer/platform/heap/test/heap_compact_test.cc b/third_party/blink/renderer/platform/heap/test/heap_compact_test.cc index d41f50d..1e56a801 100644 --- a/third_party/blink/renderer/platform/heap/test/heap_compact_test.cc +++ b/third_party/blink/renderer/platform/heap/test/heap_compact_test.cc
@@ -53,7 +53,7 @@ } // namespace using IntVector = blink::HeapVector<blink::Member<IntWrapper>>; -using IntDeque = blink::HeapDeque<blink::Member<IntWrapper>>; +using IntDeque = blink::GCedHeapDeque<blink::Member<IntWrapper>>; using IntMap = blink::HeapHashMap<blink::Member<IntWrapper>, int>; // TODO(sof): decide if this ought to be a global trait specialization. // (i.e., for HeapHash*<T>.)
diff --git a/third_party/blink/renderer/platform/heap/test/heap_test.cc b/third_party/blink/renderer/platform/heap/test/heap_test.cc index 40b64b0..16ddf48fd 100644 --- a/third_party/blink/renderer/platform/heap/test/heap_test.cc +++ b/third_party/blink/renderer/platform/heap/test/heap_test.cc
@@ -908,8 +908,8 @@ namespace { template <typename T, typename U> -bool DequeContains(HeapDeque<T>& deque, U u) { - typedef typename HeapDeque<T>::iterator iterator; +bool DequeContains(GCedHeapDeque<T>& deque, U u) { + typedef typename GCedHeapDeque<T>::iterator iterator; for (iterator it = deque.begin(); it != deque.end(); ++it) { if (*it == u) return true; @@ -929,7 +929,7 @@ typedef HeapHashCountedSet<Member<IntWrapper>> MemberCountedSet; typedef HeapVector<Member<IntWrapper>, 2> MemberVector; - typedef HeapDeque<Member<IntWrapper>> MemberDeque; + typedef GCedHeapDeque<Member<IntWrapper>> MemberDeque; typedef HeapVector<PairWrappedUnwrapped, 2> VectorWU; typedef HeapVector<PairUnwrappedWrapped, 2> VectorUW; @@ -1054,7 +1054,7 @@ vector_uw2->swap(cvec_uw); vector_uw->swap(cvec_uw); - MemberDeque& c_deque = container->deque; + auto& c_deque = container->deque; c_deque.Swap(*deque.Get()); deque2->Swap(c_deque); deque->Swap(c_deque); @@ -2151,7 +2151,7 @@ int* key = &k; IntWrapper::destructor_calls_ = 0; typedef HeapVector<Member<IntWrapper>> IntVector; - typedef HeapDeque<Member<IntWrapper>> IntDeque; + typedef GCedHeapDeque<Member<IntWrapper>> IntDeque; HeapHashMap<void*, Member<IntVector>>* map = MakeGarbageCollected<HeapHashMap<void*, Member<IntVector>>>(); HeapHashMap<void*, Member<IntDeque>>* map2 = @@ -2907,7 +2907,7 @@ TEST_F(HeapTest, DequeExpand) { // Test expansion of a HeapDeque<>'s buffer. - typedef HeapDeque<Member<IntWrapper>> IntDeque; + using IntDeque = GCedHeapDeque<Member<IntWrapper>>; Persistent<IntDeque> deque = MakeGarbageCollected<IntDeque>();
diff --git a/third_party/blink/renderer/platform/heap/test/incremental_marking_test.cc b/third_party/blink/renderer/platform/heap/test/incremental_marking_test.cc index ff85e65..28c8ef3 100644 --- a/third_party/blink/renderer/platform/heap/test/incremental_marking_test.cc +++ b/third_party/blink/renderer/platform/heap/test/incremental_marking_test.cc
@@ -404,8 +404,8 @@ TEST_F(IncrementalMarkingTest, HeapDequePushBackMember) { WeakPersistent<LinkedObject> obj = MakeGarbageCollected<LinkedObject>(); - HeapDeque<Member<LinkedObject>>* deq = - MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>(); + GCedHeapDeque<Member<LinkedObject>>* deq = + MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>(); IncrementalMarkingTestDriver driver(ThreadState::Current()); driver.StartGC(); deq->push_back(obj); @@ -415,8 +415,8 @@ TEST_F(IncrementalMarkingTest, HeapDequePushFrontMember) { WeakPersistent<LinkedObject> obj = MakeGarbageCollected<LinkedObject>(); - HeapDeque<Member<LinkedObject>>* deq = - MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>(); + GCedHeapDeque<Member<LinkedObject>>* deq = + MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>(); IncrementalMarkingTestDriver driver(ThreadState::Current()); driver.StartGC(); deq->push_front(obj); @@ -426,8 +426,8 @@ TEST_F(IncrementalMarkingTest, HeapDequeEmplaceBackMember) { WeakPersistent<LinkedObject> obj = MakeGarbageCollected<LinkedObject>(); - HeapDeque<Member<LinkedObject>>* deq = - MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>(); + GCedHeapDeque<Member<LinkedObject>>* deq = + MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>(); IncrementalMarkingTestDriver driver(ThreadState::Current()); driver.StartGC(); deq->emplace_back(obj); @@ -437,8 +437,8 @@ TEST_F(IncrementalMarkingTest, HeapDequeEmplaceFrontMember) { WeakPersistent<LinkedObject> obj = MakeGarbageCollected<LinkedObject>(); - HeapDeque<Member<LinkedObject>>* deq = - MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>(); + GCedHeapDeque<Member<LinkedObject>>* deq = + MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>(); IncrementalMarkingTestDriver driver(ThreadState::Current()); driver.StartGC(); deq->emplace_front(obj); @@ -448,24 +448,24 @@ TEST_F(IncrementalMarkingTest, HeapDequeCopyMember) { WeakPersistent<LinkedObject> obj = MakeGarbageCollected<LinkedObject>(); - HeapDeque<Member<LinkedObject>>* deq = - MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>(); + GCedHeapDeque<Member<LinkedObject>>* deq = + MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>(); deq->push_back(obj); IncrementalMarkingTestDriver driver(ThreadState::Current()); driver.StartGC(); - *MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>() = *deq; + *MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>() = *deq; driver.FinishGC(); EXPECT_TRUE(obj); } TEST_F(IncrementalMarkingTest, HeapDequeCopyMemberInCtor) { WeakPersistent<LinkedObject> obj = MakeGarbageCollected<LinkedObject>(); - HeapDeque<Member<LinkedObject>>* deq = - MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>(); + GCedHeapDeque<Member<LinkedObject>>* deq = + MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>(); deq->push_back(obj); IncrementalMarkingTestDriver driver(ThreadState::Current()); driver.StartGC(); - MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>(*deq); + MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>(*deq); driver.FinishGC(); // Copy during object construction does not emit write barriers as // in-construction/on-stack objects would be found during conservative GC. @@ -474,24 +474,25 @@ TEST_F(IncrementalMarkingTest, HeapDequeMoveMember) { WeakPersistent<LinkedObject> obj = MakeGarbageCollected<LinkedObject>(); - HeapDeque<Member<LinkedObject>>* deq = - MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>(); + GCedHeapDeque<Member<LinkedObject>>* deq = + MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>(); deq->push_back(obj); IncrementalMarkingTestDriver driver(ThreadState::Current()); driver.StartGC(); - *MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>() = std::move(*deq); + *MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>() = + std::move(*deq); driver.FinishGC(); EXPECT_TRUE(obj); } TEST_F(IncrementalMarkingTest, HeapDequeMoveMemberInCtor) { WeakPersistent<LinkedObject> obj = MakeGarbageCollected<LinkedObject>(); - HeapDeque<Member<LinkedObject>>* deq = - MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>(); + GCedHeapDeque<Member<LinkedObject>>* deq = + MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>(); deq->push_back(obj); IncrementalMarkingTestDriver driver(ThreadState::Current()); driver.StartGC(); - MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>(std::move(*deq)); + MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>(std::move(*deq)); driver.FinishGC(); // Move construction does not emit a write barrier. EXPECT_FALSE(obj); @@ -500,15 +501,15 @@ TEST_F(IncrementalMarkingTest, HeapDequeSwapMember) { WeakPersistent<LinkedObject> obj1 = MakeGarbageCollected<LinkedObject>(); WeakPersistent<LinkedObject> obj2 = MakeGarbageCollected<LinkedObject>(); - HeapDeque<Member<LinkedObject>>* deq1 = - MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>(); + GCedHeapDeque<Member<LinkedObject>>* deq1 = + MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>(); deq1->push_back(obj1); - HeapDeque<Member<LinkedObject>>* deq2 = - MakeGarbageCollected<HeapDeque<Member<LinkedObject>>>(); + GCedHeapDeque<Member<LinkedObject>>* deq2 = + MakeGarbageCollected<GCedHeapDeque<Member<LinkedObject>>>(); deq2->push_back(obj2); IncrementalMarkingTestDriver driver(ThreadState::Current()); driver.StartGC(); - std::swap(*deq1, *deq2); + deq1->Swap(*deq2); driver.FinishGC(); EXPECT_TRUE(obj1); EXPECT_TRUE(obj2);
diff --git a/third_party/blink/renderer/platform/image-decoders/image_decoder.cc b/third_party/blink/renderer/platform/image-decoders/image_decoder.cc index 34c1195..0cc5dfa 100644 --- a/third_party/blink/renderer/platform/image-decoders/image_decoder.cc +++ b/third_party/blink/renderer/platform/image-decoders/image_decoder.cc
@@ -522,6 +522,10 @@ return std::nullopt; } +bool ImageDecoder::HasC2PAManifest() const { + return false; +} + gfx::Size ImageDecoder::FrameSizeAtIndex(wtf_size_t) const { return Size(); }
diff --git a/third_party/blink/renderer/platform/image-decoders/image_decoder.h b/third_party/blink/renderer/platform/image-decoders/image_decoder.h index 4f5a994..cb74dfc 100644 --- a/third_party/blink/renderer/platform/image-decoders/image_decoder.h +++ b/third_party/blink/renderer/platform/image-decoders/image_decoder.h
@@ -321,6 +321,9 @@ // Image decoders that support HDR metadata can override this. virtual std::optional<gfx::HDRMetadata> GetHDRMetadata() const; + // Image decoders that support C2PA manifest embedding can override this. + virtual bool HasC2PAManifest() const; + // Returns the information required to decide whether or not hardware // acceleration can be used to decode this image. Callers of this function // must ensure the header was successfully parsed prior to calling this
diff --git a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc index dc61b253..0d1c235 100644 --- a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc +++ b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
@@ -58,6 +58,7 @@ extern "C" { #include <setjmp.h> #include <stdio.h> // jpeglib.h needs stdio FILE. +#include <string.h> #include "jpeglib.h" } @@ -246,6 +247,9 @@ // Keep APP2 blocks, for obtaining ICC and MPF data. jpeg_save_markers(&info_, JPEG_APP0 + 2, 0xFFFF); + + // Keep APP11 blocks, for obtaining JUMBF data including C2PA manifests + jpeg_save_markers(&info_, JPEG_APP0 + 11, 0xFFFF); } JPEGImageReader(const JPEGImageReader&) = delete; @@ -1019,6 +1023,51 @@ return true; } +bool JPEGImageDecoder::HasC2PAManifest() const { + auto* metadata_decoder = reader_ ? reader_->GetMetadataDecoder() : nullptr; + if (!metadata_decoder) { + return false; + } + + // C2PA manifests are contained in APP11 blocks in JUMBF format + sk_sp<SkData> jumbf_data = + metadata_decoder->getJUMBFMetadata(/*copyData=*/false); + if (!jumbf_data) { + return false; + } + + // APP11 blocks have a 2-byte extension type set to 'JP' for JUMBF + // (stripped by getJUMBFMetadata), followed by a 2-byte segment ID, + // and a 4-byte sequence number. + // This is followed by JUMBF boxes: { LBox(4), TBox(4), payload }, + // as defined in ISO 19566-5 (https://iso.org/standard/84635.html) + // the payload of the first superbox is more boxes. + // The C2PA manifest store is a JUMBF superbox with a label of 'c2pa': + // https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_jpeg_specific_handling + // C2PA support would require full JUMBF parsing; for detection, we + // just look for a fixed signature based on this box structure. + // This won't detect C2PA manifests preceded by a non-C2PA JUMBF + // superbox, which is OK since this is for a lower bound metric. + static constexpr uint8_t kSBSig[] = {'j', 'u', 'm', 'b'}; + static constexpr size_t kSBOffset = 10; + static constexpr uint8_t kDBSig[] = {'j', 'u', 'm', 'd'}; + static constexpr size_t kDBOffset = 18; + static constexpr uint8_t kC2PASig[] = {'c', '2', 'p', 'a'}; + static constexpr size_t kC2PAOffset = 22; + + if (jumbf_data->size() < kC2PAOffset + sizeof(kC2PASig)) { + return false; + } + const uint8_t* jumbf_bytes = jumbf_data->bytes(); + if (memcmp(jumbf_bytes + kSBOffset, kSBSig, sizeof(kSBSig)) != 0 || + memcmp(jumbf_bytes + kDBOffset, kDBSig, sizeof(kDBSig)) != 0 || + memcmp(jumbf_bytes + kC2PAOffset, kC2PASig, sizeof(kC2PASig)) != 0) { + return false; + } + + return true; +} + gfx::Size JPEGImageDecoder::GetImageCodedSize() const { // We use the |max_{h,v}_samp_factor|s returned by // AreValidSampleFactorsAvailable() since the ones available via
diff --git a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.h b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.h index a53c817..e1c8890 100644 --- a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.h +++ b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.h
@@ -60,7 +60,7 @@ bool GetGainmapInfoAndData( SkGainmapInfo& out_gainmap_info, scoped_refptr<SegmentReader>& out_gainmap_data) const override; - + bool HasC2PAManifest() const override; bool HasImagePlanes() const { return image_planes_.get(); } bool OutputScanlines();
diff --git a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder_test.cc b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder_test.cc index 02e7656..e0aa701 100644 --- a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder_test.cc +++ b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder_test.cc
@@ -683,4 +683,26 @@ TestJpegBppHistogram("/images/resources/cs-uma-grayscale.jpg"); } +// Decode a JPEG with C2PA metadata, and verify that it is detected correctly +TEST(JPEGImageDecoderTest, c2paManifestPresent) { + scoped_refptr<SharedBuffer> test_data = ReadFileToSharedBuffer( + "/images/resources/jpeg-with-c2pa-adobe-20220124-C.jpg"); + ASSERT_TRUE(test_data.get()); + + std::unique_ptr<ImageDecoder> test_decoder = CreateJPEGDecoder(); + test_decoder->SetData(test_data.get(), true); + EXPECT_TRUE(test_decoder->HasC2PAManifest()); +} + +// Decode a JPEG without C2PA metadata, verify that none is found +TEST(JPEGImageDecoderTest, c2paManifestNotPresent) { + scoped_refptr<SharedBuffer> test_data = + ReadFileToSharedBuffer("/images/resources/gracehopper.jpg"); + ASSERT_TRUE(test_data.get()); + + std::unique_ptr<ImageDecoder> test_decoder = CreateJPEGDecoder(); + test_decoder->SetData(test_data.get(), true); + EXPECT_FALSE(test_decoder->HasC2PAManifest()); +} + } // namespace blink
diff --git a/third_party/blink/renderer/platform/widget/widget_base.cc b/third_party/blink/renderer/platform/widget/widget_base.cc index 8cbc912..f2d7f75 100644 --- a/third_party/blink/renderer/platform/widget/widget_base.cc +++ b/third_party/blink/renderer/platform/widget/widget_base.cc
@@ -862,7 +862,7 @@ attributes.enable_gles2_interface = false; attributes.enable_grcontext = false; attributes.enable_raster_interface = true; - attributes.enable_oop_rasterization = false; + attributes.enable_gpu_rasterization = false; constexpr bool automatic_flushes = false; constexpr bool support_locking = false;
diff --git a/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py b/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py index e197be2..3008b90 100755 --- a/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py +++ b/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py
@@ -1976,6 +1976,8 @@ 'paths': [ 'third_party/blink/public/platform/web_theme_engine.h', 'third_party/blink/renderer/core/css/resolver/style_builder_converter.h', + 'third_party/blink/renderer/core/animation/css_color_interpolation_type.cc', + 'third_party/blink/renderer/core/animation/interpolable_shadow.cc', 'third_party/blink/renderer/core/layout/layout_theme.cc', 'third_party/blink/renderer/core/layout/layout_theme.h', 'third_party/blink/renderer/core/scroll/',
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 151548b..8bb1ff5a 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -407,7 +407,10 @@ "platforms": ["Linux", "Mac", "Win"], "bases": ["external/wpt/css/css-position/sticky/", "external/wpt/css/css-viewport/zoom/scroll-top-test-with-zoom.html", - "fast/scrolling/"], + "fast/scrolling/", + "fast/forms/fieldset/overflow-scroll-interaction.html", + "fast/scroll-behavior/smooth-scroll-overflow-hidden.html", + "fast/scroll-snap/snap-to-area-with-fractional-offset.html"], "args": ["--enable-blink-features=FractionalScrollOffsets"], "expires": "Jun 1, 2025" },
diff --git a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-svg-path-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-svg-path-expected.txt index 859687ec..a08a1a6 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-svg-path-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-svg-path-expected.txt
@@ -1,8 +1,4 @@ This is a testharness.js-based test. -[FAIL] isPointInFill() should return true in a c-v:hidden subtree. - Failed to execute 'isPointInFill' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] isPointInStroke() should return true in a c-v:hidden subtree. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. [FAIL] checkEnclosure() should return true in a c-v:hidden subtree. assert_true: enclosure expected true got false [FAIL] getEnclosureList() should return items in a c-v:hidden subtree.
diff --git a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-svg-rect-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-svg-rect-expected.txt deleted file mode 100644 index db7c2e39..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-svg-rect-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -This is a testharness.js-based test. -[FAIL] isPointInFill() should return true in a c-v:hidden subtree. - Failed to execute 'isPointInFill' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] isPointInStroke() should return true in a c-v:hidden subtree. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-svg-text-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-svg-text-expected.txt deleted file mode 100644 index 45b58d9..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-svg-text-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This is a testharness.js-based test. -[FAIL] getCharNumAtPosition() should return nonzero values in a c-v:hidden subtree. - Failed to execute 'getCharNumAtPosition' on 'SVGTextContentElement': parameter 1 is not of type 'SVGPoint'. -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-001.html b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-001.html index 2741196..5fe13a11 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-001.html +++ b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-001.html
@@ -17,6 +17,9 @@ column-rule-color: green; column-rule-style: solid; column-rule-width: 10px; + row-rule-color: green; + row-rule-style: solid; + row-rule-width: 10px; } .grid-item {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-002.html b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-002.html index 8cad606..429798d0 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-002.html +++ b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-002.html
@@ -9,7 +9,6 @@ .grid-container { height: 110px; width: 110px; - background-color: green; display: grid; grid-template-columns: repeat(2, 1fr); @@ -20,6 +19,10 @@ column-rule-color: pink; column-rule-style: solid; column-rule-width: 10px; + + row-rule-color: green; + row-rule-style: solid; + row-rule-width: 10px; } .grid-item {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-003-ref.html b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-003-ref.html index 86796ed..15fc3056 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-003-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-003-ref.html
@@ -2,19 +2,20 @@ <link rel="help" href="https://drafts.csswg.org/css-gaps-1/"> <link rel="author" title="Sam Davis Omekara Jr." href="mailto:samomekarajr@microsoft.com"> <style> + body { + margin: 0px; + } + .container { width: 110px; height: 110px; - background-color: green; - column-count: 2; column-gap: 10px; - column-rule-color: pink; column-rule-style: dotted; column-rule-width: 10px; - overflow: hidden; + position: relative; } .item { @@ -29,10 +30,25 @@ .item:nth-child(odd) { margin-bottom: 10px; } + + .row-rule { + margin: 0px; + padding: 0px; + height: 0px; + + width: 110px; + border-bottom: 10px dotted; + border-color: green; + position: absolute; + top: 50px; + } + </style> <div class="container"> - <div class="item"></div> - <div class="item"></div> - <div class="item"></div> - <div class="item"></div> + <div class="item"></div> + <div class="item"></div> + <div class="item"></div> + <div class="item"></div> </div> +<div class="row-rule"> +</div> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-003.html b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-003.html index 5e618aae..f9d07a18 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-003.html +++ b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-003.html
@@ -6,10 +6,14 @@ <link rel="match" href="grid-gap-decorations-003-ref.html"> <link rel="author" title="Sam Davis Omekara Jr." href="mailto:samomekarajr@microsoft.com"> <style> + + body { + margin: 0px; + } + .grid-container { height: 110px; width: 110px; - background-color: green; display: grid; grid-template-columns: repeat(2, 1fr); @@ -20,6 +24,10 @@ column-rule-color: pink; column-rule-style: dotted; column-rule-width: 10px; + + row-rule-color: green; + row-rule-style: dotted; + row-rule-width: 10px; } .grid-item {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-004-ref.html b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-004-ref.html index 9011957e..e4e6b8b 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-004-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-004-ref.html
@@ -2,24 +2,28 @@ <link rel="help" href="https://drafts.csswg.org/css-gaps-1/"> <link rel="author" title="Sam Davis Omekara Jr." href="mailto:samomekarajr@microsoft.com"> <style> + body { + margin: 0px; + } + .container { - width: 110px; - height: 110px; + width: 108px; + height: 108px; background: green; column-count: 2; - column-gap: 10px; + column-gap: 12px; column-rule-color: pink; column-rule-style: double; - column-rule-width: 10px; + column-rule-width: 12px; overflow: hidden; } .item { background: skyblue; - height: 50px; + height: 48px; width: 100%; margin: 0; } @@ -27,12 +31,26 @@ /* For 2x2 grid-like layout, add a 10px bottom margin to odd children(#1 & #3) to simulate a horizontal row gap.*/ .item:nth-child(odd) { - margin-bottom: 10px; + margin-bottom: 12px; } + + .row-gap { + margin: 0px; + padding: 0px; + height: 4px; + background: pink; + width: 108px; + position: absolute; + } + </style> <div class="container"> - <div class="item"></div> - <div class="item"></div> - <div class="item"></div> - <div class="item"></div> + <div class="item"></div> + <div class="item"></div> + <div class="item"></div> + <div class="item"></div> </div> + +<!-- Two horizontal bars to simulate row gaps with style double --> +<div id="horizontal1" class="row-gap" style="top: 48px;"></div> +<div id="horizontal2" class="row-gap" style="top: 56px;"></div> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-004.html b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-004.html index ab7e5d66..e289881 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-004.html +++ b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-004.html
@@ -6,21 +6,30 @@ <link rel="match" href="grid-gap-decorations-004-ref.html"> <link rel="author" title="Sam Davis Omekara Jr." href="mailto:samomekarajr@microsoft.com"> <style> + + body { + margin: 0px; + } + .grid-container { - height: 110px; - width: 110px; + height: 108px; + width: 108px; display: grid; grid-template-columns: repeat(2, 1fr); - column-gap: 10px; - row-gap: 10px; + column-gap: 12px; + row-gap: 12px; background-color: green; column-rule-color: pink; column-rule-style: double; - column-rule-width: 10px; + column-rule-width: 12px; + + row-rule-color: pink; + row-rule-style: double; + row-rule-width: 12px; } .grid-item {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-005-ref.html b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-005-ref.html index 887c9f1..aebfba5 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-005-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-005-ref.html
@@ -2,6 +2,10 @@ <link rel="help" href="https://drafts.csswg.org/css-gaps-1/"> <link rel="author" title="Sam Davis Omekara Jr." href="mailto:samomekarajr@microsoft.com"> <style> + body { + margin: 0px; + } + .container { width: 110px; height: 110px; @@ -24,6 +28,23 @@ margin: 0; } + .double { + margin: 0px; + padding: 0px; + height: 0px; + + width: 110px; + border-bottom: 5px double; + border-color: pink; + position: absolute; + /* + The top position of the double border is set to 52.5px + to account for 10px gap and 5px height of the double border, + in order to center it in the gap. + */ + top: 52.5px; + } + /* For 2x2 grid-like layout, add a 10px bottom margin to odd children(#1 & #3) to simulate a horizontal row gap.*/ .item:nth-child(odd) { @@ -36,3 +57,6 @@ <div class="item"></div> <div class="item"></div> </div> + +<div class="double"> +</div> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-005.html b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-005.html index 8a429ee..741977d 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-005.html +++ b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/grid/grid-gap-decorations-005.html
@@ -6,6 +6,11 @@ <link rel="match" href="grid-gap-decorations-005-ref.html"> <link rel="author" title="Sam Davis Omekara Jr." href="mailto:samomekarajr@microsoft.com"> <style> + + body { + margin: 0px; + } + .grid-container { height: 110px; width: 110px; @@ -21,6 +26,10 @@ column-rule-color: pink; column-rule-style: double; column-rule-width: 5px; + + row-rule-color: pink; + row-rule-style: double; + row-rule-width: 5px; } .grid-item {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-color-computed.html b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-color-computed.html index 31b311a..3ef68de7 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-color-computed.html +++ b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-color-computed.html
@@ -5,7 +5,7 @@ <title>CSS Gap Decoration: column-rule-color getComputedStyle()</title> <link rel="help" href="https://tabatkins.github.io/specs/css-masonry/"> <link rel="author" title="Sam Davis Omekara Jr." href="mailto:samomekarajr@microsoft.com"> -<meta name="assert" content="column-rule-color computed value is as specified."> +<meta name="assert" content="*-rule-color computed value is as specified."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/css/support/computed-testcommon.js"></script> @@ -18,20 +18,23 @@ } </style> <script> -test_computed_value("column-rule-color", "currentcolor", "rgb(0, 255, 0)"); -test_computed_value("column-rule-color", "red", "rgb(255, 0, 0)"); -test_computed_value("column-rule-color", "repeat(4, yellow)", "repeat(4, rgb(255, 255, 0))"); -test_computed_value("column-rule-color", "red green blue", "rgb(255, 0, 0) rgb(0, 128, 0) rgb(0, 0, 255)"); -test_computed_value("column-rule-color", "repeat(7, lime) repeat(3, red)", "repeat(7, rgb(0, 255, 0)) repeat(3, rgb(255, 0, 0))"); -test_computed_value("column-rule-color", "repeat(auto, red)", "repeat(auto, rgb(255, 0, 0))"); +const properties = ["column-rule-color", "row-rule-color"]; +for (let property of properties) { + test_computed_value(property, "currentcolor", "rgb(0, 255, 0)"); + test_computed_value(property, "red", "rgb(255, 0, 0)"); + test_computed_value(property, "repeat(4, yellow)", "repeat(4, rgb(255, 255, 0))"); + test_computed_value(property, "red green blue", "rgb(255, 0, 0) rgb(0, 128, 0) rgb(0, 0, 255)"); + test_computed_value(property, "repeat(7, lime) repeat(3, red)", "repeat(7, rgb(0, 255, 0)) repeat(3, rgb(255, 0, 0))"); + test_computed_value(property, "repeat(auto, red)", "repeat(auto, rgb(255, 0, 0))"); -test_computed_value("column-rule-color", "repeat(calc(5 + 3), salmon)", "repeat(8, rgb(250, 128, 114))"); + test_computed_value(property, "repeat(calc(5 + 3), salmon)", "repeat(8, rgb(250, 128, 114))"); -test_computed_value("column-rule-color", "color-mix(in srgb, red 50%, blue 50%)", "color(srgb 0.5 0 0.5)"); -test_computed_value("column-rule-color", "color-mix(in srgb, lime 25%, yellow 75%)", "color(srgb 0.75 1 0)"); + test_computed_value(property, "color-mix(in srgb, red 50%, blue 50%)", "color(srgb 0.5 0 0.5)"); + test_computed_value(property, "color-mix(in srgb, lime 25%, yellow 75%)", "color(srgb 0.75 1 0)"); -test_computed_value("column-rule-color", "repeat(auto, rgb(from lime r g b))", "repeat(auto, color(srgb 0 1 0))"); -test_computed_value("column-rule-color", "rgb(from yellow calc(255 - r) calc(255 - g) calc(255 - b))", "color(srgb 0 0 1)"); + test_computed_value(property, "repeat(auto, rgb(from lime r g b))", "repeat(auto, color(srgb 0 1 0))"); + test_computed_value(property, "rgb(from yellow calc(255 - r) calc(255 - g) calc(255 - b))", "color(srgb 0 0 1)"); +} </script> </body> </html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-color-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-color-invalid.html index 36f26ce..e553d24e 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-color-invalid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-color-invalid.html
@@ -5,20 +5,23 @@ <title>CSS Gap Decorations: column-rule-color parsing</title> <link rel="help" href="https://drafts.csswg.org/css-gaps-1/#column-row-rule-color"> <link rel="author" title="Sam Davis Omekara Jr." href="mailto:samomekarajr@microsoft.com"> -<meta name="assert" content="column-rule-color supports only the grammar '[ <line-color-list> | <auto-line-color-list> ]'."> +<meta name="assert" content="*-rule-color supports only the grammar '[ <line-color-list> | <auto-line-color-list> ]'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/css/support/parsing-testcommon.js"></script> </head> <body> <script> -test_invalid_value("column-rule-color", "auto"); +const properties = ["column-rule-color", "row-rule-color"]; +for (let property of properties) { + test_invalid_value(property, "auto"); -test_invalid_value("column-rule-color", "red, blue, green"); -test_invalid_value("column-rule-color", "repeat(auto, red, blue, green)"); -test_invalid_value("column-rule-color", "repeat(0, red, blue, green)"); -test_invalid_value("column-rule-color", "repeat(-1, red, blue, green)"); -test_invalid_value("column-rule-color", "repeat(auto, red) red repeat(auto, blue)"); + test_invalid_value(property, "red, blue, green"); + test_invalid_value(property, "repeat(auto, red, blue, green)"); + test_invalid_value(property, "repeat(0, red, blue, green)"); + test_invalid_value(property, "repeat(-1, red, blue, green)"); + test_invalid_value(property, "repeat(auto, red) red repeat(auto, blue)"); +} </script> </body> </html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-color-valid.html b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-color-valid.html index d4cb5b1..af24afc3 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-color-valid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-color-valid.html
@@ -12,32 +12,35 @@ </head> <body> <script> -// <repeat-line-color> = repeat( [ <integer [1,∞]> ] , [ <color> ]+ ) -test_valid_value("column-rule-color", "repeat(4, blue)"); -test_valid_value("column-rule-color", "repeat(3, red green blue)"); -test_valid_value("column-rule-color", "repeat(1, red green blue yellow)"); +const properties = ["column-rule-color", "row-rule-color"]; +for (let property of properties) { + // <repeat-line-color> = repeat( [ <integer [1,∞]> ] , [ <color> ]+ ) + test_valid_value(property, "repeat(4, blue)"); + test_valid_value(property, "repeat(3, red green blue)"); + test_valid_value(property, "repeat(1, red green blue yellow)"); -// <line-color-or-repeat> = [ <color> | <repeat-line-color> ] -test_valid_value("column-rule-color", "red"); -test_valid_value("column-rule-color", "repeat(4, cyan)"); + // <line-color-or-repeat> = [ <color> | <repeat-line-color> ] + test_valid_value(property, "red"); + test_valid_value(property, "repeat(4, cyan)"); -// <line-color-list> = [ <line-color-or-repeat> ]+ -test_valid_value("column-rule-color", "green blue"); -test_valid_value("column-rule-color", "red blue green yellow pink"); -test_valid_value("column-rule-color", "repeat(3, blue) repeat(4, red)"); -test_valid_value("column-rule-color", "red repeat(3, blue) blue repeat(4, red green cyan)"); -test_valid_value("column-rule-color", "repeat(4, red green cyan) repeat(5, yellow) blue"); + // <line-color-list> = [ <line-color-or-repeat> ]+ + test_valid_value(property, "green blue"); + test_valid_value(property, "red blue green yellow pink"); + test_valid_value(property, "repeat(3, blue) repeat(4, red)"); + test_valid_value(property, "red repeat(3, blue) blue repeat(4, red green cyan)"); + test_valid_value(property, "repeat(4, red green cyan) repeat(5, yellow) blue"); -// <auto-repeat-line-color> = repeat( auto , [ <color> ]+ ) -test_valid_value("column-rule-color", "repeat(auto, red)"); -test_valid_value("column-rule-color", "repeat(auto, red green blue)"); + // <auto-repeat-line-color> = repeat( auto , [ <color> ]+ ) + test_valid_value(property, "repeat(auto, red)"); + test_valid_value(property, "repeat(auto, red green blue)"); -// <auto-line-color-list> = [ <line-color-or-repeat> ]* -// <auto-repeat-line-color> -// [ <line-color-or-repeat> ]* -test_valid_value("column-rule-color", "repeat(auto, red green) red"); -test_valid_value("column-rule-color", "repeat(4, blue red green) repeat(auto, red)"); -test_valid_value("column-rule-color", "blue repeat(auto, red green) repeat(4, blue red green)"); + // <auto-line-color-list> = [ <line-color-or-repeat> ]* + // <auto-repeat-line-color> + // [ <line-color-or-repeat> ]* + test_valid_value(property, "repeat(auto, red green) red"); + test_valid_value(property, "repeat(4, blue red green) repeat(auto, red)"); + test_valid_value(property, "blue repeat(auto, red green) repeat(4, blue red green)"); +} </script> </body> </html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-width-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-width-invalid.html index 1b93fb5..902c619a 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-width-invalid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-gaps/tentative/parsing/gap-decorations-width-invalid.html
@@ -28,4 +28,4 @@ </script> </body> -</html> +</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/keyboard-scroll.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/keyboard-scroll.html new file mode 100644 index 0000000..ac0b017 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/keyboard-scroll.html
@@ -0,0 +1,107 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Keyboard scrolling targets the last clicked element</title> +<link rel="help" href=""> +<link rel="author" href="flackr@chromium.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script src="/resources/testdriver-actions.js"></script> +<script src="/css/css-scroll-snap/support/common.js"></script> +<script src="/dom/events/scrolling/scroll_support.js"></script> +<style> + .scroller { + overflow: auto; + height: 200px; + border: 1px solid black; + } + .spacer { + height: 200vh; + } +</style> +<body id="body"> +<div class="scroller" id="outer"> + <div class="scroller" id="inner"> + <div id="target"><span>This is the targeted node</span></div> + <div class="spacer"></div> + </div> + <div class="spacer"></div> +</div> +<div class="spacer"></div> +</body> +<script> + +const target = document.getElementById("target"); +const outer = document.getElementById("outer"); +const inner = document.getElementById("inner"); +const scrollTargets = [document, outer, inner]; + +function raf() { + return new Promise((resolve) => { + requestAnimationFrame(resolve); + }); +} + +async function getKeyboardScrollingElement(test, clickTarget, onclick) { + const click_promise = waitForEvent("click", test, clickTarget); + await test_driver.click(clickTarget); + await click_promise; + await onclick(); + await raf(); + const scrollEndPromise = waitForScrollEndFallbackToDelayWithoutScrollEvent(scrollTargets); + await keyPress(document.body, "ArrowDown"); + return scrollEndPromise; +} + +function friendlyName(node) { + if (node == document) return "document"; + if (node.id) return `#${node.id}`; + return `<${node.tagName}>`; +} + +async function resetScroll() { + for (const scrollTarget of scrollTargets) { + const scroller = scrollTarget.scrollingElement || scrollTarget; + scroller.scrollTo(0, 0); + } + return raf(); +} + +promise_test(async (test) => { + test.add_cleanup(resetScroll); + const scrolled = await getKeyboardScrollingElement(test, target, async () => { + target.remove(); + test.add_cleanup(() => { + inner.insertBefore(target, inner.firstChild); + }); + }); + assert_equals(friendlyName(scrolled), "#inner"); +}, "Keyboard scrolling scrolls the scroller when clicked target is removed"); + +// Notably removing all children is a different code path than removing +// a single child. This is a regression test for https://crbug.com/40941145. +promise_test(async (test) => { + test.add_cleanup(resetScroll); + const scrolled = await getKeyboardScrollingElement(test, target.firstElementChild, async () => { + const previous = target.innerHTML; + target.innerHTML = ""; + test.add_cleanup(() => { + target.innerHTML = previous; + }); + }); + assert_equals(friendlyName(scrolled), "#inner"); +}, "Keyboard scrolling scrolls the scroller when clicked children are removed"); + +promise_test(async (test) => { + test.add_cleanup(resetScroll); + const scrolled = await getKeyboardScrollingElement(test, target, async () => { + inner.remove(); + test.add_cleanup(() => { + outer.insertBefore(inner, outer.firstChild); + }); + }); + assert_equals(friendlyName(scrolled), "#outer"); +}, "Keyboard scrolling scrolls the next nearest scroller if the clicked scroller is removed"); + +</script>
diff --git a/third_party/blink/web_tests/external/wpt/device-bound-session-credentials/session_manager.py b/third_party/blink/web_tests/external/wpt/device-bound-session-credentials/session_manager.py index bba15ccd..dd7943b 100644 --- a/third_party/blink/web_tests/external/wpt/device-bound-session-credentials/session_manager.py +++ b/third_party/blink/web_tests/external/wpt/device-bound-session-credentials/session_manager.py
@@ -21,6 +21,7 @@ self.authorization_value = None self.send_challenge_early = False self.cookie_has_no_attributes = False + self.scope_origin = None def create_new_session(self): session_id = str(len(self.session_to_key_map)) @@ -56,6 +57,10 @@ if cookie_has_no_attributes is not None: self.cookie_has_no_attributes = cookie_has_no_attributes + scope_origin = configuration.get("scopeOrigin") + if scope_origin is not None: + self.scope_origin = scope_origin + def get_should_refresh_end_session(self): return self.should_refresh_end_session @@ -73,10 +78,15 @@ cookie_parts.append(cookie_attributes) value_of_set_cookie = "; ".join(cookie_parts) + scope_origin = "" + if self.scope_origin is not None: + scope_origin = self.scope_origin + response_body = { "session_identifier": session_id, "refresh_url": "/device-bound-session-credentials/refresh_session.py", "scope": { + "origin": scope_origin, "include_site": True, "scope_specification" : [ { "type": "exclude", "domain": request.url_parts.hostname, "path": "/device-bound-session-credentials/request_early_challenge.py" },
diff --git a/third_party/blink/web_tests/external/wpt/device-bound-session-credentials/set-scope-origin.https.html b/third_party/blink/web_tests/external/wpt/device-bound-session-credentials/set-scope-origin.https.html new file mode 100644 index 0000000..2105e87 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/device-bound-session-credentials/set-scope-origin.https.html
@@ -0,0 +1,63 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>DBSC scope origin set</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="helper.js" type="module"></script> + +<script type="module"> + import { expireCookie, documentHasCookie, waitForCookie, addCookieAndSessionCleanup, setupShardedServerState, configureServer} from "./helper.js"; + + promise_test(async t => { + await setupShardedServerState(); + const expectedCookieAndValue = "auth_cookie=abcdef0123"; + const expectedCookieAndAttributes = `${expectedCookieAndValue};Domain=${get_host_info().ORIGINAL_HOST};Path=/device-bound-session-credentials`; + addCookieAndSessionCleanup(t, expectedCookieAndAttributes); + + // Configure server to have the same scope origin as the upcoming request. + configureServer({ scopeOrigin: get_host_info().HTTPS_ORIGIN }); + + // Prompt starting a session, and wait until registration completes. + const login_response = await fetch('login.py'); + assert_equals(login_response.status, 200); + assert_true(await waitForCookie(expectedCookieAndValue)); + + // Confirm that a request has the cookie set. + const auth_response = await fetch('verify_authenticated.py'); + assert_equals(auth_response.status, 200); + + // Confirm that expiring the cookie still leads to a request with the cookie set (refresh occurs). + expireCookie(expectedCookieAndAttributes); + assert_false(documentHasCookie(expectedCookieAndValue)); + const auth_response_after_expiry = await fetch('verify_authenticated.py'); + assert_equals(auth_response_after_expiry.status, 200); + assert_true(documentHasCookie(expectedCookieAndValue)); + }, "A request within the scope origin refreshes"); + + promise_test(async t => { + await setupShardedServerState(); + const expectedCookieAndValue = "auth_cookie=abcdef0123"; + const expectedCookieAndAttributes = `${expectedCookieAndValue};Domain=${get_host_info().ORIGINAL_HOST};Path=/device-bound-session-credentials`; + addCookieAndSessionCleanup(t, expectedCookieAndAttributes); + + // Configure server to have a scope origin that does not match the upcoming request. + configureServer({ scopeOrigin: get_host_info().OTHER_ORIGIN }); + + // Prompt starting a session, and wait until registration completes. + const login_response = await fetch('login.py'); + assert_equals(login_response.status, 200); + assert_true(await waitForCookie(expectedCookieAndValue)); + + // Confirm that a request has the cookie set. + const auth_response = await fetch('verify_authenticated.py'); + assert_equals(auth_response.status, 200); + + // Confirm that expiring the cookie does not trigger refresh. + expireCookie(expectedCookieAndAttributes); + assert_false(documentHasCookie(expectedCookieAndValue)); + const auth_response_after_expiry = await fetch('verify_authenticated.py'); + assert_equals(auth_response_after_expiry.status, 401); + assert_false(documentHasCookie(expectedCookieAndValue)); + }, "A request outside the scope origin does not refresh"); +</script> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/dom/events/scrolling/scroll_support.js b/third_party/blink/web_tests/external/wpt/dom/events/scrolling/scroll_support.js index c94803a..59deaf4 100644 --- a/third_party/blink/web_tests/external/wpt/dom/events/scrolling/scroll_support.js +++ b/third_party/blink/web_tests/external/wpt/dom/events/scrolling/scroll_support.js
@@ -46,12 +46,41 @@ // Waits for the end of scrolling. Uses the "scrollend" event if available. // Otherwise, fall backs to waitForDelayWithoutScrollEvent(). -function waitForScrollEndFallbackToDelayWithoutScrollEvent(eventTarget) { - if (window.onscrollend !== undefined) { - return waitForScrollendEventNoTimeout(eventTarget); - } - return waitForScrollEvent(eventTarget).then(() => { - return waitForDelayWithoutScrollEvent(eventTarget); +function waitForScrollEndFallbackToDelayWithoutScrollEvent(eventTargets) { + return new Promise(resolve => { + if (!Array.isArray(eventTargets)) { + eventTargets = [eventTargets]; + } + let listeners = []; + const cleanup = () => { + for (const [eventTarget, eventName, listener] of listeners) { + eventTarget.removeEventListener(eventName, listener); + } + listeners = []; + } + const addListener = (eventTarget, eventName, listener) => { + listeners.push([eventTarget, eventName, listener]); + eventTarget.addEventListener(eventName, listener); + } + if (window.onscrollend !== undefined) { + // If scrollend is supported, wait for the first scrollend event. + for (const eventTarget of eventTargets) { + addListener(eventTarget, 'scrollend', () => { + cleanup(); + resolve(eventTarget); + }); + } + } else { + // Otherwise, wait for the first scroll event, then wait until that + // scroller finishes scrolling. + for (const eventTarget of eventTargets) { + addListener(eventTarget, 'scroll', async () => { + cleanup(); + await waitForDelayWithoutScrollEvent(eventTarget); + resolve(eventTarget); + }); + } + } }); }
diff --git a/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.js b/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.js index b1b57a4..4750111 100644 --- a/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.js +++ b/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.js
@@ -12,9 +12,6 @@ idl_array => { idl_array.add_objects({ Performance: ['performance'], - EventCounts: ['performance.eventCounts'], - InteractionCounts: ['performance.interactionCounts'], - // PerformanceEventTiming: [ TODO ] }); } );
diff --git a/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.serviceworker-expected.txt b/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.serviceworker-expected.txt deleted file mode 100644 index 60a14f82..0000000 --- a/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.serviceworker-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -This is a testharness.js-based test. -[FAIL] EventCounts must be primary interface of performance.eventCounts - assert_equals: wrong typeof object expected "object" but got "undefined" -[FAIL] Stringification of performance.eventCounts - assert_equals: wrong typeof object expected "object" but got "undefined" -[FAIL] EventCounts interface: performance.eventCounts must not have property "undefined" - Cannot use 'in' operator to search for 'undefined' in undefined -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.sharedworker-expected.txt b/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.sharedworker-expected.txt deleted file mode 100644 index 60a14f82..0000000 --- a/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.sharedworker-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -This is a testharness.js-based test. -[FAIL] EventCounts must be primary interface of performance.eventCounts - assert_equals: wrong typeof object expected "object" but got "undefined" -[FAIL] Stringification of performance.eventCounts - assert_equals: wrong typeof object expected "object" but got "undefined" -[FAIL] EventCounts interface: performance.eventCounts must not have property "undefined" - Cannot use 'in' operator to search for 'undefined' in undefined -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.worker-expected.txt deleted file mode 100644 index 60a14f82..0000000 --- a/third_party/blink/web_tests/external/wpt/event-timing/idlharness.any.worker-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -This is a testharness.js-based test. -[FAIL] EventCounts must be primary interface of performance.eventCounts - assert_equals: wrong typeof object expected "object" but got "undefined" -[FAIL] Stringification of performance.eventCounts - assert_equals: wrong typeof object expected "object" but got "undefined" -[FAIL] EventCounts interface: performance.eventCounts must not have property "undefined" - Cannot use 'in' operator to search for 'undefined' in undefined -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/event-timing/idlharness.window.js b/third_party/blink/web_tests/external/wpt/event-timing/idlharness.window.js new file mode 100644 index 0000000..83dd8c557 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/event-timing/idlharness.window.js
@@ -0,0 +1,19 @@ +// META: global=window +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js + +// https://wicg.github.io/event-timing/ + +'use strict'; + +idl_test( + ['event-timing'], + ['performance-timeline', 'hr-time', 'dom'], + idl_array => { + idl_array.add_objects({ + Performance: ['performance'], + EventCounts: ['performance.eventCounts'], + // PerformanceEventTiming: [ TODO ] + }); + } +);
diff --git a/third_party/blink/web_tests/external/wpt/svg/idlharness.window-expected.txt b/third_party/blink/web_tests/external/wpt/svg/idlharness.window-expected.txt index f901530..46057a7e 100644 --- a/third_party/blink/web_tests/external/wpt/svg/idlharness.window-expected.txt +++ b/third_party/blink/web_tests/external/wpt/svg/idlharness.window-expected.txt
@@ -4,10 +4,6 @@ assert_true: The prototype object must have a property "correspondingElement" expected true got false [FAIL] SVGElement interface: attribute correspondingUseElement assert_true: The prototype object must have a property "correspondingUseElement" expected true got false -[FAIL] SVGGeometryElement interface: operation isPointInFill(optional DOMPointInit) - assert_equals: property has wrong .length expected 0 but got 1 -[FAIL] SVGGeometryElement interface: operation isPointInStroke(optional DOMPointInit) - assert_equals: property has wrong .length expected 0 but got 1 [FAIL] SVGAnimatedRect interface: objects.svg.viewBox must inherit property "baseVal" with the proper type assert_true: wrong type: not a DOMRect expected true got false [FAIL] SVGAnimatedRect interface: objects.svg.viewBox must inherit property "animVal" with the proper type @@ -142,8 +138,6 @@ assert_inherits: property "correspondingElement" not found in prototype chain [FAIL] SVGElement interface: objects.polygon must inherit property "correspondingUseElement" with the proper type assert_inherits: property "correspondingUseElement" not found in prototype chain -[FAIL] SVGTextContentElement interface: operation getCharNumAtPosition(optional DOMPointInit) - assert_equals: property has wrong .length expected 0 but got 1 [FAIL] SVGElement interface: objects.text must inherit property "correspondingElement" with the proper type assert_inherits: property "correspondingElement" not found in prototype chain [FAIL] SVGElement interface: objects.text must inherit property "correspondingUseElement" with the proper type
diff --git a/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGGeometryElement.isPointInFill-01-expected.txt b/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGGeometryElement.isPointInFill-01-expected.txt deleted file mode 100644 index 0abf390..0000000 --- a/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGGeometryElement.isPointInFill-01-expected.txt +++ /dev/null
@@ -1,17 +0,0 @@ -This is a testharness.js-based test. -[FAIL] SVGGeometryElement.prototype.isPointInFill, no arguments. - Failed to execute 'isPointInFill' on 'SVGGeometryElement': 1 argument required, but only 0 present. -[FAIL] SVGGeometryElement.prototype.isPointInFill, non-finite argument. - Failed to execute 'isPointInFill' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInFill, functional test. - Failed to execute 'isPointInFill' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInFill, points on the shape boundary are inside. - Failed to execute 'isPointInFill' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInFill, 'fill-rule'. - Failed to execute 'isPointInFill' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInFill, 'visibility' and 'pointer-events' have no effect. - Failed to execute 'isPointInFill' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInFill, 'clip-rule' never overrides 'fill-rule'. - Failed to execute 'isPointInFill' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGGeometryElement.isPointInStroke-01-expected.txt b/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGGeometryElement.isPointInStroke-01-expected.txt deleted file mode 100644 index 277c834..0000000 --- a/third_party/blink/web_tests/external/wpt/svg/types/scripted/SVGGeometryElement.isPointInStroke-01-expected.txt +++ /dev/null
@@ -1,25 +0,0 @@ -This is a testharness.js-based test. -[FAIL] SVGGeometryElement.prototype.isPointInStroke, no arguments. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': 1 argument required, but only 0 present. -[FAIL] SVGGeometryElement.prototype.isPointInStroke, non-finite argument. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInStroke, functional test. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInStroke, 'stroke-dasharray'. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInStroke, 'stroke-dashoffset'. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInStroke, 'stroke-miterlimit'. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInStroke, 'stroke-linejoin'. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInStroke, 'stroke-linecap'. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInStroke, 'pathLength'. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInStroke, 'vector-effect'. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -[FAIL] SVGGeometryElement.prototype.isPointInStroke, 'visibility' and 'pointer-events' have no effect. - Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'. -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/fast/forms/fieldset/overflow-scroll-interaction.html b/third_party/blink/web_tests/fast/forms/fieldset/overflow-scroll-interaction.html index 5376862..5eaa5ff 100644 --- a/third_party/blink/web_tests/fast/forms/fieldset/overflow-scroll-interaction.html +++ b/third_party/blink/web_tests/fast/forms/fieldset/overflow-scroll-interaction.html
@@ -38,8 +38,9 @@ assert_equals(fieldset.scrollHeight, 400); await test_driver.click(fieldset); assert_equals(fieldset.scrollTop, 0); + const scrollEndPromise = eventPromise(fieldset, 'scrollend'); await test_driver.send_keys(fieldset, ' '); - await eventPromise(fieldset, 'scroll'); + await scrollEndPromise; assert_greater_than(fieldset.scrollTop, 0); }, 'Pressing the space bar should scroll up');
diff --git a/third_party/blink/web_tests/fast/scroll-behavior/smooth-scroll-overflow-hidden.html b/third_party/blink/web_tests/fast/scroll-behavior/smooth-scroll-overflow-hidden.html index f277464..4efa96bf9 100644 --- a/third_party/blink/web_tests/fast/scroll-behavior/smooth-scroll-overflow-hidden.html +++ b/third_party/blink/web_tests/fast/scroll-behavior/smooth-scroll-overflow-hidden.html
@@ -11,8 +11,8 @@ <script> async_test(t => { - onscroll = t.step_func_done(() => { - assert_true(scrollY > 0); + onscrollend = t.step_func_done(() => { + assert_equals(scrollY, 500); }); scroll({behavior: "smooth", top: 500}); }, 'scroll');
diff --git a/third_party/blink/web_tests/fast/scroll-snap/snap-to-area-with-fractional-offset.html b/third_party/blink/web_tests/fast/scroll-snap/snap-to-area-with-fractional-offset.html index 5ef51c8..01ba29d 100644 --- a/third_party/blink/web_tests/fast/scroll-snap/snap-to-area-with-fractional-offset.html +++ b/third_party/blink/web_tests/fast/scroll-snap/snap-to-area-with-fractional-offset.html
@@ -77,8 +77,6 @@ async function waitForScrollEndWithFractionalValue(targetElement, value) { return waitForScrollEnd(targetElement, () => { - if (internals.runtimeFlags.fractionalScrollOffsetsEnabled) - return Math.abs(scrollTop() - value) < 1; return Math.abs(scrollTop() - value) <= 1; }, true); }
diff --git a/third_party/blink/web_tests/images/resources/jpeg-with-c2pa-adobe-20220124-C.jpg b/third_party/blink/web_tests/images/resources/jpeg-with-c2pa-adobe-20220124-C.jpg new file mode 100644 index 0000000..4b8df5e --- /dev/null +++ b/third_party/blink/web_tests/images/resources/jpeg-with-c2pa-adobe-20220124-C.jpg Binary files differ
diff --git a/third_party/blink/web_tests/resources/testdriver.js b/third_party/blink/web_tests/resources/testdriver.js index bdd18cc..d8b55ba4 100644 --- a/third_party/blink/web_tests/resources/testdriver.js +++ b/third_party/blink/web_tests/resources/testdriver.js
@@ -3,6 +3,26 @@ var idCounter = 0; let testharness_context = null; + const features = (() => { + function getFeatures(scriptSrc) { + try { + const url = new URL(scriptSrc); + return url.searchParams.getAll('feature'); + } catch (e) { + return []; + } + } + + return getFeatures(document?.currentScript?.src ?? ''); + })(); + + function assertBidiIsEnabled(){ + if (!features.includes('bidi')) { + throw new Error( + "`?feature=bidi` is missing when importing testdriver.js but the test is using WebDriver BiDi APIs"); + } + } + function getInViewCenterPoint(rect) { var left = Math.max(0, rect.left); var right = Math.min(window.innerWidth, rect.right); @@ -63,6 +83,42 @@ */ bluetooth: { /** + * Handle a bluetooth device prompt with the given params. Matches the + * `bluetooth.handleRequestDevicePrompt + * <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-handlerequestdeviceprompt-command>`_ + * WebDriver BiDi command. + * + * @example + * await test_driver.bidi.bluetooth.handleRequestDevicePrompt({ + * prompt: "pmt-e0a234b", + * accept: true, + * device: "dvc-9b3b872" + * }); + * + * @param {object} params - Parameters for the command. + * @param {string} params.prompt - The id of a bluetooth device prompt. + * Matches the + * `bluetooth.HandleRequestDevicePromptParameters:prompt <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-handlerequestdeviceprompt-command>`_ + * value. + * @param {bool} params.accept - Whether to accept a bluetooth device prompt. + * Matches the + * `bluetooth.HandleRequestDevicePromptAcceptParameters:accept <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-handlerequestdeviceprompt-command>`_ + * value. + * @param {string} params.device - The device id from a bluetooth device + * prompt to be accepted. Matches the + * `bluetooth.HandleRequestDevicePromptAcceptParameters:device <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-handlerequestdeviceprompt-command>`_ + * value. + * @param {Context} [params.context] The optional context parameter specifies in + * which browsing context the bluetooth device prompt should be handled. If not + * provided, the current browsing context is used. + * @returns {Promise} fulfilled after the bluetooth device prompt + * is handled, or rejected if the operation fails. + */ + handle_request_device_prompt: function(params) { + return window.test_driver_internal.bidi.bluetooth + .handle_request_device_prompt(params); + }, + /** * Creates a simulated bluetooth adapter with the given params. Matches the * `bluetooth.simulateAdapter <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateAdapter-command>`_ * WebDriver BiDi command. @@ -85,6 +141,116 @@ */ simulate_adapter: function (params) { return window.test_driver_internal.bidi.bluetooth.simulate_adapter(params); + }, + /** + * Creates a simulated bluetooth peripheral with the given params. + * Matches the + * `bluetooth.simulatePreconnectedPeripheral <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_ + * WebDriver BiDi command. + * + * @example + * await test_driver.bidi.bluetooth.simulatePreconnectedPeripheral({ + * "address": "09:09:09:09:09:09", + * "name": "Some Device", + * "manufacturerData": [{key: 17, data: "AP8BAX8="}], + * "knownServiceUuids": [ + * "12345678-1234-5678-9abc-def123456789", + * ], + * }); + * + * @param {object} params - Parameters for the command. + * @param {string} params.address - The address of the simulated + * bluetooth peripheral. Matches the + * `bluetooth.SimulatePreconnectedPeripheralParameters:address <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_ + * value. + * @param {string} params.name - The name of the simulated bluetooth + * peripheral. Matches the + * `bluetooth.SimulatePreconnectedPeripheralParameters:name <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_ + * value. + * @param {Array.ManufacturerData} params.manufacturerData - The manufacturerData of the + * simulated bluetooth peripheral. Matches the + * `bluetooth.SimulatePreconnectedPeripheralParameters:manufacturerData <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_ + * value. + * @param {string} params.knownServiceUuids - The knownServiceUuids of + * the simulated bluetooth peripheral. Matches the + * `bluetooth.SimulatePreconnectedPeripheralParameters:knownServiceUuids <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command>`_ + * value. + * @param {Context} [params.context] The optional context parameter + * specifies in which browsing context the simulated bluetooth peripheral should be + * set. If not provided, the current browsing context is used. + * @returns {Promise} fulfilled after the simulated bluetooth peripheral is created + * and set, or rejected if the operation fails. + */ + simulate_preconnected_peripheral: function(params) { + return window.test_driver_internal.bidi.bluetooth + .simulate_preconnected_peripheral(params); + }, + /** + * `bluetooth.RequestDevicePromptUpdatedParameters <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-requestdevicepromptupdated-event>`_ + * event. + */ + request_device_prompt_updated: { + /** + * @typedef {object} RequestDevicePromptUpdated + * `bluetooth.RequestDevicePromptUpdatedParameters <https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-requestdevicepromptupdated-event>`_ + * event. + */ + + /** + * Subscribes to the event. Events will be emitted only if + * there is a subscription for the event. This method does + * not add actual listeners. To listen to the event, use the + * `on` or `once` methods. The buffered events will be + * emitted before the command promise is resolved. + * + * @param {object} [params] Parameters for the subscription. + * @param {null|Array.<(Context)>} [params.contexts] The + * optional contexts parameter specifies which browsing + * contexts to subscribe to the event on. It should be + * either an array of Context objects, or null. If null, the + * event will be subscribed to globally. If omitted, the + * event will be subscribed to on the current browsing + * context. + * @returns {Promise<void>} Resolves when the subscription + * is successfully done. + */ + subscribe: async function(params = {}) { + assertBidiIsEnabled(); + return window.test_driver_internal.bidi.bluetooth + .request_device_prompt_updated.subscribe(params); + }, + /** + * Adds an event listener for the event. + * + * @param {function(RequestDevicePromptUpdated): void} callback The + * callback to be called when the event is emitted. The + * callback is called with the event object as a parameter. + * @returns {function(): void} A function that removes the + * added event listener when called. + */ + on: function(callback) { + assertBidiIsEnabled(); + return window.test_driver_internal.bidi.bluetooth + .request_device_prompt_updated.on(callback); + }, + /** + * Adds an event listener for the event that is only called + * once and removed afterward. + * + * @return {Promise<RequestDevicePromptUpdated>} The promise which + * is resolved with the event object when the event is emitted. + */ + once: function() { + assertBidiIsEnabled(); + return new Promise(resolve => { + const remove_handler = + window.test_driver_internal.bidi.bluetooth + .request_device_prompt_updated.on(event => { + resolve(event); + remove_handler(); + }); + }); + }, } }, /** @@ -115,6 +281,7 @@ * is successfully done. */ subscribe: async function (params = {}) { + assertBidiIsEnabled(); return window.test_driver_internal.bidi.log.entry_added.subscribe(params); }, /** @@ -127,6 +294,7 @@ * added event listener when called. */ on: function (callback) { + assertBidiIsEnabled(); return window.test_driver_internal.bidi.log.entry_added.on(callback); }, /** @@ -137,6 +305,7 @@ * with the event object when the event is emitted. */ once: function () { + assertBidiIsEnabled(); return new Promise(resolve => { const remove_handler = window.test_driver_internal.bidi.log.entry_added.on( event => { @@ -181,6 +350,7 @@ * the permission fails. */ set_permission: function (params) { + assertBidiIsEnabled(); return window.test_driver_internal.bidi.permissions.set_permission( params); } @@ -250,8 +420,8 @@ let wait_click = new Promise(resolve => button.addEventListener("click", resolve)); return test_driver.click(button) - .then(wait_click) - .then(function() { + .then(wait_click) + .then(function () { button.remove(); if (typeof action === "function") { @@ -1316,9 +1486,27 @@ bidi: { bluetooth: { + handle_request_device_prompt: function() { + throw new Error( + 'bidi.bluetooth.handle_request_device_prompt is not implemented by testdriver-vendor.js'); + }, simulate_adapter: function () { throw new Error( "bidi.bluetooth.simulate_adapter is not implemented by testdriver-vendor.js"); + }, + simulate_preconnected_peripheral: function() { + throw new Error( + 'bidi.bluetooth.simulate_preconnected_peripheral is not implemented by testdriver-vendor.js'); + }, + request_device_prompt_updated: { + async subscribe() { + throw new Error( + 'bidi.bluetooth.request_device_prompt_updated.subscribe is not implemented by testdriver-vendor.js'); + }, + on() { + throw new Error( + 'bidi.bluetooth.request_device_prompt_updated.on is not implemented by testdriver-vendor.js'); + } } }, log: {
diff --git a/third_party/blink/web_tests/resources/testharness.js b/third_party/blink/web_tests/resources/testharness.js index 81cf617..5b5410c 100644 --- a/third_party/blink/web_tests/resources/testharness.js +++ b/third_party/blink/web_tests/resources/testharness.js
@@ -4788,7 +4788,8 @@ return META_TITLE; } if ('location' in global_scope && 'pathname' in location) { - return location.pathname.substring(location.pathname.lastIndexOf('/') + 1, location.pathname.indexOf('.')); + var filename = location.pathname.substring(location.pathname.lastIndexOf('/') + 1); + return filename.substring(0, filename.indexOf('.')); } return "Untitled"; }
diff --git a/third_party/blink/web_tests/svg/dom/undefined-null-expected.txt b/third_party/blink/web_tests/svg/dom/undefined-null-expected.txt index 8830ead..5923f77f 100644 --- a/third_party/blink/web_tests/svg/dom/undefined-null-expected.txt +++ b/third_party/blink/web_tests/svg/dom/undefined-null-expected.txt
@@ -5,16 +5,16 @@ SVGGeometryElement -isPointInFill(SVGPoint point) +isPointInFill(optional DOMPointInit point) PASS circle.isPointInFill(point) did not throw exception. -PASS circle.isPointInFill(undefined) threw exception TypeError: Failed to execute 'isPointInFill' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'.. -PASS circle.isPointInFill(null) threw exception TypeError: Failed to execute 'isPointInFill' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'.. +PASS circle.isPointInFill(undefined) did not throw exception. +PASS circle.isPointInFill(null) did not throw exception. -isPointInStroke(SVGPoint point) +isPointInStroke(optional DOMPointInit point) PASS circle.isPointInStroke(point) did not throw exception. -PASS circle.isPointInStroke(undefined) threw exception TypeError: Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'.. -PASS circle.isPointInStroke(null) threw exception TypeError: Failed to execute 'isPointInStroke' on 'SVGGeometryElement': parameter 1 is not of type 'SVGPoint'.. +PASS circle.isPointInStroke(undefined) did not throw exception. +PASS circle.isPointInStroke(null) did not throw exception. @@ -66,10 +66,10 @@ SVGTextContentElement -getCharNumAtPosition(SVGPoint point) +getCharNumAtPosition(optional DOMPointInit point) PASS text.getCharNumAtPosition(point) did not throw exception. -PASS text.getCharNumAtPosition(undefined) threw exception TypeError: Failed to execute 'getCharNumAtPosition' on 'SVGTextContentElement': parameter 1 is not of type 'SVGPoint'.. -PASS text.getCharNumAtPosition(null) threw exception TypeError: Failed to execute 'getCharNumAtPosition' on 'SVGTextContentElement': parameter 1 is not of type 'SVGPoint'.. +PASS text.getCharNumAtPosition(undefined) did not throw exception. +PASS text.getCharNumAtPosition(null) did not throw exception. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/svg/dom/undefined-null.html b/third_party/blink/web_tests/svg/dom/undefined-null.html index c22feccb..9b0b450 100644 --- a/third_party/blink/web_tests/svg/dom/undefined-null.html +++ b/third_party/blink/web_tests/svg/dom/undefined-null.html
@@ -22,16 +22,16 @@ // SVGGeometryElement is an abstract class: instantiate object of derived class debug(''); -debug('isPointInFill(SVGPoint point)'); +debug('isPointInFill(optional DOMPointInit point)'); shouldNotThrow('circle.isPointInFill(point)'); -shouldThrow('circle.isPointInFill(undefined)'); -shouldThrow('circle.isPointInFill(null)'); +shouldNotThrow('circle.isPointInFill(undefined)'); +shouldNotThrow('circle.isPointInFill(null)'); debug(''); -debug('isPointInStroke(SVGPoint point)'); +debug('isPointInStroke(optional DOMPointInit point)'); shouldNotThrow('circle.isPointInStroke(point)'); -shouldThrow('circle.isPointInStroke(undefined)'); -shouldThrow('circle.isPointInStroke(null)'); +shouldNotThrow('circle.isPointInStroke(undefined)'); +shouldNotThrow('circle.isPointInStroke(null)'); debug(''); @@ -83,9 +83,9 @@ debug('SVGTextContentElement'); debug(''); -debug('getCharNumAtPosition(SVGPoint point)'); +debug('getCharNumAtPosition(optional DOMPointInit point)'); shouldNotThrow('text.getCharNumAtPosition(point)'); -shouldThrow('text.getCharNumAtPosition(undefined)'); -shouldThrow('text.getCharNumAtPosition(null)'); +shouldNotThrow('text.getCharNumAtPosition(undefined)'); +shouldNotThrow('text.getCharNumAtPosition(null)'); </script>
diff --git a/third_party/blink/web_tests/svg/text/svgtextcontentelement-methods-parameters.html b/third_party/blink/web_tests/svg/text/svgtextcontentelement-methods-parameters.html index 4b070c7..9ce5955 100644 --- a/third_party/blink/web_tests/svg/text/svgtextcontentelement-methods-parameters.html +++ b/third_party/blink/web_tests/svg/text/svgtextcontentelement-methods-parameters.html
@@ -39,9 +39,7 @@ assert_throws_js(TypeError, function() { svgText.getEndPositionOfChar(); }); assert_throws_js(TypeError, function() { svgText.getExtentOfChar(); }); assert_throws_js(TypeError, function() { svgText.getRotationOfChar(); }); - assert_throws_js(TypeError, function() { svgText.getCharNumAtPosition(); }); assert_throws_js(TypeError, function() { svgText.getCharNumAtPosition('aString'); }); - assert_throws_js(TypeError, function() { svgText.getCharNumAtPosition(svgText); }); assert_throws_js(TypeError, function() { svgText.selectSubString(); }); assert_throws_js(TypeError, function() { svgText.selectSubString(2); });
diff --git a/third_party/blink/web_tests/transforms/scale-and-translate-transform-composited-descendants-expected.png b/third_party/blink/web_tests/transforms/scale-and-translate-transform-composited-descendants-expected.png new file mode 100644 index 0000000..5b26531 --- /dev/null +++ b/third_party/blink/web_tests/transforms/scale-and-translate-transform-composited-descendants-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/transforms/scale-and-translate-transform-composited-descendants.html b/third_party/blink/web_tests/transforms/scale-and-translate-transform-composited-descendants.html new file mode 100644 index 0000000..4c0d319 --- /dev/null +++ b/third_party/blink/web_tests/transforms/scale-and-translate-transform-composited-descendants.html
@@ -0,0 +1,21 @@ + +<!DOCTYPE html> +<style> + .black-layer { + width: 100px; + height: 100px; + background: black; + will-change: opacity; + } + #parent { + transform-origin:0 0; + scale: 0.995; + transform: translate(1px); + } +</style> +<!-- Tests that a 1px seam remains between the two .black-layer composited +layers, due to scale and transform both being present. --> +<div id=parent> + <div class="black-layer"></div> + <div class="black-layer"></div> +</div>
diff --git a/third_party/blink/web_tests/transforms/scale-transform-composited-descendants-changed-expected.png b/third_party/blink/web_tests/transforms/scale-transform-composited-descendants-changed-expected.png new file mode 100644 index 0000000..071ca6e --- /dev/null +++ b/third_party/blink/web_tests/transforms/scale-transform-composited-descendants-changed-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/transforms/scale-transform-composited-descendants-changed.html b/third_party/blink/web_tests/transforms/scale-transform-composited-descendants-changed.html new file mode 100644 index 0000000..dbb2949 --- /dev/null +++ b/third_party/blink/web_tests/transforms/scale-transform-composited-descendants-changed.html
@@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> + <style> + .black-layer { + width: 100px; + height: 100px; + background: black; + will-change: opacity; + } + #parentEl { + transform-origin:0 0; + transform: scale(0.995); + } + </style> + <!-- Tests that there is no 1px seam between the two .black-layer composited + layers. --> + <div id=parentEl> + <div class="black-layer"></div> + <div class="black-layer"></div> + </div> + <script> + if (testRunner) + testRunner.waitUntilDone(); + requestAnimationFrame(() => + requestAnimationFrame(() => { + parentEl.style.transform = "scale(0.994)"; + testRunner.notifyDone(); + })); + </script> +</html>
diff --git a/third_party/blink/web_tests/transforms/scale-transform-composited-descendants.html b/third_party/blink/web_tests/transforms/scale-transform-composited-descendants.html index aecb78d..5f1f46e 100644 --- a/third_party/blink/web_tests/transforms/scale-transform-composited-descendants.html +++ b/third_party/blink/web_tests/transforms/scale-transform-composited-descendants.html
@@ -1,4 +1,3 @@ - <!DOCTYPE html> <style> .black-layer { @@ -7,14 +6,19 @@ background: black; will-change: opacity; } - #parent { + #parentEl { transform-origin:0 0; - scale: 0.995; + transform: scale(0.995); } </style> <!-- Tests that there is no 1px seam between the two .black-layer composited layers. --> -<div id=parent> +<div id=parentEl> <div class="black-layer"></div> <div class="black-layer"></div> </div> +<script> + setTimeout(() => { + parentEl.style.transform = "scale(0.5)"; + }, 1000); +</script>
diff --git a/third_party/blink/web_tests/transforms/scale-transform-with-willchange-composited-descendants-expected.png b/third_party/blink/web_tests/transforms/scale-transform-with-willchange-composited-descendants-expected.png new file mode 100644 index 0000000..309dc8be --- /dev/null +++ b/third_party/blink/web_tests/transforms/scale-transform-with-willchange-composited-descendants-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/transforms/scale-transform-with-willchange-composited-descendants.html b/third_party/blink/web_tests/transforms/scale-transform-with-willchange-composited-descendants.html new file mode 100644 index 0000000..33074c3 --- /dev/null +++ b/third_party/blink/web_tests/transforms/scale-transform-with-willchange-composited-descendants.html
@@ -0,0 +1,25 @@ +<!DOCTYPE html> +<style> + .black-layer { + width: 100px; + height: 100px; + background: black; + will-change: opacity; + } + #parentEl { + transform-origin:0 0; + transform: scale(0.995); + will-change: transform; + } +</style> +<!-- Tests that there is no 1px seam between the two .black-layer composited +layers. --> +<div id=parentEl> + <div class="black-layer"></div> + <div class="black-layer"></div> +</div> +<script> + setTimeout(() => { + parentEl.style.transform = "scale(0.5)"; + }, 1000); +</script>
diff --git a/third_party/boringssl/src b/third_party/boringssl/src index 704dc8d..784c2db 160000 --- a/third_party/boringssl/src +++ b/third_party/boringssl/src
@@ -1 +1 @@ -Subproject commit 704dc8deff291eaf2f9564e2cd949824d181302e +Subproject commit 784c2dbf5d3ec7fd662cff39cb4c365e581d91f9
diff --git a/third_party/chromite b/third_party/chromite index 2026679..e2b890b 160000 --- a/third_party/chromite +++ b/third_party/chromite
@@ -1 +1 @@ -Subproject commit 2026679fbc91392c6964d0bdb0c3c0aae0a4a110 +Subproject commit e2b890bbaea41cbe3cbf9ae36555dfb654e1659d
diff --git a/third_party/crabbyavif/BUILD.gn b/third_party/crabbyavif/BUILD.gn index 855e6eac..d7fdceb 100644 --- a/third_party/crabbyavif/BUILD.gn +++ b/third_party/crabbyavif/BUILD.gn
@@ -162,8 +162,13 @@ "dav1d", "libyuv", "capi", + "disable_cfi", ] + # Required for disable_cfi feature. + configs -= [ "//build/config/compiler:disallow_unstable_features" ] + rustflags = [ "-Zallow-features=no_sanitize" ] + public_deps = [ ":header_files" ] deps = [ ":crabbyavif_dav1d_sys",
diff --git a/third_party/crabbyavif/src b/third_party/crabbyavif/src index a75457c..e8b91a8 160000 --- a/third_party/crabbyavif/src +++ b/third_party/crabbyavif/src
@@ -1 +1 @@ -Subproject commit a75457c637a365910508f3c2c2b986a701b03a2e +Subproject commit e8b91a8b8519ba5381ba56609a721f499fa10301
diff --git a/third_party/crossbench b/third_party/crossbench index 610824f..e1e2e04 160000 --- a/third_party/crossbench +++ b/third_party/crossbench
@@ -1 +1 @@ -Subproject commit 610824f7175a8cff107b69cfa56646f724bf9453 +Subproject commit e1e2e0403c30da1b6e3aeffd34ec33e314db94eb
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index 66bddca..acdf453 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit 66bddcab5926993be9b03ef601bb94c5c5d1ce2d +Subproject commit acdf453e69dfe33bb9134f0070b1cdbec23273b1
diff --git a/third_party/libvpx/README.chromium b/third_party/libvpx/README.chromium index 58c7e9c8..e1529d6 100644 --- a/third_party/libvpx/README.chromium +++ b/third_party/libvpx/README.chromium
@@ -1,7 +1,7 @@ Name: libvpx URL: https://chromium.googlesource.com/webm/libvpx Version: N/A -Revision: 2bfb9f9e0a9cca18cd5a0045e931b49dac390c79 +Revision: 95afae324986797afb19a606f3d95ecdf21e99a7 CPEPrefix: cpe:/a:webmproject:libvpx:1.15.0 License: BSD-3-Clause, Patent License Android Compatible: yes
diff --git a/third_party/libvpx/source/config/vpx_version.h b/third_party/libvpx/source/config/vpx_version.h index 9a7c2d5..4ec08f6 100644 --- a/third_party/libvpx/source/config/vpx_version.h +++ b/third_party/libvpx/source/config/vpx_version.h
@@ -4,9 +4,9 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 15 #define VERSION_PATCH 0 -#define VERSION_EXTRA "60-g2bfb9f9e0" +#define VERSION_EXTRA "65-g95afae324" #define VERSION_PACKED \ ((VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | (VERSION_PATCH)) -#define VERSION_STRING_NOSP "v1.15.0-60-g2bfb9f9e0" -#define VERSION_STRING " v1.15.0-60-g2bfb9f9e0" +#define VERSION_STRING_NOSP "v1.15.0-65-g95afae324" +#define VERSION_STRING " v1.15.0-65-g95afae324" #endif // VPX_VERSION_H_
diff --git a/third_party/libvpx/source/libvpx b/third_party/libvpx/source/libvpx index 2bfb9f9..95afae3 160000 --- a/third_party/libvpx/source/libvpx +++ b/third_party/libvpx/source/libvpx
@@ -1 +1 @@ -Subproject commit 2bfb9f9e0a9cca18cd5a0045e931b49dac390c79 +Subproject commit 95afae324986797afb19a606f3d95ecdf21e99a7
diff --git a/third_party/lit/v3_0/BUILD.gn b/third_party/lit/v3_0/BUILD.gn index 0fb53c2..0d86a9b9 100644 --- a/third_party/lit/v3_0/BUILD.gn +++ b/third_party/lit/v3_0/BUILD.gn
@@ -4,7 +4,6 @@ import("//tools/typescript/ts_library.gni") import("//ui/webui/resources/tools/bundle_js.gni") -import("//ui/webui/resources/tools/generate_code_cache.gni") import("//ui/webui/resources/tools/generate_grd.gni") import("//ui/webui/resources/tools/minify_js.gni") import("//ui/webui/webui_features.gni") @@ -212,9 +211,6 @@ # don't need to depend on this target. "//components/neterror/resources:bundle_js_internal", ] - if (enable_webui_generate_code_cache) { - visibility += [ ":build_code_cache" ] - } deps = [ ":build_bundle" ] in_folder = "$target_gen_dir/bundled" in_files = [ "lit.rollup.js" ] @@ -229,22 +225,3 @@ manifest_files = [ "${target_gen_dir}/build_min_js_manifest.json" ] deps = [ ":build_min_js" ] } - -if (enable_webui_generate_code_cache) { - generate_code_cache("build_code_cache") { - in_folder = "$target_gen_dir/minified" - in_files = [ "lit.rollup.js" ] - out_folder = "$target_gen_dir/code_cache" - out_manifest = "$target_gen_dir/build_code_cache_manifest.json" - - deps = [ ":build_min_js" ] - } - - generate_grd("build_code_cache_grdp") { - grd_prefix = "lit_v3_0_code_cache" - out_grd = "$target_gen_dir/code_cache_resources.grdp" - resource_path_prefix = "lit/v3_0" - manifest_files = [ "${target_gen_dir}/build_code_cache_manifest.json" ] - deps = [ ":build_code_cache" ] - } -}
diff --git a/third_party/llvm-libc/src b/third_party/llvm-libc/src index a02de4d..a35441f 160000 --- a/third_party/llvm-libc/src +++ b/third_party/llvm-libc/src
@@ -1 +1 @@ -Subproject commit a02de4d0d992b110c8b180fdec91258e7b60265f +Subproject commit a35441f9bbcc779f89ffc049ef643a6e6d1b93fe
diff --git a/third_party/skia b/third_party/skia index 15b0d75..6ca926d 160000 --- a/third_party/skia +++ b/third_party/skia
@@ -1 +1 @@ -Subproject commit 15b0d7575e642f7d577d6a9610dbd5f321fc700d +Subproject commit 6ca926db528a7c0346649495ad19457ee76461ed
diff --git a/third_party/webrtc b/third_party/webrtc index b4a81db..fa3b0a5 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit b4a81dbae4e8bc104ae982f3c7ff42ae2a7351e4 +Subproject commit fa3b0a5720d09efef183756c44c0fd2f7edeb94c
diff --git a/tools/crates/gnrt/lib/deps.rs b/tools/crates/gnrt/lib/deps.rs index 919f374..a9ddcf9 100644 --- a/tools/crates/gnrt/lib/deps.rs +++ b/tools/crates/gnrt/lib/deps.rs
@@ -6,9 +6,9 @@ use crate::config::BuildConfig; use crate::crates; +use crate::gn::{target_platform_to_condition, Condition}; use crate::group::Group; use crate::inherit::find_inherited_privilege_group; -use crate::platforms::{self, Platform, PlatformSet}; use std::collections::{hash_map::Entry, HashMap, HashSet}; use std::path::PathBuf; @@ -81,9 +81,8 @@ pub use_name: String, /// The resolved version of this dependency. pub version: Version, - /// A platform constraint for this dependency, or `None` if it's used on all - /// platforms. - pub platform: Option<Platform>, + /// A condition for using this dependency. + pub condition: Condition, } impl DepOfDep { @@ -96,8 +95,8 @@ /// test dependencies. #[derive(Clone, Debug)] pub struct PerKindInfo { - /// The set of platforms this kind is needed on. - pub platforms: PlatformSet, + /// Condition that enables the dependency. + pub condition: Condition, /// The resolved feature set for this kind. pub features: Vec<String>, } @@ -318,16 +317,11 @@ // needed for build file generation later. for node_dep in iter_node_deps(node) { let dep_pkg = dep_graph.packages.get(node_dep.pkg).unwrap(); - let mut platform = node_dep.target; - if let Some(p) = platform { - assert!(platforms::matches_supported_target(&p)); - platform = platforms::filter_unsupported_platform_terms(p); - } let dep_of_dep = DepOfDep { package_name: dep_pkg.name.clone(), use_name: node_dep.lib_name.to_string(), version: dep_pkg.version.clone(), - platform, + condition: node_dep.condition.clone(), }; match node_dep.kind { @@ -416,8 +410,8 @@ let info: &mut PerKindInfo = dep .dependency_kinds .entry(dep_edge.kind) - .or_insert(PerKindInfo { platforms: PlatformSet::empty(), features: Vec::new() }); - info.platforms.add(dep_edge.target); + .or_insert(PerKindInfo { condition: Condition::AlwaysFalse, features: Vec::new() }); + info.condition = Condition::or(info.condition.clone(), dep_edge.condition); } // Initialize the dependency entry for this node's package if it's not our @@ -431,7 +425,7 @@ pkg: &'a cargo_metadata::PackageId, lib_name: &'a str, kind: DependencyKind, - target: Option<Platform>, + condition: Condition, } /// Iterates over the dependencies of `node`, filtering out platforms we don't @@ -451,14 +445,14 @@ // See crbug.com/1393600. let mut seen = HashSet::new(); node_dep.dep_kinds.iter().filter_map(move |dep_kind_info| { + let condition = match dep_kind_info.target.as_ref() { + None => Condition::AlwaysTrue, + Some(platform) => target_platform_to_condition(platform), + }; + // Filter if it's for a platform we don't support. - match &dep_kind_info.target { - None => (), - Some(platform) => { - if !platforms::matches_supported_target(platform) { - return None; - } - } + if condition == Condition::AlwaysFalse { + return None; }; if seen.contains(&(&dep_kind_info.kind, &dep_kind_info.target)) { @@ -470,7 +464,7 @@ pkg: &node_dep.pkg, lib_name: &node_dep.name, kind: dep_kind_info.kind, - target: dep_kind_info.target.clone(), + condition, }) }) }) @@ -539,7 +533,6 @@ #[test] fn collect_dependencies_on_sample_output() { use crate::config::CrateConfig; - use std::str::FromStr; let foo_config = CrateConfig { group: Some(Group::Test), ..CrateConfig::default() }; let build_config = BuildConfig { per_crate_config: [("foo".to_string(), foo_config)].into_iter().collect(), @@ -614,7 +607,7 @@ package_name: "bar".to_string(), use_name: "baz".to_string(), version: Version::new(0, 1, 0), - platform: None, + condition: Condition::AlwaysTrue, } ); assert_eq!( @@ -623,7 +616,7 @@ package_name: "time".to_string(), use_name: "time".to_string(), version: Version::new(0, 3, 14), - platform: None, + condition: Condition::AlwaysTrue, } ); @@ -663,7 +656,7 @@ package_name: "autocfg".to_string(), use_name: "autocfg".to_string(), version: Version::new(1, 1, 0), - platform: None, + condition: Condition::AlwaysTrue, } ); assert!(dependencies[i].build_script.as_ref().is_some_and(|path| { @@ -731,7 +724,7 @@ package_name: "serde_derive".to_string(), use_name: "serde_derive".to_string(), version: Version::new(1, 0, 139), - platform: None, + condition: Condition::AlwaysTrue, } ); @@ -754,7 +747,7 @@ package_name: "proc-macro2".to_string(), use_name: "proc_macro2".to_string(), version: Version::new(1, 0, 40), - platform: None, + condition: Condition::AlwaysTrue, } ); assert_eq!( @@ -763,7 +756,7 @@ package_name: "quote".to_string(), use_name: "quote".to_string(), version: Version::new(1, 0, 20), - platform: None, + condition: Condition::AlwaysTrue, } ); assert_eq!( @@ -772,7 +765,7 @@ package_name: "syn".to_string(), use_name: "syn".to_string(), version: Version::new(1, 0, 98), - platform: None, + condition: Condition::AlwaysTrue, } ); @@ -794,7 +787,7 @@ package_name: "proc-macro2".to_string(), use_name: "proc_macro2".to_string(), version: Version::new(1, 0, 40), - platform: None, + condition: Condition::AlwaysTrue, } ); assert_eq!( @@ -803,7 +796,7 @@ package_name: "quote".to_string(), use_name: "quote".to_string(), version: Version::new(1, 0, 20), - platform: None, + condition: Condition::AlwaysTrue, } ); assert_eq!( @@ -812,7 +805,7 @@ package_name: "unicode-ident".to_string(), use_name: "unicode_ident".to_string(), version: Version::new(1, 0, 1), - platform: None, + condition: Condition::AlwaysTrue, } ); @@ -834,7 +827,7 @@ package_name: "winapi-util".to_string(), use_name: "winapi_util".to_string(), version: Version::new(0, 1, 5), - platform: Some(Platform::from_str("cfg(windows)").unwrap()), + condition: Condition::Expr("is_win".to_string()), } ); @@ -855,7 +848,7 @@ package_name: "libc".to_string(), use_name: "libc".to_string(), version: Version::new(0, 2, 133), - platform: Some(Platform::from_str("cfg(target_family = \"unix\")").unwrap()), + condition: Condition::Expr("!is_win".to_string()), } ); assert_eq!( @@ -864,7 +857,7 @@ package_name: "num_threads".to_string(), use_name: "num_threads".to_string(), version: Version::new(0, 1, 6), - platform: Some(Platform::from_str("cfg(target_family = \"unix\")").unwrap()), + condition: Condition::Expr("!is_win".to_string()), } ); @@ -902,12 +895,11 @@ i += 1; - let win_platform = Platform::from_str("cfg(windows)").unwrap(); assert_eq!(dependencies[i].package_name, "winapi-util"); assert_eq!(dependencies[i].version, Version::new(0, 1, 5)); assert!(dependencies[i].dependency_kinds.get(&DependencyKind::Normal).is_some_and(|d| { assert_eq!(d.features, empty_str_slice); - assert_eq!(d.platforms, PlatformSet::one(Some(win_platform.clone()))); + assert_eq!(d.condition, Condition::Expr("is_win".to_string())); true })); assert_eq!(dependencies[i].dependencies.len(), 1); @@ -919,7 +911,7 @@ package_name: "winapi".to_string(), use_name: "winapi".to_string(), version: Version::new(0, 3, 9), - platform: Some(win_platform.clone()), + condition: Condition::Expr("is_win".to_string()), } );
diff --git a/tools/crates/gnrt/lib/gn.rs b/tools/crates/gnrt/lib/gn.rs index 06ca0a9e..101360d 100644 --- a/tools/crates/gnrt/lib/gn.rs +++ b/tools/crates/gnrt/lib/gn.rs
@@ -10,12 +10,11 @@ use crate::deps::{self, DepOfDep}; use crate::group::Group; use crate::paths; -use crate::platforms; use std::collections::{HashMap, HashSet}; use std::ops::Deref; -use anyhow::{bail, Result}; +use anyhow::{anyhow, bail, Context, Result}; use itertools::Itertools; use serde::Serialize; @@ -95,7 +94,7 @@ #[derive(Clone, Debug, Serialize)] pub struct DepGroup { /// `if` condition for GN, or `None` for unconditional deps. - cond: Option<Condition>, + cond: Option<String>, /// Packages to depend on. The build file template determines the exact name /// based on the identified package and context. packages: Vec<PackageId>, @@ -223,7 +222,7 @@ NameLibStyle::LibLiteral => Some(Epoch::from_version(&d.version).to_string()), NameLibStyle::PackageName => None, }, - }); + })?; detail_template.build_deps = group_deps(&build_deps, |d| PackageId { name: NormalizedName::from_crate_name(&d.package_name).to_string(), epoch: match name_lib_style { @@ -231,7 +230,7 @@ NameLibStyle::LibLiteral => Some(Epoch::from_version(&d.version).to_string()), NameLibStyle::PackageName => None, }, - }); + })?; detail_template.aliased_deps = aliased_normal_deps; detail_template.sources = @@ -409,11 +408,18 @@ /// If the returned list is non-empty, it will always have a group without a /// condition, even if that group is empty. If there are no dependencies, then /// the returned list is empty. -fn group_deps(deps: &[&DepOfDep], target_name: impl Fn(&DepOfDep) -> PackageId) -> Vec<DepGroup> { - let mut groups = HashMap::<Option<Condition>, Vec<_>>::new(); +fn group_deps( + deps: &[&DepOfDep], + target_name: impl Fn(&DepOfDep) -> PackageId, +) -> Result<Vec<DepGroup>> { + let mut groups = HashMap::<Option<String>, Vec<_>>::new(); for dep in deps { - let cond = dep.platform.as_ref().map(platform_to_condition); - + let cond = dep.condition.to_handlebars_value().with_context(|| { + format!( + "Error processing condition of the following dependency: `{}`", + dep.package_name + ) + })?; groups.entry(cond).or_default().push(target_name(dep)); } @@ -422,91 +428,175 @@ } let mut groups: Vec<DepGroup> = - groups.into_iter().map(|(cond, rules)| DepGroup { cond, packages: rules }).collect(); + groups.into_iter().map(|(cond, packages)| DepGroup { cond, packages }).collect(); for group in groups.iter_mut() { group.packages.sort_unstable(); } groups.sort_unstable_by(|l, r| l.cond.cmp(&r.cond)); - groups + Ok(groups) } /// Describes a condition for some GN declaration. #[derive(Clone, Debug, Hash, Eq, Ord, PartialEq, PartialOrd, Serialize)] -pub struct Condition(pub String); +pub enum Condition { + /// The condition is always false. In other words, supported Chromium + /// builds never meet this condition. + /// + /// Example: `#[cfg(target_arch = "powerpc")]`. + AlwaysFalse, + /// The condition is always true. + /// + /// Example: `#[cfg(not(target_arch = "powerpc"))]`. + AlwaysTrue, + /// Ignored terms. For example we ignore `target_abi` and assume that + /// `target_env` is sufficient for picking the right dependencies. + Ignored, + /// The condition requires evaluating the nested GN expression. + /// The `String` payload is the condition expressed in GN syntax (e.g. + /// `is_win`). + /// + /// For example `#[cfg(target_os = "windows")]` translates into + /// `Condition::Expr("is_win".to_string())`. + Expr(String), + /// + /// Some of the [conditional + /// compilation](https://doc.rust-lang.org/reference/conditional-compilation.html) directives + /// weren't recognized by `gnrt`. + /// + /// The `String` is an error message. + /// + /// In some cases such terms will "disappear" - e.g. `unknown_cfg && + /// always_false` is the same as `always_false`. When these terms do + /// not disappear, then it may mean that supporting a new crate would + /// require teaching `gnrt` about the new kinds of configuration. + Unsupported(String), +} impl Condition { - pub fn from_platform_set(platforms: platforms::PlatformSet) -> Option<Self> { - let platforms = match platforms { - platforms::PlatformSet::All => return None, - platforms::PlatformSet::Platforms(platforms) => platforms, - }; + pub fn or(lhs: Condition, rhs: Condition) -> Self { + match (lhs, rhs) { + (Condition::AlwaysFalse, other) | (other, Condition::AlwaysFalse) => other.clone(), + (Condition::AlwaysTrue, _) | (_, Condition::AlwaysTrue) => Condition::AlwaysTrue, + (Condition::Ignored, other) | (other, Condition::Ignored) => other.clone(), + (Condition::Expr(lhs), Condition::Expr(rhs)) => { + Condition::Expr(format!("({lhs}) || ({rhs})")) + } + (err @ Condition::Unsupported(_), _) | (_, err @ Condition::Unsupported(_)) => { + err.clone() + } + } + } - Some(Condition( - platforms - .iter() - .map(|p| format!("({})", platform_to_condition(p).0)) - .collect::<Vec<_>>() - .join(" || "), - )) + fn and(lhs: Condition, rhs: Condition) -> Self { + match (lhs, rhs) { + (Condition::AlwaysFalse, _) | (_, Condition::AlwaysFalse) => Condition::AlwaysFalse, + (Condition::AlwaysTrue, other) | (other, Condition::AlwaysTrue) => other, + (Condition::Ignored, other) | (other, Condition::Ignored) => other, + (Condition::Expr(lhs), Condition::Expr(rhs)) => { + Condition::Expr(format!("({lhs}) && ({rhs})")) + } + (err @ Condition::Unsupported(_), _) | (_, err @ Condition::Unsupported(_)) => err, + } + } + + fn not(other: Condition) -> Self { + match other { + Condition::AlwaysFalse => Condition::AlwaysTrue, + Condition::AlwaysTrue => Condition::AlwaysFalse, + Condition::Ignored => Condition::Ignored, + Condition::Expr(expr) => Condition::Expr(format!("!({expr})")), + err @ Condition::Unsupported(_) => err, + } + } + + fn to_handlebars_value(&self) -> Result<Option<String>> { + match self { + Condition::AlwaysTrue | Condition::Ignored => Ok(None), + Condition::Expr(expr) => Ok(Some(expr.clone())), + Condition::AlwaysFalse => unreachable!( + "AlwaysFalse dependencies should be filtered out \ + by `fn collect_dependencies` from `deps.rs`" + ), + Condition::Unsupported(err) => { + Err(anyhow!("{err}") + .context("Failed to translate `#[cfg(...)]` into a GN condition")) + } + } } } -/// Map a cargo `Platform` constraint to a GN conditional expression. -pub fn platform_to_condition(platform: &platforms::Platform) -> Condition { - Condition(match platform { - platforms::Platform::Name(triple) => triple_to_condition(triple).to_string(), - platforms::Platform::Cfg(cfg_expr) => cfg_expr_to_condition(cfg_expr), - }) +pub fn target_platform_to_condition(spec: &cargo_platform::Platform) -> Condition { + use cargo_platform::Platform::*; + match spec { + Name(triple) => triple_to_condition(triple.as_str()), + Cfg(cfg_expr) => cfg_expr_to_condition(cfg_expr), + } } -pub fn cfg_expr_to_condition(cfg_expr: &cargo_platform::CfgExpr) -> String { +fn cfg_expr_to_condition(cfg_expr: &cargo_platform::CfgExpr) -> Condition { match cfg_expr { - cargo_platform::CfgExpr::Not(expr) => { - format!("!({})", cfg_expr_to_condition(expr)) - } + cargo_platform::CfgExpr::Not(expr) => Condition::not(cfg_expr_to_condition(expr)), cargo_platform::CfgExpr::All(exprs) => { - let mut conds = exprs - .iter() - .map(|expr| format!("({})", cfg_expr_to_condition(expr))) - .collect::<Vec<String>>(); + let mut conds = exprs.iter().map(cfg_expr_to_condition).collect::<Vec<_>>(); conds.sort(); conds.dedup(); - conds.join(" && ") + + // https://doc.rust-lang.org/reference/conditional-compilation.html#r-cfg.predicate.all + // says that "It is true if "all of the given predicates are true, or if the + // list is empty." + conds.into_iter().fold(Condition::AlwaysTrue, |accumulated, condition| { + Condition::and(accumulated, condition) + }) } cargo_platform::CfgExpr::Any(exprs) => { - let mut conds = exprs - .iter() - .map(|expr| format!("({})", cfg_expr_to_condition(expr))) - .collect::<Vec<String>>(); + let mut conds = exprs.iter().map(cfg_expr_to_condition).collect::<Vec<_>>(); conds.sort(); conds.dedup(); - conds.join(" || ") + + // https://doc.rust-lang.org/reference/conditional-compilation.html#r-cfg.predicate.any + // says that "It is true if at least one of the given predicates is true. If + // there are no predicates, it is false.". + conds.into_iter().fold(Condition::AlwaysFalse, |accumulated, condition| { + Condition::or(accumulated, condition) + }) } cargo_platform::CfgExpr::Value(cfg) => cfg_to_condition(cfg), } } -pub fn cfg_to_condition(cfg: &cargo_platform::Cfg) -> String { +fn cfg_to_condition(cfg: &cargo_platform::Cfg) -> Condition { match cfg { - cargo_platform::Cfg::Name(name) => match name.as_str() { - // Note that while Fuchsia is not a unix, rustc sets the unix cfg - // anyway. We must be consistent with rustc. This may change with - // https://github.com/rust-lang/rust/issues/58590 - "unix" => "!is_win", - "windows" => "is_win", - _ => unreachable!(), - }, + cargo_platform::Cfg::Name(name) => cfg_name_to_condition(name), cargo_platform::Cfg::KeyPair(key, value) => match key.as_ref() { - "target_os" => target_os_to_condition(value), + "target_abi" => Condition::Ignored, "target_arch" => target_arch_to_condition(value), - _ => unreachable!("unknown key in cargo_platform::Cfg"), + "target_env" => target_env_to_condition(value), + "target_family" => target_family_to_condition(value), + "target_os" => target_os_to_condition(value), + "target_vendor" => target_vendor_to_condition(value), + _ => Condition::Unsupported(format!("Unknown key `{key}` in `{cfg}`")), }, } - .to_string() } -fn triple_to_condition(triple: &str) -> &'static str { +/// `name` should correspond to https://doc.rust-lang.org/reference/conditional-compilation.html#r-cfg.option-name +fn cfg_name_to_condition(name: &str) -> Condition { + const FAMILY_NAMES: [&str; 2] = ["unix", "windows"]; + if FAMILY_NAMES.contains(&name) { + return target_family_to_condition(name); + } + + // We don't support `windows_raw_dylib` in Chromium. See also + // https://github.com/rust-lang/rust/issues/58713 + if ["windows_raw_dylib"].contains(&name) { + return Condition::AlwaysFalse; + } + + Condition::Unsupported(format!("unknown option name: `#[cfg({name})]`")) +} + +fn triple_to_condition(triple: &str) -> Condition { for (t, c) in &[ ("i686-linux-android", "is_android && current_cpu == \"x86\""), ("x86_64-linux-android", "is_android && current_cpu == \"x64\""), @@ -526,14 +616,84 @@ ("aarch64-apple-darwin", "is_mac && current_cpu == \"arm64\""), ] { if *t == triple { - return c; + return Condition::Expr(c.to_string()); } } - panic!("target triple {triple} not found") + // Other target triples are never used in Chromium builds. + Condition::AlwaysFalse } -fn target_os_to_condition(target_os: &str) -> &'static str { +/// `target_arch` should correspond to https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch +fn target_arch_to_condition(target_arch: &str) -> Condition { + for (t, c) in &[ + ("aarch64", "current_cpu == \"arm64\""), + ("arm", "current_cpu == \"arm\""), + ("x86", "current_cpu == \"x86\""), + ("x86_64", "current_cpu == \"x64\""), + ] { + if *t == target_arch { + return Condition::Expr(c.to_string()); + } + } + + // Other `target_arch` values are never used in Chromium builds. + // Examples: "mipc", "powerpc". + Condition::AlwaysFalse +} + +/// `target_env` should correspond to https://doc.rust-lang.org/reference/conditional-compilation.html#target_env +fn target_env_to_condition(target_env: &str) -> Condition { + for (t, c) in &[ + // Based on `triple_to_condition` `msvc` is the only supported environment + // on Windows. + // + // TODO(lukasza): Would returning `Condition::Expr("is_win")` be more correct? + ("msvc", Condition::AlwaysTrue), + // Treating `gnu` as `AlwaysFalse`, because: + // + // * This is how `gnrt` worked in the past + // * This helps to filter out packages like `windows_i686_gnu` (this is desirable, because + // Chromium only supports `msvc` environment on Windows. + // + // OTOH, maybe this is not quite right, because Chromium also supports triples like + // "i686-unknown-linux-gnu". + // + // TODO(lukasza): Would returning `Condition::Expr("is_linux || is_chromeos")` be more + // correct? + ("gnu", Condition::AlwaysFalse), + // `sgx` is used as condition in `dlmalloc` package in `std` library. + ("sgx", Condition::AlwaysFalse), + ] { + if *t == target_env { + return c.clone(); + } + } + + Condition::Unsupported(format!("unknown `target_env` value: `{target_env}`")) +} + +/// `target_family` should correspond to https://doc.rust-lang.org/reference/conditional-compilation.html#target_family +fn target_family_to_condition(target_family: &str) -> Condition { + for (t, c) in &[ + // Note that while Fuchsia is not a unix, rustc sets the unix cfg + // anyway. We must be consistent with rustc. This may change with + // https://github.com/rust-lang/rust/issues/58590 + ("unix", "!is_win"), + ("windows", "is_win"), + ] { + if *t == target_family { + return Condition::Expr(c.to_string()); + } + } + + // Other `target_family` values are never used in Chromium builds. + // Example: "wasm". + Condition::AlwaysFalse +} + +/// `target_os` should correspond to https://doc.rust-lang.org/reference/conditional-compilation.html#target_os +fn target_os_to_condition(target_os: &str) -> Condition { for (t, c) in &[ ("android", "is_android"), ("darwin", "is_mac"), @@ -543,98 +703,103 @@ ("windows", "is_win"), ] { if *t == target_os { - return c; + return Condition::Expr(c.to_string()); } } - panic!("target os {target_os} not found") + // Other `target_os` values are never used in Chromium builds. + // Examples: "freebsd", "macos" (not sure why "darwin" is preferred...). + Condition::AlwaysFalse } -fn target_arch_to_condition(target_arch: &str) -> &'static str { - for (t, c) in &[ - ("aarch64", "current_cpu == \"arm64\""), - ("arm", "current_cpu == \"arm\""), - ("x86", "current_cpu == \"x86\""), - ("x86_64", "current_cpu == \"x64\""), - ] { - if *t == target_arch { - return c; - } +/// `target_vendor` should correspond to https://doc.rust-lang.org/reference/conditional-compilation.html#target_vendor +fn target_vendor_to_condition(target_vendor: &str) -> Condition { + const UNSUPPORTED_VENDORS: [&str; 2] = [ + "fortanix", // Used as condition in `dlmalloc` package used in `std` library. + "uwp", // Used as condition in some `windows...` crates. + ]; + if UNSUPPORTED_VENDORS.contains(&target_vendor) { + return Condition::AlwaysFalse; } - panic!("target arch {target_arch} not found") + Condition::Unsupported(format!("unknown `target_vendor` name: `{target_vendor}`")) } #[cfg(test)] mod tests { use super::*; + fn condition_from_test_triple(triple: &str) -> Condition { + let platform = cargo_platform::Platform::Name(triple.to_string()); + target_platform_to_condition(&platform) + } + + fn condition_from_test_expr(expr: &str) -> Condition { + let platform = + cargo_platform::Platform::Cfg(expr.parse::<cargo_platform::CfgExpr>().unwrap()); + target_platform_to_condition(&platform) + } + #[test] - fn platform_to_condition() { - use crate::platforms::{Platform, PlatformSet}; - use cargo_platform::CfgExpr; - use std::str::FromStr; - - // Try an unconditional filter. - assert_eq!(Condition::from_platform_set(PlatformSet::one(None)), None); - + fn test_target_spec_to_condition() { // Try a target triple. assert_eq!( - Condition::from_platform_set(PlatformSet::one(Some(Platform::Name( - "x86_64-pc-windows-msvc".to_string() - )))) - .unwrap() - .0, - "(is_win && current_cpu == \"x64\")" + condition_from_test_triple("x86_64-pc-windows-msvc"), + Condition::Expr("is_win && current_cpu == \"x64\"".to_string()), ); // Try a cfg expression. assert_eq!( - Condition::from_platform_set(PlatformSet::one(Some(Platform::Cfg( - CfgExpr::from_str("any(windows, target_os = \"android\")").unwrap() - )))) - .unwrap() - .0, - "((is_android) || (is_win))" + condition_from_test_expr("any(windows, target_os = \"android\")"), + Condition::Expr("(is_android) || (is_win)".to_string()), ); // Redundant cfg expression. assert_eq!( - Condition::from_platform_set(PlatformSet::one(Some(Platform::Cfg( - CfgExpr::from_str("any(windows, windows)").unwrap() - )))) - .unwrap() - .0, - "((is_win))" + condition_from_test_expr("any(windows, windows)"), + Condition::Expr("is_win".to_string()), ); // Try a PlatformSet with multiple filters. - let mut platform_set = PlatformSet::empty(); - platform_set.add(Some(Platform::Name("armv7-linux-android".to_string()))); - platform_set.add(Some(Platform::Cfg(CfgExpr::from_str("windows").unwrap()))); + let filter1 = condition_from_test_triple("armv7-linux-android"); + let filter2 = condition_from_test_expr("windows"); assert_eq!( - Condition::from_platform_set(platform_set).unwrap().0, - "(is_android && current_cpu == \"arm\") || (is_win)" + Condition::or(filter1, filter2), + Condition::Expr("(is_android && current_cpu == \"arm\") || (is_win)".to_string()), ); // A cfg expression on arch only. assert_eq!( - Condition::from_platform_set(PlatformSet::one(Some(Platform::Cfg( - CfgExpr::from_str("target_arch = \"aarch64\"").unwrap() - )))) - .unwrap() - .0, - "(current_cpu == \"arm64\")" + condition_from_test_expr("target_arch = \"aarch64\""), + Condition::Expr("current_cpu == \"arm64\"".to_string()), ); // A cfg expression on arch and OS (but not via the target triple string). assert_eq!( - Condition::from_platform_set(PlatformSet::one(Some(Platform::Cfg( - CfgExpr::from_str("all(target_arch = \"aarch64\", unix)").unwrap() - )))) - .unwrap() - .0, - "((!is_win) && (current_cpu == \"arm64\"))" + condition_from_test_expr("all(target_arch = \"aarch64\", unix)"), + Condition::Expr("(!is_win) && (current_cpu == \"arm64\")".to_string()), + ); + + // A cfg expression taken from `windows_aarch64_msvc` package. + assert_eq!( + condition_from_test_expr( + "all(any(target_arch = \"x86_64\", target_arch = \"arm64ec\"), \ + target_env = \"msvc\", \ + not(windows_raw_dylib))" + ), + Condition::Expr("current_cpu == \"x64\"".to_string()), + ); + + // A cfg expression taken from `windows-targets` => `windows_i686_gnu` + // dependency. + assert_eq!( + condition_from_test_expr( + "all(target_arch = \"x86\", \ + target_env = \"gnu\", \ + not(target_abi = \"llvm\"), \ + not(windows_raw_dylib))" + ), + Condition::AlwaysFalse, ); } }
diff --git a/tools/crates/gnrt/lib/lib.rs b/tools/crates/gnrt/lib/lib.rs index 2d98d5b8..051adbc 100644 --- a/tools/crates/gnrt/lib/lib.rs +++ b/tools/crates/gnrt/lib/lib.rs
@@ -14,7 +14,6 @@ pub mod manifest; pub mod metadata_util; pub mod paths; -pub mod platforms; pub mod readme; pub mod util; pub mod vet;
diff --git a/tools/crates/gnrt/lib/platforms.rs b/tools/crates/gnrt/lib/platforms.rs deleted file mode 100644 index cc6fe6e2..0000000 --- a/tools/crates/gnrt/lib/platforms.rs +++ /dev/null
@@ -1,458 +0,0 @@ -// Copyright 2022 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -//! Maps Rust targets to Chromium targets. - -use std::collections::BTreeSet; - -use cargo_platform::{Cfg, CfgExpr}; -use once_cell::sync::OnceCell; - -pub use cargo_platform::Platform; - -/// A set of platforms: either the set of all platforms, or a finite set of -/// platform configurations. -#[derive(Clone, Debug, Eq, PartialEq)] -pub enum PlatformSet { - /// Matches any platform configuration. - All, - /// Matches a finite set of configurations. - // Note we use a `BTreeSet` because stable iteration order is desired when - // generating build files. - Platforms(BTreeSet<Platform>), -} - -impl PlatformSet { - /// A `PlatformSet` that matches no platforms. Useful as a starting point - /// when iteratively adding platforms with `add`. - pub fn empty() -> Self { - Self::Platforms(BTreeSet::new()) - } - - /// A `PlatformSet` that matches one platform filter. - #[cfg(test)] - pub fn one(filter: Option<Platform>) -> Self { - let mut ps = Self::empty(); - ps.add(filter); - ps - } - - /// Add a single platform filter to `self`. The resulting set is superset of - /// the original. If `filter` is `None`, `self` becomes `PlatformSet::All`. - pub fn add(&mut self, filter: Option<Platform>) { - let set = match self { - // If the set is already all platforms, no need to add `filter`. - Self::All => return, - Self::Platforms(set) => set, - }; - - match filter { - None => *self = Self::All, - Some(platform) => { - set.insert(platform); - } - } - } -} - -// Whether a CfgExpr matches any build target supported by Chromium. -fn supported_cfg_expr(e: &CfgExpr) -> bool { - fn validity_can_be_true(v: ExprValidity) -> bool { - match v { - ExprValidity::Valid => true, - ExprValidity::AlwaysTrue => true, - ExprValidity::AlwaysFalse => false, - } - } - fn recurse(e: &CfgExpr) -> ExprValidity { - match e { - CfgExpr::All(x) => { - if x.iter().all(|e| validity_can_be_true(recurse(e))) { - // TODO(danakj): We don't combine to anything fancy. - // Technically, if they are all AlwaysTrue it should combine - // as such, and then it could be inverted to AlwaysFalse. - ExprValidity::Valid - } else { - ExprValidity::AlwaysFalse - } - } - CfgExpr::Any(x) => { - if x.iter().any(|e| validity_can_be_true(recurse(e))) { - // TODO(danakj): We don't combine to anything fancy. - // Technically, if anything is AlwaysTrue it should combine - // as such, and then it could be inverted to AlwaysFalse. - ExprValidity::Valid - } else { - ExprValidity::AlwaysFalse - } - } - CfgExpr::Not(x) => match recurse(x) { - ExprValidity::AlwaysFalse => ExprValidity::AlwaysTrue, - ExprValidity::Valid => ExprValidity::Valid, - ExprValidity::AlwaysTrue => ExprValidity::AlwaysFalse, - }, - CfgExpr::Value(v) => supported_cfg_value(v), - } - } - validity_can_be_true(recurse(e)) -} - -// If a Cfg option is always true/false in Chromium, or needs to be conditional -// in the build file's rules. -fn supported_cfg_value(cfg: &Cfg) -> ExprValidity { - if supported_os_cfgs().contains(cfg) - || supported_arch_cfgs().contains(cfg) - || supported_family_cfgs().contains(cfg) - { - // OS and Arch are always conditional, as we support more than one. - ExprValidity::Valid - } else { - // Other configs may resolve to AlwaysTrue or AlwaysFalse. If it's - // unknown, we treat it as AlwaysFalse since we don't know how to - // convert it to a build file condition. - supported_other_cfgs() - .iter() - .find(|(c, _)| c == cfg) - .map(|(_, validity)| *validity) - .unwrap_or(ExprValidity::AlwaysFalse) - } -} - -/// Whether `platform`, either an explicit rustc target triple or a `cfg(...)` -/// expression, matches any build target supported by Chromium. -pub fn matches_supported_target(platform: &Platform) -> bool { - match platform { - Platform::Name(name) => SUPPORTED_NAMED_PLATFORMS.iter().any(|p| *p == name), - Platform::Cfg(expr) => supported_cfg_expr(expr), - } -} - -/// Remove terms containing unsupported platforms from `platform`, assuming -/// `matches_supported_target(&platform)` is true. -/// -/// `platform` may contain a cfg(...) expression referencing platforms we don't -/// support: for example, `cfg(any(unix, target_os = "wasi"))`. However, such an -/// expression may still be true on configurations we do support. -/// -/// `filter_unsupported_platform_terms` returns a new platform filter without -/// unsupported terms that is logically equivalent for the set of platforms we -/// do support, or `None` if the new filter would be true for all supported -/// platforms. This is useful when generating conditional expressions in build -/// files from such a cfg(...) expression. -/// -/// Assumes `matches_supported_target(&platform)` is true. If not, the function -/// may return an invalid result or panic. -pub fn filter_unsupported_platform_terms(platform: Platform) -> Option<Platform> { - use ExprValidity::*; - match platform { - // If it's a target name, do nothing since `is_supported` is true. - x @ Platform::Name(_) => Some(x), - // Rewrite `cfg_expr` to be valid. - Platform::Cfg(mut cfg_expr) => match cfg_expr_filter_visitor(&mut cfg_expr) { - Valid => Some(Platform::Cfg(cfg_expr)), - AlwaysTrue => None, - AlwaysFalse => unreachable!("cfg would be false on all supported platforms"), - }, - } -} - -// The validity of a cfg expr for our set of supported platforms. -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -enum ExprValidity { - // Contains only terms for supported platforms. - Valid, - // Contains terms for unsupported platforms, and would evaluate to true on - // all supported platforms. - AlwaysTrue, - // Contains terms for unsupported platforms, and would evaluate to false on - // all supported platforms. - AlwaysFalse, -} - -// Rewrites `cfg_expr` to exclude unsupported terms. `ExprValidity::Valid` if -// the rewritten expr is valid: it contains no unsupported terms. Otherwise -// returns `AlwaysTrue` or `AlwaysFalse`. -fn cfg_expr_filter_visitor(cfg_expr: &mut CfgExpr) -> ExprValidity { - use ExprValidity::*; - // Any logical operation on a set of valid expressions also yields a valid - // expression. If any of the set is invalid, we must apply special handling - // to remove the invalid term or decide the expression is always true or - // false. - match cfg_expr { - // A not(...) expr inverts the truth value of an invalid expr. - CfgExpr::Not(sub_expr) => match cfg_expr_filter_visitor(sub_expr) { - Valid => Valid, - AlwaysTrue => AlwaysFalse, - AlwaysFalse => AlwaysTrue, - }, - // An all(...) expr is always false if any term is always false. If any - // term is always true, it can be removed. - CfgExpr::All(sub_exprs) => { - let mut validity = Valid; - sub_exprs.retain_mut(|e| match cfg_expr_filter_visitor(e) { - // Keep valid terms. - Valid => true, - // Remove always-true terms. - AlwaysTrue => false, - // If a term is always false, it doesn't matter; we will discard - // this expr. - AlwaysFalse => { - validity = AlwaysFalse; - true - } - }); - if validity == AlwaysFalse { - AlwaysFalse - } else if sub_exprs.is_empty() { - // We only reach this if all the terms we removed were always - // true, in which case the expression is always true. - AlwaysTrue - } else if sub_exprs.len() == 1 { - // If only one term remains, we can simplify by replacing - // all(<term>) with <term>. - let new_expr = sub_exprs.drain(..).next().unwrap(); - *cfg_expr = new_expr; - Valid - } else { - Valid - } - } - // An any(...) expr is always true if any term is always true. If any - // term is always false, it can be removed. - CfgExpr::Any(sub_exprs) => { - let mut validity = Valid; - sub_exprs.retain_mut(|e| match cfg_expr_filter_visitor(e) { - // Keep valid terms. - Valid => true, - // If a term is always true, it doesn't matter; we will discard - // this expr. - AlwaysTrue => { - validity = AlwaysTrue; - true - } - // Remove always-false terms. - AlwaysFalse => false, - }); - if validity == AlwaysTrue { - AlwaysTrue - } else if sub_exprs.is_empty() { - // We only reach this if all the terms we removed were always - // false, in which case the expression is always false. - AlwaysFalse - } else if sub_exprs.len() == 1 { - // If only one term remains, we can simplify by replacing - // any(<term>) with <term>. - let new_expr = sub_exprs.drain(..).next().unwrap(); - *cfg_expr = new_expr; - Valid - } else { - Valid - } - } - CfgExpr::Value(cfg) => supported_cfg_value(cfg), - } -} - -fn supported_os_cfgs() -> &'static [Cfg] { - static CFG_SET: OnceCell<Vec<Cfg>> = OnceCell::new(); - CFG_SET.get_or_init(|| { - [ - // Set of supported OSes for `cfg(target_os = ...)`. - "android", "darwin", "fuchsia", "ios", "linux", "windows", - ] - .into_iter() - .map(|os| Cfg::KeyPair("target_os".to_string(), os.to_string())) - .chain( - // Alternative syntax `cfg(unix)` or `cfg(windows)`. - ["unix", "windows"].into_iter().map(|os| Cfg::Name(os.to_string())), - ) - .collect() - }) -} - -fn supported_arch_cfgs() -> &'static [Cfg] { - static CFG_SET: OnceCell<Vec<Cfg>> = OnceCell::new(); - CFG_SET.get_or_init(|| { - [ - // Set of supported arches for `cfg(target_arch = ...)`. - "aarch64", "arm", "x86", "x86_64", - ] - .into_iter() - .map(|a| Cfg::KeyPair("target_arch".to_string(), a.to_string())) - .collect() - }) -} - -fn supported_family_cfgs() -> &'static [Cfg] { - static CFG_SET: OnceCell<Vec<Cfg>> = OnceCell::new(); - CFG_SET.get_or_init(|| { - [ - // Set of supported families for `cfg(target_family = ...)`. - "unix", "windows", - ] - .into_iter() - .map(|a| Cfg::KeyPair("target_family".to_string(), a.to_string())) - .collect() - }) -} - -fn supported_other_cfgs() -> &'static [(Cfg, ExprValidity)] { - static CFG_SET: OnceCell<Vec<(Cfg, ExprValidity)>> = OnceCell::new(); - CFG_SET.get_or_init(|| { - use ExprValidity::*; - vec![ - // target_env = "msvc" is always true for us, so it can be dropped from expressions. - (Cfg::KeyPair("target_env".to_string(), "msvc".to_string()), AlwaysTrue), - ] - }) -} - -static SUPPORTED_NAMED_PLATFORMS: &[&str] = &[ - "i686-linux-android", - "x86_64-linux-android", - "armv7-linux-android", - "aarch64-linux-android", - "aarch64-fuchsia", - "x86_64-fuchsia", - "aarch64-apple-ios", - "aarch64-apple-ios-macabi", - "armv7-apple-ios", - "x86_64-apple-ios", - "x86_64-apple-ios-macabi", - "i386-apple-ios", - "i686-pc-windows-msvc", - "x86_64-pc-windows-msvc", - "i686-unknown-linux-gnu", - "x86_64-unknown-linux-gnu", - "x86_64-apple-darwin", - "aarch64-apple-darwin", -]; - -#[cfg(test)] -mod tests { - use super::*; - use cargo_platform::{CfgExpr, Platform}; - use std::str::FromStr; - - #[test] - fn platform_is_supported() { - for named_platform in SUPPORTED_NAMED_PLATFORMS { - assert!(matches_supported_target(&Platform::Name(named_platform.to_string()))); - } - - assert!(!matches_supported_target(&Platform::Name("x86_64-unknown-redox".to_string()))); - assert!(!matches_supported_target(&Platform::Name("wasm32-wasi".to_string()))); - - for os in supported_os_cfgs() { - assert!(matches_supported_target(&Platform::Cfg(CfgExpr::Value(os.clone())))); - } - - assert!(!matches_supported_target(&Platform::Cfg( - CfgExpr::from_str("target_os = \"redox\"").unwrap() - ))); - assert!(!matches_supported_target(&Platform::Cfg( - CfgExpr::from_str("target_os = \"haiku\"").unwrap() - ))); - - assert!(matches_supported_target(&Platform::Cfg( - CfgExpr::from_str("any(unix, target_os = \"wasi\")").unwrap() - ))); - - assert!(!matches_supported_target(&Platform::Cfg( - CfgExpr::from_str("all(unix, target_os = \"wasi\")").unwrap() - ))); - - for arch in supported_arch_cfgs() { - assert!(matches_supported_target(&Platform::Cfg(CfgExpr::Value(arch.clone())))); - } - - assert!(!matches_supported_target(&Platform::Cfg( - CfgExpr::from_str("target_arch = \"sparc\"").unwrap() - ))); - - assert!(matches_supported_target(&Platform::Cfg( - CfgExpr::from_str("not(windows)").unwrap() - ))); - } - - #[test] - fn filter_unsupported() { - assert_eq!( - filter_unsupported_platform_terms(Platform::Cfg( - CfgExpr::from_str("any(unix, target_os = \"wasi\")").unwrap() - )), - Some(Platform::Cfg(CfgExpr::from_str("unix").unwrap())) - ); - - assert_eq!( - filter_unsupported_platform_terms(Platform::Cfg( - CfgExpr::from_str("all(not(unix), not(target_os = \"wasi\"))").unwrap() - )), - Some(Platform::Cfg(CfgExpr::from_str("not(unix)").unwrap())) - ); - - assert_eq!( - filter_unsupported_platform_terms(Platform::Cfg( - CfgExpr::from_str("not(target_os = \"wasi\")").unwrap() - )), - None - ); - - assert_eq!( - filter_unsupported_platform_terms(Platform::Cfg( - CfgExpr::from_str("not(all(windows, target_vendor = \"uwp\"))").unwrap() - )), - None - ); - - assert_eq!( - filter_unsupported_platform_terms(Platform::Cfg( - CfgExpr::from_str("not(all(windows, target_env = \"msvc\"))").unwrap() - )), - Some(Platform::Cfg(CfgExpr::from_str("not(windows)").unwrap())) - ); - - assert_eq!( - filter_unsupported_platform_terms(Platform::Cfg( - CfgExpr::from_str( - "not(all(windows, target_env = \"msvc\", not(target_vendor = \"uwp\")))" - ) - .unwrap() - )), - Some(Platform::Cfg(CfgExpr::from_str("not(windows)").unwrap())) - ); - } - - #[test] - // From windows-targets crate. - fn windows_target_cfgs() { - // Accepted. `windows_raw_dylib` is not a known cfg so considered AlwaysFalse. - let cfg = "all(target_arch = \"aarch64\", target_env = \"msvc\", not(windows_raw_dylib))"; - assert_eq!( - filter_unsupported_platform_terms(Platform::Cfg(CfgExpr::from_str(cfg).unwrap())), - Some(Platform::Cfg(CfgExpr::from_str("target_arch = \"aarch64\"").unwrap())) - ); - assert!(matches_supported_target(&Platform::Cfg(CfgExpr::from_str(cfg).unwrap()))); - - // Accepted. `windows_raw_dylib` is not a known cfg so considered AlwaysFalse. - let cfg = "all(any(target_arch = \"x86_64\", target_arch = \"arm64ec\"), \ - target_env = \"msvc\", not(windows_raw_dylib))"; - assert_eq!( - filter_unsupported_platform_terms(Platform::Cfg(CfgExpr::from_str(cfg).unwrap())), - Some(Platform::Cfg(CfgExpr::from_str("target_arch = \"x86_64\"").unwrap())) - ); - - // Accepted. `windows_raw_dylib` is not a known cfg so considered AlwaysFalse. - let cfg = "all(target_arch = \"x86\", target_env = \"msvc\", not(windows_raw_dylib))"; - assert_eq!( - filter_unsupported_platform_terms(Platform::Cfg(CfgExpr::from_str(cfg).unwrap())), - Some(Platform::Cfg(CfgExpr::from_str("target_arch = \"x86\"").unwrap())) - ); - - // Rejected for gnu env. - let cfg = "all(target_arch = \"x86\", target_env = \"gnu\", not(target_abi = \"llvm\"), \ - not(windows_raw_dylib))"; - assert!(!matches_supported_target(&Platform::Cfg(CfgExpr::from_str(cfg).unwrap()))); - } -}
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec index b7c03fa5..2cd6ca7 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec
@@ -1446,10 +1446,6 @@ "META": {"sizes": {"includes": [10]}}, "includes": [9980], }, - "<(SHARED_INTERMEDIATE_DIR)/ui/webui/resources/webui_code_cache_resources.grd": { - "META": {"sizes": {"includes": [10]}}, - "includes": [9990], - }, "<(SHARED_INTERMEDIATE_DIR)/ui/webui/resources/webui_resources.grd": { "META": {"sizes": {"includes": [1100]}}, "includes": [10000],
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index b079515..ff67f0a 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -9953,6 +9953,7 @@ <int value="-1684123448" label="disable-best-effort-tasks"/> <int value="-1683976057" label="ArcOnDemand:disabled"/> <int value="-1682843294" label="DataReductionProxyDecidesTransform:enabled"/> + <int value="-1681823704" label="DeviceBoundSessionsRefreshQuota:disabled"/> <int value="-1681777841" label="TabGroupsForTablets:enabled"/> <int value="-1679849626" label="AuraWindowSubtreeCapture:disabled"/> <int value="-1679829698" label="ColorProviderRedirection:disabled"/> @@ -11320,7 +11321,6 @@ <int value="-1156639003" label="ArcResizeCompat:enabled"/> <int value="-1156179600" label="OmniboxRichEntitySuggestions:enabled"/> <int value="-1155543191" label="CopylessPaste:disabled"/> - <int value="-1155470492" label="AutofillEnableCardExpiredText:enabled"/> <int value="-1155411808" label="HoldingSpacePredictability:enabled"/> <int value="-1155071457" label="CCTResizableAllowResizeByUserGesture:disabled"/> @@ -12120,7 +12120,6 @@ <int value="-838233458" label="RustyPng:enabled"/> <int value="-837650216" label="DisableCryptAuthV1DeviceSync:disabled"/> <int value="-837473047" label="AutofillEnableStickyPaymentsBubble:disabled"/> - <int value="-837209358" label="AutofillEnableCardExpiredText:disabled"/> <int value="-836123854" label="wallet-service-use-sandbox"/> <int value="-835672415" label="PointerEventV1SpecCapturing:disabled"/> <int value="-835627918" label="QuickSettingsNetworkRevamp:enabled"/> @@ -12468,6 +12467,7 @@ <int value="-703519655" label="SystemLiveCaption:enabled"/> <int value="-702477233" label="ContentFullscreen:enabled"/> <int value="-700762821" label="RequestDesktopSiteForTablets:disabled"/> + <int value="-700490514" label="DeviceBoundSessionsRefreshQuota:enabled"/> <int value="-700388124" label="OmniboxPedalsAndroidBatch1:enabled"/> <int value="-700300613" label="use-fake-device-for-media-stream:disabled"/> <int value="-699767107" label="enable-sync-app-list"/> @@ -21192,6 +21192,8 @@ <int value="72" label="YouSearch"/> <int value="73" label="StarterPackGemini"/> <int value="74" label="Lilo"/> + <int value="75" label="Startpage"/> + <int value="76" label="StarterPackPage"/> </enum> <enum name="OnboardingStartupState">
diff --git a/tools/metrics/histograms/metadata/autofill/enums.xml b/tools/metrics/histograms/metadata/autofill/enums.xml index a81fbbc2..33f23234 100644 --- a/tools/metrics/histograms/metadata/autofill/enums.xml +++ b/tools/metrics/histograms/metadata/autofill/enums.xml
@@ -1166,6 +1166,8 @@ <int value="8" label="VIRTUAL_CARD_ENROLLMENT_TEMPORARY_ERROR"/> <int value="9" label="CARD_INFO_RETRIEVAL_TEMPORARY_ERROR"/> <int value="10" label="CARD_INFO_RETRIEVAL_PERMANENT_ERROR"/> + <int value="11" label="BNPL_TEMPORARY_ERROR"/> + <int value="12" label="BNPL_PERMANENT_ERROR"/> </enum> <enum name="AutofillExpirationDateFixFlowPromptEvent">
diff --git a/tools/metrics/histograms/metadata/blink/enums.xml b/tools/metrics/histograms/metadata/blink/enums.xml index 211e6e9d..7900aff 100644 --- a/tools/metrics/histograms/metadata/blink/enums.xml +++ b/tools/metrics/histograms/metadata/blink/enums.xml
@@ -5938,6 +5938,21 @@ <int value="5334" label="CSSVarFallbackCycle"/> <int value="5335" label="CSSAttrFallbackCycle"/> <int value="5336" label="CSSRainbowGradientPattern"/> + <int value="5337" label="WebAppManifestStartUrl"/> + <int value="5338" label="WebAppManifestDisplay"/> + <int value="5339" label="WebAppManifestIcons"/> + <int value="5340" label="WebAppManifestScreenshots"/> + <int value="5341" label="WebAppManifestScope"/> + <int value="5342" label="WebAppManifestLockScreen"/> + <int value="5343" label="WebAppManifestNoteTaking"/> + <int value="5344" label="WebAppManifestPermissionsPolicy"/> + <int value="5345" label="WebAppManifestPrefer_Related_Applications"/> + <int value="5346" label="WebAppManifestThemeColor"/> + <int value="5347" label="WebAppManifestBackgroundColor"/> + <int value="5348" label="WebAppManifestTranslations"/> + <int value="5349" label="WebAppManifestTabStrip"/> + <int value="5350" label="WebAppManifestVersion"/> + <int value="5351" label="WebAppManifestRelated_Applications"/> </enum> <!-- LINT.ThenChange(//third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom:WebFeature) --> @@ -7469,6 +7484,7 @@ <int value="844" label="row-rule-style"/> <int value="845" label="gap-rule-paint-order"/> <int value="846" label="row-rule-width"/> + <int value="847" label="row-rule-color"/> </enum> <!-- LINT.ThenChange(//third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom:CSSSampleId) -->
diff --git a/tools/metrics/histograms/metadata/bluetooth/histograms.xml b/tools/metrics/histograms/metadata/bluetooth/histograms.xml index 3986a6a..26ef696 100644 --- a/tools/metrics/histograms/metadata/bluetooth/histograms.xml +++ b/tools/metrics/histograms/metadata/bluetooth/histograms.xml
@@ -53,7 +53,7 @@ </variants> <histogram name="Bluetooth.BlueZ.DBus.{MethodName}.Latency" units="ms" - expires_after="2025-04-13"> + expires_after="2026-04-13"> <owner>jonmann@chromium.org</owner> <owner>chromeos-cross-device-eng@google.com</owner> <summary>Tracks the latency of the BlueZ {MethodName} DBus method.</summary> @@ -61,7 +61,7 @@ </histogram> <histogram name="Bluetooth.BlueZ.DBus.{MethodName}.Result" enum="DBusResult" - expires_after="2025-07-27"> + expires_after="2026-04-13"> <owner>jonmann@chromium.org</owner> <owner>chromeos-cross-device-eng@google.com</owner> <summary>Tracks the result for BlueZ {MethodName} DBus method calls.</summary> @@ -69,7 +69,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.ConnectionToastShownIn24Hours.Count" - units="count" expires_after="2025-05-30"> + units="count" expires_after="2026-04-13"> <owner>longbowei@google.com</owner> <owner>dpad@google.com</owner> <owner>cros-device-enablement@google.com</owner> @@ -1896,7 +1896,7 @@ </histogram> <histogram name="Bluetooth.Mojo.PendingConnectAtShutdown.DurationWaiting" - units="ms" expires_after="2025-08-24"> + units="ms" expires_after="2026-04-13"> <owner>jonmann@chromium.org</owner> <owner>cros-system-services-networking@google.com</owner> <summary> @@ -1911,7 +1911,7 @@ <histogram name="Bluetooth.Mojo.PendingConnectAtShutdown.NumberOfServiceDiscoveriesInProgress" - units="count" expires_after="2025-08-24"> + units="count" expires_after="2026-04-13"> <owner>jonmann@chromium.org</owner> <owner>cros-system-services-networking@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/cookie/histograms.xml b/tools/metrics/histograms/metadata/cookie/histograms.xml index 2616092..f37b7be4 100644 --- a/tools/metrics/histograms/metadata/cookie/histograms.xml +++ b/tools/metrics/histograms/metadata/cookie/histograms.xml
@@ -396,34 +396,6 @@ </summary> </histogram> -<histogram name="Cookie.FirstPartySets.ContextDelayedQueriesCount" - units="queries" expires_after="M140"> - <owner>shuuran@chromium.org</owner> - <owner>kaustubhag@chromium.org</owner> - <summary> - The number of queries that were delayed for a browser context (i.e. answered - asynchronously instead of synchronously). - - Recorded once per profile during log-in when the First-Party Sets info is - ready for the network context if feature WaitForFirstPartySetsInit was - enabled. - </summary> -</histogram> - -<histogram name="Cookie.FirstPartySets.ContextMostDelayedQueryDelta" units="ms" - expires_after="M140"> - <owner>shuuran@chromium.org</owner> - <owner>kaustubhag@chromium.org</owner> - <summary> - The length of time between when the first asynchronous query was received, - and when asynchronous queries started to be answered for a browser context. - - Recorded once per profile profile during log-in when the First-Party Sets - info is ready in the network context if feature WaitForFirstPartySetsInit - was enabled. - </summary> -</histogram> - <histogram name="Cookie.FirstPartySets.EnqueueingDelay.{QueryType}" units="ms" expires_after="2025-08-04"> <owner>cfredric@chromium.org</owner> @@ -506,7 +478,6 @@ </summary> <token key="Context"> <variant name="Browser"/> - <variant name="Network"/> </token> </histogram> @@ -528,7 +499,6 @@ </summary> <token key="Context"> <variant name="Browser"/> - <variant name="Network"/> </token> </histogram>
diff --git a/tools/metrics/histograms/metadata/crostini/enums.xml b/tools/metrics/histograms/metadata/crostini/enums.xml index 004e7a62..0c845e22 100644 --- a/tools/metrics/histograms/metadata/crostini/enums.xml +++ b/tools/metrics/histograms/metadata/crostini/enums.xml
@@ -173,6 +173,14 @@ <int value="77" label="SIGNAL_NOT_CONNECTED"/> <int value="78" label="INSTALL_TERMINA_CANCELLED"/> <int value="79" label="START_TIMED_OUT"/> + <int value="80" label="DISK_IMAGE_NO_RESPONSE"/> + <int value="81" label="DISK_IMAGE_IN_PROGRESS"/> + <int value="82" label="DISK_IMAGE_FAILED"/> + <int value="83" label="DISK_IMAGE_FAILED_NO_SPACE"/> + <int value="84" label="DISK_IMAGE_CANCELLED"/> + <int value="85" label="START_BAGUETTE_VM_TIMED_OUT"/> + <int value="86" label="UNINSTALL_BAGUETTE_FAILED"/> + <int value="87" label="INSTALL_BAGUETTE_CANCELLED"/> </enum> <enum name="CrostiniSettingsEvent">
diff --git a/tools/metrics/histograms/metadata/facilitated_payments/enums.xml b/tools/metrics/histograms/metadata/facilitated_payments/enums.xml index b93ff98..eaafeb99 100644 --- a/tools/metrics/histograms/metadata/facilitated_payments/enums.xml +++ b/tools/metrics/histograms/metadata/facilitated_payments/enums.xml
@@ -45,6 +45,7 @@ result of a user action"/> <int value="12" label="The FOP selector was closed by the user"/> <int value="13" label="Foldable devices not supported"/> + <int value="14" label="Max strikes reached"/> </enum> <!-- LINT.ThenChange(/components/facilitated_payments/core/metrics/facilitated_payments_metrics.h:EwalletFlowExitedReason) -->
diff --git a/tools/metrics/histograms/metadata/leveldb_proto/histograms.xml b/tools/metrics/histograms/metadata/leveldb_proto/histograms.xml index c971bbe..29d3a0e 100644 --- a/tools/metrics/histograms/metadata/leveldb_proto/histograms.xml +++ b/tools/metrics/histograms/metadata/leveldb_proto/histograms.xml
@@ -23,6 +23,8 @@ <histograms> <variants name="LevelDBClient"> + <variant name="AutofillAiModelCache" + summary="Database that acts as a cache for AutofillAI model responses"/> <variant name="BudgetManager" summary="Database for storing budget information for origins."/> <variant name="CachedImageFetcherDatabase"
diff --git a/tools/metrics/histograms/metadata/navigation/histograms.xml b/tools/metrics/histograms/metadata/navigation/histograms.xml index 44b2efcd5..cbf1360 100644 --- a/tools/metrics/histograms/metadata/navigation/histograms.xml +++ b/tools/metrics/histograms/metadata/navigation/histograms.xml
@@ -1030,7 +1030,7 @@ </histogram> <histogram name="Navigation.FencedFrameBeaconReportingCountSameOrigin" - units="beacons" expires_after="2025-03-13"> + units="beacons" expires_after="2025-07-27"> <owner>lbrady@google.com</owner> <owner>shivanisha@chromium.org</owner> <owner>chrome-fenced-frames-core@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/net/enums.xml b/tools/metrics/histograms/metadata/net/enums.xml index 839bfb9..ca72c90 100644 --- a/tools/metrics/histograms/metadata/net/enums.xml +++ b/tools/metrics/histograms/metadata/net/enums.xml
@@ -268,6 +268,7 @@ <int value="14" label="Persistent HTTP error"/> <int value="15" label="Same-site mismatch scope origin"/> <int value="16" label="Same-site mismatch refresh URL"/> + <int value="17" label="Invalid scope origin"/> </enum> <!-- LINT.ThenChange(//net/device_bound_sessions/session_error.h:DeviceBoundSessionError) -->
diff --git a/tools/metrics/histograms/metadata/omnibox/enums.xml b/tools/metrics/histograms/metadata/omnibox/enums.xml index 146e97da..1d8798d 100644 --- a/tools/metrics/histograms/metadata/omnibox/enums.xml +++ b/tools/metrics/histograms/metadata/omnibox/enums.xml
@@ -116,6 +116,7 @@ <int value="3" label="@history starter pack engine"/> <int value="4" label="@tabs starter pack engine"/> <int value="5" label="@gemini starter pack engine"/> + <int value="6" label="@page starter pack engine"/> </enum> <enum name="OmniboxEnteredKeywordMode2">
diff --git a/tools/metrics/histograms/metadata/privacy/histograms.xml b/tools/metrics/histograms/metadata/privacy/histograms.xml index 7cec44e..33ab212 100644 --- a/tools/metrics/histograms/metadata/privacy/histograms.xml +++ b/tools/metrics/histograms/metadata/privacy/histograms.xml
@@ -142,15 +142,11 @@ summary="Consent notice with Topics API on Clank CCT."/> </variants> -<!-- TODO(crbug.com/333408794): Add user action metrics for these. --> - <variants name="PSNoticeAction"> <variant name="Ack" summary="Got it or any other ack action on a privacy sandbox notice."/> <variant name="Closed" summary="Closed (x) action on a privacy sandbox notice"/> - <variant name="LearnMore" - summary="Learn more action on a privacy sandbox notice."/> <variant name="OptIn" summary="Turn it on or any other opt in action on a privacy sandbox notice."/>
diff --git a/tools/metrics/histograms/metadata/quota/histograms.xml b/tools/metrics/histograms/metadata/quota/histograms.xml index f5ece7e3..82a60fd 100644 --- a/tools/metrics/histograms/metadata/quota/histograms.xml +++ b/tools/metrics/histograms/metadata/quota/histograms.xml
@@ -101,6 +101,7 @@ <variant name="GetBucketsForType"/> <variant name="GetBucketsModifiedBetween"/> <variant name="GetExpired"/> + <variant name="GetExpiredAndOrphanAndStale"/> <variant name="GetOrphan"/> <variant name="GetStale"/> <variant name="GetStorageKeys"/>
diff --git a/tools/metrics/histograms/metadata/settings/histograms.xml b/tools/metrics/histograms/metadata/settings/histograms.xml index a43c8a41..ed216ca8 100644 --- a/tools/metrics/histograms/metadata/settings/histograms.xml +++ b/tools/metrics/histograms/metadata/settings/histograms.xml
@@ -800,6 +800,29 @@ </histogram> <histogram + name="Settings.SafetyHub.DisruptiveNotificationRevocations.FalsePositive.SiteEngagement" + units="EngagementScore" expires_after="2026-02-26"> + <owner>olesiamarukhnno@google.com</owner> + <owner>antoniosartori@chromium.org</owner> + <summary> + Tracks the distribution of the site engagement score for detected false + positive sites that were previously marked for revocation of disruptive + notifications. + </summary> +</histogram> + +<histogram + name="Settings.SafetyHub.DisruptiveNotificationRevocations.Proposed.NotificationCount" + units="count" expires_after="2026-02-26"> + <owner>olesiamarukhnno@google.com</owner> + <owner>antoniosartori@chromium.org</owner> + <summary> + Tracks the distribution of the average daily notification count for proposed + revocation of disruptive notifications. + </summary> +</histogram> + +<histogram name="Settings.SafetyHub.DisruptiveNotificationRevocations.RevocationResult" enum="DisruptiveNotificationRevocationResult" expires_after="2026-02-26"> <owner>olesiamarukhnno@google.com</owner> @@ -812,6 +835,17 @@ </summary> </histogram> +<histogram + name="Settings.SafetyHub.DisruptiveNotificationRevocations.RevokedWebsitesCount" + units="count" expires_after="2026-02-26"> + <owner>olesiamarukhnno@google.com</owner> + <owner>antoniosartori@chromium.org</owner> + <summary> + Records the number of revoked disruptive notification sites per a Safety Hub + run. + </summary> +</histogram> + <histogram name="Settings.SafetyHub.EntryPointImpression" enum="SafetyHubEntryPoint" expires_after="2025-07-27"> <owner>sideyilmaz@chromium.org</owner> @@ -1077,7 +1111,7 @@ </histogram> <histogram name="Settings.TrackedPreferenceChanged" enum="TrackedPreference" - expires_after="2026-01-06"> + expires_after="2026-02-01"> <!-- Note to owner: This histogram can be renewed 1 full year if it is still useful for Chirp alerts (go/crca-alerts). --> @@ -1091,27 +1125,22 @@ </histogram> <histogram name="Settings.TrackedPreferenceCleared" enum="TrackedPreference" - expires_after="2022-12-22"> - <expired_intentionally> - Kept as test chrome/browser/prefs/tracked/pref_hash_browsertest.cc depends - on this histogram. - </expired_intentionally> - <owner>drubery@chromium.org</owner> + expires_after="2026-02-01"> + <owner>anunoy@chromium.org</owner> <owner>junhao.huang@microsoft.com</owner> <summary> The id of a tracked preference whose value has been cleared since the last time Chrome set it. Without a suffix, this histogram stands for preference validation using MACs in the JSON pref files. + + Warning: This histogram was expired from 2022-12 to 2025-03; data may be + missing. </summary> </histogram> <histogram name="Settings.TrackedPreferenceInitialized" - enum="TrackedPreference" expires_after="2022-12-22"> - <expired_intentionally> - Kept as test chrome/browser/prefs/tracked/pref_hash_browsertest.cc depends - on this histogram. - </expired_intentionally> - <owner>drubery@chromium.org</owner> + enum="TrackedPreference" expires_after="2026-02-01"> + <owner>anunoy@chromium.org</owner> <owner>junhao.huang@microsoft.com</owner> <summary> The id of a tracked preference whose last value isn't known. We may be just @@ -1119,16 +1148,15 @@ outside of Chrome. This should only happen once per pref per profile. Without a suffix, this histogram stands for preference validation using MACs in the JSON pref files. + + Warning: This histogram was expired from 2022-12 to 2025-03; data may be + missing. </summary> </histogram> <histogram name="Settings.TrackedPreferenceMigratedLegacyDeviceId" - enum="TrackedPreference" expires_after="2022-12-22"> - <expired_intentionally> - Kept as test chrome/browser/prefs/tracked/pref_hash_browsertest.cc depends - on this histogram. - </expired_intentionally> - <owner>drubery@chromium.org</owner> + enum="TrackedPreference" expires_after="2026-02-01"> + <owner>anunoy@chromium.org</owner> <owner>junhao.huang@microsoft.com</owner> <summary> The id of a tracked preference whose value has not changed since the last @@ -1136,65 +1164,65 @@ user should report this at most once per preference id and immediately be migrated to the latest hashing model. Without a suffix, this histogram stands for preference validation using MACs in the JSON pref files. + + Warning: This histogram was expired from 2022-12 to 2025-03; data may be + missing. </summary> </histogram> <histogram name="Settings.TrackedPreferenceNullInitialized" - enum="TrackedPreference" expires_after="2022-12-22"> - <expired_intentionally> - Kept as test chrome/browser/prefs/tracked/pref_hash_browsertest.cc depends - on this histogram. - </expired_intentionally> - <owner>drubery@chromium.org</owner> + enum="TrackedPreference" expires_after="2026-02-01"> + <owner>anunoy@chromium.org</owner> <owner>junhao.huang@microsoft.com</owner> <summary> The id of a tracked preference which was initialized despite the absence of a MAC as its value was NULL. Without a suffix, this histogram stands for preference validation using MACs in the JSON pref files. + + Warning: This histogram was expired from 2022-12 to 2025-03; data may be + missing. </summary> </histogram> <histogram name="Settings.TrackedPreferenceReset" enum="TrackedPreference" - expires_after="2025-08-24"> + expires_after="2026-02-01"> <owner>anunoy@chromium.org</owner> <owner>junhao.huang@microsoft.com</owner> <summary>The id of a tracked preference which was reset by Chrome.</summary> </histogram> <histogram name="Settings.TrackedPreferenceTrustedInitialized" - enum="TrackedPreference" expires_after="2022-12-22"> - <expired_intentionally> - Kept as test chrome/browser/prefs/tracked/pref_hash_browsertest.cc depends - on this histogram. - </expired_intentionally> - <owner>drubery@chromium.org</owner> + enum="TrackedPreference" expires_after="2026-02-01"> + <owner>anunoy@chromium.org</owner> <owner>junhao.huang@microsoft.com</owner> <summary> The id of a tracked preference which was initialized despite the absence of a MAC as the current MACs are trusted, inferring that this is a newly tracked pref. Without a suffix, this histogram stands for preference validation using MACs in the JSON pref files. + + Warning: This histogram was expired from 2022-12 to 2025-03; data may be + missing. </summary> </histogram> <histogram name="Settings.TrackedPreferenceUnchanged" enum="TrackedPreference" - expires_after="2022-12-22"> - <expired_intentionally> - Kept as test chrome/browser/prefs/tracked/pref_hash_browsertest.cc depends - on this histogram. - </expired_intentionally> - <owner>drubery@chromium.org</owner> + expires_after="2026-02-01"> + <owner>anunoy@chromium.org</owner> <owner>junhao.huang@microsoft.com</owner> <summary> The id of a tracked preference whose value has not changed since the last time Chrome set it. Without a suffix, this histogram stands for preference validation using MACs in the JSON pref files. + + Warning: This histogram was expired from 2022-12 to 2025-03; data may be + missing. </summary> </histogram> <histogram name="Settings.TrackedPreferenceWantedReset" - enum="TrackedPreference" expires_after="2025-08-24"> - <owner>drubery@chromium.org</owner> + enum="TrackedPreference" expires_after="2026-02-01"> + <owner>anunoy@chromium.org</owner> <owner>junhao.huang@microsoft.com</owner> <summary> The id of a tracked preference which Chrome would have reset had the config
diff --git a/tools/metrics/histograms/metadata/ui/histograms.xml b/tools/metrics/histograms/metadata/ui/histograms.xml index 02ebfe95..bc4c80c 100644 --- a/tools/metrics/histograms/metadata/ui/histograms.xml +++ b/tools/metrics/histograms/metadata/ui/histograms.xml
@@ -430,8 +430,7 @@ </histogram> <histogram name="Views.ColorProviderCacheSize" units="entries" - expires_after="2025-03-09"> - <owner>pkasting@chromium.org</owner> + expires_after="2025-09-09"> <owner>tluk@chromium.org</owner> <owner>skau@chromium.org</owner> <summary>
diff --git a/tools/perf/json_constants.py b/tools/perf/json_constants.py index 442352b..9dd6051 100644 --- a/tools/perf/json_constants.py +++ b/tools/perf/json_constants.py
@@ -2,7 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Constants for json results file.""" -from types import MappingProxyType BENCHMARK = 'benchmark' BENCHMARKS = 'benchmarks' @@ -47,10 +46,6 @@ VALUES = 'values' VERSION = 'version' WEBRTC_GIT_HASH = 'WebRTC Git Hash' -UNIT_TO_DIRECTION = MappingProxyType({ - 'ms_smallerIsBetter': 'down', - 'unitless_biggerIsBetter': 'up', -}) REPOSITORY_PROPERTY_MAP = { 'chromium': { 'masters': ['ChromeFYIInternal', 'ChromiumAndroid', 'ChromiumChrome',
diff --git a/tools/perf/json_util.py b/tools/perf/json_util.py index c2fe263..2ac0244 100644 --- a/tools/perf/json_util.py +++ b/tools/perf/json_util.py
@@ -214,6 +214,11 @@ return key +def _get_improvement_direction(unit: str) -> str: + """Returns the improvement direction for a given unit.""" + return "down" if "smallerIsBetter" in unit else "up" + + class JsonUtil: """Tools to convert result2 json to skia json.""" @@ -245,8 +250,8 @@ guid_to_values[item[json_constants.GUID]] = item[json_constants.VALUES] if json_constants.DIAGNOSTICS in item: test_name = item[json_constants.NAME] - improvement_direction = json_constants.UNIT_TO_DIRECTION.get( - item[json_constants.UNIT], "up") + improvement_direction = _get_improvement_direction( + item[json_constants.UNIT]) if not isinstance(item[json_constants.DIAGNOSTICS], dict): raise ValueError("The diagnostics should be a dict, but it is %s" % type(item[json_constants.DIAGNOSTICS]))
diff --git a/tools/perf/json_util_unittest.py b/tools/perf/json_util_unittest.py index a275658d..bf5955d 100755 --- a/tools/perf/json_util_unittest.py +++ b/tools/perf/json_util_unittest.py
@@ -839,6 +839,44 @@ experiment_only=experiment_only) self.assertEqual(got, expected) + @parameterized.expand([ + ( + 'default_up_on_empty_string', + '', + 'up', + ), + ( + 'foo_smallerIsBetter', + 'foo_smallerIsBetter', + 'down', + ), + ( + 'smallerIsBetter', + '_smallerIsBetter', + 'down', + ), + ( + 'abc_smallerIsBetter', + 'abc_smallerIsBetter', + 'down', + ), + ( + 'default_up', + 'foo_bar', + 'up', + ), + ( + 'bar_biggerIsBetter', + 'bar_biggerIsBetter', + 'up', + ), + ]) + def test_get_improvement_direction( + self, _, unit, expected): + # pylint: disable=protected-access + got= json_util._get_improvement_direction(unit) + self.assertEqual(got, expected) + if __name__ == '__main__': unittest.main()
diff --git a/tools/traffic_annotation/summary/annotations.xml b/tools/traffic_annotation/summary/annotations.xml index bd0ea7f..f69069a 100644 --- a/tools/traffic_annotation/summary/annotations.xml +++ b/tools/traffic_annotation/summary/annotations.xml
@@ -511,4 +511,5 @@ <item id="payments_autofill" added_in_milestone="135" content_hash_code="04acbe74" os_list="linux,windows,android,chromeos" file_path="components/autofill/core/browser/payments/multiple_request_payments_network_interface_base.cc" /> <item id="client_download_request_desktop" added_in_milestone="135" type="branchedcompleting" second_id="client_download_request_for_platform" content_hash_code="01222414" os_list="linux,windows,android,chromeos" semantics_fields="2,3,4,8,9" file_path="chrome/browser/safe_browsing/download_protection/download_protection_delegate_desktop.cc" /> <item id="chromeos_scanner_provider" added_in_milestone="135" content_hash_code="04db096b" os_list="chromeos" file_path="components/manta/scanner_provider.cc" /> + <item id="glic_fre_preconnect" added_in_milestone="136" content_hash_code="02865907" os_list="linux,windows" file_path="chrome/browser/glic/glic_fre_controller.cc" /> </annotations>
diff --git a/tools/traffic_annotation/summary/grouping.xml b/tools/traffic_annotation/summary/grouping.xml index 6cf892c..533eb2f7 100644 --- a/tools/traffic_annotation/summary/grouping.xml +++ b/tools/traffic_annotation/summary/grouping.xml
@@ -372,6 +372,7 @@ <annotation id="metrics_report_dwa"/> <annotation id="version_history"/> <annotation id="chromeos_scanner_provider"/> + <annotation id="glic_fre_preconnect"/> </sender> </group> <group name="Admin Features" hidden="true">
diff --git a/ui/android/java/src/org/chromium/ui/base/PhotoPickerListener.java b/ui/android/java/src/org/chromium/ui/base/PhotoPickerListener.java index 975c3e46..7af883b 100644 --- a/ui/android/java/src/org/chromium/ui/base/PhotoPickerListener.java +++ b/ui/android/java/src/org/chromium/ui/base/PhotoPickerListener.java
@@ -9,6 +9,7 @@ import androidx.annotation.IntDef; import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -42,7 +43,7 @@ * * @param photos The photos that were selected. */ - void onPhotoPickerUserAction(@PhotoPickerAction int action, Uri[] photos); + void onPhotoPickerUserAction(@PhotoPickerAction int action, Uri @Nullable [] photos); /** Called when the dialog has been dismissed. */ void onPhotoPickerDismissed();
diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java index c1c866d3..709cc999 100644 --- a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java +++ b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
@@ -813,13 +813,14 @@ } @Override - public void onPhotoPickerUserAction(@PhotoPickerAction int action, Uri[] photos) { + public void onPhotoPickerUserAction(@PhotoPickerAction int action, Uri @Nullable [] photos) { switch (action) { case PhotoPickerAction.CANCEL: onFileNotSelected(); break; case PhotoPickerAction.PHOTOS_SELECTED: + assumeNonNull(photos); if (photos.length == 0) { onFileNotSelected(); return;
diff --git a/ui/android/java/src/org/chromium/ui/modaldialog/ModalDialogProperties.java b/ui/android/java/src/org/chromium/ui/modaldialog/ModalDialogProperties.java index 2c128f2..233600e 100644 --- a/ui/android/java/src/org/chromium/ui/modaldialog/ModalDialogProperties.java +++ b/ui/android/java/src/org/chromium/ui/modaldialog/ModalDialogProperties.java
@@ -289,6 +289,24 @@ public static final WritableObjectPropertyKey<Rect> PADDING = new WritableObjectPropertyKey(); /** + * Whether the positive button should draw an indeterminate spinner within the button while + * awaiting a pending result. Only one of the positive or negative buttons should have the + * loading state applied with the spinner active. + */ + @Deprecated + public static final WritableBooleanPropertyKey POSITIVE_BUTTON_LOADING = + new WritableBooleanPropertyKey(); + + /** + * Whether the negative button should draw an indeterminate spinner within the button while + * awaiting a pending result. Only one of the positive or negative buttons should have the + * loading state applied with the spinner active. + */ + @Deprecated + public static final WritableBooleanPropertyKey NEGATIVE_BUTTON_LOADING = + new WritableBooleanPropertyKey(); + + /** * Block all inputs on the rest of the dialog view. Note that this does not override any * existing behaviour for touching the scrim or system backpress handling. */ @@ -329,6 +347,8 @@ HORIZONTAL_MARGIN, VERTICAL_MARGIN, PADDING, + POSITIVE_BUTTON_LOADING, + NEGATIVE_BUTTON_LOADING, BLOCK_INPUTS, }; }
diff --git a/ui/views/layout/table_layout.cc b/ui/views/layout/table_layout.cc index 8387480..edd3242 100644 --- a/ui/views/layout/table_layout.cc +++ b/ui/views/layout/table_layout.cc
@@ -323,6 +323,14 @@ TableLayout::~TableLayout() = default; +size_t TableLayout::NumColumns() const { + return columns_.size(); +} + +size_t TableLayout::NumRows() const { + return rows_.size(); +} + TableLayout& TableLayout::AddColumn(LayoutAlignment h_align, LayoutAlignment v_align, float horizontal_resize, @@ -341,6 +349,11 @@ return *this; } +void TableLayout::RemoveColumns(size_t n) { + CHECK_LE(n, columns_.size()); + columns_.erase(columns_.end() - static_cast<ptrdiff_t>(n), columns_.end()); +} + TableLayout& TableLayout::AddRows(size_t n, float vertical_resize, int height) { for (size_t i = 0; i < n; ++i) { rows_.emplace_back(vertical_resize, height, false); @@ -353,6 +366,11 @@ return *this; } +void TableLayout::RemoveRows(size_t n) { + CHECK_LE(n, rows_.size()); + rows_.erase(rows_.end() - static_cast<ptrdiff_t>(n), rows_.end()); +} + TableLayout& TableLayout::LinkColumnSizes(std::vector<size_t> columns) { if (columns.size() > 1) { std::ranges::sort(columns);
diff --git a/ui/views/layout/table_layout.h b/ui/views/layout/table_layout.h index 438000ad..40909e7 100644 --- a/ui/views/layout/table_layout.h +++ b/ui/views/layout/table_layout.h
@@ -93,6 +93,9 @@ ~TableLayout() override; + size_t NumColumns() const; + size_t NumRows() const; + // Adds a column. The alignment gives the default alignment for views added // with no explicit alignment. fixed_width gives a specific width for the // column, and is only used if size_type == kFixed. min_width gives the @@ -114,6 +117,10 @@ // spans. TableLayout& AddPaddingColumn(float horizontal_resize, int width); + // Removes the last `n` normal and/or padding columns. `n` must be at + // most `num_columns()`. + void RemoveColumns(size_t n); + // Adds `n` new rows with the specified height (0 for unspecified height). TableLayout& AddRows(size_t n, float vertical_resize, int height = 0); @@ -121,6 +128,10 @@ // Padding rows don't have any views, but are counted in row spans. TableLayout& AddPaddingRow(float vertical_resize, int height); + // Removes the last `n` normal and/or padding rows. `n` must be at most + // `num_rows()`. + void RemoveRows(size_t n); + // Forces the specified columns to have the same size. The size of // linked columns is that of the max of the specified columns. // For example, the following forces the first and
diff --git a/ui/webui/resources/BUILD.gn b/ui/webui/resources/BUILD.gn index 22ac4ff..57c676c 100644 --- a/ui/webui/resources/BUILD.gn +++ b/ui/webui/resources/BUILD.gn
@@ -169,27 +169,3 @@ "add_filepath_to_resource_map=${load_webui_from_disk}", ] } - -if (enable_webui_generate_code_cache) { - generate_grd("build_code_cache_grd") { - grd_prefix = "webui_code_cache" - out_grd = "$target_gen_dir/${grd_prefix}_resources.grd" - grdp_files = - [ "$root_gen_dir/third_party/lit/v3_0/code_cache_resources.grdp" ] - - public_deps = [ "//third_party/lit/v3_0:build_code_cache_grdp" ] - } - - grit("code_cache_resources") { - enable_input_discovery_for_gn_analyze = false - source = "$target_gen_dir/webui_code_cache_resources.grd" - deps = [ ":build_code_cache_grd" ] - - outputs = [ - "grit/webui_code_cache_resources.h", - "grit/webui_code_cache_resources_map.cc", - "grit/webui_code_cache_resources_map.h", - "webui_code_cache_resources.pak", - ] - } -}
diff --git a/ui/webui/webui_features.gni b/ui/webui/webui_features.gni index 09734cfb..26af3386 100644 --- a/ui/webui/webui_features.gni +++ b/ui/webui/webui_features.gni
@@ -4,7 +4,6 @@ import("//build/config/chrome_build.gni") import("//build/config/coverage/coverage.gni") -import("//build/config/sanitizers/sanitizers.gni") declare_args() { # Optimize parts of Chrome's UI written with web technologies (HTML/CSS/JS) @@ -26,13 +25,6 @@ # Meant to be used during local development only (requires a local checkout # and build) with the runtime --load-webui-from-disk command line switch. load_webui_from_disk = false - - # Enable generation of compiled JS bytecode for opted-in WebUI scripts. When - # the host and current toolchains are the same there are issues instrumenting - # the code_cache_generator msan binaries, see crbug.com/40055221#comment17. - # TODO(crbug.com/399764218): Enable this build-step on cross-compiled builds. - enable_webui_generate_code_cache = host_toolchain == current_toolchain && - !is_msan && (is_linux || is_mac || is_win) } if (load_webui_from_disk) {
diff --git a/v8 b/v8 index c206c46..4c9f0bc 160000 --- a/v8 +++ b/v8
@@ -1 +1 @@ -Subproject commit c206c46cd0bd65b02e85abe5965d82e4beb7d453 +Subproject commit 4c9f0bc7cfaa2e503fecdaa71fb9b7b1fd5bf85e