diff --git a/DEPS b/DEPS index b8a0d30..eab63d5c 100644 --- a/DEPS +++ b/DEPS
@@ -245,11 +245,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '5dee0a27e0d2306541f4a6214b75c8f405e99ac4', + 'skia_revision': '5941929042eec257445b7c43f3d492a5b85c07ac', # 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': '612603ba2fc6194ab9c9b142a123ff68e236be03', + 'v8_revision': '34f3e7ae4019f355bf15da7ca12e37ad7d907632', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. @@ -257,7 +257,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. - 'swiftshader_revision': 'b57a3aaee927a7412dffffac064d833e1d87dc7d', + 'swiftshader_revision': 'cd848cd695a460a223de0658b7f8553d012b4184', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. @@ -320,7 +320,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': 'c880d6528b4e3abc72e179b047ea68aa3324f08b', + 'devtools_frontend_revision': '0caec293a33fed43f2eeb8821a6991bb2ab251a0', # 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. @@ -555,7 +555,7 @@ 'packages': [ { 'package': 'chromium/chrome/test/data/autofill/captured_sites', - 'version': 'T1tIsFMGPMQ9YL3t92oEL1r4wxGz5RHTSr45M0H9GwkC', + 'version': '6FZx4kLIcnkvGaTkGDOHxErv11ttOFp23UyBd6tFLxQC', } ], 'condition': 'checkout_chromium_autofill_test_dependencies', @@ -744,7 +744,7 @@ 'packages': [ { 'package': 'chromium/rts/model/windows-amd64', - 'version': 'CPBtF_qieM5GGsI5wilCYlsS8pJyJshDI0LfN31FalgC', + 'version': 'hYyQwE6vYM1J9CgYv7T1S92lkrZodIDGayRLtUQL3sAC', }, ], 'dep_type': 'cipd', @@ -805,7 +805,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': '72KhrVPMAimIlLbSf4qfoMjnvI2FmvCxSBB-rUtxn8UC', + 'version': 'A2SRkmLGieck6AyFqq-ZI_WZV5i32fH-eIfxK5dytRIC', }, ], 'condition': 'checkout_android', @@ -1024,7 +1024,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' + '@' + 'd0f15301899309b439cf5710ef2752f8075d4dc3', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '89b58730aff41923385b8ae22082e9161c1d3c28', 'condition': 'checkout_chromeos', }, @@ -1609,7 +1609,7 @@ 'src/third_party/usrsctp/usrsctplib': Var('chromium_git') + '/external/github.com/sctplab/usrsctp' + '@' + '62d7d0c928c9a040dce96aa2f16c00e7e67d59cb', - 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@328da0f26e8ef4750b8a13befb76a03f35e48c6c', + 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@e00bdeb5d931056da2f55ea3efdfba1ca6ee8853', 'src/third_party/vulkan_memory_allocator': Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + '5e49f57a6e71a026a54eb42e366de09a4142d24e', @@ -1648,7 +1648,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'fca7b339442bd70c5dc49bb33ee7f9466b560a97', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'c58adb753a286fad87c0470e04c2a12766927e48', + Var('webrtc_git') + '/src.git' + '@' + '47ff35db61dd5688901fa4b00db25dd0151866ef', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1730,7 +1730,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@c608bd0c2766732c761ef2f2d5e1d81e968d982c', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@489c2e67375054674e4321278a114f0739272d4a', 'condition': 'checkout_src_internal', },
diff --git a/WATCHLISTS b/WATCHLISTS index d1cc6fa..54daad8 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -2794,7 +2794,6 @@ 'spellcheck': ['rlp+watch@chromium.org', 'rouslan+spell@chromium.org'], 'startup': ['nicolaso+watch@chromium.org', - 'pastarmovj+watch@chromium.org', 'ydago+watch@chromium.org'], 'storage_service': ['dmurph+watching-storageservice@chromium.org'], 'structured_headers': ['iclelland+watch@chromium.org'],
diff --git a/android_webview/browser/BUILD.gn b/android_webview/browser/BUILD.gn index dd6eaae..08ea6b9 100644 --- a/android_webview/browser/BUILD.gn +++ b/android_webview/browser/BUILD.gn
@@ -211,6 +211,7 @@ "//components/component_updater/installer_policies", "//components/content_capture/android", "//components/content_capture/browser", + "//components/embedder_support:browser_util", "//components/embedder_support/android:util", "//components/embedder_support/origin_trials", "//components/favicon_base:favicon_base",
diff --git a/android_webview/browser/DEPS b/android_webview/browser/DEPS index add5255..eeb97687 100644 --- a/android_webview/browser/DEPS +++ b/android_webview/browser/DEPS
@@ -18,8 +18,7 @@ "+components/crash/content/browser", "+components/crash/core", "+components/download/public/common", - "+components/embedder_support/android/metrics", - "+components/embedder_support/origin_trials", + "+components/embedder_support", "+components/favicon_base", "+components/flags_ui", "+components/heap_profiling",
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc index 77213b1..3dd4ae1 100644 --- a/android_webview/browser/aw_content_browser_client.cc +++ b/android_webview/browser/aw_content_browser_client.cc
@@ -55,6 +55,7 @@ #include "components/cdm/browser/cdm_message_filter_android.h" #include "components/content_capture/browser/onscreen_content_provider.h" #include "components/crash/content/browser/crash_handler_host_linux.h" +#include "components/embedder_support/user_agent_utils.h" #include "components/navigation_interception/intercept_navigation_delegate.h" #include "components/page_load_metrics/browser/metrics_navigation_throttle.h" #include "components/page_load_metrics/browser/metrics_web_contents_observer.h" @@ -202,7 +203,7 @@ } // anonymous namespace std::string GetProduct() { - return version_info::GetProductNameAndVersionForUserAgent(); + return embedder_support::GetProduct(/*allow_override=*/true); } std::string GetUserAgent() {
diff --git a/android_webview/browser/aw_feature_list_creator.cc b/android_webview/browser/aw_feature_list_creator.cc index 0294b08..be882f8 100644 --- a/android_webview/browser/aw_feature_list_creator.cc +++ b/android_webview/browser/aw_feature_list_creator.cc
@@ -218,18 +218,14 @@ // Populate FieldTrialList. Since |low_entropy_provider| is null, it will fall // back to the provider we previously gave to FieldTrialList, which is a low // entropy provider. The X-Client-Data header is not reported on WebView, so - // we pass an empty object as the |low_entropy_source_value|. Because WebView - // does not use the same Variations Safe Mode mechanism as most other - // platforms, pass false for |extend_variations_safe_mode| to opt out of the - // Extended Variations Safe Mode experiment. See crbug/1220131 for more info. + // we pass an empty object as the |low_entropy_source_value|. variations_field_trial_creator_->SetUpFieldTrials( variation_ids, GetSwitchDependentFeatureOverrides( *base::CommandLine::ForCurrentProcess()), /*low_entropy_provider=*/nullptr, std::move(feature_list), metrics_client->metrics_state_manager(), aw_field_trials_.get(), - &ignored_safe_seed_manager, /*low_entropy_source_value=*/absl::nullopt, - /*extend_variations_safe_mode=*/false); + &ignored_safe_seed_manager, /*low_entropy_source_value=*/absl::nullopt); } void AwFeatureListCreator::CreateLocalState() {
diff --git a/android_webview/browser/gfx/hardware_renderer_viz.cc b/android_webview/browser/gfx/hardware_renderer_viz.cc index 3a786a5..0b4016e 100644 --- a/android_webview/browser/gfx/hardware_renderer_viz.cc +++ b/android_webview/browser/gfx/hardware_renderer_viz.cc
@@ -294,7 +294,7 @@ bool will_draw_and_swap, viz::AggregatedRenderPassList* render_passes) { DCHECK_CALLED_ON_VALID_THREAD(viz_thread_checker_); - hit_test_aggregator_->Aggregate(child_surface_id_, render_passes); + hit_test_aggregator_->Aggregate(child_surface_id_); } base::TimeDelta
diff --git a/android_webview/browser/metrics/aw_metrics_service_client.cc b/android_webview/browser/metrics/aw_metrics_service_client.cc index 22804da7..b427f3f 100644 --- a/android_webview/browser/metrics/aw_metrics_service_client.cc +++ b/android_webview/browser/metrics/aw_metrics_service_client.cc
@@ -14,7 +14,6 @@ #include "base/android/jni_android.h" #include "base/android/jni_string.h" #include "base/feature_list.h" -#include "base/files/file_path.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/persistent_histogram_allocator.h" #include "base/time/time.h" @@ -82,13 +81,6 @@ AwMetricsServiceClient::~AwMetricsServiceClient() = default; -void AwMetricsServiceClient::Initialize(PrefService* pref_service) { - // Pass an empty file path since the path is for the Extended Variations Safe - // Mode experiment and Android WebView is excluded from this experiment. - AndroidMetricsServiceClient::Initialize(/*user_data_dir=*/base::FilePath(), - pref_service); -} - int32_t AwMetricsServiceClient::GetProduct() { return metrics::ChromeUserMetricsExtension::ANDROID_WEBVIEW; }
diff --git a/android_webview/browser/metrics/aw_metrics_service_client.h b/android_webview/browser/metrics/aw_metrics_service_client.h index ea8ab47..4632dfe 100644 --- a/android_webview/browser/metrics/aw_metrics_service_client.h +++ b/android_webview/browser/metrics/aw_metrics_service_client.h
@@ -20,8 +20,6 @@ #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -class PrefService; - namespace android_webview { namespace prefs { @@ -155,9 +153,6 @@ ~AwMetricsServiceClient() override; - // Initializes, but does not necessarily start, the MetricsService. - void Initialize(PrefService* pref_service); - // metrics::MetricsServiceClient int32_t GetProduct() override;
diff --git a/android_webview/java/src/org/chromium/android_webview/ErrorCodeConversionHelper.java b/android_webview/java/src/org/chromium/android_webview/ErrorCodeConversionHelper.java index 4f9ce8af..2c4210b9 100644 --- a/android_webview/java/src/org/chromium/android_webview/ErrorCodeConversionHelper.java +++ b/android_webview/java/src/org/chromium/android_webview/ErrorCodeConversionHelper.java
@@ -74,7 +74,6 @@ case NetError.ERR_NO_SSL_VERSIONS_ENABLED: case NetError.ERR_SSL_VERSION_OR_CIPHER_MISMATCH: case NetError.ERR_SSL_RENEGOTIATION_REQUESTED: - case NetError.ERR_CERT_ERROR_IN_SSL_RENEGOTIATION: case NetError.ERR_BAD_SSL_CLIENT_AUTH_CERT: case NetError.ERR_SSL_NO_RENEGOTIATION: case NetError.ERR_SSL_DECOMPRESSION_FAILURE_ALERT:
diff --git a/ash/assistant/ui/main_stage/assistant_opt_in_view_unittest.cc b/ash/assistant/ui/main_stage/assistant_opt_in_view_unittest.cc index 8215177f..d34c3b5 100644 --- a/ash/assistant/ui/main_stage/assistant_opt_in_view_unittest.cc +++ b/ash/assistant/ui/main_stage/assistant_opt_in_view_unittest.cc
@@ -21,7 +21,7 @@ namespace { constexpr int kLongerEdge = kPreferredWidthDip + 10; -constexpr int kShoterEdge = kPreferredWidthDip - 10; +constexpr int kShorterEdge = kPreferredWidthDip - 10; class AssistantOptInViewUnittest : public AssistantAshTestBase {}; @@ -30,7 +30,10 @@ // |AssistantPageView| doesn't get bigger than |kPreferredWidthDip|. This test // case makes sure that styled label is relayouted correctly. TEST_F(AssistantOptInViewUnittest, RotateSmallScreen) { - UpdateDisplay(base::StringPrintf("%dx%d", kLongerEdge, kShoterEdge)); + UpdateDisplay(base::StringPrintf("%dx%d", kLongerEdge, kShorterEdge)); + // Test in tablet mode because ProductivityLauncher doesn't resize lower than + // 640 dips wide in clamshell. + SetTabletMode(true); ShowAssistantUi(); const views::View* styled_label = @@ -49,7 +52,7 @@ // Rotate display 90 degree by changing bounds. int original_width = opt_in_view()->bounds().width(); - UpdateDisplay(base::StringPrintf("%dx%d", kShoterEdge, kLongerEdge)); + UpdateDisplay(base::StringPrintf("%dx%d", kShorterEdge, kLongerEdge)); // Assert that relayout of |opt_in_view| is necessary. ASSERT_THAT(opt_in_view()->bounds().width(), testing::Ne(original_width));
diff --git a/ash/components/settings/cros_settings_names.h b/ash/components/settings/cros_settings_names.h index bcdc72f..a457c285 100644 --- a/ash/components/settings/cros_settings_names.h +++ b/ash/components/settings/cros_settings_names.h
@@ -341,7 +341,6 @@ using ::ash::kDeviceWebBasedAttestationAllowedUrls; using ::ash::kFineGrainedTimeZoneResolveEnabled; using ::ash::kLoginAuthenticationBehavior; -using ::ash::kSystemProxySettings; using ::ash::kSystemTimezone; using ::ash::kSystemTimezonePolicy; using ::ash::kTPMFirmwareUpdateSettings;
diff --git a/ash/components/timezone/timezone_resolver.cc b/ash/components/timezone/timezone_resolver.cc index 47ad780..3a0d677e 100644 --- a/ash/components/timezone/timezone_resolver.cc +++ b/ash/components/timezone/timezone_resolver.cc
@@ -199,7 +199,7 @@ } void TZRequest::Start() { - // call to chromeos::DelayNetworkCall + // Call to `ash::DelayNetworkCall`. resolver_->delay_network_call().Run( base::BindOnce(&TZRequest::StartRequestOnNetworkAvailable, AsWeakPtr())); }
diff --git a/ash/components/timezone/timezone_resolver.h b/ash/components/timezone/timezone_resolver.h index f160b83..0a9c9ff 100644 --- a/ash/components/timezone/timezone_resolver.h +++ b/ash/components/timezone/timezone_resolver.h
@@ -32,8 +32,7 @@ using ApplyTimeZoneCallback = base::RepeatingCallback<void(const TimeZoneResponseData*)>; - // chromeos::DelayNetworkCall cannot be used directly due to link - // restrictions. + // `ash::DelayNetworkCall` cannot be used directly due to link restrictions. using DelayNetworkCallClosure = base::RepeatingCallback<void(base::OnceClosure)>;
diff --git a/ash/fast_ink/fast_ink_host.cc b/ash/fast_ink/fast_ink_host.cc index 2c57a7ab..faeb054 100644 --- a/ash/fast_ink/fast_ink_host.cc +++ b/ash/fast_ink/fast_ink_host.cc
@@ -114,8 +114,7 @@ gfx::Rect(last_frame_size_in_pixels_), gfx::Transform()); frame.render_pass_list.push_back(std::move(pass)); frame_sink_->SubmitCompositorFrame(std::move(frame), - /*hit_test_data_changed=*/true, - /*show_hit_test_borders=*/false); + /*hit_test_data_changed=*/true); // Delete sink holder immediately if not waiting for exported resources to // be reclaimed. @@ -145,8 +144,7 @@ last_frame_device_scale_factor_ = frame.metadata.device_scale_factor; frame.metadata.frame_token = ++next_frame_token_; frame_sink_->SubmitCompositorFrame(std::move(frame), - /*hit_test_data_changed=*/true, - /*show_hit_test_borders=*/false); + /*hit_test_data_changed=*/true); } void DamageExportedResources() {
diff --git a/ash/fast_ink/view_tree_host_root_view.cc b/ash/fast_ink/view_tree_host_root_view.cc index 9c8a27b..b787339 100644 --- a/ash/fast_ink/view_tree_host_root_view.cc +++ b/ash/fast_ink/view_tree_host_root_view.cc
@@ -108,8 +108,7 @@ gfx::Transform()); frame.render_pass_list.push_back(std::move(pass)); holder->frame_sink_->SubmitCompositorFrame(std::move(frame), - /*hit_test_data_changed=*/true, - /*show_hit_test_borders=*/false); + /*hit_test_data_changed=*/true); // Delete sink holder immediately if not waiting for exported resources to // be reclaimed. @@ -140,8 +139,7 @@ last_frame_device_scale_factor_ = frame.metadata.device_scale_factor; frame.metadata.frame_token = ++next_frame_token_; frame_sink_->SubmitCompositorFrame(std::move(frame), - /*hit_test_data_changed=*/true, - /*show_hit_test_borders=*/false); + /*hit_test_data_changed=*/true); } void DamageExportedResources() {
diff --git a/ash/quick_pair/pairing/fast_pair/fast_pair_pairer.cc b/ash/quick_pair/pairing/fast_pair/fast_pair_pairer.cc index a9d7013..c878c004 100644 --- a/ash/quick_pair/pairing/fast_pair/fast_pair_pairer.cc +++ b/ash/quick_pair/pairing/fast_pair/fast_pair_pairer.cc
@@ -131,7 +131,7 @@ QP_LOG(VERBOSE) << "Key-based pairing changed. Address: " << device_address << ". Found device: " - << ((device != nullptr) ? "Yes" : "No") << "."; + << ((device_ != nullptr) ? "Yes" : "No") << "."; if (bt_device) { bt_device->Pair(this, base::BindOnce(&FastPairPairer::OnPairConnected,
diff --git a/ash/quick_pair/scanning/fast_pair/fast_pair_not_discoverable_scanner.cc b/ash/quick_pair/scanning/fast_pair/fast_pair_not_discoverable_scanner.cc index 1cbd55ca..32dd20f 100644 --- a/ash/quick_pair/scanning/fast_pair/fast_pair_not_discoverable_scanner.cc +++ b/ash/quick_pair/scanning/fast_pair/fast_pair_not_discoverable_scanner.cc
@@ -219,9 +219,8 @@ device::BluetoothDevice* ble_device = adapter_->GetDevice(device->ble_address); - bool is_already_paired = - (classic_device ? classic_device->IsPaired() : false) || - (ble_device && ble_device->IsPaired()); + bool is_already_paired = (classic_device && classic_device->IsPaired()) || + (ble_device && ble_device->IsPaired()); if (is_already_paired) { QP_LOG(INFO) << __func__ << ": Already paired with " << device;
diff --git a/ash/quick_pair/ui/fast_pair/fast_pair_notification_controller.cc b/ash/quick_pair/ui/fast_pair/fast_pair_notification_controller.cc index 50789ad..7e329beb 100644 --- a/ash/quick_pair/ui/fast_pair/fast_pair_notification_controller.cc +++ b/ash/quick_pair/ui/fast_pair/fast_pair_notification_controller.cc
@@ -9,6 +9,7 @@ #include "ash/strings/grit/ash_strings.h" #include "base/bind.h" #include "base/callback_helpers.h" +#include "base/time/time.h" #include "ui/base/l10n/l10n_util.h" #include "ui/message_center/message_center.h" #include "ui/message_center/public/cpp/notification.h" @@ -35,6 +36,8 @@ // progress bar. const int kInfiniteLoadingProgressValue = -1; +constexpr base::TimeDelta kNotificationTimeout = base::Seconds(30); + // Creates an empty Fast Pair notification with the given id and uses the // Bluetooth icon and FastPair notifierID. std::unique_ptr<message_center::Notification> CreateNotification( @@ -56,7 +59,6 @@ /*delegate=*/nullptr, /*small_image=*/ash::kNotificationBluetoothIcon, /*warning_level=*/warning_level); - notification->set_never_timeout(true); notification->set_priority( message_center::NotificationPriority::MAX_PRIORITY); @@ -76,10 +78,12 @@ explicit NotificationDelegate( base::RepeatingClosure on_primary_click, base::OnceCallback<void(bool)> on_close, - base::RepeatingClosure on_secondary_click = base::DoNothing()) { + base::RepeatingClosure on_secondary_click = base::DoNothing(), + base::OneShotTimer* expire_notification_timer = nullptr) { on_primary_click_ = on_primary_click; on_secondary_click_ = on_secondary_click; on_close_ = std::move(on_close); + expire_notification_timer_ = expire_notification_timer; } protected: @@ -103,13 +107,22 @@ } // message_center::NotificationDelegate override: - void Close(bool by_user) override { std::move(on_close_).Run(by_user); } + void Close(bool by_user) override { + // If there is an expire notification timer, stop the timer if the user + // dismisses the notification to prevent the timer firing and removing + // notifications that might come up later. + if (expire_notification_timer_) + expire_notification_timer_->Stop(); + + std::move(on_close_).Run(by_user); + } private: enum class Button { kPrimaryButton, kSecondaryButton }; base::RepeatingClosure on_primary_click_; base::RepeatingClosure on_secondary_click_; base::OnceCallback<void(bool)> on_close_; + base::OneShotTimer* expire_notification_timer_; }; FastPairNotificationController::FastPairNotificationController() = default; @@ -163,9 +176,19 @@ discovery_notification->set_delegate( base::MakeRefCounted<NotificationDelegate>( /*on_primary_click=*/on_connect_clicked, - /*on_close=*/std::move(on_close))); + /*on_close=*/std::move(on_close), + /*on_secondary_click=*/base::DoNothing(), + /*expire_notification_timer=*/&expire_notification_timer_)); discovery_notification->set_image(device_image); + // Start timer for how long to show the notification before removing the + // notification. After the timeout period, we will remove the notification + // from the Message Center. + expire_notification_timer_.Start( + FROM_HERE, kNotificationTimeout, + base::BindOnce(&FastPairNotificationController::RemoveNotifications, + weak_ptr_factory_.GetWeakPtr())); + MessageCenter::Get()->AddNotification(std::move(discovery_notification)); } @@ -174,6 +197,14 @@ gfx::Image device_image, base::RepeatingClosure on_cancel_clicked, base::OnceCallback<void(bool)> on_close) { + // If we get to this point in the pairing flow where we are showing the + // Pairing notification, then the user has elected to begin pairing and we + // can stop the timer that was waiting for user interaction on the + // Discovery notification. We do not need the timer for the Pairing + // notification since it will be removed when pairing succeeds or fails by + // the system. + expire_notification_timer_.Stop(); + std::unique_ptr<message_center::Notification> pairing_notification = CreateNotification( kFastPairPairingNotificationId, @@ -222,9 +253,18 @@ base::MakeRefCounted<NotificationDelegate>( /*on_primary_click=*/on_save_clicked, /*on_close=*/std::move(on_close), - /*on_secondary_click=*/on_learn_more_clicked)); + /*on_secondary_click=*/on_learn_more_clicked, + /*expire_notification_timer=*/&expire_notification_timer_)); associate_account_notification->set_image(device_image); + // Start timer for how long to show the notification before removing the + // notification. After the timeout period, we will remove the notification + // from the Message Center. + expire_notification_timer_.Start( + FROM_HERE, kNotificationTimeout, + base::BindOnce(&FastPairNotificationController::RemoveNotifications, + weak_ptr_factory_.GetWeakPtr())); + MessageCenter::Get()->AddNotification( std::move(associate_account_notification)); }
diff --git a/ash/quick_pair/ui/fast_pair/fast_pair_notification_controller.h b/ash/quick_pair/ui/fast_pair/fast_pair_notification_controller.h index facdce5..e856c9a 100644 --- a/ash/quick_pair/ui/fast_pair/fast_pair_notification_controller.h +++ b/ash/quick_pair/ui/fast_pair/fast_pair_notification_controller.h
@@ -7,6 +7,8 @@ #include "base/callback.h" #include "base/component_export.h" +#include "base/memory/weak_ptr.h" +#include "base/timer/timer.h" #include "ui/gfx/image/image.h" namespace ash { @@ -43,6 +45,14 @@ base::RepeatingClosure on_learn_more_clicked, base::OnceCallback<void(bool)> on_close); void RemoveNotifications(); + + private: + // This timer is used for Discovery and Associate Account notifications to + // remove them from the Message Center if the user does not elect to begin + // pairing/saving to their account. + base::OneShotTimer expire_notification_timer_; + + base::WeakPtrFactory<FastPairNotificationController> weak_ptr_factory_{this}; }; } // namespace quick_pair
diff --git a/ash/strings/ash_strings_bg.xtb b/ash/strings/ash_strings_bg.xtb index c2167d1..3a49ba0b 100644 --- a/ash/strings/ash_strings_bg.xtb +++ b/ash/strings/ash_strings_bg.xtb
@@ -53,6 +53,10 @@ <translation id="1247519845643687288">Скорошни приложения</translation> <translation id="1252999807265626933">Зарежда се от <ph name="POWER_SOURCE" /></translation> <translation id="1255033239764210633">„What's the weather?“ („Какво е времето?“)</translation> +<translation id="1262870540683925850"><ph name="START_TIME" /> до + <ph name="END_TIME" />, + <ph name="TIME_ZONE" />, + <ph name="EVENT_SUMMARY" />. За още подробности в Google Календар изберете събитието.</translation> <translation id="1266097335951928626">Стартиране на камерата за селфи</translation> <translation id="1267032506238418139">Промяна на клавишната комбинация</translation> <translation id="1269405891096105529">Периферното устройство не се поддържа в режим на гост</translation> @@ -997,6 +1001,8 @@ <translation id="7720410380936703141">НОВ ОПИТ</translation> <translation id="7723389094756330927">{NUM_NOTIFICATIONS,plural, =1{1 известие}other{# известия}}</translation> <translation id="7724603315864178912">Изрязване</translation> +<translation id="7734209118399753735"><ph name="EVENT_SUMMARY" />, + <ph name="TIME_RANGE" /></translation> <translation id="7745560842763881396">Показване на приложенията в лавицата</translation> <translation id="7749443890790263709">Достигнат е максималният брой работни кътове.</translation> <translation id="7749640678855296659">Понастоящем микрофонът ви е изключен</translation>
diff --git a/ash/strings/ash_strings_id.xtb b/ash/strings/ash_strings_id.xtb index 2aa0997..66c1243 100644 --- a/ash/strings/ash_strings_id.xtb +++ b/ash/strings/ash_strings_id.xtb
@@ -53,6 +53,10 @@ <translation id="1247519845643687288">Aplikasi terbaru</translation> <translation id="1252999807265626933">Mengisi daya dari <ph name="POWER_SOURCE" /></translation> <translation id="1255033239764210633">Gimana kondisi cuaca?</translation> +<translation id="1262870540683925850"><ph name="START_TIME" /> sampai + <ph name="END_TIME" />, + <ph name="TIME_ZONE" />, + <ph name="EVENT_SUMMARY" />. Pilih acara untuk mengetahui detail selengkapnya di Google Kalender.</translation> <translation id="1266097335951928626">Mulai kamera selfie</translation> <translation id="1267032506238418139">Perubahan pintasan</translation> <translation id="1269405891096105529">Periferal tidak didukung dalam mode Tamu</translation> @@ -997,6 +1001,8 @@ <translation id="7720410380936703141">COBA LAGI</translation> <translation id="7723389094756330927">{NUM_NOTIFICATIONS,plural, =1{1 notifikasi}other{# notifikasi}}</translation> <translation id="7724603315864178912">Potong</translation> +<translation id="7734209118399753735"><ph name="EVENT_SUMMARY" />, + <ph name="TIME_RANGE" /></translation> <translation id="7745560842763881396">Tampilkan aplikasi di rak</translation> <translation id="7749443890790263709">Jumlah halaman kerja maksimum tercapai.</translation> <translation id="7749640678855296659">Mikrofon Anda saat ini dinonaktifkan</translation>
diff --git a/ash/strings/ash_strings_ko.xtb b/ash/strings/ash_strings_ko.xtb index 9aa6db48..358ccdf 100644 --- a/ash/strings/ash_strings_ko.xtb +++ b/ash/strings/ash_strings_ko.xtb
@@ -53,6 +53,10 @@ <translation id="1247519845643687288">최근 앱</translation> <translation id="1252999807265626933"><ph name="POWER_SOURCE" />에서 충전 중</translation> <translation id="1255033239764210633">날씨가 어때?</translation> +<translation id="1262870540683925850"><ph name="START_TIME" />~ + <ph name="END_TIME" />, + <ph name="TIME_ZONE" />, + <ph name="EVENT_SUMMARY" />. Google Calendar에서 세부 사항을 선택하세요.</translation> <translation id="1266097335951928626">셀카 카메라 시작</translation> <translation id="1267032506238418139">단축키 변경</translation> <translation id="1269405891096105529">게스트 모드에서는 주변기기가 지원되지 않습니다.</translation> @@ -997,6 +1001,8 @@ <translation id="7720410380936703141">다시 시도</translation> <translation id="7723389094756330927">{NUM_NOTIFICATIONS,plural, =1{알림 1개}other{알림 #개}}</translation> <translation id="7724603315864178912">잘라내기</translation> +<translation id="7734209118399753735"><ph name="EVENT_SUMMARY" />, + <ph name="TIME_RANGE" /></translation> <translation id="7745560842763881396">실행기에 앱 표시</translation> <translation id="7749443890790263709">최대 데스크 개수에 도달했습니다.</translation> <translation id="7749640678855296659">현재 마이크가 꺼져 있습니다.</translation>
diff --git a/ash/strings/ash_strings_uk.xtb b/ash/strings/ash_strings_uk.xtb index a48033a..194791b 100644 --- a/ash/strings/ash_strings_uk.xtb +++ b/ash/strings/ash_strings_uk.xtb
@@ -53,6 +53,10 @@ <translation id="1247519845643687288">Нещодавні додатки</translation> <translation id="1252999807265626933">Джерело заряджання: <ph name="POWER_SOURCE" /></translation> <translation id="1255033239764210633">Який прогноз погоди?</translation> +<translation id="1262870540683925850"><ph name="START_TIME" />– + <ph name="END_TIME" />, + <ph name="TIME_ZONE" />, + <ph name="EVENT_SUMMARY" />. Виберіть подію, щоб переглянути відомості про неї в Google Календарі.</translation> <translation id="1266097335951928626">Увімкнути камеру для селфі</translation> <translation id="1267032506238418139">Зміна комбінацій клавіш</translation> <translation id="1269405891096105529">Периферійні пристрої не підтримуються в режимі гостя</translation> @@ -997,6 +1001,8 @@ <translation id="7720410380936703141">ПОВТОРИТИ</translation> <translation id="7723389094756330927">{NUM_NOTIFICATIONS,plural, =1{1 cповіщення}one{# сповіщення}few{# сповіщення}many{# сповіщень}other{# сповіщення}}</translation> <translation id="7724603315864178912">Вирізати</translation> +<translation id="7734209118399753735"><ph name="EVENT_SUMMARY" />, + <ph name="TIME_RANGE" /></translation> <translation id="7745560842763881396">Показати додатки на полиці</translation> <translation id="7749443890790263709">Ви додали максимальну кількість робочих столів.</translation> <translation id="7749640678855296659">Мікрофон наразі вимкнено</translation>
diff --git a/ash/strings/ash_strings_uz.xtb b/ash/strings/ash_strings_uz.xtb index 5b18e341..77540ce 100644 --- a/ash/strings/ash_strings_uz.xtb +++ b/ash/strings/ash_strings_uz.xtb
@@ -53,6 +53,10 @@ <translation id="1247519845643687288">Oxirgi ilovalar</translation> <translation id="1252999807265626933"><ph name="POWER_SOURCE" /> orqali quvvat olmoqda</translation> <translation id="1255033239764210633">Ob-havo qanday?</translation> +<translation id="1262870540683925850"><ph name="START_TIME" /> – + <ph name="END_TIME" />, + <ph name="TIME_ZONE" />, + <ph name="EVENT_SUMMARY" />. Google Taqvimda tafsilotlarini koʻrish uchun tadbirni tanlang.</translation> <translation id="1266097335951928626">Old kamerani yoqish</translation> <translation id="1267032506238418139">Tugmalar birikmasini o‘zgartirish</translation> <translation id="1269405891096105529">Mehmon rejimida tashqi qurilmalar ishlamaydi</translation> @@ -997,6 +1001,8 @@ <translation id="7720410380936703141">QAYTADAN</translation> <translation id="7723389094756330927">{NUM_NOTIFICATIONS,plural, =1{1 ta bildirishnoma}other{# ta bildirishnoma}}</translation> <translation id="7724603315864178912">Qirqish</translation> +<translation id="7734209118399753735"><ph name="EVENT_SUMMARY" />, + <ph name="TIME_RANGE" /></translation> <translation id="7745560842763881396">Ilovalarni ishga tushirish panelida chiqarish</translation> <translation id="7749443890790263709">Ish stollari maksimal miqdorda.</translation> <translation id="7749640678855296659">Mikrofon hozir yoniq emas</translation>
diff --git a/ash/strings/ash_strings_vi.xtb b/ash/strings/ash_strings_vi.xtb index a3988e52..edb6e28 100644 --- a/ash/strings/ash_strings_vi.xtb +++ b/ash/strings/ash_strings_vi.xtb
@@ -53,6 +53,10 @@ <translation id="1247519845643687288">Ứng dụng gần đây</translation> <translation id="1252999807265626933">Đang sạc từ <ph name="POWER_SOURCE" /></translation> <translation id="1255033239764210633">Tình hình thời tiết thế nào?</translation> +<translation id="1262870540683925850"><ph name="START_TIME" /> đến + <ph name="END_TIME" />, + <ph name="TIME_ZONE" />, + <ph name="EVENT_SUMMARY" />. Chọn để xem thêm thông tin chi tiết trong Lịch Google.</translation> <translation id="1266097335951928626">Bắt đầu máy ảnh ở chế độ tự chụp ảnh chân dung</translation> <translation id="1267032506238418139">Thay đổi phím tắt</translation> <translation id="1269405891096105529">Chế độ khách không hỗ trợ thiết bị ngoại vi</translation> @@ -997,6 +1001,8 @@ <translation id="7720410380936703141">THỬ LẠI</translation> <translation id="7723389094756330927">{NUM_NOTIFICATIONS,plural, =1{1 thông báo}other{# thông báo}}</translation> <translation id="7724603315864178912">Cắt</translation> +<translation id="7734209118399753735"><ph name="EVENT_SUMMARY" />, + <ph name="TIME_RANGE" /></translation> <translation id="7745560842763881396">Hiện các ứng dụng trên kệ</translation> <translation id="7749443890790263709">Đã đạt đến số lượng không gian làm việc tối đa.</translation> <translation id="7749640678855296659">Micrô của bạn đang tắt</translation>
diff --git a/ash/strings/ash_strings_zh-HK.xtb b/ash/strings/ash_strings_zh-HK.xtb index d5395fd..5eb036e 100644 --- a/ash/strings/ash_strings_zh-HK.xtb +++ b/ash/strings/ash_strings_zh-HK.xtb
@@ -53,6 +53,10 @@ <translation id="1247519845643687288">最近使用的應用程式</translation> <translation id="1252999807265626933">正在使用 <ph name="POWER_SOURCE" />充電</translation> <translation id="1255033239764210633">天氣點樣?</translation> +<translation id="1262870540683925850"><ph name="START_TIME" />至 + <ph name="END_TIME" />, + <ph name="TIME_ZONE" />, + <ph name="EVENT_SUMMARY" />。揀活動就可以喺 Google 日曆度睇詳情。</translation> <translation id="1266097335951928626">啟用自拍鏡頭</translation> <translation id="1267032506238418139">快速鍵有變動</translation> <translation id="1269405891096105529">訪客模式不支援周邊裝置</translation> @@ -995,6 +999,8 @@ <translation id="7720410380936703141">再試一次</translation> <translation id="7723389094756330927">{NUM_NOTIFICATIONS,plural, =1{1 則通知}other{# 則通知}}</translation> <translation id="7724603315864178912">剪下</translation> +<translation id="7734209118399753735"><ph name="EVENT_SUMMARY" />, + <ph name="TIME_RANGE" /></translation> <translation id="7745560842763881396">在捷徑列中顯示應用程式</translation> <translation id="7749443890790263709">桌面數量已達上限。</translation> <translation id="7749640678855296659">麥克風目前已關閉</translation>
diff --git a/base/allocator/partition_allocator/partition_alloc_unittest.cc b/base/allocator/partition_allocator/partition_alloc_unittest.cc index 142c828..b30e6c8 100644 --- a/base/allocator/partition_allocator/partition_alloc_unittest.cc +++ b/base/allocator/partition_allocator/partition_alloc_unittest.cc
@@ -282,8 +282,8 @@ size_t num_slots = (bucket->num_system_pages_per_slot_span * SystemPageSize()) / bucket->slot_size; - void* first = nullptr; - void* last = nullptr; + uintptr_t first = 0; + uintptr_t last = 0; size_t i; for (i = 0; i < num_slots; ++i) { void* ptr = allocator.root()->Alloc(size, type_name); @@ -297,10 +297,8 @@ SlotSpan::FromSlotStartPtr(base::memory::UnmaskPtr(last))); if (bucket->num_system_pages_per_slot_span == NumSystemPagesPerPartitionPage()) - EXPECT_EQ(reinterpret_cast<size_t>(base::memory::UnmaskPtr(first)) & - PartitionPageBaseMask(), - reinterpret_cast<size_t>(base::memory::UnmaskPtr(last)) & - PartitionPageBaseMask()); + EXPECT_EQ(base::memory::UnmaskPtr(first) & PartitionPageBaseMask(), + base::memory::UnmaskPtr(last) & PartitionPageBaseMask()); EXPECT_EQ(num_slots, static_cast<size_t>( bucket->active_slot_spans_head->num_allocated_slots)); @@ -964,9 +962,8 @@ #if BUILDFLAG(USE_BACKUP_REF_PTR) uintptr_t address = reinterpret_cast<uintptr_t>(ptr); for (size_t offset = 0; offset < requested_size; ++offset) { - PA_EXPECT_ADDR_EQ( - PartitionAllocGetSlotStartInBRPPool(address + offset), - allocator.root()->AdjustPointerForExtrasSubtract(address)); + PA_EXPECT_ADDR_EQ(PartitionAllocGetSlotStartInBRPPool(address + offset), + allocator.root()->AdjustPointerForExtrasSubtract(ptr)); } #endif // BUILDFLAG(USE_BACKUP_REF_PTR) allocator.root()->Free(ptr); @@ -985,7 +982,7 @@ address = reinterpret_cast<uintptr_t>(ptr); for (size_t offset = 0; offset < requested_size; offset += 877) { PA_EXPECT_PTR_EQ(PartitionAllocGetSlotStartInBRPPool(address + offset), - allocator.root()->AdjustPointerForExtrasSubtract(address)); + allocator.root()->AdjustPointerForExtrasSubtract(ptr)); } #endif // BUILDFLAG(USE_BACKUP_REF_PTR) allocator.root()->Free(ptr); @@ -1009,7 +1006,7 @@ address = reinterpret_cast<uintptr_t>(ptr); for (size_t offset = 0; offset < requested_size; offset += 4999) { PA_EXPECT_PTR_EQ(PartitionAllocGetSlotStartInBRPPool(address + offset), - allocator.root()->AdjustPointerForExtrasSubtract(address)); + allocator.root()->AdjustPointerForExtrasSubtract(ptr)); } #endif // BUILDFLAG(USE_BACKUP_REF_PTR) @@ -1026,7 +1023,7 @@ address = reinterpret_cast<uintptr_t>(ptr); for (size_t offset = 0; offset < requested_size; offset += 4999) { PA_EXPECT_PTR_EQ(PartitionAllocGetSlotStartInBRPPool(address + offset), - allocator.root()->AdjustPointerForExtrasSubtract(address)); + allocator.root()->AdjustPointerForExtrasSubtract(ptr)); } #endif // BUILDFLAG(USE_BACKUP_REF_PTR) @@ -1048,9 +1045,8 @@ #if BUILDFLAG(USE_BACKUP_REF_PTR) address = reinterpret_cast<uintptr_t>(ptr); for (size_t offset = 0; offset < requested_size; offset += 16111) { - PA_EXPECT_PTR_EQ( - PartitionAllocGetSlotStartInBRPPool(address + offset), - allocator.root()->AdjustPointerForExtrasSubtract(address)); + PA_EXPECT_PTR_EQ(PartitionAllocGetSlotStartInBRPPool(address + offset), + allocator.root()->AdjustPointerForExtrasSubtract(ptr)); } #endif // BUILDFLAG(USE_BACKUP_REF_PTR) allocator.root()->Free(ptr); @@ -1164,9 +1160,8 @@ uintptr_t address = reinterpret_cast<uintptr_t>(ptr); EXPECT_EQ(allocator.root()->AllocationCapacityFromPtr(ptr), requested_size); for (size_t offset = 0; offset < requested_size; offset += 13) { - PA_EXPECT_PTR_EQ( - PartitionAllocGetSlotStartInBRPPool(address + offset), - allocator.root()->AdjustPointerForExtrasSubtract(address)); + PA_EXPECT_PTR_EQ(PartitionAllocGetSlotStartInBRPPool(address + offset), + allocator.root()->AdjustPointerForExtrasSubtract(ptr)); } allocator.root()->Free(ptr); } @@ -1184,7 +1179,7 @@ void* ptr2 = allocator.root()->Realloc(ptr, 0, type_name); EXPECT_EQ(nullptr, ptr2); PA_EXPECT_PTR_EQ(allocator.root()->AdjustPointerForExtrasSubtract(ptr), - slot_span->get_freelist_head()); + reinterpret_cast<uintptr_t>(slot_span->get_freelist_head())); // Test that growing an allocation with realloc() copies everything from the // old allocation. @@ -3479,15 +3474,14 @@ ASSERT_GT(large_size, kMaxBucketed); void* ptr = allocator.root()->Alloc(large_size, type_name); EXPECT_TRUE(ptr); - void* slot_start = allocator.root()->AdjustPointerForExtrasSubtract(ptr); - uintptr_t reservation_start = - reinterpret_cast<uintptr_t>(slot_start) - PartitionPageSize(); + uintptr_t slot_start = allocator.root()->AdjustPointerForExtrasSubtract(ptr); + uintptr_t reservation_start = slot_start - PartitionPageSize(); EXPECT_EQ(0U, reservation_start & DirectMapAllocationGranularityOffsetMask()); uintptr_t address = reinterpret_cast<uintptr_t>(ptr); for (uintptr_t a = address; a < address + large_size; ++a) { uintptr_t address2 = GetDirectMapReservationStart(a) + PartitionPageSize(); - EXPECT_EQ(reinterpret_cast<uintptr_t>(slot_start), address2); + EXPECT_EQ(slot_start, address2); } EXPECT_EQ(reservation_start, GetDirectMapReservationStart(
diff --git a/base/allocator/partition_allocator/partition_bucket.cc b/base/allocator/partition_allocator/partition_bucket.cc index accde667..cab197b4 100644 --- a/base/allocator/partition_allocator/partition_bucket.cc +++ b/base/allocator/partition_allocator/partition_bucket.cc
@@ -717,7 +717,8 @@ } template <bool thread_safe> -ALWAYS_INLINE char* PartitionBucket<thread_safe>::ProvisionMoreSlotsAndAllocOne( +ALWAYS_INLINE uintptr_t +PartitionBucket<thread_safe>::ProvisionMoreSlotsAndAllocOne( PartitionRoot<thread_safe>* root, SlotSpanMetadata<thread_safe>* slot_span) { PA_DCHECK(slot_span != @@ -733,15 +734,16 @@ PA_DCHECK(slot_span->num_allocated_slots >= 0); size_t size = slot_size; - char* base = reinterpret_cast<char*>( + uintptr_t slot_span_start = reinterpret_cast<uintptr_t>( SlotSpanMetadata<thread_safe>::ToSlotSpanStartPtr(slot_span)); // If we got here, the first unallocated slot is either partially or fully on // an uncommitted page. If the latter, it must be at the start of that page. - char* return_slot = base + (size * slot_span->num_allocated_slots); - char* next_slot = return_slot + size; - char* commit_start = bits::AlignUp(return_slot, SystemPageSize()); + uintptr_t return_slot = + slot_span_start + (size * slot_span->num_allocated_slots); + uintptr_t next_slot = return_slot + size; + uintptr_t commit_start = bits::AlignUp(return_slot, SystemPageSize()); PA_DCHECK(next_slot > commit_start); - char* commit_end = bits::AlignUp(next_slot, SystemPageSize()); + uintptr_t commit_end = bits::AlignUp(next_slot, SystemPageSize()); // If the slot was partially committed, |return_slot| and |next_slot| fall // in different pages. If the slot was fully uncommitted, |return_slot| points // to the page start and |next_slot| doesn't, thus only the latter gets @@ -777,13 +779,14 @@ // Add all slots that fit within so far committed pages to the free list. PartitionFreelistEntry* prev_entry = nullptr; - char* next_slot_end = next_slot + size; + uintptr_t next_slot_end = next_slot + size; size_t free_list_entries_added = 0; while (next_slot_end <= commit_end) { if (LIKELY(size <= kMaxMemoryTaggingSize)) { next_slot = memory::TagMemoryRangeRandomly(next_slot, size); } - auto* entry = new (next_slot) PartitionFreelistEntry(); + auto* entry = new (reinterpret_cast<PartitionFreelistEntry*>(next_slot)) + PartitionFreelistEntry(); if (!slot_span->get_freelist_head()) { PA_DCHECK(!prev_entry); PA_DCHECK(!free_list_entries_added); @@ -884,7 +887,7 @@ } template <bool thread_safe> -void* PartitionBucket<thread_safe>::SlowPathAlloc( +uintptr_t PartitionBucket<thread_safe>::SlowPathAlloc( PartitionRoot<thread_safe>* root, int flags, size_t raw_size, @@ -925,7 +928,7 @@ // No fast path for direct-mapped allocations. if (flags & PartitionAllocFastPathOrReturnNull) - return nullptr; + return 0; new_slot_span = PartitionDirectMap(root, flags, raw_size, slot_span_alignment); @@ -969,7 +972,7 @@ LIKELY(decommitted_slot_spans_head != nullptr)) { // Commit can be expensive, don't do it. if (flags & PartitionAllocFastPathOrReturnNull) - return nullptr; + return 0; new_slot_span = decommitted_slot_spans_head; PA_DCHECK(new_slot_span->bucket == this); @@ -998,7 +1001,7 @@ } else { // Getting a new slot span is expensive, don't do it. if (flags & PartitionAllocFastPathOrReturnNull) - return nullptr; + return 0; // Third. If we get here, we need a brand new slot span. // TODO(bartekn): For single-slot slot spans, we can use rounded raw_size @@ -1013,7 +1016,7 @@ PA_DCHECK(active_slot_spans_head == SlotSpanMetadata<thread_safe>::get_sentinel_slot_span()); if (flags & PartitionAllocReturnNull) - return nullptr; + return 0; // See comment in PartitionDirectMap() for unlocking. ScopedUnlockGuard<thread_safe> unlock{root->lock_}; root->OutOfMemory(raw_size); @@ -1033,7 +1036,7 @@ // We likely set *is_already_zeroed to true above, make sure that the // freelist entry doesn't contain data. - return entry->ClearForAllocation(); + return reinterpret_cast<uintptr_t>(entry->ClearForAllocation()); } // Otherwise, we need to provision more slots by committing more pages. Build
diff --git a/base/allocator/partition_allocator/partition_bucket.h b/base/allocator/partition_allocator/partition_bucket.h index f61bd72..252cde5e 100644 --- a/base/allocator/partition_allocator/partition_bucket.h +++ b/base/allocator/partition_allocator/partition_bucket.h
@@ -7,6 +7,7 @@ #include <stddef.h> #include <stdint.h> +#include <cstdint> #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h" @@ -63,11 +64,11 @@ // them. (See |PartitionRoot::AllocFromBucket|.) // // Note the matching Free() functions are in SlotSpanMetadata. - BASE_EXPORT NOINLINE void* SlowPathAlloc(PartitionRoot<thread_safe>* root, - int flags, - size_t raw_size, - size_t slot_span_alignment, - bool* is_already_zeroed) + BASE_EXPORT NOINLINE uintptr_t SlowPathAlloc(PartitionRoot<thread_safe>* root, + int flags, + size_t raw_size, + size_t slot_span_alignment, + bool* is_already_zeroed) EXCLUSIVE_LOCKS_REQUIRED(root->lock_); ALWAYS_INLINE bool CanStoreRawSize() const { @@ -184,9 +185,9 @@ // // If |slot_span| was freshly allocated, it must have been passed through // InitializeSlotSpan() first. - ALWAYS_INLINE char* ProvisionMoreSlotsAndAllocOne( - PartitionRoot<thread_safe>* root, - SlotSpanMetadata<thread_safe>* slot_span) + ALWAYS_INLINE uintptr_t + ProvisionMoreSlotsAndAllocOne(PartitionRoot<thread_safe>* root, + SlotSpanMetadata<thread_safe>* slot_span) EXCLUSIVE_LOCKS_REQUIRED(root->lock_); };
diff --git a/base/allocator/partition_allocator/partition_cookie.h b/base/allocator/partition_allocator/partition_cookie.h index 7e9396c..812bddfd 100644 --- a/base/allocator/partition_allocator/partition_cookie.h +++ b/base/allocator/partition_allocator/partition_cookie.h
@@ -23,14 +23,12 @@ constexpr size_t kPartitionCookieSizeAdjustment = kCookieSize; -ALWAYS_INLINE void PartitionCookieCheckValue(uintptr_t address) { - unsigned char* cookie_ptr = reinterpret_cast<unsigned char*>(address); +ALWAYS_INLINE void PartitionCookieCheckValue(unsigned char* cookie_ptr) { for (size_t i = 0; i < kCookieSize; ++i, ++cookie_ptr) PA_DCHECK(*cookie_ptr == kCookieValue[i]); } -ALWAYS_INLINE void PartitionCookieWriteValue(uintptr_t address) { - unsigned char* cookie_ptr = reinterpret_cast<unsigned char*>(address); +ALWAYS_INLINE void PartitionCookieWriteValue(unsigned char* cookie_ptr) { for (size_t i = 0; i < kCookieSize; ++i, ++cookie_ptr) *cookie_ptr = kCookieValue[i]; } @@ -39,9 +37,9 @@ constexpr size_t kPartitionCookieSizeAdjustment = 0; -ALWAYS_INLINE void PartitionCookieCheckValue(uintptr_t address) {} +ALWAYS_INLINE void PartitionCookieCheckValue(unsigned char* address) {} -ALWAYS_INLINE void PartitionCookieWriteValue(uintptr_t address) {} +ALWAYS_INLINE void PartitionCookieWriteValue(unsigned char* cookie_ptr) {} #endif // DCHECK_IS_ON()
diff --git a/base/allocator/partition_allocator/partition_freelist_entry.h b/base/allocator/partition_allocator/partition_freelist_entry.h index e3c64d2..d86b12d 100644 --- a/base/allocator/partition_allocator/partition_freelist_entry.h +++ b/base/allocator/partition_allocator/partition_freelist_entry.h
@@ -67,7 +67,7 @@ // Creates a new entry, with |next| following it. static ALWAYS_INLINE PartitionFreelistEntry* InitForThreadCache( - void* slot_start, + uintptr_t slot_start, PartitionFreelistEntry* next) { auto* entry = reinterpret_cast<PartitionFreelistEntry*>(slot_start); // ThreadCache freelists can point to entries across superpage boundaries,
diff --git a/base/allocator/partition_allocator/partition_page.h b/base/allocator/partition_allocator/partition_page.h index 09f4eaac..cf86172 100644 --- a/base/allocator/partition_allocator/partition_page.h +++ b/base/allocator/partition_allocator/partition_page.h
@@ -160,7 +160,7 @@ // Note the matching Alloc() functions are in PartitionPage. BASE_EXPORT NOINLINE void FreeSlowPath(size_t number_of_freed); ALWAYS_INLINE PartitionFreelistEntry* PopForAlloc(size_t size); - ALWAYS_INLINE void Free(void* ptr); + ALWAYS_INLINE void Free(uintptr_t ptr); // Appends the passed freelist to the slot-span's freelist. Please note that // the function doesn't increment the tags of the passed freelist entries, // since FreeNoHooks() did it already. @@ -178,9 +178,12 @@ // |slot_span| pointer may be the result of an offset calculation and // therefore cannot be trusted. The objective of these functions is to // sanitize this input. + // TODO(bartekn): void* -> uintptr_t ALWAYS_INLINE static void* ToSlotSpanStartPtr( const SlotSpanMetadata* slot_span); + // TODO(bartekn): Remove the void* version. Drop Ptr from the name. ALWAYS_INLINE static SlotSpanMetadata* FromSlotStartPtr(void* slot_start); + ALWAYS_INLINE static SlotSpanMetadata* FromSlotStartPtr(uintptr_t slot_start); ALWAYS_INLINE static SlotSpanMetadata* FromSlotInnerPtr(void* ptr); ALWAYS_INLINE PartitionSuperPageExtentEntry<thread_safe>* ToSuperPageExtent() @@ -452,7 +455,6 @@ bool with_quarantine) { address = memory::UnmaskPtr(address); PA_DCHECK(IsManagedByNormalBuckets(address)); - // TODO(bartekn): char* -> uintptr_t, incl. callees uintptr_t super_page = address & kSuperPageBaseMask; uintptr_t payload_start = SuperPagePayloadBegin(super_page, with_quarantine); uintptr_t payload_end = SuperPagePayloadEnd(super_page); @@ -593,6 +595,11 @@ slot_span->bucket->slot_size)); return slot_span; } +template <bool thread_safe> +ALWAYS_INLINE SlotSpanMetadata<thread_safe>* +SlotSpanMetadata<thread_safe>::FromSlotStartPtr(uintptr_t slot_start) { + return FromSlotStartPtr(reinterpret_cast<void*>(slot_start)); +} template <bool thread_safe> ALWAYS_INLINE void SlotSpanMetadata<thread_safe>::SetRawSize(size_t raw_size) { @@ -636,7 +643,7 @@ } template <bool thread_safe> -ALWAYS_INLINE void SlotSpanMetadata<thread_safe>::Free(void* slot_start) +ALWAYS_INLINE void SlotSpanMetadata<thread_safe>::Free(uintptr_t slot_start) EXCLUSIVE_LOCKS_REQUIRED( PartitionRoot<thread_safe>::FromSlotSpan(this)->lock_) { #if DCHECK_IS_ON() @@ -645,12 +652,12 @@ #endif PA_DCHECK(num_allocated_slots); + auto* entry = reinterpret_cast<internal::PartitionFreelistEntry*>(slot_start); // Catches an immediate double free. - PA_CHECK(slot_start != freelist_head); + PA_CHECK(entry != freelist_head); // Look for double free one level deeper in debug. PA_DCHECK(!freelist_head || - slot_start != freelist_head->GetNext(bucket->slot_size)); - auto* entry = static_cast<internal::PartitionFreelistEntry*>(slot_start); + entry != freelist_head->GetNext(bucket->slot_size)); entry->SetNext(freelist_head); SetFreelistHead(entry); --num_allocated_slots; @@ -754,9 +761,9 @@ next_slot_span = nullptr; } -// Returns the state bitmap from a pointer within a normal-bucket super page. +// Returns the state bitmap from an address within a normal-bucket super page. // It's the caller's responsibility to ensure that the bitmap exists. -ALWAYS_INLINE AllocationStateMap* StateBitmapFromPointer(uintptr_t address) { +ALWAYS_INLINE AllocationStateMap* StateBitmapFromAddr(uintptr_t address) { PA_DCHECK(IsManagedByNormalBuckets(address)); uintptr_t super_page = address & kSuperPageBaseMask; return SuperPageStateBitmap(super_page);
diff --git a/base/allocator/partition_allocator/partition_root.cc b/base/allocator/partition_allocator/partition_root.cc index 4c4a4883..d0b9d27 100644 --- a/base/allocator/partition_allocator/partition_root.cc +++ b/base/allocator/partition_allocator/partition_root.cc
@@ -4,6 +4,8 @@ #include "base/allocator/partition_allocator/partition_root.h" +#include <cstdint> + #include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/address_pool_manager_bitmap.h" #include "base/allocator/partition_allocator/oom.h" @@ -789,9 +791,10 @@ #if DCHECK_IS_ON() // Write a new trailing cookie. if (allow_cookie) { - uintptr_t user_data_start = AdjustPointerForExtrasAdd(slot_start); - size_t usable_size = slot_span->GetUsableSize(this); - internal::PartitionCookieWriteValue(user_data_start + usable_size); + auto* object = + reinterpret_cast<unsigned char*>(AdjustPointerForExtrasAdd(slot_start)); + internal::PartitionCookieWriteValue(object + + slot_span->GetUsableSize(this)); } #endif @@ -818,7 +821,7 @@ // statistics (and cookie, if present). if (slot_span->CanStoreRawSize()) { #if BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && DCHECK_IS_ON() - uintptr_t slot_start = AdjustPointerForExtrasSubtract(address); + uintptr_t slot_start = AdjustPointerForExtrasSubtract(ptr); internal::PartitionRefCount* old_ref_count; if (brp_enabled()) { old_ref_count = internal::PartitionRefCountPointer(slot_start); @@ -837,8 +840,9 @@ // Write a new trailing cookie only when it is possible to keep track // raw size (otherwise we wouldn't know where to look for it later). if (allow_cookie) { - size_t usable_size = slot_span->GetUsableSize(this); - internal::PartitionCookieWriteValue(address + usable_size); + internal::PartitionCookieWriteValue( + reinterpret_cast<unsigned char*>(address) + + slot_span->GetUsableSize(this)); } #endif // DCHECK_IS_ON() } @@ -1115,7 +1119,7 @@ } template <> -void* PartitionRoot<internal::ThreadSafe>::MaybeInitThreadCacheAndAlloc( +uintptr_t PartitionRoot<internal::ThreadSafe>::MaybeInitThreadCacheAndAlloc( uint16_t bucket_index, size_t* slot_size) { auto* tcache = internal::ThreadCache::Get(); @@ -1130,7 +1134,7 @@ // be us, in which case we are re-entering and should not create a thread // cache. If it is not us, then this merely delays thread cache // construction a bit, which is not an issue. - return nullptr; + return 0; } // There is no per-thread ThreadCache allocated here yet, and this partition
diff --git a/base/allocator/partition_allocator/partition_root.h b/base/allocator/partition_allocator/partition_root.h index 3fc394f..3645b6e 100644 --- a/base/allocator/partition_allocator/partition_root.h +++ b/base/allocator/partition_allocator/partition_root.h
@@ -482,12 +482,12 @@ static uint16_t SizeToBucketIndex(size_t size); - ALWAYS_INLINE void FreeInSlotSpan(void* slot_start, SlotSpan* slot_span) + ALWAYS_INLINE void FreeInSlotSpan(uintptr_t slot_start, SlotSpan* slot_span) EXCLUSIVE_LOCKS_REQUIRED(lock_); // Frees memory, with |slot_start| as returned by |RawAlloc()|. - ALWAYS_INLINE void RawFree(void* slot_start); - ALWAYS_INLINE void RawFree(void* slot_start, SlotSpan* slot_span) + ALWAYS_INLINE void RawFree(uintptr_t slot_start); + ALWAYS_INLINE void RawFree(uintptr_t slot_start, SlotSpan* slot_span) LOCKS_EXCLUDED(lock_); ALWAYS_INLINE void RawFreeBatch(FreeListEntry* head, @@ -495,7 +495,7 @@ size_t size, SlotSpan* slot_span) LOCKS_EXCLUDED(lock_); - ALWAYS_INLINE void RawFreeWithThreadCache(void* slot_start, + ALWAYS_INLINE void RawFreeWithThreadCache(uintptr_t slot_start, SlotSpan* slot_span); internal::ThreadCache* thread_cache_for_testing() const { @@ -641,24 +641,13 @@ } // TODO(bartekn): Consider |void* SlotStartToObjectStart(uintptr_t)|. - ALWAYS_INLINE uintptr_t AdjustPointerForExtrasAdd(uintptr_t address) const { - return address + extras_offset; - } - // TODO(bartekn): Remove the |void*| variant. - ALWAYS_INLINE void* AdjustPointerForExtrasAdd(void* ptr) const { - return reinterpret_cast<void*>( - AdjustPointerForExtrasAdd(reinterpret_cast<uintptr_t>(ptr))); + ALWAYS_INLINE void* AdjustPointerForExtrasAdd(uintptr_t address) const { + return reinterpret_cast<void*>(address + extras_offset); } // TODO(bartekn): Consider |uintptr_t ObjectStartToSlotStart(void*)|. - ALWAYS_INLINE uintptr_t - AdjustPointerForExtrasSubtract(uintptr_t address) const { - return address - extras_offset; - } - // TODO(bartekn): Remove the |void*| variant. - ALWAYS_INLINE void* AdjustPointerForExtrasSubtract(void* ptr) const { - return reinterpret_cast<void*>( - AdjustPointerForExtrasSubtract(reinterpret_cast<uintptr_t>(ptr))); + ALWAYS_INLINE uintptr_t AdjustPointerForExtrasSubtract(void* ptr) const { + return reinterpret_cast<uintptr_t>(ptr) - extras_offset; } bool brp_enabled() const { @@ -725,20 +714,18 @@ // |requested_size|. // - |usable_size| and |is_already_zeroed| are output only. |usable_size| is // guaranteed to be larger or equal to AllocFlags()'s |requested_size|. - // - // TODO(bartekn): void* -> uintptr_t - ALWAYS_INLINE void* RawAlloc(Bucket* bucket, - int flags, - size_t raw_size, - size_t slot_span_alignment, - size_t* usable_size, - bool* is_already_zeroed); - ALWAYS_INLINE void* AllocFromBucket(Bucket* bucket, - int flags, - size_t raw_size, - size_t slot_span_alignment, - size_t* usable_size, - bool* is_already_zeroed) + ALWAYS_INLINE uintptr_t RawAlloc(Bucket* bucket, + int flags, + size_t raw_size, + size_t slot_span_alignment, + size_t* usable_size, + bool* is_already_zeroed); + ALWAYS_INLINE uintptr_t AllocFromBucket(Bucket* bucket, + int flags, + size_t raw_size, + size_t slot_span_alignment, + size_t* usable_size, + bool* is_already_zeroed) EXCLUSIVE_LOCKS_REQUIRED(lock_); bool TryReallocInPlaceForNormalBuckets(void* ptr, @@ -748,9 +735,10 @@ internal::SlotSpanMetadata<thread_safe>* slot_span, size_t requested_size) EXCLUSIVE_LOCKS_REQUIRED(lock_); void DecommitEmptySlotSpans() EXCLUSIVE_LOCKS_REQUIRED(lock_); - ALWAYS_INLINE void RawFreeLocked(void* slot_start) + ALWAYS_INLINE void RawFreeLocked(uintptr_t slot_start) EXCLUSIVE_LOCKS_REQUIRED(lock_); - void* MaybeInitThreadCacheAndAlloc(uint16_t bucket_index, size_t* slot_size); + uintptr_t MaybeInitThreadCacheAndAlloc(uint16_t bucket_index, + size_t* slot_size); friend class internal::ThreadCache; }; @@ -893,22 +881,19 @@ // Double check that ref-count is indeed present. PA_DCHECK(root->brp_enabled()); - // TODO(bartekn): Remove reinterpret_casts. - uintptr_t user_data_start = reinterpret_cast<uintptr_t>( - root->AdjustPointerForExtrasAdd(reinterpret_cast<void*>(slot_start))); - size_t user_data_size = slot_span->GetUsableSize(root); + uintptr_t object_start = + reinterpret_cast<uintptr_t>(root->AdjustPointerForExtrasAdd(slot_start)); uintptr_t new_address = address + delta_in_bytes; - return user_data_start <= new_address && + return object_start <= new_address && // We use "greater then or equal" below because we want to include // pointers right past the end of an allocation. - new_address <= user_data_start + user_data_size; + new_address <= object_start + slot_span->GetUsableSize(root); } ALWAYS_INLINE void PartitionAllocFreeForRefCounting(uintptr_t slot_start) { PA_DCHECK(!internal::PartitionRefCountPointer(slot_start)->IsAlive()); - auto* slot_span = SlotSpanMetadata<ThreadSafe>::FromSlotStartPtr( - reinterpret_cast<void*>(slot_start)); + auto* slot_span = SlotSpanMetadata<ThreadSafe>::FromSlotStartPtr(slot_start); auto* root = PartitionRoot<ThreadSafe>::FromSlotSpan(slot_span); // PartitionRefCount is required to be allocated inside a `PartitionRoot` that // supports reference counts. @@ -929,20 +914,20 @@ root->total_count_of_brp_quarantined_slots.fetch_sub( 1, std::memory_order_relaxed); - root->RawFreeWithThreadCache(reinterpret_cast<void*>(slot_start), slot_span); + root->RawFreeWithThreadCache(slot_start, slot_span); } #endif // BUILDFLAG(USE_BACKUP_REF_PTR) } // namespace internal template <bool thread_safe> -ALWAYS_INLINE void* PartitionRoot<thread_safe>::AllocFromBucket( - Bucket* bucket, - int flags, - size_t raw_size, - size_t slot_span_alignment, - size_t* usable_size, - bool* is_already_zeroed) { +ALWAYS_INLINE uintptr_t +PartitionRoot<thread_safe>::AllocFromBucket(Bucket* bucket, + int flags, + size_t raw_size, + size_t slot_span_alignment, + size_t* usable_size, + bool* is_already_zeroed) { PA_DCHECK((slot_span_alignment >= PartitionPageSize()) && bits::IsPowerOfTwo(slot_span_alignment)); SlotSpan* slot_span = bucket->active_slot_spans_head; @@ -950,7 +935,8 @@ PA_DCHECK(slot_span); PA_DCHECK(slot_span->num_allocated_slots >= 0); - void* slot_start = slot_span->get_freelist_head(); + uintptr_t slot_start = + reinterpret_cast<uintptr_t>(slot_span->get_freelist_head()); // Use the fast path when a slot is readily available on the free list of the // first active slot span. However, fall back to the slow path if a // higher-order alignment is requested, because an inner slot of an existing @@ -971,14 +957,14 @@ PA_DCHECK(!slot_span->CanStoreRawSize()); PA_DCHECK(!slot_span->bucket->is_direct_mapped()); void* entry = slot_span->PopForAlloc(bucket->slot_size); - PA_DCHECK(entry == slot_start); + PA_DCHECK(reinterpret_cast<uintptr_t>(entry) == slot_start); PA_DCHECK(slot_span->bucket == bucket); } else { slot_start = bucket->SlowPathAlloc(this, flags, raw_size, slot_span_alignment, is_already_zeroed); if (UNLIKELY(!slot_start)) - return nullptr; + return 0; slot_span = SlotSpan::FromSlotStartPtr(slot_start); // TODO(crbug.com/1257655): See if we can afford to make this a CHECK. @@ -1075,7 +1061,7 @@ PA_DCHECK(FromSlotSpan(slot_span) == root); const size_t slot_size = slot_span->bucket->slot_size; - uintptr_t slot_start = root->AdjustPointerForExtrasSubtract(address); + uintptr_t slot_start = root->AdjustPointerForExtrasSubtract(ptr); if (LIKELY(slot_size <= kMaxMemoryTaggingSize)) { // Incrementing the memory range returns the true underlying tag, so // RemaskPtr is not required here. @@ -1135,8 +1121,9 @@ if (allow_cookie) { // Verify the cookie after the allocated region. // If this assert fires, you probably corrupted memory. - internal::PartitionCookieCheckValue(address + - slot_span->GetUsableSize(this)); + internal::PartitionCookieCheckValue( + reinterpret_cast<unsigned char*>(address) + + slot_span->GetUsableSize(this)); } #endif @@ -1146,7 +1133,7 @@ if (LIKELY(internal::IsManagedByNormalBuckets(address))) { uintptr_t unmasked_slot_start = memory::UnmaskPtr(slot_start); // Mark the state in the state bitmap as freed. - internal::StateBitmapFromPointer(unmasked_slot_start) + internal::StateBitmapFromAddr(unmasked_slot_start) ->Free(unmasked_slot_start); } } @@ -1195,12 +1182,12 @@ } #endif // defined(PA_ZERO_RANDOMLY_ON_FREE) - RawFreeWithThreadCache(reinterpret_cast<void*>(slot_start), slot_span); + RawFreeWithThreadCache(slot_start, slot_span); } template <bool thread_safe> ALWAYS_INLINE void PartitionRoot<thread_safe>::FreeInSlotSpan( - void* slot_start, + uintptr_t slot_start, SlotSpan* slot_span) { // An underflow here means we've miscounted |total_size_of_allocated_bytes| // somewhere. @@ -1211,13 +1198,13 @@ } template <bool thread_safe> -ALWAYS_INLINE void PartitionRoot<thread_safe>::RawFree(void* slot_start) { +ALWAYS_INLINE void PartitionRoot<thread_safe>::RawFree(uintptr_t slot_start) { SlotSpan* slot_span = SlotSpan::FromSlotStartPtr(slot_start); RawFree(slot_start, slot_span); } template <bool thread_safe> -ALWAYS_INLINE void PartitionRoot<thread_safe>::RawFree(void* slot_start, +ALWAYS_INLINE void PartitionRoot<thread_safe>::RawFree(uintptr_t slot_start, SlotSpan* slot_span) { // At this point we are about to acquire the lock, so we try to minimize the // risk of blocking inside the locked section. @@ -1275,10 +1262,9 @@ slot_span->AppendFreeList(head, tail, size); } -// TODO(bartekn): void* -> uintptr_t template <bool thread_safe> ALWAYS_INLINE void PartitionRoot<thread_safe>::RawFreeWithThreadCache( - void* slot_start, + uintptr_t slot_start, SlotSpan* slot_span) { // TLS access can be expensive, do a cheap local check first. // @@ -1301,7 +1287,8 @@ } template <bool thread_safe> -ALWAYS_INLINE void PartitionRoot<thread_safe>::RawFreeLocked(void* slot_start) { +ALWAYS_INLINE void PartitionRoot<thread_safe>::RawFreeLocked( + uintptr_t slot_start) { SlotSpan* slot_span = SlotSpan::FromSlotStartPtr(slot_start); // Direct-mapped deallocation releases then re-acquires the lock. The caller // may not expect that, but we never call this function on direct-mapped @@ -1454,10 +1441,9 @@ template <bool thread_safe> ALWAYS_INLINE size_t PartitionRoot<thread_safe>::AllocationCapacityFromPtr(void* ptr) const { - ptr = AdjustPointerForExtrasSubtract(ptr); + uintptr_t address = AdjustPointerForExtrasSubtract(ptr); auto* slot_span = - internal::PartitionAllocGetSlotSpanForSizeQuery<thread_safe>( - reinterpret_cast<uintptr_t>(ptr)); + internal::PartitionAllocGetSlotSpanForSizeQuery<thread_safe>(address); size_t size = AdjustSizeForExtrasSubtract(slot_span->bucket->slot_size); return size; } @@ -1546,8 +1532,7 @@ uint16_t bucket_index = SizeToBucketIndex(raw_size); size_t usable_size; bool is_already_zeroed = false; - // TODO(bartekn): void* -> uintptr_t - void* slot_start = nullptr; + uintptr_t slot_start = 0; size_t slot_size; const bool is_quarantine_enabled = IsQuarantineEnabled(); @@ -1672,8 +1657,8 @@ #if DCHECK_IS_ON() // Add the cookie after the allocation. if (allow_cookie) { - uintptr_t address = reinterpret_cast<uintptr_t>(ret); - internal::PartitionCookieWriteValue(address + usable_size); + internal::PartitionCookieWriteValue(static_cast<unsigned char*>(ret) + + usable_size); } #endif @@ -1707,7 +1692,7 @@ uintptr_t unmasked_slot_start = memory::UnmaskPtr(reinterpret_cast<uintptr_t>(slot_start)); // Mark the corresponding bits in the state bitmap as allocated. - internal::StateBitmapFromPointer(unmasked_slot_start) + internal::StateBitmapFromAddr(unmasked_slot_start) ->Allocate(unmasked_slot_start); } } @@ -1716,13 +1701,13 @@ } template <bool thread_safe> -ALWAYS_INLINE void* PartitionRoot<thread_safe>::RawAlloc( - Bucket* bucket, - int flags, - size_t raw_size, - size_t slot_span_alignment, - size_t* usable_size, - bool* is_already_zeroed) { +ALWAYS_INLINE uintptr_t +PartitionRoot<thread_safe>::RawAlloc(Bucket* bucket, + int flags, + size_t raw_size, + size_t slot_span_alignment, + size_t* usable_size, + bool* is_already_zeroed) { internal::ScopedGuard<thread_safe> guard{lock_}; return AllocFromBucket(bucket, flags, raw_size, slot_span_alignment, usable_size, is_already_zeroed);
diff --git a/base/allocator/partition_allocator/starscan/pcscan.h b/base/allocator/partition_allocator/starscan/pcscan.h index 847ab0f..351117e 100644 --- a/base/allocator/partition_allocator/starscan/pcscan.h +++ b/base/allocator/partition_allocator/starscan/pcscan.h
@@ -248,7 +248,7 @@ } uintptr_t unmasked_slot_start = memory::UnmaskPtr(slot_start); - auto* state_bitmap = StateBitmapFromPointer(unmasked_slot_start); + auto* state_bitmap = StateBitmapFromAddr(unmasked_slot_start); // Mark the state in the state bitmap as quarantined. Make sure to do it after // the clearing to avoid racing with *Scan Sweeper.
diff --git a/base/allocator/partition_allocator/starscan/pcscan_internal.cc b/base/allocator/partition_allocator/starscan/pcscan_internal.cc index 29bd833..b89cecf 100644 --- a/base/allocator/partition_allocator/starscan/pcscan_internal.cc +++ b/base/allocator/partition_allocator/starscan/pcscan_internal.cc
@@ -649,7 +649,7 @@ #endif // defined(PA_HAS_64_BITS_POINTERS) // We are certain here that |maybe_ptr| points to an allocated super-page. - return StateBitmapFromPointer(maybe_ptr); + return StateBitmapFromAddr(maybe_ptr); } // Looks up and marks a potential dangling pointer. Returns the size of the slot @@ -726,7 +726,7 @@ StarScanSnapshot::ClearingView view(*snapshot_); view.VisitConcurrently([clear_type](uintptr_t super_page) { - auto* bitmap = StateBitmapFromPointer(super_page); + auto* bitmap = StateBitmapFromAddr(super_page); auto* root = Root::FromFirstSuperPage(super_page); bitmap->IterateQuarantined([root, clear_type](uintptr_t address) { auto* object = memory::RemaskPtr(reinterpret_cast<void*>(address)); @@ -866,7 +866,7 @@ pcscan.ProtectPages(reinterpret_cast<uintptr_t>(begin), (end - begin) * sizeof(uintptr_t)); - auto* bitmap = StateBitmapFromPointer(reinterpret_cast<uintptr_t>(begin)); + auto* bitmap = StateBitmapFromAddr(reinterpret_cast<uintptr_t>(begin)); const size_t slot_size_in_words = slot_size / sizeof(uintptr_t); for (uintptr_t* current_slot = begin; current_slot < end; @@ -949,7 +949,8 @@ uintptr_t object) { object = memory::RemaskPtr(object); const size_t slot_size = slot_span->bucket->slot_size; - uintptr_t slot_start = root->AdjustPointerForExtrasSubtract(object); + uintptr_t slot_start = + root->AdjustPointerForExtrasSubtract(reinterpret_cast<void*>(object)); root->FreeNoHooksImmediate(object, slot_span, slot_start); UnmarkInCardTable(object, slot_span); return slot_size; @@ -959,7 +960,7 @@ uintptr_t super_page, size_t epoch, SweepStat& stat) { - auto* bitmap = StateBitmapFromPointer(super_page); + auto* bitmap = StateBitmapFromAddr(super_page); ThreadSafePartitionRoot::FromFirstSuperPage(super_page); bitmap->IterateUnmarkedQuarantined(epoch, [root, &stat](uintptr_t object) { auto* slot_span = SlotSpanMetadata<ThreadSafe>::FromSlotInnerPtr( @@ -973,7 +974,7 @@ uintptr_t super_page, size_t epoch, SweepStat& stat) { - auto* bitmap = StateBitmapFromPointer(super_page); + auto* bitmap = StateBitmapFromAddr(super_page); bitmap->IterateQuarantined(epoch, [root, &stat](uintptr_t object, bool is_marked) { auto* slot_span = SlotSpanMetadata<ThreadSafe>::FromSlotInnerPtr( @@ -1009,7 +1010,7 @@ SweepStat& stat) { using SlotSpan = SlotSpanMetadata<ThreadSafe>; - auto* bitmap = StateBitmapFromPointer(super_page); + auto* bitmap = StateBitmapFromAddr(super_page); SlotSpan* previous_slot_span = nullptr; internal::PartitionFreelistEntry* freelist_tail = nullptr; internal::PartitionFreelistEntry* freelist_head = nullptr;
diff --git a/base/allocator/partition_allocator/starscan/pcscan_unittest.cc b/base/allocator/partition_allocator/starscan/pcscan_unittest.cc index 62d9fcbc3..0dd7138 100644 --- a/base/allocator/partition_allocator/starscan/pcscan_unittest.cc +++ b/base/allocator/partition_allocator/starscan/pcscan_unittest.cc
@@ -96,7 +96,7 @@ bool IsInQuarantine(void* ptr) const { uintptr_t address = memory::UnmaskPtr(reinterpret_cast<uintptr_t>(ptr)); - return StateBitmapFromPointer(address)->IsQuarantined(address); + return StateBitmapFromAddr(address)->IsQuarantined(address); } ThreadSafePartitionRoot& root() { return *allocator_.root(); } @@ -138,8 +138,8 @@ ThreadSafePartitionRoot::Bucket& bucket = root.buckets[bucket_index]; const size_t num_slots = (bucket.get_bytes_per_span()) / bucket.slot_size; - void* first = nullptr; - void* last = nullptr; + uintptr_t first = 0; + uintptr_t last = 0; for (size_t i = 0; i < num_slots; ++i) { void* ptr = root.AllocFlagsNoHooks(0, object_size, PartitionPageSize()); EXPECT_TRUE(ptr); @@ -165,12 +165,12 @@ root.AdjustPointerForExtrasAdd(last)}; } -bool IsInFreeList(void* slot_start) { +bool IsInFreeList(uintptr_t slot_start) { slot_start = memory::RemaskPtr(slot_start); auto* slot_span = SlotSpan::FromSlotStartPtr(slot_start); for (auto* entry = slot_span->get_freelist_head(); entry; entry = entry->GetNext(slot_span->bucket->slot_size)) { - if (entry == slot_start) + if (reinterpret_cast<uintptr_t>(entry) == slot_start) return true; } return false; @@ -692,14 +692,13 @@ // Make sure to commit more memory than requested and have slack for storing // dangling reference outside of the raw size. const size_t big_size = kMaxBucketed - SystemPageSize() + 1; - uint8_t* source = static_cast<uint8_t*>(root().Alloc(big_size, nullptr)); + void* ptr = root().Alloc(big_size, nullptr); - auto* slot_span = SlotSpanMetadata<ThreadSafe>::FromSlotInnerPtr(source); + auto* slot_span = SlotSpanMetadata<ThreadSafe>::FromSlotInnerPtr(ptr); ASSERT_TRUE(slot_span->CanStoreRawSize()); - uint8_t* source_end = - static_cast<uint8_t*>(root().AdjustPointerForExtrasSubtract(source)) + - slot_span->GetRawSize(); + uintptr_t source_end = + root().AdjustPointerForExtrasSubtract(ptr) + slot_span->GetRawSize(); auto* value = ValueList::Create(root()); @@ -837,11 +836,11 @@ // Check if the tag overflows. If so, the object must be in quarantine. if (HasOverflowTag(reinterpret_cast<uintptr_t>(obj))) { EXPECT_TRUE(IsInQuarantine(obj)); - EXPECT_FALSE(IsInFreeList(obj)); + EXPECT_FALSE(IsInFreeList(root().AdjustPointerForExtrasSubtract(obj))); return; } else { EXPECT_FALSE(IsInQuarantine(obj)); - EXPECT_TRUE(IsInFreeList(obj)); + EXPECT_TRUE(IsInFreeList(root().AdjustPointerForExtrasSubtract(obj))); } }
diff --git a/base/allocator/partition_allocator/thread_cache.cc b/base/allocator/partition_allocator/thread_cache.cc index 54054790..4b914949 100644 --- a/base/allocator/partition_allocator/thread_cache.cc +++ b/base/allocator/partition_allocator/thread_cache.cc
@@ -7,6 +7,7 @@ #include <sys/types.h> #include <algorithm> #include <atomic> +#include <cstdint> #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" @@ -438,10 +439,10 @@ auto* bucket = root->buckets + PartitionRoot<internal::ThreadSafe>::SizeToBucketIndex(raw_size); - void* buffer = + uintptr_t buffer = root->RawAlloc(bucket, PartitionAllocZeroFill, raw_size, PartitionPageSize(), &usable_size, &already_zeroed); - ThreadCache* tcache = new (buffer) ThreadCache(root); + ThreadCache* tcache = new (reinterpret_cast<void*>(buffer)) ThreadCache(root); // This may allocate. PartitionTlsSet(g_thread_cache_key, tcache); @@ -495,14 +496,14 @@ // static void ThreadCache::Delete(void* tcache_ptr) { - auto* tcache = reinterpret_cast<ThreadCache*>(tcache_ptr); + auto* tcache = static_cast<ThreadCache*>(tcache_ptr); #if defined(PA_THREAD_CACHE_FAST_TLS) g_thread_cache = nullptr; #endif auto* root = tcache->root_; - reinterpret_cast<ThreadCache*>(tcache_ptr)->~ThreadCache(); - root->RawFree(tcache_ptr); + tcache->~ThreadCache(); + root->RawFree(reinterpret_cast<uintptr_t>(tcache_ptr)); #if defined(OS_WIN) // On Windows, allocations do occur during thread/process teardown, make sure @@ -580,7 +581,7 @@ // |raw_size| is set to the slot size, as we don't know it. However, it is // only used for direct-mapped allocations and single-slot ones anyway, // which are not handled here. - void* ptr = root_->AllocFromBucket( + uintptr_t slot_start = root_->AllocFromBucket( &root_->buckets[bucket_index], PartitionAllocFastPathOrReturnNull | PartitionAllocReturnNull, root_->buckets[bucket_index].slot_size /* raw_size */, @@ -591,11 +592,11 @@ // some objects, then the allocation will be handled normally. Otherwise, // this goes to the central allocator, which will service the allocation, // return nullptr or crash. - if (!ptr) + if (!slot_start) break; allocated_slots++; - PutInBucket(bucket, ptr); + PutInBucket(bucket, slot_start); } cached_memory_ += allocated_slots * bucket.slot_size; @@ -650,9 +651,9 @@ // acquisitions can be expensive. internal::ScopedGuard<internal::ThreadSafe> guard(root_->lock_); while (head) { - void* ptr = head; + uintptr_t slot_start = reinterpret_cast<uintptr_t>(head); head = head->GetNextForThreadCache(slot_size); - root_->RawFreeLocked(ptr); + root_->RawFreeLocked(slot_start); } }
diff --git a/base/allocator/partition_allocator/thread_cache.h b/base/allocator/partition_allocator/thread_cache.h index 281faa04..c397314 100644 --- a/base/allocator/partition_allocator/thread_cache.h +++ b/base/allocator/partition_allocator/thread_cache.h
@@ -6,6 +6,7 @@ #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_THREAD_CACHE_H_ #include <atomic> +#include <cstdint> #include <limits> #include <memory> @@ -275,14 +276,14 @@ // Returns true if the slot was put in the cache, and false otherwise. This // can happen either because the cache is full or the allocation was too // large. - ALWAYS_INLINE bool MaybePutInCache(void* slot_start, size_t bucket_index); + ALWAYS_INLINE bool MaybePutInCache(uintptr_t slot_start, size_t bucket_index); // Tries to allocate a memory slot from the cache. - // Returns nullptr on failure. + // Returns 0 on failure. // // Has the same behavior as RawAlloc(), that is: no cookie nor ref-count // handling. Sets |slot_size| to the allocated size upon success. - ALWAYS_INLINE void* GetFromCache(size_t bucket_index, size_t* slot_size); + ALWAYS_INLINE uintptr_t GetFromCache(size_t bucket_index, size_t* slot_size); // Asks this cache to trigger |Purge()| at a later point. Can be called from // any thread. @@ -344,7 +345,7 @@ void FillBucket(size_t bucket_index); // Empties the |bucket| until there are at most |limit| objects in it. void ClearBucket(Bucket& bucket, size_t limit); - ALWAYS_INLINE void PutInBucket(Bucket& bucket, void* slot_start); + ALWAYS_INLINE void PutInBucket(Bucket& bucket, uintptr_t slot_start); void ResetForTesting(); // Releases the entire freelist starting at |head| to the root. void FreeAfter(PartitionFreelistEntry* head, size_t slot_size); @@ -430,7 +431,7 @@ FRIEND_TEST_ALL_PREFIXES(PartitionAllocThreadCacheTest, ClearFromTail); }; -ALWAYS_INLINE bool ThreadCache::MaybePutInCache(void* slot_start, +ALWAYS_INLINE bool ThreadCache::MaybePutInCache(uintptr_t slot_start, size_t bucket_index) { PA_REENTRANCY_GUARD(is_in_thread_cache_); INCREMENT_COUNTER(stats_.cache_fill_count); @@ -464,8 +465,8 @@ return true; } -ALWAYS_INLINE void* ThreadCache::GetFromCache(size_t bucket_index, - size_t* slot_size) { +ALWAYS_INLINE uintptr_t ThreadCache::GetFromCache(size_t bucket_index, + size_t* slot_size) { #if defined(PA_THREAD_CACHE_ALLOC_STATS) stats_.allocs_per_bucket_[bucket_index]++; #endif @@ -476,7 +477,7 @@ if (UNLIKELY(bucket_index > largest_active_bucket_index_)) { INCREMENT_COUNTER(stats_.alloc_miss_too_large); INCREMENT_COUNTER(stats_.alloc_misses); - return nullptr; + return 0; } auto& bucket = buckets_[bucket_index]; @@ -490,9 +491,9 @@ FillBucket(bucket_index); // Very unlikely, means that the central allocator is out of memory. Let it - // deal with it (may return nullptr, may crash). + // deal with it (may return 0, may crash). if (UNLIKELY(!bucket.freelist_head)) - return nullptr; + return 0; } PA_DCHECK(bucket.count != 0); @@ -510,10 +511,11 @@ PA_DCHECK(cached_memory_ >= bucket.slot_size); cached_memory_ -= bucket.slot_size; - return result; + return reinterpret_cast<uintptr_t>(result); } -ALWAYS_INLINE void ThreadCache::PutInBucket(Bucket& bucket, void* slot_start) { +ALWAYS_INLINE void ThreadCache::PutInBucket(Bucket& bucket, + uintptr_t slot_start) { #if defined(PA_HAS_FREELIST_HARDENING) && defined(ARCH_CPU_X86_64) && \ defined(PA_HAS_64_BITS_POINTERS) // We see freelist corruption crashes happening in the wild. These are likely @@ -532,10 +534,10 @@ static_assert(kAlignment == 16, ""); #if HAS_BUILTIN(__builtin_assume_aligned) - uintptr_t address = reinterpret_cast<uintptr_t>( - __builtin_assume_aligned(slot_start, kAlignment)); + uintptr_t address = reinterpret_cast<uintptr_t>(__builtin_assume_aligned( + reinterpret_cast<void*>(slot_start), kAlignment)); #else - uintptr_t address = reinterpret_cast<uintptr_t>(slot_start); + uintptr_t address = slot_start; #endif // The pointer is always 16 bytes aligned, so its start address is always == 0
diff --git a/base/android/java/src/org/chromium/base/BuildInfo.java b/base/android/java/src/org/chromium/base/BuildInfo.java index 4d286ce..a835e05c2 100644 --- a/base/android/java/src/org/chromium/base/BuildInfo.java +++ b/base/android/java/src/org/chromium/base/BuildInfo.java
@@ -145,7 +145,8 @@ try { gmsPackageInfo = pm.getPackageInfo("com.google.android.gms", 0); } catch (NameNotFoundException e) { - Log.d(TAG, "GMS package is not found."); + // TODO(b/197112084): Re-enable the logging + // Log.d(TAG, "GMS package is not found."); } gmsVersionCode = gmsPackageInfo != null ? String.valueOf(packageVersionCode(gmsPackageInfo))
diff --git a/cc/debug/layer_tree_debug_state.cc b/cc/debug/layer_tree_debug_state.cc index 2a791a6..ba6acf2 100644 --- a/cc/debug/layer_tree_debug_state.cc +++ b/cc/debug/layer_tree_debug_state.cc
@@ -72,7 +72,6 @@ a.slow_down_raster_scale_factor == b.slow_down_raster_scale_factor && a.rasterize_only_visible_content == b.rasterize_only_visible_content && a.highlight_non_lcd_text_layers == b.highlight_non_lcd_text_layers && - a.show_hit_test_borders == b.show_hit_test_borders && a.show_web_vital_metrics == b.show_web_vital_metrics && a.record_rendering_stats_ == b.record_rendering_stats_); }
diff --git a/cc/debug/layer_tree_debug_state.h b/cc/debug/layer_tree_debug_state.h index d6618b9..90712bf 100644 --- a/cc/debug/layer_tree_debug_state.h +++ b/cc/debug/layer_tree_debug_state.h
@@ -48,8 +48,6 @@ bool rasterize_only_visible_content = false; bool highlight_non_lcd_text_layers = false; - bool show_hit_test_borders = false; - // This is part of the feature to show performance metrics on HUD. This // particular flag is set only in Blink. bool show_web_vital_metrics = false;
diff --git a/cc/mojo_embedder/async_layer_tree_frame_sink.cc b/cc/mojo_embedder/async_layer_tree_frame_sink.cc index a7f0a88..5bebaf72 100644 --- a/cc/mojo_embedder/async_layer_tree_frame_sink.cc +++ b/cc/mojo_embedder/async_layer_tree_frame_sink.cc
@@ -132,8 +132,7 @@ void AsyncLayerTreeFrameSink::SubmitCompositorFrame( viz::CompositorFrame frame, - bool hit_test_data_changed, - bool show_hit_test_borders) { + bool hit_test_data_changed) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(compositor_frame_sink_ptr_); DCHECK(frame.metadata.begin_frame_ack.has_damage); @@ -157,9 +156,6 @@ absl::optional<viz::HitTestRegionList> hit_test_region_list = client_->BuildHitTestData(); - if (show_hit_test_borders && hit_test_region_list) - hit_test_region_list->flags |= viz::HitTestRegionFlags::kHitTestDebug; - // If |hit_test_data_changed| was set or local_surface_id has been updated, // we always send hit-test data; otherwise we check for equality with the // last submitted hit-test data for possible optimization.
diff --git a/cc/mojo_embedder/async_layer_tree_frame_sink.h b/cc/mojo_embedder/async_layer_tree_frame_sink.h index b10b55d0..332df8f 100644 --- a/cc/mojo_embedder/async_layer_tree_frame_sink.h +++ b/cc/mojo_embedder/async_layer_tree_frame_sink.h
@@ -91,8 +91,7 @@ void DetachFromClient() override; void SetLocalSurfaceId(const viz::LocalSurfaceId& local_surface_id) override; void SubmitCompositorFrame(viz::CompositorFrame frame, - bool hit_test_data_changed, - bool show_hit_test_borders) override; + bool hit_test_data_changed) override; void DidNotProduceFrame(const viz::BeginFrameAck& ack, FrameSkippedReason reason) override; void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
diff --git a/cc/mojo_embedder/async_layer_tree_frame_sink_unittest.cc b/cc/mojo_embedder/async_layer_tree_frame_sink_unittest.cc index ca9a80d..060ab11b 100644 --- a/cc/mojo_embedder/async_layer_tree_frame_sink_unittest.cc +++ b/cc/mojo_embedder/async_layer_tree_frame_sink_unittest.cc
@@ -157,9 +157,8 @@ .SetRenderPassList(std::move(*pass_list)) .Build(); pass_list->clear(); - layer_tree_frame_sink_->SubmitCompositorFrame( - std::move(frame), hit_test_data_changed, - /*show_hit_test_borders=*/false); + layer_tree_frame_sink_->SubmitCompositorFrame(std::move(frame), + hit_test_data_changed); } const viz::HitTestRegionList& GetHitTestData() const {
diff --git a/cc/test/fake_layer_tree_frame_sink.cc b/cc/test/fake_layer_tree_frame_sink.cc index 391c6f8..0a034a4 100644 --- a/cc/test/fake_layer_tree_frame_sink.cc +++ b/cc/test/fake_layer_tree_frame_sink.cc
@@ -60,10 +60,8 @@ LayerTreeFrameSink::DetachFromClient(); } -void FakeLayerTreeFrameSink::SubmitCompositorFrame( - viz::CompositorFrame frame, - bool hit_test_data_changed, - bool submit_hit_test_borders) { +void FakeLayerTreeFrameSink::SubmitCompositorFrame(viz::CompositorFrame frame, + bool hit_test_data_changed) { ReturnResourcesHeldByParent(); last_sent_frame_ = std::make_unique<viz::CompositorFrame>(std::move(frame));
diff --git a/cc/test/fake_layer_tree_frame_sink.h b/cc/test/fake_layer_tree_frame_sink.h index 8257fec6..42ee0888a 100644 --- a/cc/test/fake_layer_tree_frame_sink.h +++ b/cc/test/fake_layer_tree_frame_sink.h
@@ -120,8 +120,7 @@ bool BindToClient(LayerTreeFrameSinkClient* client) override; void DetachFromClient() override; void SubmitCompositorFrame(viz::CompositorFrame frame, - bool hit_test_data_changed, - bool show_hit_test_borders) override; + bool hit_test_data_changed) override; void DidNotProduceFrame(const viz::BeginFrameAck& ack, FrameSkippedReason reason) override; void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 84143ef51..4b9ddbc 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc
@@ -106,11 +106,10 @@ InvalidateIfPossible(); } void SubmitCompositorFrame(viz::CompositorFrame frame, - bool hit_test_data_changed, - bool show_hit_test_borders) override { + bool hit_test_data_changed) override { frame_ack_pending_ = true; - TestLayerTreeFrameSink::SubmitCompositorFrame( - std::move(frame), hit_test_data_changed, show_hit_test_borders); + TestLayerTreeFrameSink::SubmitCompositorFrame(std::move(frame), + hit_test_data_changed); } void DidReceiveCompositorFrameAck( std::vector<viz::ReturnedResource> resources) override {
diff --git a/cc/test/test_layer_tree_frame_sink.cc b/cc/test/test_layer_tree_frame_sink.cc index 888f13c..fbab16f 100644 --- a/cc/test/test_layer_tree_frame_sink.cc +++ b/cc/test/test_layer_tree_frame_sink.cc
@@ -177,8 +177,7 @@ } void TestLayerTreeFrameSink::SubmitCompositorFrame(viz::CompositorFrame frame, - bool hit_test_data_changed, - bool show_hit_test_borders) { + bool hit_test_data_changed) { DebugScopedSetImplThread impl(task_runner_provider_); DCHECK(frame.metadata.begin_frame_ack.has_damage); DCHECK(frame.metadata.begin_frame_ack.frame_id.IsSequenceValid());
diff --git a/cc/test/test_layer_tree_frame_sink.h b/cc/test/test_layer_tree_frame_sink.h index 6691b32..268f3db6 100644 --- a/cc/test/test_layer_tree_frame_sink.h +++ b/cc/test/test_layer_tree_frame_sink.h
@@ -98,8 +98,7 @@ void DetachFromClient() override; void SetLocalSurfaceId(const viz::LocalSurfaceId& local_surface_id) override; void SubmitCompositorFrame(viz::CompositorFrame frame, - bool hit_test_data_changed, - bool show_hit_test_borders) override; + bool hit_test_data_changed) override; void DidNotProduceFrame(const viz::BeginFrameAck& ack, FrameSkippedReason reason) override; void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion buffer,
diff --git a/cc/trees/layer_tree_frame_sink.h b/cc/trees/layer_tree_frame_sink.h index ba1286c..e68f245 100644 --- a/cc/trees/layer_tree_frame_sink.h +++ b/cc/trees/layer_tree_frame_sink.h
@@ -119,11 +119,8 @@ // with the old hit-test data. If there is no change, we do not send the // hit-test data. False positives are allowed. The value of // |hit_test_data_changed| should remain constant in the caller. - // |show_hit_test_borders| controls whether viz will insert debug borders over - // hit-test data and is passed from LayerTreeDebugState. virtual void SubmitCompositorFrame(viz::CompositorFrame frame, - bool hit_test_data_changed, - bool show_hit_test_borders) = 0; + bool hit_test_data_changed) = 0; // Signals that a BeginFrame issued by the viz::BeginFrameSource provided to // the client did not lead to a CompositorFrame submission.
diff --git a/cc/trees/layer_tree_frame_sink_unittest.cc b/cc/trees/layer_tree_frame_sink_unittest.cc index cce1ce8d..42323730 100644 --- a/cc/trees/layer_tree_frame_sink_unittest.cc +++ b/cc/trees/layer_tree_frame_sink_unittest.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <utility> + #include "cc/trees/layer_tree_frame_sink.h" #include "base/memory/read_only_shared_memory_region.h" @@ -30,8 +32,7 @@ nullptr) {} void SubmitCompositorFrame(viz::CompositorFrame frame, - bool hit_test_data_changed, - bool show_hit_test_borders) override { + bool hit_test_data_changed) override { client_->DidReceiveCompositorFrameAck(); } void DidNotProduceFrame(const viz::BeginFrameAck& ack,
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 814e6fab..b012b3b8 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -2510,7 +2510,7 @@ events_metrics); layer_tree_frame_sink_->SubmitCompositorFrame( std::move(compositor_frame), - /*hit_test_data_changed=*/false, debug_state_.show_hit_test_borders); + /*hit_test_data_changed=*/false); #if DCHECK_IS_ON() if (!doing_sync_draw_) {
diff --git a/chrome/VERSION b/chrome/VERSION index 6893191b..793bccb3 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=99 MINOR=0 -BUILD=4819 +BUILD=4820 PATCH=0
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java index 851b7e79..295286e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java
@@ -89,6 +89,9 @@ // Toast at the top of the screen that is shown when user enters fullscreen for the // first time. private View mNotificationToast; + private long mNotificationStartTimestamp; + private long mNotificationRemainingTimeMs; + private final Runnable mHideNotificationToastRunnable; private OnLayoutChangeListener mFullscreenOnLayoutChangeListener; @@ -199,6 +202,7 @@ mPersistentModeSupplier = new ObservableSupplierImpl<>(); mPersistentModeSupplier.set(false); mExitFullscreenOnStop = exitFullscreenOnStop; + mHideNotificationToastRunnable = this::hideNotificationToast; } /** @@ -524,7 +528,11 @@ mNotificationToast.setAlpha(0); parent.addView(mNotificationToast); mNotificationToast.animate().alpha(1).setDuration(TOAST_FADE_MS).start(); - mHandler.postDelayed(this::hideNotificationToast, 5000); + mNotificationRemainingTimeMs = 5000; + if (parent.hasWindowFocus()) { + mNotificationStartTimestamp = System.currentTimeMillis(); + mHandler.postDelayed(mHideNotificationToastRunnable, mNotificationRemainingTimeMs); + } } /** @@ -570,7 +578,16 @@ @Override public void onWindowFocusChanged(Activity activity, boolean hasWindowFocus) { if (mActivity != activity) return; - if (!hasWindowFocus) hideNotificationToast(); + if (mNotificationToast != null) { + if (hasWindowFocus) { + mNotificationStartTimestamp = System.currentTimeMillis(); + mHandler.postDelayed(mHideNotificationToastRunnable, mNotificationRemainingTimeMs); + } else { + mHandler.removeCallbacks(mHideNotificationToastRunnable); + mNotificationRemainingTimeMs -= + System.currentTimeMillis() - mNotificationStartTimestamp; + } + } mHandler.removeMessages(MSG_ID_SET_FULLSCREEN_SYSTEM_UI_FLAGS); mHandler.removeMessages(MSG_ID_CLEAR_LAYOUT_FULLSCREEN_FLAG);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/Fido2ApiTestHelper.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/Fido2ApiTestHelper.java index 03e8ea3..47f7a03 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/Fido2ApiTestHelper.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/Fido2ApiTestHelper.java
@@ -7,6 +7,7 @@ import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; import android.content.Intent; +import android.os.Parcel; import android.os.SystemClock; import android.util.Base64; @@ -44,8 +45,6 @@ import org.chromium.url.internal.mojom.Origin; import org.chromium.url.mojom.Url; -import java.io.ByteArrayOutputStream; -import java.io.IOException; import java.nio.ByteBuffer; import java.util.concurrent.TimeUnit; @@ -77,9 +76,10 @@ public class Fido2ApiTestHelper { // Test data. private static final String FILLER_ERROR_MSG = "Error Error"; + private static final int OBJECT_MAGIC = 20293; /** - * This byte array is produced by + * This byte array was produced by * com.google.android.gms.fido.fido2.api.common.AuthenticatorAttestationResponse with test data, * i.e.: * AuthenticatorAttestationResponse response = @@ -89,27 +89,30 @@ * .setKeyHandle(TEST_KEY_HANDLE) * .build().serializeToBytes(); * - * NOTE: See NO_BUILDER comment, above. + * NOTE: See NO_BUILDER comment, above. Additionally this byte array was modified by prepending + * an object header and tag with value four so that it's compatible with + * FIDO2_KEY_CREDENTIAL_EXTRA. */ private static final byte[] TEST_AUTHENTICATOR_ATTESTATION_RESPONSE = new byte[] {69, 79, -1, - -1, 44, 1, 0, 0, 2, 0, -1, -1, 36, 0, 0, 0, 32, 0, 0, 0, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, - 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 9, 3, 0, -1, -1, 8, 0, 0, - 0, 3, 0, 0, 0, 4, 5, 6, 0, 4, 0, -1, -1, -24, 0, 0, 0, -30, 0, 0, 0, -93, 99, 102, 109, - 116, 100, 110, 111, 110, 101, 103, 97, 116, 116, 83, 116, 109, 116, -96, 104, 97, 117, - 116, 104, 68, 97, 116, 97, 88, -60, 38, -67, 114, 120, -66, 70, 55, 97, -15, -6, -95, - -79, 10, -76, -60, -8, 38, 112, 38, -100, 65, 12, 114, 106, 31, -42, -32, 88, 85, -31, - -101, 70, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 124, - 80, -60, -114, 69, -117, 44, -120, 122, -62, 63, 104, 18, -66, 2, -3, -56, 35, -24, 66, - -4, 74, 48, -128, -52, 80, -100, 46, 97, 93, -25, -21, -53, 40, 123, 90, -107, -20, 111, - -4, 15, 64, 122, 15, -84, -21, -33, -15, 26, 11, 35, 36, -49, 116, 52, -74, 107, 63, - 113, -59, 125, -27, -120, -63, -91, 1, 2, 3, 38, 32, 1, 33, 88, 32, -75, -80, 118, 102, - -14, 124, -108, -9, -27, -91, 59, -48, -92, -102, -38, -44, 92, 95, 14, -62, 41, -117, - -70, 101, 9, 64, 35, 31, -20, 79, -71, -71, 34, 88, 32, -24, -33, 64, 97, -31, -34, 96, - -83, -119, -25, 21, -14, -56, -70, -37, -116, -21, -33, -128, -66, 61, 41, 107, 16, -25, - 120, 106, -113, 54, -62, -102, 42, 0, 0}; + -1, 60, 1, 0, 0, 4, 0, -1, -1, 52, 1, 0, 0, 69, 79, -1, -1, 44, 1, 0, 0, 2, 0, -1, -1, + 36, 0, 0, 0, 32, 0, 0, 0, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 5, + 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 9, 3, 0, -1, -1, 8, 0, 0, 0, 3, 0, 0, 0, 4, 5, 6, 0, 4, 0, + -1, -1, -24, 0, 0, 0, -30, 0, 0, 0, -93, 99, 102, 109, 116, 100, 110, 111, 110, 101, + 103, 97, 116, 116, 83, 116, 109, 116, -96, 104, 97, 117, 116, 104, 68, 97, 116, 97, 88, + -60, 38, -67, 114, 120, -66, 70, 55, 97, -15, -6, -95, -79, 10, -76, -60, -8, 38, 112, + 38, -100, 65, 12, 114, 106, 31, -42, -32, 88, 85, -31, -101, 70, 65, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 124, 80, -60, -114, 69, -117, 44, -120, + 122, -62, 63, 104, 18, -66, 2, -3, -56, 35, -24, 66, -4, 74, 48, -128, -52, 80, -100, + 46, 97, 93, -25, -21, -53, 40, 123, 90, -107, -20, 111, -4, 15, 64, 122, 15, -84, -21, + -33, -15, 26, 11, 35, 36, -49, 116, 52, -74, 107, 63, 113, -59, 125, -27, -120, -63, + -91, 1, 2, 3, 38, 32, 1, 33, 88, 32, -75, -80, 118, 102, -14, 124, -108, -9, -27, -91, + 59, -48, -92, -102, -38, -44, 92, 95, 14, -62, 41, -117, -70, 101, 9, 64, 35, 31, -20, + 79, -71, -71, 34, 88, 32, -24, -33, 64, 97, -31, -34, 96, -83, -119, -25, 21, -14, -56, + -70, -37, -116, -21, -33, -128, -66, 61, 41, 107, 16, -25, 120, 106, -113, 54, -62, + -102, 42, 0, 0}; /** - * This byte array is produced by + * This byte array was produced by * com.google.android.gms.fido.fido2.api.common.AuthenticatorAssertionResponse with test data, * i.e.: * AuthenticatorAssertionResponse.Builder() @@ -119,13 +122,16 @@ * .setKeyHandle(TEST_KEY_HANDLE) * .build().serializeToBytes(); * - * NOTE: See NO_BUILDER comment, above. + * NOTE: See NO_BUILDER comment, above. Additionally this byte array was modified by prepending + * an object header and tag with value five so that it's compatible with + * FIDO2_KEY_CREDENTIAL_EXTRA. */ - private static final byte[] TEST_AUTHENTICATOR_ASSERTION_RESPONSE = new byte[] {69, 79, -1, -1, - 92, 0, 0, 0, 2, 0, -1, -1, 36, 0, 0, 0, 32, 0, 0, 0, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, - 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 9, 3, 0, -1, -1, 8, 0, 0, 0, 3, - 0, 0, 0, 4, 5, 6, 0, 4, 0, -1, -1, 8, 0, 0, 0, 3, 0, 0, 0, 7, 8, 9, 0, 5, 0, -1, -1, 8, - 0, 0, 0, 3, 0, 0, 0, 10, 11, 12, 0}; + private static final byte[] TEST_AUTHENTICATOR_ASSERTION_RESPONSE = + new byte[] {69, 79, -1, -1, 108, 0, 0, 0, 5, 0, -1, -1, 100, 0, 0, 0, 69, 79, -1, -1, + 92, 0, 0, 0, 2, 0, -1, -1, 36, 0, 0, 0, 32, 0, 0, 0, 5, 6, 7, 8, 5, 6, 7, 8, 5, + 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 9, 3, 0, -1, + -1, 8, 0, 0, 0, 3, 0, 0, 0, 4, 5, 6, 0, 4, 0, -1, -1, 8, 0, 0, 0, 3, 0, 0, 0, 7, + 8, 9, 0, 5, 0, -1, -1, 8, 0, 0, 0, 3, 0, 0, 0, 10, 11, 12, 0}; /** * This byte array is produced by @@ -178,62 +184,6 @@ 2, 0, 0, 0, 2, 0, 4, 0, 2, 0, 0, 0, 3, 0, 4, 0, 4, 0, 0, 0, 32, 0, 0, 0, 69, 79, -1, -1, 24, 0, 0, 0, 1, 0, 4, 0, 0, 2, 0, 0, 2, 0, 4, 0, 1, 0, 0, 0, 3, 0, 4, 0, 1, 0, 0, 0}; - /** - * The following byte arrays are produced by - * com.google.android.gms.fido.fido2.api.common.AuthenticatorErrorResponse with - * com.google.android.gms.fido.fido2.api.common.ErrorCode and error message; - * i.e.: - * AuthenticatorErrorResponse.Builder() - * .setErrorCode(errorCode) - * .setErrorMessage(errorMsg) - * .build().serializeToBytes(); - * - * NOTE: See NO_BUILDER comment, above. - */ - private static final byte[] TEST_ERROR_WITH_FILLER_ERROR_MSG_RESPONSE_FRONT = - new byte[] {69, 79, -1, -1, 44, 0, 0, 0, 2, 0, 4, 0}; - private static final byte[] TEST_ERROR_WITH_FILLER_ERROR_MSG_RESPONSE_TAIL = - new byte[] {0, 0, 0, 3, 0, -1, -1, 28, 0, 0, 0, 11, 0, 0, 0, 69, 0, 114, 0, 114, 0, 111, - 0, 114, 0, 32, 0, 69, 0, 114, 0, 114, 0, 111, 0, 114, 0, 0, 0}; - private static final byte[] TEST_ERROR_WITH_NULL_ERROR_MSG_RESPONSE_FRONT = { - 69, 79, -1, -1, 8, 0, 0, 0, 2, 0, 4, 0}; - private static final byte[] TEST_ERROR_WITH_NULL_ERROR_MSG_RESPONSE_TAIL = {0, 0, 0}; - private static final byte[] TEST_CONSTRAINTERROR_NOSCREENLOCK_RESPONSE = - new byte[] {69, 79, -1, -1, 116, 0, 0, 0, 2, 0, 4, 0, 29, 0, 0, 0, 3, 0, -1, -1, 100, 0, - 0, 0, 46, 0, 0, 0, 84, 0, 104, 0, 101, 0, 32, 0, 100, 0, 101, 0, 118, 0, 105, 0, - 99, 0, 101, 0, 32, 0, 105, 0, 115, 0, 32, 0, 110, 0, 111, 0, 116, 0, 32, 0, 115, - 0, 101, 0, 99, 0, 117, 0, 114, 0, 101, 0, 100, 0, 32, 0, 119, 0, 105, 0, 116, 0, - 104, 0, 32, 0, 97, 0, 110, 0, 121, 0, 32, 0, 115, 0, 99, 0, 114, 0, 101, 0, 101, - 0, 110, 0, 32, 0, 108, 0, 111, 0, 99, 0, 107, 0, 0, 0, 0, 0}; - private static final byte[] TEST_EMPTYALLOWCRED_RESPONSE1 = new byte[] {69, 79, -1, -1, -128, 0, - 0, 0, 2, 0, 4, 0, 35, 0, 0, 0, 3, 0, -1, -1, 112, 0, 0, 0, 52, 0, 0, 0, 65, 0, 117, 0, - 116, 0, 104, 0, 101, 0, 110, 0, 116, 0, 105, 0, 99, 0, 97, 0, 116, 0, 105, 0, 111, 0, - 110, 0, 32, 0, 114, 0, 101, 0, 113, 0, 117, 0, 101, 0, 115, 0, 116, 0, 32, 0, 109, 0, - 117, 0, 115, 0, 116, 0, 32, 0, 104, 0, 97, 0, 118, 0, 101, 0, 32, 0, 110, 0, 111, 0, - 110, 0, 45, 0, 101, 0, 109, 0, 112, 0, 116, 0, 121, 0, 32, 0, 97, 0, 108, 0, 108, 0, - 111, 0, 119, 0, 76, 0, 105, 0, 115, 0, 116, 0, 0, 0, 0, 0}; - private static final byte[] TEST_EMPTYALLOWCRED_RESPONSE2 = new byte[] {69, 79, -1, -1, -120, 0, - 0, 0, 2, 0, 4, 0, 35, 0, 0, 0, 3, 0, -1, -1, 120, 0, 0, 0, 57, 0, 0, 0, 82, 0, 101, 0, - 113, 0, 117, 0, 101, 0, 115, 0, 116, 0, 32, 0, 100, 0, 111, 0, 101, 0, 115, 0, 110, 0, - 39, 0, 116, 0, 32, 0, 104, 0, 97, 0, 118, 0, 101, 0, 32, 0, 97, 0, 32, 0, 118, 0, 97, 0, - 108, 0, 105, 0, 100, 0, 32, 0, 108, 0, 105, 0, 115, 0, 116, 0, 32, 0, 111, 0, 102, 0, - 32, 0, 97, 0, 108, 0, 108, 0, 111, 0, 119, 0, 101, 0, 100, 0, 32, 0, 99, 0, 114, 0, 101, - 0, 100, 0, 101, 0, 110, 0, 116, 0, 105, 0, 97, 0, 108, 0, 115, 0, 46, 0, 0, 0}; - private static final byte[] TEST_INVALIDSTATEERROR_DUPLICATE_REGISTRATION_RESPONSE = - new byte[] {69, 79, -1, -1, -116, 0, 0, 0, 2, 0, 4, 0, 11, 0, 0, 0, 3, 0, -1, -1, 124, - 0, 0, 0, 58, 0, 0, 0, 79, 0, 110, 0, 101, 0, 32, 0, 111, 0, 102, 0, 32, 0, 116, - 0, 104, 0, 101, 0, 32, 0, 101, 0, 120, 0, 99, 0, 108, 0, 117, 0, 100, 0, 101, 0, - 100, 0, 32, 0, 99, 0, 114, 0, 101, 0, 100, 0, 101, 0, 110, 0, 116, 0, 105, 0, - 97, 0, 108, 0, 115, 0, 32, 0, 101, 0, 120, 0, 105, 0, 115, 0, 116, 0, 115, 0, - 32, 0, 111, 0, 110, 0, 32, 0, 116, 0, 104, 0, 101, 0, 32, 0, 108, 0, 111, 0, 99, - 0, 97, 0, 108, 0, 32, 0, 100, 0, 101, 0, 118, 0, 105, 0, 99, 0, 101, 0, 0, 0, 0, - 0}; - private static final byte[] TEST_UNKNOWNERROR_CRED_NOT_RECOGNIZED_RESPONSE = - new byte[] {69, 79, -1, -1, 68, 0, 0, 0, 2, 0, 4, 0, 28, 0, 0, 0, 3, 0, -1, -1, 52, 0, - 0, 0, 22, 0, 0, 0, 76, 0, 111, 0, 119, 0, 32, 0, 108, 0, 101, 0, 118, 0, 101, 0, - 108, 0, 32, 0, 101, 0, 114, 0, 114, 0, 111, 0, 114, 0, 32, 0, 48, 0, 120, 0, 54, - 0, 97, 0, 56, 0, 48, 0, 0, 0, 0, 0}; - private static final byte[] TEST_KEY_HANDLE = BaseEncoding.base16().decode( "0506070805060708050607080506070805060708050607080506070805060709"); private static final String TEST_ENCODED_KEY_HANDLE = Base64.encodeToString( @@ -272,7 +222,7 @@ */ public static Intent createSuccessfulMakeCredentialIntent() { Intent intent = new Intent(); - intent.putExtra(Fido.FIDO2_KEY_RESPONSE_EXTRA, TEST_AUTHENTICATOR_ATTESTATION_RESPONSE); + intent.putExtra(Fido.FIDO2_KEY_CREDENTIAL_EXTRA, TEST_AUTHENTICATOR_ATTESTATION_RESPONSE); return intent; } @@ -362,7 +312,7 @@ */ public static Intent createSuccessfulGetAssertionIntent() { Intent intent = new Intent(); - intent.putExtra(Fido.FIDO2_KEY_RESPONSE_EXTRA, TEST_AUTHENTICATOR_ASSERTION_RESPONSE); + intent.putExtra(Fido.FIDO2_KEY_CREDENTIAL_EXTRA, TEST_AUTHENTICATOR_ASSERTION_RESPONSE); return intent; } @@ -420,84 +370,43 @@ Assert.assertTrue(elapsedTime < TIMEOUT_MS); } - /** - * Generates error response byte array with error message that only differs by a single - * errorCode byte. - * @return Error response byte array. - */ - private static byte[] generateErrorResponseBytesWithErrorMessage(Integer errorCode) { - byte errorByte = errorCode.byteValue(); - ByteArrayOutputStream error_response_output = new ByteArrayOutputStream(); - try { - error_response_output.write(TEST_ERROR_WITH_FILLER_ERROR_MSG_RESPONSE_FRONT); - } catch (IOException e) { - e.printStackTrace(); + private static void appendErrorResponseToParcel( + int errorCode, @Nullable String message, Parcel parcel) { + final int a = writeHeader(OBJECT_MAGIC, parcel); + final int b = writeHeader(6, parcel); + final int c = writeHeader(OBJECT_MAGIC, parcel); + + int z = writeHeader(2, parcel); + parcel.writeInt(errorCode); + writeLength(z, parcel); + + if (message != null) { + z = writeHeader(3, parcel); + parcel.writeString(message); + writeLength(z, parcel); } - try { - error_response_output.write(new byte[] {errorByte}); - } catch (IOException e) { - e.printStackTrace(); - } - try { - error_response_output.write(TEST_ERROR_WITH_FILLER_ERROR_MSG_RESPONSE_TAIL); - } catch (IOException e) { - e.printStackTrace(); - } - return error_response_output.toByteArray(); + + writeLength(c, parcel); + writeLength(b, parcel); + writeLength(a, parcel); } - /** - * Generates error response byte array without error message that only differs by a single - * errorCode byte. - * @return Error response byte array. - */ - private static byte[] generateErrorResponseBytesWithoutErrorMessage(Integer errorCode) { - byte errorByte = errorCode.byteValue(); - ByteArrayOutputStream error_response_output = new ByteArrayOutputStream(); - try { - error_response_output.write(TEST_ERROR_WITH_NULL_ERROR_MSG_RESPONSE_FRONT); - } catch (IOException e) { - e.printStackTrace(); - } - try { - error_response_output.write(new byte[] {errorByte}); - } catch (IOException e) { - e.printStackTrace(); - } - try { - error_response_output.write(TEST_ERROR_WITH_NULL_ERROR_MSG_RESPONSE_TAIL); - } catch (IOException e) { - e.printStackTrace(); - } - return error_response_output.toByteArray(); + private static int writeHeader(int tag, Parcel parcel) { + parcel.writeInt(0xffff0000 | tag); + return startLength(parcel); } - /** - * Constructs corresponding error response byte array based on errorCode and errorMsg. - * @return Error response byte array. - */ - private static byte[] constructErrorResponseBytes( - ErrorCode errorCode, @Nullable String errorMsg) { - if (errorMsg == null) { - return generateErrorResponseBytesWithoutErrorMessage(errorCode.getCode()); - } - if (FILLER_ERROR_MSG.equals(errorMsg)) { - return generateErrorResponseBytesWithErrorMessage(errorCode.getCode()); - } - switch (errorMsg) { - case "The device is not secured with any screen lock": - return TEST_CONSTRAINTERROR_NOSCREENLOCK_RESPONSE; - case "One of the excluded credentials exists on the local device": - return TEST_INVALIDSTATEERROR_DUPLICATE_REGISTRATION_RESPONSE; - case "Authentication request must have non-empty allowList": - return TEST_EMPTYALLOWCRED_RESPONSE1; - case "Request doesn't have a valid list of allowed credentials.": - return TEST_EMPTYALLOWCRED_RESPONSE2; - case "Low level error 0x6a80": - return TEST_UNKNOWNERROR_CRED_NOT_RECOGNIZED_RESPONSE; - default: - return new byte[] {}; - } + private static int startLength(Parcel parcel) { + int pos = parcel.dataPosition(); + parcel.writeInt(0xdddddddd); + return pos; + } + + private static void writeLength(int pos, Parcel parcel) { + int totalLength = parcel.dataPosition(); + parcel.setDataPosition(pos); + parcel.writeInt(totalLength - pos - 4); + parcel.setDataPosition(totalLength); } /** @@ -506,9 +415,11 @@ * @return an Intent containing the error response. */ public static Intent createErrorIntent(ErrorCode errorCode, @Nullable String errorMsg) { + Parcel parcel = Parcel.obtain(); + appendErrorResponseToParcel(errorCode.getCode(), errorMsg, parcel); + Intent intent = new Intent(); - intent.putExtra( - Fido.FIDO2_KEY_ERROR_EXTRA, constructErrorResponseBytes(errorCode, errorMsg)); + intent.putExtra(Fido.FIDO2_KEY_CREDENTIAL_EXTRA, parcel.marshall()); return intent; }
diff --git a/chrome/app/resources/generated_resources_bg.xtb b/chrome/app/resources/generated_resources_bg.xtb index 290a7ab7..ce3c8dd 100644 --- a/chrome/app/resources/generated_resources_bg.xtb +++ b/chrome/app/resources/generated_resources_bg.xtb
@@ -3687,6 +3687,7 @@ <translation id="4785719467058219317">Използвате ключ за сигурност, който не е регистриран в този уебсайт</translation> <translation id="478708757211772586">Използвайте „Напред“ за придвижване напред по екрана</translation> <translation id="4788092183367008521">Моля, проверете връзката си с мрежата и опитайте отново.</translation> +<translation id="4789550509729954245">Показване на известие, когато наблизо има споделящи устройства</translation> <translation id="4791000909649665275"><ph name="NUMBER" /> снимка</translation> <translation id="4791037424585594169">(UDP)</translation> <translation id="4792290259143007505">Активиране на ускоряването на TrackPoint</translation> @@ -4048,6 +4049,7 @@ <translation id="5171343362375269016">Резервна памет</translation> <translation id="5172855596271336236">Има 1 управляван принтер.</translation> <translation id="5173668317844998239">Добавяне и изтриване на отпечатъци, запазени в ключа ви за сигурност</translation> +<translation id="5174169235862638850">Паролата е копирана в буферната памет</translation> <translation id="5175379009094579629">Името на устройството е невалидно. Въведете валидно име на устройство, за да опитате отново.</translation> <translation id="5177479852722101802">Достъпът до камерата и микрофона да продължи да се блокира</translation> <translation id="5177549709747445269">Използвате мобилни данни</translation>
diff --git a/chrome/app/resources/generated_resources_hi.xtb b/chrome/app/resources/generated_resources_hi.xtb index 7ddf2e3..506bd2f 100644 --- a/chrome/app/resources/generated_resources_hi.xtb +++ b/chrome/app/resources/generated_resources_hi.xtb
@@ -3226,6 +3226,7 @@ <translation id="4275830172053184480">अपना डिवाइस फिर से प्रारंभ करें</translation> <translation id="4278390842282768270">अनुमति है</translation> <translation id="4279129444466079448">आप इस डिवाइस पर <ph name="PROFILE_LIMIT" /> ई-सिम प्रोफ़ाइलें इंस्टॉल कर सकते हैं. अन्य प्रोफ़ाइल जोड़ने के लिए, पहले किसी मौजूदा प्रोफ़ाइल को हटाएं.</translation> +<translation id="4280325816108262082">बंद होने पर या इस्तेमाल नहीं किए जाने पर डिवाइस अपने-आप डिसकनेक्ट हो जाएगा</translation> <translation id="4281844954008187215">सेवा की शर्तें</translation> <translation id="4282196459431406533">Smart Lock चालू है</translation> <translation id="4284755288573763878">बेहतर सुरक्षा वाली ब्राउज़िंग बंद करनी है?</translation> @@ -4346,6 +4347,7 @@ <translation id="5490721031479690399">ब्लूटूथ डिवाइस डिसकनेक्ट करें</translation> <translation id="5490798133083738649">Linux को अपना माइक्रोफ़ोन ऐक्सेस करने दें</translation> <translation id="549211519852037402">गहरा पीला और सफ़ेद</translation> +<translation id="5492637351392383067">डिवाइस पर पासवर्ड एन्क्रिप्ट (सुरक्षित) करना</translation> <translation id="5493792505296048976">स्क्रीन चालू है</translation> <translation id="5494016731375030300">हाल ही में बंद किए गए टैब</translation> <translation id="5494362494988149300">&पू्र्ण होने पर खोलें</translation> @@ -6543,6 +6545,7 @@ <translation id="7775694664330414886">टैब को बिना नाम वाले ग्रुप में ले जाया गया - <ph name="GROUP_CONTENTS" /></translation> <translation id="7776156998370251340">जब तक आप इस साइट के लिए सभी टैब बंद नहीं कर देते, <ph name="ORIGIN" /> तब तक फाइलों को <ph name="FOLDERNAME" /> में देख पाएगी</translation> <translation id="7776701556330691704">कोई आवाज़ नहीं मिली</translation> +<translation id="7777284276915203144">Google पासवर्ड मैनेजर में सेव होने से पहले, पासवर्ड आपके डिवाइस पर एन्क्रिप्ट (सुरक्षित) कर लिए जाते हैं</translation> <translation id="7781335840981796660">सभी 'उपयोगकर्ता खातों' और 'स्थानीय डेटा' को हटा दिया जाएगा.</translation> <translation id="7782102568078991263">Google की ओर से कोई और सुझाव नहीं</translation> <translation id="7782717250816686129">लॉगिन स्क्रीन पर लगातार दिख रहे डेटा को स्टोर करें और सेशन में क्रेडेंशियल डालें.</translation> @@ -7194,6 +7197,7 @@ <translation id="8428634594422941299">समझ लिया</translation> <translation id="84297032718407999">आपको <ph name="LOGOUT_TIME_LEFT" /> में साइन आउट कर दिया जाएगा</translation> <translation id="8431190899827883166">टैप दिखाएं</translation> +<translation id="8431730749911729314">Google पासवर्ड मैनेजर में सेव होने से पहले, पासवर्ड अपने डिवाइस पर एन्क्रिप्ट (सुरक्षित) करें</translation> <translation id="8434480141477525001">NaCl डीबग पोर्ट</translation> <translation id="8435395510592618362"><ph name="APP_NAME" /> के ज़रिए अपनी पहचान की पुष्टि करें</translation> <translation id="8437209419043462667">यूएस</translation> @@ -7984,6 +7988,7 @@ <translation id="947667444780368238"><ph name="ORIGIN" /> की मदद से, इस फ़ोल्डर में मौजूद फ़ाइलें नहीं खोली जा सकतीं, क्योंकि इस फ़ोल्डर में सिस्टम फ़ाइलें हैं</translation> <translation id="950307215746360464">सेट अप गाइड</translation> <translation id="951991426597076286">अस्वीकार करें</translation> +<translation id="952471655966876828">चालू होने पर या इस्तेमाल किए जाने पर डिवाइस अपने-आप कनेक्ट हो जाएगा</translation> <translation id="953434574221655299">साइटों को यह जानने की अनुमति है कि आप अपने डिवाइस का इस्तेमाल कब करते हैं</translation> <translation id="956500788634395331">आप ऐसे एक्सटेंशन से सुरक्षित हैं जो शायद नुकसान पहुंचा सकते हैं</translation> <translation id="957960681186851048">इस साइट ने अपने आप कई फ़ाइलें डाउनलोड करने की कोशिश की है</translation>
diff --git a/chrome/app/resources/generated_resources_id.xtb b/chrome/app/resources/generated_resources_id.xtb index 9d9f1d86..654347d 100644 --- a/chrome/app/resources/generated_resources_id.xtb +++ b/chrome/app/resources/generated_resources_id.xtb
@@ -3690,6 +3690,7 @@ <translation id="4785719467058219317">Anda menggunakan kunci keamanan yang tidak terdaftar di situs ini</translation> <translation id="478708757211772586">Gunakan “Berikutnya” untuk berpindah ke item berikutnya di layar</translation> <translation id="4788092183367008521">Periksa koneksi jaringan Anda, lalu coba lagi.</translation> +<translation id="4789550509729954245">Tampilkan notifikasi saat perangkat sedang berbagi di sekitar</translation> <translation id="4791000909649665275"><ph name="NUMBER" /> foto</translation> <translation id="4791037424585594169">(UDP)</translation> <translation id="4792290259143007505">Aktifkan akselerasi TrackPoint</translation> @@ -4051,6 +4052,7 @@ <translation id="5171343362375269016">Memori yang Ditukar</translation> <translation id="5172855596271336236">Ada 1 printer terkelola.</translation> <translation id="5173668317844998239">Menambahkan dan menghapus sidik jari yang tersimpan di kunci keamanan Anda</translation> +<translation id="5174169235862638850">Sandi disalin ke papan klip</translation> <translation id="5175379009094579629">Nama perangkat tidak valid. Masukkan nama perangkat yang valid untuk mencoba lagi.</translation> <translation id="5177479852722101802">Terus blokir akses mikrofon dan kamera</translation> <translation id="5177549709747445269">Anda menggunakan data seluler</translation>
diff --git a/chrome/app/resources/generated_resources_km.xtb b/chrome/app/resources/generated_resources_km.xtb index b5b0c0a..b1047134 100644 --- a/chrome/app/resources/generated_resources_km.xtb +++ b/chrome/app/resources/generated_resources_km.xtb
@@ -3227,6 +3227,7 @@ <translation id="4275830172053184480">ចាប់ផ្តើមឧបករណ៍របស់អ្នកឡើងវិញ</translation> <translation id="4278390842282768270">បានអនុញ្ញាត</translation> <translation id="4279129444466079448">អ្នកអាចដំឡើងកម្រងព័ត៌មាន eSIM បានរហូតដល់ <ph name="PROFILE_LIMIT" /> នៅលើឧបករណ៍នេះ។ ដើម្បីបញ្ចូលកម្រងព័ត៌មានផ្សេងទៀត សូមលុបកម្រងព័ត៌មានដែលមានស្រាប់ជាមុនសិន។</translation> +<translation id="4280325816108262082">ឧបករណ៍នឹងផ្ដាច់ដោយស្វ័យប្រវត្តិ នៅពេលបិទ ឬមិនកំពុងត្រូវបានប្រើប្រាស់</translation> <translation id="4281844954008187215">លក្ខខណ្ឌសេវាកម្ម</translation> <translation id="4282196459431406533">Smart Lock បានបើកហើយ</translation> <translation id="4284755288573763878">បិទសុវត្ថិភាពបន្ថែមឬ?</translation> @@ -4345,6 +4346,7 @@ <translation id="5490721031479690399">ផ្ដាច់ឧបករណ៍ប៊្លូធូស</translation> <translation id="5490798133083738649">អនុញ្ញាតឱ្យ Linux ចូលប្រើមីក្រូហ្វូនរបស់អ្នក</translation> <translation id="549211519852037402">ត្នោតខ្ចី និងស</translation> +<translation id="5492637351392383067">ការអ៊ីនគ្រីបនៅលើឧបករណ៍</translation> <translation id="5493792505296048976">បើកអេក្រង់</translation> <translation id="5494016731375030300">ផ្ទាំងដែលបានបិទថ្មីៗ</translation> <translation id="5494362494988149300">បើកនៅពេលបញ្ចប់</translation> @@ -6543,6 +6545,7 @@ <translation id="7775694664330414886">បានផ្លាស់ទីផ្ទាំងទៅក្នុងក្រុមដែលគ្មានឈ្មោះ - <ph name="GROUP_CONTENTS" /></translation> <translation id="7776156998370251340"><ph name="ORIGIN" /> នឹងអាចមើលឯកសារនៅក្នុង <ph name="FOLDERNAME" /> បាន រហូតទាល់តែអ្នកបិទផ្ទាំងទាំងអស់សម្រាប់គេហទំព័រនេះ</translation> <translation id="7776701556330691704">រកមិនឃើញសំឡេងទេ</translation> +<translation id="7777284276915203144">ពាក្យសម្ងាត់របស់អ្នកត្រូវបានអ៊ីនគ្រីបនៅលើឧបករណ៍របស់អ្នក មុនពេលរក្សាទុកពាក្យសម្ងាត់ទាំងនោះទៅកម្មវិធីគ្រប់គ្រងពាក្យសម្ងាត់ Google</translation> <translation id="7781335840981796660">គណនីអ្នកប្រើ និងទិន្នន័យមូលដ្ឋានទាំងអស់នឹងត្រូវបានដកចេញ។</translation> <translation id="7782102568078991263">គ្មានការផ្តល់យោបល់ផ្សេងទៀតពី Google ទេ</translation> <translation id="7782717250816686129">រក្សាទុកទិន្នន័យអចិន្ត្រៃយ៍នៅលើអេក្រង់ចូល រួចបញ្ចូលព័ត៌មានផ្ទៀងផ្ទាត់នៅពេលចូលប្រើ។</translation> @@ -7194,6 +7197,7 @@ <translation id="8428634594422941299">យល់ហើយ</translation> <translation id="84297032718407999">អ្នកនឹងត្រូវបានបង្ខំឱ្យចាកចេញក្នុងរយៈពេល <ph name="LOGOUT_TIME_LEFT" /> ទៀត</translation> <translation id="8431190899827883166">បង្ហាញការចុច</translation> +<translation id="8431730749911729314">អ៊ីនគ្រីបពាក្យសម្ងាត់នៅលើឧបករណ៍របស់អ្នក មុនពេលរក្សាទុកពាក្យសម្ងាត់ទាំងនោះទៅកម្មវិធីគ្រប់គ្រងពាក្យសម្ងាត់ Google</translation> <translation id="8434480141477525001">រន្ធកម្ចាត់កំហុស NaCl</translation> <translation id="8435395510592618362">ផ្ទៀងផ្ទាត់អត្តសញ្ញាណរបស់អ្នកជាមួយ <ph name="APP_NAME" /></translation> <translation id="8437209419043462667">អាមេរិក</translation> @@ -7983,6 +7987,7 @@ <translation id="947667444780368238"><ph name="ORIGIN" /> មិនអាចបើកឯកសារនៅក្នុងថតនេះបានទេ ដោយសារថតនេះមានឯកសារប្រព័ន្ធ</translation> <translation id="950307215746360464">ការណែនាំអំពីការរៀបចំ</translation> <translation id="951991426597076286">បដិសេធ</translation> +<translation id="952471655966876828">ឧបករណ៍នឹងភ្ជាប់ដោយស្វ័យប្រវត្តិ នៅពេលបើក ឬកំពុងត្រូវបានប្រើប្រាស់</translation> <translation id="953434574221655299">អនុញ្ញាតឱ្យដឹងថា នៅពេលណាដែលអ្នកកំពុងប្រើឧបករណ៍របស់អ្នកយ៉ាងសកម្ម</translation> <translation id="956500788634395331">អ្នកទទួលបានការការពារពីកម្មវិធីបន្ថែមដែលអាចបង្កគ្រោះថ្នាក់</translation> <translation id="957960681186851048">ទំព័រនេះបានព្យាយាមទាញយកឯកសារជាច្រើនដោយស្វ័យប្រវត្តិ</translation>
diff --git a/chrome/app/resources/generated_resources_ko.xtb b/chrome/app/resources/generated_resources_ko.xtb index 2a0b2b7b..c6f954d 100644 --- a/chrome/app/resources/generated_resources_ko.xtb +++ b/chrome/app/resources/generated_resources_ko.xtb
@@ -3687,6 +3687,7 @@ <translation id="4785719467058219317">이 웹사이트에 등록되지 않은 보안 키를 사용하고 있습니다.</translation> <translation id="478708757211772586">'다음'을 사용하여 화면에서 앞으로 이동합니다.</translation> <translation id="4788092183367008521">네트워크 연결을 확인한 다음 다시 시도하세요.</translation> +<translation id="4789550509729954245">근처의 기기가 공유 중일 때 알림 표시</translation> <translation id="4791000909649665275">사진 <ph name="NUMBER" />장</translation> <translation id="4791037424585594169">(UDP)</translation> <translation id="4792290259143007505">TrackPoint 가속 사용</translation> @@ -4048,6 +4049,7 @@ <translation id="5171343362375269016">교체된 메모리</translation> <translation id="5172855596271336236">관리되는 프린터가 1대 있습니다.</translation> <translation id="5173668317844998239">보안 키에 저장된 지문을 추가 및 삭제합니다.</translation> +<translation id="5174169235862638850">비밀번호가 클립보드에 복사되었습니다.</translation> <translation id="5175379009094579629">잘못된 기기 이름입니다. 올바른 기기 이름을 입력하고 다시 시도해 보세요.</translation> <translation id="5177479852722101802">카메라 및 마이크 액세스 계속 차단</translation> <translation id="5177549709747445269">모바일 데이터 사용 중</translation>
diff --git a/chrome/app/resources/generated_resources_mn.xtb b/chrome/app/resources/generated_resources_mn.xtb index 692c6689..3b28c43 100644 --- a/chrome/app/resources/generated_resources_mn.xtb +++ b/chrome/app/resources/generated_resources_mn.xtb
@@ -3222,6 +3222,7 @@ <translation id="4275830172053184480">Төхөөрөмжийг дахин эхлүүл</translation> <translation id="4278390842282768270">Зөвшөөрөгдсөн</translation> <translation id="4279129444466079448">Та энэ төхөөрөмж дээр <ph name="PROFILE_LIMIT" /> хүртэлх eSIM-н профайл суулгах боломжтой. Өөр профайл нэмэхийн тулд эхлээд одоо байгаа аль нэг профайлыг хасна уу.</translation> +<translation id="4280325816108262082">Төхөөрөмж унтраалттай эсвэл ашиглагдаагүй үедээ автоматаар сална</translation> <translation id="4281844954008187215">Үйлчилгээний нөхцөл</translation> <translation id="4282196459431406533">Smart Lock-г асаасан</translation> <translation id="4284755288573763878">Сайжруулсан хамгаалалтыг унтраах уу?</translation> @@ -4342,6 +4343,7 @@ <translation id="5490721031479690399">Bluetooth төхөөрөмжийг салгах</translation> <translation id="5490798133083738649">Linux-д таны микрофонд хандахыг зөвшөөрнө үү</translation> <translation id="549211519852037402">Хул ба цагаан</translation> +<translation id="5492637351392383067">Төхөөрөмж дээрх шифрлэлт</translation> <translation id="5493792505296048976">дэлгэц асаалттай</translation> <translation id="5494016731375030300">Сүүлд хаасан табууд</translation> <translation id="5494362494988149300">Үйлдэл хийгдэж дууссаны дараа нээх</translation> @@ -6539,6 +6541,7 @@ <translation id="7775694664330414886">Табыг нэргүй бүлэг рүү зөөсөн - <ph name="GROUP_CONTENTS" /></translation> <translation id="7776156998370251340">Таныг энэ сайтын бүх табыг хаах хүртэл <ph name="ORIGIN" /> нь <ph name="FOLDERNAME" /> доторх файлуудыг үзэх боломжтой байна</translation> <translation id="7776701556330691704">Дуу хоолой олдсонгүй</translation> +<translation id="7777284276915203144">Таны нууц үгийг Google-н Нууц үгний менежерт хадгалахаас нь өмнө төхөөрөмж дээр тань шифрлэдэг</translation> <translation id="7781335840981796660">Бүх хэрэглэгчийн бүртгэлүүд болон суурин өгөгдлүүд устах болно.</translation> <translation id="7782102568078991263">Google-ээс өөр зөвлөмж алга байна.</translation> <translation id="7782717250816686129">Нэвтрэх дэлгэц дээр байнгын өгөгдлийг хадгалж, харилцан үйлдэлд мандат үнэмлэхийг оруулах.</translation> @@ -7188,6 +7191,7 @@ <translation id="8428634594422941299">Ойлголоо</translation> <translation id="84297032718407999">Та <ph name="LOGOUT_TIME_LEFT" />-н дараа гарах болно</translation> <translation id="8431190899827883166">Товшилтыг харуулах</translation> +<translation id="8431730749911729314">Өөрийн төхөөрөмж дээрх нууц үгнүүдийг Google-н Нууц үгний менежерт хадгалахаас нь өмнө шифрлэнэ үү</translation> <translation id="8434480141477525001">NaCl гүйцэтгэл сайжруулах порт</translation> <translation id="8435395510592618362">Аюулгүй байдлын түлхүүрээ <ph name="APP_NAME" />-р баталгаажуулна уу</translation> <translation id="8437209419043462667">АНУ</translation> @@ -7975,6 +7979,7 @@ <translation id="947667444780368238">Энэ фолдер системийн файл агуулдаг тул <ph name="ORIGIN" /> үүний файлыг нээх боломжгүй</translation> <translation id="950307215746360464">Тохируулгын хөтөч</translation> <translation id="951991426597076286">Татгалзах</translation> +<translation id="952471655966876828">Төхөөрөмж асаалттай эсвэл ашиглагдах үедээ автоматаар холбогдоно</translation> <translation id="953434574221655299">Таныг төхөөрөмжөө хэзээ идэвхтэй ашиглаж буйг мэдэхийг зөвшөөрсөн</translation> <translation id="956500788634395331">Таныг аюултай байж болзошгүй өргөтгөлөөс хамгаалж байна</translation> <translation id="957960681186851048">Энэ сайт автоматаар олон файл татахаар оролдсон</translation>
diff --git a/chrome/app/resources/generated_resources_ne.xtb b/chrome/app/resources/generated_resources_ne.xtb index 67c98cd9..2ae0ad1 100644 --- a/chrome/app/resources/generated_resources_ne.xtb +++ b/chrome/app/resources/generated_resources_ne.xtb
@@ -3209,6 +3209,7 @@ <translation id="4275830172053184480">आफ्नो यन्त्रलाई फेरि सुरु गर्नुहोस्</translation> <translation id="4278390842282768270">अनुमति प्राप्त</translation> <translation id="4279129444466079448">तपाईं यो डिभाइसमा बढीमा <ph name="PROFILE_LIMIT" /> वटा eSIM प्रोफाइल इन्स्टल गर्न सक्नुहुन्छ। अर्को प्रोफाइल हाल्न सर्वप्रथम अहिलेको प्रोफाइल हटाउनुहोस्।</translation> +<translation id="4280325816108262082">डिभाइस अफ गरिएको खण्डमा वा उक्त डिभाइस प्रयोग नभएको बेला सो डिभाइस स्वतः डिस्कनेक्ट हुने छ</translation> <translation id="4281844954008187215">सेवाका सर्तहरू</translation> <translation id="4282196459431406533">Smart Lock सक्रिय छ</translation> <translation id="4284755288573763878">परिष्कृत सुरक्षा अफ गर्ने हो?</translation> @@ -4328,6 +4329,7 @@ <translation id="5490721031479690399">ब्लुटुथ डिस्कनेक्ट गर्नुहोस्</translation> <translation id="5490798133083738649">Linux लाई तपाईंको माइक्रोफोन प्रयोग गर्ने अनुमति दिनुहोस्</translation> <translation id="549211519852037402">फुस्रो खैरो र सेतो</translation> +<translation id="5492637351392383067">डिभाइसमै चल्ने इन्क्रिप्सन</translation> <translation id="5493792505296048976">स्क्रिन सक्रिय छ</translation> <translation id="5494016731375030300">भर्खरै बन्द गरिएका ट्याबहरू</translation> <translation id="5494362494988149300">&पूरा भएपछि खोल्नुहोस्</translation> @@ -6524,6 +6526,7 @@ <translation id="7775694664330414886">यो ट्याब नामविहीन समूहमा सारियो - <ph name="GROUP_CONTENTS" /></translation> <translation id="7776156998370251340">तपाईंले यो साइटका सबै ट्याबहरू बन्द नगरुन्जेल <ph name="ORIGIN" /> ले <ph name="FOLDERNAME" /> मा रहेका फाइलहरू हेर्न सक्ने छ</translation> <translation id="7776701556330691704">कुनै पनि आवाज फेला परेन</translation> +<translation id="7777284276915203144">तपाईंका पासवर्डहरू तपाईंको डिभाइसमा इन्क्रिप्ट गरेपछि मात्र Google पासवर्ड म्यानेजरमा सेभ गरिन्छ</translation> <translation id="7781335840981796660">सबै प्रयोगकर्ता खाताहरू र स्थानीय लगत हटाइनेछन्।</translation> <translation id="7782102568078991263">गुगलबाट कुनै थप सुझाव छैन</translation> <translation id="7782717250816686129">लग इन स्क्रिनमा निरन्तर डेटा भण्डारण गर्नुहोस् र सत्रमा प्रमाणपत्रहरू प्रविष्टि होस्।</translation> @@ -7175,6 +7178,7 @@ <translation id="8428634594422941299">बुझेँ</translation> <translation id="84297032718407999"><ph name="LOGOUT_TIME_LEFT" /> मा तपाईंलाई साइन आउट गरिने छ</translation> <translation id="8431190899827883166">ट्याप देखाइयोस्</translation> +<translation id="8431730749911729314">Google पासवर्ड म्यानेजरमा पासवर्डहरू सेभ गर्नुअघि ती पासवर्डहरू आफ्नो डिभाइसमा इन्क्रिप्ट गर्नुहोस्</translation> <translation id="8434480141477525001">NaCl डिबग पोर्ट</translation> <translation id="8435395510592618362"><ph name="APP_NAME" /> मार्फत आफ्नो पहिचान पुष्टि गर्नुहोस्</translation> <translation id="8437209419043462667">US</translation> @@ -7964,6 +7968,7 @@ <translation id="947667444780368238">यो फोल्डरमा प्रणालीका फाइलहरू भएकाले <ph name="ORIGIN" /> ले यो फोल्डरमा भएका फाइल खोल्न सक्दैन</translation> <translation id="950307215746360464">सेटअप गाइड</translation> <translation id="951991426597076286">अस्वीकार गर्नुहोस्</translation> +<translation id="952471655966876828">डिभाइस अन गरिएको खण्डमा वा उक्त डिभाइस प्रयोग भएको बेला सो डिभाइस स्वतः कनेक्ट हुने छ</translation> <translation id="953434574221655299">तपाईं आफ्नो यन्त्र चलाउँदै हुनुहुन्छ कि हुनुहुन्न भन्ने कुरा थाहा पाउन दिइएका साइटहरू</translation> <translation id="956500788634395331">तपाईं हानिकारक हुन सक्ने एक्स्टेन्सनहरूबाट सुरक्षित हुनुहुन्छ</translation> <translation id="957960681186851048">यो साइटले स्वतः एकभन्दा बढी फाइलहरू डाउनलोड गर्ने प्रयास गर्यो</translation>
diff --git a/chrome/app/resources/generated_resources_uk.xtb b/chrome/app/resources/generated_resources_uk.xtb index 66d93bf..5d9bf59 100644 --- a/chrome/app/resources/generated_resources_uk.xtb +++ b/chrome/app/resources/generated_resources_uk.xtb
@@ -3693,6 +3693,7 @@ <translation id="4785719467058219317">Ви використовуєте ключ безпеки, не зареєстрований на цьому веб-сайті</translation> <translation id="478708757211772586">Натискайте "Далі", щоб переходити вперед на екрані</translation> <translation id="4788092183367008521">Перевірте з’єднання з мережею та повторіть спробу.</translation> +<translation id="4789550509729954245">Показувати сповіщення, коли пристрої поблизу обмінюються даними</translation> <translation id="4791000909649665275"><ph name="NUMBER" /> фото</translation> <translation id="4791037424585594169">(UDP)</translation> <translation id="4792290259143007505">Увімкнути прискорення TrackPoint</translation> @@ -4054,6 +4055,7 @@ <translation id="5171343362375269016">Замінена пам’ять</translation> <translation id="5172855596271336236">Є 1 керований принтер.</translation> <translation id="5173668317844998239">Додавайте та видаляйте відбитки пальців, збережені на ключі безпеки</translation> +<translation id="5174169235862638850">Пароль скопійовано в буфер обміну</translation> <translation id="5175379009094579629">Назва пристрою недійсна. Введіть дійсну назву.</translation> <translation id="5177479852722101802">Продовжити блокувати доступ до камери та мікрофона</translation> <translation id="5177549709747445269">Ви використовуєте мобільний Інтернет</translation>
diff --git a/chrome/app/resources/generated_resources_uz.xtb b/chrome/app/resources/generated_resources_uz.xtb index bfc1152..8255dda 100644 --- a/chrome/app/resources/generated_resources_uz.xtb +++ b/chrome/app/resources/generated_resources_uz.xtb
@@ -3214,6 +3214,7 @@ <translation id="4275830172053184480">Qurilmangizni qayta yuklang</translation> <translation id="4278390842282768270">Berilgan ruxsatnomalar</translation> <translation id="4279129444466079448">Bu qurilmada <ph name="PROFILE_LIMIT" /> gacha eSIM profillarini oʻrnatish mumkin. Boshqa profil kiritish uchun avval mavjud profillardan birini olib tashlang.</translation> +<translation id="4280325816108262082">Qurilma faolsizlantirilganda yoki ishlatilmayotganda avtomatik ravishda uziladi</translation> <translation id="4281844954008187215">Xizmat shartlari</translation> <translation id="4282196459431406533">Smart Lock yoniq</translation> <translation id="4284755288573763878">Kengaytirilgan himoya oʻchirilsinmi?</translation> @@ -3677,6 +3678,7 @@ <translation id="4785719467058219317">Elektron kalitingiz bu sayt roʻyxatidan oʻtkazilmagan</translation> <translation id="478708757211772586">Keyingi ekranga oʻtish uchun “Keyingi” tugmasini bosing</translation> <translation id="4788092183367008521">Tarmoq ulanishini tekshiring va qaytadan urining.</translation> +<translation id="4789550509729954245">Yaqin-atrofdagi qurilmalar maʼlumot almashganda bildirishnomalarni koʻrsatilsin</translation> <translation id="4791000909649665275"><ph name="NUMBER" /> ta rasm</translation> <translation id="4791037424585594169">(UDP)</translation> <translation id="4792290259143007505">TrackPoint tezlatkichini yoqish</translation> @@ -4038,6 +4040,7 @@ <translation id="5171343362375269016">Swap xotirasi</translation> <translation id="5172855596271336236">Boshqariladigan 1 ta printer bor.</translation> <translation id="5173668317844998239">Elektron kalitga barmoq izlari kiritish va saqlanganlarini olib tashlash</translation> +<translation id="5174169235862638850">Parol vaqtinchalik xotiraga nusxalandi</translation> <translation id="5175379009094579629">Qurilma nomi xato kiritilgan. Xatosiz kiriting va yana urining.</translation> <translation id="5177479852722101802">Kamera va mikrofonga ruxsat har doim bloklansin</translation> <translation id="5177549709747445269">Mobil internetdan foydalanilmoqda</translation> @@ -4332,6 +4335,7 @@ <translation id="5490721031479690399">Bluetooth qurilmani uzish</translation> <translation id="5490798133083738649">Linux mikrofondan foydalanishiga ruxsat berish</translation> <translation id="549211519852037402">Sargʻish va oq</translation> +<translation id="5492637351392383067">Qurilmada shifrlash</translation> <translation id="5493792505296048976">ekran yoniq</translation> <translation id="5494016731375030300">Oxirgi yopilgan varaqlar</translation> <translation id="5494362494988149300">&Yakunlanishida ochish</translation> @@ -6530,6 +6534,7 @@ <translation id="7775694664330414886">Varaq nomsiz guruhga olindi – <ph name="GROUP_CONTENTS" /></translation> <translation id="7776156998370251340">Bu sayt uchun varaqlar yopilmasa, <ph name="ORIGIN" /> sayti <ph name="FOLDERNAME" /> jildidagi barcha fayllarni ocha oladi</translation> <translation id="7776701556330691704">Ovoz namunalari topilmadi</translation> +<translation id="7777284276915203144">Parolingiz Google Parollar menejeriga saqlanishidan oldin qurilmangizda shifrlangan</translation> <translation id="7781335840981796660">Barcha hisoblar va mahalliy ma’lumotlar o‘chib ketadi.</translation> <translation id="7782102568078991263">Google‘dan boshqa takliflar yo‘q</translation> <translation id="7782717250816686129">Doimiy maʼlumotlarni kirish ekranida saqlash va hisob maʼlumotlarini seansga kiritish.</translation> @@ -7180,6 +7185,7 @@ <translation id="8428634594422941299">OK</translation> <translation id="84297032718407999"><ph name="LOGOUT_TIME_LEFT" />dan keyin tizimdan chiqasiz</translation> <translation id="8431190899827883166">Vizual teginish</translation> +<translation id="8431730749911729314">Parollarni Google Parollar menejeriga saqlashdan oldin qurilmangizda shifrlang</translation> <translation id="8434480141477525001">NaCl nosozliklarni ko‘rib chiqish porti</translation> <translation id="8435395510592618362">Shaxsingizni <ph name="APP_NAME" /> orqali tasdiqlang</translation> <translation id="8437209419043462667">Ingliz (AQSH)</translation> @@ -7970,6 +7976,7 @@ <translation id="947667444780368238"><ph name="ORIGIN" /> bu jilddagi fayllarni ocha olmaydi, chunki unda tizim fayllari mavjud</translation> <translation id="950307215746360464">Sozlash qoʻllanmasi</translation> <translation id="951991426597076286">Rad etish</translation> +<translation id="952471655966876828">Qurilma yoqilganda yoki ishlatilayotganda avtomatik ravishda ulanadi</translation> <translation id="953434574221655299">Qurilmangizni faol ishlatayotgan vaqtini bilishga ruxsat berilgan saytlar</translation> <translation id="956500788634395331">Zararli kengaytmalardan himoyalangansiz</translation> <translation id="957960681186851048">Bu sayt bir necha fayllarni avtomatik yuklab olishga urinib ko‘rdi</translation>
diff --git a/chrome/app/resources/generated_resources_vi.xtb b/chrome/app/resources/generated_resources_vi.xtb index 75a2e8bd..84d4001 100644 --- a/chrome/app/resources/generated_resources_vi.xtb +++ b/chrome/app/resources/generated_resources_vi.xtb
@@ -3690,6 +3690,7 @@ <translation id="4785719467058219317">Bạn đang sử dụng một khóa bảo mật chưa đăng ký với trang web này</translation> <translation id="478708757211772586">Sử dụng nút “Tiếp theo” để chuyển đến mục tiếp theo trên màn hình</translation> <translation id="4788092183367008521">Vui lòng kiểm tra kết nối mạng và thử lại.</translation> +<translation id="4789550509729954245">Hiện thông báo khi ở gần các thiết bị đang chia sẻ</translation> <translation id="4791000909649665275"><ph name="NUMBER" /> ảnh</translation> <translation id="4791037424585594169">(UDP)</translation> <translation id="4792290259143007505">Bật tính năng tăng tốc TrackPoint</translation> @@ -4051,6 +4052,7 @@ <translation id="5171343362375269016">Đã hoán đổi bộ nhớ</translation> <translation id="5172855596271336236">Có 1 máy in được quản lý.</translation> <translation id="5173668317844998239">Thêm và xóa vân tay đã lưu trên khóa bảo mật của bạn</translation> +<translation id="5174169235862638850">Đã sao chép mật khẩu vào bảng nhớ tạm</translation> <translation id="5175379009094579629">Tên thiết bị là không hợp lệ. Hãy nhập tên thiết bị hợp lệ để thử lại.</translation> <translation id="5177479852722101802">Tiếp tục chặn truy cập vào máy ảnh và micrô</translation> <translation id="5177549709747445269">Bạn đang sử dụng dữ liệu di động</translation>
diff --git a/chrome/app/resources/generated_resources_zh-HK.xtb b/chrome/app/resources/generated_resources_zh-HK.xtb index ab1ae3a..d0f16e7 100644 --- a/chrome/app/resources/generated_resources_zh-HK.xtb +++ b/chrome/app/resources/generated_resources_zh-HK.xtb
@@ -3689,6 +3689,7 @@ <translation id="4785719467058219317">您目前使用的安全密鑰並未在此網站註冊</translation> <translation id="478708757211772586">使用代表「下一個」的按鍵,前往畫面上的下一個項目</translation> <translation id="4788092183367008521">請檢查你的網絡連線,然後再試一次。</translation> +<translation id="4789550509729954245">附近裝置分享緊內容嘅時候顯示通知</translation> <translation id="4791000909649665275"><ph name="NUMBER" /> 張相片</translation> <translation id="4791037424585594169">(UDP)</translation> <translation id="4792290259143007505">啟用 TrackPoint 加速功能</translation> @@ -4051,6 +4052,7 @@ <translation id="5171343362375269016">儲存在 Swap 空間的記憶體</translation> <translation id="5172855596271336236">有 1 部受管理嘅打印機。</translation> <translation id="5173668317844998239">新增及刪除安全密鑰上儲存的指紋</translation> +<translation id="5174169235862638850">密碼已複製到剪貼簿</translation> <translation id="5175379009094579629">裝置名稱無效。請輸入有效的裝置名稱並再試一次。</translation> <translation id="5177479852722101802">繼續封鎖存取相機和麥克風</translation> <translation id="5177549709747445269">您正在使用流動數據</translation>
diff --git a/chrome/browser/ash/account_manager/account_manager_util.cc b/chrome/browser/ash/account_manager/account_manager_util.cc index 13f1c031..ed0e024 100644 --- a/chrome/browser/ash/account_manager/account_manager_util.cc +++ b/chrome/browser/ash/account_manager/account_manager_util.cc
@@ -60,9 +60,8 @@ cryptohome_root_dir, g_browser_process->system_network_context_manager() ->GetSharedURLLoaderFactory(), - base::BindRepeating( - &chromeos::DelayNetworkCall, - base::Milliseconds(chromeos::kDefaultNetworkRetryDelayMS)), + base::BindRepeating(&DelayNetworkCall, + base::Milliseconds(kDefaultNetworkRetryDelayMS)), std::move(initialization_callback)); crosapi::AccountManagerMojoService* account_manager_mojo_service =
diff --git a/chrome/browser/ash/browser_context_keyed_service_factories.cc b/chrome/browser/ash/browser_context_keyed_service_factories.cc index 1549b61..3498e337 100644 --- a/chrome/browser/ash/browser_context_keyed_service_factories.cc +++ b/chrome/browser/ash/browser_context_keyed_service_factories.cc
@@ -34,7 +34,6 @@ #include "chrome/browser/ash/secure_channel/nearby_connector_factory.h" #include "chrome/browser/ash/smb_client/smb_service_factory.h" #include "chrome/browser/ash/tether/tether_service_factory.h" -#include "chrome/browser/ash/web_applications/crosh_loader_factory.h" #include "chrome/browser/chromeos/extensions/file_manager/event_router_factory.h" #include "chrome/browser/chromeos/extensions/input_method_api.h" #include "chrome/browser/chromeos/extensions/media_player_api.h" @@ -62,7 +61,6 @@ bluetooth::DebugLogsManagerFactory::GetInstance(); borealis::BorealisServiceFactory::GetInstance(); cert_provisioning::CertProvisioningSchedulerUserServiceFactory::GetInstance(); - CroshLoaderFactory::GetInstance(); crostini::CrostiniEngagementMetricsService::Factory::GetInstance(); #if defined(USE_CUPS) chromeos::CupsProxyServiceManagerFactory::GetInstance();
diff --git a/chrome/browser/ash/chrome_browser_main_parts_ash.cc b/chrome/browser/ash/chrome_browser_main_parts_ash.cc index 3eb14f3a..363f9eb 100644 --- a/chrome/browser/ash/chrome_browser_main_parts_ash.cc +++ b/chrome/browser/ash/chrome_browser_main_parts_ash.cc
@@ -263,10 +263,6 @@ namespace ash { namespace { -// TODO(https://crbug.com/1164001): remove after migrating to namespace ash. -using ::chromeos::NetworkPortalDetectorImpl; -namespace network_health = ::chromeos::network_health; - void ChromeOSVersionCallback(const std::string& version) { base::SetLinuxDistro(std::string("CrOS ") + version); }
diff --git a/chrome/browser/ash/chrome_browser_main_parts_ash.h b/chrome/browser/ash/chrome_browser_main_parts_ash.h index 9b40163..6fef86d 100644 --- a/chrome/browser/ash/chrome_browser_main_parts_ash.h +++ b/chrome/browser/ash/chrome_browser_main_parts_ash.h
@@ -11,12 +11,6 @@ #include "base/task/cancelable_task_tracker.h" #include "chrome/browser/ash/external_metrics.h" // TODO(https://crbug.com/1164001): remove and use forward declaration. -#include "chrome/browser/ash/net/bluetooth_pref_state_observer.h" -// TODO(https://crbug.com/1164001): remove and use forward declaration. -#include "chrome/browser/ash/net/network_pref_state_observer.h" -// TODO(https://crbug.com/1164001): remove and use forward declaration. -#include "chrome/browser/ash/net/network_throttling_observer.h" -// TODO(https://crbug.com/1164001): remove and use forward declaration. #include "chrome/browser/ash/network_change_manager_client.h" #include "chrome/browser/ash/pcie_peripheral/ash_usb_detector.h" // TODO(https://crbug.com/1164001): remove and use forward declaration. @@ -68,6 +62,7 @@ namespace ash { class AccessibilityEventRewriterDelegateImpl; class ArcKioskAppManager; +class BluetoothPrefStateObserver; class BulkPrintersCalculatorFactory; class CrosUsbDetector; class DebugdNotificationHandler; @@ -80,6 +75,8 @@ class LoginScreenExtensionsLifetimeManager; class LoginScreenExtensionsStorageCleaner; class LowDiskNotification; +class NetworkPrefStateObserver; +class NetworkThrottlingObserver; class PowerMetricsReporter; class PSIMemoryMetrics; class RendererFreezer;
diff --git a/chrome/browser/ash/login/arc_terms_of_service_browsertest.cc b/chrome/browser/ash/login/arc_terms_of_service_browsertest.cc index 597057d..6a41701 100644 --- a/chrome/browser/ash/login/arc_terms_of_service_browsertest.cc +++ b/chrome/browser/ash/login/arc_terms_of_service_browsertest.cc
@@ -20,9 +20,8 @@ #include "chrome/browser/ash/login/login_wizard.h" #include "chrome/browser/ash/login/oobe_screen.h" #include "chrome/browser/ash/login/screens/recommend_apps_screen.h" -#include "chrome/browser/ash/login/test/embedded_test_server_setup_mixin.h" +#include "chrome/browser/ash/login/test/embedded_policy_test_server_mixin.h" #include "chrome/browser/ash/login/test/js_checker.h" -#include "chrome/browser/ash/login/test/local_policy_test_server_mixin.h" #include "chrome/browser/ash/login/test/login_manager_mixin.h" #include "chrome/browser/ash/login/test/oobe_base_test.h" #include "chrome/browser/ash/login/test/oobe_screen_exit_waiter.h" @@ -650,9 +649,9 @@ void UploadDeviceLocalAccountPolicy() { BuildDeviceLocalAccountPolicy(); - ASSERT_TRUE(local_policy_mixin_.server()->UpdatePolicy( + policy_test_server_mixin_.UpdatePolicy( policy::dm_protocol::kChromePublicAccountPolicyType, kAccountId, - device_local_account_policy_.payload().SerializeAsString())); + device_local_account_policy_.payload().SerializeAsString()); } void UploadAndInstallDeviceLocalAccountPolicy() { @@ -665,7 +664,7 @@ em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); policy::DeviceLocalAccountTestHelper::AddPublicSession(&proto, kAccountId); RefreshDevicePolicy(); - ASSERT_TRUE(local_policy_mixin_.UpdateDevicePolicy(proto)); + policy_test_server_mixin_.UpdateDevicePolicy(proto); } void WaitForDisplayName() { @@ -714,7 +713,7 @@ policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION)); policy::DevicePolicyCrosTestHelper policy_helper_; policy::UserPolicyBuilder device_local_account_policy_; - LocalPolicyTestServerMixin local_policy_mixin_{&mixin_host_}; + EmbeddedPolicyTestServerMixin policy_test_server_mixin_{&mixin_host_}; DeviceStateMixin device_state_{ &mixin_host_, DeviceStateMixin::State::OOBE_COMPLETED_CLOUD_ENROLLED}; };
diff --git a/chrome/browser/ash/login/test/embedded_policy_test_server_mixin.cc b/chrome/browser/ash/login/test/embedded_policy_test_server_mixin.cc index d8a58b8..a4bf429 100644 --- a/chrome/browser/ash/login/test/embedded_policy_test_server_mixin.cc +++ b/chrome/browser/ash/login/test/embedded_policy_test_server_mixin.cc
@@ -40,8 +40,9 @@ } // namespace EmbeddedPolicyTestServerMixin::EmbeddedPolicyTestServerMixin( - InProcessBrowserTestMixinHost* host) - : InProcessBrowserTestMixin(host) {} + InProcessBrowserTestMixinHost* host, + std::initializer_list<Capabilities> capabilities) + : InProcessBrowserTestMixin(host), capabilities_(capabilities) {} EmbeddedPolicyTestServerMixin::~EmbeddedPolicyTestServerMixin() = default; @@ -52,13 +53,22 @@ FakeGaiaMixin::kFakeAuthCode); policy_test_server_->policy_storage()->add_managed_user("*"); - // Create universal signing keys that can sign any domain. - std::vector<policy::SignatureProvider::SigningKey> universal_signing_keys; - universal_signing_keys.push_back(policy::SignatureProvider::SigningKey( - policy::PolicyBuilder::CreateTestSigningKey(), - {{"*", policy::PolicyBuilder::GetTestSigningKeySignature()}})); - policy_test_server_->policy_storage()->signature_provider()->set_signing_keys( - std::move(universal_signing_keys)); + if (!capabilities_.contains(ENABLE_CANNED_SIGNING_KEYS)) { + // Create universal signing keys that can sign any domain. + std::vector<policy::SignatureProvider::SigningKey> universal_signing_keys; + universal_signing_keys.push_back(policy::SignatureProvider::SigningKey( + policy::PolicyBuilder::CreateTestSigningKey(), + {{"*", policy::PolicyBuilder::GetTestSigningKeySignature()}})); + policy_test_server_->policy_storage() + ->signature_provider() + ->set_signing_keys(std::move(universal_signing_keys)); + } + + if (capabilities_.contains(ENABLE_AUTOMATIC_ROTATION_OF_SIGNINGKEYS)) { + policy_test_server_->policy_storage() + ->signature_provider() + ->set_rotate_keys(true); + } // Register default user used in many tests. policy::ClientStorage::ClientInfo client_info; @@ -86,16 +96,30 @@ void EmbeddedPolicyTestServerMixin::UpdateDevicePolicy( const enterprise_management::ChromeDeviceSettingsProto& policy) { - policy_test_server_->policy_storage()->SetPolicyPayload( - policy::dm_protocol::kChromeDevicePolicyType, policy.SerializeAsString()); + UpdatePolicy(policy::dm_protocol::kChromeDevicePolicyType, + policy.SerializeAsString()); } void EmbeddedPolicyTestServerMixin::UpdateUserPolicy( const enterprise_management::CloudPolicySettings& policy, const std::string& policy_user) { policy_test_server_->policy_storage()->set_policy_user(policy_user); - policy_test_server_->policy_storage()->SetPolicyPayload( - policy::dm_protocol::kChromeUserPolicyType, policy.SerializeAsString()); + UpdatePolicy(policy::dm_protocol::kChromeUserPolicyType, + policy.SerializeAsString()); +} + +void EmbeddedPolicyTestServerMixin::UpdatePolicy( + const std::string& type, + const std::string& serialized_policy) { + UpdatePolicy(type, std::string(), serialized_policy); +} + +void EmbeddedPolicyTestServerMixin::UpdatePolicy( + const std::string& type, + const std::string& entity_id, + const std::string& serialized_policy) { + policy_test_server_->policy_storage()->SetPolicyPayload(type, entity_id, + serialized_policy); } void EmbeddedPolicyTestServerMixin::SetUpdateDeviceAttributesPermission(
diff --git a/chrome/browser/ash/login/test/embedded_policy_test_server_mixin.h b/chrome/browser/ash/login/test/embedded_policy_test_server_mixin.h index 0c4bcff..f1bd1f43 100644 --- a/chrome/browser/ash/login/test/embedded_policy_test_server_mixin.h +++ b/chrome/browser/ash/login/test/embedded_policy_test_server_mixin.h
@@ -5,10 +5,12 @@ #ifndef CHROME_BROWSER_ASH_LOGIN_TEST_EMBEDDED_POLICY_TEST_SERVER_MIXIN_H_ #define CHROME_BROWSER_ASH_LOGIN_TEST_EMBEDDED_POLICY_TEST_SERVER_MIXIN_H_ +#include <initializer_list> #include <memory> #include <string> #include "base/command_line.h" +#include "base/containers/flat_set.h" #include "chrome/browser/ash/policy/server_backed_state/server_backed_state_keys_broker.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "chromeos/system/fake_statistics_provider.h" @@ -28,7 +30,18 @@ // Server is started after SetUp execution. class EmbeddedPolicyTestServerMixin : public InProcessBrowserTestMixin { public: - explicit EmbeddedPolicyTestServerMixin(InProcessBrowserTestMixinHost* host); + enum Capabilities { + // Enables the usage of keys canned into the policy test server, instead of + // the default key returned by PolicyBuilder::CreateTestSigningKey(). + ENABLE_CANNED_SIGNING_KEYS, + // Enables the automatic rotation of the policy signing keys with each + // policy fetch request. + ENABLE_AUTOMATIC_ROTATION_OF_SIGNINGKEYS + }; + + explicit EmbeddedPolicyTestServerMixin( + InProcessBrowserTestMixinHost* host, + std::initializer_list<Capabilities> capabilities = {}); EmbeddedPolicyTestServerMixin(const EmbeddedPolicyTestServerMixin&) = delete; EmbeddedPolicyTestServerMixin& operator=( @@ -44,16 +57,29 @@ void SetUp() override; void SetUpCommandLine(base::CommandLine* command_line) override; - // Updates the device policy blob served by the local policy test server. + // Updates the device policy blob served by the embedded policy test server. + // This does not trigger policy invalidation, hence test authors must manually + // trigger a policy fetch. void UpdateDevicePolicy( const enterprise_management::ChromeDeviceSettingsProto& policy); // Updates user policy blob served by the embedded policy test server. - // `policy_user` - the policy user's email. + // `policy_user` - the policy user's email. This does not trigger policy + // invalidation, hence test authors must manually trigger a policy fetch. void UpdateUserPolicy( const enterprise_management::CloudPolicySettings& policy, const std::string& policy_user); + // Updates policy selected by |type| and optional |entity_id|. The policy is + // set to the proto serialized in |serialized_policy|. This does not trigger + // policy invalidation, hence test authors must manually trigger a policy + // fetch. + void UpdatePolicy(const std::string& type, + const std::string& serialized_policy); + void UpdatePolicy(const std::string& type, + const std::string& entity_id, + const std::string& serialized_policy); + // Configures whether the server should indicate that the client is // allowed to update device attributes in response to // DeviceAttributeUpdatePermissionRequest. @@ -109,6 +135,7 @@ private: std::unique_ptr<policy::EmbeddedPolicyTestServer> policy_test_server_; + base::flat_set<Capabilities> capabilities_; }; } // namespace ash
diff --git a/chrome/browser/ash/net/bluetooth_pref_state_observer.cc b/chrome/browser/ash/net/bluetooth_pref_state_observer.cc index 2ba12650..f39c681 100644 --- a/chrome/browser/ash/net/bluetooth_pref_state_observer.cc +++ b/chrome/browser/ash/net/bluetooth_pref_state_observer.cc
@@ -10,10 +10,10 @@ #include "chrome/browser/profiles/profile.h" #include "chromeos/services/bluetooth_config/in_process_instance.h" -namespace chromeos { +namespace ash { BluetoothPrefStateObserver::BluetoothPrefStateObserver() { - CHECK(ash::features::IsBluetoothRevampEnabled()); + CHECK(features::IsBluetoothRevampEnabled()); // Set CrosBluetoothConfig with device prefs only. SetPrefs(/*profile=*/nullptr); @@ -48,4 +48,4 @@ g_browser_process->local_state()); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/bluetooth_pref_state_observer.h b/chrome/browser/ash/net/bluetooth_pref_state_observer.h index 93a3b5f..9c656fe 100644 --- a/chrome/browser/ash/net/bluetooth_pref_state_observer.h +++ b/chrome/browser/ash/net/bluetooth_pref_state_observer.h
@@ -11,7 +11,7 @@ class Profile; -namespace chromeos { +namespace ash { // Class to update CrosBluetoothConfig when the PrefService state changes. The // implementation currently relies on g_browser_process since it holds the @@ -38,11 +38,6 @@ session_observation_{this}; }; -} // namespace chromeos - -// TODO(https://crbug.com/1164001): remove after the migration is finished. -namespace ash { -using ::chromeos::BluetoothPrefStateObserver; -} +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_BLUETOOTH_PREF_STATE_OBSERVER_H_
diff --git a/chrome/browser/ash/net/client_cert_filter.cc b/chrome/browser/ash/net/client_cert_filter.cc index 0a46926..2e73495e 100644 --- a/chrome/browser/ash/net/client_cert_filter.cc +++ b/chrome/browser/ash/net/client_cert_filter.cc
@@ -12,7 +12,7 @@ #include "crypto/scoped_nss_types.h" #include "net/cert/nss_profile_filter_chromeos.h" -namespace chromeos { +namespace ash { class ClientCertFilter::CertFilterIO { public: @@ -145,4 +145,4 @@ std::move(callback).Run(); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/client_cert_filter.h b/chrome/browser/ash/net/client_cert_filter.h index 824f26fc..732a17bb 100644 --- a/chrome/browser/ash/net/client_cert_filter.h +++ b/chrome/browser/ash/net/client_cert_filter.h
@@ -14,7 +14,7 @@ typedef struct CERTCertificateStr CERTCertificate; -namespace chromeos { +namespace ash { // A client certificate filter that filters by applying a // NSSProfileFilterChromeOS. @@ -52,6 +52,6 @@ base::WeakPtrFactory<ClientCertFilter> weak_ptr_factory_{this}; }; -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_CLIENT_CERT_FILTER_H_
diff --git a/chrome/browser/ash/net/client_cert_store_ash.cc b/chrome/browser/ash/net/client_cert_store_ash.cc index 2c4792b..e87e04b 100644 --- a/chrome/browser/ash/net/client_cert_store_ash.cc +++ b/chrome/browser/ash/net/client_cert_store_ash.cc
@@ -22,7 +22,7 @@ #include "net/ssl/ssl_cert_request_info.h" #include "net/ssl/ssl_private_key.h" -namespace chromeos { +namespace ash { ClientCertStoreAsh::ClientCertStoreAsh( std::unique_ptr<CertificateProvider> cert_provider, @@ -105,4 +105,4 @@ return client_certs; } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/client_cert_store_ash.h b/chrome/browser/ash/net/client_cert_store_ash.h index 178d5ac6..9a2e304c 100644 --- a/chrome/browser/ash/net/client_cert_store_ash.h +++ b/chrome/browser/ash/net/client_cert_store_ash.h
@@ -10,12 +10,12 @@ #include <vector> #include "base/memory/ref_counted.h" -// TODO(https://crbug.com/1164001): forward declare when moved to ash. -#include "chrome/browser/ash/certificate_provider/certificate_provider.h" #include "chrome/browser/ash/net/client_cert_filter.h" #include "net/ssl/client_cert_store_nss.h" -namespace chromeos { +namespace ash { + +class CertificateProvider; class ClientCertStoreAsh : public net::ClientCertStore { public: @@ -60,6 +60,11 @@ PasswordDelegateFactory password_delegate_factory_; }; -} // namespace chromeos +} // namespace ash + +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace chromeos { +using ::ash::ClientCertStoreAsh; +} #endif // CHROME_BROWSER_ASH_NET_CLIENT_CERT_STORE_ASH_H_
diff --git a/chrome/browser/ash/net/client_cert_store_ash_unittest.cc b/chrome/browser/ash/net/client_cert_store_ash_unittest.cc index 7529390..f6b08875 100644 --- a/chrome/browser/ash/net/client_cert_store_ash_unittest.cc +++ b/chrome/browser/ash/net/client_cert_store_ash_unittest.cc
@@ -31,7 +31,7 @@ #include "net/test/test_data_directory.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { +namespace ash { namespace { @@ -258,4 +258,4 @@ cert_1->EqualsExcludingChain(selected_identities[0]->certificate())); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/delay_network_call.cc b/chrome/browser/ash/net/delay_network_call.cc index bdd158c..ac451d2 100644 --- a/chrome/browser/ash/net/delay_network_call.cc +++ b/chrome/browser/ash/net/delay_network_call.cc
@@ -16,7 +16,7 @@ #include "content/public/browser/browser_thread.h" #include "third_party/cros_system_api/dbus/service_constants.h" -namespace chromeos { +namespace ash { const unsigned kDefaultNetworkRetryDelayMS = 3000; @@ -55,4 +55,4 @@ } } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/delay_network_call.h b/chrome/browser/ash/net/delay_network_call.h index 373fc5b5..b244d12b 100644 --- a/chrome/browser/ash/net/delay_network_call.h +++ b/chrome/browser/ash/net/delay_network_call.h
@@ -10,12 +10,10 @@ #include "base/callback_forward.h" namespace base { - class TimeDelta; +} -} // namespace base - -namespace chromeos { +namespace ash { // Default delay to be used as an argument to DelayNetworkCall(). extern const unsigned kDefaultNetworkRetryDelayMS; @@ -23,12 +21,6 @@ // Delay callback until the network is connected or while on a captive portal. void DelayNetworkCall(base::TimeDelta retry, base::OnceClosure callback); -} // namespace chromeos - -// TODO(https://crbug.com/1164001): remove when moved to chrome/browser/ash/. -namespace ash { -using chromeos::DelayNetworkCall; -using chromeos::kDefaultNetworkRetryDelayMS; } // namespace ash #endif // CHROME_BROWSER_ASH_NET_DELAY_NETWORK_CALL_H_
diff --git a/chrome/browser/ash/net/device_event_log_error_browsertest.cc b/chrome/browser/ash/net/device_event_log_error_browsertest.cc index 624fff27..2c07be8 100644 --- a/chrome/browser/ash/net/device_event_log_error_browsertest.cc +++ b/chrome/browser/ash/net/device_event_log_error_browsertest.cc
@@ -14,7 +14,7 @@ // Browser test using device_event_log to ensure that no device related error // events are generated during startup and after login. -namespace chromeos { +namespace ash { class DeviceEventLogErrorBrowserTest : public LoginManagerTest { public: @@ -46,4 +46,4 @@ EXPECT_EQ(GetErrors(), 0); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/dhcp_wpad_url_client.cc b/chrome/browser/ash/net/dhcp_wpad_url_client.cc index 9ab82a61..eab09b89 100644 --- a/chrome/browser/ash/net/dhcp_wpad_url_client.cc +++ b/chrome/browser/ash/net/dhcp_wpad_url_client.cc
@@ -10,11 +10,13 @@ #include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" -namespace { -GURL* g_pac_url_for_testing = nullptr; -} +namespace ash { -namespace chromeos { +namespace { + +GURL* g_pac_url_for_testing = nullptr; + +} void DhcpWpadUrlClient::GetPacUrl(GetPacUrlCallback callback) { if (g_pac_url_for_testing) { @@ -57,4 +59,4 @@ g_pac_url_for_testing = new GURL(url); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/dhcp_wpad_url_client.h b/chrome/browser/ash/net/dhcp_wpad_url_client.h index a989e971..451e3db3 100644 --- a/chrome/browser/ash/net/dhcp_wpad_url_client.h +++ b/chrome/browser/ash/net/dhcp_wpad_url_client.h
@@ -10,7 +10,7 @@ #include "services/network/public/mojom/dhcp_wpad_url_client.mojom.h" #include "url/gurl.h" -namespace chromeos { +namespace ash { // A mojom::DhcpWpadUrlClient implementation that gets the PAC // script URL from the DefaultNetwork, which mirrors the state from Shill @@ -43,6 +43,6 @@ static void ClearPacUrlForTesting(); }; -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_DHCP_WPAD_URL_CLIENT_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/arc_dns_resolution_routine.cc b/chrome/browser/ash/net/network_diagnostics/arc_dns_resolution_routine.cc index 61f79af..605508ec 100644 --- a/chrome/browser/ash/net/network_diagnostics/arc_dns_resolution_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/arc_dns_resolution_routine.cc
@@ -11,11 +11,14 @@ #include "chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.h" #include "net/dns/public/dns_protocol.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + // These hostnames were chosen because they need to be resolved for a // successful ARC provisioning step. constexpr char kHostname1[] = "www.googleapis.com"; @@ -126,4 +129,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/arc_dns_resolution_routine.h b/chrome/browser/ash/net/network_diagnostics/arc_dns_resolution_routine.h index 66b65e9..4e978f1 100644 --- a/chrome/browser/ash/net/network_diagnostics/arc_dns_resolution_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/arc_dns_resolution_routine.h
@@ -13,15 +13,15 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Performs DNS queries from within ARC to resolve a hardcoded set of hostnames // and returns the result. class ArcDnsResolutionRoutine : public NetworkDiagnosticsRoutine { public: - using RunArcDnsResolutionCallback = - mojom::NetworkDiagnosticsRoutines::RunArcDnsResolutionCallback; + using RunArcDnsResolutionCallback = chromeos::network_diagnostics::mojom:: + NetworkDiagnosticsRoutines::RunArcDnsResolutionCallback; ArcDnsResolutionRoutine(); ArcDnsResolutionRoutine(const ArcDnsResolutionRoutine&) = delete; @@ -29,7 +29,7 @@ ~ArcDnsResolutionRoutine() override; // NetworkDiagnosticsRoutine: - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -49,7 +49,8 @@ void OnQueryComplete(arc::mojom::ArcDnsResolutionTestResultPtr result); std::vector<std::string> hostnames_to_resolve_dns_; - std::vector<mojom::ArcDnsResolutionProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::ArcDnsResolutionProblem> + problems_; bool successfully_resolved_hostnames_ = true; bool failed_to_get_arc_service_manager_ = false; bool failed_to_get_net_instance_service_for_dns_resolution_test_ = false; @@ -59,6 +60,6 @@ }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_ARC_DNS_RESOLUTION_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/arc_dns_resolution_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/arc_dns_resolution_routine_unittest.cc index 63a7060c..2a7099b 100644 --- a/chrome/browser/ash/net/network_diagnostics/arc_dns_resolution_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/arc_dns_resolution_routine_unittest.cc
@@ -11,11 +11,14 @@ #include "net/dns/public/dns_protocol.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + const int kNoProblemDelayMs = 100; const int kHighLatencyDelayMs = 450; const int kVeryHighLatencyDelayMs = 550; @@ -127,4 +130,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/arc_http_routine.cc b/chrome/browser/ash/net/network_diagnostics/arc_http_routine.cc index 5db5b9c..a161d19a 100644 --- a/chrome/browser/ash/net/network_diagnostics/arc_http_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/arc_http_routine.cc
@@ -12,11 +12,14 @@ #include "net/http/http_status_code.h" #include "url/gurl.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + constexpr int kTotalHostsToQuery = 3; // The length of a random eight letter prefix. constexpr int kHostPrefixLength = 8; @@ -132,4 +135,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/arc_http_routine.h b/chrome/browser/ash/net/network_diagnostics/arc_http_routine.h index 7639808f..51ee218 100644 --- a/chrome/browser/ash/net/network_diagnostics/arc_http_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/arc_http_routine.h
@@ -12,15 +12,15 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Performs HTTP GET requests from within ARC to a random set of URLs // and returns the result. class ArcHttpRoutine : public NetworkDiagnosticsRoutine { public: - using RunArcHttpCallback = - mojom::NetworkDiagnosticsRoutines::RunArcHttpCallback; + using RunArcHttpCallback = chromeos::network_diagnostics::mojom:: + NetworkDiagnosticsRoutines::RunArcHttpCallback; ArcHttpRoutine(); ArcHttpRoutine(const ArcHttpRoutine&) = delete; @@ -28,7 +28,7 @@ ~ArcHttpRoutine() override; // NetworkDiagnosticsRoutine: - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -48,7 +48,7 @@ void OnRequestComplete(arc::mojom::ArcHttpTestResultPtr result); std::vector<std::string> hostnames_to_request_http_; - std::vector<mojom::ArcHttpProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::ArcHttpProblem> problems_; bool successfully_requested_targets_ = true; bool failed_to_get_arc_service_manager_ = false; bool failed_to_get_net_instance_service_for_http_test_ = false; @@ -58,6 +58,6 @@ }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_ARC_HTTP_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/arc_http_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/arc_http_routine_unittest.cc index 8b81a80..18da36d 100644 --- a/chrome/browser/ash/net/network_diagnostics/arc_http_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/arc_http_routine_unittest.cc
@@ -11,11 +11,14 @@ #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + const int kNoProblemDelayMs = 100; const int kHighLatencyDelayMs = 550; const int kVeryHighLatencyDelayMs = 1050; @@ -123,4 +126,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/arc_ping_routine.cc b/chrome/browser/ash/net/network_diagnostics/arc_ping_routine.cc index a8887622..18728ec 100644 --- a/chrome/browser/ash/net/network_diagnostics/arc_ping_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/arc_ping_routine.cc
@@ -13,11 +13,15 @@ #include "chromeos/services/network_config/in_process_instance.h" #include "chromeos/services/network_config/public/cpp/cros_network_config_util.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; +namespace network_config = ::chromeos::network_config; + using chromeos::network_config::mojom::CrosNetworkConfig; using chromeos::network_config::mojom::FilterType; using chromeos::network_config::mojom::NetworkFilter; @@ -260,4 +264,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/arc_ping_routine.h b/chrome/browser/ash/net/network_diagnostics/arc_ping_routine.h index fc99452..1a67aeda 100644 --- a/chrome/browser/ash/net/network_diagnostics/arc_ping_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/arc_ping_routine.h
@@ -15,7 +15,7 @@ #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "mojo/public/cpp/bindings/remote.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { @@ -28,8 +28,8 @@ // and returns the result. class ArcPingRoutine : public NetworkDiagnosticsRoutine { public: - using RunArcHttpCallback = - mojom::NetworkDiagnosticsRoutines::RunArcPingCallback; + using RunArcHttpCallback = chromeos::network_diagnostics::mojom:: + NetworkDiagnosticsRoutines::RunArcPingCallback; ArcPingRoutine(); ArcPingRoutine(const ArcPingRoutine&) = delete; @@ -37,7 +37,7 @@ ~ArcPingRoutine() override; // NetworkDiagnosticsRoutine: - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -85,7 +85,7 @@ mojo::Remote<chromeos::network_config::mojom::CrosNetworkConfig> remote_cros_network_config_; - std::vector<mojom::ArcPingProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::ArcPingProblem> problems_; std::vector<std::string> gateways_; std::vector<std::string> gateways_transport_names_; bool get_managed_properties_timeout_failure_ = false; @@ -105,6 +105,6 @@ }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_ARC_PING_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/arc_ping_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/arc_ping_routine_unittest.cc index f92eae9c8..a0f32064 100644 --- a/chrome/browser/ash/net/network_diagnostics/arc_ping_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/arc_ping_routine_unittest.cc
@@ -24,11 +24,14 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + const int kNoProblemDelayMs = 1000; const int kHighLatencyDelayMs = 1600; @@ -219,4 +222,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/captive_portal_routine.cc b/chrome/browser/ash/net/network_diagnostics/captive_portal_routine.cc index 977d3fd..7f042d0 100644 --- a/chrome/browser/ash/net/network_diagnostics/captive_portal_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/captive_portal_routine.cc
@@ -10,11 +10,15 @@ #include "chromeos/services/network_config/in_process_instance.h" #include "chromeos/services/network_config/public/cpp/cros_network_config_util.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; +namespace network_config = ::chromeos::network_config; + mojom::CaptivePortalProblem GetProblemFromPortalState( network_config::mojom::PortalState portal_state) { switch (portal_state) { @@ -110,4 +114,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/captive_portal_routine.h b/chrome/browser/ash/net/network_diagnostics/captive_portal_routine.h index 6f45d4ef..8e27bbb7 100644 --- a/chrome/browser/ash/net/network_diagnostics/captive_portal_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/captive_portal_routine.h
@@ -12,7 +12,7 @@ #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "mojo/public/cpp/bindings/remote.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Tests whether the internet connection is trapped behind a captive portal. @@ -24,7 +24,7 @@ ~CaptivePortalRoutine() override; // NetworkDiagnosticsRoutine: - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -35,17 +35,18 @@ std::vector<chromeos::network_config::mojom::NetworkStatePropertiesPtr> networks); void OnManagedPropertiesReceived( - network_config::mojom::ManagedPropertiesPtr managed_properties); + chromeos::network_config::mojom::ManagedPropertiesPtr managed_properties); bool no_active_networks_ = false; chromeos::network_config::mojom::PortalState portal_state_ = chromeos::network_config::mojom::PortalState::kUnknown; mojo::Remote<chromeos::network_config::mojom::CrosNetworkConfig> remote_cros_network_config_; - std::vector<mojom::CaptivePortalProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::CaptivePortalProblem> + problems_; }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_CAPTIVE_PORTAL_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/captive_portal_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/captive_portal_routine_unittest.cc index 6d306b20..fa1d920 100644 --- a/chrome/browser/ash/net/network_diagnostics/captive_portal_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/captive_portal_routine_unittest.cc
@@ -24,9 +24,12 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + class CaptivePortalRoutineTest : public ::testing::Test { public: CaptivePortalRoutineTest() { @@ -216,4 +219,4 @@ // TODO(khegde): Add a test for unknown captive portal state. } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/dns_latency_routine.cc b/chrome/browser/ash/net/network_diagnostics/dns_latency_routine.cc index 1659db7..e7cc9dd7 100644 --- a/chrome/browser/ash/net/network_diagnostics/dns_latency_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/dns_latency_routine.cc
@@ -27,10 +27,13 @@ class TimeTicks; } -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + constexpr int kHttpPort = 80; constexpr int kTotalHostsToQuery = 3; // The length of a random eight letter prefix obtained by the characters from @@ -184,4 +187,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/dns_latency_routine.h b/chrome/browser/ash/net/network_diagnostics/dns_latency_routine.h index 7222eaef6..2c9f9264 100644 --- a/chrome/browser/ash/net/network_diagnostics/dns_latency_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/dns_latency_routine.h
@@ -22,7 +22,7 @@ class TickClock; } -namespace chromeos { +namespace ash { namespace network_diagnostics { // Tests whether the DNS latency is below an acceptable threshold. @@ -35,7 +35,7 @@ ~DnsLatencyRoutine() override; // NetworkDiagnosticsRoutine: - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -77,12 +77,13 @@ std::vector<std::string> hostnames_to_query_; std::vector<base::TimeDelta> latencies_; net::AddressList resolved_addresses_; - std::vector<mojom::DnsLatencyProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::DnsLatencyProblem> + problems_; mojo::Remote<network::mojom::HostResolver> host_resolver_; mojo::Receiver<network::mojom::ResolveHostClient> receiver_{this}; }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_DNS_LATENCY_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/dns_latency_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/dns_latency_routine_unittest.cc index f49eaa90..bf03a41 100644 --- a/chrome/browser/ash/net/network_diagnostics/dns_latency_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/dns_latency_routine_unittest.cc
@@ -15,11 +15,14 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + const int kFakePortNumber = 1234; const char kFakeTestProfile[] = "test"; const base::TimeDelta kSuccessfulDnsResolutionDelayMs = base::Milliseconds(100); @@ -258,4 +261,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/dns_resolution_routine.cc b/chrome/browser/ash/net/network_diagnostics/dns_resolution_routine.cc index 17b7fe7..5f91eaa 100644 --- a/chrome/browser/ash/net/network_diagnostics/dns_resolution_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/dns_resolution_routine.cc
@@ -19,10 +19,13 @@ #include "services/network/public/mojom/network_context.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + constexpr char kHostname[] = "ccd-testing-v4.gstatic.com"; constexpr int kHttpPort = 80; // For an explanation of error codes, see "net/base/net_error_list.h". @@ -133,4 +136,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/dns_resolution_routine.h b/chrome/browser/ash/net/network_diagnostics/dns_resolution_routine.h index d05e3b2..54b82b0 100644 --- a/chrome/browser/ash/net/network_diagnostics/dns_resolution_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/dns_resolution_routine.h
@@ -23,7 +23,7 @@ } } // namespace network -namespace chromeos { +namespace ash { namespace network_diagnostics { // Tests whether a DNS resolution can be completed successfully. @@ -36,7 +36,7 @@ ~DnsResolutionRoutine() override; // NetworkDiagnosticsRoutine: - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -68,12 +68,13 @@ int num_retries_ = kTotalNumRetries; bool resolved_address_received_ = false; net::AddressList resolved_addresses_; - std::vector<mojom::DnsResolutionProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::DnsResolutionProblem> + problems_; mojo::Receiver<network::mojom::ResolveHostClient> receiver_{this}; mojo::Remote<network::mojom::HostResolver> host_resolver_; }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_DNS_RESOLUTION_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/dns_resolution_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/dns_resolution_routine_unittest.cc index 900e9c8..9996aab 100644 --- a/chrome/browser/ash/net/network_diagnostics/dns_resolution_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/dns_resolution_routine_unittest.cc
@@ -16,11 +16,14 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + const int kFakePortNumber = 1234; const char kFakeTestProfile[] = "test"; @@ -223,4 +226,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/dns_resolver_present_routine.cc b/chrome/browser/ash/net/network_diagnostics/dns_resolver_present_routine.cc index 08a139e..17e6c4cb 100644 --- a/chrome/browser/ash/net/network_diagnostics/dns_resolver_present_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/dns_resolver_present_routine.cc
@@ -17,10 +17,14 @@ #include "net/base/ip_address.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; +namespace network_config = ::chromeos::network_config; + // Filters the list of |name_servers| and returns those that are not // empty/default values. std::vector<std::string> GetNonEmptyNameServers( @@ -171,4 +175,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/dns_resolver_present_routine.h b/chrome/browser/ash/net/network_diagnostics/dns_resolver_present_routine.h index 60a2665e..fe5d19a 100644 --- a/chrome/browser/ash/net/network_diagnostics/dns_resolver_present_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/dns_resolver_present_routine.h
@@ -12,7 +12,7 @@ #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "mojo/public/cpp/bindings/remote.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Tests whether the current network is set up correctly for performing DNS @@ -27,7 +27,7 @@ // NetworkDiagnosticsRoutine: bool CanRun() override; - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -43,12 +43,13 @@ bool connected_network_ = false; bool name_servers_are_found_ = false; bool name_servers_are_valid_ = false; - std::vector<mojom::DnsResolverPresentProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::DnsResolverPresentProblem> + problems_; mojo::Remote<chromeos::network_config::mojom::CrosNetworkConfig> remote_cros_network_config_; }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_DNS_RESOLVER_PRESENT_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/dns_resolver_present_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/dns_resolver_present_routine_unittest.cc index 604b23b..7be8178 100644 --- a/chrome/browser/ash/net/network_diagnostics/dns_resolver_present_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/dns_resolver_present_routine_unittest.cc
@@ -28,11 +28,14 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + // The IP config path specified here must match the IP config path specified in // NetworkStateTestHelper::ResetDevicesAndServices(), which itself is based on // the IP config path used to set up IP configs in @@ -290,4 +293,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/fake_host_resolver.cc b/chrome/browser/ash/net/network_diagnostics/fake_host_resolver.cc index defadc7..915b975b 100644 --- a/chrome/browser/ash/net/network_diagnostics/fake_host_resolver.cc +++ b/chrome/browser/ash/net/network_diagnostics/fake_host_resolver.cc
@@ -14,7 +14,7 @@ #include "net/dns/public/resolve_error_info.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { FakeHostResolver::DnsResult::DnsResult( @@ -68,4 +68,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/fake_host_resolver.h b/chrome/browser/ash/net/network_diagnostics/fake_host_resolver.h index 0d75f34..35144c9 100644 --- a/chrome/browser/ash/net/network_diagnostics/fake_host_resolver.h +++ b/chrome/browser/ash/net/network_diagnostics/fake_host_resolver.h
@@ -16,7 +16,7 @@ #include "services/network/public/mojom/host_resolver.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Used in unit tests, the FakeHostResolver class simulates the behavior of a @@ -73,6 +73,6 @@ }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_FAKE_HOST_RESOLVER_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/fake_network_context.cc b/chrome/browser/ash/net/network_diagnostics/fake_network_context.cc index a9984e1..e698651 100644 --- a/chrome/browser/ash/net/network_diagnostics/fake_network_context.cc +++ b/chrome/browser/ash/net/network_diagnostics/fake_network_context.cc
@@ -8,7 +8,7 @@ #include "base/logging.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { @@ -151,4 +151,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/fake_network_context.h b/chrome/browser/ash/net/network_diagnostics/fake_network_context.h index 0bbfc08..58b9265 100644 --- a/chrome/browser/ash/net/network_diagnostics/fake_network_context.h +++ b/chrome/browser/ash/net/network_diagnostics/fake_network_context.h
@@ -16,7 +16,7 @@ #include "services/network/test/test_network_context.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Used in unit tests, the FakeNetworkContext class simulates the behavior of a @@ -146,6 +146,6 @@ }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_FAKE_NETWORK_CONTEXT_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/fake_tcp_connected_socket.cc b/chrome/browser/ash/net/network_diagnostics/fake_tcp_connected_socket.cc index 7fde5ab..49138dd 100644 --- a/chrome/browser/ash/net/network_diagnostics/fake_tcp_connected_socket.cc +++ b/chrome/browser/ash/net/network_diagnostics/fake_tcp_connected_socket.cc
@@ -12,7 +12,7 @@ #include "services/network/public/mojom/tls_socket.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { FakeTCPConnectedSocket::FakeTCPConnectedSocket() = default; @@ -65,4 +65,4 @@ receiver_.Bind(std::move(socket)); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/fake_tcp_connected_socket.h b/chrome/browser/ash/net/network_diagnostics/fake_tcp_connected_socket.h index ed5576bc..a2ba785f 100644 --- a/chrome/browser/ash/net/network_diagnostics/fake_tcp_connected_socket.h +++ b/chrome/browser/ash/net/network_diagnostics/fake_tcp_connected_socket.h
@@ -10,7 +10,7 @@ #include "net/base/net_errors.h" #include "services/network/public/mojom/tcp_socket.mojom.h" -namespace chromeos { +namespace ash { class FakeTCPConnectedSocket : public network::mojom::TCPConnectedSocket { public: @@ -55,6 +55,6 @@ bool disconnect_ = false; }; -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_FAKE_TCP_CONNECTED_SOCKET_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/fake_udp_socket.cc b/chrome/browser/ash/net/network_diagnostics/fake_udp_socket.cc index 2f23986..1450f3e 100644 --- a/chrome/browser/ash/net/network_diagnostics/fake_udp_socket.cc +++ b/chrome/browser/ash/net/network_diagnostics/fake_udp_socket.cc
@@ -9,7 +9,7 @@ #include "net/base/ip_endpoint.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace {} // namespace @@ -122,4 +122,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/fake_udp_socket.h b/chrome/browser/ash/net/network_diagnostics/fake_udp_socket.h index 0bee9fb..ad01ee8 100644 --- a/chrome/browser/ash/net/network_diagnostics/fake_udp_socket.h +++ b/chrome/browser/ash/net/network_diagnostics/fake_udp_socket.h
@@ -14,7 +14,7 @@ #include "net/base/net_errors.h" #include "services/network/public/mojom/udp_socket.mojom.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Provides some UDP socket functionality in tests. Most methods, unless @@ -128,6 +128,6 @@ }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_FAKE_UDP_SOCKET_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/gateway_can_be_pinged_routine.cc b/chrome/browser/ash/net/network_diagnostics/gateway_can_be_pinged_routine.cc index e95fce1..0c61b7e9 100644 --- a/chrome/browser/ash/net/network_diagnostics/gateway_can_be_pinged_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/gateway_can_be_pinged_routine.cc
@@ -17,10 +17,14 @@ #include "net/base/net_errors.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; +namespace network_config = ::chromeos::network_config; + using chromeos::network_config::mojom::CrosNetworkConfig; using chromeos::network_config::mojom::FilterType; using chromeos::network_config::mojom::ManagedPropertiesPtr; @@ -246,4 +250,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/gateway_can_be_pinged_routine.h b/chrome/browser/ash/net/network_diagnostics/gateway_can_be_pinged_routine.h index 587a51b..30e4124a 100644 --- a/chrome/browser/ash/net/network_diagnostics/gateway_can_be_pinged_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/gateway_can_be_pinged_routine.h
@@ -15,7 +15,7 @@ #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "mojo/public/cpp/bindings/remote.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Tests whether a device can ping all the gateways it is connected to. @@ -30,7 +30,7 @@ // NetworkDiagnosticsRoutine: bool CanRun() override; - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -60,7 +60,8 @@ mojo::Remote<chromeos::network_config::mojom::CrosNetworkConfig> remote_cros_network_config_; - std::vector<mojom::GatewayCanBePingedProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::GatewayCanBePingedProblem> + problems_; // An unowned pointer to the DebugDaemonClient instance. chromeos::DebugDaemonClient* debug_daemon_client_; std::vector<std::string> gateways_; @@ -79,6 +80,6 @@ }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_GATEWAY_CAN_BE_PINGED_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/gateway_can_be_pinged_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/gateway_can_be_pinged_routine_unittest.cc index 36d80fd..1cef52a3 100644 --- a/chrome/browser/ash/net/network_diagnostics/gateway_can_be_pinged_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/gateway_can_be_pinged_routine_unittest.cc
@@ -27,11 +27,14 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + // Fake ICMP output. For more details, see: // https://gerrit.chromium.org/gerrit/#/c/30310/2/src/helpers/icmp.cc. const char kFakeValidICMPOutput[] = R"( @@ -311,4 +314,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine.cc b/chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine.cc index 3de8933..b47a138317 100644 --- a/chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine.cc
@@ -15,10 +15,14 @@ #include "mojo/public/cpp/bindings/remote.h" #include "net/base/net_errors.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; +namespace network_config = ::chromeos::network_config; + using chromeos::network_config::mojom::CrosNetworkConfig; using chromeos::network_config::mojom::FilterType; using chromeos::network_config::mojom::NetworkFilter; @@ -130,4 +134,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine.h b/chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine.h index d854db6b..a1206a0 100644 --- a/chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine.h
@@ -12,7 +12,7 @@ #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "mojo/public/cpp/bindings/remote.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Tests whether the WiFi connection uses a secure encryption method. @@ -27,7 +27,7 @@ // NetworkDiagnosticsRoutine: bool CanRun() override; - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -42,10 +42,12 @@ bool wifi_connected_ = false; chromeos::network_config::mojom::SecurityType wifi_security_ = chromeos::network_config::mojom::SecurityType::kNone; - std::vector<mojom::HasSecureWiFiConnectionProblem> problems_; + std::vector< + chromeos::network_diagnostics::mojom::HasSecureWiFiConnectionProblem> + problems_; }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_HAS_SECURE_WIFI_CONNECTION_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine_unittest.cc index 3594b6f..92b57707 100644 --- a/chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/has_secure_wifi_connection_routine_unittest.cc
@@ -9,11 +9,14 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + const char* kInsecureSecurity = shill::kSecurityWep; const char* kSecureSecurity = shill::kSecurityPsk; @@ -113,4 +116,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/host_resolver.cc b/chrome/browser/ash/net/network_diagnostics/host_resolver.cc index 3817b75..e17170a 100644 --- a/chrome/browser/ash/net/network_diagnostics/host_resolver.cc +++ b/chrome/browser/ash/net/network_diagnostics/host_resolver.cc
@@ -12,7 +12,7 @@ #include "net/dns/public/dns_config_overrides.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { HostResolver::ResolutionResult::ResolutionResult( @@ -70,4 +70,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/host_resolver.h b/chrome/browser/ash/net/network_diagnostics/host_resolver.h index 0f13257..95064d65 100644 --- a/chrome/browser/ash/net/network_diagnostics/host_resolver.h +++ b/chrome/browser/ash/net/network_diagnostics/host_resolver.h
@@ -14,7 +14,7 @@ #include "services/network/public/mojom/network_context.mojom.h" #include "url/gurl.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Performs a DNS host resolution. This is a single-use class. @@ -62,6 +62,6 @@ }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_HOST_RESOLVER_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/host_resolver_unittest.cc b/chrome/browser/ash/net/network_diagnostics/host_resolver_unittest.cc index aaf978d..d23d5a2 100644 --- a/chrome/browser/ash/net/network_diagnostics/host_resolver_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/host_resolver_unittest.cc
@@ -19,7 +19,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { class HostResolverTest : public ::testing::Test { @@ -138,4 +138,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/http_firewall_routine.cc b/chrome/browser/ash/net/network_diagnostics/http_firewall_routine.cc index 795c3a1..6386becf5 100644 --- a/chrome/browser/ash/net/network_diagnostics/http_firewall_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/http_firewall_routine.cc
@@ -15,10 +15,13 @@ #include "content/public/browser/storage_partition.h" #include "services/network/public/mojom/network_context.mojom.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + // Http port number. constexpr int kHttpPort = 80; // Http scheme. @@ -163,4 +166,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/http_firewall_routine.h b/chrome/browser/ash/net/network_diagnostics/http_firewall_routine.h index 66dc497..a489f61 100644 --- a/chrome/browser/ash/net/network_diagnostics/http_firewall_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/http_firewall_routine.h
@@ -14,7 +14,7 @@ #include "chrome/browser/ash/net/network_diagnostics/tls_prober.h" #include "net/base/host_port_pair.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Tests whether a firewall is blocking HTTP port 80. @@ -45,7 +45,7 @@ ~HttpFirewallRoutine() override; // NetworkDiagnosticsRoutine: - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -82,12 +82,13 @@ int tls_probe_failures_ = 0; int num_no_dns_failure_tls_probes_attempted_ = 0; std::unique_ptr<TlsProber> tls_prober_; - std::vector<mojom::HttpFirewallProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::HttpFirewallProblem> + problems_; base::WeakPtrFactory<HttpFirewallRoutine> weak_factory_{this}; }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_HTTP_FIREWALL_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/http_firewall_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/http_firewall_routine_unittest.cc index 22ee1d3..1a95835 100644 --- a/chrome/browser/ash/net/network_diagnostics/http_firewall_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/http_firewall_routine_unittest.cc
@@ -16,11 +16,14 @@ #include "net/base/net_errors.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + // The number of hosts the the routine tries to open socket connections to (if // DNS resolution is successful). Value equals the number of random hosts // + fixed hosts queried by HttpFirewallRoutine. @@ -236,4 +239,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/http_request_manager.cc b/chrome/browser/ash/net/network_diagnostics/http_request_manager.cc index 635c674..a1fe956 100644 --- a/chrome/browser/ash/net/network_diagnostics/http_request_manager.cc +++ b/chrome/browser/ash/net/network_diagnostics/http_request_manager.cc
@@ -16,7 +16,7 @@ #include "net/traffic_annotation/network_traffic_annotation.h" #include "services/network/public/cpp/resource_request.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { @@ -97,4 +97,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/http_request_manager.h b/chrome/browser/ash/net/network_diagnostics/http_request_manager.h index a3f8afa2..3a8d0d9 100644 --- a/chrome/browser/ash/net/network_diagnostics/http_request_manager.h +++ b/chrome/browser/ash/net/network_diagnostics/http_request_manager.h
@@ -17,7 +17,7 @@ class Profile; -namespace chromeos { +namespace ash { namespace network_diagnostics { // Makes an HTTP request and determines the results. Used as a utility in @@ -57,6 +57,6 @@ }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_HTTP_REQUEST_MANAGER_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/http_request_manager_unittest.cc b/chrome/browser/ash/net/network_diagnostics/http_request_manager_unittest.cc index 08c69f5a..6c8eb6d 100644 --- a/chrome/browser/ash/net/network_diagnostics/http_request_manager_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/http_request_manager_unittest.cc
@@ -14,7 +14,7 @@ #include "services/network/test/test_url_loader_factory.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { @@ -197,4 +197,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/https_firewall_routine.cc b/chrome/browser/ash/net/network_diagnostics/https_firewall_routine.cc index 3272fa44d..9ea8ad8 100644 --- a/chrome/browser/ash/net/network_diagnostics/https_firewall_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/https_firewall_routine.cc
@@ -15,10 +15,13 @@ #include "content/public/browser/storage_partition.h" #include "services/network/public/mojom/network_context.mojom.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + // Https port number. constexpr int kHttpsPort = 443; // Https scheme. @@ -160,4 +163,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/https_firewall_routine.h b/chrome/browser/ash/net/network_diagnostics/https_firewall_routine.h index f565e2e..badcc86 100644 --- a/chrome/browser/ash/net/network_diagnostics/https_firewall_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/https_firewall_routine.h
@@ -20,7 +20,7 @@ } } // namespace network -namespace chromeos { +namespace ash { namespace network_diagnostics { // Number of retry attempts. @@ -42,7 +42,7 @@ ~HttpsFirewallRoutine() override; // NetworkDiagnosticsRoutine: - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -87,12 +87,13 @@ int num_no_dns_failure_tls_probes_attempted_ = 0; TlsProberGetterCallback tls_prober_getter_callback_; std::unique_ptr<TlsProber> tls_prober_; - std::vector<mojom::HttpsFirewallProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::HttpsFirewallProblem> + problems_; base::WeakPtrFactory<HttpsFirewallRoutine> weak_factory_{this}; }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_HTTPS_FIREWALL_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/https_firewall_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/https_firewall_routine_unittest.cc index 9b708aa..be225149 100644 --- a/chrome/browser/ash/net/network_diagnostics/https_firewall_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/https_firewall_routine_unittest.cc
@@ -16,11 +16,14 @@ #include "net/base/net_errors.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + // The number of hosts the the routine tries to open socket connections to (if // DNS resolution is successful). Value equals the number of random hosts // + fixed hosts queried by HttpsFirewallRoutine. @@ -229,4 +232,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/https_latency_routine.cc b/chrome/browser/ash/net/network_diagnostics/https_latency_routine.cc index 37e6d5f..7a9bde4 100644 --- a/chrome/browser/ash/net/network_diagnostics/https_latency_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/https_latency_routine.cc
@@ -19,10 +19,13 @@ #include "net/base/net_errors.h" #include "services/network/public/mojom/network_context.mojom.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + constexpr int kTotalHostsToQuery = 3; // The length of a random eight letter prefix. constexpr int kHostPrefixLength = 8; @@ -257,4 +260,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/https_latency_routine.h b/chrome/browser/ash/net/network_diagnostics/https_latency_routine.h index 0a4d57c..039c1369 100644 --- a/chrome/browser/ash/net/network_diagnostics/https_latency_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/https_latency_routine.h
@@ -31,7 +31,7 @@ } } // namespace network -namespace chromeos { +namespace ash { namespace network_diagnostics { // Tests whether the HTTPS latency is within established tolerance levels for @@ -50,7 +50,7 @@ ~HttpsLatencyRoutine() override; // NetworkDiagnosticsRoutine: - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -103,11 +103,12 @@ std::vector<base::TimeDelta> latencies_; std::unique_ptr<HostResolver> host_resolver_; std::unique_ptr<HttpRequestManager> http_request_manager_; - std::vector<mojom::HttpsLatencyProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::HttpsLatencyProblem> + problems_; base::WeakPtrFactory<HttpsLatencyRoutine> weak_factory_{this}; }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_HTTPS_LATENCY_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/https_latency_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/https_latency_routine_unittest.cc index 18dcbf0a..39ca1359 100644 --- a/chrome/browser/ash/net/network_diagnostics/https_latency_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/https_latency_routine_unittest.cc
@@ -19,10 +19,13 @@ #include "services/network/test/test_network_context.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + const base::TimeDelta kNoProblemDelayMs = base::Milliseconds(100); const base::TimeDelta kHighLatencyDelayMs = base::Milliseconds(550); const base::TimeDelta kVeryHighLatencyDelayMs = base::Milliseconds(1050); @@ -383,4 +386,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine.cc b/chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine.cc index e940ab8..a7c4e91 100644 --- a/chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine.cc
@@ -13,11 +13,15 @@ #include "mojo/public/cpp/bindings/remote.h" #include "net/base/net_errors.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; +namespace network_config = ::chromeos::network_config; + using chromeos::network_config::mojom::CrosNetworkConfig; using chromeos::network_config::mojom::FilterType; using chromeos::network_config::mojom::NetworkFilter; @@ -87,4 +91,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine.h b/chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine.h index 8a99b8a..e5f756d8 100644 --- a/chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine.h
@@ -12,7 +12,7 @@ #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "mojo/public/cpp/bindings/remote.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Tests whether the device is connected to a LAN. It is possible that the @@ -28,7 +28,7 @@ // NetworkDiagnosticsRoutine: bool CanRun() override; - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -41,10 +41,11 @@ mojo::Remote<chromeos::network_config::mojom::CrosNetworkConfig> remote_cros_network_config_; bool lan_connected_ = false; - std::vector<mojom::LanConnectivityProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::LanConnectivityProblem> + problems_; }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_LAN_CONNECTIVITY_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine_unittest.cc index 663d61f5..74bca70 100644 --- a/chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/lan_connectivity_routine_unittest.cc
@@ -10,9 +10,12 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + class LanConnectivityRoutineTest : public ::testing::Test { public: LanConnectivityRoutineTest() { @@ -100,4 +103,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/network_diagnostics.cc b/chrome/browser/ash/net/network_diagnostics/network_diagnostics.cc index 605364d..5ce59d6e 100644 --- a/chrome/browser/ash/net/network_diagnostics/network_diagnostics.cc +++ b/chrome/browser/ash/net/network_diagnostics/network_diagnostics.cc
@@ -27,9 +27,12 @@ #include "components/device_event_log/device_event_log.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + NetworkDiagnostics::NetworkDiagnostics( chromeos::DebugDaemonClient* debug_daemon_client) { DCHECK(debug_daemon_client); @@ -170,4 +173,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/network_diagnostics.h b/chrome/browser/ash/net/network_diagnostics/network_diagnostics.h index 99587c6..175690c2 100644 --- a/chrome/browser/ash/net/network_diagnostics/network_diagnostics.h +++ b/chrome/browser/ash/net/network_diagnostics/network_diagnostics.h
@@ -17,10 +17,13 @@ namespace chromeos { class DebugDaemonClient; +} +namespace ash { namespace network_diagnostics { -class NetworkDiagnostics : public mojom::NetworkDiagnosticsRoutines { +class NetworkDiagnostics + : public chromeos::network_diagnostics::mojom::NetworkDiagnosticsRoutines { public: explicit NetworkDiagnostics(chromeos::DebugDaemonClient* debug_daemon_client); NetworkDiagnostics(const NetworkDiagnostics&) = delete; @@ -29,10 +32,12 @@ // Binds this instance to |receiver|. void BindReceiver( - mojo::PendingReceiver<mojom::NetworkDiagnosticsRoutines> receiver); + mojo::PendingReceiver< + chromeos::network_diagnostics::mojom::NetworkDiagnosticsRoutines> + receiver); // mojom::NetworkDiagnostics - void GetResult(const mojom::RoutineType type, + void GetResult(const chromeos::network_diagnostics::mojom::RoutineType type, GetResultCallback callback) override; void GetAllResults(GetAllResultsCallback callback) override; void RunLanConnectivity(RunLanConnectivityCallback callback) override; @@ -56,20 +61,25 @@ private: void RunRoutine(std::unique_ptr<NetworkDiagnosticsRoutine> routine, RoutineResultCallback callback); - void HandleResult(std::unique_ptr<NetworkDiagnosticsRoutine> routine, - RoutineResultCallback callback, - mojom::RoutineResultPtr result); + void HandleResult( + std::unique_ptr<NetworkDiagnosticsRoutine> routine, + RoutineResultCallback callback, + chromeos::network_diagnostics::mojom::RoutineResultPtr result); // An unowned pointer to the DebugDaemonClient instance. chromeos::DebugDaemonClient* debug_daemon_client_; // Receivers for external requests (WebUI, Feedback, CrosHealthdClient). - mojo::ReceiverSet<mojom::NetworkDiagnosticsRoutines> receivers_; + mojo::ReceiverSet< + chromeos::network_diagnostics::mojom::NetworkDiagnosticsRoutines> + receivers_; // Holds the results of the routines. - base::flat_map<mojom::RoutineType, mojom::RoutineResultPtr> results_; + base::flat_map<chromeos::network_diagnostics::mojom::RoutineType, + chromeos::network_diagnostics::mojom::RoutineResultPtr> + results_; base::WeakPtrFactory<NetworkDiagnostics> weak_ptr_factory_{this}; }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_NETWORK_DIAGNOSTICS_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine.cc b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine.cc index 255fcb3f..89d906d 100644 --- a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine.cc
@@ -6,11 +6,12 @@ #include "base/time/time.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { NetworkDiagnosticsRoutine::NetworkDiagnosticsRoutine() { - result_.verdict = mojom::RoutineVerdict::kNotRun; + result_.verdict = + chromeos::network_diagnostics::mojom::RoutineVerdict::kNotRun; } NetworkDiagnosticsRoutine::~NetworkDiagnosticsRoutine() = default; @@ -36,4 +37,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine.h b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine.h index 9b5434b..2a457603 100644 --- a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine.h
@@ -9,10 +9,11 @@ #include "base/callback.h" #include "chromeos/services/network_health/public/mojom/network_diagnostics.mojom.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { -using RoutineResultCallback = base::OnceCallback<void(mojom::RoutineResultPtr)>; +using RoutineResultCallback = base::OnceCallback<void( + chromeos::network_diagnostics::mojom::RoutineResultPtr)>; // Defines the key components of a network diagnostics routine. This class is // expected to be implemented by every network diagnostics routine. @@ -25,7 +26,7 @@ virtual ~NetworkDiagnosticsRoutine(); // Returns the type of network diagnostic routine. - virtual mojom::RoutineType Type() = 0; + virtual chromeos::network_diagnostics::mojom::RoutineType Type() = 0; // Determines whether this test is capable of being run. virtual bool CanRun(); @@ -43,23 +44,29 @@ // Runs the routine callback and returns the result. void ExecuteCallback(); - void set_verdict(mojom::RoutineVerdict verdict) { result_.verdict = verdict; } + void set_verdict( + chromeos::network_diagnostics::mojom::RoutineVerdict verdict) { + result_.verdict = verdict; + } - void set_problems(mojom::RoutineProblemsPtr problems) { + void set_problems( + chromeos::network_diagnostics::mojom::RoutineProblemsPtr problems) { result_.problems = std::move(problems); } - void set_result_value(mojom::RoutineResultValuePtr result_value) { + void set_result_value( + chromeos::network_diagnostics::mojom::RoutineResultValuePtr + result_value) { result_.result_value = std::move(result_value); } private: - mojom::RoutineResult result_; + chromeos::network_diagnostics::mojom::RoutineResult result_; RoutineResultCallback callback_; friend class NetworkDiagnosticsRoutineTest; }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_NETWORK_DIAGNOSTICS_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine_unittest.cc index 7114a4f..03444f8 100644 --- a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_routine_unittest.cc
@@ -9,11 +9,14 @@ #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + constexpr mojom::RoutineVerdict kInitialVerdict = mojom::RoutineVerdict::kNotRun; constexpr mojom::RoutineVerdict kVerdict = mojom::RoutineVerdict::kNoProblem; @@ -98,4 +101,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_unittest.cc b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_unittest.cc index 5917bb4..3148de2 100644 --- a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_unittest.cc
@@ -32,11 +32,14 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + // The IP v4 config path specified here must match the IP v4 config path // specified in NetworkStateTestHelper::ResetDevicesAndServices(), which itself // is based on the IP v4 config path used to set up IP v4 configs in @@ -362,4 +365,4 @@ // TEST_F(NetworkDiagnosticsTest, DnsResolutionReachability) {} } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.cc b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.cc index 5f7777af..3acbe0b 100644 --- a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.cc +++ b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.cc
@@ -14,7 +14,7 @@ #include "chrome/browser/profiles/profile_manager.h" #include "content/public/browser/storage_partition.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace util { @@ -214,4 +214,4 @@ } // namespace util } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.h b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.h index ffd899f57..42f428e 100644 --- a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.h +++ b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util.h
@@ -15,7 +15,7 @@ class Profile; -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace util { @@ -114,6 +114,6 @@ } // namespace util } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_NETWORK_DIAGNOSTICS_UTIL_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util_unittest.cc b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util_unittest.cc index 8b660119..794352d6 100644 --- a/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/network_diagnostics_util_unittest.cc
@@ -10,7 +10,7 @@ #include "base/strings/string_util.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { @@ -83,4 +83,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/signal_strength_routine.cc b/chrome/browser/ash/net/network_diagnostics/signal_strength_routine.cc index 196d226..3960724 100644 --- a/chrome/browser/ash/net/network_diagnostics/signal_strength_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/signal_strength_routine.cc
@@ -14,10 +14,14 @@ #include "mojo/public/cpp/bindings/remote.h" #include "net/base/net_errors.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; +namespace network_config = ::chromeos::network_config; + using chromeos::network_config::mojom::CrosNetworkConfig; using chromeos::network_config::mojom::FilterType; using chromeos::network_config::mojom::NetworkFilter; @@ -95,4 +99,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/signal_strength_routine.h b/chrome/browser/ash/net/network_diagnostics/signal_strength_routine.h index f1129698..5b57c33 100644 --- a/chrome/browser/ash/net/network_diagnostics/signal_strength_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/signal_strength_routine.h
@@ -12,7 +12,7 @@ #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "mojo/public/cpp/bindings/remote.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Tests the Network Interface Controller (NIC) signal strength. @@ -25,7 +25,7 @@ // NetworkDiagnosticRoutine: bool CanRun() override; - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -40,10 +40,11 @@ // Represents the strength of an unknown signal. static constexpr int kUnknownSignalStrength = 0; int signal_strength_ = kUnknownSignalStrength; - std::vector<mojom::SignalStrengthProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::SignalStrengthProblem> + problems_; }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_SIGNAL_STRENGTH_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/signal_strength_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/signal_strength_routine_unittest.cc index 067a2cae..74be4538 100644 --- a/chrome/browser/ash/net/network_diagnostics/signal_strength_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/signal_strength_routine_unittest.cc
@@ -9,11 +9,14 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + constexpr int kGoodWiFiSignal = 80; constexpr int kBadWiFiSignal = 20; @@ -124,4 +127,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/tls_prober.cc b/chrome/browser/ash/net/network_diagnostics/tls_prober.cc index 3cf16c8..5a43e42 100644 --- a/chrome/browser/ash/net/network_diagnostics/tls_prober.cc +++ b/chrome/browser/ash/net/network_diagnostics/tls_prober.cc
@@ -23,7 +23,7 @@ #include "services/network/public/cpp/resolve_host_client_base.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { @@ -185,4 +185,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/tls_prober.h b/chrome/browser/ash/net/network_diagnostics/tls_prober.h index 58856473..07d05eb 100644 --- a/chrome/browser/ash/net/network_diagnostics/tls_prober.h +++ b/chrome/browser/ash/net/network_diagnostics/tls_prober.h
@@ -18,7 +18,7 @@ #include "services/network/public/mojom/tls_socket.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Uses either a TCP or TLS socket to determine whether a socket connection to a @@ -117,6 +117,6 @@ }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_TLS_PROBER_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/tls_prober_unittest.cc b/chrome/browser/ash/net/network_diagnostics/tls_prober_unittest.cc index cdd39fa..042f9e1 100644 --- a/chrome/browser/ash/net/network_diagnostics/tls_prober_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/tls_prober_unittest.cc
@@ -31,7 +31,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { @@ -399,4 +399,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/udp_prober.cc b/chrome/browser/ash/net/network_diagnostics/udp_prober.cc index 420c7f6..5e8f9f2 100644 --- a/chrome/browser/ash/net/network_diagnostics/udp_prober.cc +++ b/chrome/browser/ash/net/network_diagnostics/udp_prober.cc
@@ -34,7 +34,7 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "url/gurl.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Implements the UdpProber class. @@ -267,4 +267,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/udp_prober.h b/chrome/browser/ash/net/network_diagnostics/udp_prober.h index 82d9d32e..cef6ee39 100644 --- a/chrome/browser/ash/net/network_diagnostics/udp_prober.h +++ b/chrome/browser/ash/net/network_diagnostics/udp_prober.h
@@ -15,7 +15,7 @@ #include "net/traffic_annotation/network_traffic_annotation.h" #include "services/network/public/mojom/network_context.mojom.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { // Uses a UDP socket to send data to a remote destination. After sending data, @@ -56,6 +56,6 @@ }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_UDP_PROBER_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/udp_prober_unittest.cc b/chrome/browser/ash/net/network_diagnostics/udp_prober_unittest.cc index b02bc0d..a813ae84 100644 --- a/chrome/browser/ash/net/network_diagnostics/udp_prober_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/udp_prober_unittest.cc
@@ -28,7 +28,7 @@ #include "services/network/test/test_network_context.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { @@ -341,4 +341,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/video_conferencing_routine.cc b/chrome/browser/ash/net/network_diagnostics/video_conferencing_routine.cc index 23b4e2b..6185de2 100644 --- a/chrome/browser/ash/net/network_diagnostics/video_conferencing_routine.cc +++ b/chrome/browser/ash/net/network_diagnostics/video_conferencing_routine.cc
@@ -17,11 +17,14 @@ #include "services/network/public/mojom/network_context.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + const char kDefaultStunServer[] = "stun.l.google.com"; } // namespace @@ -210,4 +213,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_diagnostics/video_conferencing_routine.h b/chrome/browser/ash/net/network_diagnostics/video_conferencing_routine.h index f3767a3..59a6a7e 100644 --- a/chrome/browser/ash/net/network_diagnostics/video_conferencing_routine.h +++ b/chrome/browser/ash/net/network_diagnostics/video_conferencing_routine.h
@@ -20,7 +20,7 @@ #include "net/traffic_annotation/network_traffic_annotation.h" #include "url/gurl.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { extern const char kSupportDetails[]; @@ -55,7 +55,7 @@ ~VideoConferencingRoutine() override; // NetworkDiagnosticsRoutine: - mojom::RoutineType Type() override; + chromeos::network_diagnostics::mojom::RoutineType Type() override; void Run() override; void AnalyzeResultsAndExecuteCallback() override; @@ -123,7 +123,8 @@ return weak_factory_.GetWeakPtr(); } - std::vector<mojom::VideoConferencingProblem> problems_; + std::vector<chromeos::network_diagnostics::mojom::VideoConferencingProblem> + problems_; std::string stun_server_hostname_; bool open_udp_port_found_ = false; bool open_tcp_port_found_ = false; @@ -140,6 +141,6 @@ }; } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_DIAGNOSTICS_VIDEO_CONFERENCING_ROUTINE_H_
diff --git a/chrome/browser/ash/net/network_diagnostics/video_conferencing_routine_unittest.cc b/chrome/browser/ash/net/network_diagnostics/video_conferencing_routine_unittest.cc index 1c73fc6..998454b 100644 --- a/chrome/browser/ash/net/network_diagnostics/video_conferencing_routine_unittest.cc +++ b/chrome/browser/ash/net/network_diagnostics/video_conferencing_routine_unittest.cc
@@ -20,11 +20,14 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_diagnostics::mojom; + // Test implementation of UdpProber. class TestUdpProber final : public UdpProber { public: @@ -521,4 +524,4 @@ } } // namespace network_diagnostics -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_health/network_health.cc b/chrome/browser/ash/net/network_health/network_health.cc index b816b6b1..405a79c6 100644 --- a/chrome/browser/ash/net/network_health/network_health.cc +++ b/chrome/browser/ash/net/network_health/network_health.cc
@@ -18,11 +18,15 @@ #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "chromeos/services/network_health/public/mojom/network_health.mojom.h" -namespace chromeos { +namespace ash { namespace network_health { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_health::mojom; +namespace network_config = ::chromeos::network_config; + constexpr mojom::NetworkState DeviceStateToNetworkState( network_config::mojom::DeviceStateType device_state) { switch (device_state) { @@ -370,4 +374,4 @@ } } // namespace network_health -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_health/network_health.h b/chrome/browser/ash/net/network_health/network_health.h index d79857d..fbd0f41 100644 --- a/chrome/browser/ash/net/network_health/network_health.h +++ b/chrome/browser/ash/net/network_health/network_health.h
@@ -19,11 +19,12 @@ #include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote_set.h" -namespace chromeos { +namespace ash { namespace network_health { -class NetworkHealth : public mojom::NetworkHealthService, - public network_config::mojom::CrosNetworkConfigObserver { +class NetworkHealth + : public chromeos::network_health::mojom::NetworkHealthService, + public chromeos::network_config::mojom::CrosNetworkConfigObserver { public: NetworkHealth(); @@ -31,14 +32,17 @@ // Binds this instance to |receiver|. void BindReceiver( - mojo::PendingReceiver<mojom::NetworkHealthService> receiver); + mojo::PendingReceiver< + chromeos::network_health::mojom::NetworkHealthService> receiver); // Returns the current NetworkHealthState. - const mojom::NetworkHealthStatePtr GetNetworkHealthState(); + const chromeos::network_health::mojom::NetworkHealthStatePtr + GetNetworkHealthState(); // NetworkHealthService - void AddObserver( - mojo::PendingRemote<mojom::NetworkEventsObserver> observer) override; + void AddObserver(mojo::PendingRemote< + chromeos::network_health::mojom::NetworkEventsObserver> + observer) override; void GetNetworkList(GetNetworkListCallback) override; void GetHealthSnapshot(GetHealthSnapshotCallback) override; @@ -46,10 +50,11 @@ void OnNetworkStateListChanged() override; void OnDeviceStateListChanged() override; void OnActiveNetworksChanged( - std::vector<network_config::mojom::NetworkStatePropertiesPtr> + std::vector<chromeos::network_config::mojom::NetworkStatePropertiesPtr> active_networks) override; void OnNetworkStateChanged( - network_config::mojom::NetworkStatePropertiesPtr network_state) override; + chromeos::network_config::mojom::NetworkStatePropertiesPtr network_state) + override; void OnVpnProvidersChanged() override; void OnNetworkCertificatesChanged() override; @@ -66,11 +71,11 @@ private: // Handler for receiving the network state list. void OnNetworkStateListReceived( - std::vector<network_config::mojom::NetworkStatePropertiesPtr>); + std::vector<chromeos::network_config::mojom::NetworkStatePropertiesPtr>); // Handler for receiving networking devices. void OnDeviceStateListReceived( - std::vector<network_config::mojom::DeviceStatePropertiesPtr>); + std::vector<chromeos::network_config::mojom::DeviceStatePropertiesPtr>); // Creates the NetworkHealthState structure from cached network information. void CreateNetworkHealthState(); @@ -81,21 +86,23 @@ void RequestDeviceStateList(); // Finds the matching network using |guid|. - const mojom::NetworkPtr* FindMatchingNetwork(const std::string& guid) const; + const chromeos::network_health::mojom::NetworkPtr* FindMatchingNetwork( + const std::string& guid) const; // Handles the case when an active network changes. Also handles the case // when a network that was not active becomes active. void HandleNetworkEventsForActiveNetworks( - std::vector<network_config::mojom::NetworkStatePropertiesPtr> + std::vector<chromeos::network_config::mojom::NetworkStatePropertiesPtr> active_networks); // Handles the case when an active network becomes no longer active. void HandleNetworkEventsForInactiveNetworks( - network_config::mojom::NetworkStatePropertiesPtr network); + chromeos::network_config::mojom::NetworkStatePropertiesPtr network); // Notifies observers of connection state changes. - void NotifyObserversConnectionStateChanged(const std::string& guid, - mojom::NetworkState state); + void NotifyObserversConnectionStateChanged( + const std::string& guid, + chromeos::network_health::mojom::NetworkState state); // Notifies observers of signal strength changes. void NotifyObserversSignalStrengthChanged(const std::string& guid, @@ -103,13 +110,15 @@ // Checks if a connection state changed has occurred. bool ConnectionStateChanged( - const mojom::NetworkPtr& network, - const network_config::mojom::NetworkStatePropertiesPtr& network_state); + const chromeos::network_health::mojom::NetworkPtr& network, + const chromeos::network_config::mojom::NetworkStatePropertiesPtr& + network_state); // Checks if a signal strength change event has occurred. bool SignalStrengthChanged( - const mojom::NetworkPtr& network, - const network_config::mojom::NetworkStatePropertiesPtr& network_state); + const chromeos::network_health::mojom::NetworkPtr& network, + const chromeos::network_config::mojom::NetworkStatePropertiesPtr& + network_state); // Function to add a signal strength sample for each network and update the // statistics over time for each network. @@ -117,15 +126,17 @@ // Remotes for tracking observers that will be notified of network events in // the mojom::NetworkEventsObserver interface. - mojo::RemoteSet<mojom::NetworkEventsObserver> observers_; + mojo::RemoteSet<chromeos::network_health::mojom::NetworkEventsObserver> + observers_; // Remote for sending requests to the CrosNetworkConfig service. - mojo::Remote<network_config::mojom::CrosNetworkConfig> + mojo::Remote<chromeos::network_config::mojom::CrosNetworkConfig> remote_cros_network_config_; // Receiver for the CrosNetworkConfigObserver events. - mojo::Receiver<network_config::mojom::CrosNetworkConfigObserver> + mojo::Receiver<chromeos::network_config::mojom::CrosNetworkConfigObserver> cros_network_config_observer_receiver_{this}; // Receivers for external requests (WebUI, Feedback, CrosHealthdClient). - mojo::ReceiverSet<mojom::NetworkHealthService> receivers_; + mojo::ReceiverSet<chromeos::network_health::mojom::NetworkHealthService> + receivers_; // Container for storing a running tally of the average signal strength per // network GUID. @@ -133,14 +144,14 @@ // Timer that triggers the function to analyze the networks' signal strengths. std::unique_ptr<base::RepeatingTimer> timer_; - mojom::NetworkHealthState network_health_state_; - std::vector<network_config::mojom::DeviceStatePropertiesPtr> + chromeos::network_health::mojom::NetworkHealthState network_health_state_; + std::vector<chromeos::network_config::mojom::DeviceStatePropertiesPtr> device_properties_; - std::vector<network_config::mojom::NetworkStatePropertiesPtr> + std::vector<chromeos::network_config::mojom::NetworkStatePropertiesPtr> network_properties_; }; } // namespace network_health -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_HEALTH_NETWORK_HEALTH_H_
diff --git a/chrome/browser/ash/net/network_health/network_health_constants.h b/chrome/browser/ash/net/network_health/network_health_constants.h index 49f13f3..6de3c0c 100644 --- a/chrome/browser/ash/net/network_health/network_health_constants.h +++ b/chrome/browser/ash/net/network_health/network_health_constants.h
@@ -7,7 +7,7 @@ #include "base/time/time.h" -namespace chromeos { +namespace ash { namespace network_health { // The rate in seconds at which to sample all network's signal strengths. @@ -18,6 +18,6 @@ constexpr base::TimeDelta kSignalStrengthSampleWindow = base::Minutes(15); } // namespace network_health -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_HEALTH_NETWORK_HEALTH_CONSTANTS_H_
diff --git a/chrome/browser/ash/net/network_health/network_health_service.cc b/chrome/browser/ash/net/network_health/network_health_service.cc index 7194d7a..f81389e 100644 --- a/chrome/browser/ash/net/network_health/network_health_service.cc +++ b/chrome/browser/ash/net/network_health/network_health_service.cc
@@ -9,9 +9,12 @@ #include "chrome/browser/ash/net/network_health/network_health.h" #include "chromeos/dbus/dbus_thread_manager.h" -namespace chromeos { +namespace ash { namespace network_health { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace mojom = ::chromeos::network_health::mojom; + NetworkHealthService::NetworkHealthService() { network_health_ = std::make_unique<NetworkHealth>(); network_diagnostics_ = @@ -26,9 +29,11 @@ return remote; } -mojo::PendingRemote<network_diagnostics::mojom::NetworkDiagnosticsRoutines> +mojo::PendingRemote< + chromeos::network_diagnostics::mojom::NetworkDiagnosticsRoutines> NetworkHealthService::GetDiagnosticsRemoteAndBindReceiver() { - mojo::PendingRemote<network_diagnostics::mojom::NetworkDiagnosticsRoutines> + mojo::PendingRemote< + chromeos::network_diagnostics::mojom::NetworkDiagnosticsRoutines> remote; BindDiagnosticsReceiver(remote.InitWithNewPipeAndPassReceiver()); return remote; @@ -41,7 +46,8 @@ void NetworkHealthService::BindDiagnosticsReceiver( mojo::PendingReceiver< - network_diagnostics::mojom::NetworkDiagnosticsRoutines> receiver) { + chromeos::network_diagnostics::mojom::NetworkDiagnosticsRoutines> + receiver) { network_diagnostics_->BindReceiver(std::move(receiver)); } @@ -56,4 +62,4 @@ } } // namespace network_health -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_health/network_health_service.h b/chrome/browser/ash/net/network_health/network_health_service.h index df4af73..b7c1aa2c 100644 --- a/chrome/browser/ash/net/network_health/network_health_service.h +++ b/chrome/browser/ash/net/network_health/network_health_service.h
@@ -9,7 +9,7 @@ #include "chromeos/services/network_health/public/mojom/network_health.mojom.h" #include "mojo/public/cpp/bindings/pending_remote.h" -namespace chromeos { +namespace ash { namespace network_diagnostics { class NetworkDiagnostics; @@ -26,18 +26,23 @@ NetworkHealthService(); ~NetworkHealthService() = delete; - mojo::PendingRemote<mojom::NetworkHealthService> + mojo::PendingRemote<chromeos::network_health::mojom::NetworkHealthService> GetHealthRemoteAndBindReceiver(); - mojo::PendingRemote<network_diagnostics::mojom::NetworkDiagnosticsRoutines> + mojo::PendingRemote< + chromeos::network_diagnostics::mojom::NetworkDiagnosticsRoutines> GetDiagnosticsRemoteAndBindReceiver(); void BindHealthReceiver( - mojo::PendingReceiver<mojom::NetworkHealthService> receiver); + mojo::PendingReceiver< + chromeos::network_health::mojom::NetworkHealthService> receiver); void BindDiagnosticsReceiver( mojo::PendingReceiver< - network_diagnostics::mojom::NetworkDiagnosticsRoutines> receiver); + chromeos::network_diagnostics::mojom::NetworkDiagnosticsRoutines> + receiver); - void AddObserver(mojo::PendingRemote<mojom::NetworkEventsObserver> observer); + void AddObserver( + mojo::PendingRemote< + chromeos::network_health::mojom::NetworkEventsObserver> observer); private: std::unique_ptr<NetworkHealth> network_health_; @@ -45,6 +50,13 @@ }; } // namespace network_health +} // namespace ash + +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace chromeos { +namespace network_health { +using ::ash::network_health::NetworkHealthService; +} } // namespace chromeos #endif // CHROME_BROWSER_ASH_NET_NETWORK_HEALTH_NETWORK_HEALTH_SERVICE_H_
diff --git a/chrome/browser/ash/net/network_health/network_health_unittest.cc b/chrome/browser/ash/net/network_health/network_health_unittest.cc index 4b2cbac..8cee8d14 100644 --- a/chrome/browser/ash/net/network_health/network_health_unittest.cc +++ b/chrome/browser/ash/net/network_health/network_health_unittest.cc
@@ -18,10 +18,15 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" -using chromeos::network_config::mojom::NetworkType; +namespace ash { +namespace network_health { namespace { +// TODO(https://crbug.com/1164001): remove when migrated to namespace ash. +namespace network_config = ::chromeos::network_config; +namespace network_health = ::chromeos::network_health; + // Constant values for fake devices and services. constexpr char kEthServicePath[] = "/service/eth/0"; constexpr char kEthServiceName[] = "eth_service_name"; @@ -82,9 +87,6 @@ } // namespace -namespace chromeos { -namespace network_health { - class NetworkHealthTestImpl : public NetworkHealth { public: NetworkHealthTestImpl() { @@ -137,7 +139,7 @@ initial_network_health_state->networks[0]->state); } - mojom::NetworkPtr GetNetworkHealthStateByType( + network_health::mojom::NetworkPtr GetNetworkHealthStateByType( network_config::mojom::NetworkType type) { const auto& network_health_state = network_health_.GetNetworkHealthState(); for (auto& network : network_health_state->networks) { @@ -561,4 +563,4 @@ } } // namespace network_health -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_health/signal_strength_tracker.cc b/chrome/browser/ash/net/network_health/signal_strength_tracker.cc index 607e07ed..2798457 100644 --- a/chrome/browser/ash/net/network_health/signal_strength_tracker.cc +++ b/chrome/browser/ash/net/network_health/signal_strength_tracker.cc
@@ -10,7 +10,7 @@ #include "base/logging.h" -namespace chromeos { +namespace ash { namespace network_health { SignalStrengthTracker::SignalStrengthTracker() = default; @@ -52,4 +52,4 @@ } } // namespace network_health -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_health/signal_strength_tracker.h b/chrome/browser/ash/net/network_health/signal_strength_tracker.h index d22b6918..b327d9d1 100644 --- a/chrome/browser/ash/net/network_health/signal_strength_tracker.h +++ b/chrome/browser/ash/net/network_health/signal_strength_tracker.h
@@ -11,7 +11,7 @@ #include "base/containers/circular_deque.h" #include "chrome/browser/ash/net/network_health/network_health_constants.h" -namespace chromeos { +namespace ash { namespace network_health { // The size is the list to use for the signal strength calculations. This is @@ -49,6 +49,6 @@ }; } // namespace network_health -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_HEALTH_SIGNAL_STRENGTH_TRACKER_H_
diff --git a/chrome/browser/ash/net/network_health/signal_strength_tracker_unittest.cc b/chrome/browser/ash/net/network_health/signal_strength_tracker_unittest.cc index 4c4d12f..40584ec 100644 --- a/chrome/browser/ash/net/network_health/signal_strength_tracker_unittest.cc +++ b/chrome/browser/ash/net/network_health/signal_strength_tracker_unittest.cc
@@ -9,13 +9,15 @@ #include "testing/gtest/include/gtest/gtest.h" -namespace { -constexpr std::array<uint8_t, 3> samples = {71, 74, 80}; -} // namespace - -namespace chromeos { +namespace ash { namespace network_health { +namespace { + +constexpr std::array<uint8_t, 3> samples = {71, 74, 80}; + +} + class SignalStrengthTrackerTest : public ::testing::Test { public: SignalStrengthTrackerTest() {} @@ -74,4 +76,4 @@ } } // namespace network_health -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_portal_detector_impl.cc b/chrome/browser/ash/net/network_portal_detector_impl.cc index 502ac3f..1860a50e 100644 --- a/chrome/browser/ash/net/network_portal_detector_impl.cc +++ b/chrome/browser/ash/net/network_portal_detector_impl.cc
@@ -29,12 +29,12 @@ #include "services/network/public/cpp/shared_url_loader_factory.h" #include "third_party/cros_system_api/dbus/service_constants.h" -using captive_portal::CaptivePortalDetector; - -namespace chromeos { +namespace ash { namespace { +using ::captive_portal::CaptivePortalDetector; + // Delay before portal detection caused by changes in proxy settings. constexpr int kProxyChangeDelaySec = 1; @@ -469,4 +469,4 @@ strategy_->Reset(); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_portal_detector_impl.h b/chrome/browser/ash/net/network_portal_detector_impl.h index 258b1d2..e3cb200 100644 --- a/chrome/browser/ash/net/network_portal_detector_impl.h +++ b/chrome/browser/ash/net/network_portal_detector_impl.h
@@ -17,6 +17,8 @@ #include "base/observer_list.h" #include "base/sequence_checker.h" #include "base/time/time.h" +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler_observer.h" #include "chromeos/network/portal_detector/network_portal_detector.h" #include "chromeos/network/portal_detector/network_portal_detector_strategy.h" @@ -37,9 +39,7 @@ } } // namespace network -namespace chromeos { - -class NetworkState; +namespace ash { // This class handles all notifications about network changes from // NetworkStateHandler and delegates portal detection for the default @@ -232,6 +232,6 @@ base::WeakPtrFactory<NetworkPortalDetectorImpl> weak_factory_{this}; }; -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_
diff --git a/chrome/browser/ash/net/network_portal_detector_impl_browsertest.cc b/chrome/browser/ash/net/network_portal_detector_impl_browsertest.cc index 8882986..7c174c41 100644 --- a/chrome/browser/ash/net/network_portal_detector_impl_browsertest.cc +++ b/chrome/browser/ash/net/network_portal_detector_impl_browsertest.cc
@@ -38,7 +38,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/service_constants.h" -namespace chromeos { +namespace ash { class NetworkPortalWebDialog; @@ -252,4 +252,4 @@ NetworkPortalDetectorImplBrowserTestIgnoreProxy, testing::Bool()); -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_portal_detector_impl_unittest.cc b/chrome/browser/ash/net/network_portal_detector_impl_unittest.cc index 53dba4d8..083dc801 100644 --- a/chrome/browser/ash/net/network_portal_detector_impl_unittest.cc +++ b/chrome/browser/ash/net/network_portal_detector_impl_unittest.cc
@@ -44,14 +44,14 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/service_constants.h" -using testing::_; -using testing::AnyNumber; -using testing::Mock; - -namespace chromeos { +namespace ash { namespace { +using ::testing::_; +using ::testing::AnyNumber; +using ::testing::Mock; + // Service path / guid for stub networks. const char kStubEthernet[] = "stub_ethernet"; const char kStubWireless1[] = "stub_wifi1"; @@ -917,4 +917,4 @@ EXPECT_NE(State::STATE_IDLE, state()); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_portal_detector_test_impl.cc b/chrome/browser/ash/net/network_portal_detector_test_impl.cc index 6fc9812..126755a 100644 --- a/chrome/browser/ash/net/network_portal_detector_test_impl.cc +++ b/chrome/browser/ash/net/network_portal_detector_test_impl.cc
@@ -10,7 +10,7 @@ #include "base/logging.h" #include "chromeos/network/network_state.h" -namespace chromeos { +namespace ash { NetworkPortalDetectorTestImpl::NetworkPortalDetectorTestImpl() : strategy_id_(PortalDetectorStrategy::STRATEGY_ID_LOGIN_SCREEN) { @@ -123,4 +123,4 @@ strategy_id_ = id; } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_portal_detector_test_impl.h b/chrome/browser/ash/net/network_portal_detector_test_impl.h index ef62e45..31ef335 100644 --- a/chrome/browser/ash/net/network_portal_detector_test_impl.h +++ b/chrome/browser/ash/net/network_portal_detector_test_impl.h
@@ -14,7 +14,7 @@ #include "base/observer_list.h" #include "chromeos/network/portal_detector/network_portal_detector.h" -namespace chromeos { +namespace ash { class NetworkPortalDetectorTestImpl : public NetworkPortalDetector { public: @@ -70,12 +70,11 @@ std::vector<base::OnceClosure> start_detection_callbacks_; }; -} // namespace chromeos - -// TODO(https://crbug.com/1164001): remove when //chrome/browser/chromeos/net -// moved to ash -namespace ash { -using ::chromeos::NetworkPortalDetectorTestImpl; } // namespace ash +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace chromeos { +using ::ash::NetworkPortalDetectorTestImpl; +} + #endif // CHROME_BROWSER_ASH_NET_NETWORK_PORTAL_DETECTOR_TEST_IMPL_H_
diff --git a/chrome/browser/ash/net/network_portal_detector_test_utils.cc b/chrome/browser/ash/net/network_portal_detector_test_utils.cc index d04944f..47d5f37d 100644 --- a/chrome/browser/ash/net/network_portal_detector_test_utils.cc +++ b/chrome/browser/ash/net/network_portal_detector_test_utils.cc
@@ -14,7 +14,7 @@ #include "base/metrics/histogram_samples.h" #include "base/metrics/statistics_recorder.h" -namespace chromeos { +namespace ash { EnumHistogramChecker::EnumHistogramChecker(const std::string& histogram, int count, @@ -68,4 +68,4 @@ return ok; } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_portal_detector_test_utils.h b/chrome/browser/ash/net/network_portal_detector_test_utils.h index 9431731..4bf002a 100644 --- a/chrome/browser/ash/net/network_portal_detector_test_utils.h +++ b/chrome/browser/ash/net/network_portal_detector_test_utils.h
@@ -12,7 +12,7 @@ class HistogramSamples; } -namespace chromeos { +namespace ash { // Checks enum values in a histogram. class EnumHistogramChecker { @@ -44,6 +44,6 @@ base::HistogramSamples* base_; }; -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_PORTAL_DETECTOR_TEST_UTILS_H_
diff --git a/chrome/browser/ash/net/network_portal_web_dialog.cc b/chrome/browser/ash/net/network_portal_web_dialog.cc index 2d6e124..45e53a2 100644 --- a/chrome/browser/ash/net/network_portal_web_dialog.cc +++ b/chrome/browser/ash/net/network_portal_web_dialog.cc
@@ -14,6 +14,8 @@ #include "ui/views/widget/widget.h" #include "url/gurl.h" +namespace ash { + namespace { const float kNetworkPortalWebDialogScale = .8; @@ -28,8 +30,6 @@ } // namespace -namespace chromeos { - NetworkPortalWebDialog::NetworkPortalWebDialog( base::WeakPtr<NetworkPortalNotificationController> controller) : controller_(controller), widget_(nullptr) { @@ -87,4 +87,4 @@ return true; } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_portal_web_dialog.h b/chrome/browser/ash/net/network_portal_web_dialog.h index 615ced2..8962ee4 100644 --- a/chrome/browser/ash/net/network_portal_web_dialog.h +++ b/chrome/browser/ash/net/network_portal_web_dialog.h
@@ -13,7 +13,7 @@ class Widget; } -namespace chromeos { +namespace ash { // This is the modal Web dialog to display captive portal login page. // It is automatically closed when successful authorization is detected. @@ -49,6 +49,11 @@ views::Widget* widget_; }; -} // namespace chromeos +} // namespace ash + +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace chromeos { +using ::ash::NetworkPortalWebDialog; +} #endif // CHROME_BROWSER_ASH_NET_NETWORK_PORTAL_WEB_DIALOG_H_
diff --git a/chrome/browser/ash/net/network_pref_state_observer.cc b/chrome/browser/ash/net/network_pref_state_observer.cc index 9493bea10..49362aa4 100644 --- a/chrome/browser/ash/net/network_pref_state_observer.cc +++ b/chrome/browser/ash/net/network_pref_state_observer.cc
@@ -15,7 +15,7 @@ #include "chromeos/tpm/install_attributes.h" #include "content/public/browser/notification_service.h" -namespace chromeos { +namespace ash { NetworkPrefStateObserver::NetworkPrefStateObserver() { // Initialize NetworkHandler with device prefs only. @@ -59,4 +59,4 @@ g_browser_process->local_state()); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_pref_state_observer.h b/chrome/browser/ash/net/network_pref_state_observer.h index a661dd1..5ad9218 100644 --- a/chrome/browser/ash/net/network_pref_state_observer.h +++ b/chrome/browser/ash/net/network_pref_state_observer.h
@@ -11,7 +11,7 @@ class Profile; -namespace chromeos { +namespace ash { // Class to update NetworkHandler when the PrefService state changes. The // implementation currently relies on g_browser_process since it holds the @@ -37,11 +37,6 @@ session_observation_{this}; }; -} // namespace chromeos - -// TODO(https://crbug.com/1164001): remove after the migration is finished. -namespace ash { -using ::chromeos::NetworkPrefStateObserver; -} +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_PREF_STATE_OBSERVER_H_
diff --git a/chrome/browser/ash/net/network_pref_state_observer_unittest.cc b/chrome/browser/ash/net/network_pref_state_observer_unittest.cc index 186db818..8cb6acd1 100644 --- a/chrome/browser/ash/net/network_pref_state_observer_unittest.cc +++ b/chrome/browser/ash/net/network_pref_state_observer_unittest.cc
@@ -25,12 +25,14 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/service_constants.h" +namespace ash { + namespace { + const char kUserId[] = "test@example.com"; const char kNetworkId[] = "wifi1_guid"; // Matches FakeShillManagerClient -} // namespace -namespace chromeos { +} // namespace class NetworkPrefStateObserverTest : public testing::Test { public: @@ -116,4 +118,4 @@ EXPECT_EQ(base::Value(::onc::proxy::kPAC), *mode); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_throttling_observer.cc b/chrome/browser/ash/net/network_throttling_observer.cc index 1267052e..89208ab 100644 --- a/chrome/browser/ash/net/network_throttling_observer.cc +++ b/chrome/browser/ash/net/network_throttling_observer.cc
@@ -16,7 +16,7 @@ #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" -namespace chromeos { +namespace ash { NetworkThrottlingObserver::NetworkThrottlingObserver(PrefService* local_state) : local_state_(local_state) { @@ -64,4 +64,4 @@ enabled, upload_rate, download_rate); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/network_throttling_observer.h b/chrome/browser/ash/net/network_throttling_observer.h index 189b2dd..a41b04f 100644 --- a/chrome/browser/ash/net/network_throttling_observer.h +++ b/chrome/browser/ash/net/network_throttling_observer.h
@@ -12,7 +12,7 @@ class PrefRegistrySimple; -namespace chromeos { +namespace ash { // NetworkThrottlingObserver is a singleton, owned by // `ChromeBrowserMainPartsAsh`. @@ -39,11 +39,6 @@ PrefChangeRegistrar pref_change_registrar_; }; -} // namespace chromeos - -// TODO(https://crbug.com/1164001): remove after the migration is finished. -namespace ash { -using ::chromeos::NetworkThrottlingObserver; -} +} // namespace ash #endif // CHROME_BROWSER_ASH_NET_NETWORK_THROTTLING_OBSERVER_H_
diff --git a/chrome/browser/ash/net/network_throttling_observer_unittest.cc b/chrome/browser/ash/net/network_throttling_observer_unittest.cc index 221dcbb..a550af2 100644 --- a/chrome/browser/ash/net/network_throttling_observer_unittest.cc +++ b/chrome/browser/ash/net/network_throttling_observer_unittest.cc
@@ -14,8 +14,7 @@ #include "components/prefs/testing_pref_service.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { - +namespace ash { namespace test { class NetworkThrottlingObserverTest : public ::testing::Test { @@ -83,4 +82,4 @@ } } // namespace test -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/rollback_network_config/rollback_network_config.cc b/chrome/browser/ash/net/rollback_network_config/rollback_network_config.cc index c1cc921..01b2e7b 100644 --- a/chrome/browser/ash/net/rollback_network_config/rollback_network_config.cc +++ b/chrome/browser/ash/net/rollback_network_config/rollback_network_config.cc
@@ -36,8 +36,8 @@ const char kDeviceUserHash[] = ""; bool IsOwnershipTaken() { - return ash::DeviceSettingsService::Get()->GetOwnershipStatus() == - ash::DeviceSettingsService::OwnershipStatus::OWNERSHIP_TAKEN; + return DeviceSettingsService::Get()->GetOwnershipStatus() == + DeviceSettingsService::OwnershipStatus::OWNERSHIP_TAKEN; } bool IsDeviceEnterpriseEnrolled() { @@ -314,9 +314,8 @@ return serialized_config; } -class RollbackNetworkConfig::Importer - : public ash::DeviceSettingsService::Observer, - public NetworkPolicyObserver { +class RollbackNetworkConfig::Importer : public DeviceSettingsService::Observer, + public NetworkPolicyObserver { public: Importer(); Importer(const Importer&) = delete; @@ -351,15 +350,15 @@ }; RollbackNetworkConfig::Importer::Importer() { - ash::DeviceSettingsService::Get()->AddObserver(this); + DeviceSettingsService::Get()->AddObserver(this); chromeos::NetworkHandler::Get() ->managed_network_configuration_handler() ->AddObserver(this); } RollbackNetworkConfig::Importer::~Importer() { - if (ash::DeviceSettingsService::Get()) { - ash::DeviceSettingsService::Get()->RemoveObserver(this); + if (DeviceSettingsService::Get()) { + DeviceSettingsService::Get()->RemoveObserver(this); } if (chromeos::NetworkHandler::Get()) { chromeos::NetworkHandler::Get()
diff --git a/chrome/browser/ash/net/rollback_network_config/rollback_network_config_unittest.cc b/chrome/browser/ash/net/rollback_network_config/rollback_network_config_unittest.cc index 1084e44..da80d90 100644 --- a/chrome/browser/ash/net/rollback_network_config/rollback_network_config_unittest.cc +++ b/chrome/browser/ash/net/rollback_network_config/rollback_network_config_unittest.cc
@@ -36,6 +36,9 @@ #include "content/public/test/test_utils.h" #include "testing/gtest/include/gtest/gtest.h" +namespace ash { +namespace rollback_network_config { + namespace { static const char kDeviceUserHash[] = ""; @@ -144,7 +147,7 @@ })"; TestingPrefServiceSimple* RegisterPrefs(TestingPrefServiceSimple* local_state) { - ash::device_settings_cache::RegisterPrefs(local_state->registry()); + device_settings_cache::RegisterPrefs(local_state->registry()); return local_state; } @@ -170,8 +173,8 @@ ->managed_network_configuration_handler(); } -ash::ShillServiceClient* shill_service_client() { - return ash::ShillServiceClient::Get(); +ShillServiceClient* shill_service_client() { + return ShillServiceClient::Get(); } const chromeos::NetworkState* GetNetworkState(const std::string& guid) { @@ -288,9 +291,6 @@ } // namespace -namespace ash { -namespace rollback_network_config { - class RollbackNetworkConfigTest : public testing::Test { public: RollbackNetworkConfigTest() { @@ -387,9 +387,8 @@ content::BrowserTaskEnvironment::IO_MAINLOOP}; NetworkHandlerTestHelper network_handler_test_helper_; ScopedStubInstallAttributes scoped_stub_install_attributes_; - ash::ScopedTestDeviceSettingsService scoped_device_settings_; - ash::ScopedTestCrosSettings scoped_cros_settings_{ - RegisterPrefs(&local_state_)}; + ScopedTestDeviceSettingsService scoped_device_settings_; + ScopedTestCrosSettings scoped_cros_settings_{RegisterPrefs(&local_state_)}; policy::DevicePolicyBuilder device_policy_; std::unique_ptr<RollbackNetworkConfig> rollback_network_config_; @@ -492,7 +491,7 @@ } TEST_F(RollbackNetworkConfigTest, WepPskWiFiIsPreserved) { - base::Value network = *base::JSONReader::Read(::kWepPskWiFi); + base::Value network = *base::JSONReader::Read(kWepPskWiFi); SetUpDeviceWideNetworkConfig(network); const std::string& guid = GetStringValue(network, onc::network_config::kGUID); @@ -509,7 +508,7 @@ } TEST_F(RollbackNetworkConfigTest, PolicyWepPskWiFiIsPreserved) { - base::Value network = *base::JSONReader::Read(::kWepPskWiFi); + base::Value network = *base::JSONReader::Read(kWepPskWiFi); SetUpDevicePolicyNetworkConfig(network); const std::string& guid = GetStringValue(network, onc::network_config::kGUID); @@ -657,7 +656,7 @@ } TEST_F(RollbackNetworkConfigTest, ConsumerOwnershipKeepsDeviceNetworks) { - base::Value network = *base::JSONReader::Read(::kOpenWiFi); + base::Value network = *base::JSONReader::Read(kOpenWiFi); SetUpDeviceWideNetworkConfig(network); const std::string& guid = GetStringValue(network, onc::network_config::kGUID); @@ -674,7 +673,7 @@ } TEST_F(RollbackNetworkConfigTest, ConsumerOwnershipDeletesPolicyNetworksWiFi) { - base::Value network = *base::JSONReader::Read(::kOpenWiFi); + base::Value network = *base::JSONReader::Read(kOpenWiFi); SetUpDevicePolicyNetworkConfig(network); const std::string& guid = GetStringValue(network, onc::network_config::kGUID);
diff --git a/chrome/browser/ash/net/system_proxy_manager.cc b/chrome/browser/ash/net/system_proxy_manager.cc index 9ece923b..c0abcfd 100644 --- a/chrome/browser/ash/net/system_proxy_manager.cc +++ b/chrome/browser/ash/net/system_proxy_manager.cc
@@ -49,6 +49,8 @@ #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h" +namespace ash { + namespace { const char kSystemProxyService[] = "system-proxy-service"; @@ -90,25 +92,21 @@ // system services and the PlayStore. If enabled via flag, system-proxy can only // be used by system services which explicitly ask to use system-proxy for HTTP // proxy authentication. Otherwise, system-proxy is disabled. -chromeos::SystemProxyManager::SystemProxyState DetermineSystemProxyState( +SystemProxyManager::SystemProxyState DetermineSystemProxyState( bool policy_enabled) { if (policy_enabled) - return chromeos::SystemProxyManager::SystemProxyState::kEnabledForAll; + return SystemProxyManager::SystemProxyState::kEnabledForAll; - if (base::FeatureList::IsEnabled( - ash::features::kSystemProxyForSystemServices)) { - return chromeos::SystemProxyManager::SystemProxyState:: - kEnabledForSystemServices; + if (base::FeatureList::IsEnabled(features::kSystemProxyForSystemServices)) { + return SystemProxyManager::SystemProxyState::kEnabledForSystemServices; } - return chromeos::SystemProxyManager::SystemProxyState::kDisabled; + return SystemProxyManager::SystemProxyState::kDisabled; } +SystemProxyManager* g_system_proxy_manager_ = nullptr; + } // namespace -namespace chromeos { - -static SystemProxyManager* g_system_proxy_manager_ = nullptr; - SystemProxyManager::SystemProxyManager(PrefService* local_state) { // Connect to System-proxy signals. SystemProxyClient::Get()->SetWorkerActiveSignalCallback(base::BindRepeating( @@ -167,15 +165,15 @@ } std::string SystemProxyManager::SystemServicesProxyPacString( - SystemProxyOverride system_proxy_override) const { - if (system_proxy_override == SystemProxyOverride::kOptOut || + chromeos::SystemProxyOverride system_proxy_override) const { + if (system_proxy_override == chromeos::SystemProxyOverride::kOptOut || system_services_address_.empty()) { return std::string(); } if (system_proxy_state_ == SystemProxyState::kEnabledForAll || (system_proxy_state_ == SystemProxyState::kEnabledForSystemServices && - system_proxy_override == SystemProxyOverride::kOptIn)) { + system_proxy_override == chromeos::SystemProxyOverride::kOptIn)) { return "PROXY " + system_services_address_; } @@ -450,7 +448,7 @@ send_auth_details_closure_for_test_ = closure; } -ash::RequestSystemProxyCredentialsView* +RequestSystemProxyCredentialsView* SystemProxyManager::GetActiveAuthDialogForTest() { return active_auth_dialog_; } @@ -679,7 +677,7 @@ bool show_error) { if (active_auth_dialog_) return; - notification_handler_ = std::make_unique<ash::SystemProxyNotification>( + notification_handler_ = std::make_unique<SystemProxyNotification>( protection_space, show_error, base::BindOnce(&SystemProxyManager::ShowAuthenticationDialog, weak_factory_.GetWeakPtr())); @@ -695,7 +693,7 @@ if (notification_handler_) notification_handler_->Close(); - active_auth_dialog_ = new ash::RequestSystemProxyCredentialsView( + active_auth_dialog_ = new RequestSystemProxyCredentialsView( protection_space.origin(), show_error_label, base::BindOnce(&SystemProxyManager::OnDialogClosed, weak_factory_.GetWeakPtr(), protection_space)); @@ -742,4 +740,4 @@ auth_widget_->CloseWithReason(views::Widget::ClosedReason::kUnspecified); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/system_proxy_manager.h b/chrome/browser/ash/net/system_proxy_manager.h index 876162e..5f400a87 100644 --- a/chrome/browser/ash/net/system_proxy_manager.h +++ b/chrome/browser/ash/net/system_proxy_manager.h
@@ -21,15 +21,6 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/cros_system_api/dbus/service_constants.h" -namespace ash { -class RequestSystemProxyCredentialsView; -class SystemProxyNotification; -} // namespace ash - -namespace chromeos { -class NetworkState; -} // namespace chromeos - namespace content { class LoginDelegate; } // namespace content @@ -48,7 +39,9 @@ class PrefChangeRegistrar; class Profile; -namespace chromeos { +namespace ash { +class RequestSystemProxyCredentialsView; +class SystemProxyNotification; // Starts and stops the system-proxy service and handles the authentication // requests coming from system-proxy. Authentication requests are resolved by @@ -103,7 +96,7 @@ // PROXY localhost:3128 // otherwise it returns an empty string. std::string SystemServicesProxyPacString( - SystemProxyOverride system_proxy_override) const; + chromeos::SystemProxyOverride system_proxy_override) const; void StartObservingPrimaryProfilePrefs(Profile* profile); void StopObservingPrimaryProfilePrefs(); @@ -126,7 +119,7 @@ void SetSystemProxyEnabledForTest(bool enabled); void SetSystemServicesProxyUrlForTest(const std::string& local_proxy_url); void SetSendAuthDetailsClosureForTest(base::RepeatingClosure closure); - ash::RequestSystemProxyCredentialsView* GetActiveAuthDialogForTest(); + RequestSystemProxyCredentialsView* GetActiveAuthDialogForTest(); void CloseAuthDialogForTest(); // Registers prefs stored in user profiles. @@ -267,10 +260,10 @@ // Notification which informs the user that System-proxy requires credentials // for authentication to the remote proxy. - std::unique_ptr<ash::SystemProxyNotification> notification_handler_; + std::unique_ptr<SystemProxyNotification> notification_handler_; // Owned by |auth_widget_|. - ash::RequestSystemProxyCredentialsView* active_auth_dialog_ = nullptr; + RequestSystemProxyCredentialsView* active_auth_dialog_ = nullptr; // Owned by the UI code (NativeWidget). views::Widget* auth_widget_ = nullptr; @@ -287,11 +280,6 @@ base::WeakPtrFactory<SystemProxyManager> weak_factory_{this}; }; -} // namespace chromeos - -// TODO(https://crbug.com/1164001): remove when moved to ash. -namespace ash { -using ::chromeos::SystemProxyManager; } // namespace ash #endif // CHROME_BROWSER_ASH_NET_SYSTEM_PROXY_MANAGER_H_
diff --git a/chrome/browser/ash/net/system_proxy_manager_browsertest.cc b/chrome/browser/ash/net/system_proxy_manager_browsertest.cc index 713f381..85548095 100644 --- a/chrome/browser/ash/net/system_proxy_manager_browsertest.cc +++ b/chrome/browser/ash/net/system_proxy_manager_browsertest.cc
@@ -66,12 +66,10 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" -using testing::_; -using testing::Return; - -namespace chromeos { +namespace ash { namespace { + constexpr char kRealm[] = "My proxy"; constexpr char kScheme[] = "dIgEsT"; constexpr char kProxyAuthUrl[] = "http://example.com:3128"; @@ -162,6 +160,7 @@ base::RunLoop loop; loop.RunUntilIdle(); } + } // namespace class SystemProxyManagerBrowserTest : public InProcessBrowserTest { @@ -189,7 +188,7 @@ return SystemProxyManager::Get(); } - ash::RequestSystemProxyCredentialsView* dialog() { + RequestSystemProxyCredentialsView* dialog() { return GetSystemProxyManager()->GetActiveAuthDialogForTest(); } @@ -782,4 +781,4 @@ CheckEntryInHttpAuthCache("Basic", kProxyUsername, kProxyPassword); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/net/system_proxy_manager_unittest.cc b/chrome/browser/ash/net/system_proxy_manager_unittest.cc index c1326370..bb975e9 100644 --- a/chrome/browser/ash/net/system_proxy_manager_unittest.cc +++ b/chrome/browser/ash/net/system_proxy_manager_unittest.cc
@@ -42,11 +42,10 @@ #include "url/gurl.h" #include "url/scheme_host_port.h" -using testing::_; -using testing::Invoke; -using testing::WithArg; +namespace ash { namespace { + constexpr char kBrowserUsername[] = "browser_username"; constexpr char16_t kBrowserUsername16[] = u"browser_username"; constexpr char kBrowserPassword[] = "browser_password"; @@ -103,7 +102,6 @@ } // namespace -namespace chromeos { // TODO(acostinas, https://crbug.com/1102351) Replace RunUntilIdle() in tests // with RunLoop::Run() with explicit RunLoop::QuitClosure(). class SystemProxyManagerTest : public testing::Test { @@ -452,7 +450,7 @@ task_environment_.RunUntilIdle(); EXPECT_EQ(system_proxy_manager_->SystemServicesProxyPacString( - SystemProxyOverride::kDefault), + chromeos::SystemProxyOverride::kDefault), "PROXY http://example.com:3128"); } @@ -466,13 +464,14 @@ client_test_interface()->SendWorkerActiveSignal(details); task_environment_.RunUntilIdle(); - EXPECT_TRUE(system_proxy_manager_ - ->SystemServicesProxyPacString(SystemProxyOverride::kOptOut) - .empty()); + EXPECT_TRUE( + system_proxy_manager_ + ->SystemServicesProxyPacString(chromeos::SystemProxyOverride::kOptOut) + .empty()); } // Tests the behaviour of SystemProxyManager when enabled via the feature flag -// `ash::features::kSystemProxyForSystemServices`. +// `features::kSystemProxyForSystemServices`. class FeatureEnabledSystemProxyTest : public SystemProxyManagerTest { public: FeatureEnabledSystemProxyTest() : SystemProxyManagerTest() {} @@ -481,7 +480,7 @@ // testing::Test void SetUp() override { scoped_feature_list_.InitAndEnableFeature( - ash::features::kSystemProxyForSystemServices); + features::kSystemProxyForSystemServices); SystemProxyManagerTest::SetUp(); } @@ -499,7 +498,8 @@ task_environment_.RunUntilIdle(); EXPECT_TRUE(system_proxy_manager_ - ->SystemServicesProxyPacString(SystemProxyOverride::kDefault) + ->SystemServicesProxyPacString( + chromeos::SystemProxyOverride::kDefault) .empty()); } @@ -511,7 +511,7 @@ task_environment_.RunUntilIdle(); EXPECT_EQ(system_proxy_manager_->SystemServicesProxyPacString( - SystemProxyOverride::kOptIn), + chromeos::SystemProxyOverride::kOptIn), "PROXY local-proxy.com:3128"); } @@ -547,4 +547,4 @@ ::prefs::kSystemProxyUserTrafficHostAndPort)); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_browsertest.cc b/chrome/browser/ash/policy/core/device_cloud_policy_browsertest.cc index 52c46c0..6e3dafc 100644 --- a/chrome/browser/ash/policy/core/device_cloud_policy_browsertest.cc +++ b/chrome/browser/ash/policy/core/device_cloud_policy_browsertest.cc
@@ -15,7 +15,7 @@ #include "base/memory/ref_counted.h" #include "base/run_loop.h" #include "base/values.h" -#include "chrome/browser/ash/login/test/local_policy_test_server_mixin.h" +#include "chrome/browser/ash/login/test/embedded_policy_test_server_mixin.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" #include "chrome/browser/ash/policy/core/device_cloud_policy_store_ash.h" #include "chrome/browser/ash/policy/core/device_policy_cros_browser_test.h" @@ -81,8 +81,6 @@ KeyRotationDeviceCloudPolicyTest() { UpdateBuiltTestPolicyValue(kInitialPolicyValue); - local_policy_mixin_.EnableCannedSigningKeys(); - local_policy_mixin_.EnableAutomaticRotationOfSigningKeys(); } void SetUpInProcessBrowserTestFixture() override { @@ -110,8 +108,7 @@ } void UpdateServedTestPolicy() { - EXPECT_TRUE( - local_policy_mixin_.UpdateDevicePolicy(device_policy()->payload())); + policy_test_server_mixin_.UpdateDevicePolicy(device_policy()->payload()); } void StartDevicePolicyRefresh() { @@ -191,7 +188,11 @@ } } - ash::LocalPolicyTestServerMixin local_policy_mixin_{&mixin_host_}; + ash::EmbeddedPolicyTestServerMixin policy_test_server_mixin_{ + &mixin_host_, + {ash::EmbeddedPolicyTestServerMixin::ENABLE_CANNED_SIGNING_KEYS, + ash::EmbeddedPolicyTestServerMixin:: + ENABLE_AUTOMATIC_ROTATION_OF_SIGNINGKEYS}}; std::unique_ptr<PolicyChangeRegistrar> policy_change_registrar_; int awaited_policy_value_ = -1; std::unique_ptr<base::RunLoop> policy_change_waiting_run_loop_; @@ -285,11 +286,10 @@ DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture(); SetFakeDevicePolicy(); - EXPECT_TRUE( - local_policy_mixin_.UpdateDevicePolicy(device_policy()->payload())); - EXPECT_TRUE(local_policy_mixin_.server()->UpdatePolicy( + policy_test_server_mixin_.UpdateDevicePolicy(device_policy()->payload()); + policy_test_server_mixin_.UpdatePolicy( dm_protocol::kChromeSigninExtensionPolicyType, kTestExtensionId, - BuildTestComponentPolicyPayload().SerializeAsString())); + BuildTestComponentPolicyPayload().SerializeAsString()); } void SetUpOnMainThread() override { @@ -386,7 +386,7 @@ builder->Build(); } - ash::LocalPolicyTestServerMixin local_policy_mixin_{&mixin_host_}; + ash::EmbeddedPolicyTestServerMixin policy_test_server_mixin_{&mixin_host_}; }; } // namespace
diff --git a/chrome/browser/ash/policy/handlers/system_proxy_handler.cc b/chrome/browser/ash/policy/handlers/system_proxy_handler.cc index f6a1989..ee8682b 100644 --- a/chrome/browser/ash/policy/handlers/system_proxy_handler.cc +++ b/chrome/browser/ash/policy/handlers/system_proxy_handler.cc
@@ -86,15 +86,15 @@ } void SystemProxyHandler::SetSystemProxyManagerForTesting( - chromeos::SystemProxyManager* system_proxy_manager) { + ash::SystemProxyManager* system_proxy_manager) { system_proxy_manager_for_testing_ = system_proxy_manager; } -chromeos::SystemProxyManager* SystemProxyHandler::GetSystemProxyManager() { +ash::SystemProxyManager* SystemProxyHandler::GetSystemProxyManager() { if (system_proxy_manager_for_testing_) { return system_proxy_manager_for_testing_; } - return chromeos::SystemProxyManager::Get(); + return ash::SystemProxyManager::Get(); } } // namespace policy
diff --git a/chrome/browser/ash/policy/handlers/system_proxy_handler.h b/chrome/browser/ash/policy/handlers/system_proxy_handler.h index 54f70a0b..04ec71e2 100644 --- a/chrome/browser/ash/policy/handlers/system_proxy_handler.h +++ b/chrome/browser/ash/policy/handlers/system_proxy_handler.h
@@ -8,7 +8,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/settings/cros_settings.h" -namespace chromeos { +namespace ash { class SystemProxyManager; } @@ -27,15 +27,15 @@ ~SystemProxyHandler(); void SetSystemProxyManagerForTesting( - chromeos::SystemProxyManager* system_proxy_manager); + ash::SystemProxyManager* system_proxy_manager); private: void OnSystemProxySettingsPolicyChanged(); - chromeos::SystemProxyManager* GetSystemProxyManager(); + ash::SystemProxyManager* GetSystemProxyManager(); // Owned by the test fixture. - chromeos::SystemProxyManager* system_proxy_manager_for_testing_ = nullptr; + ash::SystemProxyManager* system_proxy_manager_for_testing_ = nullptr; chromeos::CrosSettings* cros_settings_; base::CallbackListSubscription system_proxy_subscription_; };
diff --git a/chrome/browser/ash/policy/handlers/system_proxy_handler_unittest.cc b/chrome/browser/ash/policy/handlers/system_proxy_handler_unittest.cc index ed42c57..49c5e7b 100644 --- a/chrome/browser/ash/policy/handlers/system_proxy_handler_unittest.cc +++ b/chrome/browser/ash/policy/handlers/system_proxy_handler_unittest.cc
@@ -56,7 +56,7 @@ system_proxy_handler_ = std::make_unique<SystemProxyHandler>(ash::CrosSettings::Get()); system_proxy_manager_ = - std::make_unique<chromeos::SystemProxyManager>(local_state_.Get()); + std::make_unique<ash::SystemProxyManager>(local_state_.Get()); profile_ = std::make_unique<TestingProfile>(); system_proxy_manager_->StartObservingPrimaryProfilePrefs(profile_.get()); @@ -111,7 +111,7 @@ ash::ScopedDeviceSettingsTestHelper device_settings_test_helper_; chromeos::ScopedStubInstallAttributes test_install_attributes_; std::unique_ptr<SystemProxyHandler> system_proxy_handler_; - std::unique_ptr<chromeos::SystemProxyManager> system_proxy_manager_; + std::unique_ptr<ash::SystemProxyManager> system_proxy_manager_; }; // Verifies that authentication details are forwarded to system-proxy according
diff --git a/chrome/browser/ash/policy/networking/policy_certs_browsertest.cc b/chrome/browser/ash/policy/networking/policy_certs_browsertest.cc index 70c48258..8307de02 100644 --- a/chrome/browser/ash/policy/networking/policy_certs_browsertest.cc +++ b/chrome/browser/ash/policy/networking/policy_certs_browsertest.cc
@@ -20,7 +20,7 @@ #include "chrome/browser/ash/login/existing_user_controller.h" #include "chrome/browser/ash/login/helper.h" #include "chrome/browser/ash/login/startup_utils.h" -#include "chrome/browser/ash/login/test/local_policy_test_server_mixin.h" +#include "chrome/browser/ash/login/test/embedded_policy_test_server_mixin.h" #include "chrome/browser/ash/login/test/login_or_lock_screen_visible_waiter.h" #include "chrome/browser/ash/login/test/oobe_base_test.h" #include "chrome/browser/ash/login/test/oobe_screen_waiter.h" @@ -703,7 +703,7 @@ command_line->AppendSwitch(chromeos::switches::kOobeSkipPostLogin); } - ash::LocalPolicyTestServerMixin local_policy_mixin_{&mixin_host_}; + ash::EmbeddedPolicyTestServerMixin policy_test_server_mixin_{&mixin_host_}; const AccountId device_local_account_id_ = AccountId::FromUserEmail(GenerateDeviceLocalAccountUserId( @@ -731,9 +731,11 @@ account->set_type( em::DeviceLocalAccountInfoProto::ACCOUNT_TYPE_PUBLIC_SESSION); RefreshDevicePolicy(); - ASSERT_TRUE(local_policy_mixin_.UpdateDevicePolicy(proto)); + policy_test_server_mixin_.UpdateDevicePolicy(proto); } + // TODO(crbug/874831): Consider migrating to LoggedInMixin and deprecating + // this function. void StartLogin() { ash::WizardController::SkipPostLoginScreensForTesting(); auto* const wizard_controller = ash::WizardController::default_controller();
diff --git a/chrome/browser/ash/policy/reporting/metrics_reporting/network/https_latency_sampler_unittest.cc b/chrome/browser/ash/policy/reporting/metrics_reporting/network/https_latency_sampler_unittest.cc index c87c5b2..709e523 100644 --- a/chrome/browser/ash/policy/reporting/metrics_reporting/network/https_latency_sampler_unittest.cc +++ b/chrome/browser/ash/policy/reporting/metrics_reporting/network/https_latency_sampler_unittest.cc
@@ -20,7 +20,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h" -using ::chromeos::network_diagnostics::NetworkDiagnostics; +using ::ash::network_diagnostics::NetworkDiagnostics; using ::chromeos::network_diagnostics::mojom::HttpsLatencyResultValue; using ::chromeos::network_diagnostics::mojom::NetworkDiagnosticsRoutines; using ::chromeos::network_diagnostics::mojom::RoutineProblems;
diff --git a/chrome/browser/ash/system_logs/network_health_source.cc b/chrome/browser/ash/system_logs/network_health_source.cc index adf00d21..bdc4421 100644 --- a/chrome/browser/ash/system_logs/network_health_source.cc +++ b/chrome/browser/ash/system_logs/network_health_source.cc
@@ -174,10 +174,9 @@ NetworkHealthSource::NetworkHealthSource(bool scrub) : SystemLogsSource("NetworkHealth"), scrub_(scrub) { - chromeos::network_health::NetworkHealthService::GetInstance() - ->BindHealthReceiver( - network_health_service_.BindNewPipeAndPassReceiver()); - chromeos::network_health::NetworkHealthService::GetInstance() + ash::network_health::NetworkHealthService::GetInstance()->BindHealthReceiver( + network_health_service_.BindNewPipeAndPassReceiver()); + ash::network_health::NetworkHealthService::GetInstance() ->BindDiagnosticsReceiver( network_diagnostics_service_.BindNewPipeAndPassReceiver()); }
diff --git a/chrome/browser/ash/web_applications/crosh_loader.cc b/chrome/browser/ash/web_applications/crosh_loader.cc deleted file mode 100644 index 63908ff..0000000 --- a/chrome/browser/ash/web_applications/crosh_loader.cc +++ /dev/null
@@ -1,15 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ash/web_applications/crosh_loader.h" - -#include "chrome/browser/ash/web_applications/terminal_source.h" -#include "chrome/browser/profiles/profile.h" -#include "content/public/browser/url_data_source.h" - -CroshLoader::CroshLoader(Profile* profile) { - content::URLDataSource::Add(profile, TerminalSource::ForCrosh(profile)); -} - -CroshLoader::~CroshLoader() = default;
diff --git a/chrome/browser/ash/web_applications/crosh_loader.h b/chrome/browser/ash/web_applications/crosh_loader.h deleted file mode 100644 index a0e9cfe..0000000 --- a/chrome/browser/ash/web_applications/crosh_loader.h +++ /dev/null
@@ -1,23 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_ASH_WEB_APPLICATIONS_CROSH_LOADER_H_ -#define CHROME_BROWSER_ASH_WEB_APPLICATIONS_CROSH_LOADER_H_ - -#include "components/keyed_service/core/keyed_service.h" - -class Profile; - -// Loads crosh DataSource at startup. -// TODO(crbug.com/1080384): This service can be removed once chrome-untrusted -// has WebUIControllers. -class CroshLoader : public KeyedService { - public: - explicit CroshLoader(Profile* profile); - ~CroshLoader() override; - CroshLoader(const CroshLoader&) = delete; - CroshLoader& operator=(const CroshLoader&) = delete; -}; - -#endif // CHROME_BROWSER_ASH_WEB_APPLICATIONS_CROSH_LOADER_H_
diff --git a/chrome/browser/ash/web_applications/crosh_loader_factory.cc b/chrome/browser/ash/web_applications/crosh_loader_factory.cc deleted file mode 100644 index ac76f4a5..0000000 --- a/chrome/browser/ash/web_applications/crosh_loader_factory.cc +++ /dev/null
@@ -1,48 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ash/web_applications/crosh_loader_factory.h" - -#include "base/no_destructor.h" -#include "chrome/browser/ash/web_applications/crosh_loader.h" -#include "chrome/browser/profiles/incognito_helpers.h" -#include "chrome/browser/profiles/profile.h" -#include "components/keyed_service/content/browser_context_dependency_manager.h" - -// static -CroshLoader* CroshLoaderFactory::GetForProfile(Profile* profile) { - return static_cast<CroshLoader*>( - GetInstance()->GetServiceForBrowserContext(profile, true)); -} - -// static -CroshLoaderFactory* CroshLoaderFactory::GetInstance() { - static base::NoDestructor<CroshLoaderFactory> factory; - return factory.get(); -} - -CroshLoaderFactory::CroshLoaderFactory() - : BrowserContextKeyedServiceFactory( - "CroshLoader", - BrowserContextDependencyManager::GetInstance()) {} - -CroshLoaderFactory::~CroshLoaderFactory() = default; - -KeyedService* CroshLoaderFactory::BuildServiceInstanceFor( - content::BrowserContext* context) const { - return new CroshLoader(Profile::FromBrowserContext(context)); -} - -content::BrowserContext* CroshLoaderFactory::GetBrowserContextToUse( - content::BrowserContext* context) const { - return chrome::GetBrowserContextOwnInstanceInIncognito(context); -} - -bool CroshLoaderFactory::ServiceIsCreatedWithBrowserContext() const { - return true; -} - -bool CroshLoaderFactory::ServiceIsNULLWhileTesting() const { - return true; -}
diff --git a/chrome/browser/ash/web_applications/crosh_loader_factory.h b/chrome/browser/ash/web_applications/crosh_loader_factory.h deleted file mode 100644 index 51f706bb..0000000 --- a/chrome/browser/ash/web_applications/crosh_loader_factory.h +++ /dev/null
@@ -1,40 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_ASH_WEB_APPLICATIONS_CROSH_LOADER_FACTORY_H_ -#define CHROME_BROWSER_ASH_WEB_APPLICATIONS_CROSH_LOADER_FACTORY_H_ - -#include "base/no_destructor.h" -#include "components/keyed_service/content/browser_context_keyed_service_factory.h" - -namespace content { -class BrowserContext; -} - -class CroshLoader; -class Profile; - -class CroshLoaderFactory : public BrowserContextKeyedServiceFactory { - public: - static CroshLoader* GetForProfile(Profile* profile); - static CroshLoaderFactory* GetInstance(); - - private: - friend class base::NoDestructor<CroshLoaderFactory>; - - CroshLoaderFactory(); - ~CroshLoaderFactory() override; - CroshLoaderFactory(const CroshLoaderFactory&) = delete; - CroshLoaderFactory& operator=(const CroshLoaderFactory&) = delete; - - // BrowserContextKeyedServiceFactory: - KeyedService* BuildServiceInstanceFor( - content::BrowserContext* context) const override; - content::BrowserContext* GetBrowserContextToUse( - content::BrowserContext* context) const override; - bool ServiceIsCreatedWithBrowserContext() const override; - bool ServiceIsNULLWhileTesting() const override; -}; - -#endif // CHROME_BROWSER_ASH_WEB_APPLICATIONS_CROSH_LOADER_FACTORY_H_
diff --git a/chrome/browser/ash/web_applications/crosh_ui.cc b/chrome/browser/ash/web_applications/crosh_ui.cc new file mode 100644 index 0000000..fb5497db --- /dev/null +++ b/chrome/browser/ash/web_applications/crosh_ui.cc
@@ -0,0 +1,35 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/web_applications/crosh_ui.h" + +#include "chrome/browser/ash/web_applications/terminal_source.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/common/webui_url_constants.h" +#include "content/public/common/url_constants.h" +#include "url/gurl.h" + +CroshUIConfig::CroshUIConfig() + : WebUIConfig(content::kChromeUIUntrustedScheme, + chrome::kChromeUIUntrustedCroshHost) {} + +CroshUIConfig::~CroshUIConfig() = default; + +bool CroshUIConfig::IsWebUIEnabled(content::BrowserContext* browser_context) { + // TODO(b/210659944): Make logic depend on SystemFeaturesDisableList policy. + return true; +} + +std::unique_ptr<content::WebUIController> CroshUIConfig::CreateWebUIController( + content::WebUI* web_ui) { + return std::make_unique<CroshUI>(web_ui); +} + +CroshUI::CroshUI(content::WebUI* web_ui) + : ui::UntrustedWebUIController(web_ui) { + auto* profile = Profile::FromWebUI(web_ui); + content::URLDataSource::Add(profile, TerminalSource::ForCrosh(profile)); +} + +CroshUI::~CroshUI() = default;
diff --git a/chrome/browser/ash/web_applications/crosh_ui.h b/chrome/browser/ash/web_applications/crosh_ui.h new file mode 100644 index 0000000..603a633 --- /dev/null +++ b/chrome/browser/ash/web_applications/crosh_ui.h
@@ -0,0 +1,34 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ASH_WEB_APPLICATIONS_CROSH_UI_H_ +#define CHROME_BROWSER_ASH_WEB_APPLICATIONS_CROSH_UI_H_ + +#include "ui/webui/untrusted_web_ui_controller.h" +#include "ui/webui/webui_config.h" + +namespace content { +class WebUI; +} // namespace content + +// Loads DataSource at startup for Crosh (the Chromium OS shell). +class CroshUIConfig : public ui::WebUIConfig { + public: + CroshUIConfig(); + ~CroshUIConfig() override; + bool IsWebUIEnabled(content::BrowserContext* browser_context) override; + + std::unique_ptr<content::WebUIController> CreateWebUIController( + content::WebUI* web_ui) override; +}; + +class CroshUI : public ui::UntrustedWebUIController { + public: + explicit CroshUI(content::WebUI* web_ui); + CroshUI(const CroshUI&) = delete; + CroshUI& operator=(const CroshUI&) = delete; + ~CroshUI() override; +}; + +#endif // CHROME_BROWSER_ASH_WEB_APPLICATIONS_CROSH_UI_H_
diff --git a/chrome/browser/browser_process_platform_part_chromeos.cc b/chrome/browser/browser_process_platform_part_chromeos.cc index 9682d86..caf12b6c 100644 --- a/chrome/browser/browser_process_platform_part_chromeos.cc +++ b/chrome/browser/browser_process_platform_part_chromeos.cc
@@ -301,8 +301,8 @@ &BrowserProcessPlatformPart::ShutdownPrimaryProfileServices, base::Unretained(this))); - if (chromeos::SystemProxyManager::Get()) { - chromeos::SystemProxyManager::Get()->StartObservingPrimaryProfilePrefs( + if (ash::SystemProxyManager::Get()) { + ash::SystemProxyManager::Get()->StartObservingPrimaryProfilePrefs( primary_profile); } @@ -318,8 +318,8 @@ if (manager) manager->policy_service()->StopObservingPrimaryProfilePrefs(); - if (chromeos::SystemProxyManager::Get()) - chromeos::SystemProxyManager::Get()->StopObservingPrimaryProfilePrefs(); + if (ash::SystemProxyManager::Get()) + ash::SystemProxyManager::Get()->StopObservingPrimaryProfilePrefs(); in_session_password_change_manager_.reset(); } @@ -364,8 +364,8 @@ ash::SimpleGeolocationProvider::DefaultGeolocationProviderURL(), base::BindRepeating(&ash::system::ApplyTimeZone), base::BindRepeating( - &chromeos::DelayNetworkCall, - base::Milliseconds(chromeos::kDefaultNetworkRetryDelayMS)), + &ash::DelayNetworkCall, + base::Milliseconds(ash::kDefaultNetworkRetryDelayMS)), g_browser_process->local_state()); } return timezone_resolver_.get();
diff --git a/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc b/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc index 5582766..9f71481 100644 --- a/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc
@@ -1218,7 +1218,7 @@ // sends a request to System-proxy to clear the cached user credentials. IN_PROC_BROWSER_TEST_F(BrowsingDataRemoverBrowserTest, SystemProxyClearsUserCredentials) { - chromeos::SystemProxyManager::Get()->SetSystemProxyEnabledForTest(true); + ash::SystemProxyManager::Get()->SetSystemProxyEnabledForTest(true); EXPECT_EQ(0, chromeos::SystemProxyClient::Get() ->GetTestInterface() ->GetClearUserCredentialsCount());
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc index 9a6647fa..669e58f 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
@@ -815,7 +815,7 @@ } #if BUILDFLAG(IS_CHROMEOS_ASH) - if (chromeos::SystemProxyManager::Get()) { + if (ash::SystemProxyManager::Get()) { // Sends a request to the System-proxy daemon to clear the proxy user // credentials. System-proxy retrieves proxy username and password from // the NetworkService, but not the creation time of the credentials. The @@ -823,7 +823,7 @@ // credentials. If credentials prior to |delete_begin_| are removed from // System-proxy, the daemon will send a D-Bus request to Chrome to fetch // them from the NetworkService when needed. - chromeos::SystemProxyManager::Get()->ClearUserCredentials(); + ash::SystemProxyManager::Get()->ClearUserCredentials(); } #endif // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/chrome_browser_main_parts_lacros.cc b/chrome/browser/chrome_browser_main_parts_lacros.cc index 67d0ef2..72d86145 100644 --- a/chrome/browser/chrome_browser_main_parts_lacros.cc +++ b/chrome/browser/chrome_browser_main_parts_lacros.cc
@@ -41,6 +41,17 @@ return content::RESULT_CODE_NORMAL_EXIT; } +int ChromeBrowserMainPartsLacros::PreCreateThreads() { + const crosapi::mojom::BrowserInitParams* init_params = + chromeos::LacrosService::Get()->init_params(); + if (init_params->initial_browser_action == + crosapi::mojom::InitialBrowserAction::kDoNotOpenWindow) { + base::CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kNoStartupWindow); + } + return ChromeBrowserMainPartsLinux::PreCreateThreads(); +} + void ChromeBrowserMainPartsLacros::PreProfileInit() { ChromeBrowserMainPartsLinux::PreProfileInit();
diff --git a/chrome/browser/chrome_browser_main_parts_lacros.h b/chrome/browser/chrome_browser_main_parts_lacros.h index 2adc7ab..795d634 100644 --- a/chrome/browser/chrome_browser_main_parts_lacros.h +++ b/chrome/browser/chrome_browser_main_parts_lacros.h
@@ -24,6 +24,7 @@ // ChromeBrowserMainParts: int PreEarlyInitialization() override; + int PreCreateThreads() override; void PreProfileInit() override; void PostDestroyThreads() override;
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 649ade7..2ff56f7 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -5514,8 +5514,7 @@ bool first_auth_attempt, LoginAuthRequiredCallback auth_required_callback) { #if BUILDFLAG(IS_CHROMEOS_ASH) - chromeos::SystemProxyManager* system_proxy_manager = - chromeos::SystemProxyManager::Get(); + auto* system_proxy_manager = ash::SystemProxyManager::Get(); // For Managed Guest Session and Kiosk devices, the credentials configured // via the policy SystemProxySettings may be used for proxy authentication. // Note: |system_proxy_manager| may be missing in tests.
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index ffb4574..19f0da4 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -3157,12 +3157,10 @@ "../ash/web_applications/chrome_file_manager_ui_delegate.h", "../ash/web_applications/connectivity_diagnostics_system_web_app_info.cc", "../ash/web_applications/connectivity_diagnostics_system_web_app_info.h", - "../ash/web_applications/crosh_loader.cc", - "../ash/web_applications/crosh_loader.h", - "../ash/web_applications/crosh_loader_factory.cc", - "../ash/web_applications/crosh_loader_factory.h", "../ash/web_applications/crosh_system_web_app_info.cc", "../ash/web_applications/crosh_system_web_app_info.h", + "../ash/web_applications/crosh_ui.cc", + "../ash/web_applications/crosh_ui.h", "../ash/web_applications/diagnostics_system_web_app_info.cc", "../ash/web_applications/diagnostics_system_web_app_info.h", "../ash/web_applications/eche_app_info.cc",
diff --git a/chrome/browser/download/chrome_download_manager_delegate_unittest.cc b/chrome/browser/download/chrome_download_manager_delegate_unittest.cc index 741dadf..6afb70dc 100644 --- a/chrome/browser/download/chrome_download_manager_delegate_unittest.cc +++ b/chrome/browser/download/chrome_download_manager_delegate_unittest.cc
@@ -493,7 +493,7 @@ kInsecureDownloadHistogramTargetSecure, kInsecureDownloadHistogramTargetInsecure}; - std::vector<const std::string> histograms; + std::vector<std::string> histograms; for (auto* initiator_init : initiator_types) { for (auto* download_init : download_types) { histograms.push_back(
diff --git a/chrome/browser/download/download_target_determiner_unittest.cc b/chrome/browser/download/download_target_determiner_unittest.cc index cbc9f06..2020807 100644 --- a/chrome/browser/download/download_target_determiner_unittest.cc +++ b/chrome/browser/download/download_target_determiner_unittest.cc
@@ -2507,9 +2507,7 @@ }; // We use a slightly different test fixture for tests that touch plugins. SetUp -// needs to disable plugin discovery and we rely on the base class' -// ShadowingAtExitManager to discard the tainted PluginService. Unfortunately, -// PluginService carries global state. +// needs to disable plugin discovery. class DownloadTargetDeterminerTestWithPlugin : public DownloadTargetDeterminerTest { public:
diff --git a/chrome/browser/enterprise/connectors/file_system/service_settings_unittest.cc b/chrome/browser/enterprise/connectors/file_system/service_settings_unittest.cc index 659ce4f..675da4ad 100644 --- a/chrome/browser/enterprise/connectors/file_system/service_settings_unittest.cc +++ b/chrome/browser/enterprise/connectors/file_system/service_settings_unittest.cc
@@ -142,26 +142,26 @@ })"; std::set<std::string>* NormalMimeTypes() { - static base::NoDestructor<std::set<std::string>> mime_types( - {"text/plain", "image/png", "application/zip"}); + static base::NoDestructor<std::set<std::string>> mime_types{ + {"text/plain", "image/png", "application/zip"}}; return mime_types.get(); } std::set<std::string>* NoTextMimeTypes() { - static base::NoDestructor<std::set<std::string>> mime_types( - {"image/png", "application/zip"}); + static base::NoDestructor<std::set<std::string>> mime_types{ + {"image/png", "application/zip"}}; return mime_types.get(); } std::set<std::string>* NoImageMimeTypes() { - static base::NoDestructor<std::set<std::string>> mime_types( - {"text/plain", "application/zip"}); + static base::NoDestructor<std::set<std::string>> mime_types{ + {"text/plain", "application/zip"}}; return mime_types.get(); } std::set<std::string>* NoTextNoImageMimeTypes() { - static base::NoDestructor<std::set<std::string>> mime_types( - {"application/zip"}); + static base::NoDestructor<std::set<std::string>> mime_types{ + {"application/zip"}}; return mime_types.get(); }
diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc index 639716f1..8c5f93fe 100644 --- a/chrome/browser/extensions/api/identity/identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/identity_apitest.cc
@@ -121,12 +121,12 @@ ->network_state_handler() ->DefaultNetwork(); - auto* portal_detector = new chromeos::NetworkPortalDetectorTestImpl(); + auto* portal_detector = new ash::NetworkPortalDetectorTestImpl(); portal_detector->SetDefaultNetworkForTesting(default_network->guid()); portal_detector->SetDetectionResultsForTesting( default_network->guid(), - chromeos::NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204); + ash::NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204); chromeos::network_portal_detector::InitializeForTesting(portal_detector); }
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 6bbe91d2..5ecea7a 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -15,7 +15,6 @@ #include <utility> #include <vector> -#include "base/at_exit.h" #include "base/bind.h" #include "base/command_line.h" #include "base/cxx17_backports.h" @@ -6181,8 +6180,6 @@ }; TEST_F(ExtensionServiceTestSimple, Enabledness) { - // Make sure the PluginService singleton is destroyed at the end of the test. - base::ShadowingAtExitManager at_exit_manager; #if BUILDFLAG(ENABLE_PLUGINS) content::PluginService::GetInstance()->Init(); #endif
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 9c54e1d4..ad3f5de 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -2811,6 +2811,11 @@ "expiry_milestone": -1 }, { + "name": "enable-unicorn-account-support", + "owners": [ "fernandex" ], + "expiry_milestone": 106 + }, + { "name": "enable-universal-links", "owners": [ "avi", "olivierli" ], "expiry_milestone": 101
diff --git a/chrome/browser/media/webrtc/desktop_capture_access_handler.cc b/chrome/browser/media/webrtc/desktop_capture_access_handler.cc index 87acd71..4d3bcaa 100644 --- a/chrome/browser/media/webrtc/desktop_capture_access_handler.cc +++ b/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
@@ -168,6 +168,48 @@ return audio_permitted && audio_requested && audio_supported; } +// Returns whether the request is approved or not. Some extensions do not +// require user approval, because they provide their own user approval UI. For +// others, shows a message box and asks for user approval. +bool IsRequestApproved(content::WebContents* web_contents, + const content::MediaStreamRequest& request, + const extensions::Extension* extension, + bool is_allowlisted_extension) { + // Component extensions and some external extensions are approved by default. + if (extension && + (extension->location() == ManifestLocation::kComponent || + extension->location() == ManifestLocation::kExternalComponent || + is_allowlisted_extension)) { + return true; + } + + // chrome://feedback/ is allowed by default. + // The user can still decide whether the screenshot taken is shared or not. + if (request.security_origin.spec() == chrome::kChromeUIFeedbackURL) { + return true; + } + +#if !defined(OS_ANDROID) + gfx::NativeWindow parent_window = + FindParentWindowForWebContents(web_contents); +#else + gfx::NativeWindow parent_window = nullptr; +#endif + const std::u16string application_name = base::UTF8ToUTF16( + extension ? extension->name() : request.security_origin.spec()); + const std::u16string confirmation_text = l10n_util::GetStringFUTF16( + request.audio_type == blink::mojom::MediaStreamType::NO_SERVICE + ? IDS_MEDIA_SCREEN_CAPTURE_CONFIRMATION_TEXT + : IDS_MEDIA_SCREEN_AND_AUDIO_CAPTURE_CONFIRMATION_TEXT, + application_name); + const chrome::MessageBoxResult mb_result = chrome::ShowQuestionMessageBoxSync( + parent_window, + l10n_util::GetStringFUTF16(IDS_MEDIA_SCREEN_CAPTURE_CONFIRMATION_TITLE, + application_name), + confirmation_text); + return mb_result == chrome::MESSAGE_BOX_RESULT_YES; +} + } // namespace DesktopCaptureAccessHandler::DesktopCaptureAccessHandler() @@ -194,11 +236,13 @@ UpdateExtensionTrusted(request, IsExtensionAllowedForScreenCapture(extension)); + const bool is_allowlisted_extension = + IsExtensionAllowedForScreenCapture(extension); + const bool screen_capture_enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableUserMediaScreenCapturing) || - IsExtensionAllowedForScreenCapture(extension) || - IsBuiltInFeedbackUI(request.security_origin); + is_allowlisted_extension || IsBuiltInFeedbackUI(request.security_origin); const bool origin_is_secure = network::IsUrlPotentiallyTrustworthy(request.security_origin) || @@ -212,7 +256,8 @@ return; } - if (!IsRequestApproved(web_contents, request, extension)) { + if (!IsRequestApproved(web_contents, request, extension, + is_allowlisted_extension)) { std::move(callback).Run( blink::MediaStreamDevices(), blink::mojom::MediaStreamRequestResult::PERMISSION_DENIED, nullptr); @@ -272,51 +317,6 @@ std::move(ui)); } -bool DesktopCaptureAccessHandler::IsDefaultApproved( - const extensions::Extension* extension) { - return extension && - (extension->location() == ManifestLocation::kComponent || - extension->location() == ManifestLocation::kExternalComponent || - IsExtensionAllowedForScreenCapture(extension)); -} - -bool DesktopCaptureAccessHandler::IsDefaultApproved(const GURL& url) { - // allow the Feedback WebUI chrome://feedback/ to take screenshot without - // user's approval. The screenshot will not be shared by default. So the - // user can still decide whether the screenshot taken is shared or not. - return url.spec() == chrome::kChromeUIFeedbackURL; -} - -bool DesktopCaptureAccessHandler::IsRequestApproved( - content::WebContents* web_contents, - const content::MediaStreamRequest& request, - const extensions::Extension* extension) { -#if !defined(OS_ANDROID) - gfx::NativeWindow parent_window = - FindParentWindowForWebContents(web_contents); -#else - gfx::NativeWindow parent_window = nullptr; -#endif - - if (IsDefaultApproved(extension) || - IsDefaultApproved(request.security_origin)) - return true; - - const std::u16string application_name = base::UTF8ToUTF16( - extension ? extension->name() : request.security_origin.spec()); - const std::u16string confirmation_text = l10n_util::GetStringFUTF16( - request.audio_type == blink::mojom::MediaStreamType::NO_SERVICE - ? IDS_MEDIA_SCREEN_CAPTURE_CONFIRMATION_TEXT - : IDS_MEDIA_SCREEN_AND_AUDIO_CAPTURE_CONFIRMATION_TEXT, - application_name); - const chrome::MessageBoxResult mb_result = chrome::ShowQuestionMessageBoxSync( - parent_window, - l10n_util::GetStringFUTF16(IDS_MEDIA_SCREEN_CAPTURE_CONFIRMATION_TITLE, - application_name), - confirmation_text); - return mb_result == chrome::MESSAGE_BOX_RESULT_YES; -} - bool DesktopCaptureAccessHandler::SupportsStreamType( content::WebContents* web_contents, const blink::mojom::MediaStreamType type,
diff --git a/chrome/browser/media/webrtc/desktop_capture_access_handler.h b/chrome/browser/media/webrtc/desktop_capture_access_handler.h index 06ae1ef..0ccc2915 100644 --- a/chrome/browser/media/webrtc/desktop_capture_access_handler.h +++ b/chrome/browser/media/webrtc/desktop_capture_access_handler.h
@@ -73,22 +73,6 @@ content::MediaResponseCallback callback, const extensions::Extension* extension); - // Returns whether desktop capture is always approved for |extension|. - // Currently component extensions and some external extensions are default - // approved. - static bool IsDefaultApproved(const extensions::Extension* extension); - - // Returns whether desktop capture is always approved for |url|. - // Currently chrome://feedback/ is default approved. - static bool IsDefaultApproved(const GURL& url); - - // Returns whether the request is approved or not. Some extensions do not - // require user approval, because they provide their own user approval UI. For - // others, shows a message box and asks for user approval. - static bool IsRequestApproved(content::WebContents* web_contents, - const content::MediaStreamRequest& request, - const extensions::Extension* extension); - // WebContentsCollection::Observer: void WebContentsDestroyed(content::WebContents* web_contents) override;
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 91990009b..ed5af8a1 100644 --- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc +++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
@@ -220,20 +220,13 @@ base::UmaHistogramBoolean("Windows.ApplockerRunning", IsApplockerRunning()); #endif // defined(OS_WIN) - // TODO(crbug.com/1216328) Remove logging. - LOG(ERROR) << "START: ReportBluetoothAvailability(). " - "If you don't see the END: message, this is crbug.com/1216328."; bluetooth_utility::ReportBluetoothAvailability(); - LOG(ERROR) << "END: ReportBluetoothAvailability()"; // Record whether Chrome is the default browser or not. // Disabled on Linux due to hanging browser tests, see crbug.com/1216328. #if !BUILDFLAG(IS_LINUX) - LOG(ERROR) << "START: GetDefaultBrowser(). " - "If you don't see the END: message, this is crbug.com/1216328."; shell_integration::DefaultWebClientState default_state = shell_integration::GetDefaultBrowser(); - LOG(ERROR) << "END: GetDefaultBrowser()"; base::UmaHistogramEnumeration("DefaultBrowser.State", default_state, shell_integration::NUM_DEFAULT_STATES); #endif // !BUILDFLAG(IS_LINUX)
diff --git a/chrome/browser/net/network_request_metrics_browsertest.cc b/chrome/browser/net/network_request_metrics_browsertest.cc index 35843bd..6f07c721 100644 --- a/chrome/browser/net/network_request_metrics_browsertest.cc +++ b/chrome/browser/net/network_request_metrics_browsertest.cc
@@ -361,13 +361,13 @@ NetErrorBeforeHeaders) { TestNavigationObserver navigation_observer(active_web_contents(), 1); StartNavigatingAndWaitForRequest(); - // Not sending any body will result in failing with ERR_EMPTY_RESPONSE, - // without receiving any headers so the load won't be committed until the - // error page is seen. + interesting_http_response()->Send( + "HTTP/1.1 200 OK\r\nContent-Length: 42\r\nContent-Length: 43\r\n\r\n"); interesting_http_response()->Done(); navigation_observer.Wait(); - CheckHistograms(net::ERR_EMPTY_RESPONSE, HeadersReceived::kNoHeadersReceived, + CheckHistograms(net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH, + HeadersReceived::kNoHeadersReceived, NetworkAccessed::kNetworkAccessed); }
diff --git a/chrome/browser/net/profile_network_context_service.cc b/chrome/browser/net/profile_network_context_service.cc index c052559..23196e16 100644 --- a/chrome/browser/net/profile_network_context_service.cc +++ b/chrome/browser/net/profile_network_context_service.cc
@@ -583,7 +583,7 @@ // dependency is explicit. See https://crbug.com/1018972. profile_->GetResourceContext(); - return std::make_unique<chromeos::ClientCertStoreAsh>( + return std::make_unique<ash::ClientCertStoreAsh>( std::move(certificate_provider), use_system_key_slot, username_hash, base::BindRepeating(&CreateCryptoModuleBlockingPasswordDelegate, kCryptoModulePasswordClientAuth));
diff --git a/chrome/browser/net/proxy_browsertest.cc b/chrome/browser/net/proxy_browsertest.cc index ecf485d4..075a92c 100644 --- a/chrome/browser/net/proxy_browsertest.cc +++ b/chrome/browser/net/proxy_browsertest.cc
@@ -196,12 +196,12 @@ void SetUp() override { ASSERT_TRUE(http_server_.Start()); pac_url_ = http_server_.GetURL("/" + GetPacFilename()); - chromeos::DhcpWpadUrlClient::SetPacUrlForTesting(pac_url_); + ash::DhcpWpadUrlClient::SetPacUrlForTesting(pac_url_); InProcessBrowserTest::SetUp(); } void TearDown() override { - chromeos::DhcpWpadUrlClient::ClearPacUrlForTesting(); + ash::DhcpWpadUrlClient::ClearPacUrlForTesting(); InProcessBrowserTest::TearDown(); }
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc index 0681644..d36a448 100644 --- a/chrome/browser/net/system_network_context_manager.cc +++ b/chrome/browser/net/system_network_context_manager.cc
@@ -664,7 +664,7 @@ ChromeMojoProxyResolverFactory::CreateWithSelfOwnedReceiver(); #if BUILDFLAG(IS_CHROMEOS_ASH) network_context_params->dhcp_wpad_url_client = - chromeos::DhcpWpadUrlClient::CreateWithSelfOwnedReceiver(); + ash::DhcpWpadUrlClient::CreateWithSelfOwnedReceiver(); #endif // BUILDFLAG(IS_CHROMEOS_ASH) } }
diff --git a/chrome/browser/page_load_metrics/observers/README.md b/chrome/browser/page_load_metrics/observers/README.md index 99ebe5b..525bccb 100644 --- a/chrome/browser/page_load_metrics/observers/README.md +++ b/chrome/browser/page_load_metrics/observers/README.md
@@ -41,6 +41,10 @@ network. For example, a navigation may fail because hostname resolution fails, or because establishing a connection to the server fails, among other reasons. * There can be at most one committed load in a frame at any given time. +* However, a committed load can be placed in the Back/Forward Cache (BFCache), + whereupon it is frozen, and another load can commit in the same frame, while + the original committed load is still 'live' (but frozen). Note that not every + page is eligible to be placed in the BFCache. * There is typically at most one provisional load in a frame at any given time, though there can be two provisional page loads in a frame in uncommon cases. @@ -60,7 +64,9 @@ * The hosting `WebContents` (a `WebContents` is essentially a browser tab) is destroyed * The navigation fails to commit -* Another navigation in the frame commits and replaces the committed load, for page loads that committed (note: the documentation needs to be updated here for bfcache). +* Another navigation in the frame commits and replaces the committed load, for page loads that committed, but are not eligible to enter the Back/Forward cache. +* The page is placed in the Back/Forward Cache, and the `PageLoadMetricsObserver` in question responds to the resulting `OnEnterBackForwardCache` callback with `STOP_OBSERVING`. +* The page is placed in the Back/Forward Cache, and is evicted without being restored. ### Example: `PageLoadMetricsObserver` lifetimes, for a WebContents with 3 page loads @@ -145,6 +151,17 @@ * `OnUserInput` is invoked as user input events are received. * `OnLoadingBehaviorObserved` is invoked as certain page loading behaviors are observed. See the section on loading behaviors below for additional information. + * `OnEnterBackForwardCache` is invoked if the page will enter the Back/Forward + cache. Observers may return `STOP_OBSERVING` from this callback if they do + not wish to continue logging after a page has entered the BFCache, and this + is the default implementation for `PageLoadMetricsObserver` (it will also + call `OnComplete` at this time). + * `OnRestoreFromBackForwardCache` is invoked when the page is restored from + the Back/Forward cache. This callback is invoked with a `NavigationHandle` + which will have a different navigation ID to the original page load's. + Whether metrics should be logged using this new navigation ID, or the + original page load's ID, depends on the desired interpretation of the + metrics. ## Which page loads are tracked by `PageLoadMetricsObserver`s?
diff --git a/chrome/browser/password_manager/android/password_store_android_backend.cc b/chrome/browser/password_manager/android/password_store_android_backend.cc index ed19b9a6..10bca890 100644 --- a/chrome/browser/password_manager/android/password_store_android_backend.cc +++ b/chrome/browser/password_manager/android/password_store_android_backend.cc
@@ -185,6 +185,40 @@ } } +class PasswordStoreAndroidBackend::ClearAllLocalPasswordsMetricRecorder { + public: + explicit ClearAllLocalPasswordsMetricRecorder( + PasswordStoreAndroidBackend::MetricsRecorder metrics_recorder) + : metrics_recorder_(std::move(metrics_recorder)) {} + + void OnAllRemovalsFinished() { + metrics_recorder_.RecordMetrics(/*success=*/true, /*error=*/absl::nullopt); + base::UmaHistogramCounts1M( + "PasswordManager.PasswordStoreAndroidBackend.ClearAllLocalPasswords." + "LoginsToRemove", + total_count_); + if (total_count_ != 0) { + size_t success_rate = + 100 * (total_count_ - failure_count_) / total_count_; + base::UmaHistogramPercentage( + "PasswordManager.PasswordStoreAndroidBackend.ClearAllLocalPasswords." + "SuccessRate", + success_rate); + } + } + + void OnLoginRemoved(absl::optional<PasswordStoreChangeList> change_list) { + if (change_list && change_list.value().empty()) + failure_count_++; + total_count_++; + } + + private: + int total_count_ = 0; + int failure_count_ = 0; + MetricsRecorder metrics_recorder_; +}; + PasswordStoreAndroidBackend::JobReturnHandler::JobReturnHandler() = default; PasswordStoreAndroidBackend::JobReturnHandler::JobReturnHandler( @@ -521,26 +555,45 @@ void PasswordStoreAndroidBackend::ClearAllLocalPasswords() { LoginsOrErrorReply cleaning_callback = base::BindOnce( [](base::WeakPtr<PasswordStoreAndroidBackend> weak_self, + MetricsRecorder metrics_recorder, LoginsResultOrError logins_or_error) { - if (!weak_self || - absl::holds_alternative<PasswordStoreBackendError>(logins_or_error)) + if (!weak_self || absl::holds_alternative<PasswordStoreBackendError>( + logins_or_error)) { + metrics_recorder.RecordMetrics(/*success=*/false, + /*error=*/absl::nullopt); return; + } - base::OnceClosure callbacks_chain = base::DoNothing(); + auto detailed_metric_recorder = + std::make_unique<ClearAllLocalPasswordsMetricRecorder>( + std::move(metrics_recorder)); + + raw_ptr<ClearAllLocalPasswordsMetricRecorder> raw_recorder = + detailed_metric_recorder.get(); + + base::OnceClosure callbacks_chain = base::BindOnce( + &ClearAllLocalPasswordsMetricRecorder::OnAllRemovalsFinished, + std::move(detailed_metric_recorder)); for (const auto& login : absl::get<LoginsResult>(logins_or_error)) { + base::OnceCallback record_removal_result = base::BindOnce( + &ClearAllLocalPasswordsMetricRecorder::OnLoginRemoved, + // This is safe because |detailed_metric_recorder| will be deleted + // only after all removals are finished. + base::Unretained(raw_recorder)); + callbacks_chain = base::BindOnce( &PasswordStoreAndroidBackend::RemoveLoginForTarget, weak_self, std::move(*login), PasswordStoreOperationTarget::kLocalStorage, - IgnoreChangeListAndRunCallback(std::move(callbacks_chain))); + std::move(record_removal_result) + .Then(std::move(callbacks_chain))); } std::move(callbacks_chain).Run(); }, - weak_ptr_factory_.GetWeakPtr()); + weak_ptr_factory_.GetWeakPtr(), + MetricsRecorder(MetricInfix("ClearAllLocalPasswords"))); - // TODO(https://crbug.com/1278748) Record whether the operation was - // successful. GetAllLoginsForTarget(PasswordStoreOperationTarget::kLocalStorage, std::move(cleaning_callback)); }
diff --git a/chrome/browser/password_manager/android/password_store_android_backend.h b/chrome/browser/password_manager/android/password_store_android_backend.h index f9b242a..b46b399 100644 --- a/chrome/browser/password_manager/android/password_store_android_backend.h +++ b/chrome/browser/password_manager/android/password_store_android_backend.h
@@ -109,6 +109,8 @@ base::Time start_ = base::Time::Now(); }; + class ClearAllLocalPasswordsMetricRecorder; + // Wraps the handler for an asynchronous job (if successful) and invokes the // supplied metrics recorded upon completion. An object of this type shall be // created and stored in |request_for_job_| once an asynchronous begins, and
diff --git a/chrome/browser/password_manager/android/password_store_android_backend_unittest.cc b/chrome/browser/password_manager/android/password_store_android_backend_unittest.cc index 0c01630..4837923 100644 --- a/chrome/browser/password_manager/android/password_store_android_backend_unittest.cc +++ b/chrome/browser/password_manager/android/password_store_android_backend_unittest.cc
@@ -556,6 +556,9 @@ } TEST_F(PasswordStoreAndroidBackendTest, RemoveAllLocalLogins) { + base::HistogramTester histogram_tester; + constexpr auto kLatencyDelta = base::Milliseconds(123u); + backend().InitBackend(PasswordStoreAndroidBackend::RemoteChangesReceived(), base::RepeatingClosure(), base::DoNothing()); @@ -575,8 +578,76 @@ RemoveLogin(form_to_delete, PasswordStoreOperationTarget::kLocalStorage)) .WillOnce(Return(kRemoveLoginJobId)); + task_environment_.FastForwardBy(kLatencyDelta); consumer().OnCompleteWithLogins(kGetLoginsJobId, {form_to_delete}); RunUntilIdle(); + + task_environment_.FastForwardBy(kLatencyDelta); + consumer().OnLoginsChanged(kRemoveLoginJobId, PasswordStoreChangeList()); + RunUntilIdle(); + + histogram_tester.ExpectTimeBucketCount( + "PasswordManager.PasswordStoreAndroidBackend." + "ClearAllLocalPasswords." + "Latency", + kLatencyDelta * 2, 1); + + histogram_tester.ExpectTotalCount( + "PasswordManager.PasswordStoreAndroidBackend." + "ClearAllLocalPasswords." + "Success", + 1); +} + +TEST_F(PasswordStoreAndroidBackendTest, RemoveAllLocalLoginsSuccessMetrics) { + base::HistogramTester histogram_tester; + backend().InitBackend(PasswordStoreAndroidBackend::RemoteChangesReceived(), + base::RepeatingClosure(), base::DoNothing()); + + base::MockCallback<LoginsReply> mock_logins_reply; + const JobId kGetLoginsJobId{13387}; + EXPECT_CALL(*bridge(), + GetAllLogins(PasswordStoreOperationTarget::kLocalStorage)) + .WillOnce(Return(kGetLoginsJobId)); + backend().ClearAllLocalPasswords(); + + // Imitate login retrieval and check that it triggers the removal of forms. + const JobId kRemoveLoginJobId1{13388}, kRemoveLoginJobId2{13389}; + PasswordForm form = CreateTestLogin(kTestUsername, kTestPassword, kTestUrl, + base::Time::FromTimeT(1500)); + EXPECT_CALL(*bridge(), RemoveLogin).WillOnce(Return(kRemoveLoginJobId1)); + + // Simulate GetLoginAsync returns two identical logins + consumer().OnCompleteWithLogins(kGetLoginsJobId, {form, form}); + RunUntilIdle(); + testing::Mock::VerifyAndClearExpectations(bridge()); + + PasswordStoreChangeList changes = { + PasswordStoreChange(PasswordStoreChange::REMOVE, form)}; + // Receiving callback after removing the first login should trigger + // removal of the second login. + EXPECT_CALL(*bridge(), RemoveLogin).WillOnce(Return(kRemoveLoginJobId2)); + consumer().OnLoginsChanged(kRemoveLoginJobId1, changes); + RunUntilIdle(); + testing::Mock::VerifyAndClearExpectations(bridge()); + + // Simulate that the second removal failed. + consumer().OnError( + kRemoveLoginJobId2, + AndroidBackendError(AndroidBackendErrorType::kUncategorized)); + RunUntilIdle(); + + const char kTotalCountMetric[] = + "PasswordManager.PasswordStoreAndroidBackend.ClearAllLocalPasswords." + "LoginsToRemove"; + const char kSuccessRateMetric[] = + "PasswordManager.PasswordStoreAndroidBackend.ClearAllLocalPasswords." + "SuccessRate"; + + histogram_tester.ExpectTotalCount(kTotalCountMetric, 1); + histogram_tester.ExpectUniqueSample(kTotalCountMetric, 2, 1); + histogram_tester.ExpectTotalCount(kSuccessRateMetric, 1); + histogram_tester.ExpectUniqueSample(kSuccessRateMetric, 50, 1); } class PasswordStoreAndroidBackendTestForMetrics
diff --git a/chrome/browser/plugins/plugin_info_host_impl_unittest.cc b/chrome/browser/plugins/plugin_info_host_impl_unittest.cc index da39a8a..80c3a399 100644 --- a/chrome/browser/plugins/plugin_info_host_impl_unittest.cc +++ b/chrome/browser/plugins/plugin_info_host_impl_unittest.cc
@@ -4,7 +4,9 @@ #include "chrome/browser/plugins/plugin_info_host_impl.h" -#include "base/at_exit.h" +#include <map> +#include <utility> + #include "base/bind.h" #include "base/callback_helpers.h" #include "base/memory/raw_ptr.h" @@ -131,7 +133,6 @@ FakePluginServiceFilter filter_; private: - base::ShadowingAtExitManager at_exit_manager_; // Destroys the PluginService. content::BrowserTaskEnvironment task_environment; TestingProfile profile_; PluginInfoHostImpl::Context context_;
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index fb4d668c..e64a2fb5 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc
@@ -1073,7 +1073,7 @@ ash::login::SecurityTokenSessionController::RegisterLocalStatePrefs(registry); ash::MultiProfileUserController::RegisterPrefs(registry); chromeos::NetworkMetadataStore::RegisterPrefs(registry); - chromeos::NetworkThrottlingObserver::RegisterPrefs(registry); + ash::NetworkThrottlingObserver::RegisterPrefs(registry); ash::PowerMetricsReporter::RegisterLocalStatePrefs(registry); ash::platform_keys::KeyPermissionsManagerImpl::RegisterLocalStatePrefs( registry); @@ -1424,7 +1424,7 @@ policy::ExtensionInstallEventLogManagerWrapper::RegisterProfilePrefs( registry); policy::StatusCollector::RegisterProfilePrefs(registry); - chromeos::SystemProxyManager::RegisterProfilePrefs(registry); + ash::SystemProxyManager::RegisterProfilePrefs(registry); ChromeShelfPrefs::RegisterProfilePrefs(registry); ::onc::RegisterProfilePrefs(registry); ash::cert_provisioning::RegisterProfilePrefs(registry);
diff --git a/chrome/browser/resources/browser_switch/app.ts b/chrome/browser/resources/browser_switch/app.ts index 1a44751..1d763bfd 100644 --- a/chrome/browser/resources/browser_switch/app.ts +++ b/chrome/browser/resources/browser_switch/app.ts
@@ -114,28 +114,29 @@ private computeTitle_(): string { if (this.error_) { - return this.i18n('errorTitle', getBrowserName()); + return this.i18n('errorTitle', getAltBrowserName()); } if (this.secondCounter_ > 0) { - return this.i18n('countdownTitle', this.secondCounter_, getBrowserName()); + return this.i18n( + 'countdownTitle', this.secondCounter_, getAltBrowserName()); } - return this.i18n('openingTitle', getBrowserName()); + return this.i18n('openingTitle', getAltBrowserName()); } private computeDescription_(): string { if (this.error_) { return this.i18n( - this.error_, getUrlHostname(this.url_), getBrowserName()); + this.error_, getUrlHostname(this.url_), getAltBrowserName()); } return this.i18n( - 'description', getUrlHostname(this.url_), getBrowserName()); + 'description', getUrlHostname(this.url_), getAltBrowserName()); } } customElements.define(BrowserSwitchAppElement.is, BrowserSwitchAppElement); -function getBrowserName(): string { - return loadTimeData.getString('browserName'); +function getAltBrowserName(): string { + return loadTimeData.getString('altBrowserName'); } function getUrlHostname(url: string): string {
diff --git a/chrome/browser/resources/chromeos/login/BUILD.gn b/chrome/browser/resources/chromeos/login/BUILD.gn index e0ece14..bcb54f2 100644 --- a/chrome/browser/resources/chromeos/login/BUILD.gn +++ b/chrome/browser/resources/chromeos/login/BUILD.gn
@@ -98,6 +98,7 @@ "images/settings_gear.svg", "images/sync-consent.svg", "images/update_boot.svg", + "images/cfm/enrollment.svg", "images/cfm/welcome.svg", "images/update-antivirus.svg", "images/update-apps.svg", @@ -122,13 +123,14 @@ out_manifest = "$target_gen_dir/$existing_unconditional_files_manifest" in_files = [ "cr_ui.html", + "display_manager.html", "i18n_setup.js", "keyboard_utils.html", + "login_ui_tools.html", "oobe.css", "oobe_polymer3.js", "oobe_popup_overlay.css", "oobe_screen.css", - "login_ui_tools.html", "components/behaviors/i18n_setup.html", "components/behaviors/login_screen_behavior.html", "components/behaviors/login_screen_behavior.js", @@ -204,6 +206,7 @@ "components/throbber_notice.js", "components/web_view_helper.html", "components/web_view_loader.html", + "gaia_auth_host/authenticator.html", "screens/common/adb_sideloading.html", "screens/common/adb_sideloading.js", "screens/common/app_downloading.html", @@ -226,6 +229,8 @@ "screens/common/family_link_notice.js", "screens/common/fingerprint_setup.html", "screens/common/fingerprint_setup.js", + "screens/common/gaia_signin.html", + "screens/common/gaia_signin.js", "screens/common/gesture_navigation.html", "screens/common/gesture_navigation.js", "screens/common/guest_tos.html", @@ -286,6 +291,8 @@ "screens/oobe/demo_setup.js", "screens/oobe/enable_debugging.html", "screens/oobe/enable_debugging.js", + "screens/oobe/enterprise_enrollment.html", + "screens/oobe/enterprise_enrollment.js", "screens/oobe/hid_detection.html", "screens/oobe/hid_detection.js", "screens/oobe/update.html", @@ -389,6 +396,7 @@ "screens/common/error_message.m.js", "screens/common/family_link_notice.m.js", "screens/common/fingerprint_setup.m.js", + "screens/common/gaia_signin.m.js", "screens/common/gesture_navigation.m.js", "screens/common/guest_tos.m.js", "screens/common/hw_data_collection.m.js", @@ -418,6 +426,7 @@ "screens/oobe/demo_preferences.m.js", "screens/oobe/demo_setup.m.js", "screens/oobe/enable_debugging.m.js", + "screens/oobe/enterprise_enrollment.m.js", "screens/oobe/hid_detection.m.js", "screens/oobe/oobe_eula.m.js", "screens/oobe/oobe_network.m.js", @@ -498,24 +507,6 @@ js_library("login_ui_tools") { } -# TODO(crbug.com/1184731) - Add this to a group once migrated. -js_library("enterprise_enrollment") { - deps = [ - # TODO(crbug.com/1184731) - Uncomment once this screen is migrated. - # ":offline_ad_login", - "../keyboard:keyboard_utils", - "components:display_manager_types", - "components:fake_authenticator", - "components:fake_oobe", - "components/behaviors:login_screen_behavior", - "components/behaviors:multi_step_behavior", - "components/buttons:oobe_back_button", - "components/buttons:oobe_next_button", - "components/buttons:oobe_text_button", - "//ui/webui/resources/js:cr", - ] -} - js_library("multidevice_setup_first_run") { deps = [ "components/behaviors:oobe_i18n_behavior",
diff --git a/chrome/browser/resources/chromeos/login/components/BUILD.gn b/chrome/browser/resources/chromeos/login/components/BUILD.gn index 6141d42..d717480 100644 --- a/chrome/browser/resources/chromeos/login/components/BUILD.gn +++ b/chrome/browser/resources/chromeos/login/components/BUILD.gn
@@ -173,12 +173,12 @@ js_library("gaia_dialog.m") { sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/login/components/gaia_dialog.m.js" ] deps = [ + "../../../gaia_auth_host:authenticator.m", "./behaviors:oobe_dialog_host_behavior.m", "./behaviors:oobe_i18n_behavior.m", "./buttons:oobe_back_button.m", "./buttons:oobe_text_button.m", "./dialogs:oobe_content_dialog.m", - "//chrome/browser/resources/gaia_auth_host:authenticator.m", "//ui/webui/resources/js:cr.m", ] extra_deps = [ ":gaia_dialog_module" ] @@ -290,7 +290,10 @@ js_library("security_token_pin.m") { sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/login/components/security_token_pin.m.js" ] - deps = [ "./behaviors:oobe_i18n_behavior" ] + deps = [ + ":oobe_types.m", + "./behaviors:oobe_i18n_behavior", + ] extra_deps = [ ":security_token_pin_module" ] }
diff --git a/chrome/browser/resources/chromeos/login/components/behaviors/BUILD.gn b/chrome/browser/resources/chromeos/login/components/behaviors/BUILD.gn index 87743de..a9f3b86 100644 --- a/chrome/browser/resources/chromeos/login/components/behaviors/BUILD.gn +++ b/chrome/browser/resources/chromeos/login/components/behaviors/BUILD.gn
@@ -4,16 +4,17 @@ import("//third_party/closure_compiler/compile_js.gni") import("//ui/webui/resources/tools/js_modulizer.gni") +import("../../oobe_auto_imports.gni") js_type_check("closure_compile") { uses_legacy_modules = true deps = [ + ":login_screen_behavior", + ":multi_step_behavior", ":oobe_dialog_host_behavior", ":oobe_focus_behavior", ":oobe_i18n_behavior", ":oobe_scrollable_behavior", - ":login_screen_behavior", - ":multi_step_behavior", ] } @@ -29,7 +30,6 @@ ] } - js_library("oobe_dialog_host_behavior") { } @@ -90,7 +90,7 @@ sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/login/components/behaviors/oobe_i18n_behavior.m.js" ] deps = [ "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", - "//ui/webui/resources/js:i18n_behavior.m" + "//ui/webui/resources/js:i18n_behavior.m", ] extra_deps = [ ":modulize" ] } @@ -112,7 +112,5 @@ "oobe_i18n_behavior.js", "oobe_scrollable_behavior.js", ] - namespace_rewrites = [ - "cr.ui.login.invokePolymerMethod|invokePolymerMethod", - ] + namespace_rewrites = oobe_namespace_rewrites }
diff --git a/chrome/browser/resources/chromeos/login/components/gaia_dialog.html b/chrome/browser/resources/chromeos/login/components/gaia_dialog.html index 71633e9..1d9c8098 100644 --- a/chrome/browser/resources/chromeos/login/components/gaia_dialog.html +++ b/chrome/browser/resources/chromeos/login/components/gaia_dialog.html
@@ -8,6 +8,7 @@ <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="../../../gaia_auth_host/authenticator.html"> <link rel="import" href="./behaviors/oobe_dialog_host_behavior.html"> <link rel="import" href="./behaviors/oobe_i18n_behavior.html"> <link rel="import" href="./buttons/oobe_back_button.html">
diff --git a/chrome/browser/resources/chromeos/login/components/gaia_dialog.js b/chrome/browser/resources/chromeos/login/components/gaia_dialog.js index 68240629..6dadb85e 100644 --- a/chrome/browser/resources/chromeos/login/components/gaia_dialog.js +++ b/chrome/browser/resources/chromeos/login/components/gaia_dialog.js
@@ -13,7 +13,6 @@ * @constructor * @extends {PolymerElement} * @implements {OobeI18nBehaviorInterface} - * @implements {OobeDialogHostBehaviorInterface} */ const GaiaDialogBase = Polymer.mixinBehaviors( [OobeI18nBehavior, OobeDialogHostBehavior], Polymer.Element); @@ -187,7 +186,7 @@ /** @override */ ready() { super.ready(); - const webview = this.$['signin-frame']; + const webview = /** @type {!WebView} */ (this.$['signin-frame']); this.authenticator_ = new cr.login.Authenticator(webview); /** * Event listeners for the events triggered by the authenticator.
diff --git a/chrome/browser/resources/chromeos/login/components/oobe_types.js b/chrome/browser/resources/chromeos/login/components/oobe_types.js index d863b0a..533f1c1 100644 --- a/chrome/browser/resources/chromeos/login/components/oobe_types.js +++ b/chrome/browser/resources/chromeos/login/components/oobe_types.js
@@ -145,3 +145,24 @@ MISSING_GAIA_INFO: 3, CUSTOM: 4, }; + +/** + * Screen steps used by EnterpriseEnrollmentElement. Defined here to + * avoid circular dependencies since it is needed by cr_ui.js + * @enum {string} + */ +OobeTypes.EnrollmentStep = { + SIGNIN: 'signin', + AD_JOIN: 'ad-join', + WORKING: 'working', + ATTRIBUTE_PROMPT: 'attribute-prompt', + ERROR: 'error', + SUCCESS: 'success', + CHECKING: 'checking', + TPM_CHECKING: 'tpm-checking', + + /* TODO(dzhioev): define this step on C++ side. + */ + ATTRIBUTE_PROMPT_ERROR: 'attribute-prompt-error', + ACTIVE_DIRECTORY_JOIN_ERROR: 'active-directory-join-error', +};
diff --git a/chrome/browser/resources/chromeos/login/components/security_token_pin.html b/chrome/browser/resources/chromeos/login/components/security_token_pin.html index 48e5dfe9..809c2e23 100644 --- a/chrome/browser/resources/chromeos/login/components/security_token_pin.html +++ b/chrome/browser/resources/chromeos/login/components/security_token_pin.html
@@ -5,9 +5,12 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> +<link rel="import" href="chrome://resources/cr_components/chromeos/quick_unlock/pin_keyboard.html"> <link rel="import" href="chrome://resources/cr_elements/icons.html"> + <link rel="import" href="./oobe_icons.html"> +<link rel="import" href="./oobe_types.html"> <link rel="import" href="./behaviors/oobe_dialog_host_behavior.html"> <link rel="import" href="./behaviors/oobe_i18n_behavior.html"> <link rel="import" href="./buttons/oobe_back_button.html">
diff --git a/chrome/browser/resources/chromeos/login/components/security_token_pin.js b/chrome/browser/resources/chromeos/login/components/security_token_pin.js index 5594690..e3a2a611 100644 --- a/chrome/browser/resources/chromeos/login/components/security_token_pin.js +++ b/chrome/browser/resources/chromeos/login/components/security_token_pin.js
@@ -13,11 +13,13 @@ * @constructor * @extends {PolymerElement} * @implements {OobeI18nBehaviorInterface} - * @implements {OobeDialogHostBehaviorInterface} */ const SecurityTokenPinBase = Polymer.mixinBehaviors( [OobeI18nBehavior, OobeDialogHostBehavior], Polymer.Element); +/** + * @polymer + */ class SecurityTokenPin extends SecurityTokenPinBase { static get is() { return 'security-token-pin';
diff --git a/chrome/browser/resources/chromeos/login/cr_ui.js b/chrome/browser/resources/chromeos/login/cr_ui.js index f53908c..559e59a 100644 --- a/chrome/browser/resources/chromeos/login/cr_ui.js +++ b/chrome/browser/resources/chromeos/login/cr_ui.js
@@ -295,25 +295,19 @@ * Returns true if enrollment was successful. Dismisses the enrollment * attribute screen if it's present. * - * TODO(crbug.com/1111387) - Remove inline values from - * ENROLLMENT_STEP once fully migrated to JS modules. - * * @suppress {missingProperties} * $('enterprise-enrollment').uiStep * TODO(crbug.com/1229130) - Remove this suppression. */ static isEnrollmentSuccessfulForTest() { const step = $('enterprise-enrollment').uiStep; - // See [ENROLLMENT_STEP.ATTRIBUTE_PROMPT] - // from c/b/r/chromeos/login/enterprise_enrollment.js - if (step === 'attribute-prompt') { + // TODO(crbug.com/1229130) - Improve this check. + if (step === OobeTypes.EnrollmentStep.ATTRIBUTE_PROMPT) { chrome.send('oauthEnrollAttributes', ['', '']); return true; } - // See [ENROLLMENT_STEP.SUCCESS] - // from c/b/r/chromeos/login/enterprise_enrollment.js - return step === 'success'; + return step === OobeTypes.EnrollmentStep.SUCCESS; } /**
diff --git a/chrome/browser/resources/chromeos/login/display_manager.html b/chrome/browser/resources/chromeos/login/display_manager.html new file mode 100644 index 0000000..a6abfce3 --- /dev/null +++ b/chrome/browser/resources/chromeos/login/display_manager.html
@@ -0,0 +1,9 @@ +<!-- Copyright 2021 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. --> + +<!-- This is just a dummy file to assist with the Polymer3 migration. + Adding this file as an import will force the Polymer3 version of + the file to add the directive: + - `import {DisplayManager, invokePolymerMethod} from '.../display_manager.m.js';` +--> \ No newline at end of file
diff --git a/chrome/browser/resources/chromeos/login/gaia_auth_host/authenticator.html b/chrome/browser/resources/chromeos/login/gaia_auth_host/authenticator.html new file mode 100644 index 0000000..302f5ec --- /dev/null +++ b/chrome/browser/resources/chromeos/login/gaia_auth_host/authenticator.html
@@ -0,0 +1,9 @@ +<!-- Copyright 2021 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. --> + +<!-- This is just a dummy file to assist with the Polymer3 migration. + Adding this file as an import will force the Polymer3 version of + the file to add the directive: + - `import {Authenticator, AuthFlow, AuthMode, SUPPORTED_PARAMS} from '.../authenticator.m.js';` +--> \ No newline at end of file
diff --git a/chrome/browser/resources/chromeos/login/md_login.html b/chrome/browser/resources/chromeos/login/md_login.html index e9777d6..f7535ca 100644 --- a/chrome/browser/resources/chromeos/login/md_login.html +++ b/chrome/browser/resources/chromeos/login/md_login.html
@@ -11,7 +11,6 @@ <!-- This must be the first import in all login pages. --> <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="chrome://resources/cr_components/chromeos/quick_unlock/pin_keyboard.html"> <link rel="stylesheet" href="chrome://resources/chromeos/colors/cros_styles.css"> <link rel="stylesheet" href="chrome://resources/css/butter_bar.css"> <link rel="stylesheet" href="chrome://resources/css/list.css">
diff --git a/chrome/browser/resources/chromeos/login/md_login_polymer3.html b/chrome/browser/resources/chromeos/login/md_login_polymer3.html index 7cdc1f3..ae4fc4a 100644 --- a/chrome/browser/resources/chromeos/login/md_login_polymer3.html +++ b/chrome/browser/resources/chromeos/login/md_login_polymer3.html
@@ -46,6 +46,8 @@ </gesture-navigation-element> <pin-setup-element id="pin-setup" class="step hidden" hidden> </pin-setup-element> + <gaia-signin-element id="gaia-signin" class="step hidden" hidden> + </gaia-signin-element> <marketing-opt-in-element id="marketing-opt-in" class="step hidden" hidden> </marketing-opt-in-element> <family-link-notice-element id="family-link-notice" class="step hidden" hidden>
diff --git a/chrome/browser/resources/chromeos/login/oobe.html b/chrome/browser/resources/chromeos/login/oobe.html index 2da9ece..c6639c1 100644 --- a/chrome/browser/resources/chromeos/login/oobe.html +++ b/chrome/browser/resources/chromeos/login/oobe.html
@@ -11,8 +11,6 @@ <!-- This must be the first import in all login pages. --> <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="chrome://resources/cr_components/chromeos/quick_unlock/pin_keyboard.html"> - <link rel="stylesheet" href="chrome://resources/chromeos/colors/cros_styles.css"> <link rel="stylesheet" href="chrome://resources/css/butter_bar.css"> <link rel="stylesheet" href="chrome://resources/css/list.css"> @@ -57,6 +55,7 @@ <script defer src="chrome://oobe/test_api.js"></script> <script src="chrome://oobe/keyboard_utils.js"></script> +<script src="chrome://oobe/components/keyboard_utils_for_injection.js"></script> <link rel="import" href="/components/behaviors/i18n_setup.html"> <link rel="import" href="chrome://oobe/custom_elements.html">
diff --git a/chrome/browser/resources/chromeos/login/oobe_auto_imports.gni b/chrome/browser/resources/chromeos/login/oobe_auto_imports.gni index 54e8ee0..cf8dd23d 100644 --- a/chrome/browser/resources/chromeos/login/oobe_auto_imports.gni +++ b/chrome/browser/resources/chromeos/login/oobe_auto_imports.gni
@@ -39,26 +39,28 @@ "chrome/browser/resources/chromeos/login/components/behaviors/oobe_scrollable_behavior.html|OobeScrollableBehavior", "chrome/browser/resources/chromeos/login/components/behaviors/login_screen_behavior.html|LoginScreenBehavior,LoginScreenBehaviorInterface", "chrome/browser/resources/chromeos/login/components/behaviors/multi_step_behavior.html|MultiStepBehavior,MultiStepBehaviorInterface", - "chrome/browser/resources/chromeos/login/components/display_manager_types.html|OOBE_UI_STATE", + "chrome/browser/resources/chromeos/login/components/display_manager_types.html|OOBE_UI_STATE,SCREEN_GAIA_SIGNIN", "chrome/browser/resources/chromeos/login/components/long_touch_detector.html|LongTouchDetector", "chrome/browser/resources/chromeos/login/components/network_select_login.html|NetworkSelectLogin", "chrome/browser/resources/chromeos/login/components/oobe_select.html|getSelectedValue,getSelectedTitle,SelectListType,setupSelect", "chrome/browser/resources/chromeos/login/components/oobe_types.html|OobeTypes", "chrome/browser/resources/chromeos/login/components/oobe_a11y_option.html|OobeA11yOption", "chrome/browser/resources/chromeos/login/components/web_view_helper.html|WebViewHelper", - "chrome/browser/resources/chromeos/login/screens/oobe/welcome_dialog.html|OobeWelcomeDialog", "chrome/browser/resources/chromeos/login/components/web_view_loader.html|WebViewLoader", "chrome/browser/resources/chromeos/login/screens/common/offline_ad_login.html|ActiveDirectoryErrorState,ADLoginStep,JoinConfigType", "chrome/browser/resources/chromeos/login/screens/login/checking_downloading_update.html|CheckingDownloadingUpdate", "chrome/browser/resources/chromeos/login/screens/oobe/welcome_dialog.html|OobeWelcomeDialog", "chrome/browser/resources/chromeos/login/cr_ui.html|Oobe", + "chrome/browser/resources/chromeos/login/display_manager.html|DisplayManager,invokePolymerMethod", "chrome/browser/resources/chromeos/login/keyboard_utils.html|keyboard", "chrome/browser/resources/chromeos/login/login_ui_tools.html|addSubmitListener", + "chrome/browser/resources/gaia_auth_host/authenticator.html|Authenticator,AuthFlow,AuthMode,AuthParams,SUPPORTED_PARAMS", "ui/webui/resources/cr_components/chromeos/network/mojo_interface_provider.html|MojoInterfaceProviderImpl", "ui/webui/resources/cr_components/chromeos/network/network_list_types.html|NetworkList", "ui/webui/resources/cr_components/chromeos/network/onc_mojo.html|OncMojo", "ui/webui/resources/cr_components/chromeos/quick_unlock/lock_screen_constants.html|recordLockScreenProgress", "ui/webui/resources/html/assert.html|assert,assertNotReached", + "ui/webui/resources/html/cr.html|sendWithPromise,removeWebUIListener,addWebUIListener,WebUIListener", "ui/webui/resources/html/parse_html_subset.html|SanitizeInnerHtmlOpts,sanitizeInnerHtml", "ui/webui/resources/html/polymer.html|afterNextRender,Polymer,PolymerElement,html,flush,mixinBehaviors,dom", "ui/webui/resources/html/util.html|announceAccessibleMessage,ensureTransitionEndEvent", @@ -71,4 +73,9 @@ "network_config.MojoInterfaceProviderImpl|MojoInterfaceProviderImpl", "settings.recordLockScreenProgress|recordLockScreenProgress", "cr.ui.LoginUITools.addSubmitListener|addSubmitListener", + "cr.ui.login.invokePolymerMethod|invokePolymerMethod", + "cr.login.Authenticator.AuthFlow|AuthFlow", + "cr.login.Authenticator.AuthMode|AuthMode", + "cr.login.Authenticator.SUPPORTED_PARAMS|SUPPORTED_PARAMS", + "cr.login.Authenticator|Authenticator", ]
diff --git a/chrome/browser/resources/chromeos/login/oobe_polymer3.html b/chrome/browser/resources/chromeos/login/oobe_polymer3.html index 05a5fec..9dbcc5e7 100644 --- a/chrome/browser/resources/chromeos/login/oobe_polymer3.html +++ b/chrome/browser/resources/chromeos/login/oobe_polymer3.html
@@ -56,6 +56,8 @@ </oobe-eula-element> <pin-setup-element id="pin-setup" class="step hidden" hidden> </pin-setup-element> + <gaia-signin-element id="gaia-signin" class="step hidden" hidden> + </gaia-signin-element> <wrong-hwid-element id="wrong-hwid" class="step hidden" hidden> </wrong-hwid-element> <app-launch-splash-element id="app-launch-splash" class="step hidden" hidden> @@ -66,6 +68,8 @@ </arc-tos-element> <app-downloading-element id="app-downloading" class="step hidden" hidden> </app-downloading-element> + <enterprise-enrollment-element id="enterprise-enrollment" class="step hidden" hidden> + </enterprise-enrollment-element> <fingerprint-setup-element id="fingerprint-setup" class="step hidden" hidden> </fingerprint-setup-element> <parental-handoff-element id="parental-handoff" class="step hidden" hidden>
diff --git a/chrome/browser/resources/chromeos/login/oobe_polymer3.js b/chrome/browser/resources/chromeos/login/oobe_polymer3.js index 49580dd..a5247fd51 100644 --- a/chrome/browser/resources/chromeos/login/oobe_polymer3.js +++ b/chrome/browser/resources/chromeos/login/oobe_polymer3.js
@@ -3,6 +3,7 @@ // found in the LICENSE file. import {Oobe} from './cr_ui.m.js'; +import {invokePolymerMethod} from './display_manager.m.js'; import {DebuggerUI} from './debug/debug.m.js'; import {loadTimeData} from './i18n_setup.js'; import 'chrome://oobe/components/test_util.m.js'; @@ -20,6 +21,7 @@ import 'chrome://oobe/screens/common/error_message.m.js'; import 'chrome://oobe/screens/common/family_link_notice.m.js'; import 'chrome://oobe/screens/common/fingerprint_setup.m.js'; +import 'chrome://oobe/screens/common/gaia_signin.m.js'; import 'chrome://oobe/screens/common/gesture_navigation.m.js'; import 'chrome://oobe/screens/common/guest_tos.m.js'; import 'chrome://oobe/screens/common/hw_data_collection.m.js'; @@ -48,6 +50,7 @@ import 'chrome://oobe/screens/oobe/demo_preferences.m.js'; import 'chrome://oobe/screens/oobe/demo_setup.m.js'; import 'chrome://oobe/screens/oobe/enable_debugging.m.js'; +import 'chrome://oobe/screens/oobe/enterprise_enrollment.m.js'; import 'chrome://oobe/screens/oobe/hid_detection.m.js'; import 'chrome://oobe/screens/oobe/oobe_eula.m.js'; import 'chrome://oobe/screens/oobe/oobe_network.m.js'; @@ -70,9 +73,13 @@ globalValue.cr = {}; } if (globalValue.cr.ui == undefined) { - globalValue.cr.ui = {}; + globalValue.cr.ui = {}; + } + if (globalValue.cr.ui.login == undefined) { + globalValue.cr.ui.login = {}; } + // Expose some values in the global object that are needed by OOBE. globalValue.cr.ui.Oobe = Oobe; globalValue.Oobe = Oobe; }
diff --git a/chrome/browser/resources/chromeos/login/screens/common/BUILD.gn b/chrome/browser/resources/chromeos/login/screens/common/BUILD.gn index 4cbea955..343fbf023f 100644 --- a/chrome/browser/resources/chromeos/login/screens/common/BUILD.gn +++ b/chrome/browser/resources/chromeos/login/screens/common/BUILD.gn
@@ -23,6 +23,7 @@ ":error_message_module", ":family_link_notice_module", ":fingerprint_setup_module", + ":gaia_signin_module", ":gesture_navigation_module", ":guest_tos_module", ":hw_data_collection_module", @@ -62,6 +63,7 @@ ":error_message.m", ":family_link_notice.m", ":fingerprint_setup.m", + ":gaia_signin.m", ":gesture_navigation.m", ":guest_tos.m", ":hw_data_collection.m", @@ -250,6 +252,23 @@ extra_deps = [ ":gesture_navigation_module" ] } +js_library("gaia_signin.m") { + sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/login/screens/common/gaia_signin.m.js" ] + deps = [ + "../..:display_manager.m", + "../../components:gaia_dialog.m", + "../../components:notification_card.m", + "../../components:oobe_types.m", + "../../components:security_token_pin.m", + "../../components/behaviors:login_screen_behavior.m", + "../../components/behaviors:multi_step_behavior.m", + "../../components/behaviors:oobe_i18n_behavior.m", + "../../components/dialogs:oobe_adaptive_dialog.m", + "//ui/webui/resources/js:cr.m", + ] + extra_deps = [ ":gaia_signin_module" ] +} + js_library("guest_tos.m") { sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/login/screens/common/guest_tos.m.js" ] deps = [ @@ -606,6 +625,14 @@ namespace_rewrites = oobe_namespace_rewrites } +polymer_modulizer("gaia_signin") { + js_file = "gaia_signin.js" + html_file = "gaia_signin.html" + html_type = "dom-module" + auto_imports = oobe_auto_imports + namespace_rewrites = oobe_namespace_rewrites +} + polymer_modulizer("gesture_navigation") { js_file = "gesture_navigation.js" html_file = "gesture_navigation.html"
diff --git a/chrome/browser/resources/chromeos/login/screen_gaia_signin.html b/chrome/browser/resources/chromeos/login/screens/common/gaia_signin.html similarity index 71% rename from chrome/browser/resources/chromeos/login/screen_gaia_signin.html rename to chrome/browser/resources/chromeos/login/screens/common/gaia_signin.html index 4b5c9e03..5fee73d 100644 --- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.html +++ b/chrome/browser/resources/chromeos/login/screens/common/gaia_signin.html
@@ -4,21 +4,32 @@ <link rel="import" href="chrome://resources/html/polymer.html"> + <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/html/action_link.html"> +<link rel="import" href="chrome://resources/html/assert.html"> +<link rel="import" href="chrome://resources/html/cr.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> -<link rel="import" href="/components/oobe_icons.html"> -<link rel="import" href="/components/behaviors/login_screen_behavior.html"> -<link rel="import" href="/components/behaviors/multi_step_behavior.html"> -<link rel="import" href="/components/behaviors/oobe_i18n_behavior.html"> -<link rel="import" href="/components/buttons/oobe_back_button.html"> -<link rel="import" href="/components/buttons/oobe_next_button.html"> -<link rel="import" href="/components/common_styles/common_styles.html"> -<link rel="import" href="/components/common_styles/oobe_dialog_host_styles.html"> -<link rel="import" href="/components/dialogs/oobe_adaptive_dialog.html"> -<link rel="import" href="/components/dialogs/oobe_loading_dialog.html"> -<link rel="import" href="/components/throbber_notice.html"> +<link rel="import" href="../../../../gaia_auth_host/authenticator.html"> +<link rel="import" href="../../cr_ui.html"> +<link rel="import" href="../../display_manager.html"> +<link rel="import" href="../../components/display_manager_types.html"> +<link rel="import" href="../../components/notification_card.html"> +<link rel="import" href="../../components/security_token_pin.html"> +<link rel="import" href="../../components/gaia_dialog.html"> +<link rel="import" href="../../components/oobe_icons.html"> +<link rel="import" href="../../components/oobe_types.html"> +<link rel="import" href="../../components/behaviors/login_screen_behavior.html"> +<link rel="import" href="../../components/behaviors/multi_step_behavior.html"> +<link rel="import" href="../../components/behaviors/oobe_i18n_behavior.html"> +<link rel="import" href="../../components/buttons/oobe_back_button.html"> +<link rel="import" href="../../components/buttons/oobe_next_button.html"> +<link rel="import" href="../../components/common_styles/common_styles.html"> +<link rel="import" href="../../components/common_styles/oobe_dialog_host_styles.html"> +<link rel="import" href="../../components/dialogs/oobe_adaptive_dialog.html"> +<link rel="import" href="../../components/dialogs/oobe_loading_dialog.html"> +<link rel="import" href="../../components/throbber_notice.html"> <dom-module id="gaia-signin-element"> <template> @@ -101,4 +112,5 @@ link-label="[[i18nDynamic(locale, 'learnMoreButton')]]"> </notification-card> </template> + <script src="gaia_signin.js"></script> </dom-module>
diff --git a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js b/chrome/browser/resources/chromeos/login/screens/common/gaia_signin.js similarity index 76% rename from chrome/browser/resources/chromeos/login/screen_gaia_signin.js rename to chrome/browser/resources/chromeos/login/screens/common/gaia_signin.js index 6a66c52..6c9471d 100644 --- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js +++ b/chrome/browser/resources/chromeos/login/screens/common/gaia_signin.js
@@ -6,9 +6,7 @@ * @fileoverview Oobe signin screen implementation. */ -'use strict'; - -(function() { +/* #js_imports_placeholder */ // GAIA animation guard timer. Started when GAIA page is loaded (Authenticator // 'ready' event) and is intended to guard against edge cases when 'showView' @@ -30,7 +28,7 @@ * The authentication mode for the screen. * @enum {number} */ -const AuthMode = { +const ScreenAuthMode = { DEFAULT: 0, // Default GAIA login flow. SAML_INTERSTITIAL: 1, // Interstitial page before SAML redirection. }; @@ -54,261 +52,280 @@ const POSSIBLE_FIRST_SIGNIN_STEPS = [DialogMode.GAIA, DialogMode.GAIA_LOADING, DialogMode.SAML_INTERSTITIAL]; -Polymer({ - is: 'gaia-signin-element', +/** + * @constructor + * @extends {PolymerElement} + * @implements {LoginScreenBehaviorInterface} + * @implements {MultiStepBehaviorInterface} + * @implements {OobeI18nBehaviorInterface} + */ +const GaiaSigninElementBase = Polymer.mixinBehaviors( + [OobeI18nBehavior, LoginScreenBehavior, MultiStepBehavior], + Polymer.Element); - behaviors: [ - OobeI18nBehavior, - LoginScreenBehavior, - MultiStepBehavior, - ], +/** + * @polymer + */ +class GaiaSigninElement extends GaiaSigninElementBase { + static get is() { + return 'gaia-signin-element'; + } - EXTERNAL_API: [ - 'loadAuthExtension', - 'doReload', - 'showAllowlistCheckFailedError', - 'showPinDialog', - 'closePinDialog', - 'clickPrimaryButtonForTesting', - ], + /* #html_template_placeholder */ - properties: { + static get properties() { + return { + /** + * Current mode of this screen. + * @private + */ + screenMode_: { + type: Number, + value: ScreenAuthMode.DEFAULT, + }, + + /** + * Whether the screen contents are currently being loaded. + * @private + */ + loadingFrameContents_: { + type: Boolean, + value: false, + }, + + /** + * Whether the loading UI is shown. + * @private + */ + isLoadingUiShown_: { + type: Boolean, + computed: 'computeIsLoadingUiShown_(loadingFrameContents_, ' + + 'isAllowlistErrorShown_, authCompleted_)', + }, + + /** + * Whether the loading allowlist error UI is shown. + * @private + */ + isAllowlistErrorShown_: { + type: Boolean, + value: false, + }, + + /** + * Whether the navigation controls are enabled. + * @private + */ + navigationEnabled_: { + type: Boolean, + value: true, + }, + + /** + * Whether the authenticator is currently in the |SAML| AuthFlow. + * @private + */ + isSaml_: { + type: Boolean, + value: false, + observer: 'onSamlChanged_', + }, + + /** + * Whether the authenticator is or has been in the |SAML| AuthFlow during + * the current authentication attempt. + * @private + */ + usedSaml_: { + type: Boolean, + value: false, + }, + + /** + * Management domain or admin displayed on SAML interstitial page. + * @private + */ + samlInterstitialDomainManager_: { + type: String, + value: null, + }, + + /** + * Contains the security token PIN dialog parameters object when the + * dialog is shown. Is null when no PIN dialog is shown. + * @type {?OobeTypes.SecurityTokenPinDialogParameters} + * @private + */ + pinDialogParameters_: { + type: Object, + value: null, + observer: 'onPinDialogParametersChanged_', + }, + + /** + * Whether the SAML 3rd-party page is visible. + * @private + */ + isSamlSsoVisible_: { + type: Boolean, + computed: 'computeSamlSsoVisible_(isSaml_, pinDialogParameters_)', + }, + + /** + * Bound to gaia-dialog::videoEnabled. + * @private + */ + videoEnabled_: { + type: Boolean, + observer: 'onVideoEnabledChange_', + }, + + /** + * Bound to gaia-dialog::authFlow. + * @private + */ + authFlow: { + type: Number, + observer: 'onAuthFlowChange_', + }, + + /** + * @private + */ + navigationButtonsHidden_: { + type: Boolean, + value: false, + }, + + /** + * Bound to gaia-dialog::canGoBack. + * @private + */ + canGaiaGoBack_: { + type: Boolean, + }, + + /* + * Updates whether the Guest and Apps button is allowed to be shown. + * (Note that the C++ side contains additional logic that decides whether + * the Guest button should be shown.) + * @private + */ + isFirstSigninStep_: { + type: Boolean, + computed: 'isFirstSigninStep(uiStep, canGaiaGoBack_, isSaml_)', + observer: 'onIsFirstSigninStepChanged' + }, + + /* + * Whether the screen is shown. + * @private + */ + isShown_: { + type: Boolean, + value: false, + }, + }; + } + + constructor() { + super(); + /** + * Saved authenticator load params. + * @type {?Object} + * @private + */ + this.authenticatorParams_ = null; /** - * Current mode of this screen. + * Email of the user, which is logging in using offline mode. + * @type {string} * @private */ - screenMode_: { - type: Number, - value: AuthMode.DEFAULT, - }, + this.email_ = ''; /** - * Whether the screen contents are currently being loaded. + * Timer id of pending load. + * @type {number|undefined} * @private */ - loadingFrameContents_: { - type: Boolean, - value: false, - }, + this.loadingTimer_ = undefined; /** - * Whether the loading UI is shown. + * Timer id of a guard timer that is fired in case 'showView' message is not + * received from GAIA. + * @type {number|undefined} * @private */ - isLoadingUiShown_: { - type: Boolean, - computed: 'computeIsLoadingUiShown_(loadingFrameContents_, ' + - 'isAllowlistErrorShown_, authCompleted_)', - }, + this.loadAnimationGuardTimer_ = undefined; /** - * Whether the loading allowlist error UI is shown. + * Timer id of the video login timer. + * @type {number|undefined} * @private */ - isAllowlistErrorShown_: { - type: Boolean, - value: false, - }, + this.videoTimer_ = undefined; /** - * Whether the navigation controls are enabled. + * Whether we've processed 'showView' message - either from GAIA or from + * guard timer. + * @type {boolean} * @private */ - navigationEnabled_: { - type: Boolean, - value: true, - }, + this.showViewProcessed_ = false; /** - * Whether the authenticator is currently in the |SAML| AuthFlow. + * Whether we've processed 'authCompleted' message. + * @type {boolean} * @private */ - isSaml_: { - type: Boolean, - value: false, - observer: 'onSamlChanged_', - }, + this.authCompleted_ = false; /** - * Whether the authenticator is or has been in the |SAML| AuthFlow during - * the current authentication attempt. + * SAML password confirmation attempt count. + * @type {number} * @private */ - usedSaml_: { - type: Boolean, - value: false, - }, + this.samlPasswordConfirmAttempt_ = 0; /** - * Management domain or admin displayed on SAML interstitial page. + * Whether the result was reported to the handler for the most recent PIN + * dialog. + * @type {boolean} * @private */ - samlInterstitialDomainManager_: { - type: String, - value: null, - }, + this.pinDialogResultReported_ = false; + } - /** - * Contains the security token PIN dialog parameters object when the dialog - * is shown. Is null when no PIN dialog is shown. - * @type {OobeTypes.SecurityTokenPinDialogParameter} - * @private - */ - pinDialogParameters_: { - type: Object, - value: null, - observer: 'onPinDialogParametersChanged_', - }, + get EXTERNAL_API() { + return [ + 'loadAuthExtension', 'doReload', 'showAllowlistCheckFailedError', + 'showPinDialog', 'closePinDialog', 'clickPrimaryButtonForTesting' + ]; + } - /** - * Whether the SAML 3rd-party page is visible. - * @private - */ - isSamlSsoVisible_: { - type: Boolean, - computed: 'computeSamlSsoVisible_(isSaml_, pinDialogParameters_)', - }, - - /** - * Bound to gaia-dialog::videoEnabled. - * @private - */ - videoEnabled_: { - type: Boolean, - observer: 'onVideoEnabledChange_', - }, - - /** - * Bound to gaia-dialog::authFlow. - * @private - */ - authFlow: { - type: Number, - observer: 'onAuthFlowChange_', - }, - - /** - * @private - */ - navigationButtonsHidden_: { - type: Boolean, - value: false, - }, - - /** - * Bound to gaia-dialog::canGoBack. - * @private - */ - canGaiaGoBack_: { - type: Boolean, - }, - - /* - * Updates whether the Guest and Apps button is allowed to be shown. - * (Note that the C++ side contains additional logic that decides whether - * the Guest button should be shown.) - * @private - */ - isFirstSigninStep_: { - type: Boolean, - computed: 'isFirstSigninStep(uiStep, canGaiaGoBack_, isSaml_)', - observer: 'onIsFirstSigninStepChanged' - }, - - /* - * Whether the screen is shown. - * @private - */ - isShown_: { - type: Boolean, - value: false, - }, - }, - - observers: [ - 'refreshDialogStep_(isShown_, screenMode_, pinDialogParameters_,' + - 'isLoadingUiShown_, isAllowlistErrorShown_)', - ], - - /** - * Saved authenticator load params. - * @type {?string} - * @private - */ - authenticatorParams_: null, - - /** - * Email of the user, which is logging in using offline mode. - * @type {string} - * @private - */ - email_: '', - - /** - * Timer id of pending load. - * @type {number} - * @private - */ - loadingTimer_: undefined, - - /** - * Timer id of a guard timer that is fired in case 'showView' message is not - * received from GAIA. - * @type {number} - * @private - */ - loadAnimationGuardTimer_: undefined, - - /** - * Timer id of the video login timer. - * @type {number} - * @private - */ - videoTimer_: undefined, - - /** - * Whether we've processed 'showView' message - either from GAIA or from - * guard timer. - * @type {boolean} - * @private - */ - showViewProcessed_: false, - - /** - * Whether we've processed 'authCompleted' message. - * @type {boolean} - * @private - */ - authCompleted_: false, - - /** - * SAML password confirmation attempt count. - * @type {number} - * @private - */ - samlPasswordConfirmAttempt_: 0, - - /** - * Whether the result was reported to the handler for the most recent PIN - * dialog. - * @type {boolean} - * @private - */ - pinDialogResultReported_: false, + static get observers() { + return [ + 'refreshDialogStep_(isShown_, screenMode_, pinDialogParameters_,' + + 'isLoadingUiShown_, isAllowlistErrorShown_)', + ]; + } defaultUIStep() { return DialogMode.GAIA; - }, + } - UI_STEPS: DialogMode, + get UI_STEPS() { + return DialogMode; + } get authenticator_() { return this.$['signin-frame-dialog'].getAuthenticator(); - }, + } /** @override */ ready() { + super.ready(); this.authenticator_.confirmPasswordCallback = this.onAuthConfirmPassword_.bind(this); this.authenticator_.onePasswordCallback = @@ -335,7 +352,7 @@ this.initializeLoginScreen('GaiaSigninScreen', { resetAllowed: true, }); - }, + } /** * Whether the dialog could be closed. @@ -346,7 +363,7 @@ */ isClosable_() { return Oobe.getInstance().hasUserPods; - }, + } /** * Updates whether the Guest and Apps button is allowed to be shown. (Note @@ -358,11 +375,11 @@ return !this.isClosable_() && POSSIBLE_FIRST_SIGNIN_STEPS.includes(uiStep) && !canGaiaGoBack && !isSaml; - }, + } onIsFirstSigninStepChanged(isFirstSigninStep) { chrome.send('setIsFirstSigninStep', [isFirstSigninStep]); - }, + } /** * Handles clicks on "Back" button. @@ -372,11 +389,11 @@ if (!this.authCompleted_) { this.cancel(true /* isBackClicked */); } - }, + } onInterstitialBackButtonClicked_() { this.cancel(true /* isBackClicked */); - }, + } /** * Handles user closes the dialog on the SAML page. @@ -384,7 +401,7 @@ */ closeSaml_() { this.cancel(); - }, + } /** * Loads the authenticator and updates the UI to reflect the loading state. @@ -400,7 +417,7 @@ this.authenticatorParams_.doSamlRedirect = doSamlRedirect; this.authenticator_.load( cr.login.Authenticator.AuthMode.DEFAULT, this.authenticatorParams_); - }, + } /** * Whether the SAML 3rd-party page is visible. @@ -411,7 +428,7 @@ */ computeSamlSsoVisible_(isSaml, pinDialogParameters) { return isSaml && !pinDialogParameters; - }, + } /** * Handler for Gaia loading timeout. @@ -422,7 +439,7 @@ return; this.loadingTimer_ = undefined; chrome.send('showLoadingTimeoutError'); - }, + } /** * Clears loading timer. @@ -433,7 +450,7 @@ clearTimeout(this.loadingTimer_); this.loadingTimer_ = undefined; } - }, + } /** * Sets up loading timer. @@ -443,7 +460,7 @@ this.clearLoadingTimer_(); this.loadingTimer_ = setTimeout( this.onLoadingTimeOut_.bind(this), MAX_GAIA_LOADING_TIME_SEC * 1000); - }, + } /** * Handler for GAIA animation guard timer. @@ -452,7 +469,7 @@ onLoadAnimationGuardTimer_() { this.loadAnimationGuardTimer_ = undefined; this.onShowView_(); - }, + } /** * Clears GAIA animation guard timer. @@ -463,7 +480,7 @@ clearTimeout(this.loadAnimationGuardTimer_); this.loadAnimationGuardTimer_ = undefined; } - }, + } /** * Sets up GAIA animation guard timer. @@ -474,11 +491,11 @@ this.loadAnimationGuardTimer_ = setTimeout( this.onLoadAnimationGuardTimer_.bind(this), GAIA_ANIMATION_GUARD_MILLISEC); - }, + } getOobeUIInitialState() { return OOBE_UI_STATE.GAIA_SIGNIN; - }, + } /** * Event handler that is invoked just before the frame is shown. @@ -497,7 +514,7 @@ this.isShown_ = true; cr.ui.login.invokePolymerMethod(this.$.pinDialog, 'onBeforeShow'); - }, + } /** * @return {!Element} @@ -505,29 +522,29 @@ */ getSigninFrame_() { return this.$['signin-frame-dialog'].getFrame(); - }, + } /** @private */ getActiveFrame_() { switch (this.screenMode_) { - case AuthMode.DEFAULT: + case ScreenAuthMode.DEFAULT: return this.getSigninFrame_(); - case AuthMode.SAML_INTERSTITIAL: + case ScreenAuthMode.SAML_INTERSTITIAL: return this.$['saml-interstitial']; } - }, + } /** @private */ focusActiveFrame_() { let activeFrame = this.getActiveFrame_(); Polymer.RenderStatus.afterNextRender(this, () => activeFrame.focus()); - }, + } /** Event handler that is invoked after the screen is shown. */ onAfterShow() { if (!this.isLoadingUiShown_) this.focusActiveFrame_(); - }, + } /** * Event handler that is invoked just before the screen is hidden. @@ -535,17 +552,18 @@ onBeforeHide() { chrome.send('loginUIStateChanged', ['gaia-signin', false]); this.isShown_ = false; - }, + } /** * Loads the authentication extension into the iframe. * @param {!Object} data Extension parameters bag. + * @suppress {missingProperties} */ loadAuthExtension(data) { // Redirect the webview to the blank page in order to stop the SAML IdP // page from working in a background (see crbug.com/613245). - if (this.screenMode_ == AuthMode.DEFAULT && - data.screenMode != AuthMode.DEFAULT) { + if (this.screenMode_ == ScreenAuthMode.DEFAULT && + data.screenMode != ScreenAuthMode.DEFAULT) { this.authenticator_.resetWebview(); } @@ -564,13 +582,15 @@ this.closePinDialog(); let params = {}; - for (let i in cr.login.Authenticator.SUPPORTED_PARAMS) { - const name = cr.login.Authenticator.SUPPORTED_PARAMS[i]; - if (data[name]) + cr.login.Authenticator.SUPPORTED_PARAMS.forEach(name => { + if (data.hasOwnProperty(name)) { params[name] = data[name]; - } + } + }); - params.doSamlRedirect = (this.screenMode_ == AuthMode.SAML_INTERSTITIAL); + + params.doSamlRedirect = + (this.screenMode_ == ScreenAuthMode.SAML_INTERSTITIAL); params.menuEnterpriseEnrollment = !(data.enterpriseManagedDevice || data.hasDeviceOwner); params.isFirstUser = !(data.enterpriseManagedDevice || data.hasDeviceOwner); @@ -580,16 +600,16 @@ this.authenticatorParams_ = params; switch (this.screenMode_) { - case AuthMode.DEFAULT: + case ScreenAuthMode.DEFAULT: this.loadAuthenticator_(false /* doSamlRedirect */); break; - case AuthMode.SAML_INTERSTITIAL: + case ScreenAuthMode.SAML_INTERSTITIAL: this.samlInterstitialDomainManager_ = data.enterpriseDomainManager; this.loadingFrameContents_ = false; break; } chrome.send('authExtensionLoaded'); - }, + } /** * Whether the current auth flow is SAML. @@ -597,7 +617,7 @@ */ isSamlForTesting() { return this.isSaml_; - }, + } /** * Clean up from a video-enabled SAML flow. @@ -608,7 +628,7 @@ clearTimeout(this.videoTimer_); this.videoTimer_ = undefined; } - }, + } /** * @private @@ -620,7 +640,7 @@ } else { this.clearVideoTimer_(); } - }, + } /** * Invoked when the authFlow property is changed on the authenticator. @@ -628,7 +648,7 @@ */ onAuthFlowChange_() { this.isSaml_ = this.authFlow == cr.login.Authenticator.AuthFlow.SAML; - }, + } /** * Observer that is called when the |isSaml_| property gets changed. @@ -643,7 +663,7 @@ chrome.send('samlStateChanged', [this.isSaml_]); this.classList.toggle('saml', this.isSaml_); - }, + } /** * Invoked when the authenticator emits 'ready' event or when another @@ -655,17 +675,17 @@ this.startLoadAnimationGuardTimer_(); this.clearLoadingTimer_(); // Workaround to hide flashing scroll bar. - this.async(function() { + setTimeout(function() { this.loadingFrameContents_ = false; }.bind(this), 100); - }, + } /** * @private */ onStartEnrollment_() { this.userActed('startEnrollment'); - }, + } /** * Invoked when the authenticator requests whether the specified user is a @@ -679,7 +699,7 @@ getIsSamlUserPasswordless_(email, gaiaId, callback) { cr.sendWithPromise('getIsSamlUserPasswordless', email, gaiaId) .then(callback); - }, + } /** * Invoked when the authenticator emits 'showView' event or when corresponding @@ -693,7 +713,7 @@ this.showViewProcessed_ = true; this.clearLoadAnimationGuardTimer_(); this.onLoginUIVisible_(); - }, + } /** * Called when UI is shown. @@ -702,22 +722,28 @@ onLoginUIVisible_() { chrome.send('loginWebuiReady'); chrome.send('loginVisible', ['gaia-signin']); - }, + } /** + * TODO(crbug.com/1229130) - Remove suppression. + * login.ConfirmSamlPasswordScreen has a `show` method exposed through its + * usage of LoginScreenBehavior. Suppressing for now, but this should be + * improved. + * * Invoked when the user has successfully authenticated via SAML, * the Chrome Credentials Passing API was not used and the authenticator needs * the user to confirm the scraped password. * @param {string} email The authenticated user's e-mail. * @param {number} passwordCount The number of passwords that were scraped. * @private + * @suppress {missingProperties} */ onAuthConfirmPassword_(email, passwordCount) { if (this.samlPasswordConfirmAttempt_ == 0) chrome.send('scrapedPasswordCount', [passwordCount]); if (this.samlPasswordConfirmAttempt_ < 2) { - login.ConfirmSamlPasswordScreen.show( + window.login.ConfirmSamlPasswordScreen.show( email, false /* manual password entry */, this.samlPasswordConfirmAttempt_, this.onConfirmPasswordCollected_.bind(this)); @@ -726,7 +752,7 @@ this.showFatalAuthError_( OobeTypes.FatalErrorCode.SCRAPED_PASSWORD_VERIFICATION_FAILURE); } - }, + } /** * Invoked when the user has successfully authenticated via SAML, @@ -736,7 +762,7 @@ */ onAuthOnePassword_() { chrome.send('scrapedPasswordCount', [1]); - }, + } /** * Invoked when the confirm password screen is dismissed. @@ -749,23 +775,28 @@ // Shows signin UI again without changing states. Oobe.showScreen({id: SCREEN_GAIA_SIGNIN}); - }, + } /** + * TODO(crbug.com/1229130) - Remove suppression + * login.ConfirmSamlPasswordScreen has a `show` method exposed through its + * usage of LoginScreenBehavior. Suppressing for now, but this should be + * improved. * Invoked when the user has successfully authenticated via SAML, the * Chrome Credentials Passing API was not used and no passwords * could be scraped. * The user will be asked to pick a manual password for the device. * @param {string} email The authenticated user's e-mail. * @private + * @suppress {missingProperties} login.ConfirmSamlPasswordScreen */ onAuthNoPassword_(email) { chrome.send('scrapedPasswordCount', [0]); - login.ConfirmSamlPasswordScreen.show( + window.login.ConfirmSamlPasswordScreen.show( email, true /* manual password entry */, this.samlPasswordConfirmAttempt_, this.onManualPasswordCollected_.bind(this)); - }, + } /** * Invoked when the dialog where the user enters a manual password for the @@ -776,7 +807,7 @@ */ onManualPasswordCollected_(password) { this.authenticator_.completeAuthWithManualPassword(password); - }, + } /** * Invoked when the authentication flow had to be aborted because content @@ -789,17 +820,17 @@ onInsecureContentBlocked_(url) { this.showFatalAuthError_( OobeTypes.FatalErrorCode.INSECURE_CONTENT_BLOCKED, {'url': url}); - }, + } /** * Shows the fatal auth error. * @param {OobeTypes.FatalErrorCode} error_code The error code - * @param {string} info Additional info + * @param {Object} [info] Additional info * @private */ showFatalAuthError_(error_code, info) { chrome.send('onFatalError', [error_code, info || {}]); - }, + } /** * Show fatal auth error when information is missing from GAIA. @@ -807,7 +838,7 @@ */ missingGaiaInfo_() { this.showFatalAuthError_(OobeTypes.FatalErrorCode.MISSING_GAIA_INFO); - }, + } /** * Record that SAML API was used during sign-in. @@ -816,7 +847,7 @@ */ samlApiUsed_(isThirdPartyIdP) { chrome.send('usingSAMLAPI', [isThirdPartyIdP]); - }, + } /** * Record SAML Provider that has signed-in @@ -825,7 +856,7 @@ */ recordSAMLProvider_(X509Certificate) { chrome.send('recordSAMLProvider', [X509Certificate]); - }, + } /** * Invoked when auth is completed successfully. @@ -850,7 +881,7 @@ this.clearVideoTimer_(); this.authCompleted_ = true; - }, + } /** * Invoked when onAuthCompleted message received. @@ -860,7 +891,7 @@ */ onAuthCompletedMessage_(e) { this.onAuthCompleted_(e.detail); - }, + } /** * Invoked when onLoadAbort message received. @@ -872,7 +903,7 @@ */ onLoadAbortMessage_(e) { this.onWebviewError_(e.detail); - }, + } /** * Invoked when exit message received. @@ -881,7 +912,7 @@ */ onExitMessage_(e) { this.cancel(); - }, + } /** * Invoked when identifierEntered message received. @@ -891,7 +922,7 @@ */ onIdentifierEnteredMessage_(e) { this.onIdentifierEntered_(e.detail); - }, + } /** * Invoked when removeUserByEmail message received. @@ -901,7 +932,7 @@ */ onRemoveUserByEmailMessage_(e) { this.onRemoveUserByEmail_(e.detail); - }, + } /** * Clears input fields and switches to input mode. @@ -913,19 +944,19 @@ if (takeFocus) { Oobe.getInstance().setOobeUIState(OOBE_UI_STATE.GAIA_SIGNIN); } - }, + } /** * Reloads extension frame. */ doReload() { - if (this.screenMode_ != AuthMode.DEFAULT) + if (this.screenMode_ != ScreenAuthMode.DEFAULT) return; this.authenticator_.reload(); this.loadingFrameContents_ = true; this.startLoadingTimer_(); this.authCompleted_ = false; - }, + } /** * Called when user canceled signin. @@ -940,7 +971,7 @@ } this.userActed(isBackClicked ? 'back' : 'cancel'); - }, + } /** * Handler for webview error handling. @@ -951,7 +982,7 @@ */ onWebviewError_(data) { chrome.send('webviewLoadAborted', [data.error_code]); - }, + } /** * Handler for identifierEntered event. @@ -961,7 +992,7 @@ */ onIdentifierEntered_(data) { chrome.send('identifierEntered', [data.accountIdentifier]); - }, + } /** * Handler for removeUserByEmail event. @@ -972,7 +1003,7 @@ onRemoveUserByEmail_(data) { chrome.send('removeUserByEmail', [data]); this.cancel(); - }, + } /** * Show/Hide error when user is not in allowlist. When UI is hidden GAIA is @@ -984,7 +1015,7 @@ if (show) { const isManaged = opt_data && opt_data.enterpriseManaged; const isFamilyLinkAllowed = opt_data && opt_data.familyLinkAllowed; - errorMessage = ''; + let errorMessage = ''; if (isManaged && isFamilyLinkAllowed) { errorMessage = 'allowlistErrorEnterpriseAndFamilyLink'; } else if (isManaged) { @@ -998,7 +1029,7 @@ // To make animations correct, we need to make sure Gaia is completely // reloaded. Otherwise ChromeOS overlays hide and Gaia page is shown // somewhere in the middle of animations. - if (this.screenMode_ == AuthMode.DEFAULT) + if (this.screenMode_ == ScreenAuthMode.DEFAULT) this.authenticator_.resetWebview(); // It might show the OOBE screen id=SCREEN_CONFIRM_PASSWORD. @@ -1006,11 +1037,11 @@ Oobe.showScreen({id: SCREEN_GAIA_SIGNIN}); this.$['gaia-allowlist-error'].submitButton.focus(); } else { - Oobe.showSigninUI(); + Oobe.showSigninUI(''); } this.isAllowlistErrorShown_ = show; - }, + } /** * Shows the PIN dialog according to the given parameters. @@ -1028,7 +1059,7 @@ this.pinDialogParameters_ = parameters; this.pinDialogResultReported_ = false; - }, + } /** * Closes the PIN dialog (that was previously opened using showPinDialog()). @@ -1038,13 +1069,13 @@ // Note that the update triggers the observer, that notifies the handler // about the closing. this.pinDialogParameters_ = null; - }, + } /** * Observer that is called when the |pinDialogParameters_| property gets * changed. - * @param {OobeTypes.SecurityTokenPinDialogParameter} newValue - * @param {OobeTypes.SecurityTokenPinDialogParameter} oldValue + * @param {OobeTypes.SecurityTokenPinDialogParameters} newValue + * @param {OobeTypes.SecurityTokenPinDialogParameters} oldValue * @private */ onPinDialogParametersChanged_(newValue, oldValue) { @@ -1071,7 +1102,7 @@ // before reporting the result. chrome.send('securityTokenPinEntered', [/*user_input=*/ '']); } - }, + } /** * Invoked when the user cancels the PIN dialog. @@ -1080,7 +1111,7 @@ onPinDialogCanceled_(e) { this.closePinDialog(); this.cancel(); - }, + } /** * Invoked when the PIN dialog is completed. @@ -1089,13 +1120,13 @@ onPinDialogCompleted_(e) { this.pinDialogResultReported_ = true; chrome.send('securityTokenPinEntered', [/*user_input=*/ e.detail]); - }, + } /** * Updates current UI step based on internal state. * @param {boolean} isScreenShown * @param {number} mode - * @param {OobeTypes.SecurityTokenPinDialogParameter} pinParams + * @param {OobeTypes.SecurityTokenPinDialogParameters} pinParams * @param {boolean} isLoading * @param {boolean} isAllowlistError * @private @@ -1109,7 +1140,7 @@ return; } if (isLoading) { - if (mode == AuthMode.DEFAULT) { + if (mode == ScreenAuthMode.DEFAULT) { this.setUIStep(DialogMode.GAIA_LOADING); } else { this.setUIStep(DialogMode.LOADING); @@ -1121,37 +1152,37 @@ return; } switch (mode) { - case AuthMode.DEFAULT: + case ScreenAuthMode.DEFAULT: this.setUIStep(DialogMode.GAIA); break; - case AuthMode.SAML_INTERSTITIAL: + case ScreenAuthMode.SAML_INTERSTITIAL: this.setUIStep(DialogMode.SAML_INTERSTITIAL); break; } - }, + } /** * Invoked when "Next" button is pressed on SAML Interstitial screen. * @param {!CustomEvent} e * @private */ - onSamlInterstitialNext_() { - this.screenMode_ = AuthMode.DEFAULT; + onSamlInterstitialNext_(e) { + this.screenMode_ = ScreenAuthMode.DEFAULT; this.loadAuthenticator_(true /* doSamlRedirect */); - }, + } /** * Invoked when "Change account" link is pressed on SAML Interstitial screen. * @param {!CustomEvent} e * @private */ - onSamlPageChangeAccount_() { + onSamlPageChangeAccount_(e) { // The user requests to change the account. We must clear the email // field of the auth params. this.authenticatorParams_.email = ''; - this.screenMode_ = AuthMode.DEFAULT; + this.screenMode_ = ScreenAuthMode.DEFAULT; this.loadAuthenticator_(false /* doSamlRedirect */); - }, + } /** * Computes the value of the isLoadingUiShown_ property. @@ -1161,10 +1192,10 @@ * @return {boolean} * @private */ - computeIsLoadingUiShown_: function( + computeIsLoadingUiShown_( loadingFrameContents, isAllowlistErrorShown, authCompleted) { return (loadingFrameContents || authCompleted) && !isAllowlistErrorShown; - }, + } /** * Checks if string is empty @@ -1173,10 +1204,11 @@ */ isEmpty_(value) { return !value; - }, + } clickPrimaryButtonForTesting() { this.$['signin-frame-dialog'].clickPrimaryButtonForTesting(); - }, -}); -})(); + } +} + +customElements.define(GaiaSigninElement.is, GaiaSigninElement); \ No newline at end of file
diff --git a/chrome/browser/resources/chromeos/login/screens/oobe/BUILD.gn b/chrome/browser/resources/chromeos/login/screens/oobe/BUILD.gn index 51bdcf3d..38036024 100644 --- a/chrome/browser/resources/chromeos/login/screens/oobe/BUILD.gn +++ b/chrome/browser/resources/chromeos/login/screens/oobe/BUILD.gn
@@ -13,6 +13,7 @@ ":demo_preferences_module", ":demo_setup_module", ":enable_debugging_module", + ":enterprise_enrollment_module", ":hid_detection_module", ":oobe_eula_module", ":oobe_network_module", @@ -32,6 +33,7 @@ ":demo_preferences.m", ":demo_setup.m", ":enable_debugging.m", + ":enterprise_enrollment.m", ":hid_detection.m", ":oobe_eula.m", ":oobe_network.m", @@ -100,6 +102,25 @@ extra_deps = [ ":enable_debugging_module" ] } +js_library("enterprise_enrollment.m") { + sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/login/screens/oobe/enterprise_enrollment.m.js" ] + deps = [ + "../../../keyboard:keyboard_utils.m", + "../../components:display_manager_types.m", + "../../components:gaia_dialog.m", + "../../components:keyboard_utils_for_injection", + "../../components/behaviors:login_screen_behavior.m", + "../../components/behaviors:multi_step_behavior.m", + "../../components/buttons:oobe_back_button.m", + "../../components/buttons:oobe_next_button.m", + "../../components/buttons:oobe_text_button.m", + "../common:offline_ad_login.m", + "//ui/webui/resources/cr_elements/cr_input:cr_input.m", + "//ui/webui/resources/js:cr.m", + ] + extra_deps = [ ":enterprise_enrollment_module" ] +} + js_library("hid_detection.m") { sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/login/screens/oobe/hid_detection.m.js" ] deps = [ @@ -252,6 +273,14 @@ namespace_rewrites = oobe_namespace_rewrites } +polymer_modulizer("enterprise_enrollment") { + js_file = "enterprise_enrollment.js" + html_file = "enterprise_enrollment.html" + html_type = "dom-module" + auto_imports = oobe_auto_imports + namespace_rewrites = oobe_namespace_rewrites +} + polymer_modulizer("hid_detection") { js_file = "hid_detection.js" html_file = "hid_detection.html"
diff --git a/chrome/browser/resources/chromeos/login/enterprise_enrollment.html b/chrome/browser/resources/chromeos/login/screens/oobe/enterprise_enrollment.html similarity index 84% rename from chrome/browser/resources/chromeos/login/enterprise_enrollment.html rename to chrome/browser/resources/chromeos/login/screens/oobe/enterprise_enrollment.html index 1cc69e1..2cf37f533 100644 --- a/chrome/browser/resources/chromeos/login/enterprise_enrollment.html +++ b/chrome/browser/resources/chromeos/login/screens/oobe/enterprise_enrollment.html
@@ -4,22 +4,32 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="chrome://oobe/custom_elements.html"> <link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html"> <link rel="import" href="chrome://resources/html/action_link.html"> +<link rel="import" href="chrome://resources/html/load_time_data.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> -<link rel="import" href="/components/oobe_icons.html"> -<link rel="import" href="/components/behaviors/login_screen_behavior.html"> -<link rel="import" href="/components/behaviors/multi_step_behavior.html"> -<link rel="import" href="/components/behaviors/oobe_i18n_behavior.html"> -<link rel="import" href="/components/buttons/oobe_back_button.html"> -<link rel="import" href="/components/buttons/oobe_next_button.html"> -<link rel="import" href="/components/buttons/oobe_text_button.html"> -<link rel="import" href="/components/common_styles/common_styles.html"> -<link rel="import" href="/components/common_styles/oobe_dialog_host_styles.html"> -<link rel="import" href="/components/dialogs/oobe_adaptive_dialog.html"> -<link rel="import" href="/components/dialogs/oobe_loading_dialog.html"> +<link rel="import" href="../../../../gaia_auth_host/authenticator.html"> +<link rel="import" href="../common/offline_ad_login.html"> + + +<link rel="import" href="../../keyboard_utils.html"> +<link rel="import" href="../../cr_ui.html"> +<link rel="import" href="../../display_manager.html"> +<link rel="import" href="../../components/display_manager_types.html"> +<link rel="import" href="../../components/gaia_dialog.html"> +<link rel="import" href="../../components/oobe_icons.html"> +<link rel="import" href="../../components/oobe_types.html"> +<link rel="import" href="../../components/behaviors/login_screen_behavior.html"> +<link rel="import" href="../../components/behaviors/multi_step_behavior.html"> +<link rel="import" href="../../components/behaviors/oobe_i18n_behavior.html"> +<link rel="import" href="../../components/buttons/oobe_back_button.html"> +<link rel="import" href="../../components/buttons/oobe_next_button.html"> +<link rel="import" href="../../components/buttons/oobe_text_button.html"> +<link rel="import" href="../../components/common_styles/common_styles.html"> +<link rel="import" href="../../components/common_styles/oobe_dialog_host_styles.html"> +<link rel="import" href="../../components/dialogs/oobe_adaptive_dialog.html"> +<link rel="import" href="../../components/dialogs/oobe_loading_dialog.html"> <dom-module id="enterprise-enrollment-element"> <template> @@ -209,4 +219,5 @@ </div> </oobe-adaptive-dialog> </template> + <script src="enterprise_enrollment.js"></script> </dom-module>
diff --git a/chrome/browser/resources/chromeos/login/enterprise_enrollment.js b/chrome/browser/resources/chromeos/login/screens/oobe/enterprise_enrollment.js similarity index 61% rename from chrome/browser/resources/chromeos/login/enterprise_enrollment.js rename to chrome/browser/resources/chromeos/login/screens/oobe/enterprise_enrollment.js index 0080a36e..00a33035 100644 --- a/chrome/browser/resources/chromeos/login/enterprise_enrollment.js +++ b/chrome/browser/resources/chromeos/login/screens/oobe/enterprise_enrollment.js
@@ -6,218 +6,188 @@ * @fileoverview Polymer element for Enterprise Enrollment screen. */ -(function() { - -/* Code which is embedded inside of the webview. See below for details. -/** @const */ -var INJECTED_WEBVIEW_SCRIPT = String.raw` - (function() { - // <include src="../keyboard/keyboard_utils.js"> - keyboard.initializeKeyboardFlow(true); - })();`; +/* #js_imports_placeholder */ /** - * @const - * When making changes to any of these parameters, make sure that their use in - * chrome/browser/resources/chromeos/login/cr_ui.js is updated as well. - * TODO(crbug.com/1111387) - Remove this dependency when fully migrated - * to JS modules. - * */ -var ENROLLMENT_STEP = { - SIGNIN: 'signin', - AD_JOIN: 'ad-join', - WORKING: 'working', - ATTRIBUTE_PROMPT: 'attribute-prompt', - ERROR: 'error', - SUCCESS: 'success', - CHECKING: 'checking', - TPM_CHECKING: 'tpm-checking', - - /* TODO(dzhioev): define this step on C++ side. - */ - ATTRIBUTE_PROMPT_ERROR: 'attribute-prompt-error', - ACTIVE_DIRECTORY_JOIN_ERROR: 'active-directory-join-error', -}; - -/** - * The same steps as in offline-ad-login-element. + * @constructor + * @extends {PolymerElement} + * @implements {OobeI18nBehaviorInterface} + * @implements {LoginScreenBehaviorInterface} + * @implements {MultiStepBehaviorInterface} */ -const ADLoginStep = { - UNLOCK: 'unlock', - CREDS: 'creds', -}; +const EnterpriseEnrollmentElementBase = Polymer.mixinBehaviors( + [OobeI18nBehavior, LoginScreenBehavior, MultiStepBehavior], + Polymer.Element); -Polymer({ - is: 'enterprise-enrollment-element', +/** + * @polymer + */ +class EnterpriseEnrollmentElement extends EnterpriseEnrollmentElementBase { + static get is() { + return 'enterprise-enrollment-element'; + } - behaviors: [ - OobeI18nBehavior, - LoginScreenBehavior, - MultiStepBehavior, - ], + /* #html_template_placeholder */ - EXTERNAL_API: [ - 'doReload', - 'setAdJoinConfiguration', - 'setAdJoinParams', - 'setEnterpriseDomainInfo', - 'setIsBrandedBuild', - 'showAttributePromptStep', - 'showError', - 'showOSNotInstalledError', - 'showStep', - ], - - properties: { - - /** - * Manager of the enrolled domain. Either a domain (foo.com) or an email - * address (admin@foo.com). - */ - domainManager_: { - type: String, - value: '', - }, - - /** - * Name of the device that was enrolled. - */ - deviceName_: { - type: String, - value: 'Chromebook', - }, - - /** - * Text on the error screen. - */ - errorText_: { - type: String, - value: '', - }, - - /** - * Controls if there will be "Try Again" button on the error screen. - * - * True: Error Nature Recoverable - * False: Error Nature Fatal - */ - canRetryAfterError_: { - type: Boolean, - value: true, - }, - - /** - * Device attribute : Asset ID. - */ - assetId_: { - type: String, - value: '', - }, - - /** - * Device attribute : Location. - */ - deviceLocation_: { - type: String, - value: '', - }, - - /** - * Whether account identifier should be sent for check. - */ - hasAccountCheck_: { - type: Boolean, - value: false, - }, - - /** - * Whether the enrollment is automatic - * - * True: Automatic (Attestation-based) - * False: Manual (OAuth) - */ - isAutoEnroll_: { - type: Boolean, - value: false, - }, - - /** - * Whether the enrollment is enforced and cannot be skipped. - * - * True: Enrollment Enforced - * False: Enrollment Optional - */ - isForced_: { - type: Boolean, - value: false, - }, - - /** - * Bound to gaia-dialog::authFlow. - * @private - */ - authFlow_: { - type: Number, - }, - - isMeet_: { - type: Boolean, - value() { - return loadTimeData.valueExists('flowType') && - (loadTimeData.getString('flowType') == 'meet'); + static get properties() { + return { + /** + * Manager of the enrolled domain. Either a domain (foo.com) or an email + * address (admin@foo.com). + */ + domainManager_: { + type: String, + value: '', }, - readOnly: true, - }, - isBranded: { - type: Boolean, - value: true, - }, - }, + /** + * Name of the device that was enrolled. + */ + deviceName_: { + type: String, + value: 'Chromebook', + }, + + /** + * Text on the error screen. + */ + errorText_: { + type: String, + value: '', + }, + + /** + * Controls if there will be "Try Again" button on the error screen. + * + * True: Error Nature Recoverable + * False: Error Nature Fatal + */ + canRetryAfterError_: { + type: Boolean, + value: true, + }, + + /** + * Device attribute : Asset ID. + */ + assetId_: { + type: String, + value: '', + }, + + /** + * Device attribute : Location. + */ + deviceLocation_: { + type: String, + value: '', + }, + + /** + * Whether account identifier should be sent for check. + */ + hasAccountCheck_: { + type: Boolean, + value: false, + }, + + /** + * Whether the enrollment is automatic + * + * True: Automatic (Attestation-based) + * False: Manual (OAuth) + */ + isAutoEnroll_: { + type: Boolean, + value: false, + }, + + /** + * Whether the enrollment is enforced and cannot be skipped. + * + * True: Enrollment Enforced + * False: Enrollment Optional + */ + isForced_: { + type: Boolean, + value: false, + }, + + /** + * Bound to gaia-dialog::authFlow. + * @private + */ + authFlow_: { + type: Number, + }, + + isMeet_: { + type: Boolean, + value() { + return loadTimeData.valueExists('flowType') && + (loadTimeData.getString('flowType') == 'meet'); + }, + readOnly: true, + }, + + isBranded: { + type: Boolean, + value: true, + }, + }; + } + + constructor() { + super(); + /** + * We block esc, back button and cancel button until gaia is loaded to + * prevent multiple cancel events. + * @type {?boolean} + */ + this.isCancelDisabled = false; + + this.isManualEnrollment_ = undefined; + } + + get EXTERNAL_API() { + return [ + 'doReload', 'setAdJoinConfiguration', 'setAdJoinParams', + 'setEnterpriseDomainInfo', 'setIsBrandedBuild', 'showAttributePromptStep', + 'showError', 'showOSNotInstalledError', 'showStep' + ]; + } defaultUIStep() { - return ENROLLMENT_STEP.SIGNIN; - }, + return OobeTypes.EnrollmentStep.SIGNIN; + } - UI_STEPS: ENROLLMENT_STEP, - - /** - * We block esc, back button and cancel button until gaia is loaded to - * prevent multiple cancel events. - */ - isCancelDisabled_: null, - - get isCancelDisabled() { - return this.isCancelDisabled_; - }, - set isCancelDisabled(disabled) { - this.isCancelDisabled_ = disabled; - }, - - isManualEnrollment_: undefined, + get UI_STEPS() { + return OobeTypes.EnrollmentStep; + } get authenticator_() { return this.$['step-signin'].getAuthenticator(); - }, + } get authView_() { return this.$['step-signin'].getFrame(); - }, + } ready() { + super.ready(); this.initializeLoginScreen('OAuthEnrollmentScreen', { resetAllowed: true, }); // Establish an initial messaging between content script and // host script so that content script can message back. - this.authView_.addEventListener('loadstop', function(e) { + this.authView_.addEventListener('loadstop', (e) => { // Could be null in tests. if (e.target && e.target.contentWindow) { e.target.contentWindow.postMessage( 'initialMessage', this.authView_.src); } - }.bind(this)); + }); // When we get the advancing focus command message from injected content // script, we can execute it on host script context. @@ -228,32 +198,30 @@ keyboard.onAdvanceFocus(true); }); - this.$["step-ad-join"].addEventListener('authCompleted', function(e) { - this.$["step-ad-join"].disabled = true; - this.$["step-ad-join"].loading = true; + this.$['step-ad-join'].addEventListener('authCompleted', (e) => { + this.$['step-ad-join'].disabled = true; + this.$['step-ad-join'].loading = true; chrome.send('oauthEnrollAdCompleteLogin', [ e.detail.machine_name, e.detail.distinguished_name, e.detail.encryption_types, e.detail.username, e.detail.password ]); - }.bind(this)); - this.$["step-ad-join"].addEventListener('unlockPasswordEntered', function(e) { - this.$["step-ad-join"].disabled = true; + }); + + this.$['step-ad-join'].addEventListener('unlockPasswordEntered', (e) => { + this.$['step-ad-join'].disabled = true; chrome.send( 'oauthEnrollAdUnlockConfiguration', [e.detail.unlock_password]); - }.bind(this)); - this.authenticator_.insecureContentBlockedCallback = - (function(url) { - this.showError( - loadTimeData.getStringF('insecureURLEnrollmentError', url), - false); - }).bind(this); + }); - this.authenticator_.missingGaiaInfoCallback = - (function() { - this.showError( - loadTimeData.getString('fatalEnrollmentError'), false); - }).bind(this); - }, + this.authenticator_.insecureContentBlockedCallback = (url) => { + this.showError( + loadTimeData.getStringF('insecureURLEnrollmentError', url), false); + }; + + this.authenticator_.missingGaiaInfoCallback = () => { + this.showError(loadTimeData.getString('fatalEnrollmentError'), false); + }; + } /** * Event handler that is invoked just before the frame is shown. @@ -281,7 +249,7 @@ // TODO(crbug.com/1187024) - Improve the type checking in `data` // this.authenticator_.setWebviewPartition( - 'webviewPartitionName' in data ? data.webviewPartitionName : ''); + 'webviewPartitionName' in data ? data.webviewPartitionName : ''); var gaiaParams = {}; gaiaParams.gaiaUrl = data.gaiaUrl; @@ -298,26 +266,28 @@ cr.login.Authenticator.AuthMode.DEFAULT, gaiaParams); this.isManualEnrollment_ = 'enrollment_mode' in data ? - data.enrollment_mode === 'manual' : undefined; + data.enrollment_mode === 'manual' : + undefined; this.isForced_ = 'is_enrollment_enforced' in data ? - data.is_enrollment_enforced : undefined; - this.isAutoEnroll_ = 'attestationBased' in data ? - data.attestationBased : undefined; + data.is_enrollment_enforced : + undefined; + this.isAutoEnroll_ = + 'attestationBased' in data ? data.attestationBased : undefined; this.hasAccountCheck_ = 'flow' in data ? (data.flow == 'enterpriseLicense') : false; - cr.ui.login.invokePolymerMethod(this.$["step-ad-join"], 'onBeforeShow'); + cr.ui.login.invokePolymerMethod(this.$['step-ad-join'], 'onBeforeShow'); this.showStep( - this.isAutoEnroll_ ? ENROLLMENT_STEP.WORKING : ENROLLMENT_STEP.SIGNIN); - }, + this.isAutoEnroll_ ? OobeTypes.EnrollmentStep.WORKING : + OobeTypes.EnrollmentStep.SIGNIN); + } /** * Initial UI State for screen */ getOobeUIInitialState() { return OOBE_UI_STATE.ENROLLMENT; - }, - + } /** * Shows attribute-prompt step with pre-filled asset ID and @@ -326,9 +296,8 @@ showAttributePromptStep(annotatedAssetId, annotatedLocation) { this.assetId_ = annotatedAssetId; this.deviceLocation_ = annotatedLocation; - this.showStep(ENROLLMENT_STEP.ATTRIBUTE_PROMPT); - }, - + this.showStep(OobeTypes.EnrollmentStep.ATTRIBUTE_PROMPT); + } /** * Sets the type of the device and the enterprise domain to be shown. @@ -339,7 +308,7 @@ setEnterpriseDomainInfo(manager, device_type) { this.domainManager_ = manager; this.deviceName_ = device_type; - }, + } /** * Invoked when identifierEntered message received. @@ -349,10 +318,10 @@ */ onIdentifierEnteredMessage_(e) { if (this.hasAccountCheck_) { - this.showStep(ENROLLMENT_STEP.CHECKING); + this.showStep(OobeTypes.EnrollmentStep.CHECKING); chrome.send('enterpriseIdentifierEntered', [e.detail.accountIdentifier]); } - }, + } /** * Cancels the current authentication and drops the user back to the next @@ -363,7 +332,7 @@ return; this.isCancelDisabled = true; this.closeEnrollment_('cancel'); - }, + } /** * Switches between the different steps in the enrollment flow. @@ -373,27 +342,29 @@ */ showStep(step) { this.setUIStep(step); - if (step === ENROLLMENT_STEP.AD_JOIN) { - this.$["step-ad-join"].disabled = false; - this.$["step-ad-join"].loading = false; - this.$["step-ad-join"].focus(); + if (step === OobeTypes.EnrollmentStep.AD_JOIN) { + this.$['step-ad-join'].disabled = false; + this.$['step-ad-join'].loading = false; + this.$['step-ad-join'].focus(); } - this.isCancelDisabled = - (step === ENROLLMENT_STEP.SIGNIN && !this.isManualEnrollment_) || - step === ENROLLMENT_STEP.AD_JOIN || step === ENROLLMENT_STEP.WORKING || - step === ENROLLMENT_STEP.CHECKING || step === ENROLLMENT_STEP.SUCCESS || - step == ENROLLMENT_STEP.TPM_CHECKING; + this.isCancelDisabled = (step === OobeTypes.EnrollmentStep.SIGNIN && + !this.isManualEnrollment_) || + step === OobeTypes.EnrollmentStep.AD_JOIN || + step === OobeTypes.EnrollmentStep.WORKING || + step === OobeTypes.EnrollmentStep.CHECKING || + step === OobeTypes.EnrollmentStep.SUCCESS || + step == OobeTypes.EnrollmentStep.TPM_CHECKING; if (this.isCancelDisabled) { Oobe.getInstance().setOobeUIState(OOBE_UI_STATE.ENROLLMENT); } else { Oobe.getInstance().setOobeUIState( OOBE_UI_STATE.ENROLLMENT_CANCEL_ENABLED); } - }, + } doReload() { this.authenticator_.reload(); - }, + } /** * Sets Active Directory join screen params. @@ -404,39 +375,39 @@ * configuration (and not unlocked yet). */ setAdJoinParams(machineName, userName, errorState, showUnlockConfig) { - this.$["step-ad-join"].disabled = false; - this.$["step-ad-join"].machineName = machineName; - this.$["step-ad-join"].userName = userName; - this.$["step-ad-join"].errorState = errorState; + this.$['step-ad-join'].disabled = false; + this.$['step-ad-join'].machineName = machineName; + this.$['step-ad-join'].userName = userName; + this.$['step-ad-join'].errorState = errorState; if (showUnlockConfig) { - this.$["step-ad-join"].setUIStep(ADLoginStep.UNLOCK); + this.$['step-ad-join'].setUIStep(ADLoginStep.UNLOCK); } else { - this.$["step-ad-join"].setUIStep(ADLoginStep.CREDS); + this.$['step-ad-join'].setUIStep(ADLoginStep.CREDS); } - }, + } /** * Sets Active Directory join screen with the unlocked configuration. * @param {Array<JoinConfigType>} options */ setAdJoinConfiguration(options) { - this.$["step-ad-join"].disabled = false; - this.$["step-ad-join"].setJoinConfigurationOptions(options); - this.$["step-ad-join"].setUIStep(ADLoginStep.CREDS); - this.$["step-ad-join"].focus(); - }, + this.$['step-ad-join'].disabled = false; + this.$['step-ad-join'].setJoinConfigurationOptions(options); + this.$['step-ad-join'].setUIStep(ADLoginStep.CREDS); + this.$['step-ad-join'].focus(); + } clickPrimaryButtonForTesting() { this.$['step-signin'].clickPrimaryButtonForTesting(); - }, + } /** * Skips the device attribute update, * shows the successful enrollment step. */ skipAttributes_() { - this.showStep(ENROLLMENT_STEP.SUCCESS); - }, + this.showStep(OobeTypes.EnrollmentStep.SUCCESS); + } /** * Uploads the device attributes to server. This goes to C++ side through @@ -444,25 +415,25 @@ */ submitAttributes_() { chrome.send('oauthEnrollAttributes', [this.assetId_, this.deviceLocation_]); - }, + } /** * Shows the learn more dialog. */ onLearnMore_() { chrome.send('oauthEnrollOnLearnMore'); - }, + } closeEnrollment_(result) { chrome.send('oauthEnrollClose', [result]); - }, + } /** * Notifies chrome that enrollment have finished. */ onEnrollmentFinished_() { this.closeEnrollment_('done'); - }, + } /** * Generates message on the success screen. @@ -470,11 +441,11 @@ successText_(locale, device, domain) { return this.i18nAdvanced( 'oauthEnrollAbeSuccessDomain', {substitutions: [device, domain]}); - }, + } isEmpty_(str) { return !str; - }, + } onAuthCompleted_(e) { var detail = e.detail; @@ -483,14 +454,14 @@ return; } chrome.send('oauthEnrollCompleteLogin', [detail.email]); - }, + } onReady() { - if (this.uiStep != ENROLLMENT_STEP.SIGNIN) + if (this.uiStep != OobeTypes.EnrollmentStep.SIGNIN) return; this.isCancelDisabled = false; chrome.send('frameLoadingCompleted'); - }, + } /** * ERROR DIALOG LOGIC: @@ -523,18 +494,18 @@ * @param {string} message the error message. * @param {boolean} retry whether the retry link should be shown. */ - showError: function(message, retry) { + showError(message, retry) { this.errorText_ = message; this.canRetryAfterError_ = retry; - if (this.uiStep === ENROLLMENT_STEP.ATTRIBUTE_PROMPT) { - this.showStep(ENROLLMENT_STEP.ATTRIBUTE_PROMPT_ERROR); - } else if (this.uiStep === ENROLLMENT_STEP.AD_JOIN) { - this.showStep(ENROLLMENT_STEP.ACTIVE_DIRECTORY_JOIN_ERROR); + if (this.uiStep === OobeTypes.EnrollmentStep.ATTRIBUTE_PROMPT) { + this.showStep(OobeTypes.EnrollmentStep.ATTRIBUTE_PROMPT_ERROR); + } else if (this.uiStep === OobeTypes.EnrollmentStep.AD_JOIN) { + this.showStep(OobeTypes.EnrollmentStep.ACTIVE_DIRECTORY_JOIN_ERROR); } else { - this.showStep(ENROLLMENT_STEP.ERROR); + this.showStep(OobeTypes.EnrollmentStep.ERROR); } - }, + } showOSNotInstalledError() { this.canRetryAfterError_ = false; @@ -542,8 +513,8 @@ this.locale, 'oauthOSNotInstalledError', this.isBranded ? loadTimeData.getString('osInstallCloudReadyOS') : loadTimeData.getString('osInstallChromiumOS')); - this.showStep(ENROLLMENT_STEP.ERROR); - }, + this.showStep(OobeTypes.EnrollmentStep.ERROR); + } /** * Provides the label for the generic cancel button (Skip / Enroll Manually) @@ -558,7 +529,7 @@ } else { return 'oauthEnrollSkip'; } - }, + } /** * Whether the "GENERIC CANCEL" (SKIP / ENROLL_MANUALLY ) button should be @@ -572,7 +543,7 @@ */ isGenericCancel_(automatic, enforced) { return automatic || (!automatic && !enforced); - }, + } /** * Retries the enrollment process after an error occurred in a previous @@ -581,35 +552,37 @@ */ doRetry_() { chrome.send('oauthEnrollRetry'); - }, + } /** * Event handler for the 'Try again' button that is shown upon an error * during ActiveDirectory join. */ onAdJoinErrorRetry_() { - this.showStep(ENROLLMENT_STEP.AD_JOIN); - }, + this.showStep(OobeTypes.EnrollmentStep.AD_JOIN); + } /* * Whether authFlow is the SAML. */ isSaml_(authFlow) { return authFlow === cr.login.Authenticator.AuthFlow.SAML; - }, + } /* * Called when we cancel TPM check early. */ onTPMCheckCanceled_() { this.userActed('cancel-tpm-check'); - }, + } /** * @param {boolean} is_branded */ setIsBrandedBuild(is_branded) { this.isBranded = is_branded; - }, -}); -})(); + } +} + +customElements.define( + EnterpriseEnrollmentElement.is, EnterpriseEnrollmentElement);
diff --git a/chrome/browser/resources/chromeos/login/structure/components_common.html b/chrome/browser/resources/chromeos/login/structure/components_common.html index 6d1978b..bcd1844 100644 --- a/chrome/browser/resources/chromeos/login/structure/components_common.html +++ b/chrome/browser/resources/chromeos/login/structure/components_common.html
@@ -9,11 +9,6 @@ <link rel="import" href="/components/hd_iron_icon.html"> <link rel="import" href="/components/html_echo.html"> -<!-- TODO(crbug.com/1184731) - Move to screen_gaia_signin once migrated --> -<link rel="import" href="/components/notification_card.html"> -<link rel="import" href="/components/security_token_pin.html"> -<link rel="import" href="/components/gaia_dialog.html"> - <link rel="import" href="/components/oobe_a11y_option.html"> <link rel="import" href="/screens/common/adb_sideloading.html"> <link rel="import" href="/screens/common/app_downloading.html"> @@ -25,6 +20,7 @@ <link rel="import" href="/screens/common/error_message.html"> <link rel="import" href="/screens/common/family_link_notice.html"> <link rel="import" href="/screens/common/fingerprint_setup.html"> +<link rel="import" href="/screens/common/gaia_signin.html"> <link rel="import" href="/screens/common/guest_tos.html"> <link rel="import" href="/screens/common/gesture_navigation.html"> <link rel="import" href="/screens/common/hw_data_collection.html"> @@ -46,7 +42,6 @@ <include src="../components/oobe_network_icons.html"> -<include src="../screen_gaia_signin.html"> <include src="../recommend_apps.html"> <include src="../oobe_screen_assistant_optin_flow.html"> <include src="../multidevice_setup_first_run.html">
diff --git a/chrome/browser/resources/chromeos/login/structure/components_common.js b/chrome/browser/resources/chromeos/login/structure/components_common.js index 4cc98a8..456d5b9 100644 --- a/chrome/browser/resources/chromeos/login/structure/components_common.js +++ b/chrome/browser/resources/chromeos/login/structure/components_common.js
@@ -9,7 +9,6 @@ console.warn('loadCommonComponents() : Starting to load common components.'); // This inclusion is types-only. No actual code to execute. -// <include src="../screen_gaia_signin.js"> // <include src="../recommend_apps.js"> // <include src="../oobe_screen_assistant_optin_flow.js"> // <include src="../multidevice_setup_first_run.js">
diff --git a/chrome/browser/resources/chromeos/login/structure/components_oobe.html b/chrome/browser/resources/chromeos/login/structure/components_oobe.html index 1a0970b..dd73b6d 100644 --- a/chrome/browser/resources/chromeos/login/structure/components_oobe.html +++ b/chrome/browser/resources/chromeos/login/structure/components_oobe.html
@@ -7,6 +7,7 @@ <link rel="import" href="/screens/oobe/demo_preferences.html"> <link rel="import" href="/screens/oobe/demo_setup.html"> <link rel="import" href="/screens/oobe/enable_debugging.html"> +<link rel="import" href="/screens/oobe/enterprise_enrollment.html"> <link rel="import" href="/screens/oobe/hid_detection.html"> <link rel="import" href="/screens/oobe/oobe_eula.html"> <link rel="import" href="/screens/oobe/oobe_network.html"> @@ -15,4 +16,3 @@ <link rel="import" href="/screens/oobe/update.html"> <link rel="import" href="/screens/oobe/welcome.html"> -<include src="../enterprise_enrollment.html">
diff --git a/chrome/browser/resources/chromeos/login/structure/components_oobe.js b/chrome/browser/resources/chromeos/login/structure/components_oobe.js index 7a92f03..1bf989a 100644 --- a/chrome/browser/resources/chromeos/login/structure/components_oobe.js +++ b/chrome/browser/resources/chromeos/login/structure/components_oobe.js
@@ -4,4 +4,3 @@ // clang-format off -// <include src="../enterprise_enrollment.js">
diff --git a/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html b/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html index 1cf7530..b0d14eb 100644 --- a/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html +++ b/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html
@@ -107,12 +107,14 @@ </div> <div class="user-name">[[item.userName]]</div> <cr-icon-button iron-icon="settings:create" + aria-label$="$i18n{edit}" class="edit-button" on-click="onUpdateButtonClick_" hidden="[[!editButtonVisible_]]" data-credentialid$="[[item.credentialId]]"> </cr-icon-button> <cr-icon-button iron-icon="cr:delete" + aria-label$="$i18n{delete}" class="delete-button" on-click="onDeleteButtonClick_" data-credentialid$="[[item.credentialId]]">
diff --git a/chrome/browser/resources/signin/profile_picker/profile_creation_flow/account_selection_lacros.html b/chrome/browser/resources/signin/profile_picker/profile_creation_flow/account_selection_lacros.html index 383399b..249768a 100644 --- a/chrome/browser/resources/signin/profile_picker/profile_creation_flow/account_selection_lacros.html +++ b/chrome/browser/resources/signin/profile_picker/profile_creation_flow/account_selection_lacros.html
@@ -11,6 +11,7 @@ #accountsContainer { background-color: white; border: var(--cr-hairline); + border-color: var(--google-grey-300); border-radius: 8px; margin: 65px 25% 25px 25%; min-width: 500px; @@ -106,6 +107,7 @@ #accountsContainer { background-color: var(--md-background-color); + border-color: var(--google-grey-refresh-700); } } </style>
diff --git a/chrome/browser/resources/tab_strip/tab_list.ts b/chrome/browser/resources/tab_strip/tab_list.ts index 0ad2b6b..1e39ea41 100644 --- a/chrome/browser/resources/tab_strip/tab_list.ts +++ b/chrome/browser/resources/tab_strip/tab_list.ts
@@ -474,7 +474,7 @@ this.$<TabElement>('tabstrip-tab')!.focus(); } - private updatePreviouslyActiveTabs(activeTabId: number) { + private updatePreviouslyActiveTabs_(activeTabId: number) { // There may be more than 1 TabElement marked as active if other events // have updated a Tab to have an active state. For example, if a // tab is created with an already active state, there may be 2 active @@ -496,7 +496,7 @@ this.activatingTabId_ = undefined; this.activatingTabIdTimestamp_ = undefined; - this.updatePreviouslyActiveTabs(tabId); + this.updatePreviouslyActiveTabs_(tabId); const newlyActiveTab = this.findTabElement_(tabId); if (newlyActiveTab) { newlyActiveTab.tab = @@ -555,7 +555,7 @@ this.placeTabElement(tabElement, tab.index, tab.pinned, tab.groupId); this.addAnimationPromise_(tabElement.slideIn()); if (tab.active) { - this.updatePreviouslyActiveTabs(tab.id); + this.updatePreviouslyActiveTabs_(tab.id); this.scrollToTab_(tabElement); } }
diff --git a/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_test_utils.cc b/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_test_utils.cc index ee2decc1..99eaa9e 100644 --- a/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_test_utils.cc +++ b/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_test_utils.cc
@@ -69,8 +69,8 @@ void EventReportValidator::ExpectUnscannedFileEvents( const std::string& expected_url, - const std::vector<const std::string>& expected_filenames, - const std::vector<const std::string>& expected_sha256s, + const std::vector<std::string>& expected_filenames, + const std::vector<std::string>& expected_sha256s, const std::string& expected_trigger, const std::string& expected_reason, const std::set<std::string>* expected_mimetypes, @@ -165,8 +165,8 @@ void EventReportValidator::ExpectSensitiveDataEvents( const std::string& expected_url, - const std::vector<const std::string>& expected_filenames, - const std::vector<const std::string>& expected_sha256s, + const std::vector<std::string>& expected_filenames, + const std::vector<std::string>& expected_sha256s, const std::string& expected_trigger, const std::vector<enterprise_connectors::ContentAnalysisResponse::Result>& expected_dlp_verdicts,
diff --git a/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_test_utils.h b/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_test_utils.h index 101aec7..9d653ce 100644 --- a/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_test_utils.h +++ b/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_test_utils.h
@@ -64,8 +64,8 @@ void ExpectSensitiveDataEvents( const std::string& expected_url, - const std::vector<const std::string>& expected_filenames, - const std::vector<const std::string>& expected_sha256s, + const std::vector<std::string>& expected_filenames, + const std::vector<std::string>& expected_sha256s, const std::string& expected_trigger, const std::vector<enterprise_connectors::ContentAnalysisResponse::Result>& expected_dlp_verdicts, @@ -115,8 +115,8 @@ void ExpectUnscannedFileEvents( const std::string& expected_url, - const std::vector<const std::string>& expected_filenames, - const std::vector<const std::string>& expected_sha256s, + const std::vector<std::string>& expected_filenames, + const std::vector<std::string>& expected_sha256s, const std::string& expected_trigger, const std::string& expected_reason, const std::set<std::string>* expected_mimetypes,
diff --git a/chrome/browser/signin/chrome_signin_client.cc b/chrome/browser/signin/chrome_signin_client.cc index 3a5ea10..341c6c51 100644 --- a/chrome/browser/signin/chrome_signin_client.cc +++ b/chrome/browser/signin/chrome_signin_client.cc
@@ -249,9 +249,8 @@ std::move(callback).Run(); return; } - chromeos::DelayNetworkCall( - base::Milliseconds(chromeos::kDefaultNetworkRetryDelayMS), - std::move(callback)); + ash::DelayNetworkCall(base::Milliseconds(ash::kDefaultNetworkRetryDelayMS), + std::move(callback)); return; #else // Don't bother if we don't have any kind of network connection.
diff --git a/chrome/browser/signin/remove_local_account_browsertest.cc b/chrome/browser/signin/remove_local_account_browsertest.cc index 259f3d2..6fd679e 100644 --- a/chrome/browser/signin/remove_local_account_browsertest.cc +++ b/chrome/browser/signin/remove_local_account_browsertest.cc
@@ -80,7 +80,7 @@ embedded_test_server_.StartAcceptingConnections(); #if BUILDFLAG(IS_CHROMEOS_ASH) - // ChromeSigninClient uses chromeos::DelayNetworkCall() which requires + // `ChromeSigninClient` uses `ash::DelayNetworkCall()` which requires // simulating being online. network_portal_detector_.SimulateDefaultNetworkState( ash::NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE);
diff --git a/chrome/browser/sync/test/integration/exponential_backoff_helper.cc b/chrome/browser/sync/test/integration/exponential_backoff_helper.cc index 36acaeb..e1d742b1 100644 --- a/chrome/browser/sync/test/integration/exponential_backoff_helper.cc +++ b/chrome/browser/sync/test/integration/exponential_backoff_helper.cc
@@ -4,116 +4,142 @@ #include "chrome/browser/sync/test/integration/exponential_backoff_helper.h" -#include <string.h> - -#include <algorithm> #include <ostream> -#include "base/logging.h" +#include "base/cxx17_backports.h" +#include "components/sync/engine/cycle/model_neutral_state.h" #include "components/sync/engine/cycle/sync_cycle_snapshot.h" #include "components/sync/engine/polling_constants.h" +#include "testing/gtest/include/gtest/gtest.h" namespace exponential_backoff_helper { namespace { -// Given the current delay calculate the minimum and maximum wait times for -// the next retry. This is analogous to the production logic in -// BackoffDelayProvider::GetDelay(). -DelayInfo CalculateDelay(base::TimeDelta current_delay) { - base::TimeDelta backoff = std::max( - base::Seconds(1), current_delay * syncer::kBackoffMultiplyFactor); +constexpr size_t kMaxRetriesToVerify = 3; +constexpr base::TimeDelta kMinExtraUnexpectedDelayForWarning = base::Seconds(1); - DelayInfo delay_info; - delay_info.min_delay = backoff - current_delay * syncer::kBackoffJitterFactor; - delay_info.max_delay = backoff + current_delay * syncer::kBackoffJitterFactor; - - delay_info.min_delay = - std::max(base::Seconds(1), - std::min(delay_info.min_delay, syncer::kMaxBackoffTime)); - - delay_info.max_delay = - std::max(base::Seconds(1), - std::min(delay_info.max_delay, syncer::kMaxBackoffTime)); - - return delay_info; +bool DidLastSyncCycleFail(syncer::SyncService* sync_service) { + // Note that SyncCycleSnapshot::is_silenced() is avoided here because, + // unfortunately, it's one cycle "behind". is_silenced() continues to be + // be false upon completion of the first cycle leading to backoff, because the + // sync cycle snapshot is taken *before* the |is_silenced| bit is set to true + // by SyncSchedulerImpl::HandleFailure(). + return syncer::HasSyncerError( + sync_service->GetLastCycleSnapshotForDebugging().model_neutral_state()); } -// Fills the table with the maximum and minimum values for each retry, upto -// |count| number of retries. -void FillDelayTable(DelayInfo* delay_table, int count) { - DCHECK_GT(count, 1); +base::TimeDelta ClampBackoffDelay(base::TimeDelta delay) { + return base::clamp(delay, syncer::kMinBackoffTime, syncer::kMaxBackoffTime); +} + +} // namespace + +// static +ExponentialBackoffChecker::DelayRange +ExponentialBackoffChecker::CalculateDelayRange(base::TimeDelta current_delay) { + // Given the current delay calculate the minimum and maximum wait times for + // each retry. This is analogous to the production logic in + // BackoffDelayProvider::GetDelay(). + const base::TimeDelta backoff = std::max( + base::Seconds(1), current_delay * syncer::kBackoffMultiplyFactor); + + DelayRange delay_range; + delay_range.min_delay = + ClampBackoffDelay(backoff - current_delay * syncer::kBackoffJitterFactor); + delay_range.max_delay = + ClampBackoffDelay(backoff + current_delay * syncer::kBackoffJitterFactor); + return delay_range; +} + +// static +std::vector<ExponentialBackoffChecker::DelayRange> +ExponentialBackoffChecker::BuildExpectedDelayTable() { + std::vector<DelayRange> delay_table; // Start off with the initial value used for tests, where SyncTest forces a // short retry time via command-line kSyncShortInitialRetryOverride. - delay_table[0] = CalculateDelay(syncer::kInitialBackoffShortRetryTime); + delay_table.push_back( + CalculateDelayRange(syncer::kInitialBackoffShortRetryTime)); - for (int i = 1; i < count; ++i) { - delay_table[i].min_delay = - CalculateDelay(delay_table[i - 1].min_delay).min_delay; - delay_table[i].max_delay = - CalculateDelay(delay_table[i - 1].max_delay).max_delay; + for (size_t i = 1; i < kMaxRetriesToVerify; ++i) { + DelayRange range; + range.min_delay = + CalculateDelayRange(delay_table.back().min_delay).min_delay; + range.max_delay = + CalculateDelayRange(delay_table.back().max_delay).max_delay; + delay_table.push_back(range); } -} -} // namespace -// Verifies if the current retry is on time. Note that we dont use the -// maximum value of the retry range in verifying, only the minimum. Reason -// being there is no guarantee that the retry will be on the dot. However in -// practice it is on the dot. But making that assumption for all the platforms -// would make the test flaky. -bool IsRetryOnTime(DelayInfo* delay_table, - int retry_count, - const base::TimeDelta& time_elapsed) { - DVLOG(1) << "Retry Count : " << retry_count - << " Time elapsed : " << time_elapsed - << " Retry table min: " << delay_table[retry_count].min_delay - << " Retry table max: " << delay_table[retry_count].max_delay; - return time_elapsed >= delay_table[retry_count].min_delay; + return delay_table; } ExponentialBackoffChecker::ExponentialBackoffChecker( syncer::SyncServiceImpl* sync_service) - : SingleClientStatusChangeChecker(sync_service) { - memset(&delay_table_, 0, sizeof(delay_table_)); - - const syncer::SyncCycleSnapshot& snap = - service()->GetLastCycleSnapshotForDebugging(); - last_sync_time_ = snap.sync_start_time(); - FillDelayTable(delay_table_, kMaxRetriesToVerify); + : SingleClientStatusChangeChecker(sync_service), + expected_delay_table_(BuildExpectedDelayTable()) { + // Upon construction, backoff must not have started, since it's otherwise + // impossible to determine the precise timestamp corresponding to the first + // backed-off sync cycle, required to predict the exponential behavior. + if (DidLastSyncCycleFail(sync_service)) { + ADD_FAILURE() << "Last sync cycle already failed upon construction of " + << "ExponentialBackoffChecker."; + } } ExponentialBackoffChecker::~ExponentialBackoffChecker() = default; -bool ExponentialBackoffChecker::IsExitConditionSatisfied(std::ostream* os) { - DCHECK(retry_count_ < kMaxRetriesToVerify); - - *os << "Verifying backoff intervals (" << retry_count_ << "/" - << kMaxRetriesToVerify << ")"; - +void ExponentialBackoffChecker::OnSyncCycleCompleted( + syncer::SyncService* sync_service) { const syncer::SyncCycleSnapshot& snap = - service()->GetLastCycleSnapshotForDebugging(); + sync_service->GetLastCycleSnapshotForDebugging(); - if (retry_count_ == 0) { - if (snap.sync_start_time() != last_sync_time_) { - retry_count_++; - last_sync_time_ = snap.sync_start_time(); + if (!DidLastSyncCycleFail(sync_service)) { + return; + } + + // The very first backed-off cycle has itself no delay to verify, but only + // acts as reference point. + if (!last_sync_time_.is_null()) { + // Note that this measures the delay between the *start* time of two cycles, + // instead of measuring the time between one cycle ending and the next one + // starting. However, the difference is negligible when using a fake server, + // because sync cycles are very fast, and either way this checker cannot be + // strict about upper bounds (there may be extra delays for various reasons + // under high CPU load). + actual_delays_.push_back(snap.sync_start_time() - last_sync_time_); + } + + last_sync_time_ = snap.sync_start_time(); + CheckExitCondition(); +} + +bool ExponentialBackoffChecker::IsExitConditionSatisfied(std::ostream* os) { + *os << "Verifying backoff intervals " << actual_delays_.size() << " out of " + << kMaxRetriesToVerify << "\n"; + + for (size_t i = 0; i < std::min(actual_delays_.size(), kMaxRetriesToVerify); + ++i) { + *os << "Delay for retry " << (i + 1) << "/" << kMaxRetriesToVerify + << " expected between " << expected_delay_table_[i].min_delay + << " and (approximately) " << expected_delay_table_[i].max_delay + << "; actual = " << actual_delays_[i] << "\n"; + if (actual_delays_[i] < expected_delay_table_[i].min_delay) { + *os << "ERROR: Delay " << i << " is too short\n"; + return false; } - success_ = true; - return false; + if (actual_delays_[i] > expected_delay_table_[i].max_delay + + kMinExtraUnexpectedDelayForWarning) { + // Although the delay is usually before the max delay, there is nothing + // providing strong guarantees about when precisely the sync thread is + // able to issue a request to the server. Hence, to avoid test flakiness, + // this is treated as a warning only. + *os << "WARNING: delay " << i + << " is longer than expected, but this may be due to high CPU load\n"; + } } - // Check if the sync start time has changed. If so indicates a new sync - // has taken place. - if (snap.sync_start_time() != last_sync_time_) { - base::TimeDelta delta = snap.sync_start_time() - last_sync_time_; - success_ = IsRetryOnTime(delay_table_, retry_count_ - 1, delta); - last_sync_time_ = snap.sync_start_time(); - ++retry_count_; - done_ = (retry_count_ >= kMaxRetriesToVerify); - } - - return done_ && success_; + return actual_delays_.size() >= kMaxRetriesToVerify; } } // namespace exponential_backoff_helper
diff --git a/chrome/browser/sync/test/integration/exponential_backoff_helper.h b/chrome/browser/sync/test/integration/exponential_backoff_helper.h index 6fa9ee7..ad00524 100644 --- a/chrome/browser/sync/test/integration/exponential_backoff_helper.h +++ b/chrome/browser/sync/test/integration/exponential_backoff_helper.h
@@ -5,25 +5,18 @@ #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_EXPONENTIAL_BACKOFF_HELPER_H_ #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_EXPONENTIAL_BACKOFF_HELPER_H_ +#include <vector> + #include "base/time/time.h" #include "chrome/browser/sync/test/integration/single_client_status_change_checker.h" namespace exponential_backoff_helper { -// The minimum and maximum wait times for a retry. The actual retry would take -// place somewhere in this range. The algorithm that calculates the retry wait -// time uses rand functions. -struct DelayInfo { - base::TimeDelta min_delay; - base::TimeDelta max_delay; -}; - // Helper class that checks if a sync client has successfully gone through // exponential backoff after it encounters an error. class ExponentialBackoffChecker : public SingleClientStatusChangeChecker { public: - static constexpr int kMaxRetriesToVerify = 3; - + // Upon construction, it is expected that backoff hasn't started yet. explicit ExponentialBackoffChecker(syncer::SyncServiceImpl* sync_service); ~ExponentialBackoffChecker() override; @@ -31,16 +24,27 @@ ExponentialBackoffChecker& operator=(const ExponentialBackoffChecker&) = delete; - // Checks if backoff is complete. Called repeatedly each time SyncServiceImpl - // notifies observers of a state change. + // SingleClientStatusChangeChecker overrides. + void OnSyncCycleCompleted(syncer::SyncService* sync_service) override; bool IsExitConditionSatisfied(std::ostream* os) override; private: - int retry_count_ = 0; + // The minimum and maximum wait times for a retry. The actual retry would take + // place somewhere in this range. The algorithm that calculates the retry wait + // time uses rand functions. + struct DelayRange { + base::TimeDelta min_delay; + base::TimeDelta max_delay; + }; + + // Helper functions to build the delay table. + static DelayRange CalculateDelayRange(base::TimeDelta current_delay); + static std::vector<DelayRange> BuildExpectedDelayTable(); + + const std::vector<DelayRange> expected_delay_table_; + std::vector<base::TimeDelta> actual_delays_; + base::Time last_sync_time_; - DelayInfo delay_table_[kMaxRetriesToVerify]; - bool success_ = false; - bool done_ = false; }; } // namespace exponential_backoff_helper
diff --git a/chrome/browser/sync/test/integration/secondary_account_helper.cc b/chrome/browser/sync/test/integration/secondary_account_helper.cc index da13d154..c649a99 100644 --- a/chrome/browser/sync/test/integration/secondary_account_helper.cc +++ b/chrome/browser/sync/test/integration/secondary_account_helper.cc
@@ -45,7 +45,7 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) void InitNetwork() { - auto* portal_detector = new chromeos::NetworkPortalDetectorTestImpl(); + auto* portal_detector = new ash::NetworkPortalDetectorTestImpl(); const chromeos::NetworkState* default_network = chromeos::NetworkHandler::Get() @@ -56,7 +56,7 @@ portal_detector->SetDetectionResultsForTesting( default_network->guid(), - chromeos::NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204); + ash::NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204); // Takes ownership. chromeos::network_portal_detector::InitializeForTesting(portal_detector);
diff --git a/chrome/browser/sync/test/integration/secondary_account_helper.h b/chrome/browser/sync/test/integration/secondary_account_helper.h index 06e9cbd4..840988a 100644 --- a/chrome/browser/sync/test/integration/secondary_account_helper.h +++ b/chrome/browser/sync/test/integration/secondary_account_helper.h
@@ -33,7 +33,7 @@ // Sets up necessary fakes for fake network responses to work. Meant to be // called from SetUpOnMainThread. // TODO(crbug.com/882770): On ChromeOS, we need to set up a fake -// NetworkPortalDetector, otherwise chromeos::DelayNetworkCall will think it's +// `NetworkPortalDetector`, otherwise `ash::DelayNetworkCall` will think it's // behind a captive portal and delay all network requests forever, which means // the ListAccounts requests (i.e. getting cookie accounts) will never make it // far enough to even request our fake response.
diff --git a/chrome/browser/tracing/background_tracing_field_trial_unittest.cc b/chrome/browser/tracing/background_tracing_field_trial_unittest.cc index a4c3decc..7c75b1973 100644 --- a/chrome/browser/tracing/background_tracing_field_trial_unittest.cc +++ b/chrome/browser/tracing/background_tracing_field_trial_unittest.cc
@@ -70,7 +70,7 @@ } // namespace TEST_F(BackgroundTracingTest, GetBackgroundTracingSetupMode) { - const std::vector<const SetupModeParams> kParams = { + const std::vector<SetupModeParams> kParams = { // No config file param. {nullptr, nullptr, BackgroundTracingSetupMode::kFromFieldTrial}, // Empty config filename.
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_hi.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_hi.xtb index 5a2d3259..6ec2ed8 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_hi.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_hi.xtb
@@ -500,6 +500,7 @@ <translation id="3908308510347173149"><ph name="PRODUCT_NAME" /> को अपडेट करें</translation> <translation id="3912508018559818924">वेब की सबसे अच्छी जानकारी ढूंढी जा रही है…</translation> <translation id="3924911262913579434"><ph name="SAFE_BROWSING_MODE" /> चालू है</translation> +<translation id="3925830358619338299">Google पासवर्ड मैनेजर में सेव होने से पहले, पासवर्ड आपके डिवाइस पर एन्क्रिप्ट (सुरक्षित) कर लिए जाते हैं</translation> <translation id="3927692899758076493">Sans Serif</translation> <translation id="3928666092801078803">मेरा डेटा संयोजित करें</translation> <translation id="3934366560681368531">“</translation> @@ -772,6 +773,7 @@ <translation id="5483197086164197190">Navigate Chrome</translation> <translation id="5487521232677179737">डेटा साफ़ करें</translation> <translation id="549025011754480756">बोलकर खोजने का तरीका</translation> +<translation id="5492637351392383067">डिवाइस पर पासवर्ड एन्क्रिप्ट (सुरक्षित) करना</translation> <translation id="5514904542973294328">इस डिवाइस के व्यवस्थापक ने अक्षम किया है</translation> <translation id="5515439363601853141">अपना पासवर्ड देखने के लिए अनलॉक करें</translation> <translation id="5517095782334947753">आपके पास <ph name="FROM_ACCOUNT" /> के बुकमार्क, इतिहास, पासवर्ड और अन्य सेटिंग हैं.</translation> @@ -1321,6 +1323,7 @@ <translation id="8427875596167638501">'झलक' टैब आधी स्क्रीन में खुला हुआ है</translation> <translation id="8428213095426709021">सेटिंग</translation> <translation id="8430824733382774043">सिर्फ़ स्क्रीनशॉट शेयर करें</translation> +<translation id="8431730749911729314">Google पासवर्ड मैनेजर में सेव होने से पहले, पासवर्ड अपने डिवाइस पर एन्क्रिप्ट (सुरक्षित) करें</translation> <translation id="8438566539970814960">खोजों और ब्राउज़िंग को बेहतर बनाएं</translation> <translation id="8439974325294139057"><ph name="LANG" /> - भाषा इस्तेमाल के लिए तैयार है. <ph name="APP_NAME" /> को रीस्टार्ट करें.</translation> <translation id="8442258441309440798">कोई भी कहानी उपलब्ध नहीं है</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_km.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_km.xtb index a97311f..48bdd67 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_km.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_km.xtb
@@ -500,6 +500,7 @@ <translation id="3908308510347173149">ដំឡើងកំណែ <ph name="PRODUCT_NAME" /></translation> <translation id="3912508018559818924">កំពុងស្វែងរកអ្វីដែលល្អបំផុតពីបណ្ដាញ…</translation> <translation id="3924911262913579434"><ph name="SAFE_BROWSING_MODE" /> ត្រូវបានបើក</translation> +<translation id="3925830358619338299">ពាក្យសម្ងាត់របស់អ្នកត្រូវបានអ៊ីនគ្រីបនៅលើឧបករណ៍របស់អ្នក មុនពេលរក្សាទុកពាក្យសម្ងាត់ទាំងនោះទៅកម្មវិធីគ្រប់គ្រងពាក្យសម្ងាត់ Google</translation> <translation id="3927692899758076493">Sans Serif</translation> <translation id="3928666092801078803">រួមបញ្ចូលទិន្នន័យរបស់ខ្ញុំ</translation> <translation id="3934366560681368531">“</translation> @@ -772,6 +773,7 @@ <translation id="5483197086164197190">រុករក Chrome</translation> <translation id="5487521232677179737">ជម្រះទិន្នន័យ</translation> <translation id="549025011754480756">របៀបស្វែងរកដោយប្រើសំឡេងរបស់អ្នក</translation> +<translation id="5492637351392383067">ការអ៊ីនគ្រីបនៅលើឧបករណ៍</translation> <translation id="5514904542973294328">បិទដោយអ្នកគ្រប់គ្រងឧបករណ៍នេះ</translation> <translation id="5515439363601853141">ដោះសោដើម្បីមើលពាក្យសម្ងាត់របស់អ្នក</translation> <translation id="5517095782334947753">អ្នកមានចំណាំ ប្រវត្តិ ពាក្យសម្ងាត់ និងការកំណត់ផ្សេងទៀតពី <ph name="FROM_ACCOUNT" /> ។</translation> @@ -1321,6 +1323,7 @@ <translation id="8427875596167638501">ផ្ទាំងមើលសាកល្បងបានបើកពាក់កណ្ដាល</translation> <translation id="8428213095426709021">ការកំណត់</translation> <translation id="8430824733382774043">ចែករំលែករូបថតអេក្រង់តែប៉ុណ្ណោះ</translation> +<translation id="8431730749911729314">អ៊ីនគ្រីបពាក្យសម្ងាត់នៅលើឧបករណ៍របស់អ្នក មុនពេលរក្សាទុកពាក្យសម្ងាត់ទាំងនោះទៅកម្មវិធីគ្រប់គ្រងពាក្យសម្ងាត់ Google</translation> <translation id="8438566539970814960">ធ្វើឱ្យការស្វែងរក និងការរុករកប្រសើរជាងមុន</translation> <translation id="8439974325294139057"><ph name="LANG" /> - អាចប្រើភាសាបានហើយ សូមចាប់ផ្ដើម <ph name="APP_NAME" /> ឡើងវិញ។</translation> <translation id="8442258441309440798">មិនមានអត្ថបទទេ</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_mn.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_mn.xtb index a1ced1a..c86d7f0 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_mn.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_mn.xtb
@@ -500,6 +500,7 @@ <translation id="3908308510347173149"><ph name="PRODUCT_NAME" />-г шинэчлэх</translation> <translation id="3912508018559818924">Вебээс шилдэг илэрцийг хайж байна…</translation> <translation id="3924911262913579434"><ph name="SAFE_BROWSING_MODE" /> идэвхтэй байна</translation> +<translation id="3925830358619338299">Таны нууц үгийг Google-н Нууц үгний менежерт хадгалахаас нь өмнө төхөөрөмж дээр тань шифрлэдэг</translation> <translation id="3927692899758076493">Санс сериф</translation> <translation id="3928666092801078803">Миний өгөгдлийг нэгтгэх</translation> <translation id="3934366560681368531">“</translation> @@ -771,6 +772,7 @@ <translation id="5483197086164197190">Navigate Chrome</translation> <translation id="5487521232677179737">Өгөгдлийг устгах</translation> <translation id="549025011754480756">Хэрхэн дуу хоолойгоороо хайх вэ</translation> +<translation id="5492637351392383067">Төхөөрөмж дээрх шифрлэлт</translation> <translation id="5514904542973294328">Энэ төхөөрөмжийн администратор цуцалсан</translation> <translation id="5515439363601853141">Нууц үгээ харах бол түгжээг тайлна уу</translation> <translation id="5517095782334947753">Танд <ph name="FROM_ACCOUNT" />-н хавчуурга, түүх, нууц үг болон бусад тохиргоо байна.</translation> @@ -1320,6 +1322,7 @@ <translation id="8427875596167638501">Урьдчилан үзэх табыг хагас нээсэн</translation> <translation id="8428213095426709021">Тохиргоо</translation> <translation id="8430824733382774043">Зөвхөн дэлгэцийн агшин хуваалцана уу</translation> +<translation id="8431730749911729314">Өөрийн төхөөрөмж дээрх нууц үгнүүдийг Google-н Нууц үгний менежерт хадгалахаас нь өмнө шифрлэнэ үү</translation> <translation id="8438566539970814960">Хайлт болон хөтлөх явцыг сайжруулаарай</translation> <translation id="8439974325294139057"><ph name="LANG" /> - Хэл бэлэн байна. <ph name="APP_NAME" />-г дахин эхлүүлнэ үү.</translation> <translation id="8442258441309440798">Түүх алга байна</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_ne.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_ne.xtb index 9e8ba9f..e7546db 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_ne.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_ne.xtb
@@ -500,6 +500,7 @@ <translation id="3908308510347173149"><ph name="PRODUCT_NAME" /> अपडेट गर्नुहोस्</translation> <translation id="3912508018559818924">वेबका उत्कृष्ट सामग्रीहरू फेला पार्दै…</translation> <translation id="3924911262913579434">'<ph name="SAFE_BROWSING_MODE" />' अन छ</translation> +<translation id="3925830358619338299">तपाईंका पासवर्डहरू तपाईंको डिभाइसमा इन्क्रिप्ट गरेपछि मात्र Google पासवर्ड म्यानेजरमा सेभ गरिन्छ</translation> <translation id="3927692899758076493">स्यान्स सेरिफ</translation> <translation id="3928666092801078803">मेरो डेटालाई संयोजन गर्नुहोस्</translation> <translation id="3934366560681368531">“</translation> @@ -771,6 +772,7 @@ <translation id="5483197086164197190">Chrome नेभिगेट गर्ने तरिका</translation> <translation id="5487521232677179737">डेटा मेटाउनुहोस्</translation> <translation id="549025011754480756">बोलेर खोज्ने तरिका</translation> +<translation id="5492637351392383067">डिभाइसमै चल्ने इन्क्रिप्सन</translation> <translation id="5514904542973294328">यो डिभाइसका प्रशासकले असक्षम पार्नुभएको</translation> <translation id="5515439363601853141">आफ्नो पासवर्ड हेर्न अनलक गर्नुहोस्</translation> <translation id="5517095782334947753">तपाईंसँग <ph name="FROM_ACCOUNT" /> का पुस्तक चिन्ह, इतिहास, पासवर्ड र अन्य सेटिङहरू छन्।</translation> @@ -1320,6 +1322,7 @@ <translation id="8427875596167638501">पूर्वावलोकन ट्याब आधा खुला छ</translation> <translation id="8428213095426709021">सेटिङहरू</translation> <translation id="8430824733382774043">स्क्रिनसट मात्र सेयर गरियोस्</translation> +<translation id="8431730749911729314">Google पासवर्ड म्यानेजरमा पासवर्डहरू सेभ गर्नुअघि ती पासवर्डहरू आफ्नो डिभाइसमा इन्क्रिप्ट गर्नुहोस्</translation> <translation id="8438566539970814960">खोज तथा ब्राउजिङलाई अझ राम्रो बनाउनुहोस्</translation> <translation id="8439974325294139057"><ph name="LANG" /> - भाषा तयार छ, <ph name="APP_NAME" /> रिस्टार्ट गर्नुहोस्।</translation> <translation id="8442258441309440798">कुनै पनि समाचार उपलब्ध छैन</translation>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_uz.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_uz.xtb index d591b45..9f47824 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_uz.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_uz.xtb
@@ -500,6 +500,7 @@ <translation id="3908308510347173149"><ph name="PRODUCT_NAME" /> ilovasini yangilang</translation> <translation id="3912508018559818924">Internetdan maʼlumotlar yuklanmoqda…</translation> <translation id="3924911262913579434"><ph name="SAFE_BROWSING_MODE" /> yoniq</translation> +<translation id="3925830358619338299">Parolingiz Google Parollar menejeriga saqlanishidan oldin qurilmangizda shifrlangan</translation> <translation id="3927692899758076493">Sans Serif</translation> <translation id="3928666092801078803">Ma’lumotlarni birlashtirish</translation> <translation id="3934366560681368531">“</translation> @@ -772,6 +773,7 @@ <translation id="5483197086164197190">Chrome bilan tanishuv</translation> <translation id="5487521232677179737">Tarixni tozalash</translation> <translation id="549025011754480756">Ovoz bilan qanday qidirish mumkin</translation> +<translation id="5492637351392383067">Qurilmada shifrlash</translation> <translation id="5514904542973294328">Qurilma administratori o‘chirib qo‘ygan</translation> <translation id="5515439363601853141">Paolni ko‘rish uchun qulfni oching</translation> <translation id="5517095782334947753"><ph name="FROM_ACCOUNT" /> hisobiga tegishli xatcho‘p, tarix, parol va boshqa sozlamalar mavjud.</translation> @@ -1321,6 +1323,7 @@ <translation id="8427875596167638501">Razm solish sahifasi yarim hajmda ochildi</translation> <translation id="8428213095426709021">Sozlamalar</translation> <translation id="8430824733382774043">Faqat skrinshotni ulashish</translation> +<translation id="8431730749911729314">Parollarni Google Parollar menejeriga saqlashdan oldin qurilmangizda shifrlang</translation> <translation id="8438566539970814960">Sahifalarni kezish va qidiruvni yaxshilash</translation> <translation id="8439974325294139057"><ph name="LANG" /> – Til tayyor, <ph name="APP_NAME" /> ilovasini qayta ishga tushiring.</translation> <translation id="8442258441309440798">Maqolalar topilmadi</translation>
diff --git a/chrome/browser/ui/ash/network/network_portal_notification_controller.h b/chrome/browser/ui/ash/network/network_portal_notification_controller.h index 1bc85264..a4bc563 100644 --- a/chrome/browser/ui/ash/network/network_portal_notification_controller.h +++ b/chrome/browser/ui/ash/network/network_portal_notification_controller.h
@@ -12,10 +12,13 @@ #include "components/session_manager/core/session_manager_observer.h" #include "ui/message_center/public/cpp/notification.h" +namespace ash { +class NetworkPortalWebDialog; +} + namespace chromeos { class NetworkState; -class NetworkPortalWebDialog; class NetworkPortalNotificationControllerTest; // Shows a message center notification when the networking stack detects a @@ -52,14 +55,14 @@ void CloseDialog(); // NULLifies reference to the active dialog. - void OnDialogDestroyed(const NetworkPortalWebDialog* dialog); + void OnDialogDestroyed(const ash::NetworkPortalWebDialog* dialog); // Ignores "No network" errors in browser tests. void SetIgnoreNoNetworkForTesting(); // Browser tests should be able to verify that NetworkPortalWebDialog is // shown. - const NetworkPortalWebDialog* GetDialogForTesting() const; + const ash::NetworkPortalWebDialog* GetDialogForTesting() const; private: friend NetworkPortalNotificationControllerTest; @@ -86,7 +89,7 @@ NetworkPortalDetector* network_portal_detector_ = nullptr; // Currently displayed authorization dialog, or NULL if none. - NetworkPortalWebDialog* dialog_ = nullptr; + ash::NetworkPortalWebDialog* dialog_ = nullptr; // Do not close Portal Login dialog on "No network" error in browser tests. bool ignore_no_network_for_testing_ = false; @@ -96,4 +99,9 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace ash { +using ::chromeos::NetworkPortalNotificationController; +} + #endif // CHROME_BROWSER_UI_ASH_NETWORK_NETWORK_PORTAL_NOTIFICATION_CONTROLLER_H_
diff --git a/chrome/browser/ui/quick_answers/quick_answers_state_controller.cc b/chrome/browser/ui/quick_answers/quick_answers_state_controller.cc index 59107a3..73198185 100644 --- a/chrome/browser/ui/quick_answers/quick_answers_state_controller.cc +++ b/chrome/browser/ui/quick_answers/quick_answers_state_controller.cc
@@ -4,49 +4,10 @@ #include "chrome/browser/ui/quick_answers/quick_answers_state_controller.h" -#include "ash/public/cpp/assistant/assistant_state.h" #include "ash/session/session_controller_impl.h" #include "ash/shell.h" -#include "chromeos/services/assistant/public/cpp/assistant_prefs.h" #include "components/prefs/pref_service.h" -namespace { - -using chromeos::assistant::prefs::kAssistantContextEnabled; -using chromeos::assistant::prefs::kAssistantEnabled; -using quick_answers::prefs::ConsentStatus; -using quick_answers::prefs::kQuickAnswersConsentStatus; -using quick_answers::prefs::kQuickAnswersEnabled; -using quick_answers::prefs::kQuickAnswersNoticeImpressionCount; - -void MigrateQuickAnswersConsentStatus(PrefService* prefs) { - // If the consented status has not been set, migrate the current context - // enabled value. - if (prefs->FindPreference(kQuickAnswersConsentStatus)->IsDefaultValue()) { - if (!prefs->FindPreference(kAssistantContextEnabled)->IsDefaultValue()) { - // Set the consent status based on current feature eligibility. - bool consented = - ash::AssistantState::Get()->allowed_state() == - chromeos::assistant::AssistantAllowedState::ALLOWED && - prefs->GetBoolean(kAssistantEnabled) && - prefs->GetBoolean(kAssistantContextEnabled); - prefs->SetInteger( - kQuickAnswersConsentStatus, - consented ? ConsentStatus::kAccepted : ConsentStatus::kRejected); - // Enable Quick Answers settings for existing users. - if (consented) - prefs->SetBoolean(kQuickAnswersEnabled, true); - } else { - // Set the consent status to unknown for new users. - prefs->SetInteger(kQuickAnswersConsentStatus, ConsentStatus::kUnknown); - // Reset the impression count for new users. - prefs->SetInteger(kQuickAnswersNoticeImpressionCount, 0); - } - } -} - -} // namespace - QuickAnswersStateController::QuickAnswersStateController() : session_observer_(this) {} @@ -56,5 +17,4 @@ PrefService* prefs = ash::Shell::Get()->session_controller()->GetPrimaryUserPrefService(); state_.RegisterPrefChanges(prefs); - MigrateQuickAnswersConsentStatus(prefs); }
diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc index d202ae2..5071ccd2 100644 --- a/chrome/browser/ui/startup/startup_browser_creator.cc +++ b/chrome/browser/ui/startup/startup_browser_creator.cc
@@ -795,13 +795,6 @@ if (command_line.HasSwitch(switches::kNoStartupWindow)) return true; -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // Don't open any browser windows if Ash requested that Lacros not do so. - // The implicit assumption is that some other code is responsible for - // keeping Lacros running in the background. - // Temporarily remove this logic to deal with https://crbug.com/1278549. -#endif - #if BUILDFLAG(IS_CHROMEOS_ASH) // If Lacros is the primary web browser, do not open the browser window // on Chrome OS session login.
diff --git a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc index 4f16686..87fbdd5 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
@@ -22,6 +22,7 @@ #include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/mock_callback.h" +#include "base/test/test_future.h" #include "base/threading/thread_restrictions.h" #include "build/branding_buildflags.h" #include "build/build_config.h" @@ -44,6 +45,7 @@ #include "chrome/browser/profiles/profile_attributes_storage.h" #include "chrome/browser/profiles/profile_impl.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/profiles/profile_window.h" #include "chrome/browser/search/search.h" #include "chrome/browser/sessions/app_session_service.h" #include "chrome/browser/sessions/app_session_service_factory.h" @@ -127,6 +129,10 @@ #include "components/policy/core/common/policy_map.h" #include "components/policy/core/common/policy_types.h" +#if BUILDFLAG(IS_CHROMEOS_LACROS) +#include "chromeos/lacros/lacros_service.h" +#endif + #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) #include "base/json/json_string_value_serializer.h" #include "chrome/browser/ui/views/web_apps/web_app_protocol_handler_intent_picker_dialog_view.h" @@ -4287,3 +4293,81 @@ }); #endif // !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) + +#if BUILDFLAG(IS_CHROMEOS_LACROS) +class StartupBrowserCreatorLacrosNoWindowTest + : public StartupBrowserCreatorPickerTestBase { + public: + StartupBrowserCreatorLacrosNoWindowTest() = default; + + void CreatedBrowserMainParts( + content::BrowserMainParts* browser_main_parts) override { + if (!content::IsPreTest()) { + crosapi::mojom::BrowserInitParamsPtr init_params = + crosapi::mojom::BrowserInitParams::New(); + init_params->initial_browser_action = + crosapi::mojom::InitialBrowserAction::kDoNotOpenWindow; + chromeos::LacrosService::Get()->SetInitParamsForTests( + std::move(init_params)); + } + + StartupBrowserCreatorPickerTestBase::CreatedBrowserMainParts( + browser_main_parts); + } + + base::FilePath GetDefaultProfileDir() const { + ProfileManager* profile_manager = g_browser_process->profile_manager(); + return profile_manager->user_data_dir().Append( + profile_manager->GetInitialProfileDir()); + } +}; + +// Create a secondary profile in a separate PRE run because the existence of +// profiles is checked during startup in the actual test. +IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorLacrosNoWindowTest, + PRE_MultiProfile) { + CreateMultipleProfiles(); + // Need to close the browser window manually so that the real test does not + // treat it as session restore. + CloseAllBrowsers(); +} + +// Checks that no picker and no browser window are open when there are multiple +// profiles. +IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorLacrosNoWindowTest, MultiProfile) { + EXPECT_FALSE(ProfilePicker::IsOpen()); + EXPECT_EQ(0u, chrome::GetTotalBrowserCount()); +} + +// Checks that no picker and no browser window are open when there is a single +// profile. +IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorLacrosNoWindowTest, SingleProfile) { + EXPECT_FALSE(ProfilePicker::IsOpen()); + EXPECT_EQ(0u, chrome::GetTotalBrowserCount()); + + // Checks that it's possible to open a profile after startup. + // Regression test for https://crbug.com/1278549 + base::test::TestFuture<Profile*, Profile::CreateStatus> future; + ProfileManager::CreateCallback created_callback = base::BindLambdaForTesting( + [&future](Profile* profile, Profile::CreateStatus status) { + future.GetCallback().Run(profile, status); + }); + profiles::SwitchToProfile(GetDefaultProfileDir(), + /*always_create=*/false, created_callback); + Profile* profile = future.Get<0>(); + Profile::CreateStatus status = future.Get<1>(); + EXPECT_NE(profile, nullptr); + EXPECT_EQ(status, Profile::CREATE_STATUS_INITIALIZED); + EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); + + // Checks that it's possible to open the profile picker. + EXPECT_FALSE(ProfilePicker::IsOpen()); + base::RunLoop run_loop; + ProfilePicker::AddOnProfilePickerOpenedCallbackForTesting( + run_loop.QuitClosure()); + ProfilePicker::Show(ProfilePicker::EntryPoint::kProfileMenuManageProfiles); + run_loop.Run(); + EXPECT_TRUE(ProfilePicker::IsOpen()); +} + +#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
diff --git a/chrome/browser/ui/views/frame/browser_view_layout_unittest.cc b/chrome/browser/ui/views/frame/browser_view_layout_unittest.cc index 07f531cb..b105886 100644 --- a/chrome/browser/ui/views/frame/browser_view_layout_unittest.cc +++ b/chrome/browser/ui/views/frame/browser_view_layout_unittest.cc
@@ -81,12 +81,12 @@ bool SupportsWindowFeature( const Browser::WindowFeature feature) const override { static const base::NoDestructor<base::flat_set<Browser::WindowFeature>> - supported_features({ + supported_features{{ Browser::FEATURE_TABSTRIP, Browser::FEATURE_TOOLBAR, Browser::FEATURE_LOCATIONBAR, Browser::FEATURE_BOOKMARKBAR, - }); + }}; return base::Contains(*supported_features, feature); } gfx::NativeView GetHostView() const override { return nullptr; }
diff --git a/chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller.cc b/chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller.cc index 43296f7..57c5fc12 100644 --- a/chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller.cc +++ b/chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller.cc
@@ -4,7 +4,6 @@ #include "chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller.h" -#include "base/metrics/histogram_functions.h" #include "chrome/browser/sync/sync_service_factory.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" @@ -107,8 +106,7 @@ : sync_service_(sync_service), theme_service_(theme_service), show_bubble_callback_(std::move(show_bubble_callback)), - suggested_profile_color_(suggested_profile_color), - observation_start_time_(base::TimeTicks::Now()) { + suggested_profile_color_(suggested_profile_color) { CHECK(profile); CHECK(anchor_view); CHECK(sync_service_); @@ -120,10 +118,7 @@ } ProfileCustomizationBubbleSyncController:: - ~ProfileCustomizationBubbleSyncController() { - base::UmaHistogramTimes("Profile.SyncCustomizationBubbleDelay", - base::TimeTicks::Now() - observation_start_time_); -} + ~ProfileCustomizationBubbleSyncController() = default; void ProfileCustomizationBubbleSyncController::Init() { if (!CanSyncStart(sync_service_)) {
diff --git a/chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller.h b/chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller.h index 4efb57373..b1f3bd8 100644 --- a/chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller.h +++ b/chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller.h
@@ -8,7 +8,6 @@ #include "base/callback.h" #include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" -#include "base/time/time.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_observer.h" #include "chrome/browser/themes/theme_syncable_service.h" @@ -107,7 +106,6 @@ const raw_ptr<ThemeService> theme_service_; ShowBubbleCallback show_bubble_callback_; SkColor const suggested_profile_color_; - base::TimeTicks observation_start_time_; base::ScopedObservation<Profile, ProfileObserver> profile_observation_{this}; base::ScopedObservation<views::View, views::ViewObserver> view_observation_{
diff --git a/chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller_unittest.cc b/chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller_unittest.cc index dfd47f75..6cc3a29c 100644 --- a/chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller_unittest.cc +++ b/chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller_unittest.cc
@@ -5,7 +5,6 @@ #include "chrome/browser/ui/views/profiles/profile_customization_bubble_sync_controller.h" #include "base/memory/raw_ptr.h" -#include "base/test/metrics/histogram_tester.h" #include "base/test/mock_callback.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_syncable_service.h" @@ -117,7 +116,6 @@ protected: content::BrowserTaskEnvironment task_environment_; syncer::TestSyncService test_sync_service_; - base::HistogramTester histogram_tester_; private: raw_ptr<Profile> testing_profile_ = nullptr; @@ -135,7 +133,6 @@ ApplyColorAndShowBubbleWhenNoValueSynced(show_bubble.Get()); NotifyOnSyncStarted(); - histogram_tester_.ExpectTotalCount("Profile.SyncCustomizationBubbleDelay", 1); } TEST_F(ProfileCustomizationBubbleSyncControllerTest, @@ -146,7 +143,6 @@ test_sync_service_.SetDisableReasons( syncer::SyncService::DISABLE_REASON_ENTERPRISE_POLICY); ApplyColorAndShowBubbleWhenNoValueSynced(show_bubble.Get()); - histogram_tester_.ExpectTotalCount("Profile.SyncCustomizationBubbleDelay", 1); } TEST_F(ProfileCustomizationBubbleSyncControllerTest, @@ -157,7 +153,6 @@ ApplyColorAndShowBubbleWhenNoValueSynced(show_bubble.Get()); SetSyncedProfileColor(); NotifyOnSyncStarted(); - histogram_tester_.ExpectTotalCount("Profile.SyncCustomizationBubbleDelay", 1); } // Regression test for crbug.com/1213109. @@ -171,7 +166,6 @@ NotifyOnSyncStarted(); ApplyColorAndShowBubbleWhenNoValueSynced(show_bubble.Get()); - histogram_tester_.ExpectTotalCount("Profile.SyncCustomizationBubbleDelay", 1); } TEST_F(ProfileCustomizationBubbleSyncControllerTest, @@ -182,7 +176,6 @@ ApplyColorAndShowBubbleWhenNoValueSynced(show_bubble.Get()); SetSyncedProfileTheme(); NotifyOnSyncStarted(); - histogram_tester_.ExpectTotalCount("Profile.SyncCustomizationBubbleDelay", 1); } TEST_F(ProfileCustomizationBubbleSyncControllerTest, @@ -192,7 +185,6 @@ ApplyColorAndShowBubbleWhenNoValueSynced(show_bubble.Get()); NotifyOnSyncStarted(/*waiting_for_extension_installation=*/true); - histogram_tester_.ExpectTotalCount("Profile.SyncCustomizationBubbleDelay", 1); } TEST_F(ProfileCustomizationBubbleSyncControllerTest, @@ -203,7 +195,6 @@ test_sync_service_.SetPassphraseRequired(true); ApplyColorAndShowBubbleWhenNoValueSynced(show_bubble.Get()); test_sync_service_.FireStateChanged(); - histogram_tester_.ExpectTotalCount("Profile.SyncCustomizationBubbleDelay", 1); } TEST_F(ProfileCustomizationBubbleSyncControllerTest, @@ -213,7 +204,6 @@ ApplyColorAndShowBubbleWhenNoValueSynced(show_bubble.Get()); DeleteTestingProfile(); - histogram_tester_.ExpectTotalCount("Profile.SyncCustomizationBubbleDelay", 1); } TEST_F(ProfileCustomizationBubbleSyncControllerTest, @@ -223,7 +213,6 @@ ApplyColorAndShowBubbleWhenNoValueSynced(show_bubble.Get()); DeleteTestingView(); - histogram_tester_.ExpectTotalCount("Profile.SyncCustomizationBubbleDelay", 1); } } // namespace
diff --git a/chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.cc index aecf5d7..0fafe54 100644 --- a/chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.cc
@@ -31,6 +31,7 @@ #include "ash/webui/file_manager/file_manager_untrusted_ui.h" #include "ash/webui/help_app_ui/help_app_kids_magazine_untrusted_ui.h" #include "ash/webui/personalization_app/untrusted_personalization_app_ui_config.h" +#include "chrome/browser/ash/web_applications/crosh_ui.h" #include "chrome/browser/ash/web_applications/help_app/help_app_untrusted_ui_config.h" #include "chrome/browser/ash/web_applications/media_app/media_app_guest_ui_config.h" #include "chrome/browser/ash/web_applications/projector_app/untrusted_projector_ui_config.h" @@ -70,6 +71,7 @@ #endif // defined(OS_ANDROID) #if BUILDFLAG(IS_CHROMEOS_ASH) + register_config(std::make_unique<CroshUIConfig>()); register_config(std::make_unique<TerminalUIConfig>()); register_config(std::make_unique<ash::eche_app::UntrustedEcheAppUIConfig>()); register_config(std::make_unique<MediaAppGuestUIConfig>());
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc index d636e45..6e50c9b 100644 --- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc +++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -109,6 +109,8 @@ #include "chrome/grit/browser_resources.h" #include "chrome/grit/chrome_unscaled_resources.h" #include "chrome/grit/component_extension_resources.h" +#include "chrome/grit/gaia_auth_host_resources.h" +#include "chrome/grit/gaia_auth_host_resources_map.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/oobe_conditional_resources.h" #include "chrome/grit/oobe_unconditional_resources_map.h" @@ -699,6 +701,9 @@ // Add all resources from OOBE's autogenerated GRD. source->AddResourcePaths(base::make_span(kOobeUnconditionalResources, kOobeUnconditionalResourcesSize)); + // Add Gaia Authenticator resources + source->AddResourcePaths(base::make_span(kGaiaAuthHostResources, + kGaiaAuthHostResourcesSize)); if (policy::EnrollmentRequisitionManager::IsRemoraRequisition()) { source->AddResourcePath(
diff --git a/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc b/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc index 08f308b..91698e9e 100644 --- a/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc +++ b/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc
@@ -421,6 +421,9 @@ if (!context_menu_after_tap_) page_->ShowContextMenu(); return true; + case blink::WebInputEvent::Type::kGestureTwoFingerTap: + page_->ShowContextMenu(); + return true; case blink::WebInputEvent::Type::kGestureLongTap: if (context_menu_after_tap_) page_->ShowContextMenu();
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 09c8a2f3..dba2f4c 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1641815658-a5ab5a1fc52e96782cdcee31e1f1aa23ceda8372.profdata +chrome-linux-main-1641837549-d0239f085154d7cc9f77850079ba2f6daf29ab31.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 6d29610..fd59a2d 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1641793337-2e4d3a2b7b73d8cc9091fa78b5f157aaae2daca3.profdata +chrome-mac-main-1641815658-9fcc1c6e86dfdb3c51856011bd5393eb3b079029.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 9e3f716..426cec97 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1641803336-4a7e270c35d3d270eac2bf1d6a5cf5c3e5abfd57.profdata +chrome-win32-main-1641826617-d0c055df873d1faff22f6a40c005486a81730562.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 8d66211..202ee01 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1641803336-28310930e85fdee615d31b40cd1a1d7a705caf06.profdata +chrome-win64-main-1641826617-a3414858ff3187ad1b8fa668983c76c8e5075daa.profdata
diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc index 5162045d..3ad355f3 100644 --- a/chrome/common/webui_url_constants.cc +++ b/chrome/common/webui_url_constants.cc
@@ -333,6 +333,7 @@ const char kChromeUISmbCredentialsURL[] = "chrome://smb-credentials-dialog/"; const char kChromeUISysInternalsHost[] = "sys-internals"; const char kChromeUISysInternalsUrl[] = "chrome://sys-internals"; +const char kChromeUIUntrustedCroshHost[] = "crosh"; const char kChromeUIUntrustedCroshURL[] = "chrome-untrusted://crosh/"; const char kChromeUIUntrustedTerminalHost[] = "terminal"; const char kChromeUIUntrustedTerminalURL[] = "chrome-untrusted://terminal/";
diff --git a/chrome/common/webui_url_constants.h b/chrome/common/webui_url_constants.h index cf1d03d..6a6c86fa 100644 --- a/chrome/common/webui_url_constants.h +++ b/chrome/common/webui_url_constants.h
@@ -321,6 +321,7 @@ extern const char kChromeUISmbShareURL[]; extern const char kChromeUISysInternalsHost[]; extern const char kChromeUISysInternalsUrl[]; +extern const char kChromeUIUntrustedCroshHost[]; extern const char kChromeUIUntrustedCroshURL[]; extern const char kChromeUIUntrustedTerminalHost[]; extern const char kChromeUIUntrustedTerminalURL[];
diff --git a/chrome/test/data/autofill/captured_sites/testcases.json b/chrome/test/data/autofill/captured_sites/testcases.json index 4d1f7e4..87f9ad95 100644 --- a/chrome/test/data/autofill/captured_sites/testcases.json +++ b/chrome/test/data/autofill/captured_sites/testcases.json
@@ -119,7 +119,7 @@ { "site_name": "mercurypay" }, { "site_name": "mlbshop" }, { "site_name": "modcloth" }, - { "site_name": "moma" }, + { "site_name": "moma", "bug_number":1285733 }, { "site_name": "monoprice" }, { "site_name": "movietickets" }, { "site_name": "musicians_friend" }, @@ -199,7 +199,7 @@ { "site_name": "venus" }, { "site_name": "verizonwireless", "bug_number":1172706 }, { "site_name": "victorias_secret" }, - { "site_name": "vitacost" }, + { "site_name": "vitacost", "bug_number":1285720 }, { "site_name": "walgreen" }, { "site_name": "walmart" }, { "site_name": "walmart_ca" },
diff --git a/chrome/test/data/chromeos/enterprise/policies b/chrome/test/data/chromeos/enterprise/policies deleted file mode 100644 index 75dd99b0..0000000 --- a/chrome/test/data/chromeos/enterprise/policies +++ /dev/null
@@ -1,613 +0,0 @@ -{ u'prod_enterprise_executive_user': { - u'user_recommended_policies': {}, - u'user_mandatory_policies': { - u'ExtensionInstallForcelist': [ - (u'kcnhkahnjcbndmmehfkdnkjomaanaooo;' - 'https://clients2.google.com/service/update2/crx'), - (u'boidnimkebefpfgbeekbjoponilnomle;' - 'https://clients2.google.com/service/update2/crx'), - (u'khgabmflimjjbclkmljlpmgaleanedem;' - 'https://clients2.google.com/service/update2/crx'), - (u'inmnggcpelemfookhlhkdfbechcdadfp;' - 'https://clients2.google.com/service/update2/crx')], - u'PolicyRefreshRate': 28800000, - u'PrintingEnabled': True}}, - - u'prod_enterprise_sales_user': { - u'user_mandatory_policies': { - u'AlternateErrorPagesEnabled': False, - u'AutoFillEnabled': False, - u'ChromeOsLockOnIdleSuspend': False, - u'DefaultCookiesSetting': 2, - u'DefaultGeolocationSetting': 2, - u'DefaultImagesSetting': 2, - u'DefaultJavaScriptSetting': 2, - u'DefaultNotificationsSetting': 2, - u'DefaultPopupsSetting': 2, - u'DefaultSearchProviderEnabled': True, - u'DefaultSearchProviderEncodings': [u'UTF-8'], - u'DefaultSearchProviderIconURL': u'http://www.engadget.icon', - u'DefaultSearchProviderInstantURL': u'http://www.engadget.com/instant', - u'DefaultSearchProviderKeyword': u'engadget.com', - u'DefaultSearchProviderName': u'engadget', - u'DefaultSearchProviderSearchURL': - (u'http://www.engadget.com/search/' - '?q={searchTerms}&invocationType=wl-gadget'), - u'DefaultSearchProviderSuggestURL': u'http://www.engadget.com/suggest', - u'DeveloperToolsDisabled': True, - u'Disable3DAPIs': True, - u'DisableSpdy': True, - u'DnsPrefetchingEnabled': False, - u'ExtensionInstallBlocklist': [u'*'], - u'ExtensionInstallForcelist': [ - (u'kcnhkahnjcbndmmehfkdnkjomaanaooo;' - 'https://clients2.google.com/service/update2/crx'), - (u'boidnimkebefpfgbeekbjoponilnomle;' - 'https://clients2.google.com/service/update2/crx'), - (u'khgabmflimjjbclkmljlpmgaleanedem;' - 'https://clients2.google.com/service/update2/crx'), - (u'inmnggcpelemfookhlhkdfbechcdadfp;' - 'https://clients2.google.com/service/update2/crx')], - u'ExtensionInstallAllowlist': [ - u'kcnhkahnjcbndmmehfkdnkjomaanaooo', - u'boidnimkebefpfgbeekbjoponilnomle', - u'aggljnipbdiebhbmadknfbjlhehbohbn', - u'mgijmajocgfcbeboacabfgobmjgjcoja'], - u'HomepageIsNewTabPage': True, - u'PasswordManagerAllowShowPasswords': False, - u'PasswordManagerEnabled': False, - u'PolicyRefreshRate': 1800000, - u'PrintingEnabled': True, - u'ProxyMode': u'direct', - u'RestoreOnStartup': 4, - u'RestoreOnStartupURLs': [ - u'https://www.google.com', - u'chrome:settings', - u'chrome:policy'], - u'SearchSuggestEnabled': False, - u'ShowHomeButton': False, - u'URLBlacklist': [ - u'http://google.com', - u'ftp://*', - u'news.yahoo.com', - u'slashdot.org/popular'], - u'URLWhitelist': [u'https://google.com']}}, - - u'prod_enterprise_development_user': { - u'user_mandatory_policies': { - u'AlternateErrorPagesEnabled': True, - u'ChromeOsLockOnIdleSuspend': True, - u'DefaultCookiesSetting': 1, - u'DefaultGeolocationSetting': 3, - u'DefaultImagesSetting': 1, - u'DefaultJavaScriptSetting': 1, - u'DefaultNotificationsSetting': 1, - u'DefaultPopupsSetting': 1, - u'DefaultSearchProviderEnabled': True, - u'DefaultSearchProviderEncodings': [ - u'"UTF-8"', - u'"UTF-16"', - u'"GB2312"', - u'"ISO-8859-1"'], - u'DefaultSearchProviderIconURL': u'', - u'DefaultSearchProviderInstantURL': u'', - u'DefaultSearchProviderKeyword': u'amazon.com', - u'DefaultSearchProviderName': u'Amazon', - u'DefaultSearchProviderSearchURL': - (u'http://www.amazon.com/s/' - 'ref=nb_sb_noss?url=search-alias%3Daps&' - 'field-keywords={searchTerms}&x=0&y=0'), - u'DefaultSearchProviderSuggestURL': u'', - u'Disable3DAPIs': True, - u'DnsPrefetchingEnabled': True, - u'ExtensionInstallBlocklist': [ - u'khgabmflimjjbclkmljlpmgaleanedem', - u'boidnimkebefpfgbeekbjoponilnomle'], - u'ExtensionInstallForcelist': [ - (u'hpfomeedmekonipambfkmjfacahlngjd;' - 'https://clients2.google.com/service/update2/crx'), - (u'kcnhkahnjcbndmmehfkdnkjomaanaooo;' - 'https://clients2.google.com/service/update2/crx')], - u'ExtensionInstallAllowlist': [ - u'kcnhkahnjcbndmmehfkdnkjomaanaooo', - u'boidnimkebefpfgbeekbjoponilnomle', - u'aggljnipbdiebhbmadknfbjlhehbohbn', - u'mgijmajocgfcbeboacabfgobmjgjcoja'], - u'HomepageIsNewTabPage': False, - u'HomepageLocation': u'https://news.google.com', - u'PasswordManagerEnabled': True, - u'PolicyRefreshRate': 3600000, - u'PrintingEnabled': True, - u'ProxyBypassList': - (u'http://www.bing.com,' - 'http://www.google.com,irs.gov'), - u'ProxyMode': u'fixed_servers', - u'ProxyServer': u'cache.corp.google.com:3128', - u'SearchSuggestEnabled': True, - u'ShowHomeButton': True, - u'SyncDisabled': False}}, - - u'prod_enterprise_test_user': { - u'user_mandatory_policies': { - u'PolicyRefreshRate': 5400000, - u'ProxyPacUrl': u'http://proxyconfig.corp.google.com/wpad.dat', - u'DefaultJavaScriptSetting': 1, - u'RestoreOnStartup': 4, - u'DefaultSearchProviderSuggestURL': - u'http://search.my.company/suggest?q={searchTerms}', - u'ProxyMode': u'pac_script', - u'DefaultGeolocationSetting': 1, - u'DefaultCookiesSetting': 1, - u'RestoreOnStartupURLs': - [u'http://cnn.com', - u'nytimes.com', - u'msnbc.com', - u'latimes.com', - u'chrome:settings', - u'chrome:policy'], - u'HomepageIsNewTabPage': False, - u'DeveloperToolsDisabled': True, - u'SavingBrowserHistoryDisabled': True, - u'DefaultSearchProviderSearchURL': - u'http://search.my.company/search?q={searchTerms}', - u'DefaultNotificationsSetting': 3, - u'DefaultSearchProviderEncodings': [ - u'["UTF-8"', - u'"UTF-16"', - u'"GB2312"', - u'"ISO-8859-1"]'], - u'DisableSpdy': True, - u'ChromeOsLockOnIdleSuspend': True, - u'DefaultSearchProviderName': u'My Intranet Search', - u'ShowHomeButton': False, - u'DefaultSearchProviderIconURL': - u'http://search.my.company/favicon.ico', - u'URLBlacklist': [ - u'http://google.com', - u'ftp://*', - u'news.yahoo.com', - u'slashdot.org/popular'], - u'DefaultSearchProviderInstantURL': - u'http://search.my.company/suggest?q={searchTerms}', - u'ExtensionInstallAllowlist': [ - u'kjebfhglflhjjjiceimfkgicifkhjlnm', - u'aknpkdffaafgjchaibgeefbgmgeghloj', - u'hpfomeedmekonipambfkmjfacahlngjd'], - u'PasswordManagerEnabled': True, - u'PrintingEnabled': True, - u'DefaultPopupsSetting': 1, - u'DefaultSearchProviderKeyword': u'mis', - u'DnsPrefetchingEnabled': True, - u'ExtensionInstallBlocklist': [u'*'], - u'AlternateErrorPagesEnabled': True, - u'HomepageLocation': u'http://finance.yahoo.com', - u'SyncDisabled': False, - u'URLWhitelist': [u'https://google.com'], - u'DefaultImagesSetting': 1, u'DefaultSearchProviderEnabled': True}}, - - u'prod_enterprise_operations_user': { - u'user_mandatory_policies': { - u'ChromeOsLockOnIdleSuspend': True, - u'DefaultCookiesSetting': 1, - u'DefaultGeolocationSetting': 1, - u'DefaultJavaScriptSetting': 1, - u'DefaultNotificationsSetting': 1, - u'DefaultPopupsSetting': 2, - u'DefaultSearchProviderEnabled': True, - u'DefaultSearchProviderEncodings': [ - u'UTF-8', - u'UTF-16', - u'GB2312', - u'ISO-8859-1'], - u'DefaultSearchProviderIconURL': u'', - u'DefaultSearchProviderInstantURL': u'', - u'DefaultSearchProviderKeyword': u'aol.com', - u'DefaultSearchProviderName': u'AOL Search', - u'DefaultSearchProviderSearchURL': - (u'http://search.aol.com/aol/search' - '?q={searchTerms}&s_it=opensearch'), - u'DefaultSearchProviderSuggestURL': u'', - u'Disable3DAPIs': True, - u'DnsPrefetchingEnabled': True, - u'ExtensionInstallBlocklist': [u'*'], - u'ExtensionInstallForcelist': [ - (u'kcnhkahnjcbndmmehfkdnkjomaanaooo;' - 'https://clients2.google.com/service/update2/crx'), - (u'boidnimkebefpfgbeekbjoponilnomle;' - 'https://clients2.google.com/service/update2/crx'), - (u'khgabmflimjjbclkmljlpmgaleanedem;' - 'https://clients2.google.com/service/update2/crx'), - (u'inmnggcpelemfookhlhkdfbechcdadfp;' - 'https://clients2.google.com/service/update2/crx')], - u'ExtensionInstallAllowlist': [ - u'kcnhkahnjcbndmmehfkdnkjomaanaooo', - u'boidnimkebefpfgbeekbjoponilnomle', - u'aggljnipbdiebhbmadknfbjlhehbohbn', - u'mgijmajocgfcbeboacabfgobmjgjcoja'], - u'HomepageIsNewTabPage': False, - u'HomepageLocation': u'http://www.nasdaq.com', - u'PasswordManagerAllowShowPasswords': False, - u'PasswordManagerEnabled': True, - u'PolicyRefreshRate': 5400000, - u'PrintingEnabled': True, - u'ProxyMode': u'auto_detect', - u'SearchSuggestEnabled': True, - u'ShowHomeButton': True, - u'SyncDisabled': True, - u'URLBlacklist': [ - u'http://google.com', - u'ftp://*', - u'news.yahoo.com', - u'slashdot.org/popular'], - u'URLWhitelist': [u'https://google.com']}}, - - u'test_enterprise_executive_user': { - u'user_mandatory_policies': { - u'ExtensionInstallForcelist': [ - (u'kcnhkahnjcbndmmehfkdnkjomaanaooo;' - 'https://clients2.google.com/service/update2/crx'), - (u'boidnimkebefpfgbeekbjoponilnomle;' - 'https://clients2.google.com/service/update2/crx'), - (u'khgabmflimjjbclkmljlpmgaleanedem;' - 'https://clients2.google.com/service/update2/crx'), - (u'inmnggcpelemfookhlhkdfbechcdadfp;' - 'https://clients2.google.com/service/update2/crx')], - u'PolicyRefreshRate': 28800000, - u'PrintingEnabled': True}}, - - u'test_enterprise_sales_user': { - u'user_mandatory_policies': { - u'AlternateErrorPagesEnabled': False, - u'AutoFillEnabled': False, - u'ChromeOsLockOnIdleSuspend': False, - u'DefaultCookiesSetting': 2, - u'DefaultGeolocationSetting': 2, - u'DefaultImagesSetting': 2, - u'DefaultJavaScriptSetting': 2, - u'DefaultNotificationsSetting': 2, - u'DefaultPopupsSetting': 2, - u'DefaultSearchProviderEnabled': True, - u'DefaultSearchProviderEncodings': [u'UTF-8'], - u'DefaultSearchProviderIconURL': u'http://www.engadget.icon', - u'DefaultSearchProviderInstantURL': u'http://www.engadget.com/instant', - u'DefaultSearchProviderKeyword': u'engadget.com', - u'DefaultSearchProviderName': u'engadget', - u'DefaultSearchProviderSearchURL': - (u'http://www.engadget.com/search/' - '?q={searchTerms}&invocationType=wl-gadget'), - u'DefaultSearchProviderSuggestURL': u'http://www.engadget.com/suggest', - u'DeveloperToolsDisabled': True, - u'Disable3DAPIs': True, - u'DisableSpdy': True, - u'DnsPrefetchingEnabled': False, - u'ExtensionInstallBlocklist': [u'*'], - u'ExtensionInstallForcelist': [ - (u'kcnhkahnjcbndmmehfkdnkjomaanaooo;' - 'https://clients2.google.com/service/update2/crx'), - (u'boidnimkebefpfgbeekbjoponilnomle;' - 'https://clients2.google.com/service/update2/crx'), - (u'khgabmflimjjbclkmljlpmgaleanedem;' - 'https://clients2.google.com/service/update2/crx'), - (u'inmnggcpelemfookhlhkdfbechcdadfp;' - 'https://clients2.google.com/service/update2/crx')], - u'ExtensionInstallAllowlist': [ - u'kcnhkahnjcbndmmehfkdnkjomaanaooo', - u'boidnimkebefpfgbeekbjoponilnomle', - u'aggljnipbdiebhbmadknfbjlhehbohbn', - u'mgijmajocgfcbeboacabfgobmjgjcoja'], - u'HomepageIsNewTabPage': True, - u'PasswordManagerAllowShowPasswords': False, - u'PasswordManagerEnabled': False, - u'PolicyRefreshRate': 1800000, - u'PrintingEnabled': True, - u'ProxyMode': u'direct', - u'RestoreOnStartup': 4, - u'RestoreOnStartupURLs': [ - u'https://www.google.com', - u'chrome:settings', - u'chrome:policy'], - u'SearchSuggestEnabled': False, - u'ShowHomeButton': False, - u'URLBlacklist': [ - u'http://google.com', - u'ftp://*', - u'news.yahoo.com', - u'slashdot.org/popular'], - u'URLWhitelist': [u'https://google.com']}}, - - u'test_enterprise_development_user': { - u'user_mandatory_policies': { - u'AlternateErrorPagesEnabled': True, - u'ChromeOsLockOnIdleSuspend': True, - u'DefaultCookiesSetting': 1, - u'DefaultGeolocationSetting': 3, - u'DefaultImagesSetting': 1, - u'DefaultJavaScriptSetting': 1, - u'DefaultNotificationsSetting': 1, - u'DefaultPopupsSetting': 1, - u'DefaultSearchProviderEnabled': True, - u'DefaultSearchProviderEncodings': [ - u'"UTF-8"', - u'"UTF-16"', - u'"GB2312"', - u'"ISO-8859-1"'], - u'DefaultSearchProviderIconURL': u'', - u'DefaultSearchProviderInstantURL': u'', - u'DefaultSearchProviderKeyword': u'amazon.com', - u'DefaultSearchProviderName': u'Amazon', - u'DefaultSearchProviderSearchURL': - (u'http://www.amazon.com/s/' - 'ref=nb_sb_noss?url=search-alias%3Daps&' - 'field-keywords={searchTerms}&x=0&y=0'), - u'DefaultSearchProviderSuggestURL': u'', - u'Disable3DAPIs': True, - u'DnsPrefetchingEnabled': True, - u'ExtensionInstallBlocklist': [ - u'khgabmflimjjbclkmljlpmgaleanedem', - u'boidnimkebefpfgbeekbjoponilnomle'], - u'ExtensionInstallForcelist': [ - (u'hpfomeedmekonipambfkmjfacahlngjd;' - 'https://clients2.google.com/service/update2/crx'), - (u'kcnhkahnjcbndmmehfkdnkjomaanaooo;' - 'https://clients2.google.com/service/update2/crx')], - u'ExtensionInstallAllowlist': [ - u'kcnhkahnjcbndmmehfkdnkjomaanaooo', - u'boidnimkebefpfgbeekbjoponilnomle', - u'aggljnipbdiebhbmadknfbjlhehbohbn', - u'mgijmajocgfcbeboacabfgobmjgjcoja'], - u'HomepageIsNewTabPage': False, - u'HomepageLocation': u'https://news.google.com', - u'PasswordManagerEnabled': True, - u'PolicyRefreshRate': 3600000, - u'PrintingEnabled': True, - u'ProxyBypassList': - (u'http://www.bing.com,' - 'http://www.google.com,irs.gov'), - u'ProxyMode': u'fixed_servers', - u'ProxyServer': u'cache.corp.google.com:3128', - u'SearchSuggestEnabled': True, - u'ShowHomeButton': True, - u'SyncDisabled': False}}, - - u'test_enterprise_test_user': { - u'user_mandatory_policies': { - u'PolicyRefreshRate': 5400000, - u'ProxyPacUrl': u'http://proxyconfig.corp.google.com/wpad.dat', - u'DefaultJavaScriptSetting': 1, - u'RestoreOnStartup': 4, - u'DefaultSearchProviderSuggestURL': - u'http://search.my.company/suggest?q={searchTerms}', - u'ProxyMode': u'pac_script', - u'DefaultGeolocationSetting': 1, - u'DefaultCookiesSetting': 1, - u'RestoreOnStartupURLs': - [u'http://cnn.com', - u'nytimes.com', - u'msnbc.com', - u'latimes.com', - u'chrome:settings', - u'chrome:policy'], - u'HomepageIsNewTabPage': False, - u'DeveloperToolsDisabled': True, - u'SavingBrowserHistoryDisabled': True, - u'DefaultSearchProviderSearchURL': - u'http://search.my.company/search?q={searchTerms}', - u'DefaultNotificationsSetting': 3, - u'DefaultSearchProviderEncodings': [ - u'["UTF-8"', - u'"UTF-16"', - u'"GB2312"', - u'"ISO-8859-1"]'], - u'DisableSpdy': True, - u'ChromeOsLockOnIdleSuspend': True, - u'DefaultSearchProviderName': u'My Intranet Search', - u'ShowHomeButton': False, - u'DefaultSearchProviderIconURL': - u'http://search.my.company/favicon.ico', - u'URLBlacklist': [ - u'http://google.com', - u'ftp://*', - u'news.yahoo.com', - u'slashdot.org/popular'], - u'DefaultSearchProviderInstantURL': - u'http://search.my.company/suggest?q={searchTerms}', - u'ExtensionInstallAllowlist': [ - u'kjebfhglflhjjjiceimfkgicifkhjlnm', - u'aknpkdffaafgjchaibgeefbgmgeghloj', - u'hpfomeedmekonipambfkmjfacahlngjd'], - u'PasswordManagerEnabled': True, - u'PrintingEnabled': True, - u'DefaultPopupsSetting': 1, - u'DefaultSearchProviderKeyword': u'mis', - u'DnsPrefetchingEnabled': True, - u'ExtensionInstallBlocklist': [u'*'], - u'AlternateErrorPagesEnabled': True, - u'HomepageLocation': u'http://finance.yahoo.com', - u'SyncDisabled': False, - u'URLWhitelist': [u'https://google.com'], - u'DefaultImagesSetting': 1, u'DefaultSearchProviderEnabled': True}}, - - u'test_enterprise_operations_user': { - u'user_mandatory_policies': { - u'ChromeOsLockOnIdleSuspend': True, - u'DefaultCookiesSetting': 1, - u'DefaultGeolocationSetting': 1, - u'DefaultJavaScriptSetting': 1, - u'DefaultNotificationsSetting': 1, - u'DefaultPopupsSetting': 2, - u'DefaultSearchProviderEnabled': True, - u'DefaultSearchProviderEncodings': [ - u'UTF-8', - u'UTF-16', - u'GB2312', - u'ISO-8859-1'], - u'DefaultSearchProviderIconURL': u'', - u'DefaultSearchProviderInstantURL': u'', - u'DefaultSearchProviderKeyword': u'aol.com', - u'DefaultSearchProviderName': u'AOL Search', - u'DefaultSearchProviderSearchURL': - (u'http://search.aol.com/aol/search' - '?q={searchTerms}&s_it=opensearch'), - u'DefaultSearchProviderSuggestURL': u'', - u'Disable3DAPIs': True, - u'DnsPrefetchingEnabled': True, - u'ExtensionInstallBlocklist': [u'*'], - u'ExtensionInstallForcelist': [ - (u'kcnhkahnjcbndmmehfkdnkjomaanaooo;' - 'https://clients2.google.com/service/update2/crx'), - (u'boidnimkebefpfgbeekbjoponilnomle;' - 'https://clients2.google.com/service/update2/crx'), - (u'khgabmflimjjbclkmljlpmgaleanedem;' - 'https://clients2.google.com/service/update2/crx'), - (u'inmnggcpelemfookhlhkdfbechcdadfp;' - 'https://clients2.google.com/service/update2/crx')], - u'ExtensionInstallAllowlist': [ - u'kcnhkahnjcbndmmehfkdnkjomaanaooo', - u'boidnimkebefpfgbeekbjoponilnomle', - u'aggljnipbdiebhbmadknfbjlhehbohbn', - u'mgijmajocgfcbeboacabfgobmjgjcoja'], - u'HomepageIsNewTabPage': False, - u'HomepageLocation': u'http://www.nasdaq.com', - u'PasswordManagerAllowShowPasswords': False, - u'PasswordManagerEnabled': True, - u'PolicyRefreshRate': 5400000, - u'PrintingEnabled': True, - u'ProxyMode': u'auto_detect', - u'SearchSuggestEnabled': True, - u'ShowHomeButton': True, - u'SyncDisabled': True, - u'URLBlacklist': [ - u'http://google.com', - u'ftp://*', - u'news.yahoo.com', - u'slashdot.org/popular'], - u'URLWhitelist': [u'https://google.com']}}, - - u'prod_enterprise_crosprqa0_user': { - u'device_recommended_policies': {}, - u'device_mandatory_policies': {}}, - - u'prod_enterprise_crosprqa2_user': { - u'device_recommended_policies': {}, - u'device_mandatory_policies': { - u'DeviceDataRoamingEnabled': False, - u'DeviceMetricsReportingEnabled': True, - u'DeviceShowUserNamesOnSignin': True, - u'ReportDeviceActivityTimes': False, - u'ReportDeviceBootMode': False, - u'ReportDeviceVersionInfo': False}}, - - u'prod_enterprise_crosprqa3_user': { - u'device_recommended_policies': {}, - u'device_mandatory_policies': { - u'DeviceUserAllowlist': [ - u'bob.exc@crosprqa1.com', - u'*@crosprqa3.com', - u'*@crosprqa2.com', - u'*@crosprqa0.com', - u'*@gmail.com'], - u'DeviceDataRoamingEnabled': True, - u'DeviceMetricsReportingEnabled': True, - u'DeviceShowUserNamesOnSignin': True, - u'ReportDeviceActivityTimes': True, - u'ReportDeviceBootMode': True, - u'ReportDeviceVersionInfo': True}}, - - u'prod_enterprise_crosprqa4_user': { - u'device_recommended_policies': {}, - u'device_mandatory_policies': { - u'DeviceGuestModeEnabled': False, - u'DeviceUserAllowlist': [ - u'adm@crosprqa4.com', - u'scott@crosprqa4.com', - u'bob.exc@crosprqa4.com', - u'bill.fac@crosprqa4.com', - u'carl.ops@crosprqa4.com', - u'code.dev@crospcrosprqa4.com', - u'ddt.teg@crosprqa4.com', - u'dil.int@crosprqa4.com', - u'greg.sal@crosprqa4.com', - u'kim.ins@crosprqa4.com', - u'rudy.exs@crosprqa4.com', - u'tom.eng@crosprqa4.com', - u'exc1@crosprqa4.com', - u'sal1@crosprqa4.com', - u'dev1@crosprqa4.com', - u'teg1@crosprqa4.com', - u'eng1@crosprqa4.com', - u'ops1@crosprqa4.com', - u'*@crosprqa0.com', - u'*@crosprqa2.com', - u'*@crosprqa3.com'], - u'ChromeOsReleaseChannelDelegated': True, - u'DeviceDataRoamingEnabled': False, - u'DeviceMetricsReportingEnabled': False, - u'DeviceShowUserNamesOnSignin': False, - u'ReportDeviceActivityTimes': False, - u'ReportDeviceBootMode': False, - u'ReportDeviceVersionInfo': False}}, - - u'test_enterprise_crosqa0_user': { - u'device_recommended_policies': {}, - u'device_mandatory_policies': {}}, - - u'test_enterprise_crosqa2_user': { - u'device_recommended_policies': {}, - u'device_mandatory_policies': { - u'DeviceDataRoamingEnabled': False, - u'DeviceMetricsReportingEnabled': True, - u'DeviceShowUserNamesOnSignin': True, - u'ReportDeviceActivityTimes': False, - u'ReportDeviceBootMode': False, - u'ReportDeviceVersionInfo': False}}, - - u'test_enterprise_crosqa3_user': { - u'device_recommended_policies': {}, - u'device_mandatory_policies': { - u'DeviceUserAllowlist': [ - u'bob.exc@crosprqa1.com', - u'*@crosqa3.com', - u'*@crosqa2.com', - u'*@crosqa0.com', - u'*@gmail.com'], - u'DeviceDataRoamingEnabled': True, - u'DeviceMetricsReportingEnabled': True, - u'DeviceShowUserNamesOnSignin': True, - u'ReportDeviceActivityTimes': True, - u'ReportDeviceBootMode': True, - u'ReportDeviceVersionInfo': True}}, - - u'test_enterprise_crosqa4_user': { - u'device_recommended_policies': {}, - u'device_mandatory_policies': { - u'DeviceGuestModeEnabled': False, - u'DeviceUserAllowlist': [ - u'adm@crosqa4.com', - u'scott@crosqa4.com', - u'bob.exc@crosqa4.com', - u'bill.fac@crosqa4.com', - u'carl.ops@crosqa4.com', - u'code.dev@crosqa4.com', - u'ddt.teg@crosqa4.com', - u'dil.int@crosqa4.com', - u'greg.sal@crosqa4.com', - u'kim.ins@crosqa4.com', - u'rudy.exs@crosqa4.com', - u'tom.eng@crosqa4.com', - u'exc1@crosqa4.com', - u'sal1@crosqa4.com', - u'dev1@crosqa4.com', - u'teg1@crosqa4.com', - u'eng1@crosqa4.com', - u'ops1@crosqa4.com', - u'*@crosqa0.com', - u'*@crosqa2.com', - u'*@crosqa3.com'], - u'ChromeOsReleaseChannelDelegated': True, - u'DeviceDataRoamingEnabled': False, - u'DeviceMetricsReportingEnabled': False, - u'DeviceShowUserNamesOnSignin': False, - u'ReportDeviceActivityTimes': False, - u'ReportDeviceBootMode': False, - u'ReportDeviceVersionInfo': False}}, -}
diff --git a/chromeos/network/network_event_log.h b/chromeos/network/network_event_log.h index 95a9c9a..ce94753d 100644 --- a/chromeos/network/network_event_log.h +++ b/chromeos/network/network_event_log.h
@@ -33,7 +33,8 @@ // TODO(https://crbug.com/1164001): remove when moved to ash. namespace ash { +using ::chromeos::NetworkGuidId; using ::chromeos::NetworkPathId; -} +} // namespace ash #endif // CHROMEOS_NETWORK_NETWORK_EVENT_LOG_H_
diff --git a/chromeos/network/policy_applicator.cc b/chromeos/network/policy_applicator.cc index bde95d0..f57dc038 100644 --- a/chromeos/network/policy_applicator.cc +++ b/chromeos/network/policy_applicator.cc
@@ -163,21 +163,21 @@ if (!it.is_string()) continue; - std::string entry = it.GetString(); + std::string entry_identifier = it.GetString(); // Skip "ethernet_any", as this is used by shill internally to persist // ethernet settings and the policy application logic should not mess with // it. - if (entry == kEthernetAnyService) + if (entry_identifier == kEthernetAnyService) continue; - pending_get_entry_calls_.insert(entry); + pending_get_entry_calls_.insert(entry_identifier); ShillProfileClient::Get()->GetEntry( - dbus::ObjectPath(profile_.path), entry, + dbus::ObjectPath(profile_.path), entry_identifier, base::BindOnce(&PolicyApplicator::GetEntryCallback, - weak_ptr_factory_.GetWeakPtr(), entry), + weak_ptr_factory_.GetWeakPtr(), entry_identifier), base::BindOnce(&PolicyApplicator::GetEntryError, - weak_ptr_factory_.GetWeakPtr(), entry)); + weak_ptr_factory_.GetWeakPtr(), entry_identifier)); } if (pending_get_entry_calls_.empty()) ApplyRemainingPolicies(); @@ -192,11 +192,11 @@ NotifyConfigurationHandlerAndFinish(); } -void PolicyApplicator::GetEntryCallback(const std::string& entry, +void PolicyApplicator::GetEntryCallback(const std::string& entry_identifier, base::Value entry_properties) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - VLOG(2) << "Received properties for entry " << entry << " of profile " - << profile_.ToDebugString(); + VLOG(2) << "Received properties for entry " << entry_identifier + << " of profile " << profile_.ToDebugString(); std::unique_ptr<base::DictionaryValue> onc_part( onc::TranslateShillServiceToONCPart( @@ -209,8 +209,8 @@ shill_property_util::GetUIDataFromProperties( base::Value::AsDictionaryValue(entry_properties)); if (!ui_data) { - VLOG(1) << "Entry " << entry << " of profile " << profile_.ToDebugString() - << " contains no or no valid UIData."; + VLOG(1) << "Entry " << entry_identifier << " of profile " + << profile_.ToDebugString() << " contains no or no valid UIData."; // This might be an entry of an older ChromeOS version. Assume it to be // unmanaged. It's an inconsistency if there is a GUID but no UIData, thus // clear the GUID just in case. @@ -236,7 +236,7 @@ auto profile_entry_finished_callback = base::BindOnce(&PolicyApplicator::ProfileEntryFinished, - weak_ptr_factory_.GetWeakPtr(), entry); + weak_ptr_factory_.GetWeakPtr(), entry_identifier); if (new_policy) { std::string new_guid = GetGUIDFromONCPart(*new_policy); DCHECK(!new_guid.empty()); @@ -247,8 +247,8 @@ << "Applying policy " << new_guid << " to previously unmanaged " << "configuration."; - ApplyNewPolicy(entry, entry_properties, std::move(ui_data), old_guid, - new_guid, *new_policy, + ApplyNewPolicy(entry_identifier, entry_properties, std::move(ui_data), + old_guid, new_guid, *new_policy, std::move(profile_entry_finished_callback)); return; } @@ -260,25 +260,25 @@ // Remove the entry, because the network was managed but isn't anymore. // Note: An alternative might be to preserve the user settings, but it's // unclear which values originating the policy should be removed. - DeleteEntry(entry, std::move(profile_entry_finished_callback)); + DeleteEntry(entry_identifier, std::move(profile_entry_finished_callback)); return; } ApplyGlobalPolicyOnUnmanagedEntry( - entry, base::Value::AsDictionaryValue(entry_properties), + entry_identifier, base::Value::AsDictionaryValue(entry_properties), std::move(profile_entry_finished_callback)); } -void PolicyApplicator::GetEntryError(const std::string& entry, +void PolicyApplicator::GetEntryError(const std::string& entry_identifier, const std::string& error_name, const std::string& error_message) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - LOG(ERROR) << "Could not retrieve entry " << entry << " of profile " - << profile_.path << ": " << error_message; - ProfileEntryFinished(entry); + LOG(ERROR) << "Could not retrieve entry " << entry_identifier + << " of profile " << profile_.path << ": " << error_message; + ProfileEntryFinished(entry_identifier); } -void PolicyApplicator::ApplyNewPolicy(const std::string& entry, +void PolicyApplicator::ApplyNewPolicy(const std::string& entry_identifier, const base::Value& entry_properties, std::unique_ptr<NetworkUIData> ui_data, const std::string& old_guid, @@ -344,7 +344,7 @@ // At first ENTRY1 and ENTRY2 should be removed, then the new config be // written and the result should be: // { {GUID=X, SSID=Y, USER_SETTINGS=X} } - DeleteEntry(entry, + DeleteEntry(entry_identifier, base::BindOnce(&PolicyApplicator::WriteNewShillConfiguration, weak_ptr_factory_.GetWeakPtr(), std::move(new_shill_properties), @@ -353,7 +353,7 @@ } void PolicyApplicator::ApplyGlobalPolicyOnUnmanagedEntry( - const std::string& entry, + const std::string& entry_identifier, const base::DictionaryValue& entry_properties, base::OnceClosure callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -377,12 +377,13 @@ std::move(callback)); } -void PolicyApplicator::DeleteEntry(const std::string& entry, +void PolicyApplicator::DeleteEntry(const std::string& entry_identifier, base::OnceClosure callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto split_callback = base::SplitOnceCallback(std::move(callback)); ShillProfileClient::Get()->DeleteEntry( - dbus::ObjectPath(profile_.path), entry, std::move(split_callback.first), + dbus::ObjectPath(profile_.path), entry_identifier, + std::move(split_callback.first), base::BindOnce(&LogErrorMessageAndInvokeCallback, std::move(split_callback.second), FROM_HERE)); } @@ -412,9 +413,10 @@ std::move(callback)); } -void PolicyApplicator::ProfileEntryFinished(const std::string& entry) { +void PolicyApplicator::ProfileEntryFinished( + const std::string& entry_identifier) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - auto iter = pending_get_entry_calls_.find(entry); + auto iter = pending_get_entry_calls_.find(entry_identifier); DCHECK(iter != pending_get_entry_calls_.end()); pending_get_entry_calls_.erase(iter); if (pending_get_entry_calls_.empty()) @@ -439,7 +441,9 @@ // remaining policies, new configurations have to be created. for (std::set<std::string>::iterator it = remaining_policy_guids_.begin(); it != remaining_policy_guids_.end();) { - const base::DictionaryValue* network_policy = GetByGUID(all_policies_, *it); + const std::string& guid = *it; + const base::DictionaryValue* network_policy = + GetByGUID(all_policies_, guid); DCHECK(network_policy); VLOG(1) << "Creating new configuration managed by policy " << *it @@ -471,20 +475,20 @@ } base::Value shill_dictionary = policy_util::CreateShillConfiguration( - profile_, *it, &global_network_config_, network_policy, + profile_, guid, &global_network_config_, network_policy, nullptr /* no user settings */); handler_->CreateConfigurationFromPolicy( shill_dictionary, base::BindOnce(&PolicyApplicator::RemainingPolicyApplied, - weak_ptr_factory_.GetWeakPtr(), *it /* entry */)); + weak_ptr_factory_.GetWeakPtr(), guid)); it++; } } -void PolicyApplicator::RemainingPolicyApplied(const std::string& entry) { +void PolicyApplicator::RemainingPolicyApplied(const std::string& guid) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - remaining_policy_guids_.erase(entry); + remaining_policy_guids_.erase(guid); if (remaining_policy_guids_.empty()) { NotifyConfigurationHandlerAndFinish(); }
diff --git a/chromeos/network/policy_applicator.h b/chromeos/network/policy_applicator.h index 972f51f0..0a957c3 100644 --- a/chromeos/network/policy_applicator.h +++ b/chromeos/network/policy_applicator.h
@@ -81,21 +81,23 @@ void GetProfilePropertiesError(const std::string& error_name, const std::string& error_message); - // Called with the properties of the profile entry |entry|. Checks whether the - // entry was previously managed, whether a current policy applies and then - // either updates, deletes or not touches the entry. - void GetEntryCallback(const std::string& entry, base::Value entry_properties); - void GetEntryError(const std::string& entry, + // Called with the properties of the profile entry |entry_identifier|. Checks + // whether the entry was previously managed, whether a current policy applies + // and then either updates, deletes or not touches the entry. + void GetEntryCallback(const std::string& entry_identifier, + base::Value entry_properties); + void GetEntryError(const std::string& entry_identifier, const std::string& error_name, const std::string& error_message); - // Applies |new_policy| for |entry|. + // Applies |new_policy| for |entry_identifier|. // |entry_properties| are the current properties for the entry. |ui_data| is // the NetworkUIData extracted from |entry_properties| and is passed so it // doesn't have to be re-extracted. |old_guid| is the current GUID of the // entry and may be empty. - // |callback| will be called when policy application for |entry| has finished. - void ApplyNewPolicy(const std::string& entry, + // |callback| will be called when policy application for |entry_identifier| + // has finished. + void ApplyNewPolicy(const std::string& entry_identifier, const base::Value& entry_properties, std::unique_ptr<NetworkUIData> ui_data, const std::string& old_guid, @@ -103,18 +105,20 @@ const base::Value& new_policy, base::OnceClosure callback); - // Applies the global network policy (if any) on |entry|, + // Applies the global network policy (if any) on |entry_identifier|, // |entry_properties|} are the current properties for the entry. - // |callback| will be called when policy application for |entry| has finished - // or immediately if no global network policy is present. + // |callback| will be called when policy application for |entry_identifier| + // has finished or immediately if no global network policy is present. void ApplyGlobalPolicyOnUnmanagedEntry( - const std::string& entry, + const std::string& entry_identifier, const base::DictionaryValue& entry_properties, base::OnceClosure callback); - // Sends Shill the command to delete profile entry |entry| from |profile_|. - // |callback| will be called when the profile entry has been deleted in shill. - void DeleteEntry(const std::string& entry, base::OnceClosure callback); + // Sends Shill the command to delete profile entry |entry_identifier| from + // |profile_|. |callback| will be called when the profile entry has been + // deleted in shill. + void DeleteEntry(const std::string& entry_identifier, + base::OnceClosure callback); // Applies |shill_dictionary| in shill. |policy_ is the ONC policy blob which // lead to the policy application. |callback| will be called when policy @@ -124,19 +128,19 @@ base::Value policy, base::OnceClosure callback); - // Removes |entry| from the list of pending profile entries. + // Removes |entry_identifier| from the list of pending profile entries. // If all entries were processed, applies the remaining policies and notifies // |handler_|. - void ProfileEntryFinished(const std::string& entry); + void ProfileEntryFinished(const std::string& entry_identifier); // Creates new entries for all remaining policies, i.e. for which no matching // Profile entry was found. // This should only be called if all profile entries were processed. void ApplyRemainingPolicies(); - // This is called when the remaining policy application for |entry| scheduled + // This is called when the remaining policy application for |guid| scheduled // by ApplyRemainingPolicies has finished. - void RemainingPolicyApplied(const std::string& entry); + void RemainingPolicyApplied(const std::string& guid); // Called after all policies are applied or an error occurred. Notifies // |handler_|.
diff --git a/chromeos/network/portal_detector/network_portal_detector_strategy.h b/chromeos/network/portal_detector/network_portal_detector_strategy.h index 20b8e8ed..795df3f 100644 --- a/chromeos/network/portal_detector/network_portal_detector_strategy.h +++ b/chromeos/network/portal_detector/network_portal_detector_strategy.h
@@ -13,6 +13,12 @@ #include "base/time/time.h" #include "net/base/backoff_entry.h" +// TODO(https://crbug.com/1164001): remove after moving to ash/. +namespace ash { +class NetworkPortalDetectorImplTest; +class NetworkPortalDetectorImplBrowserTest; +} // namespace ash + namespace chromeos { class COMPONENT_EXPORT(CHROMEOS_NETWORK) PortalDetectorStrategy { @@ -77,8 +83,8 @@ std::unique_ptr<net::BackoffEntry> backoff_entry_; private: - friend class NetworkPortalDetectorImplTest; - friend class NetworkPortalDetectorImplBrowserTest; + friend class ash::NetworkPortalDetectorImplTest; + friend class ash::NetworkPortalDetectorImplBrowserTest; static void set_delay_till_next_attempt_for_testing( const base::TimeDelta& timeout) {
diff --git a/chromeos/network/proxy/proxy_config_handler.h b/chromeos/network/proxy/proxy_config_handler.h index cd29a32..a6ad9ec 100644 --- a/chromeos/network/proxy/proxy_config_handler.h +++ b/chromeos/network/proxy/proxy_config_handler.h
@@ -40,4 +40,11 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace ash { +namespace proxy_config { +using ::chromeos::proxy_config::SetProxyConfigForNetwork; +} +} // namespace ash + #endif // CHROMEOS_NETWORK_PROXY_PROXY_CONFIG_HANDLER_H_
diff --git a/components/account_manager_core/chromeos/account_manager.h b/components/account_manager_core/chromeos/account_manager.h index 8a72406..90e2973c 100644 --- a/components/account_manager_core/chromeos/account_manager.h +++ b/components/account_manager_core/chromeos/account_manager.h
@@ -110,7 +110,7 @@ // |AccountManager| does not persist any data to disk. // |request_context| is a non-owning pointer. // |delay_network_call_runner| is basically a wrapper for - // |chromeos::DelayNetworkCall|. Cannot use |chromeos::DelayNetworkCall| due + // |ash::DelayNetworkCall|. Cannot use |ash::DelayNetworkCall| due // to linking/dependency constraints. // This method MUST be called at least once in the lifetime of AccountManager. void Initialize( @@ -391,8 +391,8 @@ // All tokens, if channel bound, are bound to |url_loader_factory_|. scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_; - // An indirect way to access |chromeos::DelayNetworkCall|. We cannot use - // |chromeos::DelayNetworkCall| directly here due to linking/dependency + // An indirect way to access `ash::DelayNetworkCall`. We cannot use + // `ash::DelayNetworkCall` directly here due to linking/dependency // issues. DelayNetworkCallRunner delay_network_call_runner_;
diff --git a/components/certificate_transparency/data/log_list.json b/components/certificate_transparency/data/log_list.json index 6d5a8986..9bf8ab86 100644 --- a/components/certificate_transparency/data/log_list.json +++ b/components/certificate_transparency/data/log_list.json
@@ -1,6 +1,6 @@ { - "version": "4.84", - "log_list_timestamp": "2022-01-09T01:33:59Z", + "version": "4.85", + "log_list_timestamp": "2022-01-10T01:34:22Z", "operators": [ { "name": "Google",
diff --git a/components/embedder_support/android/metrics/BUILD.gn b/components/embedder_support/android/metrics/BUILD.gn index a8e6ab26..adff06ed 100644 --- a/components/embedder_support/android/metrics/BUILD.gn +++ b/components/embedder_support/android/metrics/BUILD.gn
@@ -70,6 +70,7 @@ "//base/test:test_support", "//components/metrics", "//components/prefs:test_support", + "//components/variations/service:constants", "//content/test:test_support", "//testing/gtest", ]
diff --git a/components/embedder_support/android/metrics/DEPS b/components/embedder_support/android/metrics/DEPS index aef2f182..0ddc4e3 100644 --- a/components/embedder_support/android/metrics/DEPS +++ b/components/embedder_support/android/metrics/DEPS
@@ -2,6 +2,7 @@ "+components/metrics", "+components/prefs", "+components/ukm", + "+components/variations/service/variations_safe_mode_constants.h", "+components/version_info", "+content/public/browser", "+content/public/test",
diff --git a/components/embedder_support/android/metrics/android_metrics_service_client.cc b/components/embedder_support/android/metrics/android_metrics_service_client.cc index 0926baa08..cf77d615 100644 --- a/components/embedder_support/android/metrics/android_metrics_service_client.cc +++ b/components/embedder_support/android/metrics/android_metrics_service_client.cc
@@ -11,6 +11,7 @@ #include "base/android/jni_android.h" #include "base/android/jni_string.h" #include "base/base_paths_android.h" +#include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/i18n/rtl.h" #include "base/metrics/field_trial_params.h" @@ -233,9 +234,7 @@ ukm::UkmService::RegisterPrefs(registry); } -void AndroidMetricsServiceClient::Initialize( - const base::FilePath& user_data_dir, - PrefService* pref_service) { +void AndroidMetricsServiceClient::Initialize(PrefService* pref_service) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!init_finished_); @@ -244,8 +243,11 @@ // TODO(crbug/1245347): If and when the Extended Variations Safe Mode // experiment is enabled on Android WebLayer, pass the channel to the // MetricsStateManager. + // + // Pass an empty file path since the path is for the Extended Variations Safe + // Mode experiment and Android embedders are excluded from this experiment. metrics_state_manager_ = MetricsStateManager::Create( - pref_service_, this, std::wstring(), user_data_dir); + pref_service_, this, std::wstring(), base::FilePath()); // Creates the FieldTrialList using the low entropy provider. The low entropy // provider is used instead of the default provider because the default
diff --git a/components/embedder_support/android/metrics/android_metrics_service_client.h b/components/embedder_support/android/metrics/android_metrics_service_client.h index d829b38..d21a3867f 100644 --- a/components/embedder_support/android/metrics/android_metrics_service_client.h +++ b/components/embedder_support/android/metrics/android_metrics_service_client.h
@@ -9,7 +9,6 @@ #include <string> #include "base/callback_forward.h" -#include "base/files/file_path.h" #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/metrics/field_trial.h" @@ -107,11 +106,7 @@ // Initializes, but does not necessarily start, the MetricsService. See the // documentation at the top of the file for more details. - // - // |user_data_dir| is the path to the client's user data directory. If empty, - // a separate file will not be used for Variations Safe Mode prefs. - void Initialize(const base::FilePath& user_data_dir, - PrefService* pref_service); + void Initialize(PrefService* pref_service); void SetHaveMetricsConsent(bool user_consent, bool app_consent); void SetFastStartupForTesting(bool fast_startup_for_testing); void SetUploadIntervalForTesting(const base::TimeDelta& upload_interval);
diff --git a/components/embedder_support/android/metrics/android_metrics_service_client_unittest.cc b/components/embedder_support/android/metrics/android_metrics_service_client_unittest.cc index bacd04f..ce83e198 100644 --- a/components/embedder_support/android/metrics/android_metrics_service_client_unittest.cc +++ b/components/embedder_support/android/metrics/android_metrics_service_client_unittest.cc
@@ -9,6 +9,7 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/memory/scoped_refptr.h" +#include "base/metrics/field_trial.h" #include "base/metrics/persistent_histogram_allocator.h" #include "base/path_service.h" #include "base/run_loop.h" @@ -20,6 +21,7 @@ #include "components/metrics/metrics_switches.h" #include "components/metrics/persistent_histograms.h" #include "components/prefs/testing_pref_service.h" +#include "components/variations/service/variations_safe_mode_constants.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" @@ -43,10 +45,6 @@ ~TestClient() override = default; - void Initialize(PrefService* pref_service) { - AndroidMetricsServiceClient::Initialize(base::FilePath(), pref_service); - } - bool IsRecordingActive() { auto* service = GetMetricsService(); if (service) @@ -155,6 +153,17 @@ scoped_refptr<base::TestSimpleTaskRunner> task_runner_; }; +// Verify that the Extended Variations Safe Mode experiment is disabled on +// Android embedders. +TEST_F(AndroidMetricsServiceClientTest, + ExtendedVariationsSafeModeExperimentDisabled) { + auto prefs = CreateTestPrefs(); + auto client = std::make_unique<TestClient>(); + client->Initialize(prefs.get()); + EXPECT_FALSE( + base::FieldTrialList::IsTrialActive(variations::kExtendedSafeModeTrial)); +} + TEST_F(AndroidMetricsServiceClientTest, TestSetConsentTrueBeforeInit) { auto prefs = CreateTestPrefs(); auto client = std::make_unique<TestClient>();
diff --git a/components/embedder_support/user_agent_utils.cc b/components/embedder_support/user_agent_utils.cc index 0c5532b..8fa2d7f 100644 --- a/components/embedder_support/user_agent_utils.cc +++ b/components/embedder_support/user_agent_utils.cc
@@ -273,6 +273,8 @@ return GetUserAgentBrandFullVersionList(enable_updated_grease_by_policy); } +} // namespace + std::string GetProduct(const bool allow_version_override) { // FF Priority 1: force major version to 99 and minor version to major version // number. @@ -296,12 +298,6 @@ return version_info::GetProductNameAndVersionForUserAgent(); } -} // namespace - -std::string GetProduct() { - return GetProduct(/*allow_version_override=*/false); -} - std::string GetUserAgent() { base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(kUserAgent)) {
diff --git a/components/embedder_support/user_agent_utils.h b/components/embedder_support/user_agent_utils.h index 4627f8b..f51296e 100644 --- a/components/embedder_support/user_agent_utils.h +++ b/components/embedder_support/user_agent_utils.h
@@ -22,10 +22,11 @@ namespace embedder_support { -// Returns the product string, e.g. "Chrome/98.0.4521.0". It's possible to have -// a mismatch between the product's version number and the version number in the -// User-Agent string, if there are flag-enabled overrides. -std::string GetProduct(); +// Returns the product string, e.g. "Chrome/98.0.4521.0". If `allow_override` +// is set to true, it's possible to have a mismatch between the product's +// version number and the version number in the User-Agent string if there are +// flag-enabled overrides. +std::string GetProduct(bool allow_override = false); // Returns the user agent string for Chrome. std::string GetFullUserAgent();
diff --git a/components/embedder_support/user_agent_utils_unittest.cc b/components/embedder_support/user_agent_utils_unittest.cc index e8ef75e2..8d2e7d8 100644 --- a/components/embedder_support/user_agent_utils_unittest.cc +++ b/components/embedder_support/user_agent_utils_unittest.cc
@@ -26,7 +26,7 @@ #include "third_party/blink/public/common/user_agent/user_agent_metadata.h" #include "third_party/re2/src/re2/re2.h" -#if defined(USE_OZONE) +#if defined(OS_POSIX) #include <sys/utsname.h> #endif @@ -51,6 +51,19 @@ static constexpr char kChromeProductVersionRegex[] = "Chrome/([0-9]+).([0-9]+).([0-9]+).([0-9]+)"; +#if defined(OS_LINUX) || defined(OS_CHROMEOS) +std::string GetMachine() { + struct utsname unixinfo; + uname(&unixinfo); + std::string machine = unixinfo.machine; + if (strcmp(unixinfo.machine, "x86_64") == 0 && + sizeof(void*) == sizeof(int32_t)) { + machine = "i686 (x86_64)"; + } + return machine; +} +#endif + void CheckUserAgentStringOrdering(bool mobile_device) { std::vector<std::string> pieces; @@ -131,42 +144,33 @@ ASSERT_LE(0, value); ASSERT_TRUE(base::StringToInt(pieces[2], &value)); ASSERT_LE(0, value); -#elif defined(USE_OZONE) - // X11; Linux x86_64 +#elif defined(OS_CHROMEOS) // X11; CrOS armv7l 4537.56.0 - struct utsname unixinfo; - uname(&unixinfo); - std::string machine = unixinfo.machine; - if (strcmp(unixinfo.machine, "x86_64") == 0 && - sizeof(void*) == sizeof(int32_t)) { - machine = "i686 (x86_64)"; - } ASSERT_EQ(2u, pieces.size()); ASSERT_EQ("X11", pieces[0]); pieces = base::SplitStringUsingSubstr(pieces[1], " ", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); -#if defined(OS_CHROMEOS) - // X11; CrOS armv7l 4537.56.0 - // ^^ ASSERT_EQ(3u, pieces.size()); ASSERT_EQ("CrOS", pieces[0]); - ASSERT_EQ(machine, pieces[1]); + ASSERT_EQ(GetMachine(), pieces[1]); pieces = base::SplitStringUsingSubstr(pieces[2], ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); for (unsigned int i = 1; i < pieces.size(); ++i) { int value; ASSERT_TRUE(base::StringToInt(pieces[i], &value)); } -#else +#elif defined(OS_LINUX) // X11; Linux x86_64 - // ^^ + ASSERT_EQ(2u, pieces.size()); + ASSERT_EQ("X11", pieces[0]); + pieces = base::SplitStringUsingSubstr(pieces[1], " ", base::KEEP_WHITESPACE, + base::SPLIT_WANT_ALL); ASSERT_EQ(2u, pieces.size()); // This may not be Linux in all cases in the wild, but it is on the bots. ASSERT_EQ("Linux", pieces[0]); - ASSERT_EQ(machine, pieces[1]); -#endif + ASSERT_EQ(GetMachine(), pieces[1]); #elif defined(OS_ANDROID) - // Linux; Android 7.1.1; Samsung Chromebook 3 + // Linux; Android 7.1.1; Pixel 2 ASSERT_GE(3u, pieces.size()); ASSERT_EQ("Linux", pieces[0]); std::string model; @@ -195,6 +199,8 @@ ASSERT_EQ(2u, pieces.size()); ASSERT_EQ("X11", pieces[0]); ASSERT_EQ("Fuchsia", pieces[1]); +#else +#error Unsupported platform #endif // Check that the version numbers match. @@ -757,13 +763,24 @@ } TEST_P(UserAgentUtilsTest, GetProduct) { - const std::string product = GetProduct(); + std::string product = GetProduct(/*allow_override=*/false); std::string major_version; EXPECT_TRUE( re2::RE2::FullMatch(product, kChromeProductVersionRegex, &major_version)); // Whether the force M100 experiment is on or not, the product value should // contain the actual major version number which is 0. EXPECT_EQ(major_version, version_info::GetMajorVersionNumber()); + + // Allow overrides in the product version. + product = GetProduct(/*allow_override=*/true); + major_version.clear(); + EXPECT_TRUE( + re2::RE2::FullMatch(product, kChromeProductVersionRegex, &major_version)); + if (ForceMajorVersionTo100()) { + EXPECT_EQ(major_version, "100"); + } else { + EXPECT_EQ(major_version, version_info::GetMajorVersionNumber()); + } } TEST_P(UserAgentUtilsTest, GetUserAgent) {
diff --git a/components/exo/layer_tree_frame_sink_holder.cc b/components/exo/layer_tree_frame_sink_holder.cc index 4aef196..11f20135 100644 --- a/components/exo/layer_tree_frame_sink_holder.cc +++ b/components/exo/layer_tree_frame_sink_holder.cc
@@ -62,8 +62,7 @@ frame.render_pass_list.push_back(std::move(pass)); holder->last_frame_resources_.clear(); holder->frame_sink_->SubmitCompositorFrame(std::move(frame), - /*hit_test_data_changed=*/true, - /*show_hit_test_borders=*/false); + /*hit_test_data_changed=*/true); // Delete sink holder immediately if not waiting for resources to be // reclaimed. @@ -92,8 +91,7 @@ for (auto& resource : frame.resource_list) last_frame_resources_.push_back(resource.id); frame_sink_->SubmitCompositorFrame(std::move(frame), - /*hit_test_data_changed=*/true, - /*show_hit_test_borders=*/false); + /*hit_test_data_changed=*/true); } void LayerTreeFrameSinkHolder::DidNotProduceFrame(
diff --git a/components/global_media_controls/public/media_item_manager.h b/components/global_media_controls/public/media_item_manager.h index 0c84089..e53b7a1 100644 --- a/components/global_media_controls/public/media_item_manager.h +++ b/components/global_media_controls/public/media_item_manager.h
@@ -5,6 +5,7 @@ #ifndef COMPONENTS_GLOBAL_MEDIA_CONTROLS_PUBLIC_MEDIA_ITEM_MANAGER_H_ #define COMPONENTS_GLOBAL_MEDIA_CONTROLS_PUBLIC_MEDIA_ITEM_MANAGER_H_ +#include <memory> #include <string> #include "base/component_export.h"
diff --git a/components/keyed_service/core/dependency_manager.cc b/components/keyed_service/core/dependency_manager.cc index 006914ba..553c937 100644 --- a/components/keyed_service/core/dependency_manager.cc +++ b/components/keyed_service/core/dependency_manager.cc
@@ -159,15 +159,11 @@ void DependencyManager::AssertContextWasntDestroyed(void* context) const { if (dead_context_pointers_.find(context) != dead_context_pointers_.end()) { -#if DCHECK_IS_ON() - NOTREACHED() << "Attempted to access a context that was ShutDown(). " + // We want to see all possible use-after-destroy in production environment. + CHECK(false) << "Attempted to access a context that was ShutDown(). " << "This is most likely a heap smasher in progress. After " << "KeyedService::Shutdown() completes, your service MUST " << "NOT refer to depended services again."; -#else // DCHECK_IS_ON() - // We want to see all possible use-after-destroy in production environment. - base::debug::DumpWithoutCrashing(); -#endif // DCHECK_IS_ON() } }
diff --git a/components/keyed_service/core/dependency_manager.h b/components/keyed_service/core/dependency_manager.h index 9174ae93..b2712da 100644 --- a/components/keyed_service/core/dependency_manager.h +++ b/components/keyed_service/core/dependency_manager.h
@@ -75,8 +75,8 @@ void DestroyContextServices(void* context); // Runtime assertion called as a part of GetServiceForContext() to check if - // |context| is considered stale. This will NOTREACHED() or - // base::debug::DumpWithoutCrashing() depending on the DCHECK_IS_ON() value. + // |context| is considered stale. This will CHECK(false) to avoid a potential + // use-after-free from services created after context destruction. void AssertContextWasntDestroyed(void* context) const; // Marks |context| as live (i.e., not stale). This method can be called as a
diff --git a/components/optimization_guide/core/DEPS b/components/optimization_guide/core/DEPS index 3ab01bf..74dc5df 100644 --- a/components/optimization_guide/core/DEPS +++ b/components/optimization_guide/core/DEPS
@@ -1,7 +1,5 @@ include_rules = [ "+components/ukm/test_ukm_recorder.h", "+services/metrics/public/cpp", - "+third_party/abseil-cpp/absl/types/optional.h", - "+third_party/abseil-cpp/absl/status/status.h", "+ui/base/l10n", ]
diff --git a/components/optimization_guide/core/base_model_executor.h b/components/optimization_guide/core/base_model_executor.h index 76bd8b9..78e064b4 100644 --- a/components/optimization_guide/core/base_model_executor.h +++ b/components/optimization_guide/core/base_model_executor.h
@@ -69,9 +69,9 @@ } // InferenceDelegate: - absl::Status Preprocess(const std::vector<TfLiteTensor*>& input_tensors, - InputTypes... input) override = 0; - OutputType Postprocess( + bool Preprocess(const std::vector<TfLiteTensor*>& input_tensors, + InputTypes... input) override = 0; + absl::optional<OutputType> Postprocess( const std::vector<const TfLiteTensor*>& output_tensors) override = 0; };
diff --git a/components/optimization_guide/core/base_model_executor_helpers.h b/components/optimization_guide/core/base_model_executor_helpers.h index 0b9717e..986ce045 100644 --- a/components/optimization_guide/core/base_model_executor_helpers.h +++ b/components/optimization_guide/core/base_model_executor_helpers.h
@@ -11,6 +11,7 @@ #include "base/check.h" #include "base/memory/raw_ptr.h" #include "components/optimization_guide/core/execution_status.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/base_task_api.h" namespace optimization_guide { @@ -18,13 +19,13 @@ template <class OutputType, class... InputTypes> class InferenceDelegate { public: - // Preprocesses |args| into |input_tensors|. - virtual absl::Status Preprocess( - const std::vector<TfLiteTensor*>& input_tensors, - InputTypes... args) = 0; + // Preprocesses |args| into |input_tensors|. Returns true on success. + virtual bool Preprocess(const std::vector<TfLiteTensor*>& input_tensors, + InputTypes... args) = 0; - // Postprocesses |output_tensors| into the desired |OutputType|. - virtual OutputType Postprocess( + // Postprocesses |output_tensors| into the desired |OutputType|, returning + // absl::nullopt on error. + virtual absl::optional<OutputType> Postprocess( const std::vector<const TfLiteTensor*>& output_tensors) = 0; }; @@ -59,12 +60,24 @@ // BaseTaskApi: absl::Status Preprocess(const std::vector<TfLiteTensor*>& input_tensors, InputTypes... args) override { - return delegate_->Preprocess(input_tensors, args...); + bool success = delegate_->Preprocess(input_tensors, args...); + if (success) { + return absl::OkStatus(); + } + return absl::InternalError( + "error during preprocessing. See stderr for more information if " + "available"); } tflite::support::StatusOr<OutputType> Postprocess( const std::vector<const TfLiteTensor*>& output_tensors, InputTypes... api_inputs) override { - return delegate_->Postprocess(output_tensors); + absl::optional<OutputType> output = delegate_->Postprocess(output_tensors); + if (!output) { + return absl::InternalError( + "error during postprocessing. See stderr for more infomation if " + "available"); + } + return *output; } private:
diff --git a/components/optimization_guide/core/model_validator.cc b/components/optimization_guide/core/model_validator.cc index 65a9bd5f..bb09c0c 100644 --- a/components/optimization_guide/core/model_validator.cc +++ b/components/optimization_guide/core/model_validator.cc
@@ -53,22 +53,21 @@ ModelValidatorExecutor::~ModelValidatorExecutor() = default; -absl::Status ModelValidatorExecutor::Preprocess( +bool ModelValidatorExecutor::Preprocess( const std::vector<TfLiteTensor*>& input_tensors, const std::vector<float>& input) { // Return error so that actual model execution does not happen. - return absl::Status(absl::StatusCode::kUnimplemented, - "Model execution not supported"); + return false; } -float ModelValidatorExecutor::Postprocess( +absl::optional<float> ModelValidatorExecutor::Postprocess( const std::vector<const TfLiteTensor*>& output_tensors) { std::vector<float> data; absl::Status status = tflite::task::core::PopulateVector<float>(output_tensors[0], &data); if (!status.ok()) { NOTREACHED(); - return -1; + return absl::nullopt; } return data[0]; }
diff --git a/components/optimization_guide/core/model_validator.h b/components/optimization_guide/core/model_validator.h index 4e48f4f..fc25cf6b 100644 --- a/components/optimization_guide/core/model_validator.h +++ b/components/optimization_guide/core/model_validator.h
@@ -53,9 +53,9 @@ protected: // BaseModelExecutor: - absl::Status Preprocess(const std::vector<TfLiteTensor*>& input_tensors, - const std::vector<float>& input) override; - float Postprocess( + bool Preprocess(const std::vector<TfLiteTensor*>& input_tensors, + const std::vector<float>& input) override; + absl::optional<float> Postprocess( const std::vector<const TfLiteTensor*>& output_tensors) override; };
diff --git a/components/optimization_guide/core/test_model_executor.h b/components/optimization_guide/core/test_model_executor.h index 42dd3cfc..9935bfb6 100644 --- a/components/optimization_guide/core/test_model_executor.h +++ b/components/optimization_guide/core/test_model_executor.h
@@ -6,7 +6,6 @@ #define COMPONENTS_OPTIMIZATION_GUIDE_CORE_TEST_MODEL_EXECUTOR_H_ #include "components/optimization_guide/core/model_executor.h" -#include "third_party/abseil-cpp/absl/status/status.h" namespace optimization_guide {
diff --git a/components/optimization_guide/core/test_tflite_model_executor.cc b/components/optimization_guide/core/test_tflite_model_executor.cc index 09697f7d..a310697 100644 --- a/components/optimization_guide/core/test_tflite_model_executor.cc +++ b/components/optimization_guide/core/test_tflite_model_executor.cc
@@ -8,13 +8,14 @@ namespace optimization_guide { -absl::Status TestTFLiteModelExecutor::Preprocess( +bool TestTFLiteModelExecutor::Preprocess( const std::vector<TfLiteTensor*>& input_tensors, const std::vector<float>& input) { - return tflite::task::core::PopulateTensor<float>(input, input_tensors[0]); + return tflite::task::core::PopulateTensor<float>(input, input_tensors[0]) + .ok(); } -std::vector<float> TestTFLiteModelExecutor::Postprocess( +absl::optional<std::vector<float>> TestTFLiteModelExecutor::Postprocess( const std::vector<const TfLiteTensor*>& output_tensors) { std::vector<float> data; absl::Status status =
diff --git a/components/optimization_guide/core/test_tflite_model_executor.h b/components/optimization_guide/core/test_tflite_model_executor.h index ac33fd33..39c99e45 100644 --- a/components/optimization_guide/core/test_tflite_model_executor.h +++ b/components/optimization_guide/core/test_tflite_model_executor.h
@@ -16,10 +16,10 @@ ~TestTFLiteModelExecutor() override = default; protected: - absl::Status Preprocess(const std::vector<TfLiteTensor*>& input_tensors, - const std::vector<float>& input) override; + bool Preprocess(const std::vector<TfLiteTensor*>& input_tensors, + const std::vector<float>& input) override; - std::vector<float> Postprocess( + absl::optional<std::vector<float>> Postprocess( const std::vector<const TfLiteTensor*>& output_tensors) override; };
diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc index 8f3fc9c..ec3652c7 100644 --- a/components/password_manager/core/browser/password_store.cc +++ b/components/password_manager/core/browser/password_store.cc
@@ -365,21 +365,55 @@ absl::optional<PasswordStoreChangeList> changes) { DCHECK(main_task_runner_->RunsTasksInCurrentSequence()); - // TODO(crbug.com/1267912): Rerequest full list if `!changes.has_value()`. - - if (changes->empty()) - return; - // Don't propagate reference to this store after its shutdown. No caller // should expect any notifications from a shut down store in any case. if (!backend_) return; +#if defined(OS_ANDROID) + if (!changes.has_value()) { + // If the changes aren't provided, the store propagates the latest logins. + backend_->GetAllLoginsAsync(base::BindOnce( + &PasswordStore::NotifyLoginsRetainedOnMainSequence, this)); + return; + } +#else + DCHECK(changes.has_value()) + << "Non-Android platforms can always compute changes!"; +#endif + + if (changes->empty()) + return; + for (auto& observer : observers_) { observer.OnLoginsChanged(this, changes.value()); } } +void PasswordStore::NotifyLoginsRetainedOnMainSequence( + LoginsResultOrError result) { + DCHECK(main_task_runner_->RunsTasksInCurrentSequence()); + // Don't propagate reference to this store after its shutdown. No caller + // should expect any notifications from a shut down store in any case. + if (!backend_) + return; + + // Clients don't expect errors yet, so just wait for the next notification. + if (absl::holds_alternative<PasswordStoreBackendError>(result)) { + return; + } + + std::vector<PasswordForm> retained_logins; + retained_logins.reserve(absl::get<LoginsResult>(result).size()); + for (auto& login : absl::get<LoginsResult>(result)) { + retained_logins.push_back(std::move(*login)); + } + + for (auto& observer : observers_) { + observer.OnLoginsRetained(this, retained_logins); + } +} + void PasswordStore::NotifySyncEnabledOrDisabledOnMainSequence() { DCHECK(main_task_runner_->RunsTasksInCurrentSequence()); sync_enabled_or_disabled_cb_.Run();
diff --git a/components/password_manager/core/browser/password_store.h b/components/password_manager/core/browser/password_store.h index ff0fddb9..ba2a6ec1 100644 --- a/components/password_manager/core/browser/password_store.h +++ b/components/password_manager/core/browser/password_store.h
@@ -153,10 +153,15 @@ // |init_status_|. void OnInitCompleted(bool success); - // Notifies observers that password store data may have been changed. + // Notifies observers that password store data may have been changed. If + // available, it forwards the changes to observers. Otherwise, all logins are + // requested and forwarded to `NotifyLoginsRetainedOnMainSequence`. void NotifyLoginsChangedOnMainSequence( absl::optional<PasswordStoreChangeList> changes); + // Notifies observers with all logins remaining after a modifying operation. + void NotifyLoginsRetainedOnMainSequence(LoginsResultOrError result); + // Called when the backend reports that sync has been enabled or disabled. void NotifySyncEnabledOrDisabledOnMainSequence();
diff --git a/components/password_manager/core/browser/password_store_unittest.cc b/components/password_manager/core/browser/password_store_unittest.cc index 6872600..c09613d0 100644 --- a/components/password_manager/core/browser/password_store_unittest.cc +++ b/components/password_manager/core/browser/password_store_unittest.cc
@@ -1099,6 +1099,46 @@ store->ShutdownOnUIThread(); } +#if defined(OS_ANDROID) +TEST_F(PasswordStoreTest, CallOnLoginsRetainedIfUpdateProvidesNoChanges) { + std::vector<std::unique_ptr<PasswordForm>> all_credentials; + all_credentials.push_back(FillPasswordFormWithData( + CreateTestPasswordFormDataByOrigin(kTestWebRealm1))); + all_credentials.push_back(FillPasswordFormWithData( + CreateTestPasswordFormDataByOrigin(kTestAndroidRealm1))); + const PasswordForm kTestForm = *all_credentials[0]; + const PasswordForm kOtherForm = *all_credentials[1]; + MockPasswordStoreObserver mock_observer; + scoped_refptr<PasswordStore> store; + MockPasswordStoreBackend* mock_backend; + std::tie(store, mock_backend) = CreateUnownedStoreWithOwnedMockBackend(); + store->Init(/*prefs=*/nullptr, /*affiliated_match_helper=*/nullptr); + store->AddObserver(&mock_observer); + + // Expect that observers receive the full list if the backend invokes the + // reply with a nullopt. + EXPECT_CALL(*mock_backend, UpdateLoginAsync(Eq(kTestForm), _)) + .WillOnce( + WithArg<1>(Invoke([](PasswordStoreChangeListReply reply) -> void { + std::move(reply).Run(absl::nullopt); + }))); + EXPECT_CALL(*mock_backend, GetAllLoginsAsync(_)) + .WillOnce(WithArg<0>( + Invoke([&all_credentials](LoginsOrErrorReply reply) -> void { + std::move(reply).Run(std::move(all_credentials)); + }))); + EXPECT_CALL(mock_observer, OnLoginsChanged).Times(0); + EXPECT_CALL(mock_observer, + OnLoginsRetained(store.get(), + UnorderedElementsAre(kTestForm, kOtherForm))); + store->UpdateLogin(kTestForm); + WaitForPasswordStore(); + + store->RemoveObserver(&mock_observer); + store->ShutdownOnUIThread(); +} +#endif // OS_ANDROID + TEST_F(PasswordStoreTest, GetAllLogins) { static constexpr PasswordFormData kTestCredentials[] = { {PasswordForm::Scheme::kHtml, kTestAndroidRealm1, "", "", u"", u"", u"", @@ -1205,7 +1245,6 @@ EXPECT_CALL(mock_consumer, OnGetPasswordStoreResultsConstRef( UnorderedPasswordFormElementsAre(&expected_results))); - LoginsOrErrorReply callback; EXPECT_CALL(*mock_backend, GetAllLoginsAsync) .WillOnce([&all_credentials](LoginsOrErrorReply callback) { std::move(callback).Run(std::move(all_credentials));
diff --git a/components/permissions/prediction_service/prediction_model_executor.cc b/components/permissions/prediction_service/prediction_model_executor.cc index 1fd7298..1eaa250 100644 --- a/components/permissions/prediction_service/prediction_model_executor.cc +++ b/components/permissions/prediction_service/prediction_model_executor.cc
@@ -14,7 +14,7 @@ PredictionModelExecutor::PredictionModelExecutor() = default; PredictionModelExecutor::~PredictionModelExecutor() = default; -absl::Status PredictionModelExecutor::Preprocess( +bool PredictionModelExecutor::Preprocess( const std::vector<TfLiteTensor*>& input_tensors, const GeneratePredictionsRequest& input) { switch (input.permission_features()[0].permission_type_case()) { @@ -28,101 +28,106 @@ NOTREACHED(); } - absl::Status status = tflite::task::core::PopulateTensor<float>( - input.client_features().client_stats().avg_deny_rate(), input_tensors[0]); - if (!status.ok()) { - return status; + if (!tflite::task::core::PopulateTensor<float>( + input.client_features().client_stats().avg_deny_rate(), + input_tensors[0]) + .ok()) { + return false; } - status = tflite::task::core::PopulateTensor<float>( - input.client_features().client_stats().avg_dismiss_rate(), - input_tensors[1]); - if (!status.ok()) { - return status; + if (!tflite::task::core::PopulateTensor<float>( + input.client_features().client_stats().avg_dismiss_rate(), + input_tensors[1]) + .ok()) { + return false; } - status = tflite::task::core::PopulateTensor<float>( - input.client_features().client_stats().avg_grant_rate(), - input_tensors[2]); - if (!status.ok()) { - return status; + if (!tflite::task::core::PopulateTensor<float>( + input.client_features().client_stats().avg_grant_rate(), + input_tensors[2]) + .ok()) { + return false; } - status = tflite::task::core::PopulateTensor<float>( - input.client_features().client_stats().avg_ignore_rate(), - input_tensors[3]); - if (!status.ok()) { - return status; + if (!tflite::task::core::PopulateTensor<float>( + input.client_features().client_stats().avg_ignore_rate(), + input_tensors[3]) + .ok()) { + return false; } - status = tflite::task::core::PopulateTensor<float>( - input.permission_features()[0].permission_stats().avg_deny_rate(), - input_tensors[4]); - if (!status.ok()) { - return status; + if (!tflite::task::core::PopulateTensor<float>( + input.permission_features()[0].permission_stats().avg_deny_rate(), + input_tensors[4]) + .ok()) { + return false; } - status = tflite::task::core::PopulateTensor<float>( - input.permission_features()[0].permission_stats().avg_dismiss_rate(), - input_tensors[5]); - if (!status.ok()) { - return status; + if (!tflite::task::core::PopulateTensor<float>( + input.permission_features()[0].permission_stats().avg_dismiss_rate(), + input_tensors[5]) + .ok()) { + return false; } - status = tflite::task::core::PopulateTensor<float>( - input.permission_features()[0].permission_stats().avg_grant_rate(), - input_tensors[6]); - if (!status.ok()) { - return status; + if (!tflite::task::core::PopulateTensor<float>( + input.permission_features()[0].permission_stats().avg_grant_rate(), + input_tensors[6]) + .ok()) { + return false; } - status = tflite::task::core::PopulateTensor<float>( - input.permission_features()[0].permission_stats().avg_ignore_rate(), - input_tensors[7]); - if (!status.ok()) { - return status; + if (!tflite::task::core::PopulateTensor<float>( + input.permission_features()[0].permission_stats().avg_ignore_rate(), + input_tensors[7]) + .ok()) { + return false; } - status = tflite::task::core::PopulateTensor<int64_t>( - static_cast<int64_t>( - input.permission_features()[0].permission_stats().prompts_count()), - input_tensors[8]); - if (!status.ok()) { - return status; + if (!tflite::task::core::PopulateTensor<int64_t>( + static_cast<int64_t>(input.permission_features()[0] + .permission_stats() + .prompts_count()), + input_tensors[8]) + .ok()) { + return false; } - status = tflite::task::core::PopulateTensor<int64_t>( - static_cast<int64_t>( - input.client_features().client_stats().prompts_count()), - input_tensors[9]); - if (!status.ok()) { - return status; + if (!tflite::task::core::PopulateTensor<int64_t>( + static_cast<int64_t>( + input.client_features().client_stats().prompts_count()), + input_tensors[9]) + .ok()) { + return false; } - status = tflite::task::core::PopulateTensor<int64_t>( - static_cast<int64_t>(input.client_features().gesture_enum()), - input_tensors[10]); - if (!status.ok()) { - return status; + if (!tflite::task::core::PopulateTensor<int64_t>( + static_cast<int64_t>(input.client_features().gesture_enum()), + input_tensors[10]) + .ok()) { + return false; } - status = tflite::task::core::PopulateTensor<int64_t>( - static_cast<int64_t>(input.client_features().platform_enum()), - input_tensors[11]); - if (!status.ok()) { - return status; + if (!tflite::task::core::PopulateTensor<int64_t>( + static_cast<int64_t>(input.client_features().platform_enum()), + input_tensors[11]) + .ok()) { + return false; } - return absl::OkStatus(); + return true; } -GeneratePredictionsResponse PredictionModelExecutor::Postprocess( + +absl::optional<GeneratePredictionsResponse> +PredictionModelExecutor::Postprocess( const std::vector<const TfLiteTensor*>& output_tensors) { DCHECK(request_type_ == RequestType::kNotifications || request_type_ == RequestType::kGeolocation); std::vector<float> data; - absl::Status status = - tflite::task::core::PopulateVector<float>(output_tensors[0], &data); - DCHECK(status.ok()); + if (!tflite::task::core::PopulateVector<float>(output_tensors[0], &data) + .ok()) { + return absl::nullopt; + } GeneratePredictionsResponse response; float threshold = request_type_ == RequestType::kNotifications
diff --git a/components/permissions/prediction_service/prediction_model_executor.h b/components/permissions/prediction_service/prediction_model_executor.h index eff3f35..f3f84a9 100644 --- a/components/permissions/prediction_service/prediction_model_executor.h +++ b/components/permissions/prediction_service/prediction_model_executor.h
@@ -25,10 +25,10 @@ protected: // optimization_guide::BaseModelExecutor: - absl::Status Preprocess(const std::vector<TfLiteTensor*>& input_tensors, - const GeneratePredictionsRequest& input) override; + bool Preprocess(const std::vector<TfLiteTensor*>& input_tensors, + const GeneratePredictionsRequest& input) override; - GeneratePredictionsResponse Postprocess( + absl::optional<GeneratePredictionsResponse> Postprocess( const std::vector<const TfLiteTensor*>& output_tensors) override; private:
diff --git a/components/policy/proto/device_management_backend.proto b/components/policy/proto/device_management_backend.proto index 241cec9..f4ca2bd2 100644 --- a/components/policy/proto/device_management_backend.proto +++ b/components/policy/proto/device_management_backend.proto
@@ -503,7 +503,12 @@ // This message is included in serialized form in PolicyFetchResponse below. It // may also be signed, with the signature being created for the serialized form. message PolicyData { - reserved 10; + reserved 10, 13, 14, 18, 19; + reserved "command_invalidation_name"; + reserved "command_invalidation_source"; + reserved "invalidation_name"; + reserved "invalidation_source"; + reserved "valid_serial_number_missing"; // See PolicyFetchRequest.policy_type. optional string policy_type = 1; @@ -574,18 +579,6 @@ // This is only sent as part of device policy fetch. optional string service_account_identity = 12; - // TODO(crbug/1073504): Clean up after legacy Tango shutdown. - // The object source which hosts policy objects within the invalidation - // service. This value is combined with invalidation_name to form the object - // id used to register for invalidations to this policy. - optional int32 invalidation_source = 13; - - // TODO(crbug/1073504): Clean up after legacy Tango shutdown. - // The name which uniquely identifies this policy within the invalidation - // service object source. This value is combined with invalidation_source to - // form the object id used to register for invalidations to this policy. - optional bytes invalidation_name = 14; - // Server-provided identifier of the fetched policy. This is to be used // by the client when requesting Policy Posture assertion through an API // call or SAML flow. For details, see http://go/chrome-nac-server-design. @@ -610,20 +603,6 @@ // Indicates the state that the device should be in. optional DeviceState device_state = 17; - // TODO(crbug/1073504): Clean up after legacy Tango shutdown. - // The object source which hosts command queue objects within the - // invalidation service. This value is combined with - // command_invalidation_name to form the object ID used to - // register for invalidations to the command queue. - optional int32 command_invalidation_source = 18; - - // TODO(crbug/1073504): Clean up after legacy Tango shutdown. - // The name which uniquely identifies this device’s queue within - // the invalidation service object source. This value is combined - // with command_invalidation_source to form the object ID used to - // register for invalidations to the command queue. - optional bytes command_invalidation_name = 19; - // The free-text location info the admin enters to associate the device // with a location. optional string annotated_location = 20;
diff --git a/components/policy/resources/policy_templates_id.xtb b/components/policy/resources/policy_templates_id.xtb index 96a55e4..86dc177 100644 --- a/components/policy/resources/policy_templates_id.xtb +++ b/components/policy/resources/policy_templates_id.xtb
@@ -474,6 +474,7 @@ Jika kebijakan disetel ke Nonaktif, permintaan HTTP yang tidak aman akan dilarang menggunakan skema autentikasi <ph name="BASIC_AUTH" />; hanya HTTPS yang diizinkan. Setelan kebijakan ini akan diabaikan (dan <ph name="BASIC_AUTH" /> akan selalu dilarang) jika kebijakan <ph name="AUTH_SCHEMES_POLICY_NAME" /> disetel dan <ph name="BASIC_AUTH" /> tidak disertakan.</translation> +<translation id="1574258262373444557">Jangan gunakan <ph name="AES_KL_NAME" /> sebagai algoritme enkripsi untuk enkripsi penyimpanan pengguna</translation> <translation id="1575015449587326319">Kebijakan konfigurasi untuk Chrome Enterprise Connector OnFileDownloaded</translation> <translation id="1583248206450240930">Gunakan <ph name="PRODUCT_FRAME_NAME" /> jika tidak diubah</translation> <translation id="1587042984081085960">Kebijakan ini memungkinkan admin menentukan bahwa halaman dapat mengirimkan permintaan XHR sinkron selama penutupan halaman. @@ -605,6 +606,7 @@ <translation id="167514072300004091">Jika kebijakan disetel ke 3, situs akan meminta akses ke perangkat USB yang terhubung. Jika kebijakan disetel ke 2, akses ke perangkat USB yang terhubung akan ditolak. Jika tidak disetel, situs akan meminta akses tetapi pengguna dapat mengubah setelan ini.</translation> +<translation id="1678137412645922426">Mengontrol penggunaan <ph name="AES_KL_NAME" /> untuk enkripsi penyimpanan pengguna jika didukung</translation> <translation id="1682063842123336408">Perlu ruang disk kosong (dalam GB) untuk menginstal <ph name="PLUGIN_VM_NAME" />. Jika kebijakan ini tidak disetel, penginstalan <ph name="PLUGIN_VM_NAME" /> akan gagal jika ruang disk kosong yang tersedia di perangkat kurang dari 20 GB (nilai default). @@ -3892,6 +3894,12 @@ Jika kebijakan ini tidak ditetapkan, tindakan defaultnya adalah tidak diizinkan untuk pengguna yang dikelola perusahaan dan diizinkan untuk pengguna yang tidak dikelola.</translation> <translation id="5584132346604748282">Mengontrol layanan lokasi Google di Android</translation> +<translation id="5585384603219625331">Kebijakan ini mengontrol apakah implementasi <ph name="AES_KL_NAME" /> akan diaktifkan untuk enkripsi penyimpanan pengguna bagi halaman beranda pengguna <ph name="DM_CRYPT" /> di Chrome OS, jika didukung. + + Kebijakan ini hanya berlaku untuk halaman beranda pengguna yang menggunakan enkripsi <ph name="DM_CRYPT" />). Halaman beranda lama milik pengguna (yang tidak menggunakan <ph name="DM_CRYPT" />) tidak mendukung penggunaan <ph name="AES_KL_NAME" /> dan akan menggunakan <ph name="AES_NI_NAME" /> secara default. + + Jika nilai kebijakan ini berubah, halaman beranda pengguna <ph name="DM_CRYPT" /> yang ada akan diakses menggunakan implementasi enkripsi yang dikonfigurasi oleh kebijakan ini karena implementasi <ph name="AES_ALGORITHM_NAME" /> kompatibel. + Jika kebijakan ini dinonaktifkan atau tidak disetel, enkripsi penyimpanan pengguna untuk halaman beranda pengguna <ph name="DM_CRYPT" /> akan menggunakan <ph name="AES_NI_NAME" /> secara default.</translation> <translation id="5586942249556966598">Tidak melakukan apa-apa</translation> <translation id="5598417829613725146">Canvas (didukung sejak versi 90)</translation> <translation id="5599461642204007579">Setelan pengelolaan <ph name="MS_AD_NAME" /></translation> @@ -6550,6 +6558,7 @@ <translation id="8626826495474944836">Memerlukan Isolasi Situs untuk setiap situs</translation> <translation id="8631434304112909927">sampai versi <ph name="UNTIL_VERSION" /></translation> <translation id="8631437968147930597">Daftar aplikasi pencatat yang diizinkan di layar kunci <ph name="PRODUCT_OS_NAME" /></translation> +<translation id="8634062512783775032">Gunakan <ph name="AES_KL_NAME" /> sebagai algoritme enkripsi untuk enkripsi penyimpanan pengguna, jika didukung</translation> <translation id="8637566476051166626">Secara eksplisit mengizinkan port jaringan</translation> <translation id="8643838501942693770">Izinkan cookie pihak ketiga, tetapi izinkan pengguna mengubah setelan ini</translation> <translation id="8648844602494595665">Kebijakan ini mengontrol perlakuan terhadap ikon gembok di omnibox.
diff --git a/components/policy/resources/policy_templates_ko.xtb b/components/policy/resources/policy_templates_ko.xtb index e774afb..7fc7904 100644 --- a/components/policy/resources/policy_templates_ko.xtb +++ b/components/policy/resources/policy_templates_ko.xtb
@@ -475,6 +475,7 @@ 사용 중지하면 <ph name="BASIC_AUTH" /> 인증 스키마를 사용한 비보안 HTTP 요청이 금지되고 보안 HTTPS만 허용됩니다. <ph name="AUTH_SCHEMES_POLICY_NAME" /> 정책이 설정되어 있고 <ph name="BASIC_AUTH" />을 포함하지 않으면 이 정책이 무시되며 <ph name="BASIC_AUTH" />이 항상 금지됩니다.</translation> +<translation id="1574258262373444557">사용자 저장용량 암호화로 <ph name="AES_KL_NAME" /> 알고리즘 사용 안함</translation> <translation id="1575015449587326319">OnFileDownloaded Chrome Enterprise Connector 설정 정책</translation> <translation id="1583248206450240930">기본으로 <ph name="PRODUCT_FRAME_NAME" /> 사용</translation> <translation id="1587042984081085960">이 정책은 페이지를 닫는 중에 페이지에서 동기 XHR 요청을 전송하도록 관리자가 지정할 수 있게 합니다. @@ -596,6 +597,7 @@ <translation id="167514072300004091">정책을 3으로 설정하면 웹사이트에서 연결된 USB 기기 액세스를 요청하도록 허용합니다. 정책을 2로 설정하면 연결된 USB 기기 액세스를 거부합니다. 설정하지 않으면 웹사이트에서 액세스를 요청하도록 허용하지만 사용자가 이 설정을 변경할 수 있습니다.</translation> +<translation id="1678137412645922426">지원되는 경우 사용자 저장용량 암호화로 <ph name="AES_KL_NAME" /> 사용 제어</translation> <translation id="1682063842123336408"><ph name="PLUGIN_VM_NAME" /> 설치에는 GB 단위의 디스크 여유 공간이 필요합니다. 정책을 설정하지 않으면 기기의 디스크 여유 공간이 20GB(기본값) 미만일 경우 <ph name="PLUGIN_VM_NAME" /> 설치에 실패합니다. @@ -3878,6 +3880,12 @@ 이 정책이 설정되지 않으면 기본적으로 엔터프라이즈 관리 사용자의 경우 사용 중지되고 관리되지 않는 사용자의 경우 사용 설정됩니다.</translation> <translation id="5584132346604748282">Android Google 위치 서비스 제어</translation> +<translation id="5585384603219625331">이 정책은 Chrome OS에서 <ph name="DM_CRYPT" /> 사용자 홈의 사용자 저장용량 암호화에 <ph name="AES_KL_NAME" /> 구현이 지원되는 경우 이를 사용할지 제어합니다. + + 이 정책은 <ph name="DM_CRYPT" /> 암호화를 사용하는 사용자 홈에만 적용됩니다. 레거시 사용자 홈(<ph name="DM_CRYPT" /> 암호화를 사용하지 않는 홈)은 <ph name="AES_KL_NAME" /> 사용을 지원하지 않으며 기본값으로 <ph name="AES_NI_NAME" /> 암호화를 사용하게 됩니다. + + 정책 값이 변경되는 경우 기존 <ph name="DM_CRYPT" /> 사용자 홈이 <ph name="AES_ALGORITHM_NAME" /> 구현과 호환되므로 정책에 따라 구성된 암호화 구현을 사용하여 사용자 홈에 액세스할 수 있습니다. + 정책이 사용 중지되거나 설정되지 않은 경우 <ph name="DM_CRYPT" /> 사용자 홈의 기본 저장용량 암호화는 <ph name="AES_NI_NAME" />입니다.</translation> <translation id="5586942249556966598">취소</translation> <translation id="5598417829613725146">캔버스(버전 90 이후 지원)</translation> <translation id="5599461642204007579"><ph name="MS_AD_NAME" /> 관리 설정</translation> @@ -6547,6 +6555,7 @@ <translation id="8626826495474944836">모든 사이트에 사이트 격리 필요</translation> <translation id="8631434304112909927">버전 <ph name="UNTIL_VERSION" /> 이하</translation> <translation id="8631437968147930597"><ph name="PRODUCT_OS_NAME" /> 잠금 화면에서 허용된 메모 앱 목록</translation> +<translation id="8634062512783775032">지원되는 경우 사용자 저장용량 암호화로 <ph name="AES_KL_NAME" /> 알고리즘 사용</translation> <translation id="8637566476051166626">명시적으로 허용된 네트워크 포트</translation> <translation id="8643838501942693770">타사 쿠키를 허용하되 사용자에게 설정 변경 허용</translation> <translation id="8648844602494595665">이 정책은 검색주소창에서 자물쇠 아이콘이 처리되는 방식을 제어합니다.
diff --git a/components/policy/resources/policy_templates_th.xtb b/components/policy/resources/policy_templates_th.xtb index 15c7beb..89e358d 100644 --- a/components/policy/resources/policy_templates_th.xtb +++ b/components/policy/resources/policy_templates_th.xtb
@@ -130,6 +130,7 @@ * ntlm การไม่เลือกเป็นการอนุญาตให้ใช้ทั้ง 3 รูปแบบ</translation> <translation id="1153306961094113710">อนุญาตให้ใช้การแก้ไขข้อบกพร่องจากระยะไกล</translation> +<translation id="115699958189272121">รายงานเหตุการณ์ <ph name="CHROME_REMOTE_DESKTOP_PRODUCT_NAME" /></translation> <translation id="1158844608156732189">การกำหนดค่า Kerberos (1 บรรทัดต่อรายการอาร์เรย์) โปรดดู https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html</translation> <translation id="1160479894929412407">อนุญาตโปรโตคอล QUIC</translation> <translation id="1160939557934457296">ปิดใช้งานการดำเนินการต่อจากหน้าคำเตือน Safe Browsing</translation> @@ -3945,6 +3946,7 @@ การตั้งค่านโยบายเป็น "ปิดใช้" หมายความว่าหากผู้ใช้ไม่ได้ปิดปลั๊กอิน PDF ก็จะมีการเปิดไฟล์ PDF หากคุณตั้งค่านโยบายไว้ ผู้ใช้จะเปลี่ยนการตั้งค่าดังกล่าวใน <ph name="PRODUCT_NAME" /> ไม่ได้ หากไม่ได้ตั้งค่า ผู้ใช้เลือกได้ว่าจะเปิด PDF ภายนอกหรือไม่</translation> +<translation id="5705828032077475554">รายงานเซสชัน CRD</translation> <translation id="5708969689202733975">กำหนดค่าโหมดปลดล็อกด่วนที่ได้รับอนุญาต</translation> <translation id="5714563837055244378">เปิดใช้การแชร์จาก Android ไปยังเว็บแอป</translation> <translation id="5715617256528927547">การตั้งค่านโยบายจะระบุอายุการใช้งาน (เป็นชั่วโมง) ของแคช Group Policy Object (GPO) ระบบใช้ GPO ที่มีระยะเวลาสูงสุดซ้ำได้ก่อนที่จะมีการดาวน์โหลดซ้ำ ระบบจะใช้ GPO ที่แคชไว้ซ้ำ (ตราบใดที่ยังเป็นเวอร์ชันเดิม) แทนการดาวน์โหลด GPO ซ้ำในการเรียกนโยบายทุกครั้ง @@ -4509,6 +4511,7 @@ หากตั้งค่าเป็น "จริง" หรือไม่ได้ตั้งค่า จะมีการรายงานการกำหนดค่าเครือข่ายของอุปกรณ์</translation> <translation id="6401669939808766804">ออกจากระบบให้ผู้ใช้</translation> <translation id="640244877779556713">เปิดใช้คำแนะนำอีโมจิ</translation> +<translation id="6404064917675764807">ไม่รายงานเหตุการณ์เซสชัน CRD</translation> <translation id="6407093060083181305">กำหนดค่ารายการที่บล็อกสำหรับการติดตั้งส่วนขยาย</translation> <translation id="640827304541402854">ปิดใช้การส่งผ่านไฟร์วอลล์จากโฮสต์การเข้าถึงระยะไกล</translation> <translation id="6412352702230183710">อนุญาตเฉพาะโฮสต์การรับส่งข้อความดั้งเดิมระดับระบบ</translation> @@ -4872,6 +4875,11 @@ หากไม่ได้ตั้งค่าไว้ โหมดคอนทราสต์สูงจะปิดอยู่ในหน้าจอลงชื่อเข้าใช้ ผู้ใช้จะเปิดใช้เมื่อใดก็ได้ และสถานะนั้นในหน้าจอลงชื่อเข้าใช้จะยังคงอยู่ตลอดระหว่างการใช้งานของผู้ใช้แต่ละคน หมายเหตุ: <ph name="DEVICE_LOGIN_SCREEN_HIGH_CONTRAST_ENABLED_POLICY_NAME" /> จะลบล้างนโยบายนี้หากระบุนโยบายเดิมไว้</translation> +<translation id="6833462729740272863">กำหนดค่ารายการ URL ที่ได้รับอนุญาตให้คงอยู่ในโหมดเต็มหน้าจอโดยไม่ต้องแสดงการแจ้งเตือนเมื่ออุปกรณ์ออกจากหน้าจอล็อก + + โดยทั่วไปโหมดเต็มหน้าจอจะปิดเมื่อออกจากหน้าจอล็อกเพื่อลดความเสี่ยงต่อการโจมตีแบบฟิชชิง นโยบายนี้ให้คุณระบุ URL ที่จะได้รับการพิจารณาว่าเป็นแหล่งที่มาที่เชื่อถือได้ ซึ่งจะได้รับอนุญาตให้อยู่ในโหมดเต็มหน้าจอต่อไปเมื่อปลดล็อก โดยกำหนดนโยบายด้วยการระบุรายการรูปแบบ URL ที่จัดรูปแบบตามนี้ ( https://www.chromium.org/administrators/url-blocklist-filter-format ) เช่น อาจให้อยู่ในโหมดเต็มหน้าจออยู่เสมอเมื่อปลดล็อกและปิดการแจ้งเตือนทั้งหมดได้โดยระบุอักขระไวลด์การ์ด <ph name="WILDCARD_VALUE" /> ที่ตรงกับ URL ทั้งหมด + + การตั้งค่านโยบายนี้เป็นรายการที่ว่างเปล่าหรือไม่ตั้งค่าจะทำให้ไม่มี URL ที่ได้รับอนุญาตให้อยู่ในโหมดเต็มหน้าจอต่อไปโดยไม่มีการแจ้งเตือน</translation> <translation id="6833988859168635883">เริ่มต้นใช้งาน หน้าแรก และหน้าแท็บใหม่</translation> <translation id="6835883744948188639">แสดงข้อความแจ้งที่ปรากฏขึ้นซ้ำๆ แก่ผู้ใช้เพื่อแจ้งว่าควรเปิดเบราว์เซอร์ขึ้นมาใหม่</translation> <translation id="683688607121170501">การตั้งค่านี้ทำให้ผู้ใช้สลับการใช้งานระหว่างบัญชี Google ได้ภายในพื้นที่เนื้อหาของหน้าต่างเบราว์เซอร์และในแอปพลิเคชันของ Android หลังจากที่ลงชื่อเข้าใช้อุปกรณ์ <ph name="PRODUCT_OS_NAME" /> @@ -6084,6 +6092,7 @@ <translation id="8219813789911069300">บล็อกการดาวน์โหลดที่เป็นอันตราย แนะนำ</translation> <translation id="8220023426952118761">อัตราการดาวน์โหลดที่ต้องการเป็นหน่วย kbits/s</translation> <translation id="8220156281401380422">กำหนดค่ารายการที่อนุญาตสำหรับการรับส่งข้อความดั้งเดิม</translation> +<translation id="822055204938220476">รายการ URL ที่ได้รับอนุญาตให้คงอยู่ในโหมดเต็มหน้าจอโดยไม่ต้องแสดงการแจ้งเตือน</translation> <translation id="8229912067600517877">เปิดใช้เครื่องมือสำหรับนักพัฒนาซอฟต์แวร์</translation> <translation id="8238421250255592181">ธงบูลีนที่ระบุว่าแป้นพิมพ์บนหน้าจอจะมีฟีเจอร์การเติมคำอัตโนมัติหรือไม่</translation> <translation id="8239109177194627162">ปิดใช้ฟีเจอร์ป้อนข้อความอัตโนมัติสำหรับบัตรเครดิต</translation> @@ -6420,6 +6429,10 @@ <translation id="8544465954173828789">อนุญาตให้ซิงค์ข้อความ SMS จากโทรศัพท์ไปยัง Chromebook</translation> <translation id="8566842294717252664">ซ่อนเว็บสโตร์จากหน้าแท็บใหม่และเครื่องเรียกใช้งานแอป</translation> <translation id="8571314270766672278">ย้อนกลับไปเวอร์ชันก่อนหน้าและรีเซ็ตอุปกรณ์ในการดาวน์เกรดเวอร์ชัน พยายามรักษาการตั้งค่าของการลงทะเบียนไว้</translation> +<translation id="8571871284943706125">รายงานเหตุการณ์เซสชัน CRD ในอุปกรณ์ที่ลงทะเบียนไว้สำหรับผู้ใช้ที่เชื่อมโยง + + หากปิดใช้นโยบายหรือไม่ได้ตั้งค่า จะไม่มีการรายงานข้อมูล + หากเปิดใช้ ระบบจะรายงานเหตุการณ์ CRD หากเชื่อมโยงผู้ใช้ไว้</translation> <translation id="857369585509260201">นโยบายนี้เลิกใช้งานแล้ว ลองพิจารณาใช้ BrowserSignin แทน หากตั้งค่านโยบายนี้เป็น "จริง" ผู้ใช้ต้องลงชื่อเข้าใช้ <ph name="PRODUCT_NAME" /> ด้วยโปรไฟล์ของตนก่อนใช้เบราว์เซอร์ และระบบจะตั้งค่าเริ่มต้นของ BrowserGuestModeEnabled เป็น "เท็จ" โปรดทราบว่าโปรไฟล์ที่ไม่ได้ลงชื่อเข้าใช้ซึ่งมีอยู่จะถูกล็อกและเข้าถึงไม่ได้หลังจากเปิดใช้นโยบายนี้ ดูข้อมูลเพิ่มเติมได้จากบทความในศูนย์ช่วยเหลือ
diff --git a/components/policy/resources/policy_templates_uk.xtb b/components/policy/resources/policy_templates_uk.xtb index 3f3a6d5..08381f69 100644 --- a/components/policy/resources/policy_templates_uk.xtb +++ b/components/policy/resources/policy_templates_uk.xtb
@@ -475,6 +475,7 @@ Якщо це правило вимкнено, незахищені запити HTTP не можуть використовувати схему автентифікації <ph name="BASIC_AUTH" />; дозволяється лише захищене з'єднання HTTPS. Якщо встановлено правило <ph name="AUTH_SCHEMES_POLICY_NAME" /> і воно не містить <ph name="BASIC_AUTH" />, це налаштування правила не застосовується (а <ph name="BASIC_AUTH" /> завжди заборонятиметься).</translation> +<translation id="1574258262373444557">Не використовувати <ph name="AES_KL_NAME" /> як алгоритм шифрування сховищ користувачів</translation> <translation id="1575015449587326319">Правило для налаштування конектора Chrome Enterprise OnFileDownloaded</translation> <translation id="1583248206450240930">Використовувати <ph name="PRODUCT_FRAME_NAME" /> за умовчанням</translation> <translation id="1587042984081085960">Це правило дає змогу адміністратору дозволити сторінці надсилати синхронні запити XHR під час її закриття. @@ -606,6 +607,7 @@ <translation id="167514072300004091">Якщо для цього правила вибрано значення 3, веб-сайти зможуть запитувати дозвіл на доступ до підключених пристроїв USB. Якщо для нього вибрано значення 2, доступ до пристроїв USB буде заблоковано. Якщо це правило не налаштовано, веб-сайти зможуть запитувати дозвіл, але користувачі матимуть можливість змінити цей параметр.</translation> +<translation id="1678137412645922426">Керує використанням правила <ph name="AES_KL_NAME" /> для шифрування сховищ користувачів (якщо підтримується)</translation> <translation id="1682063842123336408">Щоб установити <ph name="PLUGIN_VM_NAME" />, на диску потрібне вільне місце (у ГБ). Якщо це правило не налаштовано, а на диску є менше ніж 20 ГБ (значення за умовчанням) вільного місця, <ph name="PLUGIN_VM_NAME" /> не буде встановлено. @@ -3890,6 +3892,12 @@ Якщо це правило не налаштовано, за умовчанням дозвіл мають лише користувачі, якими не керує адміністратор.</translation> <translation id="5584132346604748282">Контролює Точність гелокації Google на пристрої Android</translation> +<translation id="5585384603219625331">Це правило дає змогу вибрати, чи ввімкнено в ОС Chrome правило <ph name="AES_KL_NAME" /> для шифрування сховищ користувачів на головних сторінках із системою <ph name="DM_CRYPT" /> (якщо підтримується). + + Це правило діє лише для головних сторінок, де для шифрування застосовується <ph name="DM_CRYPT" />. Застарілі домашні сторінки користувачів (де не застосовується <ph name="DM_CRYPT" />) не підтримують правило <ph name="AES_KL_NAME" /> і за умовчанням використовують <ph name="AES_NI_NAME" />. + + Якщо значення правила змінюється, доступ до наявних домашніх сторінок користувачів із системою <ph name="DM_CRYPT" /> отримуватиметься за допомогою шифрування, налаштованого правилом, оскільки правила <ph name="AES_ALGORITHM_NAME" /> сумісні. + Якщо це правило вимкнути або не налаштувати, для шифрування сховищ користувачів на домашніх сторінках із системою <ph name="DM_CRYPT" /> за умовчанням використовуватиметься правило <ph name="AES_NI_NAME" />.</translation> <translation id="5586942249556966598">Нічого не робити</translation> <translation id="5598417829613725146">Canvas (підтримується з версії 90)</translation> <translation id="5599461642204007579">Параметри керування <ph name="MS_AD_NAME" /></translation> @@ -6563,6 +6571,7 @@ <translation id="8626826495474944836">Вимагати ізоляцію для всіх сайтів</translation> <translation id="8631434304112909927">до версії <ph name="UNTIL_VERSION" /></translation> <translation id="8631437968147930597">Список додатків для нотаток, які дозволені на заблокованому екрані <ph name="PRODUCT_OS_NAME" /></translation> +<translation id="8634062512783775032">Використовувати <ph name="AES_KL_NAME" /> як алгоритм шифрування сховищ користувачів (якщо підтримується)</translation> <translation id="8637566476051166626">Дозволені мережеві порти</translation> <translation id="8643838501942693770">Дозволити сторонні файли cookie, але дати користувачам можливість змінювати це налаштування</translation> <translation id="8648844602494595665">Це правило контролює використання значка замка в універсальному вікні пошуку.
diff --git a/components/policy/resources/policy_templates_vi.xtb b/components/policy/resources/policy_templates_vi.xtb index 86fe0a833..61c5a71 100644 --- a/components/policy/resources/policy_templates_vi.xtb +++ b/components/policy/resources/policy_templates_vi.xtb
@@ -475,6 +475,7 @@ Nếu bạn đặt chính sách này thành Tắt, thì các yêu cầu HTTP không an toàn sẽ không được phép dùng lược đồ xác thực <ph name="BASIC_AUTH" />; chỉ HTTP an toàn mới được phép. Nếu bạn đặt chính sách <ph name="AUTH_SCHEMES_POLICY_NAME" /> và không bao gồm <ph name="BASIC_AUTH" />, thì chế độ cài đặt chính sách này bị bỏ qua (và <ph name="BASIC_AUTH" /> sẽ luôn bị cấm).</translation> +<translation id="1574258262373444557">Không sử dụng <ph name="AES_KL_NAME" /> làm thuật toán mã hoá để mã hoá bộ nhớ của người dùng</translation> <translation id="1575015449587326319">Chính sách cấu hình dành cho Trình kết nối OnFileDownloaded của Chrome Enterprise</translation> <translation id="1583248206450240930">Sử dụng <ph name="PRODUCT_FRAME_NAME" /> theo mặc định</translation> <translation id="1587042984081085960">Chính sách này cho phép quản trị viên chỉ định rằng một trang có thể gửi các yêu cầu XHR đồng bộ trong khi đóng trang. @@ -595,6 +596,7 @@ <translation id="167514072300004091">Nếu bạn đặt chính sách này thành 3, thì các trang web có thể yêu cầu quyền truy cập vào thiết bị USB được kết nối. Nếu bạn đặt chính sách này thành 2, thì các trang web không thể truy cập vào thiết bị USB được kết nối. Nếu bạn không đặt chính sách này, thì các trang web có thể yêu cầu quyền truy cập nhưng người dùng được quyền thay đổi tùy chọn cài đặt này.</translation> +<translation id="1678137412645922426">Kiểm soát việc sử dụng <ph name="AES_KL_NAME" /> để mã hoá bộ nhớ của người dùng (nếu có hỗ trợ)</translation> <translation id="1682063842123336408">Ổ đĩa cần có dung lượng trống (tính bằng GB) để cài đặt <ph name="PLUGIN_VM_NAME" />. Nếu bạn không đặt chính sách này, thì thiết bị sẽ không cài đặt được <ph name="PLUGIN_VM_NAME" /> nếu ổ đĩa còn dưới 20 GB trống (giá trị mặc định). @@ -3882,6 +3884,12 @@ Nếu bạn không đặt chính sách này, tùy chọn cài đặt mặc định sẽ là không được phép đối với người dùng do doanh nghiệp quản lý và được phép đối với người dùng không được quản lý.</translation> <translation id="5584132346604748282">Kiểm soát các dịch vụ vị trí của Google trên thiết bị Android</translation> +<translation id="5585384603219625331">Chính sách này kiểm soát việc có triển khai <ph name="AES_KL_NAME" /> để mã hoá bộ nhớ của người dùng cho trang chủ <ph name="DM_CRYPT" /> của người dùng trên Chrome OS hay không (nếu có hỗ trợ) + + Chính sách này chỉ áp dụng cho trang chủ của người dùng có sử dụng <ph name="DM_CRYPT" /> để mã hoá. Trang chủ cũ của người dùng (các trang không sử dụng <ph name="DM_CRYPT" />) không hỗ trợ việc sử dụng <ph name="AES_KL_NAME" /> và sẽ sử dụng <ph name="AES_NI_NAME" /> theo mặc định. + + Nếu giá trị của chính sách thay đổi, thì trang chủ <ph name="DM_CRYPT" /> hiện tại của người dùng sẽ được truy cập bằng phương thức mã hoá do chính sách này định cấu hình vì tương thích với các hoạt động triển khai <ph name="AES_ALGORITHM_NAME" />. + Nếu bạn vô hiệu hoá hoặc không đặt chính sách này, thì trang chủ <ph name="DM_CRYPT" /> của người dùng sẽ sử dụng <ph name="AES_NI_NAME" /> theo mặc định.</translation> <translation id="5586942249556966598">Không làm gì</translation> <translation id="5598417829613725146">Canvas (được hỗ trợ kể từ phiên bản 90)</translation> <translation id="5599461642204007579">Cài đặt quản lý <ph name="MS_AD_NAME" /></translation> @@ -6553,6 +6561,7 @@ <translation id="8626826495474944836">Yêu cầu tính năng Tách biệt trang web cho mọi trang web</translation> <translation id="8631434304112909927">cho đến phiên bản <ph name="UNTIL_VERSION" /></translation> <translation id="8631437968147930597">Danh sách các ứng dụng ghi chú được phép trên màn hình khóa <ph name="PRODUCT_OS_NAME" /></translation> +<translation id="8634062512783775032">Sử dụng <ph name="AES_KL_NAME" /> làm thuật toán mã hoá để mã hoá bộ nhớ của người dùng (nếu có hỗ trợ)</translation> <translation id="8637566476051166626">Các cổng mạng được cho phép một cách rõ ràng</translation> <translation id="8643838501942693770">Cho phép các cookie của bên thứ ba nhưng người dùng có thể thay đổi tùy chọn cài đặt này</translation> <translation id="8648844602494595665">Chính sách này kiểm soát cách xử lý biểu tượng khóa trên thanh địa chỉ.
diff --git a/components/policy/test_support/policy_storage.cc b/components/policy/test_support/policy_storage.cc index 0d8381e..5fd2615 100644 --- a/components/policy/test_support/policy_storage.cc +++ b/components/policy/test_support/policy_storage.cc
@@ -4,10 +4,25 @@ #include "components/policy/test_support/policy_storage.h" #include "base/big_endian.h" +#include "base/strings/strcat.h" +#include "base/strings/string_util.h" #include "crypto/sha2.h" namespace policy { +namespace { + +const char kPolicyKeySeparator[] = "/"; + +std::string GetPolicyKey(const std::string& policy_type, + const std::string& entity_id) { + if (entity_id.empty()) + return policy_type; + return base::StrCat({policy_type, kPolicyKeySeparator, entity_id}); +} + +} // namespace + PolicyStorage::PolicyStorage() : signature_provider_(std::make_unique<SignatureProvider>()) {} @@ -19,14 +34,33 @@ PolicyStorage::~PolicyStorage() = default; std::string PolicyStorage::GetPolicyPayload( - const std::string& policy_type) const { - auto it = policy_payloads_.find(policy_type); + const std::string& policy_type, + const std::string& entity_id) const { + auto it = policy_payloads_.find(GetPolicyKey(policy_type, entity_id)); return it == policy_payloads_.end() ? std::string() : it->second; } +std::vector<std::string> PolicyStorage::GetEntityIdsForType( + const std::string& policy_type) { + std::string prefix = base::StrCat({policy_type, kPolicyKeySeparator}); + std::vector<std::string> ids; + const size_t prefix_length = prefix.length(); + for (const auto& [policy_key, payload] : policy_payloads_) { + if (base::StartsWith(policy_key, prefix)) + ids.push_back(policy_key.substr(prefix_length)); + } + return ids; +} + void PolicyStorage::SetPolicyPayload(const std::string& policy_type, const std::string& policy_payload) { - policy_payloads_[policy_type] = policy_payload; + SetPolicyPayload(policy_type, std::string(), policy_payload); +} + +void PolicyStorage::SetPolicyPayload(const std::string& policy_type, + const std::string& entity_id, + const std::string& policy_payload) { + policy_payloads_[GetPolicyKey(policy_type, entity_id)] = policy_payload; } void PolicyStorage::SetPsmEntry(const std::string& brand_serial_id,
diff --git a/components/policy/test_support/policy_storage.h b/components/policy/test_support/policy_storage.h index e8a840a6..952363d 100644 --- a/components/policy/test_support/policy_storage.h +++ b/components/policy/test_support/policy_storage.h
@@ -29,13 +29,20 @@ PolicyStorage& operator=(PolicyStorage&& policy_storage); virtual ~PolicyStorage(); - // Returns the serialized proto associated with |policy_type|. Returns empty - // string if there is no such association. - std::string GetPolicyPayload(const std::string& policy_type) const; + // Returns the serialized proto associated with |policy_type| and optional + // |entity_id|. Returns empty string if there is no such association. + std::string GetPolicyPayload( + const std::string& policy_type, + const std::string& entity_id = std::string()) const; + std::vector<std::string> GetEntityIdsForType(const std::string& policy_type); + // Associates the serialized proto stored in |policy_payload| with - // |policy_type|. + // |policy_type| and optional |entity_id|. void SetPolicyPayload(const std::string& policy_type, const std::string& policy_payload); + void SetPolicyPayload(const std::string& policy_type, + const std::string& entity_id, + const std::string& policy_payload); SignatureProvider* signature_provider() const { return signature_provider_.get();
diff --git a/components/policy/test_support/request_handler_for_policy.cc b/components/policy/test_support/request_handler_for_policy.cc index bfbe346..ec2ff1a29 100644 --- a/components/policy/test_support/request_handler_for_policy.cc +++ b/components/policy/test_support/request_handler_for_policy.cc
@@ -4,9 +4,12 @@ #include "components/policy/test_support/request_handler_for_policy.h" +#include "base/containers/contains.h" +#include "base/containers/flat_set.h" #include "base/strings/stringprintf.h" #include "base/time/time.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" +#include "components/policy/proto/device_management_backend.pb.h" #include "components/policy/test_support/policy_storage.h" #include "components/policy/test_support/signature_provider.h" #include "components/policy/test_support/test_server_helpers.h" @@ -36,7 +39,7 @@ std::unique_ptr<HttpResponse> RequestHandlerForPolicy::HandleRequest( const HttpRequest& request) { - const std::set<std::string> kCloudPolicyTypes{ + const base::flat_set<std::string> kCloudPolicyTypes{ dm_protocol::kChromeDevicePolicyType, dm_protocol::kChromeExtensionPolicyType, dm_protocol::kChromeMachineLevelUserCloudPolicyType, @@ -46,6 +49,11 @@ dm_protocol::kChromeSigninExtensionPolicyType, dm_protocol::kChromeUserPolicyType, }; + const base::flat_set<std::string> kExtensionPolicyTypes{ + dm_protocol::kChromeExtensionPolicyType, + dm_protocol::kChromeMachineLevelExtensionCloudPolicyType, + dm_protocol::kChromeSigninExtensionPolicyType, + }; std::string request_device_token; if (!GetDeviceTokenFromRequest(request, &request_device_token)) @@ -65,18 +73,25 @@ device_management_request.policy_request().requests()) { const std::string& policy_type = fetch_request.policy_type(); // TODO(crbug.com/1221328): Add other policy types as needed. - if (kCloudPolicyTypes.find(policy_type) == kCloudPolicyTypes.end()) { + if (!base::Contains(kCloudPolicyTypes, policy_type)) { return CreateHttpResponse( net::HTTP_BAD_REQUEST, base::StringPrintf("Invalid policy_type: %s", policy_type.c_str())); } std::string error_msg; - if (!ProcessCloudPolicy( - fetch_request, *client_info, - device_management_response.mutable_policy_response() - ->add_responses(), - &error_msg)) { + if (base::Contains(kExtensionPolicyTypes, policy_type)) { + if (!ProcessCloudPolicyForExtensions( + fetch_request, *client_info, + device_management_response.mutable_policy_response(), + &error_msg)) { + return CreateHttpResponse(net::HTTP_BAD_REQUEST, error_msg); + } + } else if (!ProcessCloudPolicy( + fetch_request, *client_info, + device_management_response.mutable_policy_response() + ->add_responses(), + &error_msg)) { return CreateHttpResponse(net::HTTP_BAD_REQUEST, error_msg); } } @@ -100,10 +115,11 @@ // Determine the current key on the client. const SignatureProvider::SigningKey* client_key = nullptr; + const SignatureProvider* signature_provider = + policy_storage()->signature_provider(); + int public_key_version = fetch_request.public_key_version(); if (fetch_request.has_public_key_version()) { - int public_key_version = fetch_request.public_key_version(); - client_key = policy_storage()->signature_provider()->GetKeyByVersion( - public_key_version); + client_key = signature_provider->GetKeyByVersion(public_key_version); if (!client_key) { error_msg->assign(base::StringPrintf("Invalid public key version: %d", public_key_version)); @@ -112,12 +128,16 @@ } // Choose the key for signing the policy. + int signing_key_version = signature_provider->current_key_version(); + if (fetch_request.has_public_key_version() && + signature_provider->rotate_keys()) { + signing_key_version = public_key_version + 1; + } const SignatureProvider::SigningKey* signing_key = - policy_storage()->signature_provider()->GetCurrentKey(); + signature_provider->GetKeyByVersion(signing_key_version); if (!signing_key) { error_msg->assign(base::StringPrintf( - "Can't find signin key for version: %d", - policy_storage()->signature_provider()->current_key_version())); + "Can't find signin key for version: %d", signing_key_version)); return false; } @@ -127,7 +147,9 @@ ? base::Time::Now().ToJavaTime() : policy_storage()->timestamp().ToJavaTime()); policy_data.set_request_token(client_info.device_token); - policy_data.set_policy_value(policy_storage()->GetPolicyPayload(policy_type)); + policy_data.set_policy_value(policy_storage()->GetPolicyPayload( + policy_type, fetch_request.settings_entity_id())); + policy_data.set_settings_entity_id(fetch_request.settings_entity_id()); policy_data.set_machine_name(client_info.machine_name); policy_data.set_service_account_identity( policy_storage()->service_account_identity().empty() @@ -141,10 +163,8 @@ policy_data.set_policy_invalidation_topic( policy_storage()->policy_invalidation_topic()); - if (fetch_request.signature_type() != em::PolicyFetchRequest::NONE) { - policy_data.set_public_key_version( - policy_storage()->signature_provider()->current_key_version()); - } + if (fetch_request.signature_type() != em::PolicyFetchRequest::NONE) + policy_data.set_public_key_version(signing_key_version); policy_data.SerializeToString(fetch_response->mutable_policy_data()); @@ -156,8 +176,8 @@ return false; } - if (fetch_request.public_key_version() != - policy_storage()->signature_provider()->current_key_version()) { + if (!fetch_request.has_public_key_version() || + public_key_version != signing_key_version) { fetch_response->set_new_public_key(signing_key->public_key()); } @@ -185,4 +205,27 @@ return true; } +bool RequestHandlerForPolicy::ProcessCloudPolicyForExtensions( + const em::PolicyFetchRequest& fetch_request, + const ClientStorage::ClientInfo& client_info, + em::DevicePolicyResponse* response, + std::string* error_msg) { + // Send one PolicyFetchResponse for each extension configured on the server as + // the client does not actually tell us which extensions it has installed to + // protect user privacy. + std::vector<std::string> ids = + policy_storage()->GetEntityIdsForType(fetch_request.policy_type()); + for (const std::string& id : ids) { + em::PolicyFetchRequest fetch_request_with_id; + fetch_request_with_id.CopyFrom(fetch_request); + fetch_request_with_id.set_settings_entity_id(id); + if (!ProcessCloudPolicy(fetch_request_with_id, client_info, + response->add_responses(), error_msg)) { + return false; + } + } + + return true; +} + } // namespace policy
diff --git a/components/policy/test_support/request_handler_for_policy.h b/components/policy/test_support/request_handler_for_policy.h index beabb9d..e8b2594 100644 --- a/components/policy/test_support/request_handler_for_policy.h +++ b/components/policy/test_support/request_handler_for_policy.h
@@ -5,13 +5,14 @@ #ifndef COMPONENTS_POLICY_TEST_SUPPORT_REQUEST_HANDLER_FOR_POLICY_H_ #define COMPONENTS_POLICY_TEST_SUPPORT_REQUEST_HANDLER_FOR_POLICY_H_ -#include "components/policy/test_support/embedded_policy_test_server.h" - #include <string> #include "components/policy/test_support/client_storage.h" +#include "components/policy/test_support/embedded_policy_test_server.h" namespace enterprise_management { +class DevicePolicyResponse; +class PolicyFetchRequest; class PolicyFetchResponse; } // namespace enterprise_management @@ -42,6 +43,16 @@ const ClientStorage::ClientInfo& client, enterprise_management::PolicyFetchResponse* fetch_response, std::string* error_msg); + + // Add to |response| the policies associated with |client_info| for extension + // policy type in |fetch_request|. Returns true is request is well-formed, or + // false otherwise (in which case, |error_msg| is set with the corresponding + // error message). + bool ProcessCloudPolicyForExtensions( + const enterprise_management::PolicyFetchRequest& fetch_request, + const ClientStorage::ClientInfo& client_info, + enterprise_management::DevicePolicyResponse* response, + std::string* error_msg); }; } // namespace policy
diff --git a/components/policy/test_support/request_handler_for_policy_unittest.cc b/components/policy/test_support/request_handler_for_policy_unittest.cc index bdbf9f35..aff00a9dc 100644 --- a/components/policy/test_support/request_handler_for_policy_unittest.cc +++ b/components/policy/test_support/request_handler_for_policy_unittest.cc
@@ -25,6 +25,9 @@ constexpr char kMachineName[] = "machine_name"; constexpr char kPolicyInvalidationTopic[] = "policy_invalidation_topic"; constexpr char kUsername[] = "user-for-policy@example.com"; +#if !BUILDFLAG(IS_ANDROID) +constexpr char kExtensionId[] = "extension_id"; +#endif // !BUILDFLAG(IS_ANDROID) } // namespace @@ -96,15 +99,13 @@ client_info.device_token = kDeviceToken; client_info.device_id = kDeviceId; client_info.machine_name = kMachineName; - client_info.allowed_policy_types.insert( - dm_protocol::kChromeMachineLevelUserCloudPolicyType); + client_info.allowed_policy_types.insert(dm_protocol::kChromeDevicePolicyType); client_storage()->RegisterClient(std::move(client_info)); em::DeviceManagementRequest device_management_request; em::PolicyFetchRequest* fetch_request = device_management_request.mutable_policy_request()->add_requests(); - fetch_request->set_policy_type( - dm_protocol::kChromeMachineLevelExtensionCloudPolicyType); + fetch_request->set_policy_type(dm_protocol::kChromeRemoteCommandPolicyType); SetDeviceTokenHeader(kDeviceToken); SetPayload(device_management_request); @@ -286,4 +287,81 @@ EXPECT_FALSE(fetch_response.new_public_key_signature().empty()); } +#if !BUILDFLAG(IS_ANDROID) +TEST_F(RequestHandlerForPolicyTest, HandleRequest_Success_ExtensionPolicies) { + ClientStorage::ClientInfo client_info; + client_info.device_token = kDeviceToken; + client_info.device_id = kDeviceId; + client_info.username = kUsername; + client_info.allowed_policy_types.insert( + dm_protocol::kChromeExtensionPolicyType); + client_storage()->RegisterClient(client_info); + + em::CloudPolicySettings settings; + settings.mutable_extensionsettings()->mutable_value()->assign( + "extension-policy"); + policy_storage()->SetPolicyPayload(dm_protocol::kChromeExtensionPolicyType, + kExtensionId, + settings.SerializeAsString()); + + em::DeviceManagementRequest device_management_request; + device_management_request.mutable_policy_request() + ->add_requests() + ->set_policy_type(dm_protocol::kChromeExtensionPolicyType); + + SetDeviceTokenHeader(kDeviceToken); + SetPayload(device_management_request); + + StartRequestAndWait(); + + EXPECT_EQ(GetResponseCode(), net::HTTP_OK); + + ASSERT_TRUE(HasResponseBody()); + em::DeviceManagementResponse device_management_response = + GetDeviceManagementResponse(); + + ASSERT_EQ(device_management_response.policy_response().responses_size(), 1); + const em::PolicyFetchResponse& fetch_response = + device_management_response.policy_response().responses(0); + em::PolicyData policy_data; + policy_data.ParseFromString(fetch_response.policy_data()); + EXPECT_EQ(policy_data.policy_type(), dm_protocol::kChromeExtensionPolicyType); + EXPECT_EQ(policy_data.policy_value(), + policy_storage()->GetPolicyPayload( + dm_protocol::kChromeExtensionPolicyType, kExtensionId)); +} + +TEST_F(RequestHandlerForPolicyTest, + HandleRequest_ExtensionPoliciesWithMissingSigningKey) { + ClientStorage::ClientInfo client_info; + client_info.device_token = kDeviceToken; + client_info.device_id = kDeviceId; + client_info.username = kUsername; + client_info.allowed_policy_types.insert( + dm_protocol::kChromeMachineLevelExtensionCloudPolicyType); + client_storage()->RegisterClient(client_info); + + em::CloudPolicySettings settings; + settings.mutable_extensionsettings()->mutable_value()->assign( + "extension-policy"); + policy_storage()->SetPolicyPayload( + dm_protocol::kChromeMachineLevelExtensionCloudPolicyType, kExtensionId, + settings.SerializeAsString()); + policy_storage()->signature_provider()->set_current_key_version(-1); + + em::DeviceManagementRequest device_management_request; + device_management_request.mutable_policy_request() + ->add_requests() + ->set_policy_type( + dm_protocol::kChromeMachineLevelExtensionCloudPolicyType); + + SetDeviceTokenHeader(kDeviceToken); + SetPayload(device_management_request); + + StartRequestAndWait(); + + EXPECT_EQ(GetResponseCode(), net::HTTP_BAD_REQUEST); +} +#endif // !BUILDFLAG(IS_ANDROID) + } // namespace policy
diff --git a/components/policy/test_support/signature_provider.cc b/components/policy/test_support/signature_provider.cc index 31cf722..7cd6787 100644 --- a/components/policy/test_support/signature_provider.cc +++ b/components/policy/test_support/signature_provider.cc
@@ -199,10 +199,15 @@ const SignatureProvider::SigningKey* SignatureProvider::GetKeyByVersion( int key_version) const { // |key_version| is 1-based. - return key_version > 0 && - static_cast<size_t>(key_version) <= signing_keys_.size() - ? &signing_keys_[key_version - 1] - : nullptr; + if (key_version < 1) + return nullptr; + size_t key_index = static_cast<size_t>(key_version) - 1; + if (key_index >= signing_keys_.size()) { + if (!rotate_keys()) + return nullptr; + key_index %= signing_keys_.size(); + } + return &signing_keys_[key_index]; } const SignatureProvider::SigningKey* SignatureProvider::GetCurrentKey() const {
diff --git a/components/policy/test_support/signature_provider.h b/components/policy/test_support/signature_provider.h index 4d595db..327cb705 100644 --- a/components/policy/test_support/signature_provider.h +++ b/components/policy/test_support/signature_provider.h
@@ -79,11 +79,20 @@ current_key_version_ = current_key_version; } + bool rotate_keys() const { return rotate_keys_; } + void set_rotate_keys(bool rotate_keys) { rotate_keys_ = rotate_keys; } + private: std::vector<SigningKey> signing_keys_; // The key version to be used if no key version is defined by the client. int current_key_version_ = 1; + + // Whether to rotate signing keys or to fail when last key is reached. The + // policy keys will be rotated in a round-robin fashion for each policy + // request (by default, the |current_key_version_| will be used for all + // requests). + bool rotate_keys_ = false; }; } // namespace policy
diff --git a/components/segmentation_platform/internal/execution/segmentation_model_executor.cc b/components/segmentation_platform/internal/execution/segmentation_model_executor.cc index f4fa1fe4..3b7396d 100644 --- a/components/segmentation_platform/internal/execution/segmentation_model_executor.cc +++ b/components/segmentation_platform/internal/execution/segmentation_model_executor.cc
@@ -16,25 +16,31 @@ SegmentationModelExecutor::~SegmentationModelExecutor() = default; -absl::Status SegmentationModelExecutor::Preprocess( +bool SegmentationModelExecutor::Preprocess( const std::vector<TfLiteTensor*>& input_tensors, const std::vector<float>& input) { // The model must have a single float input tensor, and the length of the // input data must match the length of the tensor. - if (input_tensors.size() != 1u) - return absl::InvalidArgumentError("input tensor size not 1"); - if (kTfLiteFloat32 != input_tensors[0]->type) - return absl::InvalidArgumentError("input tensor type is not float"); + if (input_tensors.size() != 1u) { + LOG(ERROR) << "input tensor size not 1"; + return false; + } + if (kTfLiteFloat32 != input_tensors[0]->type) { + LOG(ERROR) << "input tensor type is not float"; + return false; + } if (input_tensors[0]->bytes / sizeof(input_tensors[0]->type) != input.size()) { - return absl::InvalidArgumentError( - "length of input data does not match length of tensor"); + LOG(ERROR) << "length of input data does not match length of tensor"; + return false; } - return tflite::task::core::PopulateTensor<float>(input, input_tensors[0]); + absl::Status status = + tflite::task::core::PopulateTensor<float>(input, input_tensors[0]); + return status.ok(); } -float SegmentationModelExecutor::Postprocess( +absl::optional<float> SegmentationModelExecutor::Postprocess( const std::vector<const TfLiteTensor*>& output_tensors) { // The output must be a single tensor with a single float element. DCHECK_EQ(1u, output_tensors.size()); @@ -46,7 +52,7 @@ tflite::task::core::PopulateVector<float>(output_tensors[0], &data); if (!status.ok()) { NOTREACHED(); - return -1; + return absl::nullopt; } DCHECK_EQ(1u, data.size()); return data[0];
diff --git a/components/segmentation_platform/internal/execution/segmentation_model_executor.h b/components/segmentation_platform/internal/execution/segmentation_model_executor.h index fa578e9..33e885e 100644 --- a/components/segmentation_platform/internal/execution/segmentation_model_executor.h +++ b/components/segmentation_platform/internal/execution/segmentation_model_executor.h
@@ -37,9 +37,9 @@ protected: // optimization_guide::BaseModelExecutor overrides. - absl::Status Preprocess(const std::vector<TfLiteTensor*>& input_tensors, - const std::vector<float>& input) override; - float Postprocess( + bool Preprocess(const std::vector<TfLiteTensor*>& input_tensors, + const std::vector<float>& input) override; + absl::optional<float> Postprocess( const std::vector<const TfLiteTensor*>& output_tensors) override; };
diff --git a/components/signin/ios/browser/features.cc b/components/signin/ios/browser/features.cc index 27c8fcb3..83d421e 100644 --- a/components/signin/ios/browser/features.cc +++ b/components/signin/ios/browser/features.cc
@@ -22,4 +22,7 @@ const char kWaitThresholdMillisecondsForCapabilitiesApi[] = "wait-threshold-milliseconds-for-capabilities-api"; +const base::Feature kEnableUnicornAccountSupport{ + "EnableUnicornAccountSupport", base::FEATURE_DISABLED_BY_DEFAULT}; + } // namespace signin
diff --git a/components/signin/ios/browser/features.h b/components/signin/ios/browser/features.h index b301ec1e..c47ab10b 100644 --- a/components/signin/ios/browser/features.h +++ b/components/signin/ios/browser/features.h
@@ -23,6 +23,9 @@ // waiting for a response from the Account Capabilities API. extern const char kWaitThresholdMillisecondsForCapabilitiesApi[]; +// Feature to enable Unicorn account sign-in for iOS. +extern const base::Feature kEnableUnicornAccountSupport; + } // namespace signin #endif // COMPONENTS_SIGNIN_IOS_BROWSER_FEATURES_H_
diff --git a/components/sync/engine/backoff_delay_provider.cc b/components/sync/engine/backoff_delay_provider.cc index 1c772b8..3c8b77786 100644 --- a/components/sync/engine/backoff_delay_provider.cc +++ b/components/sync/engine/backoff_delay_provider.cc
@@ -28,11 +28,11 @@ return kMaxBackoffTime; const base::TimeDelta backoff = - std::max(base::Seconds(1), last_delay * kBackoffMultiplyFactor) + + std::max(kMinBackoffTime, last_delay * kBackoffMultiplyFactor) + jitter_sign * kBackoffJitterFactor * last_delay; // Clamp backoff between 1 second and |kMaxBackoffTime|. - return std::max(base::Seconds(1), std::min(backoff, kMaxBackoffTime)); + return std::max(kMinBackoffTime, std::min(backoff, kMaxBackoffTime)); } } // namespace
diff --git a/components/sync/engine/polling_constants.h b/components/sync/engine/polling_constants.h index 7ad270e..7a819c8 100644 --- a/components/sync/engine/polling_constants.h +++ b/components/sync/engine/polling_constants.h
@@ -25,7 +25,8 @@ // local limits. constexpr base::TimeDelta kDefaultPollInterval = base::Hours(8); -// Maximum interval for exponential backoff. +// Minimum and maximum interval for exponential backoff. +constexpr base::TimeDelta kMinBackoffTime = base::Seconds(1); constexpr base::TimeDelta kMaxBackoffTime = base::Minutes(10); // After a failure contacting sync servers, specifies how long to wait before
diff --git a/components/system_media_controls/linux/system_media_controls_linux.cc b/components/system_media_controls/linux/system_media_controls_linux.cc index 870f5c8f..4c33825 100644 --- a/components/system_media_controls/linux/system_media_controls_linux.cc +++ b/components/system_media_controls/linux/system_media_controls_linux.cc
@@ -40,6 +40,8 @@ constexpr int kNumMethodsToExport = 11; +constexpr base::TimeDelta kUpdatePositionInterval = base::Milliseconds(100); + } // namespace const char kMprisAPIServiceNameFormatString[] = @@ -47,6 +49,7 @@ const char kMprisAPIObjectPath[] = "/org/mpris/MediaPlayer2"; const char kMprisAPIInterfaceName[] = "org.mpris.MediaPlayer2"; const char kMprisAPIPlayerInterfaceName[] = "org.mpris.MediaPlayer2.Player"; +const char kMprisAPISignalSeeked[] = "Seeked"; SystemMediaControlsLinux::SystemMediaControlsLinux( const std::string& product_name) @@ -112,6 +115,12 @@ }; properties_->SetProperty(kMprisAPIPlayerInterfaceName, "PlaybackStatus", status()); + + playing_ = (value == PlaybackStatus::kPlaying); + if (playing_ && position_.has_value()) + StartPositionUpdateTimer(); + else + StopPositionUpdateTimer(); } void SystemMediaControlsLinux::SetTitle(const std::u16string& value) { @@ -130,10 +139,20 @@ "xesam:album", MakeDbusVariant(DbusString(base::UTF16ToUTF8(value)))); } +void SystemMediaControlsLinux::SetPosition( + const media_session::MediaPosition& position) { + position_ = position; + UpdatePosition(/*emit_signal=*/true); + + if (playing_) + StartPositionUpdateTimer(); +} + void SystemMediaControlsLinux::ClearMetadata() { SetTitle(std::u16string()); SetArtist(std::u16string()); SetAlbum(std::u16string()); + ClearPosition(); } std::string SystemMediaControlsLinux::GetServiceName() const { @@ -343,6 +362,60 @@ properties_->PropertyUpdated(kMprisAPIPlayerInterfaceName, "Metadata"); } +void SystemMediaControlsLinux::ClearPosition() { + position_ = absl::nullopt; + StopPositionUpdateTimer(); + UpdatePosition(/*emit_signal=*/true); +} + +void SystemMediaControlsLinux::UpdatePosition(bool emit_signal) { + int64_t position = 0; + double rate = 1.0; + int64_t duration = 0; + + if (position_.has_value()) { + position = position_->GetPosition().InMicroseconds(); + rate = position_->playback_rate(); + duration = position_->duration().InMicroseconds(); + } + + // We never emit a PropertiesChanged signal for the "Position" property. We + // only emit "Seeked" signals. + properties_->SetProperty(kMprisAPIPlayerInterfaceName, "Position", + DbusInt64(position), /*emit_signal=*/false); + + properties_->SetProperty(kMprisAPIPlayerInterfaceName, "Rate", + DbusDouble(rate), emit_signal); + SetMetadataPropertyInternal("mpris:length", + MakeDbusVariant(DbusInt64(duration))); + + if (!service_ready_ || !emit_signal || !position_.has_value()) + return; + + dbus::Signal seeked_signal(kMprisAPIPlayerInterfaceName, + kMprisAPISignalSeeked); + dbus::MessageWriter writer(&seeked_signal); + writer.AppendInt64(position); + exported_object_->SendSignal(&seeked_signal); +} + +void SystemMediaControlsLinux::StartPositionUpdateTimer() { + // The timer should only run when the media is playing and has a position. + DCHECK(playing_); + DCHECK(position_.has_value()); + + // base::Unretained(this) is safe here since |this| owns + // |position_update_timer_|. + position_update_timer_.Start( + FROM_HERE, kUpdatePositionInterval, + base::BindRepeating(&SystemMediaControlsLinux::UpdatePosition, + base::Unretained(this), /*emit_signal=*/false)); +} + +void SystemMediaControlsLinux::StopPositionUpdateTimer() { + position_update_timer_.Stop(); +} + } // namespace internal } // namespace system_media_controls
diff --git a/components/system_media_controls/linux/system_media_controls_linux.h b/components/system_media_controls/linux/system_media_controls_linux.h index 6eebaf4..7d338ab6 100644 --- a/components/system_media_controls/linux/system_media_controls_linux.h +++ b/components/system_media_controls/linux/system_media_controls_linux.h
@@ -35,6 +35,8 @@ extern const char kMprisAPIInterfaceName[]; COMPONENT_EXPORT(SYSTEM_MEDIA_CONTROLS) extern const char kMprisAPIPlayerInterfaceName[]; +COMPONENT_EXPORT(SYSTEM_MEDIA_CONTROLS) +extern const char kMprisAPISignalSeeked[]; // A D-Bus service conforming to the MPRIS spec: // https://specifications.freedesktop.org/mpris-spec/latest/ @@ -64,6 +66,7 @@ void SetArtist(const std::u16string& value) override; void SetAlbum(const std::u16string& value) override; void SetThumbnail(const SkBitmap& bitmap) override {} + void SetPosition(const media_session::MediaPosition& position) override; void ClearThumbnail() override {} void ClearMetadata() override; void UpdateDisplay() override {} @@ -106,6 +109,18 @@ void SetMetadataPropertyInternal(const std::string& property_name, DbusVariant&& new_value); + void ClearPosition(); + + // Updates MPRIS with our current position. + void UpdatePosition(bool emit_signal); + + void StartPositionUpdateTimer(); + void StopPositionUpdateTimer(); + + absl::optional<media_session::MediaPosition> position_; + base::RepeatingTimer position_update_timer_; + bool playing_ = false; + const std::string product_name_; std::unique_ptr<DbusProperties> properties_;
diff --git a/components/system_media_controls/linux/system_media_controls_linux_unittest.cc b/components/system_media_controls/linux/system_media_controls_linux_unittest.cc index 121876b..2cc7b32 100644 --- a/components/system_media_controls/linux/system_media_controls_linux_unittest.cc +++ b/components/system_media_controls/linux/system_media_controls_linux_unittest.cc
@@ -56,7 +56,8 @@ public SystemMediaControlsObserver { public: SystemMediaControlsLinuxTest() - : task_environment_(base::test::TaskEnvironment::MainThreadType::UI) {} + : task_environment_(base::test::TaskEnvironment::MainThreadType::UI, + base::test::TaskEnvironment::TimeSource::MOCK_TIME) {} SystemMediaControlsLinuxTest(const SystemMediaControlsLinuxTest&) = delete; SystemMediaControlsLinuxTest& operator=(const SystemMediaControlsLinuxTest&) = @@ -87,12 +88,48 @@ response_wait_loop_->Run(); } + int64_t GetCurrentPositionValue() { + base::RunLoop wait_loop; + + // We need to supply a serial or the test will crash. + dbus::MethodCall method_call(DBUS_INTERFACE_PROPERTIES, "Get"); + method_call.SetSerial(kFakeSerial); + dbus::MessageWriter writer(&method_call); + writer.AppendString(kMprisAPIPlayerInterfaceName); + writer.AppendString("Position"); + + int64_t position; + + // Call the method and await a response. + properties_interface_exported_methods_["Get"].Run( + &method_call, base::BindOnce( + [](int64_t* position_out, base::RunLoop& wait_loop, + std::unique_ptr<dbus::Response> response) { + // A response of nullptr means an error has + // occurred. + EXPECT_NE(nullptr, response.get()); + + dbus::MessageReader reader(response.get()); + ASSERT_TRUE(reader.PopVariantOfInt64(position_out)); + + wait_loop.Quit(); + }, + &position, std::ref(wait_loop))); + wait_loop.Run(); + + return position; + } + SystemMediaControlsLinux* GetService() { return service_.get(); } dbus::MockExportedObject* GetExportedObject() { return mock_exported_object_.get(); } + void AdvanceClockMilliseconds(int ms) { + task_environment_.FastForwardBy(base::Milliseconds(ms)); + } + private: void StartMprisServiceAndWaitForReady() { service_wait_loop_ = std::make_unique<base::RunLoop>(); @@ -148,6 +185,8 @@ dbus::ExportedObject::OnExportedCallback callback) { if (interface_name == kMprisAPIPlayerInterfaceName) player_interface_exported_methods_[method_name] = exported_method; + if (interface_name == DBUS_INTERFACE_PROPERTIES) + properties_interface_exported_methods_[method_name] = exported_method; std::move(callback).Run(interface_name, method_name, true); } @@ -180,6 +219,8 @@ base::flat_map<std::string, dbus::ExportedObject::MethodCallCallback> player_interface_exported_methods_; + base::flat_map<std::string, dbus::ExportedObject::MethodCallCallback> + properties_interface_exported_methods_; }; TEST_F(SystemMediaControlsLinuxTest, ObserverNotifiedOfServiceReadyWhenAdded) { @@ -330,6 +371,151 @@ GetService()->SetTitle(u"Foo"); } +TEST_F(SystemMediaControlsLinuxTest, + PlayingMediaWithPositionWillContinuouslyUpdatePosition) { + base::RunLoop wait_for_initial_position_update; + + const base::TimeDelta expected_position = base::Seconds(5); + double expected_rate = 2.0; + const base::TimeDelta expected_duration = base::Seconds(20); + + // Since the position is updated every 500ms, and the rate is 2.0, after 500ms + // we should get 6 seconds as the position. + const base::TimeDelta expected_updated_position = base::Seconds(6); + + int signal_count = 0; + + // The returned signal should give the changed property. + EXPECT_CALL(*GetExportedObject(), SendSignal(_)) + .WillRepeatedly(WithArg<0>([&](dbus::Signal* signal) { + signal_count++; + + EXPECT_NE(nullptr, signal); + dbus::MessageReader reader(signal); + + // The final signal we get is a "Seeked" signal which has a different + // format than the rest. + if (signal_count == 4) { + EXPECT_EQ(kMprisAPIPlayerInterfaceName, signal->GetInterface()); + EXPECT_EQ(kMprisAPISignalSeeked, signal->GetMember()); + + int64_t new_position; + ASSERT_TRUE(reader.PopInt64(&new_position)); + EXPECT_EQ(expected_position.InMicroseconds(), new_position); + + wait_for_initial_position_update.Quit(); + return; + } + + EXPECT_EQ(DBUS_INTERFACE_PROPERTIES, signal->GetInterface()); + EXPECT_EQ("PropertiesChanged", signal->GetMember()); + + std::string interface_name; + ASSERT_TRUE(reader.PopString(&interface_name)); + EXPECT_EQ(kMprisAPIPlayerInterfaceName, interface_name); + + dbus::MessageReader changed_properties_reader(nullptr); + ASSERT_TRUE(reader.PopArray(&changed_properties_reader)); + + dbus::MessageReader dict_entry_reader(nullptr); + ASSERT_TRUE(changed_properties_reader.PopDictEntry(&dict_entry_reader)); + + std::string property_name; + std::string metadata_property_name; + dbus::MessageReader metadata_variant_reader(nullptr); + dbus::MessageReader metadata_reader(nullptr); + dbus::MessageReader metadata_entry_reader(nullptr); + std::string playback_status_value; + double rate_value; + int64_t duration_value; + + ASSERT_TRUE(dict_entry_reader.PopString(&property_name)); + switch (signal_count) { + case 1: + // The first changed property will be the playback status to + // playing. + EXPECT_EQ("PlaybackStatus", property_name); + ASSERT_TRUE( + dict_entry_reader.PopVariantOfString(&playback_status_value)); + EXPECT_EQ("Playing", playback_status_value); + break; + case 2: + // The next changed property will be rate to 1.0. + EXPECT_EQ("Rate", property_name); + ASSERT_TRUE(dict_entry_reader.PopVariantOfDouble(&rate_value)); + EXPECT_EQ(expected_rate, rate_value); + break; + case 3: + // The next changed property will be duration to 20 seconds. + EXPECT_EQ("Metadata", property_name); + ASSERT_TRUE(dict_entry_reader.PopVariant(&metadata_variant_reader)); + ASSERT_TRUE(metadata_variant_reader.PopArray(&metadata_reader)); + ASSERT_TRUE(metadata_reader.PopDictEntry(&metadata_entry_reader)); + ASSERT_TRUE( + metadata_entry_reader.PopString(&metadata_property_name)); + EXPECT_EQ("mpris:length", metadata_property_name); + ASSERT_TRUE( + metadata_entry_reader.PopVariantOfInt64(&duration_value)); + EXPECT_EQ(expected_duration.InMicroseconds(), duration_value); + break; + } + + // There should only be one entry at a time. + EXPECT_FALSE(changed_properties_reader.HasMoreData()); + })); + + // Set playback status to "Playing" to ensure the position updates. + GetService()->SetPlaybackStatus( + SystemMediaControls::PlaybackStatus::kPlaying); + + // Set the initial position. + media_session::MediaPosition position(expected_rate, expected_duration, + expected_position, + /*end_of_media=*/false); + GetService()->SetPosition(position); + + // Wait for the initial position property updates to be signaled. + wait_for_initial_position_update.Run(); + + // After the initial position signaling, we should not receive more signals + // for the position updates that happen due to typical media playback. + testing::Mock::VerifyAndClearExpectations(GetExportedObject()); + EXPECT_CALL(*GetExportedObject(), SendSignal(_)).Times(0); + + // Even without signals, the property should still be updated and return the + // correct new value when called after some time. + AdvanceClockMilliseconds(500); + EXPECT_EQ(expected_updated_position.InMicroseconds(), + GetCurrentPositionValue()); + + const base::TimeDelta expected_seeked_position = base::Seconds(14); + base::RunLoop wait_for_seeked_signal; + + // If the position changes in a way that is inconsistent with the current + // playing state (e.g. the user has seeked to a different time), then we + // should receive a "Seeked" signal indicating the change. + testing::Mock::VerifyAndClearExpectations(GetExportedObject()); + EXPECT_CALL(*GetExportedObject(), SendSignal(_)) + .WillRepeatedly(WithArg<0>([&](dbus::Signal* signal) { + EXPECT_NE(nullptr, signal); + EXPECT_EQ(kMprisAPIPlayerInterfaceName, signal->GetInterface()); + EXPECT_EQ(kMprisAPISignalSeeked, signal->GetMember()); + + dbus::MessageReader reader(signal); + int64_t new_position; + ASSERT_TRUE(reader.PopInt64(&new_position)); + EXPECT_EQ(expected_seeked_position.InMicroseconds(), new_position); + + wait_for_seeked_signal.Quit(); + })); + + media_session::MediaPosition seeked_position(expected_rate, expected_duration, + expected_seeked_position, + /*end_of_media=*/false); + GetService()->SetPosition(seeked_position); + wait_for_seeked_signal.Run(); +} + } // namespace internal } // namespace system_media_controls
diff --git a/components/variations/service/variations_field_trial_creator.cc b/components/variations/service/variations_field_trial_creator.cc index 0972105..041ae3e 100644 --- a/components/variations/service/variations_field_trial_creator.cc +++ b/components/variations/service/variations_field_trial_creator.cc
@@ -183,14 +183,13 @@ metrics::MetricsStateManager* metrics_state_manager, PlatformFieldTrials* platform_field_trials, SafeSeedManager* safe_seed_manager, - absl::optional<int> low_entropy_source_value, - bool extend_variations_safe_mode) { + absl::optional<int> low_entropy_source_value) { DCHECK(feature_list); DCHECK(metrics_state_manager); DCHECK(platform_field_trials); DCHECK(safe_seed_manager); - if (extend_variations_safe_mode && + if (base::FieldTrialList::IsTrialActive(kExtendedSafeModeTrial) && !metrics_state_manager->is_background_session()) { // If the session is expected to be a background session, then do not extend // Variations Safe Mode. Extending Safe Mode involves monitoring for crashes @@ -449,7 +448,9 @@ metrics::MetricsStateManager* metrics_state_manager) { const std::string group_name = base::FieldTrialList::FindFullName(kExtendedSafeModeTrial); - if (group_name.empty() || group_name == kDefaultGroup) + DCHECK(!group_name.empty()); + + if (group_name == kDefaultGroup) return; if (group_name == kControlGroup) {
diff --git a/components/variations/service/variations_field_trial_creator.h b/components/variations/service/variations_field_trial_creator.h index 8baf0c6..30e0ae8 100644 --- a/components/variations/service/variations_field_trial_creator.h +++ b/components/variations/service/variations_field_trial_creator.h
@@ -120,11 +120,6 @@ // value is true). Must not be null. // |low_entropy_source_value| contains the low entropy source value that was // used for client-side randomization of variations. - // |extend_variations_safe_mode| indicates whether the client should - // participate in the extended variations safe mode field trial. This should - // be the case for all platforms that use a VariationsSeed with the exception - // of Android WebView, which has its own safe mode mechanism: crbug/1220131. - // TODO(crbug/1245646): Remove |extend_variations_safe_mode| param. // // NOTE: The ordering of the FeatureList method calls is such that the // explicit --disable-features and --enable-features from the command line @@ -140,8 +135,7 @@ metrics::MetricsStateManager* metrics_state_manager, PlatformFieldTrials* platform_field_trials, SafeSeedManager* safe_seed_manager, - absl::optional<int> low_entropy_source_value, - bool extend_variations_safe_mode = true); + absl::optional<int> low_entropy_source_value); // Returns all of the client state used for filtering studies. // As a side-effect, may update the stored permanent consistency country.
diff --git a/components/variations/service/variations_field_trial_creator_unittest.cc b/components/variations/service/variations_field_trial_creator_unittest.cc index 12cb3823..fc3eda4 100644 --- a/components/variations/service/variations_field_trial_creator_unittest.cc +++ b/components/variations/service/variations_field_trial_creator_unittest.cc
@@ -296,15 +296,14 @@ // A convenience wrapper around SetUpFieldTrials() which passes default values // for uninteresting params. - bool SetUpFieldTrials(bool extend_variations_safe_mode = true) { + bool SetUpFieldTrials() { TestPlatformFieldTrials platform_field_trials; return VariationsFieldTrialCreator::SetUpFieldTrials( /*variation_ids=*/std::vector<std::string>(), std::vector<base::FeatureList::FeatureOverrideInfo>(), /*low_entropy_provider=*/nullptr, std::make_unique<base::FeatureList>(), metrics_state_manager_.get(), &platform_field_trials, - safe_seed_manager_, /*low_entropy_source_value=*/absl::nullopt, - extend_variations_safe_mode); + safe_seed_manager_, /*low_entropy_source_value=*/absl::nullopt); } TestVariationsSeedStore* seed_store() { return &seed_store_; } @@ -914,31 +913,35 @@ } #endif // defined(OS_ANDROID) +// Verify that providing an empty user data directory opts the client out of the +// Extended Variations Safe Mode experiment. TEST_F(FieldTrialCreatorSafeModeExperimentTest, OptOutOfExperiment) { // Ensure that variations safe mode is not triggered. NiceMock<MockSafeSeedManager> safe_seed_manager(local_state()); ON_CALL(safe_seed_manager, ShouldRunInSafeMode()) .WillByDefault(Return(false)); + // Specify a channel on which the Extended Variations Safe Mode experiment is + // running. version_info::Channel channel = version_info::Channel::DEV; NiceMock<MockVariationsServiceClient> variations_service_client; ON_CALL(variations_service_client, GetChannel()) .WillByDefault(Return(channel)); TestVariationsFieldTrialCreator field_trial_creator( - local_state(), &variations_service_client, &safe_seed_manager, channel); + local_state(), &variations_service_client, &safe_seed_manager, channel, + base::FilePath()); base::HistogramTester histogram_tester; - ASSERT_TRUE(field_trial_creator.SetUpFieldTrials( - /*extend_variations_safe_mode=*/false)); + ASSERT_TRUE(field_trial_creator.SetUpFieldTrials()); - // Verify that the experiment is not active and that the WritePrefsTime metric - // was not recorded. + // Verify that the experiment is not active and that Variations Safe Mode was + // not extended. EXPECT_FALSE(base::FieldTrialList::IsTrialActive(kExtendedSafeModeTrial)); + EXPECT_FALSE( + field_trial_creator.was_maybe_extend_variations_safe_mode_called()); histogram_tester.ExpectTotalCount( "Variations.ExtendedSafeMode.WritePrefsTime", 0); - - base::FeatureList::ClearInstanceForTesting(); } INSTANTIATE_TEST_SUITE_P( @@ -976,9 +979,13 @@ StartupVisibilityTestParams params = GetParam(); TestVariationsFieldTrialCreator field_trial_creator( local_state(), &variations_service_client, &safe_seed_manager, channel, - base::FilePath(), params.startup_visibility); - ASSERT_TRUE(field_trial_creator.SetUpFieldTrials()); + user_data_dir_path(), params.startup_visibility); + // Verify that the Extended Variations Safe Mode experiment is active to be + // certain that Safe Mode is (or isn't) extended due to the StartupVisibility. + ASSERT_TRUE(base::FieldTrialList::IsTrialActive(kExtendedSafeModeTrial)); + + ASSERT_TRUE(field_trial_creator.SetUpFieldTrials()); // Verify that MaybeExtendVariationsSafeMode() was (or wasn't) called. EXPECT_EQ(field_trial_creator.was_maybe_extend_variations_safe_mode_called(), params.extend_safe_mode);
diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc index 5ae3f54..03a94c1 100644 --- a/components/variations/service/variations_service.cc +++ b/components/variations/service/variations_service.cc
@@ -953,13 +953,11 @@ const std::vector<std::string>& variation_ids, const std::vector<base::FeatureList::FeatureOverrideInfo>& extra_overrides, std::unique_ptr<base::FeatureList> feature_list, - variations::PlatformFieldTrials* platform_field_trials, - bool extend_variations_safe_mode) { + variations::PlatformFieldTrials* platform_field_trials) { return field_trial_creator_.SetUpFieldTrials( variation_ids, extra_overrides, CreateLowEntropyProvider(), std::move(feature_list), state_manager_, platform_field_trials, - &safe_seed_manager_, state_manager_->GetLowEntropySource(), - extend_variations_safe_mode); + &safe_seed_manager_, state_manager_->GetLowEntropySource()); } void VariationsService::OverrideCachedUIStrings() {
diff --git a/components/variations/service/variations_service.h b/components/variations/service/variations_service.h index a0883a8..ef942c9 100644 --- a/components/variations/service/variations_service.h +++ b/components/variations/service/variations_service.h
@@ -187,14 +187,12 @@ } // Wrapper around VariationsFieldTrialCreator::SetUpFieldTrials(). - // TODO(crbug/1245646): Remove |extend_variations_safe_mode| param. bool SetUpFieldTrials( const std::vector<std::string>& variation_ids, const std::vector<base::FeatureList::FeatureOverrideInfo>& extra_overrides, std::unique_ptr<base::FeatureList> feature_list, - variations::PlatformFieldTrials* platform_field_trials, - bool extend_variations_safe_mode = true); + variations::PlatformFieldTrials* platform_field_trials); // Overrides cached UI strings on the resource bundle once it is initialized. void OverrideCachedUIStrings();
diff --git a/components/viz/common/features.cc b/components/viz/common/features.cc index 1b74223..44f1647 100644 --- a/components/viz/common/features.cc +++ b/components/viz/common/features.cc
@@ -263,11 +263,6 @@ return base::FeatureList::IsEnabled(kUsePreferredIntervalForVideo); } -bool IsVizHitTestingDebugEnabled() { - return base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableVizHitTestDebug); -} - bool ShouldUseRealBuffersForPageFlipTest() { return base::FeatureList::IsEnabled(kUseRealBuffersForPageFlipTest); }
diff --git a/components/viz/common/features.h b/components/viz/common/features.h index 6d65cbd..5f8f0ba 100644 --- a/components/viz/common/features.h +++ b/components/viz/common/features.h
@@ -79,7 +79,6 @@ VIZ_COMMON_EXPORT bool IsUsingSkiaRenderer(); VIZ_COMMON_EXPORT bool IsUsingVizFrameSubmissionForWebView(); VIZ_COMMON_EXPORT bool IsUsingPreferredIntervalForVideo(); -VIZ_COMMON_EXPORT bool IsVizHitTestingDebugEnabled(); VIZ_COMMON_EXPORT bool ShouldUseRealBuffersForPageFlipTest(); VIZ_COMMON_EXPORT bool ShouldWebRtcLogCapturePipeline(); #if defined(OS_WIN)
diff --git a/components/viz/common/hit_test/hit_test_region_list.h b/components/viz/common/hit_test/hit_test_region_list.h index e0d8f116..0bfdab51 100644 --- a/components/viz/common/hit_test/hit_test_region_list.h +++ b/components/viz/common/hit_test/hit_test_region_list.h
@@ -36,9 +36,6 @@ // Client hasn't submitted its own hit-test data yet. kHitTestNotActive = 0x40, - - // Hit-test debugging is enabled. - kHitTestDebug = 0x80, }; // In viz hit testing surface layer, hit test regions are marked as kHitTestAsk
diff --git a/components/viz/common/switches.cc b/components/viz/common/switches.cc index 14db420..f6c5ff4 100644 --- a/components/viz/common/switches.cc +++ b/components/viz/common/switches.cc
@@ -4,6 +4,9 @@ #include "components/viz/common/switches.h" +#include <algorithm> +#include <string> + #include "base/command_line.h" #include "base/logging.h" #include "base/strings/string_number_conversions.h" @@ -41,9 +44,6 @@ // fullscreen overlay and use it as main framebuffer where possible. const char kEnableHardwareOverlays[] = "enable-hardware-overlays"; -// Enables hit-test debug logging. -const char kEnableVizHitTestDebug[] = "enable-viz-hit-test-debug"; - #if defined(OS_CHROMEOS) // ChromeOS uses one of two VideoDecoder implementations based on SoC/board // specific configurations that are signalled via this command line flag.
diff --git a/components/viz/common/switches.h b/components/viz/common/switches.h index 64490ee..4592b9cd 100644 --- a/components/viz/common/switches.h +++ b/components/viz/common/switches.h
@@ -21,7 +21,6 @@ VIZ_COMMON_EXPORT extern const char kDoubleBufferCompositing[]; VIZ_COMMON_EXPORT extern const char kEnableDeJelly[]; VIZ_COMMON_EXPORT extern const char kEnableHardwareOverlays[]; -VIZ_COMMON_EXPORT extern const char kEnableVizHitTestDebug[]; #if defined(OS_CHROMEOS) VIZ_COMMON_EXPORT extern const char
diff --git a/components/viz/host/hit_test/hit_test_query.cc b/components/viz/host/hit_test/hit_test_query.cc index 9ca5eba8..25496aa 100644 --- a/components/viz/host/hit_test/hit_test_query.cc +++ b/components/viz/host/hit_test/hit_test_query.cc
@@ -5,6 +5,8 @@ #include "components/viz/host/hit_test/hit_test_query.h" #include <sstream> +#include <string> +#include <utility> #include "base/containers/stack.h" #include "base/metrics/histogram_macros.h" @@ -50,8 +52,6 @@ names.emplace_back("Touch"); if (flag & kHitTestNotActive) names.emplace_back("NotActive"); - if (flag & kHitTestDebug) - names.emplace_back("Debug"); return base::JoinString(std::move(names), ", "); }
diff --git a/components/viz/host/host_frame_sink_manager.cc b/components/viz/host/host_frame_sink_manager.cc index 6da1186..a0f46ca 100644 --- a/components/viz/host/host_frame_sink_manager.cc +++ b/components/viz/host/host_frame_sink_manager.cc
@@ -216,13 +216,6 @@ data.client->OnFrameTokenChanged(frame_token, activation_time); } -void HostFrameSinkManager::SetHitTestAsyncQueriedDebugRegions( - const FrameSinkId& root_frame_sink_id, - const std::vector<FrameSinkId>& hit_test_async_queried_debug_queue) { - frame_sink_manager_->SetHitTestAsyncQueriedDebugRegions( - root_frame_sink_id, hit_test_async_queried_debug_queue); -} - bool HostFrameSinkManager::RegisterFrameSinkHierarchy( const FrameSinkId& parent_frame_sink_id, const FrameSinkId& child_frame_sink_id) {
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_impl.cc b/components/viz/service/frame_sinks/frame_sink_manager_impl.cc index da9b85e8..0e5b34a 100644 --- a/components/viz/service/frame_sinks/frame_sink_manager_impl.cc +++ b/components/viz/service/frame_sinks/frame_sink_manager_impl.cc
@@ -348,15 +348,6 @@ surface_id.local_surface_id(), SubtreeCaptureId(), std::move(request)}); } -void FrameSinkManagerImpl::SetHitTestAsyncQueriedDebugRegions( - const FrameSinkId& root_frame_sink_id, - const std::vector<FrameSinkId>& hit_test_async_queried_debug_queue) { - hit_test_manager_.SetHitTestAsyncQueriedDebugRegions( - root_frame_sink_id, hit_test_async_queried_debug_queue); - DCHECK(base::Contains(root_sink_map_, root_frame_sink_id)); - root_sink_map_[root_frame_sink_id]->ForceImmediateDrawAndSwapIfPossible(); -} - void FrameSinkManagerImpl::DestroyFrameSinkBundle(const FrameSinkBundleId& id) { bundle_map_.erase(id); }
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_impl.h b/components/viz/service/frame_sinks/frame_sink_manager_impl.h index 6270347..d912483 100644 --- a/components/viz/service/frame_sinks/frame_sink_manager_impl.h +++ b/components/viz/service/frame_sinks/frame_sink_manager_impl.h
@@ -139,10 +139,6 @@ void EvictSurfaces(const std::vector<SurfaceId>& surface_ids) override; void RequestCopyOfOutput(const SurfaceId& surface_id, std::unique_ptr<CopyOutputRequest> request) override; - void SetHitTestAsyncQueriedDebugRegions( - const FrameSinkId& root_frame_sink_id, - const std::vector<FrameSinkId>& hit_test_async_queried_debug_queue) - override; void CacheBackBuffer(uint32_t cache_id, const FrameSinkId& root_frame_sink_id) override; void EvictBackBuffer(uint32_t cache_id,
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc index 94a087b..39fb4375 100644 --- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc +++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
@@ -499,8 +499,7 @@ bool will_draw_and_swap, AggregatedRenderPassList* render_passes) { DCHECK(support_->GetHitTestAggregator()); - support_->GetHitTestAggregator()->Aggregate(display_->CurrentSurfaceId(), - render_passes); + support_->GetHitTestAggregator()->Aggregate(display_->CurrentSurfaceId()); } base::ScopedClosureRunner RootCompositorFrameSinkImpl::GetCacheBackBufferCb() {
diff --git a/components/viz/service/hit_test/hit_test_aggregator.cc b/components/viz/service/hit_test/hit_test_aggregator.cc index 99bb7666..9690a1c8 100644 --- a/components/viz/service/hit_test/hit_test_aggregator.cc +++ b/components/viz/service/hit_test/hit_test_aggregator.cc
@@ -6,8 +6,6 @@ #include "base/trace_event/trace_event.h" #include "components/viz/common/hit_test/hit_test_region_list.h" -#include "components/viz/common/quads/debug_border_draw_quad.h" -#include "components/viz/common/quads/solid_color_draw_quad.h" #include "components/viz/service/hit_test/hit_test_aggregator_delegate.h" #include "components/viz/service/surfaces/latest_local_surface_id_lookup_delegate.h" #include "skia/ext/skia_matrix_44.h" @@ -32,8 +30,7 @@ HitTestAggregator::~HitTestAggregator() = default; -void HitTestAggregator::Aggregate(const SurfaceId& display_surface_id, - AggregatedRenderPassList* render_passes) { +void HitTestAggregator::Aggregate(const SurfaceId& display_surface_id) { DCHECK(referenced_child_regions_.empty()); // The index will only have changed when new hit-test data has been submitted. @@ -52,84 +49,8 @@ hit_test_data_size_ = 0; hit_test_data_.resize(hit_test_data_capacity_); - hit_test_debug_ = false; - hit_test_debug_ask_regions_ = 0; - AppendRoot(display_surface_id); SendHitTestData(); - - if (hit_test_debug_ && render_passes) { - InsertHitTestDebugQuads(render_passes); - } -} - -void HitTestAggregator::InsertHitTestDebugQuads( - AggregatedRenderPassList* render_passes) { - const base::flat_set<FrameSinkId>* hit_test_async_queried_debug_regions = - hit_test_manager_->GetHitTestAsyncQueriedDebugRegions( - root_frame_sink_id_); - - QuadList& ql = render_passes->back()->quad_list; - ql.InsertBeforeAndInvalidateAllPointers<DebugBorderDrawQuad>( - ql.begin(), hit_test_data_size_); - ql.InsertBeforeAndInvalidateAllPointers<SolidColorDrawQuad>( - ql.begin(), hit_test_debug_ask_regions_); - - SharedQuadState* sqs = - render_passes->back()->CreateAndAppendSharedQuadState(); - sqs->opacity = 0.25f; - - const SkColor colors[3] = {SK_ColorCYAN, SK_ColorGREEN, SK_ColorMAGENTA}; - - base::stack<uint32_t> parents; - base::stack<gfx::Transform> parent_transforms; - parent_transforms.push(gfx::Transform()); - - for (uint32_t i = 0, ask_i = 0; i < hit_test_data_size_; ++i) { - const AggregatedHitTestRegion& htr = hit_test_data_[i]; - - gfx::Transform child_to_parent; - // Hit-test transforms are guaranteed to be invertible. - if (!htr.transform().GetInverse(&child_to_parent)) { - return; - } - - SkColor color = colors[parents.size() % 3]; - if (hit_test_async_queried_debug_regions && - hit_test_async_queried_debug_regions->count(htr.frame_sink_id)) { - color = SK_ColorRED; - } - - parents.push(i); - // Concatenate transformation. - parent_transforms.push(parent_transforms.top() * child_to_parent); - - // We can only transform gfx::RectF. - gfx::RectF rf(hit_test_data_[i].rect); - parent_transforms.top().TransformRect(&rf); - const gfx::Rect debug_rect = gfx::ToEnclosedRect(rf); - - DebugBorderDrawQuad* debug_quad = static_cast<DebugBorderDrawQuad*>( - ql.ElementAt(hit_test_debug_ask_regions_ + i)); - debug_quad->SetNew(sqs, debug_rect, debug_rect, color, /*width=*/5); - - if (htr.flags & kHitTestAsk) { - SolidColorDrawQuad* ask_quad = - static_cast<SolidColorDrawQuad*>(ql.ElementAt(ask_i++)); - ask_quad->SetNew(sqs, debug_rect, debug_rect, color, - /*force_anti_aliasing_off=*/false); - } - - while (!parents.empty()) { - uint32_t parent_index = parents.top(); - uint32_t max_child_index = - parent_index + hit_test_data_[parent_index].child_count; - if (max_child_index > i) - break; - parents.pop(); - parent_transforms.pop(); - } - } } void HitTestAggregator::SendHitTestData() { @@ -283,10 +204,6 @@ AggregatedHitTestRegion(frame_sink_id, flags, rect, transform, child_count, async_hit_test_reasons); hit_test_data_size_++; - - hit_test_debug_ |= flags & kHitTestDebug; - if (flags & kHitTestAsk) - ++hit_test_debug_ask_regions_; } } // namespace viz
diff --git a/components/viz/service/hit_test/hit_test_aggregator.h b/components/viz/service/hit_test/hit_test_aggregator.h index a10feed..79589604 100644 --- a/components/viz/service/hit_test/hit_test_aggregator.h +++ b/components/viz/service/hit_test/hit_test_aggregator.h
@@ -44,10 +44,8 @@ // Called after surfaces have been aggregated into the DisplayFrame. // In this call HitTestRegionList structures received from active surfaces - // are aggregated into |hit_test_data_|. If |render_passes| are given and - // the correct flags are set, hit-test debug quads will be inserted. - void Aggregate(const SurfaceId& display_surface_id, - AggregatedRenderPassList* render_passes = nullptr); + // are aggregated into |hit_test_data_|. + void Aggregate(const SurfaceId& display_surface_id); private: friend class TestHitTestAggregator; @@ -78,9 +76,6 @@ absl::optional<int64_t> GetTraceIdIfUpdated(const SurfaceId& surface_id, uint64_t active_frame_index); - // Inserts debug quads based on hit-test data. - void InsertHitTestDebugQuads(AggregatedRenderPassList* render_passes); - const raw_ptr<const HitTestManager> hit_test_manager_; const raw_ptr<HitTestAggregatorDelegate> delegate_; @@ -102,9 +97,6 @@ uint32_t hit_test_data_size_ = 0; std::vector<AggregatedHitTestRegion> hit_test_data_; - bool hit_test_debug_ = false; - uint32_t hit_test_debug_ask_regions_ = 0; - // This is the set of FrameSinkIds referenced in the aggregation in this tree // chain so far, used to detect cycles. We can have regions that have the // same FrameSinkId, e.g. when ALPHA_SHAPE is set in cc::FilterOperations,
diff --git a/components/viz/service/hit_test/hit_test_manager.cc b/components/viz/service/hit_test/hit_test_manager.cc index 9381b42..205186d3 100644 --- a/components/viz/service/hit_test/hit_test_manager.cc +++ b/components/viz/service/hit_test/hit_test_manager.cc
@@ -30,20 +30,6 @@ } // namespace -HitTestManager::HitTestAsyncQueriedDebugRegion:: - HitTestAsyncQueriedDebugRegion() = default; -HitTestManager::HitTestAsyncQueriedDebugRegion::HitTestAsyncQueriedDebugRegion( - base::flat_set<FrameSinkId> regions) - : regions(std::move(regions)) {} -HitTestManager::HitTestAsyncQueriedDebugRegion:: - ~HitTestAsyncQueriedDebugRegion() = default; - -HitTestManager::HitTestAsyncQueriedDebugRegion::HitTestAsyncQueriedDebugRegion( - HitTestAsyncQueriedDebugRegion&&) = default; -HitTestManager::HitTestAsyncQueriedDebugRegion& -HitTestManager::HitTestAsyncQueriedDebugRegion::operator=( - HitTestAsyncQueriedDebugRegion&&) = default; - HitTestManager::HitTestManager(SurfaceManager* surface_manager) : surface_manager_(surface_manager) {} @@ -143,26 +129,6 @@ return surface->GetActiveFrameMetadata().begin_frame_ack.trace_id; } -const base::flat_set<FrameSinkId>* -HitTestManager::GetHitTestAsyncQueriedDebugRegions( - const FrameSinkId& root_frame_sink_id) const { - auto it = hit_test_async_queried_debug_regions_.find(root_frame_sink_id); - if (it == hit_test_async_queried_debug_regions_.end() || - it->second.timer.Elapsed().InMilliseconds() > 2000) { - return nullptr; - } - return &it->second.regions; -} - -void HitTestManager::SetHitTestAsyncQueriedDebugRegions( - const FrameSinkId& root_frame_sink_id, - const std::vector<FrameSinkId>& hit_test_async_queried_debug_queue) { - hit_test_async_queried_debug_regions_[root_frame_sink_id] = - HitTestAsyncQueriedDebugRegion(base::flat_set<FrameSinkId>( - hit_test_async_queried_debug_queue.begin(), - hit_test_async_queried_debug_queue.end())); -} - bool HitTestManager::ValidateHitTestRegionList( const SurfaceId& surface_id, HitTestRegionList* hit_test_region_list) {
diff --git a/components/viz/service/hit_test/hit_test_manager.h b/components/viz/service/hit_test/hit_test_manager.h index affeddf..d6f5063 100644 --- a/components/viz/service/hit_test/hit_test_manager.h +++ b/components/viz/service/hit_test/hit_test_manager.h
@@ -62,12 +62,6 @@ int64_t GetTraceId(const SurfaceId& id) const; - const base::flat_set<FrameSinkId>* GetHitTestAsyncQueriedDebugRegions( - const FrameSinkId& root_frame_sink_id) const; - void SetHitTestAsyncQueriedDebugRegions( - const FrameSinkId& root_frame_sink_id, - const std::vector<FrameSinkId>& hit_test_async_queried_debug_queue); - uint64_t submit_hit_test_region_list_index() const { return submit_hit_test_region_list_index_; } @@ -82,25 +76,6 @@ std::map<SurfaceId, base::flat_map<uint64_t, HitTestRegionList>> hit_test_region_lists_; - struct HitTestAsyncQueriedDebugRegion { - HitTestAsyncQueriedDebugRegion(); - explicit HitTestAsyncQueriedDebugRegion( - base::flat_set<FrameSinkId> regions); - ~HitTestAsyncQueriedDebugRegion(); - - HitTestAsyncQueriedDebugRegion(HitTestAsyncQueriedDebugRegion&&); - HitTestAsyncQueriedDebugRegion& operator=(HitTestAsyncQueriedDebugRegion&&); - - base::flat_set<FrameSinkId> regions; - base::ElapsedTimer timer; - }; - - // We store the async queried regions for each |root_frame_sink_id|. If viz - // hit-test debug is enabled, We will highlight the regions red in - // HitTestAggregator for 2 seconds, or until the next async queried event. - base::flat_map<FrameSinkId, HitTestAsyncQueriedDebugRegion> - hit_test_async_queried_debug_regions_; - // Keeps track of the number of submitted HitTestRegionLists. This allows the // HitTestAggregators to stay in sync with the HitTestManager and only // aggregate when there is new hit-test data.
diff --git a/components/viz/test/test_frame_sink_manager.h b/components/viz/test/test_frame_sink_manager.h index 11c6cf6..310dedd1 100644 --- a/components/viz/test/test_frame_sink_manager.h +++ b/components/viz/test/test_frame_sink_manager.h
@@ -65,10 +65,6 @@ void RequestCopyOfOutput( const SurfaceId& surface_id, std::unique_ptr<CopyOutputRequest> request) override {} - void SetHitTestAsyncQueriedDebugRegions( - const FrameSinkId& root_frame_sink_id, - const std::vector<FrameSinkId>& hit_test_async_queried_debug_queue) - override {} void CacheBackBuffer(uint32_t cache_id, const FrameSinkId& root_frame_sink_id) override {} void EvictBackBuffer(uint32_t cache_id,
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 5a97956..80b2e76e 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -1406,8 +1406,6 @@ "renderer_host/frame_tree_node.h", "renderer_host/frame_tree_node_blame_context.cc", "renderer_host/frame_tree_node_blame_context.h", - "renderer_host/hit_test_debug_key_event_observer.cc", - "renderer_host/hit_test_debug_key_event_observer.h", "renderer_host/http_error_navigation_throttle.cc", "renderer_host/http_error_navigation_throttle.h", "renderer_host/input/fling_controller.cc",
diff --git a/content/browser/cookie_store/cookie_store_manager.cc b/content/browser/cookie_store/cookie_store_manager.cc index b9707a3..ff5899c7 100644 --- a/content/browser/cookie_store/cookie_store_manager.cc +++ b/content/browser/cookie_store/cookie_store_manager.cc
@@ -189,8 +189,7 @@ return; } - if (!origin.IsSameOriginWith( - url::Origin::Create(service_worker_registration->scope()))) { + if (!origin.IsSameOriginWith(service_worker_registration->key().origin())) { std::move(bad_message_callback).Run("Invalid service worker"); std::move(callback).Run(false); return; @@ -287,8 +286,7 @@ return; } - if (!origin.IsSameOriginWith( - url::Origin::Create(service_worker_registration->scope()))) { + if (!origin.IsSameOriginWith(service_worker_registration->key().origin())) { std::move(bad_message_callback).Run("Invalid service worker"); std::move(callback).Run(false); return;
diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc index 2e574d5f..ee57078b 100644 --- a/content/browser/devtools/protocol/network_handler.cc +++ b/content/browser/devtools/protocol/network_handler.cc
@@ -2992,6 +2992,10 @@ auto factory = CreateNetworkFactoryForDevTools( gurl.scheme(), frame->GetProcess(), frame->GetRoutingID(), frame->GetLastCommittedOrigin(), std::move(params)); + if (!factory.is_valid()) { + callback->sendFailure(Response::InvalidParams("Unsupported URL scheme")); + return; + } url_loader_factory.Bind(std::move(factory)); auto loader = DevToolsNetworkResourceLoader::Create(
diff --git a/content/browser/interest_group/interest_group_manager.cc b/content/browser/interest_group/interest_group_manager.cc index b9e5346..800edf7 100644 --- a/content/browser/interest_group/interest_group_manager.cc +++ b/content/browser/interest_group/interest_group_manager.cc
@@ -142,6 +142,12 @@ .Then(std::move(callback)); } +void InterestGroupManager::GetAllInterestGroupJoiningOrigins( + base::OnceCallback<void(std::vector<url::Origin>)> callback) { + impl_.AsyncCall(&InterestGroupStorage::GetAllInterestGroupJoiningOrigins) + .Then(std::move(callback)); +} + void InterestGroupManager::DeleteInterestGroupData( base::RepeatingCallback<bool(const url::Origin&)> origin_matcher) { impl_.AsyncCall(&InterestGroupStorage::DeleteInterestGroupData)
diff --git a/content/browser/interest_group/interest_group_manager.h b/content/browser/interest_group/interest_group_manager.h index 55b6688..e5e212d7 100644 --- a/content/browser/interest_group/interest_group_manager.h +++ b/content/browser/interest_group/interest_group_manager.h
@@ -106,6 +106,10 @@ void ClaimInterestGroupsForUpdate( const url::Origin& owner, base::OnceCallback<void(std::vector<StorageInterestGroup>)> callback); + // Gets a list of all interest group joining origins. Each joining origin + // will only appear once. + void GetAllInterestGroupJoiningOrigins( + base::OnceCallback<void(std::vector<url::Origin>)> callback); // Clear out storage for the matching owning origin. If the callback is empty // then apply to all origins. void DeleteInterestGroupData(
diff --git a/content/browser/interest_group/interest_group_storage.cc b/content/browser/interest_group/interest_group_storage.cc index 6180b79..6e26e9e1 100644 --- a/content/browser/interest_group/interest_group_storage.cc +++ b/content/browser/interest_group/interest_group_storage.cc
@@ -1752,6 +1752,18 @@ return std::move(maybe_result.value()); } +std::vector<url::Origin> +InterestGroupStorage::GetAllInterestGroupJoiningOrigins() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!EnsureDBInitialized()) + return {}; + absl::optional<std::vector<url::Origin>> maybe_result = + DoGetAllInterestGroupJoiningOrigins(*db_, base::Time::Now()); + if (!maybe_result) + return {}; + return std::move(maybe_result.value()); +} + void InterestGroupStorage::DeleteInterestGroupData( const base::RepeatingCallback<bool(const url::Origin&)>& origin_matcher) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/content/browser/interest_group/interest_group_storage.h b/content/browser/interest_group/interest_group_storage.h index 5a041b75b..edc90466 100644 --- a/content/browser/interest_group/interest_group_storage.h +++ b/content/browser/interest_group/interest_group_storage.h
@@ -106,6 +106,9 @@ // anything until after the success rate limit period passes. std::vector<StorageInterestGroup> ClaimInterestGroupsForUpdate( const url::Origin& owner); + // Gets a list of all interest group joining origins. Each joining origin + // will only appear once. + std::vector<url::Origin> GetAllInterestGroupJoiningOrigins(); // Clear out storage for the matching owning origin. If the callback is empty // then apply to all origins.
diff --git a/content/browser/interest_group/interest_group_storage_unittest.cc b/content/browser/interest_group/interest_group_storage_unittest.cc index 2930234b..07076d4 100644 --- a/content/browser/interest_group/interest_group_storage_unittest.cc +++ b/content/browser/interest_group/interest_group_storage_unittest.cc
@@ -34,6 +34,7 @@ namespace content { using blink::InterestGroup; +using testing::UnorderedElementsAre; using testing::UnorderedElementsAreArray; class InterestGroupStorageTest : public testing::Test { @@ -755,7 +756,12 @@ joining_originB.GetURL()); std::vector<url::Origin> origins = storage->GetAllInterestGroupOwners(); - EXPECT_EQ(3u, origins.size()); + EXPECT_THAT(origins, UnorderedElementsAre(owner_originA, owner_originB, + owner_originC)); + std::vector<url::Origin> joining_origins = + storage->GetAllInterestGroupJoiningOrigins(); + EXPECT_THAT(joining_origins, + UnorderedElementsAre(joining_originA, joining_originB)); storage->DeleteInterestGroupData( base::BindLambdaForTesting([&owner_originA](const url::Origin& origin) { @@ -763,7 +769,10 @@ })); origins = storage->GetAllInterestGroupOwners(); - EXPECT_EQ(2u, origins.size()); + EXPECT_THAT(origins, UnorderedElementsAre(owner_originB, owner_originC)); + joining_origins = storage->GetAllInterestGroupJoiningOrigins(); + EXPECT_THAT(joining_origins, + UnorderedElementsAre(joining_originA, joining_originB)); // Delete all interest groups that joined on joining_origin A. We expect that // we will be left with the one that joined on joining_origin B. @@ -773,7 +782,9 @@ })); origins = storage->GetAllInterestGroupOwners(); - EXPECT_EQ(1u, origins.size()); + EXPECT_THAT(origins, UnorderedElementsAre(owner_originB)); + joining_origins = storage->GetAllInterestGroupJoiningOrigins(); + EXPECT_THAT(joining_origins, UnorderedElementsAre(joining_originB)); storage->DeleteInterestGroupData({});
diff --git a/content/browser/push_messaging/push_messaging_manager.cc b/content/browser/push_messaging/push_messaging_manager.cc index 36af35e6..422c649 100644 --- a/content/browser/push_messaging/push_messaging_manager.cc +++ b/content/browser/push_messaging/push_messaging_manager.cc
@@ -193,8 +193,7 @@ return; } - url::Origin origin = - url::Origin::Create(service_worker_registration->scope()); + const url::Origin& origin = service_worker_registration->key().origin(); if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanAccessDataForOrigin( render_process_host_.GetID(), origin)) { @@ -203,7 +202,7 @@ return; } - data.requesting_origin = std::move(origin); + data.requesting_origin = origin; DCHECK(!(data.options->application_server_key.empty() && IsRequestFromDocument(render_frame_id_))); @@ -505,8 +504,7 @@ return; } - url::Origin origin = - url::Origin::Create(service_worker_registration->scope()); + const url::Origin& origin = service_worker_registration->key().origin(); if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanAccessDataForOrigin( render_process_host_.GetID(), origin)) { @@ -519,7 +517,7 @@ service_worker_registration_id, {kPushSenderIdServiceWorkerKey}, base::BindOnce(&PushMessagingManager::UnsubscribeHavingGottenSenderId, weak_factory_.GetWeakPtr(), std::move(callback), - service_worker_registration_id, std::move(origin))); + service_worker_registration_id, origin)); } void PushMessagingManager::UnsubscribeHavingGottenSenderId( @@ -598,10 +596,8 @@ service_worker_context_->GetLiveRegistration( service_worker_registration_id); if (registration) { - url::Origin origin = url::Origin::Create(registration->scope()); - if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanAccessDataForOrigin( - render_process_host_.GetID(), std::move(origin))) { + render_process_host_.GetID(), registration->key().origin())) { bad_message::ReceivedBadMessage( &render_process_host_, bad_message::PMM_GET_SUBSCRIPTION_INVALID_ORIGIN); @@ -652,7 +648,7 @@ break; } - const url::Origin origin = url::Origin::Create(registration->scope()); + const url::Origin& origin = registration->key().origin(); GetSubscriptionInfo( origin, service_worker_registration_id, application_server_key,
diff --git a/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.cc b/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.cc index 0e2ecf26..5705d578 100644 --- a/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.cc +++ b/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.cc
@@ -150,7 +150,7 @@ base::ReadOnlySharedMemoryRegion DWriteFontLookupTableBuilder::DuplicateMemoryRegion() { - DCHECK(!TableCacheFilePath().empty()) + DCHECK(!table_cache_path_.empty()) << "Ensure that a cache_directory_ is set (see " "InitializeCacheDirectoryFromProfile())"; DCHECK(FontUniqueNameTableReady()); @@ -267,12 +267,6 @@ })); } -base::FilePath DWriteFontLookupTableBuilder::TableCacheFilePath() { - if (!EnsureCacheDirectory(cache_directory_)) - return base::FilePath(); - return cache_directory_.Append(kProtobufFilename); -} - bool DWriteFontLookupTableBuilder::PersistToFile() { DCHECK(caching_enabled_); @@ -280,14 +274,14 @@ return false; return blink::font_table_persistence::PersistToFile(font_table_memory_, - TableCacheFilePath()); + table_cache_path_); } bool DWriteFontLookupTableBuilder::LoadFromFile() { DCHECK(caching_enabled_); DCHECK(!IsFontUniqueNameTableValid()); - return blink::font_table_persistence::LoadFromFile(TableCacheFilePath(), + return blink::font_table_persistence::LoadFromFile(table_cache_path_, &font_table_memory_); } @@ -342,11 +336,14 @@ if (HasDWriteUniqueFontLookups()) return; + if (EnsureCacheDirectory(cache_directory_)) + table_cache_path_ = cache_directory_.Append(kProtobufFilename); + // Do not schedule indexing if we do not have a profile or temporary directory // to store the cached table. This prevents repetitive and redundant scanning // when the ContentBrowserClient did not provide a cache directory, as is the // case in content_unittests. - if (TableCacheFilePath().empty()) + if (table_cache_path_.empty()) return; start_time_table_ready_ = base::TimeTicks::Now();
diff --git a/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.h b/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.h index bbc3f07..45ae779 100644 --- a/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.h +++ b/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.h
@@ -188,8 +188,6 @@ void InitializeDirectWrite(); - base::FilePath TableCacheFilePath(); - // Returns true if IDWriteFactory3 is available, which means that we can // access IDWriteFontSet API which provides direct lookup by PostScript name // and full font name, in which case we do not need to build this table. @@ -235,6 +233,7 @@ base::TimeTicks start_time_table_ready_; base::TimeTicks start_time_table_build_; base::FilePath cache_directory_; + base::FilePath table_cache_path_; bool caching_enabled_ = true; absl::optional<base::WaitableEvent> hang_event_for_testing_;
diff --git a/content/browser/renderer_host/hit_test_debug_key_event_observer.cc b/content/browser/renderer_host/hit_test_debug_key_event_observer.cc deleted file mode 100644 index 3bbf671..0000000 --- a/content/browser/renderer_host/hit_test_debug_key_event_observer.cc +++ /dev/null
@@ -1,80 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/browser/renderer_host/hit_test_debug_key_event_observer.h" - -#include "components/viz/common/hit_test/hit_test_region_list.h" -#include "components/viz/host/host_frame_sink_manager.h" -#include "content/browser/compositor/surface_utils.h" -#include "content/browser/renderer_host/render_widget_host_impl.h" -#include "content/browser/renderer_host/render_widget_host_input_event_router.h" -#include "content/browser/renderer_host/render_widget_host_view_base.h" -#include "ui/events/keycodes/keyboard_codes.h" - -#if defined(USE_AURA) -#include "ui/aura/window.h" -#include "ui/aura/window_tree_host.h" -#include "ui/compositor/compositor.h" -#endif - -typedef blink::WebInputEvent::Type Type; -typedef blink::WebInputEvent::Modifiers Modifiers; - -namespace content { - -HitTestDebugKeyEventObserver::HitTestDebugKeyEventObserver( - RenderWidgetHostImpl* host) - : host_(host), hit_test_query_(nullptr) { - host_->AddInputEventObserver(this); -} - -HitTestDebugKeyEventObserver::~HitTestDebugKeyEventObserver() { - host_->RemoveInputEventObserver(this); -} - -void HitTestDebugKeyEventObserver::OnInputEventAck( - blink::mojom::InputEventResultSource source, - blink::mojom::InputEventResultState state, - const blink::WebInputEvent& event) { - if (blink::mojom::InputEventResultState::kConsumed == state || - (event.GetType() != Type::kRawKeyDown && - event.GetType() != Type::kKeyDown)) { - return; - } - - const blink::WebKeyboardEvent& key_event = - static_cast<const blink::WebKeyboardEvent&>(event); - - // All keybindings use Ctrl-Shift modifiers. - if (key_event.GetModifiers() != - (Modifiers::kControlKey | Modifiers::kShiftKey)) { - return; - } - - int key = key_event.windows_key_code; - - if (key == ui::VKEY_H) { - if (!hit_test_query_) { - hit_test_query_ = GetHitTestQuery(GetHostFrameSinkManager(), - host_->GetView()->GetRootFrameSinkId()); - } - if (hit_test_query_) { - std::string printed_hit_test_data = hit_test_query_->PrintHitTestData(); - VLOG(1) << (printed_hit_test_data.empty() ? "No hit-test data." - : printed_hit_test_data); - } - } else if (key == ui::VKEY_K) { -#if defined(USE_AURA) - ui::Compositor* compositor = - host_->GetView()->GetNativeView()->GetHost()->compositor(); - cc::LayerTreeDebugState debug_state = compositor->GetLayerTreeDebugState(); - debug_state.show_hit_test_borders = !debug_state.show_hit_test_borders; - compositor->SetLayerTreeDebugState(debug_state); -#endif - // TODO(zandershah): Implement for mac and android through - // RenderWidgetHostViewBase interface. - } -} - -} // namespace content
diff --git a/content/browser/renderer_host/hit_test_debug_key_event_observer.h b/content/browser/renderer_host/hit_test_debug_key_event_observer.h deleted file mode 100644 index 48e0800..0000000 --- a/content/browser/renderer_host/hit_test_debug_key_event_observer.h +++ /dev/null
@@ -1,41 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_BROWSER_RENDERER_HOST_HIT_TEST_DEBUG_KEY_EVENT_OBSERVER_H_ -#define CONTENT_BROWSER_RENDERER_HOST_HIT_TEST_DEBUG_KEY_EVENT_OBSERVER_H_ - -#include "base/memory/raw_ptr.h" -#include "content/public/browser/render_widget_host.h" - -namespace viz { - -class HitTestQuery; - -} // namespace viz - -namespace content { - -class RenderWidgetHostImpl; - -// Implements the RenderWidgetHost::InputEventObserver interface, and acts on -// keyboard input events to print hit-test data. -class HitTestDebugKeyEventObserver - : public RenderWidgetHost::InputEventObserver { - public: - explicit HitTestDebugKeyEventObserver(RenderWidgetHostImpl* host); - ~HitTestDebugKeyEventObserver() override; - - // RenderWidgetHost::InputEventObserver: - void OnInputEventAck(blink::mojom::InputEventResultSource source, - blink::mojom::InputEventResultState state, - const blink::WebInputEvent&) override; - - private: - raw_ptr<RenderWidgetHostImpl> host_; - raw_ptr<viz::HitTestQuery> hit_test_query_; -}; - -} // namespace content - -#endif // CONTENT_BROWSER_RENDERER_HOST_HIT_TEST_DEBUG_KEY_EVENT_OBSERVER_H_
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_child_frame_browsertest.cc index 7ca0efb..c8829b0 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_view_child_frame_browsertest.cc
@@ -10,6 +10,7 @@ #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "base/test/test_timeouts.h" +#include "base/time/time.h" #include "build/build_config.h" #include "components/viz/common/surfaces/surface_id.h" #include "content/browser/portal/portal.h" @@ -37,6 +38,8 @@ namespace content { +namespace { + class RenderWidgetHostViewChildFrameBrowserTest : public ContentBrowserTest { public: RenderWidgetHostViewChildFrameBrowserTest() = default; @@ -410,9 +413,21 @@ // Force the child to submit a new frame. ASSERT_TRUE(ExecJs(root->child_at(0)->current_frame_host(), "document.write('Force a new frame.');")); + + const base::TimeTicks start_time = base::TimeTicks::Now(); do { + if (base::TimeTicks::Now() - start_time > TestTimeouts::action_timeout()) { + FAIL() + << "Timed out waiting for Browser.Tabs.TotalSwitchDuration. Received " + "these histograms instead: " + << ::testing::PrintToString( + histogram_tester.GetTotalCountsForPrefix("Browser.Tabs.")); + } FetchHistogramsFromChildProcesses(); GiveItSomeTime(); + + // Once the tab switch completes the PresentationFeedback should cause a + // single TotalSwitchDuration histogram to be logged. } while (histogram_tester .GetTotalCountsForPrefix("Browser.Tabs.TotalSwitchDuration") .size() != 1); @@ -710,4 +725,6 @@ EXPECT_EQ(oop_input_element_dir, "rtl"); } -} // namespace content +} // namespace + +} // namespace content \ No newline at end of file
diff --git a/content/browser/renderer_host/render_widget_host_view_event_handler.cc b/content/browser/renderer_host/render_widget_host_view_event_handler.cc index 98aca4f..4aaa57f 100644 --- a/content/browser/renderer_host/render_widget_host_view_event_handler.cc +++ b/content/browser/renderer_host/render_widget_host_view_event_handler.cc
@@ -10,7 +10,6 @@ #include "base/numerics/safe_conversions.h" #include "build/build_config.h" #include "components/viz/common/features.h" -#include "content/browser/renderer_host/hit_test_debug_key_event_observer.h" #include "content/browser/renderer_host/input/touch_selection_controller_client_aura.h" #include "content/browser/renderer_host/overscroll_controller.h" #include "content/browser/renderer_host/render_view_host_delegate.h" @@ -121,10 +120,7 @@ host_(host), host_view_(host_view), delegate_(delegate), - mouse_wheel_phase_handler_(host_view), - debug_observer_(features::IsVizHitTestingDebugEnabled() - ? std::make_unique<HitTestDebugKeyEventObserver>(host) - : nullptr) {} + mouse_wheel_phase_handler_(host_view) {} RenderWidgetHostViewEventHandler::~RenderWidgetHostViewEventHandler() { DCHECK(!mouse_locked_);
diff --git a/content/browser/renderer_host/render_widget_host_view_event_handler.h b/content/browser/renderer_host/render_widget_host_view_event_handler.h index 5b038db..118f634 100644 --- a/content/browser/renderer_host/render_widget_host_view_event_handler.h +++ b/content/browser/renderer_host/render_widget_host_view_event_handler.h
@@ -45,7 +45,6 @@ class RenderWidgetHostImpl; class RenderWidgetHostViewBase; class TouchSelectionControllerClientAura; -class HitTestDebugKeyEventObserver; // Provides an implementation of ui::EventHandler for use with // RenderWidgetHostViewBase. A delegate is required in order to provide platform @@ -316,8 +315,6 @@ const raw_ptr<Delegate> delegate_; raw_ptr<aura::Window> window_ = nullptr; MouseWheelPhaseHandler mouse_wheel_phase_handler_; - - std::unique_ptr<HitTestDebugKeyEventObserver> debug_observer_; }; } // namespace content
diff --git a/content/browser/renderer_host/render_widget_targeter.cc b/content/browser/renderer_host/render_widget_targeter.cc index 7cff5b1..2ad777bc 100644 --- a/content/browser/renderer_host/render_widget_targeter.cc +++ b/content/browser/renderer_host/render_widget_targeter.cc
@@ -10,9 +10,6 @@ #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/rand_util.h" -#include "components/viz/common/features.h" -#include "components/viz/host/host_frame_sink_manager.h" -#include "content/browser/compositor/surface_utils.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/public/browser/site_isolation_policy.h" @@ -176,8 +173,6 @@ RenderWidgetTargeter::RenderWidgetTargeter(Delegate* delegate) : async_hit_test_timeout_delay_(kAsyncHitTestTimeout), trace_id_(base::RandUint64()), - is_viz_hit_testing_debug_enabled_( - features::IsVizHitTestingDebugEnabled()), delegate_(delegate) { DCHECK(delegate_); } @@ -388,11 +383,6 @@ target->host()->input_target_client().set_disconnect_handler( base::OnceClosure()); - if (is_viz_hit_testing_debug_enabled_ && request.IsWebInputEventRequest() && - request.GetEvent()->GetType() == blink::WebInputEvent::Type::kMouseDown) { - hit_test_async_queried_debug_queue_.push_back(target->GetFrameSinkId()); - } - auto* view = delegate_->FindViewFromFrameSinkId(frame_sink_id); if (!view) view = target.get(); @@ -440,14 +430,6 @@ if (!request->GetRootView() || !request->GetRootView()->GetRenderWidgetHost()) return; - if (is_viz_hit_testing_debug_enabled_ && - !hit_test_async_queried_debug_queue_.empty()) { - GetHostFrameSinkManager()->SetHitTestAsyncQueriedDebugRegions( - request->GetRootView()->GetRootFrameSinkId(), - hit_test_async_queried_debug_queue_); - hit_test_async_queried_debug_queue_.clear(); - } - if (request->IsWebInputEventRequest()) { delegate_->DispatchEventToTarget(request->GetRootView(), target, request->GetEvent(), request->GetLatency(),
diff --git a/content/browser/renderer_host/render_widget_targeter.h b/content/browser/renderer_host/render_widget_targeter.h index 173b3ac..d5a7512 100644 --- a/content/browser/renderer_host/render_widget_targeter.h +++ b/content/browser/renderer_host/render_widget_targeter.h
@@ -259,11 +259,6 @@ uint64_t trace_id_; - const bool is_viz_hit_testing_debug_enabled_; - // Stores SurfaceIds for regions that were async queried if hit-test debugging - // is enabled. This allows us to send the queried regions in batches. - std::vector<viz::FrameSinkId> hit_test_async_queried_debug_queue_; - const raw_ptr<Delegate> delegate_; base::WeakPtrFactory<RenderWidgetTargeter> weak_ptr_factory_{this}; };
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index b565aa3..30d111a 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h
@@ -60,8 +60,6 @@ #include "third_party/blink/public/web/web_memory_statistics.h" #include "ui/gfx/native_widget_types.h" -class SkBitmap; - namespace blink { class WebResourceRequestSenderDelegate; class WebVideoCaptureImplManager; @@ -430,9 +428,6 @@ void InitializeCompositorThread(); void InitializeWebKit(mojo::BinderMap* binders); - void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); - void OnGetAccessibilityTree(); - // mojom::Renderer: void CreateAgentSchedulingGroup( mojo::PendingReceiver<IPC::mojom::ChannelBootstrap> bootstrap,
diff --git a/fuchsia/engine/BUILD.gn b/fuchsia/engine/BUILD.gn index 134f292..84c2f8c 100644 --- a/fuchsia/engine/BUILD.gn +++ b/fuchsia/engine/BUILD.gn
@@ -572,6 +572,9 @@ "//build/config/fuchsia/test/vulkan_capabilities.test-cmx", ] additional_manifests = [ + # Required by ContextProvider to determine the services list. + "web_instance.cmx", + # Required by ContextProvider unit-tests to launch the FakeContext process. "$target_gen_dir/web_engine_unittests_fake_instance.cmx", ] @@ -617,6 +620,9 @@ "//build/config/fuchsia/test/web_engine_required_capabilities.test-cmx", "//build/config/fuchsia/test/web_instance_host_capabilities.test-cmx", ] + + # Required by web_instance_host. + additional_manifests = [ "//fuchsia/engine/web_instance.cmx" ] } cr_fuchsia_package("web_engine_shell_pkg") {
diff --git a/fuchsia/engine/web_engine_debug_integration_test.cc b/fuchsia/engine/web_engine_debug_integration_test.cc index 52769be..71b11a7f 100644 --- a/fuchsia/engine/web_engine_debug_integration_test.cc +++ b/fuchsia/engine/web_engine_debug_integration_test.cc
@@ -133,7 +133,6 @@ return; fuchsia::web::CreateContextParams create_params; - create_params.set_features(fuchsia::web::ContextFeatureFlags::NETWORK); create_params.set_service_directory(std::move(directory)); if (user_mode_debugging == UserModeDebugging::kEnabled) create_params.set_remote_debugging_port(0);
diff --git a/fuchsia/engine/web_engine_integration_logging_test.cc b/fuchsia/engine/web_engine_integration_logging_test.cc index 04d6d15..b93a496 100644 --- a/fuchsia/engine/web_engine_integration_logging_test.cc +++ b/fuchsia/engine/web_engine_integration_logging_test.cc
@@ -119,9 +119,9 @@ log_listener.ListenToLog(log(), nullptr); // Create the Context & Frame with all log severities enabled. - CreateContext(TestContextParams()); fuchsia::web::CreateFrameParams frame_params; frame_params.set_debug_name(kFrameLogTag); + CreateContext(TestContextParams()); CreateFrameWithParams(std::move(frame_params)); frame_->SetJavaScriptLogLevel(fuchsia::web::ConsoleLogLevel::DEBUG);
diff --git a/fuchsia/engine/web_engine_integration_test.cc b/fuchsia/engine/web_engine_integration_test.cc index e96519a..8a3933f 100644 --- a/fuchsia/engine/web_engine_integration_test.cc +++ b/fuchsia/engine/web_engine_integration_test.cc
@@ -78,8 +78,7 @@ fuchsia::web::CreateContextParams ContextParamsWithAudioAndTestData() { fuchsia::web::CreateContextParams create_params = TestContextParamsWithTestData(); - *create_params.mutable_features() |= - fuchsia::web::ContextFeatureFlags::AUDIO; + create_params.set_features(fuchsia::web::ContextFeatureFlags::AUDIO); return create_params; } @@ -534,8 +533,7 @@ TEST_F(MAYBE_VulkanWebEngineIntegrationTest, WebGLContextPresentWithVulkanFeature) { fuchsia::web::CreateContextParams create_params = TestContextParams(); - *create_params.mutable_features() |= - fuchsia::web::ContextFeatureFlags::VULKAN; + create_params.set_features(fuchsia::web::ContextFeatureFlags::VULKAN); CreateContextAndFrame(std::move(create_params)); ASSERT_NO_FATAL_FAILURE(LoadUrlAndExpectResponse( @@ -611,9 +609,10 @@ // The VULKAN flag is required for hardware video decoders to be available. fuchsia::web::CreateContextParams create_params = ContextParamsWithAudioAndTestData(); - *create_params.mutable_features() |= + create_params.set_features( fuchsia::web::ContextFeatureFlags::VULKAN | - fuchsia::web::ContextFeatureFlags::HARDWARE_VIDEO_DECODER; + fuchsia::web::ContextFeatureFlags::HARDWARE_VIDEO_DECODER | + fuchsia::web::ContextFeatureFlags::AUDIO); CreateContextAndFrame(std::move(create_params)); static const uint16_t kTestMediaSessionId = 1;
diff --git a/fuchsia/engine/web_engine_integration_test_base.cc b/fuchsia/engine/web_engine_integration_test_base.cc index cba804c..f830f33d 100644 --- a/fuchsia/engine/web_engine_integration_test_base.cc +++ b/fuchsia/engine/web_engine_integration_test_base.cc
@@ -73,10 +73,6 @@ fuchsia::web::CreateContextParams WebEngineIntegrationTestBase::TestContextParams() { fuchsia::web::CreateContextParams create_params; - - // Most integration tests require networking, to load test web content. - create_params.set_features(fuchsia::web::ContextFeatureFlags::NETWORK); - zx_status_t status = filtered_service_directory_.ConnectClient( create_params.mutable_service_directory()->NewRequest()); ZX_CHECK(status == ZX_OK, status)
diff --git a/fuchsia/engine/web_instance_host/web_instance_host.cc b/fuchsia/engine/web_instance_host/web_instance_host.cc index e5a5170..1fccbd7 100644 --- a/fuchsia/engine/web_instance_host/web_instance_host.cc +++ b/fuchsia/engine/web_instance_host/web_instance_host.cc
@@ -27,9 +27,12 @@ #include "base/command_line.h" #include "base/containers/contains.h" #include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/files/scoped_file.h" #include "base/fuchsia/file_utils.h" #include "base/fuchsia/fuchsia_logging.h" #include "base/fuchsia/process_context.h" +#include "base/json/json_reader.h" #include "base/logging.h" #include "base/process/process.h" #include "base/strings/strcat.h" @@ -68,6 +71,9 @@ namespace { +// Path to the definition file for web Component instances. +constexpr char kWebInstanceComponentPath[] = "/pkg/meta/web_instance.cmx"; + // Test-only URL for web hosting Component instances with WebUI resources. const char kWebInstanceWithWebUiComponentUrl[] = "fuchsia-pkg://fuchsia.com/web_engine_with_webui#meta/web_instance.cmx"; @@ -437,105 +443,15 @@ #endif } -// Returns the names of all services required by a web_instance.cmx component -// instance configured with the specified set of feature flags. The caller is -// responsible for verifying that |params| specifies a valid combination of -// settings, before calling this function. -std::vector<std::string> GetRequiredServicesForConfig( - const fuchsia::web::CreateContextParams& params) { - // All web_instance.cmx instances require a common set of services, described - // at: - // https://fuchsia.dev/reference/fidl/fuchsia.web#CreateContextParams.service_directory - std::vector<std::string> services{ - "fuchsia.device.NameProvider", "fuchsia.fonts.Provider", - "fuchsia.intl.PropertyProvider", "fuchsia.logger.LogSink", - "fuchsia.memorypressure.Provider", "fuchsia.process.Launcher", - "fuchsia.settings.Display", // Used if preferred theme is DEFAULT. - "fuchsia.sysmem.Allocator"}; - - // TODO(crbug.com/1209031): Provide these conditionally, once corresponding - // ContextFeatureFlags have been defined. - services.insert(services.end(), {"fuchsia.camera3.DeviceWatcher", - "fuchsia.media.ProfileProvider"}); - - // Additional services are required depending on particular configuration - // parameters. - if (params.has_playready_key_system()) { - services.emplace_back("fuchsia.media.drm.PlayReady"); - } - - // Additional services are required dependent on the set of features specified - // for the instance, as described at: - // https://fuchsia.dev/reference/fidl/fuchsia.web#ContextFeatureFlags - // Features are listed here in order of their enum value. - fuchsia::web::ContextFeatureFlags features = {}; - if (params.has_features()) - features = params.features(); - - // TODO(crbug.com/1020273): Allow access to network services only if the - // NETWORK feature flag is set. - services.insert(services.end(), { - "fuchsia.net.interfaces.State", - "fuchsia.net.name.Lookup", - "fuchsia.posix.socket.Provider", - }); - - if ((features & fuchsia::web::ContextFeatureFlags::AUDIO) == - fuchsia::web::ContextFeatureFlags::AUDIO) { - services.insert(services.end(), - { - "fuchsia.media.Audio", - "fuchsia.media.AudioDeviceEnumerator", - "fuchsia.media.SessionAudioConsumerFactory", - }); - } - - if ((features & fuchsia::web::ContextFeatureFlags::VULKAN) == - fuchsia::web::ContextFeatureFlags::VULKAN) { - services.emplace_back("fuchsia.vulkan.loader.Loader"); - } - - if ((features & fuchsia::web::ContextFeatureFlags::HARDWARE_VIDEO_DECODER) == - fuchsia::web::ContextFeatureFlags::HARDWARE_VIDEO_DECODER) { - services.emplace_back("fuchsia.mediacodec.CodecFactory"); - } - - // HARDWARE_VIDEO_DECODER_ONLY does not require any additional services. - - if ((features & fuchsia::web::ContextFeatureFlags::WIDEVINE_CDM) == - fuchsia::web::ContextFeatureFlags::WIDEVINE_CDM) { - services.emplace_back("fuchsia.media.drm.Widevine"); - } - - // HEADLESS instances cannot create Views and therefore do not require access - // to any View-based services. - if ((features & fuchsia::web::ContextFeatureFlags::HEADLESS) != - fuchsia::web::ContextFeatureFlags::HEADLESS) { - services.insert(services.end(), - { - "fuchsia.accessibility.semantics.SemanticsManager", - "fuchsia.ui.composition.Allocator", - "fuchsia.ui.composition.Flatland", - "fuchsia.ui.scenic.Scenic", - }); - } - - if ((features & fuchsia::web::ContextFeatureFlags::LEGACYMETRICS) == - fuchsia::web::ContextFeatureFlags::LEGACYMETRICS) { - services.emplace_back("fuchsia.legacymetrics.MetricsRecorder"); - } - - if ((features & fuchsia::web::ContextFeatureFlags::KEYBOARD) == - fuchsia::web::ContextFeatureFlags::KEYBOARD) { - services.emplace_back("fuchsia.ui.input3.Keyboard"); - } - - if ((features & fuchsia::web::ContextFeatureFlags::VIRTUAL_KEYBOARD) == - fuchsia::web::ContextFeatureFlags::VIRTUAL_KEYBOARD) { - services.emplace_back("fuchsia.input.virtualkeyboard.ControllerCreator"); - } - - return services; +std::vector<std::string> LoadWebInstanceSandboxServices() { + std::string cmx; + CHECK(ReadFileToString(base::FilePath(kWebInstanceComponentPath), &cmx)); + absl::optional<base::Value> json = base::JSONReader::Read(cmx); + const base::Value* services = json->FindListPath("sandbox.services"); + std::vector<std::string> result; + for (auto& entry : services->GetList()) + result.push_back(std::move(entry.GetString())); + return result; } } // namespace @@ -597,21 +513,16 @@ return ZX_ERR_INTERNAL; } - fuchsia::web::ContextFeatureFlags features = {}; - if (params.has_features()) - features = params.features(); - if (params.has_remote_debugging_port()) { - if ((features & fuchsia::web::ContextFeatureFlags::NETWORK) != - fuchsia::web::ContextFeatureFlags::NETWORK) { - LOG(ERROR) << "Enabling remote debugging port requires NETWORK feature."; - return ZX_ERR_INVALID_ARGS; - } launch_args.AppendSwitchNative( switches::kRemoteDebuggingPort, base::NumberToString(params.remote_debugging_port())); } + fuchsia::web::ContextFeatureFlags features = {}; + if (params.has_features()) + features = params.features(); + const bool is_headless = (features & fuchsia::web::ContextFeatureFlags::HEADLESS) == fuchsia::web::ContextFeatureFlags::HEADLESS; @@ -639,8 +550,8 @@ // VULKAN is required for DRM-protected video playback. Allow DRM to also be // enabled for HEADLESS Contexts, since Vulkan is never required for audio. if (!enable_vulkan && !is_headless) { - LOG(ERROR) << "WIDEVINE_CDM and PLAYREADY_CDM features require VULKAN " - " or HEADLESS."; + DLOG(ERROR) << "WIDEVINE_CDM and PLAYREADY_CDM features require VULKAN " + " or HEADLESS."; return ZX_ERR_NOT_SUPPORTED; } if (!params.has_cdm_data_directory()) { @@ -806,12 +717,12 @@ // Pass on the caller's service-directory request. launch_info.directory_request = services_request.TakeChannel(); - // Set |additional_services| to redirect requests for only those services - // required for the specified |params|, to be satisfied by the caller- - // supplied service directory. This reduces the risk of an instance being - // able to somehow exploit services other than those that it should be using. + // Set |additional_services| to redirect requests for all services specified + // in the web instance component manifest to be satisfied by the caller- + // supplied service directory. This ensures that the instance cannot access + // any services outside those provided by the caller. launch_info.additional_services = fuchsia::sys::ServiceList::New(); - launch_info.additional_services->names = GetRequiredServicesForConfig(params); + launch_info.additional_services->names = LoadWebInstanceSandboxServices(); launch_info.additional_services->host_directory = service_directory.TakeChannel();
diff --git a/fuchsia/engine/web_instance_host_integration_test.cc b/fuchsia/engine/web_instance_host_integration_test.cc index 5f4c7a1d..5eacb5ef 100644 --- a/fuchsia/engine/web_instance_host_integration_test.cc +++ b/fuchsia/engine/web_instance_host_integration_test.cc
@@ -63,7 +63,6 @@ protected: fuchsia::web::CreateContextParams TestContextParams() { fuchsia::web::CreateContextParams create_params; - create_params.set_features(fuchsia::web::ContextFeatureFlags::NETWORK); zx_status_t status = filtered_service_directory_.ConnectClient( create_params.mutable_service_directory()->NewRequest()); ZX_CHECK(status == ZX_OK, status)
diff --git a/fuchsia/runners/BUILD.gn b/fuchsia/runners/BUILD.gn index b57b9823..a7be37d 100644 --- a/fuchsia/runners/BUILD.gn +++ b/fuchsia/runners/BUILD.gn
@@ -159,6 +159,8 @@ package_name = "cast_runner" manifest = "cast/cast_runner.cmx" + # Required by web_instance_host. + additional_manifests = [ "//fuchsia/engine/web_instance.cmx" ] excluded_files = _web_instance_host_deps_files_to_exclude } @@ -290,6 +292,8 @@ package_name = "web_runner" manifest = "web/web_runner.cmx" + # Required by web_instance_host. + additional_manifests = [ "//fuchsia/engine/web_instance.cmx" ] excluded_files = _web_instance_host_deps_files_to_exclude }
diff --git a/fuchsia/runners/cast/cast_runner.cc b/fuchsia/runners/cast/cast_runner.cc index eddd7458..c90534f 100644 --- a/fuchsia/runners/cast/cast_runner.cc +++ b/fuchsia/runners/cast/cast_runner.cc
@@ -603,7 +603,6 @@ std::vector<fuchsia::web::ContentDirectoryProvider> content_directories) { fuchsia::web::CreateContextParams params = GetCommonContextParams(); EnsureSoftwareVideoDecodersAreDisabled(params.mutable_features()); - *params.mutable_features() |= fuchsia::web::ContextFeatureFlags::NETWORK; params.set_remote_debugging_port(kEphemeralRemoteDebuggingPort); params.set_content_directories(std::move(content_directories)); zx_status_t status = isolated_services_->ConnectClient(
diff --git a/infra/config/generated/cq-builders.md b/infra/config/generated/cq-builders.md index 8786b21..9af9154a 100644 --- a/infra/config/generated/cq-builders.md +++ b/infra/config/generated/cq-builders.md
@@ -436,6 +436,9 @@ by CQ. These are often used to test new configurations before they are added as required builders. +* [android-11-x86-rel](https://ci.chromium.org/p/chromium/builders/try/android-11-x86-rel) ([definition](https://cs.chromium.org/search?q=+file:/try.star$+""android-11-x86-rel"")) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+""android-11-x86-rel"")) + * Experiment percentage: 5.0 + * [android-marshmallow-arm64-rel-rts](https://ci.chromium.org/p/chromium/builders/try/android-marshmallow-arm64-rel-rts) ([definition](https://cs.chromium.org/search?q=+file:/try.star$+""android-marshmallow-arm64-rel-rts"")) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+""android-marshmallow-arm64-rel-rts"")) * Experiment percentage: 5.0
diff --git a/infra/config/generated/luci/commit-queue.cfg b/infra/config/generated/luci/commit-queue.cfg index fe30bb16..ba3a6326 100644 --- a/infra/config/generated/luci/commit-queue.cfg +++ b/infra/config/generated/luci/commit-queue.cfg
@@ -265,7 +265,10 @@ } builders { name: "chromium/try/android-11-x86-rel" - includable_only: true + experiment_percentage: 5 + location_regexp: ".*" + location_regexp_exclude: ".+/[+]/docs/.+" + location_regexp_exclude: ".+/[+]/infra/config/.+" } builders { name: "chromium/try/android-11-x86-rel-compilator"
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.android.star b/infra/config/subprojects/chromium/try/tryserver.chromium.android.star index 823ee81..4971e9c8 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.android.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.android.star
@@ -35,9 +35,10 @@ #branch_selector = branches.STANDARD_MILESTONE, main_list_view = "try", orchestrator_cores = 4, - # TODO(crbug.com/1137474): Enable it 5% experimentally once it works fine - # under orchestrator. - orchestrator_tryjob = None, + # TODO(crbug.com/1137474): Fully enable once it works fine + orchestrator_tryjob = try_.job( + experiment_percentage = 5, + ), compilator_cores = 32, compilator_goma_jobs = goma.jobs.J300, compilator_name = "android-11-x86-rel-compilator",
diff --git a/ios/chrome/app/application_delegate/BUILD.gn b/ios/chrome/app/application_delegate/BUILD.gn index 194b1e25..d23b999 100644 --- a/ios/chrome/app/application_delegate/BUILD.gn +++ b/ios/chrome/app/application_delegate/BUILD.gn
@@ -79,9 +79,9 @@ "//ios/chrome/common/intents", "//ios/chrome/test:test_support", "//ios/chrome/test/ocmock", + "//ios/chrome/test/providers/app_distribution", "//ios/public/provider/chrome/browser:test_support", "//ios/public/provider/chrome/browser/app_distribution:app_distribution_api", - "//ios/public/provider/chrome/browser/app_distribution:test_app_distribution", "//ios/public/provider/chrome/browser/user_feedback:test_support", "//ios/testing:block_swizzler", "//ios/testing:ocmock_support",
diff --git a/ios/chrome/app/application_delegate/app_state_unittest.mm b/ios/chrome/app/application_delegate/app_state_unittest.mm index ca6bab47..baa6c6e 100644 --- a/ios/chrome/app/application_delegate/app_state_unittest.mm +++ b/ios/chrome/app/application_delegate/app_state_unittest.mm
@@ -47,9 +47,9 @@ #import "ios/chrome/browser/ui/safe_mode/safe_mode_coordinator.h" #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h" #include "ios/chrome/test/block_cleanup_test.h" +#include "ios/chrome/test/providers/app_distribution/test_app_distribution.h" #import "ios/chrome/test/scoped_key_window.h" #include "ios/public/provider/chrome/browser/app_distribution/app_distribution_api.h" -#include "ios/public/provider/chrome/browser/app_distribution/test_app_distribution.h" #include "ios/public/provider/chrome/browser/test_chrome_browser_provider.h" #include "ios/public/provider/chrome/browser/user_feedback/test_user_feedback_provider.h" #import "ios/testing/ocmock_complex_type_helper.h"
diff --git a/ios/chrome/app/strings/resources/ios_chromium_strings_bg.xtb b/ios/chrome/app/strings/resources/ios_chromium_strings_bg.xtb index 27031f4cf..675a241b 100644 --- a/ios/chrome/app/strings/resources/ios_chromium_strings_bg.xtb +++ b/ios/chrome/app/strings/resources/ios_chromium_strings_bg.xtb
@@ -90,6 +90,7 @@ <translation id="7313655110045230863">За да направите Chromium браузъра си по подразбиране, отворете „Настройки“, докоснете „Стандартно приложение за браузър“ и изберете Chromium.</translation> <translation id="7337881442233988129">Chromium</translation> <translation id="7357211569052832586">Избраните данни са премахнати от Chromium и синхронизираните устройства. Възможно е в профила ви в Google да има други видове история на сърфиране, съхранявани на адрес history.google.com – например търсения и активност от други наши услуги.</translation> +<translation id="7395825497086981028">Паролата ви ще бъде запазена в мениджъра на паролите за <ph name="EMAIL" />.</translation> <translation id="7400689562045506105">Използвайте Chromium навсякъде</translation> <translation id="766897673682622022">Паролата ви бе разкрита при нарушение на сигурността на данните. Chromium препоръчва да я промените сега.</translation> <translation id="7674213385180944843">Отворете „Settings“ > „Privacy“ > „Camera“ > „Chromium“ и включете камерата.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_chromium_strings_id.xtb b/ios/chrome/app/strings/resources/ios_chromium_strings_id.xtb index db86946..5d0a02cb 100644 --- a/ios/chrome/app/strings/resources/ios_chromium_strings_id.xtb +++ b/ios/chrome/app/strings/resources/ios_chromium_strings_id.xtb
@@ -90,6 +90,7 @@ <translation id="7313655110045230863">Untuk menjadikan Chromium sebagai browser default, buka Setelan. Ketuk Aplikasi Browser Default, lalu pilih Chromium.</translation> <translation id="7337881442233988129">Chromium</translation> <translation id="7357211569052832586">Data yang dipilih telah dihapus dari Chromium dan perangkat yang disinkronkan. Akun Google Anda mungkin memiliki bentuk histori penelusuran lain seperti penelusuran dan aktivitas dari layanan Google lainnya di history.google.com.</translation> +<translation id="7395825497086981028">Sandi Anda akan disimpan ke Pengelola Sandi untuk <ph name="EMAIL" />.</translation> <translation id="7400689562045506105">Gunakan Chromium di Mana Saja</translation> <translation id="766897673682622022">Sandi Anda terekspos saat terjadi pelanggaran data. Chromium merekomendasikan untuk mengubah sandi sekarang.</translation> <translation id="7674213385180944843">Buka Setelan > Privasi > Kamera > Chromium, lalu aktifkan kamera.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_chromium_strings_ko.xtb b/ios/chrome/app/strings/resources/ios_chromium_strings_ko.xtb index a97950e..ff62361 100644 --- a/ios/chrome/app/strings/resources/ios_chromium_strings_ko.xtb +++ b/ios/chrome/app/strings/resources/ios_chromium_strings_ko.xtb
@@ -90,6 +90,7 @@ <translation id="7313655110045230863">Chromium을 기본 브라우저로 설정하려면 Settings(설정)를 여세요. Default Browser App(기본 브라우저 앱)을 탭한 다음 Chromium을 선택합니다.</translation> <translation id="7337881442233988129">Chromium</translation> <translation id="7357211569052832586">선택한 데이터가 Chromium 및 동기화된 기기에서 삭제되었습니다. history.google.com에서 검색이나 기타 Google 서비스에서의 활동 등 내 Google 계정에 있는 다른 형식의 탐색 기록을 확인할 수 있습니다.</translation> +<translation id="7395825497086981028">비밀번호가 <ph name="EMAIL" />의 비밀번호 관리자에 저장됩니다.</translation> <translation id="7400689562045506105">어디서나 Chromium 사용</translation> <translation id="766897673682622022">정보 유출로 인해 비밀번호가 노출되었습니다. 지금 바로 비밀번호를 변경하시기 바랍니다.</translation> <translation id="7674213385180944843">설정 > 개인정보 보호 > 카메라 > Chromium을 열고 카메라를 사용 설정하세요.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_chromium_strings_uk.xtb b/ios/chrome/app/strings/resources/ios_chromium_strings_uk.xtb index 55be416..23d49a0 100644 --- a/ios/chrome/app/strings/resources/ios_chromium_strings_uk.xtb +++ b/ios/chrome/app/strings/resources/ios_chromium_strings_uk.xtb
@@ -90,6 +90,7 @@ <translation id="7313655110045230863">Щоб зробити Chromium веб-переглядачем за умовчанням, відкрийте налаштування, натисніть "Веб-переглядач за умовчанням" і виберіть Chromium.</translation> <translation id="7337881442233988129">Chromium</translation> <translation id="7357211569052832586">Вибрані дані видалено з Chromium і синхронізованих пристроїв. У вашому обліковому записі Google на сторінці history.google.com може зберігатись історія веб-перегляду (як-от пошукові запити й активність) з інших служб Google.</translation> +<translation id="7395825497086981028">Ваш пароль буде збережено в Менеджері паролів для електронної адреси <ph name="EMAIL" />.</translation> <translation id="7400689562045506105">Користуйтеся Chromium будь-де</translation> <translation id="766897673682622022">Ваш пароль розкрито через порушення безпеки даних. Chromium радить негайно змінити його.</translation> <translation id="7674213385180944843">Відкрийте меню "Параметри" > "Приватність" > "Камера" > "Chromium" і ввімкніть камеру.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_chromium_strings_uz.xtb b/ios/chrome/app/strings/resources/ios_chromium_strings_uz.xtb index bca267e..3c969b16 100644 --- a/ios/chrome/app/strings/resources/ios_chromium_strings_uz.xtb +++ b/ios/chrome/app/strings/resources/ios_chromium_strings_uz.xtb
@@ -89,6 +89,7 @@ <translation id="7313655110045230863">Chromium brauzerini asosiy deb belgilash uchun Sozlamalarni oching. Standart brauzer ilovasi ustiga bosing va Chromiumni tanlang.</translation> <translation id="7337881442233988129">Chromium</translation> <translation id="7357211569052832586">Tanlangan ma’lumotlar Chromium va sinxronlangan qurilmalardan o‘chirildi. Google hisobingiz orqali amalga oshirilgan qidiruvlar, brauzer tarixi va boshqa internetdagi faoliyatingizni history.google.com sahifasi orqali ko‘rishingiz mumkin.</translation> +<translation id="7395825497086981028">Parolingiz Parollar menejerida <ph name="EMAIL" /> hisobiga saqlanadi.</translation> <translation id="7400689562045506105">Chromium doim yoningizda</translation> <translation id="766897673682622022">Parolingiz oshkor qilingan. Chromimum parolni hoziroq yangilashni tavsiya qiladi.</translation> <translation id="7674213385180944843">Kameradan foydalanishga ruxsat berish uchun “Sozlamalar > Maxfiylik > Kamera > Chromium” bandini oching.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_chromium_strings_vi.xtb b/ios/chrome/app/strings/resources/ios_chromium_strings_vi.xtb index ba798cc..dbd3d8e0 100644 --- a/ios/chrome/app/strings/resources/ios_chromium_strings_vi.xtb +++ b/ios/chrome/app/strings/resources/ios_chromium_strings_vi.xtb
@@ -90,6 +90,7 @@ <translation id="7313655110045230863">Để đặt Chromium làm trình duyệt mặc định, hãy mở phần Cài đặt. Nhấn vào Ứng dụng trình duyệt mặc định rồi chọn Chromium.</translation> <translation id="7337881442233988129">Chromium</translation> <translation id="7357211569052832586">Dữ liệu được chọn đã bị xóa khỏi Chromium và các thiết bị được đồng bộ hóa. Tài khoản Google của bạn có thể có các dạng lịch sử duyệt web khác, chẳng hạn như tìm kiếm và hoạt động từ các dịch vụ khác của Google tại history.google.com.</translation> +<translation id="7395825497086981028">Mật khẩu của bạn sẽ được lưu vào Trình quản lý mật khẩu cho <ph name="EMAIL" />.</translation> <translation id="7400689562045506105">Sử dụng Chromium mọi nơi</translation> <translation id="766897673682622022">Mật khẩu của bạn đã bị lộ trong một vụ rò rỉ dữ liệu. Chromium khuyên bạn nên đổi ngay mật khẩu.</translation> <translation id="7674213385180944843">Mở Cài đặt > Bảo mật > Máy ảnh > Chromium và bật máy ảnh.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_chromium_strings_zh-HK.xtb b/ios/chrome/app/strings/resources/ios_chromium_strings_zh-HK.xtb index 753dde88..b567001 100644 --- a/ios/chrome/app/strings/resources/ios_chromium_strings_zh-HK.xtb +++ b/ios/chrome/app/strings/resources/ios_chromium_strings_zh-HK.xtb
@@ -90,6 +90,7 @@ <translation id="7313655110045230863">如要將 Chromium 設定為預設瀏覽器,請開啟 [設定]。輕按 [預設的瀏覽器應用程式],然後選取 Chromium。</translation> <translation id="7337881442233988129">ChromiumHelper</translation> <translation id="7357211569052832586">所選資料已從 Chromium 和已同步的裝置中移除。不過,您仍可前往 history.google.com 存取 Google 帳戶中保存的其他各種瀏覽紀錄,例如在其他 Google 服務中的搜尋和活動紀錄。</translation> +<translation id="7395825497086981028">系統會將密碼儲存在 <ph name="EMAIL" /> 的「密碼管理工具」。</translation> <translation id="7400689562045506105">隨時隨地使用 Chromium</translation> <translation id="766897673682622022">您的密碼因資料外洩而被洩露。Chromium 建議立即變更密碼。</translation> <translation id="7674213385180944843">開啟 [設定] > [私隱權] > [相機] > [Chromium],然後開啟相機。</translation>
diff --git a/ios/chrome/app/strings/resources/ios_google_chrome_strings_bg.xtb b/ios/chrome/app/strings/resources/ios_google_chrome_strings_bg.xtb index f805c1db..1a76cb1 100644 --- a/ios/chrome/app/strings/resources/ios_google_chrome_strings_bg.xtb +++ b/ios/chrome/app/strings/resources/ios_google_chrome_strings_bg.xtb
@@ -2,6 +2,7 @@ <!DOCTYPE translationbundle> <translationbundle lang="bg"> <translation id="1096883626080133124">Вършете повече неща с опростения, сигурен и по-бърз от всякога браузър Google Chrome</translation> +<translation id="1143896152279775643">Паролата ви ще бъде запазена в мениджъра на паролите в Google за <ph name="EMAIL" />.</translation> <translation id="1282031177488366470">Помощ за подобряването на функциите и ефективността на Chrome</translation> <translation id="1314663809820920746">Пак можете да преглеждате отметките, историята, паролите и другите си настройки на това устройство. В случай че направите промени, те няма да се синхронизират с профила ви в Google.</translation> <translation id="1479202195792305274">Chrome може да проверява паролите ви, когато влизате с профила си в Google.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_google_chrome_strings_id.xtb b/ios/chrome/app/strings/resources/ios_google_chrome_strings_id.xtb index 7b91296..3debdad4 100644 --- a/ios/chrome/app/strings/resources/ios_google_chrome_strings_id.xtb +++ b/ios/chrome/app/strings/resources/ios_google_chrome_strings_id.xtb
@@ -2,6 +2,7 @@ <!DOCTYPE translationbundle> <translationbundle lang="id"> <translation id="1096883626080133124">Tingkatkan produktivitas dengan Google Chrome yang lebih praktis, aman, dan cepat</translation> +<translation id="1143896152279775643">Sandi Anda akan disimpan ke Pengelola Sandi Google untuk <ph name="EMAIL" />.</translation> <translation id="1282031177488366470">Bantu Sempurnakan Fitur dan Performa Chrome</translation> <translation id="1314663809820920746">Anda tetap dapat melihat semua bookmark, histori, sandi, dan setelan lain di perangkat ini. Jika Anda membuat perubahan, perubahan tersebut tidak akan disinkronkan ke Akun Google Anda.</translation> <translation id="1479202195792305274">Chrome dapat memeriksa sandi saat Anda login dengan Akun Google.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_google_chrome_strings_ko.xtb b/ios/chrome/app/strings/resources/ios_google_chrome_strings_ko.xtb index e21cae00..2b41e43 100644 --- a/ios/chrome/app/strings/resources/ios_google_chrome_strings_ko.xtb +++ b/ios/chrome/app/strings/resources/ios_google_chrome_strings_ko.xtb
@@ -2,6 +2,7 @@ <!DOCTYPE translationbundle> <translationbundle lang="ko"> <translation id="1096883626080133124">더욱 심플하고 안전하며 그 어느 때보다도 빠른 Chrome을 더욱 다양하게 활용하세요</translation> +<translation id="1143896152279775643">비밀번호가 <ph name="EMAIL" />의 Google 비밀번호 관리자에 저장됩니다.</translation> <translation id="1282031177488366470">Chrome의 기능 및 성능 개선에 참여</translation> <translation id="1314663809820920746">북마크, 방문 기록, 비밀번호 및 기타 설정은 모두 이 기기에서 계속 확인할 수 있습니다. 변경할 경우 변경사항이 내 Google 계정에 동기화되지는 않습니다.</translation> <translation id="1479202195792305274">Google 계정으로 로그인하면 Chrome에서 비밀번호를 확인할 수 있습니다.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_google_chrome_strings_uk.xtb b/ios/chrome/app/strings/resources/ios_google_chrome_strings_uk.xtb index 1cffdaa..39228f3 100644 --- a/ios/chrome/app/strings/resources/ios_google_chrome_strings_uk.xtb +++ b/ios/chrome/app/strings/resources/ios_google_chrome_strings_uk.xtb
@@ -2,6 +2,7 @@ <!DOCTYPE translationbundle> <translationbundle lang="uk"> <translation id="1096883626080133124">Більше можливостей у простому, безпечному й швидкому веб-переглядачі Google Chrome</translation> +<translation id="1143896152279775643">Ваш пароль буде збережено в Менеджері паролів Google для електронної адреси <ph name="EMAIL" />.</translation> <translation id="1282031177488366470">Допомогти покращити ефективність і функції Chrome</translation> <translation id="1314663809820920746">Ви все ще можете переглядати всі свої закладки, історію, паролі й інші налаштування на цьому пристрої. Якщо ви внесете зміни, вони не синхронізуватимуться з обліковим записом Google.</translation> <translation id="1479202195792305274">Chrome зможе перевірити ваші паролі, коли ви ввійдете в обліковий запис Google.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_google_chrome_strings_uz.xtb b/ios/chrome/app/strings/resources/ios_google_chrome_strings_uz.xtb index 9bf1716a..2c9491c 100644 --- a/ios/chrome/app/strings/resources/ios_google_chrome_strings_uz.xtb +++ b/ios/chrome/app/strings/resources/ios_google_chrome_strings_uz.xtb
@@ -2,6 +2,7 @@ <!DOCTYPE translationbundle> <translationbundle lang="uz"> <translation id="1096883626080133124">Oddiy, xavfsiz va har qachongidan tezkor Google Chrome brauzerida koʻplab imkoniyatlar</translation> +<translation id="1143896152279775643">Parolingiz Google Parollar menejerida <ph name="EMAIL" /> hisobiga saqlanadi.</translation> <translation id="1282031177488366470">Chrome funksiyalari va unumdorligini yaxshilashga yordam bering</translation> <translation id="1314663809820920746">Bu qurilmadagi bukmarklar, tarix, parollar va boshqa sozlamalarni koʻrishingiz mumkin. Oʻzgartirish kiritilsa, ular Google hisobingizga sinxronlanmaydi.</translation> <translation id="1479202195792305274">Google hisobingizga kirsangiz, Chrome parollaringizni tekshira oladi.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_google_chrome_strings_vi.xtb b/ios/chrome/app/strings/resources/ios_google_chrome_strings_vi.xtb index ca96c9d..653c559d 100644 --- a/ios/chrome/app/strings/resources/ios_google_chrome_strings_vi.xtb +++ b/ios/chrome/app/strings/resources/ios_google_chrome_strings_vi.xtb
@@ -2,6 +2,7 @@ <!DOCTYPE translationbundle> <translationbundle lang="vi"> <translation id="1096883626080133124">Với Google Chrome đơn giản, an toàn và nhanh nhất từ trước đến nay, bạn sẽ làm được nhiều việc hơn</translation> +<translation id="1143896152279775643">Mật khẩu của bạn sẽ được lưu vào Trình quản lý mật khẩu của Google cho <ph name="EMAIL" />.</translation> <translation id="1282031177488366470">Giúp cải thiện hiệu suất và các tính năng của Chrome</translation> <translation id="1314663809820920746">Bạn vẫn có thể xem tất cả dấu trang, danh sách trang web đã truy cập, mật khẩu và các chế độ cài đặt khác trên thiết bị này. Nếu bạn thực hiện thay đổi, các thay đổi đó sẽ không đồng bộ hóa với Tài khoản Google của bạn.</translation> <translation id="1479202195792305274">Chrome có thể kiểm tra mật khẩu khi bạn đăng nhập bằng Tài khoản Google của mình.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_google_chrome_strings_zh-HK.xtb b/ios/chrome/app/strings/resources/ios_google_chrome_strings_zh-HK.xtb index eb4f96a..c3a4a22 100644 --- a/ios/chrome/app/strings/resources/ios_google_chrome_strings_zh-HK.xtb +++ b/ios/chrome/app/strings/resources/ios_google_chrome_strings_zh-HK.xtb
@@ -2,6 +2,7 @@ <!DOCTYPE translationbundle> <translationbundle lang="zh-HK"> <translation id="1096883626080133124">Google Chrome 比以前更簡便、安全而快速,讓您事半功倍</translation> +<translation id="1143896152279775643">系統會將密碼儲存在 <ph name="EMAIL" /> 的「Google 密碼管理工具」。</translation> <translation id="1282031177488366470">協助改善 Chrome 的功能和效能</translation> <translation id="1314663809820920746">您仍可在此裝置上查看自己的所有書籤、記錄、密碼和其他設定,但您作出的變更將不會同步到 Google 帳戶。</translation> <translation id="1479202195792305274">Chrome 可在您使用 Google 帳戶登入時檢查密碼。</translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_ar.xtb b/ios/chrome/app/strings/resources/ios_strings_ar.xtb index 61a93ab..445022e 100644 --- a/ios/chrome/app/strings/resources/ios_strings_ar.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_ar.xtb
@@ -60,6 +60,7 @@ <translation id="1407135791313364759">فتح الكل</translation> <translation id="1430915738399379752">طباعة</translation> <translation id="1434356225517321998">تتم إدارة متصفّحك. <ph name="BEGIN_LINK" />التفاصيل<ph name="END_LINK" /></translation> +<translation id="1442838519825026149">التشفير على الجهاز فقط</translation> <translation id="1449835205994625556">إخفاء كلمة المرور</translation> <translation id="145015347812617860"><ph name="COUNT" /> من العناصر</translation> <translation id="149095475893949513">يحاول هذا الموقع الإلكتروني تنزيل ملف شخصي يتضمّن إعدادات.</translation> @@ -286,6 +287,7 @@ <translation id="3529024052484145543">غير آمن</translation> <translation id="3533202363250687977">إغلاق جميع علامات تبويب التصفُّح المتخفي</translation> <translation id="3533436815740441613">علامة تبويب جديدة</translation> +<translation id="3536487890564466894">يمكنك تشفير كلمات المرور قبل حفظها في حسابك على Google.</translation> <translation id="3551320343578183772">إغلاق علامة التبويب</translation> <translation id="3581564640715911333">اقتراح ترجمة الصفحات المكتوبة بلغات أخرى</translation> <translation id="3588820906588687999">فتح صورة في علامة تبويب جديدة</translation> @@ -503,6 +505,7 @@ <translation id="575902488528307720">البحث عن الصور</translation> <translation id="5781453543752460388">إضافة إلى "صور Google"</translation> <translation id="5782227691023083829">جارٍ ترجمة...</translation> +<translation id="5802829331520313983">بدء الإعداد…</translation> <translation id="5803566855766646066">هل تريد فعلاً تجاهل هذه البطاقة الجديدة؟</translation> <translation id="5812974770859303494">إضافة إلى...</translation> <translation id="5816228676161003208">هذا يتيح لك البحث بشكلٍ أسرع باستخدام صوتك.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_bg.xtb b/ios/chrome/app/strings/resources/ios_strings_bg.xtb index a53e6a8..d7767a1 100644 --- a/ios/chrome/app/strings/resources/ios_strings_bg.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_bg.xtb
@@ -60,6 +60,7 @@ <translation id="1407135791313364759">Отваряне на всички</translation> <translation id="1430915738399379752">Печат</translation> <translation id="1434356225517321998">Браузърът ви е управляван. <ph name="BEGIN_LINK" />Подробности<ph name="END_LINK" /></translation> +<translation id="1442838519825026149">Шифроване на устройството</translation> <translation id="1449835205994625556">Скриване на паролата</translation> <translation id="145015347812617860"><ph name="COUNT" /> елемента</translation> <translation id="149095475893949513">Този уебсайт се опитва да изтегли конфигурационен профил.</translation> @@ -94,6 +95,7 @@ <translation id="1690731385917361335">Няма елементи</translation> <translation id="1692118695553449118">Синхронизирането е включено</translation> <translation id="1700629756560807968">Избрахте <ph name="NUMBER_OF_SELECTED_BOOKMARKS" /></translation> +<translation id="1726573592754903697">Мениджър на паролите в Google</translation> <translation id="1740468249224277719">Докоснете двукратно, за да инсталирате.</translation> <translation id="1752547299766512813">Запазени пароли</translation> <translation id="1753905327828125965">Ползвани</translation> @@ -284,6 +286,7 @@ <translation id="3529024052484145543">Няма защита</translation> <translation id="3533202363250687977">Затв. на разделите „инкогнито“</translation> <translation id="3533436815740441613">Нов раздел</translation> +<translation id="3536487890564466894">Шифровайте паролите си, преди да бъдат запазени в профила ви в Google.</translation> <translation id="3551320343578183772">Затваряне на раздела</translation> <translation id="3581564640715911333">Извеждане на предложения за превод на страниците, написани на други езици</translation> <translation id="3588820906588687999">Отваряне на изображението в нов раздел</translation> @@ -501,6 +504,7 @@ <translation id="575902488528307720">Търсене на изображението</translation> <translation id="5781453543752460388">Добавяне към Photos</translation> <translation id="5782227691023083829">Превежда се...</translation> +<translation id="5802829331520313983">Настройване…</translation> <translation id="5803566855766646066">Наистина ли искате да отхвърлите тази нова карта?</translation> <translation id="5812974770859303494">Добавяне към...</translation> <translation id="5816228676161003208">Това ви позволява да търсите по-бързо посредством гласа си.</translation> @@ -560,6 +564,7 @@ <translation id="6219688215832490856">Никога да не се превежда</translation> <translation id="6223816392543092032">Получете отметките, историята, паролите и другите си настройки на всичките си устройства.</translation> <translation id="6232329973559504466">Търсене в режим „инкогнито“</translation> +<translation id="6232736989810857397">Това ви дава възможност лесно да създавате събития в календара посредством Google Обектив.</translation> <translation id="6254066287920239840">Отваряне на връзките в приложението вместо в браузъра.</translation> <translation id="6255097610484507482">Редактиране на кредитната карта</translation> <translation id="6284652193729350524">Предлагане на превод от <ph name="LANGUAGE" /></translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_es-419.xtb b/ios/chrome/app/strings/resources/ios_strings_es-419.xtb index b838eca8..ee1b038 100644 --- a/ios/chrome/app/strings/resources/ios_strings_es-419.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_es-419.xtb
@@ -60,6 +60,7 @@ <translation id="1407135791313364759">Abrir todas</translation> <translation id="1430915738399379752">Imprimir</translation> <translation id="1434356225517321998">Tu navegador está administrado. <ph name="BEGIN_LINK" />Detalles<ph name="END_LINK" /></translation> +<translation id="1442838519825026149">Encriptación integrada en el dispositivo</translation> <translation id="1449835205994625556">Ocultar contraseña</translation> <translation id="145015347812617860"><ph name="COUNT" /> elementos</translation> <translation id="149095475893949513">Este sitio web intenta descargar un perfil de configuración.</translation> @@ -284,6 +285,7 @@ <translation id="3529024052484145543">No seguro</translation> <translation id="3533202363250687977">Cerrar todas las pestañas de incógnito</translation> <translation id="3533436815740441613">Nueva pestaña</translation> +<translation id="3536487890564466894">Encripta tus contraseñas antes de que se guarden en tu Cuenta de Google.</translation> <translation id="3551320343578183772">Cerrar pestaña</translation> <translation id="3581564640715911333">Ofrecer la traducción de páginas en otros idiomas</translation> <translation id="3588820906588687999">Abrir imagen en nueva pestaña</translation> @@ -501,6 +503,7 @@ <translation id="575902488528307720">Buscar imagen</translation> <translation id="5781453543752460388">Agregar a fotos</translation> <translation id="5782227691023083829">Traduciendo...</translation> +<translation id="5802829331520313983">Configuración…</translation> <translation id="5803566855766646066">¿Confirmas que quieres descartar esta tarjeta nueva?</translation> <translation id="5812974770859303494">Agregar a…</translation> <translation id="5816228676161003208">Te permite realizar búsquedas más rápidas con tu voz.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_et.xtb b/ios/chrome/app/strings/resources/ios_strings_et.xtb index de8b6b2..04cb1c53 100644 --- a/ios/chrome/app/strings/resources/ios_strings_et.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_et.xtb
@@ -60,6 +60,7 @@ <translation id="1407135791313364759">Ava kõik</translation> <translation id="1430915738399379752">Printimine</translation> <translation id="1434356225517321998">Teie brauserit hallatakse. <ph name="BEGIN_LINK" />Üksikasjad<ph name="END_LINK" /></translation> +<translation id="1442838519825026149">Krüpteerimine seadmes</translation> <translation id="1449835205994625556">Peida parool</translation> <translation id="145015347812617860"><ph name="COUNT" /> üksust</translation> <translation id="149095475893949513">See veebisait üritab alla laadida seadistusprofiili.</translation> @@ -284,6 +285,7 @@ <translation id="3529024052484145543">Pole turvaline</translation> <translation id="3533202363250687977">Sule kõik inkognito vahelehed</translation> <translation id="3533436815740441613">Uus vaheleht</translation> +<translation id="3536487890564466894">Krüpteerige oma paroolid, enne kui need teie Google'i kontole salvestatakse.</translation> <translation id="3551320343578183772">Sule vaheleht</translation> <translation id="3581564640715911333">Paku muudes keeltes olevate lehtede tõlkimist</translation> <translation id="3588820906588687999">Ava kujutis uuel vahelehel</translation> @@ -501,6 +503,7 @@ <translation id="575902488528307720">Otsige pilte</translation> <translation id="5781453543752460388">Lisa teenusesse Photos</translation> <translation id="5782227691023083829">Tõlkimine...</translation> +<translation id="5802829331520313983">Seadistus …</translation> <translation id="5803566855766646066">Kas soovite kindlasti sellest uuest kaardist loobuda?</translation> <translation id="5812974770859303494">Lisa …</translation> <translation id="5816228676161003208">See võimaldab häälkäskluste abil kiiremini otsida.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_hi.xtb b/ios/chrome/app/strings/resources/ios_strings_hi.xtb index 7fbe2dc..93dca7a 100644 --- a/ios/chrome/app/strings/resources/ios_strings_hi.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_hi.xtb
@@ -614,6 +614,7 @@ <translation id="6524918542306337007">गुप्त मोड उपलब्ध नहीं है</translation> <translation id="6537746030088321027">example.com</translation> <translation id="6561262006871132942">ज़ूम इन करें</translation> +<translation id="6583087784430677195">इसे बंद करने के लिए, <ph name="BEGIN_LINK" />सेटिंग<ph name="END_LINK" /> खोलें और पासवर्ड अपने-आप भरने की सुविधा पर जाएं.</translation> <translation id="6585618849026997638">किसी भी अहम पेज पर आसानी से वापस जाने के लिए, आप उसे बुकमार्क कर सकते हैं</translation> <translation id="6603393121510733479">आपके संगठन ने निजी ब्राउज़िंग की सुविधा बंद कर दी है. <ph name="BEGIN_LINK" />ज़्यादा जानें<ph name="END_LINK" /></translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_id.xtb b/ios/chrome/app/strings/resources/ios_strings_id.xtb index 94711e5c..6f168e3 100644 --- a/ios/chrome/app/strings/resources/ios_strings_id.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_id.xtb
@@ -60,6 +60,7 @@ <translation id="1407135791313364759">Buka semua</translation> <translation id="1430915738399379752">Cetak</translation> <translation id="1434356225517321998">Browser Anda dikelola. <ph name="BEGIN_LINK" />Detail<ph name="END_LINK" /></translation> +<translation id="1442838519825026149">Enkripsi di Perangkat</translation> <translation id="1449835205994625556">Sembunyikan Sandi</translation> <translation id="145015347812617860"><ph name="COUNT" /> item</translation> <translation id="149095475893949513">Situs ini mencoba mendownload profil konfigurasi.</translation> @@ -94,6 +95,7 @@ <translation id="1690731385917361335">Tidak ada item</translation> <translation id="1692118695553449118">Sinkronisasi aktif</translation> <translation id="1700629756560807968"><ph name="NUMBER_OF_SELECTED_BOOKMARKS" /> dipilih</translation> +<translation id="1726573592754903697">Pengelola Sandi Google</translation> <translation id="1740468249224277719">Ketuk dua kali untuk memasang.</translation> <translation id="1752547299766512813">Simpan Sandi</translation> <translation id="1753905327828125965">Sering Dibuka</translation> @@ -284,6 +286,7 @@ <translation id="3529024052484145543">Tidak aman</translation> <translation id="3533202363250687977">Tutup Semua Tab Samaran</translation> <translation id="3533436815740441613">Tab Baru</translation> +<translation id="3536487890564466894">Mengenkripsi sandi sebelum disimpan ke Akun Google Anda.</translation> <translation id="3551320343578183772">Tutup Tab</translation> <translation id="3581564640715911333">Tawarkan penerjemahan halaman ke dalam bahasa lain</translation> <translation id="3588820906588687999">Buka Gambar di Tab Baru</translation> @@ -501,6 +504,7 @@ <translation id="575902488528307720">Telusuri Gambar</translation> <translation id="5781453543752460388">Tambahkan ke Foto</translation> <translation id="5782227691023083829">Menerjemahkan...</translation> +<translation id="5802829331520313983">Siapkan …</translation> <translation id="5803566855766646066">Yakin ingin menghapus kartu baru ini?</translation> <translation id="5812974770859303494">Tambahkan ke ...</translation> <translation id="5816228676161003208">Hal ini memungkinkan Anda menelusuri lebih cepat menggunakan suara.</translation> @@ -560,6 +564,7 @@ <translation id="6219688215832490856">Jangan Pernah Terjemahkan</translation> <translation id="6223816392543092032">Dapatkan bookmark, histori, sandi, dan setelan lainnya di semua perangkat Anda.</translation> <translation id="6232329973559504466">Penelusuran Samaran</translation> +<translation id="6232736989810857397">Hal ini memungkinkan Anda membuat acara kalender dengan mudah menggunakan Google Lens.</translation> <translation id="6254066287920239840">Buka link di aplikasi, bukan di browser.</translation> <translation id="6255097610484507482">Edit Kartu Kredit</translation> <translation id="6284652193729350524">Tawarkan untuk menerjemahkan bahasa <ph name="LANGUAGE" /></translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_ja.xtb b/ios/chrome/app/strings/resources/ios_strings_ja.xtb index 693c1ff..11afe547 100644 --- a/ios/chrome/app/strings/resources/ios_strings_ja.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_ja.xtb
@@ -60,6 +60,7 @@ <translation id="1407135791313364759">すべて開く</translation> <translation id="1430915738399379752">印刷</translation> <translation id="1434356225517321998">お使いのブラウザは管理されています。<ph name="BEGIN_LINK" />詳細<ph name="END_LINK" /></translation> +<translation id="1442838519825026149">オンデバイスの暗号化</translation> <translation id="1449835205994625556">パスワードを非表示にします</translation> <translation id="145015347812617860"><ph name="COUNT" />個のアイテム</translation> <translation id="149095475893949513">このウェブサイトが設定プロファイルをダウンロードしようとしています。</translation> @@ -285,6 +286,7 @@ <translation id="3529024052484145543">保護されていません</translation> <translation id="3533202363250687977">すべてのシークレット タブを閉じる</translation> <translation id="3533436815740441613">新しいタブ</translation> +<translation id="3536487890564466894">Google アカウントに保存する前にパスワードを暗号化します。</translation> <translation id="3551320343578183772">タブを閉じる</translation> <translation id="3581564640715911333">他の言語のページで翻訳するかどうかを尋ねる</translation> <translation id="3588820906588687999">新しいタブで画像を開く</translation> @@ -502,6 +504,7 @@ <translation id="575902488528307720">画像を検索</translation> <translation id="5781453543752460388">フォトに追加</translation> <translation id="5782227691023083829">翻訳しています...</translation> +<translation id="5802829331520313983">セットアップ…</translation> <translation id="5803566855766646066">この新しいカードを破棄してもよろしいですか?</translation> <translation id="5812974770859303494">追加先…</translation> <translation id="5816228676161003208">音声を使ってより速く検索できます。</translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_kk.xtb b/ios/chrome/app/strings/resources/ios_strings_kk.xtb index 0b4a9fdb3..9e9ab96 100644 --- a/ios/chrome/app/strings/resources/ios_strings_kk.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_kk.xtb
@@ -60,6 +60,7 @@ <translation id="1407135791313364759">Барлығын ашу</translation> <translation id="1430915738399379752">Басып шығару</translation> <translation id="1434356225517321998">Браузеріңіз басқарылады. <ph name="BEGIN_LINK" />Мәліметтер<ph name="END_LINK" /></translation> +<translation id="1442838519825026149">Құрылғыда шифрлау</translation> <translation id="1449835205994625556">Құпия сөзді жасыру</translation> <translation id="145015347812617860"><ph name="COUNT" /> элемент</translation> <translation id="149095475893949513">Бұл веб-сайт конфигурация профилін жүктеп алмақшы.</translation> @@ -284,6 +285,7 @@ <translation id="3529024052484145543">Қауіпсіз емес</translation> <translation id="3533202363250687977">Барлық инкогнито қойындыларын жабу</translation> <translation id="3533436815740441613">Жаңа қойынды</translation> +<translation id="3536487890564466894">Құпия сөздерді Google аккаунтыңызға сақтамас бұрын шифрлап алыңыз.</translation> <translation id="3551320343578183772">Қойындыны жабу</translation> <translation id="3581564640715911333">Басқа тілдердегі беттердің аудармасын ұсыну</translation> <translation id="3588820906588687999">Кескінді жаңа қойындыда ашу</translation> @@ -501,6 +503,7 @@ <translation id="575902488528307720">Кескін іздеу</translation> <translation id="5781453543752460388">Photos қолданбасына қосу</translation> <translation id="5782227691023083829">Аударылуда...</translation> +<translation id="5802829331520313983">Реттеу…</translation> <translation id="5803566855766646066">Осы жаңа картаны шынымен де жабу керек пе?</translation> <translation id="5812974770859303494">Қосу...</translation> <translation id="5816228676161003208">Дауыспен жылдамырақ іздеуге мүмкіндік береді.</translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_km.xtb b/ios/chrome/app/strings/resources/ios_strings_km.xtb index 6467675..af437568 100644 --- a/ios/chrome/app/strings/resources/ios_strings_km.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_km.xtb
@@ -612,6 +612,7 @@ <translation id="6524918542306337007">មិនអាចប្រើមុខងារឯកជនបានទេ</translation> <translation id="6537746030088321027">example.com</translation> <translation id="6561262006871132942">ពង្រីក</translation> +<translation id="6583087784430677195">ដើម្បីបិទ សូមបើក<ph name="BEGIN_LINK" />ការកំណត់<ph name="END_LINK" /> ហើយចូលទៅកាន់ "បំពេញពាក្យសម្ងាត់ស្វ័យប្រវត្តិ"។</translation> <translation id="6585618849026997638">អ្នកអាចត្រឡប់ទៅទំព័រដែលសំខាន់ចំពោះអ្នក តាមរយៈការបញ្ចូលចំណាំ</translation> <translation id="6603393121510733479">ស្ថាប័នរបស់អ្នកបានបិទការរុករកលក្ខណៈឯកជន។ <ph name="BEGIN_LINK" />ស្វែងយល់បន្ថែម<ph name="END_LINK" /></translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_ko.xtb b/ios/chrome/app/strings/resources/ios_strings_ko.xtb index cb84ca3..2150fa0 100644 --- a/ios/chrome/app/strings/resources/ios_strings_ko.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_ko.xtb
@@ -94,6 +94,7 @@ <translation id="1690731385917361335">항목 없음</translation> <translation id="1692118695553449118">동기화 사용 중</translation> <translation id="1700629756560807968"><ph name="NUMBER_OF_SELECTED_BOOKMARKS" />개 항목 선택됨</translation> +<translation id="1726573592754903697">Google 비밀번호 관리자</translation> <translation id="1740468249224277719">설치하려면 두 번 탭하세요.</translation> <translation id="1752547299766512813">비밀번호 저장</translation> <translation id="1753905327828125965">자주 방문한 페이지</translation> @@ -560,6 +561,7 @@ <translation id="6219688215832490856">번역 안함</translation> <translation id="6223816392543092032">모든 기기에서 북마크, 방문 기록, 비밀번호, 기타 설정을 동기화합니다</translation> <translation id="6232329973559504466">시크릿 검색</translation> +<translation id="6232736989810857397">이렇게 하면 Google 렌즈를 사용하여 간편하게 캘린더 일정을 만들 수 있습니다.</translation> <translation id="6254066287920239840">브라우저 대신 앱에서 링크 열기</translation> <translation id="6255097610484507482">신용카드 수정</translation> <translation id="6284652193729350524"><ph name="LANGUAGE" /> 번역 옵션 제공</translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_mn.xtb b/ios/chrome/app/strings/resources/ios_strings_mn.xtb index 106fe2c..35abff29 100644 --- a/ios/chrome/app/strings/resources/ios_strings_mn.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_mn.xtb
@@ -613,6 +613,7 @@ <translation id="6524918542306337007">Нууцлалын горим боломжгүй байна</translation> <translation id="6537746030088321027">example.com</translation> <translation id="6561262006871132942">Томруулах</translation> +<translation id="6583087784430677195">Унтраахын тулд <ph name="BEGIN_LINK" />Тохиргоог<ph name="END_LINK" /> нээж, Нууц үгнүүдийг автоматаар бөглөх хэсэг рүү очно уу.</translation> <translation id="6585618849026997638">Та хавчуурга нэмснээр чухал хуудас руугаа буцан очих боломжтой</translation> <translation id="6603393121510733479">Танай байгууллага хувийн хөтчийг унтраасан. <ph name="BEGIN_LINK" />Нэмэлт мэдээлэл авах<ph name="END_LINK" /></translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_ne.xtb b/ios/chrome/app/strings/resources/ios_strings_ne.xtb index 8c82a3d6..65b0f767 100644 --- a/ios/chrome/app/strings/resources/ios_strings_ne.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_ne.xtb
@@ -614,6 +614,7 @@ <translation id="6524918542306337007">इन्कोग्निटो मोड उपलब्ध छैन</translation> <translation id="6537746030088321027">example.com</translation> <translation id="6561262006871132942">जुम बढाउनुहोस्</translation> +<translation id="6583087784430677195">तपाईं अटोफिल गर्ने सुविधा अफ गर्न चाहनुहुन्छ भने <ph name="BEGIN_LINK" />सेटिङ<ph name="END_LINK" /> खोल्नुहोस् अनि "पासवर्डहरू अटोफिल गरियोस्" मा जानुहोस्।</translation> <translation id="6585618849026997638">तपाईं आफ्ना लागि महत्त्वपूर्ण पृष्ठ बुकमार्क गरी सजिलैसँग उक्त पृष्ठमा फर्कन सक्नुहुन्छ</translation> <translation id="6603393121510733479">तपाईंको सङ्गठनले गोप्य रूपमा ब्राउज गर्ने सुविधा अफ गरेको छ। <ph name="BEGIN_LINK" />थप जान्नुहोस्<ph name="END_LINK" /></translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_uk.xtb b/ios/chrome/app/strings/resources/ios_strings_uk.xtb index cb46f682..29c25b5 100644 --- a/ios/chrome/app/strings/resources/ios_strings_uk.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_uk.xtb
@@ -94,6 +94,7 @@ <translation id="1690731385917361335">Нічого немає</translation> <translation id="1692118695553449118">Синхронізацію ввімкнено</translation> <translation id="1700629756560807968">Вибрано <ph name="NUMBER_OF_SELECTED_BOOKMARKS" /></translation> +<translation id="1726573592754903697">Менеджер паролів Google</translation> <translation id="1740468249224277719">Торкніться двічі, щоб установити.</translation> <translation id="1752547299766512813">Зберігати паролі</translation> <translation id="1753905327828125965">Часто відвідувані</translation> @@ -560,6 +561,7 @@ <translation id="6219688215832490856">Ніколи не перекладати</translation> <translation id="6223816392543092032">Отримайте доступ до своїх закладок, історії, паролів та інших налаштувань на всіх пристроях.</translation> <translation id="6232329973559504466">Пошук в анонімному режимі</translation> +<translation id="6232736989810857397">Ви зможете легко створювати події в календарі за допомогою Google Об’єктива.</translation> <translation id="6254066287920239840">Відкривайте посилання в додатку, а не у веб-переглядачі.</translation> <translation id="6255097610484507482">Редагувати дані кредитної картки</translation> <translation id="6284652193729350524">Пропонувати переклад для такої мови: <ph name="LANGUAGE" /></translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_uz.xtb b/ios/chrome/app/strings/resources/ios_strings_uz.xtb index fccb4fb..5943cec 100644 --- a/ios/chrome/app/strings/resources/ios_strings_uz.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_uz.xtb
@@ -60,6 +60,7 @@ <translation id="1407135791313364759">Barchasini ochish</translation> <translation id="1430915738399379752">Chop etish</translation> <translation id="1434356225517321998">Bu brauzer nazorat ostida. <ph name="BEGIN_LINK" />Batafsil<ph name="END_LINK" /></translation> +<translation id="1442838519825026149">Qurilmada shifrlash</translation> <translation id="1449835205994625556">Parolni berkitish</translation> <translation id="145015347812617860"><ph name="COUNT" /> ta xatcho‘p</translation> <translation id="149095475893949513">Bu sayt konfiguratsiya profilini yuklab olishga harakat qilmoqda.</translation> @@ -94,6 +95,7 @@ <translation id="1690731385917361335">Xatcho‘plar yo‘q</translation> <translation id="1692118695553449118">Sinxronlash yoniq</translation> <translation id="1700629756560807968"><ph name="NUMBER_OF_SELECTED_BOOKMARKS" /> ta xatcho‘p tanlandi</translation> +<translation id="1726573592754903697">Google Parollar menejeri</translation> <translation id="1740468249224277719">O‘rnatish uchun ikki marta bosing.</translation> <translation id="1752547299766512813">Parollarni saqlash</translation> <translation id="1753905327828125965">Eng ko‘p ochilganlar</translation> @@ -284,6 +286,7 @@ <translation id="3529024052484145543">Xavfsiz emas</translation> <translation id="3533202363250687977">Inkognito sahifalarni yopish</translation> <translation id="3533436815740441613">Yangi varaq</translation> +<translation id="3536487890564466894">Parollarni Google hisobingizga saqlashdan oldin shifrlang.</translation> <translation id="3551320343578183772">Ichki oynani yopish</translation> <translation id="3581564640715911333">Boshqa tildagi sahifalarni tarjima qilish taklif qilinsin</translation> <translation id="3588820906588687999">Tasvirni yangi tabda ochish</translation> @@ -501,6 +504,7 @@ <translation id="575902488528307720">Rasmni qidirish</translation> <translation id="5781453543752460388">Photos xizmatiga kiritish</translation> <translation id="5782227691023083829">Tarjima qilinmoqda...</translation> +<translation id="5802829331520313983">Sozlash</translation> <translation id="5803566855766646066">Bu yangi karta inkor etilsinmi?</translation> <translation id="5812974770859303494">Kiritish...</translation> <translation id="5816228676161003208">Ovoz orqali tezroq qidirish imkonini beradi.</translation> @@ -560,6 +564,7 @@ <translation id="6219688215832490856">Hech qachon tarjima qilinmasin</translation> <translation id="6223816392543092032">Chrome brauzeriga kirganingizdan so‘ng xatcho‘plar, tarix, parollar va boshqa sozlamalaringiz barcha qurilmalaringizda sinxronlanadi.</translation> <translation id="6232329973559504466">Inkognito qidiruv</translation> +<translation id="6232736989810857397">Bunda Google Lens yordamida taqvim tadbirlarini oson yaratish mumkin.</translation> <translation id="6254066287920239840">Havolalarni brauzerning o‘rniga boshqa ilovada oching.</translation> <translation id="6255097610484507482">Kartani tahrirlash</translation> <translation id="6284652193729350524">Bu tildagi sahifalar tarjimasi taklif qilinsin: <ph name="LANGUAGE" /></translation> @@ -609,6 +614,7 @@ <translation id="6524918542306337007">Inkognito rejimi ishlamayapti</translation> <translation id="6537746030088321027">example.com</translation> <translation id="6561262006871132942">Yaqinlashtirish</translation> +<translation id="6583087784430677195">Faolsizlantirish uchun avval <ph name="BEGIN_LINK" />Sozlamalar<ph name="END_LINK" />, keyin Parollarni avtomatik kiritish sahifasini oching.</translation> <translation id="6585618849026997638">Siz uchun muhim sahifalarga bukmark kiritish orqali qaytish mumkin</translation> <translation id="6603393121510733479">Inkognito rejimi tashkilotingiz tomonidan faolsizlantirildi. <ph name="BEGIN_LINK" />Batafsil<ph name="END_LINK" /></translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_vi.xtb b/ios/chrome/app/strings/resources/ios_strings_vi.xtb index 068cea2..896fbae 100644 --- a/ios/chrome/app/strings/resources/ios_strings_vi.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_vi.xtb
@@ -94,6 +94,7 @@ <translation id="1690731385917361335">Không có mục nào</translation> <translation id="1692118695553449118">Tính năng đồng bộ hóa đang bật</translation> <translation id="1700629756560807968">Đã chọn <ph name="NUMBER_OF_SELECTED_BOOKMARKS" /> dấu trang</translation> +<translation id="1726573592754903697">Trình quản lý mật khẩu của Google</translation> <translation id="1740468249224277719">Nhấn đúp để cài đặt.</translation> <translation id="1752547299766512813">Lưu mật khẩu</translation> <translation id="1753905327828125965">Truy cập nhiều nhất</translation> @@ -560,6 +561,7 @@ <translation id="6219688215832490856">Không bao giờ dịch</translation> <translation id="6223816392543092032">Sử dụng dấu trang, danh sách trang web đã truy cập, mật khẩu và các chế độ cài đặt khác trên mọi thiết bị của bạn.</translation> <translation id="6232329973559504466">Tìm kiếm ẩn danh</translation> +<translation id="6232736989810857397">Nhờ đó, bạn có thể dễ dàng tạo sự kiện trên lịch bằng cách sử dụng Google Ống kính.</translation> <translation id="6254066287920239840">Mở đường liên kết trong ứng dụng thay vì trình duyệt.</translation> <translation id="6255097610484507482">Chỉnh sửa thẻ tín dụng</translation> <translation id="6284652193729350524">Đề xuất dịch <ph name="LANGUAGE" /></translation>
diff --git a/ios/chrome/app/strings/resources/ios_strings_zh-HK.xtb b/ios/chrome/app/strings/resources/ios_strings_zh-HK.xtb index 4c5b8ca..5104e55f 100644 --- a/ios/chrome/app/strings/resources/ios_strings_zh-HK.xtb +++ b/ios/chrome/app/strings/resources/ios_strings_zh-HK.xtb
@@ -95,6 +95,7 @@ <translation id="1690731385917361335">沒有任何項目</translation> <translation id="1692118695553449118">同步處理已開啟</translation> <translation id="1700629756560807968">已選取 <ph name="NUMBER_OF_SELECTED_BOOKMARKS" /> 個項目</translation> +<translation id="1726573592754903697">Google 密碼管理工具</translation> <translation id="1740468249224277719">輕按兩下即可安裝。</translation> <translation id="1752547299766512813">儲存密碼</translation> <translation id="1753905327828125965">最常瀏覽</translation> @@ -563,6 +564,7 @@ <translation id="6219688215832490856">永不翻譯</translation> <translation id="6223816392543092032">您可從任何裝置取得自己的書籤、記錄、密碼和其他設定。</translation> <translation id="6232329973559504466">無痕搜尋</translation> +<translation id="6232736989810857397">此操作讓您可透過「Google 智能鏡頭」輕鬆建立日曆活動。</translation> <translation id="6254066287920239840">在應用程式 (而非瀏覽器) 中開啟連結。</translation> <translation id="6255097610484507482">編輯信用卡</translation> <translation id="6284652193729350524">為<ph name="LANGUAGE" />提供翻譯選項</translation>
diff --git a/ios/chrome/browser/browser_state/test_chrome_browser_state.mm b/ios/chrome/browser/browser_state/test_chrome_browser_state.mm index b7e0d2d..cacea5b 100644 --- a/ios/chrome/browser/browser_state/test_chrome_browser_state.mm +++ b/ios/chrome/browser/browser_state/test_chrome_browser_state.mm
@@ -4,11 +4,12 @@ #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" +#include <tuple> + #include "base/base_paths.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/files/file_util.h" -#include "base/ignore_result.h" #include "base/location.h" #include "base/logging.h" #include "base/memory/ptr_util.h" @@ -269,9 +270,9 @@ } void TestChromeBrowserState::CreateWebDataService() { - ignore_result( + std::ignore = ios::WebDataServiceFactory::GetInstance()->SetTestingFactoryAndUse( - this, base::BindRepeating(&BuildWebDataService))); + this, base::BindRepeating(&BuildWebDataService)); // Wait a bit after creating the WebDataService to allow the initialisation // to complete (otherwise the TestChromeBrowserState may be destroyed before @@ -285,9 +286,9 @@ base::DeleteFile(GetOriginalChromeBrowserState()->GetStatePath().Append( bookmarks::kBookmarksFileName)); } - ignore_result( + std::ignore = ios::BookmarkModelFactory::GetInstance()->SetTestingFactoryAndUse( - this, base::BindRepeating(&BuildBookmarkModel))); + this, base::BindRepeating(&BuildBookmarkModel)); } bool TestChromeBrowserState::CreateHistoryService() {
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm index ef326949..415846a 100644 --- a/ios/chrome/browser/flags/about_flags.mm +++ b/ios/chrome/browser/flags/about_flags.mm
@@ -788,6 +788,11 @@ {"use-new-popup-menu", flag_descriptions::kUseUIKitPopupMenuName, flag_descriptions::kUseUIKitPopupMenuDescription, flags_ui::kOsIos, FEATURE_VALUE_TYPE(kUseUIKitPopupMenu)}, + {"enable-unicorn-account-support", + flag_descriptions::kEnableUnicornAccountSupportName, + flag_descriptions::kEnableUnicornAccountSupportDescription, + flags_ui::kOsIos, + FEATURE_VALUE_TYPE(signin::kEnableUnicornAccountSupport)}, }; bool SkipConditionalFeatureEntry(const flags_ui::FeatureEntry& entry) {
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc index 1db93a27..427f3c7 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
@@ -218,6 +218,11 @@ "Enable optimization hints fetching for users who have enabled the 'Make " "Searches and Browsing Better' setting."; +const char kEnableUnicornAccountSupportName[] = + "Enable Unicorn account support"; +const char kEnableUnicornAccountSupportDescription[] = + "Allows users to sign-in with their Unicorn account."; + const char kEnableShortenedPasswordAutoFillInstructionName[] = "Enable shortened instructions to turn on Password AutoFill for Chrome"; const char kEnableShortenedPasswordAutoFillInstructionDescription[] =
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h index d68f107db..b8ea084 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
@@ -226,6 +226,10 @@ extern const char kForceStartupSigninPromoName[]; extern const char kForceStartupSigninPromoDescription[]; +// Title and description for the flag to enable sign-in with a Unicorn account. +extern const char kEnableUnicornAccountSupportName[]; +extern const char kEnableUnicornAccountSupportDescription[]; + // Title and description for the flag to set the major version the UA string to // 100. extern const char kForceMajorVersion100InUserAgentName[];
diff --git a/ios/chrome/browser/metrics/tab_usage_recorder_browser_agent_unittest.mm b/ios/chrome/browser/metrics/tab_usage_recorder_browser_agent_unittest.mm index 3e5b607..d6a3522 100644 --- a/ios/chrome/browser/metrics/tab_usage_recorder_browser_agent_unittest.mm +++ b/ios/chrome/browser/metrics/tab_usage_recorder_browser_agent_unittest.mm
@@ -7,8 +7,8 @@ #import <UIKit/UIKit.h> #include <memory> +#include <tuple> -#include "base/ignore_result.h" #include "base/metrics/histogram_samples.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/task_environment.h" @@ -336,7 +336,7 @@ // TabUsageRecorder count kAliveTabsCountAtRendererTermination tabs // as alive when mock_tab_a is evicted. for (int ii = 0; ii < kAliveTabsCountAtRendererTermination; ++ii) { - ignore_result(InsertFakeWebState(kURL, IN_MEMORY)); + std::ignore = InsertFakeWebState(kURL, IN_MEMORY); } base::TimeTicks now = base::TimeTicks::Now();
diff --git a/ios/chrome/browser/ssl/BUILD.gn b/ios/chrome/browser/ssl/BUILD.gn index 67f8c27a..9692f3d 100644 --- a/ios/chrome/browser/ssl/BUILD.gn +++ b/ios/chrome/browser/ssl/BUILD.gn
@@ -5,10 +5,10 @@ source_set("ssl") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ - "captive_portal_detector_tab_helper.h", - "captive_portal_detector_tab_helper.mm", - "captive_portal_detector_tab_helper_delegate.h", "captive_portal_metrics.h", + "captive_portal_tab_helper.h", + "captive_portal_tab_helper.mm", + "captive_portal_tab_helper_delegate.h", "ios_captive_portal_blocking_page.h", "ios_captive_portal_blocking_page.mm", "ios_ssl_blocking_page.h",
diff --git a/ios/chrome/browser/ssl/captive_portal_detector_tab_helper.h b/ios/chrome/browser/ssl/captive_portal_detector_tab_helper.h deleted file mode 100644 index 4f153fd..0000000 --- a/ios/chrome/browser/ssl/captive_portal_detector_tab_helper.h +++ /dev/null
@@ -1,67 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_DETECTOR_TAB_HELPER_H_ -#define IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_DETECTOR_TAB_HELPER_H_ - -#import "ios/web/public/web_state_user_data.h" - -@protocol CaptivePortalDetectorTabHelperDelegate; - -namespace captive_portal { -class CaptivePortalDetector; -} - -namespace network { -namespace mojom { -class URLLoaderFactory; -} -} // namespace network - -namespace web { -class WebState; -} - -// Associates a Tab to a CaptivePortalDetector and manages its lifetime. -class CaptivePortalDetectorTabHelper - : public web::WebStateUserData<CaptivePortalDetectorTabHelper> { - public: - CaptivePortalDetectorTabHelper(const CaptivePortalDetectorTabHelper&) = - delete; - CaptivePortalDetectorTabHelper& operator=( - const CaptivePortalDetectorTabHelper&) = delete; - - ~CaptivePortalDetectorTabHelper() override; - - // Creates a Tab Helper and attaches it to |web_state|. The |delegate| is not - // retained by the CaptivePortalDetectorTabHelper and must not be nil. - static void CreateForWebState( - web::WebState* web_state, - id<CaptivePortalDetectorTabHelperDelegate> delegate, - network::mojom::URLLoaderFactory* loader_factory_for_testing = nullptr); - - // Returns the associated captive portal detector. - captive_portal::CaptivePortalDetector* detector(); - - // Displays the Captive Portal Login page at |landing_url|. - void DisplayCaptivePortalLoginPage(GURL landing_url); - - private: - friend class web::WebStateUserData<CaptivePortalDetectorTabHelper>; - - CaptivePortalDetectorTabHelper( - web::WebState* web_state, - id<CaptivePortalDetectorTabHelperDelegate> delegate, - network::mojom::URLLoaderFactory* loader_factory_for_testing); - - // The delegate to notify when the user performs an action in response to the - // captive portal detector state. - __weak id<CaptivePortalDetectorTabHelperDelegate> delegate_; - // The underlying CaptivePortalDetector. - std::unique_ptr<captive_portal::CaptivePortalDetector> detector_; - - WEB_STATE_USER_DATA_KEY_DECL(); -}; - -#endif // IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_DETECTOR_TAB_HELPER_H_
diff --git a/ios/chrome/browser/ssl/captive_portal_detector_tab_helper.mm b/ios/chrome/browser/ssl/captive_portal_detector_tab_helper.mm deleted file mode 100644 index ac970f4..0000000 --- a/ios/chrome/browser/ssl/captive_portal_detector_tab_helper.mm +++ /dev/null
@@ -1,57 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/chrome/browser/ssl/captive_portal_detector_tab_helper.h" - -#include <memory> - -#include "base/memory/ptr_util.h" -#include "components/captive_portal/core/captive_portal_detector.h" -#import "ios/chrome/browser/ssl/captive_portal_detector_tab_helper_delegate.h" -#include "ios/web/public/browser_state.h" -#import "ios/web/public/web_state.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -// static -void CaptivePortalDetectorTabHelper::CreateForWebState( - web::WebState* web_state, - id<CaptivePortalDetectorTabHelperDelegate> delegate, - network::mojom::URLLoaderFactory* loader_factory_for_testing) { - DCHECK(web_state); - if (!FromWebState(web_state)) { - web_state->SetUserData( - UserDataKey(), base::WrapUnique(new CaptivePortalDetectorTabHelper( - web_state, delegate, loader_factory_for_testing))); - } -} - -CaptivePortalDetectorTabHelper::CaptivePortalDetectorTabHelper( - web::WebState* web_state, - id<CaptivePortalDetectorTabHelperDelegate> delegate, - network::mojom::URLLoaderFactory* loader_factory_for_testing) - : delegate_(delegate), - detector_(std::make_unique<captive_portal::CaptivePortalDetector>( - loader_factory_for_testing - ? loader_factory_for_testing - : web_state->GetBrowserState()->GetURLLoaderFactory())) { - DCHECK(delegate); -} - -captive_portal::CaptivePortalDetector* -CaptivePortalDetectorTabHelper::detector() { - return detector_.get(); -} - -void CaptivePortalDetectorTabHelper::DisplayCaptivePortalLoginPage( - GURL landing_url) { - [delegate_ captivePortalDetectorTabHelper:this - connectWithLandingURL:landing_url]; -} - -CaptivePortalDetectorTabHelper::~CaptivePortalDetectorTabHelper() = default; - -WEB_STATE_USER_DATA_KEY_IMPL(CaptivePortalDetectorTabHelper)
diff --git a/ios/chrome/browser/ssl/captive_portal_detector_tab_helper_delegate.h b/ios/chrome/browser/ssl/captive_portal_detector_tab_helper_delegate.h deleted file mode 100644 index 9d2c9e7..0000000 --- a/ios/chrome/browser/ssl/captive_portal_detector_tab_helper_delegate.h +++ /dev/null
@@ -1,25 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_DETECTOR_TAB_HELPER_DELEGATE_H_ -#define IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_DETECTOR_TAB_HELPER_DELEGATE_H_ - -#import <Foundation/Foundation.h> - -class CaptivePortalDetectorTabHelper; -class GURL; - -// Delegate for CaptivePortalDetectorTabHelper. -@protocol CaptivePortalDetectorTabHelperDelegate<NSObject> - -// Notifies the delegate the user selected the connect button on the captive -// portal blocking page and that the page with the specified |landingURL| should -// be displayed to the user. -- (void)captivePortalDetectorTabHelper: - (CaptivePortalDetectorTabHelper*)tabHelper - connectWithLandingURL:(const GURL&)landingURL; - -@end - -#endif // IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_DETECTOR_TAB_HELPER_DELEGATE_H_
diff --git a/ios/chrome/browser/ssl/captive_portal_tab_helper.h b/ios/chrome/browser/ssl/captive_portal_tab_helper.h new file mode 100644 index 0000000..22d6352 --- /dev/null +++ b/ios/chrome/browser/ssl/captive_portal_tab_helper.h
@@ -0,0 +1,45 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_TAB_HELPER_H_ +#define IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_TAB_HELPER_H_ + +#import "ios/web/public/web_state_user_data.h" + +@protocol CaptivePortalTabHelperDelegate; + +namespace web { +class WebState; +} + +// Associates a Tab to a CaptivePortalDetector and manages its lifetime. +class CaptivePortalTabHelper + : public web::WebStateUserData<CaptivePortalTabHelper> { + public: + CaptivePortalTabHelper(const CaptivePortalTabHelper&) = delete; + CaptivePortalTabHelper& operator=(const CaptivePortalTabHelper&) = delete; + + ~CaptivePortalTabHelper() override; + + // Creates a Tab Helper and attaches it to |web_state|. The |delegate| is not + // retained by the CaptivePortalTabHelper and must not be nil. + static void CreateForWebState(web::WebState* web_state, + id<CaptivePortalTabHelperDelegate> delegate); + + // Displays the Captive Portal Login page at |landing_url|. + void DisplayCaptivePortalLoginPage(GURL landing_url); + + private: + friend class web::WebStateUserData<CaptivePortalTabHelper>; + + CaptivePortalTabHelper(id<CaptivePortalTabHelperDelegate> delegate); + + // The delegate to notify when the user performs an action in response to the + // captive portal detector state. + __weak id<CaptivePortalTabHelperDelegate> delegate_; + + WEB_STATE_USER_DATA_KEY_DECL(); +}; + +#endif // IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_TAB_HELPER_H_
diff --git a/ios/chrome/browser/ssl/captive_portal_tab_helper.mm b/ios/chrome/browser/ssl/captive_portal_tab_helper.mm new file mode 100644 index 0000000..f588d49 --- /dev/null +++ b/ios/chrome/browser/ssl/captive_portal_tab_helper.mm
@@ -0,0 +1,41 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/ssl/captive_portal_tab_helper.h" + +#include <memory> + +#include "base/memory/ptr_util.h" +#import "ios/chrome/browser/ssl/captive_portal_tab_helper_delegate.h" +#include "ios/web/public/browser_state.h" +#import "ios/web/public/web_state.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +// static +void CaptivePortalTabHelper::CreateForWebState( + web::WebState* web_state, + id<CaptivePortalTabHelperDelegate> delegate) { + DCHECK(web_state); + if (!FromWebState(web_state)) { + web_state->SetUserData( + UserDataKey(), base::WrapUnique(new CaptivePortalTabHelper(delegate))); + } +} + +CaptivePortalTabHelper::CaptivePortalTabHelper( + id<CaptivePortalTabHelperDelegate> delegate) + : delegate_(delegate) { + DCHECK(delegate); +} + +void CaptivePortalTabHelper::DisplayCaptivePortalLoginPage(GURL landing_url) { + [delegate_ captivePortalTabHelper:this connectWithLandingURL:landing_url]; +} + +CaptivePortalTabHelper::~CaptivePortalTabHelper() = default; + +WEB_STATE_USER_DATA_KEY_IMPL(CaptivePortalTabHelper)
diff --git a/ios/chrome/browser/ssl/captive_portal_tab_helper_delegate.h b/ios/chrome/browser/ssl/captive_portal_tab_helper_delegate.h new file mode 100644 index 0000000..eb83f9a --- /dev/null +++ b/ios/chrome/browser/ssl/captive_portal_tab_helper_delegate.h
@@ -0,0 +1,24 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_TAB_HELPER_DELEGATE_H_ +#define IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_TAB_HELPER_DELEGATE_H_ + +#import <Foundation/Foundation.h> + +class CaptivePortalTabHelper; +class GURL; + +// Delegate for CaptivePortalTabHelper. +@protocol CaptivePortalTabHelperDelegate <NSObject> + +// Notifies the delegate the user selected the connect button on the captive +// portal blocking page and that the page with the specified |landingURL| should +// be displayed to the user. +- (void)captivePortalTabHelper:(CaptivePortalTabHelper*)tabHelper + connectWithLandingURL:(const GURL&)landingURL; + +@end + +#endif // IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_TAB_HELPER_DELEGATE_H_
diff --git a/ios/chrome/browser/ssl/ios_captive_portal_blocking_page.mm b/ios/chrome/browser/ssl/ios_captive_portal_blocking_page.mm index f6511ec..310ceab 100644 --- a/ios/chrome/browser/ssl/ios_captive_portal_blocking_page.mm +++ b/ios/chrome/browser/ssl/ios_captive_portal_blocking_page.mm
@@ -13,7 +13,7 @@ #include "components/security_interstitials/core/controller_client.h" #include "components/strings/grit/components_strings.h" #include "components/url_formatter/url_formatter.h" -#include "ios/chrome/browser/ssl/captive_portal_detector_tab_helper.h" +#include "ios/chrome/browser/ssl/captive_portal_tab_helper.h" #include "ui/base/l10n/l10n_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -96,7 +96,7 @@ captive_portal::CaptivePortalMetrics::LogCaptivePortalBlockingPageEvent( captive_portal::CaptivePortalMetrics::OPEN_LOGIN_PAGE); - CaptivePortalDetectorTabHelper::FromWebState(web_state()) + CaptivePortalTabHelper::FromWebState(web_state()) ->DisplayCaptivePortalLoginPage(landing_url_); } }
diff --git a/ios/chrome/browser/ssl/ios_ssl_error_handler.h b/ios/chrome/browser/ssl/ios_ssl_error_handler.h index f94941c..2da6ea61 100644 --- a/ios/chrome/browser/ssl/ios_ssl_error_handler.h +++ b/ios/chrome/browser/ssl/ios_ssl_error_handler.h
@@ -107,6 +107,9 @@ // A timer to display the SSL interstitial if the captive portal detection // takes too long. base::OneShotTimer timer_; + // The underlying CaptivePortalDetector. + std::unique_ptr<captive_portal::CaptivePortalDetector> + captive_portal_detector_; base::WeakPtrFactory<IOSSSLErrorHandler> weak_factory_;
diff --git a/ios/chrome/browser/ssl/ios_ssl_error_handler.mm b/ios/chrome/browser/ssl/ios_ssl_error_handler.mm index e9942c5..7104eeb3 100644 --- a/ios/chrome/browser/ssl/ios_ssl_error_handler.mm +++ b/ios/chrome/browser/ssl/ios_ssl_error_handler.mm
@@ -15,7 +15,6 @@ #include "components/security_interstitials/core/ssl_error_options_mask.h" #include "components/security_interstitials/core/ssl_error_ui.h" #include "ios/chrome/browser/application_context.h" -#include "ios/chrome/browser/ssl/captive_portal_detector_tab_helper.h" #include "ios/chrome/browser/ssl/captive_portal_metrics.h" #include "ios/chrome/browser/ssl/ios_captive_portal_blocking_page.h" #include "ios/chrome/browser/ssl/ios_ssl_blocking_page.h" @@ -36,6 +35,7 @@ const int64_t kSSLInterstitialDelayInSeconds = 3; using captive_portal::CaptivePortalDetector; +using security_interstitials::IOSBlockingPageTabHelper; namespace { std::unique_ptr<security_interstitials::IOSBlockingPageMetricsHelper> @@ -92,18 +92,27 @@ weak_factory_(this) {} void IOSSSLErrorHandler::StartHandlingError() { - CaptivePortalDetectorTabHelper* tab_helper = - CaptivePortalDetectorTabHelper::FromWebState(web_state_); // TODO(crbug.com/760873): replace test with DCHECK when this method is only // called on WebStates attached to tabs. - if (!tab_helper) { + IOSBlockingPageTabHelper* blocking_tab_helper = + IOSBlockingPageTabHelper::FromWebState(web_state_); + if (!blocking_tab_helper) { + std::move(blocking_page_callback_).Run(@""); return; } + if (captive_portal_detector_) { + timer_.Stop(); + captive_portal_detector_->Cancel(); + } + + captive_portal_detector_ = + std::make_unique<captive_portal::CaptivePortalDetector>( + web_state_->GetBrowserState()->GetURLLoaderFactory()); + base::WeakPtr<IOSSSLErrorHandler> weak_error_handler = weak_factory_.GetWeakPtr(); - - tab_helper->detector()->DetectCaptivePortal( + captive_portal_detector_->DetectCaptivePortal( GURL(CaptivePortalDetector::kDefaultURL), base::BindRepeating( &IOSSSLErrorHandler::HandleCaptivePortalDetectionResult, @@ -119,6 +128,7 @@ void IOSSSLErrorHandler::HandleCaptivePortalDetectionResult( const CaptivePortalDetector::Results& results) { timer_.Stop(); + captive_portal_detector_.reset(); IOSSSLErrorHandler::LogCaptivePortalResult(results.result); if (results.result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL) { @@ -133,9 +143,10 @@ // Cancel the captive portal detection if it is still ongoing. This will be // the case if |timer_| triggered the call of this method. - CaptivePortalDetectorTabHelper* tab_helper = - CaptivePortalDetectorTabHelper::FromWebState(web_state_); - tab_helper->detector()->Cancel(); + if (captive_portal_detector_) { + captive_portal_detector_->Cancel(); + captive_portal_detector_.reset(); + } int options_mask = overridable_ @@ -149,7 +160,7 @@ CreateMetricsHelper(web_state_, request_url_, overridable_), GetApplicationContext()->GetApplicationLocale())); std::string error_html = page->GetHtmlContents(); - security_interstitials::IOSBlockingPageTabHelper::FromWebState(web_state_) + IOSBlockingPageTabHelper::FromWebState(web_state_) ->AssociateBlockingPage(navigation_id_, std::move(page)); std::move(blocking_page_callback_).Run(base::SysUTF8ToNSString(error_html)); // Once an interstitial is displayed, no need to keep the handler around. @@ -166,7 +177,7 @@ CreateMetricsHelper(web_state_, request_url_, overridable_), GetApplicationContext()->GetApplicationLocale())); std::string error_html = page->GetHtmlContents(); - security_interstitials::IOSBlockingPageTabHelper::FromWebState(web_state_) + IOSBlockingPageTabHelper::FromWebState(web_state_) ->AssociateBlockingPage(navigation_id_, std::move(page)); std::move(blocking_page_callback_).Run(base::SysUTF8ToNSString(error_html)); // Once an interstitial is displayed, no need to keep the handler around.
diff --git a/ios/chrome/browser/ssl/ios_ssl_error_handler_unittest.mm b/ios/chrome/browser/ssl/ios_ssl_error_handler_unittest.mm index a7fbe9d..a7f0295 100644 --- a/ios/chrome/browser/ssl/ios_ssl_error_handler_unittest.mm +++ b/ios/chrome/browser/ssl/ios_ssl_error_handler_unittest.mm
@@ -8,15 +8,16 @@ #include "base/run_loop.h" #import "base/test/ios/wait_util.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" -#import "ios/chrome/browser/ssl/captive_portal_detector_tab_helper.h" -#import "ios/chrome/browser/ssl/captive_portal_detector_tab_helper_delegate.h" +#import "ios/chrome/browser/ssl/captive_portal_tab_helper.h" +#import "ios/chrome/browser/ssl/captive_portal_tab_helper_delegate.h" +#import "ios/chrome/browser/web/chrome_web_test.h" #import "ios/components/security_interstitials/ios_blocking_page_tab_helper.h" -#import "ios/web/public/test/web_test_with_web_state.h" #import "ios/web/public/web_state.h" #include "net/http/http_status_code.h" #include "net/ssl/ssl_info.h" #include "net/test/cert_test_util.h" #include "net/test/test_data_directory.h" +#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" #include "services/network/test/test_url_loader_factory.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -32,49 +33,79 @@ const char kTestHostName[] = "https://chromium.test/"; } // namespace -// Test fixture for IOSSSLErrorHandler class. -class IOSSSLErrorHandlerTest : public web::WebTestWithWebState { +// Test fixture for IOSSSLErrorHander when used with a WebState that hasn't +// been inserted into a WebStateList and hence doesn't have the usual set of +// tab helpers. +class IOSSSLErrorHandlerWithoutTabHelpersTest : public ChromeWebTest { protected: - IOSSSLErrorHandlerTest() - : cert_(net::ImportCertFromFile(net::GetTestCertsDirectory(), + IOSSSLErrorHandlerWithoutTabHelpersTest() + : ChromeWebTest(web::WebTaskEnvironment::Options::IO_MAINLOOP), + cert_(net::ImportCertFromFile(net::GetTestCertsDirectory(), kTestCertFileName)) {} + // Returns certificate. + scoped_refptr<net::X509Certificate> cert() { return cert_; } + // web::WebTestWithWebState overrides: void SetUp() override { - web::WebTestWithWebState::SetUp(); + ChromeWebTest::SetUp(); + chrome_browser_state_->SetSharedURLLoaderFactory( + base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>( + &test_loader_factory_)); test_loader_factory_.AddResponse("http://www.gstatic.com/generate_204", "", net::HTTP_NO_CONTENT); + } - id captive_portal_detector_tab_helper_delegate = [OCMockObject - mockForProtocol:@protocol(CaptivePortalDetectorTabHelperDelegate)]; + private: + network::TestURLLoaderFactory test_loader_factory_; + scoped_refptr<net::X509Certificate> cert_; +}; + +// Tests that error handling is short-circuited when the associated WebState +// isn't in a WebStateList. +TEST_F(IOSSSLErrorHandlerWithoutTabHelpersTest, HandleError) { + net::SSLInfo ssl_info; + ssl_info.cert = cert(); + GURL url(kTestHostName); + __block bool blocking_page_callback_called = false; + base::OnceCallback<void(NSString*)> blocking_page_callback = + base::BindOnce(^(NSString* blocking_page) { + blocking_page_callback_called = true; + }); + IOSSSLErrorHandler::HandleSSLError( + web_state(), net::ERR_CERT_AUTHORITY_INVALID, ssl_info, url, true, 0, + std::move(blocking_page_callback)); + EXPECT_TRUE(base::test::ios::WaitUntilConditionOrTimeout( + base::test::ios::kWaitForActionTimeout, ^bool() { + base::RunLoop().RunUntilIdle(); + return blocking_page_callback_called; + })); +} + +// Test fixture for IOSSSLErrorHandler class. +class IOSSSLErrorHandlerTest : public IOSSSLErrorHandlerWithoutTabHelpersTest { + protected: + IOSSSLErrorHandlerTest() {} + + // web::WebTestWithWebState overrides: + void SetUp() override { + IOSSSLErrorHandlerWithoutTabHelpersTest::SetUp(); + + id captive_portal_tab_helper_delegate = [OCMockObject + mockForProtocol:@protocol(CaptivePortalTabHelperDelegate)]; security_interstitials::IOSBlockingPageTabHelper::CreateForWebState( web_state()); - // Use a testing URLLoaderFactory so that these tests don't attempt to make - // network requests. - CaptivePortalDetectorTabHelper::CreateForWebState( - web_state(), captive_portal_detector_tab_helper_delegate, - &test_loader_factory_); - ASSERT_TRUE(cert_); + CaptivePortalTabHelper::CreateForWebState( + web_state(), captive_portal_tab_helper_delegate); + ASSERT_TRUE(cert()); // Transient item can only be added for pending non-app-specific loads. AddPendingItem(GURL(kTestHostName), ui::PageTransition::PAGE_TRANSITION_TYPED); } - - std::unique_ptr<web::BrowserState> CreateBrowserState() override { - TestChromeBrowserState::Builder builder; - return builder.Build(); - } - - // Returns certificate for testing. - scoped_refptr<net::X509Certificate> cert() { return cert_; } - - private: - network::TestURLLoaderFactory test_loader_factory_; - scoped_refptr<net::X509Certificate> cert_; }; // Tests that error HTML is returned instead of calling the usual show @@ -93,40 +124,10 @@ IOSSSLErrorHandler::HandleSSLError( web_state(), net::ERR_CERT_AUTHORITY_INVALID, ssl_info, url, true, 0, std::move(blocking_page_callback)); - base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(blocking_page_callback_called); -} -// Test fixture for IOSSSLErrorHander when used with a WebState that hasn't -// been inserted into a WebStateList and hence doesn't have the usual set of -// tab helpers. -class IOSSSLErrorHandlerWithoutTabHelpersTest - : public web::WebTestWithWebState { - protected: - IOSSSLErrorHandlerWithoutTabHelpersTest() - : cert_(net::ImportCertFromFile(net::GetTestCertsDirectory(), - kTestCertFileName)) {} - - // Returns certificate. - scoped_refptr<net::X509Certificate> cert() { return cert_; } - - private: - scoped_refptr<net::X509Certificate> cert_; -}; - -// Tests that error handling is short-circuited when the associated WebState -// isn't in a WebStateList. -TEST_F(IOSSSLErrorHandlerWithoutTabHelpersTest, HandleError) { - net::SSLInfo ssl_info; - ssl_info.cert = cert(); - GURL url(kTestHostName); - __block bool blocking_page_callback_called = false; - base::OnceCallback<void(NSString*)> blocking_page_callback = - base::BindOnce(^(NSString* blocking_page) { - blocking_page_callback_called = true; - }); - IOSSSLErrorHandler::HandleSSLError( - web_state(), net::ERR_CERT_AUTHORITY_INVALID, ssl_info, url, true, 0, - std::move(blocking_page_callback)); - EXPECT_FALSE(blocking_page_callback_called); + EXPECT_TRUE(base::test::ios::WaitUntilConditionOrTimeout( + base::test::ios::kWaitForActionTimeout, ^bool() { + base::RunLoop().RunUntilIdle(); + return blocking_page_callback_called; + })); }
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm index 3d2fe12..a25e1e9 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
@@ -56,8 +56,8 @@ #include "ios/chrome/browser/signin/authentication_service.h" #include "ios/chrome/browser/signin/authentication_service_factory.h" #import "ios/chrome/browser/snapshots/snapshot_tab_helper.h" -#import "ios/chrome/browser/ssl/captive_portal_detector_tab_helper.h" -#import "ios/chrome/browser/ssl/captive_portal_detector_tab_helper_delegate.h" +#import "ios/chrome/browser/ssl/captive_portal_tab_helper.h" +#import "ios/chrome/browser/ssl/captive_portal_tab_helper_delegate.h" #import "ios/chrome/browser/tabs/tab_title_util.h" #import "ios/chrome/browser/translate/chrome_ios_translate_client.h" #import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" @@ -274,7 +274,7 @@ #pragma mark - BVC @interface BrowserViewController () <BubblePresenterDelegate, - CaptivePortalDetectorTabHelperDelegate, + CaptivePortalTabHelperDelegate, ChromeLensControllerDelegate, CRWWebStateObserver, FindBarPresentationDelegate, @@ -2611,7 +2611,7 @@ self.sideSwipeController); SadTabTabHelper::FromWebState(webState)->SetDelegate(_sadTabCoordinator); NetExportTabHelper::CreateForWebState(webState, self); - CaptivePortalDetectorTabHelper::CreateForWebState(webState, self); + CaptivePortalTabHelper::CreateForWebState(webState, self); OfflinePageTabHelper::CreateForWebState( webState, ReadingListModelFactory::GetForBrowserState(self.browserState)); @@ -4550,11 +4550,10 @@ return nil; } -#pragma mark - CaptivePortalDetectorTabHelperDelegate +#pragma mark - CaptivePortalTabHelperDelegate -- (void)captivePortalDetectorTabHelper: - (CaptivePortalDetectorTabHelper*)tabHelper - connectWithLandingURL:(const GURL&)landingURL { +- (void)captivePortalTabHelper:(CaptivePortalTabHelper*)tabHelper + connectWithLandingURL:(const GURL&)landingURL { TabInsertionBrowserAgent* insertionAgent = TabInsertionBrowserAgent::FromBrowser(self.browser); insertionAgent->InsertWebState(
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller_egtest.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller_egtest.mm index 3efb599b..e0022a7 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller_egtest.mm +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller_egtest.mm
@@ -3,9 +3,9 @@ // found in the LICENSE file. #include <map> +#include <tuple> #include "base/feature_list.h" -#include "base/ignore_result.h" #import "base/ios/ios_util.h" #include "base/strings/sys_string_conversions.h" #include "components/strings/grit/components_strings.h" @@ -53,7 +53,7 @@ block:^BOOL { return NO; }]; - ignore_result([myCondition waitWithTimeout:0.05]); + std::ignore = [myCondition waitWithTimeout:0.05]; [ChromeEarlGrey openNewTab]; } // End of the sync disabler scope.
diff --git a/ios/chrome/browser/ui/settings/password/passwords_in_other_apps/BUILD.gn b/ios/chrome/browser/ui/settings/password/passwords_in_other_apps/BUILD.gn index c58e934..fd72414b 100644 --- a/ios/chrome/browser/ui/settings/password/passwords_in_other_apps/BUILD.gn +++ b/ios/chrome/browser/ui/settings/password/passwords_in_other_apps/BUILD.gn
@@ -43,6 +43,7 @@ "//ios/chrome/browser/ui/util", "//ios/chrome/common", "//ios/chrome/common/ui/colors", + "//ios/chrome/common/ui/elements", "//ios/chrome/common/ui/util", "//ios/chrome/common/ui/util:image_util", "//ios/public/provider/chrome/browser/password_auto_fill:password_auto_fill_api",
diff --git a/ios/chrome/browser/ui/settings/password/passwords_in_other_apps/passwords_in_other_apps_view_controller.mm b/ios/chrome/browser/ui/settings/password/passwords_in_other_apps/passwords_in_other_apps_view_controller.mm index 3599150f..2b82e5d 100644 --- a/ios/chrome/browser/ui/settings/password/passwords_in_other_apps/passwords_in_other_apps_view_controller.mm +++ b/ios/chrome/browser/ui/settings/password/passwords_in_other_apps/passwords_in_other_apps_view_controller.mm
@@ -15,6 +15,7 @@ #import "ios/chrome/browser/ui/util/uikit_ui_util.h" #include "ios/chrome/common/string_util.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h" +#import "ios/chrome/common/ui/elements/highlight_button.h" #import "ios/chrome/common/ui/util/button_util.h" #import "ios/chrome/common/ui/util/image_util.h" #import "ios/chrome/common/ui/util/pointer_interaction_util.h" @@ -35,7 +36,9 @@ CGFloat const kTitleHorizontalMargin = 18; CGFloat const kDefaultBannerMultiplier = 0.25; CGFloat const kContentWidthMultiplier = 0.65; +CGFloat const kBottomMargin = 10; CGFloat const kButtonHorizontalMargin = 4; +CGFloat const kContentOptimalWidth = 327; BOOL isPasswordManagerBrandingUpdateEnabled() { return base::FeatureList::IsEnabled( @@ -57,7 +60,7 @@ @property(nonatomic, strong) UILabel* subtitleLabel; @property(nonatomic, strong) UIView* turnOnInstructionView; @property(nonatomic, strong) UIView* turnOffInstructionView; -@property(nonatomic, strong) UIButton* actionButton; +@property(nonatomic, strong) HighlightButton* actionButton; @property(nonatomic, strong) UIActivityIndicatorView* spinner; // Views that are used to format the layout of visible UI components. @@ -236,6 +239,18 @@ constraintEqualToAnchor:self.scrollContentView.bottomAnchor], ]]; + // This constraint is added to enforce that the content width should be as + // close to the optimal width as possible, within the range already activated + // for "widthLayoutGuide.widthAnchor" previously, with a higher priority. + // In this case, the content width in iPad and iPhone landscape mode should be + // the safe layout width multiplied by kContentWidthMultiplier, while the + // content width for a iPhone portrait mode should be kContentOptimalWidth. + NSLayoutConstraint* contentLayoutGuideWidthConstraint = + [widthLayoutGuide.widthAnchor + constraintEqualToConstant:kContentOptimalWidth]; + contentLayoutGuideWidthConstraint.priority = UILayoutPriorityRequired - 1; + contentLayoutGuideWidthConstraint.active = YES; + // In iPhone landscape mode, the top image is removed. In that case, we should // make sure there is enough distance between the title label and the top edge // of the iPhone. @@ -411,7 +426,7 @@ - (UIButton*)actionButton { if (!_actionButton) { - _actionButton = [[UIButton alloc] initWithFrame:CGRectZero]; + _actionButton = [[HighlightButton alloc] initWithFrame:CGRectZero]; _actionButton.contentEdgeInsets = UIEdgeInsetsMake(kButtonVerticalInsets, 0, kButtonVerticalInsets, 0); [_actionButton @@ -492,7 +507,7 @@ constraintEqualToAnchor:self.specificContentView.topAnchor], [_turnOnInstructionView.bottomAnchor constraintEqualToAnchor:self.specificContentView.bottomAnchor - constant:-kDefaultMargin], + constant:-kBottomMargin], [_turnOnInstructionView.centerXAnchor constraintEqualToAnchor:self.specificContentView.centerXAnchor], [_turnOnInstructionView.widthAnchor @@ -511,7 +526,8 @@ [self.actionButton.centerXAnchor constraintEqualToAnchor:_turnOnInstructionView.centerXAnchor], [self.actionButton.bottomAnchor - constraintEqualToAnchor:_turnOnInstructionView.bottomAnchor], + constraintEqualToAnchor:_turnOnInstructionView.bottomAnchor + constant:-kBottomMargin], [instructionLayoutGuide.bottomAnchor constraintEqualToAnchor:self.actionButton.topAnchor constant:-kDefaultMargin],
diff --git a/ios/chrome/browser/ui/toolbar/BUILD.gn b/ios/chrome/browser/ui/toolbar/BUILD.gn index 12d7724..d81d37e 100644 --- a/ios/chrome/browser/ui/toolbar/BUILD.gn +++ b/ios/chrome/browser/ui/toolbar/BUILD.gn
@@ -146,7 +146,7 @@ "//ios/chrome/browser/web_state_list", "//ios/chrome/browser/web_state_list:test_support", "//ios/chrome/test:test_support", - "//ios/public/provider/chrome/browser/voice_search:test_voice_search", + "//ios/chrome/test/providers/voice_search", "//ios/public/provider/chrome/browser/voice_search:voice_search_api", "//ios/web", "//ios/web/public/test",
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_mediator_unittest.mm b/ios/chrome/browser/ui/toolbar/toolbar_mediator_unittest.mm index bb4cdcaa..bc65e21 100644 --- a/ios/chrome/browser/ui/toolbar/toolbar_mediator_unittest.mm +++ b/ios/chrome/browser/ui/toolbar/toolbar_mediator_unittest.mm
@@ -17,7 +17,7 @@ #include "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/chrome/browser/web_state_list/web_state_list_observer_bridge.h" #import "ios/chrome/browser/web_state_list/web_state_opener.h" -#import "ios/public/provider/chrome/browser/voice_search/test_voice_search.h" +#import "ios/chrome/test/providers/voice_search/test_voice_search.h" #import "ios/public/provider/chrome/browser/voice_search/voice_search_api.h" #import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
diff --git a/ios/chrome/browser/voice/BUILD.gn b/ios/chrome/browser/voice/BUILD.gn index 68b8734..b9edd4a 100644 --- a/ios/chrome/browser/voice/BUILD.gn +++ b/ios/chrome/browser/voice/BUILD.gn
@@ -89,7 +89,7 @@ deps = [ ":voice", "//base", - "//ios/public/provider/chrome/browser/voice_search:test_voice_search", + "//ios/chrome/test/providers/voice_search", "//testing/gtest", ] }
diff --git a/ios/chrome/browser/voice/fake_voice_search_availability.mm b/ios/chrome/browser/voice/fake_voice_search_availability.mm index f65f974..1027936 100644 --- a/ios/chrome/browser/voice/fake_voice_search_availability.mm +++ b/ios/chrome/browser/voice/fake_voice_search_availability.mm
@@ -5,7 +5,7 @@ #import "ios/chrome/browser/voice/fake_voice_search_availability.h" #include "base/memory/ptr_util.h" -#import "ios/public/provider/chrome/browser/voice_search/test_voice_search.h" +#import "ios/chrome/test/providers/voice_search/test_voice_search.h" #include "testing/gtest/include/gtest/gtest.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/chrome/browser/web/chrome_web_client_unittest.mm b/ios/chrome/browser/web/chrome_web_client_unittest.mm index 721312ce2..7842922 100644 --- a/ios/chrome/browser/web/chrome_web_client_unittest.mm +++ b/ios/chrome/browser/web/chrome_web_client_unittest.mm
@@ -14,7 +14,6 @@ #include "base/strings/sys_string_conversions.h" #import "base/test/ios/wait_util.h" #include "base/test/scoped_feature_list.h" -#include "base/test/task_environment.h" #include "base/version.h" #include "components/captive_portal/core/captive_portal_detector.h" #include "components/content_settings/core/browser/host_content_settings_map.h" @@ -29,8 +28,8 @@ #import "ios/chrome/browser/safe_browsing/safe_browsing_blocking_page.h" #import "ios/chrome/browser/safe_browsing/safe_browsing_error.h" #import "ios/chrome/browser/safe_browsing/safe_browsing_unsafe_resource_container.h" -#import "ios/chrome/browser/ssl/captive_portal_detector_tab_helper.h" -#import "ios/chrome/browser/ssl/captive_portal_detector_tab_helper_delegate.h" +#import "ios/chrome/browser/ssl/captive_portal_tab_helper.h" +#import "ios/chrome/browser/ssl/captive_portal_tab_helper_delegate.h" #include "ios/chrome/browser/web/error_page_controller_bridge.h" #import "ios/chrome/browser/web/error_page_util.h" #include "ios/chrome/browser/web/features.h" @@ -45,11 +44,13 @@ #import "ios/web/public/test/fakes/fake_web_state.h" #import "ios/web/public/test/js_test_util.h" #include "ios/web/public/test/scoped_testing_web_client.h" +#include "ios/web/public/test/web_task_environment.h" #include "net/base/net_errors.h" #include "net/http/http_status_code.h" #include "net/ssl/ssl_info.h" #include "net/test/cert_test_util.h" #include "net/test/test_data_directory.h" +#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" #include "services/network/public/mojom/fetch_api.mojom.h" #include "services/network/test/test_url_loader_factory.h" #include "testing/gtest/include/gtest/gtest.h" @@ -82,7 +83,8 @@ class ChromeWebClientTest : public PlatformTest { public: - ChromeWebClientTest() { + ChromeWebClientTest() + : environment_(web::WebTaskEnvironment::Options::IO_MAINLOOP) { browser_state_ = TestChromeBrowserState::Builder().Build(); } @@ -93,9 +95,9 @@ ChromeBrowserState* browser_state() { return browser_state_.get(); } - private: - base::test::TaskEnvironment environment_; - std::unique_ptr<ChromeBrowserState> browser_state_; + protected: + web::WebTaskEnvironment environment_; + std::unique_ptr<TestChromeBrowserState> browser_state_; }; TEST_F(ChromeWebClientTest, UserAgent) { @@ -336,11 +338,14 @@ test_loader_factory.AddResponse( captive_portal::CaptivePortalDetector::kDefaultURL, "", net::HTTP_NO_CONTENT); - id captive_portal_detector_tab_helper_delegate = [OCMockObject - mockForProtocol:@protocol(CaptivePortalDetectorTabHelperDelegate)]; - CaptivePortalDetectorTabHelper::CreateForWebState( - &web_state, captive_portal_detector_tab_helper_delegate, - &test_loader_factory); + browser_state_->SetSharedURLLoaderFactory( + base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>( + &test_loader_factory)); + + id captive_portal_tab_helper_delegate = + [OCMockObject mockForProtocol:@protocol(CaptivePortalTabHelperDelegate)]; + CaptivePortalTabHelper::CreateForWebState(&web_state, + captive_portal_tab_helper_delegate); web_state.SetBrowserState(browser_state()); web_client.PrepareErrorPage(&web_state, GURL(kTestUrl), error,
diff --git a/ios/chrome/common/ui/promo_style/promo_style_view_controller.mm b/ios/chrome/common/ui/promo_style/promo_style_view_controller.mm index f3bf5d3..8f9e3b2 100644 --- a/ios/chrome/common/ui/promo_style/promo_style_view_controller.mm +++ b/ios/chrome/common/ui/promo_style/promo_style_view_controller.mm
@@ -28,7 +28,7 @@ constexpr CGFloat kTallBannerMultiplier = 0.35; constexpr CGFloat kDefaultBannerMultiplier = 0.25; constexpr CGFloat kContentWidthMultiplier = 0.65; -constexpr CGFloat kContentMaxWidth = 327; +constexpr CGFloat kContentOptimalWidth = 327; constexpr CGFloat kMoreArrowMargin = 4; constexpr CGFloat kPreviousContentVisibleOnScroll = 0.15; constexpr CGFloat kSeparatorHeight = 1; @@ -259,10 +259,15 @@ constant:-extraBottomMargin], ]]; - // Also constrain the width layout guide to a maximum constant, but at a lower - // priority so that it only applies in compact screens. + // This constraint is added to enforce that the content width should be as + // close to the optimal width as possible, within the range already activated + // for "widthLayoutGuide.widthAnchor" previously, with a higher priority. + // In this case, the content width in iPad and iPhone landscape mode should be + // the safe layout width multiplied by kContentWidthMultiplier, while the + // content width for a iPhone portrait mode should be kContentOptimalWidth. NSLayoutConstraint* contentLayoutGuideWidthConstraint = - [widthLayoutGuide.widthAnchor constraintEqualToConstant:kContentMaxWidth]; + [widthLayoutGuide.widthAnchor + constraintEqualToConstant:kContentOptimalWidth]; contentLayoutGuideWidthConstraint.priority = UILayoutPriorityRequired - 1; contentLayoutGuideWidthConstraint.active = YES;
diff --git a/ios/chrome/test/BUILD.gn b/ios/chrome/test/BUILD.gn index 3c5523a..a1d1bc27 100644 --- a/ios/chrome/test/BUILD.gn +++ b/ios/chrome/test/BUILD.gn
@@ -172,7 +172,7 @@ "//ios/chrome/app/resources:packed_resources", # Use the test implementation of the provider API. - "//ios/public/provider/chrome/browser:test_providers", + "//ios/chrome/test/providers", # Add unit_tests target here. "//ios/chrome/app:unit_tests",
diff --git a/ios/chrome/test/providers/BUILD.gn b/ios/chrome/test/providers/BUILD.gn new file mode 100644 index 0000000..e886417 --- /dev/null +++ b/ios/chrome/test/providers/BUILD.gn
@@ -0,0 +1,31 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +group("providers") { + testonly = true + deps = [ + # The target providing the ChromeBrowserProvider factory. + "//ios/public/provider/chrome/browser:test_provider_factory", + + # The individual API implementations. + "//ios/chrome/test/providers/app_distribution", + "//ios/chrome/test/providers/branded_images", + "//ios/chrome/test/providers/lens", + "//ios/chrome/test/providers/modals", + "//ios/chrome/test/providers/omaha", + "//ios/chrome/test/providers/overrides", + "//ios/chrome/test/providers/password_auto_fill", + "//ios/chrome/test/providers/risk_data", + "//ios/chrome/test/providers/signin", + "//ios/chrome/test/providers/signin", + "//ios/chrome/test/providers/text_zoom", + "//ios/chrome/test/providers/url_rewriters", + "//ios/chrome/test/providers/voice_search", + + # The provider API needs to provide MaterialDesignComponent API (as the + # internal provider provides an alternate implementation). + "//ios/third_party/material_components_ios:material_components_ios+bundle", + "//ios/third_party/material_components_ios:material_components_ios+link", + ] +}
diff --git a/ios/chrome/test/providers/app_distribution/BUILD.gn b/ios/chrome/test/providers/app_distribution/BUILD.gn new file mode 100644 index 0000000..866130c --- /dev/null +++ b/ios/chrome/test/providers/app_distribution/BUILD.gn
@@ -0,0 +1,12 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("app_distribution") { + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ + "test_app_distribution.cc", + "test_app_distribution.h", + ] + deps = [ "//ios/public/provider/chrome/browser/app_distribution:app_distribution_api" ] +}
diff --git a/ios/public/provider/chrome/browser/app_distribution/test_app_distribution.cc b/ios/chrome/test/providers/app_distribution/test_app_distribution.cc similarity index 94% rename from ios/public/provider/chrome/browser/app_distribution/test_app_distribution.cc rename to ios/chrome/test/providers/app_distribution/test_app_distribution.cc index db0b0c9..2e199b3 100644 --- a/ios/public/provider/chrome/browser/app_distribution/test_app_distribution.cc +++ b/ios/chrome/test/providers/app_distribution/test_app_distribution.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/public/provider/chrome/browser/app_distribution/test_app_distribution.h" +#include "ios/chrome/test/providers/app_distribution/test_app_distribution.h" #include "ios/public/provider/chrome/browser/app_distribution/app_distribution_api.h"
diff --git a/ios/public/provider/chrome/browser/app_distribution/test_app_distribution.h b/ios/chrome/test/providers/app_distribution/test_app_distribution.h similarity index 73% rename from ios/public/provider/chrome/browser/app_distribution/test_app_distribution.h rename to ios/chrome/test/providers/app_distribution/test_app_distribution.h index 23ebc24..27619082 100644 --- a/ios/public/provider/chrome/browser/app_distribution/test_app_distribution.h +++ b/ios/chrome/test/providers/app_distribution/test_app_distribution.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_APP_DISTRIBUTION_TEST_APP_DISTRIBUTION_H_ -#define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_APP_DISTRIBUTION_TEST_APP_DISTRIBUTION_H_ +#ifndef IOS_CHROME_TEST_PROVIDERS_APP_DISTRIBUTION_TEST_APP_DISTRIBUTION_H_ +#define IOS_CHROME_TEST_PROVIDERS_APP_DISTRIBUTION_TEST_APP_DISTRIBUTION_H_ namespace ios { namespace provider { @@ -23,4 +23,4 @@ } // namespace provider } // namespace ios -#endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_APP_DISTRIBUTION_TEST_APP_DISTRIBUTION_H_ +#endif // IOS_CHROME_TEST_PROVIDERS_APP_DISTRIBUTION_TEST_APP_DISTRIBUTION_H_
diff --git a/ios/chrome/test/providers/branded_images/BUILD.gn b/ios/chrome/test/providers/branded_images/BUILD.gn new file mode 100644 index 0000000..27b8dec6 --- /dev/null +++ b/ios/chrome/test/providers/branded_images/BUILD.gn
@@ -0,0 +1,11 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("branded_images") { + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ "test_branded_images.mm" ] + deps = [ + "//ios/public/provider/chrome/browser/branded_images:branded_images_api", + ] +}
diff --git a/ios/public/provider/chrome/browser/branded_images/test_branded_images.mm b/ios/chrome/test/providers/branded_images/test_branded_images.mm similarity index 100% rename from ios/public/provider/chrome/browser/branded_images/test_branded_images.mm rename to ios/chrome/test/providers/branded_images/test_branded_images.mm
diff --git a/ios/chrome/test/providers/lens/BUILD.gn b/ios/chrome/test/providers/lens/BUILD.gn new file mode 100644 index 0000000..918d99d --- /dev/null +++ b/ios/chrome/test/providers/lens/BUILD.gn
@@ -0,0 +1,13 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("lens") { + testonly = true + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ "test_lens.mm" ] + deps = [ + "//base", + "//ios/public/provider/chrome/browser/lens:lens_api", + ] +}
diff --git a/ios/public/provider/chrome/browser/lens/test_lens.mm b/ios/chrome/test/providers/lens/test_lens.mm similarity index 100% rename from ios/public/provider/chrome/browser/lens/test_lens.mm rename to ios/chrome/test/providers/lens/test_lens.mm
diff --git a/ios/chrome/test/providers/modals/BUILD.gn b/ios/chrome/test/providers/modals/BUILD.gn new file mode 100644 index 0000000..1b9d8574 --- /dev/null +++ b/ios/chrome/test/providers/modals/BUILD.gn
@@ -0,0 +1,10 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("modals") { + testonly = true + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ "test_modals.mm" ] + deps = [ "//ios/public/provider/chrome/browser/modals:modals_api" ] +}
diff --git a/ios/public/provider/chrome/browser/modals/test_modals.mm b/ios/chrome/test/providers/modals/test_modals.mm similarity index 100% rename from ios/public/provider/chrome/browser/modals/test_modals.mm rename to ios/chrome/test/providers/modals/test_modals.mm
diff --git a/ios/chrome/test/providers/omaha/BUILD.gn b/ios/chrome/test/providers/omaha/BUILD.gn new file mode 100644 index 0000000..1ed3251 --- /dev/null +++ b/ios/chrome/test/providers/omaha/BUILD.gn
@@ -0,0 +1,10 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("omaha") { + testonly = true + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ "test_omaha.cc" ] + deps = [ "//ios/public/provider/chrome/browser/omaha:omaha_api" ] +}
diff --git a/ios/public/provider/chrome/browser/omaha/test_omaha.cc b/ios/chrome/test/providers/omaha/test_omaha.cc similarity index 100% rename from ios/public/provider/chrome/browser/omaha/test_omaha.cc rename to ios/chrome/test/providers/omaha/test_omaha.cc
diff --git a/ios/chrome/test/providers/overrides/BUILD.gn b/ios/chrome/test/providers/overrides/BUILD.gn new file mode 100644 index 0000000..52b14c5f --- /dev/null +++ b/ios/chrome/test/providers/overrides/BUILD.gn
@@ -0,0 +1,10 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("overrides") { + testonly = true + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ "test_overrides.cc" ] + deps = [ "//ios/public/provider/chrome/browser/overrides:overrides_api" ] +}
diff --git a/ios/public/provider/chrome/browser/overrides/test_overrides.cc b/ios/chrome/test/providers/overrides/test_overrides.cc similarity index 100% rename from ios/public/provider/chrome/browser/overrides/test_overrides.cc rename to ios/chrome/test/providers/overrides/test_overrides.cc
diff --git a/ios/chrome/test/providers/password_auto_fill/BUILD.gn b/ios/chrome/test/providers/password_auto_fill/BUILD.gn new file mode 100644 index 0000000..6c3f899 --- /dev/null +++ b/ios/chrome/test/providers/password_auto_fill/BUILD.gn
@@ -0,0 +1,9 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("password_auto_fill") { + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ "test_password_auto_fill.mm" ] + deps = [ "//ios/public/provider/chrome/browser/password_auto_fill:password_auto_fill_api" ] +}
diff --git a/ios/public/provider/chrome/browser/password_auto_fill/test_password_auto_fill.mm b/ios/chrome/test/providers/password_auto_fill/test_password_auto_fill.mm similarity index 100% rename from ios/public/provider/chrome/browser/password_auto_fill/test_password_auto_fill.mm rename to ios/chrome/test/providers/password_auto_fill/test_password_auto_fill.mm
diff --git a/ios/chrome/test/providers/risk_data/BUILD.gn b/ios/chrome/test/providers/risk_data/BUILD.gn new file mode 100644 index 0000000..ce2a422 --- /dev/null +++ b/ios/chrome/test/providers/risk_data/BUILD.gn
@@ -0,0 +1,10 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("risk_data") { + testonly = true + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ "test_risk_data.mm" ] + deps = [ "//ios/public/provider/chrome/browser/risk_data:risk_data_api" ] +}
diff --git a/ios/public/provider/chrome/browser/risk_data/test_risk_data.mm b/ios/chrome/test/providers/risk_data/test_risk_data.mm similarity index 100% rename from ios/public/provider/chrome/browser/risk_data/test_risk_data.mm rename to ios/chrome/test/providers/risk_data/test_risk_data.mm
diff --git a/ios/chrome/test/providers/signin/BUILD.gn b/ios/chrome/test/providers/signin/BUILD.gn new file mode 100644 index 0000000..0b64829f --- /dev/null +++ b/ios/chrome/test/providers/signin/BUILD.gn
@@ -0,0 +1,33 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +group("signin") { + testonly = true + deps = [ + ":signin_error", + ":signin_resources", + ] +} + +source_set("signin_error") { + testonly = true + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ "test_signin_error.mm" ] + deps = [ + "//base", + "//ios/public/provider/chrome/browser/signin:signin_error_api", + ] + frameworks = [ "Foundation.framework" ] +} + +source_set("signin_resources") { + testonly = true + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ "test_signin_resources.mm" ] + deps = [ + "//ios/public/provider/chrome/browser/signin:signin_resources_api", + "//ui/base:test_support", + ] + frameworks = [ "UIKit.framework" ] +}
diff --git a/ios/public/provider/chrome/browser/signin/test_signin_error.mm b/ios/chrome/test/providers/signin/test_signin_error.mm similarity index 100% rename from ios/public/provider/chrome/browser/signin/test_signin_error.mm rename to ios/chrome/test/providers/signin/test_signin_error.mm
diff --git a/ios/public/provider/chrome/browser/signin/test_signin_resources.mm b/ios/chrome/test/providers/signin/test_signin_resources.mm similarity index 100% rename from ios/public/provider/chrome/browser/signin/test_signin_resources.mm rename to ios/chrome/test/providers/signin/test_signin_resources.mm
diff --git a/ios/chrome/test/providers/text_zoom/BUILD.gn b/ios/chrome/test/providers/text_zoom/BUILD.gn new file mode 100644 index 0000000..fcfc7a8 --- /dev/null +++ b/ios/chrome/test/providers/text_zoom/BUILD.gn
@@ -0,0 +1,13 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("text_zoom") { + testonly = true + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ "test_text_zoom.mm" ] + deps = [ + "//ios/chrome/browser/web/font_size", + "//ios/public/provider/chrome/browser/text_zoom:text_zoom_api", + ] +}
diff --git a/ios/public/provider/chrome/browser/text_zoom/test_text_zoom.mm b/ios/chrome/test/providers/text_zoom/test_text_zoom.mm similarity index 100% rename from ios/public/provider/chrome/browser/text_zoom/test_text_zoom.mm rename to ios/chrome/test/providers/text_zoom/test_text_zoom.mm
diff --git a/ios/chrome/test/providers/url_rewriters/BUILD.gn b/ios/chrome/test/providers/url_rewriters/BUILD.gn new file mode 100644 index 0000000..39603f3 --- /dev/null +++ b/ios/chrome/test/providers/url_rewriters/BUILD.gn
@@ -0,0 +1,11 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("url_rewriters") { + testonly = true + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ "test_url_rewriters.cc" ] + deps = + [ "//ios/public/provider/chrome/browser/url_rewriters:url_rewriters_api" ] +}
diff --git a/ios/public/provider/chrome/browser/url_rewriters/test_url_rewriters.cc b/ios/chrome/test/providers/url_rewriters/test_url_rewriters.cc similarity index 100% rename from ios/public/provider/chrome/browser/url_rewriters/test_url_rewriters.cc rename to ios/chrome/test/providers/url_rewriters/test_url_rewriters.cc
diff --git a/ios/chrome/test/providers/voice_search/BUILD.gn b/ios/chrome/test/providers/voice_search/BUILD.gn new file mode 100644 index 0000000..97af2bb --- /dev/null +++ b/ios/chrome/test/providers/voice_search/BUILD.gn
@@ -0,0 +1,16 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("voice_search") { + testonly = true + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ + "test_voice_search.h", + "test_voice_search.mm", + ] + deps = [ + "//ios/chrome/browser/voice:voice_search_language", + "//ios/public/provider/chrome/browser/voice_search:voice_search_api", + ] +}
diff --git a/ios/public/provider/chrome/browser/voice_search/test_voice_search.h b/ios/chrome/test/providers/voice_search/test_voice_search.h similarity index 66% rename from ios/public/provider/chrome/browser/voice_search/test_voice_search.h rename to ios/chrome/test/providers/voice_search/test_voice_search.h index 4fab71d..aded202 100644 --- a/ios/public/provider/chrome/browser/voice_search/test_voice_search.h +++ b/ios/chrome/test/providers/voice_search/test_voice_search.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_VOICE_SEARCH_TEST_VOICE_SEARCH_H_ -#define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_VOICE_SEARCH_TEST_VOICE_SEARCH_H_ +#ifndef IOS_CHROME_TEST_PROVIDERS_VOICE_SEARCH_TEST_VOICE_SEARCH_H_ +#define IOS_CHROME_TEST_PROVIDERS_VOICE_SEARCH_TEST_VOICE_SEARCH_H_ #import "ios/public/provider/chrome/browser/voice_search/voice_search_api.h" @@ -18,4 +18,4 @@ } // namespace provider } // namespace ios -#endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_VOICE_SEARCH_TEST_VOICE_SEARCH_H_ +#endif // IOS_CHROME_TEST_PROVIDERS_VOICE_SEARCH_TEST_VOICE_SEARCH_H_
diff --git a/ios/public/provider/chrome/browser/voice_search/test_voice_search.mm b/ios/chrome/test/providers/voice_search/test_voice_search.mm similarity index 93% rename from ios/public/provider/chrome/browser/voice_search/test_voice_search.mm rename to ios/chrome/test/providers/voice_search/test_voice_search.mm index 72aa26b..36a0d112 100644 --- a/ios/public/provider/chrome/browser/voice_search/test_voice_search.mm +++ b/ios/chrome/test/providers/voice_search/test_voice_search.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "ios/public/provider/chrome/browser/voice_search/test_voice_search.h" +#import "ios/chrome/test/providers/voice_search/test_voice_search.h" #import "ios/chrome/browser/voice/voice_search_language.h" #import "ios/public/provider/chrome/browser/voice_search/voice_search_api.h"
diff --git a/ios/public/provider/chrome/browser/BUILD.gn b/ios/public/provider/chrome/browser/BUILD.gn index e7c72802..9c6deab2 100644 --- a/ios/public/provider/chrome/browser/BUILD.gn +++ b/ios/public/provider/chrome/browser/BUILD.gn
@@ -77,31 +77,3 @@ ":test_support", ] } - -group("test_providers") { - testonly = true - deps = [ - # The target providing the ChromeBrowserProvider factory. - ":test_provider_factory", - - # The individual API implementations. - "//ios/public/provider/chrome/browser/app_distribution:test_app_distribution", - "//ios/public/provider/chrome/browser/branded_images:test_branded_images", - "//ios/public/provider/chrome/browser/lens:test_lens", - "//ios/public/provider/chrome/browser/modals:test_modals", - "//ios/public/provider/chrome/browser/omaha:test_omaha", - "//ios/public/provider/chrome/browser/overrides:test_overrides", - "//ios/public/provider/chrome/browser/password_auto_fill:test_password_auto_fill", - "//ios/public/provider/chrome/browser/risk_data:test_risk_data", - "//ios/public/provider/chrome/browser/signin:test_signin_error", - "//ios/public/provider/chrome/browser/signin:test_signin_resources", - "//ios/public/provider/chrome/browser/text_zoom:test_text_zoom", - "//ios/public/provider/chrome/browser/url_rewriters:test_url_rewriters", - "//ios/public/provider/chrome/browser/voice_search:test_voice_search", - - # The provider API needs to provide MaterialDesignComponent API (as the - # internal provider provides an alternate implementation). - "//ios/third_party/material_components_ios:material_components_ios+bundle", - "//ios/third_party/material_components_ios:material_components_ios+link", - ] -}
diff --git a/ios/public/provider/chrome/browser/app_distribution/BUILD.gn b/ios/public/provider/chrome/browser/app_distribution/BUILD.gn index cbabc447..8c0520b 100644 --- a/ios/public/provider/chrome/browser/app_distribution/BUILD.gn +++ b/ios/public/provider/chrome/browser/app_distribution/BUILD.gn
@@ -7,12 +7,3 @@ sources = [ "app_distribution_api.h" ] deps = [ "//base" ] } - -source_set("test_app_distribution") { - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ - "test_app_distribution.cc", - "test_app_distribution.h", - ] - deps = [ ":app_distribution_api" ] -}
diff --git a/ios/public/provider/chrome/browser/branded_images/BUILD.gn b/ios/public/provider/chrome/browser/branded_images/BUILD.gn index 2340823..8d9a4d9e 100644 --- a/ios/public/provider/chrome/browser/branded_images/BUILD.gn +++ b/ios/public/provider/chrome/browser/branded_images/BUILD.gn
@@ -7,9 +7,3 @@ sources = [ "branded_images_api.h" ] frameworks = [ "UIKit.framework" ] } - -source_set("test_branded_images") { - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ "test_branded_images.mm" ] - deps = [ ":branded_images_api" ] -}
diff --git a/ios/public/provider/chrome/browser/lens/BUILD.gn b/ios/public/provider/chrome/browser/lens/BUILD.gn index e2a00b5..7cd9971 100644 --- a/ios/public/provider/chrome/browser/lens/BUILD.gn +++ b/ios/public/provider/chrome/browser/lens/BUILD.gn
@@ -11,13 +11,3 @@ ] deps = [ "//base" ] } - -source_set("test_lens") { - testonly = true - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ "test_lens.mm" ] - deps = [ - ":lens_api", - "//base", - ] -}
diff --git a/ios/public/provider/chrome/browser/modals/BUILD.gn b/ios/public/provider/chrome/browser/modals/BUILD.gn index aa61b58..80f7084 100644 --- a/ios/public/provider/chrome/browser/modals/BUILD.gn +++ b/ios/public/provider/chrome/browser/modals/BUILD.gn
@@ -6,10 +6,3 @@ configs += [ "//build/config/compiler:enable_arc" ] sources = [ "modals_api.h" ] } - -source_set("test_modals") { - testonly = true - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ "test_modals.mm" ] - deps = [ ":modals_api" ] -}
diff --git a/ios/public/provider/chrome/browser/omaha/BUILD.gn b/ios/public/provider/chrome/browser/omaha/BUILD.gn index 14df2d06..070a4e8 100644 --- a/ios/public/provider/chrome/browser/omaha/BUILD.gn +++ b/ios/public/provider/chrome/browser/omaha/BUILD.gn
@@ -10,10 +10,3 @@ "//url", ] } - -source_set("test_omaha") { - testonly = true - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ "test_omaha.cc" ] - deps = [ ":omaha_api" ] -}
diff --git a/ios/public/provider/chrome/browser/overrides/BUILD.gn b/ios/public/provider/chrome/browser/overrides/BUILD.gn index d0149cc..53d7c5df 100644 --- a/ios/public/provider/chrome/browser/overrides/BUILD.gn +++ b/ios/public/provider/chrome/browser/overrides/BUILD.gn
@@ -6,10 +6,3 @@ configs += [ "//build/config/compiler:enable_arc" ] sources = [ "overrides_api.h" ] } - -source_set("test_overrides") { - testonly = true - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ "test_overrides.cc" ] - deps = [ ":overrides_api" ] -}
diff --git a/ios/public/provider/chrome/browser/password_auto_fill/BUILD.gn b/ios/public/provider/chrome/browser/password_auto_fill/BUILD.gn index 1755e23..c1fa0078 100644 --- a/ios/public/provider/chrome/browser/password_auto_fill/BUILD.gn +++ b/ios/public/provider/chrome/browser/password_auto_fill/BUILD.gn
@@ -7,9 +7,3 @@ sources = [ "password_auto_fill_api.h" ] frameworks = [ "Foundation.framework" ] } - -source_set("test_password_auto_fill") { - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ "test_password_auto_fill.mm" ] - deps = [ ":password_auto_fill_api" ] -}
diff --git a/ios/public/provider/chrome/browser/risk_data/BUILD.gn b/ios/public/provider/chrome/browser/risk_data/BUILD.gn index 2150e3b..cc4eb6f 100644 --- a/ios/public/provider/chrome/browser/risk_data/BUILD.gn +++ b/ios/public/provider/chrome/browser/risk_data/BUILD.gn
@@ -7,10 +7,3 @@ sources = [ "risk_data_api.h" ] frameworks = [ "Foundation.framework" ] } - -source_set("test_risk_data") { - testonly = true - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ "test_risk_data.mm" ] - deps = [ ":risk_data_api" ] -}
diff --git a/ios/public/provider/chrome/browser/signin/BUILD.gn b/ios/public/provider/chrome/browser/signin/BUILD.gn index 43df01c1..55d1da92 100644 --- a/ios/public/provider/chrome/browser/signin/BUILD.gn +++ b/ios/public/provider/chrome/browser/signin/BUILD.gn
@@ -88,28 +88,6 @@ deps = [ "//base" ] } -source_set("test_signin_error") { - testonly = true - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ "test_signin_error.mm" ] - deps = [ - ":signin_error_api", - "//base", - ] - frameworks = [ "Foundation.framework" ] -} - -source_set("test_signin_resources") { - testonly = true - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ "test_signin_resources.mm" ] - deps = [ - ":signin_resources_api", - "//ui/base:test_support", - ] - frameworks = [ "UIKit.framework" ] -} - source_set("unit_tests") { configs += [ "//build/config/compiler:enable_arc" ] testonly = true
diff --git a/ios/public/provider/chrome/browser/text_zoom/BUILD.gn b/ios/public/provider/chrome/browser/text_zoom/BUILD.gn index 1e0c235..5566125 100644 --- a/ios/public/provider/chrome/browser/text_zoom/BUILD.gn +++ b/ios/public/provider/chrome/browser/text_zoom/BUILD.gn
@@ -6,13 +6,3 @@ configs += [ "//build/config/compiler:enable_arc" ] sources = [ "text_zoom_api.h" ] } - -source_set("test_text_zoom") { - testonly = true - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ "test_text_zoom.mm" ] - deps = [ - ":text_zoom_api", - "//ios/chrome/browser/web/font_size", - ] -}
diff --git a/ios/public/provider/chrome/browser/text_zoom/DEPS b/ios/public/provider/chrome/browser/text_zoom/DEPS deleted file mode 100644 index 2c0e1b6..0000000 --- a/ios/public/provider/chrome/browser/text_zoom/DEPS +++ /dev/null
@@ -1,7 +0,0 @@ -include_rules = [] - -specific_include_rules = { - "test_text_zoom.mm": [ - "+ios/chrome/browser/web/font_size/font_size_java_script_feature.h", - ] -}
diff --git a/ios/public/provider/chrome/browser/url_rewriters/BUILD.gn b/ios/public/provider/chrome/browser/url_rewriters/BUILD.gn index 6b82aa6..9295aff 100644 --- a/ios/public/provider/chrome/browser/url_rewriters/BUILD.gn +++ b/ios/public/provider/chrome/browser/url_rewriters/BUILD.gn
@@ -6,10 +6,3 @@ configs += [ "//build/config/compiler:enable_arc" ] sources = [ "url_rewriters_api.h" ] } - -source_set("test_url_rewriters") { - testonly = true - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ "test_url_rewriters.cc" ] - deps = [ ":url_rewriters_api" ] -}
diff --git a/ios/public/provider/chrome/browser/voice_search/BUILD.gn b/ios/public/provider/chrome/browser/voice_search/BUILD.gn index 60b7204..dbf60d9 100644 --- a/ios/public/provider/chrome/browser/voice_search/BUILD.gn +++ b/ios/public/provider/chrome/browser/voice_search/BUILD.gn
@@ -10,16 +10,3 @@ ] deps = [ "//ios/chrome/browser/voice:voice_search_language" ] } - -source_set("test_voice_search") { - testonly = true - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ - "test_voice_search.h", - "test_voice_search.mm", - ] - deps = [ - ":voice_search_api", - "//ios/chrome/browser/voice:voice_search_language", - ] -}
diff --git a/ios/web/download/download_native_task_bridge.mm b/ios/web/download/download_native_task_bridge.mm index c7b762cc..34ce7345 100644 --- a/ios/web/download/download_native_task_bridge.mm +++ b/ios/web/download/download_native_task_bridge.mm
@@ -4,6 +4,8 @@ #import "ios/web/download/download_native_task_bridge.h" +#import "base/check.h" + #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif @@ -13,6 +15,7 @@ id<DownloadNativeTaskBridgeReadyDelegate> _readyDelegate; void (^_progressionHandler)(); void (^_completionHandler)(int error_code); + BOOL _observingDownloadProgress; } - (instancetype)initWithDownload:(WKDownload*)download @@ -27,6 +30,10 @@ return self; } +- (void)dealloc { + [self stopObservingDownloadProgress]; +} + - (void)cancel { if (_startDownloadBlock) { // WKDownload will pass a block to its delegate when calling its @@ -54,6 +61,8 @@ }); } + [self stopObservingDownloadProgress]; + [_download cancel:^(NSData* data){/* do nothing */}]; _download = nil; } @@ -64,10 +73,7 @@ _progressionHandler = progressionHandler; _completionHandler = completionHandler; - [_download.progress addObserver:self - forKeyPath:@"fractionCompleted" - options:NSKeyValueObservingOptionNew - context:nil]; + [self startObservingDownloadProgress]; _urlForDownload = [url copy]; @@ -100,11 +106,15 @@ resumeData:(NSData*)resumeData API_AVAILABLE(ios(15)) { if (_completionHandler) (_completionHandler)(error.code); + + [self stopObservingDownloadProgress]; } - (void)downloadDidFinish:(WKDownload*)download API_AVAILABLE(ios(15)) { if (_completionHandler) (_completionHandler)(0); + + [self stopObservingDownloadProgress]; } #pragma mark - KVO @@ -117,4 +127,25 @@ _progressionHandler(); } +#pragma mark - Private methods + +- (void)startObservingDownloadProgress { + DCHECK(!_observingDownloadProgress); + + _observingDownloadProgress = YES; + [_download.progress addObserver:self + forKeyPath:@"fractionCompleted" + options:NSKeyValueObservingOptionNew + context:nil]; +} + +- (void)stopObservingDownloadProgress { + if (_observingDownloadProgress) { + _observingDownloadProgress = NO; + [_download.progress removeObserver:self + forKeyPath:@"fractionCompleted" + context:nil]; + } +} + @end
diff --git a/ios/web/navigation/crw_wk_navigation_handler.mm b/ios/web/navigation/crw_wk_navigation_handler.mm index 7c292f9..f4afb7f 100644 --- a/ios/web/navigation/crw_wk_navigation_handler.mm +++ b/ios/web/navigation/crw_wk_navigation_handler.mm
@@ -46,6 +46,7 @@ #import "net/base/mac/url_conversions.h" #include "net/base/net_errors.h" #include "net/cert/x509_util_ios.h" +#include "net/http/http_content_disposition.h" #include "url/gurl.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -453,7 +454,7 @@ : WKNavigationResponsePolicyCancel); }); - if ([self shouldRenderResponse:WKResponse]) { + if ([self shouldRenderResponse:WKResponse HTTPHeaders:headers.get()]) { const web::WebStatePolicyDecider::ResponseInfo response_info( WKResponse.forMainFrame); self.webStateImpl->ShouldAllowResponse(WKResponse.response, response_info, @@ -1351,7 +1352,18 @@ } // Returns YES if response should be rendered in WKWebView. -- (BOOL)shouldRenderResponse:(WKNavigationResponse*)WKResponse { +- (BOOL)shouldRenderResponse:(WKNavigationResponse*)WKResponse + HTTPHeaders:(net::HttpResponseHeaders*)headers { + if (headers) { + std::string contentDisposition; + headers->GetNormalizedHeader("content-disposition", &contentDisposition); + net::HttpContentDisposition parsedContentDisposition(contentDisposition, + std::string()); + if (parsedContentDisposition.is_attachment()) { + return NO; + } + } + if (_shouldPerformDownload) { DCHECK(web::features::IsNewDownloadAPIEnabled()); return NO;
diff --git a/media/gpu/v4l2/test/vp9_decoder.cc b/media/gpu/v4l2/test/vp9_decoder.cc index 4e66fadf..ebbbe3e 100644 --- a/media/gpu/v4l2/test/vp9_decoder.cc +++ b/media/gpu/v4l2/test/vp9_decoder.cc
@@ -156,6 +156,9 @@ LOG(INFO) << "Ivf file header: " << file_header.width << " x " << file_header.height; + // TODO(stevecho): might need to consider using more than 1 file descriptor + // (fd) & buffer with the output queue for 4K60 requirement. + // https://buganizer.corp.google.com/issues/202214561#comment31 auto OUTPUT_queue = std::make_unique<V4L2Queue>( V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, kDriverCodecFourcc, gfx::Size(file_header.width, file_header.height), /*num_planes=*/1, @@ -371,6 +374,20 @@ FillV4L2VP9SegmentationParams(segm_params, &v4l2_frame_params->seg); } +bool Vp9Decoder::CopyFrameData(const Vp9FrameHeader& frame_hdr, + std::unique_ptr<V4L2Queue>& queue) { + LOG_ASSERT(queue->num_buffers() == 1) + << "Only 1 buffer is expected to be used for OUTPUT queue for now."; + + LOG_ASSERT(queue->num_planes() == 1) + << "Number of planes is expected to be 1 for OUTPUT queue."; + + scoped_refptr<MmapedBuffer> buffer = queue->GetBuffer(0); + + return memcpy(static_cast<uint8_t*>(buffer->mmaped_planes()[0].start_addr), + frame_hdr.data, frame_hdr.frame_size); +} + Vp9Decoder::Result Vp9Decoder::DecodeNextFrame() { gfx::Size size; Vp9FrameHeader frame_hdr{}; @@ -389,6 +406,9 @@ break; } + if (!CopyFrameData(frame_hdr, OUTPUT_queue_)) + LOG(FATAL) << "Failed to copy the frame data into the V4L2 buffer."; + if (!v4l2_ioctl_->QBuf(OUTPUT_queue_, 0)) LOG(ERROR) << "VIDIOC_QBUF failed for OUTPUT queue.";
diff --git a/media/gpu/v4l2/test/vp9_decoder.h b/media/gpu/v4l2/test/vp9_decoder.h index 023683c..4151e9d7 100644 --- a/media/gpu/v4l2/test/vp9_decoder.h +++ b/media/gpu/v4l2/test/vp9_decoder.h
@@ -55,6 +55,10 @@ Vp9Parser::Result ReadNextFrame(Vp9FrameHeader& vp9_frame_header, gfx::Size& size); + // Copies the frame data into the V4L2 buffer of OUTPUT |queue|. + bool CopyFrameData(const Vp9FrameHeader& frame_hdr, + std::unique_ptr<V4L2Queue>& queue); + // Sets up per frame parameters |v4l2_frame_params| needed for VP9 decoding // with VIDIOC_S_EXT_CTRLS ioctl call. void SetupFrameParams(
diff --git a/net/base/ip_endpoint_unittest.cc b/net/base/ip_endpoint_unittest.cc index eeb8047..afa1ad5 100644 --- a/net/base/ip_endpoint_unittest.cc +++ b/net/base/ip_endpoint_unittest.cc
@@ -7,9 +7,9 @@ #include <string.h> #include <string> +#include <tuple> #include "base/check_op.h" -#include "base/ignore_result.h" #include "base/notreached.h" #include "base/numerics/safe_conversions.h" #include "base/strings/string_number_conversions.h" @@ -202,7 +202,7 @@ EXPECT_DCHECK_DEATH(bt_endpoint.port()); SockaddrStorage storage; EXPECT_DCHECK_DEATH( - ignore_result(bt_endpoint.ToSockAddr(storage.addr, &storage.addr_len))); + std::ignore = bt_endpoint.ToSockAddr(storage.addr, &storage.addr_len)); EXPECT_DCHECK_DEATH(bt_endpoint.ToString()); EXPECT_DCHECK_DEATH(bt_endpoint.ToStringWithoutPort()); } @@ -246,8 +246,8 @@ // Test that IPv4/IPv6-only methods crash. EXPECT_DCHECK_DEATH(bt_endpoint_other.port()); SockaddrStorage storage; - EXPECT_DCHECK_DEATH(ignore_result( - bt_endpoint_other.ToSockAddr(storage.addr, &storage.addr_len))); + EXPECT_DCHECK_DEATH(std::ignore = bt_endpoint_other.ToSockAddr( + storage.addr, &storage.addr_len)); EXPECT_DCHECK_DEATH(bt_endpoint_other.ToString()); EXPECT_DCHECK_DEATH(bt_endpoint_other.ToStringWithoutPort()); } @@ -277,8 +277,8 @@ // Test that IPv4/IPv6-only methods crash. EXPECT_DCHECK_DEATH(bt_endpoint_other.port()); SockaddrStorage storage; - EXPECT_DCHECK_DEATH(ignore_result( - bt_endpoint_other.ToSockAddr(storage.addr, &storage.addr_len))); + EXPECT_DCHECK_DEATH(std::ignore = bt_endpoint_other.ToSockAddr( + storage.addr, &storage.addr_len)); EXPECT_DCHECK_DEATH(bt_endpoint_other.ToString()); EXPECT_DCHECK_DEATH(bt_endpoint_other.ToStringWithoutPort()); } @@ -307,8 +307,8 @@ // Test that IPv4/IPv6-only methods crash. EXPECT_DCHECK_DEATH(bt_endpoint_other.port()); SockaddrStorage storage; - EXPECT_DCHECK_DEATH(ignore_result( - bt_endpoint_other.ToSockAddr(storage.addr, &storage.addr_len))); + EXPECT_DCHECK_DEATH(std::ignore = bt_endpoint_other.ToSockAddr( + storage.addr, &storage.addr_len)); EXPECT_DCHECK_DEATH(bt_endpoint_other.ToString()); EXPECT_DCHECK_DEATH(bt_endpoint_other.ToStringWithoutPort()); }
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h index 3d972b95..4f00e42 100644 --- a/net/base/net_error_list.h +++ b/net/base/net_error_list.h
@@ -180,12 +180,7 @@ // unsupported method. NET_ERROR(PROXY_AUTH_UNSUPPORTED, -115) -// During SSL renegotiation (rehandshake), the server sent a certificate with -// an error. -// -// Note: this error is not in the -2xx range so that it won't be handled as a -// certificate error. -NET_ERROR(CERT_ERROR_IN_SSL_RENEGOTIATION, -116) +// Error -116 was removed (CERT_ERROR_IN_SSL_RENEGOTIATION) // The SSL handshake failed because of a bad or missing client certificate. NET_ERROR(BAD_SSL_CLIENT_AUTH_CERT, -117)
diff --git a/net/cert/internal/crl_parse_crl_certificatelist_fuzzer.cc b/net/cert/internal/crl_parse_crl_certificatelist_fuzzer.cc index c2a62623..e8f07245 100644 --- a/net/cert/internal/crl_parse_crl_certificatelist_fuzzer.cc +++ b/net/cert/internal/crl_parse_crl_certificatelist_fuzzer.cc
@@ -5,7 +5,8 @@ #include <stddef.h> #include <stdint.h> -#include "base/ignore_result.h" +#include <tuple> + #include "net/cert/internal/crl.h" #include "net/der/input.h" @@ -16,8 +17,8 @@ net::der::Input signature_algorithm_tlv; net::der::BitString signature_value; - ignore_result(net::ParseCrlCertificateList( - crl_der, &tbs_cert_list_tlv, &signature_algorithm_tlv, &signature_value)); + std::ignore = net::ParseCrlCertificateList( + crl_der, &tbs_cert_list_tlv, &signature_algorithm_tlv, &signature_value); return 0; }
diff --git a/net/cert/internal/crl_parse_crl_tbscertlist_fuzzer.cc b/net/cert/internal/crl_parse_crl_tbscertlist_fuzzer.cc index e0fcc5b..df64f7b 100644 --- a/net/cert/internal/crl_parse_crl_tbscertlist_fuzzer.cc +++ b/net/cert/internal/crl_parse_crl_tbscertlist_fuzzer.cc
@@ -5,7 +5,8 @@ #include <stddef.h> #include <stdint.h> -#include "base/ignore_result.h" +#include <tuple> + #include "net/cert/internal/crl.h" #include "net/der/input.h" @@ -13,7 +14,7 @@ net::der::Input input_der(data, size); net::ParsedCrlTbsCertList tbs_cert_list; - ignore_result(net::ParseCrlTbsCertList(input_der, &tbs_cert_list)); + std::ignore = net::ParseCrlTbsCertList(input_der, &tbs_cert_list); return 0; }
diff --git a/net/cert/internal/parse_authority_key_identifier_fuzzer.cc b/net/cert/internal/parse_authority_key_identifier_fuzzer.cc index 31c1a8db..8448bb29 100644 --- a/net/cert/internal/parse_authority_key_identifier_fuzzer.cc +++ b/net/cert/internal/parse_authority_key_identifier_fuzzer.cc
@@ -5,7 +5,8 @@ #include <stddef.h> #include <stdint.h> -#include "base/ignore_result.h" +#include <tuple> + #include "net/cert/internal/parse_certificate.h" #include "net/der/input.h" @@ -14,8 +15,8 @@ net::ParsedAuthorityKeyIdentifier authority_key_identifier; - ignore_result( - net::ParseAuthorityKeyIdentifier(der, &authority_key_identifier)); + std::ignore = + net::ParseAuthorityKeyIdentifier(der, &authority_key_identifier); return 0; }
diff --git a/net/data/ssl/chrome_root_store/BUILD.gn b/net/data/ssl/chrome_root_store/BUILD.gn index 39a10306..616429b6 100644 --- a/net/data/ssl/chrome_root_store/BUILD.gn +++ b/net/data/ssl/chrome_root_store/BUILD.gn
@@ -14,6 +14,7 @@ "--root-store-dir=" + rebase_path("store", root_build_dir), "--write-cpp=" + rebase_path("${target_gen_dir}/chrome-root-store-inc.cc", root_build_dir), + "--cpp-output-format=root", "--write-deps=" + rebase_path(depfile, root_build_dir), ] } @@ -29,6 +30,7 @@ "--write-cpp=" + rebase_path("${target_gen_dir}/chrome-root-store-test-data-inc.cc", root_build_dir), + "--cpp-output-format=root", "--write-deps=" + rebase_path(depfile, root_build_dir), ] }
diff --git a/net/data/ssl/ev_roots/BUILD.gn b/net/data/ssl/ev_roots/BUILD.gn index 17ef2f8..9211dbf 100644 --- a/net/data/ssl/ev_roots/BUILD.gn +++ b/net/data/ssl/ev_roots/BUILD.gn
@@ -5,86 +5,17 @@ # Generate C++ include file for the Chrome root store. compiled_action("gen_ev_root_store_inc") { - tool = "//net/tools/ev_store_tool:ev_store_tool" + tool = "//net/tools/root_store_tool:root_store_tool" - # It'd be really nice to list an input as "store/certs/*", but it doesn't seem - # to work. So we list them all out. - inputs = [ - "root_store.textproto", - "certs/063e4afac491dfd332f3089b8542e94617d893d7fe944e10a7937ee29d9693c0.pem", - "certs/687fa451382278fff0c8b11f8d43d576671c6eb2bceab413fb83d965d06d2ff2.pem", - "certs/001686cd181f83a1b1217d305b365c41e3470a78a1d37b134a98cd547b92dab3.pem", - "certs/02ed0eb28c14da45165c566791700d6451d7fb56f0b2ab1d3b8eb070e56edff5.pem", - "certs/0376ab1d54c5f9803ce4b2e201a0ee7eef7b57b636e8a93c9b8d4860c96f5fa7.pem", - "certs/04048028bf1f2864d48f9ad4d83294366a828856553f3b14303f90147f5d40ef.pem", - "certs/063e4afac491dfd332f3089b8542e94617d893d7fe944e10a7937ee29d9693c0.pem", - "certs/0a81ec5a929777f145904af38d5d509f66b5e2c58fcdb531058b0e17f3f0b41b.pem", - "certs/0c2cd63df7806fa399ede809116b575bf87989f06518f9808c860503178baf66.pem", - "certs/1465fa205397b876faa6f0a9958e5590e40fcc7faa4fb7c2c8677521fb5fb658.pem", - "certs/15f0ba00a3ac7af3ac884c072b1011a077bd77c097f40164b2f8598abd83860c.pem", - "certs/16af57a9f676b0ab126095aa5ebadef22ab31119d644ac95cd4b93dbf3f26aeb.pem", - "certs/1793927a0614549789adce2f8f34f7f0b66d0f3ae3a3b84d21ec15dbba4fadc7.pem", - "certs/179fbc148a3dd00fd24ea13458cc43bfa7f59c8182d783a513f6ebec100c8924.pem", - "certs/18ce6cfe7bf14e60b2e347b8dfe868cb31d02ebb3ada271569f50343b46db3a4.pem", - "certs/1a0d20445de5ba1862d19ef880858cbce50102b36e8f0a040c3c69e74522fe6e.pem", - "certs/1ba5b2aa8c65401a82960118f80bec4f62304d83cec4713a19c39c011ea46db4.pem", - "certs/22a2c1f7bded704cc1e701b5f408c310880fe956b5de2a4a44f99c873a25a7c8.pem", - "certs/23804203ca45d8cde716b8c13bf3b448457fa06cc10250997fa01458317c41e5.pem", - "certs/2530cc8e98321502bad96f9b1fba1b099e2d299e0f4548bb914f363bc0d4531f.pem", - "certs/2ce1cb0bf9d2f9e102993fbe215152c3b2dd0cabde1c68e5319b839154dbb7f5.pem", - "certs/2e7bf16cc22485a7bbe2aa8696750761b0ae39be3b2fe9d0cc6d4ef73491425c.pem", - "certs/31ad6648f8104138c738f39ea4320133393e3a18cc02296ef97c2ac9ef6731d0.pem", - "certs/3e9099b5015e8f486c00bcea9d111ee721faba355a89bcf1df69561e3dc6325c.pem", - "certs/40f6af0346a99aa1cd1d555a4e9cce62c7f9634603ee406615833dc8c8d00367.pem", - "certs/4200f5043ac8590ebb527d209ed1503029fbcbd41ca1b506ec27f15ade7dac69.pem", - "certs/4348a0e9444c78cb265e058d5e8944b4d84f9662bd26db257f8934a443c70161.pem", - "certs/43df5774b03e7fef5fe40d931a7bedf1bb2e6b42738c4e6d3841103d3aa7f339.pem", - "certs/45140b3247eb9cc8c5b4f0d7b53091f73292089e6e5a63e2749dd3aca9198eda.pem", - "certs/4d2491414cfe956746ec4cefa6cf6f72e28a1329432f9d8a907ac4cb5dadc15a.pem", - "certs/4ff460d54b9c86dabfbcfc5712e0400d2bed3fbc4d4fbdaa86e06adcd2a9ad7a.pem", - "certs/513b2cecb810d4cde5dd85391adfc6c2dd60d87bb736d2b521484aa47a0ebef6.pem", - "certs/52f0e1c4e58ec629291b60317f074671b85d7ea80d5b07273463534b32b40234.pem", - "certs/54455f7129c20b1447c418f997168f24c58fc5023bf5da5be2eb6e1dd8902ed5.pem", - "certs/552f7bdcf1a7af9e6ce672017f4f12abf77240c78e761ac203d1d9d20ac89988.pem", - "certs/55926084ec963a64b96e2abe01ce0ba86a64fbfebcc7aab5afc155b37fd76066.pem", - "certs/568d6905a2c88708a4b3025190edcfedb1974a606a13c6e5290fcb2ae63edab5.pem", - "certs/59769007f7685d0fcd50872f9f95d5755a5b2b457d81f3692b610a98672f0e1b.pem", - "certs/5a2fc03f0c83b090bbfa40604b0988446c7636183df9846e17101a447fb8efd6.pem", - "certs/5c58468d55f58e497e743982d2b50010b6d165374acf83a7d4a32db768c4408e.pem", - "certs/5cc3d78e4e1d5e45547a04e6873e64f90cf9536d1ccc2ef800f355c4c5fd70fd.pem", - "certs/62dd0be9b9f50a163ea0f8e75c053b1eca57ea55c8688f647c6881f2c8357b95.pem", - "certs/687fa451382278fff0c8b11f8d43d576671c6eb2bceab413fb83d965d06d2ff2.pem", - "certs/6b9c08e86eb0f767cfad65cd98b62149e5494a67f5845e7bd1ed019f27b86bd6.pem", - "certs/70a73f7f376b60074248904534b11482d5bf0e698ecc498df52577ebf2e93b9a.pem", - "certs/73c176434f1bc6d5adf45b0e76e727287c8de57616c1e6e6141a2b2cbc7d8e4c.pem", - "certs/7431e5f4c3c1ce4690774f0b61e05440883ba9a01ed00ba6abd7806ed3b118cf.pem", - "certs/7d05ebb682339f8c9451ee094eebfefa7953a114edb2f44949452fab7d2fc185.pem", - "certs/7e37cb8b4c47090cab36551ba6f45db840680fba166a952db100717f43053fc2.pem", - "certs/85a0dd7dd720adb7ff05f83d542b209dc7ff4528f7d677b18389fea5e5c49e86.pem", - "certs/8ecde6884f3d87b1125ba31ac3fcb13d7016de7f57cc904fe1cb97c6ae98196e.pem", - "certs/8fe4fb0af93a4d0d67db0bebb23e37c71bf325dcbcdd240ea04daf58b47e1840.pem", - "certs/960adf0063e96356750c2965dd0a0867da0b9cbd6e77714aeafb2349ab393da3.pem", - "certs/b0bfd52bb0d7d9bd92bf5d4dc13da255c02c542f378365ea893911f55e55f23c.pem", - "certs/bd71fdf6da97e4cf62d1647add2581b07d79adf8397eb4ecba9c5e8488821423.pem", - "certs/bfd88fe1101c41ae3e801bf8be56350ee9bad1a6b9bd515edc5c6d5b8711ac44.pem", - "certs/c3846bf24b9e93ca64274c0ec67c1ecc5e024ffcacd2d74019350e81fe546ae4.pem", - "certs/cb3ccbb76031e5e0138f8dd39a23f9de47ffc35e43c1144cea27d46a5ab1cb5f.pem", - "certs/cbb522d7b7f127ad6a0113865bdf1cd4102e7d0759af635a7cf4720dc963c53b.pem", - "certs/cecddc905099d8dadfc5b1d209b737cbe2c18cfb2c10c0ff0bcf0d3286fc1aa2.pem", - "certs/d43af9b35473755c9684fc06d7d8cb70ee5c28e773fb294eb41ee71722924d24.pem", - "certs/e35d28419ed02025cfa69038cd623962458da5c695fbdea3c22b0bfb25897092.pem", - "certs/e75e72ed9f560eec6eb4800073a43fc3ad19195a392282017895974a99026b6c.pem", - "certs/e793c9b02fd8aa13e21c31228accb08119643b749c898964b1746d46c3d4cbd2.pem", - "certs/ebd41040e4bb3ec742c9e381d31ef2a41a48b6685c96e7cef3c1df6cd4331c99.pem", - "certs/edf7ebbca27a2a384d387b7d4010c666e2edb4843e4c29b4ae1d5b9332e6b24d.pem", - "certs/eec5496b988ce98625b934092eec2908bed0b0f316c2d4730c84eaf1f3d34881.pem", - ] - + inputs = [ "root_store.textproto" ] outputs = [ "${target_gen_dir}/chrome-ev-root-store-inc.cc" ] + depfile = "${target_gen_dir}/chrome-ev-root-store-inc.cc.d" args = [ "--root-store-dir=" + rebase_path("../ev_roots", root_build_dir), "--write-cpp=" + rebase_path("${target_gen_dir}/chrome-ev-root-store-inc.cc", root_build_dir), + "--cpp-output-format=ev", + "--write-deps=" + rebase_path(depfile, root_build_dir), ] }
diff --git a/net/dns/public/scoped_res_state.cc b/net/dns/public/scoped_res_state.cc index f7dbb5e7..9706d18 100644 --- a/net/dns/public/scoped_res_state.cc +++ b/net/dns/public/scoped_res_state.cc
@@ -4,6 +4,7 @@ #include "net/dns/public/scoped_res_state.h" +#include <cstring> #include <memory> #include "base/check.h"
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 18d8e83..26a2605a 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc
@@ -1094,19 +1094,11 @@ } int HttpNetworkTransaction::DoReadHeadersComplete(int result) { - // We can get a certificate error or ERR_SSL_CLIENT_AUTH_CERT_NEEDED here - // due to SSL renegotiation. - if (IsCertificateError(result)) { - // We don't handle a certificate error during SSL renegotiation, so we - // have to return an error that's not in the certificate error range - // (-2xx). - // - // TODO(davidben): Remove this error. This is impossible now that server - // certificates are forbidden from changing in renegotiation. - LOG(ERROR) << "Got a server certificate with error " << result - << " during SSL renegotiation"; - result = ERR_CERT_ERROR_IN_SSL_RENEGOTIATION; - } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { + // We can get a ERR_SSL_CLIENT_AUTH_CERT_NEEDED here due to SSL renegotiation. + // Server certificate errors are impossible. Rather than reverify the new + // server certificate, BoringSSL forbids server certificates from changing. + DCHECK(!IsCertificateError(result)); + if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { DCHECK(stream_.get()); DCHECK(IsSecureRequest()); response_.cert_request_info = base::MakeRefCounted<SSLCertRequestInfo>();
diff --git a/net/http/http_stream_factory_unittest.cc b/net/http/http_stream_factory_unittest.cc index 058d221d..77cf4d8 100644 --- a/net/http/http_stream_factory_unittest.cc +++ b/net/http/http_stream_factory_unittest.cc
@@ -15,7 +15,6 @@ #include "base/compiler_specific.h" #include "base/containers/contains.h" #include "base/cxx17_backports.h" -#include "base/ignore_result.h" #include "base/memory/ptr_util.h" #include "base/no_destructor.h" #include "base/run_loop.h" @@ -591,7 +590,7 @@ PRIVACY_MODE_DISABLED, SpdySessionKey::IsProxySession::kFalse, SocketTag(), NetworkIsolationKey(), SecureDnsPolicy::kAllow); - ignore_result(CreateFakeSpdySession(session->spdy_session_pool(), key)); + std::ignore = CreateFakeSpdySession(session->spdy_session_pool(), key); CommonConnectJobParams common_connect_job_params = session->CreateCommonConnectJobParams();
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 4e88846..d789cbe 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc
@@ -8,11 +8,11 @@ #include <limits> #include <map> #include <string> +#include <tuple> #include <utility> #include "base/bind.h" #include "base/containers/contains.h" -#include "base/ignore_result.h" #include "base/location.h" #include "base/logging.h" #include "base/memory/raw_ptr.h" @@ -2317,7 +2317,7 @@ if (availability_state_ == STATE_DRAINING) { return; } - ignore_result(DoReadLoop(expected_read_state, result)); + std::ignore = DoReadLoop(expected_read_state, result); } int SpdySession::DoReadLoop(ReadState expected_read_state, int result) { @@ -2977,7 +2977,7 @@ std::pair<ActiveStreamMap::iterator, bool> result = active_streams_.insert(std::make_pair(stream_id, stream.get())); CHECK(result.second); - ignore_result(stream.release()); + std::ignore = stream.release(); } void SpdySession::DeleteStream(std::unique_ptr<SpdyStream> stream, int status) {
diff --git a/net/spdy/spdy_session_pool_unittest.cc b/net/spdy/spdy_session_pool_unittest.cc index 07dc7fabd..f148b13 100644 --- a/net/spdy/spdy_session_pool_unittest.cc +++ b/net/spdy/spdy_session_pool_unittest.cc
@@ -5,11 +5,11 @@ #include "net/spdy/spdy_session_pool.h" #include <cstddef> +#include <tuple> #include <utility> #include "base/bind.h" #include "base/cxx17_backports.h" -#include "base/ignore_result.h" #include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/run_loop.h" @@ -204,7 +204,7 @@ void OnTrailers(const spdy::Http2HeaderBlock& trailers) override {} void OnClose(int status) override { - ignore_result(CreateFakeSpdySession(spdy_session_pool_, key_)); + std::ignore = CreateFakeSpdySession(spdy_session_pool_, key_); } bool CanGreaseFrameType() const override { return false; }
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc index afaf5b2..9691d24 100644 --- a/net/spdy/spdy_session_unittest.cc +++ b/net/spdy/spdy_session_unittest.cc
@@ -6,13 +6,13 @@ #include <algorithm> #include <string> +#include <tuple> #include <utility> #include "base/base64.h" #include "base/bind.h" #include "base/callback.h" #include "base/cxx17_backports.h" -#include "base/ignore_result.h" #include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/strings/string_number_conversions.h" @@ -3889,9 +3889,9 @@ void OnClose(int status) override { GURL url(kDefaultUrl); - ignore_result(CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, - session_, url, MEDIUM, - NetLogWithSource())); + std::ignore = + CreateStreamSynchronously(SPDY_REQUEST_RESPONSE_STREAM, session_, url, + MEDIUM, NetLogWithSource()); } private:
diff --git a/net/tools/ev_store_tool/BUILD.gn b/net/tools/ev_store_tool/BUILD.gn deleted file mode 100644 index 3a89cb95..0000000 --- a/net/tools/ev_store_tool/BUILD.gn +++ /dev/null
@@ -1,15 +0,0 @@ -# Copyright 2021 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//third_party/protobuf/proto_library.gni") - -executable("ev_store_tool") { - sources = [ "ev_store_tool.cc" ] - deps = [ - "//base", - "//crypto", - "//net/tools/root_store_tool:root_store_proto_full", - "//third_party/boringssl", - ] -}
diff --git a/net/tools/ev_store_tool/README.md b/net/tools/ev_store_tool/README.md deleted file mode 100644 index baa6e08f8..0000000 --- a/net/tools/ev_store_tool/README.md +++ /dev/null
@@ -1,8 +0,0 @@ -# EV store tool - -This directory contains tools for processing the EV Store data in -[`//net/data/ssl/ev_store`](/net/data/ssl/ev_store). It is heavily based on the -Chrome Root Store tool in -[`//net/tools/root_store_tool/`](/net/tools/root_store_tool/). - -TODO(https://crbug.com/1271177): merge this tool with the chrome root store tool
diff --git a/net/tools/ev_store_tool/ev_store_tool.cc b/net/tools/ev_store_tool/ev_store_tool.cc deleted file mode 100644 index 5d98ad0..0000000 --- a/net/tools/ev_store_tool/ev_store_tool.cc +++ /dev/null
@@ -1,245 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <iostream> -#include <string> - -#include "base/at_exit.h" -#include "base/base_paths.h" -#include "base/command_line.h" -#include "base/files/file_path.h" -#include "base/files/file_util.h" -#include "base/logging.h" -#include "base/path_service.h" -#include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" -#include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" -#include "crypto/openssl_util.h" -#include "crypto/sha2.h" -#include "net/tools/root_store_tool/root_store.pb.h" -#include "third_party/abseil-cpp/absl/types/optional.h" -#include "third_party/boringssl/src/include/openssl/bio.h" -#include "third_party/boringssl/src/include/openssl/pem.h" -#include "third_party/protobuf/src/google/protobuf/text_format.h" - -using chrome_root_store::RootStore; - -// Tool used to generate the EV root certificate store. Similar to the -// root_store_tool in net/tools/root_store_tool. -// -// TODO(hchao): Look into combining all of these codegen use cases as more tools -// get added. At a minimum, look into sharing more of the code. - -namespace { - -absl::optional<std::string> DecodePEM(base::StringPiece pem) { - // TODO(https://crbug.com/1216547): net/cert/pem.h has a much nicer API, but - // it would require some build refactoring to avoid a circular dependency. - // This is assuming that the chrome trust store code goes in - // net/cert/internal, which it may not. - bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(pem.data(), pem.size())); - if (!bio) { - return absl::nullopt; - } - char* name; - char* header; - unsigned char* data; - long len; - if (!PEM_read_bio(bio.get(), &name, &header, &data, &len)) { - LOG(ERROR) << "Could not find PEM block."; - return absl::nullopt; - } - bssl::UniquePtr<char> scoped_name(name); - bssl::UniquePtr<char> scoped_header(header); - bssl::UniquePtr<unsigned char> scoped_data(data); - if (strcmp(name, "CERTIFICATE") != 0) { - LOG(ERROR) << "Found PEM block of type " << name - << " instead of CERTIFICATE"; - return absl::nullopt; - } - return std::string(data, data + len); -} - -absl::optional<RootStore> ReadTextEvStore(const base::FilePath& ev_store_dir) { - base::FilePath ev_store_path = - ev_store_dir.AppendASCII("root_store.textproto"); - std::string ev_store_text; - if (!base::ReadFileToString(ev_store_path, &ev_store_text)) { - LOG(ERROR) << "Could not read " << ev_store_path; - return absl::nullopt; - } - - RootStore ev_store; - if (!google::protobuf::TextFormat::ParseFromString(ev_store_text, - &ev_store)) { - LOG(ERROR) << "Could not parse " << ev_store_path; - return absl::nullopt; - } - - // Replace the filenames with the actual certificate contents. - base::FilePath certs_dir = ev_store_dir.AppendASCII("certs"); - for (auto& anchor : *ev_store.mutable_trust_anchors()) { - base::FilePath pem_path = certs_dir.AppendASCII(anchor.filename()); - - if (!base::PathExists(pem_path)) { - LOG(ERROR) << "Error file does not exist: " << pem_path; - return absl::nullopt; - } - - if (base::DirectoryExists(pem_path)) { - LOG(ERROR) << "Error path is a directory: " << pem_path; - return absl::nullopt; - } - - if (!base::PathIsReadable(pem_path)) { - LOG(ERROR) << "Error file is not readable: " << pem_path; - return absl::nullopt; - } - - std::string pem; - if (!base::ReadFileToString(pem_path, &pem)) { - LOG(ERROR) << "Error reading " << pem_path; - return absl::nullopt; - } - absl::optional<std::string> der = DecodePEM(pem); - if (!der) { - LOG(ERROR) << "Error decoding " << pem_path; - return absl::nullopt; - } - anchor.clear_filename(); - anchor.set_der(*der); - } - return std::move(ev_store); -} - -} // namespace - -int main(int argc, char** argv) { - base::AtExitManager at_exit_manager; - base::CommandLine::Init(argc, argv); - - logging::LoggingSettings settings; - settings.logging_dest = - logging::LOG_TO_SYSTEM_DEBUG_LOG | logging::LOG_TO_STDERR; - logging::InitLogging(settings); - - crypto::EnsureOpenSSLInit(); - - base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); - base::FilePath proto_path = command_line.GetSwitchValuePath("write-proto"); - base::FilePath cpp_path = command_line.GetSwitchValuePath("write-cpp"); - // Get EV root store directory. Assumptions: - // - $(ROOT_STORE_DIR)/ev_store.textproto contains the textproto definition - // of the EV root store - // - // - Any certificate files referenced in - // $(ROOT_STORE_DIR)/ev_store.textproto exist in the - // $(ROOT_STORE_DIR)/certs/ subdirectory. - base::FilePath root_store_dir = - command_line.GetSwitchValuePath("root-store-dir"); - - if ((proto_path.empty() && cpp_path.empty()) || root_store_dir.empty() || - command_line.HasSwitch("help")) { - std::cerr << "Usage: ev_store_tool " - << "--root-store-dir=<path> " - << "[--write-proto=PROTO_FILE] " - << "[--write-cpp=CPP_FILE]" << std::endl; - return 1; - } - - root_store_dir = base::MakeAbsoluteFilePath(root_store_dir); - absl::optional<RootStore> ev_store = ReadTextEvStore(root_store_dir); - if (!ev_store) { - return 1; - } - - if (!proto_path.empty()) { - std::string serialized; - if (!ev_store->SerializeToString(&serialized)) { - LOG(ERROR) << "Error serializing root store proto" - << ev_store->DebugString(); - return 1; - } - if (!base::WriteFile(proto_path, serialized)) { - PLOG(ERROR) << "Error writing serialized proto root store"; - return 1; - } - } - - if (!cpp_path.empty()) { - // There should be at leas one EV root. - CHECK_GT(ev_store->trust_anchors_size(), 0); - - std::string string_to_write = - "// This file is auto-generated, DO NOT EDIT.\n\n" - "static const EVMetadata kEvRootCaMetadata[] = {\n"; - - for (auto& anchor : ev_store->trust_anchors()) { - // Every trust anchor at this point should have a DER. - CHECK(!anchor.der().empty()); - - std::string sha256_hash = crypto::SHA256HashString(anchor.der()); - - // Begin struct. Assumed type of EVMetadata: - // - // struct EVMetadata { - // static const size_t kMaxOIDsPerCA = 2; - // SHA256HashValue fingerprint; - // const base::StringPiece policy_oids[kMaxOIDsPerCA]; - // }; - string_to_write += " {\n"; - string_to_write += " {{"; - - int wrap_count = 0; - for (auto c : sha256_hash) { - if (wrap_count != 0) { - if (wrap_count % 11 == 0) { - string_to_write += ",\n "; - } else { - string_to_write += ", "; - } - } - base::StringAppendF(&string_to_write, "0x%02x", - static_cast<uint8_t>(c)); - wrap_count++; - } - - string_to_write += "}},\n"; - string_to_write += " {\n"; - - // struct expects exactly two policy oids, and we can only support 1 or 2 - // policy OIDs. - const int kMaxPolicyOids = 2; - int oids_size = anchor.ev_policy_oids_size(); - std::string hexencode_hash = - base::HexEncode(sha256_hash.data(), sha256_hash.size()); - if (oids_size > kMaxPolicyOids) { - PLOG(ERROR) << hexencode_hash << " has too many OIDs!"; - return 1; - } else if (oids_size < 1) { - PLOG(ERROR) << hexencode_hash << " has no OIDs!"; - return 1; - } - for (int i = 0; i < kMaxPolicyOids; i++) { - std::string oid; - if (i < oids_size) { - oid = anchor.ev_policy_oids(i); - } - string_to_write += " \"" + oid + "\",\n"; - } - - // End struct - string_to_write += " },\n"; - string_to_write += " },\n"; - } - string_to_write += "};\n"; - if (!base::WriteFile(cpp_path, string_to_write)) { - PLOG(ERROR) << "Error writing cpp include file"; - return 1; - } - } - - return 0; -}
diff --git a/net/tools/root_store_tool/README.md b/net/tools/root_store_tool/README.md index d1eac4fa..97793fb 100644 --- a/net/tools/root_store_tool/README.md +++ b/net/tools/root_store_tool/README.md
@@ -3,6 +3,7 @@ This directory contains tools for processing the [Chrome Root Store](https://www.chromium.org/Home/chromium-security/root-ca-policy) data in -[`//net/data/ssl/chrome_root_store`](/net/data/ssl/chrome_root_store). +[`//net/data/ssl/chrome_root_store`](/net/data/ssl/chrome_root_store), as well +as the EV root data in [`//net/data/ssl/ev_roots`](//net/data/ssl/ev_roots). TODO(https://crbug.com/1216547): document how to use these tools.
diff --git a/net/tools/root_store_tool/root_store_tool.cc b/net/tools/root_store_tool/root_store_tool.cc index 794b9a3..86178ec 100644 --- a/net/tools/root_store_tool/root_store_tool.cc +++ b/net/tools/root_store_tool/root_store_tool.cc
@@ -13,12 +13,14 @@ #include "base/files/file_util.h" #include "base/logging.h" #include "base/path_service.h" +#include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "crypto/openssl_util.h" +#include "crypto/sha2.h" #include "net/tools/root_store_tool/root_store.pb.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/boringssl/src/include/openssl/bio.h" @@ -128,6 +130,124 @@ out->append(path_str); } +// Returns true if file was correctly written, false otherwise. +bool WriteRootCppFile(const RootStore& root_store, + const base::FilePath cpp_path) { + // Root store should have at least one trust anchors. + CHECK_GT(root_store.trust_anchors_size(), 0); + + std::string string_to_write = + "// This file is auto-generated, DO NOT EDIT.\n\n" + "const ChromeRootCertInfo kChromeRootCertList[] = {\n"; + + for (auto& anchor : root_store.trust_anchors()) { + // Every trust anchor at this point should have a DER. + CHECK(!anchor.der().empty()); + std::string der = anchor.der(); + + // Begin struct. Assumed type of ChromeRootCertInfo: + // + // struct { + // base::span<const uint8_t> der; + // }; + string_to_write += " {{{"; + + // Convert each character to hex representation, escaped. + for (auto c : der) { + base::StringAppendF(&string_to_write, "0x%02xu,", + static_cast<uint8_t>(c)); + } + + // End struct + string_to_write += "}}},\n"; + } + string_to_write += "};"; + if (!base::WriteFile(cpp_path, string_to_write)) { + return false; + } + return true; +} + +// Returns true if file was correctly written, false otherwise. +bool WriteEvCppFile(const RootStore& root_store, + const base::FilePath cpp_path) { + // There should be at least one EV root. + CHECK_GT(root_store.trust_anchors_size(), 0); + + std::string string_to_write = + "// This file is auto-generated, DO NOT EDIT.\n\n" + "static const EVMetadata kEvRootCaMetadata[] = {\n"; + + for (auto& anchor : root_store.trust_anchors()) { + // Every trust anchor at this point should have a DER. + CHECK(!anchor.der().empty()); + + std::string sha256_hash = crypto::SHA256HashString(anchor.der()); + + // Begin struct. Assumed type of EVMetadata: + // + // struct EVMetadata { + // static const size_t kMaxOIDsPerCA = 2; + // SHA256HashValue fingerprint; + // const base::StringPiece policy_oids[kMaxOIDsPerCA]; + // }; + string_to_write += " {\n"; + string_to_write += " {{"; + + int wrap_count = 0; + for (auto c : sha256_hash) { + if (wrap_count != 0) { + if (wrap_count % 11 == 0) { + string_to_write += ",\n "; + } else { + string_to_write += ", "; + } + } + base::StringAppendF(&string_to_write, "0x%02x", static_cast<uint8_t>(c)); + wrap_count++; + } + + string_to_write += "}},\n"; + string_to_write += " {\n"; + + // struct expects exactly two policy oids, and we can only support 1 or 2 + // policy OIDs. These checks will need to change if we ever merge the EV and + // Chrome Root Store textprotos. + const int kMaxPolicyOids = 2; + int oids_size = anchor.ev_policy_oids_size(); + std::string hexencode_hash = + base::HexEncode(sha256_hash.data(), sha256_hash.size()); + if (oids_size > kMaxPolicyOids) { + PLOG(ERROR) << hexencode_hash << " has too many OIDs!"; + return false; + } else if (oids_size < 1) { + PLOG(ERROR) << hexencode_hash << " has no OIDs!"; + return false; + } + for (int i = 0; i < kMaxPolicyOids; i++) { + std::string oid; + if (i < oids_size) { + oid = anchor.ev_policy_oids(i); + } + string_to_write += " \"" + oid + "\",\n"; + } + + // End struct + string_to_write += " },\n"; + string_to_write += " },\n"; + } + string_to_write += "};\n"; + if (!base::WriteFile(cpp_path, string_to_write)) { + PLOG(ERROR) << "Error writing cpp include file"; + return false; + } + return true; +} + +bool ValidCppOutputFormatValue(base::StringPiece value) { + return (value == "root" || value == "ev"); +} + } // namespace int main(int argc, char** argv) { @@ -145,6 +265,8 @@ base::FilePath deps_path = command_line.GetSwitchValuePath("write-deps"); base::FilePath proto_path = command_line.GetSwitchValuePath("write-proto"); base::FilePath cpp_path = command_line.GetSwitchValuePath("write-cpp"); + std::string cpp_output_format = + command_line.GetSwitchValueASCII("cpp-output-format"); // Get root store directory. Assumptions: // - $(ROOT_STORE_DIR)/root_store.textproto contains the textproto definition // of the root store @@ -156,12 +278,15 @@ command_line.GetSwitchValuePath("root-store-dir"); if ((proto_path.empty() && cpp_path.empty()) || root_store_dir.empty() || - command_line.HasSwitch("help")) { + command_line.HasSwitch("help") || + (!cpp_path.empty() && !ValidCppOutputFormatValue(cpp_output_format))) { + std::cerr << cpp_output_format << " "; std::cerr << "Usage: root_store_tool " << "--root-store-dir=<path> " << "[--write-deps=DEP_FILE] " << "[--write-proto=PROTO_FILE] " - << "[--write-cpp=CPP_FILE]" << std::endl; + << "[--write-cpp=CPP_FILE --cpp-output-format=[ev|root]] " + << std::endl; return 1; } @@ -190,36 +315,16 @@ } if (!cpp_path.empty()) { - // Root store should have at least one trust anchors. - CHECK_GT(root_store->trust_anchors_size(), 0); - - std::string string_to_write = - "// This file is auto-generated, DO NOT EDIT.\n\n" - "const ChromeRootCertInfo kChromeRootCertList[] = {\n"; - - for (auto& anchor : root_store->trust_anchors()) { - // Every trust anchor at this point should have a DER. - CHECK(!anchor.der().empty()); - std::string der = anchor.der(); - - // Begin struct. Assumed type of ChromeRootCertInfo: - // - // struct { - // base::span<const uint8_t> der; - // }; - string_to_write += " {{{"; - - // Convert each character to hex representation, escaped. - for (auto c : der) { - base::StringAppendF(&string_to_write, "0x%02xu,", - static_cast<uint8_t>(c)); - } - - // End struct - string_to_write += "}}},\n"; + bool success; + if (cpp_output_format == "root") { + success = WriteRootCppFile(*root_store, cpp_path); + } else if (cpp_output_format == "ev") { + success = WriteEvCppFile(*root_store, cpp_path); + } else { + // Unknown format. + success = false; } - string_to_write += "};"; - if (!base::WriteFile(cpp_path, string_to_write)) { + if (!success) { PLOG(ERROR) << "Error writing cpp include file"; return 1; }
diff --git a/net/websockets/websocket_channel_test.cc b/net/websockets/websocket_channel_test.cc index 41693d0c..90a1e8f 100644 --- a/net/websockets/websocket_channel_test.cc +++ b/net/websockets/websocket_channel_test.cc
@@ -12,6 +12,7 @@ #include <iostream> #include <iterator> #include <string> +#include <tuple> #include <utility> #include <vector> @@ -19,7 +20,6 @@ #include "base/callback.h" #include "base/callback_helpers.h" #include "base/cxx17_backports.h" -#include "base/ignore_result.h" #include "base/location.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" @@ -805,7 +805,7 @@ connect_data_.argument_saver.connect_delegate->OnSuccess( std::move(stream_), std::make_unique<WebSocketHandshakeResponseInfo>( GURL(), nullptr, IPEndPoint(), base::Time())); - ignore_result(channel_->ReadFrames()); + std::ignore = channel_->ReadFrames(); } // Returns a WebSocketEventInterface to be passed to the WebSocketChannel. @@ -999,7 +999,7 @@ connect_data_.argument_saver.connect_delegate->OnSuccess( std::move(stream_), std::make_unique<WebSocketHandshakeResponseInfo>( GURL(), nullptr, IPEndPoint(), base::Time())); - ignore_result(channel_->ReadFrames()); + std::ignore = channel_->ReadFrames(); } TEST_F(WebSocketChannelEventInterfaceTest, ConnectFailureReported) { @@ -1026,7 +1026,7 @@ std::make_unique<FakeWebSocketStream>("Bob", ""), std::make_unique<WebSocketHandshakeResponseInfo>( GURL(), nullptr, IPEndPoint(), base::Time())); - ignore_result(channel_->ReadFrames()); + std::ignore = channel_->ReadFrames(); } TEST_F(WebSocketChannelEventInterfaceTest, ExtensionsPassed) { @@ -1039,7 +1039,7 @@ std::make_unique<FakeWebSocketStream>("", "extension1, extension2"), std::make_unique<WebSocketHandshakeResponseInfo>( GURL(), nullptr, IPEndPoint(), base::Time())); - ignore_result(channel_->ReadFrames()); + std::ignore = channel_->ReadFrames(); } // The first frames from the server can arrive together with the handshake, in @@ -2696,7 +2696,7 @@ connect_data_.argument_saver.connect_delegate->OnSuccess( std::move(stream_), std::make_unique<WebSocketHandshakeResponseInfo>( GURL(), nullptr, IPEndPoint(), base::Time())); - ignore_result(channel_->ReadFrames()); + std::ignore = channel_->ReadFrames(); } };
diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc index 2f53b8f..8021eea 100644 --- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc +++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
@@ -24,9 +24,10 @@ #include <time.h> #include <unistd.h> +#include <tuple> + #include "base/clang_profiling_buildflags.h" #include "base/files/scoped_file.h" -#include "base/ignore_result.h" #include "base/posix/eintr_wrapper.h" #include "base/threading/thread.h" #include "build/build_config.h" @@ -252,7 +253,7 @@ DEATH_SEGV_MESSAGE(GetErrorMessageContentForTests()), BaselinePolicy) { int sv[2]; - ignore_result(socketpair(AF_INET, SOCK_STREAM, 0, sv)); + std::ignore = socketpair(AF_INET, SOCK_STREAM, 0, sv); _exit(1); } #endif // defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
diff --git a/sandbox/linux/suid/client/setuid_sandbox_host_unittest.cc b/sandbox/linux/suid/client/setuid_sandbox_host_unittest.cc index c33a1ed9..728a232 100644 --- a/sandbox/linux/suid/client/setuid_sandbox_host_unittest.cc +++ b/sandbox/linux/suid/client/setuid_sandbox_host_unittest.cc
@@ -6,9 +6,9 @@ #include <memory> #include <string> +#include <tuple> #include "base/environment.h" -#include "base/ignore_result.h" #include "base/strings/string_number_conversions.h" #include "sandbox/linux/suid/common/sandbox.h" #include "testing/gtest/include/gtest/gtest.h" @@ -66,7 +66,7 @@ TEST(SetuidSandboxHost, GetSandboxBinaryPath) { std::unique_ptr<SetuidSandboxHost> setuid_sandbox_host( SetuidSandboxHost::Create()); - ignore_result(setuid_sandbox_host->GetSandboxBinaryPath()); + std::ignore = setuid_sandbox_host->GetSandboxBinaryPath(); } } // namespace sandbox
diff --git a/sandbox/linux/syscall_broker/remote_syscall_arg_handler_unittest.cc b/sandbox/linux/syscall_broker/remote_syscall_arg_handler_unittest.cc index 2e7f360..2c9492c 100644 --- a/sandbox/linux/syscall_broker/remote_syscall_arg_handler_unittest.cc +++ b/sandbox/linux/syscall_broker/remote_syscall_arg_handler_unittest.cc
@@ -6,13 +6,14 @@ #include <sys/mman.h> #include <sys/types.h> + #include <algorithm> #include <cstring> +#include <tuple> #include "base/bind.h" #include "base/callback_helpers.h" #include "base/files/scoped_file.h" -#include "base/ignore_result.h" #include "base/memory/page_size.h" #include "base/posix/unix_domain_socket.h" #include "base/test/bind.h" @@ -76,7 +77,7 @@ if (parent_sync_fd) *parent_sync_fd = std::move(parent_sync); else - ignore_result(parent_sync.release()); // Closes when parent dies. + std::ignore = parent_sync.release(); // Closes when parent dies. return pid; }
diff --git a/sandbox/linux/tests/unit_tests.cc b/sandbox/linux/tests/unit_tests.cc index ff502a9..35ff4ea3 100644 --- a/sandbox/linux/tests/unit_tests.cc +++ b/sandbox/linux/tests/unit_tests.cc
@@ -15,9 +15,10 @@ #include <time.h> #include <unistd.h> +#include <tuple> + #include "base/debug/leak_annotations.h" #include "base/files/file_util.h" -#include "base/ignore_result.h" #include "base/posix/eintr_wrapper.h" #include "build/build_config.h" #include "sandbox/linux/tests/unit_tests.h" @@ -85,7 +86,7 @@ const char failure_message[] = "Timeout reached!\n"; // Make sure that we never block here. if (!fcntl(2, F_SETFL, O_NONBLOCK)) { - ignore_result(write(2, failure_message, sizeof(failure_message) - 1)); + std::ignore = write(2, failure_message, sizeof(failure_message) - 1); } _exit(kExitForTimeout); }
diff --git a/sandbox/policy/linux/sandbox_debug_handling_linux.cc b/sandbox/policy/linux/sandbox_debug_handling_linux.cc index a1fcded8..e854ef6 100644 --- a/sandbox/policy/linux/sandbox_debug_handling_linux.cc +++ b/sandbox/policy/linux/sandbox_debug_handling_linux.cc
@@ -10,8 +10,9 @@ #include <sys/prctl.h> #include <unistd.h> +#include <tuple> + #include "base/command_line.h" -#include "base/ignore_result.h" #include "base/logging.h" #include "base/strings/safe_sprintf.h" #include "sandbox/policy/switches.h" @@ -24,7 +25,7 @@ void DoChrootSignalHandler(int) { const int old_errno = errno; const char kFirstMessage[] = "Chroot signal handler called.\n"; - ignore_result(write(STDERR_FILENO, kFirstMessage, sizeof(kFirstMessage) - 1)); + std::ignore = write(STDERR_FILENO, kFirstMessage, sizeof(kFirstMessage) - 1); const int chroot_ret = chroot("/"); @@ -33,7 +34,7 @@ kSecondMessage, "chroot() returned %d. Errno is %d.\n", chroot_ret, errno); if (printed > 0 && printed < static_cast<ssize_t>(sizeof(kSecondMessage))) { - ignore_result(write(STDERR_FILENO, kSecondMessage, printed)); + std::ignore = write(STDERR_FILENO, kSecondMessage, printed); } errno = old_errno; }
diff --git a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom index 83e7682..a9a0e5a 100644 --- a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom +++ b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
@@ -152,12 +152,6 @@ // reachable from the root surface. RequestCopyOfOutput(SurfaceId surface_id, CopyOutputRequest request); - // Marks a region as having been recently async queried. This is used by the - // HitTestAggregator to highlight queried regions if hit-test debugging is - // enabled. - SetHitTestAsyncQueriedDebugRegions( - FrameSinkId root_frame_sink_id, - array<FrameSinkId> hit_test_async_queried_debug_queue); // Caches the back buffer for the |root_frame_sink_id|. The back buffer is // keyed using |cache_id| and evicted when EvictBackBuffer with the same id is
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 9fc4bf4..2d8285c 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -2088,24 +2088,6 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "content_nocompile_tests", - "test_id_prefix": "ninja://content/test:content_nocompile_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "arm64", - "os": "Mac-12" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, "test": "content_unittests", "test_id_prefix": "ninja://content/test:content_unittests/" }, @@ -2665,24 +2647,6 @@ ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, - "test": "openscreen_unittests", - "test_id_prefix": "ninja://chrome/browser/media/router:openscreen_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "arm64", - "os": "Mac-12" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, "test": "pdf_unittests", "test_id_prefix": "ninja://pdf:pdf_unittests/" },
diff --git a/testing/buildbot/filters/fuchsia.components_unittests.filter b/testing/buildbot/filters/fuchsia.components_unittests.filter index 91efe36..ae34c24a 100644 --- a/testing/buildbot/filters/fuchsia.components_unittests.filter +++ b/testing/buildbot/filters/fuchsia.components_unittests.filter
@@ -1,4 +1,3 @@ --All/UserAgentUtilsTest.UserAgentStringOrdering* -BaseFileTest.Duplicate* -BaseFileTest.ExistingBaseFileKnownHash -BaseFileTest.ExistingBaseFileUnknownHashToo*
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index cc4d1a2..f343eba 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -2590,7 +2590,7 @@ 'all', ], 'test_suites': { - 'gtest_tests': 'chromium_mac_gtests_no_nacl', + 'gtest_tests': 'chromium_mac_gtests_no_nacl_no_nocompile', 'isolated_scripts': 'chromium_mac_rel_isolated_scripts', } },
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index b063a85..1f1c47b0 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -166,6 +166,23 @@ ] } ], + "AndroidDynamicPerformanceFramework": [ + { + "platforms": [ + "android", + "android_weblayer" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "Adpf" + ], + "min_os_version": "12.0.0" + } + ] + } + ], "AndroidDynamicWideColorGamut": [ { "platforms": [ @@ -5292,6 +5309,27 @@ ] } ], + "NavigationRequestPreconnect": [ + { + "platforms": [ + "android", + "android_weblayer", + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "NavigationRequestPreconnect" + ] + } + ] + } + ], "NavigationThreadingOptimizations": [ { "platforms": [
diff --git a/third_party/blink/perf_tests/css/ChangeStyleChildClassSelector.html b/third_party/blink/perf_tests/css/ChangeStyleChildClassSelector.html index 93f52d3..79723de 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleChildClassSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStyleChildClassSelector.html
@@ -19,7 +19,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of a child class selector.", run: function() { - var rule = applyCSSRule(".a > .b { color: red; }"); + var rule = applyCSSRule(".a > .b { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body);
diff --git a/third_party/blink/perf_tests/css/ChangeStyleChildElementSelectors.html b/third_party/blink/perf_tests/css/ChangeStyleChildElementSelectors.html index 75cac36..fcaafa73 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleChildElementSelectors.html +++ b/third_party/blink/perf_tests/css/ChangeStyleChildElementSelectors.html
@@ -11,7 +11,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of applying a style on the div child of a div.", run: function() { - var rule = applyCSSRule("div div { color: red; }"); + var rule = applyCSSRule("div div { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body); @@ -24,4 +24,4 @@ ] }); </script> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/perf_tests/css/ChangeStyleCustomPropertyDeclaration.html b/third_party/blink/perf_tests/css/ChangeStyleCustomPropertyDeclaration.html index 9ebbab1..215e4cc 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleCustomPropertyDeclaration.html +++ b/third_party/blink/perf_tests/css/ChangeStyleCustomPropertyDeclaration.html
@@ -5,15 +5,15 @@ <script src="resources/utils.js"></script> </head> <style> - .green { --prop: green; } - .red { --prop: red; } + .crosshair { --prop: crosshair; } + .default { --prop: default; } body > div > div { background-color: grey; } </style> <body> <script> function createDOMTree() { let div = document.createElement('div'); - div.innerHTML = '<div><div><div><div><div style="color: var(--prop)">' + '' + '</div></div></div></div></div>'; + div.innerHTML = '<div><div><div><div><div style="cursor: var(--prop)">' + '' + '</div></div></div></div></div>'; for (let i = 0; i < 10000; i++) { document.body.appendChild(div.cloneNode(true)); } @@ -24,7 +24,7 @@ description: "Measures the performance in the propagation of a custom property declaration.", setup: () => { document.body.classList.remove(theme); - theme = theme == 'green' ? 'red' : 'green'; + theme = theme == 'crosshair' ? 'default' : 'crosshair'; }, run: function() { document.body.classList.add(theme);
diff --git a/third_party/blink/perf_tests/css/ChangeStyleElementSelector.html b/third_party/blink/perf_tests/css/ChangeStyleElementSelector.html index 45d094d8..f6b97622 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleElementSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStyleElementSelector.html
@@ -11,7 +11,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of applying a style on all divs.", run: function() { - var rule = applyCSSRule("div { color: red; }"); + var rule = applyCSSRule("div { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body); @@ -24,4 +24,4 @@ ] }); </script> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/perf_tests/css/ChangeStyleGrandChildElementSelector.html b/third_party/blink/perf_tests/css/ChangeStyleGrandChildElementSelector.html index 724c4a13..8462739 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleGrandChildElementSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStyleGrandChildElementSelector.html
@@ -11,7 +11,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of applying a style on the div grandchild of a div.", run: function() { - var rule = applyCSSRule("div div div { color: red; }"); + var rule = applyCSSRule("div div div { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body); @@ -24,4 +24,4 @@ ] }); </script> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/perf_tests/css/ChangeStyleMultipleClassSelector.html b/third_party/blink/perf_tests/css/ChangeStyleMultipleClassSelector.html index b19776dd..2674396 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleMultipleClassSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStyleMultipleClassSelector.html
@@ -15,7 +15,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of multiple class selectors.", run: function() { - var rule = applyCSSRule(".a .b { color: red; }"); + var rule = applyCSSRule(".a .b { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body);
diff --git a/third_party/blink/perf_tests/css/ChangeStyleMultipleQualifiedDataAttributesWithValuesSelector.html b/third_party/blink/perf_tests/css/ChangeStyleMultipleQualifiedDataAttributesWithValuesSelector.html index 606ec54..f950153 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleMultipleQualifiedDataAttributesWithValuesSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStyleMultipleQualifiedDataAttributesWithValuesSelector.html
@@ -19,7 +19,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of an qualified data attribute selector with a value.", run: function() { - var rule = applyCSSRule("div[data-a=\"foo\"] div[data-b=\"bar\"] { color: red; }"); + var rule = applyCSSRule("div[data-a=\"foo\"] div[data-b=\"bar\"] { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body);
diff --git a/third_party/blink/perf_tests/css/ChangeStylePairOfNthChildSelector.html b/third_party/blink/perf_tests/css/ChangeStylePairOfNthChildSelector.html index 8f5bcdf2..b4a7602 100644 --- a/third_party/blink/perf_tests/css/ChangeStylePairOfNthChildSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStylePairOfNthChildSelector.html
@@ -11,7 +11,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of a pair of nth-child selectors.", run: function() { - var rule = applyCSSRule("div:nth-child(1) div:nth-child(1) div { color: red; }"); + var rule = applyCSSRule("div:nth-child(1) div:nth-child(1) div { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body); @@ -24,4 +24,4 @@ ] }); </script> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/perf_tests/css/ChangeStylePartialAttributeMatchingSelector.html b/third_party/blink/perf_tests/css/ChangeStylePartialAttributeMatchingSelector.html index c90816e..fefc68d 100644 --- a/third_party/blink/perf_tests/css/ChangeStylePartialAttributeMatchingSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStylePartialAttributeMatchingSelector.html
@@ -15,7 +15,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of partial attribute matching.", run: function() { - var rule = applyCSSRule("[class^='wrap'] { color: red; }"); + var rule = applyCSSRule("[class^='wrap'] { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body); @@ -28,4 +28,4 @@ ] }); </script> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/perf_tests/css/ChangeStyleQualifiedDataAttributeSelector.html b/third_party/blink/perf_tests/css/ChangeStyleQualifiedDataAttributeSelector.html index bfedd59..21b112362 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleQualifiedDataAttributeSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStyleQualifiedDataAttributeSelector.html
@@ -16,7 +16,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of a qualified data attribute selector.", run: function() { - var rule = applyCSSRule("div[data-test] { color: red; }"); + var rule = applyCSSRule("div[data-test] { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body);
diff --git a/third_party/blink/perf_tests/css/ChangeStyleQualifiedDataAttributeWithValueSelector.html b/third_party/blink/perf_tests/css/ChangeStyleQualifiedDataAttributeWithValueSelector.html index 52cf995..8521b0a1 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleQualifiedDataAttributeWithValueSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStyleQualifiedDataAttributeWithValueSelector.html
@@ -16,7 +16,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of an qualified data attribute selector with a value.", run: function() { - var rule = applyCSSRule("div[data-test=\"foo\"] { color: red; }"); + var rule = applyCSSRule("div[data-test=\"foo\"] { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body);
diff --git a/third_party/blink/perf_tests/css/ChangeStyleSingleClassSelector.html b/third_party/blink/perf_tests/css/ChangeStyleSingleClassSelector.html index 91ad558..1fb2d55 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleSingleClassSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStyleSingleClassSelector.html
@@ -15,7 +15,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of a single class selector with inherited property.", run: function() { - var rule = applyCSSRule(".test { color: red; }"); + var rule = applyCSSRule(".test { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body);
diff --git a/third_party/blink/perf_tests/css/ChangeStyleSingleNthChildSelector.html b/third_party/blink/perf_tests/css/ChangeStyleSingleNthChildSelector.html index d2ba23d..c03f733 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleSingleNthChildSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStyleSingleNthChildSelector.html
@@ -11,7 +11,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of a nth-child selector.", run: function() { - var rule = applyCSSRule("div:nth-child(1) div { color: red; }"); + var rule = applyCSSRule("div:nth-child(1) div { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body); @@ -24,4 +24,4 @@ ] }); </script> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/perf_tests/css/ChangeStyleUniversalSelector.html b/third_party/blink/perf_tests/css/ChangeStyleUniversalSelector.html index 95be1d7..4f02a30 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleUniversalSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStyleUniversalSelector.html
@@ -11,7 +11,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of the universal selector.", run: function() { - var rule = applyCSSRule("* { color: red; }"); + var rule = applyCSSRule("* { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body); @@ -24,4 +24,4 @@ ] }); </script> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/perf_tests/css/ChangeStyleUnqualifiedDataAttributeSelector.html b/third_party/blink/perf_tests/css/ChangeStyleUnqualifiedDataAttributeSelector.html index 208302c..11cbbee2 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleUnqualifiedDataAttributeSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStyleUnqualifiedDataAttributeSelector.html
@@ -16,7 +16,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of an unqualified data attribute selector.", run: function() { - var rule = applyCSSRule("[data-test] { color: red; }"); + var rule = applyCSSRule("[data-test] { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body);
diff --git a/third_party/blink/perf_tests/css/ChangeStyleUnqualifiedDataAttributeWithValueSelector.html b/third_party/blink/perf_tests/css/ChangeStyleUnqualifiedDataAttributeWithValueSelector.html index 79297e86..fb10ffb 100644 --- a/third_party/blink/perf_tests/css/ChangeStyleUnqualifiedDataAttributeWithValueSelector.html +++ b/third_party/blink/perf_tests/css/ChangeStyleUnqualifiedDataAttributeWithValueSelector.html
@@ -16,7 +16,7 @@ PerfTestRunner.measureTime({ description: "Measures the performance of an unqualified data attribute selector with a value.", run: function() { - var rule = applyCSSRule("[data-test=\"foo\"] { color: red; }"); + var rule = applyCSSRule("[data-test=\"foo\"] { cursor: crosshair; }"); forceStyleRecalc(document.body); rule.remove(); forceStyleRecalc(document.body);
diff --git a/third_party/blink/perf_tests/css/CustomPropertiesNonRootInheritance.html b/third_party/blink/perf_tests/css/CustomPropertiesNonRootInheritance.html index 20586e7..3f6dc40 100644 --- a/third_party/blink/perf_tests/css/CustomPropertiesNonRootInheritance.html +++ b/third_party/blink/perf_tests/css/CustomPropertiesNonRootInheritance.html
@@ -10,7 +10,7 @@ <script> for (let i = 0; i < 5000; i++) { let div = document.createElement('div'); - div.style = 'color: red'; // Avoid matched properties cache. + div.style = 'cursor: crosshair'; // Avoid matched properties cache. document.body.appendChild(div); }
diff --git a/third_party/blink/perf_tests/css/CustomPropertiesRootInheritance.html b/third_party/blink/perf_tests/css/CustomPropertiesRootInheritance.html index 48945d6..63eb6bd 100644 --- a/third_party/blink/perf_tests/css/CustomPropertiesRootInheritance.html +++ b/third_party/blink/perf_tests/css/CustomPropertiesRootInheritance.html
@@ -10,7 +10,7 @@ <script> for (let i = 0; i < 5000; i++) { let div = document.createElement('div'); - div.style = 'color: red'; // Avoid matched properties cache. + div.style = 'cursor: crosshair'; // Avoid matched properties cache. document.body.appendChild(div); }
diff --git a/third_party/blink/perf_tests/css/FocusUpdate.html b/third_party/blink/perf_tests/css/FocusUpdate.html index 30b0e43..69b40c9 100644 --- a/third_party/blink/perf_tests/css/FocusUpdate.html +++ b/third_party/blink/perf_tests/css/FocusUpdate.html
@@ -1,12 +1,12 @@ <!DOCTYPE html> <html> <head> - <title>Measure :focus update for a simple color change</title> + <title>Measure :focus update for a simple cursor change</title> <script src="../resources/runner.js"></script> <style type="text/css"> body { margin: 0 } - a { color: black; } - a:focus { color: red; } + a { cursor: pointer; } + a:focus { cursor: crosshair; } </style> </head> <body> @@ -27,7 +27,7 @@ var a2 = a1.nextSibling; PerfTestRunner.measureRunsPerSecond({ - description: "Measure :focus update for a simple color change", + description: "Measure :focus update for a simple cursor change", run:function() { a1.focus(); document.body.offsetTop; // Update layout for focused state.
diff --git a/third_party/blink/perf_tests/css/SelectorCountScaling.html b/third_party/blink/perf_tests/css/SelectorCountScaling.html index f5274056..7e45998 100644 --- a/third_party/blink/perf_tests/css/SelectorCountScaling.html +++ b/third_party/blink/perf_tests/css/SelectorCountScaling.html
@@ -18,13 +18,13 @@ } function cssStrWithClassSelectors(count) { - var selector = '.a' + count + ' .b' + count + ' { color: red } '; + var selector = '.a' + count + ' .b' + count + ' { cursor: crosshair } '; // Intentionally repeat the same classes many times, to test duplicate optimizations. return selector + selector + selector + selector + selector + selector + selector; } function cssStrWithAttributeSelectors(count) { - var selector = '[attrA' + count + '="1"]' + ' [attrB' + count + '="1"]' + ' { color: red } '; + var selector = '[attrA' + count + '="1"]' + ' [attrB' + count + '="1"]' + ' { cursor: crosshair } '; // Intentionally repeat the same classes many times, to test duplicate optimizations. return selector + selector + selector + selector + selector + selector + selector; }
diff --git a/third_party/blink/public/mojom/web_feature/web_feature.mojom b/third_party/blink/public/mojom/web_feature/web_feature.mojom index 494ff2f..6ab29c0 100644 --- a/third_party/blink/public/mojom/web_feature/web_feature.mojom +++ b/third_party/blink/public/mojom/web_feature/web_feature.mojom
@@ -3412,6 +3412,7 @@ kSecureContextIncorrectForWorker = 4103, kV8UDPSocket_Close_Method = 4104, kHTMLInputElementSimulatedClick = 4105, + kRTCLocalSdpModificationIceUfragPwd = 4106, // Add new features immediately above this line. Don't change assigned
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5 index 034f1f62..4736050 100644 --- a/third_party/blink/renderer/core/css/css_properties.json5 +++ b/third_party/blink/renderer/core/css/css_properties.json5
@@ -753,15 +753,6 @@ property_methods: ["ParseSingleValue", "CSSValueFromComputedStyleInternal", "ColorIncludingFallback"], interpolable: true, inherited: true, - // color isn't strictly independent of all other properties; - // it determines currentColor, which in turn can affect the used value of - // other properties (such as border colors, stops in gradients, etc.). - // However, changes to color generally also trigger paint invalidation, - // and paint invalidation resolves the color anew. (For the special case - // of gradient stops, we have logic within ComputedStyle::AdjustDiffForBackgroundVisuallyEqual - // that forces paint invalidation, recomputing the gradient and repainting - // the element.) - independent: true, field_group: "inherited", field_template: "external", include_paths: ["third_party/blink/renderer/core/css/style_color.h"], @@ -2987,7 +2978,7 @@ keywords: [ "normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", - "exclusion", "hue", "saturation", "color", "luminosity" + "exclusion", "hue", "saturation", "color", "luminosity", "plus-lighter" ], typedom_types: ["Keyword"], default_value: "normal",
diff --git a/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc b/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc index de75bf1..5801748b 100644 --- a/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc +++ b/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc
@@ -843,7 +843,9 @@ value_id == CSSValueID::kHue || value_id == CSSValueID::kSaturation || value_id == CSSValueID::kColor || - value_id == CSSValueID::kLuminosity; + value_id == CSSValueID::kLuminosity || + (RuntimeEnabledFeatures::CSSMixBlendModePlusLighterEnabled() && + value_id == CSSValueID::kPlusLighter); case CSSPropertyID::kWebkitBoxAlign: return value_id == CSSValueID::kStretch || value_id == CSSValueID::kStart || value_id == CSSValueID::kEnd ||
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 7850aab..7c712e6f 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
@@ -1533,7 +1533,6 @@ void Color::ApplyInitial(StyleResolverState& state) const { state.Style()->SetColor(state.Style()->InitialColorForColorScheme()); - state.Style()->SetColorIsInherited(false); } void Color::ApplyInherit(StyleResolverState& state) const { @@ -1544,7 +1543,6 @@ } else { style->SetColor(state.ParentStyle()->GetColor()); } - style->SetColorIsInherited(true); } void Color::ApplyValue(StyleResolverState& state, const CSSValue& value) const { @@ -1558,11 +1556,10 @@ if (value.IsInitialColorValue()) { DCHECK_EQ(state.GetElement(), state.GetDocument().documentElement()); state.Style()->SetColor(state.Style()->InitialColorForColorScheme()); - } else { - state.Style()->SetColor( - StyleBuilderConverter::ConvertStyleColor(state, value)); + return; } - state.Style()->SetColorIsInherited(false); + state.Style()->SetColor( + StyleBuilderConverter::ConvertStyleColor(state, value)); } const CSSValue* ColorInterpolation::CSSValueFromComputedStyleInternal(
diff --git a/third_party/blink/renderer/core/dom/element_data.h b/third_party/blink/renderer/core/dom/element_data.h index b8b48259..937c4fa 100644 --- a/third_party/blink/renderer/core/dom/element_data.h +++ b/third_party/blink/renderer/core/dom/element_data.h
@@ -58,7 +58,10 @@ void ClearClass() const { class_names_.Clear(); } void SetClass(const AtomicString& class_name, bool should_fold_case) const { - class_names_.Set(should_fold_case ? class_name.LowerASCII() : class_name); + AtomicString lower_class_name; + if (should_fold_case && !class_name.IsLowerASCII()) + lower_class_name = class_name.LowerASCII(); + class_names_.Set(lower_class_name ? lower_class_name : class_name); } const SpaceSplitString& ClassNames() const { return class_names_; }
diff --git a/third_party/blink/renderer/core/dom/space_split_string.cc b/third_party/blink/renderer/core/dom/space_split_string.cc index c5fa9c74..94cb5fb 100644 --- a/third_party/blink/renderer/core/dom/space_split_string.cc +++ b/third_party/blink/renderer/core/dom/space_split_string.cc
@@ -36,7 +36,7 @@ const CharacterType* characters, unsigned length) { DCHECK_EQ(0u, vector_.size()); - HashSet<AtomicString> token_set; + HashSet<StringImpl*> token_set; unsigned start = 0; while (true) { while (start < length && IsHTMLSpace<CharacterType>(characters[start])) @@ -57,15 +57,15 @@ // cost of HashSet<>::insert(), and adjust |token_set| when the second // unique token is found. if (vector_.size() == 0) { - vector_.push_back(token); + vector_.push_back(std::move(token)); } else if (vector_.size() == 1) { if (vector_[0] != token) { - token_set.insert(vector_[0]); - token_set.insert(token); - vector_.push_back(token); + token_set.insert(vector_[0].Impl()); + token_set.insert(token.Impl()); + vector_.push_back(std::move(token)); } - } else if (token_set.insert(token).is_new_entry) { - vector_.push_back(token); + } else if (token_set.insert(token.Impl()).is_new_entry) { + vector_.push_back(std::move(token)); } start = end + 1; @@ -183,12 +183,13 @@ SpaceSplitString::Data::~Data() { if (!key_string_.IsNull()) - SharedDataMap().erase(key_string_); + SharedDataMap().erase(key_string_.Impl()); } scoped_refptr<SpaceSplitString::Data> SpaceSplitString::Data::Create( const AtomicString& string) { - Data*& data = SharedDataMap().insert(string, nullptr).stored_value->value; + Data*& data = + SharedDataMap().insert(string.Impl(), nullptr).stored_value->value; if (!data) { data = new Data(string); return base::AdoptRef(data);
diff --git a/third_party/blink/renderer/core/dom/space_split_string.h b/third_party/blink/renderer/core/dom/space_split_string.h index bb6723f8..e769e246 100644 --- a/third_party/blink/renderer/core/dom/space_split_string.h +++ b/third_party/blink/renderer/core/dom/space_split_string.h
@@ -101,7 +101,10 @@ AtomicString key_string_; Vector<AtomicString, 4> vector_; }; - typedef HashMap<AtomicString, Data*> DataMap; + + // We can use a non-ref-counted StringImpl* as the key because the associated + // Data object will keep it alive via the key_string_ member. + typedef HashMap<StringImpl*, Data*> DataMap; static DataMap& SharedDataMap();
diff --git a/third_party/blink/renderer/core/inspector/inspector_overlay_agent.cc b/third_party/blink/renderer/core/inspector/inspector_overlay_agent.cc index 04e49b8..c09bc8a 100644 --- a/third_party/blink/renderer/core/inspector/inspector_overlay_agent.cc +++ b/third_party/blink/renderer/core/inspector/inspector_overlay_agent.cc
@@ -561,16 +561,7 @@ } Response InspectorOverlayAgent::setShowHitTestBorders(bool show) { - show_hit_test_borders_.Set(show); - if (show) { - Response response = CompositingEnabled(); - if (!response.IsSuccess()) - return response; - } - FrameWidget* widget = GetFrame()->GetWidgetForLocalRoot(); - cc::LayerTreeDebugState debug_state = widget->GetLayerTreeDebugState(); - debug_state.show_hit_test_borders = show; - widget->SetLayerTreeDebugState(debug_state); + // This CDP command has been deprecated. Don't do anything and return success. return Response::Success(); }
diff --git a/third_party/blink/renderer/core/page/validation_message_client_impl.cc b/third_party/blink/renderer/core/page/validation_message_client_impl.cc index 3ba5ba3..276826f1 100644 --- a/third_party/blink/renderer/core/page/validation_message_client_impl.cc +++ b/third_party/blink/renderer/core/page/validation_message_client_impl.cc
@@ -41,6 +41,12 @@ namespace blink { +namespace { +// The max length of 256 is also used by other browsers: +// https://bugs.chromium.org/p/chromium/issues/detail?id=1261191#c17 +constexpr int kMaxValidationStringLength = 256; +} // namespace + ValidationMessageClientImpl::ValidationMessageClientImpl(Page& page) : page_(&page), current_anchor_(nullptr) {} @@ -52,16 +58,26 @@ void ValidationMessageClientImpl::ShowValidationMessage( const Element& anchor, - const String& message, + const String& original_message, TextDirection message_dir, const String& sub_message, TextDirection sub_message_dir) { - if (message.IsEmpty()) { + if (original_message.IsEmpty()) { HideValidationMessage(anchor); return; } if (!anchor.GetLayoutObject()) return; + + // If this frame is cross origin to the main frame, then shorten the + // validation message to prevent validation popups that cover too much of the + // main frame. + String message = original_message; + if (original_message.length() > kMaxValidationStringLength && + anchor.GetDocument().GetFrame()->IsCrossOriginToMainFrame()) { + message = original_message.Substring(0, kMaxValidationStringLength) + "..."; + } + if (current_anchor_) HideValidationMessageImmediately(*current_anchor_); current_anchor_ = &anchor;
diff --git a/third_party/blink/renderer/core/paint/block_painter_test.cc b/third_party/blink/renderer/core/paint/block_painter_test.cc index f7df2f8..555364337 100644 --- a/third_party/blink/renderer/core/paint/block_painter_test.cc +++ b/third_party/blink/renderer/core/paint/block_painter_test.cc
@@ -277,8 +277,6 @@ <div id='wheelevent'></div> )HTML"); - auto* wheelevent_element = GetElementById("wheelevent"); - auto* wheelevent = wheelevent_element->GetLayoutObject(); EXPECT_THAT(ContentDisplayItems(), ElementsAre(VIEW_SCROLLING_BACKGROUND_DISPLAY_ITEM)); @@ -290,15 +288,13 @@ EXPECT_THAT(ContentDisplayItems(), ElementsAre(VIEW_SCROLLING_BACKGROUND_DISPLAY_ITEM)); - PaintChunk::Id hit_test_chunk_id(wheelevent->EnclosingLayer()->Id(), - kNonScrollingBackgroundChunkType); HitTestData hit_test_data; hit_test_data.wheel_event_rects = {{gfx::Rect(0, 0, 100, 100)}}; EXPECT_THAT(ContentPaintChunks(), ElementsAre(VIEW_SCROLLING_BACKGROUND_CHUNK(1, &hit_test_data))); - wheelevent_element->RemoveAllEventListeners(); + GetElementById("wheelevent")->RemoveAllEventListeners(); UpdateAllLifecyclePhasesForTest(); EXPECT_THAT(ContentDisplayItems(), ElementsAre(VIEW_SCROLLING_BACKGROUND_DISPLAY_ITEM)); @@ -529,7 +525,7 @@ ElementsAre(VIEW_SCROLLING_BACKGROUND_DISPLAY_ITEM)); PaintChunk::Id hit_test_chunk_id(touchaction->EnclosingLayer()->Id(), - kNonScrollingBackgroundChunkType); + kHitTestChunkType); HitTestData hit_test_data; hit_test_data.touch_action_rects = {{gfx::Rect(0, 0, 100, 100)}}; @@ -670,8 +666,7 @@ ElementsAre( VIEW_SCROLLING_BACKGROUND_CHUNK_COMMON, IsPaintChunk( - 1, 1, - PaintChunk::Id(scroller->Layer()->Id(), DisplayItem::kLayerChunk), + 1, 1, PaintChunk::Id(scroller->Id(), kBackgroundChunkType), scroller->FirstFragment().LocalBorderBoxProperties(), &scroller_touch_action_hit_test_data, gfx::Rect(0, 0, 100, 100)), IsPaintChunk(
diff --git a/third_party/blink/renderer/core/paint/box_painter_test.cc b/third_party/blink/renderer/core/paint/box_painter_test.cc index 5cbfe2b..404fa8b 100644 --- a/third_party/blink/renderer/core/paint/box_painter_test.cc +++ b/third_party/blink/renderer/core/paint/box_painter_test.cc
@@ -209,10 +209,9 @@ paint_chunks, ElementsAre( VIEW_SCROLLING_BACKGROUND_CHUNK_COMMON, - IsPaintChunk( - 1, 2, - PaintChunk::Id(container.Layer()->Id(), DisplayItem::kLayerChunk), - container.FirstFragment().LocalBorderBoxProperties()), + IsPaintChunk(1, 2, + PaintChunk::Id(container.Id(), kBackgroundChunkType), + container.FirstFragment().LocalBorderBoxProperties()), IsPaintChunk( 2, 2, PaintChunk::Id(container.Id(), DisplayItem::kScrollHitTest), container.FirstFragment().LocalBorderBoxProperties(),
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter_test.cc b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter_test.cc index 711d533..9206e50 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter_test.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter_test.cc
@@ -81,10 +81,9 @@ ContentPaintChunks(), ElementsAre( VIEW_SCROLLING_BACKGROUND_CHUNK_COMMON, - IsPaintChunk( - 1, 1, - PaintChunk::Id(scroller.Layer()->Id(), DisplayItem::kLayerChunk), - scroller.FirstFragment().LocalBorderBoxProperties()), + IsPaintChunk(1, 1, + PaintChunk::Id(scroller.Id(), kBackgroundChunkType), + scroller.FirstFragment().LocalBorderBoxProperties()), IsPaintChunk( 1, 1, PaintChunk::Id(root_fragment.Id(), DisplayItem::kScrollHitTest),
diff --git a/third_party/blink/renderer/core/paint/paint_controller_paint_test.cc b/third_party/blink/renderer/core/paint/paint_controller_paint_test.cc index 9d9a466..7e71d18 100644 --- a/third_party/blink/renderer/core/paint/paint_controller_paint_test.cc +++ b/third_party/blink/renderer/core/paint/paint_controller_paint_test.cc
@@ -16,6 +16,7 @@ #include "third_party/blink/renderer/platform/graphics/paint/drawing_display_item.h" #include "third_party/blink/renderer/platform/graphics/paint/drawing_recorder.h" +using testing::_; using testing::ElementsAre; namespace blink { @@ -319,11 +320,10 @@ ContentPaintChunks(), ElementsAre( VIEW_SCROLLING_BACKGROUND_CHUNK_COMMON, - IsPaintChunk( - 1, 2, - PaintChunk::Id(container.Layer()->Id(), DisplayItem::kLayerChunk), - container.FirstFragment().LocalBorderBoxProperties(), nullptr, - gfx::Rect(0, 0, 200, 200)), + IsPaintChunk(1, 2, + PaintChunk::Id(container.Id(), kBackgroundChunkType), + container.FirstFragment().LocalBorderBoxProperties(), + nullptr, gfx::Rect(0, 0, 200, 200)), IsPaintChunk( 2, 2, PaintChunk::Id(container.Id(), DisplayItem::kScrollHitTest), container.FirstFragment().LocalBorderBoxProperties(), @@ -331,7 +331,9 @@ IsPaintChunk( 2, 4, PaintChunk::Id(container.Id(), kScrollingBackgroundChunkType), - container.FirstFragment().ContentsProperties()))); + container.FirstFragment().ContentsProperties()), + // Hit test chunk for forceDocumentScroll. + IsPaintChunk(4, 4))); } TEST_P(PaintControllerPaintTest, NonStackingScrollHitTestOrder) {
diff --git a/third_party/blink/renderer/core/paint/paint_controller_paint_test.h b/third_party/blink/renderer/core/paint/paint_controller_paint_test.h index fbf986d5..81e9dec 100644 --- a/third_party/blink/renderer/core/paint/paint_controller_paint_test.h +++ b/third_party/blink/renderer/core/paint/paint_controller_paint_test.h
@@ -124,7 +124,9 @@ }; // Shorter names for frequently used display item types in core/ tests. -const DisplayItem::Type kNonScrollingBackgroundChunkType = +const DisplayItem::Type kBackgroundChunkType = + DisplayItem::PaintPhaseToDrawingType(PaintPhase::kBlockBackground); +const DisplayItem::Type kHitTestChunkType = DisplayItem::PaintPhaseToDrawingType(PaintPhase::kSelfBlockBackgroundOnly); const DisplayItem::Type kScrollingBackgroundChunkType = DisplayItem::PaintPhaseToClipType(PaintPhase::kSelfBlockBackgroundOnly);
diff --git a/third_party/blink/renderer/core/paint/paint_layer.cc b/third_party/blink/renderer/core/paint/paint_layer.cc index c53fc1b..4d44b673 100644 --- a/third_party/blink/renderer/core/paint/paint_layer.cc +++ b/third_party/blink/renderer/core/paint/paint_layer.cc
@@ -2364,8 +2364,7 @@ bool PaintLayer::ShouldBeSelfPaintingLayer() const { return GetLayoutObject().LayerTypeRequired() == kNormalPaintLayer || - (scrollable_area_ && scrollable_area_->HasOverlayOverflowControls()) || - ScrollsOverflow(); + (scrollable_area_ && scrollable_area_->HasOverlayOverflowControls()); } void PaintLayer::UpdateSelfPaintingLayer() {
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 f3d51c5..0520ec9 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
@@ -714,9 +714,10 @@ } String BaseRenderingContext2D::globalCompositeOperation() const { - return CompositeOperatorName( - CompositeOperatorFromSkBlendMode(GetState().GlobalComposite()), - BlendModeFromSkBlendMode(GetState().GlobalComposite())); + auto compositing_blend_mode_pair = + CompositeAndBlendOpsFromSkBlendMode(GetState().GlobalComposite()); + return CompositeOperatorName(compositing_blend_mode_pair.first, + compositing_blend_mode_pair.second); } void BaseRenderingContext2D::setGlobalCompositeOperation(
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc index 9789bf06..1ea0690 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc
@@ -498,6 +498,37 @@ return rtc_offer_options; } +bool SdpMismatch(String old_sdp, String new_sdp, String attribute) { + // Look for an attribute that is present in both old and new SDP + // and is modified which is not allowed. + String attribute_with_prefix = "\na=" + attribute + ":"; + const wtf_size_t new_attribute_pos = new_sdp.Find(attribute_with_prefix); + if (new_attribute_pos == kNotFound) { + return true; + } + const wtf_size_t old_attribute_pos = old_sdp.Find(attribute_with_prefix); + if (old_attribute_pos == kNotFound) { + return true; + } + wtf_size_t old_attribute_end = old_sdp.Find("\r\n", old_attribute_pos + 1); + if (old_attribute_end == kNotFound) { + old_attribute_end = old_sdp.Find("\n", old_attribute_pos + 1); + } + wtf_size_t new_attribute_end = new_sdp.Find("\r\n", new_attribute_pos + 1); + if (new_attribute_end == kNotFound) { + new_attribute_end = new_sdp.Find("\n", new_attribute_pos + 1); + } + return old_sdp.Substring(old_attribute_pos, + old_attribute_end - old_attribute_pos) != + new_sdp.Substring(new_attribute_pos, + new_attribute_end - new_attribute_pos); +} + +bool IceUfragPwdMismatch(String old_sdp, String new_sdp) { + return SdpMismatch(old_sdp, new_sdp, "ice-ufrag") || + SdpMismatch(old_sdp, new_sdp, "ice-pwd"); +} + bool FingerprintMismatch(String old_sdp, String new_sdp) { // Check special case of externally generated SDP without fingerprints. // It's impossible to generate a valid fingerprint without createOffer @@ -516,12 +547,12 @@ // line endings ('\r\n' vs, '\n' when looking for the end of the fingerprint). wtf_size_t old_fingerprint_end = old_sdp.Find("\r\n", old_fingerprint_pos + 1); - if (old_fingerprint_end == WTF::kNotFound) { + if (old_fingerprint_end == kNotFound) { old_fingerprint_end = old_sdp.Find("\n", old_fingerprint_pos + 1); } wtf_size_t new_fingerprint_end = new_sdp.Find("\r\n", new_fingerprint_pos + 1); - if (new_fingerprint_end == WTF::kNotFound) { + if (new_fingerprint_end == kNotFound) { new_fingerprint_end = new_sdp.Find("\n", new_fingerprint_pos + 1); } return old_sdp.Substring(old_fingerprint_pos, @@ -1124,6 +1155,10 @@ UseCounter::Count(context, WebFeature::kRTCLocalSdpModificationSimulcast); } + if (IceUfragPwdMismatch(last_offer_, parsed_sdp.sdp())) { + UseCounter::Count(context, + WebFeature::kRTCLocalSdpModificationIceUfragPwd); + } return nullptr; // TODO(https://crbug.com/823036): Return failure for all modification. } @@ -1139,6 +1174,10 @@ UseCounter::Count(context, WebFeature::kRTCLocalSdpModificationSimulcast); } + if (IceUfragPwdMismatch(last_answer_, parsed_sdp.sdp())) { + UseCounter::Count(context, + WebFeature::kRTCLocalSdpModificationIceUfragPwd); + } return nullptr; // TODO(https://crbug.com/823036): Return failure for all modification. }
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_container_test.cc b/third_party/blink/renderer/modules/service_worker/service_worker_container_test.cc index 4a5298d..3a0abc0b 100644 --- a/third_party/blink/renderer/modules/service_worker/service_worker_container_test.cc +++ b/third_party/blink/renderer/modules/service_worker/service_worker_container_test.cc
@@ -45,7 +45,9 @@ // The returned ScriptFunction can outlive the StubScriptFunction, // but it should not be called after the StubScriptFunction dies. v8::Local<v8::Function> GetFunction(ScriptState* script_state) { - return ScriptFunctionImpl::CreateFunction(script_state, *this); + return MakeGarbageCollected<NewScriptFunction>( + script_state, MakeGarbageCollected<ScriptFunctionImpl>(*this)) + ->V8Function(); } size_t CallCount() { return call_count_; } @@ -56,20 +58,11 @@ size_t call_count_; ScriptValue arg_; - class ScriptFunctionImpl : public ScriptFunction { + class ScriptFunctionImpl : public NewScriptFunction::Callable { public: - static v8::Local<v8::Function> CreateFunction(ScriptState* script_state, - StubScriptFunction& owner) { - ScriptFunctionImpl* self = - MakeGarbageCollected<ScriptFunctionImpl>(script_state, owner); - return self->BindToV8Function(); - } + explicit ScriptFunctionImpl(StubScriptFunction& owner) : owner_(owner) {} - ScriptFunctionImpl(ScriptState* script_state, StubScriptFunction& owner) - : ScriptFunction(script_state), owner_(owner) {} - - private: - ScriptValue Call(ScriptValue arg) override { + ScriptValue Call(ScriptState*, ScriptValue arg) override { owner_.arg_ = arg; owner_.call_count_++; return ScriptValue();
diff --git a/third_party/blink/renderer/platform/graphics/graphics_types.cc b/third_party/blink/renderer/platform/graphics/graphics_types.cc index f7e6ed9b..ad3bcd8 100644 --- a/third_party/blink/renderer/platform/graphics/graphics_types.cc +++ b/third_party/blink/renderer/platform/graphics/graphics_types.cc
@@ -32,32 +32,34 @@ namespace blink { -static const char* const kCompositeOperatorNames[] = {"clear", - "copy", - "source-over", - "source-in", - "source-out", - "source-atop", - "destination-over", - "destination-in", - "destination-out", - "destination-atop", - "xor", - "lighter"}; +// TODO(vmpstr): Move these closer to canvas, along with the parsing code. +static const char* const kCanvasCompositeOperatorNames[] = {"clear", + "copy", + "source-over", + "source-in", + "source-out", + "source-atop", + "destination-over", + "destination-in", + "destination-out", + "destination-atop", + "xor", + "lighter"}; -static const char* const kBlendModeNames[] = { +static const char* const kCanvasBlendModeNames[] = { "normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"}; -const int kNumCompositeOperatorNames = base::size(kCompositeOperatorNames); -const int kNumBlendModeNames = base::size(kBlendModeNames); +const int kNumCompositeOperatorNames = + base::size(kCanvasCompositeOperatorNames); +const int kNumBlendModeNames = base::size(kCanvasBlendModeNames); bool ParseCompositeAndBlendMode(const String& s, CompositeOperator& op, BlendMode& blend_op) { for (int i = 0; i < kNumCompositeOperatorNames; i++) { - if (s == kCompositeOperatorNames[i]) { + if (s == kCanvasCompositeOperatorNames[i]) { op = static_cast<CompositeOperator>(i); blend_op = BlendMode::kNormal; return true; @@ -65,7 +67,7 @@ } for (int i = 0; i < kNumBlendModeNames; i++) { - if (s == kBlendModeNames[i]) { + if (s == kCanvasBlendModeNames[i]) { blend_op = static_cast<BlendMode>(i); op = kCompositeSourceOver; return true; @@ -80,8 +82,8 @@ DCHECK_LT(op, kNumCompositeOperatorNames); DCHECK_GE(static_cast<unsigned>(blend_op), 0u); if (blend_op != BlendMode::kNormal) - return kBlendModeNames[static_cast<unsigned>(blend_op)]; - return kCompositeOperatorNames[op]; + return kCanvasBlendModeNames[static_cast<unsigned>(blend_op)]; + return kCanvasCompositeOperatorNames[op]; } bool ParseImageEncodingMimeType(const String& mime_type_name,
diff --git a/third_party/blink/renderer/platform/graphics/graphics_types.h b/third_party/blink/renderer/platform/graphics/graphics_types.h index faf8eb34..4b3f0cb 100644 --- a/third_party/blink/renderer/platform/graphics/graphics_types.h +++ b/third_party/blink/renderer/platform/graphics/graphics_types.h
@@ -122,6 +122,10 @@ kSaturation, kColor, kLuminosity, + // The following is only used in CSS mix-blend-mode, and maps to a composite + // operator. Canvas uses the same enum but the kPlusLighter is not a valid + // canvas value. We should consider splitting the enums. + kPlusLighter, }; enum OpacityMode {
diff --git a/third_party/blink/renderer/platform/graphics/skia/skia_utils.cc b/third_party/blink/renderer/platform/graphics/skia/skia_utils.cc index e3db3056..d2ef79e 100644 --- a/third_party/blink/renderer/platform/graphics/skia/skia_utils.cc +++ b/third_party/blink/renderer/platform/graphics/skia/skia_utils.cc
@@ -119,82 +119,109 @@ return SkBlendMode::kColor; case BlendMode::kLuminosity: return SkBlendMode::kLuminosity; + case BlendMode::kPlusLighter: + return SkBlendMode::kPlus; } NOTREACHED(); return SkBlendMode::kSrcOver; } -CompositeOperator CompositeOperatorFromSkBlendMode(SkBlendMode blend_mode) { - switch (blend_mode) { +std::pair<CompositeOperator, BlendMode> CompositeAndBlendOpsFromSkBlendMode( + SkBlendMode sk_blend_mode) { + CompositeOperator composite_op = kCompositeSourceOver; + BlendMode blend_mode = BlendMode::kNormal; + switch (sk_blend_mode) { + // The following are SkBlendMode values that map to CompositeOperators. case SkBlendMode::kClear: - return kCompositeClear; + composite_op = kCompositeClear; + break; case SkBlendMode::kSrc: - return kCompositeCopy; + composite_op = kCompositeCopy; + break; case SkBlendMode::kSrcOver: - return kCompositeSourceOver; - case SkBlendMode::kSrcIn: - return kCompositeSourceIn; - case SkBlendMode::kSrcOut: - return kCompositeSourceOut; - case SkBlendMode::kSrcATop: - return kCompositeSourceAtop; + composite_op = kCompositeSourceOver; + break; case SkBlendMode::kDstOver: - return kCompositeDestinationOver; + composite_op = kCompositeDestinationOver; + break; + case SkBlendMode::kSrcIn: + composite_op = kCompositeSourceIn; + break; case SkBlendMode::kDstIn: - return kCompositeDestinationIn; + composite_op = kCompositeDestinationIn; + break; + case SkBlendMode::kSrcOut: + composite_op = kCompositeSourceOut; + break; case SkBlendMode::kDstOut: - return kCompositeDestinationOut; + composite_op = kCompositeDestinationOut; + break; + case SkBlendMode::kSrcATop: + composite_op = kCompositeSourceAtop; + break; case SkBlendMode::kDstATop: - return kCompositeDestinationAtop; + composite_op = kCompositeDestinationAtop; + break; case SkBlendMode::kXor: - return kCompositeXOR; + composite_op = kCompositeXOR; + break; case SkBlendMode::kPlus: - return kCompositePlusLighter; - default: + composite_op = kCompositePlusLighter; break; - } - return kCompositeSourceOver; -} -BlendMode BlendModeFromSkBlendMode(SkBlendMode blend_mode) { - switch (blend_mode) { - case SkBlendMode::kSrcOver: - return BlendMode::kNormal; - case SkBlendMode::kMultiply: - return BlendMode::kMultiply; + // The following are SkBlendMode values that map to BlendModes. case SkBlendMode::kScreen: - return BlendMode::kScreen; + blend_mode = BlendMode::kScreen; + break; case SkBlendMode::kOverlay: - return BlendMode::kOverlay; + blend_mode = BlendMode::kOverlay; + break; case SkBlendMode::kDarken: - return BlendMode::kDarken; + blend_mode = BlendMode::kDarken; + break; case SkBlendMode::kLighten: - return BlendMode::kLighten; + blend_mode = BlendMode::kLighten; + break; case SkBlendMode::kColorDodge: - return BlendMode::kColorDodge; + blend_mode = BlendMode::kColorDodge; + break; case SkBlendMode::kColorBurn: - return BlendMode::kColorBurn; + blend_mode = BlendMode::kColorBurn; + break; case SkBlendMode::kHardLight: - return BlendMode::kHardLight; + blend_mode = BlendMode::kHardLight; + break; case SkBlendMode::kSoftLight: - return BlendMode::kSoftLight; + blend_mode = BlendMode::kSoftLight; + break; case SkBlendMode::kDifference: - return BlendMode::kDifference; + blend_mode = BlendMode::kDifference; + break; case SkBlendMode::kExclusion: - return BlendMode::kExclusion; + blend_mode = BlendMode::kExclusion; + break; + case SkBlendMode::kMultiply: + blend_mode = BlendMode::kMultiply; + break; case SkBlendMode::kHue: - return BlendMode::kHue; + blend_mode = BlendMode::kHue; + break; case SkBlendMode::kSaturation: - return BlendMode::kSaturation; + blend_mode = BlendMode::kSaturation; + break; case SkBlendMode::kColor: - return BlendMode::kColor; + blend_mode = BlendMode::kColor; + break; case SkBlendMode::kLuminosity: - return BlendMode::kLuminosity; + blend_mode = BlendMode::kLuminosity; + break; + + // We don't handle other SkBlendModes. default: break; } - return BlendMode::kNormal; + return std::make_pair(composite_op, blend_mode); } SkMatrix AffineTransformToSkMatrix(const AffineTransform& source) {
diff --git a/third_party/blink/renderer/platform/graphics/skia/skia_utils.h b/third_party/blink/renderer/platform/graphics/skia/skia_utils.h index 901fe944..1858578 100644 --- a/third_party/blink/renderer/platform/graphics/skia/skia_utils.h +++ b/third_party/blink/renderer/platform/graphics/skia/skia_utils.h
@@ -34,6 +34,8 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_SKIA_SKIA_UTILS_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_SKIA_SKIA_UTILS_H_ +#include <utility> + #include "cc/paint/paint_canvas.h" #include "third_party/blink/renderer/platform/graphics/graphics_types.h" #include "third_party/blink/renderer/platform/graphics/image.h" @@ -70,8 +72,9 @@ WebCoreCompositeToSkiaComposite(CompositeOperator, BlendMode = BlendMode::kNormal); SkBlendMode PLATFORM_EXPORT WebCoreBlendModeToSkBlendMode(BlendMode); -CompositeOperator PLATFORM_EXPORT CompositeOperatorFromSkBlendMode(SkBlendMode); -BlendMode PLATFORM_EXPORT BlendModeFromSkBlendMode(SkBlendMode); + +std::pair<CompositeOperator, BlendMode> PLATFORM_EXPORT +CompositeAndBlendOpsFromSkBlendMode(SkBlendMode sk_blend_mode); // Multiply a color's alpha channel by an additional alpha factor where // alpha is in the range [0, 1].
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index c0cad641..8801e295 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -701,6 +701,10 @@ name: "CSSMediaQueries4", }, { + name: "CSSMixBlendModePlusLighter", + status: "test" + }, + { name: "CSSModules", status: "stable", },
diff --git a/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.cc b/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.cc index 4fb6373..1b26c221 100644 --- a/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.cc +++ b/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.cc
@@ -281,8 +281,7 @@ void SynchronousLayerTreeFrameSink::SubmitCompositorFrame( viz::CompositorFrame frame, - bool hit_test_data_changed, - bool show_hit_test_borders) { + bool hit_test_data_changed) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(sync_client_);
diff --git a/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.h b/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.h index de728f3..32496b8 100644 --- a/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.h +++ b/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.h
@@ -101,8 +101,7 @@ void DetachFromClient() override; void SetLocalSurfaceId(const viz::LocalSurfaceId& local_surface_id) override; void SubmitCompositorFrame(viz::CompositorFrame frame, - bool hit_test_data_changed, - bool show_hit_test_borders) override; + bool hit_test_data_changed) override; void DidNotProduceFrame(const viz::BeginFrameAck& ack, cc::FrameSkippedReason reason) override; void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
diff --git a/third_party/blink/web_tests/FlagExpectations/disable-layout-ng b/third_party/blink/web_tests/FlagExpectations/disable-layout-ng index 7c0e2627..1e95050 100644 --- a/third_party/blink/web_tests/FlagExpectations/disable-layout-ng +++ b/third_party/blink/web_tests/FlagExpectations/disable-layout-ng
@@ -263,8 +263,6 @@ crbug.com/1045599 external/wpt/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-007.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-008.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-009.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-001.tentative.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-002.tentative.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/grid-definition/grid-auto-fill-columns-001.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/grid-definition/grid-auto-fill-rows-001.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/grid-definition/grid-auto-fit-columns-001.html [ Failure ] @@ -407,7 +405,6 @@ ### external/wpt/css/css-position/ crbug.com/591099 external/wpt/css/css-position/position-absolute-center-003.html [ Failure ] crbug.com/591099 external/wpt/css/css-position/position-absolute-center-004.html [ Failure ] -crbug.com/591099 external/wpt/css/css-position/position-absolute-center-005.html [ Failure ] crbug.com/591099 external/wpt/css/css-position/position-absolute-center-006.html [ Failure ] crbug.com/591099 external/wpt/css/css-position/position-absolute-crash-chrome-006.html [ Crash ] crbug.com/591099 external/wpt/css/css-position/position-absolute-dynamic-overflow-002.html [ Failure ] @@ -451,7 +448,6 @@ crbug.com/1108830 external/wpt/css/css-pseudo/marker-word-break.html [ Failure ] crbug.com/1012289 external/wpt/css/css-pseudo/marker-unicode-bidi-default.html [ Failure ] crbug.com/1012289 external/wpt/css/css-pseudo/marker-unicode-bidi-normal.html [ Failure ] -crbug.com/1147859 external/wpt/css/css-pseudo/selection-decoration-p3.html [ Failure ] crbug.com/1136817 external/wpt/css/css-pseudo/target-text-004.html [ Pass ] crbug.com/1136817 external/wpt/css/css-pseudo/target-text-007.html [ Failure ] crbug.com/1035708 wpt_internal/css/css-pseudo/spelling-error-color-001.html [ Failure ] @@ -846,9 +842,7 @@ # Newline painting difference with LayoutNG disabled. crbug.com/591099 external/wpt/forced-colors-mode/forced-colors-mode-14.html [ Failure ] -crbug.com/591099 external/wpt/forced-colors-mode/forced-colors-mode-15.html [ Failure ] crbug.com/591099 virtual/forced-high-contrast-colors/external/wpt/forced-colors-mode/forced-colors-mode-14.html [ Failure ] -crbug.com/591099 virtual/forced-high-contrast-colors/external/wpt/forced-colors-mode/forced-colors-mode-15.html [ Failure ] ### http/tests/credentialmanager/ crbug.com/874695 http/tests/credentialmanager/credentialscontainer-create-with-virtual-authenticator.html [ Failure ] @@ -1570,13 +1564,14 @@ crbug.com/626703 external/wpt/css/CSS2/borders/border-right-color-applies-to-014.xht [ Failure ] crbug.com/626703 external/wpt/css/CSS2/borders/border-right-width-applies-to-014.xht [ Failure ] -# Failures when enabling CompositeAfter +# Failures when enabling CompositeAfterPaint crbug.com/591099 fast/block/float/float-change-composited-scrolling.html [ Failure ] crbug.com/591099 svg/dom/viewspec-aspectparams.html [ Failure ] crbug.com/591099 svg/dom/viewspec-transformparams.html [ Failure ] crbug.com/591099 svg/dom/viewspec-viewboxparams.html [ Failure ] crbug.com/591099 svg/dom/viewspec-viewtargetparams.html [ Failure ] crbug.com/591099 svg/dom/viewspec-zoomandpanparams.html [ Failure ] +crbug.com/591099 external/wpt/css/css-multicol/multicol-scroll-content.html [ Failure ] # Fails with ForceSynchronousHTMLParsing enabled, might be a fluke: crbug.com/1254921 svg/as-image/image-respects-deviceScaleFactor.html [ Failure ]
diff --git a/third_party/blink/web_tests/SlowTests b/third_party/blink/web_tests/SlowTests index d1034f0..499c559 100644 --- a/third_party/blink/web_tests/SlowTests +++ b/third_party/blink/web_tests/SlowTests
@@ -80,6 +80,7 @@ crbug.com/243492 inspector-protocol/injected-script-discard.js [ Slow ] crbug.com/678482 http/tests/devtools/debugger/fetch-breakpoints.js [ Slow ] crbug.com/1236466 inspector-protocol/runtime/runtime-execution-contexts-events.js [ Slow ] +crbug.com/1229701 http/tests/inspector-protocol/network/disable-cache-media-resource.js [ Slow ] crbug.com/510337 cssom/cssvalue-comparison.html [ Slow ] @@ -319,6 +320,7 @@ crbug.com/874695 fast/events/frame-detached-in-mousedown.html [ Slow ] crbug.com/874695 fast/events/popup-blocking-timers4.html [ Slow ] crbug.com/874695 fast/forms/color/* [ Slow ] +crbug.com/874695 fast/forms/color-scheme/* [ Slow ] crbug.com/874695 fast/forms/number/number-spinbutton-gets-disabled-or-readonly.html [ Slow ] crbug.com/874695 fast/forms/select/input-select-after-resize.html [ Slow ] crbug.com/874695 fast/history/history-back-twice-with-subframes-assert.html [ Slow ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 7b119fd..59e79cfa 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -818,6 +818,8 @@ crbug.com/1008951 external/wpt/css/css-text-decor/text-decoration-subelements-002.html [ Failure ] crbug.com/1008951 external/wpt/css/css-text-decor/text-decoration-subelements-003.html [ Failure ] crbug.com/1008951 external/wpt/css/css-text-decor/text-decoration-color.html [ Failure ] +crbug.com/1284170 external/wpt/css/css-text-decor/text-decoration-dotted-001.html [ Failure ] +crbug.com/1284170 external/wpt/css/css-text-decor/text-decoration-dotted-002.html [ Failure ] #### Unprefix and update the implementation for text-emphasis crbug.com/666433 external/wpt/css/css-text-decor/text-emphasis-color-001.xht [ Failure ] @@ -3037,7 +3039,6 @@ crbug.com/626703 [ Mac11-arm64 ] virtual/system-color-compute/external/wpt/css/css-color/color-mix-non-srgb-001.html [ Failure ] crbug.com/626703 [ Win ] virtual/system-color-compute/external/wpt/css/css-color/color-mix-non-srgb-001.html [ Failure ] crbug.com/626703 [ Mac11-arm64 ] external/wpt/css/css-color/tagged-images-003.html [ Failure ] -crbug.com/626703 [ Mac11-arm64 ] external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-021.html [ Failure ] crbug.com/626703 [ Mac10.14 ] virtual/portals/external/wpt/portals/no-portal-in-sandboxed-popup.html [ Timeout ] crbug.com/626703 [ Linux ] external/wpt/css/css-color/tagged-images-003.html [ Failure ] crbug.com/626703 [ Mac10.12 ] external/wpt/css/css-color/tagged-images-003.html [ Failure ] @@ -3067,15 +3068,12 @@ crbug.com/626703 [ Mac10.15 ] virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/parse-input-arguments-012.https.html [ Failure ] crbug.com/626703 [ Mac10.15 ] virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/invalid-image-constructor-error.https.html [ Failure ] crbug.com/626703 [ Mac11-arm64 ] external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-022.html [ Crash Failure ] -crbug.com/626703 external/wpt/css/css-text-decor/text-decoration-dotted-001.html [ Failure ] -crbug.com/626703 external/wpt/css/css-text-decor/text-decoration-dotted-002.html [ Failure ] crbug.com/626703 [ Mac11-arm64 ] external/wpt/fetch/private-network-access/fetch.https.window.html?include=from-treat-as-public [ Timeout ] crbug.com/626703 [ Mac11-arm64 ] virtual/plz-dedicated-worker/external/wpt/fetch/private-network-access/fetch.window.html [ Timeout ] crbug.com/626703 [ Mac11 ] virtual/without-coep-for-shared-worker/external/wpt/html/cross-origin-embedder-policy/reporting-subresource-corp.https.html [ Skip Timeout ] crbug.com/626703 [ Mac11 ] external/wpt/css/css-color/color-resolving-hwb.html [ Failure Skip Timeout ] crbug.com/626703 [ Win10.20h2 ] external/wpt/css/css-color/color-resolving-hwb.html [ Failure Skip Timeout ] crbug.com/626703 [ Mac11 ] virtual/system-color-compute/external/wpt/css/css-color/color-resolving-hwb.html [ Failure Skip Timeout ] -crbug.com/626703 [ Mac11-arm64 ] external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-025.html [ Failure ] crbug.com/626703 [ Mac10.15 ] external/wpt/html/cross-origin-embedder-policy/reporting-subresource-corp.https.html [ Skip Timeout ] crbug.com/626703 external/wpt/css/css-text/hyphens/hyphenate-character-001.html [ Failure ] crbug.com/626703 external/wpt/css/css-text/hyphens/hyphenate-character-002.html [ Failure ] @@ -7368,9 +7366,6 @@ crbug.com/1250666 [ Mac ] virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/valid-image-before-load.https.html [ Pass Timeout ] crbug.com/1250666 [ Mac ] virtual/off-main-thread-css-paint/external/wpt/css/css-paint-api/valid-image-after-load.https.html [ Pass Timeout ] -# Sheriff 2021-09-13 -crbug.com/1229701 [ Linux ] http/tests/inspector-protocol/network/disable-cache-media-resource.js [ Failure Pass Timeout ] - # WebRTC simulcast tests contineue to be flaky crbug.com/1230534 [ Win ] external/wpt/webrtc/simulcast/vp8.https.html [ Pass Skip Timeout ] crbug.com/1230534 [ Win ] external/wpt/webrtc/simulcast/h264.https.html [ Pass Skip Timeout ] @@ -7428,6 +7423,8 @@ crbug.com/1249176 [ Mac11-arm64 ] fast/forms/color/color-picker-escape-cancellation-revert.html [ Failure ] crbug.com/1249176 [ Mac11-arm64 ] fast/css/focus-display-block-inline.html [ Failure ] crbug.com/1249176 [ Mac11-arm64 ] fast/dom/geometry-interfaces-dom-matrix-rotate.html [ Failure ] +crbug.com/1249176 [ Mac11-arm64 ] external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-021.html [ Failure ] +crbug.com/1249176 [ Mac11-arm64 ] external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-025.html [ Failure ] # Following tests timeout on mac11-arm64 crbug.com/1249176 [ Mac11-arm64 ] external/wpt/focus/focus-already-focused-iframe-deep-same-site.html [ Timeout ] @@ -7885,6 +7882,8 @@ crbug.com/1281782 [ Mac ] virtual/no-alloc-direct-call/external/wpt/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.html [ Crash Pass ] crbug.com/1281792 external/wpt/event-timing/min-duration-threshold.html [ Failure Pass ] +crbug.com/1285857 plugins/plugin-destroyed-enumerate.html [ Failure Pass ] + # Sheriff 2021-12-22 crbug.com/1179857 [ Linux ] http/tests/inspector-protocol/dom/dom-getFrameOwner.js [ Failure Pass ] crbug.com/1179857 [ Mac10.13 ] http/tests/inspector-protocol/dom/dom-getFrameOwner.js [ Failure Pass ]
diff --git a/third_party/blink/web_tests/compositing/overflow/nested-vertical-rl-overflow-expected.html b/third_party/blink/web_tests/compositing/overflow/nested-vertical-rl-overflow-expected.html index d8391ef..208711f 100644 --- a/third_party/blink/web_tests/compositing/overflow/nested-vertical-rl-overflow-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/nested-vertical-rl-overflow-expected.html
@@ -7,6 +7,7 @@ padding: 2px; writing-mode: vertical-rl; overflow: scroll; + position: relative; } .container .container { width: 150px;
diff --git a/third_party/blink/web_tests/compositing/overflow/nested-vertical-rl-overflow.html b/third_party/blink/web_tests/compositing/overflow/nested-vertical-rl-overflow.html index 752e842..26a2f07d 100644 --- a/third_party/blink/web_tests/compositing/overflow/nested-vertical-rl-overflow.html +++ b/third_party/blink/web_tests/compositing/overflow/nested-vertical-rl-overflow.html
@@ -7,6 +7,7 @@ padding: 2px; writing-mode: vertical-rl; overflow: scroll; + position: relative; } .container .container { width: 150px;
diff --git a/third_party/blink/web_tests/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt b/third_party/blink/web_tests/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt index f67e80a..64a64415 100644 --- a/third_party/blink/web_tests/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt +++ b/third_party/blink/web_tests/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt
@@ -14,6 +14,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV id='container-absolute-grandchildren-not-contained' class='overflow'", + "position": [2, 6], + "bounds": [85, 136], + "contentsOpaqueForText": true, + "transform": 2 + }, + { "name": "HorizontalScrollbar", "position": [10, 97], "bounds": [104, 257], @@ -26,13 +33,6 @@ "transform": 1 }, { - "name": "LayoutNGBlockFlow DIV id='container-absolute-grandchildren-not-contained' class='overflow'", - "position": [2, 6], - "bounds": [85, 136], - "contentsOpaqueForText": true, - "transform": 2 - }, - { "name": "LayoutNGBlockFlow (positioned) DIV id='positioned-absolute-grandchildren-not-contained' class='positionAbsolute positioned'", "position": [35, 10], "bounds": [199, 105], @@ -111,6 +111,13 @@ "transform": 7 }, { + "name": "LayoutNGBlockFlow DIV id='container-absolute-sibling-grandchildren-not-contained' class='overflow'", + "position": [2, 6], + "bounds": [85, 136], + "contentsOpaqueForText": true, + "transform": 8 + }, + { "name": "HorizontalScrollbar", "position": [2, 87], "bounds": [100, 15], @@ -124,13 +131,6 @@ "transform": 7 }, { - "name": "LayoutNGBlockFlow DIV id='container-absolute-sibling-grandchildren-not-contained' class='overflow'", - "position": [2, 6], - "bounds": [85, 136], - "contentsOpaqueForText": true, - "transform": 8 - }, - { "name": "LayoutNGBlockFlow (positioned) DIV id='positioned-absolute-sibling-grandchildren-not-contained' class='positionAbsolute positioned'", "position": [395, 75], "bounds": [80, 40],
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/floats/overflow-scroll-float-paint-order-ref.html b/third_party/blink/web_tests/external/wpt/css/CSS2/floats/overflow-scroll-float-paint-order-ref.html new file mode 100644 index 0000000..0fb53d4e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/floats/overflow-scroll-float-paint-order-ref.html
@@ -0,0 +1,4 @@ +<!DOCTYPE html> +<div style="width: 100px; height: 100px; background: green"> + <div style="width: 50px; height: 50px; background: magenta"></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/floats/overflow-scroll-float-paint-order.html b/third_party/blink/web_tests/external/wpt/css/CSS2/floats/overflow-scroll-float-paint-order.html new file mode 100644 index 0000000..79ab770 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/floats/overflow-scroll-float-paint-order.html
@@ -0,0 +1,49 @@ +<!DOCTYPE html> +<title>Overflow:scroll floating paint order</title> +<link rel="help" href="https://www.w3.org/TR/CSS2/zindex.html"> +<link rel="match" href="overflow-scroll-float-paint-order-ref.html"> +<style> + #scroller { + float: left; + background: red; + padding: 20px; + box-sizing: border-box; + width: 100px; + height: 100px; + overflow: scroll; + } + #negative-margin { + float: left; + width: 100px; + height: 100px; + background: green; + margin-left: -100px; + } + #foreground1 { + display: inline-block; + width: 50px; + height: 50px; + background: blue; + } + #foreground2 { + display: inline-block; + width: 50px; + height: 50px; + background: magenta; + } +</style> +<!-- The paint order should be: + scroller background (invisible) + scroller child background (invisible) + foreground1 (invisible) + negative-margin background (visible) + foreground2 (visible) +--> +<div id="scroller"> + <div style="height: 200px; background: yellow"> + <div id="foreground1"></div> + </div> +</div> +<div id="negative-margin"> + <div id="foreground2"></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/overflow-scroll-paint-order-ref.html b/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/overflow-scroll-paint-order-ref.html new file mode 100644 index 0000000..4ea2b5da --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/overflow-scroll-paint-order-ref.html
@@ -0,0 +1,5 @@ +<!DOCTYPE html> +<div style="width: 100px; height: 100px; background: green; position: relative"> + <div style="width: 50px; height: 50px; background: blue; position: absolute; top: 20px; left: 20px"></div> + <div style="width: 50px; height: 50px; background: magenta; position: absolute; top: 0; left: 0"></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/overflow-scroll-paint-order.html b/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/overflow-scroll-paint-order.html new file mode 100644 index 0000000..a0813ae469 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/normal-flow/overflow-scroll-paint-order.html
@@ -0,0 +1,47 @@ +<!DOCTYPE html> +<title>Overflow:scroll paint order</title> +<link rel="help" href="https://www.w3.org/TR/CSS2/zindex.html"> +<link rel="match" href="overflow-scroll-paint-order-ref.html"> +<style> + #scroller { + background: red; + padding: 20px; + box-sizing: border-box; + width: 100px; + height: 100px; + overflow: scroll; + } + #negative-margin { + width: 100px; + height: 100px; + background: green; + margin-top: -100px; + } + #foreground1 { + display: inline-block; + width: 50px; + height: 50px; + background: blue; + } + #foreground2 { + display: inline-block; + width: 50px; + height: 50px; + background: magenta; + } +</style> +<!-- The paint order should be: + scroller background (invisible) + scroller child background (invisible) + negative-margin background (visible) + foreground1 (visible) + foreground2 (visible) +--> +<div id="scroller"> + <div style="height: 200px; background: yellow"> + <div id="foreground1"></div> + </div> +</div> +<div id="negative-margin"> + <div id="foreground2"></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-plus-lighter-svg.html b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-plus-lighter-svg.html new file mode 100644 index 0000000..4762389 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-plus-lighter-svg.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<title>mix-blend-mode: plus-lighter SVG test</title> +<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> +<link rel="help" href="https://drafts.fxtf.org/compositing-2/#mix-blend-mode"> +<link rel="match" href="reference/mix-blend-mode-plus-lighter-svg-ref.html"> + +<style> +.isolate { isolation: isolate; } +rect { + opacity: 0.6; + mix-blend-mode: plus-lighter; +} +</style> + +<svg width=500 height=500> + <g class="isolate"> + <rect x="10" y="10" width="100" height="100" fill="#000064"></rect> + <rect x="30" y="65" width="100" height="100" fill="#000064"></rect> + <rect x="50" y="120" width="100" height="100" fill="#006400"></rect> + </g> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-plus-lighter.html b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-plus-lighter.html new file mode 100644 index 0000000..ae3dff1 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-plus-lighter.html
@@ -0,0 +1,42 @@ +<!DOCTYPE html> +<title>mix-blend-mode: plus-lighter test</title> +<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> +<link rel="help" href="https://drafts.fxtf.org/compositing-2/#mix-blend-mode"> +<link rel="match" href="reference/mix-blend-mode-plus-lighter-ref.html"> + +<style> +.container { + position: relative; + isolation: isolate; + width: 500px; + height: 500px; +} +.blue { background: #000064; } +.green { background: #006400; } +.common { + position: absolute; + width: 100px; + height: 100px; + opacity: 0.6; +} +.one { + top: 10px; + left: 10px; +} +.two { + top: 65px; + left: 30px; + mix-blend-mode: plus-lighter; +} +.three { + top: 120px; + left: 50px; + mix-blend-mode: plus-lighter; +} +</style> + +<div class=container> + <div class="one common blue"></div> + <div class="two common blue"></div> + <div class="three common green"></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/reference/mix-blend-mode-plus-lighter-ref.html b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/reference/mix-blend-mode-plus-lighter-ref.html new file mode 100644 index 0000000..e5acd26 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/reference/mix-blend-mode-plus-lighter-ref.html
@@ -0,0 +1,57 @@ +<!DOCTYPE html> +<title>mix-blend-mode: plus-lighter test</title> +<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> +<link rel="help" href="https://drafts.fxtf.org/compositing-2/#mix-blend-mode"> + +<style> +.container { + isolation: isolate; + position: relative; + width: 500px; + height: 500px; +} +.blue { background: #000064; } +.green { background: #006400; } +.common { + position: absolute; + width: 100px; + height: 100px; + opacity: 0.6; +} +.one { + top: 10px; + left: 10px; +} +.two { + top: 65px; + left: 30px; +} +.three { + top: 120px; + left: 50px; +} +.one_and_two { + position: absolute; + width: 80px; + height: 45px; + top: 65px; + left: 30px; + background: #000078; +} +.two_and_three { + position: absolute; + width: 80px; + height: 45px; + top: 120px; + left: 50px; + background: #003C3C; +} +</style> + +<div class=container> + <div class="one common blue"></div> + <div class="two common blue"></div> + <div class="three common green"></div> + <div class="one_and_two"></div> + <div class="two_and_three"></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/reference/mix-blend-mode-plus-lighter-svg-ref.html b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/reference/mix-blend-mode-plus-lighter-svg-ref.html new file mode 100644 index 0000000..9193bb5 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/reference/mix-blend-mode-plus-lighter-svg-ref.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<title>mix-blend-mode: plus-lighter SVG test</title> +<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> +<link rel="help" href="https://drafts.fxtf.org/compositing-2/#mix-blend-mode"> + +<style> +.isolate { isolation: isolate; } +.original { opacity: 0.6; } +</style> + +<svg width=500 height=500> + <g class="isolate"> + <rect class="original" x="10" y="10" width="100" height="100" fill="#000064"></rect> + <rect class="original" x="30" y="65" width="100" height="100" fill="#000064"></rect> + <rect class="original" x="50" y="120" width="100" height="100" fill="#006400"></rect> + <rect x="30" y="65" width="80" height="45" fill="#000078"></rect> + <rect x="50" y="120" width="80" height="45" fill="#003C3C"></rect> + </g> +</svg>
diff --git a/third_party/blink/web_tests/fast/css/invalidation/font-face-load-expected.txt b/third_party/blink/web_tests/fast/css/invalidation/font-face-load-expected.txt index 325661f..eb8dfbb 100644 --- a/third_party/blink/web_tests/fast/css/invalidation/font-face-load-expected.txt +++ b/third_party/blink/web_tests/fast/css/invalidation/font-face-load-expected.txt
@@ -2,7 +2,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS internals.updateStyleAndReturnAffectedElementCount() is 1 +PASS internals.updateStyleAndReturnAffectedElementCount() is 5 PASS getComputedStyle(x).color is "rgb(0, 128, 0)" PASS successfullyParsed is true
diff --git a/third_party/blink/web_tests/fast/css/invalidation/font-face-load.html b/third_party/blink/web_tests/fast/css/invalidation/font-face-load.html index 722909c..cbf46e9 100644 --- a/third_party/blink/web_tests/fast/css/invalidation/font-face-load.html +++ b/third_party/blink/web_tests/fast/css/invalidation/font-face-load.html
@@ -17,7 +17,7 @@ document.fonts.load("40px dummy"); if (window.internals) - shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "5"); shouldBeEqualToString("getComputedStyle(x).color", "rgb(0, 128, 0)"); </script>
diff --git a/third_party/blink/web_tests/fast/css/invalidation/inherit-through-insertion-point-v0.html b/third_party/blink/web_tests/fast/css/invalidation/inherit-through-insertion-point-v0.html index e8de97c..ea97581 100644 --- a/third_party/blink/web_tests/fast/css/invalidation/inherit-through-insertion-point-v0.html +++ b/third_party/blink/web_tests/fast/css/invalidation/inherit-through-insertion-point-v0.html
@@ -20,6 +20,6 @@ host.offsetTop; root.querySelector("#shadowDiv").style.color = "red"; assert_true(!!window.internals, "This test only works with --expose-internals-for-testing."); - assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Inheritance propagation should stop at #stopInherit element."); + assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Inheritance propagation should stop at #stopInherit element."); }, "Inheritance propagation should not cause full subtree recalcs in flat-tree."); </script>
diff --git a/third_party/blink/web_tests/fast/css/recalc-inherit-001-expected.txt b/third_party/blink/web_tests/fast/css/recalc-inherit-001-expected.txt index 9397350c..85672d2 100644 --- a/third_party/blink/web_tests/fast/css/recalc-inherit-001-expected.txt +++ b/third_party/blink/web_tests/fast/css/recalc-inherit-001-expected.txt
@@ -2,7 +2,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS internals.updateStyleAndReturnAffectedElementCount() is 1 +PASS internals.updateStyleAndReturnAffectedElementCount() is 2 PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/fast/css/recalc-inherit-001.html b/third_party/blink/web_tests/fast/css/recalc-inherit-001.html index af5f9a62..acd8f4b9 100644 --- a/third_party/blink/web_tests/fast/css/recalc-inherit-001.html +++ b/third_party/blink/web_tests/fast/css/recalc-inherit-001.html
@@ -33,5 +33,5 @@ document.getElementById("t").style.color = "pink"; if (window.internals) - shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); </script>
diff --git a/third_party/blink/web_tests/fast/events/touch/compositor-touch-hit-rects-scroll-expected.txt b/third_party/blink/web_tests/fast/events/touch/compositor-touch-hit-rects-scroll-expected.txt index bf78b95b..02a8f64 100644 --- a/third_party/blink/web_tests/fast/events/touch/compositor-touch-hit-rects-scroll-expected.txt +++ b/third_party/blink/web_tests/fast/events/touch/compositor-touch-hit-rects-scroll-expected.txt
@@ -2,17 +2,23 @@ scrollContent: layer(273x75) has hit test rect (0,13 273x12) +scrollContent5: layer(160x10) has hit test rect (0,0 160x10) scrollContent5: layer(273x85) has hit test rect (0,13 273x12) scrollContent6: layer(273x12) has hit test rect (0,0 273x12) +nestedContent: layer(140x10) has hit test rect (0,0 140x10) nestedContent: layer(256x72) has hit test rect (0,30 256x12) +overflowwithhandler: layer(250x20) has hit test rect (0,0 250x10) overflowwithhandler: layer(256x116) has hit test rect (0,0 256x116) +overflowwithhandler: layer(250x20) has hit test rect (0,10 70x10) overflowwithhandler: layer(273x112) has hit test rect (0,10 273x52) +overflowwithborder: layer(250x20) has hit test rect (0,0 250x10) overflowwithborder: layer(255x116) has hit test rect (0,0 255x116) -overflowwithborder: layer(769x753) has hit test rect (5,349 290x70) +overflowwithborder: layer(250x20) has hit test rect (0,10 240x10) +overflowwithborder: layer(769x881) has hit test rect (5,349 290x70) withTransform: layer(271x12) has hit test rect (0,0 271x12) withTransform: layer(273x77) has hit test rect (0,13 273x14)
diff --git a/third_party/blink/web_tests/fast/lists/list-color-change-no-layout-expected.txt b/third_party/blink/web_tests/fast/lists/list-color-change-no-layout-expected.txt index 1fe01fb..dcfa703 100644 --- a/third_party/blink/web_tests/fast/lists/list-color-change-no-layout-expected.txt +++ b/third_party/blink/web_tests/fast/lists/list-color-change-no-layout-expected.txt
@@ -2,7 +2,7 @@ TEST COMPLETE -PASS internals.updateStyleAndReturnAffectedElementCount() is 2 +PASS internals.updateStyleAndReturnAffectedElementCount() is 3 PASS internals.needsLayoutCount() is 0 Should not layout when list color changes. List item
diff --git a/third_party/blink/web_tests/fast/lists/list-color-change-no-layout.html b/third_party/blink/web_tests/fast/lists/list-color-change-no-layout.html index f2a28c05..176c93a 100644 --- a/third_party/blink/web_tests/fast/lists/list-color-change-no-layout.html +++ b/third_party/blink/web_tests/fast/lists/list-color-change-no-layout.html
@@ -6,7 +6,7 @@ var target = document.getElementById('target'); target.style.color = 'green'; if (window.internals) { - shouldBe('internals.updateStyleAndReturnAffectedElementCount()', '2'); + shouldBe('internals.updateStyleAndReturnAffectedElementCount()', '3'); shouldBe('internals.needsLayoutCount()', '0'); } }
diff --git a/third_party/blink/web_tests/fast/overflow/overflow-float-stacking.html b/third_party/blink/web_tests/fast/overflow/overflow-float-stacking.html deleted file mode 100644 index 6c6c16e66..0000000 --- a/third_party/blink/web_tests/fast/overflow/overflow-float-stacking.html +++ /dev/null
@@ -1,53 +0,0 @@ -<html> -<body> -Make sure that floating overflow:auto/hidden/scroll blocks stack properly with other floats at the same level. - -<div style="float:left; overflow:auto; width:300px; height:300px; background-color:lime; ">Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -</div> -<div style="float:left; background-color:yellow;width:300px;height:300px; font-size:48px; margin-left:-50px">This block should be on top of the overflow block.</div> \ No newline at end of file
diff --git a/third_party/blink/web_tests/fast/overflow/overflow-stacking.html b/third_party/blink/web_tests/fast/overflow/overflow-stacking.html deleted file mode 100644 index 08004263..0000000 --- a/third_party/blink/web_tests/fast/overflow/overflow-stacking.html +++ /dev/null
@@ -1,53 +0,0 @@ -<html> -<body style="overflow: hidden;"> -Make sure that overflow:auto/hidden/scroll blocks interleave their background and foreground with other overlapping blocks in the normal flow. - -<div style="overflow:auto; width:300px; height:300px; background-color:lime; ">Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -Hello world<br> -</div> -<div style="background-color:yellow;width:300px;height:300px; font-size:48px; margin-top:-50px">This text overlaps.</div>
diff --git a/third_party/blink/web_tests/fast/scrolling/hide-scrollbars.html b/third_party/blink/web_tests/fast/scrolling/hide-scrollbars.html index 9a04b3ea..066f1e4 100644 --- a/third_party/blink/web_tests/fast/scrolling/hide-scrollbars.html +++ b/third_party/blink/web_tests/fast/scrolling/hide-scrollbars.html
@@ -11,6 +11,7 @@ height: 100px; overflow: auto; background-color: lime; + position: relative; } .box { width: 500px;
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt index 3b23545..4a41bdc 100644 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt
@@ -16,6 +16,13 @@ "transform": 1 }, { + "name": "LayoutBlockFlow DIV class='scrollable bigBox'", + "position": [1, 1], + "bounds": [285, 800], + "contentsOpaque": true, + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [1, 286], "bounds": [300, 15], @@ -29,13 +36,6 @@ "transform": 1 }, { - "name": "LayoutBlockFlow DIV class='scrollable bigBox'", - "position": [1, 1], - "bounds": [285, 800], - "contentsOpaque": true, - "transform": 1 - }, - { "name": "LayoutBlockFlow (positioned) DIV class='fixed lime box'", "position": [10, 100], "bounds": [100, 100],
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/compositing/overflow/textarea-scroll-touch-expected.txt index dd4ff7a8..d8caa6c 100644 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/compositing/overflow/textarea-scroll-touch-expected.txt +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -17,8 +17,7 @@ { "name": "Scroll corner of LayoutTextControl TEXTAREA", "position": [193, 18], - "bounds": [261, 126], - "contentsOpaqueForText": true + "bounds": [261, 140] }, { "name": "LayoutTextControl TEXTAREA",
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt index c38183f..1ae47dd 100644 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt
@@ -14,6 +14,13 @@ "transform": 1 }, { + "name": "LayoutBlockFlow DIV id='container-absolute-grandchildren-not-contained' class='overflow'", + "position": [2, 6], + "bounds": [85, 136], + "contentsOpaqueForText": true, + "transform": 2 + }, + { "name": "HorizontalScrollbar", "position": [10, 97], "bounds": [104, 257], @@ -26,13 +33,6 @@ "transform": 1 }, { - "name": "LayoutBlockFlow DIV id='container-absolute-grandchildren-not-contained' class='overflow'", - "position": [2, 6], - "bounds": [85, 136], - "contentsOpaqueForText": true, - "transform": 2 - }, - { "name": "LayoutBlockFlow (positioned) DIV id='positioned-absolute-grandchildren-not-contained' class='positionAbsolute positioned'", "position": [35, 10], "bounds": [199, 105], @@ -111,6 +111,13 @@ "transform": 7 }, { + "name": "LayoutBlockFlow DIV id='container-absolute-sibling-grandchildren-not-contained' class='overflow'", + "position": [2, 6], + "bounds": [85, 136], + "contentsOpaqueForText": true, + "transform": 8 + }, + { "name": "HorizontalScrollbar", "position": [2, 87], "bounds": [100, 15], @@ -124,13 +131,6 @@ "transform": 7 }, { - "name": "LayoutBlockFlow DIV id='container-absolute-sibling-grandchildren-not-contained' class='overflow'", - "position": [2, 6], - "bounds": [85, 136], - "contentsOpaqueForText": true, - "transform": 8 - }, - { "name": "LayoutBlockFlow (positioned) DIV id='positioned-absolute-sibling-grandchildren-not-contained' class='positionAbsolute positioned'", "position": [395, 75], "bounds": [80, 40],
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/forms/text/textfield-outline-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/forms/text/textfield-outline-expected.png deleted file mode 100644 index 3839dd0..0000000 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/forms/text/textfield-outline-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/overflow/overflow-stacking-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/overflow/overflow-stacking-expected.png deleted file mode 100644 index 1b36f6b..0000000 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/overflow/overflow-stacking-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fragmentation/outline-crossing-columns-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fragmentation/outline-crossing-columns-expected.png index b432a376..51b325f45 100644 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fragmentation/outline-crossing-columns-expected.png +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fragmentation/outline-crossing-columns-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/compositing/scrolling-without-painting-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/compositing/scrolling-without-painting-expected.txt index cb8a3ea..571b2c8 100644 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/compositing/scrolling-without-painting-expected.txt +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/compositing/scrolling-without-painting-expected.txt
@@ -14,6 +14,14 @@ "transform": 1 }, { + "name": "LayoutBlockFlow DIV id='scroller'", + "position": [1, 26], + "bounds": [185, 1000], + "contentsOpaqueForText": true, + "drawsContent": false, + "transform": 2 + }, + { "name": "HorizontalScrollbar", "position": [1, 186], "bounds": [200, 15], @@ -25,14 +33,6 @@ "position": [186, 1], "bounds": [15, 185], "transform": 1 - }, - { - "name": "LayoutBlockFlow DIV id='scroller'", - "position": [1, 26], - "bounds": [185, 1000], - "contentsOpaqueForText": true, - "drawsContent": false, - "transform": 2 } ], "transforms": [
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.txt index bb9654f..37ae674 100644 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.txt +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.txt
@@ -13,6 +13,16 @@ "transform": 1 }, { + "name": "LayoutBlockFlow DIV id='container'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#008000", + "invalidations": [ + [0, 0, 1000, 1000] + ], + "transform": 2 + }, + { "name": "HorizontalScrollbar", "position": [0, 285], "bounds": [385, 15], @@ -30,16 +40,6 @@ "bounds": [15, 15], "contentsOpaque": true, "transform": 1 - }, - { - "name": "LayoutBlockFlow DIV id='container'", - "bounds": [1000, 1000], - "contentsOpaque": true, - "backgroundColor": "#008000", - "invalidations": [ - [0, 0, 1000, 1000] - ], - "transform": 2 } ], "transforms": [
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/compositing/updating-scrolling-content-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/compositing/updating-scrolling-content-expected.txt index 9cc5d09..ed1e093 100644 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/compositing/updating-scrolling-content-expected.txt +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/compositing/updating-scrolling-content-expected.txt
@@ -13,6 +13,15 @@ "transform": 1 }, { + "name": "LayoutBlockFlow DIV id='scroller'", + "bounds": [185, 1200], + "contentsOpaqueForText": true, + "invalidations": [ + [0, 0, 185, 200] + ], + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 185], "bounds": [200, 15], @@ -24,15 +33,6 @@ "position": [185, 0], "bounds": [15, 185], "transform": 1 - }, - { - "name": "LayoutBlockFlow DIV id='scroller'", - "bounds": [185, 1200], - "contentsOpaqueForText": true, - "invalidations": [ - [0, 0, 185, 200] - ], - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt index 6d0ec9ac..0266ebf 100644 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt
@@ -15,6 +15,12 @@ [0, 0, 1, 16] ], "transform": 1 + }, + { + "name": "LayoutTextControl INPUT id='target'", + "position": [378, 7], + "bounds": [30, 24], + "contentsOpaqueForText": true } ], "transforms": [
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/scrollbars/custom-scrollbar-with-incomplete-style-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/scrollbars/custom-scrollbar-with-incomplete-style-expected.png deleted file mode 100644 index 6efbcc6..0000000 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/scrollbars/custom-scrollbar-with-incomplete-style-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/backface-visibility-interop/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/backface-visibility-interop/compositing/overflow/textarea-scroll-touch-expected.txt new file mode 100644 index 0000000..d8caa6c --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/backface-visibility-interop/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -0,0 +1,106 @@ + +{ + "layers": [ + { + "name": "Scrolling background of LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "backgroundColor": "#FFFFFF" + }, + { + "name": "LayoutTextControl TEXTAREA", + "position": [1, 1], + "bounds": [189, 124], + "drawsContent": false, + "transform": 1 + }, + { + "name": "Scroll corner of LayoutTextControl TEXTAREA", + "position": [193, 18], + "bounds": [261, 140] + }, + { + "name": "LayoutTextControl TEXTAREA", + "position": [1, 1], + "bounds": [189, 328], + "contentsOpaque": true, + "backgroundColor": "#CCCCCC", + "transform": 2 + }, + { + "name": "VerticalScrollbar", + "position": [190, 1], + "bounds": [15, 109], + "transform": 1 + }, + { + "name": "LayoutTextControl TEXTAREA", + "position": [1, 1], + "bounds": [189, 124], + "drawsContent": false, + "transform": 3 + }, + { + "name": "Scroll corner of LayoutTextControl TEXTAREA", + "position": [175, 95], + "bounds": [30, 30], + "contentsOpaqueForText": true, + "transform": 3 + }, + { + "name": "LayoutTextControl TEXTAREA", + "position": [1, 1], + "bounds": [189, 328], + "contentsOpaque": true, + "backgroundColor": "#CCCCCC", + "transform": 4 + }, + { + "name": "VerticalScrollbar", + "position": [190, 1], + "bounds": [15, 109], + "transform": 3 + } + ], + "transforms": [ + { + "id": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [18, 18, 0, 1] + ] + }, + { + "id": 2, + "parent": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -50, 0, 1] + ] + }, + { + "id": 3, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [248, 18, 0, 1] + ] + }, + { + "id": 4, + "parent": 3, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -50, 0, 1] + ] + } + ] +} +
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/backface-visibility-interop/paint/invalidation/compositing/scrolling-without-painting-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/backface-visibility-interop/paint/invalidation/compositing/scrolling-without-painting-expected.txt new file mode 100644 index 0000000..571b2c8 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/backface-visibility-interop/paint/invalidation/compositing/scrolling-without-painting-expected.txt
@@ -0,0 +1,60 @@ +{ + "layers": [ + { + "name": "Scrolling background of LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "backgroundColor": "#FFFFFF" + }, + { + "name": "LayoutBlockFlow DIV id='scroller'", + "position": [1, 1], + "bounds": [185, 185], + "drawsContent": false, + "transform": 1 + }, + { + "name": "LayoutBlockFlow DIV id='scroller'", + "position": [1, 26], + "bounds": [185, 1000], + "contentsOpaqueForText": true, + "drawsContent": false, + "transform": 2 + }, + { + "name": "HorizontalScrollbar", + "position": [1, 186], + "bounds": [200, 15], + "contentsOpaqueForText": true, + "transform": 1 + }, + { + "name": "VerticalScrollbar", + "position": [186, 1], + "bounds": [15, 185], + "transform": 1 + } + ], + "transforms": [ + { + "id": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [8, 8, 0, 1] + ] + }, + { + "id": 2, + "parent": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -25, 0, 1] + ] + } + ] +} +
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/backface-visibility-interop/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/backface-visibility-interop/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt index 6d0ec9ac..0266ebf 100644 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/backface-visibility-interop/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/backface-visibility-interop/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt
@@ -15,6 +15,12 @@ [0, 0, 1, 16] ], "transform": 1 + }, + { + "name": "LayoutTextControl INPUT id='target'", + "position": [378, 7], + "bounds": [30, 24], + "contentsOpaqueForText": true } ], "transforms": [
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt index b18aa163..6ad396e 100644 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutBlockFlow DIV class='scroller'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 285], "bounds": [285, 15], @@ -30,13 +37,6 @@ "bounds": [15, 15], "contentsOpaque": true, "transform": 1 - }, - { - "name": "LayoutBlockFlow DIV class='scroller'", - "bounds": [1000, 1000], - "contentsOpaque": true, - "backgroundColor": "#C0C0C0", - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt index b18aa163..6ad396e 100644 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutBlockFlow DIV class='scroller'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 285], "bounds": [285, 15], @@ -30,13 +37,6 @@ "bounds": [15, 15], "contentsOpaque": true, "transform": 1 - }, - { - "name": "LayoutBlockFlow DIV class='scroller'", - "bounds": [1000, 1000], - "contentsOpaque": true, - "backgroundColor": "#C0C0C0", - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt new file mode 100644 index 0000000..1ae47dd --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt
@@ -0,0 +1,843 @@ +{ + "layers": [ + { + "name": "Scrolling background of LayoutView #document", + "bounds": [785, 2016], + "contentsOpaque": true, + "backgroundColor": "#FFFFFF" + }, + { + "name": "LayoutBlockFlow DIV id='container-absolute-grandchildren-not-contained' class='overflow'", + "position": [2, 2], + "bounds": [85, 85], + "drawsContent": false, + "transform": 1 + }, + { + "name": "LayoutBlockFlow DIV id='container-absolute-grandchildren-not-contained' class='overflow'", + "position": [2, 6], + "bounds": [85, 136], + "contentsOpaqueForText": true, + "transform": 2 + }, + { + "name": "HorizontalScrollbar", + "position": [10, 97], + "bounds": [104, 257], + "contentsOpaqueForText": true + }, + { + "name": "VerticalScrollbar", + "position": [87, 2], + "bounds": [15, 85], + "transform": 1 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='positioned-absolute-grandchildren-not-contained' class='positionAbsolute positioned'", + "position": [35, 10], + "bounds": [199, 105], + "contentsOpaqueForText": true + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='container-absolute-grandchildren' class='positionAbsolute overflow'", + "position": [2, 2], + "bounds": [85, 85], + "drawsContent": false, + "transform": 3 + }, + { + "name": "HorizontalScrollbar", + "position": [2, 87], + "bounds": [85, 15], + "transform": 3 + }, + { + "name": "VerticalScrollbar", + "position": [87, 2], + "bounds": [15, 85], + "transform": 3 + }, + { + "name": "Scroll corner of LayoutBlockFlow (positioned) DIV id='container-absolute-grandchildren' class='positionAbsolute overflow'", + "position": [217, 10], + "bounds": [137, 104], + "contentsOpaqueForText": true + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='container-absolute-grandchildren' class='positionAbsolute overflow'", + "position": [2, 6], + "bounds": [105, 136], + "contentsOpaqueForText": true, + "transform": 4 + }, + { + "name": "LayoutBlockFlow DIV id='container-absolute-not-contained' class='overflow'", + "position": [2, 2], + "bounds": [85, 85], + "drawsContent": false, + "transform": 5 + }, + { + "name": "HorizontalScrollbar", + "position": [2, 87], + "bounds": [100, 15], + "contentsOpaqueForText": true, + "transform": 5 + }, + { + "name": "VerticalScrollbar", + "position": [87, 2], + "bounds": [15, 85], + "transform": 5 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='positioned-absolute-not-contained' class='positionAbsolute positioned'", + "position": [275, 10], + "bounds": [199, 105], + "contentsOpaqueForText": true + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-absolute-not-contained' class='scrolled'", + "position": [6, 6], + "bounds": [75, 136], + "contentsOpaqueForText": true, + "transform": 6 + }, + { + "name": "LayoutBlockFlow DIV id='container-absolute-sibling-grandchildren-not-contained' class='overflow'", + "position": [2, 2], + "bounds": [85, 85], + "drawsContent": false, + "transform": 7 + }, + { + "name": "LayoutBlockFlow DIV id='container-absolute-sibling-grandchildren-not-contained' class='overflow'", + "position": [2, 6], + "bounds": [85, 136], + "contentsOpaqueForText": true, + "transform": 8 + }, + { + "name": "HorizontalScrollbar", + "position": [2, 87], + "bounds": [100, 15], + "contentsOpaqueForText": true, + "transform": 7 + }, + { + "name": "VerticalScrollbar", + "position": [87, 2], + "bounds": [15, 85], + "transform": 7 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='positioned-absolute-sibling-grandchildren-not-contained' class='positionAbsolute positioned'", + "position": [395, 75], + "bounds": [80, 40], + "contentsOpaque": true, + "backgroundColor": "#800080" + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='container-absolute-sibling-grandchildren' class='positionAbsolute overflow'", + "position": [2, 2], + "bounds": [85, 85], + "drawsContent": false, + "transform": 9 + }, + { + "name": "HorizontalScrollbar", + "position": [2, 87], + "bounds": [85, 15], + "transform": 9 + }, + { + "name": "VerticalScrollbar", + "position": [87, 2], + "bounds": [15, 85], + "transform": 9 + }, + { + "name": "Scroll corner of LayoutBlockFlow (positioned) DIV id='container-absolute-sibling-grandchildren' class='positionAbsolute overflow'", + "position": [97, 130], + "bounds": [137, 104], + "contentsOpaqueForText": true + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='container-absolute-sibling-grandchildren' class='positionAbsolute overflow'", + "position": [2, 6], + "bounds": [105, 136], + "contentsOpaqueForText": true, + "transform": 10 + }, + { + "name": "LayoutBlockFlow DIV id='container-absolute-sibling-not-contained' class='overflow'", + "position": [2, 2], + "bounds": [85, 85], + "drawsContent": false, + "transform": 11 + }, + { + "name": "HorizontalScrollbar", + "position": [130, 217], + "bounds": [224, 137], + "contentsOpaqueForText": true + }, + { + "name": "VerticalScrollbar", + "position": [87, 2], + "bounds": [15, 85], + "transform": 11 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='positioned-absolute-sibling-not-contained' class='positionAbsolute positioned'", + "position": [155, 130], + "bounds": [199, 105], + "contentsOpaqueForText": true + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-absolute-sibling-not-contained' class='scrolled'", + "position": [6, 6], + "bounds": [75, 108], + "contentsOpaqueForText": true, + "transform": 12 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='container-absolute-sibling' class='positionAbsolute overflow'", + "position": [2, 2], + "bounds": [85, 85], + "drawsContent": false, + "transform": 13 + }, + { + "name": "HorizontalScrollbar", + "position": [2, 87], + "bounds": [85, 15], + "transform": 13 + }, + { + "name": "VerticalScrollbar", + "position": [87, 2], + "bounds": [15, 85], + "transform": 13 + }, + { + "name": "Scroll corner of LayoutBlockFlow (positioned) DIV id='container-absolute-sibling' class='positionAbsolute overflow'", + "position": [337, 130], + "bounds": [137, 104], + "contentsOpaqueForText": true + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='positioned-absolute-sibling' class='positionAbsolute positioned'", + "position": [6, 6], + "bounds": [101, 108], + "contentsOpaqueForText": true, + "transform": 14 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='container-absolute' class='positionAbsolute overflow'", + "position": [2, 2], + "bounds": [85, 85], + "drawsContent": false, + "transform": 15 + }, + { + "name": "HorizontalScrollbar", + "position": [2, 87], + "bounds": [85, 15], + "transform": 15 + }, + { + "name": "VerticalScrollbar", + "position": [87, 2], + "bounds": [15, 85], + "transform": 15 + }, + { + "name": "Scroll corner of LayoutBlockFlow (positioned) DIV id='container-absolute' class='positionAbsolute overflow'", + "position": [370, 217], + "bounds": [104, 137], + "contentsOpaqueForText": true + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='positioned-absolute' class='positionAbsolute positioned'", + "position": [6, 6], + "bounds": [101, 108], + "contentsOpaqueForText": true, + "transform": 16 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='container-fixed-sibling-grandchildren' class='positionAbsolute overflow'", + "position": [2, 2], + "bounds": [85, 85], + "drawsContent": false, + "transform": 17 + }, + { + "name": "HorizontalScrollbar", + "position": [2, 87], + "bounds": [100, 15], + "contentsOpaqueForText": true, + "transform": 17 + }, + { + "name": "VerticalScrollbar", + "position": [87, 2], + "bounds": [15, 85], + "transform": 17 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='container-fixed-sibling-grandchildren' class='positionAbsolute overflow'", + "position": [2, 6], + "bounds": [85, 136], + "contentsOpaqueForText": true, + "transform": 18 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='positioned-fixed-sibling-grandchildren' class='positionFixed positioned'", + "bounds": [80, 40], + "contentsOpaque": true, + "backgroundColor": "#800080", + "transform": 19 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='container-fixed-sibling' class='positionAbsolute overflow'", + "position": [2, 2], + "bounds": [85, 85], + "drawsContent": false, + "transform": 20 + }, + { + "name": "HorizontalScrollbar", + "position": [2, 87], + "bounds": [100, 15], + "contentsOpaqueForText": true, + "transform": 20 + }, + { + "name": "VerticalScrollbar", + "position": [87, 2], + "bounds": [15, 85], + "transform": 20 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='positioned-fixed-sibling' class='positionFixed positioned'", + "bounds": [80, 40], + "contentsOpaque": true, + "backgroundColor": "#800080", + "transform": 21 + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-fixed-sibling' class='scrolled'", + "position": [6, 6], + "bounds": [75, 108], + "contentsOpaqueForText": true, + "transform": 22 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='container-fixed-grandchildren' class='positionAbsolute overflow'", + "position": [2, 2], + "bounds": [85, 85], + "drawsContent": false, + "transform": 23 + }, + { + "name": "HorizontalScrollbar", + "position": [2, 87], + "bounds": [100, 15], + "contentsOpaqueForText": true, + "transform": 23 + }, + { + "name": "VerticalScrollbar", + "position": [87, 2], + "bounds": [15, 85], + "transform": 23 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='container-fixed-grandchildren' class='positionAbsolute overflow'", + "position": [2, 6], + "bounds": [85, 136], + "contentsOpaqueForText": true, + "transform": 24 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='positioned-fixed-grandchildren' class='positionFixed positioned'", + "bounds": [80, 40], + "contentsOpaque": true, + "backgroundColor": "#800080", + "transform": 25 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='container-fixed' class='positionAbsolute overflow'", + "position": [2, 2], + "bounds": [85, 85], + "drawsContent": false, + "transform": 26 + }, + { + "name": "HorizontalScrollbar", + "position": [2, 87], + "bounds": [100, 15], + "contentsOpaqueForText": true, + "transform": 26 + }, + { + "name": "VerticalScrollbar", + "position": [87, 2], + "bounds": [15, 85], + "transform": 26 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='positioned-fixed' class='positionFixed positioned'", + "bounds": [80, 40], + "contentsOpaque": true, + "backgroundColor": "#800080", + "transform": 27 + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-fixed' class='scrolled'", + "position": [6, 6], + "bounds": [75, 108], + "contentsOpaqueForText": true, + "transform": 28 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='sibling-absolute-sibling-grandchildren-not-contained' class='positionFixed sibling'", + "bounds": [50, 100], + "contentsOpaque": true, + "backgroundColor": "#008000", + "transform": 29 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='sibling-absolute-sibling-grandchildren' class='positionFixed sibling'", + "bounds": [50, 100], + "contentsOpaque": true, + "backgroundColor": "#008000", + "transform": 30 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='sibling-absolute-sibling-not-contained' class='positionFixed sibling'", + "bounds": [50, 100], + "contentsOpaque": true, + "backgroundColor": "#008000", + "transform": 31 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='sibling-absolute-sibling' class='positionFixed sibling'", + "bounds": [50, 100], + "contentsOpaque": true, + "backgroundColor": "#008000", + "transform": 32 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='sibling-fixed-sibling-grandchildren' class='positionFixed sibling'", + "bounds": [50, 100], + "contentsOpaque": true, + "backgroundColor": "#008000", + "transform": 33 + }, + { + "name": "LayoutBlockFlow (positioned) DIV id='sibling-fixed-sibling' class='positionFixed sibling'", + "bounds": [50, 100], + "contentsOpaque": true, + "backgroundColor": "#008000", + "transform": 34 + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-absolute-grandchildren-not-contained' class='scrolled onTop'", + "position": [6, 62], + "bounds": [75, 80], + "contentsOpaqueForText": true, + "transform": 2 + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-absolute-sibling-grandchildren-not-contained' class='scrolled onTop'", + "position": [6, 62], + "bounds": [75, 80], + "contentsOpaqueForText": true, + "transform": 8 + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-absolute-sibling-grandchildren' class='scrolled onTop'", + "position": [6, 62], + "bounds": [75, 80], + "contentsOpaqueForText": true, + "transform": 10 + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-absolute-sibling-not-contained' class='scrolled onTop'", + "position": [6, 62], + "bounds": [75, 80], + "contentsOpaqueForText": true, + "transform": 12 + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-absolute-sibling' class='scrolled onTop'", + "position": [6, 62], + "bounds": [75, 80], + "contentsOpaqueForText": true, + "transform": 14 + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-absolute' class='scrolled onTop'", + "position": [6, 62], + "bounds": [75, 80], + "contentsOpaqueForText": true, + "transform": 16 + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-fixed-sibling-grandchildren' class='scrolled onTop'", + "position": [6, 62], + "bounds": [75, 80], + "contentsOpaqueForText": true, + "transform": 18 + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-fixed-sibling' class='scrolled onTop'", + "position": [6, 62], + "bounds": [75, 80], + "contentsOpaqueForText": true, + "transform": 22 + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-fixed-grandchildren' class='scrolled onTop'", + "position": [6, 62], + "bounds": [75, 80], + "contentsOpaqueForText": true, + "transform": 24 + }, + { + "name": "LayoutBlockFlow (relative positioned) DIV id='scrolled-fixed' class='scrolled onTop'", + "position": [6, 62], + "bounds": [75, 80], + "contentsOpaqueForText": true, + "transform": 28 + }, + { + "name": "VerticalScrollbar", + "position": [785, 0], + "bounds": [15, 600] + } + ], + "transforms": [ + { + "id": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [10, 10, 0, 1] + ] + }, + { + "id": 2, + "parent": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -59, 0, 1] + ] + }, + { + "id": 3, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [130, 10, 0, 1] + ] + }, + { + "id": 4, + "parent": 3, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -59, 0, 1] + ] + }, + { + "id": 5, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [250, 10, 0, 1] + ] + }, + { + "id": 6, + "parent": 5, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -59, 0, 1] + ] + }, + { + "id": 7, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [370, 10, 0, 1] + ] + }, + { + "id": 8, + "parent": 7, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -59, 0, 1] + ] + }, + { + "id": 9, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [10, 130, 0, 1] + ] + }, + { + "id": 10, + "parent": 9, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -59, 0, 1] + ] + }, + { + "id": 11, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [130, 130, 0, 1] + ] + }, + { + "id": 12, + "parent": 11, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -59, 0, 1] + ] + }, + { + "id": 13, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [250, 130, 0, 1] + ] + }, + { + "id": 14, + "parent": 13, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -59, 0, 1] + ] + }, + { + "id": 15, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [370, 130, 0, 1] + ] + }, + { + "id": 16, + "parent": 15, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -59, 0, 1] + ] + }, + { + "id": 17, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [10, 250, 0, 1] + ] + }, + { + "id": 18, + "parent": 17, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -59, 0, 1] + ] + }, + { + "id": 19, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [35, 315, 0, 1] + ] + }, + { + "id": 20, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [130, 250, 0, 1] + ] + }, + { + "id": 21, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [155, 315, 0, 1] + ] + }, + { + "id": 22, + "parent": 20, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -59, 0, 1] + ] + }, + { + "id": 23, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [250, 250, 0, 1] + ] + }, + { + "id": 24, + "parent": 23, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -59, 0, 1] + ] + }, + { + "id": 25, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [275, 315, 0, 1] + ] + }, + { + "id": 26, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [370, 250, 0, 1] + ] + }, + { + "id": 27, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [395, 315, 0, 1] + ] + }, + { + "id": 28, + "parent": 26, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -59, 0, 1] + ] + }, + { + "id": 29, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [375, 20, 0, 1] + ] + }, + { + "id": 30, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [15, 140, 0, 1] + ] + }, + { + "id": 31, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [135, 140, 0, 1] + ] + }, + { + "id": 32, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [255, 140, 0, 1] + ] + }, + { + "id": 33, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [15, 260, 0, 1] + ] + }, + { + "id": 34, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [135, 260, 0, 1] + ] + } + ] +} +
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png deleted file mode 100644 index 6efbcc6..0000000 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/scroll-unification-prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/scroll-unification-prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png deleted file mode 100644 index 6efbcc6..0000000 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/scroll-unification-prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/scroll-unification/scrollbars/custom-scrollbar-with-incomplete-style-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/scroll-unification/scrollbars/custom-scrollbar-with-incomplete-style-expected.png deleted file mode 100644 index 6efbcc6..0000000 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/virtual/scroll-unification/scrollbars/custom-scrollbar-with-incomplete-style-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/highdpi/compositing/overflow/overflow-auto-with-touch-expected.txt b/third_party/blink/web_tests/flag-specific/highdpi/compositing/overflow/overflow-auto-with-touch-expected.txt index 30ec1052..4aeddf1 100644 --- a/third_party/blink/web_tests/flag-specific/highdpi/compositing/overflow/overflow-auto-with-touch-expected.txt +++ b/third_party/blink/web_tests/flag-specific/highdpi/compositing/overflow/overflow-auto-with-touch-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [1500, 1500], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 428], "bounds": [428, 22], @@ -30,13 +37,6 @@ "bounds": [22, 22], "contentsOpaque": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='scroller'", - "bounds": [1500, 1500], - "contentsOpaque": true, - "backgroundColor": "#C0C0C0", - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/flag-specific/highdpi/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt b/third_party/blink/web_tests/flag-specific/highdpi/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt index 30ec1052..4aeddf1 100644 --- a/third_party/blink/web_tests/flag-specific/highdpi/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt +++ b/third_party/blink/web_tests/flag-specific/highdpi/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [1500, 1500], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 428], "bounds": [428, 22], @@ -30,13 +37,6 @@ "bounds": [22, 22], "contentsOpaque": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='scroller'", - "bounds": [1500, 1500], - "contentsOpaque": true, - "backgroundColor": "#C0C0C0", - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/flag-specific/highdpi/fast/overflow/overflow-float-stacking-expected.png b/third_party/blink/web_tests/flag-specific/highdpi/fast/overflow/overflow-float-stacking-expected.png deleted file mode 100644 index a2d7e3e7..0000000 --- a/third_party/blink/web_tests/flag-specific/highdpi/fast/overflow/overflow-float-stacking-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/highdpi/fast/overflow/overflow-stacking-expected.png b/third_party/blink/web_tests/flag-specific/highdpi/fast/overflow/overflow-stacking-expected.png deleted file mode 100644 index 0cd8d63..0000000 --- a/third_party/blink/web_tests/flag-specific/highdpi/fast/overflow/overflow-stacking-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/highdpi/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt b/third_party/blink/web_tests/flag-specific/highdpi/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt index 92739f6..86a08ca 100644 --- a/third_party/blink/web_tests/flag-specific/highdpi/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt +++ b/third_party/blink/web_tests/flag-specific/highdpi/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt
@@ -13,12 +13,6 @@ "transform": 2 }, { - "name": "VerticalScrollbar", - "position": [518, 0], - "bounds": [22, 960], - "transform": 2 - }, - { "name": "LayoutNGBlockFlow MAT id='scroller'", "position": [0, 27], "bounds": [518, 3000], @@ -27,6 +21,12 @@ "transform": 3 }, { + "name": "VerticalScrollbar", + "position": [518, 0], + "bounds": [22, 960], + "transform": 2 + }, + { "name": "LayoutNGBlockFlow (sticky positioned) DIV id='sticky'", "bounds": [518, 27], "transform": 4
diff --git a/third_party/blink/web_tests/flag-specific/highdpi/virtual/backface-visibility-interop/compositing/overflow/overflow-auto-with-touch-expected.txt b/third_party/blink/web_tests/flag-specific/highdpi/virtual/backface-visibility-interop/compositing/overflow/overflow-auto-with-touch-expected.txt index 30ec1052..4aeddf1 100644 --- a/third_party/blink/web_tests/flag-specific/highdpi/virtual/backface-visibility-interop/compositing/overflow/overflow-auto-with-touch-expected.txt +++ b/third_party/blink/web_tests/flag-specific/highdpi/virtual/backface-visibility-interop/compositing/overflow/overflow-auto-with-touch-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [1500, 1500], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 428], "bounds": [428, 22], @@ -30,13 +37,6 @@ "bounds": [22, 22], "contentsOpaque": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='scroller'", - "bounds": [1500, 1500], - "contentsOpaque": true, - "backgroundColor": "#C0C0C0", - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/flag-specific/highdpi/virtual/backface-visibility-interop/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt b/third_party/blink/web_tests/flag-specific/highdpi/virtual/backface-visibility-interop/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt index 30ec1052..4aeddf1 100644 --- a/third_party/blink/web_tests/flag-specific/highdpi/virtual/backface-visibility-interop/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt +++ b/third_party/blink/web_tests/flag-specific/highdpi/virtual/backface-visibility-interop/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [1500, 1500], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 428], "bounds": [428, 22], @@ -30,13 +37,6 @@ "bounds": [22, 22], "contentsOpaque": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='scroller'", - "bounds": [1500, 1500], - "contentsOpaque": true, - "backgroundColor": "#C0C0C0", - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/flag-specific/highdpi/virtual/backface-visibility-interop/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt b/third_party/blink/web_tests/flag-specific/highdpi/virtual/backface-visibility-interop/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt index 92739f6..86a08ca 100644 --- a/third_party/blink/web_tests/flag-specific/highdpi/virtual/backface-visibility-interop/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt +++ b/third_party/blink/web_tests/flag-specific/highdpi/virtual/backface-visibility-interop/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt
@@ -13,12 +13,6 @@ "transform": 2 }, { - "name": "VerticalScrollbar", - "position": [518, 0], - "bounds": [22, 960], - "transform": 2 - }, - { "name": "LayoutNGBlockFlow MAT id='scroller'", "position": [0, 27], "bounds": [518, 3000], @@ -27,6 +21,12 @@ "transform": 3 }, { + "name": "VerticalScrollbar", + "position": [518, 0], + "bounds": [22, 960], + "transform": 2 + }, + { "name": "LayoutNGBlockFlow (sticky positioned) DIV id='sticky'", "bounds": [518, 27], "transform": 4
diff --git a/third_party/blink/web_tests/flag-specific/highdpi/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt b/third_party/blink/web_tests/flag-specific/highdpi/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt index 92739f6..86a08ca 100644 --- a/third_party/blink/web_tests/flag-specific/highdpi/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt +++ b/third_party/blink/web_tests/flag-specific/highdpi/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt
@@ -13,12 +13,6 @@ "transform": 2 }, { - "name": "VerticalScrollbar", - "position": [518, 0], - "bounds": [22, 960], - "transform": 2 - }, - { "name": "LayoutNGBlockFlow MAT id='scroller'", "position": [0, 27], "bounds": [518, 3000], @@ -27,6 +21,12 @@ "transform": 3 }, { + "name": "VerticalScrollbar", + "position": [518, 0], + "bounds": [22, 960], + "transform": 2 + }, + { "name": "LayoutNGBlockFlow (sticky positioned) DIV id='sticky'", "bounds": [518, 27], "transform": 4
diff --git a/third_party/blink/web_tests/http/tests/html/resources/validation-bubble-oopif-long-message-iframe-truncated.html b/third_party/blink/web_tests/http/tests/html/resources/validation-bubble-oopif-long-message-iframe-truncated.html new file mode 100644 index 0000000..b17f424 --- /dev/null +++ b/third_party/blink/web_tests/http/tests/html/resources/validation-bubble-oopif-long-message-iframe-truncated.html
@@ -0,0 +1,7 @@ +<!DOCTYPE html> +<input> +<script> +const input = document.querySelector('input'); +input.setCustomValidity('foo'.repeat(85) + 'f...'); +input.reportValidity(); +</script>
diff --git a/third_party/blink/web_tests/http/tests/html/resources/validation-bubble-oopif-long-message-iframe.html b/third_party/blink/web_tests/http/tests/html/resources/validation-bubble-oopif-long-message-iframe.html new file mode 100644 index 0000000..74f47ea7 --- /dev/null +++ b/third_party/blink/web_tests/http/tests/html/resources/validation-bubble-oopif-long-message-iframe.html
@@ -0,0 +1,7 @@ +<!DOCTYPE html> +<input> +<script> +const input = document.querySelector('input'); +input.setCustomValidity('foo'.repeat(100)); +input.reportValidity(); +</script>
diff --git a/third_party/blink/web_tests/http/tests/html/validation-bubble-oopif-long-message-expected.html b/third_party/blink/web_tests/http/tests/html/validation-bubble-oopif-long-message-expected.html new file mode 100644 index 0000000..8d7465c --- /dev/null +++ b/third_party/blink/web_tests/http/tests/html/validation-bubble-oopif-long-message-expected.html
@@ -0,0 +1,3 @@ +<!DOCTYPE html> +<p>Cross origin validation bubbles should be truncated.</p> +<iframe src="http://127.0.0.1:8000/html/resources/validation-bubble-oopif-long-message-iframe-truncated.html"></iframe>
diff --git a/third_party/blink/web_tests/http/tests/html/validation-bubble-oopif-long-message.html b/third_party/blink/web_tests/http/tests/html/validation-bubble-oopif-long-message.html new file mode 100644 index 0000000..ec7dc432 --- /dev/null +++ b/third_party/blink/web_tests/http/tests/html/validation-bubble-oopif-long-message.html
@@ -0,0 +1,7 @@ +<!DOCTYPE html> +<link rel=author href="mailto:jarhar@chromium.org"> +<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1261191"> +<link rel=match href="validation-bubble-oopif-long-message-expected.html"> + +<p>Cross origin validation bubbles should be truncated.</p> +<iframe src="http://127.0.0.1:8080/html/resources/validation-bubble-oopif-long-message-iframe.html"></iframe>
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.txt b/third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.txt index 4c4e580..58183fa 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.txt +++ b/third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.txt
@@ -14,6 +14,14 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV id='scroller'", + "position": [1, 26], + "bounds": [185, 1000], + "contentsOpaqueForText": true, + "drawsContent": false, + "transform": 2 + }, + { "name": "HorizontalScrollbar", "position": [1, 186], "bounds": [200, 15], @@ -25,14 +33,6 @@ "position": [186, 1], "bounds": [15, 185], "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV id='scroller'", - "position": [1, 26], - "bounds": [185, 1000], - "contentsOpaqueForText": true, - "drawsContent": false, - "transform": 2 } ], "transforms": [
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/updating-scrolling-content-expected.txt b/third_party/blink/web_tests/paint/invalidation/compositing/updating-scrolling-content-expected.txt index b9a9a0e..e548140 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/updating-scrolling-content-expected.txt +++ b/third_party/blink/web_tests/paint/invalidation/compositing/updating-scrolling-content-expected.txt
@@ -13,6 +13,15 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV id='scroller'", + "bounds": [185, 1200], + "contentsOpaqueForText": true, + "invalidations": [ + [0, 0, 185, 200] + ], + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 185], "bounds": [200, 15], @@ -24,15 +33,6 @@ "position": [185, 0], "bounds": [15, 185], "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV id='scroller'", - "bounds": [185, 1200], - "contentsOpaqueForText": true, - "invalidations": [ - [0, 0, 185, 200] - ], - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/text/input-text-scroll-left-on-blur-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/text/input-text-scroll-left-on-blur-expected.png index 9fc0b5b2..acb33e8 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/text/input-text-scroll-left-on-blur-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/text/input-text-scroll-left-on-blur-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/text/textfield-outline-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/text/textfield-outline-expected.png index 3839dd0..99501d2 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/text/textfield-outline-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/text/textfield-outline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-float-stacking-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-float-stacking-expected.png deleted file mode 100644 index af88aba..0000000 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-float-stacking-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-stacking-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-stacking-expected.png deleted file mode 100644 index 1b36f6b..0000000 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-stacking-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt index bd3500f8..870f93f 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt
@@ -15,6 +15,12 @@ [0, 0, 1, 16] ], "transform": 1 + }, + { + "name": "LayoutNGTextControlSingleLine INPUT id='target'", + "position": [378, 7], + "bounds": [30, 24], + "contentsOpaqueForText": true } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt index 8abac62..ce46d48 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt
@@ -26,6 +26,16 @@ [0, 0, 1, 16] ], "transform": 2 + }, + { + "name": "LayoutNGTextControlSingleLine INPUT id='root'", + "position": [-1, -1], + "bounds": [67, 24], + "contentsOpaqueForText": true, + "invalidations": [ + [0, 0, 67, 24] + ], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt index 8abac62..ce46d48 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt
@@ -26,6 +26,16 @@ [0, 0, 1, 16] ], "transform": 2 + }, + { + "name": "LayoutNGTextControlSingleLine INPUT id='root'", + "position": [-1, -1], + "bounds": [67, 24], + "contentsOpaqueForText": true, + "invalidations": [ + [0, 0, 67, 24] + ], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/linux/scrollbars/custom-scrollbar-with-incomplete-style-expected.png b/third_party/blink/web_tests/platform/linux/scrollbars/custom-scrollbar-with-incomplete-style-expected.png index 6efbcc6..d4ce951 100644 --- a/third_party/blink/web_tests/platform/linux/scrollbars/custom-scrollbar-with-incomplete-style-expected.png +++ b/third_party/blink/web_tests/platform/linux/scrollbars/custom-scrollbar-with-incomplete-style-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/backface-visibility-interop/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt b/third_party/blink/web_tests/platform/linux/virtual/backface-visibility-interop/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt index bd3500f8..870f93f 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/backface-visibility-interop/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt +++ b/third_party/blink/web_tests/platform/linux/virtual/backface-visibility-interop/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt
@@ -15,6 +15,12 @@ [0, 0, 1, 16] ], "transform": 1 + }, + { + "name": "LayoutNGTextControlSingleLine INPUT id='target'", + "position": [378, 7], + "bounds": [30, 24], + "contentsOpaqueForText": true } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/linux/virtual/backface-visibility-interop/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt b/third_party/blink/web_tests/platform/linux/virtual/backface-visibility-interop/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt index 8abac62..ce46d48 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/backface-visibility-interop/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt +++ b/third_party/blink/web_tests/platform/linux/virtual/backface-visibility-interop/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt
@@ -26,6 +26,16 @@ [0, 0, 1, 16] ], "transform": 2 + }, + { + "name": "LayoutNGTextControlSingleLine INPUT id='root'", + "position": [-1, -1], + "bounds": [67, 24], + "contentsOpaqueForText": true, + "invalidations": [ + [0, 0, 67, 24] + ], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/linux/virtual/backface-visibility-interop/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt b/third_party/blink/web_tests/platform/linux/virtual/backface-visibility-interop/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt index 8abac62..ce46d48 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/backface-visibility-interop/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt +++ b/third_party/blink/web_tests/platform/linux/virtual/backface-visibility-interop/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt
@@ -26,6 +26,16 @@ [0, 0, 1, 16] ], "transform": 2 + }, + { + "name": "LayoutNGTextControlSingleLine INPUT id='root'", + "position": [-1, -1], + "bounds": [67, 24], + "contentsOpaqueForText": true, + "invalidations": [ + [0, 0, 67, 24] + ], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png index 6efbcc6..d4ce951 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scroll-unification-prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scroll-unification-prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png index 6efbcc6..d4ce951 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scroll-unification-prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scroll-unification-prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-with-incomplete-style-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scroll-unification/scrollbars/custom-scrollbar-with-incomplete-style-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scroll-unification/scrollbars/custom-scrollbar-with-incomplete-style-expected.png index 6efbcc6..d4ce951 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scroll-unification/scrollbars/custom-scrollbar-with-incomplete-style-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scroll-unification/scrollbars/custom-scrollbar-with-incomplete-style-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt index 9ce3ccab..78b2dd46 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt
@@ -13,12 +13,6 @@ "transform": 2 }, { - "name": "VerticalScrollbar", - "position": [345, 0], - "bounds": [15, 640], - "transform": 2 - }, - { "name": "LayoutNGBlockFlow MAT id='scroller'", "position": [0, 18], "bounds": [345, 2000], @@ -27,6 +21,12 @@ "transform": 3 }, { + "name": "VerticalScrollbar", + "position": [345, 0], + "bounds": [15, 640], + "transform": 2 + }, + { "name": "LayoutNGBlockFlow (sticky positioned) DIV id='sticky'", "bounds": [345, 18], "transform": 4
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt index 74a5897..4146b889 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 285], "bounds": [285, 15], @@ -30,13 +37,6 @@ "bounds": [15, 15], "contentsOpaqueForText": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='scroller'", - "bounds": [1000, 1000], - "contentsOpaque": true, - "backgroundColor": "#C0C0C0", - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt index 74a5897..4146b889 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 285], "bounds": [285, 15], @@ -30,13 +37,6 @@ "bounds": [15, 15], "contentsOpaqueForText": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='scroller'", - "bounds": [1000, 1000], - "contentsOpaque": true, - "backgroundColor": "#C0C0C0", - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.15/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt new file mode 100644 index 0000000..78b2dd46 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.15/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt
@@ -0,0 +1,84 @@ +{ + "layers": [ + { + "name": "Scrolling background of LayoutView #document", + "bounds": [785, 656], + "contentsOpaque": true, + "backgroundColor": "#FFFFFF" + }, + { + "name": "LayoutNGBlockFlow MAT id='scroller'", + "bounds": [345, 640], + "drawsContent": false, + "transform": 2 + }, + { + "name": "LayoutNGBlockFlow MAT id='scroller'", + "position": [0, 18], + "bounds": [345, 2000], + "contentsOpaqueForText": true, + "drawsContent": false, + "transform": 3 + }, + { + "name": "VerticalScrollbar", + "position": [345, 0], + "bounds": [15, 640], + "transform": 2 + }, + { + "name": "LayoutNGBlockFlow (sticky positioned) DIV id='sticky'", + "bounds": [345, 18], + "transform": 4 + }, + { + "name": "VerticalScrollbar", + "position": [785, 0], + "bounds": [15, 600] + } + ], + "transforms": [ + { + "id": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, -0.1], + [0, 0, 0, 1] + ], + "origin": [188, 328] + }, + { + "id": 2, + "parent": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [8, 8, 0, 1] + ], + "flattenInheritedTransform": false + }, + { + "id": 3, + "parent": 2, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -35, 0, 1] + ] + }, + { + "id": 4, + "parent": 3, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, 35, 0, 1] + ] + } + ] +} +
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt b/third_party/blink/web_tests/platform/mac-mac11-arm64/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt new file mode 100644 index 0000000..78b2dd46 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt
@@ -0,0 +1,84 @@ +{ + "layers": [ + { + "name": "Scrolling background of LayoutView #document", + "bounds": [785, 656], + "contentsOpaque": true, + "backgroundColor": "#FFFFFF" + }, + { + "name": "LayoutNGBlockFlow MAT id='scroller'", + "bounds": [345, 640], + "drawsContent": false, + "transform": 2 + }, + { + "name": "LayoutNGBlockFlow MAT id='scroller'", + "position": [0, 18], + "bounds": [345, 2000], + "contentsOpaqueForText": true, + "drawsContent": false, + "transform": 3 + }, + { + "name": "VerticalScrollbar", + "position": [345, 0], + "bounds": [15, 640], + "transform": 2 + }, + { + "name": "LayoutNGBlockFlow (sticky positioned) DIV id='sticky'", + "bounds": [345, 18], + "transform": 4 + }, + { + "name": "VerticalScrollbar", + "position": [785, 0], + "bounds": [15, 600] + } + ], + "transforms": [ + { + "id": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, -0.1], + [0, 0, 0, 1] + ], + "origin": [188, 328] + }, + { + "id": 2, + "parent": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [8, 8, 0, 1] + ], + "flattenInheritedTransform": false + }, + { + "id": 3, + "parent": 2, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -35, 0, 1] + ] + }, + { + "id": 4, + "parent": 3, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, 35, 0, 1] + ] + } + ] +} +
diff --git a/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt b/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt index b831b12..7307c275 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt +++ b/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt
@@ -16,6 +16,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='scrollable bigBox'", + "position": [1, 1], + "bounds": [285, 800], + "contentsOpaque": true, + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [1, 286], "bounds": [300, 15], @@ -29,13 +36,6 @@ "transform": 1 }, { - "name": "LayoutNGBlockFlow DIV class='scrollable bigBox'", - "position": [1, 1], - "bounds": [285, 800], - "contentsOpaque": true, - "transform": 1 - }, - { "name": "LayoutNGBlockFlow (positioned) DIV class='fixed lime box'", "position": [10, 100], "bounds": [100, 100],
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-auto-with-touch-expected.txt b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-auto-with-touch-expected.txt index 74a5897..4146b889 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-auto-with-touch-expected.txt +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-auto-with-touch-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 285], "bounds": [285, 15], @@ -30,13 +37,6 @@ "bounds": [15, 15], "contentsOpaqueForText": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='scroller'", - "bounds": [1000, 1000], - "contentsOpaque": true, - "backgroundColor": "#C0C0C0", - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt index 74a5897..4146b889 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 285], "bounds": [285, 15], @@ -30,13 +37,6 @@ "bounds": [15, 15], "contentsOpaqueForText": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='scroller'", - "bounds": [1000, 1000], - "contentsOpaque": true, - "backgroundColor": "#C0C0C0", - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/blink/web_tests/platform/mac/compositing/overflow/textarea-scroll-touch-expected.txt index f839ce61..3f77449f 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/textarea-scroll-touch-expected.txt +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -17,8 +17,7 @@ { "name": "Scroll corner of LayoutNGTextControlMultiLine TEXTAREA", "position": [193, 18], - "bounds": [261, 126], - "contentsOpaqueForText": true + "bounds": [261, 140] }, { "name": "LayoutNGTextControlMultiLine TEXTAREA",
diff --git a/third_party/blink/web_tests/platform/mac/fast/overflow/overflow-float-stacking-expected.png b/third_party/blink/web_tests/platform/mac/fast/overflow/overflow-float-stacking-expected.png deleted file mode 100644 index fbb1db9..0000000 --- a/third_party/blink/web_tests/platform/mac/fast/overflow/overflow-float-stacking-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/overflow/overflow-stacking-expected.png b/third_party/blink/web_tests/platform/mac/fast/overflow/overflow-stacking-expected.png deleted file mode 100644 index bdcdd63..0000000 --- a/third_party/blink/web_tests/platform/mac/fast/overflow/overflow-stacking-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.txt index f973ad9..6ee1cf68 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.txt
@@ -13,6 +13,16 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV id='container'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#008000", + "invalidations": [ + [0, 0, 1000, 1000] + ], + "transform": 2 + }, + { "name": "HorizontalScrollbar", "position": [0, 285], "bounds": [385, 15], @@ -30,16 +40,6 @@ "bounds": [15, 15], "contentsOpaqueForText": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV id='container'", - "bounds": [1000, 1000], - "contentsOpaque": true, - "backgroundColor": "#008000", - "invalidations": [ - [0, 0, 1000, 1000] - ], - "transform": 2 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/text-match-highlight-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/text-match-highlight-expected.txt index 1647f6f..f9c16c56 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/text-match-highlight-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/text-match-highlight-expected.txt
@@ -16,19 +16,6 @@ "transform": 1 }, { - "name": "HorizontalScrollbar", - "position": [0, 485], - "bounds": [800, 15], - "contentsOpaqueForText": true, - "transform": 1 - }, - { - "name": "VerticalScrollbar", - "position": [785, 0], - "bounds": [15, 485], - "transform": 1 - }, - { "name": "LayoutNGBlockFlow DIV", "bounds": [785, 1340], "invalidations": [ @@ -41,6 +28,19 @@ [52, 18, 45, 18] ], "transform": 1 + }, + { + "name": "HorizontalScrollbar", + "position": [0, 485], + "bounds": [800, 15], + "contentsOpaqueForText": true, + "transform": 1 + }, + { + "name": "VerticalScrollbar", + "position": [785, 0], + "bounds": [15, 485], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-container-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-container-expected.txt index 3921eaa..4fd0bd7d 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-container-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-container-expected.txt
@@ -17,6 +17,12 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV id='container'", + "position": [5, 5], + "bounds": [400, 400], + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [5, 190], "bounds": [185, 15], @@ -34,12 +40,6 @@ "bounds": [15, 15], "contentsOpaqueForText": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV id='container'", - "position": [5, 5], - "bounds": [400, 400], - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/vertical-overflow-child-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/vertical-overflow-child-expected.txt index e1b39c1..becf587 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/vertical-overflow-child-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/vertical-overflow-child-expected.txt
@@ -14,6 +14,16 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='container'", + "position": [1, 1], + "bounds": [2100, 100], + "contentsOpaqueForText": true, + "invalidations": [ + [2000, 0, 100, 100] + ], + "transform": 2 + }, + { "name": "HorizontalScrollbar", "position": [1, 186], "bounds": [285, 15], @@ -25,16 +35,6 @@ "bounds": [15, 200], "contentsOpaqueForText": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='container'", - "position": [1, 1], - "bounds": [2100, 100], - "contentsOpaqueForText": true, - "invalidations": [ - [2000, 0, 100, 100] - ], - "transform": 2 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/vertical-overflow-parent-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/vertical-overflow-parent-expected.txt index 73ff67c..8ed52f00 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/vertical-overflow-parent-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/vertical-overflow-parent-expected.txt
@@ -14,6 +14,16 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='container'", + "position": [1, 1], + "bounds": [2100, 100], + "contentsOpaqueForText": true, + "invalidations": [ + [0, 0, 100, 100] + ], + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [1, 186], "bounds": [285, 15], @@ -25,16 +35,6 @@ "bounds": [15, 200], "contentsOpaqueForText": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='container'", - "position": [1, 1], - "bounds": [2100, 100], - "contentsOpaqueForText": true, - "invalidations": [ - [0, 0, 100, 100] - ], - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/vertical-overflow-same-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/vertical-overflow-same-expected.txt index 9eac869..2e4fc76 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/vertical-overflow-same-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/vertical-overflow-same-expected.txt
@@ -14,6 +14,16 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='vertical-rl container'", + "position": [1, 1], + "bounds": [2100, 100], + "contentsOpaqueForText": true, + "invalidations": [ + [0, 0, 100, 100] + ], + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [1, 186], "bounds": [285, 15], @@ -25,16 +35,6 @@ "bounds": [15, 200], "contentsOpaqueForText": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='vertical-rl container'", - "position": [1, 1], - "bounds": [2100, 100], - "contentsOpaqueForText": true, - "invalidations": [ - [0, 0, 100, 100] - ], - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt index 6da51e38..35bdb3c 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt
@@ -15,6 +15,12 @@ [0, 0, 1, 15] ], "transform": 1 + }, + { + "name": "LayoutNGTextControlSingleLine INPUT id='target'", + "position": [386, 7], + "bounds": [30, 23], + "contentsOpaqueForText": true } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt index b3d0a23..bb1c587 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt
@@ -26,6 +26,16 @@ [0, 0, 1, 15] ], "transform": 2 + }, + { + "name": "LayoutNGTextControlSingleLine INPUT id='root'", + "position": [-1, -1], + "bounds": [50, 23], + "contentsOpaqueForText": true, + "invalidations": [ + [0, 0, 50, 23] + ], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt index b3d0a23..bb1c587 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt
@@ -26,6 +26,16 @@ [0, 0, 1, 15] ], "transform": 2 + }, + { + "name": "LayoutNGTextControlSingleLine INPUT id='root'", + "position": [-1, -1], + "bounds": [50, 23], + "contentsOpaqueForText": true, + "invalidations": [ + [0, 0, 50, 23] + ], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/overflow-auto-in-overflow-auto-scrolled-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/overflow-auto-in-overflow-auto-scrolled-expected.txt index d1be11a0..e49a1b1 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/overflow-auto-in-overflow-auto-scrolled-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/overflow-auto-in-overflow-auto-scrolled-expected.txt
@@ -13,12 +13,6 @@ "transform": 1 }, { - "name": "VerticalScrollbar", - "position": [769, 0], - "bounds": [15, 300], - "transform": 1 - }, - { "name": "LayoutNGBlockFlow DIV id='outerDiv'", "bounds": [769, 700], "contentsOpaqueForText": true, @@ -31,17 +25,23 @@ "transform": 3 }, { + "name": "LayoutNGBlockFlow DIV id='innerDiv'", + "bounds": [300, 800], + "contentsOpaque": true, + "backgroundColor": "#008000", + "transform": 4 + }, + { "name": "VerticalScrollbar", "position": [754, 0], "bounds": [15, 400], "transform": 3 }, { - "name": "LayoutNGBlockFlow DIV id='innerDiv'", - "bounds": [300, 800], - "contentsOpaque": true, - "backgroundColor": "#008000", - "transform": 4 + "name": "VerticalScrollbar", + "position": [769, 0], + "bounds": [15, 300], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/overflow-scroll-in-overflow-scroll-scrolled-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/overflow-scroll-in-overflow-scroll-scrolled-expected.txt index d1be11a0..e49a1b1 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/overflow-scroll-in-overflow-scroll-scrolled-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/overflow-scroll-in-overflow-scroll-scrolled-expected.txt
@@ -13,12 +13,6 @@ "transform": 1 }, { - "name": "VerticalScrollbar", - "position": [769, 0], - "bounds": [15, 300], - "transform": 1 - }, - { "name": "LayoutNGBlockFlow DIV id='outerDiv'", "bounds": [769, 700], "contentsOpaqueForText": true, @@ -31,17 +25,23 @@ "transform": 3 }, { + "name": "LayoutNGBlockFlow DIV id='innerDiv'", + "bounds": [300, 800], + "contentsOpaque": true, + "backgroundColor": "#008000", + "transform": 4 + }, + { "name": "VerticalScrollbar", "position": [754, 0], "bounds": [15, 400], "transform": 3 }, { - "name": "LayoutNGBlockFlow DIV id='innerDiv'", - "bounds": [300, 800], - "contentsOpaque": true, - "backgroundColor": "#008000", - "transform": 4 + "name": "VerticalScrollbar", + "position": [769, 0], + "bounds": [15, 300], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/scrollbar-ancestor-clip-change-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/scrollbar-ancestor-clip-change-expected.txt index 768e500..e51fc7b 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/scrollbar-ancestor-clip-change-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/scrollbar-ancestor-clip-change-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV id='target'", + "bounds": [400, 400], + "contentsOpaqueForText": true, + "drawsContent": false, + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 185], "bounds": [85, 15], @@ -33,13 +40,6 @@ [0, 0, 15, 15] ], "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV id='target'", - "bounds": [400, 400], - "contentsOpaqueForText": true, - "drawsContent": false, - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/scrollbar-damage-and-full-viewport-repaint-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/scrollbar-damage-and-full-viewport-repaint-expected.txt index cf98a16..5c01d1ad 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/scrollbar-damage-and-full-viewport-repaint-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/scrollbar-damage-and-full-viewport-repaint-expected.txt
@@ -18,6 +18,14 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV id='container'", + "position": [1, 1], + "bounds": [2000, 2000], + "contentsOpaqueForText": true, + "drawsContent": false, + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [1, 186], "bounds": [185, 15], @@ -38,14 +46,6 @@ [0, 0, 15, 15] ], "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV id='container'", - "position": [1, 1], - "bounds": [2000, 2000], - "contentsOpaqueForText": true, - "drawsContent": false, - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/scrollbar-parts-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/scrollbar-parts-expected.txt index 367fb46..5c4cbcd 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/scrollbar-parts-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/scrollbar-parts-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV", + "bounds": [150, 300], + "contentsOpaqueForText": true, + "drawsContent": false, + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 85], "bounds": [85, 15], @@ -30,13 +37,6 @@ "bounds": [15, 15], "contentsOpaqueForText": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV", - "bounds": [150, 300], - "contentsOpaqueForText": true, - "drawsContent": false, - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt index 9ce3ccab..78b2dd46 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt
@@ -13,12 +13,6 @@ "transform": 2 }, { - "name": "VerticalScrollbar", - "position": [345, 0], - "bounds": [15, 640], - "transform": 2 - }, - { "name": "LayoutNGBlockFlow MAT id='scroller'", "position": [0, 18], "bounds": [345, 2000], @@ -27,6 +21,12 @@ "transform": 3 }, { + "name": "VerticalScrollbar", + "position": [345, 0], + "bounds": [15, 640], + "transform": 2 + }, + { "name": "LayoutNGBlockFlow (sticky positioned) DIV id='sticky'", "bounds": [345, 18], "transform": 4
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/table/table-overflow-auto-in-overflow-auto-scrolled-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/table/table-overflow-auto-in-overflow-auto-scrolled-expected.txt index 8d07762..cf52cf893 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/table/table-overflow-auto-in-overflow-auto-scrolled-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/table/table-overflow-auto-in-overflow-auto-scrolled-expected.txt
@@ -13,12 +13,6 @@ "transform": 1 }, { - "name": "VerticalScrollbar", - "position": [769, 0], - "bounds": [15, 300], - "transform": 1 - }, - { "name": "LayoutNGBlockFlow DIV id='outerDiv'", "bounds": [769, 700], "contentsOpaqueForText": true, @@ -31,16 +25,22 @@ "transform": 3 }, { + "name": "LayoutNGBlockFlow DIV id='innerDiv'", + "bounds": [306, 810], + "contentsOpaqueForText": true, + "transform": 4 + }, + { "name": "VerticalScrollbar", "position": [754, 0], "bounds": [15, 400], "transform": 3 }, { - "name": "LayoutNGBlockFlow DIV id='innerDiv'", - "bounds": [306, 810], - "contentsOpaqueForText": true, - "transform": 4 + "name": "VerticalScrollbar", + "position": [769, 0], + "bounds": [15, 300], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/table/table-overflow-scroll-in-overflow-scroll-scrolled-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/table/table-overflow-scroll-in-overflow-scroll-scrolled-expected.txt index 8d07762..cf52cf893 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/table/table-overflow-scroll-in-overflow-scroll-scrolled-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/table/table-overflow-scroll-in-overflow-scroll-scrolled-expected.txt
@@ -13,12 +13,6 @@ "transform": 1 }, { - "name": "VerticalScrollbar", - "position": [769, 0], - "bounds": [15, 300], - "transform": 1 - }, - { "name": "LayoutNGBlockFlow DIV id='outerDiv'", "bounds": [769, 700], "contentsOpaqueForText": true, @@ -31,16 +25,22 @@ "transform": 3 }, { + "name": "LayoutNGBlockFlow DIV id='innerDiv'", + "bounds": [306, 810], + "contentsOpaqueForText": true, + "transform": 4 + }, + { "name": "VerticalScrollbar", "position": [754, 0], "bounds": [15, 400], "transform": 3 }, { - "name": "LayoutNGBlockFlow DIV id='innerDiv'", - "bounds": [306, 810], - "contentsOpaqueForText": true, - "transform": 4 + "name": "VerticalScrollbar", + "position": [769, 0], + "bounds": [15, 300], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/mac/virtual/backface-visibility-interop/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/backface-visibility-interop/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt new file mode 100644 index 0000000..78b2dd46 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/backface-visibility-interop/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt
@@ -0,0 +1,84 @@ +{ + "layers": [ + { + "name": "Scrolling background of LayoutView #document", + "bounds": [785, 656], + "contentsOpaque": true, + "backgroundColor": "#FFFFFF" + }, + { + "name": "LayoutNGBlockFlow MAT id='scroller'", + "bounds": [345, 640], + "drawsContent": false, + "transform": 2 + }, + { + "name": "LayoutNGBlockFlow MAT id='scroller'", + "position": [0, 18], + "bounds": [345, 2000], + "contentsOpaqueForText": true, + "drawsContent": false, + "transform": 3 + }, + { + "name": "VerticalScrollbar", + "position": [345, 0], + "bounds": [15, 640], + "transform": 2 + }, + { + "name": "LayoutNGBlockFlow (sticky positioned) DIV id='sticky'", + "bounds": [345, 18], + "transform": 4 + }, + { + "name": "VerticalScrollbar", + "position": [785, 0], + "bounds": [15, 600] + } + ], + "transforms": [ + { + "id": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, -0.1], + [0, 0, 0, 1] + ], + "origin": [188, 328] + }, + { + "id": 2, + "parent": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [8, 8, 0, 1] + ], + "flattenInheritedTransform": false + }, + { + "id": 3, + "parent": 2, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -35, 0, 1] + ] + }, + { + "id": 4, + "parent": 3, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, 35, 0, 1] + ] + } + ] +} +
diff --git a/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt b/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt index 44e76574..a194211d 100644 --- a/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt +++ b/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt
@@ -16,6 +16,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='scrollable bigBox'", + "position": [1, 1], + "bounds": [285, 800], + "contentsOpaque": true, + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [1, 286], "bounds": [300, 15], @@ -29,13 +36,6 @@ "transform": 1 }, { - "name": "LayoutNGBlockFlow DIV class='scrollable bigBox'", - "position": [1, 1], - "bounds": [285, 800], - "contentsOpaque": true, - "transform": 1 - }, - { "name": "LayoutNGBlockFlow (positioned) DIV class='fixed lime box'", "position": [10, 100], "bounds": [100, 100],
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/blink/web_tests/platform/win/compositing/overflow/textarea-scroll-touch-expected.txt index 2c45613a..9c61a61 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/textarea-scroll-touch-expected.txt +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -17,8 +17,7 @@ { "name": "Scroll corner of LayoutNGTextControlMultiLine TEXTAREA", "position": [193, 18], - "bounds": [261, 126], - "contentsOpaqueForText": true + "bounds": [261, 140] }, { "name": "LayoutNGTextControlMultiLine TEXTAREA",
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-float-stacking-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-float-stacking-expected.png deleted file mode 100644 index 31ac3257..0000000 --- a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-float-stacking-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-stacking-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-stacking-expected.png deleted file mode 100644 index afc1cad6..0000000 --- a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-stacking-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.txt b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.txt index ab73de17..1c2de1e 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.txt +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.txt
@@ -13,6 +13,16 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV id='container'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#008000", + "invalidations": [ + [0, 0, 1000, 1000] + ], + "transform": 2 + }, + { "name": "HorizontalScrollbar", "position": [0, 285], "bounds": [385, 15], @@ -30,16 +40,6 @@ "bounds": [15, 15], "contentsOpaque": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV id='container'", - "bounds": [1000, 1000], - "contentsOpaque": true, - "backgroundColor": "#008000", - "invalidations": [ - [0, 0, 1000, 1000] - ], - "transform": 2 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt index afb14ab..ddce7c6 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/caret-invalidation-in-overflow-scroll-expected.txt
@@ -15,6 +15,12 @@ [0, 0, 1, 16] ], "transform": 1 + }, + { + "name": "LayoutNGTextControlSingleLine INPUT id='target'", + "position": [360, 7], + "bounds": [30, 24], + "contentsOpaqueForText": true } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt index 584bf20..c374580 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/invalidate-caret-in-composited-scrolling-container-expected.txt
@@ -26,6 +26,16 @@ [0, 0, 1, 16] ], "transform": 2 + }, + { + "name": "LayoutNGTextControlSingleLine INPUT id='root'", + "position": [-1, -1], + "bounds": [74, 24], + "contentsOpaqueForText": true, + "invalidations": [ + [0, 0, 74, 24] + ], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt index 584bf20..c374580 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/invalidate-caret-in-non-composited-scrolling-container-expected.txt
@@ -26,6 +26,16 @@ [0, 0, 1, 16] ], "transform": 2 + }, + { + "name": "LayoutNGTextControlSingleLine INPUT id='root'", + "position": [-1, -1], + "bounds": [74, 24], + "contentsOpaqueForText": true, + "invalidations": [ + [0, 0, 74, 24] + ], + "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/win/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt b/third_party/blink/web_tests/platform/win/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt index 27f8829..2a75512 100644 --- a/third_party/blink/web_tests/platform/win/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt +++ b/third_party/blink/web_tests/platform/win/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt
@@ -13,12 +13,6 @@ "transform": 2 }, { - "name": "VerticalScrollbar", - "position": [345, 0], - "bounds": [15, 640], - "transform": 2 - }, - { "name": "LayoutNGBlockFlow MAT id='scroller'", "position": [0, 20], "bounds": [345, 2000], @@ -27,6 +21,12 @@ "transform": 3 }, { + "name": "VerticalScrollbar", + "position": [345, 0], + "bounds": [15, 640], + "transform": 2 + }, + { "name": "LayoutNGBlockFlow (sticky positioned) DIV id='sticky'", "bounds": [345, 20], "transform": 4
diff --git a/third_party/blink/web_tests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt b/third_party/blink/web_tests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt index 66e361c..a9d5c31 100644 --- a/third_party/blink/web_tests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt +++ b/third_party/blink/web_tests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 285], "bounds": [285, 15], @@ -30,13 +37,6 @@ "bounds": [15, 15], "contentsOpaque": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='scroller'", - "bounds": [1000, 1000], - "contentsOpaque": true, - "backgroundColor": "#C0C0C0", - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt b/third_party/blink/web_tests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt index 66e361c..a9d5c31 100644 --- a/third_party/blink/web_tests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt +++ b/third_party/blink/web_tests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt
@@ -13,6 +13,13 @@ "transform": 1 }, { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { "name": "HorizontalScrollbar", "position": [0, 285], "bounds": [285, 15], @@ -30,13 +37,6 @@ "bounds": [15, 15], "contentsOpaque": true, "transform": 1 - }, - { - "name": "LayoutNGBlockFlow DIV class='scroller'", - "bounds": [1000, 1000], - "contentsOpaque": true, - "backgroundColor": "#C0C0C0", - "transform": 1 } ], "transforms": [
diff --git a/third_party/blink/web_tests/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt b/third_party/blink/web_tests/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt new file mode 100644 index 0000000..78b2dd46 --- /dev/null +++ b/third_party/blink/web_tests/virtual/compositor_threaded_scrollbar_scrolling/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky-expected.txt
@@ -0,0 +1,84 @@ +{ + "layers": [ + { + "name": "Scrolling background of LayoutView #document", + "bounds": [785, 656], + "contentsOpaque": true, + "backgroundColor": "#FFFFFF" + }, + { + "name": "LayoutNGBlockFlow MAT id='scroller'", + "bounds": [345, 640], + "drawsContent": false, + "transform": 2 + }, + { + "name": "LayoutNGBlockFlow MAT id='scroller'", + "position": [0, 18], + "bounds": [345, 2000], + "contentsOpaqueForText": true, + "drawsContent": false, + "transform": 3 + }, + { + "name": "VerticalScrollbar", + "position": [345, 0], + "bounds": [15, 640], + "transform": 2 + }, + { + "name": "LayoutNGBlockFlow (sticky positioned) DIV id='sticky'", + "bounds": [345, 18], + "transform": 4 + }, + { + "name": "VerticalScrollbar", + "position": [785, 0], + "bounds": [15, 600] + } + ], + "transforms": [ + { + "id": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, -0.1], + [0, 0, 0, 1] + ], + "origin": [188, 328] + }, + { + "id": 2, + "parent": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [8, 8, 0, 1] + ], + "flattenInheritedTransform": false + }, + { + "id": 3, + "parent": 2, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, -35, 0, 1] + ] + }, + { + "id": 4, + "parent": 3, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, 35, 0, 1] + ] + } + ] +} +
diff --git a/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt b/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt new file mode 100644 index 0000000..4146b889 --- /dev/null +++ b/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt
@@ -0,0 +1,54 @@ +{ + "layers": [ + { + "name": "Scrolling background of LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "backgroundColor": "#FFFFFF" + }, + { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [285, 285], + "drawsContent": false, + "transform": 1 + }, + { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { + "name": "HorizontalScrollbar", + "position": [0, 285], + "bounds": [285, 15], + "transform": 1 + }, + { + "name": "VerticalScrollbar", + "position": [285, 0], + "bounds": [15, 285], + "transform": 1 + }, + { + "name": "Scroll corner of LayoutNGBlockFlow DIV class='scroller'", + "position": [285, 285], + "bounds": [15, 15], + "contentsOpaqueForText": true, + "transform": 1 + } + ], + "transforms": [ + { + "id": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [8, 8, 0, 1] + ] + } + ] +} +
diff --git a/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt b/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt new file mode 100644 index 0000000..4146b889 --- /dev/null +++ b/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt
@@ -0,0 +1,54 @@ +{ + "layers": [ + { + "name": "Scrolling background of LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "backgroundColor": "#FFFFFF" + }, + { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [285, 285], + "drawsContent": false, + "transform": 1 + }, + { + "name": "LayoutNGBlockFlow DIV class='scroller'", + "bounds": [1000, 1000], + "contentsOpaque": true, + "backgroundColor": "#C0C0C0", + "transform": 1 + }, + { + "name": "HorizontalScrollbar", + "position": [0, 285], + "bounds": [285, 15], + "transform": 1 + }, + { + "name": "VerticalScrollbar", + "position": [285, 0], + "bounds": [15, 285], + "transform": 1 + }, + { + "name": "Scroll corner of LayoutNGBlockFlow DIV class='scroller'", + "position": [285, 285], + "bounds": [15, 15], + "contentsOpaqueForText": true, + "transform": 1 + } + ], + "transforms": [ + { + "id": 1, + "transform": [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, 0], + [8, 8, 0, 1] + ] + } + ] +} +
diff --git a/third_party/liburlpattern/parse_fuzzer.cc b/third_party/liburlpattern/parse_fuzzer.cc index 802c705..038b3dd 100644 --- a/third_party/liburlpattern/parse_fuzzer.cc +++ b/third_party/liburlpattern/parse_fuzzer.cc
@@ -12,6 +12,7 @@ #include "base/containers/span.h" #include "base/logging.h" #include "base/strings/strcat.h" +#include "base/strings/string_util.h" #include "third_party/abseil-cpp/absl/status/statusor.h" #include "third_party/abseil-cpp/absl/strings/str_format.h" #include "third_party/abseil-cpp/absl/strings/string_view.h" @@ -37,8 +38,11 @@ std::string FancyHexDump(base::StringPiece label, base::StringPiece data) { std::string char_line, hex_line; for (char c : data) { - char_line.append(absl::StrFormat("%4c", c)); - hex_line.append(absl::StrFormat("%4x", c)); + if (!base::IsAsciiPrintable(c)) + char_line.append(" [?]"); + else + char_line.append(absl::StrFormat("%4c", c)); + hex_line.append(absl::StrFormat(" %02x", c)); } return base::StrCat({label, "\n", char_line, "\n", hex_line}); } @@ -68,7 +72,10 @@ << FancyHexDump("original : ", pattern_string) << "\n" << FancyHexDump("canonical: ", *canonical); - CHECK_EQ(*canonical, *canonical2); + CHECK_EQ(*canonical, *canonical2) + << "Canonical pattern and its recanonicalization are not equal.\n" + << FancyHexDump("canonical : ", *canonical) << "\n" + << FancyHexDump("canonical2: ", *canonical2); return 0; } } // namespace liburlpattern
diff --git a/third_party/maldoca/README.chromium b/third_party/maldoca/README.chromium index 796c6ea..75f3467 100644 --- a/third_party/maldoca/README.chromium +++ b/third_party/maldoca/README.chromium
@@ -18,3 +18,4 @@ third_party - Utilizing features available via protobuf lite - Using static variables over ABSL_FLAG +- Replace FALLTHROUGH macro with C++17 attribute [[fallthrough]]
diff --git a/third_party/maldoca/patches/0014-replace-fallthrough-with-attribute.patch b/third_party/maldoca/patches/0014-replace-fallthrough-with-attribute.patch new file mode 100644 index 0000000..39ba1b2 --- /dev/null +++ b/third_party/maldoca/patches/0014-replace-fallthrough-with-attribute.patch
@@ -0,0 +1,13 @@ +diff --git a/third_party/maldoca/src/third_party/zlibwrapper/gzipheader.cc b/third_party/maldoca/src/third_party/zlibwrapper/gzipheader.cc +index ed27503f31751..d6c27c4ed9451 100644 +--- a/third_party/maldoca/src/third_party/zlibwrapper/gzipheader.cc ++++ b/third_party/maldoca/src/third_party/zlibwrapper/gzipheader.cc +@@ -114,7 +114,7 @@ GZipHeader::Status GZipHeader::ReadMore(const char* inbuf, int inbuf_len, + state_++; + // If we have a zero-length FEXTRA, we want to check to notice that + // we're done reading the FEXTRA before we exit this loop... +- FALLTHROUGH; ++ [[fallthrough]]; + + case IN_FEXTRA: { + // Grab the rest of the bytes in the extra field, or as many
diff --git a/third_party/maldoca/src/third_party/zlibwrapper/gzipheader.cc b/third_party/maldoca/src/third_party/zlibwrapper/gzipheader.cc index ed27503..d6c27c4ed 100644 --- a/third_party/maldoca/src/third_party/zlibwrapper/gzipheader.cc +++ b/third_party/maldoca/src/third_party/zlibwrapper/gzipheader.cc
@@ -114,7 +114,7 @@ state_++; // If we have a zero-length FEXTRA, we want to check to notice that // we're done reading the FEXTRA before we exit this loop... - FALLTHROUGH; + [[fallthrough]]; case IN_FEXTRA: { // Grab the rest of the bytes in the extra field, or as many
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py index 23d0f00..8224d4a 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py
@@ -28,6 +28,7 @@ import urllib.request import urllib.error import zipfile +import zlib # Do NOT CHANGE this if you don't know what you're doing -- see @@ -96,16 +97,27 @@ try: sys.stdout.write('Downloading %s ' % url) sys.stdout.flush() - response = urllib.request.urlopen(url) + request = urllib.request.Request(url) + request.add_header('Accept-Encoding', 'gzip') + response = urllib.request.urlopen(request) total_size = int(response.info().get('Content-Length').strip()) + + is_gzipped = response.info().get('Content-Encoding', '').strip() == 'gzip' + if is_gzipped: + gzip_decode = zlib.decompressobj(zlib.MAX_WBITS + 16) + bytes_done = 0 dots_printed = 0 while True: chunk = response.read(CHUNK_SIZE) if not chunk: break - output_file.write(chunk) bytes_done += len(chunk) + + if is_gzipped: + chunk = gzip_decode.decompress(chunk) + output_file.write(chunk) + num_dots = TOTAL_DOTS * bytes_done // total_size sys.stdout.write('.' * (num_dots - dots_printed)) sys.stdout.flush() @@ -113,6 +125,8 @@ if bytes_done != total_size: raise urllib.error.URLError("only got %d of %d bytes" % (bytes_done, total_size)) + if is_gzipped: + output_file.write(gzip_decode.flush()) print(' Done.') return except urllib.error.URLError as e:
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 539e1844..237d630 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -36660,6 +36660,7 @@ <int value="4103" label="SecureContextIncorrectForWorker"/> <int value="4104" label="V8UDPSocket_Close_Method"/> <int value="4105" label="HTMLInputElementSimulatedClick"/> + <int value="4106" label="RTCLocalSdpModificationIceUfragPwd"/> </enum> <enum name="FeaturePolicyAllowlistType">
diff --git a/tools/metrics/histograms/metadata/password/histograms.xml b/tools/metrics/histograms/metadata/password/histograms.xml index 8a74cb0..7efb870b 100644 --- a/tools/metrics/histograms/metadata/password/histograms.xml +++ b/tools/metrics/histograms/metadata/password/histograms.xml
@@ -2223,6 +2223,29 @@ </histogram> <histogram + name="PasswordManager.PasswordStoreAndroidBackend.ClearAllLocalPasswords.LoginsToRemove" + units="count" expires_after="2022-06-30"> + <owner>fhorschig@chromium.org</owner> + <owner>vsemeniuk@google.com</owner> + <summary> + Total number of logins to be removed by ClearAllLocalPasswords. + </summary> +</histogram> + +<histogram + name="PasswordManager.PasswordStoreAndroidBackend.ClearAllLocalPasswords.SuccessRate" + units="%" expires_after="2022-06-30"> + <owner>fhorschig@chromium.org</owner> + <owner>vsemeniuk@google.com</owner> + <summary> + Ratio between successfully removed logins and total number of logins in the + GMS's local storage. Removal is considered successful when change list is + non-empty. Recorded when all the logins have been processed. If total number + of logins is 0, nothing is recorded. + </summary> +</histogram> + +<histogram name="PasswordManager.PasswordStoreAndroidBackend.{Function}.Latency" units="ms" expires_after="2022-06-30"> <owner>fhorschig@chromium.org</owner> @@ -2233,6 +2256,8 @@ </summary> <token key="Function"> <variant name="AddLoginAsync" summary="add a login to"/> + <variant name="ClearAllLocalPasswords" + summary="clear all local passwords from"/> <variant name="DisableAutoSignInForOriginsAsync" summary="disable autosignin for matching logins in"/> <variant name="FillMatchingLoginsAsync" @@ -2264,6 +2289,9 @@ <token key="Function"> <variant name="AddLoginAsync" summary="AddLoginAsync() succeeded to add a login to"/> + <variant name="ClearAllLocalPasswords" + summary="ClearAllLocalPasswords() successfully obtained a list of all + logins from"/> <variant name="DisableAutoSignInForOriginsAsync" summary="DisableAutoSignInForOriginsAsync() succeeded in disabling autosignin for matching logins in"/>
diff --git a/tools/metrics/histograms/metadata/profile/histograms.xml b/tools/metrics/histograms/metadata/profile/histograms.xml index e18d21d9..5b3d9b968 100644 --- a/tools/metrics/histograms/metadata/profile/histograms.xml +++ b/tools/metrics/histograms/metadata/profile/histograms.xml
@@ -682,6 +682,9 @@ <histogram name="Profile.SyncCustomizationBubbleDelay" units="ms" expires_after="2022-02-01"> + <obsolete> + Removed 2021-12. + </obsolete> <owner>jkrcal@chromium.org</owner> <owner>chrome-signin-team@google.com</owner> <summary>
diff --git a/tools/perf/expectations.config b/tools/perf/expectations.config index 78b677c..3c61bca 100644 --- a/tools/perf/expectations.config +++ b/tools/perf/expectations.config
@@ -514,6 +514,7 @@ crbug.com/1057035 system_health.memory_desktop/browse:tools:earth:2020 [ Skip ] crbug.com/1057035 system_health.memory_desktop/browse:tools:autocad:2021 [ Skip ] crbug.com/1057035 system_health.memory_desktop/browse:tools:photoshop:2021 [ Skip ] +crbug.com/1057035 system_health.memory_desktop/browse:tools:photoshop_warm:2021 [ Skip ] # Benchmark: system_health.memory_mobile crbug.com/1007355 [ android-go android-webview ] system_health.memory_mobile/load:media:imgur:2018 [ Skip ]
diff --git a/tools/perf/page_sets/data/system_health_desktop.json b/tools/perf/page_sets/data/system_health_desktop.json index ca4662d..e0eece08 100644 --- a/tools/perf/page_sets/data/system_health_desktop.json +++ b/tools/perf/page_sets/data/system_health_desktop.json
@@ -151,6 +151,9 @@ "browse:tools:photoshop:2021": { "DEFAULT": "system_health_desktop_c2c16f23ac.wprgo" }, + "browse:tools:photoshop_warm:2021": { + "DEFAULT": "system_health_desktop_4b96da642a.wprgo" + }, "browse:tools:sheets:2019": { "DEFAULT": "system_health_desktop_d7b02362d8.wprgo" },
diff --git a/tools/perf/page_sets/data/system_health_desktop_4b96da642a.wprgo.sha1 b/tools/perf/page_sets/data/system_health_desktop_4b96da642a.wprgo.sha1 new file mode 100644 index 0000000..90cd4f05 --- /dev/null +++ b/tools/perf/page_sets/data/system_health_desktop_4b96da642a.wprgo.sha1
@@ -0,0 +1 @@ +4b96da642af55951497fd05b094ad72ee6da91f1 \ No newline at end of file
diff --git a/tools/perf/page_sets/system_health/browsing_stories.py b/tools/perf/page_sets/system_health/browsing_stories.py index 1a9032d..3299800 100644 --- a/tools/perf/page_sets/system_health/browsing_stories.py +++ b/tools/perf/page_sets/system_health/browsing_stories.py
@@ -716,7 +716,7 @@ NAME = 'browse:tools:photoshop:2021' URL = 'https://photoshop.adobe.com/id/urn:aaid:sc:EU:1856a1e7-f397-4616-b399-9cd3b3d8c029' SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY - TAGS = [story_tags.YEAR_2021, story_tags.WEBASSEMBLY, story_tags.WEBGL] + TAGS = [story_tags.YEAR_2021, story_tags.WEBASSEMBLY] # This map translates page-specific event names to event names needed for # the reported_by_page:* metric. @@ -768,6 +768,109 @@ action_runner.WaitForJavaScriptCondition(self.FINISHED_EVENT) +class PhotoshopWarmStartupDesktopStory2021(_MediaBrowsingStory): + """Photoshop desktop story, measuring warm startup, + Open Photoshop, wait for it to load, then navigate to a different url to + get rid of the original renderer process, and then navigate back to Photoshop + to do the actual measurement. The story then measures the time it takes to + open a shared Photoshop file. + """ + NAME = 'browse:tools:photoshop_warm:2021' + URL = 'https://photoshop.adobe.com/id/urn:aaid:sc:EU:1856a1e7-f397-4616-b399-9cd3b3d8c029' + SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY + TAGS = [story_tags.YEAR_2021, story_tags.WEBASSEMBLY] + + # This map translates page-specific event names to event names needed for + # the reported_by_page:* metric. + EVENTS_REPORTED_BY_PAGE = ''' + window.__telemetry_reported_page_events = { + 'Apollo.init()': + 'telemetry:reported_by_page:benchmark_begin', + 'Doc.open complete': + 'telemetry:reported_by_page:benchmark_end', + 'open document end': + 'telemetry:reported_by_page:interactive' + }; + ''' + + # Patch performance.mark to get notified about page events. + PERFORMANCE_MARK_PATCH = ''' + window.__telemetry_observed_page_events = new Set(); + (function () { + let reported = window.__telemetry_reported_page_events; + let observed = window.__telemetry_observed_page_events; + let performance_mark = window.performance.mark; + window.performance.mark = function (label) { + performance_mark.call(window.performance, label); + if (reported.hasOwnProperty(label)) { + performance_mark.call( + window.performance, reported[label]); + observed.add(reported[label]); + } + } + })(); + ''' + + WARMUP_RUNS_SCRIPT = ''' + window.__telemetry_first_load_finished = false; + window.performance.mark = function (label) { + if (label == 'Doc.open complete') { + window.__telemetry_first_load_finished = true; + } + } + ''' + + # Page event queries. + FINISHED_EVENT = ''' + (window.__telemetry_observed_page_events.has( + "telemetry:reported_by_page:benchmark_end")) + ''' + + def __init__(self, story_set, take_memory_measurement): + super(PhotoshopWarmStartupDesktopStory2021, + self).__init__(story_set, take_memory_measurement) + self.script_to_evaluate_on_commit = js_template.Render( + self.WARMUP_RUNS_SCRIPT) + + def _DidLoadDocument(self, action_runner): + action_runner.Wait(2) + # The first navigation to photoshop initializes caching. + action_runner.WaitForJavaScriptCondition( + 'window.__telemetry_first_load_finished') + # Navigate to a different page to start a new renderer process. The + # original process stores the wasm module of photoshop in an in-process + # cache. + action_runner.Navigate('https://www.google.com/') + action_runner.Wait(1) + warmup_script = js_template.Render(self.WARMUP_RUNS_SCRIPT) + # The second navigation to photoshop stores the compiled wasm module in the + # cache. + action_runner.Navigate( + 'https://photoshop.adobe.com/id/urn:aaid:sc:EU:1856a1e7-f397-4616-b399-9cd3b3d8c029', + warmup_script) + action_runner.Wait(2) + action_runner.WaitForJavaScriptCondition( + 'window.__telemetry_first_load_finished') + # Wait for the optimizing compiler to finish compilation and to write the + # compiled module into the cache. + action_runner.Wait(30) + # Reset the renderer process again. + action_runner.Navigate('https://www.google.com/') + action_runner.Wait(1) + measurement_script = js_template.Render( + '''{{@events_reported_by_page}} + {{@performance_mark}}''', + events_reported_by_page=self.EVENTS_REPORTED_BY_PAGE, + performance_mark=self.PERFORMANCE_MARK_PATCH) + # The third navigation loads photoshop from the cache. This is the page + # load we want to measure. + action_runner.Navigate( + 'https://photoshop.adobe.com/id/urn:aaid:sc:EU:1856a1e7-f397-4616-b399-9cd3b3d8c029', + measurement_script) + action_runner.Wait(2) + action_runner.WaitForJavaScriptCondition(self.FINISHED_EVENT) + + class AutoCADDesktopStory2021(_MediaBrowsingStory): """AutoCAD desktop story, TODO: add a description here.
diff --git a/tools/perf/system_health_stories.csv b/tools/perf/system_health_stories.csv index 311e597..6cb095d7 100644 --- a/tools/perf/system_health_stories.csv +++ b/tools/perf/system_health_stories.csv
@@ -58,7 +58,8 @@ browse:tools:gmail-openconversation:2020,,desktop,2020 browse:tools:gmail-search:2020,,desktop,2020 browse:tools:maps:2019,Google maps story:,"desktop,mobile","2019,emerging_market,health_check,javascript_heavy,webgl" -browse:tools:photoshop:2021,"Photoshop desktop story,",desktop,"2021,wasm,webgl" +browse:tools:photoshop:2021,"Photoshop desktop story,",desktop,"2021,wasm" +browse:tools:photoshop_warm:2021,"Photoshop desktop story, measuring warm startup,",desktop,"2021,wasm" browse:tools:sheets:2019,,desktop,"2019,health_check,javascript_heavy" browse_accessibility:media:youtube,Tests interacting with the YouTube home page.,desktop,"2016,accessibility,keyboard_input" browse_accessibility:tech:codesearch:2018,Tests scrolling an element within a page.,desktop,"2018,accessibility,scroll"
diff --git a/ui/compositor/test/direct_layer_tree_frame_sink.cc b/ui/compositor/test/direct_layer_tree_frame_sink.cc index 6e1f6af..473601f 100644 --- a/ui/compositor/test/direct_layer_tree_frame_sink.cc +++ b/ui/compositor/test/direct_layer_tree_frame_sink.cc
@@ -77,8 +77,7 @@ void DirectLayerTreeFrameSink::SubmitCompositorFrame( viz::CompositorFrame frame, - bool hit_test_data_changed, - bool show_hit_test_borders) { + bool hit_test_data_changed) { DCHECK(frame.metadata.begin_frame_ack.has_damage); DCHECK(frame.metadata.begin_frame_ack.frame_id.IsSequenceValid()); @@ -146,8 +145,7 @@ bool will_draw_and_swap, viz::AggregatedRenderPassList* render_passes) { if (support_->GetHitTestAggregator()) { - support_->GetHitTestAggregator()->Aggregate(display_->CurrentSurfaceId(), - render_passes); + support_->GetHitTestAggregator()->Aggregate(display_->CurrentSurfaceId()); } }
diff --git a/ui/compositor/test/direct_layer_tree_frame_sink.h b/ui/compositor/test/direct_layer_tree_frame_sink.h index ad9105b5..af80fd3 100644 --- a/ui/compositor/test/direct_layer_tree_frame_sink.h +++ b/ui/compositor/test/direct_layer_tree_frame_sink.h
@@ -50,8 +50,7 @@ bool BindToClient(cc::LayerTreeFrameSinkClient* client) override; void DetachFromClient() override; void SubmitCompositorFrame(viz::CompositorFrame frame, - bool hit_test_data_changed, - bool show_hit_test_borders) override; + bool hit_test_data_changed) override; void DidNotProduceFrame(const viz::BeginFrameAck& ack, cc::FrameSkippedReason reason) override; void DidAllocateSharedBitmap(base::ReadOnlySharedMemoryRegion region,
diff --git a/weblayer/app/content_main_delegate_impl.cc b/weblayer/app/content_main_delegate_impl.cc index 16f8626..fe87a2b 100644 --- a/weblayer/app/content_main_delegate_impl.cc +++ b/weblayer/app/content_main_delegate_impl.cc
@@ -5,6 +5,7 @@ #include "weblayer/app/content_main_delegate_impl.h" #include <iostream> +#include <tuple> #include "base/base_switches.h" #include "base/command_line.h" @@ -12,7 +13,6 @@ #include "base/containers/flat_set.h" #include "base/cpu.h" #include "base/files/file_util.h" -#include "base/ignore_result.h" #include "base/lazy_instance.h" #include "base/logging.h" #include "base/path_service.h" @@ -324,7 +324,7 @@ main_runner->Initialize(std::move(main_function_params)); DCHECK_LT(initialize_exit_code, 0) << "BrowserMainRunner::Initialize failed in MainDelegate"; - ignore_result(main_runner.release()); + std::ignore = main_runner.release(); // Return 0 as BrowserMain() should not be called after this, bounce up to // the system message loop for ContentShell, and we're already done thanks // to the |ui_task| for browser tests.
diff --git a/weblayer/browser/android/metrics/weblayer_metrics_service_client.cc b/weblayer/browser/android/metrics/weblayer_metrics_service_client.cc index 69969323..97132b14 100644 --- a/weblayer/browser/android/metrics/weblayer_metrics_service_client.cc +++ b/weblayer/browser/android/metrics/weblayer_metrics_service_client.cc
@@ -9,7 +9,6 @@ #include <memory> #include "base/base64.h" -#include "base/files/file_path.h" #include "base/no_destructor.h" #include "components/metrics/metrics_provider.h" #include "components/metrics/metrics_service.h" @@ -107,15 +106,6 @@ variations::SyntheticTrialRegistry::kOverrideExistingIds); } -void WebLayerMetricsServiceClient::Initialize(PrefService* pref_service) { - // Pass an empty file path since the path is for the Extended Variations Safe - // Mode experiment and Android WebLayer is temporarily excluded from this - // experiment. - // TODO(crbug/1245347): Enable the experiment on Android WebLayer. - AndroidMetricsServiceClient::Initialize(/*user_data_dir=*/base::FilePath(), - pref_service); -} - int32_t WebLayerMetricsServiceClient::GetProduct() { return metrics::ChromeUserMetricsExtension::ANDROID_WEBLAYER; }
diff --git a/weblayer/browser/android/metrics/weblayer_metrics_service_client.h b/weblayer/browser/android/metrics/weblayer_metrics_service_client.h index 2fc0594..1050831 100644 --- a/weblayer/browser/android/metrics/weblayer_metrics_service_client.h +++ b/weblayer/browser/android/metrics/weblayer_metrics_service_client.h
@@ -19,8 +19,6 @@ #include "weblayer/browser/browser_list_observer.h" #include "weblayer/browser/profile_impl.h" -class PrefService; - namespace weblayer { class WebLayerMetricsServiceClient @@ -42,9 +40,6 @@ void RegisterExternalExperiments(const std::vector<int>& experiment_ids); - // Initializes, but does not necessarily start, the MetricsService. - void Initialize(PrefService* pref_service); - // metrics::MetricsServiceClient int32_t GetProduct() override; bool IsExternalExperimentAllowlistEnabled() override;
diff --git a/weblayer/browser/browser_context_impl.cc b/weblayer/browser/browser_context_impl.cc index adde6bd..d3f00e5 100644 --- a/weblayer/browser/browser_context_impl.cc +++ b/weblayer/browser/browser_context_impl.cc
@@ -136,8 +136,6 @@ if (SUCCEEDED( SHGetKnownFolderPath(FOLDERID_Downloads, 0, nullptr, &path_buf))) { download_dir = base::FilePath(path_buf.get()); - } else { - NOTREACHED(); } #else download_dir = base::nix::GetXDGUserDirectory("DOWNLOAD", "Downloads");
diff --git a/weblayer/browser/feature_list_creator.cc b/weblayer/browser/feature_list_creator.cc index b4e16a87..13af994 100644 --- a/weblayer/browser/feature_list_creator.cc +++ b/weblayer/browser/feature_list_creator.cc
@@ -75,15 +75,11 @@ std::vector<std::string> variation_ids; auto feature_list = std::make_unique<base::FeatureList>(); - // Pass false for |extend_variations_safe_mode| to temporarily opt out of the - // Extended Variations Safe Mode experiment. - // TODO(crbug/1245347): Enable the experiment on Android WebLayer. variations_service_->SetUpFieldTrials( variation_ids, content::GetSwitchDependentFeatureOverrides( *base::CommandLine::ForCurrentProcess()), - std::move(feature_list), &weblayer_field_trials_, - /*extend_variations_safe_mode=*/false); + std::move(feature_list), &weblayer_field_trials_); variations::InitCrashKeys(); #else // TODO(weblayer-dev): Support variations on desktop.