diff --git a/DEPS b/DEPS index d2a33e0..c7309a3 100644 --- a/DEPS +++ b/DEPS
@@ -275,15 +275,15 @@ # 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': '300f96a8e2340532bc7d0e35f88103faf35effa0', + 'skia_revision': '32bb72454d281b0f309801776d752d88b15bc6f8', # 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': '5950eed752fb25dcd199a3c898d9ce09b291a856', + 'v8_revision': 'bd6d5b3cb04d370f1df430d2b7c65d096cfc5a9d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '4868e5a700b72992b739c2d89b21bb2948d4330a', + 'angle_revision': 'ce3c0fe901f8ee12ca1330f8111517ee370b4a15', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -302,7 +302,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Fuchsia sdk # and whatever else without interference from each other. - 'fuchsia_version': 'version:8.20220606.2.1', + 'fuchsia_version': 'version:8.20220607.0.1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling google-toolbox-for-mac # and whatever else without interference from each other. @@ -346,7 +346,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '29e473f58837e8bddce56bf1c71dcab9dc68a66c', + 'catapult_revision': '45853b3700cddd1f4eefe531f18add46e6c90e76', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -354,7 +354,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': '4ced08bf85dc906d49f6821c10713eb12c5eb03c', + 'devtools_frontend_revision': 'c27f9fea0b3c15c22c3009c31853345c2dbd2ef1', # 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. @@ -390,11 +390,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': 'ce4e6a3c80df36a2aa4c49ffed0c54a0295c368a', + 'dawn_revision': 'e7099d4f3bb22e23e975099fb1d1314f76cd6227', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'quiche_revision': 'ac5d3befbfeb25d0342a1b92dceeb0e41a23b320', + 'quiche_revision': '26920de2d369289246585fa1b236ef2ef516d317', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ios_webkit # and whatever else without interference from each other. @@ -920,7 +920,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'XqlO243tWnpoGNKhlUfXplfyLNT93SHMWJjdEgOtcawC', + 'version': 'X3OVCru2OMw4Pxf6UaS3e0NxseUYtB_jm1VAfM3xtVIC', }, ], 'condition': 'checkout_android', @@ -953,7 +953,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_build_tools/aapt2', - 'version': 'kZqQH92bSO1p0a7_hcrana_9YjtSBU1te7TEtNVBoCUC', + 'version': 'jziPmg_EUjoj-eSkO24eMaf5ylm449Q7BKO1-ga2tbgC', }, ], 'condition': 'checkout_android', @@ -1425,7 +1425,7 @@ Var('chromium_git') + '/webm/libwebm.git' + '@' + 'e4fbea0c9751ae8aa86629b197a28d8276a2b0da', 'src/third_party/libyuv': - Var('chromium_git') + '/libyuv/libyuv.git' + '@' + 'd62ee21e6627888e84466b5a5ed15775582ac67b', + Var('chromium_git') + '/libyuv/libyuv.git' + '@' + 'd011314f14738e0751dcb269c1d989c4dcbaad7b', 'src/third_party/lighttpd': { 'url': Var('chromium_git') + '/chromium/deps/lighttpd.git' + '@' + Var('lighttpd_revision'), @@ -1533,7 +1533,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'dbb5ff7cb010a26d1dc8e87e74a872adb1f0dc96', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '127a4d84350dafb8b6b9f5f25fa4e31b1103fd0d', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1708,7 +1708,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '3ebdea84d63cd0a0bb5b185b97206494cc0df960', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '70eab560a14b932ac292d8e83ab86954b4a6770b', + Var('webrtc_git') + '/src.git' + '@' + 'eef9d5d6e10765e8c9374b6ef6bc0fb9fe6e1f1a', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1781,7 +1781,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@4e81f8b94aecf15d5cfa72b40e1504004fd18fe1', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@b5e28af9f7c76f5b9b2a7db93f1f72ca6c706f53', 'condition': 'checkout_src_internal', },
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index dc8c3de..b5237cbc 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -1024,6 +1024,19 @@ False, (), ), + BanRule( + 'base::Passed', + ( + 'Do not use base::Passed. It is a legacy helper for capturing ', + 'move-only types with base::BindRepeating, but invoking the ', + 'resulting RepeatingCallback moves the captured value out of ', + 'the callback storage, and subsequent invocations may pass the ', + 'value in a valid but undefined state. Prefer base::BindOnce().', + 'See http://crbug.com/1326449 for context.' + ), + False, + (), + ), ) _BANNED_MOJOM_PATTERNS : Sequence[BanRule] = (
diff --git a/android_webview/common/aw_switches.cc b/android_webview/common/aw_switches.cc index e02d026..9b1a8ff0 100644 --- a/android_webview/common/aw_switches.cc +++ b/android_webview/common/aw_switches.cc
@@ -82,6 +82,9 @@ // PrivacySandboxAdsAPIsOverride and SharedStorageAPI. const char kWebViewShadowDOMFencedFrames[] = "webview-shadow-dom-fenced-frames"; +// Disables WebView from checking for app recovery mitigations. +const char kWebViewDisableAppRecovery[] = "webview-disable-app-recovery"; + // Enables WebView to check for app recovery mitigations. const char kWebViewEnableAppRecovery[] = "webview-enable-app-recovery";
diff --git a/android_webview/common/aw_switches.h b/android_webview/common/aw_switches.h index a2ce64c..a297519 100644 --- a/android_webview/common/aw_switches.h +++ b/android_webview/common/aw_switches.h
@@ -24,6 +24,7 @@ extern const char kWebViewSelectiveImageInversionDarkening[]; extern const char kWebViewMPArchFencedFrames[]; extern const char kWebViewShadowDOMFencedFrames[]; +extern const char kWebViewDisableAppRecovery[]; extern const char kWebViewEnableAppRecovery[]; } // namespace switches
diff --git a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java index 15966e2..699ca19 100644 --- a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java +++ b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java
@@ -105,6 +105,8 @@ Flag.commandLine(AwSwitches.WEBVIEW_SHADOW_DOM_FENCED_FRAMES, "Enables ShadowDOM-based fenced frames. Also implies SharedStorageAPI, " + "and PrivacySandboxAdsAPIsOverride"), + Flag.commandLine(AwSwitches.WEBVIEW_DISABLE_APP_RECOVERY, + "Disables WebView from checking for app recovery mitigations."), Flag.commandLine(AwSwitches.WEBVIEW_ENABLE_APP_RECOVERY, "Enables WebView to check for app recovery mitigations."), Flag.baseFeature(GpuFeatures.WEBVIEW_VULKAN,
diff --git a/ash/ambient/ambient_controller.cc b/ash/ambient/ambient_controller.cc index 7119c1b3..423e815 100644 --- a/ash/ambient/ambient_controller.cc +++ b/ash/ambient/ambient_controller.cc
@@ -236,7 +236,9 @@ StartRefreshingImages(); break; case AmbientUiVisibility::kHidden: - case AmbientUiVisibility::kClosed: + case AmbientUiVisibility::kClosed: { + bool ambient_ui_was_rendering = + Shell::GetPrimaryRootWindowController()->HasAmbientWidget(); CloseAllWidgets(/*immediately=*/false); // TODO(wutao): This will clear the image cache currently. It will not @@ -257,15 +259,17 @@ // ambient mode has just started. if (start_time_) { auto elapsed = base::Time::Now() - start_time_.value(); + AmbientAnimationTheme theme = GetCurrentTheme(); DVLOG(2) << "Exit ambient mode. Elapsed time: " << elapsed; ambient::RecordAmbientModeTimeElapsed( - elapsed, Shell::Get()->IsInTabletMode(), - // The user currently has no way of changing the animation theme - // (|current_theme_from_pref_|) without exiting screensaver first, - // so it is safe to assume that |current_theme_from_pref_| did not - // change while the screensaver was active. - current_theme_from_pref_ ? *current_theme_from_pref_ - : kDefaultAmbientAnimationTheme); + elapsed, Shell::Get()->IsInTabletMode(), theme); + + if (!ambient_ui_was_rendering && + elapsed >= ambient::kMetricsStartupTimeMax) { + LOG(ERROR) << "Ambient UI completely failed to start"; + ambient::RecordAmbientModeStartupTime(elapsed, theme); + } + start_time_.reset(); } @@ -290,6 +294,7 @@ } break; + } } } @@ -809,6 +814,10 @@ widget->Show(); + DCHECK(start_time_); + ambient::RecordAmbientModeStartupTime(base::Time::Now() - *start_time_, + GetCurrentTheme()); + // Only announce for the primary window. if (Shell::GetPrimaryRootWindow() == container->GetRootWindow()) { contents_view->GetViewAccessibility().AnnounceText( @@ -854,6 +863,22 @@ } AmbientPhotoConfig AmbientController::CreatePhotoConfigForCurrentTheme() { + AmbientAnimationTheme current_theme = GetCurrentTheme(); + DVLOG(4) << "Loaded ambient theme " << ToString(current_theme); + + pending_animation_static_resources_.reset(); + if (current_theme == AmbientAnimationTheme::kSlideshow) { + return CreateAmbientSlideshowPhotoConfig(); + } else { + pending_animation_static_resources_ = + AmbientAnimationStaticResources::Create(current_theme); + return CreateAmbientAnimationPhotoConfig( + pending_animation_static_resources_->GetSkottieWrapper() + ->GetImageAssetMetadata()); + } +} + +AmbientAnimationTheme AmbientController::GetCurrentTheme() const { AmbientAnimationTheme current_theme = kDefaultAmbientAnimationTheme; absl::optional<bool> animation_experiment_enabled = base::FeatureList::GetStateIfOverridden( @@ -872,18 +897,7 @@ DCHECK(current_theme_from_pref_); current_theme = *current_theme_from_pref_; } - DVLOG(4) << "Loaded ambient theme " << ToString(current_theme); - - pending_animation_static_resources_.reset(); - if (current_theme == AmbientAnimationTheme::kSlideshow) { - return CreateAmbientSlideshowPhotoConfig(); - } else { - pending_animation_static_resources_ = - AmbientAnimationStaticResources::Create(current_theme); - return CreateAmbientAnimationPhotoConfig( - pending_animation_static_resources_->GetSkottieWrapper() - ->GetImageAssetMetadata()); - } + return current_theme; } void AmbientController::set_backend_controller_for_testing(
diff --git a/ash/ambient/ambient_controller.h b/ash/ambient/ambient_controller.h index 6ecb639a..455f99f 100644 --- a/ash/ambient/ambient_controller.h +++ b/ash/ambient/ambient_controller.h
@@ -167,6 +167,7 @@ void StartRefreshingImages(); void StopRefreshingImages(); AmbientPhotoConfig CreatePhotoConfigForCurrentTheme(); + AmbientAnimationTheme GetCurrentTheme() const; // Invoked when the auto-show timer in |InactivityMonitor| gets fired after // device being inactive for a specific amount of time.
diff --git a/ash/ambient/ambient_controller_unittest.cc b/ash/ambient/ambient_controller_unittest.cc index 031b749..f330a3a 100644 --- a/ash/ambient/ambient_controller_unittest.cc +++ b/ash/ambient/ambient_controller_unittest.cc
@@ -17,6 +17,7 @@ #include "ash/constants/ash_features.h" #include "ash/public/cpp/ambient/ambient_prefs.h" #include "ash/public/cpp/ambient/ambient_ui_model.h" +#include "ash/public/cpp/ambient/fake_ambient_backend_controller_impl.h" #include "ash/public/cpp/assistant/controller/assistant_interaction_controller.h" #include "ash/root_window_controller.h" #include "ash/shell.h" @@ -1222,4 +1223,42 @@ base::Minutes(1), 2); } +TEST_P(AmbientControllerTestForAnyTheme, MetricsStartupTime) { + base::HistogramTester histogram_tester; + LockScreen(); + FastForwardToLockScreenTimeout(); + FastForwardTiny(); + ASSERT_TRUE(ambient_controller()->IsShown()); + + histogram_tester.ExpectTotalCount( + base::StrCat({"Ash.AmbientMode.StartupTime.", ToString(GetParam())}), 1); + + UnlockScreen(); + ASSERT_FALSE(ambient_controller()->IsShown()); + + LockScreen(); + FastForwardToLockScreenTimeout(); + FastForwardTiny(); + ASSERT_TRUE(ambient_controller()->IsShown()); + + histogram_tester.ExpectTotalCount( + base::StrCat({"Ash.AmbientMode.StartupTime.", ToString(GetParam())}), 2); +} + +TEST_P(AmbientControllerTestForAnyTheme, MetricsStartupTimeFailedToStart) { + // Simulate IMAX outage that doesn't return any photos. + backend_controller()->SetFetchScreenUpdateInfoResponseSize(0); + + base::HistogramTester histogram_tester; + LockScreen(); + FastForwardToLockScreenTimeout(); + task_environment()->FastForwardBy(base::Minutes(1)); + ASSERT_TRUE(GetContainerViews().empty()); + + UnlockScreen(); + histogram_tester.ExpectUniqueTimeSample( + base::StrCat({"Ash.AmbientMode.StartupTime.", ToString(GetParam())}), + base::Minutes(1), 1); +} + } // namespace ash
diff --git a/ash/components/arc/mojom/file_system.mojom b/ash/components/arc/mojom/file_system.mojom index db83ffa..51cc18f 100644 --- a/ash/components/arc/mojom/file_system.mojom +++ b/ash/components/arc/mojom/file_system.mojom
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // -// Next MinVersion: 22 +// Next MinVersion: 23 module arc.mojom; @@ -139,13 +139,18 @@ // Supported action types for SelectFilesRequest. // Corresponds to Android intent actions described in -// http://developer.android.com/reference/android/content/Intent.html +// http://developer.android.com/reference/android/content/Intent.html except +// for OPEN_MEDIA_STORE_FILES, which is a dedicated intent action of +// ArcDocumentsUI. [Extensible] enum SelectFilesActionType { GET_CONTENT, // Intent.ACTION_GET_CONTENT OPEN_DOCUMENT, // Intent.ACTION_OPEN_DOCUMENT OPEN_DOCUMENT_TREE, // Intent.ACTION_OPEN_DOCUMENT_TREE CREATE_DOCUMENT, // Intent.ACTION_CREATE_DOCUMENT + // ArcDocumentsUI's intent action to open files indexed in Android's + // MediaStore with a customized file selector. + [MinVersion=22] OPEN_MEDIA_STORE_FILES, }; // Request for having the user select files using ChromeOS file selector,
diff --git a/ash/components/login/auth/BUILD.gn b/ash/components/login/auth/BUILD.gn index 3e5ac1cb..806f75f51 100644 --- a/ash/components/login/auth/BUILD.gn +++ b/ash/components/login/auth/BUILD.gn
@@ -138,20 +138,26 @@ testonly = true deps = [ ":auth", + "//ash/components/cryptohome", + "//ash/components/login/auth", "//base", "//base:i18n", "//chromeos/ash/components/dbus/authpolicy", "//chromeos/ash/components/dbus/authpolicy:authpolicy_proto", "//chromeos/dbus/cryptohome", + "//chromeos/dbus/userdataauth", + "//chromeos/dbus/userdataauth:test_support", "//components/prefs", "//components/prefs:test_support", "//net", "//net:test_support", "//testing/gmock", "//testing/gtest", + "//third_party/abseil-cpp:absl", "//third_party/icu", ] sources = [ + "auth_performer_unittest.cc", "challenge_response/cert_utils_unittest.cc", "key_unittest.cc", "operation_chain_runner_unittest.cc",
diff --git a/ash/components/login/auth/auth_performer.cc b/ash/components/login/auth/auth_performer.cc index 8983c7b..1c0ae5d2 100644 --- a/ash/components/login/auth/auth_performer.cc +++ b/ash/components/login/auth/auth_performer.cc
@@ -18,7 +18,9 @@ namespace ash { -AuthPerformer::AuthPerformer() = default; +AuthPerformer::AuthPerformer(base::raw_ptr<UserDataAuthClient> client) + : client_(client) {} + AuthPerformer::~AuthPerformer() = default; void AuthPerformer::InvalidateCurrentAttempts() { @@ -32,7 +34,7 @@ void AuthPerformer::StartAuthSession(std::unique_ptr<UserContext> context, bool ephemeral, StartSessionCallback callback) { - UserDataAuthClient::Get()->WaitForServiceToBeAvailable(base::BindOnce( + client_->WaitForServiceToBeAvailable(base::BindOnce( &AuthPerformer::OnServiceRunning, weak_factory_.GetWeakPtr(), std::move(context), ephemeral, std::move(callback))); } @@ -56,7 +58,7 @@ request.set_flags(user_data_auth::AUTH_SESSION_FLAGS_NONE); } - UserDataAuthClient::Get()->StartAuthSession( + client_->StartAuthSession( request, base::BindOnce(&AuthPerformer::OnStartAuthSession, weak_factory_.GetWeakPtr(), std::move(context), std::move(callback))); @@ -105,7 +107,7 @@ cryptohome::KeyDefinitionToKey( cryptohome_parameter_utils::CreateKeyDefFromUserContext(*context), key); - UserDataAuthClient::Get()->AuthenticateAuthSession( + client_->AuthenticateAuthSession( request, base::BindOnce(&AuthPerformer::OnAuthenticateAuthSession, weak_factory_.GetWeakPtr(), std::move(context), std::move(callback))); @@ -132,7 +134,7 @@ cryptohome_parameter_utils::CreateAuthorizationKeyDefFromUserContext( *context)); - UserDataAuthClient::Get()->AuthenticateAuthSession( + client_->AuthenticateAuthSession( request, base::BindOnce(&AuthPerformer::OnAuthenticateAuthSession, weak_factory_.GetWeakPtr(), std::move(context), std::move(callback))); @@ -221,7 +223,7 @@ } key_data->set_label(key_def->label); - UserDataAuthClient::Get()->AuthenticateAuthSession( + client_->AuthenticateAuthSession( request, base::BindOnce(&AuthPerformer::OnAuthenticateAuthSession, weak_factory_.GetWeakPtr(), std::move(context), std::move(callback)));
diff --git a/ash/components/login/auth/auth_performer.h b/ash/components/login/auth/auth_performer.h index f234506a..8f8ddc9 100644 --- a/ash/components/login/auth/auth_performer.h +++ b/ash/components/login/auth/auth_performer.h
@@ -11,8 +11,10 @@ #include "ash/components/login/auth/cryptohome_error.h" #include "base/callback.h" #include "base/component_export.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "chromeos/dbus/cryptohome/UserDataAuth.pb.h" +#include "chromeos/dbus/userdataauth/userdataauth_client.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace ash { @@ -25,7 +27,7 @@ // This implementation is only compatible with AuthSession-based API. class COMPONENT_EXPORT(ASH_LOGIN_AUTH) AuthPerformer { public: - AuthPerformer(); + explicit AuthPerformer(base::raw_ptr<UserDataAuthClient> client); AuthPerformer(const AuthPerformer&) = delete; AuthPerformer& operator=(const AuthPerformer&) = delete; @@ -118,6 +120,7 @@ AuthOperationCallback callback, absl::optional<user_data_auth::AuthenticateAuthSessionReply> reply); + const base::raw_ptr<UserDataAuthClient> client_; base::WeakPtrFactory<AuthPerformer> weak_factory_{this}; };
diff --git a/ash/components/login/auth/auth_performer_unittest.cc b/ash/components/login/auth/auth_performer_unittest.cc new file mode 100644 index 0000000..e9ba146 --- /dev/null +++ b/ash/components/login/auth/auth_performer_unittest.cc
@@ -0,0 +1,115 @@ +// 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. + +#include "ash/components/login/auth/auth_performer.h" + +#include <memory> + +#include "ash/components/cryptohome/cryptohome_parameters.h" +#include "ash/components/cryptohome/system_salt_getter.h" +#include "ash/components/login/auth/auth_factors_data.h" +#include "ash/components/login/auth/user_context.h" +#include "base/bind.h" +#include "base/callback_helpers.h" +#include "base/memory/raw_ptr.h" +#include "base/test/task_environment.h" +#include "base/test/test_future.h" +#include "chromeos/dbus/userdataauth/cryptohome_misc_client.h" +#include "chromeos/dbus/userdataauth/mock_userdataauth_client.h" +#include "chromeos/dbus/userdataauth/userdataauth_client.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/abseil-cpp/absl/types/optional.h" + +using ::testing::_; + +namespace ash { +namespace { + +class AuthPerformerTest : public testing::Test { + public: + AuthPerformerTest() + : task_environment_( + base::test::SingleThreadTaskEnvironment::MainThreadType::UI) { + CryptohomeMiscClient::InitializeFake(); + chromeos::SystemSaltGetter::Initialize(); + context_ = std::make_unique<UserContext>(); + context_->SetAuthSessionId("123"); + } + + ~AuthPerformerTest() override { + chromeos::SystemSaltGetter::Shutdown(); + CryptohomeMiscClient::Shutdown(); + } + + protected: + base::test::SingleThreadTaskEnvironment task_environment_; + ::testing::StrictMock<chromeos::MockUserDataAuthClient> mock_client_; + std::unique_ptr<UserContext> context_; +}; + +// Checks that AuthenticateUsingKnowledgeKey (which will be called with "gaia" +// label after online authentication) correctly falls back to "legacy-0" label. +TEST_F(AuthPerformerTest, KnowledgeKeyCorrectLabelFallback) { + // Keys as listed by StartAuthSession + std::vector<cryptohome::KeyDefinition> keys; + keys.push_back(cryptohome::KeyDefinition::CreateForPassword( + "secret", "legacy-0", /*privileges=*/0)); + AuthFactorsData data(keys); + context_->SetAuthFactorsData(data); + // Knowledge key in user context. + *context_->GetKey() = Key("secret"); + context_->GetKey()->SetLabel("gaia"); + + AuthPerformer performer(&mock_client_); + + EXPECT_CALL(mock_client_, AuthenticateAuthSession(_, _)) + .WillOnce( + [](const ::user_data_auth::AuthenticateAuthSessionRequest& request, + UserDataAuthClient::AuthenticateAuthSessionCallback callback) { + EXPECT_EQ(request.authorization().key().data().label(), "legacy-0"); + // just fail the operation + std::move(callback).Run(absl::nullopt); + }); + base::test::TestFuture<std::unique_ptr<UserContext>, + absl::optional<CryptohomeError>> + result; + performer.AuthenticateUsingKnowledgeKey(std::move(context_), + result.GetCallback()); + ASSERT_TRUE(result.Get<1>().has_value()); +} + +// Checks that AuthenticateUsingKnowledgeKey called with "pin" key does not +// fallback to "legacy-0" label. +TEST_F(AuthPerformerTest, KnowledgeKeyNoFallbackOnPin) { + // Keys as listed by StartAuthSession + std::vector<cryptohome::KeyDefinition> keys; + keys.push_back(cryptohome::KeyDefinition::CreateForPassword( + "secret", "legacy-0", /*privileges=*/0)); + AuthFactorsData data(keys); + context_->SetAuthFactorsData(data); + // Knowledge key in user context. + *context_->GetKey() = + Key(Key::KEY_TYPE_SALTED_PBKDF2_AES256_1234, "salt", /*secret=*/"123456"); + context_->GetKey()->SetLabel("pin"); + + AuthPerformer performer(&mock_client_); + + EXPECT_CALL(mock_client_, AuthenticateAuthSession(_, _)) + .WillOnce( + [](const ::user_data_auth::AuthenticateAuthSessionRequest& request, + UserDataAuthClient::AuthenticateAuthSessionCallback callback) { + EXPECT_EQ(request.authorization().key().data().label(), "pin"); + // just fail the operation + std::move(callback).Run(absl::nullopt); + }); + base::test::TestFuture<std::unique_ptr<UserContext>, + absl::optional<CryptohomeError>> + result; + performer.AuthenticateUsingKnowledgeKey(std::move(context_), + result.GetCallback()); + ASSERT_TRUE(result.Get<1>().has_value()); +} + +} // namespace +} // namespace ash
diff --git a/ash/components/login/auth/auth_session_authenticator.cc b/ash/components/login/auth/auth_session_authenticator.cc index 3b16672..985504c 100644 --- a/ash/components/login/auth/auth_session_authenticator.cc +++ b/ash/components/login/auth/auth_session_authenticator.cc
@@ -31,7 +31,8 @@ is_ephemeral_mount_enforced_(is_ephemeral_mount_enforced), safe_mode_delegate_(std::move(safe_mode_delegate)), auth_factor_editor_(std::make_unique<AuthFactorEditor>()), - auth_performer_(std::make_unique<AuthPerformer>()), + auth_performer_( + std::make_unique<AuthPerformer>(UserDataAuthClient::Get())), mount_performer_(std::make_unique<MountPerformer>()) {} AuthSessionAuthenticator::~AuthSessionAuthenticator() = default;
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index 638de13f..8510a40 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -592,8 +592,8 @@ "EnableOobeNetworkScreenSkip", base::FEATURE_ENABLED_BY_DEFAULT}; // Enables skipping of network screen. -const base::Feature kEnableOobeThemeSelection{ - "EnableOobeThemeSelection", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kEnableOobeThemeSelection{"EnableOobeThemeSelection", + base::FEATURE_ENABLED_BY_DEFAULT}; // Enables showing notification after the password change for SAML users. const base::Feature kEnableSamlNotificationOnPasswordChangeSuccess{ @@ -1505,10 +1505,6 @@ const base::Feature kVirtualKeyboardBorderedKey{ "VirtualKeyboardBorderedKey", base::FEATURE_ENABLED_BY_DEFAULT}; -// Enable or disable multitouch for virtual keyboard on ChromeOS. -const base::Feature kVirtualKeyboardMultitouch{ - "VirtualKeyboardMultitouch", base::FEATURE_DISABLED_BY_DEFAULT}; - // Enable or disable round corners for virtual keyboard on ChromeOS. const base::Feature kVirtualKeyboardRoundCorners{ "VirtualKeyboardRoundCorners", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index 72b1d45..674f3c0 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -597,8 +597,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kVirtualKeyboardBorderedKey; COMPONENT_EXPORT(ASH_CONSTANTS) -extern const base::Feature kVirtualKeyboardMultitouch; -COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kVirtualKeyboardRoundCorners; COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kWakeOnWifiAllowed;
diff --git a/ash/display/screen_ash.cc b/ash/display/screen_ash.cc index 6400703a..e3ead6a 100644 --- a/ash/display/screen_ash.cc +++ b/ash/display/screen_ash.cc
@@ -42,6 +42,7 @@ : display_list_(screen_ash->GetAllDisplays()), primary_display_(screen_ash->GetPrimaryDisplay()) { SetDisplayForNewWindows(primary_display_.id()); + set_shutdown(true); } ScreenForShutdown(const ScreenForShutdown&) = delete;
diff --git a/ash/host/ash_window_tree_host_platform_unittest.cc b/ash/host/ash_window_tree_host_platform_unittest.cc index c01f712..b6a4ef0b 100644 --- a/ash/host/ash_window_tree_host_platform_unittest.cc +++ b/ash/host/ash_window_tree_host_platform_unittest.cc
@@ -46,6 +46,11 @@ void GetAutoRepeatRate(base::TimeDelta* delay, base::TimeDelta* interval) override {} void SetCurrentLayoutByName(const std::string& layout_name) override {} + void SetKeyboardKeyBitsMapping( + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) override {} + std::vector<uint64_t> GetKeyboardKeyBits(int id) override { + return std::vector<uint64_t>(); + } void SetTouchEventLoggingEnabled(bool enabled) override { NOTIMPLEMENTED_LOG_ONCE(); }
diff --git a/ash/public/cpp/ambient/ambient_metrics.cc b/ash/public/cpp/ambient/ambient_metrics.cc index a1fcd1f..d62c6f97 100644 --- a/ash/public/cpp/ambient/ambient_metrics.cc +++ b/ash/public/cpp/ambient/ambient_metrics.cc
@@ -114,5 +114,15 @@ percentage_match); } +void RecordAmbientModeStartupTime(base::TimeDelta startup_time, + AmbientAnimationTheme theme) { + base::UmaHistogramCustomTimes( + /*name=*/base::StrCat({"Ash.AmbientMode.StartupTime.", ToString(theme)}), + /*sample=*/startup_time, + /*min=*/base::Seconds(0), + /*max=*/kMetricsStartupTimeMax, + /*buckets=*/50); +} + } // namespace ambient } // namespace ash
diff --git a/ash/public/cpp/ambient/ambient_metrics.h b/ash/public/cpp/ambient/ambient_metrics.h index c86a9ac3..797073a 100644 --- a/ash/public/cpp/ambient/ambient_metrics.h +++ b/ash/public/cpp/ambient/ambient_metrics.h
@@ -28,6 +28,10 @@ kMaxValue = kGooglePhotosEmpty, }; +// Duration after which ambient mode is considered to have failed to start. +// See summary in histograms.xml for why 15 seconds is used. +constexpr base::TimeDelta kMetricsStartupTimeMax = base::Seconds(15); + ASH_PUBLIC_EXPORT AmbientModePhotoSource AmbientSettingsToPhotoSource(const AmbientSettings& settings); @@ -51,6 +55,10 @@ int percentage_match, AmbientAnimationTheme theme); +ASH_PUBLIC_EXPORT void RecordAmbientModeStartupTime( + base::TimeDelta startup_time, + AmbientAnimationTheme theme); + } // namespace ambient } // namespace ash
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index 7c43612..3e77c4f 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc
@@ -881,6 +881,10 @@ ambient_widget_.reset(); } +bool RootWindowController::HasAmbientWidget() const { + return !!ambient_widget_; +} + AccessibilityPanelLayoutManager* RootWindowController::GetAccessibilityPanelLayoutManagerForTest() { return GetAccessibilityPanelLayoutManager();
diff --git a/ash/root_window_controller.h b/ash/root_window_controller.h index 0f6310a..ac4f2627 100644 --- a/ash/root_window_controller.h +++ b/ash/root_window_controller.h
@@ -227,6 +227,7 @@ void CreateAmbientWidget(); void CloseAmbientWidget(bool immediately); + bool HasAmbientWidget() const; views::Widget* ambient_widget_for_testing() { return ambient_widget_.get(); } AppMenuModelAdapter* menu_model_adapter_for_testing() {
diff --git a/ash/services/device_sync/BUILD.gn b/ash/services/device_sync/BUILD.gn index c259ede..59f5c82 100644 --- a/ash/services/device_sync/BUILD.gn +++ b/ash/services/device_sync/BUILD.gn
@@ -178,6 +178,7 @@ ":*", "//ash/services/device_sync/public/cpp:prefs", "//ash/services/device_sync/public/cpp:unit_tests", + "//chrome/browser/ash", "//chrome/browser/chromeos", "//chrome/test:test_support_ui", ]
diff --git a/ash/services/secure_channel/BUILD.gn b/ash/services/secure_channel/BUILD.gn index 0dd2f39..c6ae8a2 100644 --- a/ash/services/secure_channel/BUILD.gn +++ b/ash/services/secure_channel/BUILD.gn
@@ -193,6 +193,7 @@ visibility = [ ":*", "//ash/services/secure_channel/public/cpp/client:unit_tests", + "//chrome/browser/ash", "//chrome/browser/chromeos", ] }
diff --git a/ash/shelf/login_shelf_view.cc b/ash/shelf/login_shelf_view.cc index e017958..8c1b5ea 100644 --- a/ash/shelf/login_shelf_view.cc +++ b/ash/shelf/login_shelf_view.cc
@@ -750,8 +750,10 @@ kiosk_apps_button_->SetApps(kiosk_apps); UpdateUi(); if (LockScreen::HasInstance()) { + // Consider Kiosk apps button to be present when there are Kiosk apps installed. + // TODO(b/234765162): rename the method as the naming is confusing. LockScreen::Get()->SetKioskAppsButtonPresence( - kiosk_apps_button_->GetVisible()); + kiosk_apps_button_->HasApps()); } }
diff --git a/ash/utility/haptics_tracking_test_input_controller.cc b/ash/utility/haptics_tracking_test_input_controller.cc index f1bc593..5323831a 100644 --- a/ash/utility/haptics_tracking_test_input_controller.cc +++ b/ash/utility/haptics_tracking_test_input_controller.cc
@@ -60,6 +60,14 @@ void HapticsTrackingTestInputController::SetCurrentLayoutByName( const std::string& layout_name) {} +void HapticsTrackingTestInputController::SetKeyboardKeyBitsMapping( + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) {} + +std::vector<uint64_t> HapticsTrackingTestInputController::GetKeyboardKeyBits( + int id) { + return std::vector<uint64_t>(); +} + void HapticsTrackingTestInputController::SetTouchpadSensitivity(int value) {} void HapticsTrackingTestInputController::SetTouchpadScrollSensitivity(
diff --git a/ash/utility/haptics_tracking_test_input_controller.h b/ash/utility/haptics_tracking_test_input_controller.h index 0cfc430..0dfb212d 100644 --- a/ash/utility/haptics_tracking_test_input_controller.h +++ b/ash/utility/haptics_tracking_test_input_controller.h
@@ -39,6 +39,9 @@ void GetAutoRepeatRate(base::TimeDelta* delay, base::TimeDelta* interval) override; void SetCurrentLayoutByName(const std::string& layout_name) override; + void SetKeyboardKeyBitsMapping( + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) override; + std::vector<uint64_t> GetKeyboardKeyBits(int id) override; void SetTouchpadSensitivity(int value) override; void SetTouchpadScrollSensitivity(int value) override; void SetTapToClick(bool enabled) override;
diff --git a/ash/wallpaper/wallpaper_view.cc b/ash/wallpaper/wallpaper_view.cc index b26e921..feabb247 100644 --- a/ash/wallpaper/wallpaper_view.cc +++ b/ash/wallpaper/wallpaper_view.cc
@@ -54,8 +54,6 @@ window->parent()->StackChildAtBottom(window); display::Display display = display::Screen::GetScreen()->GetDisplayNearestWindow(window); - display::ManagedDisplayInfo info = - Shell::Get()->display_manager()->GetDisplayInfo(display.id()); for (auto* child : children()) { child->SetBounds(0, 0, display.size().width(), display.size().height());
diff --git a/ash/webui/camera_app_ui/resources/js/deployed_version.ts b/ash/webui/camera_app_ui/resources/js/deployed_version.ts new file mode 100644 index 0000000..30fce1ea --- /dev/null +++ b/ash/webui/camera_app_ui/resources/js/deployed_version.ts
@@ -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. + +/** + * Deployed version if CCA is deployed from cca.py deploy. + * + * This will be overridden by cca.py deploy with a simple string of deployed + * timestamp, used only for developer to identify the deployed status. + */ +export const DEPLOYED_VERSION: string|undefined = undefined;
diff --git a/ash/webui/camera_app_ui/resources/js/js.gni b/ash/webui/camera_app_ui/resources/js/js.gni index a61d829..f88dea5 100644 --- a/ash/webui/camera_app_ui/resources/js/js.gni +++ b/ash/webui/camera_app_ui/resources/js/js.gni
@@ -9,6 +9,7 @@ "async_job_queue.ts", "barcode_chip.ts", "css.ts", + "deployed_version.ts", "device/camera3_device_info.ts", "device/camera_manager.ts", "device/camera_operation.ts",
diff --git a/ash/webui/camera_app_ui/resources/js/main.ts b/ash/webui/camera_app_ui/resources/js/main.ts index 8429626..23c28f9 100644 --- a/ash/webui/camera_app_ui/resources/js/main.ts +++ b/ash/webui/camera_app_ui/resources/js/main.ts
@@ -6,6 +6,7 @@ getDefaultWindowSize, } from './app_window.js'; import {assert, assertInstanceof} from './assert.js'; +import {DEPLOYED_VERSION} from './deployed_version.js'; import {CameraManager} from './device/index.js'; import {ModeConstraints} from './device/type.js'; import * as dom from './dom.js'; @@ -467,6 +468,15 @@ }); } + if (DEPLOYED_VERSION !== undefined) { + // eslint-disable-next-line no-console + console.log( + `Local override enabled for CCA (${DEPLOYED_VERSION}). ` + + 'To disable local override, ' + + 'remove /etc/camera/cca/js/deployed_version.js on device.'); + toast.showDebugMessage(`Local override enabled (${DEPLOYED_VERSION})`); + } + instance = new App({perfLogger, intent, facing, mode}); await instance.start( openFrom === 'assistant' ? metrics.LaunchType.ASSISTANT :
diff --git a/ash/webui/camera_app_ui/resources/js/nav.ts b/ash/webui/camera_app_ui/resources/js/nav.ts index cf8539f1..e8ef903 100644 --- a/ash/webui/camera_app_ui/resources/js/nav.ts +++ b/ash/webui/camera_app_ui/resources/js/nav.ts
@@ -3,6 +3,7 @@ // found in the LICENSE file. import {assert} from './assert.js'; +import {DEPLOYED_VERSION} from './deployed_version.js'; import {toggleExpertMode} from './expert.js'; import * as state from './state.js'; import * as toast from './toast.js'; @@ -180,7 +181,10 @@ event.preventDefault(); break; case 'Ctrl-V': - toast.showDebugMessage('SWA'); + toast.showDebugMessage(`SWA${ + DEPLOYED_VERSION === undefined ? + '' : + `, Local overrde enabled (${DEPLOYED_VERSION})`}`); break; case 'Ctrl-Shift-E': toggleExpertMode();
diff --git a/ash/webui/camera_app_ui/resources/utils/cca.py b/ash/webui/camera_app_ui/resources/utils/cca.py index f3da916..3b92e0b 100755 --- a/ash/webui/camera_app_ui/resources/utils/cca.py +++ b/ash/webui/camera_app_ui/resources/utils/cca.py
@@ -187,7 +187,9 @@ '--', 'printf', '%s', - shlex.quote(f'export const VERSION = "cca.py deploy {current_time}";'), + shlex.quote( + f'export const DEPLOYED_VERSION = "cca.py deploy {current_time}";' + ), '>', f'{CCA_OVERRIDE_PATH}/js/deployed_version.js', ])
diff --git a/ash/webui/guest_os_installer/BUILD.gn b/ash/webui/guest_os_installer/BUILD.gn new file mode 100644 index 0000000..aacb7b6a8 --- /dev/null +++ b/ash/webui/guest_os_installer/BUILD.gn
@@ -0,0 +1,23 @@ +# 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. + +import("//build/config/chromeos/ui_mode.gni") + +assert(is_chromeos_ash) + +static_library("guest_os_installer") { + sources = [ + "guest_os_installer_ui.cc", + "guest_os_installer_ui.h", + "url_constants.cc", + "url_constants.h", + ] + + deps = [ + "//ash/webui/guest_os_installer/mojom", + "//ash/webui/resources:guest_os_installer_resources", + "//content/public/browser", + "//ui/web_dialogs", + ] +}
diff --git a/ash/webui/guest_os_installer/DIR_METADATA b/ash/webui/guest_os_installer/DIR_METADATA new file mode 100644 index 0000000..b3cd940 --- /dev/null +++ b/ash/webui/guest_os_installer/DIR_METADATA
@@ -0,0 +1,3 @@ +monorail { + component: "UI>Shell>Containers" +}
diff --git a/ash/webui/guest_os_installer/OWNERS b/ash/webui/guest_os_installer/OWNERS new file mode 100644 index 0000000..a33be2b --- /dev/null +++ b/ash/webui/guest_os_installer/OWNERS
@@ -0,0 +1 @@ +file://chrome/browser/ash/guest_os/OWNERS
diff --git a/ash/webui/guest_os_installer/guest_os_installer_ui.cc b/ash/webui/guest_os_installer/guest_os_installer_ui.cc new file mode 100644 index 0000000..dd24bdd --- /dev/null +++ b/ash/webui/guest_os_installer/guest_os_installer_ui.cc
@@ -0,0 +1,54 @@ +// 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. + +#include "ash/webui/guest_os_installer/guest_os_installer_ui.h" + +#include "ash/webui/grit/ash_guest_os_installer_resources.h" +#include "ash/webui/grit/ash_guest_os_installer_resources_map.h" +#include "ash/webui/guest_os_installer/url_constants.h" +#include "content/public/browser/web_ui_data_source.h" + +namespace ash { + +GuestOSInstallerUI::GuestOSInstallerUI(content::WebUI* web_ui, + const GURL& url, + DelegateFactory delegate_factory) + : ui::MojoWebDialogUI(web_ui), + url_(url), + delegate_factory_(delegate_factory) { + auto* source = content::WebUIDataSource::CreateAndAdd( + web_ui->GetWebContents()->GetBrowserContext(), + ash::kChromeUIGuestOSInstallerHost); + + source->DisableTrustedTypesCSP(); + + source->AddResourcePaths(base::make_span(kAshGuestOsInstallerResources, + kAshGuestOsInstallerResourcesSize)); + source->SetDefaultResource(IDR_ASH_GUEST_OS_INSTALLER_INDEX_HTML); +} + +GuestOSInstallerUI::~GuestOSInstallerUI() = default; + +void GuestOSInstallerUI::BindInterface( + mojo::PendingReceiver<ash::guest_os_installer::mojom::PageHandlerFactory> + pending_receiver) { + page_factory_receiver_.Bind(std::move(pending_receiver)); +} + +void GuestOSInstallerUI::CreatePageHandler( + mojo::PendingRemote<ash::guest_os_installer::mojom::Page> pending_page, + mojo::PendingReceiver<ash::guest_os_installer::mojom::PageHandler> + pending_page_handler) { + // Code under //ash/webui isn't allowed to know about types under //chrome, + // which is where all the actual GuestOS implementations live. To get around + // this we delegate actually picking a backend to this delegate factory + // callback, which lives in //chrome and is passed to us by our constructor + // (which also lives in //chrome). + handler_ = delegate_factory_.Run(this, url_, std::move(pending_page), + std::move(pending_page_handler)); +} + +WEB_UI_CONTROLLER_TYPE_IMPL(GuestOSInstallerUI) + +} // namespace ash
diff --git a/ash/webui/guest_os_installer/guest_os_installer_ui.h b/ash/webui/guest_os_installer/guest_os_installer_ui.h new file mode 100644 index 0000000..efa295f --- /dev/null +++ b/ash/webui/guest_os_installer/guest_os_installer_ui.h
@@ -0,0 +1,65 @@ +// 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. + +#ifndef ASH_WEBUI_GUEST_OS_INSTALLER_GUEST_OS_INSTALLER_UI_H_ +#define ASH_WEBUI_GUEST_OS_INSTALLER_GUEST_OS_INSTALLER_UI_H_ + +#include <memory> + +#include "ash/webui/guest_os_installer/mojom/guest_os_installer.mojom.h" +#include "base/bind.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "ui/web_dialogs/web_dialog_ui.h" + +namespace ash { + +// The WebUI for chrome://guest-os-installer +class GuestOSInstallerUI + : public ui::MojoWebDialogUI, + public ash::guest_os_installer::mojom::PageHandlerFactory { + public: + using DelegateFactory = base::RepeatingCallback< + std::unique_ptr<ash::guest_os_installer::mojom::PageHandler>( + GuestOSInstallerUI*, + const GURL&, + mojo::PendingRemote<ash::guest_os_installer::mojom::Page>, + mojo::PendingReceiver<ash::guest_os_installer::mojom::PageHandler>)>; + + GuestOSInstallerUI(content::WebUI* web_ui, + const GURL& url, + DelegateFactory delegate_factory); + + GuestOSInstallerUI(const GuestOSInstallerUI&) = delete; + GuestOSInstallerUI& operator=(const GuestOSInstallerUI&) = delete; + + ~GuestOSInstallerUI() override; + + void BindInterface( + mojo::PendingReceiver<ash::guest_os_installer::mojom::PageHandlerFactory> + pending_receiver); + + private: + // chromeos::guest_os_installer::mojom::PageHandlerFactory: + void CreatePageHandler( + mojo::PendingRemote<ash::guest_os_installer::mojom::Page> pending_page, + mojo::PendingReceiver<ash::guest_os_installer::mojom::PageHandler> + pending_page_handler) override; + + mojo::Receiver<ash::guest_os_installer::mojom::PageHandlerFactory> + page_factory_receiver_{this}; + + std::unique_ptr<ash::guest_os_installer::mojom::PageHandler> handler_; + + const GURL url_; + + const DelegateFactory delegate_factory_; + + WEB_UI_CONTROLLER_TYPE_DECL(); +}; + +} // namespace ash + +#endif // ASH_WEBUI_GUEST_OS_INSTALLER_GUEST_OS_INSTALLER_UI_H_
diff --git a/ash/webui/guest_os_installer/mojom/BUILD.gn b/ash/webui/guest_os_installer/mojom/BUILD.gn new file mode 100644 index 0000000..508eb9f --- /dev/null +++ b/ash/webui/guest_os_installer/mojom/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. + +import("//mojo/public/tools/bindings/mojom.gni") + +assert(is_chromeos_ash) + +mojom("mojom") { + sources = [ "guest_os_installer.mojom" ] + webui_module_path = "/" + public_deps = [] +}
diff --git a/ash/webui/guest_os_installer/mojom/OWNERS b/ash/webui/guest_os_installer/mojom/OWNERS new file mode 100644 index 0000000..08850f4 --- /dev/null +++ b/ash/webui/guest_os_installer/mojom/OWNERS
@@ -0,0 +1,2 @@ +per-file *.mojom=set noparent +per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/ash/webui/guest_os_installer/mojom/guest_os_installer.mojom b/ash/webui/guest_os_installer/mojom/guest_os_installer.mojom new file mode 100644 index 0000000..8d6530d --- /dev/null +++ b/ash/webui/guest_os_installer/mojom/guest_os_installer.mojom
@@ -0,0 +1,22 @@ +// 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. + +module ash.guest_os_installer.mojom; + +// Lives in the browser process. A renderer uses this to create a page handler +// for controlling the install. +interface PageHandlerFactory { + // Create a two-way connection between the renderer and the host. + CreatePageHandler(pending_remote<Page> page, + pending_receiver<PageHandler> handler); +}; + +// Lives in the browser process. A renderer use this to control installation. +interface PageHandler { +}; + +// Lives in the renderer process. The browser uses this to send UI +// updates to the web page in the renderer. +interface Page { +}; \ No newline at end of file
diff --git a/ash/webui/guest_os_installer/resources/BUILD.gn b/ash/webui/guest_os_installer/resources/BUILD.gn new file mode 100644 index 0000000..0760071 --- /dev/null +++ b/ash/webui/guest_os_installer/resources/BUILD.gn
@@ -0,0 +1,117 @@ +# 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. + +import("//third_party/closure_compiler/compile_js.gni") +import("//tools/grit/preprocess_if_expr.gni") +import("//tools/polymer/html_to_js.gni") +import("//tools/typescript/ts_library.gni") +import("//ui/webui/resources/tools/generate_grd.gni") + +assert(is_chromeos_ash) + +# This is a relatively complicated build file, so let me try to +# explain things... + +# Polymer components are made up of a HTML template and a typescript +# class. For ease of development we keep these in separate files, but +# at run-time the HTML template needs to be generated by the +# typescript code. This build rule substitiutes the contents of +# `app.html` for the string "{__html_template__}" in `app.ts`. +html_to_js("web_components") { + js_files = [ "app.ts" ] +} + +# We have three different files that needs to be passed to the +# typescript compiler (the mojom file is included because the mojo +# bindings generator currently doesn't handle typescript, see +# crbug.com/1002798) in the same directory, but are currently in three +# different locations. These three build rules copy them all into +# $target_gen_dir/ts_inputs. + +copy("copy_mojom") { + sources = [ "$target_gen_dir/../mojom/guest_os_installer.mojom-lite.js" ] + outputs = [ "$target_gen_dir/ts_inputs/guest_os_installer.mojom-lite.js" ] + deps = [ "../mojom:mojom_js" ] +} + +copy("copy_browser_proxy") { + sources = [ "browser_proxy.ts" ] + outputs = [ "$target_gen_dir/ts_inputs/browser_proxy.ts" ] +} + +copy("copy_app") { + sources = [ "$target_gen_dir/app.ts" ] + outputs = [ "$target_gen_dir/ts_inputs/app.ts" ] + deps = [ ":web_components" ] +} + +# Run the typescript compiler, putting the outputs in +# $target_gen_dir. This has to be a different directory to the inputs +# because the mojom file has the same name in both input and output, +# and they'd conflict otherwise. +ts_library("build_ts") { + root_dir = "$target_gen_dir/ts_inputs" + in_files = [ + "app.ts", + "browser_proxy.ts", + "guest_os_installer.mojom-lite.js", + ] + + # Allow javascript files in input + tsconfig_base = "tsconfig_base.json" + + # Dependencies that are typescript libraries + deps = [ "//ui/webui/resources:library" ] + + # Dependencies that are arbitrary build targets + extra_deps = [ + ":copy_app", + ":copy_browser_proxy", + ":copy_mojom", + ] +} + +# Generate "manifest" files for assets that can be processed into .grd +# files. Relative paths are significant here, so we have one for the +# generated assets and one for the static assets. Assets end up +# available in the WebUI context at the same path as is listed in +# `in_files`, e.g. chrome://guest-os-installer/app.js + +preprocess_if_expr("preprocess_generated") { + deps = [ ":build_ts" ] + in_folder = target_gen_dir + in_files = [ + "app.js", + "browser_proxy.js", + "guest_os_installer.mojom-lite.js", + ] + out_folder = "$target_gen_dir/preprocessed" + out_manifest = "$target_gen_dir/manifest_generated.json" +} + +preprocess_if_expr("preprocess_static") { + in_folder = "." + in_files = [ "index.html" ] + out_folder = "$target_gen_dir/preprocessed" + out_manifest = "$target_gen_dir/manifest_static.json" +} + +# Generate the actual grd file from the manifests. This is pulled in +# by //ash/webui/resources:guest_os_installer_resources, which is in +# turn pulled in by //chrome/chrome_paks.gni (to add the resources to +# the final resource pack), by //ash/webui/guest_os_installer to add +# them to the WebUI context, and by anyone else who needs to use these +# resources. +generate_grd("build_grd") { + deps = [ + ":preprocess_generated", + ":preprocess_static", + ] + manifest_files = [ + "$target_gen_dir/manifest_generated.json", + "$target_gen_dir/manifest_static.json", + ] + grd_prefix = "ash_guest_os_installer" + out_grd = "$target_gen_dir/${grd_prefix}_resources.grd" +}
diff --git a/ash/webui/guest_os_installer/resources/app.html b/ash/webui/guest_os_installer/resources/app.html new file mode 100644 index 0000000..b8d435b --- /dev/null +++ b/ash/webui/guest_os_installer/resources/app.html
@@ -0,0 +1,5 @@ +<style> +</style> +<div id="main"> + Hello World! +</div>
diff --git a/ash/webui/guest_os_installer/resources/app.ts b/ash/webui/guest_os_installer/resources/app.ts new file mode 100644 index 0000000..3f7f036 --- /dev/null +++ b/ash/webui/guest_os_installer/resources/app.ts
@@ -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. + +import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {BrowserProxy} from './browser_proxy.js'; + +class GuestOsInstallerApp extends PolymerElement { + static get is() { + return 'guest-os-installer-app'; + } + + static get template() { + return html`{__html_template__}`; + } + + listenerIds_: number[] = []; + + override connectedCallback() { + this.listenerIds_ = []; + super.connectedCallback(); + } + + override disconnectedCallback() { + const callbackRouter = BrowserProxy.getInstance().callbackRouter; + this.listenerIds_.forEach( + (id: number) => callbackRouter.removeListener(id)); + super.disconnectedCallback(); + } +} + +customElements.define('guest-os-installer-app', GuestOsInstallerApp);
diff --git a/ash/webui/guest_os_installer/resources/browser_proxy.ts b/ash/webui/guest_os_installer/resources/browser_proxy.ts new file mode 100644 index 0000000..cc7e761 --- /dev/null +++ b/ash/webui/guest_os_installer/resources/browser_proxy.ts
@@ -0,0 +1,29 @@ +// 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. + +import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js'; +import './guest_os_installer.mojom-lite.js'; + +export class BrowserProxy { + // The mojo generator doesn't generate typescript bindings yet, so + // we can't name the types these should have. + callbackRouter: any; + handler: any; + + constructor() { + this.callbackRouter = new ash.guestOsInstaller.mojom.PageCallbackRouter(); + this.handler = new ash.guestOsInstaller.mojom.PageHandlerRemote(); + + const factory = ash.guestOsInstaller.mojom.PageHandlerFactory.getRemote(); + factory.createPageHandler( + this.callbackRouter.$.bindNewPipeAndPassRemote(), + this.handler.$.bindNewPipeAndPassReceiver()); + } + + static instance: BrowserProxy|null = null; + static getInstance() { + return BrowserProxy.instance || + (BrowserProxy.instance = new BrowserProxy()); + } +}
diff --git a/ash/webui/guest_os_installer/resources/index.html b/ash/webui/guest_os_installer/resources/index.html new file mode 100644 index 0000000..900a076 --- /dev/null +++ b/ash/webui/guest_os_installer/resources/index.html
@@ -0,0 +1,18 @@ +<!doctype html> +<html dir="$i18n{textdirection}" lang="$i18n{language}"> +<head> + <meta charset="utf8"> + <title></title> + <style> + body { + margin: 0; + } + </style> + <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> + <link rel="stylesheet" href="chrome://resources/chromeos/colors/cros_styles.css"> + <script type="module" src="/app.js"></script> +</head> +<body> + <guest-os-installer-app></guest-os-installer-app> +</body> +</html>
diff --git a/ash/webui/guest_os_installer/resources/tsconfig_base.json b/ash/webui/guest_os_installer/resources/tsconfig_base.json new file mode 100644 index 0000000..99a81eca --- /dev/null +++ b/ash/webui/guest_os_installer/resources/tsconfig_base.json
@@ -0,0 +1,6 @@ +{ + "extends": "../../../../tools/typescript/tsconfig_base.json", + "compilerOptions": { + "allowJs": true + } +}
diff --git a/ash/webui/guest_os_installer/url_constants.cc b/ash/webui/guest_os_installer/url_constants.cc new file mode 100644 index 0000000..15a63d3 --- /dev/null +++ b/ash/webui/guest_os_installer/url_constants.cc
@@ -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. + +#include "ash/webui/guest_os_installer/url_constants.h" + +namespace ash { +const char kChromeUIGuestOSInstallerHost[] = "guest-os-installer"; +const char kChromeUIGuestOSInstallerUrl[] = "chrome://guest-os-installer"; +} // namespace ash
diff --git a/ash/webui/guest_os_installer/url_constants.h b/ash/webui/guest_os_installer/url_constants.h new file mode 100644 index 0000000..4fd5b74a --- /dev/null +++ b/ash/webui/guest_os_installer/url_constants.h
@@ -0,0 +1,15 @@ +// 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. + +#ifndef ASH_WEBUI_GUEST_OS_INSTALLER_URL_CONSTANTS_H_ +#define ASH_WEBUI_GUEST_OS_INSTALLER_URL_CONSTANTS_H_ + +namespace ash { + +extern const char kChromeUIGuestOSInstallerHost[]; +extern const char kChromeUIGuestOSInstallerUrl[]; + +} // namespace ash + +#endif
diff --git a/ash/webui/media_app_ui/resources/js/launch.js b/ash/webui/media_app_ui/resources/js/launch.js index 253ce26..65d6a18 100644 --- a/ash/webui/media_app_ui/resources/js/launch.js +++ b/ash/webui/media_app_ui/resources/js/launch.js
@@ -227,6 +227,10 @@ 'popup=1'); }); +guestMessagePipe.registerHandler(Message.RELOAD_MAIN_FRAME, () => { + window.location.reload(); +}); + guestMessagePipe.registerHandler(Message.EDIT_IN_PHOTOS, message => { const editInPhotosMsg = /** @type {!EditInPhotosMessage} */ (message); const fileHandle = fileHandleForToken(editInPhotosMsg.token);
diff --git a/ash/webui/media_app_ui/resources/js/media_app.externs.js b/ash/webui/media_app_ui/resources/js/media_app.externs.js index 581c1ce..2d10363 100644 --- a/ash/webui/media_app_ui/resources/js/media_app.externs.js +++ b/ash/webui/media_app_ui/resources/js/media_app.externs.js
@@ -64,10 +64,9 @@ * @type {function(): !Promise<boolean>|undefined} */ mediaApp.AbstractFile.prototype.isBrowserWritable; - /** - * A function that attempts to launch the original file in Photos in editing - * mode. Returns a promise that resolves when the launch has initiated. + * A function that attempts to launch the file in Photos in editing mode. + * Returns a promise that resolves when the launch has initiated. * @type {function(): !Promise<undefined>|undefined} */ mediaApp.AbstractFile.prototype.editInPhotos; @@ -165,7 +164,7 @@ /** * Request for the user to be prompted with an open file dialog. Files chosen * will be added to the last received file list. - * TODO(b/203466987): Remove the undefined here once we can ensure all file + * TODO(b/230670565): Remove the undefined here once we can ensure all file * lists implement a openFilesWithFilePicker function. * @type {function(!Array<string>, ?mediaApp.AbstractFile, ?boolean): * !Promise<undefined>|undefined} @@ -244,6 +243,11 @@ * @type {function(string)|undefined} */ mediaApp.ClientApiDelegate.prototype.openUrlInBrowserTab = function(url) {}; +/** + * Reloads the main frame, reloading launch files. + * @type {function()|undefined} + */ +mediaApp.ClientApiDelegate.prototype.reloadMainFrame = function() {}; /** * The client Api for interacting with the media app instance.
diff --git a/ash/webui/media_app_ui/resources/js/message_types.js b/ash/webui/media_app_ui/resources/js/message_types.js index a360718..6b11468 100644 --- a/ash/webui/media_app_ui/resources/js/message_types.js +++ b/ash/webui/media_app_ui/resources/js/message_types.js
@@ -25,6 +25,7 @@ OPEN_FILES_WITH_PICKER: 'open-files-with-picker', OPEN_IN_SANDBOXED_VIEWER: 'open-in-sandboxed-viewer', OVERWRITE_FILE: 'overwrite-file', + RELOAD_MAIN_FRAME: 'reload-main-frame', RENAME_FILE: 'rename-file', REQUEST_SAVE_FILE: 'request-save-file', SAVE_AS: 'save-as',
diff --git a/ash/webui/media_app_ui/resources/js/receiver.js b/ash/webui/media_app_ui/resources/js/receiver.js index 4f66651..abc4a145 100644 --- a/ash/webui/media_app_ui/resources/js/receiver.js +++ b/ash/webui/media_app_ui/resources/js/receiver.js
@@ -364,6 +364,9 @@ parentMessagePipe.sendMessage( Message.OPEN_IN_SANDBOXED_VIEWER, {title, blobUuid}); }, + reloadMainFrame() { + parentMessagePipe.sendMessage(Message.RELOAD_MAIN_FRAME); + }, // TODO(b/219631600): Implement openUrlInBrowserTab() for LacrOS if needed. };
diff --git a/ash/webui/resources/BUILD.gn b/ash/webui/resources/BUILD.gn index 6e3ad667..568d2ee 100644 --- a/ash/webui/resources/BUILD.gn +++ b/ash/webui/resources/BUILD.gn
@@ -325,6 +325,12 @@ deps = [ "//ash/webui/eche_app_ui:build_grd" ] } +# Resources used by chrome://guest-os-installer +ash_generated_grit("guest_os_installer_resources") { + source = "$root_gen_dir/ash/webui/guest_os_installer/resources/ash_guest_os_installer_resources.grd" + deps = [ "//ash/webui/guest_os_installer/resources:build_grd" ] +} + # Resources automatically served by the chrome://eche-app bundle, obtained via DEPS. grit("eche_bundle_resources") { # Obtained via an internal CIPD package in src/DEPS.
diff --git a/base/BUILD.gn b/base/BUILD.gn index d093d9e..6b3dfff 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -1429,8 +1429,6 @@ "//base/third_party/double_conversion", "//base/third_party/dynamic_annotations", "//build:branding_buildflags", - "//build:chromecast_buildflags", - "//build:chromeos_buildflags", "//build/config/compiler:compiler_buildflags", "//third_party/modp_b64", ] @@ -1486,7 +1484,10 @@ ":sanitizer_buildflags", ":synchronization_buildflags", ":tracing_buildflags", + "//base/allocator/partition_allocator:buildflags", "//base/numerics:base_numerics", + "//build:chromecast_buildflags", + "//build:chromeos_buildflags", "//third_party/abseil-cpp:absl", ]
diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn index 1f4b506..4f423cf 100644 --- a/base/allocator/BUILD.gn +++ b/base/allocator/BUILD.gn
@@ -13,10 +13,6 @@ assert(use_allocator_shim || !_use_partition_alloc_as_malloc, "Partition alloc requires the allocator shim") - # Duplicates the setup Chromium uses to define `DCHECK_IS_ON()`, - # but avails it as a buildflag. - _dcheck_is_on = is_debug || dcheck_always_on - # BackupRefPtr(BRP) build flags. _use_backup_ref_ptr = use_backup_ref_ptr && use_partition_alloc && !is_nacl _put_ref_count_in_previous_slot = @@ -30,8 +26,6 @@ # MTECheckedPtr requires 64-bit pointers (not available in NaCl). _use_mte_checked_ptr = use_mte_checked_ptr && !is_nacl - _record_alloc_info = false - flags = [ "USE_ALLOCATOR_SHIM=$use_allocator_shim", "USE_PARTITION_ALLOC=$use_partition_alloc", @@ -43,14 +37,10 @@ "ENABLE_DANGLING_RAW_PTR_CHECKS=$_enable_dangling_raw_ptr_checks", "PUT_REF_COUNT_IN_PREVIOUS_SLOT=$_put_ref_count_in_previous_slot", - "PA_DCHECK_IS_ON=$_dcheck_is_on", - # Not to be used directly - see `partition_alloc_config.h`. "USE_MTE_CHECKED_PTR=$_use_mte_checked_ptr", "USE_FAKE_BINARY_EXPERIMENT=$use_fake_binary_experiment", - - "RECORD_ALLOC_INFO=$_record_alloc_info", ] } @@ -61,7 +51,10 @@ "early_zone_registration_mac.h", ] - deps = [ ":buildflags" ] + deps = [ + ":buildflags", + "//base/allocator/partition_allocator:buildflags", + ] } }
diff --git a/base/allocator/partition_allocator/BUILD.gn b/base/allocator/partition_allocator/BUILD.gn index ca27300..34ede98 100644 --- a/base/allocator/partition_allocator/BUILD.gn +++ b/base/allocator/partition_allocator/BUILD.gn
@@ -4,6 +4,11 @@ import("//base/allocator/allocator.gni") import("//base/allocator/partition_allocator/partition_alloc.gni") +import("//build/buildflag_header.gni") +import("//build/config/chromecast_build.gni") +import("//build/config/chromeos/ui_mode.gni") +import("//build/config/dcheck_always_on.gni") +import("//build/config/logging.gni") # Add partition_alloc.gni and import it for partition_alloc configs. @@ -267,14 +272,14 @@ # To support a trampoline for another arch, please refer to v8/src/heap/base. } public_deps = [ - "//base:debugging_buildflags", - "//base:logging_buildflags", + ":chromecast_buildflags", + ":chromeos_buildflags", + ":debugging_buildflags", + ":logging_buildflags", + ":partition_alloc_buildflags", "//base:synchronization_buildflags", "//base:tracing_buildflags", - "//base/allocator:buildflags", "//build:branding_buildflags", - "//build:chromecast_buildflags", - "//build:chromeos_buildflags", "//build/config/compiler:compiler_buildflags", ] @@ -355,14 +360,14 @@ ] } public_deps = [ - "//base:debugging_buildflags", - "//base:logging_buildflags", + ":chromecast_buildflags", + ":chromeos_buildflags", + ":debugging_buildflags", + ":logging_buildflags", + ":partition_alloc_buildflags", "//base:synchronization_buildflags", "//base:tracing_buildflags", - "//base/allocator:buildflags", "//build:branding_buildflags", - "//build:chromecast_buildflags", - "//build:chromeos_buildflags", "//build/config/compiler:compiler_buildflags", ] public_configs = [] @@ -386,15 +391,91 @@ } } +buildflag_header("partition_alloc_buildflags") { + header = "partition_alloc_buildflags.h" + + _use_partition_alloc_as_malloc = use_allocator == "partition" + assert(use_allocator_shim || !_use_partition_alloc_as_malloc, + "Partition alloc requires the allocator shim") + + # BackupRefPtr(BRP) build flags. + _use_backup_ref_ptr = use_backup_ref_ptr && use_partition_alloc && !is_nacl + _put_ref_count_in_previous_slot = + put_ref_count_in_previous_slot && _use_backup_ref_ptr + _enable_backup_ref_ptr_slow_checks = + enable_backup_ref_ptr_slow_checks && _use_backup_ref_ptr + _enable_dangling_raw_ptr_checks = + enable_dangling_raw_ptr_checks && _use_backup_ref_ptr + + # MTECheckedPtr is exclusive against BRP (asserted at declaration). + # MTECheckedPtr requires 64-bit pointers (not available in NaCl). + _use_mte_checked_ptr = use_mte_checked_ptr && !is_nacl + + _record_alloc_info = false + + # TODO(crbug.com/1151236): Need to refactor the following buildflags. + # The buildflags (expect RECORD_ALLOC_INFO) are used by both chrome and + # partition alloc. For partition alloc, + # gen/base/allocator/partition_allocator/partition_alloc_buildflags.h + # defines and partition alloc includes the header file. For chrome, + # gen/base/allocator/buildflags.h defines and chrome includes. + flags = [ + "USE_PARTITION_ALLOC_AS_MALLOC=$_use_partition_alloc_as_malloc", + + "USE_BACKUP_REF_PTR=$_use_backup_ref_ptr", + "ENABLE_BACKUP_REF_PTR_SLOW_CHECKS=$_enable_backup_ref_ptr_slow_checks", + "ENABLE_DANGLING_RAW_PTR_CHECKS=$_enable_dangling_raw_ptr_checks", + "PUT_REF_COUNT_IN_PREVIOUS_SLOT=$_put_ref_count_in_previous_slot", + + "USE_MTE_CHECKED_PTR=$_use_mte_checked_ptr", + + "RECORD_ALLOC_INFO=$_record_alloc_info", + ] +} + +buildflag_header("chromecast_buildflags") { + header = "chromecast_buildflags.h" + + flags = [ "PA_IS_CASTOS=$is_castos" ] +} + +buildflag_header("chromeos_buildflags") { + header = "chromeos_buildflags.h" + + flags = [ "PA_IS_CHROMEOS_ASH=$is_chromeos_ash" ] +} + +buildflag_header("logging_buildflags") { + header = "logging_buildflags.h" + + flags = [ "PA_ENABLE_LOG_ERROR_NOT_REACHED=$enable_log_error_not_reached" ] +} + +buildflag_header("debugging_buildflags") { + header = "debugging_buildflags.h" + header_dir = rebase_path(".", "//") + "/partition_alloc_base/debug" + + # Duplicates the setup Chromium uses to define `DCHECK_IS_ON()`, + # but avails it as a buildflag. + _dcheck_is_on = is_debug || dcheck_always_on + + flags = [ + "PA_DCHECK_IS_ON=$_dcheck_is_on", + "PA_EXPENSIVE_DCHECKS_ARE_ON=$enable_expensive_dchecks", + ] +} + +group("buildflags") { + public_deps = [ + ":chromecast_buildflags", + ":chromeos_buildflags", + ":debugging_buildflags", + ":logging_buildflags", + ":partition_alloc_buildflags", + ] +} + # TODO(crbug.com/1151236): After making partition_alloc a standalone library, # move test code here. i.e. test("partition_alloc_tests") { ... } and # test("partition_alloc_perftests"). -# TODO(crbug.com/1151236): Generate partition_alloc_buildflags. The following -# flags will be defined by the buildflags: -# "USE_BACKUP_REF_PTR=$_use_backup_ref_ptr", -# "ENABLE_BACKUP_REF_PTR_SLOW_CHECKS=$_enable_backup_ref_ptr_slow_checks", -# "ENABLE_DANGLING_RAW_PTR_CHECKS=$_enable_dangling_raw_ptr_checks", -# "PUT_REF_COUNT_IN_PREVIOUS_SLOT=$_put_ref_count_in_previous_slot", -# "USE_MTE_CHECKED_PTR=$_use_mte_checked_ptr", -# "RECORD_ALLOC_INFO=$_record_alloc_info",
diff --git a/base/allocator/partition_allocator/DEPS b/base/allocator/partition_allocator/DEPS index 3e1d7798..b49d589b 100644 --- a/base/allocator/partition_allocator/DEPS +++ b/base/allocator/partition_allocator/DEPS
@@ -4,13 +4,8 @@ noparent = True include_rules = [ - "+base/allocator/buildflags.h", - "+base/logging_buildflags.h", - "+base/debug/debugging_buildflags.h", "+build/build_config.h", "+build/buildflag.h", - "+build/chromeos_buildflags.h", - "+build/chromecast_buildflags.h", "+third_party/lss/linux_syscall_support.h", ]
diff --git a/base/allocator/partition_allocator/address_pool_manager.cc b/base/allocator/partition_allocator/address_pool_manager.cc index bc55d250..2b08878 100644 --- a/base/allocator/partition_allocator/address_pool_manager.cc +++ b/base/allocator/partition_allocator/address_pool_manager.cc
@@ -9,10 +9,11 @@ #include <cstdint> #include <limits> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/address_space_stats.h" #include "base/allocator/partition_allocator/page_allocator.h" #include "base/allocator/partition_allocator/page_allocator_constants.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h" #include "base/allocator/partition_allocator/partition_alloc_notreached.h"
diff --git a/base/allocator/partition_allocator/address_pool_manager.h b/base/allocator/partition_allocator/address_pool_manager.h index 186bf9c..42d0f7042 100644 --- a/base/allocator/partition_allocator/address_pool_manager.h +++ b/base/allocator/partition_allocator/address_pool_manager.h
@@ -8,12 +8,12 @@ #include <bitset> #include <limits> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/address_pool_manager_bitmap.h" #include "base/allocator/partition_allocator/address_pool_manager_types.h" #include "base/allocator/partition_allocator/partition_address_space.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_config.h"
diff --git a/base/allocator/partition_allocator/address_pool_manager_bitmap.cc b/base/allocator/partition_allocator/address_pool_manager_bitmap.cc index 5765bdf..1a7417c 100644 --- a/base/allocator/partition_allocator/address_pool_manager_bitmap.cc +++ b/base/allocator/partition_allocator/address_pool_manager_bitmap.cc
@@ -4,7 +4,7 @@ #include "base/allocator/partition_allocator/address_pool_manager_bitmap.h" -#include "base/allocator/buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h" #if !defined(PA_HAS_64_BITS_POINTERS)
diff --git a/base/allocator/partition_allocator/address_pool_manager_bitmap.h b/base/allocator/partition_allocator/address_pool_manager_bitmap.h index f9ab470..72e5346 100644 --- a/base/allocator/partition_allocator/address_pool_manager_bitmap.h +++ b/base/allocator/partition_allocator/address_pool_manager_bitmap.h
@@ -10,9 +10,9 @@ #include <bitset> #include <limits> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h"
diff --git a/base/allocator/partition_allocator/address_space_randomization_unittest.cc b/base/allocator/partition_allocator/address_space_randomization_unittest.cc index ee90dd5..bf3559c 100644 --- a/base/allocator/partition_allocator/address_space_randomization_unittest.cc +++ b/base/allocator/partition_allocator/address_space_randomization_unittest.cc
@@ -7,8 +7,8 @@ #include <cstdint> #include <vector> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/page_allocator.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/random.h" #include "build/build_config.h"
diff --git a/base/allocator/partition_allocator/address_space_stats.h b/base/allocator/partition_allocator/address_space_stats.h index 40fe522d..3954a1bf 100644 --- a/base/allocator/partition_allocator/address_space_stats.h +++ b/base/allocator/partition_allocator/address_space_stats.h
@@ -7,8 +7,8 @@ #include <cstddef> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" namespace partition_alloc {
diff --git a/base/allocator/partition_allocator/extended_api.cc b/base/allocator/partition_allocator/extended_api.cc index 444c371f..348d1084 100644 --- a/base/allocator/partition_allocator/extended_api.cc +++ b/base/allocator/partition_allocator/extended_api.cc
@@ -5,7 +5,7 @@ #include "base/allocator/partition_allocator/extended_api.h" #include "base/allocator/allocator_shim_default_dispatch_to_partition_alloc.h" -#include "base/allocator/buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/thread_cache.h" namespace partition_alloc::internal {
diff --git a/base/allocator/partition_allocator/memory_reclaimer_unittest.cc b/base/allocator/partition_allocator/memory_reclaimer_unittest.cc index 12b23c28..3c8193a 100644 --- a/base/allocator/partition_allocator/memory_reclaimer_unittest.cc +++ b/base/allocator/partition_allocator/memory_reclaimer_unittest.cc
@@ -8,10 +8,10 @@ #include <utility> #include "base/allocator/allocator_shim_default_dispatch_to_partition_alloc.h" -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/logging.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/base/allocator/partition_allocator/page_allocator_internals_posix.h b/base/allocator/partition_allocator/page_allocator_internals_posix.h index 983edff..fb3be905 100644 --- a/base/allocator/partition_allocator/page_allocator_internals_posix.h +++ b/base/allocator/partition_allocator/page_allocator_internals_posix.h
@@ -12,9 +12,9 @@ #include <sys/mman.h> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/oom.h" #include "base/allocator/partition_allocator/page_allocator.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/posix/eintr_wrapper.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "build/build_config.h"
diff --git a/base/allocator/partition_allocator/partition_address_space.h b/base/allocator/partition_allocator/partition_address_space.h index 0167dba8..33a2d85d 100644 --- a/base/allocator/partition_allocator/partition_address_space.h +++ b/base/allocator/partition_allocator/partition_address_space.h
@@ -9,12 +9,12 @@ #include <array> #include <limits> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/address_pool_manager_types.h" #include "base/allocator/partition_allocator/page_allocator_constants.h" #include "base/allocator/partition_allocator/partition_alloc_base/bits.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h" @@ -22,7 +22,6 @@ #include "base/allocator/partition_allocator/partition_alloc_notreached.h" #include "base/allocator/partition_allocator/tagging.h" #include "build/build_config.h" -#include "build/buildflag.h" // The feature is not applicable to 32-bit address space. #if defined(PA_HAS_64_BITS_POINTERS)
diff --git a/base/allocator/partition_allocator/partition_alloc-inl.h b/base/allocator/partition_allocator/partition_alloc-inl.h index 1953caa..f973695 100644 --- a/base/allocator/partition_allocator/partition_alloc-inl.h +++ b/base/allocator/partition_allocator/partition_alloc-inl.h
@@ -8,8 +8,8 @@ #include <algorithm> #include <cstring> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_ref_count.h" #include "base/allocator/partition_allocator/random.h" #include "build/build_config.h"
diff --git a/base/allocator/partition_allocator/partition_alloc.cc b/base/allocator/partition_allocator/partition_alloc.cc index 94995d0f..671ae93 100644 --- a/base/allocator/partition_allocator/partition_alloc.cc +++ b/base/allocator/partition_allocator/partition_alloc.cc
@@ -9,10 +9,11 @@ #include <cstdint> #include <memory> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/address_pool_manager.h" #include "base/allocator/partition_allocator/memory_reclaimer.h" #include "base/allocator/partition_allocator/partition_address_space.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_hooks.h" #include "base/allocator/partition_allocator/partition_direct_map_extent.h" #include "base/allocator/partition_allocator/partition_oom.h"
diff --git a/base/allocator/partition_allocator/partition_alloc_base/check.h b/base/allocator/partition_allocator/partition_alloc_base/check.h index 27aee111..ff6db46 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/check.h +++ b/base/allocator/partition_allocator/partition_alloc_base/check.h
@@ -7,9 +7,9 @@ #include <iosfwd> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/immediate_crash.h" // This header defines the CHECK, DCHECK, and DPCHECK macros.
diff --git a/base/allocator/partition_allocator/partition_alloc_base/files/file_path_pa_unittest.cc b/base/allocator/partition_allocator/partition_alloc_base/files/file_path_pa_unittest.cc index 059660a..1138786 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/files/file_path_pa_unittest.cc +++ b/base/allocator/partition_allocator/partition_alloc_base/files/file_path_pa_unittest.cc
@@ -9,7 +9,6 @@ #include <sstream> #include "build/build_config.h" -#include "build/buildflag.h" #include "testing/gtest/include/gtest/gtest.h" // This macro helps avoid wrapped lines in the test structs.
diff --git a/base/allocator/partition_allocator/partition_alloc_base/fuchsia/fuchsia_logging.h b/base/allocator/partition_allocator/partition_alloc_base/fuchsia/fuchsia_logging.h index 78a8a9be..393571e 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/fuchsia/fuchsia_logging.h +++ b/base/allocator/partition_allocator/partition_alloc_base/fuchsia/fuchsia_logging.h
@@ -8,8 +8,8 @@ #include <lib/fit/function.h> #include <zircon/types.h> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/logging.h" #include "build/build_config.h"
diff --git a/base/allocator/partition_allocator/partition_alloc_base/fuchsia/fuchsia_logging_pa_unittest.cc b/base/allocator/partition_allocator/partition_alloc_base/fuchsia/fuchsia_logging_pa_unittest.cc index 50f7f3f..bb6ce13 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/fuchsia/fuchsia_logging_pa_unittest.cc +++ b/base/allocator/partition_allocator/partition_alloc_base/fuchsia/fuchsia_logging_pa_unittest.cc
@@ -8,7 +8,7 @@ #include <lib/fidl/cpp/binding.h> #include <lib/sys/cpp/component_context.h> -#include "base/allocator/buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/logging.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/base/allocator/partition_allocator/partition_alloc_base/logging.h b/base/allocator/partition_allocator/partition_alloc_base/logging.h index 9abf1d52..fcec8abc 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/logging.h +++ b/base/allocator/partition_allocator/partition_alloc_base/logging.h
@@ -12,9 +12,9 @@ #include <sstream> #include <string> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/migration_adapter.h" #include "base/allocator/partition_allocator/partition_alloc_base/scoped_clear_last_error.h" #include "build/build_config.h"
diff --git a/base/allocator/partition_allocator/partition_alloc_base/logging_pa_unittest.cc b/base/allocator/partition_allocator/partition_alloc_base/logging_pa_unittest.cc index 104079c..e61f5c0 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/logging_pa_unittest.cc +++ b/base/allocator/partition_allocator/partition_alloc_base/logging_pa_unittest.cc
@@ -5,7 +5,7 @@ #include <sstream> #include <string> -#include "base/allocator/buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/logging.h" #include "build/build_config.h"
diff --git a/base/allocator/partition_allocator/partition_alloc_base/memory/ref_counted.cc b/base/allocator/partition_allocator/partition_alloc_base/memory/ref_counted.cc index b613d12..bce47b5 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/memory/ref_counted.cc +++ b/base/allocator/partition_allocator/partition_alloc_base/memory/ref_counted.cc
@@ -8,7 +8,7 @@ #include <ostream> #include <type_traits> -#include "base/allocator/buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" namespace partition_alloc::internal::base::subtle {
diff --git a/base/allocator/partition_allocator/partition_alloc_base/memory/ref_counted.h b/base/allocator/partition_allocator/partition_alloc_base/memory/ref_counted.h index 5150fa3..4618e20 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/memory/ref_counted.h +++ b/base/allocator/partition_allocator/partition_alloc_base/memory/ref_counted.h
@@ -5,10 +5,10 @@ #ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_BASE_MEMORY_REF_COUNTED_H_ #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_BASE_MEMORY_REF_COUNTED_H_ -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/atomic_ref_count.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/memory/scoped_refptr.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "build/build_config.h"
diff --git a/base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h b/base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h index 7beab2b2..c73bb1f 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h +++ b/base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h
@@ -37,7 +37,7 @@ #ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_BASE_THREAD_ANNOTATIONS_H_ #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_BASE_THREAD_ANNOTATIONS_H_ -#include "base/allocator/buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "build/build_config.h" #if defined(__clang__)
diff --git a/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_posix.cc b/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_posix.cc index d47ac1e..a69ffab 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_posix.cc +++ b/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_posix.cc
@@ -12,7 +12,7 @@ #include <sys/types.h> #include <unistd.h> -#include "base/allocator/buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/logging.h" #include "base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_internal_posix.h" #include "build/build_config.h"
diff --git a/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_posix_for_testing.cc b/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_posix_for_testing.cc index 4947e7b7..8e8280a 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_posix_for_testing.cc +++ b/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_posix_for_testing.cc
@@ -13,9 +13,9 @@ #include <sys/types.h> #include <unistd.h> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/logging.h" #include "base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_internal_posix.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "build/build_config.h"
diff --git a/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_win.cc b/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_win.cc index 077432f..952dd11 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_win.cc +++ b/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_win.cc
@@ -6,7 +6,6 @@ #include <stddef.h> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/time/time_override.h" #include <windows.h>
diff --git a/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_win_for_testing.cc b/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_win_for_testing.cc index 3bf5977036..8c9a8d8 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_win_for_testing.cc +++ b/base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_win_for_testing.cc
@@ -6,9 +6,9 @@ #include <stddef.h> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/oom.h" #include "base/allocator/partition_allocator/partition_alloc_base/debug/alias.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "build/build_config.h"
diff --git a/base/allocator/partition_allocator/partition_alloc_base/time/time.h b/base/allocator/partition_allocator/partition_alloc_base/time/time.h index 0f5cd71..54980b3 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/time/time.h +++ b/base/allocator/partition_allocator/partition_alloc_base/time/time.h
@@ -68,12 +68,12 @@ #include <iosfwd> #include <limits> +#include "base/allocator/partition_allocator/chromeos_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" #include "base/allocator/partition_allocator/partition_alloc_base/migration_adapter.h" #include "base/allocator/partition_allocator/partition_alloc_base/numerics/clamped_math.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #if BUILDFLAG(IS_FUCHSIA) #include <zircon/types.h> @@ -888,14 +888,14 @@ #endif // BUILDFLAG(IS_MAC) -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(PA_IS_CHROMEOS_ASH) // Converts to TimeTicks the value obtained from SystemClock.uptimeMillis(). // Note: this conversion may be non-monotonic in relation to previously // obtained TimeTicks::Now() values because of the truncation (to // milliseconds) performed by uptimeMillis(). static TimeTicks FromUptimeMillis(int64_t uptime_millis_value); -#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(PA_IS_CHROMEOS_ASH) #if BUILDFLAG(IS_ANDROID) // Converts to TimeTicks the value obtained from System.nanoTime(). This
diff --git a/base/allocator/partition_allocator/partition_alloc_check.h b/base/allocator/partition_allocator/partition_alloc_check.h index b0f7c26..80e06ee 100644 --- a/base/allocator/partition_allocator/partition_alloc_check.h +++ b/base/allocator/partition_allocator/partition_alloc_check.h
@@ -7,12 +7,13 @@ #include <cstdint> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/page_allocator_constants.h" #include "base/allocator/partition_allocator/partition_alloc_base/check.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/debug/alias.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/immediate_crash.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "build/build_config.h" #define PA_STRINGIFY_IMPL(s) #s
diff --git a/base/allocator/partition_allocator/partition_alloc_config.h b/base/allocator/partition_allocator/partition_alloc_config.h index ae4749f..16ed3cc 100644 --- a/base/allocator/partition_allocator/partition_alloc_config.h +++ b/base/allocator/partition_allocator/partition_alloc_config.h
@@ -5,7 +5,8 @@ #ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_CONFIG_H_ #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_CONFIG_H_ -#include "base/allocator/buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "build/build_config.h" // ARCH_CPU_64_BITS implies 64-bit instruction set, but not necessarily 64-bit
diff --git a/base/allocator/partition_allocator/partition_alloc_forward.h b/base/allocator/partition_allocator/partition_alloc_forward.h index b0c8f4e..3c573caa 100644 --- a/base/allocator/partition_allocator/partition_alloc_forward.h +++ b/base/allocator/partition_allocator/partition_alloc_forward.h
@@ -8,9 +8,10 @@ #include <algorithm> #include <cstddef> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" namespace partition_alloc {
diff --git a/base/allocator/partition_allocator/partition_alloc_notreached.h b/base/allocator/partition_allocator/partition_alloc_notreached.h index d19b4282..f1329d4 100644 --- a/base/allocator/partition_allocator/partition_alloc_notreached.h +++ b/base/allocator/partition_allocator/partition_alloc_notreached.h
@@ -5,17 +5,18 @@ #ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_NOTREACHED_H_ #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_ALLOC_NOTREACHED_H_ -#include "base/allocator/buildflags.h" +#include "base/allocator/partition_allocator/logging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" -#include "base/logging_buildflags.h" // When PartitionAlloc is used as the default allocator, we cannot use the // regular (D)CHECK() macros, as they allocate internally. (c.f. // // base/allocator/partition_allocator/partition_alloc_check.h) // So PA_NOTREACHED() uses PA_DCHECK() instead of DCHECK(). -#if BUILDFLAG(ENABLE_LOG_ERROR_NOT_REACHED) +#if BUILDFLAG(PA_ENABLE_LOG_ERROR_NOT_REACHED) #define PA_NOTREACHED() \ true ? ::partition_alloc::internal::logging::RawError( \ __FILE__ "(" PA_STRINGIFY(__LINE__) ") PA_NOTREACHED() hit.") \
diff --git a/base/allocator/partition_allocator/partition_alloc_unittest.cc b/base/allocator/partition_allocator/partition_alloc_unittest.cc index 350bd7d5..46c9ad7 100644 --- a/base/allocator/partition_allocator/partition_alloc_unittest.cc +++ b/base/allocator/partition_allocator/partition_alloc_unittest.cc
@@ -17,20 +17,22 @@ #include <tuple> #include <vector> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/address_space_randomization.h" +#include "base/allocator/partition_allocator/chromecast_buildflags.h" #include "base/allocator/partition_allocator/dangling_raw_ptr_checks.h" #include "base/allocator/partition_allocator/page_allocator_constants.h" #include "base/allocator/partition_allocator/partition_address_space.h" #include "base/allocator/partition_allocator/partition_alloc_base/bits.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/cpu.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/logging.h" #include "base/allocator/partition_allocator/partition_alloc_base/numerics/checked_math.h" #include "base/allocator/partition_allocator/partition_alloc_base/rand_util.h" #include "base/allocator/partition_allocator/partition_alloc_base/strings/stringprintf.h" #include "base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h" #include "base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_for_testing.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h" #include "base/allocator/partition_allocator/partition_bucket.h" @@ -42,10 +44,8 @@ #include "base/allocator/partition_allocator/partition_tag_bitmap.h" #include "base/allocator/partition_allocator/reservation_offset_table.h" #include "base/allocator/partition_allocator/tagging.h" -#include "base/debug/debugging_buildflags.h" #include "base/system/sys_info.h" #include "build/build_config.h" -#include "build/chromecast_buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #if defined(__ARM_FEATURE_MEMORY_TAGGING) @@ -937,7 +937,7 @@ // Check that the realloc copied correctly. char* new_char_ptr = static_cast<char*>(new_ptr); EXPECT_EQ(*new_char_ptr, 'A'); -#if BUILDFLAG(EXPENSIVE_DCHECKS_ARE_ON) +#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON) // Subtle: this checks for an old bug where we copied too much from the // source of the realloc. The condition can be detected by a trashing of // the uninitialized value in the space of the upsized allocation. @@ -1054,7 +1054,7 @@ allocator.root()->Free(new_ptr_2); allocator.root()->Free(ptr4); -#if BUILDFLAG(EXPENSIVE_DCHECKS_ARE_ON) +#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON) // |SlotSpanMetadata::Free| must poison the slot's contents with // |kFreedByte|. EXPECT_EQ(kFreedByte, @@ -1364,7 +1364,7 @@ char* char_ptr2 = static_cast<char*>(ptr2); EXPECT_EQ('A', char_ptr2[0]); EXPECT_EQ('A', char_ptr2[size - 1]); -#if BUILDFLAG(EXPENSIVE_DCHECKS_ARE_ON) +#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON) EXPECT_EQ(kUninitializedByte, static_cast<unsigned char>(char_ptr2[size])); #endif @@ -1376,7 +1376,7 @@ char* char_ptr = static_cast<char*>(ptr); EXPECT_EQ('A', char_ptr[0]); EXPECT_EQ('A', char_ptr[size - 2]); -#if BUILDFLAG(EXPENSIVE_DCHECKS_ARE_ON) +#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON) EXPECT_EQ(kUninitializedByte, static_cast<unsigned char>(char_ptr[size - 1])); #endif @@ -1396,7 +1396,7 @@ char_ptr2 = static_cast<char*>(ptr2); EXPECT_EQ('A', char_ptr2[0]); EXPECT_EQ('A', char_ptr2[size - 1]); -#if BUILDFLAG(EXPENSIVE_DCHECKS_ARE_ON) +#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON) EXPECT_EQ(kUninitializedByte, static_cast<unsigned char>(char_ptr2[size])); #endif allocator.root()->Free(ptr2); @@ -4165,7 +4165,7 @@ // https://ci.chromium.org/ui/p/chromium/builders/ci/Cast%20Audio%20Linux/98492/overview #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \ defined(GTEST_HAS_DEATH_TEST) && !BUILDFLAG(IS_ANDROID) && \ - !BUILDFLAG(IS_CHROMECAST) + !BUILDFLAG(PA_IS_CASTOS) namespace { @@ -4243,7 +4243,7 @@ #endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && // defined(GTEST_HAS_DEATH_TEST) && !BUILDFLAG(IS_ANDROID) && - // !BUILDFLAG(IS_CHROMECAST) + // !BUILDFLAG(PA_IS_CASTOS) // Checks the bucket index logic. TEST_P(PartitionAllocTest, GetIndex) { @@ -4520,7 +4520,7 @@ #endif // defined(PA_USE_MTE_CHECKED_PTR_WITH_64_BITS_POINTERS) #if BUILDFLAG(IS_ANDROID) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \ - BUILDFLAG(IS_CHROMECAST) + BUILDFLAG(PA_IS_CASTOS) extern "C" { void* __real_malloc(size_t); } // extern "C"
diff --git a/base/allocator/partition_allocator/partition_bucket.cc b/base/allocator/partition_allocator/partition_bucket.cc index 8107f5d..36c7b43 100644 --- a/base/allocator/partition_allocator/partition_bucket.cc +++ b/base/allocator/partition_allocator/partition_bucket.cc
@@ -8,7 +8,6 @@ #include <cstdint> #include <tuple> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/address_pool_manager.h" #include "base/allocator/partition_allocator/oom.h" #include "base/allocator/partition_allocator/page_allocator.h" @@ -19,8 +18,10 @@ #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" #include "base/allocator/partition_allocator/partition_alloc_base/debug/alias.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/immediate_crash.h" #include "base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h"
diff --git a/base/allocator/partition_allocator/partition_cookie.h b/base/allocator/partition_allocator/partition_cookie.h index ed38f035..a3fe230 100644 --- a/base/allocator/partition_allocator/partition_cookie.h +++ b/base/allocator/partition_allocator/partition_cookie.h
@@ -5,8 +5,8 @@ #ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_COOKIE_H_ #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_COOKIE_H_ -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" namespace partition_alloc::internal {
diff --git a/base/allocator/partition_allocator/partition_freelist_entry.h b/base/allocator/partition_allocator/partition_freelist_entry.h index 9be80ff..ac097fb 100644 --- a/base/allocator/partition_allocator/partition_freelist_entry.h +++ b/base/allocator/partition_allocator/partition_freelist_entry.h
@@ -8,12 +8,13 @@ #include <cstddef> #include <cstdint> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc-inl.h" #include "base/allocator/partition_allocator/partition_alloc_base/bits.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/immediate_crash.h" #include "base/allocator/partition_allocator/partition_alloc_base/sys_byteorder.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h"
diff --git a/base/allocator/partition_allocator/partition_lock.h b/base/allocator/partition_allocator/partition_lock.h index cb5d685..f0efc921 100644 --- a/base/allocator/partition_allocator/partition_lock.h +++ b/base/allocator/partition_allocator/partition_lock.h
@@ -8,8 +8,8 @@ #include <atomic> #include <type_traits> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/immediate_crash.h" #include "base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h" #include "base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread.h"
diff --git a/base/allocator/partition_allocator/partition_lock_unittest.cc b/base/allocator/partition_allocator/partition_lock_unittest.cc index a45d0d7..7b634ff 100644 --- a/base/allocator/partition_allocator/partition_lock_unittest.cc +++ b/base/allocator/partition_allocator/partition_lock_unittest.cc
@@ -4,7 +4,7 @@ #include "base/allocator/partition_allocator/partition_lock.h" -#include "base/allocator/buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/migration_adapter.h" #include "base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h" #include "base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_for_testing.h"
diff --git a/base/allocator/partition_allocator/partition_page.cc b/base/allocator/partition_allocator/partition_page.cc index 4f1a72a..3f11d6dc 100644 --- a/base/allocator/partition_allocator/partition_page.cc +++ b/base/allocator/partition_allocator/partition_page.cc
@@ -7,13 +7,14 @@ #include <algorithm> #include <cstdint> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/address_pool_manager.h" #include "base/allocator/partition_allocator/page_allocator.h" #include "base/allocator/partition_allocator/page_allocator_constants.h" #include "base/allocator/partition_allocator/partition_address_space.h" #include "base/allocator/partition_allocator/partition_alloc_base/bits.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h"
diff --git a/base/allocator/partition_allocator/partition_page.h b/base/allocator/partition_allocator/partition_page.h index 59fe1129..d28712c 100644 --- a/base/allocator/partition_allocator/partition_page.h +++ b/base/allocator/partition_allocator/partition_page.h
@@ -10,14 +10,15 @@ #include <limits> #include <utility> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/address_pool_manager.h" #include "base/allocator/partition_allocator/address_pool_manager_types.h" #include "base/allocator/partition_allocator/partition_address_space.h" #include "base/allocator/partition_allocator/partition_alloc_base/bits.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h" #include "base/allocator/partition_allocator/partition_alloc_forward.h"
diff --git a/base/allocator/partition_allocator/partition_ref_count.h b/base/allocator/partition_allocator/partition_ref_count.h index 93534fd..4b1326f 100644 --- a/base/allocator/partition_allocator/partition_ref_count.h +++ b/base/allocator/partition_allocator/partition_ref_count.h
@@ -8,10 +8,11 @@ #include <atomic> #include <cstdint> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/immediate_crash.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h"
diff --git a/base/allocator/partition_allocator/partition_root.cc b/base/allocator/partition_allocator/partition_root.cc index 2127867..c5b9543 100644 --- a/base/allocator/partition_allocator/partition_root.cc +++ b/base/allocator/partition_allocator/partition_root.cc
@@ -6,7 +6,6 @@ #include <cstdint> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/address_pool_manager_bitmap.h" #include "base/allocator/partition_allocator/oom.h" #include "base/allocator/partition_allocator/page_allocator.h" @@ -14,7 +13,9 @@ #include "base/allocator/partition_allocator/partition_alloc_base/bits.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h"
diff --git a/base/allocator/partition_allocator/partition_root.h b/base/allocator/partition_allocator/partition_root.h index 0f29c175..e9624ca6 100644 --- a/base/allocator/partition_allocator/partition_root.h +++ b/base/allocator/partition_allocator/partition_root.h
@@ -35,9 +35,9 @@ #include <cstddef> #include <cstdint> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/address_pool_manager_types.h" #include "base/allocator/partition_allocator/allocation_guard.h" +#include "base/allocator/partition_allocator/chromecast_buildflags.h" #include "base/allocator/partition_allocator/page_allocator.h" #include "base/allocator/partition_allocator/page_allocator_constants.h" #include "base/allocator/partition_allocator/partition_address_space.h" @@ -45,8 +45,10 @@ #include "base/allocator/partition_allocator/partition_alloc_base/bits.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h" #include "base/allocator/partition_allocator/partition_alloc_base/time/time.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h" @@ -67,9 +69,7 @@ #include "base/allocator/partition_allocator/starscan/state_bitmap.h" #include "base/allocator/partition_allocator/tagging.h" #include "base/allocator/partition_allocator/thread_cache.h" -#include "base/debug/debugging_buildflags.h" #include "build/build_config.h" -#include "build/chromecast_buildflags.h" // We use this to make MEMORY_TOOL_REPLACES_ALLOCATOR behave the same for max // size as other alloc code. @@ -993,7 +993,7 @@ PA_DCHECK(root->brp_enabled()); // memset() can be really expensive. -#if BUILDFLAG(EXPENSIVE_DCHECKS_ARE_ON) +#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON) DebugMemset(reinterpret_cast<void*>(slot_start), kFreedByte, slot_span->GetUtilizedSlotSize() #if BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) @@ -1130,7 +1130,7 @@ // // On Chromecast, this is already checked in PartitionFree() in the shim. #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && \ - ((BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMECAST))) + ((BUILDFLAG(IS_ANDROID) && !BUILDFLAG(PA_IS_CASTOS))) PA_CHECK(IsManagedByPartitionAlloc(object_addr)); #endif @@ -1283,7 +1283,7 @@ #endif // BUILDFLAG(USE_BACKUP_REF_PTR) // memset() can be really expensive. -#if BUILDFLAG(EXPENSIVE_DCHECKS_ARE_ON) +#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON) internal::DebugMemset(SlotStartAddr2Ptr(slot_start), internal::kFreedByte, slot_span->GetUtilizedSlotSize() #if BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) @@ -1824,7 +1824,7 @@ // PA_LIKELY: operator new() calls malloc(), not calloc(). if (PA_LIKELY(!zero_fill)) { // memset() can be really expensive. -#if BUILDFLAG(EXPENSIVE_DCHECKS_ARE_ON) +#if BUILDFLAG(PA_EXPENSIVE_DCHECKS_ARE_ON) internal::DebugMemset(object, internal::kUninitializedByte, usable_size); #endif } else if (!is_already_zeroed) {
diff --git a/base/allocator/partition_allocator/partition_tag.h b/base/allocator/partition_allocator/partition_tag.h index d8b5965..db224b86 100644 --- a/base/allocator/partition_allocator/partition_tag.h +++ b/base/allocator/partition_allocator/partition_tag.h
@@ -10,8 +10,8 @@ #include <string.h> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h" #include "base/allocator/partition_allocator/partition_alloc_notreached.h" #include "base/allocator/partition_allocator/partition_cookie.h"
diff --git a/base/allocator/partition_allocator/partition_tag_bitmap.h b/base/allocator/partition_allocator/partition_tag_bitmap.h index d494fa4..2911e724 100644 --- a/base/allocator/partition_allocator/partition_tag_bitmap.h +++ b/base/allocator/partition_allocator/partition_tag_bitmap.h
@@ -5,9 +5,9 @@ #ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_TAG_BITMAP_H_ #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_TAG_BITMAP_H_ -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/page_allocator_constants.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h" namespace partition_alloc::internal {
diff --git a/base/allocator/partition_allocator/reservation_offset_table.h b/base/allocator/partition_allocator/reservation_offset_table.h index 43804ba..18daf13 100644 --- a/base/allocator/partition_allocator/reservation_offset_table.h +++ b/base/allocator/partition_allocator/reservation_offset_table.h
@@ -10,11 +10,12 @@ #include <limits> #include <tuple> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/address_pool_manager.h" #include "base/allocator/partition_allocator/partition_address_space.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h" #include "base/allocator/partition_allocator/tagging.h"
diff --git a/base/allocator/partition_allocator/spinning_mutex.h b/base/allocator/partition_allocator/spinning_mutex.h index 5c922e6..7719bb05 100644 --- a/base/allocator/partition_allocator/spinning_mutex.h +++ b/base/allocator/partition_allocator/spinning_mutex.h
@@ -8,7 +8,6 @@ #include <algorithm> #include <atomic> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" #include "base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h"
diff --git a/base/allocator/partition_allocator/thread_cache.cc b/base/allocator/partition_allocator/thread_cache.cc index a927c42..c09ac4e4a 100644 --- a/base/allocator/partition_allocator/thread_cache.cc +++ b/base/allocator/partition_allocator/thread_cache.cc
@@ -10,10 +10,11 @@ #include <atomic> #include <cstdint> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" #include "base/allocator/partition_allocator/partition_alloc_base/cxx17_backports.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/immediate_crash.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_check.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/partition_alloc_constants.h"
diff --git a/base/allocator/partition_allocator/thread_cache.h b/base/allocator/partition_allocator/thread_cache.h index ca8daba5..6ced855 100644 --- a/base/allocator/partition_allocator/thread_cache.h +++ b/base/allocator/partition_allocator/thread_cache.h
@@ -10,12 +10,13 @@ #include <limits> #include <memory> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" +#include "base/allocator/partition_allocator/partition_alloc_base/debug/debugging_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_base/gtest_prod_util.h" #include "base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h" #include "base/allocator/partition_allocator/partition_alloc_base/time/time.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/partition_alloc_forward.h" #include "base/allocator/partition_allocator/partition_bucket_lookup.h"
diff --git a/base/allocator/partition_allocator/thread_cache_unittest.cc b/base/allocator/partition_allocator/thread_cache_unittest.cc index a970f960..1f36943 100644 --- a/base/allocator/partition_allocator/thread_cache_unittest.cc +++ b/base/allocator/partition_allocator/thread_cache_unittest.cc
@@ -8,12 +8,12 @@ #include <atomic> #include <vector> -#include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/extended_api.h" #include "base/allocator/partition_allocator/partition_address_space.h" #include "base/allocator/partition_allocator/partition_alloc.h" #include "base/allocator/partition_allocator/partition_alloc_base/thread_annotations.h" #include "base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_for_testing.h" +#include "base/allocator/partition_allocator/partition_alloc_buildflags.h" #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/partition_lock.h" #include "base/allocator/partition_allocator/tagging.h"
diff --git a/base/memory/shared_memory_mapping.h b/base/memory/shared_memory_mapping.h index 93c7bd3..c721140 100644 --- a/base/memory/shared_memory_mapping.h +++ b/base/memory/shared_memory_mapping.h
@@ -11,6 +11,7 @@ #include "base/base_export.h" #include "base/check.h" #include "base/containers/span.h" +#include "base/memory/raw_ptr.h" #include "base/memory/shared_memory_mapper.h" #include "base/unguessable_token.h" @@ -85,7 +86,7 @@ span<uint8_t> mapped_span_; size_t size_ = 0; UnguessableToken guid_; - SharedMemoryMapper* mapper_ = nullptr; + raw_ptr<SharedMemoryMapper> mapper_ = nullptr; }; // Class modeling a read-only mapping of a shared memory region into the
diff --git a/base/memory/values_equivalent_unittest.cc b/base/memory/values_equivalent_unittest.cc index e849b62..e7ad291 100644 --- a/base/memory/values_equivalent_unittest.cc +++ b/base/memory/values_equivalent_unittest.cc
@@ -4,6 +4,7 @@ #include "base/memory/values_equivalent.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_refptr.h" #include "testing/gtest/include/gtest/gtest.h" @@ -67,7 +68,7 @@ const int* Get() const { return pointer_; } private: - int* pointer_ = nullptr; + raw_ptr<int> pointer_ = nullptr; }; auto a = 1234;
diff --git a/base/metrics/persistent_memory_allocator.h b/base/metrics/persistent_memory_allocator.h index 92a599f..723ab55 100644 --- a/base/metrics/persistent_memory_allocator.h +++ b/base/metrics/persistent_memory_allocator.h
@@ -620,7 +620,7 @@ struct Memory { Memory(void* b, MemoryType t) : base(b), type(t) {} - void* base; + raw_ptr<void> base; MemoryType type; };
diff --git a/base/run_loop.h b/base/run_loop.h index a7390ab..9762f2ad 100644 --- a/base/run_loop.h +++ b/base/run_loop.h
@@ -15,6 +15,7 @@ #include "base/dcheck_is_on.h" #include "base/gtest_prod_util.h" #include "base/location.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/sequence_checker.h" @@ -353,7 +354,7 @@ private: #if DCHECK_IS_ON() - RunLoop::Delegate* current_delegate_; + raw_ptr<RunLoop::Delegate> current_delegate_; const bool previous_run_allowance_; #endif // DCHECK_IS_ON() };
diff --git a/base/task/current_thread.h b/base/task/current_thread.h index f82025c..13dc0cd 100644 --- a/base/task/current_thread.h +++ b/base/task/current_thread.h
@@ -10,6 +10,7 @@ #include "base/base_export.h" #include "base/callback_forward.h" #include "base/check.h" +#include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/message_loop/message_pump_for_io.h" #include "base/message_loop/message_pump_for_ui.h" @@ -194,7 +195,7 @@ friend class MessageLoopTaskRunnerTest; friend class web::WebTaskEnvironment; - sequence_manager::internal::SequenceManagerImpl* current_; + raw_ptr<sequence_manager::internal::SequenceManagerImpl> current_; }; #if !BUILDFLAG(IS_NACL)
diff --git a/base/task/delayed_task_handle_unittest.cc b/base/task/delayed_task_handle_unittest.cc index 7ea2715..b80e1938 100644 --- a/base/task/delayed_task_handle_unittest.cc +++ b/base/task/delayed_task_handle_unittest.cc
@@ -4,6 +4,7 @@ #include "base/task/delayed_task_handle.h" +#include "base/memory/raw_ptr.h" #include "base/test/gtest_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -33,7 +34,7 @@ bool is_valid_ = true; // Indicates if CancelTask() was invoked, if not null. Must outlives |this|. - bool* was_cancel_task_called_; + raw_ptr<bool> was_cancel_task_called_; }; } // namespace
diff --git a/base/task/sequence_manager/delayed_task_handle_delegate.h b/base/task/sequence_manager/delayed_task_handle_delegate.h index 108f356e..981a4b9 100644 --- a/base/task/sequence_manager/delayed_task_handle_delegate.h +++ b/base/task/sequence_manager/delayed_task_handle_delegate.h
@@ -6,6 +6,7 @@ #define BASE_TASK_SEQUENCE_MANAGER_DELAYED_TASK_HANDLE_DELEGATE_H_ #include "base/containers/intrusive_heap.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "base/task/delayed_task_handle.h" @@ -41,7 +42,7 @@ private: // The TaskQueueImpl where the task was posted. - TaskQueueImpl* const outer_ GUARDED_BY_CONTEXT(sequence_checker_); + const raw_ptr<TaskQueueImpl> outer_ GUARDED_BY_CONTEXT(sequence_checker_); // The HeapHandle to the task, if the task is in the DelayedIncomingQueue, // invalid otherwise.
diff --git a/base/task/sequence_manager/sequence_manager_impl.cc b/base/task/sequence_manager/sequence_manager_impl.cc index c5d8a52..4d9e8cf 100644 --- a/base/task/sequence_manager/sequence_manager_impl.cc +++ b/base/task/sequence_manager/sequence_manager_impl.cc
@@ -406,7 +406,8 @@ void SequenceManagerImpl::ResetTimeDomain() { controller_->SetTickClock(main_thread_only().default_clock); - clock_.store(main_thread_only().default_clock, std::memory_order_release); + clock_.store(main_thread_only().default_clock.get(), + std::memory_order_release); main_thread_only().time_domain = nullptr; }
diff --git a/base/task/sequence_manager/sequence_manager_impl.h b/base/task/sequence_manager/sequence_manager_impl.h index cc8b58f8..f81bf9c 100644 --- a/base/task/sequence_manager/sequence_manager_impl.h +++ b/base/task/sequence_manager/sequence_manager_impl.h
@@ -292,7 +292,7 @@ internal::TaskQueueSelector selector; ObserverList<TaskObserver>::Unchecked task_observers; ObserverList<TaskTimeObserver>::Unchecked task_time_observers; - const base::TickClock* const default_clock; + const raw_ptr<const base::TickClock> default_clock; raw_ptr<TimeDomain> time_domain = nullptr; std::unique_ptr<WakeUpQueue> wake_up_queue;
diff --git a/base/task/sequence_manager/work_queue_sets.h b/base/task/sequence_manager/work_queue_sets.h index cd925771d..555baac 100644 --- a/base/task/sequence_manager/work_queue_sets.h +++ b/base/task/sequence_manager/work_queue_sets.h
@@ -105,7 +105,7 @@ private: struct OldestTaskOrder { TaskOrder key; - WorkQueue* value; + raw_ptr<WorkQueue> value; // Used for a min-heap. bool operator>(const OldestTaskOrder& other) const {
diff --git a/base/task/thread_pool/task_source.h b/base/task/thread_pool/task_source.h index c1b85bd..a00fd98 100644 --- a/base/task/thread_pool/task_source.h +++ b/base/task/thread_pool/task_source.h
@@ -34,7 +34,7 @@ struct BASE_EXPORT ExecutionEnvironment { SequenceToken token; - SequenceLocalStorageMap* sequence_local_storage; + raw_ptr<SequenceLocalStorageMap> sequence_local_storage; }; // A TaskSource is a virtual class that provides a series of Tasks that must be
diff --git a/base/task/thread_pool/task_tracker.cc b/base/task/thread_pool/task_tracker.cc index 683169f..f2a6ffe3 100644 --- a/base/task/thread_pool/task_tracker.cc +++ b/base/task/thread_pool/task_tracker.cc
@@ -518,7 +518,7 @@ ScopedSetSequenceLocalStorageMapForCurrentThread scoped_set_sequence_local_storage_map_for_current_thread( environment.sequence_local_storage - ? environment.sequence_local_storage + ? environment.sequence_local_storage.get() : &local_storage_map.value()); // Set up TaskRunnerHandle as expected for the scope of the task.
diff --git a/base/trace_event/category_registry.h b/base/trace_event/category_registry.h index 5fff7b6..4697bb3 100644 --- a/base/trace_event/category_registry.h +++ b/base/trace_event/category_registry.h
@@ -12,6 +12,7 @@ #include "base/base_export.h" #include "base/check_op.h" +#include "base/memory/raw_ptr.h" #include "base/trace_event/builtin_categories.h" #include "base/trace_event/common/trace_event_common.h" #include "base/trace_event/trace_category.h" @@ -41,8 +42,8 @@ TraceCategory* end() const { return end_; } private: - TraceCategory* const begin_; - TraceCategory* const end_; + const raw_ptr<TraceCategory> begin_; + const raw_ptr<TraceCategory> end_; }; // Known categories.
diff --git a/base/trace_event/traced_value.h b/base/trace_event/traced_value.h index 549da1ff..14f3253 100644 --- a/base/trace_event/traced_value.h +++ b/base/trace_event/traced_value.h
@@ -13,6 +13,7 @@ #include <vector> #include "base/base_export.h" +#include "base/memory/raw_ptr.h" #include "base/strings/string_piece.h" #include "base/trace_event/trace_arguments.h" @@ -100,7 +101,7 @@ private: explicit ArrayScope(TracedValue* value); - TracedValue* value_; + raw_ptr<TracedValue> value_; friend class TracedValue; }; @@ -143,7 +144,7 @@ private: explicit DictionaryScope(TracedValue* value); - TracedValue* value_; + raw_ptr<TracedValue> value_; friend class TracedValue; };
diff --git a/base/trace_event/typed_macros_embedder_support.h b/base/trace_event/typed_macros_embedder_support.h index faaf7f2..c97aad0 100644 --- a/base/trace_event/typed_macros_embedder_support.h +++ b/base/trace_event/typed_macros_embedder_support.h
@@ -49,9 +49,9 @@ IncrementalState* incremental_state() const { return incremental_state_; } private: - TrackEvent* event_; - IncrementalState* incremental_state_; - CompletionListener* listener_; + raw_ptr<TrackEvent> event_; + raw_ptr<IncrementalState> incremental_state_; + raw_ptr<CompletionListener> listener_; }; // Handle to a TracePacket which notifies a listener upon its destruction (after
diff --git a/base/value_iterators.h b/base/value_iterators.h index 6081c6b..6c21a66 100644 --- a/base/value_iterators.h +++ b/base/value_iterators.h
@@ -11,6 +11,7 @@ #include "base/base_export.h" #include "base/containers/flat_map.h" +#include "base/memory/raw_ptr.h" namespace base { @@ -167,7 +168,7 @@ const_reverse_iterator crend() const; private: - DictStorage* storage_; + raw_ptr<DictStorage> storage_; }; // This class wraps the various const |begin| and |end| methods of the @@ -204,7 +205,7 @@ const_reverse_iterator crend() const; private: - const DictStorage* storage_; + raw_ptr<const DictStorage> storage_; }; } // namespace detail
diff --git a/base/values.cc b/base/values.cc index c933bf0..de6685147 100644 --- a/base/values.cc +++ b/base/values.cc
@@ -8,7 +8,7 @@ // build time. Try not to raise this limit unless absolutely necessary. See // https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md #ifndef NACL_TC_REV -#pragma clang max_tokens_here 400000 +#pragma clang max_tokens_here 460000 #endif #include <algorithm>
diff --git a/build/fuchsia/linux_internal.sdk.sha1 b/build/fuchsia/linux_internal.sdk.sha1 index 8a95579..e2c60c8e 100644 --- a/build/fuchsia/linux_internal.sdk.sha1 +++ b/build/fuchsia/linux_internal.sdk.sha1
@@ -1 +1 @@ -8.20220606.2.1 +8.20220607.1.1
diff --git a/build/toolchain/get_concurrent_links.py b/build/toolchain/get_concurrent_links.py index d77bb43..f37e088 100755 --- a/build/toolchain/get_concurrent_links.py +++ b/build/toolchain/get_concurrent_links.py
@@ -94,6 +94,12 @@ else: reason = 'RAM' + # static link see too many open files if we have many concurrent links. + # ref: http://b/233068481 + if num_links > 30: + num_links = 30 + reason = 'nofile' + explanation.append('concurrent_links={} (reason: {})'.format( num_links, reason))
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index 7b8bfa3..7e9dd9f 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc
@@ -55,7 +55,7 @@ SkColor4f background_color; TouchActionRegion touch_action_region; ElementId element_id; - void* rare_inputs; + raw_ptr<void> rare_inputs; } inputs; raw_ptr<void> layer_tree_inputs; gfx::Rect update_rect;
diff --git a/cc/layers/layer.h b/cc/layers/layer.h index 4cf7628..588cecf 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h
@@ -1161,7 +1161,7 @@ AllowRemoveForReadd& operator=(const AllowRemoveForReadd&) = delete; private: - Layer* layer_; + raw_ptr<Layer> layer_; }; bool allow_remove_for_readd_ = false;
diff --git a/cc/layers/layer_list_iterator.h b/cc/layers/layer_list_iterator.h index 8dbdd9f..dc7e92a 100644 --- a/cc/layers/layer_list_iterator.h +++ b/cc/layers/layer_list_iterator.h
@@ -68,7 +68,7 @@ const Layer* operator*() const { return current_layer_; } private: - const Layer* current_layer_; + raw_ptr<const Layer> current_layer_; std::vector<size_t> list_indices_; };
diff --git a/cc/metrics/compositor_frame_reporter.h b/cc/metrics/compositor_frame_reporter.h index 9b41d47..5b4dab1 100644 --- a/cc/metrics/compositor_frame_reporter.h +++ b/cc/metrics/compositor_frame_reporter.h
@@ -162,7 +162,7 @@ base::TimeDelta GetLatency() const; private: - const ProcessedBlinkBreakdown* owner_; + raw_ptr<const ProcessedBlinkBreakdown> owner_; size_t index_ = 0; }; @@ -200,7 +200,7 @@ base::TimeDelta GetDuration() const; private: - const ProcessedVizBreakdown* owner_; + raw_ptr<const ProcessedVizBreakdown> owner_; const bool skip_swap_start_to_swap_end_; size_t index_ = 0;
diff --git a/cc/resources/resource_pool.h b/cc/resources/resource_pool.h index 1ee8d7f..a75b2e6 100644 --- a/cc/resources/resource_pool.h +++ b/cc/resources/resource_pool.h
@@ -392,7 +392,7 @@ } private: - ResourcePool* const resource_pool_; + const raw_ptr<ResourcePool> resource_pool_; const size_t unique_id_; const gfx::Size size_; const viz::ResourceFormat format_;
diff --git a/cc/test/test_layer_tree_frame_sink.h b/cc/test/test_layer_tree_frame_sink.h index 60558cc..41d1263 100644 --- a/cc/test/test_layer_tree_frame_sink.h +++ b/cc/test/test_layer_tree_frame_sink.h
@@ -168,7 +168,7 @@ raw_ptr<TestLayerTreeFrameSinkClient> test_client_ = nullptr; gfx::Size enlarge_pass_texture_amount_; - TaskRunnerProvider* task_runner_provider_; + raw_ptr<TaskRunnerProvider> task_runner_provider_; // The set of SharedBitmapIds that have been reported as allocated to this // interface. On closing this interface, the display compositor should drop
diff --git a/cc/tiles/tile.cc b/cc/tiles/tile.cc index 3afc048d..a8cb3fd 100644 --- a/cc/tiles/tile.cc +++ b/cc/tiles/tile.cc
@@ -25,7 +25,7 @@ int source_frame_number, int flags) : tile_manager_(tile_manager), - tiling_(info.tiling), + tiling_(info.tiling.get()), content_rect_(info.content_rect), enclosing_layer_rect_(info.enclosing_layer_rect), raster_transform_(info.raster_transform),
diff --git a/cc/tiles/tile.h b/cc/tiles/tile.h index bf4d2d6..cde7850f 100644 --- a/cc/tiles/tile.h +++ b/cc/tiles/tile.h
@@ -29,7 +29,7 @@ class CC_EXPORT Tile { public: struct CreateInfo { - const PictureLayerTiling* tiling = nullptr; + raw_ptr<const PictureLayerTiling> tiling = nullptr; int tiling_i_index = 0; int tiling_j_index = 0; gfx::Rect enclosing_layer_rect;
diff --git a/cc/trees/commit_state.h b/cc/trees/commit_state.h index 914cd6c..85f2ad2 100644 --- a/cc/trees/commit_state.h +++ b/cc/trees/commit_state.h
@@ -12,6 +12,7 @@ #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" +#include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "cc/benchmarks/micro_benchmark_impl.h" #include "cc/cc_export.h" @@ -165,7 +166,7 @@ } LayerListConstIterator end() const { return LayerListConstIterator(nullptr); } - MutatorHost* mutator_host; + raw_ptr<MutatorHost> mutator_host; PropertyTrees property_trees; scoped_refptr<Layer> root_layer; };
diff --git a/cc/trees/proxy_impl.cc b/cc/trees/proxy_impl.cc index 9dc7d8f6..e253b21 100644 --- a/cc/trees/proxy_impl.cc +++ b/cc/trees/proxy_impl.cc
@@ -77,9 +77,9 @@ } private: - CompletionEvent* const event_; + const raw_ptr<CompletionEvent> event_; CommitTimestamps commit_timestamps_; - base::SingleThreadTaskRunner* main_thread_task_runner_; + raw_ptr<base::SingleThreadTaskRunner> main_thread_task_runner_; base::WeakPtr<ProxyMain> proxy_main_weak_ptr_; }; @@ -767,7 +767,7 @@ allow_cross_thread_ref_count_access; auto* commit_state = data_for_commit_->commit_state.get(); - auto* unsafe_state = data_for_commit_->unsafe_state; + auto* unsafe_state = data_for_commit_->unsafe_state.get(); host_impl_->BeginCommit(commit_state->source_frame_number, commit_state->trace_id); host_impl_->FinishCommit(*commit_state, *unsafe_state);
diff --git a/cc/trees/proxy_impl.h b/cc/trees/proxy_impl.h index e2a678d..53859c9 100644 --- a/cc/trees/proxy_impl.h +++ b/cc/trees/proxy_impl.h
@@ -186,10 +186,10 @@ // Set when the main thread is waiting on a commit to complete. std::unique_ptr<ScopedCommitCompletionEvent> commit_completion_event; std::unique_ptr<CommitState> commit_state; - const ThreadUnsafeCommitState* unsafe_state; + raw_ptr<const ThreadUnsafeCommitState> unsafe_state; // This is passed from the main thread so the impl thread can record // timestamps at the beginning and end of commit. - CommitTimestamps* commit_timestamps = nullptr; + raw_ptr<CommitTimestamps> commit_timestamps = nullptr; }; std::unique_ptr<DataForCommit> data_for_commit_;
diff --git a/chrome/android/chrome_test_java_sources.gni b/chrome/android/chrome_test_java_sources.gni index 0e0a50a5b..9f0db1d7 100644 --- a/chrome/android/chrome_test_java_sources.gni +++ b/chrome/android/chrome_test_java_sources.gni
@@ -628,6 +628,7 @@ "javatests/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java", "javatests/src/org/chromium/chrome/browser/webapps/WebappActionsNotificationTest.java", "javatests/src/org/chromium/chrome/browser/webapps/WebappDefaultOfflineTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappDefaultOfflineTwaTest.java", "javatests/src/org/chromium/chrome/browser/webapps/WebappDisplayModeTest.java", "javatests/src/org/chromium/chrome/browser/webapps/WebappLaunchCauseMetricsTest.java", "javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java",
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java index 44acaa5..80fac339 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java
@@ -731,6 +731,7 @@ @Override public void setClosing(boolean closing) { + if (mIsClosing == closing) return; mIsClosing = closing; for (TabObserver observer : mObservers) observer.onClosingStateChanged(this, closing); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDefaultOfflineTwaTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDefaultOfflineTwaTest.java new file mode 100644 index 0000000..e6c9994b --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDefaultOfflineTwaTest.java
@@ -0,0 +1,192 @@ +// 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. + +package org.chromium.chrome.browser.webapps; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import android.content.Context; +import android.content.ContextWrapper; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.content.res.Resources; +import android.graphics.BitmapFactory; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.util.Base64; + +import androidx.test.filters.SmallTest; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.ContextUtils; +import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.Feature; +import org.chromium.base.test.util.PackageManagerWrapper; +import org.chromium.chrome.browser.browserservices.TrustedWebActivityTestUtil; +import org.chromium.chrome.browser.browserservices.intents.BitmapHelper; +import org.chromium.chrome.browser.customtabs.CustomTabActivityTestRule; +import org.chromium.chrome.browser.customtabs.CustomTabIntentDataProvider; +import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.flags.ChromeSwitches; +import org.chromium.chrome.browser.offlinepages.OfflineTestUtil; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.util.browser.Features.EnableFeatures; +import org.chromium.content_public.browser.test.NativeLibraryTestUtils; +import org.chromium.content_public.browser.test.util.JavaScriptUtils; +import org.chromium.net.test.EmbeddedTestServer; + +import java.util.concurrent.TimeoutException; + +/** + * Tests for the Default Offline behavior when loading a TWA (and failing to). + */ +@RunWith(ChromeJUnit4ClassRunner.class) +@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) +public class WebappDefaultOfflineTwaTest { + // The actual packageName we use, when trying to load the TWA, doesn't actually matter, because + // loading is blocked via `interceptWithOfflineError`. However, the package must exist so that + // lookup functions don't throw an error. Therefore, we use the test bundle as package name. + private static final String TWA_PACKAGE_NAME = "org.chromium.chrome.tests"; + + // Likewise, the value of this doesn't matter a great deal because the loading is intercepted, + // but we have to specify something. + private static final String TEST_PATH = "/chrome/test/data/android/google.html"; + + // The values we look for in the test. + private static final String TWA_NAME = "shortname"; + private static final int TWA_BACKGROUND_COLOR = 0x00FF00; + + private EmbeddedTestServer mTestServer; + private TestContext mTestContext; + private Context mContextToRestore; + + private static BitmapDrawable getTestIconDrawable(Resources resources, String imageAsString) { + byte[] bytes = Base64.decode(imageAsString.getBytes(), Base64.DEFAULT); + BitmapDrawable bitmapDrawable = new BitmapDrawable( + resources, BitmapFactory.decodeByteArray(bytes, 0, bytes.length)); + return bitmapDrawable; + } + + private static class TestContext extends ContextWrapper { + public TestContext(Context baseContext) { + super(baseContext); + } + + @Override + public PackageManager getPackageManager() { + return new PackageManagerWrapper(super.getPackageManager()) { + @Override + public CharSequence getApplicationLabel(ApplicationInfo info) { + if (!TWA_PACKAGE_NAME.equals(info.packageName)) { + return super.getApplicationLabel(info); + } + + return TWA_NAME; + } + + @Override + public Drawable getApplicationIcon(String packageName) + throws NameNotFoundException { + if (!TWA_PACKAGE_NAME.equals(packageName)) { + return super.getApplicationIcon(packageName); + } + + return getTestIconDrawable(getResources(), WebappActivityTestRule.TEST_ICON); + } + }; + } + } + + @Before + public void setUp() throws Exception { + NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess(); + + // Setup the context for our custom PackageManager. + mContextToRestore = ContextUtils.getApplicationContext(); + mTestContext = new TestContext(mContextToRestore); + ContextUtils.initApplicationContextForTests(mTestContext); + } + + @After + public void tearDown() { + if (mContextToRestore != null) { + ContextUtils.initApplicationContextForTests(mContextToRestore); + } + } + + @Rule + public CustomTabActivityTestRule mCustomTabActivityTestRule = new CustomTabActivityTestRule(); + + private void launchTwa(String twaPackageName, String url) throws TimeoutException { + Intent intent = TrustedWebActivityTestUtil.createTrustedWebActivityIntent(url); + intent.putExtra( + CustomTabIntentDataProvider.EXTRA_INITIAL_BACKGROUND_COLOR, TWA_BACKGROUND_COLOR); + TrustedWebActivityTestUtil.spoofVerification(twaPackageName, url); + TrustedWebActivityTestUtil.createSession(intent, twaPackageName); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + } + + @Test + @SmallTest + @Feature({"Webapps"}) + @EnableFeatures({ChromeFeatureList.PWA_DEFAULT_OFFLINE_PAGE}) + public void testDefaultOfflineTwa() throws Exception { + mCustomTabActivityTestRule.getEmbeddedTestServerRule().setServerUsesHttps(true); + mTestServer = mCustomTabActivityTestRule.getTestServer(); + + final String testAppUrl = mTestServer.getURL(TEST_PATH); + OfflineTestUtil.interceptWithOfflineError(testAppUrl); + + launchTwa(TWA_PACKAGE_NAME, testAppUrl); + + // Ensure that web_app_default_offline.html is showing the correct values. + Tab tab = mCustomTabActivityTestRule.getActivity().getActivityTab(); + assertEquals("\"shortname\"", + JavaScriptUtils.executeJavaScriptAndWaitForResult( + tab.getWebContents(), "document.getElementById('app-name').textContent;")); + assertEquals("\"No internet\"", + JavaScriptUtils.executeJavaScriptAndWaitForResult(tab.getWebContents(), + "document.getElementById('default-web-app-msg').textContent;")); + + String imageAsString = JavaScriptUtils.executeJavaScriptAndWaitForResult( + tab.getWebContents(), "document.getElementById('icon').src;"); + // Remove the base64 prefix and convert the line-feeds (%0A) so that the strings can be + // compared. + imageAsString = imageAsString.substring( + "\"data:image/png;base64,".length(), imageAsString.length() - 1); + imageAsString = imageAsString.replaceAll("%0A", "\n"); + + BitmapDrawable expectedDrawable = + getTestIconDrawable(mCustomTabActivityTestRule.getActivity().getResources(), + WebappActivityTestRule.TEST_ICON); + String expectedString = + BitmapHelper.encodeBitmapAsString(expectedDrawable.getBitmap()).trim(); + assertTrue(imageAsString.equals(expectedString)); + + assertEquals("\" #00FF00\"", + JavaScriptUtils.executeJavaScriptAndWaitForResult(tab.getWebContents(), + "getComputedStyle(document.documentElement).getPropertyValue(" + + "'--customized-background-color');")); + assertEquals("\" #00FF00\"", + JavaScriptUtils.executeJavaScriptAndWaitForResult(tab.getWebContents(), + "getComputedStyle(document.documentElement).getPropertyValue(" + + "'--dark-mode-background-color');")); + assertEquals("\" #FFFFFF\"", + JavaScriptUtils.executeJavaScriptAndWaitForResult(tab.getWebContents(), + "getComputedStyle(document.documentElement).getPropertyValue(" + + "'--theme-color');")); + assertEquals("\" #FFFFFF\"", + JavaScriptUtils.executeJavaScriptAndWaitForResult(tab.getWebContents(), + "getComputedStyle(document.documentElement).getPropertyValue(" + + "'--dark-mode-theme-color');")); + } +}
diff --git a/chrome/app_shim/app_shim_controller.h b/chrome/app_shim/app_shim_controller.h index 6a638d1..53f1f42 100644 --- a/chrome/app_shim/app_shim_controller.h +++ b/chrome/app_shim/app_shim_controller.h
@@ -24,6 +24,10 @@ class MachBootstrapAcceptorTest; } +namespace display { +class ScopedNativeScreen; +} + @class AppShimDelegate; @class ProfileMenuTarget; @class ApplicationDockMenuTarget; @@ -189,6 +193,9 @@ base::scoped_nsobject<ApplicationDockMenuTarget> application_dock_menu_target_; + // The screen object used in the app sim. + std::unique_ptr<display::ScopedNativeScreen> screen_; + // The items in the profile menu. std::vector<chrome::mojom::ProfileMenuItemPtr> profile_menu_items_;
diff --git a/chrome/app_shim/app_shim_controller.mm b/chrome/app_shim/app_shim_controller.mm index 9fb0eab..50b8ab3 100644 --- a/chrome/app_shim/app_shim_controller.mm +++ b/chrome/app_shim/app_shim_controller.mm
@@ -41,6 +41,7 @@ #include "mojo/public/cpp/platform/platform_channel.h" #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/display/screen.h" #include "ui/gfx/image/image.h" // The ProfileMenuTarget bridges between Objective C (as the target for the @@ -128,6 +129,7 @@ profile_menu_target_([[ProfileMenuTarget alloc] initWithController:this]), application_dock_menu_target_( [[ApplicationDockMenuTarget alloc] initWithController:this]) { + screen_ = std::make_unique<display::ScopedNativeScreen>(); // Since AppShimController is created before the main message loop starts, // NSApp will not be set, so use sharedApplication. NSApplication* sharedApplication = [NSApplication sharedApplication];
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index cfac7fd..ed1c08d 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -2206,6 +2206,7 @@ "//components/reporting/encryption:verification", "//components/reporting/proto:record_constants", "//components/reporting/proto:record_proto", + "//components/reporting/resources:resource_interface", "//components/reporting/storage:storage_configuration", "//components/reporting/storage:storage_module", "//components/reporting/storage:storage_module_interface", @@ -5020,6 +5021,8 @@ "//ash/webui/file_manager/mojom", "//ash/webui/firmware_update_ui", "//ash/webui/firmware_update_ui/mojom", + "//ash/webui/guest_os_installer", + "//ash/webui/guest_os_installer/mojom", "//ash/webui/help_app_ui", "//ash/webui/help_app_ui:mojo_bindings", "//ash/webui/help_app_ui/search:mojo_bindings", @@ -5926,6 +5929,8 @@ "mac/auth_session_request.mm", "mac/bluetooth_utility.h", "mac/bluetooth_utility.mm", + "mac/chrome_browser_main_extra_parts_mac.h", + "mac/chrome_browser_main_extra_parts_mac.mm", "mac/dock.h", "mac/dock.mm", "mac/exception_processor.h",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index ef8b0f1..4579d01 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -4828,7 +4828,7 @@ {"enable-cros-virtual-keyboard-multitouch", flag_descriptions::kVirtualKeyboardMultitouchName, flag_descriptions::kVirtualKeyboardMultitouchDescription, kOsCrOS, - FEATURE_VALUE_TYPE(chromeos::features::kVirtualKeyboardMultitouch)}, + FEATURE_VALUE_TYPE(features::kVirtualKeyboardMultitouch)}, {"enable-cros-virtual-keyboard-round-corners", flag_descriptions::kVirtualKeyboardRoundCornersName, flag_descriptions::kVirtualKeyboardRoundCornersDescription, kOsCrOS,
diff --git a/chrome/browser/accessibility/live_caption_unavailability_notifier_unittest.cc b/chrome/browser/accessibility/live_caption_unavailability_notifier_unittest.cc index c85796c0..45a39d48 100644 --- a/chrome/browser/accessibility/live_caption_unavailability_notifier_unittest.cc +++ b/chrome/browser/accessibility/live_caption_unavailability_notifier_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/accessibility/live_caption_unavailability_notifier.h" +#include "base/memory/raw_ptr.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "content/public/browser/render_frame_host.h" #include "content/public/test/navigation_simulator.h" @@ -55,7 +56,7 @@ private: mojo::Remote<media::mojom::MediaFoundationRendererNotifier> remote_; - LiveCaptionUnavailabilityNotifier* notifier_; + raw_ptr<LiveCaptionUnavailabilityNotifier> notifier_; }; TEST_F(LiveCaptionUnavailabilityNotifierTest, MediaFoundationRendererCreated) {
diff --git a/chrome/browser/apps/app_discovery_service/game_fetcher.cc b/chrome/browser/apps/app_discovery_service/game_fetcher.cc index 957c866..df5075d 100644 --- a/chrome/browser/apps/app_discovery_service/game_fetcher.cc +++ b/chrome/browser/apps/app_discovery_service/game_fetcher.cc
@@ -181,10 +181,17 @@ base::FilePath(app_with_locale.app().icon_info().icon_path()), app_with_locale.app().icon_info().is_masking_allowed(), GURL(app_with_locale.app().deeplink())); - results.push_back(Result( - AppSource::kGames, app_with_locale.app().app_id_for_platform(), - GetLocalisedName(app_with_locale.locale_availability(), profile_), - std::move(extras))); + + auto localised_name = + GetLocalisedName(app_with_locale.locale_availability(), profile_); + // If |localised_name| is empty here, we don't have a localised name or a + // default name, so we cannot return this game as a result. Skip it. + if (localised_name.empty()) { + continue; + } + results.push_back(Result(AppSource::kGames, + app_with_locale.app().app_id_for_platform(), + localised_name, std::move(extras))); } return results; } @@ -252,7 +259,8 @@ localised_name = available_localised_name.name_in_language(); } if (localised_name.empty()) { - DCHECK(!fallback_name.empty()); + // It's ok if |fallback_name| is also empty here, as we check later on and + // remove results with empty name fields. localised_name = fallback_name; } return base::UTF8ToUTF16(localised_name);
diff --git a/chrome/browser/apps/app_service/app_service_proxy_base.cc b/chrome/browser/apps/app_service/app_service_proxy_base.cc index b16fecb..a71a5810 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_base.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_base.cc
@@ -698,11 +698,6 @@ void AppServiceProxyBase::SetSupportedLinksPreference( const std::string& app_id) { - DCHECK(!app_id.empty()); - if (!app_service_.is_connected()) { - return; - } - IntentFilters filters; AppRegistryCache().ForOneApp( app_id, [&app_id, &filters](const AppUpdate& app) { @@ -713,15 +708,26 @@ } }); + SetSupportedLinksPreference(app_id, std::move(filters)); +} + +void AppServiceProxyBase::SetSupportedLinksPreference( + const std::string& app_id, + IntentFilters all_link_filters) { + DCHECK(!app_id.empty()); + if (preferred_apps_impl_) { preferred_apps_impl_->SetSupportedLinksPreference( - app_registry_cache_.GetAppType(app_id), app_id, std::move(filters)); + app_registry_cache_.GetAppType(app_id), app_id, + std::move(all_link_filters)); return; } - app_service_->SetSupportedLinksPreference( - ConvertAppTypeToMojomAppType(app_registry_cache_.GetAppType(app_id)), - app_id, ConvertIntentFiltersToMojomIntentFilters(filters)); + if (app_service_.is_connected()) { + app_service_->SetSupportedLinksPreference( + ConvertAppTypeToMojomAppType(app_registry_cache_.GetAppType(app_id)), + app_id, ConvertIntentFiltersToMojomIntentFilters(all_link_filters)); + } } void AppServiceProxyBase::RemoveSupportedLinksPreference(
diff --git a/chrome/browser/apps/app_service/app_service_proxy_base.h b/chrome/browser/apps/app_service/app_service_proxy_base.h index 247fca8..aa8592a 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_base.h +++ b/chrome/browser/apps/app_service/app_service_proxy_base.h
@@ -267,6 +267,18 @@ // RemoveSupportedLinksPreference was called for that app. void SetSupportedLinksPreference(const std::string& app_id); + // Set |app_id| as preferred app for all its supported link filters. Supported + // link filters, which have the http/https scheme and at least one host, are + // always enabled/disabled as a group. |all_link_filters| should contain all + // of the apps' Supported Link intent filters. + // Any apps with overlapping preferred app preferences will have all their + // supported link filters unset, as if RemoveSupportedLinksPreference was + // called for that app. + // TODO(crbug.com/1265315): Remove this method to use + // SetSupportedLinksPreference(std::string). + void SetSupportedLinksPreference(const std::string& app_id, + IntentFilters all_link_filters); + // Removes all supported link filters from the preferred app list for // |app_id|. void RemoveSupportedLinksPreference(const std::string& app_id);
diff --git a/chrome/browser/apps/app_service/intent_util.cc b/chrome/browser/apps/app_service/intent_util.cc index ce885d2..728a15f2 100644 --- a/chrome/browser/apps/app_service/intent_util.cc +++ b/chrome/browser/apps/app_service/intent_util.cc
@@ -294,7 +294,37 @@ return true; } -apps::mojom::ConditionValuePtr ConvertArcPatternMatcherToConditionValue( +apps::ConditionValuePtr ConvertArcPatternMatcherToConditionValue( + const arc::IntentFilter::PatternMatcher& path) { + apps::PatternMatchType match_type; + + switch (path.match_type()) { + case arc::mojom::PatternType::PATTERN_LITERAL: + match_type = apps::PatternMatchType::kLiteral; + break; + case arc::mojom::PatternType::PATTERN_PREFIX: + match_type = apps::PatternMatchType::kPrefix; + break; + case arc::mojom::PatternType::PATTERN_SIMPLE_GLOB: + match_type = apps::PatternMatchType::kGlob; + + // It's common for Globs to be used to encode patterns which are actually + // prefixes. Detect and convert these, since prefix matching is easier & + // cheaper. + if (IsPrefixOnlyGlob(path.pattern())) { + DCHECK_GE(path.pattern().size(), 2); + return std::make_unique<apps::ConditionValue>( + path.pattern().substr(0, path.pattern().size() - 2), + apps::PatternMatchType::kPrefix); + } + break; + } + + return std::make_unique<apps::ConditionValue>(path.pattern(), match_type); +} + +// TODO(crbug.com/1253250): Remove after migrating to non-mojo AppService. +apps::mojom::ConditionValuePtr ConvertArcPatternMatcherToMojomConditionValue( const arc::IntentFilter::PatternMatcher& path) { apps::mojom::PatternMatchType match_type; @@ -817,6 +847,113 @@ std::move(schemes), std::move(mime_types)); } +apps::IntentFilterPtr CreateIntentFilterForArc( + const arc::IntentFilter& arc_intent_filter) { + auto intent_filter = std::make_unique<apps::IntentFilter>(); + + bool has_view_action = false; + + apps::ConditionValues action_condition_values; + for (auto& arc_action : arc_intent_filter.actions()) { + const char* action = ConvertArcToAppServiceIntentAction(arc_action); + has_view_action = has_view_action || action == kIntentActionView; + + if (!action) { + continue; + } + + action_condition_values.push_back(std::make_unique<apps::ConditionValue>( + action, apps::PatternMatchType::kNone)); + } + if (!action_condition_values.empty()) { + auto action_condition = std::make_unique<apps::Condition>( + apps::ConditionType::kAction, std::move(action_condition_values)); + intent_filter->conditions.push_back(std::move(action_condition)); + } + + apps::ConditionValues scheme_condition_values; + for (auto& scheme : arc_intent_filter.schemes()) { + scheme_condition_values.push_back(std::make_unique<apps::ConditionValue>( + scheme, apps::PatternMatchType::kNone)); + } + if (!scheme_condition_values.empty()) { + auto scheme_condition = std::make_unique<apps::Condition>( + apps::ConditionType::kScheme, std::move(scheme_condition_values)); + intent_filter->conditions.push_back(std::move(scheme_condition)); + } + + apps::ConditionValues host_condition_values; + for (auto& authority : arc_intent_filter.authorities()) { + auto match_type = authority.wild() ? apps::PatternMatchType::kSuffix + : apps::PatternMatchType::kNone; + host_condition_values.push_back( + std::make_unique<apps::ConditionValue>(authority.host(), match_type)); + } + + if (!host_condition_values.empty()) { + // It's common for Android apps to include duplicate host conditions, we can + // de-duplicate these to reduce time/space usage down the line. + std::sort( + host_condition_values.begin(), host_condition_values.end(), + [](const apps::ConditionValuePtr& v1, + const apps::ConditionValuePtr& v2) -> bool { + return v1->value < v2->value || + (v1->value == v2->value && v1->match_type < v2->match_type); + }); + host_condition_values.erase( + std::unique(host_condition_values.begin(), host_condition_values.end(), + [](const apps::ConditionValuePtr& v1, + const apps::ConditionValuePtr& v2) -> bool { + return *v1 == *v2; + }), + host_condition_values.end()); + + auto host_condition = std::make_unique<apps::Condition>( + apps::ConditionType::kHost, std::move(host_condition_values)); + intent_filter->conditions.push_back(std::move(host_condition)); + } + + apps::ConditionValues path_condition_values; + for (auto& path : arc_intent_filter.paths()) { + path_condition_values.push_back( + ConvertArcPatternMatcherToConditionValue(path)); + } + + // For ARC apps, specifying a path is optional. For any intent filters which + // match every URL on a host with a "view" action, add a path which matches + // everything to ensure the filter is treated as a supported link. + if (path_condition_values.empty() && has_view_action && + arc_intent_filter.authorities().size() > 0 && + arc_intent_filter.schemes().size() > 0) { + path_condition_values.push_back(std::make_unique<apps::ConditionValue>( + "/", apps::PatternMatchType::kPrefix)); + } + if (!path_condition_values.empty()) { + auto path_condition = std::make_unique<apps::Condition>( + apps::ConditionType::kPattern, std::move(path_condition_values)); + intent_filter->conditions.push_back(std::move(path_condition)); + } + + apps::ConditionValues mime_type_condition_values; + for (auto& mime_type : arc_intent_filter.mime_types()) { + mime_type_condition_values.push_back(std::make_unique<apps::ConditionValue>( + mime_type, apps::PatternMatchType::kMimeType)); + } + if (!mime_type_condition_values.empty()) { + auto mime_type_condition = std::make_unique<apps::Condition>( + apps::ConditionType::kMimeType, std::move(mime_type_condition_values)); + intent_filter->conditions.push_back(std::move(mime_type_condition)); + } + if (!arc_intent_filter.activity_name().empty()) { + intent_filter->activity_name = arc_intent_filter.activity_name(); + } + if (!arc_intent_filter.activity_label().empty()) { + intent_filter->activity_label = arc_intent_filter.activity_label(); + } + + return intent_filter; +} + apps::mojom::IntentFilterPtr ConvertArcToAppServiceIntentFilter( const arc::IntentFilter& arc_intent_filter) { auto intent_filter = apps::mojom::IntentFilter::New(); @@ -875,7 +1012,7 @@ std::vector<apps::mojom::ConditionValuePtr> path_condition_values; for (auto& path : arc_intent_filter.paths()) { path_condition_values.push_back( - ConvertArcPatternMatcherToConditionValue(path)); + ConvertArcPatternMatcherToMojomConditionValue(path)); } // For ARC apps, specifying a path is optional. For any intent filters which
diff --git a/chrome/browser/apps/app_service/intent_util.h b/chrome/browser/apps/app_service/intent_util.h index f17a1cd..25f746f2 100644 --- a/chrome/browser/apps/app_service/intent_util.h +++ b/chrome/browser/apps/app_service/intent_util.h
@@ -153,6 +153,11 @@ arc::IntentFilter ConvertAppServiceToArcIntentFilter( const std::string& package_name, const apps::mojom::IntentFilterPtr& intent_filter); + +apps::IntentFilterPtr CreateIntentFilterForArc( + const arc::IntentFilter& arc_intent_filter); + +// TODO(crbug.com/1253250): Remove after migrating to non-mojo AppService. apps::mojom::IntentFilterPtr ConvertArcToAppServiceIntentFilter( const arc::IntentFilter& arc_intent_filter); #endif
diff --git a/chrome/browser/apps/app_service/intent_util_unittest.cc b/chrome/browser/apps/app_service/intent_util_unittest.cc index 9c5f682f..5dc2f0f33 100644 --- a/chrome/browser/apps/app_service/intent_util_unittest.cc +++ b/chrome/browser/apps/app_service/intent_util_unittest.cc
@@ -796,6 +796,37 @@ std::move(authorities1), std::move(patterns), {kScheme}, {}); + apps::IntentFilterPtr app_service_filter1 = + apps_util::CreateIntentFilterForArc(filter_with_path); + + std::vector<arc::IntentFilter::AuthorityEntry> authorities2; + authorities2.emplace_back(kHost, 0); + arc::IntentFilter filter_without_path(kPackageName, {arc::kIntentActionView}, + std::move(authorities2), {}, {kScheme}, + {}); + + apps::IntentFilterPtr app_service_filter2 = + apps_util::CreateIntentFilterForArc(filter_without_path); + + ASSERT_EQ(*app_service_filter1, *app_service_filter2); +} + +// TODO(crbug.com/1253250): Remove after migrating to non-mojo AppService. +TEST_F(IntentUtilsTest, ConvertArcIntentFilter_AddsMissingPathMojom) { + const char* kPackageName = "com.foo.bar"; + const char* kHost = "www.google.com"; + const char* kPath = "/"; + const char* kScheme = "https"; + + std::vector<arc::IntentFilter::AuthorityEntry> authorities1; + authorities1.emplace_back(kHost, 0); + std::vector<arc::IntentFilter::PatternMatcher> patterns; + patterns.emplace_back(kPath, arc::mojom::PatternType::PATTERN_PREFIX); + + arc::IntentFilter filter_with_path(kPackageName, {arc::kIntentActionView}, + std::move(authorities1), + std::move(patterns), {kScheme}, {}); + apps::mojom::IntentFilterPtr app_service_filter1 = apps_util::ConvertArcToAppServiceIntentFilter(filter_with_path); @@ -831,6 +862,48 @@ std::move(authorities), std::move(patterns), {kScheme}, {}); + apps::IntentFilterPtr app_service_filter = + apps_util::CreateIntentFilterForArc(filter_with_path); + + for (auto& condition : app_service_filter->conditions) { + if (condition->condition_type == apps::ConditionType::kPattern) { + EXPECT_EQ(4u, condition->condition_values.size()); + EXPECT_EQ(apps::ConditionValue("/foo", apps::PatternMatchType::kPrefix), + *condition->condition_values[0]); + EXPECT_EQ( + apps::ConditionValue(std::string(), apps::PatternMatchType::kPrefix), + *condition->condition_values[1]); + EXPECT_EQ( + apps::ConditionValue("/foo/.*/bar", apps::PatternMatchType::kGlob), + *condition->condition_values[2]); + EXPECT_EQ(apps::ConditionValue("/..*", apps::PatternMatchType::kGlob), + *condition->condition_values[3]); + } + } +} + +// TODO(crbug.com/1253250): Remove after migrating to non-mojo AppService. +TEST_F(IntentUtilsTest, + ConvertArcIntentFilter_ConvertsSimpleGlobToPrefixMojom) { + const char* kPackageName = "com.foo.bar"; + const char* kHost = "www.google.com"; + const char* kScheme = "https"; + + std::vector<arc::IntentFilter::AuthorityEntry> authorities; + authorities.emplace_back(kHost, 0); + + std::vector<arc::IntentFilter::PatternMatcher> patterns; + + patterns.emplace_back("/foo.*", arc::mojom::PatternType::PATTERN_SIMPLE_GLOB); + patterns.emplace_back(".*", arc::mojom::PatternType::PATTERN_SIMPLE_GLOB); + patterns.emplace_back("/foo/.*/bar", + arc::mojom::PatternType::PATTERN_SIMPLE_GLOB); + patterns.emplace_back("/..*", arc::mojom::PatternType::PATTERN_SIMPLE_GLOB); + + arc::IntentFilter filter_with_path(kPackageName, {arc::kIntentActionView}, + std::move(authorities), + std::move(patterns), {kScheme}, {}); + apps::mojom::IntentFilterPtr app_service_filter = apps_util::ConvertArcToAppServiceIntentFilter(filter_with_path); @@ -873,6 +946,39 @@ std::move(authorities), std::move(patterns), {kScheme}, {}); + apps::IntentFilterPtr app_service_filter = + apps_util::CreateIntentFilterForArc(arc_filter); + + for (auto& condition : app_service_filter->conditions) { + if (condition->condition_type == apps::ConditionType::kHost) { + ASSERT_EQ(2u, condition->condition_values.size()); + ASSERT_EQ(kHost1, condition->condition_values[0]->value); + ASSERT_EQ(kHost2, condition->condition_values[1]->value); + } + } +} + +// TODO(crbug.com/1253250): Remove after migrating to non-mojo AppService. +TEST_F(IntentUtilsTest, ConvertArcIntentFilter_DeduplicatesHostsMojom) { + const char* kPackageName = "com.foo.bar"; + const char* kPath = "/"; + const char* kScheme = "https"; + const char* kHost1 = "www.a.com"; + const char* kHost2 = "www.b.com"; + + std::vector<arc::IntentFilter::AuthorityEntry> authorities; + authorities.emplace_back(kHost1, 0); + authorities.emplace_back(kHost2, 0); + authorities.emplace_back(kHost2, 0); + authorities.emplace_back(kHost1, 0); + + std::vector<arc::IntentFilter::PatternMatcher> patterns; + patterns.emplace_back(kPath, arc::mojom::PatternType::PATTERN_PREFIX); + + arc::IntentFilter arc_filter(kPackageName, {arc::kIntentActionView}, + std::move(authorities), std::move(patterns), + {kScheme}, {}); + apps::mojom::IntentFilterPtr app_service_filter = apps_util::ConvertArcToAppServiceIntentFilter(arc_filter); @@ -902,6 +1008,42 @@ std::move(authorities), std::move(patterns), {kScheme}, {}); + apps::IntentFilterPtr app_service_filter = + apps_util::CreateIntentFilterForArc(arc_filter); + + for (auto& condition : app_service_filter->conditions) { + if (condition->condition_type == apps::ConditionType::kHost) { + ASSERT_EQ(condition->condition_values.size(), 2U); + + // Check wildcard host + EXPECT_EQ(condition->condition_values[0]->match_type, + apps::PatternMatchType::kSuffix); + // Check non-wildcard host + EXPECT_EQ(condition->condition_values[1]->match_type, + apps::PatternMatchType::kNone); + } + } +} + +// TODO(crbug.com/1253250): Remove after migrating to non-mojo AppService. +TEST_F(IntentUtilsTest, + ConvertArcIntentFilter_WildcardHostPatternMatchTypeMojom) { + const char* kPackageName = "com.foo.bar"; + const char* kPath = "/"; + const char* kScheme = "https"; + const char* kHostWildcard = "*.google.com"; + const char* kHostNoWildcard = "google.com"; + + std::vector<arc::IntentFilter::AuthorityEntry> authorities; + authorities.emplace_back(kHostWildcard, 0); + authorities.emplace_back(kHostNoWildcard, 0); + std::vector<arc::IntentFilter::PatternMatcher> patterns; + patterns.emplace_back(kPath, arc::mojom::PatternType::PATTERN_PREFIX); + + arc::IntentFilter arc_filter(kPackageName, {arc::kIntentActionView}, + std::move(authorities), std::move(patterns), + {kScheme}, {}); + apps::mojom::IntentFilterPtr app_service_filter = apps_util::ConvertArcToAppServiceIntentFilter(arc_filter);
diff --git a/chrome/browser/apps/app_service/publishers/arc_apps.cc b/chrome/browser/apps/app_service/publishers/arc_apps.cc index 7d14e189465..486cba3 100644 --- a/chrome/browser/apps/app_service/publishers/arc_apps.cc +++ b/chrome/browser/apps/app_service/publishers/arc_apps.cc
@@ -1408,17 +1408,16 @@ continue; } - std::vector<apps::mojom::IntentFilterPtr> app_service_filters; + apps::IntentFilters app_service_filters; for (const auto& arc_filter : supported_link->filters.value()) { - auto converted = - apps_util::ConvertArcToAppServiceIntentFilter(arc_filter); + auto converted = apps_util::CreateIntentFilterForArc(arc_filter); if (apps_util::IsSupportedLinkForApp(app_id, converted)) { app_service_filters.push_back(std::move(converted)); } } - app_service->SetSupportedLinksPreference(apps::mojom::AppType::kArc, app_id, - std::move(app_service_filters)); + proxy()->SetSupportedLinksPreference(app_id, + std::move(app_service_filters)); } for (const auto& supported_link : removed) { @@ -1427,8 +1426,7 @@ if (app_id.empty()) { continue; } - app_service->RemoveSupportedLinksPreference(apps::mojom::AppType::kArc, - app_id); + proxy()->RemoveSupportedLinksPreference(app_id); } }
diff --git a/chrome/browser/apps/app_service/publishers/publisher_unittest.cc b/chrome/browser/apps/app_service/publishers/publisher_unittest.cc index 9146913..9078d2a 100644 --- a/chrome/browser/apps/app_service/publishers/publisher_unittest.cc +++ b/chrome/browser/apps/app_service/publishers/publisher_unittest.cc
@@ -227,7 +227,7 @@ private: std::vector<std::string> updated_ids_; std::vector<apps::AppType> app_types_; - apps::AppRegistryCache* cache_ = nullptr; + raw_ptr<apps::AppRegistryCache> cache_ = nullptr; }; } // namespace
diff --git a/chrome/browser/apps/app_service/uninstall_dialog.h b/chrome/browser/apps/app_service/uninstall_dialog.h index 5aa2d6c..fc897d1 100644 --- a/chrome/browser/apps/app_service/uninstall_dialog.h +++ b/chrome/browser/apps/app_service/uninstall_dialog.h
@@ -120,7 +120,7 @@ OnUninstallForTestingCallback uninstall_dialog_created_callback_; - views::Widget* widget_ = nullptr; + raw_ptr<views::Widget> widget_ = nullptr; // Tracks whether |parent_window_| got destroyed. std::unique_ptr<NativeWindowTracker> parent_window_tracker_;
diff --git a/chrome/browser/ash/BUILD.gn b/chrome/browser/ash/BUILD.gn index b106b05..4e56b427 100644 --- a/chrome/browser/ash/BUILD.gn +++ b/chrome/browser/ash/BUILD.gn
@@ -842,6 +842,274 @@ "customization/customization_wallpaper_downloader.h", "customization/customization_wallpaper_util.cc", "customization/customization_wallpaper_util.h", + "dbus/ash_dbus_helper.cc", + "dbus/ash_dbus_helper.h", + "dbus/chrome_features_service_provider.cc", + "dbus/chrome_features_service_provider.h", + "dbus/component_updater_service_provider.cc", + "dbus/component_updater_service_provider.h", + "dbus/cryptohome_key_delegate_service_provider.cc", + "dbus/cryptohome_key_delegate_service_provider.h", + "dbus/dlp_files_policy_service_provider.cc", + "dbus/dlp_files_policy_service_provider.h", + "dbus/drive_file_stream_service_provider.cc", + "dbus/drive_file_stream_service_provider.h", + "dbus/encrypted_reporting_service_provider.cc", + "dbus/encrypted_reporting_service_provider.h", + "dbus/fusebox_service_provider.cc", + "dbus/fusebox_service_provider.h", + "dbus/kiosk_info_service_provider.cc", + "dbus/kiosk_info_service_provider.h", + "dbus/libvda_service_provider.cc", + "dbus/libvda_service_provider.h", + "dbus/lock_to_single_user_service_provider.cc", + "dbus/lock_to_single_user_service_provider.h", + "dbus/machine_learning_decision_service_provider.cc", + "dbus/machine_learning_decision_service_provider.h", + "dbus/metrics_event_service_provider.cc", + "dbus/metrics_event_service_provider.h", + "dbus/mojo_connection_service_provider.cc", + "dbus/mojo_connection_service_provider.h", + "dbus/printers_service_provider.cc", + "dbus/printers_service_provider.h", + "dbus/proxy_resolution_service_provider.cc", + "dbus/proxy_resolution_service_provider.h", + "dbus/screen_lock_service_provider.cc", + "dbus/screen_lock_service_provider.h", + "dbus/smb_fs_service_provider.cc", + "dbus/smb_fs_service_provider.h", + "dbus/virtual_file_request_service_provider.cc", + "dbus/virtual_file_request_service_provider.h", + "dbus/vm/plugin_vm_service_provider.cc", + "dbus/vm/plugin_vm_service_provider.h", + "dbus/vm/vm_applications_service_provider.cc", + "dbus/vm/vm_applications_service_provider.h", + "dbus/vm/vm_disk_management_service_provider.cc", + "dbus/vm/vm_disk_management_service_provider.h", + "dbus/vm/vm_launch_service_provider.cc", + "dbus/vm/vm_launch_service_provider.h", + "dbus/vm/vm_permission_service_provider.cc", + "dbus/vm/vm_permission_service_provider.h", + "dbus/vm/vm_sk_forwarding_service_provider.cc", + "dbus/vm/vm_sk_forwarding_service_provider.h", + "device_name/device_name_applier.h", + "device_name/device_name_applier_impl.cc", + "device_name/device_name_applier_impl.h", + "device_name/device_name_store.cc", + "device_name/device_name_store.h", + "device_name/device_name_store_impl.cc", + "device_name/device_name_store_impl.h", + "device_name/device_name_validator.cc", + "device_name/device_name_validator.h", + "device_sync/device_sync_client_factory.cc", + "device_sync/device_sync_client_factory.h", + "diagnostics/diagnostics_browser_delegate_impl.cc", + "diagnostics/diagnostics_browser_delegate_impl.h", + "display/quirks_manager_delegate_impl.cc", + "display/quirks_manager_delegate_impl.h", + "drive/drive_integration_service.cc", + "drive/drive_integration_service.h", + "drive/drivefs_native_message_host.cc", + "drive/drivefs_native_message_host.h", + "drive/file_system_util.cc", + "drive/file_system_util.h", + "drive/fileapi/drivefs_async_file_util.cc", + "drive/fileapi/drivefs_async_file_util.h", + "drive/fileapi/drivefs_file_system_backend_delegate.cc", + "drive/fileapi/drivefs_file_system_backend_delegate.h", + "eche_app/app_id.h", + "eche_app/eche_app_manager_factory.cc", + "eche_app/eche_app_manager_factory.h", + "eche_app/eche_app_notification_controller.cc", + "eche_app/eche_app_notification_controller.h", + "enhanced_network_tts/enhanced_network_tts_constants.cc", + "enhanced_network_tts/enhanced_network_tts_constants.h", + "enhanced_network_tts/enhanced_network_tts_impl.cc", + "enhanced_network_tts/enhanced_network_tts_impl.h", + "enhanced_network_tts/enhanced_network_tts_utils.cc", + "enhanced_network_tts/enhanced_network_tts_utils.h", + "eol_notification.cc", + "eol_notification.h", + "events/event_rewriter_delegate_impl.cc", + "events/event_rewriter_delegate_impl.h", + "exo/chrome_data_exchange_delegate.cc", + "exo/chrome_data_exchange_delegate.h", + "external_metrics.cc", + "external_metrics.h", + "external_protocol_dialog.cc", + "external_protocol_dialog.h", + "file_manager/app_id.h", + "file_manager/app_service_file_tasks.cc", + "file_manager/app_service_file_tasks.h", + "file_manager/arc_file_tasks.cc", + "file_manager/arc_file_tasks.h", + "file_manager/copy_or_move_io_task.cc", + "file_manager/copy_or_move_io_task.h", + "file_manager/delete_io_task.cc", + "file_manager/delete_io_task.h", + "file_manager/documents_provider_root_manager.cc", + "file_manager/documents_provider_root_manager.h", + "file_manager/extract_io_task.cc", + "file_manager/extract_io_task.h", + "file_manager/file_browser_handlers.cc", + "file_manager/file_browser_handlers.h", + "file_manager/file_manager_copy_or_move_hook_delegate.cc", + "file_manager/file_manager_copy_or_move_hook_delegate.h", + "file_manager/file_manager_string_util.cc", + "file_manager/file_manager_string_util.h", + "file_manager/file_tasks.cc", + "file_manager/file_tasks.h", + "file_manager/file_tasks_notifier.cc", + "file_manager/file_tasks_notifier.h", + "file_manager/file_tasks_notifier_factory.cc", + "file_manager/file_tasks_notifier_factory.h", + "file_manager/file_tasks_observer.h", + "file_manager/file_watcher.cc", + "file_manager/file_watcher.h", + "file_manager/fileapi_util.cc", + "file_manager/fileapi_util.h", + "file_manager/filesystem_api_util.cc", + "file_manager/filesystem_api_util.h", + "file_manager/fusebox_mounter.cc", + "file_manager/fusebox_mounter.h", + "file_manager/guest_os_file_tasks.cc", + "file_manager/guest_os_file_tasks.h", + "file_manager/io_task.cc", + "file_manager/io_task.h", + "file_manager/io_task_controller.cc", + "file_manager/io_task_controller.h", + "file_manager/io_task_util.cc", + "file_manager/io_task_util.h", + "file_manager/open_util.cc", + "file_manager/open_util.h", + "file_manager/open_with_browser.cc", + "file_manager/open_with_browser.h", + "file_manager/path_util.cc", + "file_manager/path_util.h", + "file_manager/prefs_migration_uma.h", + "file_manager/restore_io_task.cc", + "file_manager/restore_io_task.h", + "file_manager/select_file_dialog_util.cc", + "file_manager/select_file_dialog_util.h", + "file_manager/snapshot_manager.cc", + "file_manager/snapshot_manager.h", + "file_manager/speedometer.cc", + "file_manager/speedometer.h", + "file_manager/trash_io_task.cc", + "file_manager/trash_io_task.h", + "file_manager/url_util.cc", + "file_manager/url_util.h", + "file_manager/volume_manager.cc", + "file_manager/volume_manager.h", + "file_manager/volume_manager_factory.cc", + "file_manager/volume_manager_factory.h", + "file_manager/volume_manager_observer.h", + "file_manager/zip_io_task.cc", + "file_manager/zip_io_task.h", + "file_system_provider/abort_callback.h", + "file_system_provider/extension_provider.cc", + "file_system_provider/extension_provider.h", + "file_system_provider/fileapi/backend_delegate.cc", + "file_system_provider/fileapi/backend_delegate.h", + "file_system_provider/fileapi/buffering_file_stream_reader.cc", + "file_system_provider/fileapi/buffering_file_stream_reader.h", + "file_system_provider/fileapi/buffering_file_stream_writer.cc", + "file_system_provider/fileapi/buffering_file_stream_writer.h", + "file_system_provider/fileapi/file_stream_reader.cc", + "file_system_provider/fileapi/file_stream_reader.h", + "file_system_provider/fileapi/file_stream_writer.cc", + "file_system_provider/fileapi/file_stream_writer.h", + "file_system_provider/fileapi/provider_async_file_util.cc", + "file_system_provider/fileapi/provider_async_file_util.h", + "file_system_provider/fileapi/watcher_manager.cc", + "file_system_provider/fileapi/watcher_manager.h", + "file_system_provider/icon_set.cc", + "file_system_provider/icon_set.h", + "file_system_provider/mount_path_util.cc", + "file_system_provider/mount_path_util.h", + "file_system_provider/notification_manager.cc", + "file_system_provider/notification_manager.h", + "file_system_provider/notification_manager_interface.h", + "file_system_provider/observer.h", + "file_system_provider/operations/abort.cc", + "file_system_provider/operations/abort.h", + "file_system_provider/operations/add_watcher.cc", + "file_system_provider/operations/add_watcher.h", + "file_system_provider/operations/close_file.cc", + "file_system_provider/operations/close_file.h", + "file_system_provider/operations/configure.cc", + "file_system_provider/operations/configure.h", + "file_system_provider/operations/copy_entry.cc", + "file_system_provider/operations/copy_entry.h", + "file_system_provider/operations/create_directory.cc", + "file_system_provider/operations/create_directory.h", + "file_system_provider/operations/create_file.cc", + "file_system_provider/operations/create_file.h", + "file_system_provider/operations/delete_entry.cc", + "file_system_provider/operations/delete_entry.h", + "file_system_provider/operations/execute_action.cc", + "file_system_provider/operations/execute_action.h", + "file_system_provider/operations/get_actions.cc", + "file_system_provider/operations/get_actions.h", + "file_system_provider/operations/get_metadata.cc", + "file_system_provider/operations/get_metadata.h", + "file_system_provider/operations/move_entry.cc", + "file_system_provider/operations/move_entry.h", + "file_system_provider/operations/open_file.cc", + "file_system_provider/operations/open_file.h", + "file_system_provider/operations/operation.cc", + "file_system_provider/operations/operation.h", + "file_system_provider/operations/read_directory.cc", + "file_system_provider/operations/read_directory.h", + "file_system_provider/operations/read_file.cc", + "file_system_provider/operations/read_file.h", + "file_system_provider/operations/remove_watcher.cc", + "file_system_provider/operations/remove_watcher.h", + "file_system_provider/operations/truncate.cc", + "file_system_provider/operations/truncate.h", + "file_system_provider/operations/unmount.cc", + "file_system_provider/operations/unmount.h", + "file_system_provider/operations/write_file.cc", + "file_system_provider/operations/write_file.h", + "file_system_provider/provided_file_system.cc", + "file_system_provider/provided_file_system.h", + "file_system_provider/provided_file_system_info.cc", + "file_system_provider/provided_file_system_info.h", + "file_system_provider/provided_file_system_interface.cc", + "file_system_provider/provided_file_system_interface.h", + "file_system_provider/provided_file_system_observer.cc", + "file_system_provider/provided_file_system_observer.h", + "file_system_provider/provider_interface.h", + "file_system_provider/queue.cc", + "file_system_provider/queue.h", + "file_system_provider/registry.cc", + "file_system_provider/registry.h", + "file_system_provider/registry_interface.cc", + "file_system_provider/registry_interface.h", + "file_system_provider/request_manager.cc", + "file_system_provider/request_manager.h", + "file_system_provider/request_value.cc", + "file_system_provider/request_value.h", + "file_system_provider/scoped_file_opener.cc", + "file_system_provider/scoped_file_opener.h", + "file_system_provider/service.cc", + "file_system_provider/service.h", + "file_system_provider/service_factory.cc", + "file_system_provider/service_factory.h", + "file_system_provider/throttled_file_system.cc", + "file_system_provider/throttled_file_system.h", + "file_system_provider/watcher.cc", + "file_system_provider/watcher.h", + "first_run/first_run.cc", + "first_run/first_run.h", + "floating_workspace/floating_workspace_service.cc", + "floating_workspace/floating_workspace_service.h", + "floating_workspace/floating_workspace_service_factory.cc", + "floating_workspace/floating_workspace_service_factory.h", + "floating_workspace/floating_workspace_util.cc", + "floating_workspace/floating_workspace_util.h", + "fusebox/fusebox_util.cc", + "fusebox/fusebox_util.h", ] allow_circular_includes_from = [ @@ -866,6 +1134,9 @@ "//ash/components/attestation", "//ash/components/audio", "//ash/components/disks", + "//ash/components/drivefs", + "//ash/components/drivefs/mojom", + "//ash/components/enhanced_network_tts/mojom", "//ash/components/login/auth", "//ash/components/settings", "//ash/components/tpm", @@ -876,6 +1147,7 @@ "//ash/services/multidevice_setup/public/cpp", "//ash/services/multidevice_setup/public/cpp:android_sms_app_helper_delegate", "//ash/services/multidevice_setup/public/cpp:android_sms_pairing_state_tracker", + "//ash/webui/eche_app_ui", "//base", "//chrome/browser/ash/arc/input_overlay/db/proto", "//chrome/browser/ash/crosapi", @@ -887,9 +1159,11 @@ "//chrome/browser/ui/webui/bluetooth_internals:mojo_bindings", "//chrome/browser/ui/webui/chromeos/crostini_upgrader:mojo_bindings_headers", "//chrome/browser/web_applications", + "//chrome/common", "//chrome/common:buildflags", "//chrome/common:constants", "//chrome/common/extensions/api", + "//chrome/services/file_util/public/cpp", "//chrome/services/keymaster/public/mojom", "//chrome/services/printing/public/mojom", "//chromeos/ash/components/dbus/authpolicy", @@ -898,23 +1172,28 @@ "//chromeos/ash/components/dbus/cicerone:cicerone_proto", "//chromeos/ash/components/dbus/concierge", "//chromeos/ash/components/dbus/concierge:concierge_proto", + "//chromeos/ash/components/dbus/services", "//chromeos/ash/components/dbus/system_clock", "//chromeos/ash/components/memory", "//chromeos/components/security_token_pin", "//chromeos/components/sharesheet:constants", "//chromeos/crosapi/mojom", + "//chromeos/dbus:metrics_event_proto", "//chromeos/dbus/anomaly_detector", "//chromeos/dbus/anomaly_detector:proto", "//chromeos/dbus/attestation", "//chromeos/dbus/attestation:attestation_proto", "//chromeos/dbus/common", "//chromeos/dbus/constants", + "//chromeos/dbus/cros_disks", "//chromeos/dbus/dlcservice", + "//chromeos/dbus/missive", "//chromeos/dbus/power", "//chromeos/dbus/power:power_manager_proto", "//chromeos/dbus/resourced", "//chromeos/dbus/session_manager", "//chromeos/dbus/tpm_manager:tpm_manager_proto", + "//chromeos/dbus/update_engine", "//chromeos/metrics", "//chromeos/network", "//chromeos/services/cros_healthd/public/mojom", @@ -925,14 +1204,14 @@ "//components/arc", "//components/arc/common", "//components/content_settings/core/browser", + "//components/download/content/public", + "//components/drive", "//components/exo", "//components/gcm_driver/instance_id", "//components/guest_os", "//components/invalidation/public", "//components/keyed_service/content", "//components/keyed_service/core", - "//components/policy:cloud_policy_proto_generated_compile", - "//components/policy:generated", "//components/policy/core/browser", "//components/policy/core/common", "//components/policy/core/common:common_constants", @@ -940,23 +1219,30 @@ "//components/policy/proto", "//components/prefs", "//components/printing/common:mojo_interfaces", + "//components/quirks", + "//components/reporting/proto:record_proto", + "//components/reporting/storage_selector", "//components/services/app_service/public/cpp:app_types", "//components/services/app_service/public/cpp:app_update", "//components/services/app_service/public/cpp:icon_types", "//components/services/app_service/public/cpp:instance_update", "//components/services/app_service/public/mojom", "//components/services/app_service/public/mojom:types_headers", + "//components/services/unzip/public/cpp", "//components/session_manager/core", "//components/signin/public/identity_manager", "//components/soda", + "//components/storage_monitor", "//components/sync_preferences", "//components/user_manager", "//components/viz/common", "//content/public/browser", "//crypto", + "//dbus", "//device/bluetooth", "//extensions/browser", "//extensions/browser/api/automation_internal", + "//extensions/browser/api/file_handlers", "//extensions/browser/api/messaging:native_messaging", "//extensions/common", "//gpu/command_buffer/client", @@ -964,6 +1250,7 @@ "//media/capture:capture_lib", "//mojo/public/c/system:headers", "//mojo/public/cpp/bindings", + "//mojo/public/cpp/platform", "//mojo/public/cpp/system", "//net", "//services/data_decoder/public/cpp", @@ -974,7 +1261,9 @@ "//services/tracing/public/cpp", "//skia", "//storage/browser", + "//storage/common", "//third_party/abseil-cpp:absl", + "//third_party/blink/public/mojom:mojom_platform", "//third_party/boringssl", "//ui/accessibility", "//ui/accessibility:ax_base", @@ -985,6 +1274,7 @@ "//ui/base/ime", "//ui/base/ime/ash", "//ui/base/metadata", + "//ui/chromeos/events", "//ui/compositor", "//ui/display", "//ui/display/types", @@ -1008,22 +1298,32 @@ "//ash/components/arc:prefs", "//ash/components/arc/input_overlay/resources", "//ash/components/arc/media_session", + "//ash/components/arc/mojom:notifications", "//ash/components/arc/mojom:protected_buffer_manager", "//ash/components/cryptohome", "//ash/components/device_activity", - "//ash/components/drivefs", "//ash/components/fwupd", "//ash/components/login/session", + "//ash/components/multidevice:stub_multidevice_util", "//ash/components/multidevice/logging", "//ash/components/peripheral_notification", + "//ash/components/phonehub", "//ash/components/power", "//ash/constants", "//ash/keyboard/ui", "//ash/public/mojom", "//ash/resources/vector_icons", + "//ash/services/device_sync", + "//ash/services/device_sync:stub_device_sync", "//ash/services/multidevice_setup/public/cpp:prefs", "//ash/services/multidevice_setup/public/mojom", + "//ash/services/secure_channel", + "//ash/services/secure_channel/public/cpp/client", + "//ash/services/secure_channel/public/cpp/shared", "//ash/webui/camera_app_ui:document_scanning", + "//ash/webui/file_manager:constants", + "//ash/webui/file_manager:file_manager_ui", + "//ash/webui/file_manager:file_manager_untrusted_ui", "//base:i18n", "//build:branding_buildflags", "//chrome/app:chromium_strings", @@ -1036,7 +1336,7 @@ "//chrome/browser/ash/child_accounts/time_limits/web_time_limit_error_page", "//chrome/browser/ash/crosapi:browser_util", "//chrome/browser/ash/mojo_service_manager", - "//chrome/browser/ash/system_web_apps/types:types", + "//chrome/browser/ash/system_web_apps/types", "//chrome/browser/chromeos:attestation_proto", "//chrome/browser/metrics/structured", "//chrome/browser/profiles", @@ -1044,41 +1344,73 @@ "//chrome/browser/ui/webui/chromeos/crostini_upgrader:mojo_bindings", "//chrome/browser/ui/webui/settings/chromeos/constants:mojom", "//chrome/browser/webshare:storage", - "//chrome/common", "//chrome/common:channel_info", "//chrome/common:chrome_features", "//chrome/common:non_code_constants", "//chrome/common/net", - "//chromeos/ash/components/dbus/services", + "//chromeos/ash/components/dbus/biod", + "//chromeos/ash/components/dbus/cros_healthd", + "//chromeos/ash/components/dbus/cups_proxy", + "//chromeos/ash/components/dbus/fusebox", + "//chromeos/ash/components/dbus/hiberman", + "//chromeos/ash/components/dbus/ip_peripheral", + "//chromeos/ash/components/dbus/kerberos", + "//chromeos/ash/components/dbus/media_analytics", + "//chromeos/ash/components/dbus/os_install", + "//chromeos/ash/components/dbus/patchpanel", + "//chromeos/ash/components/dbus/pciguard", + "//chromeos/ash/components/dbus/rgbkbd", + "//chromeos/ash/components/dbus/rmad", + "//chromeos/ash/components/dbus/seneschal", + "//chromeos/ash/components/dbus/spaced", + "//chromeos/ash/components/dbus/system_proxy", + "//chromeos/ash/components/dbus/typecd", "//chromeos/ash/components/dbus/upstart", + "//chromeos/ash/components/hibernate:buildflags", "//chromeos/ash/components/network/portal_detector", "//chromeos/components/cdm_factory_daemon:cdm_factory_daemon_browser", + "//chromeos/components/chromebox_for_meetings/buildflags", + "//chromeos/components/disks:prefs", "//chromeos/components/local_search_service/public/cpp", + "//chromeos/components/mojo_bootstrap", "//chromeos/components/onc", "//chromeos/components/sensors", "//chromeos/constants", "//chromeos/dbus", + "//chromeos/dbus:plugin_vm_service_proto", "//chromeos/dbus:vm_applications_apps_proto", + "//chromeos/dbus:vm_disk_management_proto", "//chromeos/dbus:vm_launch_proto", + "//chromeos/dbus:vm_permission_service_proto", + "//chromeos/dbus:vm_sk_forwarding_proto", "//chromeos/dbus/arc", + "//chromeos/dbus/audio", "//chromeos/dbus/cdm_factory_daemon", - "//chromeos/dbus/cros_disks", "//chromeos/dbus/cryptohome:attestation_proto", + "//chromeos/dbus/cryptohome:cryptohome_proto", "//chromeos/dbus/debug_daemon", "//chromeos/dbus/dlcservice:dlcservice_proto", + "//chromeos/dbus/dlp", + "//chromeos/dbus/dlp:dlp_proto", + "//chromeos/dbus/federated", + "//chromeos/dbus/hermes", + "//chromeos/dbus/human_presence", "//chromeos/dbus/image_loader", + "//chromeos/dbus/init", + "//chromeos/dbus/machine_learning", "//chromeos/dbus/permission_broker", - "//chromeos/dbus/session_manager", "//chromeos/dbus/tpm_manager", + "//chromeos/dbus/u2f", "//chromeos/dbus/userdataauth", "//chromeos/dbus/util", "//chromeos/dbus/virtual_file_provider", "//chromeos/login/login_state", - "//chromeos/network", "//chromeos/services/assistant/public/cpp", "//chromeos/services/cros_healthd/private/cpp", "//chromeos/services/cros_healthd/public/cpp", "//chromeos/services/machine_learning/public/cpp", + "//chromeos/services/rollback_network_config/public/mojom", + "//chromeos/strings", "//chromeos/system", "//chromeos/ui/vector_icons", "//components/app_constants", @@ -1088,73 +1420,88 @@ "//components/content_settings/core/common", "//components/crx_file", "//components/device_event_log", + "//components/download/public/common:public", "//components/embedder_support:browser_util", + "//components/gcm_driver", + "//components/google/core/common", "//components/guest_os:prefs", "//components/invalidation/impl", "//components/language/core/browser", "//components/language/core/common", "//components/live_caption:constants", "//components/metrics", + "//components/metrics:serialization", "//components/onc", "//components/ownership", "//components/permissions", + "//components/policy:generated", "//components/pref_registry", - "//components/quirks", + "//components/proxy_config", + "//components/reporting/proto:interface_proto", + "//components/reporting/util:status", + "//components/reporting/util:status_proto", "//components/rlz", "//components/safe_browsing/core/common:safe_browsing_prefs", + "//components/services/app_service/public/cpp:app_file_handling", "//components/services/app_service/public/cpp:intents", "//components/services/app_service/public/cpp:types", "//components/services/app_service/public/mojom:types", "//components/services/filesystem/public/mojom", + "//components/services/unzip/content", + "//components/services/unzip/public/mojom", "//components/signin/public/base", - "//components/storage_monitor", "//components/strings:components_strings", "//components/sync/base", "//components/sync/driver", + "//components/sync_sessions", "//components/translate/core/browser", "//components/url_matcher", + "//components/vector_icons", "//components/version_info", "//components/version_info:channel", "//components/webapps/browser", "//components/webapps/browser:constants", "//content/public/common", - "//dbus", - "//extensions/browser/api/file_handlers", + "//extensions/browser/api/messaging", "//extensions/browser/api/runtime", "//extensions/browser/api/virtual_keyboard_private", "//extensions/browser/api/virtual_keyboard_private:virtual_keyboard_delegate", "//extensions/common:common_constants", "//extensions/common:mojom", "//google_apis", + "//google_apis/common", "//gpu/command_buffer/client:gles2_interface", "//gpu/command_buffer/common", "//gpu/ipc/common", "//media/capture/video/chromeos/mojom:cros_camera_shared", "//media/capture/video/chromeos/public", - "//mojo/public/cpp/bindings:bindings_base", - "//mojo/public/cpp/platform", "//net/traffic_annotation", + "//pdf:buildflags", "//printing", "//printing:printing_base", "//printing/backend", "//printing/mojom", "//rlz/buildflags", "//services/audio/public/cpp", + "//services/device/public/mojom:usb", "//services/network/public/cpp:cpp_base", "//services/network/public/mojom", "//services/network/public/mojom:url_loader_base", "//services/tracing/public/mojom", "//third_party/blink/public/common:headers", - "//third_party/blink/public/mojom:mojom_platform", "//third_party/icu", "//third_party/re2", "//third_party/securemessage/proto", - "//ui/accessibility", + "//third_party/zlib/google:zip", "//ui/accessibility:ax_enums_mojo", "//ui/base:features", + "//ui/base/clipboard", + "//ui/base/clipboard:clipboard_types", + "//ui/base/clipboard:file_info", + "//ui/base/data_transfer_policy", "//ui/chromeos", - "//ui/chromeos/events", "//ui/chromeos/resources", + "//ui/chromeos/strings", "//ui/chromeos/styles:cros_styles_views", "//ui/color:color_headers", "//ui/color:mixers", @@ -1166,8 +1513,9 @@ "//ui/gfx:color_utils", "//ui/gfx:memory_buffer", "//ui/gfx/codec", + "//ui/message_center", "//ui/native_theme", - "//ui/strings", + "//ui/strings:ui_strings", "//ui/views/controls/webview", "//ui/wm", ]
diff --git a/chrome/browser/ash/arc/fileapi/arc_select_files_handler.cc b/chrome/browser/ash/arc/fileapi/arc_select_files_handler.cc index 4ab3e3b..5791623 100644 --- a/chrome/browser/ash/arc/fileapi/arc_select_files_handler.cc +++ b/chrome/browser/ash/arc/fileapi/arc_select_files_handler.cc
@@ -116,6 +116,7 @@ switch (request->action_type) { case mojom::SelectFilesActionType::GET_CONTENT: case mojom::SelectFilesActionType::OPEN_DOCUMENT: + case mojom::SelectFilesActionType::OPEN_MEDIA_STORE_FILES: return request->allow_multiple ? ui::SelectFileDialog::SELECT_OPEN_MULTI_FILE : ui::SelectFileDialog::SELECT_OPEN_FILE; @@ -257,9 +258,15 @@ bool show_android_picker_apps = request->action_type == mojom::SelectFilesActionType::GET_CONTENT; + // In OPEN_MEDIA_STORE_FILES mode, only show volumes indexed in Android's + // MediaStore. + bool use_media_store_filter = + request->action_type == + mojom::SelectFilesActionType::OPEN_MEDIA_STORE_FILES; + bool success = dialog_holder_->SelectFile( dialog_type, default_path, &file_type_info, request->task_id, - search_query, show_android_picker_apps); + search_query, show_android_picker_apps, use_media_store_filter); if (!success) { std::move(callback_).Run(mojom::SelectFilesResult::New()); } @@ -383,7 +390,8 @@ const ui::SelectFileDialog::FileTypeInfo* file_types, int task_id, const std::string& search_query, - bool show_android_picker_apps) { + bool show_android_picker_apps, + bool use_media_store_filter) { aura::Window* owner_window = nullptr; for (auto* window : ChromeShelfController::instance()->GetArcWindows()) { if (arc::GetWindowTaskId(window) == task_id) { @@ -404,7 +412,8 @@ type, /*title=*/std::u16string(), default_path, file_types, /*file_type_index=*/0, - /*params=*/nullptr, owner, search_query, show_android_picker_apps); + /*params=*/nullptr, owner, search_query, show_android_picker_apps, + use_media_store_filter); return true; }
diff --git a/chrome/browser/ash/arc/fileapi/arc_select_files_handler.h b/chrome/browser/ash/arc/fileapi/arc_select_files_handler.h index 3b2a55e..07a0240 100644 --- a/chrome/browser/ash/arc/fileapi/arc_select_files_handler.h +++ b/chrome/browser/ash/arc/fileapi/arc_select_files_handler.h
@@ -138,7 +138,8 @@ const ui::SelectFileDialog::FileTypeInfo* file_types, int task_id, const std::string& search_query, - bool show_android_picker_apps); + bool show_android_picker_apps, + bool use_media_store_filter); virtual void ExecuteJavaScript( const std::string& script,
diff --git a/chrome/browser/ash/arc/fileapi/arc_select_files_handler_unittest.cc b/chrome/browser/ash/arc/fileapi/arc_select_files_handler_unittest.cc index 29b56a6..74e86a0 100644 --- a/chrome/browser/ash/arc/fileapi/arc_select_files_handler_unittest.cc +++ b/chrome/browser/ash/arc/fileapi/arc_select_files_handler_unittest.cc
@@ -81,13 +81,14 @@ explicit MockSelectFileDialogHolder(ui::SelectFileDialog::Listener* listener) : SelectFileDialogHolder(listener) {} ~MockSelectFileDialogHolder() override = default; - MOCK_METHOD6(SelectFile, + MOCK_METHOD7(SelectFile, bool(ui::SelectFileDialog::Type type, const base::FilePath& default_path, const ui::SelectFileDialog::FileTypeInfo* file_types, int task_id, const std::string& search_query, - bool show_android_picker_apps)); + bool show_android_picker_apps, + bool use_media_store_filter)); MOCK_METHOD2(ExecuteJavaScript, void(const std::string&, JavaScriptResultCallback)); }; @@ -114,7 +115,7 @@ mock_dialog_holder_ = mock_dialog_holder.get(); arc_select_files_handler_->SetDialogHolderForTesting( std::move(mock_dialog_holder)); - ON_CALL(*mock_dialog_holder_, SelectFile(_, _, _, _, _, _)) + ON_CALL(*mock_dialog_holder_, SelectFile(_, _, _, _, _, _, _)) .WillByDefault(Return(true)); } @@ -128,14 +129,16 @@ SelectFilesActionType request_action_type, bool request_allow_multiple, SelectFileDialog::Type expected_dialog_type, - bool expected_show_android_picker_apps) { + bool expected_show_android_picker_apps, + bool expected_use_media_store_filter) { SelectFilesRequestPtr request = SelectFilesRequest::New(); request->action_type = request_action_type; request->allow_multiple = request_allow_multiple; EXPECT_CALL(*mock_dialog_holder_, SelectFile(expected_dialog_type, _, _, _, _, - expected_show_android_picker_apps)) + expected_show_android_picker_apps, + expected_use_media_store_filter)) .Times(1); SelectFilesCallback callback; @@ -170,21 +173,29 @@ TEST_F(ArcSelectFilesHandlerTest, SelectFiles_DialogType) { CallSelectFilesAndCheckDialogType(SelectFilesActionType::GET_CONTENT, false, - SelectFileDialog::SELECT_OPEN_FILE, true); + SelectFileDialog::SELECT_OPEN_FILE, true, + false); CallSelectFilesAndCheckDialogType(SelectFilesActionType::GET_CONTENT, true, SelectFileDialog::SELECT_OPEN_MULTI_FILE, - true); + true, false); CallSelectFilesAndCheckDialogType(SelectFilesActionType::OPEN_DOCUMENT, false, - SelectFileDialog::SELECT_OPEN_FILE, false); + SelectFileDialog::SELECT_OPEN_FILE, false, + false); CallSelectFilesAndCheckDialogType(SelectFilesActionType::OPEN_DOCUMENT, true, SelectFileDialog::SELECT_OPEN_MULTI_FILE, - false); + false, false); CallSelectFilesAndCheckDialogType( SelectFilesActionType::OPEN_DOCUMENT_TREE, false, - SelectFileDialog::SELECT_EXISTING_FOLDER, false); + SelectFileDialog::SELECT_EXISTING_FOLDER, false, false); CallSelectFilesAndCheckDialogType(SelectFilesActionType::CREATE_DOCUMENT, true, SelectFileDialog::SELECT_SAVEAS_FILE, - false); + false, false); + CallSelectFilesAndCheckDialogType( + SelectFilesActionType::OPEN_MEDIA_STORE_FILES, false, + SelectFileDialog::SELECT_OPEN_FILE, false, true); + CallSelectFilesAndCheckDialogType( + SelectFilesActionType::OPEN_MEDIA_STORE_FILES, true, + SelectFileDialog::SELECT_OPEN_MULTI_FILE, false, true); } TEST_F(ArcSelectFilesHandlerTest, SelectFiles_FileTypeInfo) { @@ -205,7 +216,7 @@ *mock_dialog_holder_, SelectFile(_, _, testing::Pointee(FileTypeInfoMatcher(expected_file_type_info)), - 1234, _, _)) + 1234, _, _, _)) .Times(1); base::MockCallback<SelectFilesCallback> callback; @@ -233,7 +244,7 @@ *mock_dialog_holder_, SelectFile(_, _, testing::Pointee(FileTypeInfoMatcher(expected_file_type_info)), - 1234, _, _)) + 1234, _, _, _)) .Times(1); base::MockCallback<SelectFilesCallback> callback; @@ -260,7 +271,7 @@ *mock_dialog_holder_, SelectFile(_, _, testing::Pointee(FileTypeInfoMatcher(expected_file_type_info)), - 1234, _, _)) + 1234, _, _, _)) .Times(1); base::MockCallback<SelectFilesCallback> callback; @@ -279,7 +290,7 @@ "/special/arc-documents-provider/testing.provider/doc:root"); EXPECT_CALL(*mock_dialog_holder_, - SelectFile(_, FilePathMatcher(expected_file_path), _, _, _, _)) + SelectFile(_, FilePathMatcher(expected_file_path), _, _, _, _, _)) .Times(1); base::MockCallback<SelectFilesCallback> callback;
diff --git a/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.cc b/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.cc index fc1bab6..9ea07a7 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.cc +++ b/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.cc
@@ -202,6 +202,7 @@ header_view.get(), /*left=*/20, /*right=*/8, /*other_spacing=*/16))); game_control_toggle_->SetBorder( views::CreateEmptyBorder(gfx::Insets::TLBR(0, 0, 0, 16))); + SetCustomToggleColor(game_control_toggle_); AddChildView(std::move(header_view)); AddChildView(BuildSeparator()); @@ -260,6 +261,7 @@ show_hint_toggle_->SetIsOn( game_control_toggle_->GetIsOn() && display_overlay_controller_->GetInputMappingViewVisible()); + SetCustomToggleColor(show_hint_toggle_); hint_label->SetBorder(views::CreateEmptyBorder( CalculateInsets(hint_view.get(), /*left=*/kSideInset, /*right=*/kSideInset, /*other_spacing=*/0))); @@ -350,6 +352,21 @@ return gfx::Insets::TLBR(0, left, 0, right_inset); } +void InputMenuView::SetCustomToggleColor(views::ToggleButton* toggle) { + auto* color_provider = ash::AshColorProvider::Get(); + if (!color_provider) + return; + + toggle->SetThumbOnColor(color_provider->GetContentLayerColor( + ash::AshColorProvider::ContentLayerType::kSwitchKnobColorActive)); + toggle->SetThumbOffColor(color_provider->GetContentLayerColor( + ash::AshColorProvider::ContentLayerType::kSwitchKnobColorInactive)); + toggle->SetTrackOnColor(color_provider->GetContentLayerColor( + ash::AshColorProvider::ContentLayerType::kSwitchTrackColorActive)); + toggle->SetTrackOffColor(color_provider->GetContentLayerColor( + ash::AshColorProvider::ContentLayerType::kSwitchTrackColorInactive)); +} + } // namespace input_overlay } // namespace arc
diff --git a/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.h b/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.h index e408708..afe748d8 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.h +++ b/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.h
@@ -67,6 +67,8 @@ int left, int right, int other_spacing) const; + // Set |toggle| colors to spec. + void SetCustomToggleColor(views::ToggleButton* toggle); raw_ptr<views::ToggleButton> game_control_toggle_ = nullptr; raw_ptr<views::ToggleButton> show_hint_toggle_ = nullptr;
diff --git a/chrome/browser/ash/crostini/crostini_installer.cc b/chrome/browser/ash/crostini/crostini_installer.cc index f74919f8..07f8848 100644 --- a/chrome/browser/ash/crostini/crostini_installer.cc +++ b/chrome/browser/ash/crostini/crostini_installer.cc
@@ -446,12 +446,6 @@ } void CrostiniInstaller::OnContainerStarted(CrostiniResult result) { - if (result == CrostiniResult::CONTAINER_CONFIGURATION_FAILED) { - LOG(ERROR) << "Container start failed due to failed configuration"; - NOTREACHED(); - return; - } - DCHECK(installing_state_ == InstallerState::kStartContainer || installing_state_ == InstallerState::kConfigureContainer);
diff --git a/chrome/browser/ash/guest_os/public/installer_delegate_factory.cc b/chrome/browser/ash/guest_os/public/installer_delegate_factory.cc new file mode 100644 index 0000000..b8fa80fc --- /dev/null +++ b/chrome/browser/ash/guest_os/public/installer_delegate_factory.cc
@@ -0,0 +1,21 @@ +// Copyright (c) 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. + +#include "chrome/browser/ash/guest_os/public/installer_delegate_factory.h" + +#include "ash/webui/guest_os_installer/guest_os_installer_ui.h" + +namespace guest_os { + +std::unique_ptr<ash::guest_os_installer::mojom::PageHandler> +InstallerDelegateFactory( + ash::GuestOSInstallerUI* webui, + const GURL& url, + mojo::PendingRemote<ash::guest_os_installer::mojom::Page> pending_page, + mojo::PendingReceiver<ash::guest_os_installer::mojom::PageHandler> + pending_page_handler) { + return nullptr; +} + +} // namespace guest_os
diff --git a/chrome/browser/ash/guest_os/public/installer_delegate_factory.h b/chrome/browser/ash/guest_os/public/installer_delegate_factory.h new file mode 100644 index 0000000..3147ed5 --- /dev/null +++ b/chrome/browser/ash/guest_os/public/installer_delegate_factory.h
@@ -0,0 +1,31 @@ +// Copyright (c) 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. + +#ifndef CHROME_BROWSER_ASH_GUEST_OS_PUBLIC_INSTALLER_DELEGATE_FACTORY_H_ +#define CHROME_BROWSER_ASH_GUEST_OS_PUBLIC_INSTALLER_DELEGATE_FACTORY_H_ + +#include <memory> + +#include "ash/webui/guest_os_installer/mojom/guest_os_installer.mojom.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" + +class GURL; + +namespace ash { +class GuestOSInstallerUI; +} + +namespace guest_os { + +std::unique_ptr<ash::guest_os_installer::mojom::PageHandler> +InstallerDelegateFactory( + ash::GuestOSInstallerUI*, + const GURL&, + mojo::PendingRemote<ash::guest_os_installer::mojom::Page>, + mojo::PendingReceiver<ash::guest_os_installer::mojom::PageHandler>); + +} + +#endif
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular_unittest.cc b/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular_unittest.cc index 49fcffb..fddcae6 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular_unittest.cc +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular_unittest.cc
@@ -243,6 +243,7 @@ easy_unlock_service_regular_->Shutdown(); PowerManagerClient::Shutdown(); TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr); + display::Screen::SetScreenInstance(nullptr); } // Most tests will want to pass `should_initialize_all_dependencies` == true,
diff --git a/chrome/browser/ash/login/saml/saml_browsertest.cc b/chrome/browser/ash/login/saml/saml_browsertest.cc index a461b0d..94029d3 100644 --- a/chrome/browser/ash/login/saml/saml_browsertest.cc +++ b/chrome/browser/ash/login/saml/saml_browsertest.cc
@@ -1173,6 +1173,7 @@ void ClickBackOnSAMLInterstitialPage(); void ClickNextOnSAMLInterstitialPage(); void ShowSAMLLoginForm(); + void MaybeWaitForSAMLToLoad(); void ClickBackOnSAMLPage(); void LogInWithSAML(const std::string& user_id, const std::string& auth_sid_cookie, @@ -1375,6 +1376,19 @@ OobeScreenWaiter(GaiaView::kScreenId).Wait(); test::OobeJS().CreateVisibilityWaiter(true, kSigninFrameDialog)->Wait(); test::OobeJS().CreateVisibilityWaiter(false, kGaiaLoading)->Wait(); +} + +void SAMLPolicyTest::MaybeWaitForSAMLToLoad() { + // If SAML already loaded return and otherwise wait for the SamlLoaded + // message. + if (test::OobeJS().GetAttributeBool("isSamlForTesting()", {"gaia-signin"})) + return; + content::DOMMessageQueue message_queue; + SetupAuthFlowChangeListener(); + std::string message; + do { + ASSERT_TRUE(message_queue.WaitForMessage(&message)); + } while (message != "\"SamlLoaded\""); test::OobeJS().ExpectAttributeEQ("isSamlForTesting()", {"gaia-signin"}, true); } @@ -1616,13 +1630,14 @@ // When GetParam() is false: // Tests that clicking "Next" in the SAML interstitial page successfully // triggers a SAML redirect request, and the SAML IdP authentication page is -// loaded and authenticaing there is successful. -// TODO(https://crbug.com/1102738) flaky test +// loaded and authenticating there is successful. // // When GetParam() is true: // Tests that clicking back on the SAML page successfully closes the oobe // dialog. Reopens a dialog and checks that SAML IdP authentication page is -// loaded and authenticaing there is successful. +// loaded and authenticating there is successful. +// TODO(https://crbug.com/1102738) flaky test - partially fixed but keeping the +// test disabled since there is still some instabillity observed under load. IN_PROC_BROWSER_TEST_P(SAMLPolicyTest, DISABLED_SAMLInterstitialNext) { fake_saml_idp()->SetLoginHTMLTemplate("saml_login.html"); fake_gaia_.fake_gaia()->SetFakeMergeSessionParams( @@ -1644,6 +1659,7 @@ if (GetParam()) { ShowSAMLLoginForm(); + MaybeWaitForSAMLToLoad(); } else { ShowSAMLInterstitial(); ClickNextOnSAMLInterstitialPage();
diff --git a/chrome/browser/ash/settings/supervised_user_cros_settings_provider.cc b/chrome/browser/ash/settings/supervised_user_cros_settings_provider.cc index 6d6cc03..291806bf 100644 --- a/chrome/browser/ash/settings/supervised_user_cros_settings_provider.cc +++ b/chrome/browser/ash/settings/supervised_user_cros_settings_provider.cc
@@ -46,8 +46,12 @@ if (user_manager->GetUsers().empty()) return false; - auto* device_owner = - user_manager->FindUser(user_manager->GetOwnerAccountId()); + const AccountId owner_account_id = user_manager->GetOwnerAccountId(); + if (!owner_account_id.is_valid()) { + // Unowned or admin-owned device. + return false; + } + auto* device_owner = user_manager->FindUser(owner_account_id); if (device_owner && device_owner->IsChild()) { return base::Contains(child_user_restrictions_, path);
diff --git a/chrome/browser/autocomplete/keyword_extensions_delegate_impl.cc b/chrome/browser/autocomplete/keyword_extensions_delegate_impl.cc index 8a7a6db..c14f1c1 100644 --- a/chrome/browser/autocomplete/keyword_extensions_delegate_impl.cc +++ b/chrome/browser/autocomplete/keyword_extensions_delegate_impl.cc
@@ -209,5 +209,5 @@ } void KeywordExtensionsDelegateImpl::OnProviderUpdate(bool updated_matches) { - provider_->listener_->OnProviderUpdate(updated_matches); + provider_->NotifyListeners(updated_matches); }
diff --git a/chrome/browser/autofill_assistant/password_change/apc_external_action_delegate.cc b/chrome/browser/autofill_assistant/password_change/apc_external_action_delegate.cc index e28577e8..ad4af3c 100644 --- a/chrome/browser/autofill_assistant/password_change/apc_external_action_delegate.cc +++ b/chrome/browser/autofill_assistant/password_change/apc_external_action_delegate.cc
@@ -34,7 +34,7 @@ } void ApcExternalActionDelegate::SetupDisplay() { - Show(PasswordChangeRunDisplay::Create(GetWeakPtr(), display_delegate_)); + Show(PasswordChangeRunDisplay::Create(GetWeakPtr(), display_delegate_.get())); } void ApcExternalActionDelegate::OnInterruptStarted() {}
diff --git a/chrome/browser/autofill_assistant/password_change/apc_external_action_delegate.h b/chrome/browser/autofill_assistant/password_change/apc_external_action_delegate.h index 4c283eb..0a4544b 100644 --- a/chrome/browser/autofill_assistant/password_change/apc_external_action_delegate.h +++ b/chrome/browser/autofill_assistant/password_change/apc_external_action_delegate.h
@@ -7,6 +7,7 @@ #include <memory> +#include "base/memory/raw_ptr.h" #include "chrome/browser/autofill_assistant/password_change/proto/extensions.pb.h" #include "chrome/browser/ui/autofill_assistant/password_change/password_change_run_controller.h" #include "components/autofill_assistant/browser/public/external_action_delegate.h" @@ -65,7 +66,7 @@ nullptr; // The display where we render the UI for a password change run. - AssistantDisplayDelegate* display_delegate_ = nullptr; + raw_ptr<AssistantDisplayDelegate> display_delegate_ = nullptr; // Factory for weak pointers to this class. base::WeakPtrFactory<PasswordChangeRunController> weak_ptr_factory_{this};
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc index 9528bfc..0d35f4d 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc
@@ -1364,7 +1364,7 @@ std::unique_ptr<TestingProfile> profile_; std::unique_ptr<ScopedTestingLocalState> local_state_; #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_LACROS) - web_app::FakeWebAppProvider* web_app_provider_; + raw_ptr<web_app::FakeWebAppProvider> web_app_provider_; #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_LACROS) };
diff --git a/chrome/browser/chrome_browser_interface_binders.cc b/chrome/browser/chrome_browser_interface_binders.cc index 8df3a45..44e5dfd 100644 --- a/chrome/browser/chrome_browser_interface_binders.cc +++ b/chrome/browser/chrome_browser_interface_binders.cc
@@ -210,6 +210,8 @@ #include "ash/webui/file_manager/mojom/file_manager.mojom.h" #include "ash/webui/firmware_update_ui/firmware_update_app_ui.h" #include "ash/webui/firmware_update_ui/mojom/firmware_update.mojom.h" +#include "ash/webui/guest_os_installer/guest_os_installer_ui.h" +#include "ash/webui/guest_os_installer/mojom/guest_os_installer.mojom.h" #include "ash/webui/help_app_ui/help_app_ui.h" #include "ash/webui/help_app_ui/help_app_ui.mojom.h" #include "ash/webui/help_app_ui/search/search.mojom.h" @@ -957,6 +959,10 @@ chromeos::NetworkUI, chromeos::OobeUI>(map); RegisterWebUIControllerInterfaceBinder< + ash::guest_os_installer::mojom::PageHandlerFactory, + ash::GuestOSInstallerUI>(map); + + RegisterWebUIControllerInterfaceBinder< chromeos::crostini_installer::mojom::PageHandlerFactory, chromeos::CrostiniInstallerUI>(map);
diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm index 0cb701b8..341458a 100644 --- a/chrome/browser/chrome_browser_main_mac.mm +++ b/chrome/browser/chrome_browser_main_mac.mm
@@ -56,8 +56,7 @@ StartupData* startup_data) : ChromeBrowserMainPartsPosix(is_integration_test, startup_data) {} -ChromeBrowserMainPartsMac::~ChromeBrowserMainPartsMac() { -} +ChromeBrowserMainPartsMac::~ChromeBrowserMainPartsMac() = default; int ChromeBrowserMainPartsMac::PreEarlyInitialization() { if (base::mac::WasLaunchedAsLoginItemRestoreState()) { @@ -69,7 +68,6 @@ base::CommandLine::ForCurrentProcess(); singleton_command_line->AppendSwitch(switches::kNoStartupWindow); } - return ChromeBrowserMainPartsPosix::PreEarlyInitialization(); }
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 0e6e2da8..4fae61f0 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -339,6 +339,7 @@ #include "chrome/browser/browser_process_platform_part_mac.h" #include "chrome/browser/chrome_browser_main_mac.h" #include "chrome/browser/mac/auth_session_request.h" +#include "chrome/browser/mac/chrome_browser_main_extra_parts_mac.h" #include "components/soda/constants.h" #include "sandbox/mac/seatbelt_exec.h" #include "sandbox/policy/mac/params.h" @@ -1455,6 +1456,10 @@ #endif #endif +#if BUILDFLAG(IS_MAC) + main_parts->AddParts(std::make_unique<ChromeBrowserMainExtraPartsMac>()); +#endif + #if BUILDFLAG(IS_CHROMEOS_ASH) // TODO(jamescook): Combine with `ChromeBrowserMainPartsAsh`. main_parts->AddParts(std::make_unique<ChromeBrowserMainExtraPartsAsh>());
diff --git a/chrome/browser/chrome_multiprofile_startup_browsertest.cc b/chrome/browser/chrome_multiprofile_startup_browsertest.cc index babe4078..b1a027d 100644 --- a/chrome/browser/chrome_multiprofile_startup_browsertest.cc +++ b/chrome/browser/chrome_multiprofile_startup_browsertest.cc
@@ -5,6 +5,7 @@ #include <vector> #include "base/files/file_path.h" +#include "base/memory/raw_ptr.h" #include "base/strings/strcat.h" #include "base/test/bind.h" #include "build/build_config.h" @@ -191,7 +192,7 @@ } } - MockMainExtraParts* mock_part_; + raw_ptr<MockMainExtraParts> mock_part_; protected: base::test::ScopedFeatureList feature_list_;
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 1738df6..78e12c78 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -152,6 +152,8 @@ "//ash/webui/file_manager/resources:file_manager_swa_resources_grit", "//ash/webui/file_manager/untrusted_resources:file_manager_untrusted_resources_grit", "//ash/webui/firmware_update_ui", + "//ash/webui/guest_os_installer", + "//ash/webui/guest_os_installer/mojom", "//ash/webui/help_app_ui", "//ash/webui/media_app_ui", "//ash/webui/media_app_ui:buildflags", @@ -584,274 +586,6 @@ ] sources = [ - "../ash/dbus/ash_dbus_helper.cc", - "../ash/dbus/ash_dbus_helper.h", - "../ash/dbus/chrome_features_service_provider.cc", - "../ash/dbus/chrome_features_service_provider.h", - "../ash/dbus/component_updater_service_provider.cc", - "../ash/dbus/component_updater_service_provider.h", - "../ash/dbus/cryptohome_key_delegate_service_provider.cc", - "../ash/dbus/cryptohome_key_delegate_service_provider.h", - "../ash/dbus/dlp_files_policy_service_provider.cc", - "../ash/dbus/dlp_files_policy_service_provider.h", - "../ash/dbus/drive_file_stream_service_provider.cc", - "../ash/dbus/drive_file_stream_service_provider.h", - "../ash/dbus/encrypted_reporting_service_provider.cc", - "../ash/dbus/encrypted_reporting_service_provider.h", - "../ash/dbus/fusebox_service_provider.cc", - "../ash/dbus/fusebox_service_provider.h", - "../ash/dbus/kiosk_info_service_provider.cc", - "../ash/dbus/kiosk_info_service_provider.h", - "../ash/dbus/libvda_service_provider.cc", - "../ash/dbus/libvda_service_provider.h", - "../ash/dbus/lock_to_single_user_service_provider.cc", - "../ash/dbus/lock_to_single_user_service_provider.h", - "../ash/dbus/machine_learning_decision_service_provider.cc", - "../ash/dbus/machine_learning_decision_service_provider.h", - "../ash/dbus/metrics_event_service_provider.cc", - "../ash/dbus/metrics_event_service_provider.h", - "../ash/dbus/mojo_connection_service_provider.cc", - "../ash/dbus/mojo_connection_service_provider.h", - "../ash/dbus/printers_service_provider.cc", - "../ash/dbus/printers_service_provider.h", - "../ash/dbus/proxy_resolution_service_provider.cc", - "../ash/dbus/proxy_resolution_service_provider.h", - "../ash/dbus/screen_lock_service_provider.cc", - "../ash/dbus/screen_lock_service_provider.h", - "../ash/dbus/smb_fs_service_provider.cc", - "../ash/dbus/smb_fs_service_provider.h", - "../ash/dbus/virtual_file_request_service_provider.cc", - "../ash/dbus/virtual_file_request_service_provider.h", - "../ash/dbus/vm/plugin_vm_service_provider.cc", - "../ash/dbus/vm/plugin_vm_service_provider.h", - "../ash/dbus/vm/vm_applications_service_provider.cc", - "../ash/dbus/vm/vm_applications_service_provider.h", - "../ash/dbus/vm/vm_disk_management_service_provider.cc", - "../ash/dbus/vm/vm_disk_management_service_provider.h", - "../ash/dbus/vm/vm_launch_service_provider.cc", - "../ash/dbus/vm/vm_launch_service_provider.h", - "../ash/dbus/vm/vm_permission_service_provider.cc", - "../ash/dbus/vm/vm_permission_service_provider.h", - "../ash/dbus/vm/vm_sk_forwarding_service_provider.cc", - "../ash/dbus/vm/vm_sk_forwarding_service_provider.h", - "../ash/device_name/device_name_applier.h", - "../ash/device_name/device_name_applier_impl.cc", - "../ash/device_name/device_name_applier_impl.h", - "../ash/device_name/device_name_store.cc", - "../ash/device_name/device_name_store.h", - "../ash/device_name/device_name_store_impl.cc", - "../ash/device_name/device_name_store_impl.h", - "../ash/device_name/device_name_validator.cc", - "../ash/device_name/device_name_validator.h", - "../ash/device_sync/device_sync_client_factory.cc", - "../ash/device_sync/device_sync_client_factory.h", - "../ash/diagnostics/diagnostics_browser_delegate_impl.cc", - "../ash/diagnostics/diagnostics_browser_delegate_impl.h", - "../ash/display/quirks_manager_delegate_impl.cc", - "../ash/display/quirks_manager_delegate_impl.h", - "../ash/drive/drive_integration_service.cc", - "../ash/drive/drive_integration_service.h", - "../ash/drive/drivefs_native_message_host.cc", - "../ash/drive/drivefs_native_message_host.h", - "../ash/drive/file_system_util.cc", - "../ash/drive/file_system_util.h", - "../ash/drive/fileapi/drivefs_async_file_util.cc", - "../ash/drive/fileapi/drivefs_async_file_util.h", - "../ash/drive/fileapi/drivefs_file_system_backend_delegate.cc", - "../ash/drive/fileapi/drivefs_file_system_backend_delegate.h", - "../ash/eche_app/app_id.h", - "../ash/eche_app/eche_app_manager_factory.cc", - "../ash/eche_app/eche_app_manager_factory.h", - "../ash/eche_app/eche_app_notification_controller.cc", - "../ash/eche_app/eche_app_notification_controller.h", - "../ash/enhanced_network_tts/enhanced_network_tts_constants.cc", - "../ash/enhanced_network_tts/enhanced_network_tts_constants.h", - "../ash/enhanced_network_tts/enhanced_network_tts_impl.cc", - "../ash/enhanced_network_tts/enhanced_network_tts_impl.h", - "../ash/enhanced_network_tts/enhanced_network_tts_utils.cc", - "../ash/enhanced_network_tts/enhanced_network_tts_utils.h", - "../ash/eol_notification.cc", - "../ash/eol_notification.h", - "../ash/events/event_rewriter_delegate_impl.cc", - "../ash/events/event_rewriter_delegate_impl.h", - "../ash/exo/chrome_data_exchange_delegate.cc", - "../ash/exo/chrome_data_exchange_delegate.h", - "../ash/external_metrics.cc", - "../ash/external_metrics.h", - "../ash/external_protocol_dialog.cc", - "../ash/external_protocol_dialog.h", - "../ash/file_manager/app_id.h", - "../ash/file_manager/app_service_file_tasks.cc", - "../ash/file_manager/app_service_file_tasks.h", - "../ash/file_manager/arc_file_tasks.cc", - "../ash/file_manager/arc_file_tasks.h", - "../ash/file_manager/copy_or_move_io_task.cc", - "../ash/file_manager/copy_or_move_io_task.h", - "../ash/file_manager/delete_io_task.cc", - "../ash/file_manager/delete_io_task.h", - "../ash/file_manager/documents_provider_root_manager.cc", - "../ash/file_manager/documents_provider_root_manager.h", - "../ash/file_manager/extract_io_task.cc", - "../ash/file_manager/extract_io_task.h", - "../ash/file_manager/file_browser_handlers.cc", - "../ash/file_manager/file_browser_handlers.h", - "../ash/file_manager/file_manager_copy_or_move_hook_delegate.cc", - "../ash/file_manager/file_manager_copy_or_move_hook_delegate.h", - "../ash/file_manager/file_manager_string_util.cc", - "../ash/file_manager/file_manager_string_util.h", - "../ash/file_manager/file_tasks.cc", - "../ash/file_manager/file_tasks.h", - "../ash/file_manager/file_tasks_notifier.cc", - "../ash/file_manager/file_tasks_notifier.h", - "../ash/file_manager/file_tasks_notifier_factory.cc", - "../ash/file_manager/file_tasks_notifier_factory.h", - "../ash/file_manager/file_tasks_observer.h", - "../ash/file_manager/file_watcher.cc", - "../ash/file_manager/file_watcher.h", - "../ash/file_manager/fileapi_util.cc", - "../ash/file_manager/fileapi_util.h", - "../ash/file_manager/filesystem_api_util.cc", - "../ash/file_manager/filesystem_api_util.h", - "../ash/file_manager/fusebox_mounter.cc", - "../ash/file_manager/fusebox_mounter.h", - "../ash/file_manager/guest_os_file_tasks.cc", - "../ash/file_manager/guest_os_file_tasks.h", - "../ash/file_manager/io_task.cc", - "../ash/file_manager/io_task.h", - "../ash/file_manager/io_task_controller.cc", - "../ash/file_manager/io_task_controller.h", - "../ash/file_manager/io_task_util.cc", - "../ash/file_manager/io_task_util.h", - "../ash/file_manager/open_util.cc", - "../ash/file_manager/open_util.h", - "../ash/file_manager/open_with_browser.cc", - "../ash/file_manager/open_with_browser.h", - "../ash/file_manager/path_util.cc", - "../ash/file_manager/path_util.h", - "../ash/file_manager/prefs_migration_uma.h", - "../ash/file_manager/restore_io_task.cc", - "../ash/file_manager/restore_io_task.h", - "../ash/file_manager/select_file_dialog_util.cc", - "../ash/file_manager/select_file_dialog_util.h", - "../ash/file_manager/snapshot_manager.cc", - "../ash/file_manager/snapshot_manager.h", - "../ash/file_manager/speedometer.cc", - "../ash/file_manager/speedometer.h", - "../ash/file_manager/trash_io_task.cc", - "../ash/file_manager/trash_io_task.h", - "../ash/file_manager/url_util.cc", - "../ash/file_manager/url_util.h", - "../ash/file_manager/volume_manager.cc", - "../ash/file_manager/volume_manager.h", - "../ash/file_manager/volume_manager_factory.cc", - "../ash/file_manager/volume_manager_factory.h", - "../ash/file_manager/volume_manager_observer.h", - "../ash/file_manager/zip_io_task.cc", - "../ash/file_manager/zip_io_task.h", - "../ash/file_system_provider/abort_callback.h", - "../ash/file_system_provider/extension_provider.cc", - "../ash/file_system_provider/extension_provider.h", - "../ash/file_system_provider/fileapi/backend_delegate.cc", - "../ash/file_system_provider/fileapi/backend_delegate.h", - "../ash/file_system_provider/fileapi/buffering_file_stream_reader.cc", - "../ash/file_system_provider/fileapi/buffering_file_stream_reader.h", - "../ash/file_system_provider/fileapi/buffering_file_stream_writer.cc", - "../ash/file_system_provider/fileapi/buffering_file_stream_writer.h", - "../ash/file_system_provider/fileapi/file_stream_reader.cc", - "../ash/file_system_provider/fileapi/file_stream_reader.h", - "../ash/file_system_provider/fileapi/file_stream_writer.cc", - "../ash/file_system_provider/fileapi/file_stream_writer.h", - "../ash/file_system_provider/fileapi/provider_async_file_util.cc", - "../ash/file_system_provider/fileapi/provider_async_file_util.h", - "../ash/file_system_provider/fileapi/watcher_manager.cc", - "../ash/file_system_provider/fileapi/watcher_manager.h", - "../ash/file_system_provider/icon_set.cc", - "../ash/file_system_provider/icon_set.h", - "../ash/file_system_provider/mount_path_util.cc", - "../ash/file_system_provider/mount_path_util.h", - "../ash/file_system_provider/notification_manager.cc", - "../ash/file_system_provider/notification_manager.h", - "../ash/file_system_provider/notification_manager_interface.h", - "../ash/file_system_provider/observer.h", - "../ash/file_system_provider/operations/abort.cc", - "../ash/file_system_provider/operations/abort.h", - "../ash/file_system_provider/operations/add_watcher.cc", - "../ash/file_system_provider/operations/add_watcher.h", - "../ash/file_system_provider/operations/close_file.cc", - "../ash/file_system_provider/operations/close_file.h", - "../ash/file_system_provider/operations/configure.cc", - "../ash/file_system_provider/operations/configure.h", - "../ash/file_system_provider/operations/copy_entry.cc", - "../ash/file_system_provider/operations/copy_entry.h", - "../ash/file_system_provider/operations/create_directory.cc", - "../ash/file_system_provider/operations/create_directory.h", - "../ash/file_system_provider/operations/create_file.cc", - "../ash/file_system_provider/operations/create_file.h", - "../ash/file_system_provider/operations/delete_entry.cc", - "../ash/file_system_provider/operations/delete_entry.h", - "../ash/file_system_provider/operations/execute_action.cc", - "../ash/file_system_provider/operations/execute_action.h", - "../ash/file_system_provider/operations/get_actions.cc", - "../ash/file_system_provider/operations/get_actions.h", - "../ash/file_system_provider/operations/get_metadata.cc", - "../ash/file_system_provider/operations/get_metadata.h", - "../ash/file_system_provider/operations/move_entry.cc", - "../ash/file_system_provider/operations/move_entry.h", - "../ash/file_system_provider/operations/open_file.cc", - "../ash/file_system_provider/operations/open_file.h", - "../ash/file_system_provider/operations/operation.cc", - "../ash/file_system_provider/operations/operation.h", - "../ash/file_system_provider/operations/read_directory.cc", - "../ash/file_system_provider/operations/read_directory.h", - "../ash/file_system_provider/operations/read_file.cc", - "../ash/file_system_provider/operations/read_file.h", - "../ash/file_system_provider/operations/remove_watcher.cc", - "../ash/file_system_provider/operations/remove_watcher.h", - "../ash/file_system_provider/operations/truncate.cc", - "../ash/file_system_provider/operations/truncate.h", - "../ash/file_system_provider/operations/unmount.cc", - "../ash/file_system_provider/operations/unmount.h", - "../ash/file_system_provider/operations/write_file.cc", - "../ash/file_system_provider/operations/write_file.h", - "../ash/file_system_provider/provided_file_system.cc", - "../ash/file_system_provider/provided_file_system.h", - "../ash/file_system_provider/provided_file_system_info.cc", - "../ash/file_system_provider/provided_file_system_info.h", - "../ash/file_system_provider/provided_file_system_interface.cc", - "../ash/file_system_provider/provided_file_system_interface.h", - "../ash/file_system_provider/provided_file_system_observer.cc", - "../ash/file_system_provider/provided_file_system_observer.h", - "../ash/file_system_provider/provider_interface.h", - "../ash/file_system_provider/queue.cc", - "../ash/file_system_provider/queue.h", - "../ash/file_system_provider/registry.cc", - "../ash/file_system_provider/registry.h", - "../ash/file_system_provider/registry_interface.cc", - "../ash/file_system_provider/registry_interface.h", - "../ash/file_system_provider/request_manager.cc", - "../ash/file_system_provider/request_manager.h", - "../ash/file_system_provider/request_value.cc", - "../ash/file_system_provider/request_value.h", - "../ash/file_system_provider/scoped_file_opener.cc", - "../ash/file_system_provider/scoped_file_opener.h", - "../ash/file_system_provider/service.cc", - "../ash/file_system_provider/service.h", - "../ash/file_system_provider/service_factory.cc", - "../ash/file_system_provider/service_factory.h", - "../ash/file_system_provider/throttled_file_system.cc", - "../ash/file_system_provider/throttled_file_system.h", - "../ash/file_system_provider/watcher.cc", - "../ash/file_system_provider/watcher.h", - "../ash/first_run/first_run.cc", - "../ash/first_run/first_run.h", - "../ash/floating_workspace/floating_workspace_service.cc", - "../ash/floating_workspace/floating_workspace_service.h", - "../ash/floating_workspace/floating_workspace_service_factory.cc", - "../ash/floating_workspace/floating_workspace_service_factory.h", - "../ash/floating_workspace/floating_workspace_util.cc", - "../ash/floating_workspace/floating_workspace_util.h", - "../ash/fusebox/fusebox_util.cc", - "../ash/fusebox/fusebox_util.h", "../ash/guest_os/guest_os_capabilities.cc", "../ash/guest_os/guest_os_capabilities.h", "../ash/guest_os/guest_os_diagnostics_builder.cc", @@ -887,6 +621,8 @@ "../ash/guest_os/public/guest_os_service_factory.h", "../ash/guest_os/public/guest_os_wayland_server.cc", "../ash/guest_os/public/guest_os_wayland_server.h", + "../ash/guest_os/public/installer_delegate_factory.cc", + "../ash/guest_os/public/installer_delegate_factory.h", "../ash/guest_os/public/types.h", "../ash/guest_os/virtual_machines/virtual_machines_util.cc", "../ash/guest_os/virtual_machines/virtual_machines_util.h",
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/BUILD.gn b/chrome/browser/chromeos/extensions/telemetry/api/BUILD.gn index 52bbac4..fda821c 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/BUILD.gn +++ b/chrome/browser/chromeos/extensions/telemetry/api/BUILD.gn
@@ -37,6 +37,8 @@ "//chrome/browser/ui", "//chrome/common/chromeos/extensions", "//chrome/common/chromeos/extensions/api", + "//components/security_state/content", + "//components/security_state/core", "//components/user_manager", "//content/public/browser", "//extensions/browser", @@ -86,10 +88,13 @@ "//chromeos/services/cros_healthd/public/cpp", "//chromeos/services/cros_healthd/public/mojom", "//components/user_manager", + "//content/test:test_support", "//extensions:test_support", "//extensions/browser", "//extensions/browser:test_support", "//extensions/common", + "//net", + "//net:test_support", "//url", ] }
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/api_guard_delegate.cc b/chrome/browser/chromeos/extensions/telemetry/api/api_guard_delegate.cc index af387f2..41e0ff24 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/api_guard_delegate.cc +++ b/chrome/browser/chromeos/extensions/telemetry/api/api_guard_delegate.cc
@@ -17,6 +17,8 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chromeos/extensions/chromeos_system_extension_info.h" +#include "components/security_state/content/content_utils.h" +#include "components/security_state/core/security_state.h" #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" #include "content/public/browser/web_contents.h" @@ -70,8 +72,8 @@ return; } - if (!IsPwaUiOpen(context, extension)) { - std::move(callback).Run("Companion PWA UI is not open"); + if (!IsPwaUiOpenAndSecure(context, extension)) { + std::move(callback).Run("Companion PWA UI is not open or not secure"); return; } @@ -97,8 +99,8 @@ return user_manager::UserManager::Get()->IsCurrentUserOwner(); } - bool IsPwaUiOpen(content::BrowserContext* context, - const extensions::Extension* extension) { + bool IsPwaUiOpenAndSecure(content::BrowserContext* context, + const extensions::Extension* extension) { Profile* profile = Profile::FromBrowserContext(context); const auto* externally_connectable_info = @@ -116,7 +118,13 @@ target_tab_strip->GetWebContentsAt(i); if (externally_connectable_info->matches.MatchesURL( target_contents->GetLastCommittedURL())) { - return true; + // Ensure the PWA URL connection is secure (e.g. valid certificate). + const auto visible_security_state = + security_state::GetVisibleSecurityState(target_contents); + return security_state::GetSecurityLevel( + *visible_security_state, + /*used_policy_installed_certificate=*/false) == + security_state::SecurityLevel::SECURE; } } }
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/api_guard_delegate_unittest.cc b/chrome/browser/chromeos/extensions/telemetry/api/api_guard_delegate_unittest.cc index 272c9d8..2b527516c 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/api_guard_delegate_unittest.cc +++ b/chrome/browser/chromeos/extensions/telemetry/api/api_guard_delegate_unittest.cc
@@ -16,9 +16,16 @@ #include "components/sync_preferences/testing_pref_service_syncable.h" #include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/user.h" +#include "content/public/browser/navigation_entry.h" +#include "content/public/browser/ssl_status.h" #include "extensions/common/extension.h" #include "extensions/common/extension_builder.h" #include "extensions/common/extension_urls.h" +#include "net/base/net_errors.h" +#include "net/cert/cert_status_flags.h" +#include "net/cert/x509_certificate.h" +#include "net/test/cert_test_util.h" +#include "net/test/test_data_directory.h" #include "testing/gtest/include/gtest/gtest.h" namespace chromeos { @@ -41,7 +48,7 @@ const std::vector<ExtensionInfoTestParams> kAllExtensionInfoTestParams{ ExtensionInfoTestParams( /*extension_id=*/"gogonhoemckpdpadfnjnpgbjpbjnodgc", - /*pwa_page_url=*/"http://www.google.com", + /*pwa_page_url=*/"https://www.google.com", /*matches_origin=*/"*://www.google.com/*"), ExtensionInfoTestParams( /*extension_id=*/"alnedpmllcfpgldkagbfbjkloonjlfjb", @@ -120,6 +127,24 @@ hardware_info_delegate_factory_.get()); } + void OpenPwaUrlAndSetCertificateWithStatus(net::CertStatus cert_status) { + const base::FilePath certs_dir = net::GetTestCertsDirectory(); + scoped_refptr<net::X509Certificate> test_cert( + net::ImportCertFromFile(certs_dir, "ok_cert.pem")); + ASSERT_TRUE(test_cert); + + // Open the PWA page url and set valid certificate to bypass the + // IsPwaUiOpenAndSecure() check. + AddTab(browser(), GURL(pwa_page_url())); + + // AddTab() adds a new tab at index 0. + auto* web_contents = browser()->tab_strip_model()->GetWebContentsAt(0); + auto* entry = web_contents->GetController().GetVisibleEntry(); + content::SSLStatus& ssl = entry->GetSSL(); + ssl.certificate = test_cert; + ssl.cert_status = cert_status; + } + private: void CreateExtension() { extension_ = @@ -166,12 +191,24 @@ future.GetCallback()); ASSERT_TRUE(future.Wait()); - EXPECT_EQ("Companion PWA UI is not open", future.Get()); + EXPECT_EQ("Companion PWA UI is not open or not secure", future.Get()); +} + +TEST_P(ApiGuardDelegateTest, PwaIsOpenButNotSecure) { + OpenPwaUrlAndSetCertificateWithStatus( + /*cert_status=*/net::CERT_STATUS_INVALID); + + auto api_guard_delegate = ApiGuardDelegate::Factory::Create(); + base::test::TestFuture<std::string> future; + api_guard_delegate->CanAccessApi(profile(), extension(), + future.GetCallback()); + + ASSERT_TRUE(future.Wait()); + EXPECT_EQ("Companion PWA UI is not open or not secure", future.Get()); } TEST_P(ApiGuardDelegateTest, ManufacturerNotAllowed) { - // Open the PWA page url to bypass IsPwaUiOpen() check. - AddTab(browser(), GURL(pwa_page_url())); + OpenPwaUrlAndSetCertificateWithStatus(/*cert_status=*/net::OK); // Make sure device manufacturer is not allowed. SetDeviceManufacturer("GOOGLE"); @@ -187,8 +224,7 @@ } TEST_P(ApiGuardDelegateTest, NoError) { - // Open the PWA page url to bypass IsPwaUiOpen() check. - AddTab(browser(), GURL(pwa_page_url())); + OpenPwaUrlAndSetCertificateWithStatus(/*cert_status=*/net::OK); auto api_guard_delegate = ApiGuardDelegate::Factory::Create(); base::test::TestFuture<std::string> future; @@ -246,7 +282,30 @@ future.GetCallback()); ASSERT_TRUE(future.Wait()); - EXPECT_EQ("Companion PWA UI is not open", future.Get()); + EXPECT_EQ("Companion PWA UI is not open or not secure", future.Get()); +} + +TEST_P(ApiGuardDelegateAffiliatedUserTest, PwaIsOpenButNotSecure) { + { + extensions::ExtensionManagementPrefUpdater< + sync_preferences::TestingPrefServiceSyncable> + updater(profile()->GetTestingPrefService()); + // Make sure the extension is marked as force-installed. + updater.SetIndividualExtensionAutoInstalled( + extension_id(), extension_urls::kChromeWebstoreUpdateURL, + /*forced=*/true); + } + + OpenPwaUrlAndSetCertificateWithStatus( + /*cert_status=*/net::CERT_STATUS_INVALID); + + auto api_guard_delegate = ApiGuardDelegate::Factory::Create(); + base::test::TestFuture<std::string> future; + api_guard_delegate->CanAccessApi(profile(), extension(), + future.GetCallback()); + + ASSERT_TRUE(future.Wait()); + EXPECT_EQ("Companion PWA UI is not open or not secure", future.Get()); } TEST_P(ApiGuardDelegateAffiliatedUserTest, ManufacturerNotAllowed) { @@ -260,8 +319,7 @@ /*forced=*/true); } - // Open the PWA page url to bypass IsPwaUiOpen() check. - AddTab(browser(), GURL(pwa_page_url())); + OpenPwaUrlAndSetCertificateWithStatus(/*cert_status=*/net::OK); // Make sure device manufacturer is not allowed. SetDeviceManufacturer("GOOGLE"); @@ -287,8 +345,7 @@ /*forced=*/true); } - // Open the PWA page url to bypass IsPwaUiOpen() check. - AddTab(browser(), GURL(pwa_page_url())); + OpenPwaUrlAndSetCertificateWithStatus(/*cert_status=*/net::OK); auto api_guard_delegate = ApiGuardDelegate::Factory::Create(); base::test::TestFuture<std::string> future;
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_api_guard_function_browsertest.cc b/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_api_guard_function_browsertest.cc index 3c4e74e..846f8cc 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_api_guard_function_browsertest.cc +++ b/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_api_guard_function_browsertest.cc
@@ -17,7 +17,11 @@ #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" #include "content/public/test/browser_test.h" +#include "content/public/test/content_mock_cert_verifier.h" +#include "net/base/net_errors.h" +#include "net/cert/x509_certificate.h" #include "net/dns/mock_host_resolver.h" +#include "net/test/embedded_test_server/embedded_test_server.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -294,7 +298,9 @@ : public BaseTelemetryExtensionBrowserTest { public: TelemetryExtensionApiGuardRealDelegateBrowserTest() - : fake_hardware_info_delegate_factory_("HP") { + : fake_hardware_info_delegate_factory_("HP"), + https_server_(net::EmbeddedTestServer::TYPE_HTTPS) { + https_server_.ServeFilesFromSourceDirectory(GetChromeTestDataDir()); // Make sure device manufacturer is allowlisted. HardwareInfoDelegate::Factory::SetForTesting( &fake_hardware_info_delegate_factory_); @@ -307,6 +313,12 @@ const TelemetryExtensionApiGuardRealDelegateBrowserTest&) = delete; // BaseTelemetryExtensionBrowserTest: + void SetUpCommandLine(base::CommandLine* command_line) override { + BaseTelemetryExtensionBrowserTest::SetUpCommandLine(command_line); + + mock_cert_verifier_.SetUpCommandLine(command_line); + } + void SetUpOnMainThread() override { // Skip BaseTelemetryExtensionBrowserTest::SetUpOnMainThread() as it sets up // a FakeApiGuardDelegate instance. @@ -316,6 +328,8 @@ user_manager_enabler_ = std::make_unique<user_manager::ScopedUserManager>( std::make_unique<ash::FakeChromeUserManager>()); + ASSERT_TRUE(https_server_.Start()); + // This is needed when navigating to a network URL (e.g. // ui_test_utils::NavigateToURL). Rules can only be added before // BrowserTestBase::InitializeNetworkProcess() is called because host @@ -334,14 +348,42 @@ BaseTelemetryExtensionBrowserTest::TearDownOnMainThread(); } + void SetUpInProcessBrowserTestFixture() override { + BaseTelemetryExtensionBrowserTest::SetUpInProcessBrowserTestFixture(); + + mock_cert_verifier_.SetUpInProcessBrowserTestFixture(); + } + + void TearDownInProcessBrowserTestFixture() override { + mock_cert_verifier_.TearDownInProcessBrowserTestFixture(); + + BaseTelemetryExtensionBrowserTest::TearDownInProcessBrowserTestFixture(); + } + + content::ContentMockCertVerifier::CertVerifier* mock_cert_verifier() { + return mock_cert_verifier_.mock_cert_verifier(); + } + + void SetUpMockCertVerifierForHttpsServer() { + mock_cert_verifier()->set_default_result(net::OK); + } + protected: ash::FakeChromeUserManager* GetFakeUserManager() const { return static_cast<ash::FakeChromeUserManager*>( user_manager::UserManager::Get()); } + GURL GetPwaGURL() const { return https_server_.GetURL("/ssl/google.html"); } + + // BaseTelemetryExtensionBrowserTest: + std::string pwa_page_url() const override { return GetPwaGURL().spec(); } + std::string matches_origin() const override { return GetPwaGURL().spec(); } + FakeHardwareInfoDelegate::Factory fake_hardware_info_delegate_factory_; std::unique_ptr<user_manager::ScopedUserManager> user_manager_enabler_; + net::EmbeddedTestServer https_server_; + content::ContentMockCertVerifier mock_cert_verifier_; }; // Smoke test to verify that real ApiGuardDelegate works in prod. @@ -355,7 +397,13 @@ user_manager->SwitchActiveUser(account_id); user_manager->SetOwnerId(account_id); - // Make sure PWA UI is open. + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + chromeos::switches::kTelemetryExtensionPwaOriginOverrideForTesting, + pwa_page_url()); + + SetUpMockCertVerifierForHttpsServer(); + + // Make sure PWA UI is open and secure. auto* pwa_page_rfh = ui_test_utils::NavigateToURL(browser(), GURL(pwa_page_url())); ASSERT_TRUE(pwa_page_rfh);
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.h b/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.h index cd98568..395a81c 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.h +++ b/chrome/browser/chromeos/extensions/telemetry/api/base_telemetry_extension_browser_test.h
@@ -30,8 +30,8 @@ protected: std::string extension_id() const; std::string public_key() const; - std::string pwa_page_url() const; - std::string matches_origin() const; + virtual std::string pwa_page_url() const; + virtual std::string matches_origin() const; void CreateExtensionAndRunServiceWorker( const std::string& service_worker_content); virtual std::string GetManifestFile(const std::string& matches_origin);
diff --git a/chrome/browser/chromeos/extensions/telemetry/api/telemetry_extension_capabilities_browser_test.cc b/chrome/browser/chromeos/extensions/telemetry/api/telemetry_extension_capabilities_browser_test.cc index a238761..a1ace85 100644 --- a/chrome/browser/chromeos/extensions/telemetry/api/telemetry_extension_capabilities_browser_test.cc +++ b/chrome/browser/chromeos/extensions/telemetry/api/telemetry_extension_capabilities_browser_test.cc
@@ -174,7 +174,7 @@ const auto extension_info = GetChromeOSExtensionInfoForId(extension_id()); EXPECT_EQ(kPwaOriginOverride, extension_info.pwa_origin); - // Open the PWA page url to bypass IsPwaUiOpen() check. + // Open the PWA page url to bypass IsPwaUiOpenAndSecure() check. ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), GURL(kPwaPageUrl))); // Start listening on the extension.
diff --git a/chrome/browser/component_updater/pki_metadata_component_installer_browsertest.cc b/chrome/browser/component_updater/pki_metadata_component_installer_browsertest.cc index 5bb941e9..15a2456 100644 --- a/chrome/browser/component_updater/pki_metadata_component_installer_browsertest.cc +++ b/chrome/browser/component_updater/pki_metadata_component_installer_browsertest.cc
@@ -7,6 +7,7 @@ #include "base/callback_forward.h" #include "base/command_line.h" +#include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/component_updater/pki_metadata_component_installer.h" @@ -207,7 +208,7 @@ private: base::RunLoop run_loop_; - PKIMetadataComponentChromeRootStoreUpdateTest* test_; + raw_ptr<PKIMetadataComponentChromeRootStoreUpdateTest> test_; }; protected:
diff --git a/chrome/browser/dips/dips_bounce_detector_browsertest.cc b/chrome/browser/dips/dips_bounce_detector_browsertest.cc index 408e117..ea291547 100644 --- a/chrome/browser/dips/dips_bounce_detector_browsertest.cc +++ b/chrome/browser/dips/dips_bounce_detector_browsertest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/dips/dips_bounce_detector.h" #include "base/files/file_path.h" +#include "base/memory/raw_ptr.h" #include "base/strings/escape.h" #include "base/strings/strcat.h" #include "base/strings/stringprintf.h" @@ -108,7 +109,7 @@ DIPSBounceDetector* bounce_detector() { return bounce_detector_; } private: - DIPSBounceDetector* bounce_detector_ = nullptr; + raw_ptr<DIPSBounceDetector> bounce_detector_ = nullptr; }; // The timing of WCO::OnCookiesAccessed() execution is unpredictable for
diff --git a/chrome/browser/dips/dips_helper_browsertest.cc b/chrome/browser/dips/dips_helper_browsertest.cc index 36e86f8..0011ab9f 100644 --- a/chrome/browser/dips/dips_helper_browsertest.cc +++ b/chrome/browser/dips/dips_helper_browsertest.cc
@@ -60,7 +60,7 @@ } private: - content::RenderFrameHost* const render_frame_host_; + const raw_ptr<content::RenderFrameHost> render_frame_host_; base::RunLoop run_loop_; }; @@ -106,7 +106,7 @@ private: base::SimpleTestClock test_clock_; - DIPSTabHelper* helper_ = nullptr; + raw_ptr<DIPSTabHelper> helper_ = nullptr; }; IN_PROC_BROWSER_TEST_F(DIPSTabHelperBrowserTest,
diff --git a/chrome/browser/download/bubble/download_bubble_controller_unittest.cc b/chrome/browser/download/bubble/download_bubble_controller_unittest.cc index c9ccab39..bd19654c 100644 --- a/chrome/browser/download/bubble/download_bubble_controller_unittest.cc +++ b/chrome/browser/download/bubble/download_bubble_controller_unittest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/download/bubble/download_bubble_controller.h" #include "base/command_line.h" +#include "base/memory/raw_ptr.h" #include "chrome/browser/download/bubble/download_display.h" #include "chrome/browser/download/bubble/download_display_controller.h" #include "chrome/browser/download/bubble/download_icon_state.h" @@ -86,7 +87,8 @@ profile_ = testing_profile_manager_.CreateTestingProfile("testing_profile"); auto manager = std::make_unique<NiceMock<content::MockDownloadManager>>(); manager_ = manager.get(); - EXPECT_CALL(*manager, GetBrowserContext()).WillRepeatedly(Return(profile_)); + EXPECT_CALL(*manager, GetBrowserContext()) + .WillRepeatedly(Return(profile_.get())); EXPECT_CALL(*manager, RemoveObserver(_)).WillRepeatedly(Return()); profile_->SetDownloadManagerForTesting(std::move(manager)); @@ -224,14 +226,14 @@ std::unique_ptr<NiceMock<MockDownloadDisplayController>> display_controller_; std::vector<std::unique_ptr<StrictMockDownloadItem>> items_; OfflineItemList offline_items_; - NiceMock<content::MockDownloadManager>* manager_; + raw_ptr<NiceMock<content::MockDownloadManager>> manager_; TestingProfileManager testing_profile_manager_; std::unique_ptr< NiceMock<offline_items_collection::MockOfflineContentProvider>> content_provider_; std::unique_ptr<TestBrowserWindow> window_; std::unique_ptr<Browser> browser_; - TestingProfile* profile_; + raw_ptr<TestingProfile> profile_; }; TEST_F(DownloadBubbleUIControllerTest, ProcessesNewItems) { @@ -398,7 +400,7 @@ protected: std::unique_ptr<TestBrowserWindow> incognito_window_; std::unique_ptr<Browser> incognito_browser_; - TestingProfile* incognito_profile_; + raw_ptr<TestingProfile> incognito_profile_; std::unique_ptr<DownloadBubbleUIController> incognito_controller_; std::unique_ptr<NiceMock<MockDownloadDisplayController>> incognito_display_controller_;
diff --git a/chrome/browser/download/bubble/download_bubble_prefs_unittest.cc b/chrome/browser/download/bubble/download_bubble_prefs_unittest.cc index 2e88212..4f2c0a8 100644 --- a/chrome/browser/download/bubble/download_bubble_prefs_unittest.cc +++ b/chrome/browser/download/bubble/download_bubble_prefs_unittest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/download/bubble/download_bubble_prefs.h" #include "base/json/json_reader.h" +#include "base/memory/raw_ptr.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/enterprise/connectors/common.h" #include "chrome/browser/safe_browsing/advanced_protection_status_manager.h" @@ -50,7 +51,7 @@ } protected: - TestingProfile* profile_; + raw_ptr<TestingProfile> profile_; base::test::ScopedFeatureList feature_list_; private:
diff --git a/chrome/browser/download/bubble/download_display_controller_unittest.cc b/chrome/browser/download/bubble/download_display_controller_unittest.cc index ac366d2..643804c2 100644 --- a/chrome/browser/download/bubble/download_display_controller_unittest.cc +++ b/chrome/browser/download/bubble/download_display_controller_unittest.cc
@@ -6,6 +6,7 @@ #include "base/command_line.h" #include "base/files/file_path.h" +#include "base/memory/raw_ptr.h" #include "chrome/browser/download/bubble/download_bubble_controller.h" #include "chrome/browser/download/bubble/download_display.h" #include "chrome/browser/download/bubble/download_icon_state.h" @@ -122,7 +123,7 @@ profile_ = testing_profile_manager_.CreateTestingProfile("testing_profile"); EXPECT_CALL(*manager_.get(), GetBrowserContext()) - .WillRepeatedly(Return(profile_)); + .WillRepeatedly(Return(profile_.get())); // Set test delegate to get the corresponding download prefs. auto delegate = std::make_unique<ChromeDownloadManagerDelegate>(profile_); @@ -308,7 +309,7 @@ std::unique_ptr<NiceMock<content::MockDownloadManager>> manager_; std::unique_ptr<FakeDownloadBubbleUIController> bubble_controller_; TestingProfileManager testing_profile_manager_; - Profile* profile_; + raw_ptr<Profile> profile_; std::unique_ptr<TestBrowserWindow> window_; std::unique_ptr<Browser> browser_; };
diff --git a/chrome/browser/download/download_ui_model.h b/chrome/browser/download/download_ui_model.h index 37ffc40..48421a20 100644 --- a/chrome/browser/download/download_ui_model.h +++ b/chrome/browser/download/download_ui_model.h
@@ -10,6 +10,7 @@ #include <string> #include "base/files/file_path.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/task/sequenced_task_runner.h" @@ -102,7 +103,7 @@ ui::ColorId secondary_color = ui::kColorSecondaryForeground; // Override icon - const gfx::VectorIcon* icon_model_override = nullptr; + raw_ptr<const gfx::VectorIcon> icon_model_override = nullptr; // Subpage summary of the download warning bool has_subpage = false; @@ -479,7 +480,7 @@ void set_status_text_builder_for_testing(bool for_bubble); // Unowned Clock to override the time of "Now". - base::Clock* clock_ = base::DefaultClock::GetInstance(); + raw_ptr<base::Clock> clock_ = base::DefaultClock::GetInstance(); std::unique_ptr<StatusTextBuilderBase> status_text_builder_;
diff --git a/chrome/browser/enterprise/browser_management/management_service_browsertest.cc b/chrome/browser/enterprise/browser_management/management_service_browsertest.cc index 88c5170..d85e66ff 100644 --- a/chrome/browser/enterprise/browser_management/management_service_browsertest.cc +++ b/chrome/browser/enterprise/browser_management/management_service_browsertest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/memory/raw_ptr.h" #include "base/test/metrics/histogram_tester.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/browser_management/management_service_factory.h" @@ -77,7 +78,7 @@ protected: base::HistogramTester histogram_tester_; - TestPlatformManagementStatusProvider* platform_status_provider_; + raw_ptr<TestPlatformManagementStatusProvider> platform_status_provider_; }; IN_PROC_BROWSER_TEST_F(ManagementServiceBrowserTest,
diff --git a/chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.h b/chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.h index 28fe5e7..a29c8d6 100644 --- a/chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.h +++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.h
@@ -312,7 +312,7 @@ // `DownloadItem` for dialogs corresponding to a download with a reviewable // verdict. nullptr otherwise. - download::DownloadItem* download_item_ = nullptr; + raw_ptr<download::DownloadItem> download_item_ = nullptr; // Set to true once the dialog is either accepted or cancelled by the user. // This is used to decide whether the dialog should go away without user input
diff --git a/chrome/browser/enterprise/connectors/analysis/content_analysis_downloads_delegate.h b/chrome/browser/enterprise/connectors/analysis/content_analysis_downloads_delegate.h index 4a42439..736dd15d 100644 --- a/chrome/browser/enterprise/connectors/analysis/content_analysis_downloads_delegate.h +++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_downloads_delegate.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_ENTERPRISE_CONNECTORS_ANALYSIS_CONTENT_ANALYSIS_DOWNLOADS_DELEGATE_H_ #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_base.h" namespace download { @@ -59,7 +60,7 @@ bool bypass_justification_required_; base::OnceCallback<void()> open_file_callback_; base::OnceCallback<void()> discard_file_callback_; - download::DownloadItem* download_item_; + raw_ptr<download::DownloadItem> download_item_; }; } // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/reporting/report_scheduler_browsertest.cc b/chrome/browser/enterprise/reporting/report_scheduler_browsertest.cc index 9308b4de..b51e50f5 100644 --- a/chrome/browser/enterprise/reporting/report_scheduler_browsertest.cc +++ b/chrome/browser/enterprise/reporting/report_scheduler_browsertest.cc
@@ -100,7 +100,7 @@ base::test::ScopedFeatureList scoped_feature_list_; policy::FakeBrowserDMTokenStorage storage_; std::unique_ptr<base::RunLoop> run_loop_; - ReportScheduler* report_scheduler_; + raw_ptr<ReportScheduler> report_scheduler_; bool has_cloud_reporting_launched = false; };
diff --git a/chrome/browser/extensions/api/debugger/debugger_apitest.cc b/chrome/browser/extensions/api/debugger/debugger_apitest.cc index 653f90b..b629239 100644 --- a/chrome/browser/extensions/api/debugger/debugger_apitest.cc +++ b/chrome/browser/extensions/api/debugger/debugger_apitest.cc
@@ -507,9 +507,9 @@ DebuggerApiTest::TearDownOnMainThread(); } - ProfileManager* profile_manager_ = nullptr; - Profile* other_profile_ = nullptr; - Profile* otr_profile_ = nullptr; + raw_ptr<ProfileManager> profile_manager_ = nullptr; + raw_ptr<Profile> other_profile_ = nullptr; + raw_ptr<Profile> otr_profile_ = nullptr; }; IN_PROC_BROWSER_TEST_F(CrossProfileDebuggerApiTest, GetTargets) {
diff --git a/chrome/browser/extensions/api/search/search_api_unittest.cc b/chrome/browser/extensions/api/search/search_api_unittest.cc index baeaee9..3e69925 100644 --- a/chrome/browser/extensions/api/search/search_api_unittest.cc +++ b/chrome/browser/extensions/api/search/search_api_unittest.cc
@@ -15,8 +15,6 @@ #include "content/public/test/web_contents_tester.h" #include "extensions/browser/api_test_utils.h" #include "extensions/common/extension_builder.h" -#include "ui/display/test/scoped_screen_override.h" -#include "ui/display/test/test_screen.h" namespace extensions { @@ -74,8 +72,6 @@ std::unique_ptr<TestBrowserWindow> browser_window_; std::unique_ptr<Browser> browser_; - display::test::TestScreen test_screen_; - std::unique_ptr<display::test::ScopedScreenOverride> scoped_screen_override_; scoped_refptr<extensions::SearchQueryFunction> function_; }; @@ -91,8 +87,6 @@ params.type = Browser::TYPE_NORMAL; params.window = browser_window_.get(); browser_ = std::unique_ptr<Browser>(Browser::Create(params)); - scoped_screen_override_ = - std::make_unique<display::test::ScopedScreenOverride>(&test_screen_); // Mock TemplateURLService. auto* template_url_service = static_cast<TemplateURLService*>(
diff --git a/chrome/browser/extensions/api/system_display/system_display_extension_apitest.cc b/chrome/browser/extensions/api/system_display/system_display_extension_apitest.cc index a42a5749..837d0bd 100644 --- a/chrome/browser/extensions/api/system_display/system_display_extension_apitest.cc +++ b/chrome/browser/extensions/api/system_display/system_display_extension_apitest.cc
@@ -15,16 +15,11 @@ #include "extensions/browser/api/system_display/system_display_api.h" #include "extensions/browser/api_test_utils.h" #include "extensions/browser/mock_display_info_provider.h" -#include "extensions/browser/mock_screen.h" #include "extensions/common/api/system_display.h" #include "ui/display/display.h" -#include "ui/display/screen.h" -#include "ui/display/test/scoped_screen_override.h" namespace extensions { -using display::Screen; -using display::test::ScopedScreenOverride; using ContextType = ExtensionBrowserTest::ContextType; class SystemDisplayExtensionApiTest @@ -39,27 +34,19 @@ void SetUpOnMainThread() override { ExtensionApiTest::SetUpOnMainThread(); - ANNOTATE_LEAKING_OBJECT_PTR(Screen::GetScreen()); - scoped_screen_override_ = - std::make_unique<ScopedScreenOverride>(screen_.get()); DisplayInfoProvider::InitializeForTesting(provider_.get()); } void TearDownOnMainThread() override { ExtensionApiTest::TearDownOnMainThread(); - scoped_screen_override_.reset(); } protected: std::unique_ptr<MockDisplayInfoProvider> provider_ = std::make_unique<MockDisplayInfoProvider>(); - - private: - std::unique_ptr<Screen> screen_ = std::make_unique<MockScreen>(); - std::unique_ptr<ScopedScreenOverride> scoped_screen_override_; }; -// TODO(crbug.com/1231357): MockScreen causes random failures on Windows. +// TODO(crbug.com/1231357): Revisit this after screen creation refactoring. #if !BUILDFLAG(IS_WIN) INSTANTIATE_TEST_SUITE_P(PersistentBackground,
diff --git a/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc b/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc index 005577b..7154cba7 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc
@@ -33,8 +33,6 @@ #include "extensions/common/constants.h" #include "extensions/common/extension_builder.h" #include "third_party/abseil-cpp/absl/types/optional.h" -#include "ui/display/test/scoped_screen_override.h" -#include "ui/display/test/test_screen.h" #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/test/ash_test_helper.h" @@ -48,8 +46,6 @@ namespace extensions { -using display::test::ScopedScreenOverride; - namespace { std::unique_ptr<base::ListValue> RunTabsQueryFunction( @@ -127,13 +123,15 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) ash::AshTestHelper test_helper_; -#else - display::test::TestScreen test_screen_; - std::unique_ptr<ScopedScreenOverride> scoped_screen_override_; #endif }; void TabsApiUnitTest::SetUp() { +#if BUILDFLAG(IS_CHROMEOS_ASH) + ash::AshTestHelper::InitParams ash_params; + ash_params.start_session = true; + test_helper_.SetUp(std::move(ash_params)); +#endif // Force TabManager/TabLifecycleUnitSource creation. g_browser_process->GetTabManager(); @@ -145,14 +143,6 @@ params.type = Browser::TYPE_NORMAL; params.window = browser_window_.get(); browser_.reset(Browser::Create(params)); -#if BUILDFLAG(IS_CHROMEOS_ASH) - ash::AshTestHelper::InitParams ash_params; - ash_params.start_session = true; - test_helper_.SetUp(std::move(ash_params)); -#else - scoped_screen_override_ = - std::make_unique<ScopedScreenOverride>(&test_screen_); -#endif } void TabsApiUnitTest::TearDown() {
diff --git a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc index de3f198..e7409cc 100644 --- a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc +++ b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
@@ -577,8 +577,8 @@ "borderedkey", base::FeatureList::IsEnabled( chromeos::features::kVirtualKeyboardBorderedKey))); features.Append(GenerateFeatureFlag( - "multitouch", base::FeatureList::IsEnabled( - chromeos::features::kVirtualKeyboardMultitouch))); + "multitouch", + base::FeatureList::IsEnabled(features::kVirtualKeyboardMultitouch))); features.Append(GenerateFeatureFlag( "roundCorners", base::FeatureList::IsEnabled( chromeos::features::kVirtualKeyboardRoundCorners)));
diff --git a/chrome/browser/extensions/api/web_authentication_proxy/web_authentication_proxy_api.h b/chrome/browser/extensions/api/web_authentication_proxy/web_authentication_proxy_api.h index 63af254..f76b0fe3f 100644 --- a/chrome/browser/extensions/api/web_authentication_proxy/web_authentication_proxy_api.h +++ b/chrome/browser/extensions/api/web_authentication_proxy/web_authentication_proxy_api.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_AUTHENTICATION_PROXY_WEB_AUTHENTICATION_PROXY_API_H_ #define CHROME_BROWSER_EXTENSIONS_API_WEB_AUTHENTICATION_PROXY_WEB_AUTHENTICATION_PROXY_API_H_ +#include "base/memory/raw_ptr.h" #include "chrome/browser/extensions/api/web_authentication_proxy/remote_session_state_change.h" #include "extensions/browser/browser_context_keyed_api_factory.h" #include "extensions/browser/event_router.h" @@ -38,7 +39,7 @@ void OnListenerAdded(const EventListenerInfo& details) override; void OnListenerRemoved(const EventListenerInfo& details) override; - content::BrowserContext* const context_; + const raw_ptr<content::BrowserContext> context_; std::map<ExtensionId, WebAuthenticationProxyRemoteSessionStateChangeNotifier> session_state_change_notifiers_; };
diff --git a/chrome/browser/extensions/dynamic_origin_browsertest.cc b/chrome/browser/extensions/dynamic_origin_browsertest.cc index 43c432e8..6c34565 100644 --- a/chrome/browser/extensions/dynamic_origin_browsertest.cc +++ b/chrome/browser/extensions/dynamic_origin_browsertest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/memory/raw_ptr.h" #include "chrome/browser/extensions/chrome_test_extension_loader.h" #include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/test/base/ui_test_utils.h" @@ -61,7 +62,7 @@ DCHECK(extension_); } - const Extension* extension_ = nullptr; + raw_ptr<const Extension> extension_ = nullptr; TestExtensionDir dir_; base::test::ScopedFeatureList feature_list_; ScopedCurrentChannel current_channel_{version_info::Channel::CANARY};
diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc index 081473d..15ba00df 100644 --- a/chrome/browser/extensions/updater/extension_updater_unittest.cc +++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc
@@ -662,12 +662,14 @@ } const DownloadFailure* GetFailureWithId( - const std::vector<DownloadFailure>& failures, + const std::vector<std::pair<ExtensionDownloaderTask, DownloadFailure>>& + failures, const ExtensionId& id) { auto it = std::find_if( failures.begin(), failures.end(), - [&](const DownloadFailure& failure) { return failure.id == id; }); - return it == failures.end() ? nullptr : &*it; + [&](const std::pair<ExtensionDownloaderTask, DownloadFailure>& + failure) { return failure.first.id == id; }); + return it == failures.end() ? nullptr : &it->second; } void TestExtensionUpdateCheckRequests(bool pending) { @@ -922,8 +924,9 @@ // Check passing an empty list of parse results to DetermineUpdates UpdateManifestResults updates; - std::vector<UpdateManifestResult*> updateable; - std::vector<DownloadFailure> failures; + std::vector<std::pair<ExtensionDownloaderTask, UpdateManifestResult*>> + updateable; + std::vector<std::pair<ExtensionDownloaderTask, DownloadFailure>> failures; helper.downloader().DetermineUpdates(fetch_data->TakeAssociatedTasks(), updates, &updateable, &failures); EXPECT_TRUE(updateable.empty()); @@ -953,11 +956,11 @@ helper.downloader().DetermineUpdates(fetch_data->TakeAssociatedTasks(), updates, &updateable, &failures); ASSERT_EQ(1u, failures.size()); - EXPECT_EQ(id2, failures[0].id); + EXPECT_EQ(id2, failures[0].first.id); EXPECT_EQ(ExtensionDownloaderDelegate::Error::NO_UPDATE_AVAILABLE, - failures[0].error); + failures[0].second.error); ASSERT_EQ(1u, updateable.size()); - EXPECT_EQ("1.1", updateable[0]->version); + EXPECT_EQ("1.1", updateable[0].second->version); } void TestDetermineUpdatesError() { @@ -1021,8 +1024,9 @@ EXPECT_CALL(delegate, GetExtensionExistingVersion(id6, _)) .WillOnce(DoAll(SetArgPointee<1>("0.0.0.0"), Return(true))); - std::vector<UpdateManifestResult*> updateable; - std::vector<DownloadFailure> failures; + std::vector<std::pair<ExtensionDownloaderTask, UpdateManifestResult*>> + updateable; + std::vector<std::pair<ExtensionDownloaderTask, DownloadFailure>> failures; helper.downloader().DetermineUpdates(fetch_data->TakeAssociatedTasks(), updates, &updateable, &failures); std::vector<ExtensionId> ids_not_updateable({id2, id3}); @@ -1041,7 +1045,7 @@ } EXPECT_EQ(5u, failures.size()); ASSERT_EQ(1u, updateable.size()); - EXPECT_EQ("1.1", updateable[0]->version); + EXPECT_EQ("1.1", updateable[0].second->version); } void TestDetermineUpdatesPending() { @@ -1072,8 +1076,9 @@ // pending. EXPECT_CALL(delegate, IsExtensionPending(_)).WillRepeatedly(Return(true)); - std::vector<UpdateManifestResult*> updateable; - std::vector<DownloadFailure> failures; + std::vector<std::pair<ExtensionDownloaderTask, UpdateManifestResult*>> + updateable; + std::vector<std::pair<ExtensionDownloaderTask, DownloadFailure>> failures; helper.downloader().DetermineUpdates(fetch_data->TakeAssociatedTasks(), updates, &updateable, &failures); // All the apps should be updateable. @@ -1139,8 +1144,9 @@ EXPECT_CALL(delegate, GetExtensionExistingVersion(id6, _)) .WillOnce(DoAll(SetArgPointee<1>("1.6.0.0"), Return(true))); - std::vector<UpdateManifestResult*> updateable; - std::vector<DownloadFailure> failures; + std::vector<std::pair<ExtensionDownloaderTask, UpdateManifestResult*>> + updateable; + std::vector<std::pair<ExtensionDownloaderTask, DownloadFailure>> failures; helper.downloader().DetermineUpdates(fetch_data->TakeAssociatedTasks(), updates, &updateable, &failures); std::vector<ExtensionId> ids_not_updateable({id1, id4}); @@ -1159,8 +1165,8 @@ } EXPECT_EQ(5u, failures.size()); ASSERT_EQ(2u, updateable.size()); - EXPECT_EQ("1.3.1.0", updateable[0]->version); - EXPECT_EQ("1.6.1.0", updateable[1]->version); + EXPECT_EQ("1.3.1.0", updateable[0].second->version); + EXPECT_EQ("1.6.1.0", updateable[1].second->version); } void TestMultipleManifestDownloading() {
diff --git a/chrome/browser/feature_guide/notifications/internal/feature_notification_guide_service_impl.h b/chrome/browser/feature_guide/notifications/internal/feature_notification_guide_service_impl.h index 6b5094cfd..1fffbe9 100644 --- a/chrome/browser/feature_guide/notifications/internal/feature_notification_guide_service_impl.h +++ b/chrome/browser/feature_guide/notifications/internal/feature_notification_guide_service_impl.h
@@ -66,7 +66,7 @@ raw_ptr<feature_engagement::Tracker> tracker_; raw_ptr<segmentation_platform::SegmentationPlatformService> segmentation_platform_service_; - base::Clock* clock_; + raw_ptr<base::Clock> clock_; Config config_; std::set<std::string> scheduled_feature_guids_;
diff --git a/chrome/browser/feed/web_feed_page_information_fetcher.h b/chrome/browser/feed/web_feed_page_information_fetcher.h index be8fd66..28d86a8b 100644 --- a/chrome/browser/feed/web_feed_page_information_fetcher.h +++ b/chrome/browser/feed/web_feed_page_information_fetcher.h
@@ -8,6 +8,7 @@ #include <vector> #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/metrics/histogram_functions.h" #include "components/feed/core/v2/public/types.h" @@ -25,7 +26,7 @@ struct PageInformation { GURL url; // web_contents should be set. - content::WebContents* web_contents = nullptr; + raw_ptr<content::WebContents> web_contents = nullptr; }; // Fetches the canonical URL and RSS URLs for a web page, and then calls
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 9d4bbf2..878d0e1 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -1752,7 +1752,7 @@ { "name": "enable-cros-ime-system-emoji-picker-extension", "owners": [ "hdchuong", "curtismcmullan", "myy", "essential-inputs-team@google.com" ], - "expiry_milestone": 105 + "expiry_milestone": 110 }, { "name": "enable-cros-ime-system-emoji-picker-search-extension",
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java index cf41e1a..6cf7714 100644 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -287,7 +287,7 @@ "ContextMenuTranslateWithGoogleLens"; public static final String LENS_CAMERA_ASSISTED_SEARCH = "LensCameraAssistedSearch"; public static final String CONTEXTUAL_PAGE_ACTIONS_PRICE_TRACKING = - "ContextualPageActionsPriceTracking"; + "ContextualPageActionsWithPriceTracking"; /** Used only in native code. */ public static final String CONTEXTUAL_SEARCH_DEBUG = "ContextualSearchDebug"; public static final String CONTEXTUAL_SEARCH_DELAYED_INTELLIGENCE =
diff --git a/chrome/browser/font_prewarmer_tab_helper.cc b/chrome/browser/font_prewarmer_tab_helper.cc index 5209b29..2703769 100644 --- a/chrome/browser/font_prewarmer_tab_helper.cc +++ b/chrome/browser/font_prewarmer_tab_helper.cc
@@ -7,6 +7,7 @@ #include <set> #include <string> +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/values.h" #include "build/build_config.h" @@ -160,7 +161,7 @@ prewarmed_hosts_.erase(host); } - Profile* profile_; + raw_ptr<Profile> profile_; // Set of hosts that were requested to be prewarmed. std::set<content::RenderProcessHost*> prewarmed_hosts_; base::WeakPtrFactory<FontPrewarmerCoordinator> weak_factory_{this};
diff --git a/chrome/browser/hid/hid_chooser_context_unittest.cc b/chrome/browser/hid/hid_chooser_context_unittest.cc index f27d4fd7..134ac5d 100644 --- a/chrome/browser/hid/hid_chooser_context_unittest.cc +++ b/chrome/browser/hid/hid_chooser_context_unittest.cc
@@ -6,6 +6,7 @@ #include "base/barrier_closure.h" #include "base/guid.h" +#include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/scoped_observation.h" #include "base/test/bind.h" @@ -101,8 +102,8 @@ })); run_loop.Run(); - scoped_permission_observation_.Observe(context_); - scoped_device_observation_.Observe(context_); + scoped_permission_observation_.Observe(context_.get()); + scoped_device_observation_.Observe(context_.get()); } void DoTearDown() { @@ -284,13 +285,13 @@ content::BrowserTaskEnvironment task_environment_; base::test::ScopedFeatureList feature_list_; std::unique_ptr<TestingProfileManager> testing_profile_manager_; - TestingProfile* profile_ = nullptr; + raw_ptr<TestingProfile> profile_ = nullptr; #if BUILDFLAG(IS_CHROMEOS_ASH) std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_; #endif - HidChooserContext* context_; + raw_ptr<HidChooserContext> context_; permissions::MockPermissionObserver permission_observer_; base::ScopedObservation< permissions::ObjectPermissionContextBase,
diff --git a/chrome/browser/icon_transcoder/svg_icon_transcoder.h b/chrome/browser/icon_transcoder/svg_icon_transcoder.h index 8c7e59d..3fde025 100644 --- a/chrome/browser/icon_transcoder/svg_icon_transcoder.h +++ b/chrome/browser/icon_transcoder/svg_icon_transcoder.h
@@ -10,6 +10,7 @@ #include <vector> #include "base/files/file_path.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_process_host_observer.h" @@ -88,7 +89,7 @@ const std::vector<SkBitmap>& bitmaps, const std::vector<gfx::Size>& sizes); - Profile* const profile_; + const raw_ptr<Profile> profile_; std::unique_ptr<content::WebContents> web_contents_; bool web_contents_ready_{false}; base::WeakPtrFactory<SvgIconTranscoder> weak_ptr_factory_{this};
diff --git a/chrome/browser/logging_chrome_unittest.cc b/chrome/browser/logging_chrome_unittest.cc index 9df4eb6..4fdb2e55 100644 --- a/chrome/browser/logging_chrome_unittest.cc +++ b/chrome/browser/logging_chrome_unittest.cc
@@ -193,11 +193,6 @@ std::string buffer; base::ReadFileToString(expected_rotated_path, &buffer); EXPECT_EQ(buffer, kLog1Content); - - base::File(expected_rotated_path, - base::File::FLAG_OPEN | base::File::FLAG_READ) - .GetInfo(&file_info); - EXPECT_EQ(creation_time, file_info.creation_time); } } @@ -287,11 +282,6 @@ // The second candidate is the previous latest log. base::ReadFileToString(rotated_log_path, &buffer); EXPECT_EQ(buffer, kLatestLogContent); - - // The second candidate is the previous latest log. - base::File(rotated_log_path, base::File::FLAG_OPEN | base::File::FLAG_READ) - .GetInfo(&file_info); - EXPECT_EQ(creation_time, file_info.creation_time); } }
diff --git a/chrome/browser/mac/chrome_browser_main_extra_parts_mac.h b/chrome/browser/mac/chrome_browser_main_extra_parts_mac.h new file mode 100644 index 0000000..6f2faad --- /dev/null +++ b/chrome/browser/mac/chrome_browser_main_extra_parts_mac.h
@@ -0,0 +1,32 @@ +// 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. + +#ifndef CHROME_BROWSER_MAC_CHROME_BROWSER_MAIN_EXTRA_PARTS_MAC_H_ +#define CHROME_BROWSER_MAC_CHROME_BROWSER_MAIN_EXTRA_PARTS_MAC_H_ + +#include <memory> + +#include "chrome/browser/chrome_browser_main_extra_parts.h" + +namespace display { +class ScopedNativeScreen; +} + +class ChromeBrowserMainExtraPartsMac : public ChromeBrowserMainExtraParts { + public: + ChromeBrowserMainExtraPartsMac(); + ChromeBrowserMainExtraPartsMac(const ChromeBrowserMainExtraPartsMac&) = + delete; + ChromeBrowserMainExtraPartsMac& operator=( + const ChromeBrowserMainExtraPartsMac&) = delete; + ~ChromeBrowserMainExtraPartsMac() override; + + // ChromeBrowserMainExtraParts: + void PreEarlyInitialization() override; + + private: + std::unique_ptr<display::ScopedNativeScreen> screen_; +}; + +#endif // CHROME_BROWSER_MAC_CHROME_BROWSER_MAIN_EXTRA_PARTS_MAC_H_
diff --git a/chrome/browser/mac/chrome_browser_main_extra_parts_mac.mm b/chrome/browser/mac/chrome_browser_main_extra_parts_mac.mm new file mode 100644 index 0000000..3094e1f --- /dev/null +++ b/chrome/browser/mac/chrome_browser_main_extra_parts_mac.mm
@@ -0,0 +1,14 @@ +// 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. + +#include "chrome/browser/mac/chrome_browser_main_extra_parts_mac.h" + +#include "ui/display/screen.h" + +ChromeBrowserMainExtraPartsMac::ChromeBrowserMainExtraPartsMac() = default; +ChromeBrowserMainExtraPartsMac::~ChromeBrowserMainExtraPartsMac() = default; + +void ChromeBrowserMainExtraPartsMac::PreEarlyInitialization() { + screen_ = std::make_unique<display::ScopedNativeScreen>(); +}
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_discovery_interface.h b/chrome/browser/media/router/discovery/access_code/access_code_cast_discovery_interface.h index e74e3b0..7d6570b5 100644 --- a/chrome/browser/media/router/discovery/access_code/access_code_cast_discovery_interface.h +++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_discovery_interface.h
@@ -9,6 +9,7 @@ #include "base/callback.h" #include "base/callback_forward.h" #include "base/command_line.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/media/router/discovery/access_code/discovery_resources.pb.h" #include "chrome/browser/profiles/profile.h" @@ -88,12 +89,12 @@ AddSinkResultCode IsResponseValid( const absl::optional<base::Value>& response); - Profile* const profile_; + const raw_ptr<Profile> profile_; // Access code passed down from the WebUI and used in the construction of the // discovery interface object. const std::string access_code_; - LoggerImpl* const logger_; + const raw_ptr<LoggerImpl> logger_; std::unique_ptr<EndpointFetcher> endpoint_fetcher_;
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_pref_updater.h b/chrome/browser/media/router/discovery/access_code/access_code_cast_pref_updater.h index 2c5f896..d1cac565 100644 --- a/chrome/browser/media/router/discovery/access_code/access_code_cast_pref_updater.h +++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_pref_updater.h
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/memory/raw_ptr.h" #include "chrome/browser/media/router/discovery/access_code/access_code_cast_feature.h" #include "components/media_router/common/discovery/media_sink_internal.h" #include "components/media_router/common/media_sink.h" @@ -70,7 +71,7 @@ base::WeakPtr<AccessCodeCastPrefUpdater> GetWeakPtr(); private: - PrefService* pref_service_; + raw_ptr<PrefService> pref_service_; base::WeakPtrFactory<AccessCodeCastPrefUpdater> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.h b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.h index 8a3135d..11cc5ff 100644 --- a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.h +++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.h
@@ -299,7 +299,7 @@ std::unique_ptr<AccessCodeCastPrefUpdater> pref_updater_; - PrefService* prefs_; + raw_ptr<PrefService> prefs_; // This registrar monitors for user prefs changes. std::unique_ptr<PrefChangeRegistrar> user_prefs_registrar_;
diff --git a/chrome/browser/media/webrtc/region_capture_browsertest.cc b/chrome/browser/media/webrtc/region_capture_browsertest.cc index 1848ba21..0e54671 100644 --- a/chrome/browser/media/webrtc/region_capture_browsertest.cc +++ b/chrome/browser/media/webrtc/region_capture_browsertest.cc
@@ -10,6 +10,7 @@ #include "base/command_line.h" #include "base/files/file_path.h" #include "base/guid.h" +#include "base/memory/raw_ptr.h" #include "base/path_service.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" @@ -146,8 +147,8 @@ return script_result; } - Browser* browser; - WebContents* web_contents; + raw_ptr<Browser> browser; + raw_ptr<WebContents> web_contents; int tab_strip_index; }; @@ -245,7 +246,7 @@ // Manipulation after SetUpCommandLine, but before capture starts, // allows tests to set which tab to capture. - base::CommandLine* command_line_ = nullptr; + raw_ptr<base::CommandLine> command_line_ = nullptr; // Holds the tabs manipulated by this test. TabInfo tabs_[kTabCount];
diff --git a/chrome/browser/media/webrtc/webrtc_desktop_capture_browsertest.cc b/chrome/browser/media/webrtc/webrtc_desktop_capture_browsertest.cc index 84339608..29cd16a3 100644 --- a/chrome/browser/media/webrtc/webrtc_desktop_capture_browsertest.cc +++ b/chrome/browser/media/webrtc/webrtc_desktop_capture_browsertest.cc
@@ -197,7 +197,7 @@ std::unique_ptr<base::RunLoop> run_loop_; std::map<content::WebContents*, std::unique_ptr<InfoBarChangeObserver>> observers_; - Browser* browser_; + raw_ptr<Browser> browser_; base::RepeatingClosure barrier_closure_; };
diff --git a/chrome/browser/metrics/ukm_browsertest.cc b/chrome/browser/metrics/ukm_browsertest.cc index 827d90450..330a049 100644 --- a/chrome/browser/metrics/ukm_browsertest.cc +++ b/chrome/browser/metrics/ukm_browsertest.cc
@@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/files/file_path.h" +#include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/strings/string_util.h" #include "base/system/sys_info.h" @@ -138,7 +139,7 @@ private: bool expected_allowed_; base::OnceClosure quit_closure_; - ukm::UkmRecorderImpl* ukm_recorder_; + raw_ptr<ukm::UkmRecorderImpl> ukm_recorder_; }; #if BUILDFLAG(IS_ANDROID)
diff --git a/chrome/browser/metrics/usage_scenario/tab_usage_scenario_tracker_unittest.cc b/chrome/browser/metrics/usage_scenario/tab_usage_scenario_tracker_unittest.cc index 38ae552..181662d 100644 --- a/chrome/browser/metrics/usage_scenario/tab_usage_scenario_tracker_unittest.cc +++ b/chrome/browser/metrics/usage_scenario/tab_usage_scenario_tracker_unittest.cc
@@ -40,17 +40,16 @@ delete; void SetUp() override { + display::Screen::SetScreenInstance(&screen_); ChromeRenderViewHostTestHarness::SetUp(); - previous_screen_ = display::Screen::SetScreenInstance(&screen_); tab_usage_scenario_tracker_ = std::make_unique<TabUsageScenarioTracker>(&usage_scenario_data_store_); } void TearDown() override { tab_usage_scenario_tracker_.reset(); - display::Screen::SetScreenInstance(previous_screen_); - previous_screen_ = nullptr; ChromeRenderViewHostTestHarness::TearDown(); + display::Screen::SetScreenInstance(nullptr); } std::unique_ptr<content::WebContents> CreateWebContents() { @@ -83,7 +82,6 @@ protected: display::test::TestScreen screen_; - raw_ptr<display::Screen> previous_screen_; UsageScenarioDataStoreImpl usage_scenario_data_store_; std::unique_ptr<TabUsageScenarioTracker> tab_usage_scenario_tracker_; ukm::TestAutoSetUkmRecorder ukm_recorder_;
diff --git a/chrome/browser/new_tab_page/modules/photos/photos_handler.h b/chrome/browser/new_tab_page/modules/photos/photos_handler.h index 039eb78b..a0b6efa 100644 --- a/chrome/browser/new_tab_page/modules/photos/photos_handler.h +++ b/chrome/browser/new_tab_page/modules/photos/photos_handler.h
@@ -37,7 +37,7 @@ private: mojo::Receiver<photos::mojom::PhotosHandler> handler_; raw_ptr<Profile> profile_; - content::WebContents* web_contents_; + raw_ptr<content::WebContents> web_contents_; }; #endif // CHROME_BROWSER_NEW_TAB_PAGE_MODULES_PHOTOS_PHOTOS_HANDLER_H_
diff --git a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc index 7554864..ad35cf0 100644 --- a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc
@@ -7,6 +7,7 @@ #include <vector> #include "base/memory/ptr_util.h" +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h" #include "components/page_load_metrics/browser/metrics_web_contents_observer.h" @@ -66,7 +67,7 @@ } protected: - FromGWSPageLoadMetricsObserver* observer_ = nullptr; + raw_ptr<FromGWSPageLoadMetricsObserver> observer_ = nullptr; }; class FromGWSPageLoadMetricsLoggerTest : public testing::Test {};
diff --git a/chrome/browser/page_load_metrics/observers/prerender_page_load_metrics_observer_browsertest.cc b/chrome/browser/page_load_metrics/observers/prerender_page_load_metrics_observer_browsertest.cc index f16df1d..71995271 100644 --- a/chrome/browser/page_load_metrics/observers/prerender_page_load_metrics_observer_browsertest.cc +++ b/chrome/browser/page_load_metrics/observers/prerender_page_load_metrics_observer_browsertest.cc
@@ -169,6 +169,13 @@ EXPECT_TRUE(ukm_recorder().EntryHasMetric( prerendered_page_entry, PrerenderPageLoad::kTiming_ActivationToLargestContentfulPaintName)); + EXPECT_TRUE(ukm_recorder().EntryHasMetric( + prerendered_page_entry, + PrerenderPageLoad::kInteractiveTiming_FirstInputDelay4Name)); + EXPECT_TRUE(ukm_recorder().EntryHasMetric( + prerendered_page_entry, + PrerenderPageLoad:: + kLayoutInstability_MaxCumulativeShiftScore_SessionWindow_Gap1000ms_Max5000msName)); EXPECT_FALSE(ukm_recorder().EntryHasMetric( prerendered_page_entry, PageLoad::kPaintTiming_NavigationToFirstContentfulPaintName));
diff --git a/chrome/browser/password_manager/credential_manager_browsertest.cc b/chrome/browser/password_manager/credential_manager_browsertest.cc index 8449fb1..3700743 100644 --- a/chrome/browser/password_manager/credential_manager_browsertest.cc +++ b/chrome/browser/password_manager/credential_manager_browsertest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/command_line.h" #include "base/containers/contains.h" +#include "base/memory/raw_ptr.h" #include "base/strings/strcat.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -1032,7 +1033,7 @@ size_t avatar_request_counter_ = 0; // A pointer to the run loop used to wait for the avatar. - base::RunLoop* run_loop_ = nullptr; + raw_ptr<base::RunLoop> run_loop_ = nullptr; }; const char CredentialManagerAvatarTest::kAvatarOrigin[] = "avatarserver.com";
diff --git a/chrome/browser/policy/cloud/user_policy_signin_service.h b/chrome/browser/policy/cloud/user_policy_signin_service.h index fb2321cd..659b405 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service.h +++ b/chrome/browser/policy/cloud/user_policy_signin_service.h
@@ -8,6 +8,7 @@ #include <memory> #include <string> +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/scoped_observation.h" #include "chrome/browser/profiles/profile_attributes_storage.h" @@ -44,7 +45,7 @@ void OnProfileAdded(Profile* profile) override; private: - UserPolicySigninService* user_policy_signin_service_; + raw_ptr<UserPolicySigninService> user_policy_signin_service_; }; // A specialization of the UserPolicySigninServiceBase for the desktop
diff --git a/chrome/browser/policy/messaging_layer/public/report_client.cc b/chrome/browser/policy/messaging_layer/public/report_client.cc index 28c7ddd..60a1b53 100644 --- a/chrome/browser/policy/messaging_layer/public/report_client.cc +++ b/chrome/browser/policy/messaging_layer/public/report_client.cc
@@ -90,9 +90,11 @@ Uploader& operator=(const Uploader& other) = delete; void ProcessRecord(EncryptedRecord data, + ScopedReservation scoped_reservation, base::OnceCallback<void(bool)> processed_cb) override { helper_.AsyncCall(&Helper::ProcessRecord) - .WithArgs(std::move(data), std::move(processed_cb)); + .WithArgs(std::move(data), std::move(scoped_reservation), + std::move(processed_cb)); } void ProcessGap(SequenceInformation start, uint64_t count, @@ -113,6 +115,7 @@ Helper(const Helper& other) = delete; Helper& operator=(const Helper& other) = delete; void ProcessRecord(EncryptedRecord data, + ScopedReservation scoped_reservation, base::OnceCallback<void(bool)> processed_cb); void ProcessGap(SequenceInformation start, uint64_t count, @@ -143,6 +146,7 @@ void ReportingClient::Uploader::Helper::ProcessRecord( EncryptedRecord data, + ScopedReservation scoped_reservation, // TODO(b/233089187): Use it. base::OnceCallback<void(bool)> processed_cb) { if (completed_) { std::move(processed_cb).Run(false);
diff --git a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_canary_checker.h b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_canary_checker.h index 58cf892..3a9c592 100644 --- a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_canary_checker.h +++ b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_canary_checker.h
@@ -12,6 +12,7 @@ #include "base/callback.h" #include "base/containers/lru_cache.h" +#include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" @@ -161,7 +162,7 @@ void UpdateCacheKey(std::string key); // The current profile, not owned. - Profile* profile_; + raw_ptr<Profile> profile_; // Pipe to allow cancelling an ongoing DNS resolution request. This is set // when we fire off a DNS request to the network service. We send the @@ -198,17 +199,17 @@ std::unique_ptr<base::OneShotTimer> timeout_timer_; // The tick clock used within this class. - const base::TickClock* tick_clock_; + raw_ptr<const base::TickClock> tick_clock_; // The time clock used within this class. - const base::Clock* clock_; + raw_ptr<const base::Clock> clock_; // Remembers the last time the checker became active. absl::optional<base::Time> time_when_set_active_; // This reference is kept around for unregistering |this| as an observer on // any thread. - network::NetworkConnectionTracker* network_connection_tracker_; + raw_ptr<network::NetworkConnectionTracker> network_connection_tracker_; // Small LRU cache holding the result of canary checks made for different // networks. This cache is not persisted across browser restarts.
diff --git a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_canary_checker_unittest.cc b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_canary_checker_unittest.cc index 3a0378d..cf0459f 100644 --- a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_canary_checker_unittest.cc +++ b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_canary_checker_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_canary_checker.h" +#include "base/memory/raw_ptr.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/simple_test_clock.h" #include "base/test/simple_test_tick_clock.h" @@ -101,7 +102,7 @@ } private: - FakeNetworkContext* network_context_; + raw_ptr<FakeNetworkContext> network_context_; net::HostPortPair host_; mojo::Receiver<network::mojom::ResolveHostHandle> control_handle_receiver_{ this};
diff --git a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_network_context.h b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_network_context.h index 406e0f9..cd224629f 100644 --- a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_network_context.h +++ b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_network_context.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_PREFETCH_PREFETCH_PROXY_PREFETCH_PROXY_NETWORK_CONTEXT_H_ #define CHROME_BROWSER_PREFETCH_PREFETCH_PROXY_PREFETCH_PROXY_NETWORK_CONTEXT_H_ +#include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" #include "mojo/public/cpp/bindings/pending_receiver.h" @@ -64,7 +65,7 @@ void CreateIsolatedUrlLoaderFactory(); // The profile to use when configuring |network_context_|. - Profile* profile_; + raw_ptr<Profile> profile_; // Whether an isolated network context should be used, or if the default // network context should be used.
diff --git a/chrome/browser/prerender/omnibox_prerender_browsertest.cc b/chrome/browser/prerender/omnibox_prerender_browsertest.cc index 7d8b03c..3c82130 100644 --- a/chrome/browser/prerender/omnibox_prerender_browsertest.cc +++ b/chrome/browser/prerender/omnibox_prerender_browsertest.cc
@@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/files/file_path.h" +#include "base/memory/raw_ptr.h" #include "base/path_service.h" #include "build/build_config.h" #include "chrome/browser/predictors/autocomplete_action_predictor.h" @@ -387,7 +388,7 @@ constexpr static char kSearchDomain[] = "a.test"; constexpr static char16_t kSearchDomain16[] = u"a.test"; - PrerenderManager* prerender_manager_; + raw_ptr<PrerenderManager> prerender_manager_; net::test_server::EmbeddedTestServer search_engine_server_{ net::test_server::EmbeddedTestServer::TYPE_HTTPS}; std::string prerender_page_target_ = "/title1.html";
diff --git a/chrome/browser/printing/print_browsertest.cc b/chrome/browser/printing/print_browsertest.cc index f69df74..eab42b0 100644 --- a/chrome/browser/printing/print_browsertest.cc +++ b/chrome/browser/printing/print_browsertest.cc
@@ -2353,7 +2353,7 @@ callbacks_->did_stop_callback.Run(); } - TestPrintCallbacks* callbacks_; + raw_ptr<TestPrintCallbacks> callbacks_; }; class TestPrintJobWorkerOop : public PrintJobWorkerOop { @@ -2905,7 +2905,7 @@ mojo::Remote<mojom::PrintBackendService> test_remote_; std::unique_ptr<PrintBackendServiceTestImpl> print_backend_service_; #endif // BUILDFLAG(ENABLE_OOP_PRINTING) - PrintJob* print_job_ = nullptr; + raw_ptr<PrintJob> print_job_ = nullptr; bool reset_errors_after_check_ = true; mojom::ResultCode use_default_settings_result_ = mojom::ResultCode::kFailed; #if BUILDFLAG(IS_WIN)
diff --git a/chrome/browser/privacy_budget/privacy_budget_browsertest.cc b/chrome/browser/privacy_budget/privacy_budget_browsertest.cc index 75cc99c..1b54a24 100644 --- a/chrome/browser/privacy_budget/privacy_budget_browsertest.cc +++ b/chrome/browser/privacy_budget/privacy_budget_browsertest.cc
@@ -498,8 +498,14 @@ } } +// Fails on Window, see https://crbug.com/1268787 +#if BUILDFLAG(IS_WIN) +#define MAYBE_IncludesMetadata DISABLED_IncludesMetadata +#else +#define MAYBE_IncludesMetadata IncludesMetadata +#endif IN_PROC_BROWSER_TEST_F(PrivacyBudgetBrowserTestWithScopedConfig, - IncludesMetadata) { + MAYBE_IncludesMetadata) { ASSERT_TRUE(base::FeatureList::IsEnabled(features::kIdentifiabilityStudy)); ASSERT_TRUE(EnableUkmRecording());
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_service_unittest.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_service_unittest.cc index 8d6fc695..2d1102d 100644 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_service_unittest.cc +++ b/chrome/browser/privacy_sandbox/privacy_sandbox_service_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/privacy_sandbox/privacy_sandbox_service.h" +#include "base/memory/raw_ptr.h" #include "base/test/bind.h" #include "base/test/gtest_util.h" #include "base/test/icu_test_util.h" @@ -748,7 +749,8 @@ base::test::ScopedFeatureList feature_list_; syncer::TestSyncService sync_service_; TestInterestGroupManager test_interest_group_manager_; - privacy_sandbox_test_util::MockPrivacySandboxSettingsDelegate* mock_delegate_; + raw_ptr<privacy_sandbox_test_util::MockPrivacySandboxSettingsDelegate> + mock_delegate_; browsing_topics::MockBrowsingTopicsService mock_browsing_topics_service_; #if !BUILDFLAG(IS_ANDROID) std::unique_ptr<MockTrustSafetySentimentService> mock_sentiment_service_;
diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_settings_delegate.h b/chrome/browser/privacy_sandbox/privacy_sandbox_settings_delegate.h index 0c458fe..2e532e34 100644 --- a/chrome/browser/privacy_sandbox/privacy_sandbox_settings_delegate.h +++ b/chrome/browser/privacy_sandbox/privacy_sandbox_settings_delegate.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_PRIVACY_SANDBOX_PRIVACY_SANDBOX_SETTINGS_DELEGATE_H_ #define CHROME_BROWSER_PRIVACY_SANDBOX_PRIVACY_SANDBOX_SETTINGS_DELEGATE_H_ +#include "base/memory/raw_ptr.h" #include "components/privacy_sandbox/privacy_sandbox_settings.h" class Profile; @@ -20,7 +21,7 @@ bool IsPrivacySandboxConfirmed() override; private: - Profile* profile_; + raw_ptr<Profile> profile_; }; #endif // CHROME_BROWSER_PRIVACY_SANDBOX_PRIVACY_SANDBOX_SETTINGS_DELEGATE_H_
diff --git a/chrome/browser/profiles/profile_attributes_storage.cc b/chrome/browser/profiles/profile_attributes_storage.cc index a3cb7574..c62b047 100644 --- a/chrome/browser/profiles/profile_attributes_storage.cc +++ b/chrome/browser/profiles/profile_attributes_storage.cc
@@ -16,6 +16,7 @@ #include "base/i18n/number_formatting.h" #include "base/i18n/string_compare.h" #include "base/logging.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted_memory.h" #include "base/observer_list.h" #include "base/strings/string_number_conversions.h" @@ -177,7 +178,7 @@ return entry->GetName(); } - icu::Collator* collator_; + raw_ptr<icu::Collator> collator_; bool use_local_name_; };
diff --git a/chrome/browser/resources/apc_internals/apc_internals.css b/chrome/browser/resources/apc_internals/apc_internals.css index f075bd19..87b7831 100644 --- a/chrome/browser/resources/apc_internals/apc_internals.css +++ b/chrome/browser/resources/apc_internals/apc_internals.css
@@ -24,3 +24,12 @@ #script-fetching-table { padding-bottom: 10px; } + +button:hover { + cursor: pointer; +} + +h2 { + font-size: 1em; + text-align: center; +}
diff --git a/chrome/browser/resources/apc_internals/apc_internals.html b/chrome/browser/resources/apc_internals/apc_internals.html index db805daa..babc7fd 100644 --- a/chrome/browser/resources/apc_internals/apc_internals.html +++ b/chrome/browser/resources/apc_internals/apc_internals.html
@@ -39,6 +39,13 @@ <td class="label">App Locale:</td> <td class="version"><span>$i18n{app_locale}</span></td> </tr> + <tr> + <td class="label">Autofill Assistant URL:</td> + <td class="version"> + <input type="text" id="autofill-assistant-url"> + <button id="set-autofill-assistant-url">Set</button> + </td> + </tr> </table> </div> <div id="flags" class="info-div"> @@ -47,8 +54,8 @@ </table> </div> <div id="autofill-assistant" class="info-div"> + <h2>Overview of Autofill Assistant state</h2> <table id="autofill-assistant-table" class="info-table"> - <th colspan="2">Overview of Autofill Assistant state</th> </table> </div> <div id="script-fetching" class="info-div">
diff --git a/chrome/browser/resources/apc_internals/apc_internals.js b/chrome/browser/resources/apc_internals/apc_internals.js index 71f8708..bf3b65f 100644 --- a/chrome/browser/resources/apc_internals/apc_internals.js +++ b/chrome/browser/resources/apc_internals/apc_internals.js
@@ -46,6 +46,9 @@ return; } const table = $('autofill-assistant-table'); + while (table.firstChild) { + table.removeChild(table.lastChild); + } for (const [key, value] of Object.entries(autofillAssistantInfo)) { table.appendChild(createTableRow(key, value)); } @@ -64,6 +67,11 @@ chrome.send('refresh-script-cache'); } +function setAutofillAssistantUrl() { + const autofillAssistantUrl = $('autofill-assistant-url').value; + chrome.send('set-autofill-assistant-url', [autofillAssistantUrl]); +} + function onScriptCacheReceived(scriptsCacheInfo) { const element = $('script-cache-content'); if (!scriptsCacheInfo.length) { @@ -97,6 +105,7 @@ $('script-cache-hide').onclick = hideScriptCache; $('script-cache-show').onclick = showScriptCache; $('script-cache-refresh').onclick = refreshScriptCache; + $('set-autofill-assistant-url').onclick = setAutofillAssistantUrl; chrome.send('loaded'); });
diff --git a/chrome/browser/resources/settings/chromeos/os_languages_page/input_method_options_page.js b/chrome/browser/resources/settings/chromeos/os_languages_page/input_method_options_page.js index 104918d..83479a6c 100644 --- a/chrome/browser/resources/settings/chromeos/os_languages_page/input_method_options_page.js +++ b/chrome/browser/resources/settings/chromeos/os_languages_page/input_method_options_page.js
@@ -256,6 +256,10 @@ newValue = parseInt(newValue, 10); } updatedSettings[prefix][optionName] = newValue; + + if (prefix !== this.engineId_) { + updatedSettings[this.engineId_] = updatedSettings[prefix]; + } this.setPrefValue(this.PREFS_PATH, updatedSettings); }
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_impl_win_unittest.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_impl_win_unittest.cc index e5ac237..fa1ffd6 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_impl_win_unittest.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_impl_win_unittest.cc
@@ -12,6 +12,7 @@ #include "base/bind.h" #include "base/callback_helpers.h" #include "base/command_line.h" +#include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/test/multiprocess_test.h" #include "base/threading/thread_task_runner_handle.h" @@ -439,7 +440,7 @@ MockChromeCleanerProcess::Options cleaner_process_options_; StrictMock<MockChromeCleanerControllerObserver> mock_observer_; - ChromeCleanerControllerImpl* controller_; + raw_ptr<ChromeCleanerControllerImpl> controller_; ChromeCleanerRunner::ProcessStatus cleaner_process_status_; std::vector<Profile*> profiles_tagged_; @@ -715,7 +716,7 @@ ChromeCleanerController::State initial_state_; - ChromeCleanerControllerImpl* controller_ = nullptr; + raw_ptr<ChromeCleanerControllerImpl> controller_ = nullptr; StrictMock<MockChromeCleanerControllerObserver> mock_observer_; };
diff --git a/chrome/browser/safe_browsing/tailored_security/chrome_tailored_security_service.h b/chrome/browser/safe_browsing/tailored_security/chrome_tailored_security_service.h index 7dcfc4c6..ec5eb41 100644 --- a/chrome/browser/safe_browsing/tailored_security/chrome_tailored_security_service.h +++ b/chrome/browser/safe_browsing/tailored_security/chrome_tailored_security_service.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SAFE_BROWSING_TAILORED_SECURITY_CHROME_TAILORED_SECURITY_SERVICE_H_ #define CHROME_BROWSER_SAFE_BROWSING_TAILORED_SECURITY_CHROME_TAILORED_SECURITY_SERVICE_H_ +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "components/safe_browsing/core/browser/tailored_security_service/tailored_security_service.h" @@ -36,7 +37,7 @@ std::unique_ptr<TailoredSecurityConsentedModalAndroid> message_; #endif - Profile* profile_; + raw_ptr<Profile> profile_; }; } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/tailored_security/tailored_security_url_observer.h b/chrome/browser/safe_browsing/tailored_security/tailored_security_url_observer.h index e612aa3..9b168dc 100644 --- a/chrome/browser/safe_browsing/tailored_security/tailored_security_url_observer.h +++ b/chrome/browser/safe_browsing/tailored_security/tailored_security_url_observer.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SAFE_BROWSING_TAILORED_SECURITY_TAILORED_SECURITY_URL_OBSERVER_H_ #define CHROME_BROWSER_SAFE_BROWSING_TAILORED_SECURITY_TAILORED_SECURITY_URL_OBSERVER_H_ +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "components/safe_browsing/core/browser/tailored_security_service/tailored_security_service_observer.h" #include "content/public/browser/web_contents_observer.h" @@ -63,7 +64,7 @@ #endif // Reference to the TailoredSecurityService for this profile. - TailoredSecurityService* service_; + raw_ptr<TailoredSecurityService> service_; // Whether the WebContents is currently in focus. bool focused_ = false;
diff --git a/chrome/browser/segmentation_platform/segmentation_platform_service_factory.cc b/chrome/browser/segmentation_platform/segmentation_platform_service_factory.cc index 60ffc753..9281953 100644 --- a/chrome/browser/segmentation_platform/segmentation_platform_service_factory.cc +++ b/chrome/browser/segmentation_platform/segmentation_platform_service_factory.cc
@@ -92,9 +92,12 @@ auto* service = new SegmentationPlatformServiceImpl(std::move(params)); - service->SetUserData(kSegmentationPlatformProfileObserverKey, - std::make_unique<SegmentationPlatformProfileObserver>( - service, g_browser_process->profile_manager())); + // Profile manager can be null in unit tests. + if (g_browser_process->profile_manager()) { + service->SetUserData(kSegmentationPlatformProfileObserverKey, + std::make_unique<SegmentationPlatformProfileObserver>( + service, g_browser_process->profile_manager())); + } return service; }
diff --git a/chrome/browser/shared_highlighting/shared_highlighting_browsertest.cc b/chrome/browser/shared_highlighting/shared_highlighting_browsertest.cc index 9ba11e8..7194878 100644 --- a/chrome/browser/shared_highlighting/shared_highlighting_browsertest.cc +++ b/chrome/browser/shared_highlighting/shared_highlighting_browsertest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/memory/raw_ptr.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" @@ -247,7 +248,7 @@ run_loop_.Quit(); } - RenderViewContextMenu* context_menu_; + raw_ptr<RenderViewContextMenu> context_menu_; base::RunLoop run_loop_; };
diff --git a/chrome/browser/signin/e2e_tests/live_sign_in_test.cc b/chrome/browser/signin/e2e_tests/live_sign_in_test.cc index 792264e..6b3004e 100644 --- a/chrome/browser/signin/e2e_tests/live_sign_in_test.cc +++ b/chrome/browser/signin/e2e_tests/live_sign_in_test.cc
@@ -198,7 +198,7 @@ void Wait() { if (identity_manager_->GetAccountsWithRefreshTokens().empty()) return; - observation_.Observe(identity_manager_); + observation_.Observe(identity_manager_.get()); run_loop_.Run(); } @@ -212,7 +212,7 @@ } base::RunLoop run_loop_; - signin::IdentityManager* const identity_manager_; + const raw_ptr<signin::IdentityManager> identity_manager_; base::ScopedObservation<signin::IdentityManager, signin::IdentityManager::Observer> observation_{this};
diff --git a/chrome/browser/signin/primary_account_policy_manager_unittest.cc b/chrome/browser/signin/primary_account_policy_manager_unittest.cc index 27e4ed1..0d0d4b4 100644 --- a/chrome/browser/signin/primary_account_policy_manager_unittest.cc +++ b/chrome/browser/signin/primary_account_policy_manager_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/signin/primary_account_policy_manager.h" +#include "base/memory/raw_ptr.h" #include "build/buildflag.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/signin/identity_test_environment_profile_adaptor.h" @@ -67,7 +68,7 @@ private: content::BrowserTaskEnvironment task_environment_; TestingProfileManager profile_manager_; - TestingProfile* profile_ = nullptr; + raw_ptr<TestingProfile> profile_ = nullptr; std::unique_ptr<IdentityTestEnvironmentProfileAdaptor> identity_test_env_adaptor_; };
diff --git a/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc index 64ffcd9..d57767c 100644 --- a/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc
@@ -113,6 +113,7 @@ : SyncTest(SINGLE_CLIENT) { feature_list_.InitWithFeatures( /*enabled_features=*/{syncer::kCacheBaseEntitySpecificsInMetadata, + syncer::kReadWritePasswordNotesBackupField, password_manager::features::kPasswordNotes}, /*disabled_features=*/{}); }
diff --git a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc index bfeea2c..ba64a1d 100644 --- a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc
@@ -21,6 +21,7 @@ #include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h" #include "components/password_manager/core/browser/password_store_interface.h" #include "components/password_manager/core/common/password_manager_features.h" +#include "components/sync/base/features.h" #include "components/sync/engine/cycle/entity_change_metric_recording.h" #include "components/sync/engine/cycle/sync_cycle_snapshot.h" #include "content/public/test/browser_test.h" @@ -503,8 +504,10 @@ class TwoClientPasswordsSyncTestWithNotes : public SyncTest { public: TwoClientPasswordsSyncTestWithNotes() : SyncTest(TWO_CLIENT) { - feature_list_.InitAndEnableFeature( - password_manager::features::kPasswordNotes); + feature_list_.InitWithFeatures( + /*enabled_features=*/{password_manager::features::kPasswordNotes, + syncer::kReadWritePasswordNotesBackupField}, + /*disabled_features=*/{}); } ~TwoClientPasswordsSyncTestWithNotes() override = default; @@ -547,3 +550,29 @@ EXPECT_THAT(GetAllLogins(GetProfilePasswordStoreInterface(1)), ElementsAre(Pointee(form))); } + +// This tests the logic for reading and writing the notes backup blob when +// notes are empty. +IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTestWithNotes, + SyncPasswordWithEmptyNotesBetweenDevices) { + ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; + ASSERT_TRUE(AllProfilesContainSamePasswordForms()); + + // Add a password with note to Client 0. + PasswordForm form = CreateTestPasswordForm(0); + GetProfilePasswordStoreInterface(0)->AddLogin(form); + + // Wait until Client 1 picks up changes. + ASSERT_TRUE(SamePasswordFormsChecker().Wait()); + EXPECT_THAT(GetAllLogins(GetProfilePasswordStoreInterface(1)), + ElementsAre(Pointee(form))); + + // Update the password in Client 1. + form.password_value = u"new_password"; + GetProfilePasswordStoreInterface(1)->UpdateLogin(form); + + // Wait until Client 0 picks up changes. + ASSERT_TRUE(SamePasswordFormsChecker().Wait()); + EXPECT_THAT(GetAllLogins(GetProfilePasswordStoreInterface(0)), + ElementsAre(Pointee(form))); +}
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc index 5ffa74e..446f40f1 100644 --- a/chrome/browser/themes/browser_theme_pack.cc +++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -771,7 +771,7 @@ // For now data pack can only have extension type. scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); pack->set_extension_id(expected_id); // The data pack is loaded in a local variable to be released synchronously
diff --git a/chrome/browser/themes/browser_theme_pack_unittest.cc b/chrome/browser/themes/browser_theme_pack_unittest.cc index 5350f68f..484b707 100644 --- a/chrome/browser/themes/browser_theme_pack_unittest.cc +++ b/chrome/browser/themes/browser_theme_pack_unittest.cc
@@ -34,6 +34,7 @@ using extensions::Extension; using TP = ThemeProperties; +using ThemeType = ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType; // Maps scale factors (enum values) to file path. // A similar typedef in BrowserThemePack is private. @@ -137,8 +138,7 @@ }; BrowserThemePackTest::BrowserThemePackTest() - : theme_pack_( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)) { + : theme_pack_(new BrowserThemePack(ThemeType::kExtension)) { std::vector<ui::ResourceScaleFactor> scale_factors; scale_factors.push_back(ui::k100Percent); scale_factors.push_back(ui::k200Percent); @@ -498,7 +498,7 @@ for (int i = 0; i < colors_num; i++) { SkColor color = colors[i]; scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::AUTOGENERATED)); + new BrowserThemePack(ThemeType::kAutogenerated)); BrowserThemePack::BuildFromColor(color, pack.get()); SkColor frame_color, toolbar_color; @@ -784,7 +784,7 @@ { base::FilePath star_gazing_path = GetStarGazingPath(); scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildFromUnpackedExtension(star_gazing_path, pack.get()); ASSERT_TRUE(pack->WriteToDisk(file)); VerifyStarGazing(pack.get()); @@ -809,7 +809,7 @@ { base::FilePath hidpi_path = GetHiDpiThemePath(); scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildFromUnpackedExtension(hidpi_path, pack.get()); ASSERT_TRUE(pack->WriteToDisk(file)); VerifyHiDpiTheme(pack.get()); @@ -828,7 +828,7 @@ // caption button background colors appropriately match the frame color. TEST_F(BrowserThemePackTest, TestWindowControlButtonBGColor_FrameColor) { scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildTestExtensionTheme("theme_test_captionbutton_framecolor", pack.get()); // Verify that control button background colors are matching the frame colors. @@ -851,7 +851,7 @@ // background color blended with the frame color. TEST_F(BrowserThemePackTest, TestWindowControlButtonBGColor_ButtonBGColor) { scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildTestExtensionTheme("theme_test_captionbutton_buttoncolor", pack.get()); SkColor button_bg_color; @@ -900,7 +900,7 @@ // (to match the bg image). TEST_F(BrowserThemePackTest, TestWindowControlButtonBGColor_ButtonBGImage) { scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildTestExtensionTheme("theme_test_captionbutton_buttonimage", pack.get()); // Verify that all of the calculated button background colors are on the @@ -924,7 +924,7 @@ // correctly to their dependent colors TEST_F(BrowserThemePackTest, TestFrameAndToolbarColorPropagation) { scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildTestExtensionTheme("theme_test_toolbar_color_no_image", pack.get()); // Toolbar button icon colors. @@ -955,7 +955,7 @@ TEST_F(BrowserThemePackTest, TestToolbarColorComputedFromImageOverridesInputColor) { scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildTestExtensionTheme("theme_test_toolbar_frame_images_and_colors", pack.get()); @@ -971,7 +971,7 @@ TEST_F(BrowserThemePackTest, TestFrameColorComputedFromImageOverridesInputColor) { scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildTestExtensionTheme("theme_test_toolbar_frame_images_and_colors", pack.get()); @@ -985,7 +985,7 @@ // Test theme generation for a given color. TEST_F(BrowserThemePackTest, TestBuildFromColor) { scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::AUTOGENERATED)); + new BrowserThemePack(ThemeType::kAutogenerated)); SkColor color = SkColorSetRGB(100, 100, 200); BrowserThemePack::BuildFromColor(color, pack.get()); @@ -1014,7 +1014,7 @@ for (SkColor color : backgrounds) { scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::AUTOGENERATED)); + new BrowserThemePack(ThemeType::kAutogenerated)); BrowserThemePack::BuildFromColor(color, pack.get()); SkColor frame_color, background_tab, background_tab_text; @@ -1071,7 +1071,7 @@ for (SkColor color : dark_backgrounds) { scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::AUTOGENERATED)); + new BrowserThemePack(ThemeType::kAutogenerated)); BrowserThemePack::BuildFromColor(color, pack.get()); SkColor frame_color; @@ -1084,7 +1084,7 @@ for (SkColor color : light_backgrounds) { scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::AUTOGENERATED)); + new BrowserThemePack(ThemeType::kAutogenerated)); BrowserThemePack::BuildFromColor(color, pack.get()); SkColor frame_color; @@ -1116,7 +1116,7 @@ TEST_F(BrowserThemePackTest, TestToolbarButtonColor) { scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildTestExtensionTheme("theme_test_toolbar_button_color", pack.get()); SkColor button_color; @@ -1131,7 +1131,7 @@ // If ntp_text is not specified then it should be calculated based on NTP // background image. scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildTestExtensionTheme("theme_ntp_background_image", pack.get()); SkColor ntp_text; @@ -1140,7 +1140,7 @@ // If ntp_text is not specified then it should be calculated based on NTP // background color. scoped_refptr<BrowserThemePack> pack_autogenerated( - new BrowserThemePack(CustomThemeSupplier::ThemeType::AUTOGENERATED)); + new BrowserThemePack(ThemeType::kAutogenerated)); BrowserThemePack::BuildFromColor(SkColorSetRGB(0, 130, 130), pack_autogenerated.get()); @@ -1151,7 +1151,7 @@ // For themes with no background image and no background color, nothing should // be specified. scoped_refptr<BrowserThemePack> theme_minimal( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildTestExtensionTheme("theme_minimal", theme_minimal.get()); SkColor color; EXPECT_FALSE(theme_minimal->GetColor(TP::COLOR_NTP_LOGO, &color)); @@ -1159,7 +1159,7 @@ // For themes with image logo and shortcut colors shouldn't be set. scoped_refptr<BrowserThemePack> theme_with_image( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildTestExtensionTheme("theme_ntp_background_image", theme_with_image.get()); EXPECT_FALSE(theme_with_image->GetColor(TP::COLOR_NTP_LOGO, &color)); EXPECT_FALSE(theme_with_image->GetColor(TP::COLOR_NTP_SHORTCUT, &color)); @@ -1168,7 +1168,7 @@ // shouldn't // // be specified but the shortcut color should be set. scoped_refptr<BrowserThemePack> theme_colorful_logo( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildTestExtensionTheme("theme_color_ntp_colorful_logo", theme_colorful_logo.get()); EXPECT_FALSE(theme_colorful_logo->GetColor(TP::COLOR_NTP_LOGO, &color)); @@ -1177,7 +1177,7 @@ // For themes with no image and with alternate logo, both logo and shortcut // colors should be set. scoped_refptr<BrowserThemePack> theme_alternate_logo( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ThemeType::kExtension)); BuildTestExtensionTheme("theme_color_ntp_white_logo", theme_alternate_logo.get()); EXPECT_TRUE(theme_alternate_logo->GetColor(TP::COLOR_NTP_LOGO, &color)); @@ -1186,7 +1186,7 @@ // For darker then midpoint themes the logo color should be white. scoped_refptr<BrowserThemePack> dark_theme( - new BrowserThemePack(CustomThemeSupplier::ThemeType::AUTOGENERATED)); + new BrowserThemePack(ThemeType::kAutogenerated)); BrowserThemePack::BuildFromColor(SkColorSetRGB(120, 120, 120), dark_theme.get()); EXPECT_TRUE(dark_theme->GetColor(TP::COLOR_NTP_LOGO, &color)); @@ -1196,7 +1196,7 @@ // The Logo color shouldn't be set either because the colorful logo should be // used on white background. scoped_refptr<BrowserThemePack> white_theme( - new BrowserThemePack(CustomThemeSupplier::ThemeType::AUTOGENERATED)); + new BrowserThemePack(ThemeType::kAutogenerated)); BrowserThemePack::BuildFromColor(SK_ColorWHITE, white_theme.get()); ASSERT_TRUE(white_theme->GetColor(TP::COLOR_NTP_BACKGROUND, &color)); ASSERT_EQ(SK_ColorWHITE, color);
diff --git a/chrome/browser/themes/custom_theme_supplier.cc b/chrome/browser/themes/custom_theme_supplier.cc index e4b7cc8..54e0a8bf 100644 --- a/chrome/browser/themes/custom_theme_supplier.cc +++ b/chrome/browser/themes/custom_theme_supplier.cc
@@ -8,9 +8,6 @@ #include "ui/gfx/color_utils.h" #include "ui/gfx/image/image.h" -CustomThemeSupplier::CustomThemeSupplier(ThemeType theme_type) - : theme_type_(theme_type) {} - CustomThemeSupplier::~CustomThemeSupplier() {} void CustomThemeSupplier::StartUsingTheme() {}
diff --git a/chrome/browser/themes/custom_theme_supplier.h b/chrome/browser/themes/custom_theme_supplier.h index 1113726a..6e7ff19 100644 --- a/chrome/browser/themes/custom_theme_supplier.h +++ b/chrome/browser/themes/custom_theme_supplier.h
@@ -33,24 +33,12 @@ class CustomThemeSupplier : public ui::ColorProviderManager::ThemeInitializerSupplier { public: - enum ThemeType { - EXTENSION, - NATIVE_X11, - INCREASED_CONTRAST, - AUTOGENERATED, - }; - - explicit CustomThemeSupplier(ThemeType type); - + using ThemeInitializerSupplier::ThemeInitializerSupplier; CustomThemeSupplier(const CustomThemeSupplier&) = delete; CustomThemeSupplier& operator=(const CustomThemeSupplier&) = delete; - ThemeType get_theme_type() const { - return theme_type_; - } - const std::string& extension_id() const { - DCHECK_EQ(theme_type_, EXTENSION); + DCHECK_EQ(get_theme_type(), ThemeType::kExtension); return extension_id_; } @@ -97,14 +85,13 @@ ~CustomThemeSupplier() override; void set_extension_id(base::StringPiece id) { - DCHECK_EQ(theme_type_, EXTENSION); + DCHECK_EQ(get_theme_type(), ThemeType::kExtension); extension_id_.assign(id.data(), id.size()); } private: friend class base::RefCountedThreadSafe<CustomThemeSupplier>; - ThemeType theme_type_; std::string extension_id_; };
diff --git a/chrome/browser/themes/increased_contrast_theme_supplier.cc b/chrome/browser/themes/increased_contrast_theme_supplier.cc index 85aa8d4d..2b4f4df 100644 --- a/chrome/browser/themes/increased_contrast_theme_supplier.cc +++ b/chrome/browser/themes/increased_contrast_theme_supplier.cc
@@ -8,7 +8,7 @@ IncreasedContrastThemeSupplier::IncreasedContrastThemeSupplier( ui::NativeTheme* native_theme) - : CustomThemeSupplier(INCREASED_CONTRAST), + : CustomThemeSupplier(ThemeType::kIncreasedContrast), native_theme_(native_theme), is_dark_mode_(native_theme->ShouldUseDarkColors()) { native_theme->AddObserver(this);
diff --git a/chrome/browser/themes/theme_helper.cc b/chrome/browser/themes/theme_helper.cc index 33fb810f..11a0b68 100644 --- a/chrome/browser/themes/theme_helper.cc +++ b/chrome/browser/themes/theme_helper.cc
@@ -151,15 +151,19 @@ // static bool ThemeHelper::IsExtensionTheme(const CustomThemeSupplier* theme_supplier) { - return theme_supplier && theme_supplier->get_theme_type() == - CustomThemeSupplier::ThemeType::EXTENSION; + return theme_supplier && + theme_supplier->get_theme_type() == + ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType:: + kExtension; } // static bool ThemeHelper::IsAutogeneratedTheme( const CustomThemeSupplier* theme_supplier) { - return theme_supplier && theme_supplier->get_theme_type() == - CustomThemeSupplier::ThemeType::AUTOGENERATED; + return theme_supplier && + theme_supplier->get_theme_type() == + ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType:: + kAutogenerated; } // static @@ -167,17 +171,17 @@ if (!theme_supplier) return true; - using Type = CustomThemeSupplier::ThemeType; + using Type = ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType; switch (theme_supplier->get_theme_type()) { - case Type::INCREASED_CONTRAST: + case Type::kIncreasedContrast: return true; - case Type::EXTENSION: { + case Type::kExtension: { const std::string& id = theme_supplier->extension_id(); return id == kDefaultThemeID || id == kDefaultThemeGalleryID; } - case Type::NATIVE_X11: - case Type::AUTOGENERATED: + case Type::kNativeX11: + case Type::kAutogenerated: return false; } } @@ -501,7 +505,9 @@ // after we fully migrate to the color provider and remove SystemThemeLinux. native_theme = linux_ui->GetNativeTheme( theme_supplier && - theme_supplier->get_theme_type() == CustomThemeSupplier::NATIVE_X11); + theme_supplier->get_theme_type() == + ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType:: + kNativeX11); } #endif return native_theme->ShouldUseDarkColors(); @@ -552,7 +558,8 @@ // Certain output cases are based on inverted bg/fg. const bool high_contrast = theme_supplier && theme_supplier->get_theme_type() == - CustomThemeSupplier::ThemeType::INCREASED_CONTRAST; + ui::ColorProviderManager::ThemeInitializerSupplier:: + ThemeType::kIncreasedContrast; const bool invert = high_contrast && (id == TP::COLOR_OMNIBOX_RESULTS_BG_SELECTED ||
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc index d759fbf..5d2c348a9 100644 --- a/chrome/browser/themes/theme_service.cc +++ b/chrome/browser/themes/theme_service.cc
@@ -784,7 +784,8 @@ previous_theme_id = GetThemeID(); auto pack = base::MakeRefCounted<BrowserThemePack>( - CustomThemeSupplier::ThemeType::AUTOGENERATED); + ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType:: + kAutogenerated); BrowserThemePack::BuildFromColor(color, pack.get()); SwapThemeSupplier(std::move(pack)); if (theme_supplier_) { @@ -979,8 +980,9 @@ TRACE_EVENT0("browser", "ThemeService::MigrateTheme - BuildFromExtension"); DLOG(ERROR) << "Migrating theme"; - scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + scoped_refptr<BrowserThemePack> pack(new BrowserThemePack( + ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType:: + kExtension)); BrowserThemePack::BuildFromExtension(extension, pack.get()); OnThemeBuiltFromExtension(extension->id(), pack.get(), true); base::RecordAction(base::UserMetricsAction("Themes.Migrated")); @@ -1005,7 +1007,8 @@ build_extension_task_tracker_.TryCancelAll(); building_extension_id_ = extension->id(); scoped_refptr<BrowserThemePack> pack( - new BrowserThemePack(CustomThemeSupplier::ThemeType::EXTENSION)); + new BrowserThemePack(ui::ColorProviderManager::ThemeInitializerSupplier:: + ThemeType::kExtension)); auto task_runner = base::ThreadPool::CreateTaskRunner( {base::MayBlock(), base::TaskPriority::USER_BLOCKING}); build_extension_task_tracker_.PostTaskAndReply(
diff --git a/chrome/browser/themes/theme_service_aura_linux.cc b/chrome/browser/themes/theme_service_aura_linux.cc index 002d910..e48e0c4 100644 --- a/chrome/browser/themes/theme_service_aura_linux.cc +++ b/chrome/browser/themes/theme_service_aura_linux.cc
@@ -40,7 +40,7 @@ }; SystemThemeLinux::SystemThemeLinux(PrefService* pref_service) - : CustomThemeSupplier(NATIVE_X11), + : CustomThemeSupplier(ThemeType::kNativeX11), linux_ui_(views::LinuxUI::instance()), pref_service_(pref_service) {} @@ -98,8 +98,10 @@ } bool ThemeServiceAuraLinux::UsingSystemTheme() const { - return GetThemeSupplier() && GetThemeSupplier()->get_theme_type() == - CustomThemeSupplier::NATIVE_X11; + return GetThemeSupplier() && + GetThemeSupplier()->get_theme_type() == + ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType:: + kNativeX11; } void ThemeServiceAuraLinux::FixInconsistentPreferencesIfNeeded() {
diff --git a/chrome/browser/themes/theme_service_unittest.cc b/chrome/browser/themes/theme_service_unittest.cc index 7492296..923b9820 100644 --- a/chrome/browser/themes/theme_service_unittest.cc +++ b/chrome/browser/themes/theme_service_unittest.cc
@@ -659,7 +659,8 @@ bool using_increased_contrast = theme_service_->GetThemeSupplier() && theme_service_->GetThemeSupplier()->get_theme_type() == - CustomThemeSupplier::ThemeType::INCREASED_CONTRAST; + ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType:: + kIncreasedContrast; bool expecting_increased_contrast = theme_service_->theme_helper_for_testing() .ShouldUseIncreasedContrastThemeSupplier(&test_native_theme_);
diff --git a/chrome/browser/touch_to_fill/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillResourceProvider.java b/chrome/browser/touch_to_fill/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillResourceProvider.java index e62f4599..b8d63ae 100644 --- a/chrome/browser/touch_to_fill/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillResourceProvider.java +++ b/chrome/browser/touch_to_fill/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillResourceProvider.java
@@ -25,9 +25,5 @@ * * @return A {@link DrawableRes} that is never 0. */ - public default @DrawableRes int getWebAuthnIconId() { - /* TODO(https://crbug.com/1331066): Remove the default method - * implementation as soon as a downstream update is landed. */ - return R.drawable.touch_to_fill_webauthn_icon; - } + public @DrawableRes int getWebAuthnIconId(); }
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index a2a7a584..130aaaa4 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -576,6 +576,7 @@ "//components/security_interstitials/core:unsafe_resource", "//components/security_state/content", "//components/security_state/core", + "//components/segmentation_platform/content", "//components/segmentation_platform/public", "//components/send_tab_to_self", "//components/sessions", @@ -2577,6 +2578,8 @@ "webui/chromeos/emoji/emoji_page_handler.h", "webui/chromeos/emoji/emoji_ui.cc", "webui/chromeos/emoji/emoji_ui.h", + "webui/chromeos/guest_os_installer/guest_os_installer_dialog.cc", + "webui/chromeos/guest_os_installer/guest_os_installer_dialog.h", "webui/chromeos/human_presence_internals_ui.cc", "webui/chromeos/human_presence_internals_ui.h", "webui/chromeos/image_source.cc", @@ -3044,6 +3047,7 @@ "//ash/webui/eche_app_ui", "//ash/webui/file_manager:file_manager_ui", "//ash/webui/firmware_update_ui", + "//ash/webui/guest_os_installer", "//ash/webui/help_app_ui", "//ash/webui/help_app_ui/search:mojo_bindings", "//ash/webui/media_app_ui",
diff --git a/chrome/browser/ui/DEPS b/chrome/browser/ui/DEPS index b8ee42bb..8f96f80e 100644 --- a/chrome/browser/ui/DEPS +++ b/chrome/browser/ui/DEPS
@@ -13,6 +13,7 @@ "+components/page_load_metrics/browser", "+components/qr_code_generator", "+components/safety_check", + "+components/segmentation_platform/content", "+components/soda", "+components/translate/content/android", "+components/user_education/common",
diff --git a/chrome/browser/ui/app_list/app_context_menu.h b/chrome/browser/ui/app_list/app_context_menu.h index 6971693..918100b 100644 --- a/chrome/browser/ui/app_list/app_context_menu.h +++ b/chrome/browser/ui/app_list/app_context_menu.h
@@ -10,6 +10,7 @@ #include "ash/public/cpp/app_menu_constants.h" #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "ui/base/models/image_model.h" #include "ui/base/models/simple_menu_model.h" @@ -66,10 +67,10 @@ AppListControllerDelegate* controller() const { return controller_; } private: - AppContextMenuDelegate* delegate_; - Profile* profile_; + raw_ptr<AppContextMenuDelegate> delegate_; + raw_ptr<Profile> profile_; const std::string app_id_; - AppListControllerDelegate* controller_; + raw_ptr<AppListControllerDelegate> controller_; }; } // namespace app_list
diff --git a/chrome/browser/ui/app_list/app_list_syncable_service.h b/chrome/browser/ui/app_list/app_list_syncable_service.h index 33e085c..404b4ae 100644 --- a/chrome/browser/ui/app_list/app_list_syncable_service.h +++ b/chrome/browser/ui/app_list/app_list_syncable_service.h
@@ -14,6 +14,7 @@ #include "ash/public/cpp/app_list/app_list_types.h" #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/observer_list_types.h" @@ -414,9 +415,9 @@ bool MaybeCreateFolderBeforeAddingItem(ChromeAppListItem* app_item, const std::string& folder_id); - Profile* profile_; - extensions::ExtensionSystem* extension_system_; - extensions::ExtensionRegistry* extension_registry_; + raw_ptr<Profile> profile_; + raw_ptr<extensions::ExtensionSystem> extension_system_; + raw_ptr<extensions::ExtensionRegistry> extension_registry_; std::unique_ptr<AppListModelUpdater> model_updater_; std::unique_ptr<ModelUpdaterObserver> model_updater_observer_; std::unique_ptr<AppListSyncModelSanitizer> sync_model_sanitizer_;
diff --git a/chrome/browser/ui/app_list/chrome_app_list_item.h b/chrome/browser/ui/app_list/chrome_app_list_item.h index 0c0ce3a..60d7c215 100644 --- a/chrome/browser/ui/app_list/chrome_app_list_item.h +++ b/chrome/browser/ui/app_list/chrome_app_list_item.h
@@ -11,6 +11,7 @@ #include "ash/public/cpp/app_list/app_list_types.h" #include "ash/public/cpp/shelf_types.h" +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/app_list/app_context_menu.h" #include "chrome/browser/ui/app_list/app_list_syncable_service.h" #include "ui/gfx/image/image_skia.h" @@ -40,7 +41,7 @@ void SetName(const std::string& name); private: - ChromeAppListItem* const item_; + const raw_ptr<ChromeAppListItem> item_; }; ChromeAppListItem(Profile* profile, @@ -158,8 +159,8 @@ private: std::unique_ptr<ash::AppListItemMetadata> metadata_; - Profile* profile_; - AppListModelUpdater* model_updater_ = nullptr; + raw_ptr<Profile> profile_; + raw_ptr<AppListModelUpdater> model_updater_ = nullptr; }; #endif // CHROME_BROWSER_UI_APP_LIST_CHROME_APP_LIST_ITEM_H_
diff --git a/chrome/browser/ui/ash/system_tray_client_impl.h b/chrome/browser/ui/ash/system_tray_client_impl.h index 8d513e9..fedf44e9 100644 --- a/chrome/browser/ui/ash/system_tray_client_impl.h +++ b/chrome/browser/ui/ash/system_tray_client_impl.h
@@ -7,6 +7,7 @@ #include "ash/public/cpp/system_tray_client.h" #include "ash/public/cpp/update_types.h" +#include "base/memory/raw_ptr.h" #include "base/strings/string_piece.h" #include "chrome/browser/ash/system/system_clock_observer.h" #include "chrome/browser/upgrade_detector/upgrade_observer.h" @@ -135,7 +136,7 @@ void UpdateEnterpriseAccountDomainInfo(Profile* profile); // The system tray model in ash. - ash::SystemTray* const system_tray_; + const raw_ptr<ash::SystemTray> system_tray_; // Information on whether the update is recommended or required. ash::RelaunchNotificationState relaunch_notification_state_;
diff --git a/chrome/browser/ui/autofill_assistant/password_change/assistant_onboarding_controller_impl.h b/chrome/browser/ui/autofill_assistant/password_change/assistant_onboarding_controller_impl.h index 8b6760d..0ca32de7 100644 --- a/chrome/browser/ui/autofill_assistant/password_change/assistant_onboarding_controller_impl.h +++ b/chrome/browser/ui/autofill_assistant/password_change/assistant_onboarding_controller_impl.h
@@ -50,7 +50,7 @@ Callback callback_; // The `WebContents` for which the dialog is supposed to show. - content::WebContents* web_contents_; + raw_ptr<content::WebContents> web_contents_; // A weak pointer to the view implementing the `OnboardingPrompt` // interface.
diff --git a/chrome/browser/ui/breadcrumb_manager_browser_agent.h b/chrome/browser/ui/breadcrumb_manager_browser_agent.h index 15436d0..4b4d709 100644 --- a/chrome/browser/ui/breadcrumb_manager_browser_agent.h +++ b/chrome/browser/ui/breadcrumb_manager_browser_agent.h
@@ -7,6 +7,7 @@ #include <string> +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" #include "components/breadcrumbs/core/breadcrumb_manager_browser_agent.h" @@ -37,7 +38,7 @@ // The browser whose tab strip this agent observes. Can't be nullptr because // |browser_| owns this object. - Browser* browser_; + raw_ptr<Browser> browser_; }; #endif // CHROME_BROWSER_UI_BREADCRUMB_MANAGER_BROWSER_AGENT_H_
diff --git a/chrome/browser/ui/breadcrumb_manager_browser_agent_unittest.cc b/chrome/browser/ui/breadcrumb_manager_browser_agent_unittest.cc index d9330ae..1189ea70 100644 --- a/chrome/browser/ui/breadcrumb_manager_browser_agent_unittest.cc +++ b/chrome/browser/ui/breadcrumb_manager_browser_agent_unittest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/breadcrumb_manager_browser_agent.h" #include "base/feature_list.h" +#include "base/memory/raw_ptr.h" #include "chrome/browser/breadcrumbs/breadcrumb_manager_keyed_service_factory.h" #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" @@ -43,7 +44,8 @@ private: base::test::ScopedFeatureList scoped_feature_list_; - breadcrumbs::BreadcrumbManagerKeyedService* breadcrumb_service_ = nullptr; + raw_ptr<breadcrumbs::BreadcrumbManagerKeyedService> breadcrumb_service_ = + nullptr; }; // Tests that an event logged by the BrowserAgent is returned with events for
diff --git a/chrome/browser/ui/color/chrome_color_provider_utils.cc b/chrome/browser/ui/color/chrome_color_provider_utils.cc index e3cb11b..d9d720b 100644 --- a/chrome/browser/ui/color/chrome_color_provider_utils.cc +++ b/chrome/browser/ui/color/chrome_color_provider_utils.cc
@@ -21,10 +21,8 @@ static constexpr const auto color_id_map = base::MakeFixedFlatMap<ui::ColorId, const char*>({CHROME_COLOR_IDS}); auto* i = color_id_map.find(color_id); - if (i != color_id_map.cend()) - return {i->second}; - NOTREACHED(); - return "<invalid>"; + DCHECK(i != color_id_map.cend()); + return {i->second}; } color_utils::HSL GetThemeTint(int id, @@ -33,8 +31,16 @@ color_utils::HSL hsl; if (key.custom_theme && key.custom_theme->GetTint(id, &hsl)) return hsl; + using ThemeType = + ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType; + const bool is_custom_theme = + key.custom_theme && + (key.custom_theme->get_theme_type() == ThemeType::kExtension || + key.custom_theme->get_theme_type() == ThemeType::kAutogenerated); return ThemeProperties::GetDefaultTint( - id, false, key.color_mode == ui::ColorProviderManager::ColorMode::kDark); + id, false, + key.color_mode == ui::ColorProviderManager::ColorMode::kDark && + !is_custom_theme); #else return {-1, -1, -1}; #endif // !BUILDFLAG(IS_ANDROID)
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc index a1dcaac..c42fe48a 100644 --- a/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc +++ b/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
@@ -814,6 +814,22 @@ class MultiScreenFullscreenControllerInteractiveTest : public FullscreenControllerInteractiveTest { public: + void SetUp() override { +#if !BUILDFLAG(IS_CHROMEOS_ASH) + screen_.display_list().AddDisplay({1, gfx::Rect(100, 100, 801, 802)}, + display::DisplayList::Type::PRIMARY); + display::Screen::SetScreenInstance(&screen_); +#endif + FullscreenControllerInteractiveTest::SetUp(); + } + + void TearDown() override { + FullscreenControllerInteractiveTest::TearDown(); +#if !BUILDFLAG(IS_CHROMEOS_ASH) + display::Screen::SetScreenInstance(nullptr); +#endif + } + // Perform common setup operations for multi-screen fullscreen testing: // Mock a screen with two displays, move the browser onto the first display, // and auto-grant the Window Placement permission on its active tab. @@ -823,12 +839,8 @@ display::test::DisplayManagerTestApi(ash::Shell::Get()->display_manager()) .UpdateDisplay("0+0-800x800,800+0-800x800"); #else - original_screen_ = display::Screen::GetScreen(); - screen_.display_list().AddDisplay({1, gfx::Rect(0, 0, 800, 800)}, - display::DisplayList::Type::PRIMARY); screen_.display_list().AddDisplay({2, gfx::Rect(800, 0, 800, 800)}, display::DisplayList::Type::NOT_PRIMARY); - display::Screen::SetScreenInstance(&screen_); #endif // BUILDFLAG(IS_CHROMEOS_ASH) EXPECT_EQ(2, display::Screen::GetScreen()->GetNumDisplays()); @@ -851,14 +863,6 @@ return tab; } - void TearDown() override { -#if !BUILDFLAG(IS_CHROMEOS_ASH) - if (original_screen_) - display::Screen::SetScreenInstance(original_screen_); -#endif // !BUILDFLAG(IS_CHROMEOS_ASH) - FullscreenControllerInteractiveTest::TearDown(); - } - // Wait for a JS content fullscreen change with the given script and options. void RequestContentFullscreenFromScript( const std::string& eval_js_script, @@ -932,14 +936,12 @@ #if !BUILDFLAG(IS_CHROMEOS_ASH) display::DisplayList& display_list() { return screen_.display_list(); } #endif // !BUILDFLAG(IS_CHROMEOS_ASH) - private: base::test::ScopedFeatureList feature_list_{ blink::features::kWindowPlacement}; #if !BUILDFLAG(IS_CHROMEOS_ASH) - raw_ptr<display::Screen> original_screen_ = nullptr; display::ScreenBase screen_; -#endif // !BUILDFLAG(IS_CHROMEOS_ASH) +#endif }; // TODO(crbug.com/1034772): Disabled on Windows, where views::FullscreenHandler
diff --git a/chrome/browser/ui/intent_picker_tab_helper_unittest.cc b/chrome/browser/ui/intent_picker_tab_helper_unittest.cc index 943f650..638c79f64 100644 --- a/chrome/browser/ui/intent_picker_tab_helper_unittest.cc +++ b/chrome/browser/ui/intent_picker_tab_helper_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/intent_picker_tab_helper.h" +#include "base/memory/raw_ptr.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/apps/intent_helper/apps_navigation_types.h" #include "chrome/browser/apps/intent_helper/intent_picker_auto_display_prefs.h" @@ -35,7 +36,7 @@ } private: - IntentPickerTabHelper* helper_; + raw_ptr<IntentPickerTabHelper> helper_; }; TEST_F(IntentPickerTabHelperTest, ShowOrHideIcon) {
diff --git a/chrome/browser/ui/passwords/bubble_controllers/items_bubble_controller_unittest.cc b/chrome/browser/ui/passwords/bubble_controllers/items_bubble_controller_unittest.cc index e2755e5..fb69328 100644 --- a/chrome/browser/ui/passwords/bubble_controllers/items_bubble_controller_unittest.cc +++ b/chrome/browser/ui/passwords/bubble_controllers/items_bubble_controller_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "base/memory/raw_ptr.h" #include "base/strings/utf_string_conversions.h" #include "base/test/metrics/histogram_tester.h" #include "chrome/browser/password_manager/password_store_factory.h" @@ -91,7 +92,7 @@ content::BrowserTaskEnvironment task_environment_; content::RenderViewHostTestEnabler rvh_enabler_; std::unique_ptr<TestingProfile> profile_; - syncer::TestSyncService* test_sync_service_; + raw_ptr<syncer::TestSyncService> test_sync_service_; std::unique_ptr<content::WebContents> test_web_contents_; std::unique_ptr<PasswordsModelDelegateMock> mock_delegate_; std::unique_ptr<ItemsBubbleController> controller_;
diff --git a/chrome/browser/ui/side_search/side_search_side_contents_helper.h b/chrome/browser/ui/side_search/side_search_side_contents_helper.h index 4cbad0a..ef462ea 100644 --- a/chrome/browser/ui/side_search/side_search_side_contents_helper.h +++ b/chrome/browser/ui/side_search/side_search_side_contents_helper.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UI_SIDE_SEARCH_SIDE_SEARCH_SIDE_CONTENTS_HELPER_H_ #define CHROME_BROWSER_UI_SIDE_SEARCH_SIDE_SEARCH_SIDE_CONTENTS_HELPER_H_ +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/webui/webui_load_timer.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" @@ -95,7 +96,7 @@ SideSearchConfig* GetConfig(); // `delegate_` will outlive the SideContentsWrapper. - Delegate* delegate_ = nullptr; + raw_ptr<Delegate> delegate_ = nullptr; WebuiLoadTimer webui_load_timer_;
diff --git a/chrome/browser/ui/signin_view_controller_interactive_uitest.cc b/chrome/browser/ui/signin_view_controller_interactive_uitest.cc index 022275ab..98dfc630 100644 --- a/chrome/browser/ui/signin_view_controller_interactive_uitest.cc +++ b/chrome/browser/ui/signin_view_controller_interactive_uitest.cc
@@ -65,7 +65,7 @@ run_loop_.Quit(); } - Browser* const browser_; + const raw_ptr<Browser> browser_; base::RunLoop run_loop_; base::ScopedObservation<LoginUIService, LoginUIService::Observer> login_ui_service_observation_{this};
diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc index 47f7747..e004d33 100644 --- a/chrome/browser/ui/tab_helpers.cc +++ b/chrome/browser/ui/tab_helpers.cc
@@ -72,6 +72,7 @@ #include "chrome/browser/safe_browsing/tailored_security/tailored_security_url_observer.h" #include "chrome/browser/safe_browsing/trigger_creator.h" #include "chrome/browser/search_engines/template_url_service_factory.h" +#include "chrome/browser/segmentation_platform/segmentation_platform_service_factory.h" #include "chrome/browser/sessions/session_tab_helper_factory.h" #include "chrome/browser/ssl/chrome_security_blocking_page_factory.h" #include "chrome/browser/ssl/connection_help_tab_helper.h" @@ -134,6 +135,7 @@ #include "components/safe_browsing/content/browser/safe_browsing_navigation_observer.h" #include "components/safe_browsing/content/browser/safe_browsing_tab_observer.h" #include "components/safe_browsing/core/common/features.h" +#include "components/segmentation_platform/content/segmentation_platform_tab_helper.h" #include "components/site_engagement/content/site_engagement_helper.h" #include "components/site_engagement/content/site_engagement_service.h" #include "components/tracing/common/tracing_switches.h" @@ -417,6 +419,10 @@ ReputationWebContentsObserver::CreateForWebContents(web_contents); SearchEngineTabHelper::CreateForWebContents(web_contents); SecurityStateTabHelper::CreateForWebContents(web_contents); + segmentation_platform::SegmentationPlatformTabHelper::CreateForWebContents( + web_contents, + segmentation_platform::SegmentationPlatformServiceFactory::GetForProfile( + profile)); if (base::FeatureList::IsEnabled(commerce::kShoppingList)) { shopping_list::ShoppingDataProvider::CreateForWebContents( web_contents,
diff --git a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service.h b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service.h index 13bfa2c9..6fe0de1 100644 --- a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service.h +++ b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UI_TABS_SAVED_TAB_GROUPS_SAVED_TAB_GROUP_KEYED_SERVICE_H_ #define CHROME_BROWSER_UI_TABS_SAVED_TAB_GROUPS_SAVED_TAB_GROUP_KEYED_SERVICE_H_ +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model.h" #include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.h" #include "components/keyed_service/core/keyed_service.h" @@ -26,7 +27,7 @@ private: SavedTabGroupModel model_; SavedTabGroupModelListener listener_; - Profile* profile_ = nullptr; + raw_ptr<Profile> profile_ = nullptr; }; #endif // CHROME_BROWSER_UI_TABS_SAVED_TAB_GROUPS_SAVED_TAB_GROUP_KEYED_SERVICE_H_
diff --git a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model.h b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model.h index ea2e12a9..e977885 100644 --- a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model.h +++ b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model.h
@@ -7,6 +7,7 @@ #include <vector> +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group.h" #include "base/observer_list.h" @@ -65,7 +66,7 @@ // The observers. base::ObserverList<SavedTabGroupModelObserver>::Unchecked observers_; std::vector<SavedTabGroup> saved_tab_groups_; - Profile* profile_ = nullptr; + raw_ptr<Profile> profile_ = nullptr; }; #endif // CHROME_BROWSER_UI_TABS_SAVED_TAB_GROUPS_SAVED_TAB_GROUP_MODEL_H_
diff --git a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.h b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.h index ba2726e..86be8bfd 100644 --- a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.h +++ b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.h
@@ -40,7 +40,7 @@ private: base::flat_set<raw_ptr<Browser>> observed_browsers_; - SavedTabGroupModel* model_ = nullptr; + raw_ptr<SavedTabGroupModel> model_ = nullptr; }; #endif // CHROME_BROWSER_UI_TABS_SAVED_TAB_GROUPS_SAVED_TAB_GROUP_MODEL_LISTENER_H_
diff --git a/chrome/browser/ui/tabs/tab_strip_model_observer.h b/chrome/browser/ui/tabs/tab_strip_model_observer.h index e020717..92ad342 100644 --- a/chrome/browser/ui/tabs/tab_strip_model_observer.h +++ b/chrome/browser/ui/tabs/tab_strip_model_observer.h
@@ -281,7 +281,7 @@ const VisualsChange* GetVisualsChange() const; tab_groups::TabGroupId group; - TabStripModel* model; + raw_ptr<TabStripModel> model; Type type; private:
diff --git a/chrome/browser/ui/views/commerce/ntp_discount_consent_dialog_view.cc b/chrome/browser/ui/views/commerce/ntp_discount_consent_dialog_view.cc index 89c637d5..3ec9f6e 100644 --- a/chrome/browser/ui/views/commerce/ntp_discount_consent_dialog_view.cc +++ b/chrome/browser/ui/views/commerce/ntp_discount_consent_dialog_view.cc
@@ -22,10 +22,17 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" +#include "ui/views/layout/fill_layout.h" +#include "ui/views/view_class_properties.h" namespace { +// TODO(crbug.com/1328709): These are approved one-off dialog style, we will +// migrate when this bug is resolved. // Spacing between child of the Discount Consent Dialog View constexpr int kChildSpacing = 24; +constexpr int kBannerImageTopMargin = 44; +constexpr int kBodyContainerHorizontalMargin = 22; +constexpr int kBodyContainerBottomMargin = 54; } // namespace namespace commerce { @@ -65,30 +72,54 @@ base::Unretained(this))); // Set up dialog content view. + auto* layout_provider = ChromeLayoutProvider::Get(); SetLayoutManager(std::make_unique<views::BoxLayout>( views::BoxLayout::Orientation::kVertical, - ChromeLayoutProvider::Get()->GetInsetsMetric(views::INSETS_DIALOG), - kChildSpacing)); + layout_provider->GetInsetsMetric(views::INSETS_DIALOG), kChildSpacing)); ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); - AddChildView(std::make_unique<ThemeTrackingNonAccessibleImageView>( - *bundle.GetImageSkiaNamed(IDR_NTP_CART_DISCOUNT_CONSENT_LIGHT), - *bundle.GetImageSkiaNamed(IDR_NTP_CART_DISCOUNT_CONSENT_DARK), - base::BindRepeating(&NtpDiscountConsentDialogView::GetBackgroundColor, - base::Unretained(this)))); + auto banner_image_container = std::make_unique<views::View>(); + banner_image_container->SetLayoutManager( + std::make_unique<views::FillLayout>()); + banner_image_container->SetProperty( + views::kMarginsKey, gfx::Insets::TLBR(kBannerImageTopMargin, 0, 0, 0)); + // It is safe to use base::Unretained() here because the GetBackgroundColor + // will not be called after this class is destroyed. + banner_image_container->AddChildView( + std::make_unique<ThemeTrackingNonAccessibleImageView>( + *bundle.GetImageSkiaNamed(IDR_NTP_CART_DISCOUNT_CONSENT_LIGHT), + *bundle.GetImageSkiaNamed(IDR_NTP_CART_DISCOUNT_CONSENT_DARK), + base::BindRepeating(&NtpDiscountConsentDialogView::GetBackgroundColor, + base::Unretained(this)))); + AddChildView(std::move(banner_image_container)); - auto title_label = std::make_unique<views::Label>( - l10n_util::GetStringUTF16(IDS_NATIVE_NTP_CART_DISCOUNT_CONSENT_TITLE), - CONTEXT_HEADLINE, views::style::STYLE_PRIMARY); - auto* title = AddChildView(std::move(title_label)); - title->SetMultiLine(true); + // TODO(crbug.com/1331844): Remove the view wrappers when the bug is resolved. + auto title_container = std::make_unique<views::View>(); + title_container->SetLayoutManager(std::make_unique<views::FillLayout>()); + auto* title_label = + title_container->AddChildView(std::make_unique<views::Label>( + l10n_util::GetStringUTF16(IDS_NATIVE_NTP_CART_DISCOUNT_CONSENT_TITLE), + CONTEXT_HEADLINE, views::style::STYLE_PRIMARY)); + title_label->SetMultiLine(true); + AddChildView(std::move(title_container)); - auto consent_label = std::make_unique<views::Label>( - l10n_util::GetStringUTF16(IDS_NATIVE_NTP_CART_DISCOUNT_CONSENT_BODY), - views::style::CONTEXT_DIALOG_BODY_TEXT, views::style::STYLE_SECONDARY); - auto* consent = AddChildView(std::move(consent_label)); - consent->SetMultiLine(true); + // TODO(crbug.com/1331844): Remove the view wrappers when the bug is resolved. + auto body_container = std::make_unique<views::View>(); + body_container->SetLayoutManager(std::make_unique<views::FillLayout>()); + body_container->SetProperty( + views::kMarginsKey, gfx::Insets::TLBR(0, kBodyContainerHorizontalMargin, + kBodyContainerBottomMargin, + kBodyContainerHorizontalMargin)); + auto* consent_label = + body_container->AddChildView(std::make_unique<views::Label>( + l10n_util::GetStringUTF16(IDS_NATIVE_NTP_CART_DISCOUNT_CONSENT_BODY), + views::style::CONTEXT_DIALOG_BODY_TEXT, + views::style::STYLE_SECONDARY)); + consent_label->SetHorizontalAlignment(gfx::ALIGN_CENTER); + consent_label->SetAllowCharacterBreak(true); + consent_label->SetMultiLine(true); + AddChildView(std::move(body_container)); } NtpDiscountConsentDialogView::~NtpDiscountConsentDialogView() = default;
diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_row_view.h b/chrome/browser/ui/views/download/bubble/download_bubble_row_view.h index 9751360..5eeba89 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_row_view.h +++ b/chrome/browser/ui/views/download/bubble/download_bubble_row_view.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UI_VIEWS_DOWNLOAD_BUBBLE_DOWNLOAD_BUBBLE_ROW_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_DOWNLOAD_BUBBLE_DOWNLOAD_BUBBLE_ROW_VIEW_H_ +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/task/cancelable_task_tracker.h" #include "chrome/browser/download/download_ui_model.h" @@ -140,7 +141,7 @@ DownloadUIModel::BubbleUIInfo ui_info_; bool is_paused_; - const gfx::VectorIcon* last_overriden_icon_ = nullptr; + raw_ptr<const gfx::VectorIcon> last_overriden_icon_ = nullptr; bool already_set_default_icon_ = false; // HoverButton for main button click and inkdrop animations.
diff --git a/chrome/browser/ui/views/extensions/extension_popup.cc b/chrome/browser/ui/views/extensions/extension_popup.cc index 772d8d7..4202c5e 100644 --- a/chrome/browser/ui/views/extensions/extension_popup.cc +++ b/chrome/browser/ui/views/extensions/extension_popup.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/views/extensions/extension_popup.h" +#include "base/memory/raw_ptr.h" #include "chrome/browser/devtools/devtools_window.h" #include "chrome/browser/extensions/extension_view_host.h" #include "chrome/browser/ui/browser.h" @@ -56,7 +57,7 @@ } private: - content::DevToolsAgentHostObserver* observer_; + raw_ptr<content::DevToolsAgentHostObserver> observer_; }; // static
diff --git a/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view_unittest.cc b/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view_unittest.cc index 6fa627e0..957cf6f 100644 --- a/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view_unittest.cc +++ b/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view_unittest.cc
@@ -7,6 +7,7 @@ #include <string> #include "base/feature_list.h" +#include "base/memory/raw_ptr.h" #include "base/test/metrics/user_action_tester.h" #include "build/build_config.h" #include "chrome/browser/extensions/chrome_test_extension_loader.h" @@ -66,7 +67,7 @@ private: std::unique_ptr<Browser> browser_; - BrowserView* browser_view_; + raw_ptr<BrowserView> browser_view_; }; std::vector<std::string> GetNamesFromMenuItems( @@ -181,7 +182,7 @@ private: base::test::ScopedFeatureList scoped_feature_list_; - content::WebContentsTester* web_contents_tester_; + raw_ptr<content::WebContentsTester> web_contents_tester_; }; ExtensionsTabbedMenuViewUnitTest::ExtensionsTabbedMenuViewUnitTest() {
diff --git a/chrome/browser/ui/views/global_media_controls/media_dialog_ui_for_test.cc b/chrome/browser/ui/views/global_media_controls/media_dialog_ui_for_test.cc index 4a3c86e..316b29a6 100644 --- a/chrome/browser/ui/views/global_media_controls/media_dialog_ui_for_test.cc +++ b/chrome/browser/ui/views/global_media_controls/media_dialog_ui_for_test.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/ui/views/global_media_controls/media_dialog_ui_for_test.h" +#include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "chrome/browser/ui/global_media_controls/media_toolbar_button_observer.h" #include "chrome/browser/ui/views/frame/browser_view.h" @@ -211,7 +212,7 @@ .size(); } - MediaToolbarButtonView* const button_; + const raw_ptr<MediaToolbarButtonView> button_; std::unique_ptr<base::RunLoop> run_loop_; bool waiting_for_dialog_opened_ = false; @@ -220,7 +221,7 @@ bool waiting_for_item_count_ = false; bool waiting_for_pip_visibility_changed_ = false; - MediaDialogView* observed_dialog_ = nullptr; + raw_ptr<MediaDialogView> observed_dialog_ = nullptr; bool waiting_for_dialog_to_contain_text_ = false; std::u16string expected_text_; int expected_item_count_ = 0;
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view_unittest.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view_unittest.cc index 2ab3e82..4f6c28fc 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view_unittest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view_unittest.cc
@@ -25,6 +25,10 @@ #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/widget/widget.h" +#if defined(USE_AURA) +#include "ui/aura/env.h" +#endif + namespace { // An arbitrary index for the result view under test. Used to test the selection @@ -59,18 +63,16 @@ class OmniboxResultViewTest : public ChromeViewsTestBase { public: void SetUp() override { - ChromeViewsTestBase::SetUp(); - - // Create a widget and assign bounds to support calls to HitTestPoint. - widget_ = CreateTestWidget(); - - // Install |test_screen_| after superclass setup and widget creation; on Ash - // both these require the Screen to work well with the underlying Shell, and - // TestScreen has no knowledge of that. +#if !defined(USE_AURA) test_screen_ = std::make_unique<display::test::TestScreen>(); scoped_screen_override_ = std::make_unique<display::test::ScopedScreenOverride>( test_screen_.get()); +#endif + ChromeViewsTestBase::SetUp(); + + // Create a widget and assign bounds to support calls to HitTestPoint. + widget_ = CreateTestWidget(); edit_model_ = std::make_unique<OmniboxEditModel>( nullptr, nullptr, std::make_unique<TestOmniboxClient>()); @@ -89,10 +91,10 @@ } void TearDown() override { - scoped_screen_override_.reset(); - test_screen_.reset(); widget_.reset(); ChromeViewsTestBase::TearDown(); + scoped_screen_override_.reset(); + test_screen_.reset(); } // Also sets the fake screen's mouse cursor to 0, 0. @@ -105,7 +107,11 @@ int flags, float x, float y) { +#if !defined(USE_AURA) test_screen_->set_cursor_screen_point(gfx::Point(x, y)); +#else + aura::Env::GetInstance()->SetLastMouseLocation(gfx::Point(x, y)); +#endif return ui::MouseEvent(type, gfx::Point(x, y), gfx::Point(), ui::EventTimeForNow(), flags, 0); }
diff --git a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.cc b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.cc index f911247..eb19367 100644 --- a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.cc +++ b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.h" +#include "base/memory/raw_ptr.h" #include "base/metrics/histogram_functions.h" #include "chrome/browser/privacy_sandbox/privacy_sandbox_service.h" #include "chrome/browser/privacy_sandbox/privacy_sandbox_service_factory.h" @@ -54,7 +55,7 @@ } private: - Browser* browser_; + raw_ptr<Browser> browser_; }; } // namespace
diff --git a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble.cc b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble.cc index a6ac872..fb5f5c05 100644 --- a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble.cc +++ b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble.h" +#include "base/memory/raw_ptr.h" #include "chrome/browser/privacy_sandbox/privacy_sandbox_service.h" #include "chrome/browser/privacy_sandbox/privacy_sandbox_service_factory.h" #include "chrome/browser/ui/browser.h" @@ -72,7 +73,7 @@ } private: - Browser* browser_; + raw_ptr<Browser> browser_; bool has_user_interacted_ = false; };
diff --git a/chrome/browser/ui/views/profiles/profile_menu_view_browsertest.cc b/chrome/browser/ui/views/profiles/profile_menu_view_browsertest.cc index 08e46eb..263fecc 100644 --- a/chrome/browser/ui/views/profiles/profile_menu_view_browsertest.cc +++ b/chrome/browser/ui/views/profiles/profile_menu_view_browsertest.cc
@@ -374,7 +374,9 @@ return IdentityManagerFactory::GetForProfile(GetProfile()); } - Profile* GetProfile() { return profile_ ? profile_ : browser()->profile(); } + Profile* GetProfile() { + return profile_ ? profile_.get() : browser()->profile(); + } #if BUILDFLAG(IS_CHROMEOS_LACROS) void UseSecondaryProfile() { @@ -398,7 +400,7 @@ private: CoreAccountId account_id_; - Profile* profile_ = nullptr; + raw_ptr<Profile> profile_ = nullptr; }; #if BUILDFLAG(IS_CHROMEOS_LACROS) @@ -780,7 +782,9 @@ } #endif - Profile* GetProfile() { return profile_ ? profile_ : browser()->profile(); } + Profile* GetProfile() { + return profile_ ? profile_.get() : browser()->profile(); + } virtual ProfileMenuViewBase::ActionableItem GetExpectedActionableItemAtIndex( size_t index) = 0; @@ -844,7 +848,7 @@ base::CallbackListSubscription test_signin_client_subscription_; base::HistogramTester histogram_tester_; std::unique_ptr<SyncServiceImplHarness> sync_harness_; - Profile* profile_ = nullptr; + raw_ptr<Profile> profile_ = nullptr; }; #define PROFILE_MENU_CLICK_TEST(actionable_item_list, test_case_name) \
diff --git a/chrome/browser/ui/views/sharing_hub/preview_view.h b/chrome/browser/ui/views/sharing_hub/preview_view.h index 29050343d..adf318f2 100644 --- a/chrome/browser/ui/views/sharing_hub/preview_view.h +++ b/chrome/browser/ui/views/sharing_hub/preview_view.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UI_VIEWS_SHARING_HUB_PREVIEW_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_SHARING_HUB_PREVIEW_VIEW_H_ +#include "base/memory/raw_ptr.h" #include "chrome/browser/share/share_attempt.h" #include "ui/base/models/image_model.h" #include "ui/views/view.h" @@ -50,9 +51,9 @@ private: base::CallbackListSubscription subscription_; - views::Label* title_ = nullptr; - views::Label* url_ = nullptr; - views::ImageView* image_ = nullptr; + raw_ptr<views::Label> title_ = nullptr; + raw_ptr<views::Label> url_ = nullptr; + raw_ptr<views::ImageView> image_ = nullptr; }; } // namespace sharing_hub
diff --git a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_action_button.h b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_action_button.h index 40558a5..635ff11 100644 --- a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_action_button.h +++ b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_action_button.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_SHARING_HUB_SHARING_HUB_BUBBLE_ACTION_BUTTON_H_ #include "base/bind.h" +#include "base/memory/raw_ptr.h" #include "ui/views/controls/button/button.h" namespace views { @@ -48,8 +49,8 @@ const bool action_is_first_party_; const std::string action_name_for_metrics_; - views::Label* title_; - views::ImageView* image_; + raw_ptr<views::Label> title_; + raw_ptr<views::ImageView> image_; void UpdateColors(); };
diff --git a/chrome/browser/ui/views/side_panel/read_anything/read_anything_controller.h b/chrome/browser/ui/views/side_panel/read_anything/read_anything_controller.h index 22d8019..6374363 100644 --- a/chrome/browser/ui/views/side_panel/read_anything/read_anything_controller.h +++ b/chrome/browser/ui/views/side_panel/read_anything/read_anything_controller.h
@@ -7,6 +7,7 @@ #include <vector> +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" #include "chrome/browser/ui/views/side_panel/read_anything/read_anything_coordinator.h" @@ -77,7 +78,7 @@ // ReadAnythingController is owned by ReadAnythingCoordinator which is a // browser user data, so this pointer is always valid. - Browser* browser_; + raw_ptr<Browser> browser_; base::WeakPtrFactory<ReadAnythingController> weak_pointer_factory_{this}; };
diff --git a/chrome/browser/ui/views/side_panel/read_anything/read_anything_toolbar_view.h b/chrome/browser/ui/views/side_panel/read_anything/read_anything_toolbar_view.h index 71c2f33..840e687c 100644 --- a/chrome/browser/ui/views/side_panel/read_anything/read_anything_toolbar_view.h +++ b/chrome/browser/ui/views/side_panel/read_anything/read_anything_toolbar_view.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UI_VIEWS_SIDE_PANEL_READ_ANYTHING_READ_ANYTHING_TOOLBAR_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_SIDE_PANEL_READ_ANYTHING_READ_ANYTHING_TOOLBAR_VIEW_H_ +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/views/side_panel/read_anything/read_anything_coordinator.h" #include "ui/base/models/combobox_model.h" @@ -39,7 +40,7 @@ raw_ptr<views::Combobox> font_combobox_; raw_ptr<ReadAnythingToolbarView::Delegate> delegate_; - ReadAnythingCoordinator* coordinator_; + raw_ptr<ReadAnythingCoordinator> coordinator_; base::WeakPtrFactory<ReadAnythingToolbarView> weak_pointer_factory_{this}; };
diff --git a/chrome/browser/ui/views/tabs/alert_indicator_button.h b/chrome/browser/ui/views/tabs/alert_indicator_button.h index b22209c..e2d8f60 100644 --- a/chrome/browser/ui/views/tabs/alert_indicator_button.h +++ b/chrome/browser/ui/views/tabs/alert_indicator_button.h
@@ -7,6 +7,7 @@ #include <memory> +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/tabs/tab_utils.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/metadata/metadata_header_macros.h" @@ -89,7 +90,7 @@ // parent tab's button color. Should be called when either of these changes. void ResetImages(TabAlertState state); - Tab* const parent_tab_; + const raw_ptr<Tab> parent_tab_; absl::optional<TabAlertState> alert_state_;
diff --git a/chrome/browser/ui/views/tabs/tab_container.h b/chrome/browser/ui/views/tabs/tab_container.h index 81ffefc6..ee8d202 100644 --- a/chrome/browser/ui/views/tabs/tab_container.h +++ b/chrome/browser/ui/views/tabs/tab_container.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTAINER_H_ #include <memory> +#include "base/memory/raw_ptr.h" #include "base/timer/timer.h" #include "chrome/browser/ui/views/frame/browser_root_view.h" #include "chrome/browser/ui/views/tabs/tab.h" @@ -308,17 +309,17 @@ // the remove animation completes. views::ViewModelT<Tab> tabs_view_model_; - TabStripController* controller_; + raw_ptr<TabStripController> controller_; - TabHoverCardController* hover_card_controller_; + raw_ptr<TabHoverCardController> hover_card_controller_; // May be nullptr in tests. - TabDragContext* drag_context_; + raw_ptr<TabDragContext> drag_context_; - TabSlotController* tab_slot_controller_; + raw_ptr<TabSlotController> tab_slot_controller_; // The View that is to be scrolled by |tab_scrolling_animation_|. - views::View* scroll_contents_view_; + raw_ptr<views::View> scroll_contents_view_; // Responsible for animating tabs in response to model changes. views::BoundsAnimator bounds_animator_;
diff --git a/chrome/browser/ui/views/tabs/tab_strip.h b/chrome/browser/ui/views/tabs/tab_strip.h index 629bcbd..03a779ac 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.h +++ b/chrome/browser/ui/views/tabs/tab_strip.h
@@ -444,7 +444,7 @@ std::unique_ptr<TabDragContextImpl> drag_context_; // The View parent for the tabs and the various group views. - TabContainer* tab_container_; + raw_ptr<TabContainer> tab_container_; // The background offset used by inactive tabs to match the frame image. int background_offset_ = 0;
diff --git a/chrome/browser/ui/views/test/view_event_test_base.cc b/chrome/browser/ui/views/test/view_event_test_base.cc index 54c917a..fed341ee 100644 --- a/chrome/browser/ui/views/test/view_event_test_base.cc +++ b/chrome/browser/ui/views/test/view_event_test_base.cc
@@ -14,13 +14,13 @@ #include "chrome/test/base/interactive_test_utils.h" #include "chrome/test/base/testing_browser_process.h" #include "mojo/core/embedder/embedder.h" +#include "ui/display/screen.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" #if defined(USE_AURA) && !BUILDFLAG(IS_CHROMEOS_ASH) -#include "ui/display/screen.h" #include "ui/views/widget/desktop_aura/desktop_screen.h" #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && defined(USE_OZONE) @@ -98,13 +98,12 @@ // TODO(pkasting): Determine why the TestScreen in AuraTestHelper is // insufficient for these tests, then either bolster/replace it or fix the // tests. - DCHECK(!display::Screen::GetScreen()); + DCHECK(!display::Screen::HasScreen()); #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && defined(USE_OZONE) - if (!display::Screen::GetScreen()) - display::Screen::SetScreenInstance( - views::test::TestDesktopScreenOzone::GetInstance()); + if (!display::Screen::HasScreen()) + screen_ = views::test::TestDesktopScreenOzone::Create(); #endif - if (!display::Screen::GetScreen()) + if (!display::Screen::HasScreen()) screen_ = views::CreateDesktopScreen(); #endif }
diff --git a/chrome/browser/ui/views/toolbar/back_forward_button.h b/chrome/browser/ui/views/toolbar/back_forward_button.h index b5b5ea39..9abc4e8 100644 --- a/chrome/browser/ui/views/toolbar/back_forward_button.h +++ b/chrome/browser/ui/views/toolbar/back_forward_button.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_BACK_FORWARD_BUTTON_H_ #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_BACK_FORWARD_BUTTON_H_ +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/views/toolbar/toolbar_button.h" #include "ui/base/metadata/metadata_header_macros.h" @@ -29,7 +30,7 @@ const std::u16string GetAccessiblePageLoadingMessage(); - Browser* const browser_; + const raw_ptr<Browser> browser_; }; #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_BACK_FORWARD_BUTTON_H_
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs_unittest.cc b/chrome/browser/ui/views/toolbar/chrome_labs_unittest.cc index 4d43d6c..9b5bad1a 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs_unittest.cc +++ b/chrome/browser/ui/views/toolbar/chrome_labs_unittest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.h" #include "base/containers/cxx20_erase_vector.h" +#include "base/memory/raw_ptr.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" @@ -388,8 +389,8 @@ protected: ScopedChromeLabsModelDataForTesting scoped_chrome_labs_model_data_; - ChromeLabsBubbleView* bubble_view_; - views::Widget* bubble_widget_; + raw_ptr<ChromeLabsBubbleView> bubble_view_; + raw_ptr<views::Widget> bubble_widget_; private: #if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/ui/views/web_apps/web_app_identity_update_confirmation_view_browsertest.cc b/chrome/browser/ui/views/web_apps/web_app_identity_update_confirmation_view_browsertest.cc index f07d1fc..dd13125 100644 --- a/chrome/browser/ui/views/web_apps/web_app_identity_update_confirmation_view_browsertest.cc +++ b/chrome/browser/ui/views/web_apps/web_app_identity_update_confirmation_view_browsertest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/bind.h" +#include "base/memory/raw_ptr.h" #include "base/test/bind.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_dialogs.h" @@ -42,7 +43,7 @@ } protected: - web_app::WebAppProvider* provider_ = nullptr; + raw_ptr<web_app::WebAppProvider> provider_ = nullptr; std::string app_id_; };
diff --git a/chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_browsertest.cc b/chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_browsertest.cc index ec732ef2..0bf30af 100644 --- a/chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_browsertest.cc +++ b/chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_browsertest.cc
@@ -235,8 +235,9 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) // Test that we don't crash when uninstalling a web app from a web app window in // Ash. Context: crbug.com/825554 +// TODO(crbug.com/1332923): The test is flaky. IN_PROC_BROWSER_TEST_F(WebAppUninstallDialogViewBrowserTest, - WebAppWindowAshCrash) { + DISABLED_WebAppWindowAshCrash) { AppId app_id = InstallTestWebApp(browser()->profile()); Browser* app_browser = web_app::LaunchWebAppBrowser(browser()->profile(), app_id);
diff --git a/chrome/browser/ui/views/webauthn/authenticator_qr_sheet_view.cc b/chrome/browser/ui/views/webauthn/authenticator_qr_sheet_view.cc index bfdbbccd9..6b66a62 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_qr_sheet_view.cc +++ b/chrome/browser/ui/views/webauthn/authenticator_qr_sheet_view.cc
@@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/callback.h" #include "base/feature_list.h" +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/services/qrcode_generator/public/cpp/qrcode_generator_service.h" #include "chrome/services/qrcode_generator/public/mojom/qrcode_generator.mojom.h" @@ -109,7 +110,7 @@ } std::string qr_string_; - views::ImageView* qr_code_image_; + raw_ptr<views::ImageView> qr_code_image_; // Service instance for QR code image generation. mojo::Remote<qrcode_generator::mojom::QRCodeGeneratorService>
diff --git a/chrome/browser/ui/views/webid/account_selection_bubble_view.h b/chrome/browser/ui/views/webid/account_selection_bubble_view.h index ba8234351..eda7ffe 100644 --- a/chrome/browser/ui/views/webid/account_selection_bubble_view.h +++ b/chrome/browser/ui/views/webid/account_selection_bubble_view.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_WEBID_ACCOUNT_SELECTION_BUBBLE_VIEW_H_ #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/webid/account_selection_view.h" #include "components/image_fetcher/core/image_fetcher.h" @@ -122,16 +123,16 @@ const content::ClientIdData client_data_; // View containing the logo of the identity provider and the title. - views::View* header_view_{nullptr}; + raw_ptr<views::View> header_view_{nullptr}; // View containing the bubble icon. - views::ImageView* bubble_icon_view_{nullptr}; + raw_ptr<views::ImageView> bubble_icon_view_{nullptr}; // View containing the bubble title. - views::Label* title_label_{nullptr}; + raw_ptr<views::Label> title_label_{nullptr}; // View containing the continue button. - views::View* continue_button_{nullptr}; + raw_ptr<views::View> continue_button_{nullptr}; // Used to differentiate UI dismissal scenarios. bool verify_sheet_shown_{false};
diff --git a/chrome/browser/ui/views/webid/fake_delegate.h b/chrome/browser/ui/views/webid/fake_delegate.h index c68ee89..6a0fc35c 100644 --- a/chrome/browser/ui/views/webid/fake_delegate.h +++ b/chrome/browser/ui/views/webid/fake_delegate.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UI_VIEWS_WEBID_FAKE_DELEGATE_H_ #define CHROME_BROWSER_UI_VIEWS_WEBID_FAKE_DELEGATE_H_ +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/webid/account_selection_view.h" #include "ui/gfx/native_widget_types.h" @@ -24,7 +25,7 @@ content::WebContents* GetWebContents() override; private: - content::WebContents* web_contents_; + raw_ptr<content::WebContents> web_contents_; }; #endif // CHROME_BROWSER_UI_VIEWS_WEBID_FAKE_DELEGATE_H_
diff --git a/chrome/browser/ui/web_applications/app_browser_controller.cc b/chrome/browser/ui/web_applications/app_browser_controller.cc index 160e687..4b8b264 100644 --- a/chrome/browser/ui/web_applications/app_browser_controller.cc +++ b/chrome/browser/ui/web_applications/app_browser_controller.cc
@@ -559,7 +559,8 @@ color_utils::GetColorWithMaxContrast(colors.active_tab_color); theme_pack_ = base::MakeRefCounted<BrowserThemePack>( - CustomThemeSupplier::AUTOGENERATED); + ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType:: + kAutogenerated); BrowserThemePack::BuildFromColors(colors, theme_pack_.get()); if (browser_->window()) browser_->window()->UserChangedTheme(BrowserThemeChangeType::kWebAppTheme);
diff --git a/chrome/browser/ui/webui/apc_internals/apc_internals_handler.cc b/chrome/browser/ui/webui/apc_internals/apc_internals_handler.cc index d5a17cd..c69bc542 100644 --- a/chrome/browser/ui/webui/apc_internals/apc_internals_handler.cc +++ b/chrome/browser/ui/webui/apc_internals/apc_internals_handler.cc
@@ -53,6 +53,11 @@ "refresh-script-cache", base::BindRepeating(&APCInternalsHandler::OnRefreshScriptCacheRequested, base::Unretained(this))); + + web_ui()->RegisterMessageCallback( + "set-autofill-assistant-url", + base::BindRepeating(&APCInternalsHandler::OnSetAutofillAssistantUrl, + base::Unretained(this))); } void APCInternalsHandler::OnLoaded(const base::Value::List& args) { @@ -63,6 +68,10 @@ base::Value(GetAPCRelatedFlags())); FireWebUIListener("on-script-fetching-information-received", base::Value(GetPasswordScriptFetcherInformation())); + UpdateAutofillAssistantInformation(); +} + +void APCInternalsHandler::UpdateAutofillAssistantInformation() { FireWebUIListener("on-autofill-assistant-information-received", base::Value(GetAutofillAssistantInformation())); } @@ -81,6 +90,23 @@ } } +void APCInternalsHandler::OnSetAutofillAssistantUrl( + const base::Value::List& args) { + if (args.size() == 1 && args.front().is_string()) { + const std::string& autofill_assistant_url = args.front().GetString(); + auto* command_line = base::CommandLine::ForCurrentProcess(); + + command_line->RemoveSwitch( + autofill_assistant::switches::kAutofillAssistantUrl); + + command_line->AppendSwitchASCII( + autofill_assistant::switches::kAutofillAssistantUrl, + autofill_assistant_url); + + UpdateAutofillAssistantInformation(); + } +} + PasswordScriptsFetcher* APCInternalsHandler::GetPasswordScriptsFetcher() { return PasswordScriptsFetcherFactory::GetForBrowserContext( web_ui()->GetWebContents()->GetBrowserContext());
diff --git a/chrome/browser/ui/webui/apc_internals/apc_internals_handler.h b/chrome/browser/ui/webui/apc_internals/apc_internals_handler.h index d849320..f5a9a47 100644 --- a/chrome/browser/ui/webui/apc_internals/apc_internals_handler.h +++ b/chrome/browser/ui/webui/apc_internals/apc_internals_handler.h
@@ -35,6 +35,14 @@ // Called by user-triggered DOM event. void OnRefreshScriptCacheRequested(const base::Value::List& args); + // Fires "on-autofill-assistant-information-received" to update Autofill + // Assistant Information on the page. + void UpdateAutofillAssistantInformation(); + + // Responds to requests for setting the Autofill Assistant URL. Called by + // user-triggered DOM event. + void OnSetAutofillAssistantUrl(const base::Value::List& args); + // Returns a raw pointer to the |PasswordScriptsFetcher| keyed service. password_manager::PasswordScriptsFetcher* GetPasswordScriptsFetcher();
diff --git a/chrome/browser/ui/webui/browsing_topics/browsing_topics_internals_page_handler.h b/chrome/browser/ui/webui/browsing_topics/browsing_topics_internals_page_handler.h index a851e6e..376d2a03 100644 --- a/chrome/browser/ui/webui/browsing_topics/browsing_topics_internals_page_handler.h +++ b/chrome/browser/ui/webui/browsing_topics/browsing_topics_internals_page_handler.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UI_WEBUI_BROWSING_TOPICS_BROWSING_TOPICS_INTERNALS_PAGE_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_BROWSING_TOPICS_BROWSING_TOPICS_INTERNALS_PAGE_HANDLER_H_ +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "components/browsing_topics/mojom/browsing_topics_internals.mojom.h" #include "components/optimization_guide/core/page_content_annotations_common.h" @@ -50,7 +51,7 @@ browsing_topics::mojom::PageHandler::ClassifyHostsCallback callback, const std::vector<optimization_guide::BatchAnnotationResult>& results); - Profile* const profile_; + const raw_ptr<Profile> profile_; mojo::Receiver<browsing_topics::mojom::PageHandler> receiver_;
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index b917df9..b021aad 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -187,6 +187,8 @@ #include "ash/webui/file_manager/url_constants.h" #include "ash/webui/firmware_update_ui/firmware_update_app_ui.h" #include "ash/webui/firmware_update_ui/url_constants.h" +#include "ash/webui/guest_os_installer/guest_os_installer_ui.h" +#include "ash/webui/guest_os_installer/url_constants.h" #include "ash/webui/help_app_ui/help_app_ui.h" #include "ash/webui/help_app_ui/url_constants.h" #include "ash/webui/media_app_ui/media_app_ui.h" @@ -216,6 +218,7 @@ #include "chrome/browser/ash/arc/arc_util.h" #include "chrome/browser/ash/device_sync/device_sync_client_factory.h" #include "chrome/browser/ash/eche_app/eche_app_manager_factory.h" +#include "chrome/browser/ash/guest_os/public/installer_delegate_factory.h" #include "chrome/browser/ash/login/easy_unlock/easy_unlock_service.h" #include "chrome/browser/ash/login/easy_unlock/easy_unlock_service_factory.h" #include "chrome/browser/ash/login/login_pref_names.h" @@ -665,6 +668,13 @@ return ash::personalization_app::CreatePersonalizationAppUI(web_ui); } +template <> +WebUIController* NewWebUI<ash::GuestOSInstallerUI>(WebUI* web_ui, + const GURL& url) { + return new ash::GuestOSInstallerUI( + web_ui, url, base::BindRepeating(&guest_os::InstallerDelegateFactory)); +} + #endif // BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(ENABLE_DICE_SUPPORT) @@ -954,6 +964,8 @@ return &NewWebUI<chromeos::CertificateManagerDialogUI>; if (url.host_piece() == ash::kChromeUIConnectivityDiagnosticsHost) return &NewWebUI<ash::ConnectivityDiagnosticsUI>; + if (url.host_piece() == ash::kChromeUIGuestOSInstallerHost) + return &NewWebUI<ash::GuestOSInstallerUI>; if (url.host_piece() == chrome::kChromeUICrostiniInstallerHost) return &NewWebUI<chromeos::CrostiniInstallerUI>; if (url.host_piece() == chrome::kChromeUICrostiniUpgraderHost)
diff --git a/chrome/browser/ui/webui/chromeos/guest_os_installer/DIR_METADATA b/chrome/browser/ui/webui/chromeos/guest_os_installer/DIR_METADATA new file mode 100644 index 0000000..b3cd940 --- /dev/null +++ b/chrome/browser/ui/webui/chromeos/guest_os_installer/DIR_METADATA
@@ -0,0 +1,3 @@ +monorail { + component: "UI>Shell>Containers" +}
diff --git a/chrome/browser/ui/webui/chromeos/guest_os_installer/OWNERS b/chrome/browser/ui/webui/chromeos/guest_os_installer/OWNERS new file mode 100644 index 0000000..a33be2b --- /dev/null +++ b/chrome/browser/ui/webui/chromeos/guest_os_installer/OWNERS
@@ -0,0 +1 @@ +file://chrome/browser/ash/guest_os/OWNERS
diff --git a/chrome/browser/ui/webui/chromeos/guest_os_installer/guest_os_installer_dialog.cc b/chrome/browser/ui/webui/chromeos/guest_os_installer/guest_os_installer_dialog.cc new file mode 100644 index 0000000..d2f3380 --- /dev/null +++ b/chrome/browser/ui/webui/chromeos/guest_os_installer/guest_os_installer_dialog.cc
@@ -0,0 +1,80 @@ +// 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. + +#include "chrome/browser/ui/webui/chromeos/guest_os_installer/guest_os_installer_dialog.h" + +#include "ash/constants/ash_features.h" +#include "ash/public/cpp/shelf_types.h" +#include "ash/public/cpp/window_properties.h" +#include "ui/aura/client/aura_constants.h" +#include "ui/base/resource/resource_bundle.h" + +namespace { +// The dialog content area size. Note that the height is less than the design +// spec to compensate for title bar height. +constexpr int kDialogWidth = 768; +constexpr int kDialogHeight = 608; + +} // namespace + +namespace chromeos { + +void GuestOSInstallerDialog::Show(const GURL& page_url) { + if (!base::FeatureList::IsEnabled(ash::features::kGuestOSGenericInstaller)) { + return; + } + + auto* instance = SystemWebDialogDelegate::FindInstance(page_url.spec()); + if (instance) { + instance->Focus(); + return; + } + + instance = new GuestOSInstallerDialog(page_url); + instance->ShowSystemDialog(); +} + +GuestOSInstallerDialog::GuestOSInstallerDialog(const GURL& url) + : SystemWebDialogDelegate(url, /*title=*/{}) {} + +GuestOSInstallerDialog::~GuestOSInstallerDialog() = default; + +void GuestOSInstallerDialog::GetDialogSize(gfx::Size* size) const { + size->SetSize(::kDialogWidth, ::kDialogHeight); +} + +std::u16string GuestOSInstallerDialog::GetDialogTitle() const { + // Set GuestOS specific title here + return {}; +} + +bool GuestOSInstallerDialog::ShouldShowCloseButton() const { + return true; +} + +bool GuestOSInstallerDialog::ShouldShowDialogTitle() const { + return false; +} + +bool GuestOSInstallerDialog::ShouldCloseDialogOnEscape() const { + return false; +} + +void GuestOSInstallerDialog::AdjustWidgetInitParams( + views::Widget::InitParams* params) { + params->z_order = ui::ZOrderLevel::kNormal; + + const ash::ShelfID shelf_id(Id()); + params->init_properties_container.SetProperty(ash::kShelfIDKey, + shelf_id.Serialize()); + params->init_properties_container.SetProperty<int>(ash::kShelfItemTypeKey, + ash::TYPE_DIALOG); + + gfx::ImageSkia image; + // Load GuestOS shelf icons here + params->init_properties_container.SetProperty(aura::client::kAppIconKey, + image); +} + +} // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/guest_os_installer/guest_os_installer_dialog.h b/chrome/browser/ui/webui/chromeos/guest_os_installer/guest_os_installer_dialog.h new file mode 100644 index 0000000..3474bf37 --- /dev/null +++ b/chrome/browser/ui/webui/chromeos/guest_os_installer/guest_os_installer_dialog.h
@@ -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. + +#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_GUEST_OS_INSTALLER_GUEST_OS_INSTALLER_DIALOG_H_ +#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_GUEST_OS_INSTALLER_GUEST_OS_INSTALLER_DIALOG_H_ + +#include "chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h" + +namespace chromeos { + +class GuestOSInstallerDialog : public SystemWebDialogDelegate { + public: + static void Show(const GURL& page_url); + + private: + explicit GuestOSInstallerDialog(const GURL& page_url); + ~GuestOSInstallerDialog() override; + + // SystemWebDialogDelegate: + void GetDialogSize(gfx::Size* size) const override; + std::u16string GetDialogTitle() const override; + bool ShouldShowCloseButton() const override; + bool ShouldShowDialogTitle() const override; + bool ShouldCloseDialogOnEscape() const override; + void AdjustWidgetInitParams(views::Widget::InitParams* params) override; +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_GUEST_OS_INSTALLER_GUEST_OS_INSTALLER_DIALOG_H_
diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc index 424cf4e6..aafbfe21 100644 --- a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc +++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc
@@ -84,7 +84,9 @@ DCHECK(theme_service); const auto* theme_supplier = theme_service->GetThemeSupplier(); if (!theme_supplier || - theme_supplier->get_theme_type() != CustomThemeSupplier::EXTENSION) { + theme_supplier->get_theme_type() != + ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType:: + kExtension) { return false; } @@ -121,7 +123,9 @@ const ThemeService* theme_service) { const auto* theme_supplier = theme_service->GetThemeSupplier(); if (!theme_supplier || - theme_supplier->get_theme_type() != CustomThemeSupplier::EXTENSION) { + theme_supplier->get_theme_type() != + ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType:: + kExtension) { return false; } static constexpr auto kPrideThemeExtensionIdsDarkForeground =
diff --git a/chrome/browser/ui/webui/profile_helper_browsertest.cc b/chrome/browser/ui/webui/profile_helper_browsertest.cc index 4c36b94..59f3bc3 100644 --- a/chrome/browser/ui/webui/profile_helper_browsertest.cc +++ b/chrome/browser/ui/webui/profile_helper_browsertest.cc
@@ -100,7 +100,7 @@ } private: - raw_ptr<Browser> browser_; + raw_ptr<Browser> browser_ = nullptr; base::RunLoop run_loop_; }; @@ -213,6 +213,12 @@ EXPECT_EQ(2U, browser_list->size()); CloseBrowserSynchronously(original_browser); EXPECT_EQ(1u, browser_list->size()); + EXPECT_EQ(additional_profile, browser_list->get(0)->profile()); + // Ensure the last active browser and the`LastUsedProfile` is set. + browser_list->get(0)->window()->Show(); + EXPECT_EQ(g_browser_process->profile_manager()->GetLastUsedProfileDir(), + additional_profile->GetPath()); + // Original browser now belongs to the additional profile. original_browser = browser_list->get(0); #endif @@ -221,7 +227,6 @@ webui::DeleteProfileAtPath(original_browser->profile()->GetPath(), ProfileMetrics::DELETE_PROFILE_SETTINGS); ui_test_utils::WaitForBrowserToClose(original_browser); - content::RunAllTasksUntilIdle(); EXPECT_EQ(1u, browser_list->size());
diff --git a/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_page_handler_impl.h b/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_page_handler_impl.h index a9daefb0..3d102fb 100644 --- a/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_page_handler_impl.h +++ b/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_page_handler_impl.h
@@ -8,6 +8,7 @@ #include <string> #include <vector> +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/webui/segmentation_internals/segmentation_internals.mojom.h" #include "components/segmentation_platform/public/segment_selection_result.h" @@ -49,7 +50,7 @@ mojo::Receiver<segmentation_internals::mojom::PageHandler> receiver_; mojo::Remote<segmentation_internals::mojom::Page> page_; - segmentation_platform::ServiceProxy* service_proxy_; + raw_ptr<segmentation_platform::ServiceProxy> service_proxy_; base::WeakPtrFactory<SegmentationInternalsPageHandlerImpl> weak_ptr_factory_{ this};
diff --git a/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_ui.h b/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_ui.h index 759132c..974295b6 100644 --- a/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_ui.h +++ b/chrome/browser/ui/webui/segmentation_internals/segmentation_internals_ui.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UI_WEBUI_SEGMENTATION_INTERNALS_SEGMENTATION_INTERNALS_UI_H_ #define CHROME_BROWSER_UI_WEBUI_SEGMENTATION_INTERNALS_SEGMENTATION_INTERNALS_UI_H_ +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/webui/segmentation_internals/segmentation_internals.mojom.h" // nogncheck #include "mojo/public/cpp/bindings/pending_receiver.h" #include "ui/webui/mojo_web_ui_controller.h" @@ -34,7 +35,7 @@ mojo::PendingReceiver<segmentation_internals::mojom::PageHandler> receiver) override; - Profile* profile_; + raw_ptr<Profile> profile_; std::unique_ptr<SegmentationInternalsPageHandlerImpl> segmentation_internals_page_handler_; mojo::Receiver<segmentation_internals::mojom::PageHandlerFactory>
diff --git a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc index 1d9bfac1..bc01976 100644 --- a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc
@@ -603,7 +603,8 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) std::unique_ptr<user_manager::ScopedUserManager> user_manager_enabler_; #endif - browsing_topics::MockBrowsingTopicsService* mock_browsing_topics_service_; + raw_ptr<browsing_topics::MockBrowsingTopicsService> + mock_browsing_topics_service_; }; // True if testing for handle clear unpartitioned usage with HTTPS scheme URL.
diff --git a/chrome/browser/ui/webui/side_panel/read_anything/read_anything_page_handler.h b/chrome/browser/ui/webui/side_panel/read_anything/read_anything_page_handler.h index cdf07f6..7b0d97c 100644 --- a/chrome/browser/ui/webui/side_panel/read_anything/read_anything_page_handler.h +++ b/chrome/browser/ui/webui/side_panel/read_anything/read_anything_page_handler.h
@@ -8,6 +8,7 @@ #include <string> #include <vector> +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/side_panel/read_anything/read_anything_coordinator.h" @@ -61,7 +62,7 @@ raw_ptr<ReadAnythingModel> model_; raw_ptr<ReadAnythingPageHandler::Delegate> delegate_; - Browser* browser_; + raw_ptr<Browser> browser_; mojo::Receiver<PageHandler> receiver_; mojo::Remote<Page> page_;
diff --git a/chrome/browser/ui/webui/signin/turn_sync_on_helper_policy_fetch_tracker.cc b/chrome/browser/ui/webui/signin/turn_sync_on_helper_policy_fetch_tracker.cc index 5ab007c..4204deb 100644 --- a/chrome/browser/ui/webui/signin/turn_sync_on_helper_policy_fetch_tracker.cc +++ b/chrome/browser/ui/webui/signin/turn_sync_on_helper_policy_fetch_tracker.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/webui/signin/turn_sync_on_helper_policy_fetch_tracker.h" +#include "base/memory/raw_ptr.h" #include "chrome/browser/policy/chrome_policy_conversions_client.h" #include "chrome/browser/policy/cloud/user_policy_signin_service.h" #include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h" @@ -109,7 +110,7 @@ std::move(callback).Run(); } - Profile* profile_; + raw_ptr<Profile> profile_; const AccountInfo account_info_; // Policy credentials we keep while determining whether to create
diff --git a/chrome/browser/ui/webui/signin/turn_sync_on_helper_unittest.cc b/chrome/browser/ui/webui/signin/turn_sync_on_helper_unittest.cc index 33f6576..c37b196 100644 --- a/chrome/browser/ui/webui/signin/turn_sync_on_helper_unittest.cc +++ b/chrome/browser/ui/webui/signin/turn_sync_on_helper_unittest.cc
@@ -106,7 +106,7 @@ void Wait() { if (!identity_manager_->HasAccountWithRefreshToken(account_id_)) return; - observation_.Observe(identity_manager_); + observation_.Observe(identity_manager_.get()); run_loop_.Run(); } @@ -120,7 +120,7 @@ } base::RunLoop run_loop_; - signin::IdentityManager* const identity_manager_; + const raw_ptr<signin::IdentityManager> identity_manager_; const CoreAccountId account_id_; base::ScopedObservation<signin::IdentityManager, signin::IdentityManager::Observer> @@ -625,7 +625,7 @@ base::ScopedTempDir temp_dir_; ScopedTestingLocalState local_state_; CoreAccountId account_id_; - TestingProfile* profile_; + raw_ptr<TestingProfile> profile_; std::unique_ptr<IdentityTestEnvironmentProfileAdaptor> identity_test_env_profile_adaptor_; raw_ptr<FakeUserPolicySigninService> user_policy_signin_service_ = nullptr;
diff --git a/chrome/browser/ui/window_sizer/DEPS b/chrome/browser/ui/window_sizer/DEPS index 046d8fd0..ea16c4459 100644 --- a/chrome/browser/ui/window_sizer/DEPS +++ b/chrome/browser/ui/window_sizer/DEPS
@@ -1,6 +1,5 @@ specific_include_rules = { - ".*test.*": [ - "!ash", - "+ash/public", + ".*chromeos.*test.*": [ + "+ash", ], }
diff --git a/chrome/browser/ui/window_sizer/window_sizer_chromeos_unittest.cc b/chrome/browser/ui/window_sizer/window_sizer_chromeos_unittest.cc index a29e51a..90696be 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_chromeos_unittest.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_chromeos_unittest.cc
@@ -5,6 +5,8 @@ #include "chrome/browser/ui/window_sizer/window_sizer_chromeos.h" #include "ash/public/cpp/window_properties.h" +#include "ash/root_window_controller.h" +#include "ash/shelf/shelf.h" #include "ash/shell.h" #include "base/command_line.h" #include "base/memory/ptr_util.h" @@ -45,16 +47,30 @@ void GetWindowBounds(const Browser* browser, const gfx::Rect& passed_in, int64_t display_id, + const gfx::Rect& bounds, + const gfx::Rect& work_area, + Source source, gfx::Rect* out_bounds) { auto state_provider = std::make_unique<TestStateProvider>(); - state_provider->SetPersistentState(gfx::Rect(), gfx::Rect(), - ui::SHOW_STATE_DEFAULT); + if (source == PERSISTED) { + state_provider->SetPersistentState(bounds, work_area, + ui::SHOW_STATE_DEFAULT); + } else { + DCHECK_EQ(source, DEFAULT); + } display::Screen::GetScreen()->SetDisplayForNewWindows(display_id); ui::WindowShowState ignored; WindowSizer::GetBrowserWindowBoundsAndShowState( std::move(state_provider), passed_in, browser, out_bounds, &ignored); } + void GetWindowBounds(const Browser* browser, + const gfx::Rect& passed_in, + int64_t display_id, + gfx::Rect* out_bounds = nullptr) { + GetWindowBounds(browser, passed_in, display_id, gfx::Rect(), gfx::Rect(), + PERSISTED, out_bounds); + } // Returns browser window |out_bounds| and |out_show_state| for simulated // persisted and last-active window bounds, work area, show state, etc. @@ -124,9 +140,13 @@ } // namespace +// WindowSizerChromeOSNoAshTest are the tests that does not require ash +// environment, thus it can use WindowSizerTestUtil that create a TestScreen +// inside. + // Test that the window is sized appropriately for the first run experience // where the default window bounds calculation is invoked. -TEST_F(WindowSizerChromeOSTest, DefaultSizeCase) { +TEST(WindowSizerChromeOSNoAshTest, DefaultSizeCase) { { // 4:3 monitor case, 1024x768, no taskbar. gfx::Rect window_bounds; @@ -237,7 +257,7 @@ // Test that the next opened window is positioned appropriately given the // bounds of an existing window of the same type. -TEST_F(WindowSizerChromeOSTest, LastWindowBoundsCase) { +TEST(WindowSizerChromeOS2NoAshTest, LastWindowBoundsCase) { { // Normal, in the middle of the screen somewhere. gfx::Rect window_bounds; @@ -294,8 +314,8 @@ } } -TEST_F(WindowSizerChromeOSTest, - LastWindowOffscreenWithNonAggressiveRepositioning) { +TEST(WindowSizerChromeOSNoAshTest, + LastWindowOffscreenWithNonAggressiveRepositioning) { { // Taskbar on left. gfx::Rect window_bounds; @@ -370,6 +390,12 @@ // Test the placement of newly created windows. TEST_F(WindowSizerChromeOSTest, PlaceNewWindows) { + UpdateDisplay("1600x1200"); + auto* shelf = ash::Shell::GetPrimaryRootWindowController()->shelf(); + shelf->SetAutoHideBehavior(ash::ShelfAutoHideBehavior::kAlways); + + int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); + // Create a browser to pass into the WindowSizerTestUtil::GetWindowBounds // function. Browser::CreateParams native_params(&profile_, true); @@ -395,10 +421,9 @@ Browser::CreateParams params_popup(Browser::TYPE_POPUP, &profile_, true); auto new_popup = CreateWindowlessBrowser(params_popup); gfx::Rect window_bounds; - WindowSizerTestUtil::GetWindowBounds( - p1600x1200, p1600x1200, gfx::Rect(), gfx::Rect(50, 100, 300, 150), - bottom_s1600x1200, PERSISTED, new_popup.get(), gfx::Rect(), - &window_bounds); + GetWindowBounds(new_popup.get(), gfx::Rect(), display_id, + gfx::Rect(50, 100, 300, 150), bottom_s1600x1200, PERSISTED, + &window_bounds); EXPECT_EQ("50,100 300x150", window_bounds.ToString()); } @@ -406,19 +431,17 @@ { // If a window is there but not shown the persisted default should be used. gfx::Rect window_bounds; - WindowSizerTestUtil::GetWindowBounds( - p1600x1200, p1600x1200, gfx::Rect(), gfx::Rect(50, 100, 300, 150), - bottom_s1600x1200, PERSISTED, browser.get(), gfx::Rect(), - &window_bounds); + GetWindowBounds(browser.get(), gfx::Rect(), display_id, + gfx::Rect(50, 100, 300, 150), bottom_s1600x1200, PERSISTED, + &window_bounds); EXPECT_EQ("50,100 300x150", window_bounds.ToString()); } { // If a window is there but not shown the default should be returned. gfx::Rect window_bounds; - WindowSizerTestUtil::GetWindowBounds( - p1600x1200, p1600x1200, gfx::Rect(), gfx::Rect(), bottom_s1600x1200, - DEFAULT, browser.get(), gfx::Rect(), &window_bounds); + GetWindowBounds(browser.get(), gfx::Rect(), display_id, gfx::Rect(), + bottom_s1600x1200, DEFAULT, &window_bounds); // Note: We need to also take the defaults maximum width into account here // since that might get used if the resolution is too big. EXPECT_EQ(
diff --git a/chrome/browser/web_applications/BUILD.gn b/chrome/browser/web_applications/BUILD.gn index aba71e2..d10519f 100644 --- a/chrome/browser/web_applications/BUILD.gn +++ b/chrome/browser/web_applications/BUILD.gn
@@ -379,6 +379,10 @@ ] } + if (is_chromeos) { + deps += [ "//chromeos/constants:constants" ] + } + public_deps = [ "//chrome/browser/web_applications/proto", "//components/permissions:permissions",
diff --git a/chrome/browser/web_applications/adjustments/preinstalled_web_app_duplication_fixer_browsertest.cc b/chrome/browser/web_applications/adjustments/preinstalled_web_app_duplication_fixer_browsertest.cc index d549d80..147dccfb 100644 --- a/chrome/browser/web_applications/adjustments/preinstalled_web_app_duplication_fixer_browsertest.cc +++ b/chrome/browser/web_applications/adjustments/preinstalled_web_app_duplication_fixer_browsertest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/web_applications/adjustments/preinstalled_web_app_duplication_fixer.h" +#include "base/memory/raw_ptr.h" #include "base/strings/string_piece.h" #include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" @@ -172,7 +173,7 @@ #endif // BUILDFLAG(IS_CHROMEOS_ASH) protected: - WebAppProvider* provider_; + raw_ptr<WebAppProvider> provider_; base::test::ScopedFeatureList feature_list_{ features::kPreinstalledWebAppDuplicationFixer}; ScopedTestingPreinstalledAppData preinstalled_app_data_;
diff --git a/chrome/browser/web_applications/commands/clear_browsing_data_command_unittest.cc b/chrome/browser/web_applications/commands/clear_browsing_data_command_unittest.cc index 209daae..f5949a4 100644 --- a/chrome/browser/web_applications/commands/clear_browsing_data_command_unittest.cc +++ b/chrome/browser/web_applications/commands/clear_browsing_data_command_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/web_applications/commands/clear_browsing_data_command.h" +#include "base/memory/raw_ptr.h" #include "base/test/bind.h" #include "chrome/browser/web_applications/test/fake_web_app_provider.h" #include "chrome/browser/web_applications/test/web_app_test.h" @@ -30,7 +31,7 @@ FakeWebAppProvider* provider() { return web_app_provider_; } private: - FakeWebAppProvider* web_app_provider_; + raw_ptr<FakeWebAppProvider> web_app_provider_; }; TEST_F(ClearBrowsingDataCommandTest, ClearLastLaunchTimeForAllTimes) {
diff --git a/chrome/browser/web_applications/commands/web_app_command.h b/chrome/browser/web_applications/commands/web_app_command.h index 290f40e..b97003a 100644 --- a/chrome/browser/web_applications/commands/web_app_command.h +++ b/chrome/browser/web_applications/commands/web_app_command.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_WEB_APPLICATIONS_COMMANDS_WEB_APP_COMMAND_H_ #include "base/callback_forward.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "base/values.h" @@ -206,7 +207,7 @@ Id id_; WebAppCommandLock command_lock_; - WebAppCommandManager* command_manager_ = nullptr; + raw_ptr<WebAppCommandManager> command_manager_ = nullptr; // Because this is owned by the command manager, it will always outlive this // object. Thus a raw pointer is save. raw_ptr<content::WebContents> shared_web_contents_;
diff --git a/chrome/browser/web_applications/isolated_app_browsertest.cc b/chrome/browser/web_applications/isolated_app_browsertest.cc index e6e84ed..70ea961b 100644 --- a/chrome/browser/web_applications/isolated_app_browsertest.cc +++ b/chrome/browser/web_applications/isolated_app_browsertest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/barrier_closure.h" +#include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/test/scoped_feature_list.h" #include "base/test/test_future.h" @@ -397,10 +398,10 @@ return version_activated_waiter.AwaitVersionActivated(); } - Browser* app_window_; - content::WebContents* app_web_contents_; - content::RenderFrameHost* app_frame_; - content::StoragePartition* storage_partition_; + raw_ptr<Browser> app_window_; + raw_ptr<content::WebContents> app_web_contents_; + raw_ptr<content::RenderFrameHost> app_frame_; + raw_ptr<content::StoragePartition> storage_partition_; GURL app_url_; };
diff --git a/chrome/browser/web_applications/preinstalled_app_install_features.cc b/chrome/browser/web_applications/preinstalled_app_install_features.cc index 6633cd4..c99a052 100644 --- a/chrome/browser/web_applications/preinstalled_app_install_features.cc +++ b/chrome/browser/web_applications/preinstalled_app_install_features.cc
@@ -9,6 +9,10 @@ #include "chrome/browser/policy/profile_policy_connector.h" #include "chrome/browser/profiles/profile.h" +#if BUILDFLAG(IS_CHROMEOS) +#include "chromeos/constants/chromeos_features.h" +#endif // IS_CHROMEOS + namespace web_app { // A hard coded list of features available for externally installed apps to @@ -21,6 +25,7 @@ #if BUILDFLAG(IS_CHROMEOS) &kCursiveStylusPreinstall, &kMessagesPreinstall, + &::chromeos::features::kCloudGamingDevice, #endif };
diff --git a/chrome/browser/web_applications/web_app_command_manager.h b/chrome/browser/web_applications/web_app_command_manager.h index 943898d..bcd62331 100644 --- a/chrome/browser/web_applications/web_app_command_manager.h +++ b/chrome/browser/web_applications/web_app_command_manager.h
@@ -118,7 +118,7 @@ std::map<WebAppCommand::Id, CommandState> commands_{}; - Profile* profile_; + raw_ptr<Profile> profile_; // TODO(https://crbug.com/1329934): Figure out better ownership of this. // Perhaps set as subsystem? std::unique_ptr<WebAppUrlLoader> url_loader_;
diff --git a/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc b/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc index ed82184..9c04787d 100644 --- a/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc +++ b/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc
@@ -15,6 +15,7 @@ #include "base/containers/contains.h" #include "base/feature_list.h" #include "base/location.h" +#include "base/memory/raw_ptr.h" #include "base/ranges/algorithm.h" #include "base/strings/string_piece.h" #include "base/strings/string_split.h" @@ -167,7 +168,7 @@ } private: - Profile* profile_; + raw_ptr<Profile> profile_; }; absl::optional<
diff --git a/chrome/browser/window_placement/window_placement_printing_interactive_uitest.cc b/chrome/browser/window_placement/window_placement_printing_interactive_uitest.cc index 8efceba..b10fccc 100644 --- a/chrome/browser/window_placement/window_placement_printing_interactive_uitest.cc +++ b/chrome/browser/window_placement/window_placement_printing_interactive_uitest.cc
@@ -25,6 +25,15 @@ class WindowPlacementTest : public InProcessBrowserTest { public: + void SetUp() override { +#if !BUILDFLAG(IS_CHROMEOS_ASH) + display::Screen::SetScreenInstance(&screen_); + screen_.display_list().AddDisplay({1, gfx::Rect(0, 0, 803, 600)}, + display::DisplayList::Type::PRIMARY); +#endif + InProcessBrowserTest::SetUp(); + } + void SetUpOnMainThread() override { // Window placement features are only available on secure contexts. https_test_server_ = std::make_unique<net::EmbeddedTestServer>( @@ -33,10 +42,20 @@ ASSERT_TRUE(https_test_server_->Start()); } + void TearDown() override { + InProcessBrowserTest::TearDown(); +#if !BUILDFLAG(IS_CHROMEOS_ASH) + display::Screen::SetScreenInstance(nullptr); +#endif + } + protected: std::unique_ptr<net::EmbeddedTestServer> https_test_server_; base::test::ScopedFeatureList scoped_feature_list_{ blink::features::kWindowPlacement}; +#if !BUILDFLAG(IS_CHROMEOS_ASH) + display::ScreenBase screen_; +#endif }; // TODO(crbug.com/1042990): Windows crashes static casting to ScreenWin. @@ -56,11 +75,6 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) display::test::DisplayManagerTestApi(ash::Shell::Get()->display_manager()) .UpdateDisplay("0+0-803x600"); -#else - display::ScreenBase screen; - screen.display_list().AddDisplay({1, gfx::Rect(0, 0, 803, 600)}, - display::DisplayList::Type::PRIMARY); - display::test::ScopedScreenOverride screen_override(&screen); #endif // BUILDFLAG(IS_CHROMEOS_ASH) ASSERT_EQ(1, display::Screen::GetScreen()->GetNumDisplays()); @@ -99,9 +113,9 @@ display::test::DisplayManagerTestApi(ash::Shell::Get()->display_manager()) .UpdateDisplay("0+0-807x600"); #else - screen.display_list().UpdateDisplay({1, gfx::Rect(0, 0, 807, 600)}, - display::DisplayList::Type::PRIMARY); - EXPECT_EQ(screen.display_list().displays().size(), 1u); + screen_.display_list().UpdateDisplay({1, gfx::Rect(0, 0, 807, 600)}, + display::DisplayList::Type::PRIMARY); + EXPECT_EQ(screen_.display_list().displays().size(), 1u); #endif // BUILDFLAG(IS_CHROMEOS_ASH) ASSERT_EQ(1, display::Screen::GetScreen()->GetNumDisplays()); @@ -116,9 +130,9 @@ display::test::DisplayManagerTestApi(ash::Shell::Get()->display_manager()) .UpdateDisplay("0+0-807x600,1000+0-804x600"); #else - screen.display_list().AddDisplay({2, gfx::Rect(1000, 0, 804, 600)}, - display::DisplayList::Type::NOT_PRIMARY); - EXPECT_EQ(screen.display_list().displays().size(), 2u); + screen_.display_list().AddDisplay({2, gfx::Rect(1000, 0, 804, 600)}, + display::DisplayList::Type::NOT_PRIMARY); + EXPECT_EQ(screen_.display_list().displays().size(), 2u); #endif // BUILDFLAG(IS_CHROMEOS_ASH) ASSERT_EQ(2, display::Screen::GetScreen()->GetNumDisplays());
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 7647578..f7def3cc 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1654559966-38932b6727037c652f585118135a82e51f5bf109.profdata +chrome-linux-main-1654581586-e8210852cb5e969bb0b5175d48ba6840166b8937.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 9f410e1..eb8a1ea 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1654559966-d71df647217f27573e40241c3c8bbc476d888e8d.profdata +chrome-mac-main-1654581586-5182d8eb7e1a3dad1753e22d457cf63a3d9fe7f6.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 0265ac6..3cc5fda 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1654559966-bddaa3405173f9ad2ef49590aa7ac0ab8f485b34.profdata +chrome-win32-main-1654581586-83214eea8baba38ed1f5edcb361ce3e1a5cb5b61.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index d498e69..1fa3c3a 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1654559966-03f9a2ba641747f561b1e561dc06c1b8b46a9c2f.profdata +chrome-win64-main-1654592135-f1b3023cd582b1a85f9043f26713840c0ce63779.profdata
diff --git a/chrome/chrome_paks.gni b/chrome/chrome_paks.gni index 2e2ce4882..040475b 100644 --- a/chrome/chrome_paks.gni +++ b/chrome/chrome_paks.gni
@@ -222,6 +222,7 @@ "$root_gen_dir/ash/webui/ash_eche_app_resources.pak", "$root_gen_dir/ash/webui/ash_eche_bundle_resources.pak", "$root_gen_dir/ash/webui/ash_firmware_update_app_resources.pak", + "$root_gen_dir/ash/webui/ash_guest_os_installer_resources.pak", "$root_gen_dir/ash/webui/ash_help_app_resources.pak", "$root_gen_dir/ash/webui/ash_media_app_resources.pak", "$root_gen_dir/ash/webui/ash_multidevice_debug_resources.pak", @@ -278,6 +279,7 @@ "//ash/webui/resources:eche_app_resources", "//ash/webui/resources:eche_bundle_resources", "//ash/webui/resources:firmware_update_app_resources", + "//ash/webui/resources:guest_os_installer_resources", "//ash/webui/resources:help_app_bundle_resources", "//ash/webui/resources:help_app_kids_magazine_bundle_resources", "//ash/webui/resources:help_app_resources",
diff --git a/chrome/services/printing/print_backend_service_impl.cc b/chrome/services/printing/print_backend_service_impl.cc index f16dfd44..48c8592 100644 --- a/chrome/services/printing/print_backend_service_impl.cc +++ b/chrome/services/printing/print_backend_service_impl.cc
@@ -12,6 +12,7 @@ #include "base/containers/adapters.h" #include "base/logging.h" +#include "base/memory/raw_ptr.h" #include "base/notreached.h" #include "base/task/task_traits.h" #include "base/task/thread_pool.h" @@ -173,7 +174,7 @@ mojom::ResultCode DoDocumentDone(); private: - PrintingContext::Delegate* context_delegate_; + raw_ptr<PrintingContext::Delegate> context_delegate_; scoped_refptr<PrintedDocument> document_; // `context` is not initialized until the document is ready for printing.
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index d4101c7..a7148d5d 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -1593,6 +1593,7 @@ "//third_party/polymer/v1_0/components-chromium/iron-test-helpers/mock-interactions.js", "//third_party/pywebsocket3/src/mod_pywebsocket/", "//third_party/simplejson/", + "//third_party/webrtc/rtc_tools/compare_videos.py", "//ui/webui/resources/", ] @@ -7862,6 +7863,9 @@ "//chrome/browser/chromeos/extensions/telemetry/api:unit_tests", "//chrome/common/chromeos/extensions", "//chromeos/dbus/image_burner", + "//content/public/browser", + "//net", + "//net:test_support", ] } else { sources += [
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc index 9f1aa1e..9c4f5d5 100644 --- a/chrome/test/base/in_process_browser_test.cc +++ b/chrome/test/base/in_process_browser_test.cc
@@ -119,6 +119,10 @@ #include "ui/events/test/event_generator.h" #endif // BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(USE_OZONE) +#include "ui/views/test/test_desktop_screen_ozone.h" +#endif + #if defined(TOOLKIT_VIEWS) #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/tabs/tab.h" @@ -599,6 +603,22 @@ return true; } +void InProcessBrowserTest::SetScreenInstance() { + // TODO(crbug.com/1317416): On wayland platform, we need to check if the + // wayland-ozone platform is initialized at this point due to the async + // initialization of the display. Investigate if we can eliminate + // IsOzoneInitialized. +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) + if (!display::Screen::HasScreen() && + views::test::TestDesktopScreenOzone::IsOzoneInitialized()) { + // This is necessary for interactive UI tests. + // It is enabled in interactive_ui_tests_main.cc + // (or through GPUMain) + screen_ = views::test::TestDesktopScreenOzone::Create(); + } +#endif +} + #if !BUILDFLAG(IS_MAC) void InProcessBrowserTest::OpenDevToolsWindow( content::WebContents* web_contents) {
diff --git a/chrome/test/base/in_process_browser_test.h b/chrome/test/base/in_process_browser_test.h index b9ac30b..e154efc 100644 --- a/chrome/test/base/in_process_browser_test.h +++ b/chrome/test/base/in_process_browser_test.h
@@ -52,6 +52,10 @@ } #endif // defined(TOOLKIT_VIEWS) +namespace display { +class Screen; +} + class Browser; #if BUILDFLAG(IS_CHROMEOS_LACROS) class FakeAccountManagerUI; @@ -225,7 +229,7 @@ [[nodiscard]] virtual bool SetUpUserDataDirectory(); // Initializes the display::Screen instance. - virtual void SetScreenInstance() {} + virtual void SetScreenInstance(); // BrowserTestBase: void PreRunTestOnMainThread() override; @@ -314,6 +318,10 @@ FakeAccountManagerUI* GetFakeAccountManagerUI() const; #endif // BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) + std::unique_ptr<display::Screen> screen_; +#endif + private: void Initialize();
diff --git a/chrome/test/chromedriver/chrome/web_view_impl.cc b/chrome/test/chromedriver/chrome/web_view_impl.cc index 0efeb33..7d506b6 100644 --- a/chrome/test/chromedriver/chrome/web_view_impl.cc +++ b/chrome/test/chromedriver/chrome/web_view_impl.cc
@@ -14,6 +14,7 @@ #include "base/files/file_path.h" #include "base/json/json_writer.h" #include "base/logging.h" +#include "base/memory/raw_ptr.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/threading/platform_thread.h" @@ -183,7 +184,7 @@ ~RemoteObjectReleaseGuard() { ReleaseRemoteObject(client_, object_id_); } private: - DevToolsClient* client_; + raw_ptr<DevToolsClient> client_; std::string object_id_; };
diff --git a/chrome/test/data/webrtc/peerconnection_getstats.js b/chrome/test/data/webrtc/peerconnection_getstats.js index 6d3bf4a..a235fa6 100644 --- a/chrome/test/data/webrtc/peerconnection_getstats.js +++ b/chrome/test/data/webrtc/peerconnection_getstats.js
@@ -141,6 +141,7 @@ frameBitDepth: 'number', framesPerSecond: 'number', jitterBufferDelay: 'number', + jitterBufferTargetDelay: 'number', jitterBufferEmittedCount: 'number', totalSamplesReceived: 'number', concealedSamples: 'number',
diff --git a/chrome/test/interaction/interaction_sequence_browser_util.cc b/chrome/test/interaction/interaction_sequence_browser_util.cc index 829ee0f0..98f8223 100644 --- a/chrome/test/interaction/interaction_sequence_browser_util.cc +++ b/chrome/test/interaction/interaction_sequence_browser_util.cc
@@ -433,7 +433,7 @@ owner_->DiscardCurrentElement(); } - InteractionSequenceBrowserUtil* const owner_; + const raw_ptr<InteractionSequenceBrowserUtil> owner_; base::raw_ptr<views::WebView> web_view_; bool visible_ = false; ui::ElementContext context_;
diff --git a/chrome/test/interaction/interaction_test_util_browser.h b/chrome/test/interaction/interaction_test_util_browser.h index 8f900c8..2740450 100644 --- a/chrome/test/interaction/interaction_test_util_browser.h +++ b/chrome/test/interaction/interaction_test_util_browser.h
@@ -8,6 +8,7 @@ #include <memory> #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "ui/base/interaction/interaction_test_util.h" #include "ui/gfx/native_widget_types.h" @@ -42,7 +43,7 @@ base::RunLoop run_loop_; base::OnceClosure closure_; - views::Widget* const widget_; + const raw_ptr<views::Widget> widget_; }; #endif // CHROME_TEST_INTERACTION_INTERACTION_TEST_UTIL_BROWSER_H_
diff --git a/chrome/test/media_router/media_router_gmc_ui_for_test.h b/chrome/test/media_router/media_router_gmc_ui_for_test.h index 5a1dcea..54a184a 100644 --- a/chrome/test/media_router/media_router_gmc_ui_for_test.h +++ b/chrome/test/media_router/media_router_gmc_ui_for_test.h
@@ -6,6 +6,7 @@ #define CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_GMC_UI_FOR_TEST_H_ #include "base/callback_forward.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/views/global_media_controls/media_dialog_ui_for_test.h" #include "chrome/browser/ui/views/media_router/cast_dialog_view.h" @@ -61,7 +62,7 @@ Browser* browser() const { return browser_; } - Browser* const browser_; + const raw_ptr<Browser> browser_; MediaDialogUiForTest dialog_ui_{ base::BindRepeating(&MediaRouterGmcUiForTest::browser, base::Unretained(this))};
diff --git a/chromeos/constants/chromeos_features.cc b/chromeos/constants/chromeos_features.cc index c8bf69d..9f4a6fe 100644 --- a/chromeos/constants/chromeos_features.cc +++ b/chromeos/constants/chromeos_features.cc
@@ -26,7 +26,7 @@ // Enables dark/light mode feature. const base::Feature kDarkLightMode{"DarkLightMode", - base::FEATURE_ENABLED_BY_DEFAULT}; + base::FEATURE_DISABLED_BY_DEFAULT}; // Disables "Office Editing for Docs, Sheets & Slides" component app so handlers // won't be registered, making it possible to install another version for
diff --git a/chromeos/dbus/userdataauth/BUILD.gn b/chromeos/dbus/userdataauth/BUILD.gn index 3bf660a..7c6421c 100644 --- a/chromeos/dbus/userdataauth/BUILD.gn +++ b/chromeos/dbus/userdataauth/BUILD.gn
@@ -47,6 +47,21 @@ ] } +static_library("test_support") { + testonly = true + + sources = [ + "mock_userdataauth_client.cc", + "mock_userdataauth_client.h", + ] + deps = [ + ":userdataauth", + ":userdataauth_proto", + "//base", + "//testing/gmock", + ] +} + proto_library("userdataauth_proto") { deps = [ "//chromeos/dbus/cryptohome:cryptohome_proto" ]
diff --git a/chromeos/dbus/userdataauth/mock_userdataauth_client.cc b/chromeos/dbus/userdataauth/mock_userdataauth_client.cc new file mode 100644 index 0000000..e840f37f --- /dev/null +++ b/chromeos/dbus/userdataauth/mock_userdataauth_client.cc
@@ -0,0 +1,29 @@ +// 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. + +#include "chromeos/dbus/userdataauth/mock_userdataauth_client.h" + +#include <utility> + +#include "base/notreached.h" + +namespace chromeos { + +MockUserDataAuthClient::MockUserDataAuthClient() {} +MockUserDataAuthClient::~MockUserDataAuthClient() = default; + +void MockUserDataAuthClient::WaitForServiceToBeAvailable( + chromeos::WaitForServiceToBeAvailableCallback callback) { + std::move(callback).Run(true); +} + +void MockUserDataAuthClient::AddObserver(Observer* observer) { + NOTIMPLEMENTED(); +} + +void MockUserDataAuthClient::RemoveObserver(Observer* observer) { + NOTIMPLEMENTED(); +} + +} // namespace chromeos
diff --git a/chromeos/dbus/userdataauth/mock_userdataauth_client.h b/chromeos/dbus/userdataauth/mock_userdataauth_client.h new file mode 100644 index 0000000..b86515e --- /dev/null +++ b/chromeos/dbus/userdataauth/mock_userdataauth_client.h
@@ -0,0 +1,193 @@ +// 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. + +#ifndef CHROMEOS_DBUS_USERDATAAUTH_MOCK_USERDATAAUTH_CLIENT_H_ +#define CHROMEOS_DBUS_USERDATAAUTH_MOCK_USERDATAAUTH_CLIENT_H_ + +#include "chromeos/dbus/userdataauth/userdataauth_client.h" + +#include "base/component_export.h" +#include "testing/gmock/include/gmock/gmock.h" + +namespace chromeos { + +class COMPONENT_EXPORT(USERDATAAUTH_CLIENT) MockUserDataAuthClient + : public UserDataAuthClient { + public: + MockUserDataAuthClient(); + ~MockUserDataAuthClient() override; + + void WaitForServiceToBeAvailable( + WaitForServiceToBeAvailableCallback callback) override; + void AddObserver(Observer* observer) override; + void RemoveObserver(Observer* observer) override; + + MOCK_METHOD(void, + IsMounted, + (const ::user_data_auth::IsMountedRequest& request, + IsMountedCallback callback), + (override)); + MOCK_METHOD(void, + Unmount, + (const ::user_data_auth::UnmountRequest& request, + UnmountCallback callback), + (override)); + MOCK_METHOD(void, + Mount, + (const ::user_data_auth::MountRequest& request, + MountCallback callback), + (override)); + MOCK_METHOD(void, + Remove, + (const ::user_data_auth::RemoveRequest& request, + RemoveCallback callback), + (override)); + MOCK_METHOD(void, + GetKeyData, + (const ::user_data_auth::GetKeyDataRequest& request, + GetKeyDataCallback callback), + (override)); + MOCK_METHOD(void, + CheckKey, + (const ::user_data_auth::CheckKeyRequest& request, + CheckKeyCallback callback), + (override)); + MOCK_METHOD(void, + AddKey, + (const ::user_data_auth::AddKeyRequest& request, + AddKeyCallback callback), + (override)); + MOCK_METHOD(void, + RemoveKey, + (const ::user_data_auth::RemoveKeyRequest& request, + RemoveKeyCallback callback), + (override)); + MOCK_METHOD(void, + MassRemoveKeys, + (const ::user_data_auth::MassRemoveKeysRequest& request, + MassRemoveKeysCallback callback), + (override)); + MOCK_METHOD(void, + MigrateKey, + (const ::user_data_auth::MigrateKeyRequest& request, + MigrateKeyCallback callback), + (override)); + MOCK_METHOD( + void, + StartFingerprintAuthSession, + (const ::user_data_auth::StartFingerprintAuthSessionRequest& request, + StartFingerprintAuthSessionCallback callback), + (override)); + MOCK_METHOD( + void, + EndFingerprintAuthSession, + (const ::user_data_auth::EndFingerprintAuthSessionRequest& request, + EndFingerprintAuthSessionCallback callback), + (override)); + MOCK_METHOD(void, + StartMigrateToDircrypto, + (const ::user_data_auth::StartMigrateToDircryptoRequest& request, + StartMigrateToDircryptoCallback callback), + (override)); + MOCK_METHOD(void, + NeedsDircryptoMigration, + (const ::user_data_auth::NeedsDircryptoMigrationRequest& request, + NeedsDircryptoMigrationCallback callback), + (override)); + MOCK_METHOD(void, + GetSupportedKeyPolicies, + (const ::user_data_auth::GetSupportedKeyPoliciesRequest& request, + GetSupportedKeyPoliciesCallback callback), + (override)); + MOCK_METHOD(void, + GetAccountDiskUsage, + (const ::user_data_auth::GetAccountDiskUsageRequest& request, + GetAccountDiskUsageCallback callback), + (override)); + MOCK_METHOD(void, + StartAuthSession, + (const ::user_data_auth::StartAuthSessionRequest& request, + StartAuthSessionCallback callback), + (override)); + MOCK_METHOD(void, + AuthenticateAuthSession, + (const ::user_data_auth::AuthenticateAuthSessionRequest& request, + AuthenticateAuthSessionCallback callback), + (override)); + MOCK_METHOD(void, + AddCredentials, + (const ::user_data_auth::AddCredentialsRequest& request, + AddCredentialsCallback callback), + (override)); + MOCK_METHOD(void, + UpdateCredential, + (const ::user_data_auth::UpdateCredentialRequest& request, + UpdateCredentialCallback callback), + (override)); + MOCK_METHOD(void, + PrepareGuestVault, + (const ::user_data_auth::PrepareGuestVaultRequest& request, + PrepareGuestVaultCallback callback), + (override)); + MOCK_METHOD(void, + PrepareEphemeralVault, + (const ::user_data_auth::PrepareEphemeralVaultRequest& request, + PrepareEphemeralVaultCallback callback), + (override)); + MOCK_METHOD(void, + CreatePersistentUser, + (const ::user_data_auth::CreatePersistentUserRequest& request, + CreatePersistentUserCallback callback), + (override)); + MOCK_METHOD(void, + PreparePersistentVault, + (const ::user_data_auth::PreparePersistentVaultRequest& request, + PreparePersistentVaultCallback callback), + (override)); + MOCK_METHOD(void, + PrepareVaultForMigration, + (const ::user_data_auth::PrepareVaultForMigrationRequest& request, + PrepareVaultForMigrationCallback callback), + (override)); + MOCK_METHOD(void, + InvalidateAuthSession, + (const ::user_data_auth::InvalidateAuthSessionRequest& request, + InvalidateAuthSessionCallback callback), + (override)); + MOCK_METHOD(void, + ExtendAuthSession, + (const ::user_data_auth::ExtendAuthSessionRequest& request, + ExtendAuthSessionCallback callback), + (override)); + MOCK_METHOD(void, + AddAuthFactor, + (const ::user_data_auth::AddAuthFactorRequest& request, + AddAuthFactorCallback callback), + (override)); + MOCK_METHOD(void, + AuthenticateAuthFactor, + (const ::user_data_auth::AuthenticateAuthFactorRequest& request, + AuthenticateAuthFactorCallback callback), + (override)); + MOCK_METHOD(void, + UpdateAuthFactor, + (const ::user_data_auth::UpdateAuthFactorRequest& request, + UpdateAuthFactorCallback callback), + (override)); + MOCK_METHOD(void, + RemoveAuthFactor, + (const ::user_data_auth::RemoveAuthFactorRequest& request, + RemoveAuthFactorCallback callback), + (override)); +}; + +} // namespace chromeos + +// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos +// source migration is finished. +namespace ash { +using ::chromeos::UserDataAuthClient; +} + +#endif // CHROMEOS_DBUS_USERDATAAUTH_MOCK_USERDATAAUTH_CLIENT_H_
diff --git a/components/autofill/content/browser/content_autofill_driver_factory_test_api.h b/components/autofill/content/browser/content_autofill_driver_factory_test_api.h index 416e0e5..006dd6b 100644 --- a/components/autofill/content/browser/content_autofill_driver_factory_test_api.h +++ b/components/autofill/content/browser/content_autofill_driver_factory_test_api.h
@@ -9,6 +9,7 @@ #include <string> #include "base/memory/ptr_util.h" +#include "base/memory/raw_ptr.h" #include "components/autofill/content/browser/content_autofill_driver_factory.h" namespace autofill { @@ -30,7 +31,7 @@ ContentAutofillRouter& router() { return factory_->router_; } private: - ContentAutofillDriverFactory* factory_; + raw_ptr<ContentAutofillDriverFactory> factory_; }; } // namespace autofill
diff --git a/components/autofill/content/browser/form_forest_test_api.h b/components/autofill/content/browser/form_forest_test_api.h index 97ab33c..84be110 100644 --- a/components/autofill/content/browser/form_forest_test_api.h +++ b/components/autofill/content/browser/form_forest_test_api.h
@@ -6,6 +6,7 @@ #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_FORM_FOREST_TEST_API_H_ #include "base/containers/stack.h" +#include "base/memory/raw_ptr.h" #include "components/autofill/content/browser/form_forest.h" namespace autofill { @@ -67,7 +68,7 @@ void ExpandForm(base::stack<FrameForm>& frontier, FrameForm frame_and_form); // Non-null pointer to wrapped FormForest. - FormForest* ff_; + raw_ptr<FormForest> ff_; }; template <typename UnaryFunction>
diff --git a/components/autofill/core/browser/data_model/credit_card_test_api.h b/components/autofill/core/browser/data_model/credit_card_test_api.h index 52a35c75..ce87b6a7 100644 --- a/components/autofill/core/browser/data_model/credit_card_test_api.h +++ b/components/autofill/core/browser/data_model/credit_card_test_api.h
@@ -5,6 +5,7 @@ #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_DATA_MODEL_CREDIT_CARD_TEST_API_H_ #define COMPONENTS_AUTOFILL_CORE_BROWSER_DATA_MODEL_CREDIT_CARD_TEST_API_H_ +#include "base/memory/raw_ptr.h" #include "components/autofill/core/browser/data_model/credit_card.h" namespace autofill { @@ -21,7 +22,7 @@ } private: - CreditCard* creditcard_; + raw_ptr<CreditCard> creditcard_; }; } // namespace autofill
diff --git a/components/autofill/core/browser/form_parsing/phone_field.cc b/components/autofill/core/browser/form_parsing/phone_field.cc index a5f3040..523d186d 100644 --- a/components/autofill/core/browser/form_parsing/phone_field.cc +++ b/components/autofill/core/browser/form_parsing/phone_field.cc
@@ -123,6 +123,14 @@ {{REGEX_AREA, FIELD_AREA_CODE}, {REGEX_PHONE, FIELD_PHONE}}, // Phone: <cc>:3 - <phone> (Ext: <ext>)? {{REGEX_PHONE, FIELD_COUNTRY_CODE, 3}, {REGEX_PHONE, FIELD_PHONE}}, + // Phone: <cc> <ac> <phone> (Ext: <ext>)? + // Indistinguishable from <area> <prefix> <suffix> + {{REGEX_PHONE, FIELD_COUNTRY_CODE}, + {EMPTY_LABEL, FIELD_AREA_CODE}, + {EMPTY_LABEL, FIELD_PHONE}}, + // Phone: <cc> <phone> (Ext: <ext>)? + // Indistinguishable from <area> <phone> + {{REGEX_PHONE, FIELD_COUNTRY_CODE}, {EMPTY_LABEL, FIELD_PHONE}}, // Phone: <phone> (Ext: <ext>)? {{REGEX_PHONE, FIELD_PHONE}}, }); @@ -206,12 +214,28 @@ continue; } - if (!ParsePhoneField( - scanner, GetRegExp(rule.regex), &parsed_fields[rule.phone_part], - {log_manager, GetRegExpName(rule.regex)}, is_country_code_field, - GetJSONFieldType(rule.regex), page_language, pattern_source)) { + bool is_empty_label = rule.regex == EMPTY_LABEL; + if (is_empty_label && + !base::FeatureList::IsEnabled( + features::kAutofillEnableParsingEmptyPhoneNumberLabels)) { + // This `grammar` contains empty labels and doesn't apply when + // `kAutofillEnableParsingEmptyPhoneNumberLabels` is disabled. return false; } + // Try parsing either a field with an empty label or a field matching the + // regex of this rule. + bool parsed = + is_empty_label + ? ParseEmptyLabel(scanner, &parsed_fields[rule.phone_part]) + : ParsePhoneField(scanner, GetRegExp(rule.regex), + &parsed_fields[rule.phone_part], + {log_manager, GetRegExpName(rule.regex)}, + is_country_code_field, + GetJSONFieldType(rule.regex), page_language, + pattern_source); + if (!parsed) + return false; + if (rule.max_size != 0 && (parsed_fields[rule.phone_part]->max_length == 0 || rule.max_size < parsed_fields[rule.phone_part]->max_length)) { @@ -350,6 +374,7 @@ return kPhoneSuffixRe; case REGEX_EXTENSION: return kPhoneExtensionRe; + case EMPTY_LABEL: default: NOTREACHED(); break; @@ -378,6 +403,7 @@ return "kPhoneSuffixRe"; case REGEX_EXTENSION: return "kPhoneExtensionRe"; + case EMPTY_LABEL: default: NOTREACHED(); break; @@ -407,6 +433,7 @@ return "PHONE_SUFFIX"; case REGEX_EXTENSION: return "PHONE_EXTENSION"; + case EMPTY_LABEL: default: NOTREACHED(); break;
diff --git a/components/autofill/core/browser/form_parsing/phone_field.h b/components/autofill/core/browser/form_parsing/phone_field.h index 121e5efc..68f9a02 100644 --- a/components/autofill/core/browser/form_parsing/phone_field.h +++ b/components/autofill/core/browser/form_parsing/phone_field.h
@@ -61,6 +61,9 @@ REGEX_SUFFIX_SEPARATOR, REGEX_SUFFIX, REGEX_EXTENSION, + // Don't use any regex and match an empty label. This is helpful for inputs + // like "Phone <input><input>", where only the first fields has a label. + EMPTY_LABEL, }; // Parsed fields.
diff --git a/components/autofill/core/browser/form_parsing/phone_field_unittest.cc b/components/autofill/core/browser/form_parsing/phone_field_unittest.cc index 882cb1cc..05edafb 100644 --- a/components/autofill/core/browser/form_parsing/phone_field_unittest.cc +++ b/components/autofill/core/browser/form_parsing/phone_field_unittest.cc
@@ -239,6 +239,25 @@ } } +TEST_P(PhoneFieldTest, EmptyLabels) { + base::test::ScopedFeatureList enabled_features; + enabled_features.InitWithFeatures( + /*enabled_features=*/ + {features::kAutofillEnableSupportForPhoneNumberTrunkTypes, + features::kAutofillEnableParsingEmptyPhoneNumberLabels}, + /*disabled_features=*/{}); + + // Phone: <input><input> + RunParsingTest( + {{"text", u"Phone", u"", PHONE_HOME_COUNTRY_CODE}, + {"text", u"", u"", PHONE_HOME_CITY_AND_NUMBER_WITHOUT_TRUNK_PREFIX}}); + + // Phone: <input><input><input> + RunParsingTest({{"text", u"Phone", u"", PHONE_HOME_COUNTRY_CODE}, + {"text", u"", u"", PHONE_HOME_CITY_CODE}, + {"text", u"", u"", PHONE_HOME_NUMBER}}); +} + TEST_P(PhoneFieldTest, TrunkPrefixTypes) { base::test::ScopedFeatureList trunk_types_enabled; trunk_types_enabled.InitAndEnableFeature(
diff --git a/components/autofill/core/browser/form_structure_test_api.h b/components/autofill/core/browser/form_structure_test_api.h index 0c101bd..0889427 100644 --- a/components/autofill/core/browser/form_structure_test_api.h +++ b/components/autofill/core/browser/form_structure_test_api.h
@@ -7,6 +7,7 @@ #include <string> +#include "base/memory/raw_ptr.h" #include "base/strings/string_piece.h" #include "components/autofill/core/browser/form_structure.h" @@ -60,7 +61,7 @@ } private: - FormStructure* form_structure_; + raw_ptr<FormStructure> form_structure_; }; } // namespace autofill
diff --git a/components/autofill/core/browser/test_browser_autofill_manager.h b/components/autofill/core/browser/test_browser_autofill_manager.h index c4a4c11..422bf0e 100644 --- a/components/autofill/core/browser/test_browser_autofill_manager.h +++ b/components/autofill/core/browser/test_browser_autofill_manager.h
@@ -95,8 +95,8 @@ using BrowserAutofillManager::pending_form_data; private: - TestAutofillClient* client_; - TestAutofillDriver* driver_; + raw_ptr<TestAutofillClient> client_; + raw_ptr<TestAutofillDriver> driver_; bool autofill_profile_enabled_ = true; bool autofill_credit_card_enabled_ = true;
diff --git a/components/autofill/core/common/autofill_features.cc b/components/autofill/core/common/autofill_features.cc index 2657512..52d384f 100644 --- a/components/autofill/core/common/autofill_features.cc +++ b/components/autofill/core/common/autofill_features.cc
@@ -238,6 +238,12 @@ &kAutofillEnableMultiStepImports, "multistep_candidate_ttl", base::Minutes(30)}; +// When enabled, phone number local heuristics match empty labels when looking +// for composite phone number inputs. E.g. Phone number <input><input>. +const base::Feature kAutofillEnableParsingEmptyPhoneNumberLabels{ + "AutofillEnableParsingEmptyPhoneNumberLabels", + base::FEATURE_DISABLED_BY_DEFAULT}; + // When enabled, the precedence is given to the field label over the name when // they match different types. Applied only for parsing of address forms in // Turkish.
diff --git a/components/autofill/core/common/autofill_features.h b/components/autofill/core/common/autofill_features.h index 9df9977c..50faf70 100644 --- a/components/autofill/core/common/autofill_features.h +++ b/components/autofill/core/common/autofill_features.h
@@ -87,6 +87,8 @@ extern const base::FeatureParam<base::TimeDelta> kAutofillMultiStepImportCandidateTTL; COMPONENT_EXPORT(AUTOFILL) +extern const base::Feature kAutofillEnableParsingEmptyPhoneNumberLabels; +COMPONENT_EXPORT(AUTOFILL) extern const base::Feature kAutofillEnableRankingFormula; COMPONENT_EXPORT(AUTOFILL) extern const base::FeatureParam<int> kAutofillRankingFormulaUsageHalfLife;
diff --git a/components/autofill_assistant/browser/BUILD.gn b/components/autofill_assistant/browser/BUILD.gn index ce73789..a527283b 100644 --- a/components/autofill_assistant/browser/BUILD.gn +++ b/components/autofill_assistant/browser/BUILD.gn
@@ -404,6 +404,8 @@ sources = [ "actions/mock_action_delegate.cc", "actions/mock_action_delegate.h", + "actions/wait_for_dom_test_base.cc", + "actions/wait_for_dom_test_base.h", "fake_script_executor_delegate.cc", "fake_script_executor_delegate.h", "fake_script_executor_ui_delegate.cc",
diff --git a/components/autofill_assistant/browser/actions/prompt_action_unittest.cc b/components/autofill_assistant/browser/actions/prompt_action_unittest.cc index 222092d..9a7869f9 100644 --- a/components/autofill_assistant/browser/actions/prompt_action_unittest.cc +++ b/components/autofill_assistant/browser/actions/prompt_action_unittest.cc
@@ -16,7 +16,7 @@ #include "base/test/test_simple_task_runner.h" #include "base/time/time.h" #include "base/timer/timer.h" -#include "components/autofill_assistant/browser/actions/mock_action_delegate.h" +#include "components/autofill_assistant/browser/actions/wait_for_dom_test_base.h" #include "components/autofill_assistant/browser/wait_for_dom_observer.h" #include "components/autofill_assistant/browser/web/mock_web_controller.h" #include "testing/gmock/include/gmock/gmock.h" @@ -39,20 +39,12 @@ using ::testing::UnorderedElementsAre; using ::testing::WithArgs; -class PromptActionTest : public testing::Test { +class PromptActionTest : public WaitForDomTestBase { public: - PromptActionTest() - : task_env_(base::test::TaskEnvironment::TimeSource::MOCK_TIME) {} + PromptActionTest() = default; void SetUp() override { - ON_CALL(mock_web_controller_, FindElement(_, _, _)) - .WillByDefault(WithArgs<2>([](auto&& callback) { - std::move(callback).Run(ClientStatus(ELEMENT_RESOLUTION_FAILED), - std::make_unique<ElementFinderResult>()); - })); - EXPECT_CALL(mock_action_delegate_, WaitForDom) - .WillRepeatedly(Invoke(this, &PromptActionTest::FakeWaitForDom)); - ON_CALL(mock_action_delegate_, Prompt(_, _, _, _, _)) + ON_CALL(mock_action_delegate_, Prompt) .WillByDefault( [this](std::unique_ptr<std::vector<UserAction>> user_actions, bool disable_force_expand_sheet, @@ -64,92 +56,10 @@ } protected: - // Fakes ActionDelegate::WaitForDom. - // - // This simulates a WaitForDom that calls |check_elements_| every seconds - // until it gets a successful callback, then calls done_waiting_callback. - void FakeWaitForDom( - base::TimeDelta max_wait_time, - bool allow_observer_mode, - bool allow_interrupt, - WaitForDomObserver* observer, - base::RepeatingCallback< - void(BatchElementChecker*, - base::OnceCallback<void(const ClientStatus&)>)> check_elements, - base::OnceCallback<void(const ClientStatus&, base::TimeDelta)> - done_waiting_callback) { - fake_wait_for_dom_done_ = std::move(done_waiting_callback); - RunFakeWaitForDom(check_elements); - } - - void RunFakeWaitForDom( - base::RepeatingCallback< - void(BatchElementChecker*, - base::OnceCallback<void(const ClientStatus&)>)> check_elements) { - if (!fake_wait_for_dom_done_) - return; - - checker_ = std::make_unique<BatchElementChecker>(); - has_check_elements_result_ = false; - check_elements.Run(checker_.get(), - base::BindOnce(&PromptActionTest::OnCheckElementsDone, - base::Unretained(this))); - task_env_.FastForwardBy(base::Milliseconds(fake_check_time_)); - checker_->AddAllDoneCallback( - base::BindOnce(&PromptActionTest::OnWaitForDomDone, - base::Unretained(this), check_elements)); - checker_->Run(&mock_web_controller_); - } - - // Called from the check_elements callback passed to FakeWaitForDom. - void OnCheckElementsDone(const ClientStatus& result) { - ASSERT_FALSE(has_check_elements_result_); // Duplicate calls - has_check_elements_result_ = true; - check_elements_result_ = result; - } - - // Called by |checker_| once it's done and either ends the WaitForDom or - // schedule another run. - void OnWaitForDomDone( - base::RepeatingCallback< - void(BatchElementChecker*, - base::OnceCallback<void(const ClientStatus&)>)> check_elements) { - ASSERT_TRUE( - has_check_elements_result_); // OnCheckElementsDone() not called - - if (!fake_wait_for_dom_done_) - return; - - if (check_elements_result_.ok()) { - std::move(fake_wait_for_dom_done_) - .Run(check_elements_result_, base::Milliseconds(fake_wait_time_)); - } else { - wait_for_dom_timer_ = std::make_unique<base::OneShotTimer>(); - wait_for_dom_timer_->Start( - FROM_HERE, base::Seconds(1), - base::BindOnce(&PromptActionTest::RunFakeWaitForDom, - base::Unretained(this), check_elements)); - } - } - - // task_env_ must be first to guarantee other field - // creation run in that environment. - base::test::TaskEnvironment task_env_; - - MockActionDelegate mock_action_delegate_; - MockWebController mock_web_controller_; base::MockCallback<Action::ProcessActionCallback> callback_; - base::OnceCallback<void(const ClientStatus&, base::TimeDelta)> - fake_wait_for_dom_done_; ActionProto proto_; raw_ptr<PromptProto> prompt_proto_; std::unique_ptr<std::vector<UserAction>> user_actions_; - std::unique_ptr<BatchElementChecker> checker_; - bool has_check_elements_result_ = false; - ClientStatus check_elements_result_; - std::unique_ptr<base::OneShotTimer> wait_for_dom_timer_; - int fake_wait_time_ = 0; - int fake_check_time_ = 0; }; TEST_F(PromptActionTest, ChoicesMissing) {
diff --git a/components/autofill_assistant/browser/actions/wait_for_dom_test_base.cc b/components/autofill_assistant/browser/actions/wait_for_dom_test_base.cc new file mode 100644 index 0000000..6aedc042 --- /dev/null +++ b/components/autofill_assistant/browser/actions/wait_for_dom_test_base.cc
@@ -0,0 +1,88 @@ +// 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. + +#include "components/autofill_assistant/browser/actions/wait_for_dom_test_base.h" + +namespace autofill_assistant { + +namespace { + +using ::testing::WithArgs; + +} + +WaitForDomTestBase::WaitForDomTestBase() + : task_env_(base::test::TaskEnvironment::TimeSource::MOCK_TIME) { + ON_CALL(mock_web_controller_, FindElement) + .WillByDefault(WithArgs<2>([](auto&& callback) { + std::move(callback).Run(ClientStatus(ELEMENT_RESOLUTION_FAILED), + std::make_unique<ElementFinderResult>()); + })); + EXPECT_CALL(mock_action_delegate_, WaitForDom) + .WillRepeatedly(Invoke(this, &WaitForDomTestBase::FakeWaitForDom)); +} + +WaitForDomTestBase::~WaitForDomTestBase() = default; + +void WaitForDomTestBase::FakeWaitForDom( + base::TimeDelta max_wait_time, + bool allow_observer_mode, + bool allow_interrupt, + WaitForDomObserver* observer, + base::RepeatingCallback<void(BatchElementChecker*, + base::OnceCallback<void(const ClientStatus&)>)> + check_elements, + base::OnceCallback<void(const ClientStatus&, base::TimeDelta)> + done_waiting_callback) { + fake_wait_for_dom_done_ = std::move(done_waiting_callback); + RunFakeWaitForDom(check_elements); +} + +void WaitForDomTestBase::RunFakeWaitForDom( + base::RepeatingCallback<void(BatchElementChecker*, + base::OnceCallback<void(const ClientStatus&)>)> + check_elements) { + if (!fake_wait_for_dom_done_) + return; + + checker_ = std::make_unique<BatchElementChecker>(); + has_check_elements_result_ = false; + check_elements.Run(checker_.get(), + base::BindOnce(&WaitForDomTestBase::OnCheckElementsDone, + base::Unretained(this))); + task_env_.FastForwardBy(base::Milliseconds(fake_check_time_)); + checker_->AddAllDoneCallback( + base::BindOnce(&WaitForDomTestBase::OnWaitForDomDone, + base::Unretained(this), check_elements)); + checker_->Run(&mock_web_controller_); +} + +void WaitForDomTestBase::OnCheckElementsDone(const ClientStatus& result) { + ASSERT_FALSE(has_check_elements_result_); // Duplicate calls + has_check_elements_result_ = true; + check_elements_result_ = result; +} + +void WaitForDomTestBase::OnWaitForDomDone( + base::RepeatingCallback<void(BatchElementChecker*, + base::OnceCallback<void(const ClientStatus&)>)> + check_elements) { + ASSERT_TRUE(has_check_elements_result_); // OnCheckElementsDone() not called + + if (!fake_wait_for_dom_done_) + return; + + if (check_elements_result_.ok()) { + std::move(fake_wait_for_dom_done_) + .Run(check_elements_result_, base::Milliseconds(fake_wait_time_)); + } else { + wait_for_dom_timer_ = std::make_unique<base::OneShotTimer>(); + wait_for_dom_timer_->Start( + FROM_HERE, base::Seconds(1), + base::BindOnce(&WaitForDomTestBase::RunFakeWaitForDom, + base::Unretained(this), check_elements)); + } +} + +} // namespace autofill_assistant
diff --git a/components/autofill_assistant/browser/actions/wait_for_dom_test_base.h b/components/autofill_assistant/browser/actions/wait_for_dom_test_base.h new file mode 100644 index 0000000..70d28e9 --- /dev/null +++ b/components/autofill_assistant/browser/actions/wait_for_dom_test_base.h
@@ -0,0 +1,80 @@ +// 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. + +#ifndef COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_ACTIONS_WAIT_FOR_DOM_TEST_BASE_H_ +#define COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_ACTIONS_WAIT_FOR_DOM_TEST_BASE_H_ + +#include <utility> + +#include "base/bind.h" +#include "base/callback.h" +#include "base/test/bind.h" +#include "base/test/gmock_callback_support.h" +#include "base/test/mock_callback.h" +#include "base/test/task_environment.h" +#include "base/test/test_simple_task_runner.h" +#include "base/time/time.h" +#include "base/timer/timer.h" +#include "components/autofill_assistant/browser/actions/mock_action_delegate.h" +#include "components/autofill_assistant/browser/batch_element_checker.h" +#include "components/autofill_assistant/browser/wait_for_dom_observer.h" +#include "components/autofill_assistant/browser/web/mock_web_controller.h" +#include "testing/gmock/include/gmock/gmock.h" + +namespace autofill_assistant { + +class WaitForDomTestBase : public testing::Test { + public: + WaitForDomTestBase(); + ~WaitForDomTestBase() override; + + protected: + // Fakes ActionDelegate::WaitForDom. + // + // This simulates a WaitForDom that calls |check_elements_| every seconds + // until it gets a successful callback, then calls done_waiting_callback. + void FakeWaitForDom( + base::TimeDelta max_wait_time, + bool allow_observer_mode, + bool allow_interrupt, + WaitForDomObserver* observer, + base::RepeatingCallback< + void(BatchElementChecker*, + base::OnceCallback<void(const ClientStatus&)>)> check_elements, + base::OnceCallback<void(const ClientStatus&, base::TimeDelta)> + done_waiting_callback); + + void RunFakeWaitForDom( + base::RepeatingCallback< + void(BatchElementChecker*, + base::OnceCallback<void(const ClientStatus&)>)> check_elements); + + // Called from the check_elements callback passed to FakeWaitForDom. + void OnCheckElementsDone(const ClientStatus& result); + + // Called by |checker_| once it's done and either ends the WaitForDom or + // schedule another run. + void OnWaitForDomDone( + base::RepeatingCallback< + void(BatchElementChecker*, + base::OnceCallback<void(const ClientStatus&)>)> check_elements); + + // task_env_ must be first to guarantee other field + // creation run in that environment. + base::test::TaskEnvironment task_env_; + + MockActionDelegate mock_action_delegate_; + MockWebController mock_web_controller_; + base::OnceCallback<void(const ClientStatus&, base::TimeDelta)> + fake_wait_for_dom_done_; + std::unique_ptr<BatchElementChecker> checker_; + bool has_check_elements_result_ = false; + ClientStatus check_elements_result_; + std::unique_ptr<base::OneShotTimer> wait_for_dom_timer_; + int fake_wait_time_ = 0; + int fake_check_time_ = 0; +}; + +} // namespace autofill_assistant +#endif // COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_ACTIONS_WAIT_FOR_DOM_TEST_BASE_H_
diff --git a/components/autofill_assistant/browser/headless/client_headless.h b/components/autofill_assistant/browser/headless/client_headless.h index f39f16a3..462a139 100644 --- a/components/autofill_assistant/browser/headless/client_headless.h +++ b/components/autofill_assistant/browser/headless/client_headless.h
@@ -86,7 +86,7 @@ void OnAccessTokenFetchComplete(GoogleServiceAuthError error, signin::AccessTokenInfo access_token_info); - content::WebContents* web_contents_; + raw_ptr<content::WebContents> web_contents_; std::unique_ptr<Controller> controller_; const raw_ptr<const CommonDependencies> common_dependencies_; std::unique_ptr<WebsiteLoginManager> website_login_manager_;
diff --git a/components/autofill_assistant/browser/headless/external_script_controller_impl.h b/components/autofill_assistant/browser/headless/external_script_controller_impl.h index ce54b4e..fc9496f 100644 --- a/components/autofill_assistant/browser/headless/external_script_controller_impl.h +++ b/components/autofill_assistant/browser/headless/external_script_controller_impl.h
@@ -10,6 +10,7 @@ #include <vector> #include "base/callback_helpers.h" +#include "base/memory/raw_ptr.h" #include "components/autofill_assistant/browser/autofill_assistant_impl.h" #include "components/autofill_assistant/browser/controller.h" #include "components/autofill_assistant/browser/controller_observer.h" @@ -68,7 +69,7 @@ void OnReadyToStart(bool can_start, absl::optional<GURL> url, std::unique_ptr<TriggerContext> trigger_context); - content::WebContents* web_contents_; + raw_ptr<content::WebContents> web_contents_; std::unique_ptr<ClientHeadless> client_; base::OnceCallback<void(ScriptResult)> script_ended_callback_;
diff --git a/components/autofill_assistant/browser/js_flow_executor_impl.h b/components/autofill_assistant/browser/js_flow_executor_impl.h index a7cacdc..c75b2a5 100644 --- a/components/autofill_assistant/browser/js_flow_executor_impl.h +++ b/components/autofill_assistant/browser/js_flow_executor_impl.h
@@ -8,6 +8,7 @@ #include <memory> #include <string> #include "base/callback_forward.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/values.h" #include "components/autofill_assistant/browser/client_status.h" @@ -119,7 +120,7 @@ return true; } - Delegate* const delegate_; + const raw_ptr<Delegate> delegate_; std::unique_ptr<DevtoolsClient> devtools_client_; int isolated_world_context_id_ = -1;
diff --git a/components/autofill_assistant/browser/service/service_impl.h b/components/autofill_assistant/browser/service/service_impl.h index d83fcb5..e16ee262 100644 --- a/components/autofill_assistant/browser/service/service_impl.h +++ b/components/autofill_assistant/browser/service/service_impl.h
@@ -10,6 +10,7 @@ #include <vector> #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "components/autofill_assistant/browser/client_context.h" #include "components/autofill_assistant/browser/device_context.h" @@ -109,7 +110,7 @@ ServiceRequestSender::ResponseCallback callback, const std::string& client_token); - Client* const client_; + const raw_ptr<Client> client_; // The request sender responsible for communicating with a remote endpoint. std::unique_ptr<ServiceRequestSender> request_sender_;
diff --git a/components/autofill_assistant/browser/ui_controller.h b/components/autofill_assistant/browser/ui_controller.h index c9c8149..a8c8aa4 100644 --- a/components/autofill_assistant/browser/ui_controller.h +++ b/components/autofill_assistant/browser/ui_controller.h
@@ -10,6 +10,7 @@ #include <vector> #include "base/callback_helpers.h" +#include "base/memory/raw_ptr.h" #include "components/autofill_assistant/browser/autofill_assistant_tts_controller.h" #include "components/autofill_assistant/browser/basic_interactions.h" #include "components/autofill_assistant/browser/bottom_sheet_state.h" @@ -274,7 +275,7 @@ UserData* GetUserData(); UserModel* GetUserModel(); - Client* const client_; + const raw_ptr<Client> client_; // Current status message, may be empty. std::string status_message_; @@ -321,7 +322,7 @@ base::ObserverList<UiControllerObserver> observers_; - ExecutionDelegate* execution_delegate_; + raw_ptr<ExecutionDelegate> execution_delegate_; EventHandler event_handler_; BasicInteractions basic_interactions_{this, execution_delegate_};
diff --git a/components/autofill_assistant/browser/web/selector_observer.h b/components/autofill_assistant/browser/web/selector_observer.h index 73f28f5..0ffb89b 100644 --- a/components/autofill_assistant/browser/web/selector_observer.h +++ b/components/autofill_assistant/browser/web/selector_observer.h
@@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/containers/flat_map.h" +#include "base/memory/raw_ptr.h" #include "base/strings/strcat.h" #include "base/time/time.h" #include "base/timer/timer.h" @@ -169,9 +170,9 @@ std::unique_ptr<base::OneShotTimer> timeout_timer_; base::flat_map<SelectorId, ObservableSelector> selectors_; - DevtoolsClient* devtools_client_; - content::WebContents* web_contents_; - const UserData* user_data_; + raw_ptr<DevtoolsClient> devtools_client_; + raw_ptr<content::WebContents> web_contents_; + raw_ptr<const UserData> user_data_; Callback update_callback_; base::OnceClosure finished_callback_;
diff --git a/components/autofill_assistant/content/renderer/autofill_assistant_model_executor.cc b/components/autofill_assistant/content/renderer/autofill_assistant_model_executor.cc index 324f227..df2c4a8 100644 --- a/components/autofill_assistant/content/renderer/autofill_assistant_model_executor.cc +++ b/components/autofill_assistant/content/renderer/autofill_assistant_model_executor.cc
@@ -194,7 +194,7 @@ bool AutofillAssistantModelExecutor::GetIndexOfBestRole( const std::vector<float>& output_role, - size_t* index_of_best_role) { + size_t* index_of_best_role) const { if (output_role.size() < static_cast<size_t>( model_metadata_.output().semantic_role().classes_size())) { @@ -213,7 +213,7 @@ bool AutofillAssistantModelExecutor::GetBlockIndex( const std::vector<float>& output_role, size_t index_of_best_role, - int* block_index) { + int* block_index) const { if (index_of_best_role >= static_cast<size_t>(model_metadata_.output() .semantic_role() @@ -229,7 +229,7 @@ bool AutofillAssistantModelExecutor::GetObjective( const std::vector<float>& output_objective, int block_index, - int* objective) { + int* objective) const { if (block_index + 1 >= model_metadata_.output().objective().blocks_size()) { NOTREACHED(); return false; @@ -287,6 +287,12 @@ if (!GetIndexOfBestRole(output_role, &index_of_best_role)) { return absl::nullopt; } + if (index_of_best_role >= + static_cast<size_t>( + model_metadata_.output().semantic_role().classes_size())) { + NOTREACHED(); + return absl::nullopt; + } int semantic_role = model_metadata_.output().semantic_role().classes(index_of_best_role); if (semantic_role == 0) {
diff --git a/components/autofill_assistant/content/renderer/autofill_assistant_model_executor.h b/components/autofill_assistant/content/renderer/autofill_assistant_model_executor.h index e55e66b..d234c6f 100644 --- a/components/autofill_assistant/content/renderer/autofill_assistant_model_executor.h +++ b/components/autofill_assistant/content/renderer/autofill_assistant_model_executor.h
@@ -86,13 +86,13 @@ // Helper functions for post processing based on |model_metadata_|. bool GetIndexOfBestRole(const std::vector<float>& output_role, - size_t* index_of_best_role); + size_t* index_of_best_role) const; bool GetBlockIndex(const std::vector<float>& output_role, size_t index_of_best_role, - int* block_index); + int* block_index) const; bool GetObjective(const std::vector<float>& output_objective, int block_index, - int* objective); + int* objective) const; // Tokenizer for HTML tag. std::unique_ptr<tflite::support::text::tokenizer::RegexTokenizer>
diff --git a/components/browsing_topics/browsing_topics_calculator.h b/components/browsing_topics/browsing_topics_calculator.h index e8ced69..98b62668 100644 --- a/components/browsing_topics/browsing_topics_calculator.h +++ b/components/browsing_topics/browsing_topics_calculator.h
@@ -9,6 +9,7 @@ #include <set> #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/task/cancelable_task_tracker.h" #include "base/time/time.h" #include "components/browsing_topics/common/common_types.h" @@ -109,10 +110,11 @@ // Those pointers are safe to hold and use throughout the lifetime of // `BrowsingTopicsService`, which owns this object. - privacy_sandbox::PrivacySandboxSettings* privacy_sandbox_settings_; - history::HistoryService* history_service_; - content::BrowsingTopicsSiteDataManager* site_data_manager_; - optimization_guide::PageContentAnnotationsService* annotations_service_; + raw_ptr<privacy_sandbox::PrivacySandboxSettings> privacy_sandbox_settings_; + raw_ptr<history::HistoryService> history_service_; + raw_ptr<content::BrowsingTopicsSiteDataManager> site_data_manager_; + raw_ptr<optimization_guide::PageContentAnnotationsService> + annotations_service_; CalculateCompletedCallback calculate_completed_callback_;
diff --git a/components/cast_streaming/browser/playback_command_dispatcher.h b/components/cast_streaming/browser/playback_command_dispatcher.h index 9b26db2..849eab1 100644 --- a/components/cast_streaming/browser/playback_command_dispatcher.h +++ b/components/cast_streaming/browser/playback_command_dispatcher.h
@@ -7,6 +7,7 @@ #include <memory> +#include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" #include "base/task/sequenced_task_runner.h" @@ -100,7 +101,7 @@ bool has_set_playback_controller_call_returned_ = false; base::OnceCallback<void()> acquire_renderer_cb_; - openscreen::cast::RpcMessenger* messenger_; + raw_ptr<openscreen::cast::RpcMessenger> messenger_; // Multiplexes Renderer commands from a number of senders. std::unique_ptr<RendererControlMultiplexer> muxer_; @@ -116,8 +117,8 @@ // Handles for the demuxer stream data providers, to be used for dispatching // demuxer stream RPC commands. absl::optional<StreamingInitializationInfo> streaming_init_info_; - Dispatcher* streaming_dispatcher_ = nullptr; - const openscreen::cast::ReceiverSession* receiver_session_ = nullptr; + raw_ptr<Dispatcher> streaming_dispatcher_ = nullptr; + raw_ptr<const openscreen::cast::ReceiverSession> receiver_session_ = nullptr; // The mojo API used to configure the renderer controls in the renderer // process. Although this instance is only needed once, it is stored as an
diff --git a/components/cast_streaming/browser/renderer_rpc_call_translator.h b/components/cast_streaming/browser/renderer_rpc_call_translator.h index cdd70ab5..e0725bd 100644 --- a/components/cast_streaming/browser/renderer_rpc_call_translator.h +++ b/components/cast_streaming/browser/renderer_rpc_call_translator.h
@@ -8,6 +8,7 @@ #include <memory> #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "components/cast_streaming/public/rpc_call_message_handler.h" #include "media/base/renderer.h" @@ -86,7 +87,7 @@ mojo::AssociatedReceiver<media::mojom::RendererClient> renderer_client_receiver_; - media::mojom::Renderer* renderer_; + raw_ptr<media::mojom::Renderer> renderer_; openscreen::cast::RpcMessenger::Handle handle_ = openscreen::cast::RpcMessenger::kInvalidHandle;
diff --git a/components/cast_streaming/browser/rpc_demuxer_stream_handler.h b/components/cast_streaming/browser/rpc_demuxer_stream_handler.h index c1b2f1d..e27f35e 100644 --- a/components/cast_streaming/browser/rpc_demuxer_stream_handler.h +++ b/components/cast_streaming/browser/rpc_demuxer_stream_handler.h
@@ -8,6 +8,7 @@ #include <memory> #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "components/cast_streaming/browser/demuxer_stream_client.h" #include "components/cast_streaming/public/rpc_call_message_handler.h" @@ -114,7 +115,7 @@ void OnNoBuffersAvailable() override; void OnError() override; - Client* client_; + raw_ptr<Client> client_; RpcProcessMessageCB process_message_cb_; openscreen::cast::RpcMessenger::Handle local_handle_; openscreen::cast::RpcMessenger::Handle remote_handle_; @@ -145,7 +146,7 @@ absl::optional<media::VideoDecoderConfig> video_config, uint32_t total_frames_received) override; - Client* const client_; + const raw_ptr<Client> client_; HandleFactory handle_factory_; RpcProcessMessageCB process_message_cb_;
diff --git a/components/cronet/cronet_context.h b/components/cronet/cronet_context.h index c056f35..40f19f03 100644 --- a/components/cronet/cronet_context.h +++ b/components/cronet/cronet_context.h
@@ -336,7 +336,7 @@ contexts_; // Shorthand for the default context (needed by // components/cronet/android/test/cronet_test_util.cc). - net::URLRequestContext* default_context_; + raw_ptr<net::URLRequestContext> default_context_; bool is_default_context_initialized_;
diff --git a/components/device_signals/core/browser/signals_aggregator_impl_unittest.cc b/components/device_signals/core/browser/signals_aggregator_impl_unittest.cc index bb18ff6..012b96f9 100644 --- a/components/device_signals/core/browser/signals_aggregator_impl_unittest.cc +++ b/components/device_signals/core/browser/signals_aggregator_impl_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include <vector> +#include "base/memory/raw_ptr.h" #include "base/test/task_environment.h" #include "base/test/test_future.h" #include "components/device_signals/core/browser/mock_signals_collector.h" @@ -111,8 +112,8 @@ } base::test::TaskEnvironment task_environment_; - MockSignalsCollector* fake_signal_collector_; - MockSignalsCollector* other_fake_signal_collector_; + raw_ptr<MockSignalsCollector> fake_signal_collector_; + raw_ptr<MockSignalsCollector> other_fake_signal_collector_; testing::StrictMock<MockUserPermissionService> mock_permission_service_; UserContext user_context_{kGaiaId}; std::unique_ptr<SignalsAggregatorImpl> aggregator_;
diff --git a/components/device_signals/core/browser/user_permission_service_impl_unittest.cc b/components/device_signals/core/browser/user_permission_service_impl_unittest.cc index f03814e..d657905 100644 --- a/components/device_signals/core/browser/user_permission_service_impl_unittest.cc +++ b/components/device_signals/core/browser/user_permission_service_impl_unittest.cc
@@ -4,6 +4,7 @@ #include "components/device_signals/core/browser/user_permission_service_impl.h" +#include "base/memory/raw_ptr.h" #include "base/test/task_environment.h" #include "base/test/test_future.h" #include "components/device_signals/core/browser/mock_user_delegate.h" @@ -63,7 +64,7 @@ signin::IdentityTestEnvironment identity_test_env_; TestManagementService management_service_; ScopedManagementServiceOverrideForTesting scoped_override_; - testing::StrictMock<MockUserDelegate>* mock_user_delegate_; + raw_ptr<testing::StrictMock<MockUserDelegate>> mock_user_delegate_; std::unique_ptr<UserPermissionServiceImpl> permission_service_; };
diff --git a/components/enterprise/content/clipboard_restriction_service.h b/components/enterprise/content/clipboard_restriction_service.h index 01f3081..8df1cad 100644 --- a/components/enterprise/content/clipboard_restriction_service.h +++ b/components/enterprise/content/clipboard_restriction_service.h
@@ -8,6 +8,7 @@ #include <map> #include <memory> +#include "base/memory/raw_ptr.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" #include "components/keyed_service/core/keyed_service.h" @@ -49,7 +50,7 @@ void UpdateSettings(); PrefChangeRegistrar pref_change_registrar_; - PrefService* pref_service_; + raw_ptr<PrefService> pref_service_; base::MatcherStringPattern::ID next_id_; std::unique_ptr<url_matcher::URLMatcher> enable_url_matcher_;
diff --git a/components/exo/shell_surface_base.cc b/components/exo/shell_surface_base.cc index e8d3fe7..e19378fd 100644 --- a/components/exo/shell_surface_base.cc +++ b/components/exo/shell_surface_base.cc
@@ -518,6 +518,7 @@ pending_pip_ = true; return; } + pending_pip_ = false; // Set all the necessary window properties and window state. auto* window = widget_->GetNativeWindow(); @@ -525,15 +526,15 @@ window->SetProperty(aura::client::kZOrderingKey, ui::ZOrderLevel::kFloatingWindow); - // Pip windows should start in the bottom right corner of the screen so move - // |window| to the bottom right of the work area and let the pip positioner - // move it within the work area. + if (initial_bounds_) + return; + // If no initial bounds is specified, pip windows should start in the bottom + // right corner of the screen so move |window| to the bottom right of the + // work area and let the pip positioner move it within the work area. auto display = display::Screen::GetScreen()->GetDisplayNearestWindow(window); gfx::Size window_size = window->bounds().size(); window->SetBoundsInScreen( gfx::Rect(display.work_area().bottom_right(), window_size), display); - - pending_pip_ = false; } void ShellSurfaceBase::UnsetPip() { @@ -1368,10 +1369,8 @@ if (frame_type_ != SurfaceFrameType::NONE) OnSetFrame(frame_type_); - if (pending_pip_) { + if (pending_pip_) SetPip(); - pending_pip_ = false; - } root_surface()->OnDeskChanged(GetWindowDeskStateChanged(window));
diff --git a/components/exo/shell_surface_unittest.cc b/components/exo/shell_surface_unittest.cc index f865ac0..fbc0101 100644 --- a/components/exo/shell_surface_unittest.cc +++ b/components/exo/shell_surface_unittest.cc
@@ -2348,4 +2348,20 @@ EXPECT_FALSE(shell_surface->frame_enabled()); } +TEST_F(ShellSurfaceTest, PipInitialPosition) { + std::unique_ptr<ShellSurface> shell_surface = + test::ShellSurfaceBuilder({256, 256}) + .SetMaximumSize(gfx::Size(10, 10)) + .SetUseSystemModalContainer() + .SetNoCommit() + .BuildShellSurface(); + shell_surface->SetWindowBounds(gfx::Rect(20, 20, 256, 256)); + shell_surface->SetPip(); + shell_surface->root_surface()->Commit(); + // PIP positioner place the PIP window to the edge that is closer to the given + // position + EXPECT_EQ(gfx::Rect(8, 20, 256, 256), + shell_surface->GetWidget()->GetWindowBoundsInScreen()); +} + } // namespace exo
diff --git a/components/exo/wayland/zcr_keyboard_configuration.cc b/components/exo/wayland/zcr_keyboard_configuration.cc index 9fb56f99..bdb76d6 100644 --- a/components/exo/wayland/zcr_keyboard_configuration.cc +++ b/components/exo/wayland/zcr_keyboard_configuration.cc
@@ -5,6 +5,7 @@ #include "components/exo/wayland/zcr_keyboard_configuration.h" #include <keyboard-configuration-unstable-v1-server-protocol.h> +#include <linux/input.h> #include <wayland-server-core.h> #include <wayland-server-protocol-core.h> @@ -15,6 +16,11 @@ #include "components/exo/keyboard_device_configuration_delegate.h" #include "components/exo/keyboard_observer.h" #include "components/exo/wayland/server_util.h" +#include "ui/events/devices/device_data_manager.h" +#include "ui/events/devices/input_device_event_observer.h" +#include "ui/events/ozone/evdev/event_device_util.h" +#include "ui/ozone/public/input_controller.h" +#include "ui/ozone/public/ozone_platform.h" namespace exo { namespace wayland { @@ -27,7 +33,8 @@ class WaylandKeyboardDeviceConfigurationDelegate : public KeyboardDeviceConfigurationDelegate, public KeyboardObserver, - public ash::ImeControllerImpl::Observer { + public ash::ImeControllerImpl::Observer, + public ui::InputDeviceEventObserver { public: WaylandKeyboardDeviceConfigurationDelegate(wl_resource* resource, Keyboard* keyboard) @@ -37,6 +44,8 @@ ash::ImeControllerImpl* ime_controller = ash::Shell::Get()->ime_controller(); ime_controller->AddObserver(this); + ui::DeviceDataManager::GetInstance()->AddObserver(this); + ProcessKeyBitsUpdate(); OnKeyboardLayoutNameChanged(ime_controller->keyboard_layout_name()); } WaylandKeyboardDeviceConfigurationDelegate( @@ -45,6 +54,7 @@ const WaylandKeyboardDeviceConfigurationDelegate&) = delete; ~WaylandKeyboardDeviceConfigurationDelegate() override { + ui::DeviceDataManager::GetInstance()->RemoveObserver(this); ash::Shell::Get()->ime_controller()->RemoveObserver(this); if (keyboard_) { keyboard_->SetDeviceConfigurationDelegate(nullptr); @@ -74,7 +84,51 @@ resource_, layout_name.c_str()); } + // Overridden from ui::InputDeviceEventObserver: + void OnInputDeviceConfigurationChanged(uint8_t input_device_types) override { + if (!(input_device_types & ui::InputDeviceEventObserver::kKeyboard)) { + return; + } + ProcessKeyBitsUpdate(); + } + private: + // Notify key bits update. + void ProcessKeyBitsUpdate() { + if (wl_resource_get_version(resource_) < + ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_SUPPORTED_KEY_BITS_SINCE_VERSION) { + return; + } + + // Preparing wayland keybits. + wl_array wl_key_bits; + wl_array_init(&wl_key_bits); + size_t key_bits_len = EVDEV_BITS_TO_INT64(KEY_CNT) * sizeof(uint64_t); + uint64_t* wl_key_bits_ptr = + static_cast<uint64_t*>(wl_array_add(&wl_key_bits, key_bits_len)); + if (!wl_key_bits_ptr) { + wl_array_release(&wl_key_bits); + return; + } + memset(wl_key_bits_ptr, 0, key_bits_len); + + ui::InputController* input_controller = + ui::OzonePlatform::GetInstance()->GetInputController(); + // Combine supported key bits from all keyboard into single key bits. + for (const ui::InputDevice& device : + ui::DeviceDataManager::GetInstance()->GetKeyboardDevices()) { + const std::vector<uint64_t>& key_bits = + input_controller->GetKeyboardKeyBits(device.id); + for (size_t i = 0; i < key_bits.size(); i++) { + wl_key_bits_ptr[i] |= key_bits[i]; + } + } + + zcr_keyboard_device_configuration_v1_send_supported_key_bits(resource_, + &wl_key_bits); + wl_array_release(&wl_key_bits); + } + wl_resource* resource_; Keyboard* keyboard_; };
diff --git a/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/FeatureConstants.java b/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/FeatureConstants.java index f7291062..220292d 100644 --- a/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/FeatureConstants.java +++ b/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/FeatureConstants.java
@@ -25,6 +25,7 @@ FeatureConstants.DOWNLOAD_HOME_FEATURE, FeatureConstants.DOWNLOAD_INDICATOR_FEATURE, FeatureConstants.CHROME_HOME_EXPAND_FEATURE, FeatureConstants.CHROME_HOME_PULL_TO_REFRESH_FEATURE, FeatureConstants.CROW_FEATURE, + FeatureConstants.CONTEXTUAL_PAGE_ACTIONS_PRICE_TRACKING, FeatureConstants.DATA_SAVER_PREVIEW_FEATURE, FeatureConstants.DATA_SAVER_DETAIL_FEATURE, FeatureConstants.DATA_SAVER_MILESTONE_PROMO_FEATURE, FeatureConstants.EPHEMERAL_TAB_FEATURE, FeatureConstants.EXPLORE_SITES_TILE_FEATURE, FeatureConstants.PREVIEWS_OMNIBOX_UI_FEATURE, @@ -99,6 +100,7 @@ String AUTO_DARK_USER_EDUCATION_MESSAGE_FEATURE = "IPH_AutoDarkUserEducationMessage"; String AUTO_DARK_USER_EDUCATION_MESSAGE_OPT_IN_FEATURE = "IPH_AutoDarkUserEducationMessageOptIn"; + String CONTEXTUAL_PAGE_ACTIONS_PRICE_TRACKING = "IPH_ContextualPageActions_PriceTracking"; String CROW_FEATURE = "IPH_Crow"; String DOWNLOAD_PAGE_FEATURE = "IPH_DownloadPage"; String DOWNLOAD_PAGE_SCREENSHOT_FEATURE = "IPH_DownloadPageScreenshot";
diff --git a/components/feature_engagement/public/feature_configurations.cc b/components/feature_engagement/public/feature_configurations.cc index c0e7e392..5af9291 100644 --- a/components/feature_engagement/public/feature_configurations.cc +++ b/components/feature_engagement/public/feature_configurations.cc
@@ -214,6 +214,23 @@ Comparator(LESS_THAN, 1), 1, 360)); return config; } + if (kIPHContextualPageActionsPriceTrackingFeature.name == feature->name) { + // A config that allows the Price Tracking IPH to be shown: + // * Once per day. 3 times max in 90 days + absl::optional<FeatureConfig> config = FeatureConfig(); + config->valid = true; + config->availability = Comparator(ANY, 0); + config->session_rate = Comparator(EQUAL, 0); + config->trigger = + EventConfig("contextual_page_actions_price_tracking_iph_trigger", + Comparator(LESS_THAN, 1), 1, 360); + config->used = EventConfig("contextual_page_actions_price_tracking_used", + Comparator(EQUAL, 0), 90, 360); + config->event_configs.insert( + EventConfig("contextual_page_actions_price_tracking_iph_trigger", + Comparator(LESS_THAN, 3), 90, 360)); + return config; + } if (kIPHAddToHomescreenMessageFeature.name == feature->name) { // A config that allows the Add to homescreen message IPH to be shown: // * Once per 15 days
diff --git a/components/feature_engagement/public/feature_constants.cc b/components/feature_engagement/public/feature_constants.cc index 49f6710f..d0a13be 100644 --- a/components/feature_engagement/public/feature_constants.cc +++ b/components/feature_engagement/public/feature_constants.cc
@@ -84,6 +84,9 @@ "IPH_AutoDarkUserEducationMessage", base::FEATURE_ENABLED_BY_DEFAULT}; const base::Feature kIPHAutoDarkUserEducationMessageOptInFeature{ "IPH_AutoDarkUserEducationMessageOptIn", base::FEATURE_ENABLED_BY_DEFAULT}; +const base::Feature kIPHContextualPageActionsPriceTrackingFeature{ + "IPH_ContextualPageActions_PriceTracking", + base::FEATURE_ENABLED_BY_DEFAULT}; const base::Feature kIPHCrowFeature{"IPH_Crow", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kIPHDataSaverDetailFeature{
diff --git a/components/feature_engagement/public/feature_constants.h b/components/feature_engagement/public/feature_constants.h index 5da309a4..6dc3e390 100644 --- a/components/feature_engagement/public/feature_constants.h +++ b/components/feature_engagement/public/feature_constants.h
@@ -69,6 +69,7 @@ extern const base::Feature kIPHAutoDarkOptOutFeature; extern const base::Feature kIPHAutoDarkUserEducationMessageFeature; extern const base::Feature kIPHAutoDarkUserEducationMessageOptInFeature; +extern const base::Feature kIPHContextualPageActionsPriceTrackingFeature; extern const base::Feature kIPHCrowFeature; extern const base::Feature kIPHDataSaverDetailFeature; extern const base::Feature kIPHDataSaverMilestonePromoFeature;
diff --git a/components/feature_engagement/public/feature_list.cc b/components/feature_engagement/public/feature_list.cc index c3cbe7d5..ab905b12f 100644 --- a/components/feature_engagement/public/feature_list.cc +++ b/components/feature_engagement/public/feature_list.cc
@@ -36,6 +36,7 @@ &kIPHChromeReengagementNotification1Feature, &kIPHChromeReengagementNotification2Feature, &kIPHChromeReengagementNotification3Feature, + &kIPHContextualPageActionsPriceTrackingFeature, &kIPHContextualSearchTranslationEnableFeature, &kIPHContextualSearchWebSearchFeature, &kIPHContextualSearchPromoteTapFeature,
diff --git a/components/feature_engagement/public/feature_list.h b/components/feature_engagement/public/feature_list.h index 36c58b7..8310581 100644 --- a/components/feature_engagement/public/feature_list.h +++ b/components/feature_engagement/public/feature_list.h
@@ -61,6 +61,8 @@ "IPH_AutoDarkUserEducationMessage"); DEFINE_VARIATION_PARAM(kIPHAutoDarkUserEducationMessageOptInFeature, "IPH_AutoDarkUserEducationMessageOptIn"); +DEFINE_VARIATION_PARAM(kIPHContextualPageActionsPriceTrackingFeature, + "IPH_ContextualPageActions_PriceTracking"); DEFINE_VARIATION_PARAM(kIPHCrowFeature, "IPH_Crow"); DEFINE_VARIATION_PARAM(kIPHDataSaverDetailFeature, "IPH_DataSaverDetail"); DEFINE_VARIATION_PARAM(kIPHDataSaverMilestonePromoFeature, @@ -281,6 +283,7 @@ VARIATION_ENTRY(kIPHAutoDarkOptOutFeature), VARIATION_ENTRY(kIPHAutoDarkUserEducationMessageFeature), VARIATION_ENTRY(kIPHAutoDarkUserEducationMessageOptInFeature), + VARIATION_ENTRY(kIPHContextualPageActionsPriceTrackingFeature), VARIATION_ENTRY(kIPHCrowFeature), VARIATION_ENTRY(kIPHDataSaverDetailFeature), VARIATION_ENTRY(kIPHDataSaverMilestonePromoFeature),
diff --git a/components/feed/core/v2/algorithm_unittest.cc b/components/feed/core/v2/algorithm_unittest.cc index 0fedc70..ffaf092 100644 --- a/components/feed/core/v2/algorithm_unittest.cc +++ b/components/feed/core/v2/algorithm_unittest.cc
@@ -7,6 +7,7 @@ #include <utility> #include <vector> +#include "base/memory/raw_ptr.h" #include "testing/gtest/include/gtest/gtest.h" namespace feed { class ResultAggregator { @@ -19,7 +20,7 @@ } private: - std::vector<std::pair<int, int>>* results_; + raw_ptr<std::vector<std::pair<int, int>>> results_; }; TEST(DiffSortedRange, LeftEmpty) {
diff --git a/components/feed/core/v2/user_actions_collector.h b/components/feed/core/v2/user_actions_collector.h index e51f3b3..df76d64 100644 --- a/components/feed/core/v2/user_actions_collector.h +++ b/components/feed/core/v2/user_actions_collector.h
@@ -45,7 +45,7 @@ // Current prefs on the disk. The list is sorted by increasing timestamp. base::Value visit_metadata_string_list_pref_; - PrefService* profile_prefs_ = nullptr; + raw_ptr<PrefService> profile_prefs_ = nullptr; }; } // namespace feed
diff --git a/components/feed/core/v2/web_feed_subscription_coordinator.h b/components/feed/core/v2/web_feed_subscription_coordinator.h index 7dcec81a..ade9194 100644 --- a/components/feed/core/v2/web_feed_subscription_coordinator.h +++ b/components/feed/core/v2/web_feed_subscription_coordinator.h
@@ -244,7 +244,7 @@ bool fetching_subscribed_web_feeds_ = false; bool fetching_subscribed_web_feeds_because_stale_ = false; - HooksForTesting* hooks_for_testing_ = nullptr; + raw_ptr<HooksForTesting> hooks_for_testing_ = nullptr; base::WeakPtrFactory<WebFeedSubscriptionCoordinator> weak_ptr_factory_{this}; };
diff --git a/components/history/core/browser/sync/history_sync_metadata_database.h b/components/history/core/browser/sync/history_sync_metadata_database.h index 02bb3b1..2cb0180 100644 --- a/components/history/core/browser/sync/history_sync_metadata_database.h +++ b/components/history/core/browser/sync/history_sync_metadata_database.h
@@ -7,6 +7,7 @@ #include <string> +#include "base/memory/raw_ptr.h" #include "components/sync/base/model_type.h" #include "components/sync/model/sync_metadata_store.h" @@ -76,8 +77,8 @@ // Reads sync_pb::ModelTypeState for History and fills `state` with it. bool GetModelTypeState(sync_pb::ModelTypeState* state); - sql::Database* const db_; - sql::MetaTable* const meta_table_; + const raw_ptr<sql::Database> db_; + const raw_ptr<sql::MetaTable> meta_table_; }; } // namespace history
diff --git a/components/history/core/browser/sync/typed_url_sync_metadata_database.h b/components/history/core/browser/sync/typed_url_sync_metadata_database.h index 22015134..416dfe1 100644 --- a/components/history/core/browser/sync/typed_url_sync_metadata_database.h +++ b/components/history/core/browser/sync/typed_url_sync_metadata_database.h
@@ -8,6 +8,7 @@ #include <string> #include <vector> +#include "base/memory/raw_ptr.h" #include "components/history/core/browser/url_row.h" #include "components/sync/base/model_type.h" #include "components/sync/model/sync_metadata_store.h" @@ -74,8 +75,8 @@ // Read sync_pb::ModelTypeState for typed URL and fill `state` with it. bool GetModelTypeState(sync_pb::ModelTypeState* state); - sql::Database* const db_; - sql::MetaTable* const meta_table_; + const raw_ptr<sql::Database> db_; + const raw_ptr<sql::MetaTable> meta_table_; }; } // namespace history
diff --git a/components/image_fetcher/core/image_fetcher.h b/components/image_fetcher/core/image_fetcher.h index acd35d5..cc3a41a 100644 --- a/components/image_fetcher/core/image_fetcher.h +++ b/components/image_fetcher/core/image_fetcher.h
@@ -9,6 +9,7 @@ #include <utility> #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "components/image_fetcher/core/image_fetcher_types.h" #include "net/traffic_annotation/network_traffic_annotation.h" @@ -142,7 +143,7 @@ // The data decoder to use for decoding this image. If null, a new data // decoder will be created for each fetch. - data_decoder::DataDecoder* data_decoder_ = nullptr; + raw_ptr<data_decoder::DataDecoder> data_decoder_ = nullptr; }; // A class used to fetch server images. It can be called from any thread and the
diff --git a/components/language/core/browser/language_prefs_test_util.h b/components/language/core/browser/language_prefs_test_util.h index 4d251625..cba7243 100644 --- a/components/language/core/browser/language_prefs_test_util.h +++ b/components/language/core/browser/language_prefs_test_util.h
@@ -7,6 +7,7 @@ #include <string> +#include "base/memory/raw_ptr.h" #include "base/strings/string_piece.h" class PrefService; @@ -53,7 +54,7 @@ void SetForcedLanguagePrefs(std::vector<std::string>&& languages); private: - PrefService* prefs_; + raw_ptr<PrefService> prefs_; }; } // namespace test
diff --git a/components/live_caption/views/caption_bubble.cc b/components/live_caption/views/caption_bubble.cc index 0f0bada0..af9d489 100644 --- a/components/live_caption/views/caption_bubble.cc +++ b/components/live_caption/views/caption_bubble.cc
@@ -195,7 +195,7 @@ } private: - CaptionBubble* const caption_bubble_; // Not owned. + const raw_ptr<CaptionBubble> caption_bubble_; // Not owned. }; #endif
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc index 577e3bd6..a21a36f 100644 --- a/components/omnibox/browser/autocomplete_controller.cc +++ b/components/omnibox/browser/autocomplete_controller.cc
@@ -385,8 +385,7 @@ if (provider_types & AutocompleteProvider::TYPE_QUERY_TILE) providers_.push_back(new QueryTileProvider(provider_client_.get(), this)); if (provider_types & AutocompleteProvider::TYPE_VOICE_SUGGEST) { - voice_suggest_provider_ = - new VoiceSuggestProvider(provider_client_.get(), this); + voice_suggest_provider_ = new VoiceSuggestProvider(provider_client_.get()); providers_.push_back(voice_suggest_provider_.get()); } if (provider_types & AutocompleteProvider::TYPE_HISTORY_FUZZY) {
diff --git a/components/omnibox/browser/autocomplete_provider.cc b/components/omnibox/browser/autocomplete_provider.cc index 44fb680..d46e1b5 100644 --- a/components/omnibox/browser/autocomplete_provider.cc +++ b/components/omnibox/browser/autocomplete_provider.cc
@@ -20,6 +20,7 @@ #include "components/omnibox/browser/autocomplete_input.h" #include "components/omnibox/browser/autocomplete_match.h" #include "components/omnibox/browser/autocomplete_match_classification.h" +#include "components/omnibox/browser/autocomplete_provider_listener.h" #include "components/omnibox/browser/history_provider.h" #include "components/omnibox/browser/omnibox_field_trial.h" #include "components/omnibox/browser/scored_history_match.h" @@ -77,6 +78,15 @@ } } +void AutocompleteProvider::AddListener(AutocompleteProviderListener* listener) { + listeners_.push_back(listener); +} + +void AutocompleteProvider::NotifyListeners(bool updated_matches) const { + for (auto* listener : listeners_) + listener->OnProviderUpdate(updated_matches); +} + void AutocompleteProvider::Stop(bool clear_cached_results, bool due_to_user_inactivity) { done_ = true; @@ -114,8 +124,8 @@ classifications); } -metrics::OmniboxEventProto_ProviderType AutocompleteProvider:: - AsOmniboxEventProviderType() const { +metrics::OmniboxEventProto_ProviderType +AutocompleteProvider::AsOmniboxEventProviderType() const { switch (type_) { case TYPE_BOOKMARK: return metrics::OmniboxEventProto::BOOKMARK; @@ -173,8 +183,7 @@ void AutocompleteProvider::AddProviderInfo(ProvidersInfo* provider_info) const { } -void AutocompleteProvider::ResetSession() { -} +void AutocompleteProvider::ResetSession() {} size_t AutocompleteProvider::EstimateMemoryUsage() const { return base::trace_event::EstimateMemoryUsage(matches_); @@ -207,9 +216,8 @@ // "17173.com"), swap the original hostname in for the fixed-up one. if ((input.type() != metrics::OmniboxInputType::URL) && canonical_gurl.HostIsIPAddress()) { - std::string original_hostname = - base::UTF16ToUTF8(input_text.substr(input.parts().host.begin, - input.parts().host.len)); + std::string original_hostname = base::UTF16ToUTF8( + input_text.substr(input.parts().host.begin, input.parts().host.len)); const url::Parsed& parts = canonical_gurl.parsed_for_possibly_invalid_spec(); // parts.host must not be empty when HostIsIPAddress() is true.
diff --git a/components/omnibox/browser/autocomplete_provider.h b/components/omnibox/browser/autocomplete_provider.h index 70d61dd..c1383277 100644 --- a/components/omnibox/browser/autocomplete_provider.h +++ b/components/omnibox/browser/autocomplete_provider.h
@@ -19,6 +19,7 @@ #include "third_party/metrics_proto/omnibox_event.pb.h" class AutocompleteInput; +class AutocompleteProviderListener; typedef std::vector<metrics::OmniboxEventProto_ProviderInfo> ProvidersInfo; @@ -180,21 +181,28 @@ // Returns a string describing a particular AutocompleteProvider type. static const char* TypeToString(Type type); + // Used to communicate async matches to consumers (usually the + // `AutocompleteController`). Consumers invoke `AddListener()` to register + // their interest, while child `AutocompleteProvider` implementations invoke + // `NotifyListeners().` + void AddListener(AutocompleteProviderListener* listener); + void NotifyListeners(bool updated_matches) const; + // Called to start an autocomplete query. The provider is responsible for // tracking its matches for this query and whether it is done processing the // query. When new matches are available or the provider finishes, it - // calls the controller's OnProviderUpdate() method. The controller can then - // get the new matches using the provider's accessors. - // Exception: Matches available immediately after starting the query (that - // is, synchronously) do not cause any notifications to be sent. The - // controller is expected to check for these without prompting (since + // calls NotifyListeners() which calls the controller's OnProviderUpdate() + // method. The controller can then get the new matches using the provider's + // accessors. Exception: Matches available immediately after starting the + // query (that is, synchronously) do not cause any notifications to be sent. + // The controller is expected to check for these without prompting (since // otherwise, starting each provider running would result in a flurry of // notifications). // // Providers should invalidate any in-progress requests and make sure *not* to - // call the controller's OnProviderUpdate() method for invalidated requests by - // calling Stop(). Once Stop() has been called, usually no more notifications - // should be sent. (See comments on Stop() below.) + // call NotifyListeners() method for invalidated requests by calling Stop(). + // Once Stop() has been called, usually no more notifications should be sent. + // (See comments on Stop() below.) // // |minimal_changes| is an optimization that lets the provider do less work // when the |input|'s text hasn't changed. See the body of @@ -203,8 +211,8 @@ // Similar to Start(), but used to perform prefetch requests. Providers can // override this method and perform a prefetch request in order to cache the - // response. Providers should *not* call OnProviderUpdate() after completing - // a prefetch request. + // response. Providers should *not* call NotifyListeners() after completing a + // prefetch request. virtual void StartPrefetch(const AutocompleteInput& input) {} // Advises the provider to stop processing. This may be called even if the @@ -220,8 +228,7 @@ // legal if there's a good reason the user is likely to want even long- // delayed asynchronous results, e.g. the user has explicitly invoked a // keyword extension and the extension is still processing the request. - virtual void Stop(bool clear_cached_results, - bool due_to_user_inactivity); + virtual void Stop(bool clear_cached_results, bool due_to_user_inactivity); // Returns the enum equivalent to the name of this provider. // TODO(derat): Make metrics use AutocompleteProvider::Type directly, or at @@ -232,14 +239,14 @@ // match should not appear again in this or future queries. This can only be // called for matches the provider marks as deletable. This should only be // called when no query is running. - // NOTE: Do NOT call OnProviderUpdate() in this method, it is the + // NOTE: Do NOT call NotifyListeners() in this method, it is the // responsibility of the caller to do so after calling us. virtual void DeleteMatch(const AutocompleteMatch& match); // Called to delete an element of a match. This element should not appear // again in this or future queries. Unlike DeleteMatch, this call does not // delete the entire AutocompleteMatch, but focuses on just one part of it. - // NOTE: Do NOT call OnProviderUpdate() in this method, it is the + // NOTE: Do NOT call NotifyListeners() in this method, it is the // responsibility of the caller to do so after calling us. virtual void DeleteMatchElement(const AutocompleteMatch& match, size_t element_index); @@ -366,6 +373,8 @@ // string unconditionally. static FixupReturn FixupUserInput(const AutocompleteInput& input); + std::vector<AutocompleteProviderListener*> listeners_; + const size_t provider_max_matches_; ACMatches matches_;
diff --git a/components/omnibox/browser/autocomplete_provider_unittest.cc b/components/omnibox/browser/autocomplete_provider_unittest.cc index 448ec78..5e9a4a0 100644 --- a/components/omnibox/browser/autocomplete_provider_unittest.cc +++ b/components/omnibox/browser/autocomplete_provider_unittest.cc
@@ -109,7 +109,6 @@ const std::u16string& match_keyword, AutocompleteProviderClient* client) : AutocompleteProvider(AutocompleteProvider::TYPE_SEARCH), - listener_(nullptr), relevance_(relevance), prefix_(prefix), match_keyword_(match_keyword), @@ -119,12 +118,6 @@ void Start(const AutocompleteInput& input, bool minimal_changes) override; - void set_listener(AutocompleteProviderListener* listener) { - listener_ = listener; - } - - virtual AutocompleteProviderListener* listener() { return listener_; } - protected: ~TestProvider() override = default; @@ -137,7 +130,6 @@ AutocompleteMatch::Type type, const TemplateURLRef::SearchTermsArgs& search_terms_args); - raw_ptr<AutocompleteProviderListener> listener_; int relevance_; const std::u16string prefix_; const std::u16string match_keyword_; @@ -173,7 +165,7 @@ void TestProvider::Run() { AddResults(1, kResultsPerProvider); done_ = true; - listener()->OnProviderUpdate(true); + NotifyListeners(true); } void TestProvider::AddResults(int start_at, int num) { @@ -244,7 +236,7 @@ } private: - AutocompleteController* controller_; + raw_ptr<AutocompleteController> controller_; base::RepeatingClosure closure_; }; @@ -260,22 +252,13 @@ TestPrefetchProvider(const TestPrefetchProvider&) = delete; TestPrefetchProvider& operator=(const TestPrefetchProvider&) = delete; - // TestProvider: - AutocompleteProviderListener* listener() override { return listener_; } - // AutocompleteProvider: void StartPrefetch(const AutocompleteInput& input) override; - void set_listener(AutocompleteProviderListenerWithClosure* listener) { - listener_ = listener; - } - private: ~TestPrefetchProvider() override = default; void RunPrefetch(); - - raw_ptr<AutocompleteProviderListenerWithClosure> listener_; }; void TestPrefetchProvider::StartPrefetch(const AutocompleteInput& input) { @@ -293,7 +276,8 @@ void TestPrefetchProvider::RunPrefetch() { AddResults(0, kResultsPerProvider); done_ = true; - listener_->OnProviderFinishedPrefetch(); + static_cast<AutocompleteProviderListenerWithClosure*>(listeners_[0]) + ->OnProviderFinishedPrefetch(); } // Helper class to make running tests of ClassifyAllMatchesInString() more @@ -509,8 +493,8 @@ // empty so no elements need to be freed at this point. EXPECT_TRUE(controller_->providers_.empty()); controller_->providers_.swap(providers); - provider1->set_listener(controller_.get()); - provider2->set_listener(controller_.get()); + provider1->AddListener(controller_.get()); + provider2->AddListener(controller_.get()); if (provider1_ptr) *provider1_ptr = provider1; @@ -1674,7 +1658,7 @@ base::RunLoop run_loop; provider_listener_->set_closure(run_loop.QuitClosure()); - provider->set_listener(provider_listener_.get()); + provider->AddListener(provider_listener_.get()); AutocompleteInput input(u"foo", metrics::OmniboxEventProto::OTHER, TestingSchemeClassifier()); @@ -1702,7 +1686,7 @@ base::RunLoop run_loop; provider_listener_->set_closure(run_loop.QuitClosure()); - provider->set_listener(provider_listener_.get()); + provider->AddListener(provider_listener_.get()); AutocompleteInput input(u"", metrics::OmniboxEventProto::OTHER, TestingSchemeClassifier()); @@ -1730,7 +1714,7 @@ base::RunLoop run_loop; provider_listener_->set_closure(run_loop.QuitClosure()); - provider->set_listener(provider_listener_.get()); + provider->AddListener(provider_listener_.get()); AutocompleteInput input(u"bar", metrics::OmniboxEventProto::OTHER, TestingSchemeClassifier());
diff --git a/components/omnibox/browser/builtin_provider.h b/components/omnibox/browser/builtin_provider.h index 8d06e0f..0c5b3fb 100644 --- a/components/omnibox/browser/builtin_provider.h +++ b/components/omnibox/browser/builtin_provider.h
@@ -62,7 +62,7 @@ raw_ptr<AutocompleteProviderClient> client_; Builtins builtins_; - TemplateURLService* template_url_service_; + raw_ptr<TemplateURLService> template_url_service_; }; #endif // COMPONENTS_OMNIBOX_BROWSER_BUILTIN_PROVIDER_H_
diff --git a/components/omnibox/browser/clipboard_provider.cc b/components/omnibox/browser/clipboard_provider.cc index e0f0f498..3060e5c3 100644 --- a/components/omnibox/browser/clipboard_provider.cc +++ b/components/omnibox/browser/clipboard_provider.cc
@@ -126,12 +126,12 @@ ClipboardRecentContent* clipboard_content) : AutocompleteProvider(AutocompleteProvider::TYPE_CLIPBOARD), client_(client), - listener_(listener), clipboard_content_(clipboard_content), current_url_suggested_times_(0), field_trial_triggered_(false), field_trial_triggered_in_session_(false) { DCHECK(clipboard_content_); + AddListener(listener); } ClipboardProvider::~ClipboardProvider() {} @@ -321,17 +321,17 @@ field_trial_triggered_ = true; field_trial_triggered_in_session_ = true; AddCreatedMatchWithTracking(input, match, clipboard_contents_age); - listener_->OnProviderUpdate(true); + NotifyListeners(true); } else if (matched_types.find(ClipboardContentType::URL) != matched_types.end()) { AutocompleteMatch match = NewBlankURLMatch(); AddCreatedMatchWithTracking(input, match, clipboard_contents_age); - listener_->OnProviderUpdate(true); + NotifyListeners(true); } else if (matched_types.find(ClipboardContentType::Text) != matched_types.end()) { AutocompleteMatch match = NewBlankTextMatch(); AddCreatedMatchWithTracking(input, match, clipboard_contents_age); - listener_->OnProviderUpdate(true); + NotifyListeners(true); } done_ = true; } @@ -436,7 +436,7 @@ return; } AddCreatedMatchWithTracking(input, match.value(), clipboard_contents_age); - listener_->OnProviderUpdate(true); + NotifyListeners(true); done_ = true; }
diff --git a/components/omnibox/browser/clipboard_provider.h b/components/omnibox/browser/clipboard_provider.h index 7810f5f..fd16398 100644 --- a/components/omnibox/browser/clipboard_provider.h +++ b/components/omnibox/browser/clipboard_provider.h
@@ -179,7 +179,6 @@ AutocompleteMatch* match); raw_ptr<AutocompleteProviderClient> client_; - raw_ptr<AutocompleteProviderListener> listener_; raw_ptr<ClipboardRecentContent> clipboard_content_; // The current URL suggested and the number of times it has been offered.
diff --git a/components/omnibox/browser/document_provider.cc b/components/omnibox/browser/document_provider.cc index d77bbf6..72de70d 100644 --- a/components/omnibox/browser/document_provider.cc +++ b/components/omnibox/browser/document_provider.cc
@@ -589,9 +589,10 @@ field_trial_triggered_in_session_(false), backoff_for_session_(false), client_(client), - listener_(listener), cache_size_(cache_size), matches_cache_(MatchesCache::NO_AUTO_EVICT) { + AddListener(listener); + if (base::FeatureList::IsEnabled(omnibox::kDebounceDocumentProvider)) { bool from_last_run = base::GetFieldTrialParamByFeatureAsBool( omnibox::kDebounceDocumentProvider, @@ -630,7 +631,7 @@ LogTotalTime(time_run_invoked_, false); loader_.reset(); done_ = true; - listener_->OnProviderUpdate(results_updated); + NotifyListeners(results_updated); } bool DocumentProvider::UpdateResults(const std::string& json_data) {
diff --git a/components/omnibox/browser/document_provider.h b/components/omnibox/browser/document_provider.h index 960b334..f09405a5e 100644 --- a/components/omnibox/browser/document_provider.h +++ b/components/omnibox/browser/document_provider.h
@@ -193,9 +193,6 @@ // Client for accessing TemplateUrlService, prefs, etc. raw_ptr<AutocompleteProviderClient> client_; - // Listener to notify when results are available. - raw_ptr<AutocompleteProviderListener> listener_; - // Saved when starting a new autocomplete request so that it can be retrieved // when responses return asynchronously. AutocompleteInput input_;
diff --git a/components/omnibox/browser/fake_autocomplete_provider_client.h b/components/omnibox/browser/fake_autocomplete_provider_client.h index 519af416..4cf93b7 100644 --- a/components/omnibox/browser/fake_autocomplete_provider_client.h +++ b/components/omnibox/browser/fake_autocomplete_provider_client.h
@@ -9,6 +9,7 @@ #include <utility> #include "base/files/scoped_temp_dir.h" +#include "base/memory/raw_ptr.h" #include "components/bookmarks/browser/bookmark_model.h" #include "components/history/core/browser/top_sites.h" #include "components/omnibox/browser/fake_tab_matcher.h" @@ -99,7 +100,7 @@ std::unique_ptr<query_tiles::TileService> tile_service_; FakeTabMatcher fake_tab_matcher_; scoped_refptr<history::TopSites> top_sites_{}; - ntp_tiles::MostVisitedSites* ntp_most_visited_sites_{}; + raw_ptr<ntp_tiles::MostVisitedSites> ntp_most_visited_sites_{}; }; #endif // COMPONENTS_OMNIBOX_BROWSER_FAKE_AUTOCOMPLETE_PROVIDER_CLIENT_H_
diff --git a/components/omnibox/browser/history_fuzzy_provider.cc b/components/omnibox/browser/history_fuzzy_provider.cc index 800a0b1..d16cc68 100644 --- a/components/omnibox/browser/history_fuzzy_provider.cc +++ b/components/omnibox/browser/history_fuzzy_provider.cc
@@ -254,7 +254,7 @@ // A utility class to track search progression. struct Step { // Walks through trie. - const Node* node; + raw_ptr<const Node> node; // Edit distance. int distance;
diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc index 88b4933..4d8f70b3 100644 --- a/components/omnibox/browser/history_url_provider.cc +++ b/components/omnibox/browser/history_url_provider.cc
@@ -404,9 +404,9 @@ HistoryURLProvider::HistoryURLProvider(AutocompleteProviderClient* client, AutocompleteProviderListener* listener) : HistoryProvider(AutocompleteProvider::TYPE_HISTORY_URL, client), - listener_(listener), params_(nullptr), search_url_database_(OmniboxFieldTrial::HUPSearchDatabase()) { + AddListener(listener); // Initialize the default HUP scoring params. OmniboxFieldTrial::GetDefaultHUPScoringParams(&scoring_params_); // Initialize HUP scoring params based on the current experiment. @@ -811,7 +811,7 @@ } done_ = true; - listener_->OnProviderUpdate(true); + NotifyListeners(true); } bool HistoryURLProvider::FixupExactSuggestion(
diff --git a/components/omnibox/browser/history_url_provider.h b/components/omnibox/browser/history_url_provider.h index 88b3ba2..b3e480be 100644 --- a/components/omnibox/browser/history_url_provider.h +++ b/components/omnibox/browser/history_url_provider.h
@@ -339,8 +339,6 @@ size_t match_number, int relevance); - raw_ptr<AutocompleteProviderListener> listener_; - // Params for the current query. The provider should not free this directly; // instead, it is passed as a parameter through the history backend, and the // parameter itself is freed once it's no longer needed. The only reason we
diff --git a/components/omnibox/browser/keyword_provider.cc b/components/omnibox/browser/keyword_provider.cc index a08971d1..62233f6 100644 --- a/components/omnibox/browser/keyword_provider.cc +++ b/components/omnibox/browser/keyword_provider.cc
@@ -86,9 +86,10 @@ KeywordProvider::KeywordProvider(AutocompleteProviderClient* client, AutocompleteProviderListener* listener) : AutocompleteProvider(AutocompleteProvider::TYPE_KEYWORD), - listener_(listener), model_(client->GetTemplateURLService()), - extensions_delegate_(client->GetKeywordExtensionsDelegate(this)) {} + extensions_delegate_(client->GetKeywordExtensionsDelegate(this)) { + AddListener(listener); +} // static std::u16string KeywordProvider::SplitKeywordFromInput(
diff --git a/components/omnibox/browser/keyword_provider.h b/components/omnibox/browser/keyword_provider.h index b408a2aa..9fc1799 100644 --- a/components/omnibox/browser/keyword_provider.h +++ b/components/omnibox/browser/keyword_provider.h
@@ -164,8 +164,6 @@ const TemplateURLService* template_url_service, const std::u16string& keyword); - raw_ptr<AutocompleteProviderListener> listener_; - // Input when searching against the keyword provider. AutocompleteInput keyword_input_;
diff --git a/components/omnibox/browser/local_history_zero_suggest_provider.cc b/components/omnibox/browser/local_history_zero_suggest_provider.cc index 8e40d7f..2d3ede6 100644 --- a/components/omnibox/browser/local_history_zero_suggest_provider.cc +++ b/components/omnibox/browser/local_history_zero_suggest_provider.cc
@@ -181,8 +181,9 @@ : AutocompleteProvider( AutocompleteProvider::TYPE_ZERO_SUGGEST_LOCAL_HISTORY), max_matches_(AutocompleteResult::GetMaxMatches(true)), - client_(client), - listener_(listener) {} + client_(client) { + AddListener(listener); +} LocalHistoryZeroSuggestProvider::~LocalHistoryZeroSuggestProvider() {} @@ -258,7 +259,7 @@ break; } - listener_->OnProviderUpdate(true); + NotifyListeners(true); } void LocalHistoryZeroSuggestProvider::OnHistoryQueryResults(
diff --git a/components/omnibox/browser/local_history_zero_suggest_provider.h b/components/omnibox/browser/local_history_zero_suggest_provider.h index 997d3a0..7633e7d 100644 --- a/components/omnibox/browser/local_history_zero_suggest_provider.h +++ b/components/omnibox/browser/local_history_zero_suggest_provider.h
@@ -64,9 +64,6 @@ // Client for accessing TemplateUrlService, prefs, etc. const raw_ptr<AutocompleteProviderClient> client_; - // Listener to notify when matches are available. - const raw_ptr<AutocompleteProviderListener> listener_; - // Used for the async tasks querying the HistoryService. base::CancelableTaskTracker history_task_tracker_;
diff --git a/components/omnibox/browser/most_visited_sites_provider.cc b/components/omnibox/browser/most_visited_sites_provider.cc index fe8dc75f..99ce4e2 100644 --- a/components/omnibox/browser/most_visited_sites_provider.cc +++ b/components/omnibox/browser/most_visited_sites_provider.cc
@@ -157,16 +157,16 @@ MostVisitedSitesProvider::MostVisitedSitesProvider( AutocompleteProviderClient* client, AutocompleteProviderListener* listener) - : AutocompleteProvider(TYPE_MOST_VISITED_SITES), - client_{client}, - listener_{listener} {} + : AutocompleteProvider(TYPE_MOST_VISITED_SITES), client_{client} { + AddListener(listener); +} MostVisitedSitesProvider::~MostVisitedSitesProvider() = default; void MostVisitedSitesProvider::OnMostVisitedUrlsAvailable( const history::MostVisitedURLList& urls) { if (BuildTileSuggest(this, client_, urls, matches_)) - listener_->OnProviderUpdate(true); + NotifyListeners(true); } bool MostVisitedSitesProvider::AllowMostVisitedSitesSuggestions( @@ -223,7 +223,7 @@ if (BuildTileSuggest(this, client_, sections.at(ntp_tiles::SectionType::PERSONALIZED), matches_)) { - listener_->OnProviderUpdate(true); + NotifyListeners(true); } }
diff --git a/components/omnibox/browser/most_visited_sites_provider.h b/components/omnibox/browser/most_visited_sites_provider.h index ecd2b2e..846cb48 100644 --- a/components/omnibox/browser/most_visited_sites_provider.h +++ b/components/omnibox/browser/most_visited_sites_provider.h
@@ -65,7 +65,6 @@ raw_ptr<ntp_tiles::MostVisitedSites> most_visited_sites_{}; const raw_ptr<AutocompleteProviderClient> client_; - const raw_ptr<AutocompleteProviderListener> listener_; // Note: used to cancel requests - not a general purpose WeakPtr factory. base::WeakPtrFactory<MostVisitedSitesProvider> request_weak_ptr_factory_{ this};
diff --git a/components/omnibox/browser/on_device_head_provider.cc b/components/omnibox/browser/on_device_head_provider.cc index 1596c22..6b9e02c 100644 --- a/components/omnibox/browser/on_device_head_provider.cc +++ b/components/omnibox/browser/on_device_head_provider.cc
@@ -98,11 +98,12 @@ AutocompleteProviderListener* listener) : AutocompleteProvider(AutocompleteProvider::TYPE_ON_DEVICE_HEAD), client_(client), - listener_(listener), worker_task_runner_(base::ThreadPool::CreateSequencedTaskRunner( {base::TaskPriority::BEST_EFFORT, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN, base::MayBlock()})), - on_device_search_request_id_(0) {} + on_device_search_request_id_(0) { + AddListener(listener); +} OnDeviceHeadProvider::~OnDeviceHeadProvider() {} @@ -276,7 +277,7 @@ } done_ = true; - listener_->OnProviderUpdate(true); + NotifyListeners(true); } std::string OnDeviceHeadProvider::GetOnDeviceHeadModelFilename() const {
diff --git a/components/omnibox/browser/on_device_head_provider.h b/components/omnibox/browser/on_device_head_provider.h index 1a7492b..ba603a2 100644 --- a/components/omnibox/browser/on_device_head_provider.h +++ b/components/omnibox/browser/on_device_head_provider.h
@@ -58,7 +58,7 @@ // matches the given AutocompleteInput. void DoSearch(std::unique_ptr<OnDeviceHeadProviderParams> params); // SearchDone: called after DoSearch, fills |matches_| with the suggestions - // fetches by DoSearch and then calls OnProviderUpdate. + // fetches by DoSearch and then calls NotifyListeners. void SearchDone(std::unique_ptr<OnDeviceHeadProviderParams> params); // Helper functions to read model filename from the static @@ -73,7 +73,6 @@ std::unique_ptr<OnDeviceHeadProviderParams> params); raw_ptr<AutocompleteProviderClient> client_; - raw_ptr<AutocompleteProviderListener> listener_; // The task runner dedicated for on device head model operations which is // added to offload expensive operations out of the UI sequence.
diff --git a/components/omnibox/browser/query_tile_provider.cc b/components/omnibox/browser/query_tile_provider.cc index cf0a59f..16cf343f 100644 --- a/components/omnibox/browser/query_tile_provider.cc +++ b/components/omnibox/browser/query_tile_provider.cc
@@ -51,8 +51,9 @@ AutocompleteProviderListener* listener) : AutocompleteProvider(AutocompleteProvider::TYPE_QUERY_TILE), client_(client), - listener_(listener), - tile_service_(client_->GetQueryTileService()) {} + tile_service_(client_->GetQueryTileService()) { + AddListener(listener); +} QueryTileProvider::~QueryTileProvider() = default; @@ -171,5 +172,5 @@ match.SetAllowedToBeDefault(input); matches_.push_back(match); - listener_->OnProviderUpdate(true); + NotifyListeners(true); }
diff --git a/components/omnibox/browser/query_tile_provider.h b/components/omnibox/browser/query_tile_provider.h index d92aa7ff..db408d39 100644 --- a/components/omnibox/browser/query_tile_provider.h +++ b/components/omnibox/browser/query_tile_provider.h
@@ -67,7 +67,6 @@ std::vector<query_tiles::Tile> tiles); const raw_ptr<AutocompleteProviderClient> client_; - const raw_ptr<AutocompleteProviderListener> listener_; // The backend providing query tiles. const raw_ptr<query_tiles::TileService> tile_service_;
diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc index 494fe49..1b13a47 100644 --- a/components/omnibox/browser/search_provider.cc +++ b/components/omnibox/browser/search_provider.cc
@@ -156,9 +156,10 @@ SearchProvider::SearchProvider(AutocompleteProviderClient* client, AutocompleteProviderListener* listener) : BaseSearchProvider(AutocompleteProvider::TYPE_SEARCH, client), - listener_(listener), providers_(client->GetTemplateURLService()), answers_cache_(10) { + AddListener(listener); + TemplateURLService* template_url_service = client->GetTemplateURLService(); // |template_url_service| can be null in tests. @@ -412,11 +413,11 @@ // It's possible the template URL changed without changing associated keyword. // Hence, it's always necessary to update matches to use the new template // URL. (One could cache the template URL and only call UpdateMatches() and - // OnProviderUpdate() if a keyword was deleted/renamed or the template URL - // was changed. That would save extra calls to these functions. However, - // this is uncommon and not likely to be worth the extra work.) + // NotifyListeners() if a keyword was deleted/renamed or the template URL was + // changed. That would save extra calls to these functions. However, this is + // uncommon and not likely to be worth the extra work.) UpdateMatches(); - listener_->OnProviderUpdate(true); // always pretend something changed + NotifyListeners(true); // always pretend something changed } void SearchProvider::OnURLLoadComplete( @@ -467,7 +468,7 @@ // Update matches, done status, etc., and send alerts if necessary. UpdateMatches(); if (done_ || results_updated) - listener_->OnProviderUpdate(results_updated); + NotifyListeners(results_updated); } void SearchProvider::StopSuggest() { @@ -643,7 +644,7 @@ UpdateDone(); // We only need to update the listener if we're actually done. if (done_) - listener_->OnProviderUpdate(false); + NotifyListeners(false); } else { // Sent at least one request. time_suggest_request_sent_ = base::TimeTicks::Now();
diff --git a/components/omnibox/browser/search_provider.h b/components/omnibox/browser/search_provider.h index 25bb75b..ec2a95f0 100644 --- a/components/omnibox/browser/search_provider.h +++ b/components/omnibox/browser/search_provider.h
@@ -382,8 +382,6 @@ // Finds image URLs in most relevant results and uses client to prefetch them. void PrefetchImages(SearchSuggestionParser::Results* results); - raw_ptr<AutocompleteProviderListener> listener_; - // Maintains the TemplateURLs used. Providers providers_;
diff --git a/components/omnibox/browser/voice_suggest_provider.cc b/components/omnibox/browser/voice_suggest_provider.cc index b7e54d4f..60d313c9 100644 --- a/components/omnibox/browser/voice_suggest_provider.cc +++ b/components/omnibox/browser/voice_suggest_provider.cc
@@ -29,9 +29,7 @@ } } // namespace -VoiceSuggestProvider::VoiceSuggestProvider( - AutocompleteProviderClient* client, - AutocompleteProviderListener* listener) +VoiceSuggestProvider::VoiceSuggestProvider(AutocompleteProviderClient* client) : BaseSearchProvider(TYPE_VOICE_SUGGEST, client) {} VoiceSuggestProvider::~VoiceSuggestProvider() = default;
diff --git a/components/omnibox/browser/voice_suggest_provider.h b/components/omnibox/browser/voice_suggest_provider.h index a4ab258..41f07004 100644 --- a/components/omnibox/browser/voice_suggest_provider.h +++ b/components/omnibox/browser/voice_suggest_provider.h
@@ -14,15 +14,13 @@ #include "base/memory/weak_ptr.h" #include "components/omnibox/browser/autocomplete_input.h" #include "components/omnibox/browser/autocomplete_provider_client.h" -#include "components/omnibox/browser/autocomplete_provider_listener.h" #include "components/omnibox/browser/base_search_provider.h" #include "third_party/metrics_proto/omnibox_event.pb.h" // Autocomplete provider serving Voice suggestions on Android. class VoiceSuggestProvider : public BaseSearchProvider { public: - VoiceSuggestProvider(AutocompleteProviderClient* client, - AutocompleteProviderListener* listener); + explicit VoiceSuggestProvider(AutocompleteProviderClient* client); void Start(const AutocompleteInput& input, bool minimal_changes) override; void Stop(bool clear_cached_results, bool due_to_user_inactivity) override;
diff --git a/components/omnibox/browser/voice_suggest_provider_unittest.cc b/components/omnibox/browser/voice_suggest_provider_unittest.cc index cd38131..a4b39d2 100644 --- a/components/omnibox/browser/voice_suggest_provider_unittest.cc +++ b/components/omnibox/browser/voice_suggest_provider_unittest.cc
@@ -8,13 +8,11 @@ #include "base/test/task_environment.h" #include "build/build_config.h" -#include "components/omnibox/browser/autocomplete_provider_listener.h" #include "components/omnibox/browser/fake_autocomplete_provider_client.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -class VoiceSuggestProviderTest : public testing::Test, - public AutocompleteProviderListener { +class VoiceSuggestProviderTest : public testing::Test { public: VoiceSuggestProviderTest() = default; VoiceSuggestProviderTest(const VoiceSuggestProviderTest&) = delete; @@ -24,9 +22,6 @@ void TearDown() override; protected: - // AutocompleteProviderListener: - void OnProviderUpdate(bool updated_matches) override; - base::test::TaskEnvironment environment_; FakeAutocompleteProviderClient client_; scoped_refptr<VoiceSuggestProvider> provider_; @@ -34,7 +29,7 @@ }; void VoiceSuggestProviderTest::SetUp() { - provider_ = base::MakeRefCounted<VoiceSuggestProvider>(&client_, this); + provider_ = base::MakeRefCounted<VoiceSuggestProvider>(&client_); input_ = std::make_unique<AutocompleteInput>( std::u16string(), metrics::OmniboxEventProto::OTHER, TestSchemeClassifier()); @@ -44,8 +39,6 @@ provider_->Stop(true, true); } -void VoiceSuggestProviderTest::OnProviderUpdate(bool updated_matches) {} - TEST_F(VoiceSuggestProviderTest, ServesNoSuggestionsByDefault) { provider_->Start(*input_, false); EXPECT_TRUE(provider_->matches().empty());
diff --git a/components/omnibox/browser/zero_suggest_provider.cc b/components/omnibox/browser/zero_suggest_provider.cc index d6209437..0e359e0 100644 --- a/components/omnibox/browser/zero_suggest_provider.cc +++ b/components/omnibox/browser/zero_suggest_provider.cc
@@ -284,8 +284,9 @@ ZeroSuggestProvider::ZeroSuggestProvider(AutocompleteProviderClient* client, AutocompleteProviderListener* listener) : BaseSearchProvider(AutocompleteProvider::TYPE_ZERO_SUGGEST, client), - listener_(listener), - result_type_running_(NONE) {} + result_type_running_(NONE) { + AddListener(listener); +} ZeroSuggestProvider::~ZeroSuggestProvider() = default; @@ -375,9 +376,8 @@ result_type_running_ = NONE; // Do not notify the provider listener for prefetch requests. - if (!is_prefetch) { - listener_->OnProviderUpdate(results_updated); - } + if (!is_prefetch) + NotifyListeners(results_updated); } void ZeroSuggestProvider::OnCounterfactualURLLoadComplete(
diff --git a/components/omnibox/browser/zero_suggest_provider.h b/components/omnibox/browser/zero_suggest_provider.h index 3db3065d..fb1e0cf 100644 --- a/components/omnibox/browser/zero_suggest_provider.h +++ b/components/omnibox/browser/zero_suggest_provider.h
@@ -213,8 +213,6 @@ const AutocompleteInput& input, const GURL& suggest_url); - raw_ptr<AutocompleteProviderListener> listener_; - // The result type that is currently being processed by provider. // When the provider is not running, the result type is set to NONE. ResultType result_type_running_;
diff --git a/components/optimization_guide/core/local_page_entities_metadata_provider_unittest.cc b/components/optimization_guide/core/local_page_entities_metadata_provider_unittest.cc index 7a24cbe..8d96bf6 100644 --- a/components/optimization_guide/core/local_page_entities_metadata_provider_unittest.cc +++ b/components/optimization_guide/core/local_page_entities_metadata_provider_unittest.cc
@@ -4,6 +4,7 @@ #include "components/optimization_guide/core/local_page_entities_metadata_provider.h" +#include "base/memory/raw_ptr.h" #include "base/test/task_environment.h" #include "components/leveldb_proto/testing/fake_db.h" #include "components/optimization_guide/core/optimization_guide_features.h" @@ -39,7 +40,7 @@ private: base::test::TaskEnvironment task_environment_; std::unique_ptr<LocalPageEntitiesMetadataProvider> provider_; - leveldb_proto::test::FakeDB<proto::EntityMetadataStorage>* db_; + raw_ptr<leveldb_proto::test::FakeDB<proto::EntityMetadataStorage>> db_; std::map<std::string, proto::EntityMetadataStorage> db_store_; };
diff --git a/components/optimization_guide/core/optimization_guide_logger.h b/components/optimization_guide/core/optimization_guide_logger.h index 42373e1..9b40e75 100644 --- a/components/optimization_guide/core/optimization_guide_logger.h +++ b/components/optimization_guide/core/optimization_guide_logger.h
@@ -8,6 +8,7 @@ #include <string> #include "base/containers/circular_deque.h" +#include "base/memory/raw_ptr.h" #include "base/observer_list.h" #include "base/observer_list_types.h" #include "base/time/time.h" @@ -73,7 +74,7 @@ std::string source_file_; int source_line_; std::vector<std::string> messages_; - OptimizationGuideLogger* optimization_guide_logger_; + raw_ptr<OptimizationGuideLogger> optimization_guide_logger_; }; private:
diff --git a/components/optimization_guide/core/page_entities_model_executor_impl.h b/components/optimization_guide/core/page_entities_model_executor_impl.h index a4391aab9..2ba3071 100644 --- a/components/optimization_guide/core/page_entities_model_executor_impl.h +++ b/components/optimization_guide/core/page_entities_model_executor_impl.h
@@ -6,6 +6,7 @@ #define COMPONENTS_OPTIMIZATION_GUIDE_CORE_PAGE_ENTITIES_MODEL_EXECUTOR_IMPL_H_ #include "base/callback_list.h" +#include "base/memory/raw_ptr.h" #include "base/task/sequenced_task_runner.h" #include "base/task/task_traits.h" #include "base/task/thread_pool.h" @@ -91,7 +92,7 @@ std::unique_ptr<EntityAnnotatorNativeLibrary> entity_annotator_native_library_; - void* entity_annotator_ = nullptr; + raw_ptr<void> entity_annotator_ = nullptr; base::WeakPtrFactory<EntityAnnotatorHolder> background_weak_ptr_factory_{ this};
diff --git a/components/page_load_metrics/browser/observers/prerender_page_load_metrics_observer.cc b/components/page_load_metrics/browser/observers/prerender_page_load_metrics_observer.cc index 498fe522..0722866 100644 --- a/components/page_load_metrics/browser/observers/prerender_page_load_metrics_observer.cc +++ b/components/page_load_metrics/browser/observers/prerender_page_load_metrics_observer.cc
@@ -127,10 +127,15 @@ timing.interactive_timing->first_input_timestamp, GetDelegate())) { return; } + + base::TimeDelta first_input_delay = + timing.interactive_timing->first_input_delay.value(); base::UmaHistogramCustomTimes( AppendSuffix(internal::kHistogramPrerenderFirstInputDelay4), - timing.interactive_timing->first_input_delay.value(), - base::Milliseconds(1), base::Seconds(60), 50); + first_input_delay, base::Milliseconds(1), base::Seconds(60), 50); + ukm::builders::PrerenderPageLoad(GetDelegate().GetPageUkmSourceId()) + .SetInteractiveTiming_FirstInputDelay4(first_input_delay.InMilliseconds()) + .Record(ukm::UkmRecorder::Get()); } void PrerenderPageLoadMetricsObserver::OnComplete( @@ -154,6 +159,7 @@ return; } + // Records Largest Contentful Paint (LCP) to UMA and UKM. const page_load_metrics::ContentfulPaintTimingInfo& largest_contentful_paint = GetDelegate() .GetLargestContentfulPaintHandler() @@ -174,6 +180,7 @@ .Record(ukm::UkmRecorder::Get()); } + // Records Cumulative Layout Shift Score (CLS) to UMA and UKM. base::UmaHistogramCounts100( AppendSuffix(internal::kHistogramPrerenderCumulativeShiftScore), page_load_metrics::LayoutShiftUmaValue( @@ -193,6 +200,12 @@ internal:: kHistogramPrerenderMaxCumulativeShiftScoreSessionWindowGap1000msMax5000ms2), normalized_cls_data); + const float max_cls = + normalized_cls_data.session_windows_gap1000ms_max5000ms_max_cls; + ukm::builders::PrerenderPageLoad(GetDelegate().GetPageUkmSourceId()) + .SetLayoutInstability_MaxCumulativeShiftScore_SessionWindow_Gap1000ms_Max5000ms( + page_load_metrics::LayoutShiftUkmValue(max_cls)) + .Record(ukm::UkmRecorder::Get()); } }
diff --git a/components/page_load_metrics/browser/page_load_metrics_observer.h b/components/page_load_metrics/browser/page_load_metrics_observer.h index 30424f03..f27556a 100644 --- a/components/page_load_metrics/browser/page_load_metrics_observer.h +++ b/components/page_load_metrics/browser/page_load_metrics_observer.h
@@ -8,6 +8,7 @@ #include <memory> #include <string> +#include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "components/page_load_metrics/browser/page_load_metrics_observer_delegate.h" #include "components/page_load_metrics/browser/page_load_metrics_observer_interface.h" @@ -257,7 +258,7 @@ const std::vector<MemoryUpdate>& memory_updates) override {} private: - PageLoadMetricsObserverDelegate* delegate_ = nullptr; + raw_ptr<PageLoadMetricsObserverDelegate> delegate_ = nullptr; }; } // namespace page_load_metrics
diff --git a/components/password_manager/core/browser/password_form_prediction_waiter.h b/components/password_manager/core/browser/password_form_prediction_waiter.h index 0d1332d7..0be56fe7 100644 --- a/components/password_manager/core/browser/password_form_prediction_waiter.h +++ b/components/password_manager/core/browser/password_form_prediction_waiter.h
@@ -6,6 +6,7 @@ #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_PREDICTION_WAITER_H_ #include "base/callback_forward.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "base/timer/timer.h" @@ -51,7 +52,7 @@ // The client owns the waiter so this pointer will survive this object's // lifetime. - Client* client_; + raw_ptr<Client> client_; base::OneShotTimer timer_;
diff --git a/components/performance_manager/public/metrics/metrics_provider.h b/components/performance_manager/public/metrics/metrics_provider.h index dbe42d15..d940b9f 100644 --- a/components/performance_manager/public/metrics/metrics_provider.h +++ b/components/performance_manager/public/metrics/metrics_provider.h
@@ -5,6 +5,7 @@ #ifndef COMPONENTS_PERFORMANCE_MANAGER_PUBLIC_METRICS_METRICS_PROVIDER_H_ #define COMPONENTS_PERFORMANCE_MANAGER_PUBLIC_METRICS_METRICS_PROVIDER_H_ +#include "base/memory/raw_ptr.h" #include "components/metrics/metrics_provider.h" #include "components/prefs/pref_change_registrar.h" @@ -45,7 +46,7 @@ EfficiencyMode ComputeCurrentMode() const; PrefChangeRegistrar pref_change_registrar_; - PrefService* const local_state_; + const raw_ptr<PrefService> local_state_; EfficiencyMode current_mode_ = EfficiencyMode::kNormal; };
diff --git a/components/permissions/permission_manager_unittest.cc b/components/permissions/permission_manager_unittest.cc index 6e7dd6c..3d3e4905 100644 --- a/components/permissions/permission_manager_unittest.cc +++ b/components/permissions/permission_manager_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include "base/bind.h" +#include "base/memory/raw_ptr.h" #include "base/metrics/field_trial.h" #include "base/metrics/field_trial_params.h" #include "build/build_config.h" @@ -65,7 +66,7 @@ private: url::Origin app_origin_; - content::ContentBrowserClient* old_client_; + raw_ptr<content::ContentBrowserClient> old_client_; }; #if BUILDFLAG(IS_ANDROID)
diff --git a/components/prefs/pref_service.h b/components/prefs/pref_service.h index 41be3d16..dc9a5e27 100644 --- a/components/prefs/pref_service.h +++ b/components/prefs/pref_service.h
@@ -474,7 +474,7 @@ void OnInitializationCompleted(bool succeeded) override; private: - PrefService* pref_service_ = nullptr; + raw_ptr<PrefService> pref_service_ = nullptr; }; // Sends notification of a changed preference. This needs to be called by
diff --git a/components/query_tiles/internal/tile_utils.cc b/components/query_tiles/internal/tile_utils.cc index 173833e1..62bcf1f 100644 --- a/components/query_tiles/internal/tile_utils.cc +++ b/components/query_tiles/internal/tile_utils.cc
@@ -8,6 +8,7 @@ #include <cmath> #include <limits> +#include "base/memory/raw_ptr.h" #include "base/rand_util.h" #include "base/strings/string_util.h" #include "components/query_tiles/internal/tile_config.h" @@ -24,7 +25,7 @@ return (*tile_score_map)[a->id] > (*tile_score_map)[b->id]; } - std::map<std::string, double>* tile_score_map; + raw_ptr<std::map<std::string, double>> tile_score_map; }; void SortTiles(std::vector<std::unique_ptr<Tile>>* tiles,
diff --git a/components/reporting/resources/BUILD.gn b/components/reporting/resources/BUILD.gn index 56960d44..7d788b9 100644 --- a/components/reporting/resources/BUILD.gn +++ b/components/reporting/resources/BUILD.gn
@@ -5,7 +5,10 @@ import("//build/config/features.gni") static_library("resource_interface") { - visibility = [ "//components/reporting/*" ] + visibility = [ + "//chrome/browser/*", + "//components/reporting/*", + ] sources = [ "disk_resource_impl.cc", "disk_resource_impl.h",
diff --git a/components/reporting/storage/BUILD.gn b/components/reporting/storage/BUILD.gn index b470738..871c18e 100644 --- a/components/reporting/storage/BUILD.gn +++ b/components/reporting/storage/BUILD.gn
@@ -26,6 +26,7 @@ "//base", "//components/reporting/proto:record_constants", "//components/reporting/proto:record_proto", + "//components/reporting/resources:resource_interface", "//components/reporting/util:status", "//components/reporting/util:status_proto", ]
diff --git a/components/reporting/storage/storage.cc b/components/reporting/storage/storage.cc index 40e4cc3..93de91a 100644 --- a/components/reporting/storage/storage.cc +++ b/components/reporting/storage/storage.cc
@@ -162,12 +162,14 @@ } void ProcessRecord(EncryptedRecord encrypted_record, + ScopedReservation scoped_reservation, base::OnceCallback<void(bool)> processed_cb) override { // Update sequence information: add Priority. SequenceInformation* const sequence_info = encrypted_record.mutable_sequence_information(); sequence_info->set_priority(priority_); storage_interface_->ProcessRecord(std::move(encrypted_record), + std::move(scoped_reservation), std::move(processed_cb)); }
diff --git a/components/reporting/storage/storage_queue.cc b/components/reporting/storage/storage_queue.cc index ef3d9a9e..dce572d6 100644 --- a/components/reporting/storage/storage_queue.cc +++ b/components/reporting/storage/storage_queue.cc
@@ -998,14 +998,22 @@ google::protobuf::io::ArrayInputStream blob_stream( // Zero-copy stream. blob.data(), blob.size()); EncryptedRecord encrypted_record; + ScopedReservation scoped_reservation( + blob.size(), storage_queue_->options().memory_resource()); + if (!scoped_reservation.reserved()) { + Response( + Status(error::RESOURCE_EXHAUSTED, "Insufficient memory for upload")); + return; + } if (!encrypted_record.ParseFromZeroCopyStream(&blob_stream)) { LOG(ERROR) << "Failed to parse record, seq=" << sequence_info_.sequencing_id(); - CallGapUpload(/*count=*/1); + CallGapUpload(/*count=*/1); // Do not reserve space for Gap record. // Resume at ScheduleNextRecord. return; } - CallRecordUpload(std::move(encrypted_record)); + CallRecordUpload(std::move(encrypted_record), + std::move(scoped_reservation)); } // Completes sequence information and makes a call to UploaderInterface @@ -1014,7 +1022,8 @@ // sequential thread runner of this StorageQueue. If |encrypted_record| is // empty (has no |encrypted_wrapped_record| and/or |encryption_info|), it // indicates a gap notification. - void CallRecordUpload(EncryptedRecord encrypted_record) { + void CallRecordUpload(EncryptedRecord encrypted_record, + ScopedReservation scoped_reservation) { DCHECK_CALLED_ON_VALID_SEQUENCE( storage_queue_->storage_queue_sequence_checker_); if (encrypted_record.has_sequence_information()) { @@ -1028,6 +1037,7 @@ // Priority is attached by the Storage layer. *encrypted_record.mutable_sequence_information() = sequence_info_; uploader_->ProcessRecord(std::move(encrypted_record), + std::move(scoped_reservation), base::BindOnce(&ReadContext::ScheduleNextRecord, base::Unretained(this))); // Move sequencing id forward (ScheduleNextRecord will see this).
diff --git a/components/reporting/storage/storage_queue_stress_test.cc b/components/reporting/storage/storage_queue_stress_test.cc index 1ace4dd..feed94f8 100644 --- a/components/reporting/storage/storage_queue_stress_test.cc +++ b/components/reporting/storage/storage_queue_stress_test.cc
@@ -64,6 +64,7 @@ : last_record_digest_map_(last_record_digest_map) {} void ProcessRecord(EncryptedRecord encrypted_record, + ScopedReservation scoped_reservation, base::OnceCallback<void(bool)> processed_cb) override { WrappedRecord wrapped_record; ASSERT_TRUE(wrapped_record.ParseFromString(
diff --git a/components/reporting/storage/storage_queue_unittest.cc b/components/reporting/storage/storage_queue_unittest.cc index 6afb28c..d255a46 100644 --- a/components/reporting/storage/storage_queue_unittest.cc +++ b/components/reporting/storage/storage_queue_unittest.cc
@@ -267,6 +267,9 @@ .WillOnce(DoAll( WithoutArgs( Invoke(waiter_.get(), &test::TestCallbackWaiter::Signal)), + WithArg<1>(Invoke([](Status status) { + LOG(ERROR) << "Completion signaled with status=" << status; + })), WithoutArgs( Invoke([]() { LOG(ERROR) << "Completion signaled"; })))); return std::move(uploader_); @@ -363,6 +366,7 @@ } void ProcessRecord(EncryptedRecord encrypted_record, + ScopedReservation scoped_reservation, base::OnceCallback<void(bool)> processed_cb) override { DCHECK_CALLED_ON_VALID_SEQUENCE(test_uploader_checker_); auto sequence_information = encrypted_record.sequence_information(); @@ -1815,6 +1819,40 @@ EXPECT_EQ(write_result.error_code(), error::RESOURCE_EXHAUSTED); } +TEST_P(StorageQueueTest, UploadWithInsufficientMemory) { + CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + WriteStringOrDie(kData[0]); + + // Set uploader expectations. + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::PERIODIC))) + .WillOnce(Invoke([&waiter, this](UploaderInterface::UploadReason reason) { + return TestUploader::SetUp(&waiter, this) + .Complete(Status(error::RESOURCE_EXHAUSTED, + "Insufficient memory for upload")); + })) + .RetiresOnSaturation(); + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::FAILURE_RETRY))) + .WillOnce(Invoke([&waiter, this](UploaderInterface::UploadReason reason) { + return TestUploader::SetUp(&waiter, this) + .Required(0, kData[0]) + .Complete(); + })) + .RetiresOnSaturation(); + + // Update total memory to a low amount. + const auto original_total_memory = options_.memory_resource()->GetTotal(); + options_.memory_resource()->Test_SetTotal(100); + // Trigger upload. + task_environment_.FastForwardBy(base::Seconds(1)); + // Reset after running upload so it does not affect other tests. + options_.memory_resource()->Test_SetTotal(original_total_memory); + // Trigger another upload. + task_environment_.FastForwardBy(base::Seconds(1)); +} + INSTANTIATE_TEST_SUITE_P( VaryingFileSize, StorageQueueTest,
diff --git a/components/reporting/storage/storage_unittest.cc b/components/reporting/storage/storage_unittest.cc index 5931e8f..eebb5ee 100644 --- a/components/reporting/storage/storage_unittest.cc +++ b/components/reporting/storage/storage_unittest.cc
@@ -507,6 +507,7 @@ } void ProcessRecord(EncryptedRecord encrypted_record, + ScopedReservation scoped_reservation, base::OnceCallback<void(bool)> processed_cb) override { DCHECK_CALLED_ON_VALID_SEQUENCE(test_uploader_checker_); auto sequence_information = encrypted_record.sequence_information();
diff --git a/components/reporting/storage/storage_uploader_interface.h b/components/reporting/storage/storage_uploader_interface.h index a3d9711..46774f2 100644 --- a/components/reporting/storage/storage_uploader_interface.h +++ b/components/reporting/storage/storage_uploader_interface.h
@@ -12,6 +12,7 @@ #include "base/strings/string_piece.h" #include "components/reporting/proto/synced/record.pb.h" #include "components/reporting/proto/synced/record_constants.pb.h" +#include "components/reporting/resources/resource_interface.h" #include "components/reporting/util/status.h" #include "components/reporting/util/statusor.h" @@ -62,6 +63,7 @@ // the record or error status has been processed, with true if next record // needs to be delivered and false if the Uploader should stop. virtual void ProcessRecord(EncryptedRecord record, + ScopedReservation scoped_reservation, base::OnceCallback<void(bool)> processed_cb) = 0; // Makes a note of a gap [start, start + count). Expects |processed_cb| to
diff --git a/components/safe_browsing/core/browser/tailored_security_service/tailored_security_service.h b/components/safe_browsing/core/browser/tailored_security_service/tailored_security_service.h index 3a7a783..2f85f3af 100644 --- a/components/safe_browsing/core/browser/tailored_security_service/tailored_security_service.h +++ b/components/safe_browsing/core/browser/tailored_security_service/tailored_security_service.h
@@ -183,7 +183,7 @@ bool is_shut_down_ = false; // The preferences for the given profile. - PrefService* prefs_; + raw_ptr<PrefService> prefs_; // This is used to observe when sync users update their Tailored Security // setting.
diff --git a/components/security_interstitials/core/https_only_mode_allowlist.h b/components/security_interstitials/core/https_only_mode_allowlist.h index ea5f081..32250af 100644 --- a/components/security_interstitials/core/https_only_mode_allowlist.h +++ b/components/security_interstitials/core/https_only_mode_allowlist.h
@@ -61,8 +61,8 @@ void SetClockForTesting(base::Clock* clock); private: - HostContentSettingsMap* host_content_settings_map_; - base::Clock* clock_; + raw_ptr<HostContentSettingsMap> host_content_settings_map_; + raw_ptr<base::Clock> clock_; base::TimeDelta expiration_timeout_; // Tracks sites that are allowed to load over HTTP when HTTPS-First Mode is
diff --git a/components/segmentation_platform/content/BUILD.gn b/components/segmentation_platform/content/BUILD.gn index 40bbe13c..c2907aa 100644 --- a/components/segmentation_platform/content/BUILD.gn +++ b/components/segmentation_platform/content/BUILD.gn
@@ -11,6 +11,8 @@ sources = [ "page_load_trigger_context.cc", "page_load_trigger_context.h", + "segmentation_platform_tab_helper.cc", + "segmentation_platform_tab_helper.h", ] deps = [
diff --git a/components/segmentation_platform/content/segmentation_platform_tab_helper.cc b/components/segmentation_platform/content/segmentation_platform_tab_helper.cc new file mode 100644 index 0000000..04a96ca --- /dev/null +++ b/components/segmentation_platform/content/segmentation_platform_tab_helper.cc
@@ -0,0 +1,42 @@ +// 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. + +#include "components/segmentation_platform/content/segmentation_platform_tab_helper.h" + +#include "components/segmentation_platform/content/page_load_trigger_context.h" +#include "components/segmentation_platform/public/segmentation_platform_service.h" +#include "content/public/browser/page.h" +#include "content/public/browser/web_contents.h" + +namespace segmentation_platform { + +SegmentationPlatformTabHelper::SegmentationPlatformTabHelper( + content::WebContents* web_contents, + SegmentationPlatformService* segmentation_platform_service) + : content::WebContentsObserver(web_contents), + content::WebContentsUserData<SegmentationPlatformTabHelper>( + *web_contents), + segmentation_platform_service_(segmentation_platform_service) {} + +SegmentationPlatformTabHelper::~SegmentationPlatformTabHelper() = default; + +void SegmentationPlatformTabHelper::PrimaryPageChanged(content::Page& page) { + if (!segmentation_platform_service_) + return; + + if (page.GetMainDocument().IsErrorDocument()) + return; + + // Only trigger for the visible tabs. + if (GetWebContents().GetVisibility() == content::Visibility::HIDDEN) + return; + + PageLoadTriggerContext trigger_context(&GetWebContents()); + segmentation_platform_service_->OnTrigger(TriggerType::kPageLoad, + trigger_context); +} + +WEB_CONTENTS_USER_DATA_KEY_IMPL(SegmentationPlatformTabHelper); + +} // namespace segmentation_platform
diff --git a/components/segmentation_platform/content/segmentation_platform_tab_helper.h b/components/segmentation_platform/content/segmentation_platform_tab_helper.h new file mode 100644 index 0000000..593d2e7 --- /dev/null +++ b/components/segmentation_platform/content/segmentation_platform_tab_helper.h
@@ -0,0 +1,50 @@ +// 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. + +#ifndef COMPONENTS_SEGMENTATION_PLATFORM_CONTENT_SEGMENTATION_PLATFORM_TAB_HELPER_H_ +#define COMPONENTS_SEGMENTATION_PLATFORM_CONTENT_SEGMENTATION_PLATFORM_TAB_HELPER_H_ + +#include "base/memory/raw_ptr.h" +#include "base/memory/weak_ptr.h" +#include "content/public/browser/web_contents_observer.h" +#include "content/public/browser/web_contents_user_data.h" + +namespace content { +class Page; +class WebContents; +} // namespace content + +namespace segmentation_platform { +class SegmentationPlatformService; + +// Observes navigation specific trigger events for a given tab. +class SegmentationPlatformTabHelper + : public content::WebContentsObserver, + public content::WebContentsUserData<SegmentationPlatformTabHelper> { + public: + SegmentationPlatformTabHelper( + content::WebContents* web_contents, + SegmentationPlatformService* segmentation_platform_service); + + SegmentationPlatformTabHelper(const SegmentationPlatformTabHelper&) = delete; + SegmentationPlatformTabHelper& operator=( + const SegmentationPlatformTabHelper&) = delete; + + ~SegmentationPlatformTabHelper() override; + + private: + friend class content::WebContentsUserData<SegmentationPlatformTabHelper>; + + // content::WebContentsObserver implementation + void PrimaryPageChanged(content::Page& page) override; + + raw_ptr<SegmentationPlatformService> segmentation_platform_service_; + base::WeakPtrFactory<SegmentationPlatformTabHelper> weak_ptr_factory_{this}; + + WEB_CONTENTS_USER_DATA_KEY_DECL(); +}; + +} // namespace segmentation_platform + +#endif // COMPONENTS_SEGMENTATION_PLATFORM_CONTENT_SEGMENTATION_PLATFORM_TAB_HELPER_H_
diff --git a/components/segmentation_platform/internal/execution/execution_request.h b/components/segmentation_platform/internal/execution/execution_request.h index 271b98267..e610475 100644 --- a/components/segmentation_platform/internal/execution/execution_request.h +++ b/components/segmentation_platform/internal/execution/execution_request.h
@@ -27,7 +27,7 @@ ~ExecutionRequest(); // Required: The segment info to use for model execution. - const proto::SegmentInfo* segment_info = nullptr; + raw_ptr<const proto::SegmentInfo> segment_info = nullptr; // The model provider used to execute the model. raw_ptr<ModelProvider> model_provider = nullptr;
diff --git a/components/segmentation_platform/internal/metadata/metadata_writer.h b/components/segmentation_platform/internal/metadata/metadata_writer.h index 091a53a..e7943fe 100644 --- a/components/segmentation_platform/internal/metadata/metadata_writer.h +++ b/components/segmentation_platform/internal/metadata/metadata_writer.h
@@ -8,6 +8,7 @@ #include <cinttypes> #include <cstddef> +#include "base/memory/raw_ptr.h" #include "components/segmentation_platform/internal/database/ukm_types.h" #include "components/segmentation_platform/internal/proto/model_metadata.pb.h" @@ -63,7 +64,7 @@ const char* const sql{nullptr}; struct EventAndMetrics { const UkmEventHash event_hash; - const UkmMetricHash* const metrics{nullptr}; + const raw_ptr<const UkmMetricHash> metrics{nullptr}; const size_t metrics_size{0}; }; const EventAndMetrics* const events{nullptr}; @@ -89,7 +90,7 @@ int64_t result_time_to_live); private: - proto::SegmentationModelMetadata* const metadata_; + const raw_ptr<proto::SegmentationModelMetadata> metadata_; }; } // namespace segmentation_platform
diff --git a/components/segmentation_platform/internal/segmentation_platform_service_impl.cc b/components/segmentation_platform/internal/segmentation_platform_service_impl.cc index 18680a3d..f37f983f 100644 --- a/components/segmentation_platform/internal/segmentation_platform_service_impl.cc +++ b/components/segmentation_platform/internal/segmentation_platform_service_impl.cc
@@ -56,13 +56,13 @@ std::unique_ptr<InitParams> init_params) : model_provider_factory_(std::move(init_params->model_provider)), task_runner_(init_params->task_runner), - clock_(init_params->clock), + clock_(init_params->clock.get()), platform_options_(PlatformOptions::CreateDefault()), input_delegate_holder_(std::move(init_params->input_delegate_holder)), configs_(std::move(init_params->configs)), all_segment_ids_(GetAllSegmentIds(configs_)), field_trial_register_(std::move(init_params->field_trial_register)), - profile_prefs_(init_params->profile_prefs), + profile_prefs_(init_params->profile_prefs.get()), creation_time_(clock_->Now()) { base::UmaHistogramMediumTimes( "SegmentationPlatform.Init.ProcessCreationToServiceCreationLatency",
diff --git a/components/segmentation_platform/internal/segmentation_platform_service_impl.h b/components/segmentation_platform/internal/segmentation_platform_service_impl.h index b270fb78..399f5508 100644 --- a/components/segmentation_platform/internal/segmentation_platform_service_impl.h +++ b/components/segmentation_platform/internal/segmentation_platform_service_impl.h
@@ -62,20 +62,20 @@ bool IsValid(); // Profile data: - leveldb_proto::ProtoDatabaseProvider* db_provider = nullptr; - history::HistoryService* history_service = nullptr; + raw_ptr<leveldb_proto::ProtoDatabaseProvider> db_provider = nullptr; + raw_ptr<history::HistoryService> history_service = nullptr; base::FilePath storage_dir; - PrefService* profile_prefs = nullptr; + raw_ptr<PrefService> profile_prefs = nullptr; // Platform configuration: std::unique_ptr<ModelProviderFactory> model_provider; - UkmDataManager* ukm_data_manager = nullptr; + raw_ptr<UkmDataManager> ukm_data_manager = nullptr; std::vector<std::unique_ptr<Config>> configs; std::unique_ptr<FieldTrialRegister> field_trial_register; std::unique_ptr<processing::InputDelegateHolder> input_delegate_holder; scoped_refptr<base::SequencedTaskRunner> task_runner; - base::Clock* clock = nullptr; + raw_ptr<base::Clock> clock = nullptr; // Test only: std::unique_ptr<StorageService> storage_service;
diff --git a/components/segmentation_platform/internal/selection/segment_result_provider_unittest.cc b/components/segmentation_platform/internal/selection/segment_result_provider_unittest.cc index 578b4da6..cb0c362 100644 --- a/components/segmentation_platform/internal/selection/segment_result_provider_unittest.cc +++ b/components/segmentation_platform/internal/selection/segment_result_provider_unittest.cc
@@ -4,6 +4,7 @@ #include "components/segmentation_platform/internal/selection/segment_result_provider.h" +#include "base/memory/raw_ptr.h" #include "base/test/gmock_callback_support.h" #include "base/test/simple_test_clock.h" #include "base/test/task_environment.h" @@ -166,8 +167,9 @@ TestModelProviderFactory::Data model_providers_; TestModelProviderFactory provider_factory_; MockSignalDatabase signal_database_; - processing::MockFeatureListQueryProcessor* mock_query_processor_ = nullptr; - MockModelExecutionManager* mock_execution_manager_; + raw_ptr<processing::MockFeatureListQueryProcessor> mock_query_processor_ = + nullptr; + raw_ptr<MockModelExecutionManager> mock_execution_manager_; SignalHandler signal_handler_; std::unique_ptr<DefaultModelManager> default_manager_; std::unique_ptr<ExecutionService> execution_service_;
diff --git a/components/segmentation_platform/internal/signals/user_action_signal_handler.cc b/components/segmentation_platform/internal/signals/user_action_signal_handler.cc index b97d58d..d2d9170 100644 --- a/components/segmentation_platform/internal/signals/user_action_signal_handler.cc +++ b/components/segmentation_platform/internal/signals/user_action_signal_handler.cc
@@ -19,12 +19,12 @@ } UserActionSignalHandler::~UserActionSignalHandler() { - if (metrics_enabled_) + if (metrics_enabled_ && base::GetRecordActionTaskRunner()) base::RemoveActionCallback(action_callback_); } void UserActionSignalHandler::EnableMetrics(bool enable_metrics) { - if (metrics_enabled_ == enable_metrics) + if (metrics_enabled_ == enable_metrics || !base::GetRecordActionTaskRunner()) return; metrics_enabled_ = enable_metrics;
diff --git a/components/services/app_service/public/cpp/app_registry_cache_unittest.cc b/components/services/app_service/public/cpp/app_registry_cache_unittest.cc index b5f080af..4798bfc1 100644 --- a/components/services/app_service/public/cpp/app_registry_cache_unittest.cc +++ b/components/services/app_service/public/cpp/app_registry_cache_unittest.cc
@@ -10,6 +10,7 @@ #include <vector> #include "base/containers/contains.h" +#include "base/memory/raw_ptr.h" #include "base/test/scoped_feature_list.h" #include "components/services/app_service/public/cpp/app_types.h" #include "components/services/app_service/public/cpp/features.h" @@ -93,7 +94,7 @@ private: std::vector<std::string> updated_ids_; std::vector<apps::Readiness> readinesses_; - apps::AppRegistryCache* cache_ = nullptr; + raw_ptr<apps::AppRegistryCache> cache_ = nullptr; }; // Responds to a cache's OnAppUpdate to call back into the cache, checking that @@ -303,7 +304,7 @@ std::set<apps::AppType> app_types_; int initialized_app_type_count_ = 0; int app_count_at_initialization_ = 0; - apps::AppRegistryCache* cache_ = nullptr; + raw_ptr<apps::AppRegistryCache> cache_ = nullptr; }; } // namespace
diff --git a/components/services/unzip/unzipper_impl.cc b/components/services/unzip/unzipper_impl.cc index 1515accd..a0f5ba9 100644 --- a/components/services/unzip/unzipper_impl.cc +++ b/components/services/unzip/unzipper_impl.cc
@@ -11,6 +11,7 @@ #include "base/compiler_specific.h" #include "base/files/file.h" #include "base/logging.h" +#include "base/memory/raw_ptr.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "components/services/filesystem/public/mojom/directory.mojom.h" @@ -80,7 +81,7 @@ private: const mojo::Remote<filesystem::mojom::Directory> owned_output_dir_; - filesystem::mojom::Directory* const output_dir_; + const raw_ptr<filesystem::mojom::Directory> output_dir_; const base::FilePath path_; };
diff --git a/components/signin/internal/identity_manager/account_tracker_service_unittest.cc b/components/signin/internal/identity_manager/account_tracker_service_unittest.cc index dac0ee2..4a4226c5 100644 --- a/components/signin/internal/identity_manager/account_tracker_service_unittest.cc +++ b/components/signin/internal/identity_manager/account_tracker_service_unittest.cc
@@ -9,6 +9,7 @@ #include "base/auto_reset.h" #include "base/files/scoped_temp_dir.h" +#include "base/memory/raw_ptr.h" #include "base/strings/stringprintf.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" @@ -414,7 +415,7 @@ FakeProfileOAuth2TokenService fake_oauth2_token_service_; std::unique_ptr<AccountFetcherService> account_fetcher_; std::unique_ptr<AccountTrackerService> account_tracker_; - FakeAccountCapabilitiesFetcherFactory* + raw_ptr<FakeAccountCapabilitiesFetcherFactory> fake_account_capabilities_fetcher_factory_ = nullptr; std::vector<TrackingEvent> account_tracker_events_; bool force_account_id_to_email_for_legacy_tests_ = false;
diff --git a/components/signin/public/identity_manager/account_capabilities_test_mutator.h b/components/signin/public/identity_manager/account_capabilities_test_mutator.h index 216b53f..08a2ac4 100644 --- a/components/signin/public/identity_manager/account_capabilities_test_mutator.h +++ b/components/signin/public/identity_manager/account_capabilities_test_mutator.h
@@ -5,6 +5,7 @@ #ifndef COMPONENTS_SIGNIN_PUBLIC_IDENTITY_MANAGER_ACCOUNT_CAPABILITIES_TEST_MUTATOR_H_ #define COMPONENTS_SIGNIN_PUBLIC_IDENTITY_MANAGER_ACCOUNT_CAPABILITIES_TEST_MUTATOR_H_ +#include "base/memory/raw_ptr.h" #include "components/signin/public/identity_manager/account_capabilities.h" // Support class that allows callers to modify internal capability state @@ -27,7 +28,7 @@ void SetAllSupportedCapabilities(bool value); private: - AccountCapabilities* capabilities_; + raw_ptr<AccountCapabilities> capabilities_; }; #endif // COMPONENTS_SIGNIN_PUBLIC_IDENTITY_MANAGER_ACCOUNT_CAPABILITIES_TEST_MUTATOR_H_
diff --git a/components/sync/engine/nigori/nigori.cc b/components/sync/engine/nigori/nigori.cc index ed7a27b..4896b00 100644 --- a/components/sync/engine/nigori/nigori.cc +++ b/components/sync/engine/nigori/nigori.cc
@@ -238,9 +238,6 @@ // Enc[Kenc,Kmac](value) bool Nigori::Encrypt(const std::string& value, std::string* encrypted) const { - if (0U >= value.size()) - return false; - std::string iv; crypto::RandBytes(base::WriteInto(&iv, kIvSize + 1), kIvSize);
diff --git a/components/sync/engine/nigori/nigori_unittest.cc b/components/sync/engine/nigori/nigori_unittest.cc index 21e6b39..7222a68 100644 --- a/components/sync/engine/nigori/nigori_unittest.cc +++ b/components/sync/engine/nigori/nigori_unittest.cc
@@ -126,6 +126,22 @@ EXPECT_EQ(plaintext, decrypted); } +TEST(SyncNigoriTest, EncryptDecryptEmptyString) { + std::unique_ptr<Nigori> nigori = Nigori::CreateByDerivation( + KeyDerivationParams::CreateForPbkdf2(), "password"); + ASSERT_THAT(nigori, NotNull()); + + std::string plaintext; + + std::string encrypted; + EXPECT_TRUE(nigori->Encrypt(plaintext, &encrypted)); + + std::string decrypted; + EXPECT_TRUE(nigori->Decrypt(encrypted, &decrypted)); + + EXPECT_EQ(plaintext, decrypted); +} + TEST(SyncNigoriTest, CorruptedIv) { std::unique_ptr<Nigori> nigori = Nigori::CreateByDerivation( KeyDerivationParams::CreateForPbkdf2(), "password");
diff --git a/components/sync_bookmarks/parent_guid_preprocessing.cc b/components/sync_bookmarks/parent_guid_preprocessing.cc index 40b7356..bb49c31 100644 --- a/components/sync_bookmarks/parent_guid_preprocessing.cc +++ b/components/sync_bookmarks/parent_guid_preprocessing.cc
@@ -9,6 +9,7 @@ #include "base/check.h" #include "base/guid.h" +#include "base/memory/raw_ptr.h" #include "base/strings/string_piece.h" #include "components/bookmarks/browser/bookmark_node.h" #include "components/sync/protocol/bookmark_specifics.pb.h" @@ -126,7 +127,7 @@ } } - const syncer::UpdateResponseDataList* const updates_; + const raw_ptr<const syncer::UpdateResponseDataList> updates_; bool initialized_ = false; std:: unordered_map<base::StringPiece, base::StringPiece, base::StringPieceHash>
diff --git a/components/url_param_filter/core/url_param_classifications_loader_unittest.cc b/components/url_param_filter/core/url_param_classifications_loader_unittest.cc index 20998c3..5a9852e 100644 --- a/components/url_param_filter/core/url_param_classifications_loader_unittest.cc +++ b/components/url_param_filter/core/url_param_classifications_loader_unittest.cc
@@ -11,6 +11,7 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" +#include "base/memory/raw_ptr.h" #include "base/test/scoped_feature_list.h" #include "components/url_param_filter/core/features.h" #include "components/url_param_filter/core/url_param_filter_classification.pb.h" @@ -76,7 +77,7 @@ std::string test_file_contents() { return raw_test_file_; } private: - ClassificationsLoader* classifications_loader_; + raw_ptr<ClassificationsLoader> classifications_loader_; base::test::ScopedFeatureList scoped_feature_list_; std::string raw_test_file_; };
diff --git a/components/url_rewrite/browser/url_request_rewrite_rules_manager_browsertest.cc b/components/url_rewrite/browser/url_request_rewrite_rules_manager_browsertest.cc index 9dec9ec..ac4a7c7 100644 --- a/components/url_rewrite/browser/url_request_rewrite_rules_manager_browsertest.cc +++ b/components/url_rewrite/browser/url_request_rewrite_rules_manager_browsertest.cc
@@ -4,6 +4,7 @@ #include "base/base_paths.h" #include "base/files/file_path.h" +#include "base/memory/raw_ptr.h" #include "base/path_service.h" #include "base/test/scoped_feature_list.h" #include "components/url_rewrite/browser/url_request_rewrite_rules_manager.h" @@ -44,7 +45,7 @@ } base::RunLoop run_loop_{base::RunLoop::Type::kNestableTasksAllowed}; - UrlRequestRewriteRulesManager* url_request_rewrite_rules_manager_; + raw_ptr<UrlRequestRewriteRulesManager> url_request_rewrite_rules_manager_; }; class UrlRequestRewriteRulesManagerBrowserTest
diff --git a/components/user_education/common/feature_promo_controller.cc b/components/user_education/common/feature_promo_controller.cc index ca9446e6..2b64813 100644 --- a/components/user_education/common/feature_promo_controller.cc +++ b/components/user_education/common/feature_promo_controller.cc
@@ -412,7 +412,7 @@ critical_promo_bubble_ = nullptr; } else if (bubble == promo_bubble_.get()) { if (!continuing_after_bubble_closed_) { - if (iph_feature_bypassing_tracker_ != current_iph_feature_) + if (iph_feature_bypassing_tracker_.get() != current_iph_feature_) feature_engagement_tracker_->Dismissed(*current_iph_feature_); else iph_feature_bypassing_tracker_ = nullptr;
diff --git a/components/user_education/common/feature_promo_controller.h b/components/user_education/common/feature_promo_controller.h index ccadec7..a189b99 100644 --- a/components/user_education/common/feature_promo_controller.h +++ b/components/user_education/common/feature_promo_controller.h
@@ -78,7 +78,7 @@ private: base::WeakPtr<FeaturePromoController> controller_; - const base::Feature* feature_ = nullptr; + raw_ptr<const base::Feature> feature_ = nullptr; }; FeaturePromoController(); @@ -344,7 +344,7 @@ TutorialIdentifier tutorial_id); // The feature promo registry to use. - FeaturePromoRegistry* const registry_; + const raw_ptr<FeaturePromoRegistry> registry_; // Non-null as long as a promo is showing. Corresponds to an IPH // feature registered with |feature_engagement_tracker_|. @@ -380,7 +380,7 @@ // engagement tracker, the current iph feature will be set and then checked // against to verify the right feature is bypassing. this page is located at // internals/user-education. - const base::Feature* iph_feature_bypassing_tracker_ = nullptr; + raw_ptr<const base::Feature> iph_feature_bypassing_tracker_ = nullptr; base::WeakPtrFactory<FeaturePromoControllerCommon> weak_ptr_factory_{this};
diff --git a/components/user_education/common/tutorial_service.h b/components/user_education/common/tutorial_service.h index 6c16b0a1..dc05364 100644 --- a/components/user_education/common/tutorial_service.h +++ b/components/user_education/common/tutorial_service.h
@@ -11,6 +11,7 @@ #include "base/callback_forward.h" #include "base/callback_helpers.h" #include "base/callback_list.h" +#include "base/memory/raw_ptr.h" #include "components/user_education/common/tutorial.h" #include "components/user_education/common/tutorial_identifier.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -85,7 +86,7 @@ TutorialCreationParams(TutorialDescription* description, ui::ElementContext context); - TutorialDescription* description_; + raw_ptr<TutorialDescription> description_; ui::ElementContext context_; }; @@ -125,8 +126,8 @@ // Pointers to the registries used for constructing and showing tutorials and // help bubbles. - TutorialRegistry* const tutorial_registry_; - HelpBubbleFactoryRegistry* const help_bubble_factory_registry_; + const raw_ptr<TutorialRegistry> tutorial_registry_; + const raw_ptr<HelpBubbleFactoryRegistry> help_bubble_factory_registry_; // Number of times focus was toggled during the current tutorial. int toggle_focus_count_ = 0;
diff --git a/components/visitedlink/test/visitedlink_unittest.cc b/components/visitedlink/test/visitedlink_unittest.cc index 51e6d184..6840189b 100644 --- a/components/visitedlink/test/visitedlink_unittest.cc +++ b/components/visitedlink/test/visitedlink_unittest.cc
@@ -14,6 +14,7 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/location.h" +#include "base/memory/raw_ptr.h" #include "base/process/process_handle.h" #include "base/run_loop.h" #include "base/strings/string_util.h" @@ -678,7 +679,8 @@ void DeleteRenderProcessHosts() { processes_.clear(); } private: - content::RenderProcessHostCreationObserver* creation_observer_ = nullptr; + raw_ptr<content::RenderProcessHostCreationObserver> creation_observer_ = + nullptr; std::list<std::unique_ptr<VisitRelayingRenderProcessHost>> processes_; std::unique_ptr<VisitCountingContext> context_;
diff --git a/components/viz/service/display/overlay_candidate.h b/components/viz/service/display/overlay_candidate.h index bf3213f..a205623 100644 --- a/components/viz/service/display/overlay_candidate.h +++ b/components/viz/service/display/overlay_candidate.h
@@ -9,6 +9,7 @@ #include <vector> #include "base/containers/flat_map.h" +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "components/viz/common/quads/aggregated_render_pass.h" #include "components/viz/common/quads/tile_draw_quad.h" @@ -271,10 +272,10 @@ gfx::RectF GetDamageRect(const DrawQuad* quad, const OverlayCandidate& candidate) const; - const AggregatedRenderPass* render_pass_; - DisplayResourceProvider* resource_provider_; - const SurfaceDamageRectList* surface_damage_rect_list_; - const SkM44* output_color_matrix_; + raw_ptr<const AggregatedRenderPass> render_pass_; + raw_ptr<DisplayResourceProvider> resource_provider_; + raw_ptr<const SurfaceDamageRectList> surface_damage_rect_list_; + raw_ptr<const SkM44> output_color_matrix_; const gfx::RectF primary_rect_; bool is_delegated_context_;
diff --git a/components/webcrypto/algorithms/test_helpers.cc b/components/webcrypto/algorithms/test_helpers.cc index ccee6fa..2cbfc7a 100644 --- a/components/webcrypto/algorithms/test_helpers.cc +++ b/components/webcrypto/algorithms/test_helpers.cc
@@ -13,6 +13,7 @@ #include "base/files/file_util.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" +#include "base/memory/raw_ptr.h" #include "base/path_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -207,7 +208,7 @@ bool operator()(size_t i1, size_t i2) { return (*bufs_)[i1] < (*bufs_)[i2]; } private: - const std::vector<std::vector<uint8_t>>* bufs_; + raw_ptr<const std::vector<std::vector<uint8_t>>> bufs_; }; bool CopiesExist(const std::vector<std::vector<uint8_t>>& bufs) {
diff --git a/components/webrtc_logging/common/partial_circular_buffer.cc b/components/webrtc_logging/common/partial_circular_buffer.cc index ee221054..b349803 100644 --- a/components/webrtc_logging/common/partial_circular_buffer.cc +++ b/components/webrtc_logging/common/partial_circular_buffer.cc
@@ -18,7 +18,7 @@ position_(0), total_read_(0) { uint32_t header_size = - buffer_data_->data - reinterpret_cast<uint8_t*>(buffer_data_); + buffer_data_->data - reinterpret_cast<uint8_t*>(buffer_data_.get()); data_size_ = memory_buffer_size_ - header_size; DCHECK(buffer_data_); @@ -38,7 +38,7 @@ position_(0), total_read_(0) { uint32_t header_size = - buffer_data_->data - reinterpret_cast<uint8_t*>(buffer_data_); + buffer_data_->data - reinterpret_cast<uint8_t*>(buffer_data_.get()); data_size_ = memory_buffer_size_ - header_size; DCHECK(buffer_data_);
diff --git a/components/webrtc_logging/common/partial_circular_buffer.h b/components/webrtc_logging/common/partial_circular_buffer.h index e78411a..5ad83f6 100644 --- a/components/webrtc_logging/common/partial_circular_buffer.h +++ b/components/webrtc_logging/common/partial_circular_buffer.h
@@ -7,6 +7,8 @@ #include <stdint.h> +#include "base/memory/raw_ptr.h" + namespace webrtc_logging { // A wrapper around a memory buffer that allows circular read and write with a @@ -56,7 +58,7 @@ void DoWrite(const uint8_t* input, uint32_t input_size); // Used for reading and writing. - BufferData* buffer_data_; + raw_ptr<BufferData> buffer_data_; uint32_t memory_buffer_size_; uint32_t data_size_; uint32_t position_;
diff --git a/content/browser/accessibility/accessibility_win_browsertest.cc b/content/browser/accessibility/accessibility_win_browsertest.cc index 8b9ed7c..b9b663d 100644 --- a/content/browser/accessibility/accessibility_win_browsertest.cc +++ b/content/browser/accessibility/accessibility_win_browsertest.cc
@@ -14,6 +14,7 @@ #include "base/bind.h" #include "base/callback_helpers.h" #include "base/command_line.h" +#include "base/memory/raw_ptr.h" #include "base/process/process_handle.h" #include "base/strings/escape.h" #include "base/strings/pattern.h" @@ -875,7 +876,7 @@ std::unique_ptr<ui::AXEventRecorder> event_recorder_; std::string match_pattern_; base::RunLoop run_loop_; - BrowserAccessibilityManager* browser_accessibility_manager_; + raw_ptr<BrowserAccessibilityManager> browser_accessibility_manager_; }; // Helper class that reproduces a specific crash when UIA parent navigation
diff --git a/content/browser/accessibility/browser_accessibility.h b/content/browser/accessibility/browser_accessibility.h index bea57cc6..8456e07 100644 --- a/content/browser/accessibility/browser_accessibility.h +++ b/content/browser/accessibility/browser_accessibility.h
@@ -164,7 +164,7 @@ } private: - const BrowserAccessibility* const parent_; + const raw_ptr<const BrowserAccessibility> parent_; }; // Returns a range for platform children which can be used in range-based for @@ -256,8 +256,8 @@ } private: - const BrowserAccessibility* const parent_; - const BrowserAccessibility* const child_tree_root_; + const raw_ptr<const BrowserAccessibility> parent_; + const raw_ptr<const BrowserAccessibility> child_tree_root_; }; // Returns a range for all children including ignored children, which can be
diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 2f67ea4..369f8c77 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
@@ -1109,6 +1109,11 @@ RunAriaTest(FILE_PATH_LITERAL("aria-modal-remove-parent-container.html")); } +IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, + AccessibilityAriaModalUnhidden) { + RunAriaTest(FILE_PATH_LITERAL("aria-modal-unhidden.html")); +} + IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaMultiline) { RunAriaTest(FILE_PATH_LITERAL("aria-multiline.html")); }
diff --git a/content/browser/browsing_data/shared_storage_clear_site_data_tester.h b/content/browser/browsing_data/shared_storage_clear_site_data_tester.h index 9eafdaa..f79ac50 100644 --- a/content/browser/browsing_data/shared_storage_clear_site_data_tester.h +++ b/content/browser/browsing_data/shared_storage_clear_site_data_tester.h
@@ -8,6 +8,7 @@ #include <string> #include <vector> +#include "base/memory/raw_ptr.h" #include "content/browser/storage_partition_impl.h" #include "content/public/browser/storage_partition.h" #include "url/origin.h" @@ -37,7 +38,7 @@ int GetSharedStorageTotalEntries(); private: - StoragePartitionImpl* storage_partition_impl_; + raw_ptr<StoragePartitionImpl> storage_partition_impl_; }; } // namespace content
diff --git a/content/browser/interest_group/auction_process_manager.cc b/content/browser/interest_group/auction_process_manager.cc index c87cfb2..a5741b9 100644 --- a/content/browser/interest_group/auction_process_manager.cc +++ b/content/browser/interest_group/auction_process_manager.cc
@@ -128,7 +128,7 @@ ~WorkletProcess() override { NotifyUnusableOnce(); } - RenderProcessHost* render_process_host_; + raw_ptr<RenderProcessHost> render_process_host_; const WorkletType worklet_type_; const url::Origin origin_;
diff --git a/content/browser/interest_group/auction_worklet_manager.cc b/content/browser/interest_group/auction_worklet_manager.cc index 1faf23ed..ff274f1 100644 --- a/content/browser/interest_group/auction_worklet_manager.cc +++ b/content/browser/interest_group/auction_worklet_manager.cc
@@ -102,7 +102,7 @@ // The latter allows a handle to still exist and refer to a WorkletOwner with // a broken Worklet pipe, while new requests for the same worklet will result // in creating a fresh Mojo worklet. - AuctionWorkletManager* worklet_manager_; + raw_ptr<AuctionWorkletManager> worklet_manager_; const WorkletInfo worklet_info_;
diff --git a/content/browser/locks/lock_manager_unittest.cc b/content/browser/locks/lock_manager_unittest.cc index 3d7ed9e..43d9d09 100644 --- a/content/browser/locks/lock_manager_unittest.cc +++ b/content/browser/locks/lock_manager_unittest.cc
@@ -6,6 +6,7 @@ #include <vector> +#include "base/memory/raw_ptr.h" #include "base/test/bind.h" #include "base/test/task_environment.h" #include "mojo/public/cpp/bindings/associated_receiver.h" @@ -70,7 +71,7 @@ bool AbortCalled() const { return aborted_; } private: - mojo::PendingAssociatedRemote<blink::mojom::LockHandle>* remote_; + raw_ptr<mojo::PendingAssociatedRemote<blink::mojom::LockHandle>> remote_; mojo::AssociatedReceiver<blink::mojom::LockRequest> receiver_; base::RunLoop run_loop_; bool failed_ = false;
diff --git a/content/browser/media/session/media_session_impl.cc b/content/browser/media/session/media_session_impl.cc index c17c097..6b6b9c2 100644 --- a/content/browser/media/session/media_session_impl.cc +++ b/content/browser/media/session/media_session_impl.cc
@@ -108,7 +108,7 @@ break; } ++depth; - current_frame = current_frame->GetParent(); + current_frame = current_frame->GetParentOrOuterDocument(); } (*map_rfh_to_depth)[rfh] = depth; return depth;
diff --git a/content/browser/media/session/media_session_impl_service_routing_unittest.cc b/content/browser/media/session/media_session_impl_service_routing_unittest.cc index d0ae5f4..0d61273 100644 --- a/content/browser/media/session/media_session_impl_service_routing_unittest.cc +++ b/content/browser/media/session/media_session_impl_service_routing_unittest.cc
@@ -10,6 +10,7 @@ #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_feature_list.h" #include "base/time/time.h" #include "content/browser/media/session/media_session_player_observer.h" #include "content/browser/media/session/mock_media_session_service_impl.h" @@ -19,6 +20,7 @@ #include "services/media_session/public/cpp/media_metadata.h" #include "services/media_session/public/cpp/test/mock_media_session.h" #include "services/media_session/public/mojom/constants.mojom.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/mojom/mediasession/media_session.mojom.h" using ::testing::_; @@ -1221,4 +1223,119 @@ } } +class MediaSessionImplServiceRoutingFencedFrameTest + : public MediaSessionImplServiceRoutingTest { + public: + MediaSessionImplServiceRoutingFencedFrameTest() { + scoped_feature_list_.InitAndEnableFeatureWithParameters( + blink::features::kFencedFrames, {{"implementation_type", "mparch"}}); + } + + void SetUp() override { + MediaSessionImplServiceRoutingTest::SetUp(); + fenced_frame_ = main_frame_->AppendFencedFrame(); + } + + void CreateFencedFrameInSubframe() { + inner_fenced_frame_ = sub_frame_->AppendFencedFrame(); + } + + protected: + raw_ptr<TestRenderFrameHost> fenced_frame_; + raw_ptr<TestRenderFrameHost> inner_fenced_frame_; + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +TEST_F(MediaSessionImplServiceRoutingFencedFrameTest, NoFrameProducesAudio) { + CreateServiceForFrame(main_frame_); + CreateServiceForFrame(fenced_frame_); + + ASSERT_EQ(nullptr, ComputeServiceForRouting()); +} + +TEST_F(MediaSessionImplServiceRoutingFencedFrameTest, + OnlyFencedFrameProducesAudioButHasNoService) { + StartPlayerForFrame(fenced_frame_); + + ASSERT_EQ(nullptr, ComputeServiceForRouting()); +} + +TEST_F(MediaSessionImplServiceRoutingFencedFrameTest, + OnlyFencedFrameProducesAudioButHasDestroyedService) { + CreateServiceForFrame(fenced_frame_); + StartPlayerForFrame(fenced_frame_); + DestroyServiceForFrame(fenced_frame_); + + ASSERT_EQ(nullptr, ComputeServiceForRouting()); +} + +TEST_F(MediaSessionImplServiceRoutingFencedFrameTest, + OnlyFencedFrameProducesAudioAndServiceIsCreatedAfterwards) { + StartPlayerForFrame(fenced_frame_); + CreateServiceForFrame(fenced_frame_); + + ASSERT_EQ(services_[fenced_frame_].get(), ComputeServiceForRouting()); +} + +TEST_F(MediaSessionImplServiceRoutingFencedFrameTest, + BothFrameProducesAudioButOnlyFencedFrameHasService) { + StartPlayerForFrame(main_frame_); + StartPlayerForFrame(fenced_frame_); + + CreateServiceForFrame(fenced_frame_); + + ASSERT_EQ(services_[fenced_frame_].get(), ComputeServiceForRouting()); +} + +TEST_F(MediaSessionImplServiceRoutingFencedFrameTest, PreferTopMostFrame) { + StartPlayerForFrame(main_frame_); + StartPlayerForFrame(fenced_frame_); + + CreateServiceForFrame(main_frame_); + CreateServiceForFrame(fenced_frame_); + + ASSERT_EQ(services_[main_frame_].get(), ComputeServiceForRouting()); +} + +TEST_F(MediaSessionImplServiceRoutingFencedFrameTest, + RoutedServiceUpdatedAfterRemovingPlayer) { + StartPlayerForFrame(main_frame_); + StartPlayerForFrame(fenced_frame_); + + CreateServiceForFrame(main_frame_); + CreateServiceForFrame(fenced_frame_); + + ClearPlayersForFrame(main_frame_); + + ASSERT_EQ(services_[fenced_frame_].get(), ComputeServiceForRouting()); +} + +TEST_F(MediaSessionImplServiceRoutingFencedFrameTest, PreferSubFrame) { + CreateFencedFrameInSubframe(); + + StartPlayerForFrame(sub_frame_); + StartPlayerForFrame(inner_fenced_frame_); + + CreateServiceForFrame(sub_frame_); + CreateServiceForFrame(inner_fenced_frame_); + + ASSERT_EQ(services_[sub_frame_].get(), ComputeServiceForRouting()); +} + +TEST_F(MediaSessionImplServiceRoutingFencedFrameTest, + AllFrameProducesAudioButSubFrameAndFencedFrameHaveService) { + CreateFencedFrameInSubframe(); + + StartPlayerForFrame(main_frame_); + StartPlayerForFrame(sub_frame_); + StartPlayerForFrame(inner_fenced_frame_); + + CreateServiceForFrame(sub_frame_); + CreateServiceForFrame(inner_fenced_frame_); + + ASSERT_EQ(services_[sub_frame_].get(), ComputeServiceForRouting()); +} + } // namespace content
diff --git a/content/browser/mojo_binder_policy_map_impl.cc b/content/browser/mojo_binder_policy_map_impl.cc index 8efc645d..b37cb62 100644 --- a/content/browser/mojo_binder_policy_map_impl.cc +++ b/content/browser/mojo_binder_policy_map_impl.cc
@@ -43,10 +43,6 @@ // content/browser/prerender/prerender_metrics.h once you add a new kCancel // interface. - // NotificationService has a sync message and is requested in - // Notification constructor, so it should be kCancel. - map.SetNonAssociatedPolicy<blink::mojom::NotificationService>( - MojoBinderNonAssociatedPolicy::kCancel); map.SetNonAssociatedPolicy<device::mojom::GamepadHapticsManager>( MojoBinderNonAssociatedPolicy::kCancel); map.SetNonAssociatedPolicy<device::mojom::GamepadMonitor>(
diff --git a/content/browser/picture_in_picture/document_picture_in_picture_window_controller_impl.h b/content/browser/picture_in_picture/document_picture_in_picture_window_controller_impl.h index 7b70416cb..39effa7 100644 --- a/content/browser/picture_in_picture/document_picture_in_picture_window_controller_impl.h +++ b/content/browser/picture_in_picture/document_picture_in_picture_window_controller_impl.h
@@ -9,6 +9,7 @@ #include <set> #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "content/common/content_export.h" #include "content/public/browser/document_picture_in_picture_window_controller.h" @@ -84,7 +85,7 @@ // The WebContents for the PiP window. If this is null, then we have already // closed / stopped Picture in Picture. - WebContents* child_contents_ = nullptr; + raw_ptr<WebContents> child_contents_ = nullptr; class ChildContentsObserver : public WebContentsObserver { public: @@ -114,7 +115,7 @@ base::OnceClosure contents_destroyed_cb_; }; - WebContents* opener_web_contents_ = nullptr; + raw_ptr<WebContents> opener_web_contents_ = nullptr; // WebContentsObserver to watch for changes in `child_contents_`. std::unique_ptr<ChildContentsObserver> child_contents_observer_;
diff --git a/content/browser/prerender/prerender_browsertest.cc b/content/browser/prerender/prerender_browsertest.cc index 56265c8..e2600ae7 100644 --- a/content/browser/prerender/prerender_browsertest.cc +++ b/content/browser/prerender/prerender_browsertest.cc
@@ -2906,9 +2906,6 @@ } #endif // BUILDFLAG(ENABLE_PLUGINS) -// This is a browser test and cannot be upstreamed to WPT because it diverges -// from the spec by cancelling prerendering in the Notification constructor, -// whereas the spec says to defer upon use requestPermission(). #if BUILDFLAG(IS_ANDROID) // On Android the Notification constructor throws an exception regardless of // whether the page is being prerendered. @@ -2934,28 +2931,6 @@ })(); )")); } -#else -// On non-Android the Notification constructor is supported and can be used to -// show a notification, but if used during prerendering it cancels prerendering. -// Tests that we will cancel the prerendering if the prerendering page attempts -// to use notification. -IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, NotificationConstructor) { - base::HistogramTester histogram_tester; - const GURL kInitialUrl = GetUrl("/empty.html"); - - // Navigate to an initial page. - ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl)); - - LoadAndWaitForPrerenderDestroyed(web_contents(), - GetUrl("/prerender/notification.html"), - prerender_helper()); - - ExpectFinalStatusForSpeculationRule( - PrerenderHost::FinalStatus::kMojoBinderPolicy); - histogram_tester.ExpectUniqueSample( - "Prerender.Experimental.PrerenderCancelledInterface.SpeculationRule", - PrerenderCancelledInterface::kNotificationService, 1); -} #endif // BUILDFLAG(IS_ANDROID) // TODO(crbug.com/1215073): Make a WPT when we have a stable way to wait
diff --git a/content/browser/prerender/prerender_metrics.cc b/content/browser/prerender/prerender_metrics.cc index b7d5270..4c07934 100644 --- a/content/browser/prerender/prerender_metrics.cc +++ b/content/browser/prerender/prerender_metrics.cc
@@ -22,8 +22,6 @@ return PrerenderCancelledInterface::kGamepadHapticsManager; else if (interface_name == "device.mojom.GamepadMonitor") return PrerenderCancelledInterface::kGamepadMonitor; - else if (interface_name == "blink.mojom.NotificationService") - return PrerenderCancelledInterface::kNotificationService; else if (interface_name == "chrome.mojom.SyncEncryptionKeysExtension") return PrerenderCancelledInterface::kSyncEncryptionKeysExtension; return PrerenderCancelledInterface::kUnknown;
diff --git a/content/browser/prerender/prerender_metrics.h b/content/browser/prerender/prerender_metrics.h index 96cb90e4..1f78b51 100644 --- a/content/browser/prerender/prerender_metrics.h +++ b/content/browser/prerender/prerender_metrics.h
@@ -23,7 +23,7 @@ kUnknown = 0, // For kCancel interfaces added by embedders or tests. kGamepadHapticsManager = 1, kGamepadMonitor = 2, - kNotificationService = 3, + // kNotificationService = 3, Deprecated. kSyncEncryptionKeysExtension = 4, kMaxValue = kSyncEncryptionKeysExtension };
diff --git a/content/browser/renderer_host/back_forward_cache_impl.cc b/content/browser/renderer_host/back_forward_cache_impl.cc index 455716ed..fedc895 100644 --- a/content/browser/renderer_host/back_forward_cache_impl.cc +++ b/content/browser/renderer_host/back_forward_cache_impl.cc
@@ -510,6 +510,10 @@ size_t BackForwardCacheImpl::GetCacheSize() { if (!IsBackForwardCacheEnabled()) return 0; + auto cache_size = GetFieldTrialParamByFeatureAsOptionalInt( + kBackForwardCacheSize, "cache_size"); + if (cache_size.has_value()) + return cache_size.value(); return base::GetFieldTrialParamByFeatureAsInt( features::kBackForwardCache, "cache_size", kDefaultBackForwardCacheSize); } @@ -518,6 +522,10 @@ size_t BackForwardCacheImpl::GetForegroundedEntriesCacheSize() { if (!IsBackForwardCacheEnabled()) return 0; + auto foreground_cache_size = GetFieldTrialParamByFeatureAsOptionalInt( + kBackForwardCacheSize, "foreground_cache_size"); + if (foreground_cache_size.has_value()) + return foreground_cache_size.value(); return base::GetFieldTrialParamByFeatureAsInt( features::kBackForwardCache, "foreground_cache_size", kDefaultForegroundBackForwardCacheSize);
diff --git a/content/browser/renderer_host/back_forward_cache_impl.h b/content/browser/renderer_host/back_forward_cache_impl.h index 5a94660..4c166d4 100644 --- a/content/browser/renderer_host/back_forward_cache_impl.h +++ b/content/browser/renderer_host/back_forward_cache_impl.h
@@ -11,6 +11,7 @@ #include <unordered_set> #include "base/feature_list.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/task/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" @@ -67,6 +68,11 @@ const base::Feature kBackForwardCacheTimeToLiveControl{ "BackForwardCacheTimeToLiveControl", base::FEATURE_DISABLED_BY_DEFAULT}; +// Allows overriding the sizes of back/forward cache. +// Sizes set via this feature's parameters take precedence over others. +const base::Feature kBackForwardCacheSize{"BackForwardCacheSize", + base::FEATURE_DISABLED_BY_DEFAULT}; + // Combines a flattened list and a tree of the reasons why each document cannot // enter the back/forward cache (might be empty if it can). The tree saves the // reasons for each document in the tree (including those without the reasons) @@ -495,7 +501,7 @@ PopulateReasonsAndReturnSubtree(RenderFrameHostImpl* rfh); // Root document of the tree. - RenderFrameHostImpl* const root_rfh_; + const raw_ptr<RenderFrameHostImpl> root_rfh_; // BackForwardCacheImpl instance to access eligibility check functions. BackForwardCacheImpl& bfcache_; // Flattened list of NotRestoredReasons for the tree. This is empty at the
diff --git a/content/browser/renderer_host/back_forward_cache_metrics.h b/content/browser/renderer_host/back_forward_cache_metrics.h index b336359..0f7c665 100644 --- a/content/browser/renderer_host/back_forward_cache_metrics.h +++ b/content/browser/renderer_host/back_forward_cache_metrics.h
@@ -8,6 +8,7 @@ #include <bitset> #include <set> +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/strings/string_piece.h" #include "base/time/tick_clock.h" @@ -328,7 +329,7 @@ // didn't use a new BrowsingInstance. absl::optional<ShouldSwapBrowsingInstance> browsing_instance_swap_result_; - TestObserver* test_observer_ = nullptr; + raw_ptr<TestObserver> test_observer_ = nullptr; }; } // namespace content
diff --git a/content/browser/renderer_host/input/fling_controller_unittest.cc b/content/browser/renderer_host/input/fling_controller_unittest.cc index ebd445ad..81208f00 100644 --- a/content/browser/renderer_host/input/fling_controller_unittest.cc +++ b/content/browser/renderer_host/input/fling_controller_unittest.cc
@@ -216,6 +216,7 @@ bool first_wheel_event_sent_ = false; int sent_scroll_gesture_count_ = 0; #if BUILDFLAG(IS_WIN) + // This is necessary for static methods of `display::ScreenWin`. display::win::test::ScopedScreenWin scoped_screen_win_; #endif
diff --git a/content/browser/renderer_host/input/fling_scheduler_unittest.cc b/content/browser/renderer_host/input/fling_scheduler_unittest.cc index f8de4972b..1b45630 100644 --- a/content/browser/renderer_host/input/fling_scheduler_unittest.cc +++ b/content/browser/renderer_host/input/fling_scheduler_unittest.cc
@@ -15,10 +15,6 @@ #include "content/test/test_render_widget_host.h" #include "testing/gtest/include/gtest/gtest.h" -#if BUILDFLAG(IS_WIN) -#include "ui/display/win/test/scoped_screen_win.h" -#endif - namespace content { class FakeFlingScheduler : public FlingScheduler { @@ -139,9 +135,6 @@ scoped_refptr<SiteInstanceGroup> site_instance_group_; std::unique_ptr<TestRenderWidgetHostView> view_; std::unique_ptr<MockRenderWidgetHostDelegate> delegate_; -#if BUILDFLAG(IS_WIN) - display::win::test::ScopedScreenWin scoped_screen_win_; -#endif }; TEST_F(FlingSchedulerTest, ScheduleNextFlingProgress) {
diff --git a/content/browser/renderer_host/input/gesture_event_queue_unittest.cc b/content/browser/renderer_host/input/gesture_event_queue_unittest.cc index 292f17f..8ba2b0f7 100644 --- a/content/browser/renderer_host/input/gesture_event_queue_unittest.cc +++ b/content/browser/renderer_host/input/gesture_event_queue_unittest.cc
@@ -25,10 +25,6 @@ #include "third_party/blink/public/mojom/input/input_event_result.mojom-shared.h" #include "ui/events/blink/blink_features.h" -#if BUILDFLAG(IS_WIN) -#include "ui/display/win/test/scoped_screen_win.h" -#endif - using blink::WebGestureDevice; using blink::WebGestureEvent; using blink::WebInputEvent; @@ -244,9 +240,6 @@ std::unique_ptr<blink::mojom::InputEventResultState> sync_ack_result_; std::unique_ptr<WebGestureEvent> sync_followup_event_; base::test::ScopedFeatureList feature_list_; -#if BUILDFLAG(IS_WIN) - display::win::test::ScopedScreenWin scoped_screen_win_; -#endif }; class GestureEventQueueWithCompositorEventQueueTest
diff --git a/content/browser/renderer_host/input/input_router_impl_unittest.cc b/content/browser/renderer_host/input/input_router_impl_unittest.cc index b4e1505c..3e4d7c6 100644 --- a/content/browser/renderer_host/input/input_router_impl_unittest.cc +++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -46,10 +46,6 @@ #include "ui/events/event.h" #endif -#if BUILDFLAG(IS_WIN) -#include "ui/display/win/test/scoped_screen_win.h" -#endif - using blink::SyntheticWebGestureEventBuilder; using blink::SyntheticWebMouseEventBuilder; using blink::SyntheticWebMouseWheelEventBuilder; @@ -970,9 +966,6 @@ TEST_F(InputRouterImplTest, DISABLED_GestureTypesIgnoringAck) { // We test every gesture type, ensuring that the stream of gestures is valid. -#if BUILDFLAG(IS_WIN) - display::win::test::ScopedScreenWin scoped_screen_win_; -#endif const WebInputEvent::Type eventTypes[] = { WebInputEvent::Type::kGestureTapDown, WebInputEvent::Type::kGestureShowPress,
diff --git a/content/browser/renderer_host/media/media_stream_manager.h b/content/browser/renderer_host/media/media_stream_manager.h index 700c42d..58ddc29 100644 --- a/content/browser/renderer_host/media/media_stream_manager.h +++ b/content/browser/renderer_host/media/media_stream_manager.h
@@ -161,7 +161,7 @@ // Used to access AudioInputDeviceManager. AudioInputDeviceManager* audio_input_device_manager() const; - // Used to access AudioServiceListener, must be called on IO thread. + // Used to access AudioServiceListener, must be called on UI thread. AudioServiceListener* audio_service_listener(); // Used to access MediaDevicesManager.
diff --git a/content/browser/renderer_host/origin_agent_cluster_browsertest.cc b/content/browser/renderer_host/origin_agent_cluster_browsertest.cc index 1b9bd39..9e8d17c2c 100644 --- a/content/browser/renderer_host/origin_agent_cluster_browsertest.cc +++ b/content/browser/renderer_host/origin_agent_cluster_browsertest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/memory/raw_ptr.h" #include "content/browser/renderer_host/render_frame_host_impl.h" #include "base/command_line.h" @@ -193,7 +194,7 @@ content::ContentMockCertVerifier mock_cert_verifier_; MockContentBrowserClient browser_client_; - ContentBrowserClient* original_browser_client_ = nullptr; + raw_ptr<ContentBrowserClient> original_browser_client_ = nullptr; const bool origin_cluster_default_enabled_; const bool origin_cluster_absent_warning_;
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index b22ccbf..17c5ed84 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -81,6 +81,7 @@ #if BUILDFLAG(IS_MAC) #include "content/browser/renderer_host/test_render_widget_host_view_mac_factory.h" +#include "ui/display/test/test_screen.h" #endif #if defined(USE_AURA) || BUILDFLAG(IS_MAC) @@ -558,6 +559,10 @@ // calls display::Screen::SetScreenInstance(). ui::SetScreenAndroid(false /* use_display_wide_color_gamut */); #endif +#if BUILDFLAG(IS_MAC) + screen_ = std::make_unique<display::test::TestScreen>(); + display::Screen::SetScreenInstance(screen_.get()); +#endif #if defined(USE_AURA) screen_.reset(aura::TestScreen::Create(gfx::Size())); display::Screen::SetScreenInstance(screen_.get()); @@ -619,11 +624,11 @@ browser_context_.reset(); #if defined(USE_AURA) - display::Screen::SetScreenInstance(nullptr); - screen_.reset(); + ImageTransportFactory::Terminate(); #endif #if defined(USE_AURA) || BUILDFLAG(IS_MAC) - ImageTransportFactory::Terminate(); + display::Screen::SetScreenInstance(nullptr); + screen_.reset(); #endif #if BUILDFLAG(IS_ANDROID) display::Screen::SetScreenInstance(nullptr);
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc index 6f7e468..21f3e45 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -131,7 +131,6 @@ #if BUILDFLAG(IS_WIN) #include "ui/base/view_prop.h" #include "ui/base/win/window_event_target.h" -#include "ui/display/win/test/scoped_screen_win.h" #endif using testing::_; @@ -3763,11 +3762,6 @@ ScrollEventsOverscrollWithFling) { SetUpOverscrollEnvironment(); -#if BUILDFLAG(IS_WIN) - // Create a ScopedScreenWin. - display::win::test::ScopedScreenWin scoped_screen_win; -#endif - // Send a wheel event. ACK the event as not processed. This should not // initiate an overscroll gesture since it doesn't cross the threshold yet. SimulateWheelEvent(10, 0, 0, true, WebMouseWheelEvent::kPhaseBegan); @@ -3844,11 +3838,6 @@ ScrollEventsOverscrollWithZeroFling) { SetUpOverscrollEnvironment(); -#if BUILDFLAG(IS_WIN) - // Create a ScopedScreenWin. - display::win::test::ScopedScreenWin scoped_screen_win; -#endif - // Send a wheel event. ACK the event as not processed. This should not // initiate an overscroll gesture since it doesn't cross the threshold yet. SimulateWheelEvent(10, 0, 0, true, WebMouseWheelEvent::kPhaseBegan); @@ -3926,11 +3915,6 @@ MAYBE_ReverseFlingCancelsOverscroll) { SetUpOverscrollEnvironment(); -#if BUILDFLAG(IS_WIN) - // Create a ScopedScreenWin. - display::win::test::ScopedScreenWin scoped_screen_win; -#endif - { PressAndSetTouchActionAuto(); // Start and end a gesture in the same direction without processing the @@ -4801,11 +4785,6 @@ OverscrollStateResetsAfterScroll) { SetUpOverscrollEnvironment(); -#if BUILDFLAG(IS_WIN) - // Create a ScopedScreenWin. - display::win::test::ScopedScreenWin scoped_screen_win; -#endif - SimulateWheelEvent(0, 5, 0, true, WebMouseWheelEvent::kPhaseBegan); // sent directly SimulateWheelEvent(0, 30, 0, true, @@ -5243,11 +5222,6 @@ TEST_F(RenderWidgetHostViewAuraOverscrollTest, ScrollDeltasResetOnEnd) { SetUpOverscrollEnvironment(); -#if BUILDFLAG(IS_WIN) - // Create a ScopedScreenWin. - display::win::test::ScopedScreenWin scoped_screen_win; -#endif - PressAndSetTouchActionAuto(); // Wheel event scroll ending with mouse move. SimulateWheelEvent(-30, -10, 0, true,
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm index c79d604..8f8fb19c 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
@@ -27,6 +27,7 @@ #include "testing/platform_test.h" #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" #include "ui/base/layout.h" +#include "ui/display/screen.h" using content::RenderWidgetHostViewMac; @@ -122,6 +123,7 @@ void TearDown() override { ImageTransportFactory::Terminate(); } private: + display::ScopedNativeScreen screen_; // This has a MessageLoop for ImageTransportFactory and enables // BrowserThread::UI for RecyclableCompositorMac used by // RenderWidgetHostViewMac.
diff --git a/content/browser/renderer_host/unassigned_site_instance_browsertest.cc b/content/browser/renderer_host/unassigned_site_instance_browsertest.cc index 58b855cd..5eb3f48 100644 --- a/content/browser/renderer_host/unassigned_site_instance_browsertest.cc +++ b/content/browser/renderer_host/unassigned_site_instance_browsertest.cc
@@ -5,6 +5,7 @@ #include <memory> #include <string> +#include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" @@ -199,7 +200,7 @@ std::unique_ptr<DontAssignSiteContentBrowserClient> content_browser_client_override_; - ContentBrowserClient* old_content_browser_client_ = nullptr; + raw_ptr<ContentBrowserClient> old_content_browser_client_ = nullptr; base::test::ScopedFeatureList feature_list_for_render_document_; base::test::ScopedFeatureList feature_list_for_back_forward_cache_;
diff --git a/content/browser/screen_enumeration/screen_enumeration_browsertest.cc b/content/browser/screen_enumeration/screen_enumeration_browsertest.cc index 6267f67..feb76c9 100644 --- a/content/browser/screen_enumeration/screen_enumeration_browsertest.cc +++ b/content/browser/screen_enumeration/screen_enumeration_browsertest.cc
@@ -135,18 +135,26 @@ protected: // ScreenEnumerationTest: - void SetUpOnMainThread() override { - ScreenEnumerationTest::SetUpOnMainThread(); - original_screen_ = display::Screen::GetScreen(); - display::Screen::SetScreenInstance(&screen_); + void SetUp() override { + display::Screen::SetScreenInstance(&screen_); // Create a shell that observes the fake screen. A display is required. screen()->display_list().AddDisplay({0, gfx::Rect(100, 100, 801, 802)}, display::DisplayList::Type::PRIMARY); + + ScreenEnumerationTest::SetUp(); + } + void TearDown() override { + ScreenEnumerationTest::TearDown(); + display::Screen::SetScreenInstance(nullptr); + } + + void SetUpOnMainThread() override { + ScreenEnumerationTest::SetUpOnMainThread(); + test_shell_ = CreateBrowser(); } void TearDownOnMainThread() override { - display::Screen::SetScreenInstance(original_screen_); ScreenEnumerationTest::TearDownOnMainThread(); } @@ -154,7 +162,6 @@ Shell* test_shell() { return test_shell_; } private: - raw_ptr<display::Screen> original_screen_ = nullptr; display::ScreenBase screen_; raw_ptr<Shell> test_shell_ = nullptr; };
diff --git a/content/browser/service_worker/service_worker_internals_ui_browsertest.cc b/content/browser/service_worker/service_worker_internals_ui_browsertest.cc index 246384c4..9c707ba2 100644 --- a/content/browser/service_worker/service_worker_internals_ui_browsertest.cc +++ b/content/browser/service_worker/service_worker_internals_ui_browsertest.cc
@@ -4,6 +4,7 @@ #include "base/bind.h" #include "base/command_line.h" +#include "base/memory/raw_ptr.h" #include "base/metrics/statistics_recorder.h" #include "base/run_loop.h" #include "base/strings/string_number_conversions.h" @@ -519,7 +520,7 @@ private: base::test::ScopedFeatureList feature_list_; scoped_refptr<ServiceWorkerContextWrapper> wrapper_; - Shell* active_shell_ = shell(); + raw_ptr<Shell> active_shell_ = shell(); }; // Tests
diff --git a/content/browser/shared_storage/shared_storage_render_thread_worklet_driver.h b/content/browser/shared_storage/shared_storage_render_thread_worklet_driver.h index daed493..fe3b9a5b 100644 --- a/content/browser/shared_storage/shared_storage_render_thread_worklet_driver.h +++ b/content/browser/shared_storage/shared_storage_render_thread_worklet_driver.h
@@ -5,6 +5,7 @@ #ifndef CONTENT_BROWSER_SHARED_STORAGE_SHARED_STORAGE_RENDER_THREAD_WORKLET_DRIVER_H_ #define CONTENT_BROWSER_SHARED_STORAGE_SHARED_STORAGE_RENDER_THREAD_WORKLET_DRIVER_H_ +#include "base/memory/raw_ptr.h" #include "content/browser/shared_storage/shared_storage_worklet_driver.h" #include "content/public/browser/render_process_host_observer.h" @@ -47,7 +48,7 @@ // need to use it to track the lifetime of `agent_scheduling_group_host_` // instead of RenderProcessHostObserver. For more context see // crbug.com/1141459#c4. - AgentSchedulingGroupHost* agent_scheduling_group_host_; + raw_ptr<AgentSchedulingGroupHost> agent_scheduling_group_host_; }; } // namespace content
diff --git a/content/browser/shared_storage/shared_storage_worklet_host.h b/content/browser/shared_storage/shared_storage_worklet_host.h index 47f6d16..46f53d1 100644 --- a/content/browser/shared_storage/shared_storage_worklet_host.h +++ b/content/browser/shared_storage/shared_storage_worklet_host.h
@@ -5,6 +5,7 @@ #ifndef CONTENT_BROWSER_SHARED_STORAGE_SHARED_STORAGE_WORKLET_HOST_H_ #define CONTENT_BROWSER_SHARED_STORAGE_SHARED_STORAGE_WORKLET_HOST_H_ +#include "base/memory/raw_ptr.h" #include "content/common/content_export.h" #include "content/services/shared_storage_worklet/public/mojom/shared_storage_worklet_service.mojom.h" #include "mojo/public/cpp/bindings/associated_receiver.h" @@ -172,11 +173,11 @@ // Both `this` and `shared_storage_manager_` live in the `StoragePartition`. // `shared_storage_manager_` almost always outlives `this` (thus is valid) // except for inside `~SharedStorageWorkletHost()`. - storage::SharedStorageManager* shared_storage_manager_; + raw_ptr<storage::SharedStorageManager> shared_storage_manager_; // Pointer to the `BrowserContext`, saved to be able to call // `IsSharedStorageAllowed()`. - BrowserContext* browser_context_; + raw_ptr<BrowserContext> browser_context_; // The shared storage owner document's origin. url::Origin shared_storage_origin_;
diff --git a/content/browser/storage_partition_impl_unittest.cc b/content/browser/storage_partition_impl_unittest.cc index a9241fb..0a4f498 100644 --- a/content/browser/storage_partition_impl_unittest.cc +++ b/content/browser/storage_partition_impl_unittest.cc
@@ -2554,8 +2554,8 @@ base::test::ScopedFeatureList feature_list_; // We don't own these pointers. - StoragePartition* const storage_partition_; - storage::SharedStorageManager* shared_storage_manager_; + const raw_ptr<StoragePartition> storage_partition_; + raw_ptr<storage::SharedStorageManager> shared_storage_manager_; }; TEST_F(StoragePartitionImplSharedStorageTest,
diff --git a/content/browser/webid/federated_auth_request_impl_unittest.cc b/content/browser/webid/federated_auth_request_impl_unittest.cc index 87ecbea..0bd7565 100644 --- a/content/browser/webid/federated_auth_request_impl_unittest.cc +++ b/content/browser/webid/federated_auth_request_impl_unittest.cc
@@ -378,7 +378,7 @@ } private: - IdpNetworkRequestManager* delegate_; + raw_ptr<IdpNetworkRequestManager> delegate_; }; class TestIdpNetworkRequestManager : public MockIdpNetworkRequestManager {
diff --git a/content/browser/xr/service/isolated_device_provider.h b/content/browser/xr/service/isolated_device_provider.h index 3bf72be..0900a26e 100644 --- a/content/browser/xr/service/isolated_device_provider.h +++ b/content/browser/xr/service/isolated_device_provider.h
@@ -6,6 +6,7 @@ #define CONTENT_BROWSER_XR_SERVICE_ISOLATED_DEVICE_PROVIDER_H_ #include "base/containers/flat_map.h" +#include "base/memory/raw_ptr.h" #include "device/vr/public/cpp/vr_device_provider.h" #include "device/vr/public/mojom/isolated_xr_service.mojom-forward.h" #include "mojo/public/cpp/bindings/pending_remote.h" @@ -47,7 +48,7 @@ int retry_count_ = 0; mojo::Remote<device::mojom::IsolatedXRRuntimeProvider> device_provider_; - device::VRDeviceProviderClient* client_ = nullptr; + raw_ptr<device::VRDeviceProviderClient> client_ = nullptr; mojo::Receiver<device::mojom::IsolatedXRRuntimeProviderClient> receiver_{ this};
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index bbc1c2b..b2861672 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -380,6 +380,8 @@ kThrottleDisplayNoneAndVisibilityHiddenCrossOriginIframes}, {"TopicsAPI", features::kPrivacySandboxAdsAPIsOverride, kSetOnlyIfOverridden}, + {"TouchActionEffectiveAtPointerDown", + features::kVirtualKeyboardMultitouch}, {"TrustedDOMTypes", features::kTrustedDOMTypes}, {"UserAgentClientHint", blink::features::kUserAgentClientHint}, {"ViewportHeightClientHintHeader",
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc index ade9ed12e..53bae72 100644 --- a/content/public/test/browser_test_utils.cc +++ b/content/public/test/browser_test_utils.cc
@@ -1732,7 +1732,7 @@ run_loop_.Quit(); } - RenderFrameHost* render_frame_host_; + raw_ptr<RenderFrameHost> render_frame_host_; base::RunLoop run_loop_{base::RunLoop::Type::kNestableTasksAllowed}; bool has_value_ = false; blink::mojom::JavaScriptExecutionResultType type_;
diff --git a/content/public/test/browser_test_utils.h b/content/public/test/browser_test_utils.h index 2d75623..6d5b42f6 100644 --- a/content/public/test/browser_test_utils.h +++ b/content/public/test/browser_test_utils.h
@@ -1784,7 +1784,7 @@ // Set when a matching navigation reaches kBeforeChecks and cleared when the // navigation is deleted/finished. - NavigationRequest* request_ = nullptr; + raw_ptr<NavigationRequest> request_ = nullptr; // If the navigation is paused in the first or last CommitDeferringCondition // (i.e. the one installed by this manager for testing), this will be the
diff --git a/content/public/test/test_renderer_host.cc b/content/public/test/test_renderer_host.cc index aa30f0c..b674a89 100644 --- a/content/public/test/test_renderer_host.cc +++ b/content/public/test/test_renderer_host.cc
@@ -40,9 +40,12 @@ #include "third_party/blink/public/common/input/synthetic_web_input_event_builders.h" #include "third_party/blink/public/common/input/web_input_event.h" +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) +#include "ui/display/screen.h" +#endif + #if BUILDFLAG(IS_ANDROID) #include "ui/android/dummy_screen_android.h" -#include "ui/display/screen.h" #endif #if BUILDFLAG(IS_WIN) @@ -239,6 +242,10 @@ #if BUILDFLAG(IS_WIN) ole_initializer_ = std::make_unique<ui::ScopedOleInitializer>(); #endif +#if BUILDFLAG(IS_MAC) + screen_ = std::make_unique<display::ScopedNativeScreen>(); +#endif + #if defined(USE_AURA) aura_test_helper_ = std::make_unique<aura::test::AuraTestHelper>( ImageTransportFactory::GetInstance()->GetContextFactory());
diff --git a/content/public/test/test_renderer_host.h b/content/public/test/test_renderer_host.h index a02288f..8741365c 100644 --- a/content/public/test/test_renderer_host.h +++ b/content/public/test/test_renderer_host.h
@@ -43,6 +43,7 @@ namespace display { class Screen; +class ScopedNativeScreen; } namespace net { @@ -325,6 +326,9 @@ #if BUILDFLAG(IS_WIN) std::unique_ptr<ui::ScopedOleInitializer> ole_initializer_; #endif +#if BUILDFLAG(IS_MAC) + std::unique_ptr<display::ScopedNativeScreen> screen_; +#endif #if defined(USE_AURA) std::unique_ptr<aura::test::AuraTestHelper> aura_test_helper_; #endif
diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn index 15cbdd3..2ee2fdb 100644 --- a/content/shell/BUILD.gn +++ b/content/shell/BUILD.gn
@@ -310,6 +310,10 @@ deps += [ "//ui/views/linux_ui:linux_ui_factory" ] } + if (is_mac) { + deps += [ "//ui/display:test_support" ] + } + if (is_android) { deps += [ "//components/embedder_support/android:view",
diff --git a/content/shell/browser/shell_platform_data_aura.cc b/content/shell/browser/shell_platform_data_aura.cc index a02a4058..6e2480ed 100644 --- a/content/shell/browser/shell_platform_data_aura.cc +++ b/content/shell/browser/shell_platform_data_aura.cc
@@ -82,12 +82,7 @@ #if defined(USE_OZONE) // Setup global display::Screen singleton. - if (!display::Screen::GetScreen()) { - std::unique_ptr<aura::ScreenOzone> screen_ozone = - std::make_unique<aura::ScreenOzone>(); - screen_ozone.get()->Initialize(); - screen_ = std::move(screen_ozone); - } + screen_ = std::make_unique<aura::ScopedScreenOzone>(); #endif // defined(USE_OZONE) ui::PlatformWindowInitProperties properties;
diff --git a/content/shell/browser/shell_platform_data_aura.h b/content/shell/browser/shell_platform_data_aura.h index 8b58302..345a9d9 100644 --- a/content/shell/browser/shell_platform_data_aura.h +++ b/content/shell/browser/shell_platform_data_aura.h
@@ -20,7 +20,7 @@ #if defined(USE_OZONE) namespace display { -class Screen; +class ScopedNativeScreen; } #endif @@ -46,7 +46,7 @@ private: #if defined(USE_OZONE) - std::unique_ptr<display::Screen> screen_; + std::unique_ptr<display::ScopedNativeScreen> screen_; #endif std::unique_ptr<aura::WindowTreeHost> host_;
diff --git a/content/shell/browser/shell_platform_delegate.h b/content/shell/browser/shell_platform_delegate.h index 32cd23a..9326cb3 100644 --- a/content/shell/browser/shell_platform_delegate.h +++ b/content/shell/browser/shell_platform_delegate.h
@@ -15,6 +15,7 @@ #if BUILDFLAG(IS_MAC) #include "content/public/browser/native_web_keyboard_event.h" +#include "ui/display/screen.h" #endif class GURL; @@ -139,6 +140,9 @@ #endif private: +#if BUILDFLAG(IS_MAC) + std::unique_ptr<display::ScopedNativeScreen> screen_; +#endif // Data held for each Shell instance, since there is one ShellPlatformDelegate // for the whole browser process (shared across Shells). This is defined for // each platform implementation.
diff --git a/content/shell/browser/shell_platform_delegate_mac.mm b/content/shell/browser/shell_platform_delegate_mac.mm index 0868a06..cf91694 100644 --- a/content/shell/browser/shell_platform_delegate_mac.mm +++ b/content/shell/browser/shell_platform_delegate_mac.mm
@@ -134,7 +134,7 @@ ShellPlatformDelegate::~ShellPlatformDelegate() = default; void ShellPlatformDelegate::Initialize(const gfx::Size& default_window_size) { - // |platform_| is unused on this platform. + screen_ = std::make_unique<display::ScopedNativeScreen>(); } void ShellPlatformDelegate::CreatePlatformWindow(
diff --git a/content/shell/browser/shell_platform_delegate_views.cc b/content/shell/browser/shell_platform_delegate_views.cc index f6924fc..0063882 100644 --- a/content/shell/browser/shell_platform_delegate_views.cc +++ b/content/shell/browser/shell_platform_delegate_views.cc
@@ -331,8 +331,9 @@ std::make_unique<wm::WMTestHelper>(default_window_size); #else platform_->wm_state = std::make_unique<wm::WMState>(); - CHECK(!display::Screen::GetScreen()); - platform_->screen = views::CreateDesktopScreen(); + // FakeScreen tests create their own screen. + if (!display::Screen::HasScreen()) + platform_->screen = views::CreateDesktopScreen(); #endif platform_->views_delegate =
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 3686728..01525c8d 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -1622,6 +1622,7 @@ "//ui/base/ime/mojom", "//ui/compositor", "//ui/display", + "//ui/display:test_support", "//ui/events:test_support", "//ui/events/blink:blink", "//ui/gfx",
diff --git a/content/test/data/accessibility/aria/aria-modal-unhidden-expected-auralinux.txt b/content/test/data/accessibility/aria/aria-modal-unhidden-expected-auralinux.txt new file mode 100644 index 0000000..493af4b3 --- /dev/null +++ b/content/test/data/accessibility/aria/aria-modal-unhidden-expected-auralinux.txt
@@ -0,0 +1,7 @@ +[document web] +++[section] +++++[static] name='Non-modal contents:' +++++[push button] name='ok' +++[alert] modal +++++[static] name='Modal contents:' +++++[push button] name='cancel'
diff --git a/content/test/data/accessibility/aria/aria-modal-unhidden-expected-mac.txt b/content/test/data/accessibility/aria/aria-modal-unhidden-expected-mac.txt new file mode 100644 index 0000000..88ab5ef --- /dev/null +++ b/content/test/data/accessibility/aria/aria-modal-unhidden-expected-mac.txt
@@ -0,0 +1,4 @@ +AXWebArea +++AXGroup AXSubrole=AXApplicationAlertDialog +++++AXStaticText AXValue='Modal contents:' +++++AXButton AXTitle='cancel'
diff --git a/content/test/data/accessibility/aria/aria-modal-unhidden.html b/content/test/data/accessibility/aria/aria-modal-unhidden.html new file mode 100644 index 0000000..a0b56ed --- /dev/null +++ b/content/test/data/accessibility/aria/aria-modal-unhidden.html
@@ -0,0 +1,23 @@ +<!-- +@AURALINUX-ALLOW:modal +@WAIT-FOR:cancel +--> +<!DOCTYPE html> +<html> +<body> +<div> + <span>Non-modal contents:</span> + <button>ok</button> +</div> +<div role="alertdialog" id="dialog" aria-modal="true" style="display:none;"> + <span>Modal contents:</span> + <button id="button">cancel</button> +</div> +<script> + setTimeout(() => { + document.getElementById("dialog").style.display = "block"; + document.getElementById("button").focus(); + }, 100); +</script> +</body> +</html>
diff --git a/content/test/data/prerender/notification.html b/content/test/data/prerender/notification.html deleted file mode 100644 index d2623bf..0000000 --- a/content/test/data/prerender/notification.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -</head> -<body> -<script> -const notification = new Notification("My Notification"); -notification.onshow = function() { - notification.close(); -}; -</script> -</body> -</html>
diff --git a/content/web_test/BUILD.gn b/content/web_test/BUILD.gn index 7aab966..00cce83 100644 --- a/content/web_test/BUILD.gn +++ b/content/web_test/BUILD.gn
@@ -208,6 +208,14 @@ "//ppapi:blink_test_plugin", ] } + + if (is_mac) { + deps += [ "//ui/display:test_support" ] + } + + if (use_aura) { + deps += [ "//ui/aura:test_support" ] + } } static_library("web_test_renderer") {
diff --git a/device/fido/cable/v2_test_util.cc b/device/fido/cable/v2_test_util.cc index 8e93aba..2c37550 100644 --- a/device/fido/cable/v2_test_util.cc +++ b/device/fido/cable/v2_test_util.cc
@@ -528,7 +528,7 @@ Discovery::AdvertEventStream::Callback ble_advert_callback_; const raw_ptr<device::VirtualCtap2Device> ctap2_device_; - authenticator::Observer* const observer_; + const raw_ptr<authenticator::Observer> observer_; base::WeakPtrFactory<TestPlatform> weak_factory_{this}; };
diff --git a/device/vr/orientation/orientation_device_provider.h b/device/vr/orientation/orientation_device_provider.h index 1f46dab6..99d848f 100644 --- a/device/vr/orientation/orientation_device_provider.h +++ b/device/vr/orientation/orientation_device_provider.h
@@ -9,6 +9,7 @@ #include "base/callback_forward.h" #include "base/component_export.h" +#include "base/memory/raw_ptr.h" #include "device/vr/orientation/orientation_device.h" #include "device/vr/public/cpp/vr_device_provider.h" #include "mojo/public/cpp/bindings/pending_remote.h" @@ -41,7 +42,7 @@ mojo::Remote<device::mojom::SensorProvider> sensor_provider_; std::unique_ptr<VROrientationDevice> device_; - VRDeviceProviderClient* client_ = nullptr; + raw_ptr<VRDeviceProviderClient> client_ = nullptr; }; } // namespace device
diff --git a/device/vr/orientation/orientation_device_provider_unittest.cc b/device/vr/orientation/orientation_device_provider_unittest.cc index 48284f2..2c33175f 100644 --- a/device/vr/orientation/orientation_device_provider_unittest.cc +++ b/device/vr/orientation/orientation_device_provider_unittest.cc
@@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/memory/read_only_shared_memory_region.h" #include "base/memory/shared_memory_mapping.h" #include "base/run_loop.h" @@ -157,8 +158,8 @@ } private: - base::RunLoop* wait_for_device_ = nullptr; - base::RunLoop* wait_for_init_ = nullptr; + raw_ptr<base::RunLoop> wait_for_device_ = nullptr; + raw_ptr<base::RunLoop> wait_for_init_ = nullptr; }; TEST_F(VROrientationDeviceProviderTest, InitializationTest) {
diff --git a/device/vr/test/fake_vr_device_provider.h b/device/vr/test/fake_vr_device_provider.h index e456a282..362963ab 100644 --- a/device/vr/test/fake_vr_device_provider.h +++ b/device/vr/test/fake_vr_device_provider.h
@@ -7,6 +7,7 @@ #include <vector> +#include "base/memory/raw_ptr.h" #include "device/vr/public/cpp/vr_device_provider.h" #include "device/vr/vr_device_base.h" #include "device/vr/vr_export.h" @@ -35,7 +36,7 @@ private: std::vector<std::unique_ptr<VRDeviceBase>> devices_; bool initialized_; - VRDeviceProviderClient* client_ = nullptr; + raw_ptr<VRDeviceProviderClient> client_ = nullptr; }; } // namespace device
diff --git a/extensions/browser/api/system_display/display_info_provider.cc b/extensions/browser/api/system_display/display_info_provider.cc index 1b979ee..9097b1b 100644 --- a/extensions/browser/api/system_display/display_info_provider.cc +++ b/extensions/browser/api/system_display/display_info_provider.cc
@@ -37,7 +37,11 @@ } // namespace -DisplayInfoProvider::DisplayInfoProvider() = default; +DisplayInfoProvider::DisplayInfoProvider(display::Screen* screen) + : screen_(screen ? screen : display::Screen::GetScreen()) { + // Do not use/call on the screen object in this constructor yet because a + // subclass may pass not-yet-initialized screen instance. +} DisplayInfoProvider::~DisplayInfoProvider() = default; @@ -111,9 +115,8 @@ void DisplayInfoProvider::GetAllDisplaysInfo( bool /* single_unified*/, base::OnceCallback<void(DisplayUnitInfoList result)> callback) { - display::Screen* screen = display::Screen::GetScreen(); - int64_t primary_id = screen->GetPrimaryDisplay().id(); - std::vector<display::Display> displays = screen->GetAllDisplays(); + int64_t primary_id = screen_->GetPrimaryDisplay().id(); + std::vector<display::Display> displays = screen_->GetAllDisplays(); DisplayUnitInfoList all_displays; for (const display::Display& display : displays) { api::system_display::DisplayUnitInfo unit =
diff --git a/extensions/browser/api/system_display/display_info_provider.h b/extensions/browser/api/system_display/display_info_provider.h index 2d0d26bf..d060ff4 100644 --- a/extensions/browser/api/system_display/display_info_provider.h +++ b/extensions/browser/api/system_display/display_info_provider.h
@@ -17,6 +17,7 @@ namespace display { class Display; +class Screen; } namespace extensions { @@ -118,7 +119,7 @@ ErrorCallback callback); protected: - DisplayInfoProvider(); + explicit DisplayInfoProvider(display::Screen* screen = nullptr); // Trigger OnDisplayChangedEvent void DispatchOnDisplayChangedEvent(); @@ -142,6 +143,8 @@ void OnDisplayMetricsChanged(const display::Display& display, uint32_t metrics) override; + display::Screen* const screen_; + absl::optional<display::ScopedDisplayObserver> display_observer_; };
diff --git a/extensions/browser/api/system_display/system_display_apitest.cc b/extensions/browser/api/system_display/system_display_apitest.cc index e0bf990..e6ab556 100644 --- a/extensions/browser/api/system_display/system_display_apitest.cc +++ b/extensions/browser/api/system_display/system_display_apitest.cc
@@ -13,24 +13,17 @@ #include "extensions/browser/api/system_display/system_display_api.h" #include "extensions/browser/api_test_utils.h" #include "extensions/browser/mock_display_info_provider.h" -#include "extensions/browser/mock_screen.h" #include "extensions/common/api/system_display.h" #include "extensions/common/extension_builder.h" #include "extensions/shell/test/shell_apitest.h" #include "extensions/test/result_catcher.h" -#include "ui/display/display.h" #include "ui/display/screen.h" -#include "ui/display/test/scoped_screen_override.h" namespace extensions { -using display::Screen; -using display::test::ScopedScreenOverride; - class SystemDisplayApiTest : public ShellApiTest { public: - SystemDisplayApiTest() - : provider_(new MockDisplayInfoProvider), screen_(new MockScreen) {} + SystemDisplayApiTest() : provider_(new MockDisplayInfoProvider) {} SystemDisplayApiTest(const SystemDisplayApiTest&) = delete; SystemDisplayApiTest& operator=(const SystemDisplayApiTest&) = delete; @@ -39,17 +32,9 @@ void SetUpOnMainThread() override { ShellApiTest::SetUpOnMainThread(); - ANNOTATE_LEAKING_OBJECT_PTR(Screen::GetScreen()); - scoped_screen_override_ = - std::make_unique<ScopedScreenOverride>(screen_.get()); DisplayInfoProvider::InitializeForTesting(provider_.get()); } - void TearDownOnMainThread() override { - ShellApiTest::TearDownOnMainThread(); - scoped_screen_override_.reset(); - } - protected: void SetInfo(const std::string& display_id, const api::system_display::DisplayProperties& properties) { @@ -58,8 +43,6 @@ base::BindOnce([](absl::optional<std::string>) {})); } std::unique_ptr<MockDisplayInfoProvider> provider_; - std::unique_ptr<Screen> screen_; - std::unique_ptr<ScopedScreenOverride> scoped_screen_override_; }; #if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/extensions/browser/background_script_executor.h b/extensions/browser/background_script_executor.h index f9a68fe..aab27ca3 100644 --- a/extensions/browser/background_script_executor.h +++ b/extensions/browser/background_script_executor.h
@@ -8,6 +8,7 @@ #include <memory> #include <string> +#include "base/memory/raw_ptr.h" #include "base/values.h" #include "content/public/test/browser_test_utils.h" #include "extensions/browser/browsertest_util.h" @@ -114,11 +115,11 @@ void AddTestFailure(const std::string& message); // The associated BrowserContext. Must outlive this object. - content::BrowserContext* const browser_context_; + const raw_ptr<content::BrowserContext> browser_context_; // The associated ExtensionRegistry; tied to `browser_context_`. - ExtensionRegistry* const registry_; + const raw_ptr<ExtensionRegistry> registry_; // The associated ProcessManager; tied to `browser_context_`. - ProcessManager* const process_manager_; + const raw_ptr<ProcessManager> process_manager_; // The type of background context the extension uses; lazily instantiated in // ExecuteScript*(). @@ -136,7 +137,7 @@ std::unique_ptr<ScriptResultQueue> script_result_queue_; // The associated Extension. - const Extension* extension_ = nullptr; + raw_ptr<const Extension> extension_ = nullptr; // The script to inject; cached mostly for logging purposes. std::string script_;
diff --git a/extensions/browser/mock_display_info_provider.cc b/extensions/browser/mock_display_info_provider.cc index 56ae05d..0ce2110 100644 --- a/extensions/browser/mock_display_info_provider.cc +++ b/extensions/browser/mock_display_info_provider.cc
@@ -16,7 +16,8 @@ namespace extensions { -MockDisplayInfoProvider::MockDisplayInfoProvider() = default; +MockDisplayInfoProvider::MockDisplayInfoProvider() + : DisplayInfoProvider(&screen_) {} MockDisplayInfoProvider::~MockDisplayInfoProvider() = default;
diff --git a/extensions/browser/mock_display_info_provider.h b/extensions/browser/mock_display_info_provider.h index 4e6fba2..f173f59 100644 --- a/extensions/browser/mock_display_info_provider.h +++ b/extensions/browser/mock_display_info_provider.h
@@ -13,6 +13,7 @@ #include "base/values.h" #include "extensions/browser/api/system_display/display_info_provider.h" +#include "extensions/browser/mock_screen.h" #include "extensions/common/api/system_display.h" namespace extensions { @@ -85,6 +86,8 @@ bool native_touch_calibration_success_ = false; + MockScreen screen_; + api::system_display::MirrorMode mirror_mode_ = api::system_display::MIRROR_MODE_OFF; };
diff --git a/extensions/browser/permissions_manager.h b/extensions/browser/permissions_manager.h index 1e2aef6..f0ca637 100644 --- a/extensions/browser/permissions_manager.h +++ b/extensions/browser/permissions_manager.h
@@ -168,9 +168,9 @@ base::ObserverList<Observer>::Unchecked observers_; // The associated browser context. - content::BrowserContext* const browser_context_; + const raw_ptr<content::BrowserContext> browser_context_; - ExtensionPrefs* const extension_prefs_; + const raw_ptr<ExtensionPrefs> extension_prefs_; UserPermissionsSettings user_permissions_; };
diff --git a/extensions/browser/permissions_manager_unittest.cc b/extensions/browser/permissions_manager_unittest.cc index 8030377..1ccd0c28 100644 --- a/extensions/browser/permissions_manager_unittest.cc +++ b/extensions/browser/permissions_manager_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "extensions/browser/permissions_manager.h" +#include "base/memory/raw_ptr.h" #include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_util.h" @@ -61,7 +62,7 @@ void SetUp() override; // PermissionsManager being tested. - PermissionsManager* manager_; + raw_ptr<PermissionsManager> manager_; raw_ptr<ExtensionPrefs> extension_prefs_; };
diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/browser/updater/extension_downloader.cc index 204b543..04fc0f71 100644 --- a/extensions/browser/updater/extension_downloader.cc +++ b/extensions/browser/updater/extension_downloader.cc
@@ -175,10 +175,10 @@ const char ExtensionDownloader::kUpdateInteractivityBackground[] = "bg"; DownloadFailure::DownloadFailure( - ExtensionId id, ExtensionDownloaderDelegate::Error error, ExtensionDownloaderDelegate::FailureData failure_data) - : id(id), error(error), failure_data(failure_data) {} + : error(error), failure_data(failure_data) {} +DownloadFailure::DownloadFailure(DownloadFailure&&) = default; DownloadFailure::~DownloadFailure() = default; UpdateDetails::UpdateDetails(const std::string& id, @@ -775,16 +775,19 @@ // If not all extension were found in the cache, collect them and report // failure. const ExtensionIdSet extension_ids = fetch_data->GetExtensionIds(); - std::vector<DownloadFailure> manifest_invalid_errors; + std::vector<std::pair<ExtensionDownloaderTask, DownloadFailure>> + manifest_invalid_errors; manifest_invalid_errors.reserve(extension_ids.size()); - for (const auto& extension_id : extension_ids) { + for (ExtensionDownloaderTask& task : fetch_data->TakeAssociatedTasks()) { manifest_invalid_errors.emplace_back( - extension_id, ExtensionDownloaderDelegate::Error::MANIFEST_INVALID, - ExtensionDownloaderDelegate::FailureData(error.value().error)); + std::move(task), + DownloadFailure( + ExtensionDownloaderDelegate::Error::MANIFEST_INVALID, + ExtensionDownloaderDelegate::FailureData(error.value().error))); } NotifyExtensionsDownloadStageChanged( extension_ids, ExtensionDownloaderDelegate::Stage::FINISHED); - NotifyExtensionsDownloadFailedWithList(manifest_invalid_errors, + NotifyExtensionsDownloadFailedWithList(std::move(manifest_invalid_errors), fetch_data->request_ids()); return; } else { @@ -795,29 +798,30 @@ NotifyExtensionsDownloadStageChanged( extension_ids, ExtensionDownloaderDelegate::Stage::MANIFEST_LOADED); - std::vector<UpdateManifestResult*> to_update; - std::vector<DownloadFailure> failures; + std::vector<std::pair<ExtensionDownloaderTask, UpdateManifestResult*>> + to_update; + std::vector<std::pair<ExtensionDownloaderTask, DownloadFailure>> failures; // Examine the parsed manifest and kick off fetches of any new crx files. - // NOTE: This transfers ownership on tasks to the DetermineUpdates method. - // Currently the tasks are destructed there, but in the future - // DetermineUpdates will return them back via its output arguments. + // NOTE: This transfers ownership on tasks to the DetermineUpdates method, + // which returns tasks back via its output arguments. DetermineUpdates(fetch_data->TakeAssociatedTasks(), *results, &to_update, &failures); - for (const UpdateManifestResult* update : to_update) { - const std::string& extension_id = update->extension_id; + for (const auto& update : to_update) { + const std::string& extension_id = update.first.id; - GURL crx_url = update->crx_url; - NotifyUpdateFound(extension_id, update->version); + GURL crx_url = update.second->crx_url; + NotifyUpdateFound(extension_id, update.second->version); if (fetch_data->is_all_external_policy_download() && crx_url.is_empty()) { DCHECK_EQ(fetch_data->fetch_priority(), DownloadFetchPriority::kForeground); } FetchUpdatedExtension( std::make_unique<ExtensionFetch>( - extension_id, crx_url, update->package_hash, update->version, - fetch_data->request_ids(), fetch_data->fetch_priority()), - update->info); + extension_id, crx_url, update.second->package_hash, + update.second->version, fetch_data->request_ids(), + fetch_data->fetch_priority()), + update.second->info); } // If the manifest response included a <daystart> element, we want to save @@ -836,10 +840,11 @@ ExtensionIdSet extension_ids_with_errors; for (const auto& failure : failures) - extension_ids_with_errors.insert(failure.id); + extension_ids_with_errors.insert(failure.first.id); NotifyExtensionsDownloadStageChanged( extension_ids_with_errors, ExtensionDownloaderDelegate::Stage::FINISHED); - NotifyExtensionsDownloadFailedWithList(failures, fetch_data->request_ids()); + NotifyExtensionsDownloadFailedWithList(std::move(failures), + fetch_data->request_ids()); } ExtensionDownloader::UpdateAvailability @@ -925,8 +930,10 @@ void ExtensionDownloader::DetermineUpdates( std::vector<ExtensionDownloaderTask> tasks, const UpdateManifestResults& possible_updates, - std::vector<UpdateManifestResult*>* to_update, - std::vector<DownloadFailure>* failures) { + std::vector<std::pair<ExtensionDownloaderTask, UpdateManifestResult*>>* + to_update, + std::vector<std::pair<ExtensionDownloaderTask, DownloadFailure>>* + failures) { DCHECK_NE(nullptr, to_update); DCHECK_NE(nullptr, failures); @@ -936,16 +943,16 @@ // Contains IDs of extensions which neither have successful update entry nor // are already inserted into |errors|. - ExtensionIdSet extension_errors; + std::map<ExtensionId, ExtensionDownloaderTask> extension_errors; // For each extensions in the current batch, greedily find an update from // |possible_updates|. - for (const ExtensionDownloaderTask& task : tasks) { + for (ExtensionDownloaderTask& task : tasks) { const ExtensionId& extension_id = task.id; const auto it = update_groups.find(extension_id); if (it == update_groups.end()) { VLOG(2) << "Manifest doesn't have an update entry for " << extension_id; - extension_errors.insert(extension_id); + extension_errors.emplace(extension_id, std::move(task)); continue; } @@ -963,43 +970,50 @@ switch (update_availability) { case UpdateAvailability::kAvailable: DCHECK_NE(nullptr, update_result); - to_update->push_back(update_result); + to_update->emplace_back(std::move(task), update_result); break; case UpdateAvailability::kNoUpdate: failures->emplace_back( - extension_id, - ExtensionDownloaderDelegate::Error::NO_UPDATE_AVAILABLE, - ExtensionDownloaderDelegate::FailureData()); + std::move(task), + DownloadFailure( + ExtensionDownloaderDelegate::Error::NO_UPDATE_AVAILABLE, + ExtensionDownloaderDelegate::FailureData())); break; case UpdateAvailability::kBadUpdateSpecification: failures->emplace_back( - extension_id, ExtensionDownloaderDelegate::Error::MANIFEST_INVALID, - ExtensionDownloaderDelegate::FailureData( - ManifestInvalidError::BAD_UPDATE_SPECIFICATION)); + std::move(task), + DownloadFailure( + ExtensionDownloaderDelegate::Error::MANIFEST_INVALID, + ExtensionDownloaderDelegate::FailureData( + ManifestInvalidError::BAD_UPDATE_SPECIFICATION))); break; } } for (const auto& possible_update : possible_updates.update_list) { const ExtensionId& id = possible_update.extension_id; - if (!extension_errors.count(id)) + auto error = extension_errors.find(id); + if (error == extension_errors.end()) continue; DCHECK(possible_update.parse_error); ManifestInvalidError error_type = possible_update.parse_error.value().error; // Report any error corresponding to an extension. failures->emplace_back( - id, ExtensionDownloaderDelegate::Error::MANIFEST_INVALID, - error_type == ManifestInvalidError::BAD_APP_STATUS - ? ExtensionDownloaderDelegate::FailureData( - error_type, possible_update.app_status) - : ExtensionDownloaderDelegate::FailureData(error_type)); + std::move(error->second), + DownloadFailure( + ExtensionDownloaderDelegate::Error::MANIFEST_INVALID, + error_type == ManifestInvalidError::BAD_APP_STATUS + ? ExtensionDownloaderDelegate::FailureData( + error_type, possible_update.app_status) + : ExtensionDownloaderDelegate::FailureData(error_type))); extension_errors.erase(id); } // For the remaining extensions, we have missing ids. - for (const auto& id : extension_errors) { - failures->emplace_back(id, - ExtensionDownloaderDelegate::Error::MANIFEST_INVALID, - ExtensionDownloaderDelegate::FailureData( - ManifestInvalidError::MISSING_APP_ID)); + for (auto& error : extension_errors) { + failures->emplace_back( + std::move(error.second), + DownloadFailure(ExtensionDownloaderDelegate::Error::MANIFEST_INVALID, + ExtensionDownloaderDelegate::FailureData( + ManifestInvalidError::MISSING_APP_ID))); } } @@ -1356,12 +1370,12 @@ } void ExtensionDownloader::NotifyExtensionsDownloadFailedWithList( - std::vector<DownloadFailure> failures, + std::vector<std::pair<ExtensionDownloaderTask, DownloadFailure>> failures, std::set<int> request_ids) { for (const auto& failure : failures) { - const ExtensionId& extension_id = failure.id; - ExtensionDownloaderDelegate::Error error = failure.error; - ExtensionDownloaderDelegate::FailureData data = failure.failure_data; + const ExtensionId& extension_id = failure.first.id; + ExtensionDownloaderDelegate::Error error = failure.second.error; + ExtensionDownloaderDelegate::FailureData data = failure.second.failure_data; auto ping_iter = ping_results_.find(extension_id); delegate_->OnExtensionDownloadFailed( extension_id, error,
diff --git a/extensions/browser/updater/extension_downloader.h b/extensions/browser/updater/extension_downloader.h index d58dd82..0540c9bc 100644 --- a/extensions/browser/updater/extension_downloader.h +++ b/extensions/browser/updater/extension_downloader.h
@@ -51,12 +51,11 @@ namespace extensions { struct DownloadFailure { - DownloadFailure(ExtensionId id, - ExtensionDownloaderDelegate::Error error, + DownloadFailure(ExtensionDownloaderDelegate::Error error, ExtensionDownloaderDelegate::FailureData failure_data); + DownloadFailure(DownloadFailure&& other); ~DownloadFailure(); - ExtensionId id; ExtensionDownloaderDelegate::Error error; ExtensionDownloaderDelegate::FailureData failure_data; }; @@ -293,10 +292,12 @@ // ExtensionDownloader's perspective). // For example, a common error is |possible_updates| doesn't have any update // information for some extensions. - void DetermineUpdates(std::vector<ExtensionDownloaderTask> tasks, - const UpdateManifestResults& possible_updates, - std::vector<UpdateManifestResult*>* to_update, - std::vector<DownloadFailure>* errors); + void DetermineUpdates( + std::vector<ExtensionDownloaderTask> tasks, + const UpdateManifestResults& possible_updates, + std::vector<std::pair<ExtensionDownloaderTask, UpdateManifestResult*>>* + to_update, + std::vector<std::pair<ExtensionDownloaderTask, DownloadFailure>>* errors); // Checks whether extension is presented in cache. If yes, return path to its // cached CRX, absl::nullopt otherwise. |manifest_fetch_failed| flag indicates @@ -351,7 +352,7 @@ // of arguments because there is no guarantee that callback won't indirectly // change source of them. void NotifyExtensionsDownloadFailedWithList( - std::vector<DownloadFailure> errors, + std::vector<std::pair<ExtensionDownloaderTask, DownloadFailure>> errors, std::set<int> request_ids); // Send a notification that an update was found for |id| that we'll
diff --git a/extensions/browser/updater/extension_downloader_task.h b/extensions/browser/updater/extension_downloader_task.h index 81f83dab..d39fb98 100644 --- a/extensions/browser/updater/extension_downloader_task.h +++ b/extensions/browser/updater/extension_downloader_task.h
@@ -7,6 +7,7 @@ #include <string> +#include "base/memory/raw_ptr.h" #include "base/version.h" #include "extensions/browser/updater/extension_downloader_delegate.h" #include "extensions/browser/updater/extension_downloader_types.h" @@ -74,7 +75,7 @@ std::string update_url_data; // Link to the delegate, set by ExtensionDownloader. - ExtensionDownloaderDelegate* delegate{nullptr}; + raw_ptr<ExtensionDownloaderDelegate> delegate{nullptr}; // Notifies delegate about stage change. void OnStageChanged(ExtensionDownloaderDelegate::Stage stage);
diff --git a/extensions/shell/browser/shell_desktop_controller_aura_unittest.cc b/extensions/shell/browser/shell_desktop_controller_aura_unittest.cc index aac03851..204c58e 100644 --- a/extensions/shell/browser/shell_desktop_controller_aura_unittest.cc +++ b/extensions/shell/browser/shell_desktop_controller_aura_unittest.cc
@@ -54,9 +54,7 @@ ~ShellDesktopControllerAuraTest() override = default; void SetUp() override { - ShellTestBaseAura::SetUp(); - - // Set up a screen with 2 displays. + // Set up a screen with 2 displays before `ShellTestBaseAura::SetUp()` screen_ = std::make_unique<display::ScreenBase>(); screen_->display_list().AddDisplay( display::Display(100, gfx::Rect(0, 0, 1920, 1080)), @@ -66,6 +64,7 @@ display::DisplayList::Type::NOT_PRIMARY); screen_override_ = std::make_unique<display::test::ScopedScreenOverride>(screen_.get()); + ShellTestBaseAura::SetUp(); #if BUILDFLAG(IS_CHROMEOS_ASH) chromeos::PowerManagerClient::InitializeFake(); @@ -80,9 +79,9 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) chromeos::PowerManagerClient::Shutdown(); #endif + ShellTestBaseAura::TearDown(); screen_override_.reset(); screen_.reset(); - ShellTestBaseAura::TearDown(); } protected:
diff --git a/extensions/shell/browser/shell_desktop_controller_mac.h b/extensions/shell/browser/shell_desktop_controller_mac.h index e78005f2..d3ba91d 100644 --- a/extensions/shell/browser/shell_desktop_controller_mac.h +++ b/extensions/shell/browser/shell_desktop_controller_mac.h
@@ -8,6 +8,7 @@ #include <memory> #include "extensions/shell/browser/desktop_controller.h" +#include "ui/display/screen.h" namespace extensions { @@ -36,6 +37,8 @@ // The desktop only supports a single app window. // TODO(yoz): Support multiple app windows, as we do in Aura. AppWindow* app_window_; // NativeAppWindow::Close() deletes this. + + display::ScopedNativeScreen screen_; }; } // namespace extensions
diff --git a/fuchsia_web/webengine/browser/web_engine_browser_main_parts.cc b/fuchsia_web/webengine/browser/web_engine_browser_main_parts.cc index 5137e60..4d43477 100644 --- a/fuchsia_web/webengine/browser/web_engine_browser_main_parts.cc +++ b/fuchsia_web/webengine/browser/web_engine_browser_main_parts.cc
@@ -55,6 +55,7 @@ #include "third_party/widevine/cdm/widevine_cdm_common.h" #include "ui/aura/screen_ozone.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/display/screen.h" #include "ui/gfx/switches.h" #include "ui/ozone/public/ozone_platform.h" #include "ui/ozone/public/ozone_switches.h" @@ -167,9 +168,7 @@ content::ContentBrowserClient* browser_client) : browser_client_(browser_client) {} -WebEngineBrowserMainParts::~WebEngineBrowserMainParts() { - display::Screen::SetScreenInstance(nullptr); -} +WebEngineBrowserMainParts::~WebEngineBrowserMainParts() = default; std::vector<content::BrowserContext*> WebEngineBrowserMainParts::browser_contexts() const { @@ -190,7 +189,6 @@ } int WebEngineBrowserMainParts::PreMainMessageLoopRun() { - DCHECK(!screen_); DCHECK_EQ(context_bindings_.size(), 0u); // Initialize the |component_inspector_| to allow diagnostics to be published. @@ -252,11 +250,7 @@ base::Unretained(this))); // Configure Ozone with an Aura implementation of the Screen abstraction. - std::unique_ptr<aura::ScreenOzone> screen_ozone = - std::make_unique<aura::ScreenOzone>(); - screen_ozone.get()->Initialize(); - screen_ = std::move(screen_ozone); - display::Screen::SetScreenInstance(screen_.get()); + screen_ = std::make_unique<aura::ScopedScreenOzone>(); // Create the FuchsiaCdmManager at startup rather than on-demand, to allow it // to perform potentially expensive startup work in the background. @@ -313,7 +307,6 @@ // that they may post cleanup tasks during teardown. // NOTE: Objects are destroyed in the reverse order of their creation. legacy_metrics_client_.reset(); - screen_.reset(); intl_profile_watcher_.reset(); base::ImportantFileWriterCleaner::GetInstance().Stop();
diff --git a/fuchsia_web/webengine/browser/web_engine_browser_main_parts.h b/fuchsia_web/webengine/browser/web_engine_browser_main_parts.h index ab3bc39..b86bc78e 100644 --- a/fuchsia_web/webengine/browser/web_engine_browser_main_parts.h +++ b/fuchsia_web/webengine/browser/web_engine_browser_main_parts.h
@@ -22,7 +22,7 @@ } namespace display { -class Screen; +class ScopedNativeScreen; } namespace content { @@ -120,7 +120,7 @@ content::ContentBrowserClient* const browser_client_; - std::unique_ptr<display::Screen> screen_; + std::unique_ptr<display::ScopedNativeScreen> screen_; // Used to publish diagnostics including the active Contexts and FrameHosts. std::unique_ptr<sys::ComponentInspector> component_inspector_;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h index 7e06c5c..1d4fda2 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
@@ -703,7 +703,7 @@ std::unique_ptr<MockGLES2Decoder> mock_decoder_; std::unique_ptr<GLES2Decoder> decoder_; std::unique_ptr<MemoryTracker> memory_tracker_; - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; GLuint client_buffer_id_; GLuint client_framebuffer_id_; @@ -1035,7 +1035,7 @@ TraceOutputter outputter_; std::unique_ptr<GLES2DecoderPassthroughImpl> decoder_; scoped_refptr<ContextGroup> group_; - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; }; } // namespace gles2
diff --git a/gpu/command_buffer/service/gpu_service_test.h b/gpu/command_buffer/service/gpu_service_test.h index 1bede07..76420c1f 100644 --- a/gpu/command_buffer/service/gpu_service_test.h +++ b/gpu/command_buffer/service/gpu_service_test.h
@@ -7,6 +7,7 @@ #include <memory> +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/test/task_environment.h" #include "testing/gmock/include/gmock/gmock.h" @@ -44,7 +45,7 @@ scoped_refptr<gl::GLContextStub> context_; scoped_refptr<gl::GLSurfaceStub> surface_; base::test::SingleThreadTaskEnvironment task_environment_; - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; }; } // namespace gles2
diff --git a/gpu/command_buffer/service/gr_cache_controller_unittest.cc b/gpu/command_buffer/service/gr_cache_controller_unittest.cc index 807287c8..e8a9b4e 100644 --- a/gpu/command_buffer/service/gr_cache_controller_unittest.cc +++ b/gpu/command_buffer/service/gr_cache_controller_unittest.cc
@@ -5,6 +5,7 @@ #include "gpu/command_buffer/service/gr_cache_controller.h" #include "base/callback_helpers.h" +#include "base/memory/raw_ptr.h" #include "base/test/test_mock_time_task_runner.h" #include "gpu/command_buffer/service/feature_info.h" #include "gpu/command_buffer/service/shared_context_state.h" @@ -62,7 +63,7 @@ scoped_refptr<SharedContextState> context_state_; scoped_refptr<base::TestMockTimeTaskRunner> task_runner_; std::unique_ptr<GrCacheController> controller_; - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; }; TEST_F(GrCacheControllerTest, PurgeGrCache) {
diff --git a/gpu/command_buffer/service/raster_decoder_unittest.cc b/gpu/command_buffer/service/raster_decoder_unittest.cc index 32940e5..0ad1e92 100644 --- a/gpu/command_buffer/service/raster_decoder_unittest.cc +++ b/gpu/command_buffer/service/raster_decoder_unittest.cc
@@ -368,7 +368,7 @@ std::unique_ptr<SharedImageFactory> shared_image_factory_; SharedImageManager shared_image_manager_; gles2::MailboxManagerImpl mailbox_manager_; - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; }; TEST_F(RasterDecoderOOPTest, CopyTexSubImage2DSizeMismatch) {
diff --git a/gpu/command_buffer/service/raster_decoder_unittest_base.h b/gpu/command_buffer/service/raster_decoder_unittest_base.h index 1625699..e4f4b3d 100644 --- a/gpu/command_buffer/service/raster_decoder_unittest_base.h +++ b/gpu/command_buffer/service/raster_decoder_unittest_base.h
@@ -194,7 +194,7 @@ base::test::SingleThreadTaskEnvironment task_environment_; raw_ptr<gles2::MockCopyTextureResourceManager> copy_texture_manager_; // not owned - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; }; class RasterDecoderManualInitTest : public RasterDecoderTestBase {
diff --git a/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc b/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc index 5f4e07b..ae564df0 100644 --- a/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc +++ b/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc
@@ -86,7 +86,7 @@ } return std::make_unique<SharedImageBackingOzone>( mailbox, format, gfx::BufferPlane::DEFAULT, size, color_space, - surface_origin, alpha_type, usage, shared_context_state_, + surface_origin, alpha_type, usage, shared_context_state_.get(), std::move(pixmap), dawn_procs_); } @@ -162,7 +162,7 @@ viz::GetResourceFormat(GetPlaneBufferFormat(plane, buffer_format)); backing = std::make_unique<SharedImageBackingOzone>( mailbox, plane_format, plane, plane_size, color_space, surface_origin, - alpha_type, usage, shared_context_state_, std::move(pixmap), + alpha_type, usage, shared_context_state_.get(), std::move(pixmap), dawn_procs_); backing->SetCleared(); } else if (handle.type == gfx::SHARED_MEMORY_BUFFER) {
diff --git a/gpu/command_buffer/service/shared_image_backing_factory_ozone.h b/gpu/command_buffer/service/shared_image_backing_factory_ozone.h index 30cdaba..d041b915 100644 --- a/gpu/command_buffer/service/shared_image_backing_factory_ozone.h +++ b/gpu/command_buffer/service/shared_image_backing_factory_ozone.h
@@ -5,6 +5,7 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_BACKING_FACTORY_OZONE_H_ #define GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_BACKING_FACTORY_OZONE_H_ +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_refptr.h" #include "gpu/command_buffer/service/shared_image_backing_factory.h" @@ -75,7 +76,7 @@ gfx::GpuMemoryBufferType memory_buffer_type); bool CanImportNativePixmapToWebGPU(); - SharedContextState* const shared_context_state_; + const raw_ptr<SharedContextState> shared_context_state_; scoped_refptr<base::RefCountedData<DawnProcTable>> dawn_procs_; std::unique_ptr<SharedImageBackingOzone> CreateSharedImageInternal(
diff --git a/gpu/command_buffer/service/webgpu_decoder_impl.cc b/gpu/command_buffer/service/webgpu_decoder_impl.cc index 9c82898..d8080f67 100644 --- a/gpu/command_buffer/service/webgpu_decoder_impl.cc +++ b/gpu/command_buffer/service/webgpu_decoder_impl.cc
@@ -921,7 +921,7 @@ } }; - WebGPUDecoderImpl* decoder_; + raw_ptr<WebGPUDecoderImpl> decoder_; }; thread_local WebGPUDecoderImpl* DawnWireServer::tls_parent_decoder = nullptr;
diff --git a/gpu/command_buffer/tests/gl_test_setup_helper.h b/gpu/command_buffer/tests/gl_test_setup_helper.h index 01d6eba..251e205 100644 --- a/gpu/command_buffer/tests/gl_test_setup_helper.h +++ b/gpu/command_buffer/tests/gl_test_setup_helper.h
@@ -5,6 +5,7 @@ #ifndef GPU_COMMAND_BUFFER_TESTS_GL_TEST_SETUP_HELPER_H_ #define GPU_COMMAND_BUFFER_TESTS_GL_TEST_SETUP_HELPER_H_ +#include "base/memory/raw_ptr.h" #include "base/test/task_environment.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gl/gl_display.h" @@ -27,7 +28,7 @@ private: std::unique_ptr<base::test::TaskEnvironment> task_environment_; - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; }; } // namespace gpu
diff --git a/gpu/command_buffer/tests/gl_test_utils.h b/gpu/command_buffer/tests/gl_test_utils.h index 098f649..1b70d655 100644 --- a/gpu/command_buffer/tests/gl_test_utils.h +++ b/gpu/command_buffer/tests/gl_test_utils.h
@@ -12,6 +12,7 @@ #include <vector> +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "gpu/command_buffer/tests/gl_manager.h" #include "ui/gl/gl_display.h" @@ -141,7 +142,7 @@ gl::GLWindowSystemBindingInfo window_system_binding_info_; gfx::ExtensionSet egl_extensions_; gfx::ExtensionSet gl_extensions_; - gl::GLDisplay* gl_display_ = nullptr; + raw_ptr<gl::GLDisplay> gl_display_ = nullptr; }; } // namespace gpu
diff --git a/gpu/config/gpu_info_collector_unittest.cc b/gpu/config/gpu_info_collector_unittest.cc index 9e1881dd..760337e 100644 --- a/gpu/config/gpu_info_collector_unittest.cc +++ b/gpu/config/gpu_info_collector_unittest.cc
@@ -11,6 +11,7 @@ #include <string> #include <vector> +#include "base/memory/raw_ptr.h" #include "base/strings/string_split.h" #include "build/build_config.h" #include "gpu/config/gpu_info.h" @@ -200,7 +201,7 @@ // Persistent storage is needed for the split extension string. std::vector<std::string> split_extensions_; - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; }; INSTANTIATE_TEST_SUITE_P(GPUConfig,
diff --git a/gpu/ipc/client/command_buffer_proxy_impl.h b/gpu/ipc/client/command_buffer_proxy_impl.h index 9c8f6887..2c425bd 100644 --- a/gpu/ipc/client/command_buffer_proxy_impl.h +++ b/gpu/ipc/client/command_buffer_proxy_impl.h
@@ -294,7 +294,7 @@ // TODO(1321521) remove this member and instead let callers of // CreateTransferBuffer specify the mapper to use so that only the buffers // used for WebGPU ArrayBuffers use a non-default mapper. - base::SharedMemoryMapper* transfer_buffer_mapper_; + raw_ptr<base::SharedMemoryMapper> transfer_buffer_mapper_; base::WeakPtrFactory<CommandBufferProxyImpl> weak_ptr_factory_{this}; };
diff --git a/gpu/ipc/common/gpu_memory_buffer_impl_test_template.h b/gpu/ipc/common/gpu_memory_buffer_impl_test_template.h index cbbffd6c..e9fe0a7 100644 --- a/gpu/ipc/common/gpu_memory_buffer_impl_test_template.h +++ b/gpu/ipc/common/gpu_memory_buffer_impl_test_template.h
@@ -14,6 +14,7 @@ #include <memory> #include "base/bind.h" +#include "base/memory/raw_ptr.h" #include "base/test/task_environment.h" #include "build/build_config.h" #include "gpu/ipc/common/gpu_memory_buffer_support.h" @@ -65,7 +66,7 @@ private: GpuMemoryBufferSupport gpu_memory_buffer_support_; - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; void FreeGpuMemoryBuffer(base::OnceClosure free_callback, bool* destroyed,
diff --git a/gpu/ipc/service/gpu_channel_test_common.h b/gpu/ipc/service/gpu_channel_test_common.h index 338a579..051b3aa 100644 --- a/gpu/ipc/service/gpu_channel_test_common.h +++ b/gpu/ipc/service/gpu_channel_test_common.h
@@ -8,6 +8,7 @@ #include <memory> #include <vector> +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/memory/unsafe_shared_memory_region.h" #include "base/task/sequenced_task_runner.h" @@ -68,7 +69,7 @@ std::unique_ptr<Scheduler> scheduler_; std::unique_ptr<TestGpuChannelManagerDelegate> channel_manager_delegate_; std::unique_ptr<GpuChannelManager> channel_manager_; - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; }; } // namespace gpu
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory_test_template.h b/gpu/ipc/service/gpu_memory_buffer_factory_test_template.h index 36663b2..36be4055 100644 --- a/gpu/ipc/service/gpu_memory_buffer_factory_test_template.h +++ b/gpu/ipc/service/gpu_memory_buffer_factory_test_template.h
@@ -8,6 +8,7 @@ #ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_ #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_TEST_TEMPLATE_H_ +#include "base/memory/raw_ptr.h" #include "base/test/task_environment.h" #include "build/build_config.h" #include "gpu/ipc/common/gpu_memory_buffer_support.h" @@ -46,7 +47,7 @@ base::test::TaskEnvironment::MainThreadType::UI}; GpuMemoryBufferFactoryType factory_; - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; }; TYPED_TEST_SUITE_P(GpuMemoryBufferFactoryTest);
diff --git a/headless/lib/browser/headless_browser_impl.h b/headless/lib/browser/headless_browser_impl.h index 7be22a33..7f4ac86 100644 --- a/headless/lib/browser/headless_browser_impl.h +++ b/headless/lib/browser/headless_browser_impl.h
@@ -14,6 +14,7 @@ #include "base/memory/weak_ptr.h" #include "base/task/single_thread_task_runner.h" +#include "build/build_config.h" #include "headless/lib/browser/headless_devtools_manager_delegate.h" #include "headless/public/headless_devtools_target.h" #include "headless/public/headless_export.h" @@ -28,6 +29,10 @@ } // namespace policy #endif +#if BUILDFLAG(IS_MAC) +#include "ui/display/screen.h" +#endif + namespace ui { class Compositor; } // namespace ui @@ -117,6 +122,10 @@ #endif protected: +#if BUILDFLAG(IS_MAC) + std::unique_ptr<display::ScopedNativeScreen> screen_; +#endif + base::OnceCallback<void(HeadlessBrowser*)> on_start_callback_; HeadlessBrowser::Options options_; raw_ptr<HeadlessBrowserMainParts> browser_main_parts_; // Not owned.
diff --git a/headless/lib/browser/headless_browser_impl_mac.mm b/headless/lib/browser/headless_browser_impl_mac.mm index 812572a..da3dee43 100644 --- a/headless/lib/browser/headless_browser_impl_mac.mm +++ b/headless/lib/browser/headless_browser_impl_mac.mm
@@ -65,6 +65,7 @@ } // namespace void HeadlessBrowserImpl::PlatformInitialize() { + screen_ = std::make_unique<display::ScopedNativeScreen>(); HeadlessPopUpMethods::Init(); }
diff --git a/ios/chrome/app/strings/ios_strings.grd b/ios/chrome/app/strings/ios_strings.grd index 968be8f..1502597 100644 --- a/ios/chrome/app/strings/ios_strings.grd +++ b/ios/chrome/app/strings/ios_strings.grd
@@ -726,8 +726,8 @@ <message name="IDS_IOS_CONTEXT_MENU_SEARCHWEBFORIMAGE" desc="Context menu text for option to perform a search for image [Length: 25em] [iOS only]"> Search <ph name="SEARCH_ENGINE">$1<ex>Google</ex></ph> for This Image </message> - <message name="IDS_IOS_CONTEXT_MENU_SEARCHIMAGEWITHLENS" desc="Context menu text for option to search an image with Google Lens [Length: 25em] [iOS only]"> - Search with Google Lens + <message name="IDS_IOS_CONTEXT_MENU_SEARCHIMAGEWITHGOOGLE" desc="Context menu text for option to search an image with Google [Length: 25em] [iOS only]"> + Search image with Google </message> <message name="IDS_IOS_COPY_VERSION_HINT" desc="The accessibility hint for the label showing the Chrome version. [iOS only]"> Double tap to copy.
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_CONTEXT_MENU_SEARCHIMAGEWITHGOOGLE.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_CONTEXT_MENU_SEARCHIMAGEWITHGOOGLE.png.sha1 new file mode 100644 index 0000000..e2479c4 --- /dev/null +++ b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_CONTEXT_MENU_SEARCHIMAGEWITHGOOGLE.png.sha1
@@ -0,0 +1 @@ +e10ac58380c4ca59271d9817df5caf1def5abda2 \ No newline at end of file
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_CONTEXT_MENU_SEARCHIMAGEWITHLENS.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_CONTEXT_MENU_SEARCHIMAGEWITHLENS.png.sha1 deleted file mode 100644 index 196cf8a..0000000 --- a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_CONTEXT_MENU_SEARCHIMAGEWITHLENS.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -9ffd1ef75bbd36361b32111b20a5325203a7030f \ No newline at end of file
diff --git a/ios/chrome/browser/BUILD.gn b/ios/chrome/browser/BUILD.gn index 2d80583..e69dcd5 100644 --- a/ios/chrome/browser/BUILD.gn +++ b/ios/chrome/browser/BUILD.gn
@@ -265,6 +265,7 @@ "//rlz/buildflags", "//services/network:network_service", "//ui/base", + "//ui/display", ] if (enable_rlz) {
diff --git a/ios/chrome/browser/ios_chrome_main_parts.mm b/ios/chrome/browser/ios_chrome_main_parts.mm index 04fd297d..a2c1246 100644 --- a/ios/chrome/browser/ios_chrome_main_parts.mm +++ b/ios/chrome/browser/ios_chrome_main_parts.mm
@@ -85,6 +85,10 @@ #include "base/allocator/allocator_shim.h" #endif +#if DCHECK_IS_ON() +#include "ui/display/screen_base.h" +#endif + #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif @@ -125,7 +129,15 @@ net::URLRequest::SetDefaultCookiePolicyToBlock(); } -IOSChromeMainParts::~IOSChromeMainParts() {} +IOSChromeMainParts::~IOSChromeMainParts() { +#if DCHECK_IS_ON() + // The screen object is never deleted on IOS. Make sure that all display + // observers are removed at the end. + display::ScreenBase* screen = + static_cast<display::ScreenBase*>(display::Screen::GetScreen()); + DCHECK(!screen->HasDisplayObservers()); +#endif +} void IOSChromeMainParts::PreEarlyInitialization() { #if BUILDFLAG(USE_ALLOCATOR_SHIM)
diff --git a/ios/chrome/browser/ui/menu/action_factory.mm b/ios/chrome/browser/ui/menu/action_factory.mm index 6fa7fa6..cf97ae9 100644 --- a/ios/chrome/browser/ui/menu/action_factory.mm +++ b/ios/chrome/browser/ui/menu/action_factory.mm
@@ -302,7 +302,7 @@ - (UIAction*)actionToSearchImageUsingLensWithBlock:(ProceduralBlock)block { UIAction* action = [self actionWithTitle:l10n_util::GetNSString( - IDS_IOS_CONTEXT_MENU_SEARCHIMAGEWITHLENS) + IDS_IOS_CONTEXT_MENU_SEARCHIMAGEWITHGOOGLE) image:[UIImage imageNamed:@"lens_icon"] type:MenuActionType::SearchImageWithLens block:block];
diff --git a/ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller_egtest.mm b/ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller_egtest.mm index f2b6d19a..c6e3392 100644 --- a/ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller_egtest.mm +++ b/ios/chrome/browser/ui/settings/sync/sync_encryption_passphrase_table_view_controller_egtest.mm
@@ -92,6 +92,43 @@ [SigninEarlGrey verifySignedOut]; } +// Tests entering sync passphrase from the advanced sync settings in the sign-in +// dialog. +- (void)testEnterSyncPassphraseInSignIn { + [ChromeEarlGrey addBookmarkWithSyncPassphrase:kPassphrase]; + // Access advanced settings sign-in. + FakeChromeIdentity* fakeIdentity = [FakeChromeIdentity fakeIdentity1]; + [SigninEarlGrey addFakeIdentity:fakeIdentity]; + [ChromeEarlGreyUI openSettingsMenu]; + [ChromeEarlGreyUI tapSettingsMenuButton:PrimarySignInButton()]; + [[EarlGrey selectElementWithMatcher:SettingsLink()] performAction:grey_tap()]; + + // Scroll to bottom of Manage Sync Settings, if necessary. + [[EarlGrey selectElementWithMatcher: + grey_allOf(grey_accessibilityID( + kManageSyncTableViewAccessibilityIdentifier), + grey_sufficientlyVisible(), nil)] + performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)]; + + // Select Encryption item. + [[EarlGrey + selectElementWithMatcher:grey_allOf(ButtonWithAccessibilityLabelId( + IDS_IOS_MANAGE_SYNC_ENCRYPTION), + grey_sufficientlyVisible(), nil)] + performAction:grey_tap()]; + + // Type and submit the sync passphrase. + [SigninEarlGreyUI submitSyncPassphrase:kPassphrase]; + + // Close the advanced sync settings and the sign-in dialog. + [[EarlGrey selectElementWithMatcher:AdvancedSyncSettingsDoneButtonMatcher()] + performAction:grey_tap()]; + [SigninEarlGreyUI tapSigninConfirmationDialog]; + + // Test the user is signed in. + [SigninEarlGrey verifySignedInWithFakeIdentity:fakeIdentity]; +} + // Tests Sync is on after opening settings from the Infobar and entering the // passphrase. - (void)testShowAddSyncPassphrphrase {
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 index ef7dec0..37c8bdc 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -6de615de0be131fedac48c794311fd11034be034 \ No newline at end of file +9a117bef0efc4128cfb05e3566ecf34d46007f5a \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 index 9d23b3c..76c11a3 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -fcfc21bb4b0c5ed1744f6614ff72554ece195f6b \ No newline at end of file +fb4f4d655a9af0e5f535880df2b870ca606135a5 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 index c15d83a..7c6b2fe 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -516dc5a21690d12284b5e72bfb16651dfa814361 \ No newline at end of file +a8f1f7cb363771d05030693363b73933abbba92c \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 index ffec9df..866c5a8 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -a059a09ecdb2441a3db85199f86f77cae0f06b1e \ No newline at end of file +72b79f580d22e73ecb7e2d2f16d748faa7b2cb21 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 index 2c67be7..0316cf1 100644 --- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -4cbea4f6e225edf850e8a83e65b08966ef214149 \ No newline at end of file +18a78ea8199b44e099777cc994bc7acc9760e62b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 index d5e6429..2ad1973 100644 --- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -4415830d100907e5cb6a8b33043d34c6396a67b8 \ No newline at end of file +80cc21c2c57a8b0831a196d56120d42227b47cd7 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 index e5673a9..604be80c 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -8d6f67c99437a326d2cb37c76ff53873cd3dcb09 \ No newline at end of file +f478a85c3680bdf12332e7ec730ec9fd02834790 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 index 13afe34..e159fcc 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -dd196914f7f8bbc6eea10830a176beefa857384b \ No newline at end of file +bd14906db5ced5528879650bb682ca1d9f438b0c \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 index 41afada..46f828b 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -c46007e9a401941fb9b78f2ffd2352f16f8d5fc4 \ No newline at end of file +e8832202c32bb95a748f359947dd32cbc7f9476f \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 index 4207c03..332151d 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -9487105bc71697a1962478ff56cf4ec122dcb94d \ No newline at end of file +329293142b22e0528d2ea84e579e6ff8ad9bbff8 \ No newline at end of file
diff --git a/ios/testing/earl_grey/BUILD.gn b/ios/testing/earl_grey/BUILD.gn index 1979419..c44d6498 100644 --- a/ios/testing/earl_grey/BUILD.gn +++ b/ios/testing/earl_grey/BUILD.gn
@@ -61,5 +61,6 @@ "//ios/third_party/edo", "//ios/web/common", "//testing/gtest:gtest", + "//ui/display", ] }
diff --git a/ios/testing/earl_grey/DEPS b/ios/testing/earl_grey/DEPS new file mode 100644 index 0000000..e5069168 --- /dev/null +++ b/ios/testing/earl_grey/DEPS
@@ -0,0 +1,5 @@ +specific_include_rules = { + "base_earl_grey_test_case.mm": [ + "+ui/display" + ] +}
diff --git a/ios/testing/earl_grey/base_earl_grey_test_case.mm b/ios/testing/earl_grey/base_earl_grey_test_case.mm index ecd38af..3a09405d 100644 --- a/ios/testing/earl_grey/base_earl_grey_test_case.mm +++ b/ios/testing/earl_grey/base_earl_grey_test_case.mm
@@ -16,6 +16,10 @@ #import "ios/testing/earl_grey/coverage_utils.h" #import "ios/testing/earl_grey/earl_grey_test.h" +#if DCHECK_IS_ON() +#include "ui/display/screen_base.h" +#endif + #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif @@ -79,6 +83,14 @@ } + (void)tearDown { +#if DCHECK_IS_ON() + // The same screen object is shared across multiple test runs on IOS build. + // Make sure that all display observers are removed at the end of each + // test. + display::ScreenBase* screen = + static_cast<display::ScreenBase*>(display::Screen::GetScreen()); + DCHECK(!screen->HasDisplayObservers()); +#endif if ([[AppLaunchManager sharedManager] appIsLaunched]) { [CoverageUtils writeClangCoverageProfile]; [CoverageUtils resetCoverageProfileCounters];
diff --git a/ios/web/shell/BUILD.gn b/ios/web/shell/BUILD.gn index bdf5d2c9..a35ad69 100644 --- a/ios/web/shell/BUILD.gn +++ b/ios/web/shell/BUILD.gn
@@ -63,6 +63,7 @@ "//net", "//net:extras", "//ui/base", + "//ui/display", ] frameworks = [
diff --git a/ios/web/shell/shell_web_main_parts.mm b/ios/web/shell/shell_web_main_parts.mm index 9833401f..0e9bbbf 100644 --- a/ios/web/shell/shell_web_main_parts.mm +++ b/ios/web/shell/shell_web_main_parts.mm
@@ -6,6 +6,10 @@ #include "ios/web/shell/shell_browser_state.h" +#if DCHECK_IS_ON() +#include "ui/display/screen_base.h" +#endif + #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif @@ -16,6 +20,13 @@ } ShellWebMainParts::~ShellWebMainParts() { +#if DCHECK_IS_ON() + // The screen object is never deleted on IOS. Make sure that all display + // observers are removed at the end. + display::ScreenBase* screen = + static_cast<display::ScreenBase*>(display::Screen::GetScreen()); + DCHECK(!screen->HasDisplayObservers()); +#endif } void ShellWebMainParts::PreMainMessageLoopRun() {
diff --git a/ios/web/test/BUILD.gn b/ios/web/test/BUILD.gn index 60324ccc8..fe065aa6 100644 --- a/ios/web/test/BUILD.gn +++ b/ios/web/test/BUILD.gn
@@ -71,6 +71,7 @@ "//net", "//third_party/ocmock", "//ui/base", + "//ui/display", ] sources = [
diff --git a/ios/web/test/web_int_test.mm b/ios/web/test/web_int_test.mm index ad4cca2..896a5add 100644 --- a/ios/web/test/web_int_test.mm +++ b/ios/web/test/web_int_test.mm
@@ -15,6 +15,10 @@ #import "ios/web/public/test/web_view_interaction_test_util.h" #include "ios/web/public/web_state_observer.h" +#if DCHECK_IS_ON() +#include "ui/display/screen_base.h" +#endif + #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif @@ -81,6 +85,15 @@ [WKWebsiteDataStore allWebsiteDataTypes]); WebTest::TearDown(); + +#if DCHECK_IS_ON() + // The same screen object is shared across multiple test runs on IOS build. + // Make sure that all display observers are removed at the end of each + // test. + display::ScreenBase* screen = + static_cast<display::ScreenBase*>(display::Screen::GetScreen()); + DCHECK(!screen->HasDisplayObservers()); +#endif } bool WebIntTest::ExecuteBlockAndWaitForLoad(const GURL& url,
diff --git a/ios/web_view/BUILD.gn b/ios/web_view/BUILD.gn index 2fa51612..28d215dd 100644 --- a/ios/web_view/BUILD.gn +++ b/ios/web_view/BUILD.gn
@@ -24,6 +24,8 @@ } config("config") { + # TODO(crbug.com/1055812): This will only guarantee ios/web_view source files + # are extension safe. We also need to pass this flag to all all dependencies. common_flags = [ "-fapplication-extension" ] cflags_objc = common_flags cflags_objcc = common_flags @@ -374,6 +376,7 @@ "//services/network:network_service", "//third_party/abseil-cpp:absl", "//ui/base", + "//ui/display", "//url", ]
diff --git a/ios/web_view/internal/DEPS b/ios/web_view/internal/DEPS index 3d26b42b..271ac1bb 100644 --- a/ios/web_view/internal/DEPS +++ b/ios/web_view/internal/DEPS
@@ -69,3 +69,9 @@ "+ui/base", "+ui/gfx", ] + +specific_include_rules = { + "web_view_web_main_parts.mm": [ + "+ui/display" + ] +}
diff --git a/ios/web_view/internal/web_view_web_main_parts.mm b/ios/web_view/internal/web_view_web_main_parts.mm index f6a80877..534632d7 100644 --- a/ios/web_view/internal/web_view_web_main_parts.mm +++ b/ios/web_view/internal/web_view_web_main_parts.mm
@@ -24,6 +24,10 @@ #include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/resource/resource_bundle.h" +#if DCHECK_IS_ON() +#include "ui/display/screen_base.h" +#endif + #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif @@ -33,7 +37,15 @@ WebViewWebMainParts::WebViewWebMainParts() : field_trial_list_(/*entropy_provider=*/nullptr) {} -WebViewWebMainParts::~WebViewWebMainParts() = default; +WebViewWebMainParts::~WebViewWebMainParts() { +#if DCHECK_IS_ON() + // The screen object is never deleted on IOS. Make sure that all display + // observers are removed at the end. + display::ScreenBase* screen = + static_cast<display::ScreenBase*>(display::Screen::GetScreen()); + DCHECK(!screen->HasDisplayObservers()); +#endif +} void WebViewWebMainParts::PreCreateMainMessageLoop() { l10n_util::OverrideLocaleWithCocoaLocale();
diff --git a/media/audio/audio_input_delegate.h b/media/audio/audio_input_delegate.h index 3c97d80..babd1b48 100644 --- a/media/audio/audio_input_delegate.h +++ b/media/audio/audio_input_delegate.h
@@ -33,9 +33,6 @@ std::unique_ptr<base::CancelableSyncSocket> socket, bool initially_muted) = 0; - // Called when the microphone is muted/unmuted. - virtual void OnMuted(int stream_id, bool is_muted) = 0; - // Called if stream encounters an error and has become unusable. virtual void OnStreamError(int stream_id) = 0; };
diff --git a/media/audio/audio_manager_base.cc b/media/audio/audio_manager_base.cc index 1d3a3dc3..7090de5 100644 --- a/media/audio/audio_manager_base.cc +++ b/media/audio/audio_manager_base.cc
@@ -9,6 +9,7 @@ #include "base/bind.h" #include "base/callback_helpers.h" #include "base/command_line.h" +#include "base/memory/raw_ptr.h" #include "base/metrics/histogram_macros.h" #include "base/observer_list.h" #include "base/strings/string_number_conversions.h" @@ -114,7 +115,7 @@ } private: - const DispatcherParams* dispatcher_; + raw_ptr<const DispatcherParams> dispatcher_; }; AudioManagerBase::AudioManagerBase(std::unique_ptr<AudioThread> audio_thread,
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc index f3a15a8a..15f3e96 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc
@@ -779,6 +779,10 @@ const base::Feature kUseChromeOSDirectVideoDecoder{ "UseChromeOSDirectVideoDecoder", base::FEATURE_ENABLED_BY_DEFAULT}; +// Limit the number of concurrent hardware decoder instances on ChromeOS. +const base::Feature kLimitConcurrentDecoderInstances{ + "LimitConcurrentDecoderInstances", base::FEATURE_ENABLED_BY_DEFAULT}; + #if defined(ARCH_CPU_ARM_FAMILY) // Some architectures have separate image processor hardware that // can be used by Chromium's ImageProcessor to color convert/crop/etc.
diff --git a/media/base/media_switches.h b/media/base/media_switches.h index 247bdae9..1c2e62f8 100644 --- a/media/base/media_switches.h +++ b/media/base/media_switches.h
@@ -237,6 +237,7 @@ #if BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) MEDIA_EXPORT extern const base::Feature kUseChromeOSDirectVideoDecoder; +MEDIA_EXPORT extern const base::Feature kLimitConcurrentDecoderInstances; #if defined(ARCH_CPU_ARM_FAMILY) MEDIA_EXPORT extern const base::Feature kPreferLibYuvImageProcessor; #endif // defined(ARCH_CPU_ARM_FAMILY)
diff --git a/media/capabilities/webrtc_video_stats_db_impl.h b/media/capabilities/webrtc_video_stats_db_impl.h index 3c48cc4..a41284a 100644 --- a/media/capabilities/webrtc_video_stats_db_impl.h +++ b/media/capabilities/webrtc_video_stats_db_impl.h
@@ -8,6 +8,7 @@ #include <memory> #include "base/files/file_path.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/metrics/field_trial_params.h" #include "base/time/time.h" @@ -142,7 +143,7 @@ // For getting wall-clock time. Tests may override via // set_wall_clock_for_test(). - const base::Clock* wall_clock_ = nullptr; + raw_ptr<const base::Clock> wall_clock_ = nullptr; // Ensures all access to class members come on the same sequence. API calls // and callbacks should occur on the same sequence used during construction.
diff --git a/media/cast/sender/frame_sender_impl.h b/media/cast/sender/frame_sender_impl.h index 41e3d8d1..9000837 100644 --- a/media/cast/sender/frame_sender_impl.h +++ b/media/cast/sender/frame_sender_impl.h
@@ -115,7 +115,7 @@ const raw_ptr<CastTransport> transport_sender_; // The frame sender client. - Client* client_ = nullptr; + raw_ptr<Client> client_ = nullptr; // Whether this is an audio or video frame sender. const bool is_audio_;
diff --git a/media/formats/hls/media_playlist_test_builder.h b/media/formats/hls/media_playlist_test_builder.h index 59d6719..9fb6ad1 100644 --- a/media/formats/hls/media_playlist_test_builder.h +++ b/media/formats/hls/media_playlist_test_builder.h
@@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/callback.h" #include "base/location.h" +#include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "media/formats/hls/media_playlist.h" #include "media/formats/hls/media_segment.h" @@ -74,7 +75,7 @@ void VerifyExpectations(const MediaPlaylist& playlist, const base::Location& from) const override; - const MultivariantPlaylist* parent_ = nullptr; + raw_ptr<const MultivariantPlaylist> parent_ = nullptr; std::vector<SegmentExpectations> segment_expectations_; };
diff --git a/media/formats/hls/playlist_common.h b/media/formats/hls/playlist_common.h index 07f5ad0..a6965ff 100644 --- a/media/formats/hls/playlist_common.h +++ b/media/formats/hls/playlist_common.h
@@ -7,6 +7,7 @@ #include <utility> +#include "base/memory/raw_ptr.h" #include "media/formats/hls/items.h" #include "media/formats/hls/tag_name.h" #include "media/formats/hls/tags.h" @@ -28,7 +29,7 @@ // The dictionary of variables defined in the parent playlist. This may remain // null if there is no parent playlist (in the case of a multivariant // playlist, or a media playlist without other variants). - const VariableDictionary* parent_variable_dict = nullptr; + raw_ptr<const VariableDictionary> parent_variable_dict = nullptr; // Returns the version specified by `version_tag`, or the default version if // the playlist did not contain a version tag.
diff --git a/media/gpu/h265_decoder_unittest.cc b/media/gpu/h265_decoder_unittest.cc index 70ef163..5b2c6ec 100644 --- a/media/gpu/h265_decoder_unittest.cc +++ b/media/gpu/h265_decoder_unittest.cc
@@ -10,6 +10,7 @@ #include "base/containers/queue.h" #include "base/containers/span.h" #include "base/files/file_util.h" +#include "base/memory/raw_ptr.h" #include "media/base/test_data_util.h" #include "media/gpu/h265_decoder.h" #include "testing/gmock/include/gmock/gmock.h" @@ -141,7 +142,7 @@ protected: std::unique_ptr<H265Decoder> decoder_; - MockH265Accelerator* accelerator_; + raw_ptr<MockH265Accelerator> accelerator_; private: base::queue<std::string> input_frame_files_;
diff --git a/media/gpu/v4l2/v4l2_video_decoder.cc b/media/gpu/v4l2/v4l2_video_decoder.cc index 7f4c9f2..3f0b0fd 100644 --- a/media/gpu/v4l2/v4l2_video_decoder.cc +++ b/media/gpu/v4l2/v4l2_video_decoder.cc
@@ -15,6 +15,7 @@ #include "base/trace_event/trace_event.h" #include "media/base/limits.h" #include "media/base/media_log.h" +#include "media/base/media_switches.h" #include "media/base/video_types.h" #include "media/base/video_util.h" #include "media/gpu/chromeos/chromeos_status.h" @@ -264,7 +265,9 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_sequence_checker_); DCHECK(state_ == State::kInitialized); - can_use_decoder_ = num_instances_.Increment() < kMaxNumOfInstances; + can_use_decoder_ = + num_instances_.Increment() < kMaxNumOfInstances || + !base::FeatureList::IsEnabled(media::kLimitConcurrentDecoderInstances); if (!can_use_decoder_) { VLOGF(1) << "Reached maximum number of decoder instances (" << kMaxNumOfInstances << ")";
diff --git a/media/gpu/vaapi/vaapi_video_decoder.cc b/media/gpu/vaapi/vaapi_video_decoder.cc index 6ece5c8..0ef047f7 100644 --- a/media/gpu/vaapi/vaapi_video_decoder.cc +++ b/media/gpu/vaapi/vaapi_video_decoder.cc
@@ -110,7 +110,8 @@ scoped_refptr<base::SequencedTaskRunner> decoder_task_runner, base::WeakPtr<VideoDecoderMixin::Client> client) { const bool can_create_decoder = - num_instances_.Increment() < kMaxNumOfInstances; + num_instances_.Increment() < kMaxNumOfInstances || + !base::FeatureList::IsEnabled(media::kLimitConcurrentDecoderInstances); if (!can_create_decoder) { num_instances_.Decrement(); return nullptr;
diff --git a/media/gpu/windows/d3d11_texture_wrapper_unittest.cc b/media/gpu/windows/d3d11_texture_wrapper_unittest.cc index 313de844..e5b4543 100644 --- a/media/gpu/windows/d3d11_texture_wrapper_unittest.cc +++ b/media/gpu/windows/d3d11_texture_wrapper_unittest.cc
@@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/callback_helpers.h" +#include "base/memory/raw_ptr.h" #include "base/task/single_thread_task_runner.h" #include "base/test/task_environment.h" #include "base/win/windows_version.h" @@ -84,7 +85,7 @@ scoped_refptr<FakeCommandBufferHelper> fake_command_buffer_helper_; GetCommandBufferHelperCB get_helper_cb_; - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; }; TEST_F(D3D11TextureWrapperUnittest, NV12InitSucceeds) {
diff --git a/media/mojo/services/mojo_audio_input_stream.cc b/media/mojo/services/mojo_audio_input_stream.cc index 75a3fd0..df9550d8 100644 --- a/media/mojo/services/mojo_audio_input_stream.cc +++ b/media/mojo/services/mojo_audio_input_stream.cc
@@ -96,11 +96,6 @@ initially_muted); } -void MojoAudioInputStream::OnMuted(int stream_id, bool is_muted) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - client_->OnMutedStateChanged(is_muted); -} - void MojoAudioInputStream::OnStreamError(int stream_id) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); client_->OnError(mojom::InputStreamErrorCode::kUnknown);
diff --git a/media/mojo/services/mojo_audio_input_stream.h b/media/mojo/services/mojo_audio_input_stream.h index 922e7e92..b4449d5c 100644 --- a/media/mojo/services/mojo_audio_input_stream.h +++ b/media/mojo/services/mojo_audio_input_stream.h
@@ -62,7 +62,6 @@ base::ReadOnlySharedMemoryRegion shared_memory_region, std::unique_ptr<base::CancelableSyncSocket> foreign_socket, bool initially_muted) override; - void OnMuted(int stream_id, bool is_muted) override; void OnStreamError(int stream_id) override; // Closes connection to client and notifies owner.
diff --git a/media/renderers/paint_canvas_video_renderer_unittest.cc b/media/renderers/paint_canvas_video_renderer_unittest.cc index fa81b71..08ba905 100644 --- a/media/renderers/paint_canvas_video_renderer_unittest.cc +++ b/media/renderers/paint_canvas_video_renderer_unittest.cc
@@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/logging.h" #include "base/memory/aligned_memory.h" +#include "base/memory/raw_ptr.h" #include "base/sys_byteorder.h" #include "base/test/task_environment.h" #include "build/build_config.h" @@ -1237,7 +1238,7 @@ PaintCanvasVideoRenderer renderer_; scoped_refptr<VideoFrame> cropped_frame_; base::test::TaskEnvironment task_environment_; - gl::GLDisplay* display_ = nullptr; + raw_ptr<gl::GLDisplay> display_ = nullptr; }; TEST_F(PaintCanvasVideoRendererWithGLTest, CopyVideoFrameYUVDataToGLTexture) {
diff --git a/media/renderers/win/media_foundation_texture_pool_unittest.cc b/media/renderers/win/media_foundation_texture_pool_unittest.cc index f4b7939..e776a25 100644 --- a/media/renderers/win/media_foundation_texture_pool_unittest.cc +++ b/media/renderers/win/media_foundation_texture_pool_unittest.cc
@@ -4,6 +4,7 @@ #include "media/renderers/win/media_foundation_texture_pool.h" +#include "base/memory/raw_ptr.h" #include "base/test/mock_callback.h" #include "base/test/task_environment.h" #include "media/base/mock_filters.h" @@ -83,7 +84,7 @@ SetPrivateDataInterface(REFGUID guid, const IUnknown* pData) override; private: - MockD3D11Texture2D* parent_; + raw_ptr<MockD3D11Texture2D> parent_; volatile ULONG refcount_ = 1; }; @@ -516,8 +517,8 @@ class SpecialCallback { private: - base::WaitableEvent* wait_event_; - gfx::Size* frame_size_; + raw_ptr<base::WaitableEvent> wait_event_; + raw_ptr<gfx::Size> frame_size_; public: SpecialCallback(base::WaitableEvent* wait_event, gfx::Size* frame_size)
diff --git a/media/video/gpu_memory_buffer_video_frame_pool_unittest.cc b/media/video/gpu_memory_buffer_video_frame_pool_unittest.cc index b619ccb..a42246b 100644 --- a/media/video/gpu_memory_buffer_video_frame_pool_unittest.cc +++ b/media/video/gpu_memory_buffer_video_frame_pool_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> #include "base/bind.h" +#include "base/memory/raw_ptr.h" #include "base/test/simple_test_tick_clock.h" #include "base/test/test_simple_task_runner.h" #include "base/threading/thread_task_runner_handle.h" @@ -237,10 +238,10 @@ static constexpr uint8_t kUValue = 50; static constexpr uint8_t kVValue = 150; - uint8_t* y_data_ = nullptr; - uint8_t* u_data_ = nullptr; - uint8_t* v_data_ = nullptr; - uint8_t* uv_data_ = nullptr; + raw_ptr<uint8_t> y_data_ = nullptr; + raw_ptr<uint8_t> u_data_ = nullptr; + raw_ptr<uint8_t> v_data_ = nullptr; + raw_ptr<uint8_t> uv_data_ = nullptr; base::SimpleTestTickClock test_clock_; std::unique_ptr<MockGpuVideoAcceleratorFactories> mock_gpu_factories_;
diff --git a/media/webrtc/audio_processor.cc b/media/webrtc/audio_processor.cc index 91e6bed8..586fea2 100644 --- a/media/webrtc/audio_processor.cc +++ b/media/webrtc/audio_processor.cc
@@ -249,6 +249,13 @@ DCHECK_EQ(output_format_.sample_rate() / 100, output_format_.frames_per_buffer()); } + if (input_format_.sample_rate() % 100 != 0 || + output_format_.sample_rate() % 100 != 0) { + SendLogMessage(base::StringPrintf( + "%s: WARNING: Sample rate not divisible by 100, processing is provided " + "on a best-effort basis. input rate=[%d], output rate=[%d]", + __func__, input_format_.sample_rate(), output_format_.sample_rate())); + } SendLogMessage(base::StringPrintf( "%s({input_format_=[%s], output_format_=[%s]})", __func__, input_format_.AsHumanReadableString().c_str(), @@ -548,11 +555,6 @@ return absl::nullopt; } - // The audio processor code assumes that sample rates are divisible by 100. - if (device_format.sample_rate() % 100 != 0) { - return absl::nullopt; - } - AudioParameters params( device_format.format(), channel_layout, device_format.sample_rate(), GetCaptureBufferSize(
diff --git a/media/webrtc/audio_processor.h b/media/webrtc/audio_processor.h index 7258c61..7186a2e5 100644 --- a/media/webrtc/audio_processor.h +++ b/media/webrtc/audio_processor.h
@@ -66,7 +66,9 @@ // |input_format| specifies the format of the incoming capture data. // |output_format| specifies the output format. If // |settings|.NeedWebrtcAudioProcessing() is true, then the output must be in - // 10 ms chunks. + // 10 ms chunks: the formats must specify |sample rate|/100 samples per buffer + // (rounded down). Sample rates which are not divisible by 100 are supported + // on a best-effort basis, audio quality and stability may suffer. static std::unique_ptr<AudioProcessor> Create( DeliverProcessedAudioCallback deliver_processed_audio_callback, LogCallback log_callback,
diff --git a/mojo/core/watcher_dispatcher.h b/mojo/core/watcher_dispatcher.h index 1dc31946..43542cb 100644 --- a/mojo/core/watcher_dispatcher.h +++ b/mojo/core/watcher_dispatcher.h
@@ -96,7 +96,7 @@ // an invalid object. It must therefore never be dereferenced. Use void* // instead of Watch* to enforce the intention to not dereference it. Don't use // raw_ptr<> as it could trip dangling pointer checks. - const void* last_watch_to_block_arming_ = nullptr; + raw_ptr<const void> last_watch_to_block_arming_ = nullptr; }; } // namespace core
diff --git a/mojo/public/cpp/bindings/array_data_view.h b/mojo/public/cpp/bindings/array_data_view.h index adfab0a..0c5b79a 100644 --- a/mojo/public/cpp/bindings/array_data_view.h +++ b/mojo/public/cpp/bindings/array_data_view.h
@@ -7,6 +7,7 @@ #include <type_traits> +#include "base/memory/raw_ptr.h" #include "base/memory/raw_ptr_exclusion.h" #include "mojo/public/cpp/bindings/lib/array_internal.h" #include "mojo/public/cpp/bindings/lib/bindings_internal.h" @@ -39,10 +40,10 @@ protected: // `data_` is not a raw_ptr<...> for performance reasons (based on analysis of // sampling profiler data). - RAW_PTR_EXCLUSION Data_* data_; + RAW_PTR_EXCLUSION raw_ptr<Data_> data_; // `message_` is not a raw_ptr<...> for performance reasons (based on analysis // of sampling profiler data). - RAW_PTR_EXCLUSION Message* message_; + RAW_PTR_EXCLUSION raw_ptr<Message> message_; }; template <typename T> @@ -61,10 +62,10 @@ protected: // `data_` is not a raw_ptr<...> for performance reasons (based on analysis of // sampling profiler data). - RAW_PTR_EXCLUSION Data_* data_; + RAW_PTR_EXCLUSION raw_ptr<Data_> data_; // `message_` is not a raw_ptr<...> for performance reasons (based on analysis // of sampling profiler data). - RAW_PTR_EXCLUSION Message* message_; + RAW_PTR_EXCLUSION raw_ptr<Message> message_; }; template <typename T> @@ -93,10 +94,10 @@ protected: // `data_` is not a raw_ptr<...> for performance reasons (based on analysis of // sampling profiler data). - RAW_PTR_EXCLUSION Data_* data_; + RAW_PTR_EXCLUSION raw_ptr<Data_> data_; // `message_` is not a raw_ptr<...> for performance reasons (based on analysis // of sampling profiler data). - RAW_PTR_EXCLUSION Message* message_; + RAW_PTR_EXCLUSION raw_ptr<Message> message_; }; template <typename T> @@ -125,10 +126,10 @@ protected: // `data_` is not a raw_ptr<...> for performance reasons (based on analysis of // sampling profiler data). - RAW_PTR_EXCLUSION Data_* data_; + RAW_PTR_EXCLUSION raw_ptr<Data_> data_; // `message_` is not a raw_ptr<...> for performance reasons (based on analysis // of sampling profiler data). - RAW_PTR_EXCLUSION Message* message_; + RAW_PTR_EXCLUSION raw_ptr<Message> message_; }; template <typename T> @@ -152,10 +153,10 @@ protected: // `data_` is not a raw_ptr<...> for performance reasons (based on analysis of // sampling profiler data). - RAW_PTR_EXCLUSION Data_* data_; + RAW_PTR_EXCLUSION raw_ptr<Data_> data_; // `message_` is not a raw_ptr<...> for performance reasons (based on analysis // of sampling profiler data). - RAW_PTR_EXCLUSION Message* message_; + RAW_PTR_EXCLUSION raw_ptr<Message> message_; }; template <typename T> @@ -184,10 +185,10 @@ protected: // `data_` is not a raw_ptr<...> for performance reasons (based on analysis of // sampling profiler data). - RAW_PTR_EXCLUSION Data_* data_; + RAW_PTR_EXCLUSION raw_ptr<Data_> data_; // `message_` is not a raw_ptr<...> for performance reasons (based on analysis // of sampling profiler data). - RAW_PTR_EXCLUSION Message* message_; + RAW_PTR_EXCLUSION raw_ptr<Message> message_; }; template <typename T> @@ -213,10 +214,10 @@ protected: // `data_` is not a raw_ptr<...> for performance reasons (based on analysis of // sampling profiler data). - RAW_PTR_EXCLUSION Data_* data_; + RAW_PTR_EXCLUSION raw_ptr<Data_> data_; // `message_` is not a raw_ptr<...> for performance reasons (based on analysis // of sampling profiler data). - RAW_PTR_EXCLUSION Message* message_; + RAW_PTR_EXCLUSION raw_ptr<Message> message_; }; } // namespace internal
diff --git a/mojo/public/cpp/bindings/lib/array_internal.h b/mojo/public/cpp/bindings/lib/array_internal.h index b0a2572..1390dcb 100644 --- a/mojo/public/cpp/bindings/lib/array_internal.h +++ b/mojo/public/cpp/bindings/lib/array_internal.h
@@ -13,6 +13,7 @@ #include "base/check.h" #include "base/component_export.h" +#include "base/memory/raw_ptr.h" #include "mojo/public/c/system/macros.h" #include "mojo/public/cpp/bindings/lib/bindings_internal.h" #include "mojo/public/cpp/bindings/lib/buffer.h" @@ -79,7 +80,7 @@ friend struct ArrayDataTraits<bool>; BitRef(uint8_t* storage, uint8_t mask); BitRef(); - uint8_t* storage_; + raw_ptr<uint8_t> storage_; uint8_t mask_; };
diff --git a/mojo/public/cpp/bindings/optional_as_pointer.h b/mojo/public/cpp/bindings/optional_as_pointer.h index 81617fe..a9c8c85 100644 --- a/mojo/public/cpp/bindings/optional_as_pointer.h +++ b/mojo/public/cpp/bindings/optional_as_pointer.h
@@ -7,6 +7,8 @@ #include <cstddef> +#include "base/memory/raw_ptr.h" + namespace mojo { // Simple wrapper around a pointer to allow zero-copy serialization of a @@ -56,7 +58,7 @@ template <typename U> friend class OptionalAsPointer; - T* value_ = nullptr; + raw_ptr<T> value_ = nullptr; }; // Type-deducing helpers for constructing a `OptionalAsPointer`.
diff --git a/mojo/public/cpp/bindings/string_data_view.h b/mojo/public/cpp/bindings/string_data_view.h index 71bbcf8..18dc605 100644 --- a/mojo/public/cpp/bindings/string_data_view.h +++ b/mojo/public/cpp/bindings/string_data_view.h
@@ -5,6 +5,7 @@ #ifndef MOJO_PUBLIC_CPP_BINDINGS_STRING_DATA_VIEW_H_ #define MOJO_PUBLIC_CPP_BINDINGS_STRING_DATA_VIEW_H_ +#include "base/memory/raw_ptr.h" #include "mojo/public/cpp/bindings/lib/array_internal.h" namespace mojo { @@ -25,7 +26,7 @@ size_t size() const { return data_->size(); } private: - internal::String_Data* data_ = nullptr; + raw_ptr<internal::String_Data> data_ = nullptr; }; } // namespace mojo
diff --git a/net/base/priority_queue.h b/net/base/priority_queue.h index b634a58..73cb6d72 100644 --- a/net/base/priority_queue.h +++ b/net/base/priority_queue.h
@@ -132,8 +132,7 @@ }; // Creates a new queue for |num_priorities|. - explicit PriorityQueue(Priority num_priorities) - : lists_(num_priorities), size_(0) { + explicit PriorityQueue(Priority num_priorities) : lists_(num_priorities) { #if !defined(NDEBUG) next_id_ = 0; #endif @@ -373,7 +372,7 @@ #endif ListVector lists_; - size_t size_; + size_t size_ = 0; THREAD_CHECKER(thread_checker_); };
diff --git a/net/cert/cert_verify_proc_builtin_unittest.cc b/net/cert/cert_verify_proc_builtin_unittest.cc index 74d4e600..bb7de88 100644 --- a/net/cert/cert_verify_proc_builtin_unittest.cc +++ b/net/cert/cert_verify_proc_builtin_unittest.cc
@@ -4,6 +4,7 @@ #include "net/cert/cert_verify_proc_builtin.h" +#include "base/memory/raw_ptr.h" #include "base/numerics/safe_conversions.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" @@ -184,7 +185,7 @@ CertVerifier::Config config_; std::unique_ptr<net::URLRequestContext> context_; - MockSystemTrustStore* mock_system_trust_store_; + raw_ptr<MockSystemTrustStore> mock_system_trust_store_; scoped_refptr<CertVerifyProc> verify_proc_; scoped_refptr<CertNetFetcherURLRequest> cert_net_fetcher_; };
diff --git a/net/cert/cert_verify_proc_unittest.cc b/net/cert/cert_verify_proc_unittest.cc index 18d1793..19608b63 100644 --- a/net/cert/cert_verify_proc_unittest.cc +++ b/net/cert/cert_verify_proc_unittest.cc
@@ -12,6 +12,7 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/logging.h" +#include "base/memory/raw_ptr.h" #include "base/message_loop/message_pump_type.h" #include "base/rand_util.h" #include "base/strings/string_number_conversions.h" @@ -4862,7 +4863,7 @@ struct { std::string expected_suffix; bool known_root; - X509Certificate* root_cert; + raw_ptr<X509Certificate> root_cert; } root_cases[] = { {"PrivateRoot", false, nullptr}, {"PrivateRoot", false, root.get()},
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc index 02ed485..2f45685 100644 --- a/net/disk_cache/simple/simple_synchronous_entry.cc +++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -15,6 +15,7 @@ #include "base/hash/hash.h" #include "base/location.h" #include "base/memory/ptr_util.h" +#include "base/memory/raw_ptr.h" #include "base/metrics/field_trial_params.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros_local.h" @@ -204,7 +205,7 @@ } private: - SimpleSynchronousEntry* const owner_; + const raw_ptr<SimpleSynchronousEntry> owner_; std::unique_ptr<BackendFileOperations> file_operations_; };
diff --git a/net/dns/address_info.h b/net/dns/address_info.h index 23d68f5..f7eba24 100644 --- a/net/dns/address_info.h +++ b/net/dns/address_info.h
@@ -9,6 +9,7 @@ #include <string> #include <tuple> +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "net/base/address_family.h" #include "net/base/net_export.h" @@ -45,7 +46,7 @@ private: // Owned by AddressInfo. - const addrinfo* ai_; + raw_ptr<const addrinfo> ai_; }; // Constructors
diff --git a/net/http/bidirectional_stream_request_info.cc b/net/http/bidirectional_stream_request_info.cc index 18d9ba7b..2b8cabf 100644 --- a/net/http/bidirectional_stream_request_info.cc +++ b/net/http/bidirectional_stream_request_info.cc
@@ -6,11 +6,7 @@ namespace net { -BidirectionalStreamRequestInfo::BidirectionalStreamRequestInfo() - : allow_early_data_override(false), - priority(LOW), - end_stream_on_headers(false), - detect_broken_connection(false) {} +BidirectionalStreamRequestInfo::BidirectionalStreamRequestInfo() = default; BidirectionalStreamRequestInfo::~BidirectionalStreamRequestInfo() = default;
diff --git a/net/http/bidirectional_stream_request_info.h b/net/http/bidirectional_stream_request_info.h index 2ed8a22..51c75ec 100644 --- a/net/http/bidirectional_stream_request_info.h +++ b/net/http/bidirectional_stream_request_info.h
@@ -29,10 +29,10 @@ // Whether to allow early data to be used with this request, overriding the // early data based on the |method| semantics. - bool allow_early_data_override; + bool allow_early_data_override = false; // Request priority. - RequestPriority priority; + RequestPriority priority = LOW; // Socket tag to apply to sockets used to process this request. SocketTag socket_tag; @@ -41,11 +41,11 @@ HttpRequestHeaders extra_headers; // Whether END_STREAM should be set on the request HEADER frame. - bool end_stream_on_headers; + bool end_stream_on_headers = false; // Whether the implementor of the BidirectionalStream should monitor // the status of the connection for the lifetime of this stream. - bool detect_broken_connection; + bool detect_broken_connection = false; // Suggests the period the broken connection detector should use to check // the status of the connection.
diff --git a/net/http/broken_alternative_services.cc b/net/http/broken_alternative_services.cc index 9bde04d..8652775 100644 --- a/net/http/broken_alternative_services.cc +++ b/net/http/broken_alternative_services.cc
@@ -82,8 +82,7 @@ clock_(clock), recently_broken_alternative_services_( max_recently_broken_alternative_service_entries), - initial_delay_(kDefaultBrokenAlternativeProtocolDelay), - exponential_backoff_on_initial_delay_(true) { + initial_delay_(kDefaultBrokenAlternativeProtocolDelay) { DCHECK(delegate_); DCHECK(clock_); }
diff --git a/net/http/broken_alternative_services.h b/net/http/broken_alternative_services.h index 56c8dfd..72a36cbd 100644 --- a/net/http/broken_alternative_services.h +++ b/net/http/broken_alternative_services.h
@@ -229,7 +229,7 @@ // initial_delay_for_broken_alternative_service * (1 << broken_count). // Otherwise, the delay would be initial_delay_for_broken_alternative_service, // 5min, 10min.. and so on. - bool exponential_backoff_on_initial_delay_; + bool exponential_backoff_on_initial_delay_ = true; base::WeakPtrFactory<BrokenAlternativeServices> weak_ptr_factory_{this}; };
diff --git a/net/http/http_auth.cc b/net/http/http_auth.cc index bd9cbc1e..55240b5 100644 --- a/net/http/http_auth.cc +++ b/net/http/http_auth.cc
@@ -29,7 +29,7 @@ kSpdyProxyAuthScheme, kMockAuthScheme}; } // namespace -HttpAuth::Identity::Identity() : source(IDENT_SRC_NONE), invalid(true) {} +HttpAuth::Identity::Identity() = default; // static void HttpAuth::ChooseBestChallenge(
diff --git a/net/http/http_auth.h b/net/http/http_auth.h index 4a0f3b8..319d2d3 100644 --- a/net/http/http_auth.h +++ b/net/http/http_auth.h
@@ -128,8 +128,8 @@ struct Identity { Identity(); - IdentitySource source; - bool invalid; + IdentitySource source = IDENT_SRC_NONE; + bool invalid = true; AuthCredentials credentials; };
diff --git a/net/http/http_auth_cache.cc b/net/http/http_auth_cache.cc index bbcb979..81f82ea 100644 --- a/net/http/http_auth_cache.cc +++ b/net/http/http_auth_cache.cc
@@ -236,10 +236,7 @@ return true; } -HttpAuthCache::Entry::Entry() - : scheme_(HttpAuth::AUTH_SCHEME_MAX), - nonce_count_(0) { -} +HttpAuthCache::Entry::Entry() = default; void HttpAuthCache::Entry::AddPath(const std::string& path) { std::string parent_dir = GetParentDirectory(path);
diff --git a/net/http/http_auth_cache.h b/net/http/http_auth_cache.h index ef75a94..030de45 100644 --- a/net/http/http_auth_cache.h +++ b/net/http/http_auth_cache.h
@@ -98,13 +98,13 @@ // SchemeHostPort of the server. url::SchemeHostPort scheme_host_port_; std::string realm_; - HttpAuth::Scheme scheme_; + HttpAuth::Scheme scheme_ = HttpAuth::AUTH_SCHEME_MAX; // Identity. std::string auth_challenge_; AuthCredentials credentials_; - int nonce_count_; + int nonce_count_ = 0; // List of paths that define the realm's protection space. PathList paths_;
diff --git a/net/http/http_auth_controller.cc b/net/http/http_auth_controller.cc index 1395b59d..576cfb1 100644 --- a/net/http/http_auth_controller.cc +++ b/net/http/http_auth_controller.cc
@@ -52,8 +52,6 @@ auth_scheme_host_port_(auth_url), auth_path_(auth_url.path()), network_isolation_key_(network_isolation_key), - embedded_identity_used_(false), - default_credentials_used_(false), http_auth_cache_(http_auth_cache), http_auth_handler_factory_(http_auth_handler_factory), host_resolver_(host_resolver) {
diff --git a/net/http/http_auth_controller.h b/net/http/http_auth_controller.h index 5d9b4b0..6b346bd1 100644 --- a/net/http/http_auth_controller.h +++ b/net/http/http_auth_controller.h
@@ -226,11 +226,11 @@ // True if we've used the username:password embedded in the URL. This // makes sure we use the embedded identity only once for the transaction, // preventing an infinite auth restart loop. - bool embedded_identity_used_; + bool embedded_identity_used_ = false; // True if default credentials have already been tried for this transaction // in response to an HTTP authentication challenge. - bool default_credentials_used_; + bool default_credentials_used_ = false; // These two are owned by the HttpNetworkSession/IOThread, which own the // objects which reference |this|. Therefore, these raw pointers are valid
diff --git a/net/http/http_auth_handler.cc b/net/http/http_auth_handler.cc index 8218785..eb138c8 100644 --- a/net/http/http_auth_handler.cc +++ b/net/http/http_auth_handler.cc
@@ -16,12 +16,7 @@ namespace net { -HttpAuthHandler::HttpAuthHandler() - : auth_scheme_(HttpAuth::AUTH_SCHEME_MAX), - score_(-1), - target_(HttpAuth::AUTH_NONE), - properties_(-1) { -} +HttpAuthHandler::HttpAuthHandler() = default; HttpAuthHandler::~HttpAuthHandler() = default;
diff --git a/net/http/http_auth_handler.h b/net/http/http_auth_handler.h index b0b4de8..5348b90c 100644 --- a/net/http/http_auth_handler.h +++ b/net/http/http_auth_handler.h
@@ -208,7 +208,7 @@ HttpAuthChallengeTokenizer* challenge) = 0; // The auth-scheme as an enumerated value. - HttpAuth::Scheme auth_scheme_; + HttpAuth::Scheme auth_scheme_ = HttpAuth::AUTH_SCHEME_MAX; // The realm, encoded as UTF-8. Used by "basic" and "digest". std::string realm_; @@ -221,14 +221,14 @@ url::SchemeHostPort scheme_host_port_; // The score for this challenge. Higher numbers are better. - int score_; + int score_ = -1; // Whether this authentication request is for a proxy server, or an // origin server. - HttpAuth::Target target_; + HttpAuth::Target target_ = HttpAuth::AUTH_NONE; // A bitmask of the properties of the authentication scheme. - int properties_; + int properties_ = -1; private: void OnGenerateAuthTokenComplete(int rv);
diff --git a/net/http/http_auth_handler_digest.cc b/net/http/http_auth_handler_digest.cc index c0a0905..0557b3d 100644 --- a/net/http/http_auth_handler_digest.cc +++ b/net/http/http_auth_handler_digest.cc
@@ -167,12 +167,9 @@ } HttpAuthHandlerDigest::HttpAuthHandlerDigest( - int nonce_count, const NonceGenerator* nonce_generator) - : stale_(false), - algorithm_(ALGORITHM_UNSPECIFIED), - qop_(QOP_UNSPECIFIED), - nonce_count_(nonce_count), - nonce_generator_(nonce_generator) { + int nonce_count, + const NonceGenerator* nonce_generator) + : nonce_count_(nonce_count), nonce_generator_(nonce_generator) { DCHECK(nonce_generator_); }
diff --git a/net/http/http_auth_handler_digest.h b/net/http/http_auth_handler_digest.h index dad4683..a170f7a 100644 --- a/net/http/http_auth_handler_digest.h +++ b/net/http/http_auth_handler_digest.h
@@ -174,9 +174,9 @@ std::string nonce_; std::string domain_; std::string opaque_; - bool stale_; - DigestAlgorithm algorithm_; - QualityOfProtection qop_; + bool stale_ = false; + DigestAlgorithm algorithm_ = ALGORITHM_UNSPECIFIED; + QualityOfProtection qop_ = QOP_UNSPECIFIED; // The realm as initially encoded over-the-wire. This is used in the // challenge text, rather than |realm_| which has been converted to
diff --git a/net/http/http_auth_handler_mock.cc b/net/http/http_auth_handler_mock.cc index 0e7fb96c..9e76f02 100644 --- a/net/http/http_auth_handler_mock.cc +++ b/net/http/http_auth_handler_mock.cc
@@ -41,15 +41,7 @@ } } -HttpAuthHandlerMock::HttpAuthHandlerMock() - : state_(State::WAIT_FOR_INIT), - generate_async_(false), - generate_rv_(OK), - auth_token_(nullptr), - first_round_(true), - connection_based_(false), - allows_default_credentials_(false), - allows_explicit_credentials_(true) {} +HttpAuthHandlerMock::HttpAuthHandlerMock() = default; HttpAuthHandlerMock::~HttpAuthHandlerMock() = default; @@ -147,8 +139,7 @@ std::move(callback_).Run(generate_rv_); } -HttpAuthHandlerMock::Factory::Factory() - : do_init_from_challenge_(false) { +HttpAuthHandlerMock::Factory::Factory() { // TODO(cbentzel): Default do_init_from_challenge_ to true. }
diff --git a/net/http/http_auth_handler_mock.h b/net/http/http_auth_handler_mock.h index b98a924..ef2be2f 100644 --- a/net/http/http_auth_handler_mock.h +++ b/net/http/http_auth_handler_mock.h
@@ -13,6 +13,7 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "net/base/completion_once_callback.h" +#include "net/base/net_errors.h" #include "net/http/http_auth_handler.h" #include "net/http/http_auth_handler_factory.h" #include "url/gurl.h" @@ -62,7 +63,7 @@ private: std::vector<std::unique_ptr<HttpAuthHandler>> handlers_[HttpAuth::AUTH_NUM_TARGETS]; - bool do_init_from_challenge_; + bool do_init_from_challenge_ = false; }; HttpAuthHandlerMock(); @@ -108,15 +109,15 @@ private: void OnGenerateAuthToken(); - State state_; + State state_ = State::WAIT_FOR_INIT; CompletionOnceCallback callback_; - bool generate_async_; - int generate_rv_; - raw_ptr<std::string> auth_token_; - bool first_round_; - bool connection_based_; - bool allows_default_credentials_; - bool allows_explicit_credentials_; + bool generate_async_ = false; + int generate_rv_ = OK; + raw_ptr<std::string> auth_token_ = nullptr; + bool first_round_ = true; + bool connection_based_ = false; + bool allows_default_credentials_ = false; + bool allows_explicit_credentials_ = true; GURL request_url_; base::WeakPtrFactory<HttpAuthHandlerMock> weak_factory_{this}; };
diff --git a/net/http/http_auth_handler_negotiate.cc b/net/http/http_auth_handler_negotiate.cc index 73d2b471..df30c4f0 100644 --- a/net/http/http_auth_handler_negotiate.cc +++ b/net/http/http_auth_handler_negotiate.cc
@@ -150,10 +150,7 @@ HostResolver* resolver) : auth_system_(std::move(auth_system)), resolver_(resolver), - already_called_(false), - has_credentials_(false), auth_token_(nullptr), - next_state_(STATE_NONE), http_auth_preferences_(prefs) {} HttpAuthHandlerNegotiate::~HttpAuthHandlerNegotiate() = default;
diff --git a/net/http/http_auth_handler_negotiate.h b/net/http/http_auth_handler_negotiate.h index ed0551f..687f4c97 100644 --- a/net/http/http_auth_handler_negotiate.h +++ b/net/http/http_auth_handler_negotiate.h
@@ -141,8 +141,8 @@ std::unique_ptr<HostResolver::ResolveHostRequest> resolve_host_request_; // Things which should be consistent after first call to GenerateAuthToken. - bool already_called_; - bool has_credentials_; + bool already_called_ = false; + bool has_credentials_ = false; AuthCredentials credentials_; std::string spn_; std::string channel_bindings_; @@ -151,7 +151,7 @@ CompletionOnceCallback callback_; raw_ptr<std::string> auth_token_; - State next_state_; + State next_state_ = STATE_NONE; raw_ptr<const HttpAuthPreferences> http_auth_preferences_; };
diff --git a/net/http/http_byte_range.cc b/net/http/http_byte_range.cc index 30a5d72..95a4678 100644 --- a/net/http/http_byte_range.cc +++ b/net/http/http_byte_range.cc
@@ -20,9 +20,7 @@ HttpByteRange::HttpByteRange() : first_byte_position_(kPositionNotSpecified), last_byte_position_(kPositionNotSpecified), - suffix_length_(kPositionNotSpecified), - has_computed_bounds_(false) { -} + suffix_length_(kPositionNotSpecified) {} // static HttpByteRange HttpByteRange::Bounded(int64_t first_byte_position,
diff --git a/net/http/http_byte_range.h b/net/http/http_byte_range.h index f831874..5b6a76c 100644 --- a/net/http/http_byte_range.h +++ b/net/http/http_byte_range.h
@@ -64,7 +64,7 @@ int64_t first_byte_position_; int64_t last_byte_position_; int64_t suffix_length_; - bool has_computed_bounds_; + bool has_computed_bounds_ = false; }; } // namespace net
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index a07c10ea..9515e6f 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc
@@ -155,12 +155,11 @@ // This structure keeps track of work items that are attempting to create or // open cache entries or the backend itself. struct HttpCache::PendingOp { - PendingOp() - : entry(nullptr), entry_opened(false), callback_will_delete(false) {} + PendingOp() = default; ~PendingOp() = default; - raw_ptr<disk_cache::Entry> entry; - bool entry_opened; // rather than created. + raw_ptr<disk_cache::Entry> entry = nullptr; + bool entry_opened = false; // rather than created. std::unique_ptr<disk_cache::Backend> backend; std::unique_ptr<WorkItem> writer; @@ -168,7 +167,7 @@ // |this| without removing it from |pending_ops_|. Note that since // OnPendingOpComplete() is static, it will not get cancelled when HttpCache // is destroyed. - bool callback_will_delete; + bool callback_will_delete = false; WorkItemList pending_queue; }; @@ -241,11 +240,7 @@ std::unique_ptr<BackendFactory> backend_factory) : net_log_(nullptr), backend_factory_(std::move(backend_factory)), - building_backend_(false), - bypass_lock_for_test_(false), - bypass_lock_after_headers_for_test_(false), - fail_conditionalization_for_test_(false), - mode_(NORMAL), + network_layer_(std::move(network_layer)), clock_(base::DefaultClock::GetInstance()) { g_init_cache = true;
diff --git a/net/http/http_cache.h b/net/http/http_cache.h index 6900f71..c97adfe 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h
@@ -656,12 +656,12 @@ // Used when lazily constructing the disk_cache_. std::unique_ptr<BackendFactory> backend_factory_; - bool building_backend_; - bool bypass_lock_for_test_; - bool bypass_lock_after_headers_for_test_; - bool fail_conditionalization_for_test_; + bool building_backend_ = false; + bool bypass_lock_for_test_ = false; + bool bypass_lock_after_headers_for_test_ = false; + bool fail_conditionalization_for_test_ = false; - Mode mode_; + Mode mode_ = NORMAL; std::unique_ptr<HttpTransactionFactory> network_layer_;
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc index bf3a760..62ef5e0 100644 --- a/net/http/http_cache_transaction.cc +++ b/net/http/http_cache_transaction.cc
@@ -166,34 +166,9 @@ priority_(priority), cache_(cache->GetWeakPtr()), entry_(nullptr), - new_entry_(nullptr), new_response_(nullptr), - mode_(NONE), - reading_(false), - invalid_range_(false), - truncated_(false), - is_sparse_(false), - range_requested_(false), - handling_206_(false), - cache_pending_(false), - done_headers_create_new_entry_(false), - vary_mismatch_(false), - couldnt_conditionalize_request_(false), - bypass_lock_for_test_(false), - bypass_lock_after_headers_for_test_(false), - fail_conditionalization_for_test_(false), - read_buf_len_(0), - io_buf_len_(0), - read_offset_(0), - effective_load_flags_(0), - shared_writing_error_(OK), - cache_entry_status_(CacheEntryStatus::ENTRY_UNDEFINED), - validation_cause_(VALIDATION_CAUSE_UNDEFINED), - recorded_histograms_(false), - moved_network_transaction_to_writers_(false), - websocket_handshake_stream_base_create_helper_(nullptr), - in_do_loop_(false) { - TRACE_EVENT1("io", "HttpCacheTransaction::Transaction", "priority", + websocket_handshake_stream_base_create_helper_(nullptr) { + TRACE_EVENT1("net", "HttpCacheTransaction::Transaction", "priority", RequestPriorityToString(priority)); static_assert(HttpCache::Transaction::kNumValidationHeaders == std::size(kValidationHeaders), @@ -204,7 +179,7 @@ } HttpCache::Transaction::~Transaction() { - TRACE_EVENT0("io", "HttpCacheTransaction::~Transaction"); + TRACE_EVENT0("net", "HttpCacheTransaction::~Transaction"); RecordHistograms(); // We may have to issue another IO, but we should never invoke the callback_ @@ -242,9 +217,9 @@ const NetLogWithSource& net_log) { DCHECK(request); DCHECK(!callback.is_null()); - TRACE_EVENT_WITH_FLOW1("io", "HttpCacheTransaction::Start", + TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::Start", net_log.source().id, TRACE_EVENT_FLAG_FLOW_OUT, "url", - request->url); + request->url.spec()); // Ensure that we only have one asynchronous call at a time. DCHECK(callback_.is_null()); @@ -641,10 +616,10 @@ } void HttpCache::Transaction::WriterAboutToBeRemovedFromEntry(int result) { - TRACE_EVENT_WITH_FLOW0( - "io", "HttpCacheTransaction::WriterAboutToBeRemovedFromEntry", + TRACE_EVENT_WITH_FLOW1( + "net", "HttpCacheTransaction::WriterAboutToBeRemovedFromEntry", net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); // Since the transaction can no longer access the network transaction, save // all network related info now. if (moved_network_transaction_to_writers_ && @@ -664,7 +639,7 @@ void HttpCache::Transaction::WriteModeTransactionAboutToBecomeReader() { TRACE_EVENT_WITH_FLOW0( - "io", "HttpCacheTransaction::WriteModeTransactionAboutToBecomeReader", + "net", "HttpCacheTransaction::WriteModeTransactionAboutToBecomeReader", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); mode_ = READ; @@ -1125,7 +1100,7 @@ } int HttpCache::Transaction::DoInitEntry() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoInitEntry", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoInitEntry", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(!new_entry_); @@ -1145,7 +1120,7 @@ } int HttpCache::Transaction::DoOpenOrCreateEntry() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoOpenOrCreateEntry", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoOpenOrCreateEntry", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(!new_entry_); @@ -1205,10 +1180,11 @@ } int HttpCache::Transaction::DoOpenOrCreateEntryComplete(int result) { - TRACE_EVENT_WITH_FLOW0("io", - "HttpCacheTransaction::DoOpenOrCreateEntryComplete", - net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_WITH_FLOW1( + "net", "HttpCacheTransaction::DoOpenOrCreateEntryComplete", + net_log().source().id, + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", + (result == OK ? (new_entry_->opened ? "opened" : "created") : "failed")); const bool record_uma = record_entry_open_or_creation_time_ && cache_ && @@ -1295,7 +1271,7 @@ } int HttpCache::Transaction::DoDoomEntry() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoDoomEntry", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoDoomEntry", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); TransitionToState(STATE_DOOM_ENTRY_COMPLETE); @@ -1307,9 +1283,9 @@ } int HttpCache::Transaction::DoDoomEntryComplete(int result) { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoDoomEntryComplete", - net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_WITH_FLOW1( + "net", "HttpCacheTransaction::DoDoomEntryComplete", net_log().source().id, + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); net_log_.EndEventWithNetErrorCode(NetLogEventType::HTTP_CACHE_DOOM_ENTRY, result); cache_pending_ = false; @@ -1320,7 +1296,7 @@ } int HttpCache::Transaction::DoCreateEntry() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoCreateEntry", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoCreateEntry", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(!new_entry_); @@ -1331,9 +1307,10 @@ } int HttpCache::Transaction::DoCreateEntryComplete(int result) { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoCreateEntryComplete", + TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoCreateEntryComplete", net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, + "result", result); // It is important that we go to STATE_ADD_TO_ENTRY whenever the result is // OK, otherwise the cache will end up with an active entry without any // transaction attached. @@ -1373,7 +1350,7 @@ } int HttpCache::Transaction::DoAddToEntry() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoAddToEntry", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoAddToEntry", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(new_entry_); @@ -1449,9 +1426,10 @@ } int HttpCache::Transaction::DoAddToEntryComplete(int result) { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoAddToEntryComplete", + TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoAddToEntryComplete", net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, + "result", result); net_log_.EndEventWithNetErrorCode(NetLogEventType::HTTP_CACHE_ADD_TO_ENTRY, result); const base::TimeDelta entry_lock_wait = @@ -1515,6 +1493,10 @@ } int HttpCache::Transaction::DoDoneHeadersAddToEntryComplete(int result) { + TRACE_EVENT_WITH_FLOW1( + "net", "HttpCacheTransaction::DoDoneHeadersAddToEntryComplete", + net_log().source().id, + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); // This transaction's response headers did not match its ActiveEntry so it // created a new ActiveEntry (new_entry_) to write to (and doomed the old // one). Now that the new entry has been created, start writing the response. @@ -1543,7 +1525,7 @@ } int HttpCache::Transaction::DoCacheReadResponse() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoCacheReadResponse", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoCacheReadResponse", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(entry_); @@ -1558,10 +1540,11 @@ } int HttpCache::Transaction::DoCacheReadResponseComplete(int result) { - TRACE_EVENT_WITH_FLOW0("io", + TRACE_EVENT_WITH_FLOW2("net", "HttpCacheTransaction::DoCacheReadResponseComplete", net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, + "result", result, "io_buf_len", io_buf_len_); net_log_.EndEventWithNetErrorCode(NetLogEventType::HTTP_CACHE_READ_INFO, result); @@ -1660,7 +1643,7 @@ int HttpCache::Transaction::DoCacheWriteUpdatedPrefetchResponse(int result) { TRACE_EVENT_WITH_FLOW0( - "io", "HttpCacheTransaction::DoCacheWriteUpdatedPrefetchResponse", + "net", "HttpCacheTransaction::DoCacheWriteUpdatedPrefetchResponse", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(updated_prefetch_response_); @@ -1674,7 +1657,8 @@ int HttpCache::Transaction::DoCacheWriteUpdatedPrefetchResponseComplete( int result) { TRACE_EVENT_WITH_FLOW0( - "io", "HttpCacheTransaction::DoCacheWriteUpdatedPrefetchResponseComplete", + "net", + "HttpCacheTransaction::DoCacheWriteUpdatedPrefetchResponseComplete", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); updated_prefetch_response_.reset(); @@ -1683,7 +1667,7 @@ } int HttpCache::Transaction::DoCacheDispatchValidation() { - TRACE_EVENT_WITH_FLOW0("io", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoCacheDispatchValidation", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); @@ -1779,7 +1763,7 @@ int HttpCache::Transaction::DoCacheUpdateStaleWhileRevalidateTimeout() { TRACE_EVENT_WITH_FLOW0( - "io", "HttpCacheTransaction::DoCacheUpdateStaleWhileRevalidateTimeout", + "net", "HttpCacheTransaction::DoCacheUpdateStaleWhileRevalidateTimeout", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); response_.stale_revalidate_timeout = @@ -1791,7 +1775,7 @@ int HttpCache::Transaction::DoCacheUpdateStaleWhileRevalidateTimeoutComplete( int result) { TRACE_EVENT_WITH_FLOW0( - "io", + "net", "HttpCacheTransaction::DoCacheUpdateStaleWhileRevalidateTimeoutComplete", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); @@ -1801,7 +1785,7 @@ } int HttpCache::Transaction::DoSendRequest() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoSendRequest", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoSendRequest", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(mode_ & WRITE || mode_ == NONE); @@ -1840,9 +1824,10 @@ } int HttpCache::Transaction::DoSendRequestComplete(int result) { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoSendRequestComplete", + TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoSendRequestComplete", net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, + "result", result); if (!cache_.get()) { TransitionToState(STATE_FINISH_HEADERS); return ERR_UNEXPECTED; @@ -1887,7 +1872,7 @@ // We received the response headers and there is no error. int HttpCache::Transaction::DoSuccessfulSendRequest() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoSuccessfulSendRequest", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoSuccessfulSendRequest", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(!new_response_); @@ -2014,7 +1999,7 @@ // We received 304 or 206 and we want to update the cached response headers. int HttpCache::Transaction::DoUpdateCachedResponse() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoUpdateCachedResponse", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoUpdateCachedResponse", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); int rv = OK; @@ -2071,7 +2056,7 @@ } int HttpCache::Transaction::DoCacheWriteUpdatedResponse() { - TRACE_EVENT_WITH_FLOW0("io", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoCacheWriteUpdatedResponse", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); @@ -2081,7 +2066,7 @@ int HttpCache::Transaction::DoCacheWriteUpdatedResponseComplete(int result) { TRACE_EVENT_WITH_FLOW0( - "io", "HttpCacheTransaction::DoCacheWriteUpdatedResponseComplete", + "net", "HttpCacheTransaction::DoCacheWriteUpdatedResponseComplete", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); TransitionToState(STATE_UPDATE_CACHED_RESPONSE_COMPLETE); @@ -2089,10 +2074,10 @@ } int HttpCache::Transaction::DoUpdateCachedResponseComplete(int result) { - TRACE_EVENT_WITH_FLOW0("io", - "HttpCacheTransaction::DoUpdateCachedResponseComplete", - net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_WITH_FLOW1( + "net", "HttpCacheTransaction::DoUpdateCachedResponseComplete", + net_log().source().id, + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); if (mode_ == UPDATE) { DCHECK(!handling_206_); // We got a "not modified" response and already updated the corresponding @@ -2128,7 +2113,7 @@ } int HttpCache::Transaction::DoOverwriteCachedResponse() { - TRACE_EVENT_WITH_FLOW0("io", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoOverwriteCachedResponse", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); @@ -2171,7 +2156,7 @@ } int HttpCache::Transaction::DoCacheWriteResponse() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoCacheWriteResponse", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoCacheWriteResponse", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(response_.headers); @@ -2206,16 +2191,16 @@ } int HttpCache::Transaction::DoCacheWriteResponseComplete(int result) { - TRACE_EVENT_WITH_FLOW0("io", - "HttpCacheTransaction::DoCacheWriteResponseComplete", - net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_WITH_FLOW1( + "net", "HttpCacheTransaction::DoCacheWriteResponseComplete", + net_log().source().id, + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); TransitionToState(STATE_TRUNCATE_CACHED_DATA); return OnWriteResponseInfoToEntryComplete(result); } int HttpCache::Transaction::DoTruncateCachedData() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoTruncateCachedData", + TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoTruncateCachedData", net_log().source().id, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); TransitionToState(STATE_TRUNCATE_CACHED_DATA_COMPLETE); @@ -2229,10 +2214,10 @@ } int HttpCache::Transaction::DoTruncateCachedDataComplete(int result) { - TRACE_EVENT_WITH_FLOW0("io", - "HttpCacheTransaction::DoTruncateCachedDataComplete", - net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_WITH_FLOW1( + "net", "HttpCacheTransaction::DoTruncateCachedDataComplete", + net_log().source().id, + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); if (entry_) { net_log_.EndEventWithNetErrorCode(NetLogEventType::HTTP_CACHE_WRITE_DATA, result); @@ -2283,9 +2268,9 @@ } int HttpCache::Transaction::DoFinishHeaders(int result) { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoFinishHeaders", - net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_WITH_FLOW1( + "net", "HttpCacheTransaction::DoFinishHeaders", net_log().source().id, + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); if (!cache_.get() || !entry_ || result != OK) { TransitionToState(STATE_NONE); return result; @@ -2316,9 +2301,10 @@ } int HttpCache::Transaction::DoFinishHeadersComplete(int rv) { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoFinishHeadersComplete", + TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoFinishHeadersComplete", net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, + "result", rv); entry_lock_waiting_since_ = TimeTicks(); if (rv == ERR_CACHE_RACE || rv == ERR_CACHE_LOCK_TIMEOUT) { TransitionToState(STATE_HEADERS_PHASE_CANNOT_PROCEED); @@ -2344,19 +2330,21 @@ } int HttpCache::Transaction::DoNetworkReadCacheWrite() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoNetworkReadCacheWrite", + TRACE_EVENT_WITH_FLOW2("net", "HttpCacheTransaction::DoNetworkReadCacheWrite", net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, + "read_offset", read_offset_, "read_buf_len", + read_buf_len_); DCHECK(InWriters()); TransitionToState(STATE_NETWORK_READ_CACHE_WRITE_COMPLETE); return entry_->writers->Read(read_buf_, read_buf_len_, io_callback_, this); } int HttpCache::Transaction::DoNetworkReadCacheWriteComplete(int result) { - TRACE_EVENT_WITH_FLOW0( - "io", "HttpCacheTransaction::DoNetworkReadCacheWriteComplete", + TRACE_EVENT_WITH_FLOW1( + "net", "HttpCacheTransaction::DoNetworkReadCacheWriteComplete", net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); if (!cache_.get()) { TransitionToState(STATE_NONE); return ERR_UNEXPECTED; @@ -2425,17 +2413,19 @@ } int HttpCache::Transaction::DoNetworkRead() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoNetworkRead", - net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_WITH_FLOW2( + "net", "HttpCacheTransaction::DoNetworkRead", net_log().source().id, + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "read_offset", + read_offset_, "read_buf_len", read_buf_len_); TransitionToState(STATE_NETWORK_READ_COMPLETE); return network_trans_->Read(read_buf_.get(), read_buf_len_, io_callback_); } int HttpCache::Transaction::DoNetworkReadComplete(int result) { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoNetworkReadComplete", + TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoNetworkReadComplete", net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, + "result", result); if (!cache_.get()) { TransitionToState(STATE_NONE); @@ -2450,9 +2440,10 @@ } int HttpCache::Transaction::DoCacheReadData() { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoCacheReadData", - net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_WITH_FLOW2( + "net", "HttpCacheTransaction::DoCacheReadData", net_log().source().id, + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "read_offset", + read_offset_, "read_buf_len", read_buf_len_); if (method_ == "HEAD") { TransitionToState(STATE_NONE); @@ -2474,9 +2465,10 @@ } int HttpCache::Transaction::DoCacheReadDataComplete(int result) { - TRACE_EVENT_WITH_FLOW0("io", "HttpCacheTransaction::DoCacheReadDataComplete", + TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoCacheReadDataComplete", net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, + "result", result); net_log_.EndEventWithNetErrorCode(NetLogEventType::HTTP_CACHE_READ_DATA, result);
diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h index 214837fb..647f265 100644 --- a/net/http/http_cache_transaction.h +++ b/net/http/http_cache_transaction.h
@@ -24,6 +24,7 @@ #include "net/base/ip_endpoint.h" #include "net/base/load_states.h" #include "net/base/net_error_details.h" +#include "net/base/net_errors.h" #include "net/base/request_priority.h" #include "net/http/http_cache.h" #include "net/http/http_request_headers.h" @@ -202,7 +203,7 @@ // Helper struct to pair a header name with its value, for // headers used to validate cache entries. struct ValidationHeaders { - ValidationHeaders() : initialized(false) {} + ValidationHeaders() = default; std::string values[kNumValidationHeaders]; void Reset() { @@ -210,7 +211,7 @@ for (auto& value : values) value.clear(); } - bool initialized; + bool initialized = false; }; struct NetworkTransactionInfo { @@ -624,7 +625,7 @@ ValidationHeaders external_validation_; base::WeakPtr<HttpCache> cache_; raw_ptr<HttpCache::ActiveEntry> entry_; - HttpCache::ActiveEntry* new_entry_; + HttpCache::ActiveEntry* new_entry_ = nullptr; std::unique_ptr<HttpTransaction> network_trans_; CompletionOnceCallback callback_; // Consumer's callback. HttpResponseInfo response_; @@ -641,56 +642,60 @@ raw_ptr<const HttpResponseInfo> new_response_; std::string cache_key_; - Mode mode_; - bool reading_; // We are already reading. Never reverts to false once set. - bool invalid_range_; // We may bypass the cache for this request. - bool truncated_; // We don't have all the response data. - bool is_sparse_; // The data is stored in sparse byte ranges. - bool range_requested_; // The user requested a byte range. - bool handling_206_; // We must deal with this 206 response. - bool cache_pending_; // We are waiting for the HttpCache. + Mode mode_ = NONE; + bool reading_ = false; // We are already reading. Never reverts to + // false once set. + bool invalid_range_ = false; // We may bypass the cache for this request. + bool truncated_ = false; // We don't have all the response data. + bool is_sparse_ = false; // The data is stored in sparse byte ranges. + bool range_requested_ = false; // The user requested a byte range. + bool handling_206_ = false; // We must deal with this 206 response. + bool cache_pending_ = false; // We are waiting for the HttpCache. // Headers have been received from the network and it's not a match with the // existing entry. - bool done_headers_create_new_entry_; + bool done_headers_create_new_entry_ = false; - bool vary_mismatch_; // The request doesn't match the stored vary data. - bool couldnt_conditionalize_request_; - bool bypass_lock_for_test_; // A test is exercising the cache lock. - bool bypass_lock_after_headers_for_test_; // A test is exercising the cache - // lock. - bool fail_conditionalization_for_test_; // Fail ConditionalizeRequest. + bool vary_mismatch_ = false; // The request doesn't match the stored vary + // data. + bool couldnt_conditionalize_request_ = false; + bool bypass_lock_for_test_ = false; // A test is exercising the cache lock. + bool bypass_lock_after_headers_for_test_ = false; // A test is exercising the + // cache lock. + bool fail_conditionalization_for_test_ = + false; // Fail ConditionalizeRequest. bool mark_single_keyed_cache_entry_unusable_ = false; // Set single_keyed_cache_entry_unusable. scoped_refptr<IOBuffer> read_buf_; // Length of the buffer passed in Read(). - int read_buf_len_; + int read_buf_len_ = 0; - int io_buf_len_; - int read_offset_; - int effective_load_flags_; + int io_buf_len_ = 0; + int read_offset_ = 0; + int effective_load_flags_ = 0; std::unique_ptr<PartialData> partial_; // We are dealing with range requests. CompletionRepeatingCallback io_callback_; // Error code to be returned from a subsequent Read call if shared writing // failed in a separate transaction. - int shared_writing_error_; + int shared_writing_error_ = OK; // Members used to track data for histograms. // This cache_entry_status_ takes precedence over // response_.cache_entry_status. In fact, response_.cache_entry_status must be // kept in sync with cache_entry_status_ (via SetResponse and // UpdateCacheEntryStatus). - HttpResponseInfo::CacheEntryStatus cache_entry_status_; - ValidationCause validation_cause_; + HttpResponseInfo::CacheEntryStatus cache_entry_status_ = + HttpResponseInfo::CacheEntryStatus::ENTRY_UNDEFINED; + ValidationCause validation_cause_ = VALIDATION_CAUSE_UNDEFINED; base::TimeTicks entry_lock_waiting_since_; base::TimeTicks first_cache_access_since_; base::TimeTicks send_request_since_; base::TimeTicks read_headers_since_; base::Time open_entry_last_used_; - bool recorded_histograms_; + bool recorded_histograms_ = false; bool has_opened_or_created_entry_ = false; bool record_entry_open_or_creation_time_ = false; @@ -703,7 +708,7 @@ // TODO(shivanisha) Note that if this transaction dies mid-way and there are // other writer transactions, no transaction then accounts for those // statistics. - bool moved_network_transaction_to_writers_; + bool moved_network_transaction_to_writers_ = false; // The helper object to use to create WebSocketHandshakeStreamBase // objects. Only relevant when establishing a WebSocket connection. @@ -724,7 +729,7 @@ ResponseHeadersCallback response_headers_callback_; // True if the Transaction is currently processing the DoLoop. - bool in_do_loop_; + bool in_do_loop_ = false; base::WeakPtrFactory<Transaction> weak_factory_{this}; };
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc index f9a1768b..87c0ab4 100644 --- a/net/http/http_cache_unittest.cc +++ b/net/http/http_cache_unittest.cc
@@ -685,9 +685,9 @@ }; struct Context { - Context() : result(ERR_IO_PENDING) {} + Context() = default; - int result; + int result = ERR_IO_PENDING; TestCompletionCallback callback; std::unique_ptr<HttpTransaction> trans; };
diff --git a/net/http/http_cache_writers.cc b/net/http/http_cache_writers.cc index 80a39e5..9a9b3b9 100644 --- a/net/http/http_cache_writers.cc +++ b/net/http/http_cache_writers.cc
@@ -339,7 +339,6 @@ CompletionOnceCallback consumer_callback) : read_buf(std::move(buf)), read_buf_len(len), - write_len(0), callback(std::move(consumer_callback)) { DCHECK(read_buf); DCHECK_GT(len, 0);
diff --git a/net/http/http_cache_writers.h b/net/http/http_cache_writers.h index 344ccca..7de8dde 100644 --- a/net/http/http_cache_writers.h +++ b/net/http/http_cache_writers.h
@@ -179,7 +179,7 @@ struct WaitingForRead { scoped_refptr<IOBuffer> read_buf; int read_buf_len; - int write_len; + int write_len = 0; CompletionOnceCallback callback; WaitingForRead(scoped_refptr<IOBuffer> read_buf, int len,
diff --git a/net/http/http_cache_writers_unittest.cc b/net/http/http_cache_writers_unittest.cc index 94337894..275b6b7a 100644 --- a/net/http/http_cache_writers_unittest.cc +++ b/net/http/http_cache_writers_unittest.cc
@@ -83,7 +83,6 @@ enum class DeleteTransactionType { NONE, ACTIVE, WAITING, IDLE }; WritersTest() : scoped_transaction_(kSimpleGET_Transaction), - disk_entry_(nullptr), test_cache_(std::make_unique<MockNetworkLayer>(), std::make_unique<MockBackendFactory>()), request_(kSimpleGET_Transaction) { @@ -498,7 +497,7 @@ ScopedMockTransaction scoped_transaction_; MockHttpCache cache_; std::unique_ptr<HttpCache::Writers> writers_; - disk_cache::Entry* disk_entry_; + disk_cache::Entry* disk_entry_ = nullptr; std::unique_ptr<HttpCache::ActiveEntry> entry_; TestHttpCache test_cache_;
diff --git a/net/http/http_chunked_decoder.cc b/net/http/http_chunked_decoder.cc index fab9434..c6ae91f 100644 --- a/net/http/http_chunked_decoder.cc +++ b/net/http/http_chunked_decoder.cc
@@ -58,13 +58,7 @@ // extensions. const size_t HttpChunkedDecoder::kMaxLineBufLen = 16384; -HttpChunkedDecoder::HttpChunkedDecoder() - : chunk_remaining_(0), - chunk_terminator_remaining_(false), - reached_last_chunk_(false), - reached_eof_(false), - bytes_after_eof_(0) { -} +HttpChunkedDecoder::HttpChunkedDecoder() = default; int HttpChunkedDecoder::FilterBuf(char* buf, int buf_len) { int result = 0;
diff --git a/net/http/http_chunked_decoder.h b/net/http/http_chunked_decoder.h index 2ff55f9..99afb0b0 100644 --- a/net/http/http_chunked_decoder.h +++ b/net/http/http_chunked_decoder.h
@@ -111,22 +111,22 @@ static bool ParseChunkSize(const char* start, int len, int64_t* out); // Indicates the number of bytes remaining for the current chunk. - int64_t chunk_remaining_; + int64_t chunk_remaining_ = 0; // A small buffer used to store a partial chunk marker. std::string line_buf_; // True if waiting for the terminal CRLF of a chunk's data. - bool chunk_terminator_remaining_; + bool chunk_terminator_remaining_ = false; // Set to true when FilterBuf encounters the last-chunk. - bool reached_last_chunk_; + bool reached_last_chunk_ = false; // Set to true when FilterBuf encounters the final CRLF. - bool reached_eof_; + bool reached_eof_ = false; // The number of extraneous unfiltered bytes after the final CRLF. - int bytes_after_eof_; + int bytes_after_eof_ = 0; }; } // namespace net
diff --git a/net/http/http_content_disposition.cc b/net/http/http_content_disposition.cc index 459e7ed..c007c3c 100644 --- a/net/http/http_content_disposition.cc +++ b/net/http/http_content_disposition.cc
@@ -334,9 +334,8 @@ } // namespace HttpContentDisposition::HttpContentDisposition( - const std::string& header, const std::string& referrer_charset) - : type_(INLINE), - parse_result_flags_(INVALID) { + const std::string& header, + const std::string& referrer_charset) { Parse(header, referrer_charset); }
diff --git a/net/http/http_content_disposition.h b/net/http/http_content_disposition.h index 82424018..476eebe 100644 --- a/net/http/http_content_disposition.h +++ b/net/http/http_content_disposition.h
@@ -72,9 +72,9 @@ std::string::const_iterator ConsumeDispositionType( std::string::const_iterator begin, std::string::const_iterator end); - Type type_; + Type type_ = INLINE; std::string filename_; - int parse_result_flags_; + int parse_result_flags_ = INVALID; }; } // namespace net
diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc index a02911e..a941543 100644 --- a/net/http/http_network_layer.cc +++ b/net/http/http_network_layer.cc
@@ -23,8 +23,7 @@ namespace net { HttpNetworkLayer::HttpNetworkLayer(HttpNetworkSession* session) - : session_(session), - suspended_(false) { + : session_(session) { DCHECK(session_); #if BUILDFLAG(IS_WIN) base::PowerMonitor::AddPowerSuspendObserver(this);
diff --git a/net/http/http_network_layer.h b/net/http/http_network_layer.h index 0b8e361..4bbf32f1 100644 --- a/net/http/http_network_layer.h +++ b/net/http/http_network_layer.h
@@ -44,7 +44,7 @@ private: const raw_ptr<HttpNetworkSession> session_; - bool suspended_; + bool suspended_ = false; THREAD_CHECKER(thread_checker_); };
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index 7ffc06b..6eb6d36 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc
@@ -78,34 +78,9 @@ } // unnamed namespace HttpNetworkSessionParams::HttpNetworkSessionParams() - : enable_server_push_cancellation(false), - ignore_certificate_errors(false), - testing_fixed_http_port(0), - testing_fixed_https_port(0), - enable_user_alternate_protocol_ports(false), - enable_spdy_ping_based_connection_checking(true), - enable_http2(true), - spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize), + : spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize), spdy_session_max_queued_capped_frames(kSpdySessionMaxQueuedCappedFrames), -// For OSs that terminate TCP connections upon relevant network changes, -// attempt to preserve active streams by marking all sessions as going -// away, rather than explicitly closing them. Streams may still fail due -// to a generated TCP reset. -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_IOS) - spdy_go_away_on_ip_change(true), -#else - spdy_go_away_on_ip_change(false), -#endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_IOS) - enable_http2_settings_grease(false), - http2_end_stream_with_data_frame(false), - time_func(&base::TimeTicks::Now), - enable_http2_alternative_service(false), - enable_quic(true), - enable_quic_proxies_for_https_urls(false), - disable_idle_sockets_close_on_memory_pressure(false), - key_auth_cache_server_entries_by_network_isolation_key(false), - enable_priority_update(false), - ignore_ip_address_changes(false) { + time_func(&base::TimeTicks::Now) { enable_early_data = base::FeatureList::IsEnabled(features::kEnableTLS13EarlyData); }
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index 536aaab..e963d52 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h
@@ -89,22 +89,30 @@ HttpNetworkSessionParams(const HttpNetworkSessionParams& other); ~HttpNetworkSessionParams(); - bool enable_server_push_cancellation; + bool enable_server_push_cancellation = false; HostMappingRules host_mapping_rules; - bool ignore_certificate_errors; - uint16_t testing_fixed_http_port; - uint16_t testing_fixed_https_port; - bool enable_user_alternate_protocol_ports; + bool ignore_certificate_errors = false; + uint16_t testing_fixed_http_port = 0; + uint16_t testing_fixed_https_port = 0; + bool enable_user_alternate_protocol_ports = false; // Use SPDY ping frames to test for connection health after idle. - bool enable_spdy_ping_based_connection_checking; - bool enable_http2; + bool enable_spdy_ping_based_connection_checking = true; + bool enable_http2 = true; size_t spdy_session_max_recv_window_size; // Maximum number of capped frames that can be queued at any time. int spdy_session_max_queued_capped_frames; // Whether SPDY pools should mark sessions as going away upon relevant network // changes (instead of closing them). Default value is OS specific. - bool spdy_go_away_on_ip_change; + // For OSs that terminate TCP connections upon relevant network changes, + // attempt to preserve active streams by marking all sessions as going + // away, rather than explicitly closing them. Streams may still fail due + // to a generated TCP reset. +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_IOS) + bool spdy_go_away_on_ip_change = true; +#else + bool spdy_go_away_on_ip_change = false; +#endif // HTTP/2 connection settings. // Unknown settings will still be sent to the server. // Might contain unknown setting identifiers from a predefined set that @@ -118,7 +126,7 @@ // https://tools.ietf.org/html/draft-bishop-httpbis-grease-00. // The setting identifier and value will be drawn independently for each // connection to prevent tracking of the client. - bool enable_http2_settings_grease; + bool enable_http2_settings_grease = false; // If set, an HTTP/2 frame with a reserved frame type will be sent after // every HTTP/2 SETTINGS frame and before every HTTP/2 DATA frame. // https://tools.ietf.org/html/draft-bishop-httpbis-grease-00. @@ -132,35 +140,35 @@ // If unset, the HEADERS frame will have the END_STREAM flag set on. // This is useful in conjunction with |greased_http2_frame| so that a frame // of reserved type can be sent out even on requests without a body. - bool http2_end_stream_with_data_frame; + bool http2_end_stream_with_data_frame = false; // Source of time for SPDY connections. SpdySessionPool::TimeFunc time_func; // Whether to enable HTTP/2 Alt-Svc entries. - bool enable_http2_alternative_service; + bool enable_http2_alternative_service = false; // Enables 0-RTT support. bool enable_early_data; // Enables QUIC support. - bool enable_quic; + bool enable_quic = true; // If true, HTTPS URLs can be sent to QUIC proxies. - bool enable_quic_proxies_for_https_urls; + bool enable_quic_proxies_for_https_urls = false; // If non-empty, QUIC will only be spoken to hosts in this list. base::flat_set<std::string> quic_host_allowlist; // If true, idle sockets won't be closed when memory pressure happens. - bool disable_idle_sockets_close_on_memory_pressure; + bool disable_idle_sockets_close_on_memory_pressure = false; - bool key_auth_cache_server_entries_by_network_isolation_key; + bool key_auth_cache_server_entries_by_network_isolation_key = false; // If true, enable sending PRIORITY_UPDATE frames until SETTINGS frame // arrives. After SETTINGS frame arrives, do not send PRIORITY_UPDATE // frames any longer if SETTINGS_DEPRECATE_HTTP2_PRIORITIES is missing or // has zero 0, but continue and also stop sending HTTP/2-style priority // information in HEADERS frames and PRIORITY frames if it has value 1. - bool enable_priority_update; + bool enable_priority_update = false; // If true, objects used by a HttpNetworkTransaction are asked not to perform // disruptive work after there has been an IP address change (which usually @@ -169,7 +177,7 @@ // network: for these, the underlying network does never change, even if the // default network does (hence underlying objects should not drop their // state). - bool ignore_ip_address_changes; + bool ignore_ip_address_changes = false; }; // Structure with pointers to the dependencies of the HttpNetworkSession.
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index a28530c..edd979a2 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc
@@ -113,32 +113,11 @@ HttpNetworkTransaction::HttpNetworkTransaction(RequestPriority priority, HttpNetworkSession* session) - : pending_auth_target_(HttpAuth::AUTH_NONE), - io_callback_(base::BindRepeating(&HttpNetworkTransaction::OnIOComplete, + : io_callback_(base::BindRepeating(&HttpNetworkTransaction::OnIOComplete, base::Unretained(this))), session_(session), request_(nullptr), - priority_(priority), - headers_valid_(false), - can_send_early_data_(false), - configured_client_cert_for_server_(false), - request_headers_(), -#if BUILDFLAG(ENABLE_REPORTING) - network_error_logging_report_generated_(false), - request_reporting_upload_depth_(0), -#endif // BUILDFLAG(ENABLE_REPORTING) - read_buf_len_(0), - total_received_bytes_(0), - total_sent_bytes_(0), - next_state_(STATE_NONE), - establishing_tunnel_(false), - enable_ip_based_pooling_(true), - enable_alternative_services_(true), - websocket_handshake_stream_base_create_helper_(nullptr), - net_error_details_(), - retry_attempts_(0), - num_restarts_(0) { -} + priority_(priority) {} HttpNetworkTransaction::~HttpNetworkTransaction() { #if BUILDFLAG(ENABLE_REPORTING)
diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h index 38120f07..e10a7d7 100644 --- a/net/http/http_network_transaction.h +++ b/net/http/http_network_transaction.h
@@ -318,7 +318,7 @@ // Whether this transaction is waiting for proxy auth, server auth, or is // not waiting for any auth at all. |pending_auth_target_| is read and // cleared by RestartWithAuth(). - HttpAuth::Target pending_auth_target_; + HttpAuth::Target pending_auth_target_ = HttpAuth::AUTH_NONE; CompletionRepeatingCallback io_callback_; CompletionOnceCallback callback_; @@ -346,14 +346,14 @@ std::unique_ptr<HttpStream> stream_; // True if we've validated the headers that the stream parser has returned. - bool headers_valid_; + bool headers_valid_ = false; // True if we can send the request over early data. - bool can_send_early_data_; + bool can_send_early_data_ = false; // True if the client certificate for the server (rather than the proxy) was // configured in this transaction. - bool configured_client_cert_for_server_; + bool configured_client_cert_for_server_ = false; // SSL configuration used for the server and proxy, respectively. Note // |server_ssl_config_| may be updated from the HttpStreamFactory, which will @@ -368,14 +368,14 @@ HttpRequestHeaders request_headers_; #if BUILDFLAG(ENABLE_REPORTING) // Whether a NEL report has already been generated. Reset when restarting. - bool network_error_logging_report_generated_; + bool network_error_logging_report_generated_ = false; // Cache some fields from |request_| that we'll need to construct a NEL // report about the request. (NEL report construction happens after we've // cleared the |request_| pointer.) std::string request_method_; std::string request_referrer_; std::string request_user_agent_; - int request_reporting_upload_depth_; + int request_reporting_upload_depth_ = 0; base::TimeTicks start_timeticks_; #endif @@ -386,15 +386,15 @@ // User buffer and length passed to the Read method. scoped_refptr<IOBuffer> read_buf_; - int read_buf_len_; + int read_buf_len_ = 0; // Total number of bytes received on all destroyed HttpStreams for this // transaction. - int64_t total_received_bytes_; + int64_t total_received_bytes_ = 0; // Total number of bytes sent on all destroyed HttpStreams for this // transaction. - int64_t total_sent_bytes_; + int64_t total_sent_bytes_ = 0; // When the transaction started / finished sending the request, including // the body, if present. |send_start_time_| is set to |base::TimeTicks()| @@ -403,18 +403,18 @@ base::TimeTicks send_end_time_; // The next state in the state machine. - State next_state_; + State next_state_ = STATE_NONE; // True when the tunnel is in the process of being established - we can't // read from the socket until the tunnel is done. - bool establishing_tunnel_; + bool establishing_tunnel_ = false; // Enable pooling to a SpdySession with matching IP and certificate // even if the SpdySessionKey is different. - bool enable_ip_based_pooling_; + bool enable_ip_based_pooling_ = true; // Enable using alternative services for the request. - bool enable_alternative_services_; + bool enable_alternative_services_ = true; // When a request is retried because of errors with the alternative service, // this will store the alternative service used. @@ -423,7 +423,7 @@ // The helper object to use to create WebSocketHandshakeStreamBase // objects. Only relevant when establishing a WebSocket connection. raw_ptr<WebSocketHandshakeStreamBase::CreateHelper> - websocket_handshake_stream_base_create_helper_; + websocket_handshake_stream_base_create_helper_ = nullptr; BeforeNetworkStartCallback before_network_start_callback_; ConnectedCallback connected_callback_; @@ -443,10 +443,10 @@ // This count excludes retries on reused sockets since a well // behaved server may time those out and thus the number // of times we can retry a request on reused sockets is limited. - size_t retry_attempts_; + size_t retry_attempts_ = 0; // Number of times the transaction was restarted via a RestartWith* call. - size_t num_restarts_; + size_t num_restarts_ = 0; bool close_connection_on_destruction_ = false; };
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index c6184d9..26120aa 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc
@@ -15170,8 +15170,8 @@ MockWrite write; MockRead read; int expected_rv; - const MockWrite* extra_write; - const MockRead* extra_read; + raw_ptr<const MockWrite> extra_write; + raw_ptr<const MockRead> extra_read; }; static const int kNoSSL = 500;
diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc index 04e7530..80623ee 100644 --- a/net/http/http_proxy_client_socket.cc +++ b/net/http/http_proxy_client_socket.cc
@@ -41,9 +41,7 @@ const NetworkTrafficAnnotationTag& traffic_annotation) : io_callback_(base::BindRepeating(&HttpProxyClientSocket::OnIOComplete, base::Unretained(this))), - next_state_(STATE_NONE), socket_(std::move(socket)), - is_reused_(false), endpoint_(endpoint), auth_(http_auth_controller), proxy_server_(proxy_server),
diff --git a/net/http/http_proxy_client_socket.h b/net/http/http_proxy_client_socket.h index 5c10ad3..4c826073 100644 --- a/net/http/http_proxy_client_socket.h +++ b/net/http/http_proxy_client_socket.h
@@ -128,7 +128,7 @@ bool CheckDone(); CompletionRepeatingCallback io_callback_; - State next_state_; + State next_state_ = STATE_NONE; // Stores the callback provided by the caller of async operations. CompletionOnceCallback user_callback_; @@ -144,7 +144,7 @@ // Whether or not |socket_| has been previously used. Once auth credentials // are sent, set to true. - bool is_reused_; + bool is_reused_ = false; // The hostname and port of the endpoint. This is not necessarily the one // specified by the URL, due to Alternate-Protocol or fixed testing ports.
diff --git a/net/http/http_proxy_connect_job.cc b/net/http/http_proxy_connect_job.cc index 7715ac3..9a954556 100644 --- a/net/http/http_proxy_connect_job.cc +++ b/net/http/http_proxy_connect_job.cc
@@ -188,9 +188,6 @@ NetLogSourceType::HTTP_PROXY_CONNECT_JOB, NetLogEventType::HTTP_PROXY_CONNECT_JOB_CONNECT), params_(std::move(params)), - next_state_(STATE_NONE), - has_restarted_(false), - has_established_connection_(false), http_auth_controller_( params_->tunnel() ? base::MakeRefCounted<HttpAuthController>(
diff --git a/net/http/http_proxy_connect_job.h b/net/http/http_proxy_connect_job.h index 3ef13066..8587092c 100644 --- a/net/http/http_proxy_connect_job.h +++ b/net/http/http_proxy_connect_job.h
@@ -222,13 +222,13 @@ scoped_refptr<SSLCertRequestInfo> ssl_cert_request_info_; - State next_state_; + State next_state_ = STATE_NONE; - bool has_restarted_; + bool has_restarted_ = false; // Set to true once a connection has been successfully established. Remains // true even if a new socket is being connected to retry with auth. - bool has_established_connection_; + bool has_established_connection_ = false; ResolveErrorInfo resolve_error_info_;
diff --git a/net/http/http_request_headers.cc b/net/http/http_request_headers.cc index 5e5a4b8..ea36ce6 100644 --- a/net/http/http_request_headers.cc +++ b/net/http/http_request_headers.cc
@@ -64,9 +64,7 @@ : key(key.data(), key.size()), value(value.data(), value.size()) {} HttpRequestHeaders::Iterator::Iterator(const HttpRequestHeaders& headers) - : started_(false), - curr_(headers.headers_.begin()), - end_(headers.headers_.end()) {} + : curr_(headers.headers_.begin()), end_(headers.headers_.end()) {} HttpRequestHeaders::Iterator::~Iterator() = default;
diff --git a/net/http/http_request_headers.h b/net/http/http_request_headers.h index dbc3124..c1a956e 100644 --- a/net/http/http_request_headers.h +++ b/net/http/http_request_headers.h
@@ -56,7 +56,7 @@ const std::string& value() const { return curr_->value; } private: - bool started_; + bool started_ = false; HttpRequestHeaders::HeaderVector::const_iterator curr_; const HttpRequestHeaders::HeaderVector::const_iterator end_; };
diff --git a/net/http/http_request_info.cc b/net/http/http_request_info.cc index dba2c9b6..adac030 100644 --- a/net/http/http_request_info.cc +++ b/net/http/http_request_info.cc
@@ -8,15 +8,7 @@ namespace net { -HttpRequestInfo::HttpRequestInfo() - : is_subframe_document_resource(false), - upload_data_stream(nullptr), - load_flags(0), - privacy_mode(PRIVACY_MODE_DISABLED), - secure_dns_policy(SecureDnsPolicy::kAllow), - reporting_upload_depth(0), - idempotency(net::DEFAULT_IDEMPOTENCY), - pervasive_payloads_index_for_logging(-1) {} +HttpRequestInfo::HttpRequestInfo() = default; HttpRequestInfo::HttpRequestInfo(const HttpRequestInfo& other) = default;
diff --git a/net/http/http_request_info.h b/net/http/http_request_info.h index e10fcd4..ff52954 100644 --- a/net/http/http_request_info.h +++ b/net/http/http_request_info.h
@@ -40,23 +40,23 @@ NetworkIsolationKey network_isolation_key; // True if it is a subframe's document resource. - bool is_subframe_document_resource; + bool is_subframe_document_resource = false; // Any extra request headers (including User-Agent). HttpRequestHeaders extra_headers; // Any upload data. - raw_ptr<UploadDataStream> upload_data_stream; + raw_ptr<UploadDataStream> upload_data_stream = nullptr; // Any load flags (see load_flags.h). - int load_flags; + int load_flags = 0; // If enabled, then request must be sent over connection that cannot be // tracked by the server (e.g. without channel id). - PrivacyMode privacy_mode; + PrivacyMode privacy_mode = PRIVACY_MODE_DISABLED; // Secure DNS Tag for the request. - SecureDnsPolicy secure_dns_policy; + SecureDnsPolicy secure_dns_policy = SecureDnsPolicy::kAllow; // Tag applied to all sockets used to service request. SocketTag socket_tag; @@ -70,7 +70,7 @@ // // If the request is a Reporting upload, the depth is the max of the depth // of the requests reported within it plus 1. - int reporting_upload_depth; + int reporting_upload_depth = 0; // This may the top frame origin associated with a request, or it may be the // top frame site. Or it may be nullptr. Only used for histograms. @@ -87,11 +87,11 @@ // replay the request. If the request has any side effects, those effects can // happen multiple times. It is only safe to enable the 0-RTT if it is known // that the request is idempotent. - net::Idempotency idempotency; + net::Idempotency idempotency = net::DEFAULT_IDEMPOTENCY; // Index of the requested URL in Cache Transparency's pervasive payload list. // Only used for logging purposes. - int pervasive_payloads_index_for_logging; + int pervasive_payloads_index_for_logging = -1; // Checksum of the request body and selected headers, in upper-case // hexadecimal. Only non-empty if the USE_SINGLE_KEYED_CACHE load flag is set.
diff --git a/net/http/http_response_body_drainer.cc b/net/http/http_response_body_drainer.cc index bca2f5f..9591c58c 100644 --- a/net/http/http_response_body_drainer.cc +++ b/net/http/http_response_body_drainer.cc
@@ -20,10 +20,7 @@ const int HttpResponseBodyDrainer::kTimeoutInSeconds; HttpResponseBodyDrainer::HttpResponseBodyDrainer(HttpStream* stream) - : stream_(stream), - next_state_(STATE_NONE), - total_read_(0), - session_(nullptr) {} + : stream_(stream) {} HttpResponseBodyDrainer::~HttpResponseBodyDrainer() = default;
diff --git a/net/http/http_response_body_drainer.h b/net/http/http_response_body_drainer.h index 4ad3f5d..5ba92fa 100644 --- a/net/http/http_response_body_drainer.h +++ b/net/http/http_response_body_drainer.h
@@ -55,10 +55,10 @@ scoped_refptr<IOBuffer> read_buf_; const std::unique_ptr<HttpStream> stream_; - State next_state_; - int total_read_; + State next_state_ = STATE_NONE; + int total_read_ = 0; base::OneShotTimer timer_; - raw_ptr<HttpNetworkSession> session_; + raw_ptr<HttpNetworkSession> session_ = nullptr; }; } // namespace net
diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc index a8ffe04..13cdd3c 100644 --- a/net/http/http_response_body_drainer_unittest.cc +++ b/net/http/http_response_body_drainer_unittest.cc
@@ -48,10 +48,7 @@ class CloseResultWaiter { public: - CloseResultWaiter() - : result_(false), - have_result_(false), - waiting_for_result_(false) {} + CloseResultWaiter() = default; CloseResultWaiter(const CloseResultWaiter&) = delete; CloseResultWaiter& operator=(const CloseResultWaiter&) = delete; @@ -74,23 +71,15 @@ } private: - int result_; - bool have_result_; - bool waiting_for_result_; + int result_ = false; + bool have_result_ = false; + bool waiting_for_result_ = false; }; class MockHttpStream : public HttpStream { public: - MockHttpStream(CloseResultWaiter* result_waiter) - : result_waiter_(result_waiter), - buf_len_(0), - closed_(false), - stall_reads_forever_(false), - num_chunks_(0), - is_sync_(false), - is_last_chunk_zero_size_(false), - is_complete_(false), - can_reuse_connection_(true) {} + explicit MockHttpStream(CloseResultWaiter* result_waiter) + : result_waiter_(result_waiter) {} MockHttpStream(const MockHttpStream&) = delete; MockHttpStream& operator=(const MockHttpStream&) = delete; @@ -185,14 +174,14 @@ const raw_ptr<CloseResultWaiter> result_waiter_; scoped_refptr<IOBuffer> user_buf_; CompletionOnceCallback callback_; - int buf_len_; - bool closed_; - bool stall_reads_forever_; - int num_chunks_; - bool is_sync_; - bool is_last_chunk_zero_size_; - bool is_complete_; - bool can_reuse_connection_; + int buf_len_ = 0; + bool closed_ = false; + bool stall_reads_forever_ = false; + int num_chunks_ = 0; + bool is_sync_ = false; + bool is_last_chunk_zero_size_ = false; + bool is_complete_ = false; + bool can_reuse_connection_ = true; base::WeakPtrFactory<MockHttpStream> weak_factory_{this}; };
diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc index 15b2b28..e96d6da 100644 --- a/net/http/http_response_info.cc +++ b/net/http/http_response_info.cc
@@ -187,19 +187,7 @@ return CONNECTION_INFO_COARSE_OTHER; } -HttpResponseInfo::HttpResponseInfo() - : was_cached(false), - cache_entry_status(CacheEntryStatus::ENTRY_UNDEFINED), - network_accessed(false), - was_fetched_via_spdy(false), - was_alpn_negotiated(false), - was_fetched_via_proxy(false), - did_use_http_auth(false), - unused_since_prefetch(false), - restricted_prefetch(false), - async_revalidation_requested(false), - single_keyed_cache_entry_unusable(false), - connection_info(CONNECTION_INFO_UNKNOWN) {} +HttpResponseInfo::HttpResponseInfo() = default; HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs) = default;
diff --git a/net/http/http_response_info.h b/net/http/http_response_info.h index 0b00873d..add678f1 100644 --- a/net/http/http_response_info.h +++ b/net/http/http_response_info.h
@@ -147,49 +147,49 @@ // when reloading previously visited pages (without going over the network). // Note also that under normal circumstances, was_cached is set to the correct // value even if the request fails. - bool was_cached; + bool was_cached = false; // How this response was handled by the HTTP cache. - CacheEntryStatus cache_entry_status; + CacheEntryStatus cache_entry_status = CacheEntryStatus::ENTRY_UNDEFINED; // True if the request accessed the network in the process of retrieving // data. - bool network_accessed; + bool network_accessed = false; // True if the request was fetched over a SPDY channel. - bool was_fetched_via_spdy; + bool was_fetched_via_spdy = false; // True if ALPN was negotiated for this request. - bool was_alpn_negotiated; + bool was_alpn_negotiated = false; // True if the request was fetched via an explicit proxy. The proxy could // be any type of proxy, HTTP or SOCKS. Note, we do not know if a // transparent proxy may have been involved. If true, |proxy_server| contains // the proxy server that was used. // TODO(tbansal): crbug.com/653354. Remove |was_fetched_via_proxy|. - bool was_fetched_via_proxy; + bool was_fetched_via_proxy = false; ProxyServer proxy_server; // Whether the request use http proxy or server authentication. - bool did_use_http_auth; + bool did_use_http_auth = false; // True if the resource was originally fetched for a prefetch and has not been // used since. - bool unused_since_prefetch; + bool unused_since_prefetch = false; // True if the response is a prefetch whose reuse is "restricted". This means // it can only be reused from the cache by requests that are marked as able to // use restricted prefetches. - bool restricted_prefetch; + bool restricted_prefetch = false; // True if this resource is stale and needs async revalidation. // This value is not persisted by Persist(); it is only ever set when the // response is retrieved from the cache. - bool async_revalidation_requested; + bool async_revalidation_requested = false; // True if this entry in the single-keyed cache is unusable due to a checksum // mismatch. - bool single_keyed_cache_entry_unusable; + bool single_keyed_cache_entry_unusable = false; // stale-while-revalidate, if any, will be honored until time given by // |stale_revalidate_timeout|. This value is latched the first time @@ -209,7 +209,7 @@ std::string alpn_negotiated_protocol; // The type of connection used for this response. - ConnectionInfo connection_info; + ConnectionInfo connection_info = CONNECTION_INFO_UNKNOWN; // The time at which the request was made that resulted in this response. // For cached responses, this is the last time the cache entry was validated.
diff --git a/net/http/http_server_properties.cc b/net/http/http_server_properties.cc index 0ac003c..3adcc93 100644 --- a/net/http/http_server_properties.cc +++ b/net/http/http_server_properties.cc
@@ -143,7 +143,6 @@ use_network_isolation_key_(base::FeatureList::IsEnabled( features::kPartitionHttpServerPropertiesByNetworkIsolationKey)), is_initialized_(pref_delegate.get() == nullptr), - queue_write_on_load_(false), properties_manager_( pref_delegate ? std::make_unique<HttpServerPropertiesManager>(
diff --git a/net/http/http_server_properties.h b/net/http/http_server_properties.h index 2d782f3..94c1573e 100644 --- a/net/http/http_server_properties.h +++ b/net/http/http_server_properties.h
@@ -610,7 +610,7 @@ // Queue a write when resources finish loading. Set to true when // MaybeQueueWriteProperties() is invoked while still waiting on // initialization to complete. - bool queue_write_on_load_; + bool queue_write_on_load_ = false; // Used to load/save properties from/to preferences. May be nullptr. std::unique_ptr<HttpServerPropertiesManager> properties_manager_;
diff --git a/net/http/http_stream_factory_job.cc b/net/http/http_stream_factory_job.cc index 9b565ca..f0a2edc 100644 --- a/net/http/http_stream_factory_job.cc +++ b/net/http/http_stream_factory_job.cc
@@ -124,7 +124,6 @@ base::BindRepeating(&Job::OnIOComplete, base::Unretained(this))), connection_(new ClientSocketHandle), session_(session), - next_state_(STATE_NONE), destination_(std::move(destination)), origin_url_(origin_url), is_websocket_(is_websocket), @@ -147,15 +146,7 @@ (ShouldForceQuic(session, destination_, proxy_info, using_ssl_))), quic_version_(quic_version), expect_spdy_(alternative_protocol == kProtoHTTP2 && !using_quic_), - using_spdy_(false), - should_reconsider_proxy_(false), quic_request_(session_->quic_stream_factory()), - expect_on_quic_host_resolution_(false), - using_existing_quic_session_(false), - establishing_tunnel_(false), - was_alpn_negotiated_(false), - negotiated_protocol_(kProtoUnknown), - num_streams_(0), pushed_stream_id_(kNoPushedStreamFound), spdy_session_key_( using_quic_ ? SpdySessionKey() @@ -164,9 +155,7 @@ request_info_.privacy_mode, request_info_.socket_tag, request_info_.network_isolation_key, - request_info_.secure_dns_policy)), - stream_type_(HttpStreamRequest::BIDIRECTIONAL_STREAM), - init_connection_already_resumed_(false) { + request_info_.secure_dns_policy)) { // Websocket `destination` schemes should be converted to HTTP(S). DCHECK(base::EqualsCaseInsensitiveASCII(destination_.scheme(), url::kHttpScheme) ||
diff --git a/net/http/http_stream_factory_job.h b/net/http/http_stream_factory_job.h index 2c3f9af..1a176b7 100644 --- a/net/http/http_stream_factory_job.h +++ b/net/http/http_stream_factory_job.h
@@ -355,7 +355,7 @@ std::unique_ptr<ClientSocketHandle> connection_; const raw_ptr<HttpNetworkSession> session_; - State next_state_; + State next_state_ = STATE_NONE; // The server we are trying to reach, could be that of the origin or of the // alternative service (after applying host mapping rules). @@ -405,37 +405,37 @@ // True if Job actually uses HTTP/2. Note this describes both using HTTP/2 // with an HTTPS origin, and proxying a cleartext HTTP request over an HTTP/2 // proxy. This differs from `using_ssl_`, which only describes the origin. - bool using_spdy_; + bool using_spdy_ = false; // True if this job might succeed with a different proxy config. - bool should_reconsider_proxy_; + bool should_reconsider_proxy_ = false; QuicStreamRequest quic_request_; // Only valid for a QUIC job. Set when a QUIC connection is started. If true, // then OnQuicHostResolution() is expected to be called in the future. - bool expect_on_quic_host_resolution_; + bool expect_on_quic_host_resolution_ = false; // True if this job used an existing QUIC session. - bool using_existing_quic_session_; + bool using_existing_quic_session_ = false; // True when the tunnel is in the process of being established - we can't // read from the socket until the tunnel is done. - bool establishing_tunnel_; + bool establishing_tunnel_ = false; std::unique_ptr<HttpStream> stream_; std::unique_ptr<WebSocketHandshakeStreamBase> websocket_stream_; std::unique_ptr<BidirectionalStreamImpl> bidirectional_stream_impl_; // True if we negotiated ALPN. - bool was_alpn_negotiated_; + bool was_alpn_negotiated_ = false; // Protocol negotiated with the server. - NextProto negotiated_protocol_; + NextProto negotiated_protocol_ = kProtoUnknown; // 0 if we're not preconnecting. Otherwise, the number of streams to // preconnect. - int num_streams_; + int num_streams_ = 0; // Initialized when we have an existing SpdySession. base::WeakPtr<SpdySession> existing_spdy_session_; @@ -451,10 +451,11 @@ const SpdySessionKey spdy_session_key_; // Type of stream that is requested. - HttpStreamRequest::StreamType stream_type_; + HttpStreamRequest::StreamType stream_type_ = + HttpStreamRequest::BIDIRECTIONAL_STREAM; // Whether Job has continued to DoInitConnection(). - bool init_connection_already_resumed_; + bool init_connection_already_resumed_ = false; base::OnceClosure restart_with_auth_callback_;
diff --git a/net/http/http_stream_factory_job_controller.cc b/net/http/http_stream_factory_job_controller.cc index 05823c2..19dd80b 100644 --- a/net/http/http_stream_factory_job_controller.cc +++ b/net/http/http_stream_factory_job_controller.cc
@@ -136,28 +136,16 @@ : factory_(factory), session_(session), job_factory_(job_factory), - request_(nullptr), delegate_(delegate), is_preconnect_(is_preconnect), is_websocket_(is_websocket), enable_ip_based_pooling_(enable_ip_based_pooling), enable_alternative_services_(enable_alternative_services), - main_job_net_error_(OK), - alternative_job_net_error_(OK), - alternative_job_failed_on_default_network_(false), - job_bound_(false), - main_job_is_blocked_(false), - main_job_is_resumed_(false), delay_main_job_with_available_spdy_session_( delay_main_job_with_available_spdy_session), - bound_job_(nullptr), - next_state_(STATE_RESOLVE_PROXY), - proxy_resolve_request_(nullptr), request_info_(request_info), server_ssl_config_(server_ssl_config), proxy_ssl_config_(proxy_ssl_config), - num_streams_(0), - priority_(IDLE), net_log_(NetLogWithSource::Make( session->net_log(), NetLogSourceType::HTTP_STREAM_JOB_CONTROLLER)) {
diff --git a/net/http/http_stream_factory_job_controller.h b/net/http/http_stream_factory_job_controller.h index aed0bbf..e6149e3f 100644 --- a/net/http/http_stream_factory_job_controller.h +++ b/net/http/http_stream_factory_job_controller.h
@@ -12,6 +12,7 @@ #include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "net/base/host_port_pair.h" +#include "net/base/net_errors.h" #include "net/base/privacy_mode.h" #include "net/http/http_stream_factory_job.h" #include "net/http/http_stream_request.h" @@ -279,7 +280,7 @@ // reference and is safe as |request_| will notify |this| JobController // when it's destructed by calling OnRequestComplete(), which nulls // |request_|. - raw_ptr<HttpStreamRequest> request_; + raw_ptr<HttpStreamRequest> request_ = nullptr; const raw_ptr<HttpStreamRequest::Delegate> delegate_; @@ -307,23 +308,23 @@ // Error status used for alternative service brokenness reporting. // Net error code of the main job. Set to OK by default. - int main_job_net_error_; + int main_job_net_error_ = OK; // Net error code of the alternative job. Set to OK by default. - int alternative_job_net_error_; + int alternative_job_net_error_ = OK; // Set to true if the alternative job failed on the default network. - bool alternative_job_failed_on_default_network_; + bool alternative_job_failed_on_default_network_ = false; // True if a Job has ever been bound to the |request_|. - bool job_bound_; + bool job_bound_ = false; // True if the main job has to wait for the alternative job: i.e., the main // job must not create a connection until it is resumed. - bool main_job_is_blocked_; + bool main_job_is_blocked_ = false; // Handle for cancelling any posted delayed ResumeMainJob() task. base::CancelableOnceClosure resume_main_job_callback_; // True if the main job was blocked and has been resumed in ResumeMainJob(). - bool main_job_is_resumed_; + bool main_job_is_resumed_ = false; // If true, delay main job even the request can be sent immediately on an // available SPDY session. @@ -334,17 +335,17 @@ // At the point where a Job is irrevocably tied to |request_|, we set this. // It will be nulled when the |request_| is finished. - raw_ptr<Job> bound_job_; + raw_ptr<Job> bound_job_ = nullptr; - State next_state_; + State next_state_ = STATE_RESOLVE_PROXY; std::unique_ptr<ProxyResolutionRequest> proxy_resolve_request_; const HttpRequestInfo request_info_; ProxyInfo proxy_info_; const SSLConfig server_ssl_config_; const SSLConfig proxy_ssl_config_; - int num_streams_; + int num_streams_ = 0; HttpStreamRequest::StreamType stream_type_; - RequestPriority priority_; + RequestPriority priority_ = IDLE; const NetLogWithSource net_log_; base::WeakPtrFactory<JobController> ptr_factory_{this};
diff --git a/net/http/http_stream_factory_test_util.cc b/net/http/http_stream_factory_test_util.cc index 3da68eec..5b7a376b 100644 --- a/net/http/http_stream_factory_test_util.cc +++ b/net/http/http_stream_factory_test_util.cc
@@ -52,10 +52,7 @@ MockHttpStreamFactoryJob::~MockHttpStreamFactoryJob() = default; -TestJobFactory::TestJobFactory() - : main_job_(nullptr), - alternative_job_(nullptr), - override_main_job_url_(false) {} +TestJobFactory::TestJobFactory() = default; TestJobFactory::~TestJobFactory() = default;
diff --git a/net/http/http_stream_factory_test_util.h b/net/http/http_stream_factory_test_util.h index 1631298..ac89b431 100644 --- a/net/http/http_stream_factory_test_util.h +++ b/net/http/http_stream_factory_test_util.h
@@ -174,9 +174,9 @@ } private: - raw_ptr<MockHttpStreamFactoryJob> main_job_; - raw_ptr<MockHttpStreamFactoryJob> alternative_job_; - bool override_main_job_url_; + raw_ptr<MockHttpStreamFactoryJob> main_job_ = nullptr; + raw_ptr<MockHttpStreamFactoryJob> alternative_job_ = nullptr; + bool override_main_job_url_ = false; GURL main_job_alternative_url_; };
diff --git a/net/http/http_stream_factory_unittest.cc b/net/http/http_stream_factory_unittest.cc index 0402ed8..e11997a 100644 --- a/net/http/http_stream_factory_unittest.cc +++ b/net/http/http_stream_factory_unittest.cc
@@ -25,6 +25,7 @@ #include "build/build_config.h" #include "net/base/completion_once_callback.h" #include "net/base/features.h" +#include "net/base/net_errors.h" #include "net/base/network_isolation_key.h" #include "net/base/port_util.h" #include "net/base/privacy_mode.h" @@ -191,11 +192,8 @@ class MockHttpStreamFactoryForPreconnect : public HttpStreamFactory { public: explicit MockHttpStreamFactoryForPreconnect(HttpNetworkSession* session) - : HttpStreamFactory(session), - preconnect_done_(false), - waiting_for_preconnect_(false) {} - - ~MockHttpStreamFactoryForPreconnect() override {} + : HttpStreamFactory(session) {} + ~MockHttpStreamFactoryForPreconnect() override = default; void WaitForPreconnects() { while (!preconnect_done_) { @@ -213,14 +211,14 @@ loop_.QuitWhenIdle(); } - bool preconnect_done_; - bool waiting_for_preconnect_; + bool preconnect_done_ = false; + bool waiting_for_preconnect_ = false; base::RunLoop loop_; }; class StreamRequestWaiter : public HttpStreamRequest::Delegate { public: - StreamRequestWaiter() : error_status_(OK) {} + StreamRequestWaiter() = default; StreamRequestWaiter(const StreamRequestWaiter&) = delete; StreamRequestWaiter& operator=(const StreamRequestWaiter&) = delete; @@ -321,7 +319,7 @@ std::unique_ptr<BidirectionalStreamImpl> bidirectional_stream_impl_; SSLConfig used_ssl_config_; ProxyInfo used_proxy_info_; - int error_status_; + int error_status_ = OK; }; class WebSocketBasicHandshakeStream : public MockWebSocketHandshakeStream { @@ -425,8 +423,7 @@ base::TimeDelta(), ProxyServer::Direct(), false /* is_for_websockets */, - common_connect_job_params), - last_num_streams_(-1) {} + common_connect_job_params) {} int last_num_streams() const { return last_num_streams_; } const ClientSocketPool::GroupId& last_group_id() const { @@ -500,7 +497,7 @@ } private: - int last_num_streams_; + int last_num_streams_ = -1; ClientSocketPool::GroupId last_group_id_; }; @@ -950,8 +947,7 @@ // Simplify ownership issues and the interaction with the MockSocketFactory. class MockQuicData { public: - explicit MockQuicData(quic::ParsedQuicVersion version) - : packet_number_(0), printer_(version) {} + explicit MockQuicData(quic::ParsedQuicVersion version) : printer_(version) {} ~MockQuicData() = default; @@ -981,7 +977,7 @@ std::vector<std::unique_ptr<quic::QuicEncryptedPacket>> packets_; std::vector<MockWrite> writes_; std::vector<MockRead> reads_; - size_t packet_number_; + size_t packet_number_ = 0; QuicPacketPrinter printer_; std::unique_ptr<SequencedSocketData> socket_data_; };
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc index 72ad2d8c..e048ecb 100644 --- a/net/http/http_stream_parser.cc +++ b/net/http/http_stream_parser.cc
@@ -115,12 +115,7 @@ class HttpStreamParser::SeekableIOBuffer : public IOBuffer { public: explicit SeekableIOBuffer(int capacity) - : IOBuffer(capacity), - real_data_(data_), - capacity_(capacity), - size_(0), - used_(0) { - } + : IOBuffer(capacity), real_data_(data_), capacity_(capacity) {} // DidConsume() changes the |data_| pointer so that |data_| always points // to the first unconsumed byte. @@ -173,8 +168,8 @@ raw_ptr<char> real_data_; const int capacity_; - int size_; - int used_; + int size_ = 0; + int used_ = 0; }; // 2 CRLFs + max of 8 hex chars. @@ -185,26 +180,15 @@ const HttpRequestInfo* request, GrowableIOBuffer* read_buffer, const NetLogWithSource& net_log) - : io_state_(STATE_NONE), - request_(request), + : request_(request), request_headers_(nullptr), - request_headers_length_(0), read_buf_(read_buffer), - read_buf_unused_offset_(0), response_header_start_offset_(std::string::npos), - received_bytes_(0), - sent_bytes_(0), response_(nullptr), - response_body_length_(-1), - response_is_keep_alive_(false), - response_body_read_(0), user_read_buf_(nullptr), - user_read_buf_len_(0), stream_socket_(stream_socket), connection_is_reused_(connection_is_reused), - net_log_(net_log), - sent_last_chunk_(false), - upload_error_(OK) { + net_log_(net_log) { io_callback_ = base::BindRepeating(&HttpStreamParser::OnIOComplete, weak_ptr_factory_.GetWeakPtr()); }
diff --git a/net/http/http_stream_parser.h b/net/http/http_stream_parser.h index 16b5c49..84df5c1 100644 --- a/net/http/http_stream_parser.h +++ b/net/http/http_stream_parser.h
@@ -211,7 +211,7 @@ bool SendRequestBuffersEmpty(); // Next state of the request, when the current one completes. - State io_state_; + State io_state_ = STATE_NONE; // Null when read state machine is invoked. raw_ptr<const HttpRequestInfo> request_; @@ -221,7 +221,7 @@ // Size of just the request headers. May be less than the length of // |request_headers_| if the body was merged with the headers. - int request_headers_length_; + int request_headers_length_ = 0; // Temporary buffer for reading. scoped_refptr<GrowableIOBuffer> read_buf_; @@ -229,7 +229,7 @@ // Offset of the first unused byte in |read_buf_|. May be nonzero due to // body data in the same packet as header data but is zero when reading // headers. - int read_buf_unused_offset_; + int read_buf_unused_offset_ = 0; // The amount beyond |read_buf_unused_offset_| where the status line starts; // std::string::npos if not found yet. @@ -237,10 +237,10 @@ // The amount of received data. If connection is reused then intermediate // value may be bigger than final. - int64_t received_bytes_; + int64_t received_bytes_ = 0; // The amount of sent data. - int64_t sent_bytes_; + int64_t sent_bytes_ = 0; // The parsed response headers. Owned by the caller of SendRequest. This // cannot be safely accessed after reading the final set of headers, as the @@ -271,10 +271,10 @@ // Indicates the content length. If this value is less than zero // (and chunked_decoder_ is null), then we must read until the server // closes the connection. - int64_t response_body_length_; + int64_t response_body_length_ = -1; // True if reading a keep-alive response. False if not, or if don't yet know. - bool response_is_keep_alive_; + bool response_is_keep_alive_ = false; // True if we've seen a response that has an HTTP status line. This is // persistent across multiple response parsing. If we see a status line @@ -282,14 +282,14 @@ bool has_seen_status_line_ = false; // Keep track of the number of response body bytes read so far. - int64_t response_body_read_; + int64_t response_body_read_ = 0; // Helper if the data is chunked. std::unique_ptr<HttpChunkedDecoder> chunked_decoder_; // Where the caller wants the body data. scoped_refptr<IOBuffer> user_read_buf_; - int user_read_buf_len_; + int user_read_buf_len_ = 0; // The callback to notify a user that the handshake has been confirmed. CompletionOnceCallback confirm_handshake_callback_; @@ -317,10 +317,10 @@ // Buffer used to send the request body. This points the same buffer as // |request_body_read_buf_| unless the data is chunked. scoped_refptr<SeekableIOBuffer> request_body_send_buf_; - bool sent_last_chunk_; + bool sent_last_chunk_ = false; // Error received when uploading the body, if any. - int upload_error_; + int upload_error_ = OK; MutableNetworkTrafficAnnotationTag traffic_annotation_;
diff --git a/net/http/http_stream_parser_unittest.cc b/net/http/http_stream_parser_unittest.cc index 62373540..d870cd1c 100644 --- a/net/http/http_stream_parser_unittest.cc +++ b/net/http/http_stream_parser_unittest.cc
@@ -1227,10 +1227,9 @@ public: SimpleGetRunner() : url_("http://localhost"), - read_buffer_(base::MakeRefCounted<GrowableIOBuffer>()), - sequence_number_(0) { - writes_.push_back(MockWrite( - SYNCHRONOUS, sequence_number_++, "GET / HTTP/1.1\r\n\r\n")); + read_buffer_(base::MakeRefCounted<GrowableIOBuffer>()) { + writes_.emplace_back( + MockWrite(SYNCHRONOUS, sequence_number_++, "GET / HTTP/1.1\r\n\r\n")); } void set_url(const GURL& url) { url_ = url; } @@ -1313,7 +1312,7 @@ std::unique_ptr<StreamSocket> stream_socket_; std::unique_ptr<SequencedSocketData> data_; std::unique_ptr<HttpStreamParser> parser_; - int sequence_number_; + int sequence_number_ = 0; }; // Test that HTTP/0.9 works as expected, only on ports where it should be
diff --git a/net/http/http_stream_request.cc b/net/http/http_stream_request.cc index 980bc74..c2446311e 100644 --- a/net/http/http_stream_request.cc +++ b/net/http/http_stream_request.cc
@@ -29,10 +29,6 @@ websocket_handshake_stream_create_helper_( websocket_handshake_stream_create_helper), net_log_(net_log), - completed_(false), - was_alpn_negotiated_(false), - negotiated_protocol_(kProtoUnknown), - using_spdy_(false), stream_type_(stream_type) { net_log_.BeginEvent(NetLogEventType::HTTP_STREAM_REQUEST); }
diff --git a/net/http/http_stream_request.h b/net/http/http_stream_request.h index a96da69..8b8eb41 100644 --- a/net/http/http_stream_request.h +++ b/net/http/http_stream_request.h
@@ -226,11 +226,11 @@ websocket_handshake_stream_create_helper_; const NetLogWithSource net_log_; - bool completed_; - bool was_alpn_negotiated_; + bool completed_ = false; + bool was_alpn_negotiated_ = false; // Protocol negotiated with the server. - NextProto negotiated_protocol_; - bool using_spdy_; + NextProto negotiated_protocol_ = kProtoUnknown; + bool using_spdy_ = false; ConnectionAttempts connection_attempts_; const StreamType stream_type_; };
diff --git a/net/http/http_transaction_test_util.cc b/net/http/http_transaction_test_util.cc index 7a4dd508..8ca74d0 100644 --- a/net/http/http_transaction_test_util.cc +++ b/net/http/http_transaction_test_util.cc
@@ -215,8 +215,7 @@ TestTransactionConsumer::TestTransactionConsumer( RequestPriority priority, - HttpTransactionFactory* factory) - : state_(State::kIdle), error_(OK) { + HttpTransactionFactory* factory) { // Disregard the error code. factory->CreateTransaction(priority, &trans_); ++quit_counter_; @@ -286,18 +285,9 @@ MockNetworkTransaction::MockNetworkTransaction(RequestPriority priority, MockNetworkLayer* factory) - : request_(nullptr), - data_cursor_(0), - content_length_(0), - priority_(priority), - read_handler_(nullptr), - websocket_handshake_stream_create_helper_(nullptr), + : priority_(priority), transaction_factory_(factory->AsWeakPtr()), - received_bytes_(0), - sent_bytes_(0), - socket_log_id_(NetLogSource::kInvalidId), - done_reading_called_(false), - reading_(false) {} + socket_log_id_(NetLogSource::kInvalidId) {} MockNetworkTransaction::~MockNetworkTransaction() { // Use request_ as in ~HttpNetworkTransaction to make sure its valid and not @@ -597,13 +587,7 @@ std::move(callback).Run(result); } -MockNetworkLayer::MockNetworkLayer() - : transaction_count_(0), - done_reading_called_(false), - stop_caching_called_(false), - last_create_transaction_priority_(DEFAULT_PRIORITY), - clock_(nullptr) { -} +MockNetworkLayer::MockNetworkLayer() = default; MockNetworkLayer::~MockNetworkLayer() = default;
diff --git a/net/http/http_transaction_test_util.h b/net/http/http_transaction_test_util.h index 18e0154..67f57e22 100644 --- a/net/http/http_transaction_test_util.h +++ b/net/http/http_transaction_test_util.h
@@ -170,11 +170,11 @@ void OnIOComplete(int result); - State state_; + State state_ = State::kIdle; std::unique_ptr<HttpTransaction> trans_; std::string content_; scoped_refptr<IOBuffer> read_buf_; - int error_; + int error_ = OK; static int quit_counter_; }; @@ -276,20 +276,20 @@ void CallbackLater(CompletionOnceCallback callback, int result); void RunCallback(CompletionOnceCallback callback, int result); - raw_ptr<const HttpRequestInfo> request_; + raw_ptr<const HttpRequestInfo> request_ = nullptr; HttpResponseInfo response_; std::string data_; - int64_t data_cursor_; - int64_t content_length_; + int64_t data_cursor_ = 0; + int64_t content_length_ = 0; int test_mode_; RequestPriority priority_; - MockTransactionReadHandler read_handler_; - raw_ptr<CreateHelper> websocket_handshake_stream_create_helper_; + MockTransactionReadHandler read_handler_ = nullptr; + raw_ptr<CreateHelper> websocket_handshake_stream_create_helper_ = nullptr; BeforeNetworkStartCallback before_network_start_callback_; ConnectedCallback connected_callback_; base::WeakPtr<MockNetworkLayer> transaction_factory_; - int64_t received_bytes_; - int64_t sent_bytes_; + int64_t received_bytes_ = 0; + int64_t sent_bytes_ = 0; // NetLog ID of the fake / non-existent underlying socket used by the // connection. Requires Start() be passed a NetLogWithSource with a real @@ -297,8 +297,8 @@ // be initialized. unsigned int socket_log_id_; - bool done_reading_called_; - bool reading_; + bool done_reading_called_ = false; + bool reading_ = false; CompletionOnceCallback resume_start_callback_; // used for pause and restart. @@ -356,14 +356,14 @@ base::Time Now(); private: - int transaction_count_; - bool done_reading_called_; - bool stop_caching_called_; - RequestPriority last_create_transaction_priority_; + int transaction_count_ = 0; + bool done_reading_called_ = false; + bool stop_caching_called_ = false; + RequestPriority last_create_transaction_priority_ = DEFAULT_PRIORITY; // By default clock_ is NULL but it can be set to a custom clock by test // frameworks using SetClock. - raw_ptr<base::Clock> clock_; + raw_ptr<base::Clock> clock_ = nullptr; base::WeakPtr<MockNetworkTransaction> last_transaction_; };
diff --git a/net/http/http_vary_data.cc b/net/http/http_vary_data.cc index 221978e..9b444b9 100644 --- a/net/http/http_vary_data.cc +++ b/net/http/http_vary_data.cc
@@ -15,8 +15,7 @@ namespace net { -HttpVaryData::HttpVaryData() : is_valid_(false) { -} +HttpVaryData::HttpVaryData() = default; bool HttpVaryData::Init(const HttpRequestInfo& request_info, const HttpResponseHeaders& response_headers) {
diff --git a/net/http/http_vary_data.h b/net/http/http_vary_data.h index 0f4ceb1..c251246 100644 --- a/net/http/http_vary_data.h +++ b/net/http/http_vary_data.h
@@ -79,7 +79,7 @@ base::MD5Digest request_digest_; // True when request_digest_ contains meaningful data. - bool is_valid_; + bool is_valid_ = false; }; } // namespace net
diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc index 5a6d8a7..790d31a 100644 --- a/net/http/mock_http_cache.cc +++ b/net/http/mock_http_cache.cc
@@ -55,18 +55,7 @@ }; MockDiskEntry::MockDiskEntry(const std::string& key) - : key_(key), - in_memory_data_(0), - max_file_size_(std::numeric_limits<int>::max()), - doomed_(false), - sparse_(false), - fail_requests_(0), - fail_sparse_requests_(false), - busy_(false), - delayed_(false), - cancel_(false), - defer_op_(DEFER_NONE), - resume_return_code_(0) { + : key_(key), max_file_size_(std::numeric_limits<int>::max()) { test_mode_ = GetTestModeForEntry(key); } @@ -393,19 +382,7 @@ //----------------------------------------------------------------------------- MockDiskCache::MockDiskCache() - : Backend(DISK_CACHE), - open_count_(0), - create_count_(0), - doomed_count_(0), - max_file_size_(std::numeric_limits<int>::max()), - fail_requests_(false), - soft_failures_(0), - soft_failures_one_instance_(0), - double_create_check_(true), - fail_sparse_requests_(false), - support_in_memory_entry_data_(true), - force_fail_callback_later_(false), - defer_op_(MockDiskEntry::DEFER_NONE) {} + : Backend(DISK_CACHE), max_file_size_(std::numeric_limits<int>::max()) {} MockDiskCache::~MockDiskCache() { ReleaseAll(); @@ -844,8 +821,7 @@ //----------------------------------------------------------------------------- -MockBlockingBackendFactory::MockBlockingBackendFactory() - : backend_(nullptr), block_(true), fail_(false) {} +MockBlockingBackendFactory::MockBlockingBackendFactory() = default; MockBlockingBackendFactory::~MockBlockingBackendFactory() = default;
diff --git a/net/http/mock_http_cache.h b/net/http/mock_http_cache.h index f0bef5b..9068a3d 100644 --- a/net/http/mock_http_cache.h +++ b/net/http/mock_http_cache.h
@@ -137,21 +137,21 @@ std::string key_; std::vector<char> data_[kNumCacheEntryDataIndices]; - uint8_t in_memory_data_; + uint8_t in_memory_data_ = 0; int test_mode_; int max_file_size_; - bool doomed_; - bool sparse_; - int fail_requests_; - bool fail_sparse_requests_; - bool busy_; - bool delayed_; - bool cancel_; + bool doomed_ = false; + bool sparse_ = false; + int fail_requests_ = 0; + bool fail_sparse_requests_ = false; + bool busy_ = false; + bool delayed_ = false; + bool cancel_ = false; // Used for pause and restart. - DeferOp defer_op_; + DeferOp defer_op_ = DEFER_NONE; CompletionOnceCallback resume_callback_; - int resume_return_code_; + int resume_return_code_ = 0; static bool ignore_callbacks_; }; @@ -261,20 +261,20 @@ EntryMap entries_; std::vector<std::string> external_cache_hits_; - int open_count_; - int create_count_; - int doomed_count_; + int open_count_ = 0; + int create_count_ = 0; + int doomed_count_ = 0; int max_file_size_; - bool fail_requests_; - int soft_failures_; - int soft_failures_one_instance_; - bool double_create_check_; - bool fail_sparse_requests_; - bool support_in_memory_entry_data_; - bool force_fail_callback_later_; + bool fail_requests_ = false; + int soft_failures_ = 0; + int soft_failures_one_instance_ = 0; + bool double_create_check_ = true; + bool fail_sparse_requests_ = false; + bool support_in_memory_entry_data_ = true; + bool force_fail_callback_later_ = false; // Used for pause and restart. - MockDiskEntry::DeferOp defer_op_; + MockDiskEntry::DeferOp defer_op_ = MockDiskEntry::DEFER_NONE; base::OnceClosure resume_callback_; }; @@ -385,10 +385,10 @@ private: int Result() { return fail_ ? ERR_FAILED : OK; } - raw_ptr<std::unique_ptr<disk_cache::Backend>> backend_; + raw_ptr<std::unique_ptr<disk_cache::Backend>> backend_ = nullptr; CompletionOnceCallback callback_; - bool block_; - bool fail_; + bool block_ = true; + bool fail_ = false; }; } // namespace net
diff --git a/net/http/partial_data.cc b/net/http/partial_data.cc index 1c7a8c4..7c60c51 100644 --- a/net/http/partial_data.cc +++ b/net/http/partial_data.cc
@@ -31,18 +31,7 @@ } // namespace -PartialData::PartialData() - : current_range_start_(0), - current_range_end_(0), - cached_start_(0), - cached_min_len_(0), - resource_size_(0), - range_requested_(false), - range_present_(false), - final_range_(false), - sparse_entry_(true), - truncated_(false), - initial_validation_(false) {} +PartialData::PartialData() = default; PartialData::~PartialData() = default;
diff --git a/net/http/partial_data.h b/net/http/partial_data.h index 16510de5..4f6fe440 100644 --- a/net/http/partial_data.h +++ b/net/http/partial_data.h
@@ -136,8 +136,8 @@ void GetAvailableRangeCompleted(const disk_cache::RangeResult& result); // The portion we're trying to get, either from cache or network. - int64_t current_range_start_; - int64_t current_range_end_; + int64_t current_range_start_ = 0; + int64_t current_range_end_ = 0; // Next portion available in the cache --- this may be what's currently being // read, or the next thing that will be read if the current network portion @@ -146,20 +146,20 @@ // |cached_start_| represents the beginning of the range, while // |cached_min_len_| the data not yet read (possibly overestimated). It may // also have an error code latched into it. - int64_t cached_start_; - int cached_min_len_; + int64_t cached_start_ = 0; + int cached_min_len_ = 0; // The size of the whole file. - int64_t resource_size_; + int64_t resource_size_ = 0; HttpByteRange byte_range_; // The range requested by the user. // The clean set of extra headers (no ranges). HttpRequestHeaders extra_headers_; - bool range_requested_; // ### - bool range_present_; // True if next range entry is already stored. - bool final_range_; - bool sparse_entry_; - bool truncated_; // We have an incomplete 200 stored. - bool initial_validation_; // Only used for truncated entries. + bool range_requested_ = false; // ### + bool range_present_ = false; // True if next range entry is already stored. + bool final_range_ = false; + bool sparse_entry_ = true; + bool truncated_ = false; // We have an incomplete 200 stored. + bool initial_validation_ = false; // Only used for truncated entries. CompletionOnceCallback callback_; base::WeakPtrFactory<PartialData> weak_factory_{this}; };
diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc index f920d29..f5217b3 100644 --- a/net/http/transport_security_state.cc +++ b/net/http/transport_security_state.cc
@@ -1388,9 +1388,7 @@ hashed_host, network_isolation_key)] = state; } -TransportSecurityState::STSState::STSState() - : upgrade_mode(MODE_DEFAULT), include_subdomains(false) { -} +TransportSecurityState::STSState::STSState() = default; TransportSecurityState::STSState::~STSState() = default; @@ -1406,14 +1404,13 @@ TransportSecurityState::STSStateIterator::~STSStateIterator() = default; -TransportSecurityState::PKPState::PKPState() : include_subdomains(false) { -} +TransportSecurityState::PKPState::PKPState() = default; TransportSecurityState::PKPState::PKPState(const PKPState& other) = default; TransportSecurityState::PKPState::~PKPState() = default; -TransportSecurityState::ExpectCTState::ExpectCTState() : enforce(false) {} +TransportSecurityState::ExpectCTState::ExpectCTState() = default; TransportSecurityState::ExpectCTState::~ExpectCTState() = default;
diff --git a/net/http/transport_security_state.h b/net/http/transport_security_state.h index 17e8bac..0e003911 100644 --- a/net/http/transport_security_state.h +++ b/net/http/transport_security_state.h
@@ -125,10 +125,10 @@ // expires. base::Time expiry; - UpgradeMode upgrade_mode; + UpgradeMode upgrade_mode = MODE_DEFAULT; // Are subdomains subject to this policy state? - bool include_subdomains; + bool include_subdomains = false; // The domain which matched during a search for this STSState entry. // Updated by |GetDynamicSTSState| and |GetStaticDomainState|. @@ -191,7 +191,7 @@ HashValueVector bad_spki_hashes; // Are subdomains subject to this policy state? - bool include_subdomains; + bool include_subdomains = false; // The domain which matched during a search for this DomainState entry. // Updated by |GetDynamicPKPState| and |GetStaticDomainState|. @@ -239,7 +239,7 @@ // True if connections should be closed if they do not comply with the CT // policy. If false, noncompliant connections will be allowed but reports // will be sent about the violation. - bool enforce; + bool enforce = false; // The absolute time (UTC) when the Expect-CT state was last observed. base::Time last_observed; // The absolute time (UTC) when the Expect-CT state expires.
diff --git a/net/http/transport_security_state_unittest.cc b/net/http/transport_security_state_unittest.cc index 27a596c..72ea47e 100644 --- a/net/http/transport_security_state_unittest.cc +++ b/net/http/transport_security_state_unittest.cc
@@ -164,7 +164,7 @@ class MockFailingCertificateReportSender : public TransportSecurityState::ReportSenderInterface { public: - MockFailingCertificateReportSender() : net_error_(ERR_CONNECTION_FAILED) {} + MockFailingCertificateReportSender() = default; ~MockFailingCertificateReportSender() override = default; int net_error() { return net_error_; } @@ -182,14 +182,14 @@ } private: - const int net_error_; + const int net_error_ = ERR_CONNECTION_FAILED; }; // A mock ExpectCTReporter that remembers the latest violation that was // reported and the number of violations reported. class MockExpectCTReporter : public TransportSecurityState::ExpectCTReporter { public: - MockExpectCTReporter() : num_failures_(0) {} + MockExpectCTReporter() = default; ~MockExpectCTReporter() override = default; void OnExpectCTFailed( @@ -233,7 +233,7 @@ HostPortPair host_port_pair_; GURL report_uri_; base::Time expiration_; - uint32_t num_failures_; + uint32_t num_failures_ = 0; raw_ptr<const X509Certificate> served_certificate_chain_; raw_ptr<const X509Certificate> validated_certificate_chain_; SignedCertificateTimestampAndStatusList signed_certificate_timestamps_;
diff --git a/net/proxy_resolution/proxy_list_unittest.cc b/net/proxy_resolution/proxy_list_unittest.cc index c198469..2a0132e 100644 --- a/net/proxy_resolution/proxy_list_unittest.cc +++ b/net/proxy_resolution/proxy_list_unittest.cc
@@ -173,7 +173,6 @@ } TEST(ProxyListTest, UpdateRetryInfoOnFallback) { - ProxyRetryInfo proxy_retry_info; // Retrying should put the first proxy on the retry list. { ProxyList list;
diff --git a/net/proxy_resolution/proxy_retry_info.h b/net/proxy_resolution/proxy_retry_info.h index 23d5d75..2f85527 100644 --- a/net/proxy_resolution/proxy_retry_info.h +++ b/net/proxy_resolution/proxy_retry_info.h
@@ -13,7 +13,7 @@ // Contains the information about when to retry a proxy server. struct ProxyRetryInfo { - ProxyRetryInfo() : try_while_bad(true), net_error(0) {} + ProxyRetryInfo() = default; // We should not retry until this time. base::TimeTicks bad_until; @@ -23,12 +23,12 @@ base::TimeDelta current_delay; // True if this proxy should be considered even if still bad. - bool try_while_bad; + bool try_while_bad = true; // The network error received when this proxy failed, or |OK| if the proxy // was added to the retry list for a non-network related reason. (e.g. local // policy). - int net_error; + int net_error = 0; }; // Map of proxy servers with the associated RetryInfo structures.
diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h index 68e0ea9..147b03a 100644 --- a/net/socket/socket_test_util.h +++ b/net/socket/socket_test_util.h
@@ -610,7 +610,7 @@ template <typename T> class SocketDataProviderArray { public: - SocketDataProviderArray() : next_index_(0) {} + SocketDataProviderArray() = default; T* GetNext() { DCHECK_LT(next_index_, data_providers_.size()); @@ -639,7 +639,7 @@ private: // Index of the next |data_providers_| element to use. Not an iterator // because those are invalidated on vector reallocation. - size_t next_index_; + size_t next_index_ = 0; // SocketDataProviders to be returned. std::vector<T*> data_providers_;
diff --git a/remoting/host/webauthn/remote_webauthn_native_messaging_host_unittest.cc b/remoting/host/webauthn/remote_webauthn_native_messaging_host_unittest.cc index 1420892..e91f01d 100644 --- a/remoting/host/webauthn/remote_webauthn_native_messaging_host_unittest.cc +++ b/remoting/host/webauthn/remote_webauthn_native_messaging_host_unittest.cc
@@ -8,6 +8,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/memory/ptr_util.h" +#include "base/memory/raw_ptr.h" #include "base/notreached.h" #include "base/run_loop.h" #include "base/test/gmock_callback_support.h" @@ -128,7 +129,7 @@ void ResetReceiver(); MockWebAuthnProxy webauthn_proxy_; - MockChromotingHostServicesProvider* api_provider_; + raw_ptr<MockChromotingHostServicesProvider> api_provider_; MockChromotingSessionServices api_; private:
diff --git a/remoting/ios/DEPS b/remoting/ios/DEPS index 3b6691ff..1ef6988 100644 --- a/remoting/ios/DEPS +++ b/remoting/ios/DEPS
@@ -15,4 +15,5 @@ "+third_party/ocmock", "+third_party/protobuf/src", "+services/network/public/cpp", + "+ui/display", ]
diff --git a/remoting/ios/facade/BUILD.gn b/remoting/ios/facade/BUILD.gn index 9ae2b2b..1ed965e 100644 --- a/remoting/ios/facade/BUILD.gn +++ b/remoting/ios/facade/BUILD.gn
@@ -56,6 +56,7 @@ "//testing/gtest", "//third_party/ocmock", "//ui/base", + "//ui/display", ] configs += [ "//build/config/compiler:enable_arc" ]
diff --git a/remoting/ios/facade/host_list_service_unittest.mm b/remoting/ios/facade/host_list_service_unittest.mm index d8304324..e0412c93 100644 --- a/remoting/ios/facade/host_list_service_unittest.mm +++ b/remoting/ios/facade/host_list_service_unittest.mm
@@ -29,6 +29,7 @@ #include "testing/platform_test.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/display/screen.h" #define EXPECT_HOST_LIST_STATE(expected) \ EXPECT_EQ(expected, host_list_service_.state()) @@ -83,6 +84,7 @@ private: base::CallbackListSubscription host_list_state_subscription_; base::CallbackListSubscription fetch_failure_subscription_; + display::ScopedNativeScreen screen_; }; HostListServiceTest::HostListServiceTest()
diff --git a/services/network/cors/preflight_controller.cc b/services/network/cors/preflight_controller.cc index b036012..8015618 100644 --- a/services/network/cors/preflight_controller.cc +++ b/services/network/cors/preflight_controller.cc
@@ -131,6 +131,22 @@ header_names::kAccessControlRequestPrivateNetwork, "true"); } + // Copy the client security state as well, if set in the request's trusted + // params. Note that the we clone the pointer unconditionally if the original + // request has trusted params, but that the cloned pointer may be null. It is + // unclear whether it is safe to copy all the trusted params, so we only copy + // what we need for PNA. + // + // This is useful when the client security state is not specified through the + // URL loader factory params, typically when a single URL loader factory is + // shared by a few different client contexts. This is the case for + // navigations and interest group auctions. + if (request.trusted_params.has_value()) { + preflight_request->trusted_params = ResourceRequest::TrustedParams(); + preflight_request->trusted_params->client_security_state = + request.trusted_params->client_security_state.Clone(); + } + DCHECK(request.request_initiator); preflight_request->request_initiator = request.request_initiator; preflight_request->headers.SetHeader(
diff --git a/services/network/cors/preflight_controller_unittest.cc b/services/network/cors/preflight_controller_unittest.cc index 9911a7f..0815105e 100644 --- a/services/network/cors/preflight_controller_unittest.cc +++ b/services/network/cors/preflight_controller_unittest.cc
@@ -422,6 +422,9 @@ // the URLLoader would create a CORS-preflight for the preflight request. params->disable_web_security = true; params->is_corb_enabled = false; + // Allow setting TrustedParams on requests, specifically to pass + // ClientSecurityState to the underlying URLLoader. + params->is_trusted = true; devtools_observer_ = std::make_unique<MockDevToolsObserver>( params->devtools_observer.InitWithNewPipeAndPassReceiver()); network_context_remote_->CreateURLLoaderFactory( @@ -723,6 +726,13 @@ mojom::PrivateNetworkRequestPolicy::kPreflightWarn) .Build(); + // Set the client security state in the request's trusted params, because the + // test uses a shared factory with no client security state in its factory + // params, and URLLoader expects requests with a target IP address space to + // carry a client security state. + request.trusted_params = ResourceRequest::TrustedParams(); + request.trusted_params->client_security_state = client_security_state.Clone(); + PerformPreflightCheck(request, /*tainted=*/false, net::IsolationInfo(), EnforcePrivateNetworkAccessHeader(true), std::move(client_security_state)); @@ -768,6 +778,13 @@ mojom::PrivateNetworkRequestPolicy::kPreflightWarn) .Build(); + // Set the client security state in the request's trusted params, because the + // test uses a shared factory with no client security state in its factory + // params, and URLLoader expects requests with a target IP address space to + // carry a client security state. + request.trusted_params = ResourceRequest::TrustedParams(); + request.trusted_params->client_security_state = client_security_state.Clone(); + PerformPreflightCheck(request, /*tainted=*/false, net::IsolationInfo(), EnforcePrivateNetworkAccessHeader(true), std::move(client_security_state)); @@ -795,6 +812,13 @@ mojom::PrivateNetworkRequestPolicy::kPreflightBlock) .Build(); + // Set the client security state in the request's trusted params, because the + // test uses a shared factory with no client security state in its factory + // params, and URLLoader expects requests with a target IP address space to + // carry a client security state. + request.trusted_params = ResourceRequest::TrustedParams(); + request.trusted_params->client_security_state = client_security_state.Clone(); + PerformPreflightCheck(request, /*tainted=*/false, net::IsolationInfo(), EnforcePrivateNetworkAccessHeader(true), std::move(client_security_state));
diff --git a/services/network/private_network_access_checker.cc b/services/network/private_network_access_checker.cc index 5fc17abaf..5a8added 100644 --- a/services/network/private_network_access_checker.cc +++ b/services/network/private_network_access_checker.cc
@@ -61,7 +61,17 @@ request_client_security_state_.get())), should_block_local_request_(url_load_options & mojom::kURLLoadOptionBlockLocalRequest), - target_address_space_(request.target_ip_address_space) {} + target_address_space_(request.target_ip_address_space) { + if (!client_security_state_ || + client_security_state_->private_network_request_policy == + mojom::PrivateNetworkRequestPolicy::kAllow) { + // No client security state means PNA is implicitly disabled. A policy of + // `kAllow` means PNA is explicitly disabled. In both cases, the target IP + // address space should not be set on the request. + DCHECK_EQ(target_address_space_, mojom::IPAddressSpace::kUnknown) + << request.url; + } +} PrivateNetworkAccessChecker::~PrivateNetworkAccessChecker() { base::UmaHistogramBoolean( @@ -141,47 +151,60 @@ return Result::kBlockedByLoadOption; } + // `response_address_space_` behaves similarly to `target_address_space_`, + // except `kUnknown` is also subject to checks (instead + // `response_address_space_ == absl::nullopt` indicates that no check + // should be performed). + bool is_inconsistent_address_space = + response_address_space_.has_value() && + resource_address_space != *response_address_space_; + + // A single response may connect to two different IP address spaces without + // a redirect in between. This can happen due to split range requests, where + // a single `URLRequest` issues multiple network transactions, or when we + // create a new connection after auth credentials have been provided, etc. + // + // We record this even if there is no client security state or the policy is + // `kAllow` in order to estimate the compatibility risk of this check without + // having to enable PNA. + has_connected_to_mismatched_address_spaces_ |= is_inconsistent_address_space; + + if (!client_security_state_) { + return Result::kAllowedMissingClientSecurityState; + } + + mojom::PrivateNetworkRequestPolicy policy = + client_security_state_->private_network_request_policy; + + if (policy == mojom::PrivateNetworkRequestPolicy::kAllow) { + return Result::kAllowedByPolicyAllow; + } + if (target_address_space_ != mojom::IPAddressSpace::kUnknown) { if (resource_address_space == target_address_space_) { return Result::kAllowedByTargetIpAddressSpace; } - if (IsPolicyPreflightWarn()) { + if (policy == mojom::PrivateNetworkRequestPolicy::kPreflightWarn) { return Result::kAllowedByPolicyPreflightWarn; } return Result::kBlockedByTargetIpAddressSpace; } - if (response_address_space_.has_value() && - resource_address_space != *response_address_space_) { - // A single response may connect to two different IP address spaces without - // a redirect in between. This can happen due to split range requests, where - // a single `URLRequest` issues multiple network transactions, or when we - // create a new connection after auth credentials have been provided, etc. - has_connected_to_mismatched_address_spaces_ = true; - - // `response_address_space_` behaves similarly to `target_address_space_`, - // except `kUnknown` is also subject to checks (instead - // `response_address_space_ == absl::nullopt` indicates that no check - // should be performed). - // + if (is_inconsistent_address_space) { // If the policy is `kPreflightWarn`, the request should not fail just // because of this check - PNA checks are only experimentally turned on // for this request. Further checks should not be run, otherwise we might // return `kBlockedByPolicyPreflightWarn` and trigger a new preflight to be // sent, thus causing https://crbug.com/1279376 all over again. - if (IsPolicyPreflightWarn()) { + if (policy == mojom::PrivateNetworkRequestPolicy::kPreflightWarn) { return Result::kAllowedByPolicyPreflightWarn; } return Result::kBlockedByInconsistentIpAddressSpace; } - if (!client_security_state_) { - return Result::kAllowedMissingClientSecurityState; - } - if (!IsLessPublicAddressSpace(resource_address_space, client_security_state_->ip_address_space)) { return Result::kAllowedNoLessPublic; @@ -189,8 +212,9 @@ // We use a switch statement to force this code to be amended when values are // added to the `PrivateNetworkRequestPolicy` enum. - switch (client_security_state_->private_network_request_policy) { + switch (policy) { case Policy::kAllow: + NOTREACHED(); // Should have been handled by the if statement above. return Result::kAllowedByPolicyAllow; case Policy::kWarn: return Result::kAllowedByPolicyWarn;
diff --git a/services/network/private_network_access_checker.h b/services/network/private_network_access_checker.h index 38f3926..25eb8d039 100644 --- a/services/network/private_network_access_checker.h +++ b/services/network/private_network_access_checker.h
@@ -132,6 +132,9 @@ // // Copied from `ResourceRequest::target_ip_address_space`. // + // Invariant: always `kUnknown` if `client_security_state_` is nullptr, or + // if `client_security_state_->private_network_request_policy` is `kAllow`. + // // https://wicg.github.io/private-network-access/#request-target-ip-address-space mojom::IPAddressSpace target_address_space_;
diff --git a/services/network/private_network_access_checker_unittest.cc b/services/network/private_network_access_checker_unittest.cc index 5b34cdcc..b6d6eb7 100644 --- a/services/network/private_network_access_checker_unittest.cc +++ b/services/network/private_network_access_checker_unittest.cc
@@ -171,13 +171,37 @@ kCheckResultHistogramName, Result::kAllowedMissingClientSecurityState, 1); } +TEST(PrivateNetworkAccessCheckerTest, + CheckAllowedMissingClientSecurityStateInconsistentIpAddressSpace) { + base::HistogramTester histogram_tester; + + mojom::URLLoaderFactoryParams factory_params; + PrivateNetworkAccessChecker checker(ResourceRequest(), &factory_params, + mojom::kURLLoadOptionNone); + + EXPECT_EQ(checker.Check(DirectTransport(LocalEndpoint())), + Result::kAllowedMissingClientSecurityState); + + // Even though this is inconsistent with the previous IP address space, the + // inconsistency is ignored because of the missing client security state. + // + // This does not risk triggering https://crbug.com/1279376, because no check + // with this checker will ever return `kBlocked*`. + EXPECT_EQ(checker.Check(DirectTransport(PublicEndpoint())), + Result::kAllowedMissingClientSecurityState); +} + TEST(PrivateNetworkAccessCheckerTest, CheckAllowedNoLessPublic) { base::HistogramTester histogram_tester; - mojom::URLLoaderFactoryParamsPtr factory_params = - FactoryParamsWithClientAddressSpace(mojom::IPAddressSpace::kPrivate); + mojom::URLLoaderFactoryParams factory_params; + factory_params.client_security_state = mojom::ClientSecurityState::New(); + factory_params.client_security_state->ip_address_space = + mojom::IPAddressSpace::kPrivate; + factory_params.client_security_state->private_network_request_policy = + mojom::PrivateNetworkRequestPolicy::kBlock; - PrivateNetworkAccessChecker checker(ResourceRequest(), factory_params.get(), + PrivateNetworkAccessChecker checker(ResourceRequest(), &factory_params, mojom::kURLLoadOptionNone); EXPECT_EQ(checker.Check(DirectTransport(PrivateEndpoint())), @@ -207,6 +231,32 @@ Result::kAllowedByPolicyAllow, 1); } +TEST(PrivateNetworkAccessCheckerTest, + CheckAllowedByPolicyAllowInconsistentIpAddressSpace) { + base::HistogramTester histogram_tester; + + auto factory_params = mojom::URLLoaderFactoryParams::New(); + factory_params->client_security_state = mojom::ClientSecurityState::New(); + factory_params->client_security_state->ip_address_space = + mojom::IPAddressSpace::kPublic; + factory_params->client_security_state->private_network_request_policy = + mojom::PrivateNetworkRequestPolicy::kAllow; + + PrivateNetworkAccessChecker checker(ResourceRequest(), factory_params.get(), + mojom::kURLLoadOptionNone); + + EXPECT_EQ(checker.Check(DirectTransport(PrivateEndpoint())), + Result::kAllowedByPolicyAllow); + + // Even though this is inconsistent with the previous IP address space, the + // inconsistency is ignored because of the `kAllow` policy. + // + // This does not risk triggering https://crbug.com/1279376, because no check + // with this checker will ever return `kBlocked*`. + EXPECT_EQ(checker.Check(DirectTransport(PublicEndpoint())), + Result::kAllowedByPolicyAllow); +} + TEST(PrivateNetworkAccessCheckerTest, CheckAllowedByPolicyWarn) { base::HistogramTester histogram_tester; @@ -291,6 +341,11 @@ base::HistogramTester histogram_tester; mojom::URLLoaderFactoryParams factory_params; + factory_params.client_security_state = mojom::ClientSecurityState::New(); + factory_params.client_security_state->ip_address_space = + mojom::IPAddressSpace::kPublic; + factory_params.client_security_state->private_network_request_policy = + mojom::PrivateNetworkRequestPolicy::kPreflightBlock; ResourceRequest request; request.target_ip_address_space = mojom::IPAddressSpace::kPublic; @@ -332,6 +387,11 @@ base::HistogramTester histogram_tester; mojom::URLLoaderFactoryParams factory_params; + factory_params.client_security_state = mojom::ClientSecurityState::New(); + factory_params.client_security_state->ip_address_space = + mojom::IPAddressSpace::kPublic; + factory_params.client_security_state->private_network_request_policy = + mojom::PrivateNetworkRequestPolicy::kPreflightBlock; ResourceRequest request; request.target_ip_address_space = mojom::IPAddressSpace::kPrivate; @@ -372,12 +432,17 @@ TEST(PrivateNetworkAccessCheckerTest, CheckBlockedByInconsistentIpAddressSpace) { mojom::URLLoaderFactoryParams factory_params; + factory_params.client_security_state = mojom::ClientSecurityState::New(); + factory_params.client_security_state->ip_address_space = + mojom::IPAddressSpace::kPrivate; + factory_params.client_security_state->private_network_request_policy = + mojom::PrivateNetworkRequestPolicy::kPreflightBlock; PrivateNetworkAccessChecker checker(ResourceRequest(), &factory_params, mojom::kURLLoadOptionNone); EXPECT_EQ(checker.Check(DirectTransport(PublicEndpoint())), - Result::kAllowedMissingClientSecurityState); + Result::kAllowedNoLessPublic); base::HistogramTester histogram_tester; @@ -445,6 +510,11 @@ TEST(PrivateNetworkAccessCheckerTest, ResetForRedirectTargetAddressSpace) { mojom::URLLoaderFactoryParams factory_params; + factory_params.client_security_state = mojom::ClientSecurityState::New(); + factory_params.client_security_state->ip_address_space = + mojom::IPAddressSpace::kPrivate; + factory_params.client_security_state->private_network_request_policy = + mojom::PrivateNetworkRequestPolicy::kPreflightBlock; ResourceRequest request; request.target_ip_address_space = mojom::IPAddressSpace::kPublic; @@ -459,8 +529,8 @@ // This succeeds even though the IP address space does not match the target // passed at construction time, thanks to `ResetForRedirect()`. - EXPECT_EQ(checker.Check(DirectTransport(LocalEndpoint())), - Result::kAllowedMissingClientSecurityState); + EXPECT_EQ(checker.Check(DirectTransport(PrivateEndpoint())), + Result::kAllowedNoLessPublic); } TEST(PrivateNetworkAccessCheckerTest, ResetForRedirectResponseAddressSpace) {
diff --git a/services/network/public/cpp/private_network_access_check_result.cc b/services/network/public/cpp/private_network_access_check_result.cc index 0f49ff2..b1b7dad 100644 --- a/services/network/public/cpp/private_network_access_check_result.cc +++ b/services/network/public/cpp/private_network_access_check_result.cc
@@ -4,6 +4,8 @@ #include "services/network/public/cpp/private_network_access_check_result.h" +#include <ostream> + #include "base/strings/string_piece.h" #include "services/network/public/mojom/cors.mojom-shared.h" @@ -42,6 +44,11 @@ } } +std::ostream& operator<<(std::ostream& out, + PrivateNetworkAccessCheckResult result) { + return out << PrivateNetworkAccessCheckResultToStringPiece(result); +} + absl::optional<CorsError> PrivateNetworkAccessCheckResultToCorsError( Result result) { switch (result) {
diff --git a/services/network/public/cpp/private_network_access_check_result.h b/services/network/public/cpp/private_network_access_check_result.h index 858a88f..2ba8fd6 100644 --- a/services/network/public/cpp/private_network_access_check_result.h +++ b/services/network/public/cpp/private_network_access_check_result.h
@@ -5,6 +5,8 @@ #ifndef SERVICES_NETWORK_PUBLIC_CPP_PRIVATE_NETWORK_ACCESS_CHECK_RESULT_H_ #define SERVICES_NETWORK_PUBLIC_CPP_PRIVATE_NETWORK_ACCESS_CHECK_RESULT_H_ +#include <iosfwd> + #include "base/component_export.h" #include "base/strings/string_piece_forward.h" #include "services/network/public/mojom/cors.mojom-forward.h" @@ -68,6 +70,13 @@ PrivateNetworkAccessCheckResultToStringPiece( PrivateNetworkAccessCheckResult result); +// Results are streamable for easier logging and debugging. +// +// `COMPONENT_EXPORT()` must come first to compile correctly on Windows. +COMPONENT_EXPORT(NETWORK_CPP) +std::ostream& operator<<(std::ostream& out, + PrivateNetworkAccessCheckResult result); + // If `result` indicates that the request should be blocked, returns the // corresponding `CorsError` enum value. Otherwise returns `nullopt`. absl::optional<mojom::CorsError> COMPONENT_EXPORT(NETWORK_CPP)
diff --git a/services/network/sct_auditing/sct_auditing_handler.h b/services/network/sct_auditing/sct_auditing_handler.h index df604d7..16c426e 100644 --- a/services/network/sct_auditing/sct_auditing_handler.h +++ b/services/network/sct_auditing/sct_auditing_handler.h
@@ -9,6 +9,7 @@ #include "base/containers/lru_cache.h" #include "base/files/important_file_writer.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/task/sequenced_task_runner.h" #include "base/timer/timer.h" @@ -139,7 +140,7 @@ mojom::URLLoaderFactory* GetURLLoaderFactory(); // The NetworkContext which owns this SCTAuditingHandler. - NetworkContext* owner_network_context_; + raw_ptr<NetworkContext> owner_network_context_; // The pending reporters set is an LRUCache, so that the total number of // pending reporters can be capped. The LRUCache means that reporters will be
diff --git a/services/network/sct_auditing/sct_auditing_reporter.h b/services/network/sct_auditing/sct_auditing_reporter.h index da861902..e5b5172 100644 --- a/services/network/sct_auditing/sct_auditing_reporter.h +++ b/services/network/sct_auditing/sct_auditing_reporter.h
@@ -9,6 +9,7 @@ #include "base/callback_forward.h" #include "base/component_export.h" +#include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/time/time.h" #include "base/values.h" @@ -175,7 +176,7 @@ // The NetworkContext which owns the SCTAuditingHandler that created this // Reporter. - NetworkContext* owner_network_context_; + raw_ptr<NetworkContext> owner_network_context_; net::HashValue reporter_key_; std::unique_ptr<sct_auditing::SCTClientReport> report_;
diff --git a/services/network/tcp_client_socket_brokered.h b/services/network/tcp_client_socket_brokered.h index 8016b8c..f564a5e8 100644 --- a/services/network/tcp_client_socket_brokered.h +++ b/services/network/tcp_client_socket_brokered.h
@@ -6,6 +6,7 @@ #define SERVICES_NETWORK_TCP_CLIENT_SOCKET_BROKERED_H_ #include "base/component_export.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "build/build_config.h" #include "net/base/address_list.h" @@ -107,9 +108,9 @@ // Arguments for creating a new TCPClientSocket std::unique_ptr<net::SocketPerformanceWatcher> socket_performance_watcher_; - net::NetworkQualityEstimator* network_quality_estimator_; + raw_ptr<net::NetworkQualityEstimator> network_quality_estimator_; - net::NetLog* net_log_; + raw_ptr<net::NetLog> net_log_; const net::NetLogSource source_;
diff --git a/services/network/test/url_loader_context_for_tests.h b/services/network/test/url_loader_context_for_tests.h index 9a79ff83..b10a932 100644 --- a/services/network/test/url_loader_context_for_tests.h +++ b/services/network/test/url_loader_context_for_tests.h
@@ -5,6 +5,7 @@ #ifndef SERVICES_NETWORK_TEST_URL_LOADER_CONTEXT_FOR_TESTS_H_ #define SERVICES_NETWORK_TEST_URL_LOADER_CONTEXT_FOR_TESTS_H_ +#include "base/memory/raw_ptr.h" #include "services/network/public/cpp/corb/corb_api.h" #include "services/network/public/cpp/cors/origin_access_list.h" #include "services/network/public/mojom/network_context.mojom.h" @@ -62,9 +63,9 @@ cors::OriginAccessList origin_access_list_; corb::PerFactoryState corb_state_; - mojom::NetworkContextClient* network_context_client_ = nullptr; - mojom::OriginPolicyManager* origin_policy_manager_ = nullptr; - net::URLRequestContext* url_request_context_ = nullptr; + raw_ptr<mojom::NetworkContextClient> network_context_client_ = nullptr; + raw_ptr<mojom::OriginPolicyManager> origin_policy_manager_ = nullptr; + raw_ptr<net::URLRequestContext> url_request_context_ = nullptr; scoped_refptr<ResourceSchedulerClient> resource_scheduler_client_; };
diff --git a/services/network/url_loader.h b/services/network/url_loader.h index d545b333b..6bddb19 100644 --- a/services/network/url_loader.h +++ b/services/network/url_loader.h
@@ -621,13 +621,13 @@ // CookieAccessObserver implementation from the URLLoaderContext aka // URLLoaderFactory). const mojo::Remote<mojom::CookieAccessObserver> cookie_observer_remote_; - mojom::CookieAccessObserver* const cookie_observer_ = nullptr; + const raw_ptr<mojom::CookieAccessObserver> cookie_observer_ = nullptr; const mojo::Remote<mojom::URLLoaderNetworkServiceObserver> url_loader_network_observer_remote_; - mojom::URLLoaderNetworkServiceObserver* const url_loader_network_observer_ = - nullptr; + const raw_ptr<mojom::URLLoaderNetworkServiceObserver> + url_loader_network_observer_ = nullptr; const mojo::Remote<mojom::DevToolsObserver> devtools_observer_remote_; - mojom::DevToolsObserver* const devtools_observer_ = nullptr; + const raw_ptr<mojom::DevToolsObserver> devtools_observer_ = nullptr; // Indicates |url_request_| is fetch upload request and that has streaming // body.
diff --git a/services/network/windows_system_proxy_resolver_mojo.cc b/services/network/windows_system_proxy_resolver_mojo.cc index 1f8e79bc..f41d946 100644 --- a/services/network/windows_system_proxy_resolver_mojo.cc +++ b/services/network/windows_system_proxy_resolver_mojo.cc
@@ -7,6 +7,7 @@ #include <utility> #include "base/bind.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "net/proxy_resolution/proxy_list.h" @@ -33,7 +34,7 @@ // As described at WindowsSystemProxyResolutionRequest::GetProxyForUrl, // `callback_target_` must outlive `this`. - net::WindowsSystemProxyResolutionRequest* callback_target_; + raw_ptr<net::WindowsSystemProxyResolutionRequest> callback_target_; SEQUENCE_CHECKER(sequence_checker_); base::WeakPtrFactory<WindowsSystemProxyResolverMojo::RequestImpl>
diff --git a/services/viz/public/cpp/compositing/shared_quad_state_mojom_traits.h b/services/viz/public/cpp/compositing/shared_quad_state_mojom_traits.h index 0ddd869..134054a 100644 --- a/services/viz/public/cpp/compositing/shared_quad_state_mojom_traits.h +++ b/services/viz/public/cpp/compositing/shared_quad_state_mojom_traits.h
@@ -5,6 +5,7 @@ #ifndef SERVICES_VIZ_PUBLIC_CPP_COMPOSITING_SHARED_QUAD_STATE_MOJOM_TRAITS_H_ #define SERVICES_VIZ_PUBLIC_CPP_COMPOSITING_SHARED_QUAD_STATE_MOJOM_TRAITS_H_ +#include "base/memory/raw_ptr.h" #include "components/viz/common/quads/shared_quad_state.h" #include "services/viz/public/mojom/compositing/shared_quad_state.mojom-shared.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -14,7 +15,7 @@ namespace mojo { struct OptSharedQuadState { - const viz::SharedQuadState* sqs; + raw_ptr<const viz::SharedQuadState> sqs; }; template <>
diff --git a/services/viz/public/cpp/gpu/context_provider_command_buffer.h b/services/viz/public/cpp/gpu/context_provider_command_buffer.h index 8e87fea..35739ea 100644 --- a/services/viz/public/cpp/gpu/context_provider_command_buffer.h +++ b/services/viz/public/cpp/gpu/context_provider_command_buffer.h
@@ -184,7 +184,7 @@ // provider when creating shared memory mappings. // TODO(crbug.com/1321521) remove this member again once users of the command // buffer proxy can specify the mapper for each mapping individually. - base::SharedMemoryMapper* buffer_mapper_ = nullptr; + raw_ptr<base::SharedMemoryMapper> buffer_mapper_ = nullptr; }; } // namespace viz
diff --git a/storage/browser/quota/quota_manager_impl.cc b/storage/browser/quota/quota_manager_impl.cc index e5ed8a94..361e9927 100644 --- a/storage/browser/quota/quota_manager_impl.cc +++ b/storage/browser/quota/quota_manager_impl.cc
@@ -635,7 +635,7 @@ } SEQUENCE_CHECKER(sequence_checker_); - QuotaManagerImpl* manager_ GUARDED_BY_CONTEXT(sequence_checker_); + raw_ptr<QuotaManagerImpl> manager_ GUARDED_BY_CONTEXT(sequence_checker_); base::OnceCallback<void(StorageKeysByType)> callback_ GUARDED_BY_CONTEXT(sequence_checker_); StorageKeysByType storage_keys_by_type_ GUARDED_BY_CONTEXT(sequence_checker_); @@ -782,7 +782,8 @@ } SEQUENCE_CHECKER(sequence_checker_); - QuotaManagerImpl* const manager_ GUARDED_BY_CONTEXT(sequence_checker_); + const raw_ptr<QuotaManagerImpl> manager_ + GUARDED_BY_CONTEXT(sequence_checker_); const BucketLocator bucket_; const QuotaClientTypes quota_client_types_; int error_count_ GUARDED_BY_CONTEXT(sequence_checker_) = 0; @@ -906,7 +907,8 @@ } SEQUENCE_CHECKER(sequence_checker_); - QuotaManagerImpl* const manager_ GUARDED_BY_CONTEXT(sequence_checker_); + const raw_ptr<QuotaManagerImpl> manager_ + GUARDED_BY_CONTEXT(sequence_checker_); const std::string host_; const StorageType type_; std::map<BucketDataDeleter*, std::unique_ptr<BucketDataDeleter>>
diff --git a/storage/browser/quota/usage_tracker.h b/storage/browser/quota/usage_tracker.h index 763ddf6..10dc50e 100644 --- a/storage/browser/quota/usage_tracker.h +++ b/storage/browser/quota/usage_tracker.h
@@ -16,6 +16,7 @@ #include "base/callback.h" #include "base/component_export.h" #include "base/containers/flat_map.h" +#include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/sequence_checker.h" #include "components/services/storage/public/cpp/buckets/bucket_info.h" @@ -153,7 +154,7 @@ // Raw pointer usage is safe because `quota_manager_impl_` owns `this` and // is therefore valid throughout its lifetime. - QuotaManagerImpl* const quota_manager_impl_; + const raw_ptr<QuotaManagerImpl> quota_manager_impl_; const blink::mojom::StorageType type_; base::flat_map<QuotaClientType, std::vector<std::unique_ptr<ClientUsageTracker>>>
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index f03e31e..838a8d1e 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -8240,15 +8240,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", - "--client-outdir", - "../../weblayer_instrumentation_test_M102/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--client-outdir", + "../../weblayer_instrumentation_test_M102/out/Release", "--client-version=102", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -8325,15 +8325,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", - "--client-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--client-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--client-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -8750,15 +8750,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--implementation-outdir", - "../../weblayer_instrumentation_test_M102/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/AOSP_SystemWebView.apk", + "--implementation-outdir", + "../../weblayer_instrumentation_test_M102/out/Release", "--impl-version=102", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -8835,15 +8835,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--implementation-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/AOSP_SystemWebView.apk", + "--implementation-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--impl-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices",
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 11f849d..ff6df44 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -46214,15 +46214,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", - "--client-outdir", - "../../weblayer_instrumentation_test_M102/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--client-outdir", + "../../weblayer_instrumentation_test_M102/out/Release", "--client-version=102", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -46299,15 +46299,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", - "--client-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--client-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--client-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -46724,15 +46724,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--implementation-outdir", - "../../weblayer_instrumentation_test_M102/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/AOSP_SystemWebView.apk", + "--implementation-outdir", + "../../weblayer_instrumentation_test_M102/out/Release", "--impl-version=102", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -46809,15 +46809,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--implementation-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/AOSP_SystemWebView.apk", + "--implementation-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--impl-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -47238,15 +47238,15 @@ { "args": [ "--additional-apk=apks/ChromePublic.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", - "--client-outdir", - "../../weblayer_instrumentation_test_M102/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--client-outdir", + "../../weblayer_instrumentation_test_M102/out/Release", "--client-version=102", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -47323,15 +47323,15 @@ { "args": [ "--additional-apk=apks/ChromePublic.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", - "--client-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--client-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--client-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -47748,15 +47748,15 @@ { "args": [ "--additional-apk=apks/ChromePublic.apk", - "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--implementation-outdir", - "../../weblayer_instrumentation_test_M102/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/AOSP_SystemWebView.apk", + "--implementation-outdir", + "../../weblayer_instrumentation_test_M102/out/Release", "--impl-version=102", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -47833,15 +47833,15 @@ { "args": [ "--additional-apk=apks/ChromePublic.apk", - "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--implementation-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/AOSP_SystemWebView.apk", + "--implementation-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--impl-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -48330,15 +48330,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", - "--client-outdir", - "../../weblayer_instrumentation_test_M102/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--client-outdir", + "../../weblayer_instrumentation_test_M102/out/Release", "--client-version=102", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -48415,15 +48415,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", - "--client-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--client-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--client-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -48840,15 +48840,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--implementation-outdir", - "../../weblayer_instrumentation_test_M102/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--implementation-outdir", + "../../weblayer_instrumentation_test_M102/out/Release", "--impl-version=102", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -48925,15 +48925,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--implementation-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--implementation-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--impl-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -49422,15 +49422,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", - "--client-outdir", - "../../weblayer_instrumentation_test_M102/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--client-outdir", + "../../weblayer_instrumentation_test_M102/out/Release", "--client-version=102", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -49507,15 +49507,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", - "--client-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--client-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--client-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -49932,15 +49932,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--implementation-outdir", - "../../weblayer_instrumentation_test_M102/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--implementation-outdir", + "../../weblayer_instrumentation_test_M102/out/Release", "--impl-version=102", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -50017,15 +50017,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", - "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--implementation-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", + "--webview-apk-path=apks/SystemWebView.apk", + "--implementation-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--impl-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices",
diff --git a/testing/buildbot/chromium.webrtc.json b/testing/buildbot/chromium.webrtc.json index b1426acb..7657d2c 100644 --- a/testing/buildbot/chromium.webrtc.json +++ b/testing/buildbot/chromium.webrtc.json
@@ -131,7 +131,13 @@ "r_webrtc_git": "${webrtc_got_rev}" }, "swarming": { - "can_use_on_swarming_builders": false + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "os": "Ubuntu-18.04" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test": "browser_tests", "test_id_prefix": "ninja://chrome/test:browser_tests/" @@ -343,7 +349,14 @@ "r_webrtc_git": "${webrtc_got_rev}" }, "swarming": { - "can_use_on_swarming_builders": false + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "cpu": "x86-64", + "os": "Mac-10.15" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test": "browser_tests", "test_id_prefix": "ninja://chrome/test:browser_tests/" @@ -562,7 +575,8 @@ "r_webrtc_git": "${webrtc_got_rev}" }, "swarming": { - "can_use_on_swarming_builders": false + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test": "browser_tests", "test_id_prefix": "ninja://chrome/test:browser_tests/"
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index a0ebc1e..3497a10 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -5215,9 +5215,6 @@ 'a_default_rev': 'r_webrtc_git', 'r_webrtc_git': '${webrtc_got_rev}' }, - 'swarming': { - 'can_use_on_swarming_builders': False, - }, }, # Run capture unittests as well since our bots have real webcams. 'capture_unittests': {
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index de4a748..c23b9e4 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -402,16 +402,16 @@ }, 'WEBLAYER_10_AND_M_IMPL_SKEW_TESTS_NTH_MILESTONE': { 'args': [ - '--webview-apk-path=apks/AOSP_SystemWebView.apk', '--test-runner-outdir', '.', '--client-outdir', '.', - '--implementation-outdir', - '../../weblayer_instrumentation_test_M103/out/Release', '--test-expectations', '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--impl-version=103', + '--webview-apk-path=apks/AOSP_SystemWebView.apk', + '--implementation-outdir', + '../../weblayer_instrumentation_test_M103/out/Release', + '--impl-version=103' ], 'identifier': 'with_impl_from_103', 'swarming': { @@ -419,23 +419,23 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M103', - 'revision': 'version:103.0.5060.39', + 'revision': 'version:103.0.5060.39' } - ], - }, + ] + } }, 'WEBLAYER_10_AND_M_IMPL_SKEW_TESTS_NTH_MINUS_ONE_MILESTONE': { 'args': [ - '--webview-apk-path=apks/AOSP_SystemWebView.apk', '--test-runner-outdir', '.', '--client-outdir', '.', - '--implementation-outdir', - '../../weblayer_instrumentation_test_M102/out/Release', '--test-expectations', '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--impl-version=102', + '--webview-apk-path=apks/AOSP_SystemWebView.apk', + '--implementation-outdir', + '../../weblayer_instrumentation_test_M102/out/Release', + '--impl-version=102' ], 'identifier': 'with_impl_from_102', 'swarming': { @@ -443,10 +443,10 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M102', - 'revision': 'version:102.0.5005.108', + 'revision': 'version:102.0.5005.108' } - ], - }, + ] + } }, 'WEBLAYER_10_AND_M_IMPL_SKEW_TESTS_NTH_MINUS_TWO_MILESTONE': { 'args': [ @@ -546,16 +546,16 @@ }, 'WEBLAYER_IMPL_SKEW_TESTS_NTH_MILESTONE': { 'args': [ - '--webview-apk-path=apks/SystemWebView.apk', '--test-runner-outdir', '.', '--client-outdir', '.', - '--implementation-outdir', - '../../weblayer_instrumentation_test_M103/out/Release', '--test-expectations', '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--impl-version=103', + '--webview-apk-path=apks/SystemWebView.apk', + '--implementation-outdir', + '../../weblayer_instrumentation_test_M103/out/Release', + '--impl-version=103' ], 'identifier': 'with_impl_from_103', 'swarming': { @@ -563,23 +563,23 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M103', - 'revision': 'version:103.0.5060.39', + 'revision': 'version:103.0.5060.39' } - ], - }, + ] + } }, 'WEBLAYER_IMPL_SKEW_TESTS_NTH_MINUS_ONE_MILESTONE': { 'args': [ - '--webview-apk-path=apks/SystemWebView.apk', '--test-runner-outdir', '.', '--client-outdir', '.', - '--implementation-outdir', - '../../weblayer_instrumentation_test_M102/out/Release', '--test-expectations', '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--impl-version=102', + '--webview-apk-path=apks/SystemWebView.apk', + '--implementation-outdir', + '../../weblayer_instrumentation_test_M102/out/Release', + '--impl-version=102' ], 'identifier': 'with_impl_from_102', 'swarming': { @@ -587,10 +587,10 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M102', - 'revision': 'version:102.0.5005.108', + 'revision': 'version:102.0.5005.108' } - ], - }, + ] + } }, 'WEBLAYER_IMPL_SKEW_TESTS_NTH_MINUS_TWO_MILESTONE': { 'args': [ @@ -690,16 +690,16 @@ }, 'WEBLAYER_CLIENT_SKEW_TESTS_NTH_MILESTONE': { 'args': [ - '--webview-apk-path=apks/SystemWebView.apk', '--test-runner-outdir', '.', - '--client-outdir', - '../../weblayer_instrumentation_test_M103/out/Release', '--implementation-outdir', '.', '--test-expectations', '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--client-version=103', + '--webview-apk-path=apks/SystemWebView.apk', + '--client-outdir', + '../../weblayer_instrumentation_test_M103/out/Release', + '--client-version=103' ], 'identifier': 'with_client_from_103', 'swarming': { @@ -707,23 +707,23 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M103', - 'revision': 'version:103.0.5060.39', + 'revision': 'version:103.0.5060.39' } - ], - }, + ] + } }, 'WEBLAYER_CLIENT_SKEW_TESTS_NTH_MINUS_ONE_MILESTONE': { 'args': [ - '--webview-apk-path=apks/SystemWebView.apk', '--test-runner-outdir', '.', - '--client-outdir', - '../../weblayer_instrumentation_test_M102/out/Release', '--implementation-outdir', '.', '--test-expectations', '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--client-version=102', + '--webview-apk-path=apks/SystemWebView.apk', + '--client-outdir', + '../../weblayer_instrumentation_test_M102/out/Release', + '--client-version=102' ], 'identifier': 'with_client_from_102', 'swarming': { @@ -731,10 +731,10 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M102', - 'revision': 'version:102.0.5005.108', + 'revision': 'version:102.0.5005.108' } - ], - }, + ] + } }, 'WEBLAYER_CLIENT_SKEW_TESTS_NTH_MINUS_TWO_MILESTONE': { 'args': [
diff --git a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom index 233bde1..325904f 100644 --- a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom +++ b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom
@@ -3577,6 +3577,8 @@ kEventTimingInteractionId = 4256, kSecurePaymentConfirmationOptOut = 4257, kAnyPopupAttribute = 4258, + kDeferredShapingWorked = 4259, + kDeferredShapingReshapedByForceLayout = 4260, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/blink/public/platform/media/interval_map.h b/third_party/blink/public/platform/media/interval_map.h index d25edff..ccec7c26 100644 --- a/third_party/blink/public/platform/media/interval_map.h +++ b/third_party/blink/public/platform/media/interval_map.h
@@ -10,6 +10,7 @@ #include <map> #include "base/check.h" +#include "base/memory/raw_ptr.h" #include "third_party/blink/public/platform/web_common.h" namespace blink { @@ -149,7 +150,7 @@ } private: - const MapType* map_; + raw_ptr<const MapType> map_; // Pointer to the entry in the IntervalMap that specifies the // beginning of the current interval.
diff --git a/third_party/blink/public/platform/media/key_system_config_selector.h b/third_party/blink/public/platform/media/key_system_config_selector.h index 7b82beb0..ccbd576 100644 --- a/third_party/blink/public/platform/media/key_system_config_selector.h +++ b/third_party/blink/public/platform/media/key_system_config_selector.h
@@ -11,6 +11,7 @@ #include "base/bind.h" #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "media/base/eme_constants.h" #include "third_party/blink/public/platform/web_common.h" @@ -52,7 +53,7 @@ // The pointer below will always be valid for the lifetime of this object // because it is held by KeySystemConfigSelector whose chain of ownership is // the same as RenderFrameImpl. - WebLocalFrame* web_frame_; + raw_ptr<WebLocalFrame> web_frame_; }; KeySystemConfigSelector( @@ -133,13 +134,13 @@ const WebMediaKeySystemMediaCapability::EncryptionScheme encryption_scheme); - media::KeySystems* const key_systems_; + const raw_ptr<media::KeySystems> key_systems_; // This object is unowned but its pointer is always valid. It has the same // lifetime as RenderFrameImpl, and |this| also has the same lifetime // as RenderFrameImpl. RenderFrameImpl owns content::MediaFactory which owns // WebEncryptedMediaClientImpl which owns |this|. - media::MediaPermission* media_permission_; + raw_ptr<media::MediaPermission> media_permission_; std::unique_ptr<WebLocalFrameDelegate> web_frame_delegate_;
diff --git a/third_party/blink/public/platform/media/remote_playback_client_wrapper_impl.h b/third_party/blink/public/platform/media/remote_playback_client_wrapper_impl.h index 6151b99..09e4ac2c 100644 --- a/third_party/blink/public/platform/media/remote_playback_client_wrapper_impl.h +++ b/third_party/blink/public/platform/media/remote_playback_client_wrapper_impl.h
@@ -7,6 +7,7 @@ #include <string> +#include "base/memory/raw_ptr.h" #include "media/renderers/remote_playback_client_wrapper.h" #include "third_party/blink/public/platform/web_common.h" @@ -25,7 +26,7 @@ std::string GetActivePresentationId() override; private: - WebRemotePlaybackClient* remote_playback_client_; + raw_ptr<WebRemotePlaybackClient> remote_playback_client_; }; } // namespace blink
diff --git a/third_party/blink/public/platform/media/url_index.h b/third_party/blink/public/platform/media/url_index.h index 77ec652..255e667 100644 --- a/third_party/blink/public/platform/media/url_index.h +++ b/third_party/blink/public/platform/media/url_index.h
@@ -15,6 +15,7 @@ #include <vector> #include "base/memory/memory_pressure_listener.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" @@ -56,7 +57,7 @@ protected: // Do not access from destructor, it is a pointer to the // object that contains us. - UrlData* url_data_; + raw_ptr<UrlData> url_data_; const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; }; @@ -199,7 +200,7 @@ // Mime type category (stashed for UMA / metrics). std::string mime_type_; - UrlIndex* const url_index_; + const raw_ptr<UrlIndex> url_index_; // Length of resource this url points to. (in bytes) int64_t length_; @@ -300,7 +301,7 @@ void OnMemoryPressure( base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); - ResourceFetchContext* fetch_context_; + raw_ptr<ResourceFetchContext> fetch_context_; using UrlDataMap = std::map<UrlData::KeyType, scoped_refptr<UrlData>>; UrlDataMap indexed_data_; scoped_refptr<MultiBuffer::GlobalLRU> lru_;
diff --git a/third_party/blink/public/platform/media/video_frame_compositor.h b/third_party/blink/public/platform/media/video_frame_compositor.h index 13f8b5e..47de5e4d 100644 --- a/third_party/blink/public/platform/media/video_frame_compositor.h +++ b/third_party/blink/public/platform/media/video_frame_compositor.h
@@ -8,6 +8,7 @@ #include <utility> #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/synchronization/lock.h" #include "base/task/single_thread_task_runner.h" @@ -234,7 +235,7 @@ // media thread. scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - const base::TickClock* tick_clock_; + raw_ptr<const base::TickClock> tick_clock_; // Allows tests to disable the background rendering task. bool background_rendering_enabled_ = true; @@ -249,7 +250,7 @@ base::RetainingOneShotTimer force_begin_frames_timer_; // These values are only set and read on the compositor thread. - cc::VideoFrameProvider::Client* client_ = nullptr; + raw_ptr<cc::VideoFrameProvider::Client> client_ = nullptr; bool rendering_ = false; bool rendered_last_frame_ = false; bool is_background_rendering_ = false; @@ -276,7 +277,7 @@ // These values are updated and read from the media and compositor threads. base::Lock callback_lock_; - media::VideoRendererSink::RenderCallback* callback_ + raw_ptr<media::VideoRendererSink::RenderCallback> callback_ GUARDED_BY(callback_lock_) = nullptr; // Assume 60Hz before the first UpdateCurrentFrame() call.
diff --git a/third_party/blink/public/platform/media/web_encrypted_media_client_impl.h b/third_party/blink/public/platform/media/web_encrypted_media_client_impl.h index 3d7a38f..cc8cb5f8 100644 --- a/third_party/blink/public/platform/media/web_encrypted_media_client_impl.h +++ b/third_party/blink/public/platform/media/web_encrypted_media_client_impl.h
@@ -10,6 +10,7 @@ #include <unordered_map> #include "base/callback.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "third_party/blink/public/platform/media/key_system_config_selector.h" @@ -78,8 +79,8 @@ // Reporter singletons. std::unordered_map<std::string, std::unique_ptr<Reporter>> reporters_; - media::CdmFactory* const cdm_factory_; - media::KeySystems* const key_systems_; + const raw_ptr<media::CdmFactory> cdm_factory_; + const raw_ptr<media::KeySystems> key_systems_; KeySystemConfigSelector key_system_config_selector_; // Pending requests while waiting for KeySystems initialization.
diff --git a/third_party/blink/public/platform/scheduler/web_render_widget_scheduling_state.h b/third_party/blink/public/platform/scheduler/web_render_widget_scheduling_state.h index 34a13658..62a1a85 100644 --- a/third_party/blink/public/platform/scheduler/web_render_widget_scheduling_state.h +++ b/third_party/blink/public/platform/scheduler/web_render_widget_scheduling_state.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_SCHEDULER_WEB_RENDER_WIDGET_SCHEDULING_STATE_H_ #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_SCHEDULER_WEB_RENDER_WIDGET_SCHEDULING_STATE_H_ +#include "base/memory/raw_ptr.h" #include "third_party/blink/public/platform/web_common.h" namespace blink { @@ -25,7 +26,7 @@ explicit WebRenderWidgetSchedulingState( RenderWidgetSignals* render_widget_scheduling_signals); - RenderWidgetSignals* render_widget_signals_; // NOT OWNED + raw_ptr<RenderWidgetSignals> render_widget_signals_; // NOT OWNED bool hidden_; bool has_touch_handler_; };
diff --git a/third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h b/third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h index 702d214..3a7e28c 100644 --- a/third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h +++ b/third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_SCHEDULER_WEB_SCOPED_VIRTUAL_TIME_PAUSER_H_ #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_SCHEDULER_WEB_SCOPED_VIRTUAL_TIME_PAUSER_H_ +#include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "third_party/blink/public/platform/web_common.h" #include "third_party/blink/public/platform/web_string.h" @@ -62,7 +63,7 @@ bool paused_ = false; bool virtual_time_enabled_when_paused_ = false; VirtualTaskDuration duration_ = VirtualTaskDuration::kInstant; - scheduler::ThreadSchedulerImpl* scheduler_; // NOT OWNED + raw_ptr<scheduler::ThreadSchedulerImpl> scheduler_; // NOT OWNED WebString debug_name_; intptr_t trace_id_; };
diff --git a/third_party/blink/public/platform/weak_wrapper_resource_load_info_notifier.h b/third_party/blink/public/platform/weak_wrapper_resource_load_info_notifier.h index e1a3621..6fb694b 100644 --- a/third_party/blink/public/platform/weak_wrapper_resource_load_info_notifier.h +++ b/third_party/blink/public/platform/weak_wrapper_resource_load_info_notifier.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEAK_WRAPPER_RESOURCE_LOAD_INFO_NOTIFIER_H_ #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEAK_WRAPPER_RESOURCE_LOAD_INFO_NOTIFIER_H_ +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" #include "build/build_config.h" @@ -54,7 +55,7 @@ // content::WebWorkerFetchContextImpl or content::RenderFrameImpl own // `resource_load_info_notifier_` and `this`, which ensure that // `resource_load_info_notifier_` outlives `this`. - mojom::ResourceLoadInfoNotifier* resource_load_info_notifier_; + raw_ptr<mojom::ResourceLoadInfoNotifier> resource_load_info_notifier_; base::WeakPtrFactory<WeakWrapperResourceLoadInfoNotifier> weak_factory_{this}; };
diff --git a/third_party/blink/public/platform/web_resource_request_sender.h b/third_party/blink/public/platform/web_resource_request_sender.h index 930a406..4e247d0 100644 --- a/third_party/blink/public/platform/web_resource_request_sender.h +++ b/third_party/blink/public/platform/web_resource_request_sender.h
@@ -12,6 +12,7 @@ #include <string> #include <vector> +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/task/single_thread_task_runner.h" #include "base/time/time.h" @@ -222,7 +223,7 @@ network::mojom::URLResponseHead& response_head) const; // `delegate_` is expected to live longer than `this`. - WebResourceRequestSenderDelegate* delegate_; + raw_ptr<WebResourceRequestSenderDelegate> delegate_; // The instance is created on StartAsync() or StartSync(), and it's deleted // when the response has finished, or when the request is canceled.
diff --git a/third_party/blink/public/platform/web_url_loader_factory.h b/third_party/blink/public/platform/web_url_loader_factory.h index 822e0d5..fb9f517 100644 --- a/third_party/blink/public/platform/web_url_loader_factory.h +++ b/third_party/blink/public/platform/web_url_loader_factory.h
@@ -9,6 +9,7 @@ #include <string> #include <vector> +#include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/synchronization/waitable_event.h" #include "third_party/blink/public/mojom/frame/frame.mojom-shared.h" @@ -59,7 +60,7 @@ protected: scoped_refptr<network::SharedURLLoaderFactory> loader_factory_; WebVector<WebString> cors_exempt_header_list_; - base::WaitableEvent* terminate_sync_load_event_ = nullptr; + raw_ptr<base::WaitableEvent> terminate_sync_load_event_ = nullptr; }; // A test version of the above factory interface, which supports cloning the
diff --git a/third_party/blink/public/platform/web_url_request.h b/third_party/blink/public/platform/web_url_request.h index 4f84cba7..2f891dc 100644 --- a/third_party/blink/public/platform/web_url_request.h +++ b/third_party/blink/public/platform/web_url_request.h
@@ -32,6 +32,7 @@ #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_URL_REQUEST_H_ #include <memory> +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/time/time.h" #include "base/unguessable_token.h" @@ -328,7 +329,7 @@ std::unique_ptr<ResourceRequest> owned_resource_request_; // Should never be null. - ResourceRequest* resource_request_; + raw_ptr<ResourceRequest> resource_request_; }; } // namespace blink
diff --git a/third_party/blink/public/platform/web_url_response.h b/third_party/blink/public/platform/web_url_response.h index 1b0e7314..f047dd9 100644 --- a/third_party/blink/public/platform/web_url_response.h +++ b/third_party/blink/public/platform/web_url_response.h
@@ -33,6 +33,7 @@ #include <memory> +#include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "base/unguessable_token.h" #include "net/base/ip_endpoint.h" @@ -301,7 +302,7 @@ const std::unique_ptr<ResourceResponse> owned_resource_response_; // Should never be null. - ResourceResponse* const resource_response_; + const raw_ptr<ResourceResponse> resource_response_; }; } // namespace blink
diff --git a/third_party/blink/public/platform/webaudiosourceprovider_impl.h b/third_party/blink/public/platform/webaudiosourceprovider_impl.h index 0c744205..afdea75e 100644 --- a/third_party/blink/public/platform/webaudiosourceprovider_impl.h +++ b/third_party/blink/public/platform/webaudiosourceprovider_impl.h
@@ -12,6 +12,7 @@ #include "base/callback.h" #include "base/callback_forward.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/synchronization/lock.h" #include "media/base/audio_renderer_sink.h" @@ -112,7 +113,7 @@ base::RepeatingClosure set_format_cb_; // When set via setClient() it overrides |sink_| for consuming audio. - WebAudioSourceProviderClient* client_; + raw_ptr<WebAudioSourceProviderClient> client_; // Where audio ends up unless overridden by |client_|. base::Lock sink_lock_; @@ -124,7 +125,7 @@ class TeeFilter; const std::unique_ptr<TeeFilter> tee_filter_; - media::MediaLog* const media_log_; + const raw_ptr<media::MediaLog> media_log_; base::OnceClosure on_set_client_callback_;
diff --git a/third_party/blink/renderer/bindings/PRESUBMIT.py b/third_party/blink/renderer/bindings/PRESUBMIT.py index 934b9efc..8d6f9ab 100644 --- a/third_party/blink/renderer/bindings/PRESUBMIT.py +++ b/third_party/blink/renderer/bindings/PRESUBMIT.py
@@ -58,11 +58,7 @@ input_api.PresubmitLocalPath(), pardir, pardir, 'tools', 'run_bindings_tests.py') cmd_name = 'run_bindings_tests.py' - if input_api.platform == 'win32': - # Windows needs some help. - cmd = [input_api.python3_executable, run_bindings_tests_path] - else: - cmd = [run_bindings_tests_path] + cmd = [input_api.python3_executable, run_bindings_tests_path] test_cmd = input_api.Command( name=cmd_name, cmd=cmd, kwargs={}, message=message_type) if input_api.verbose:
diff --git a/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py b/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py index 8c7f154..4cfe4201 100644 --- a/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py +++ b/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py
@@ -474,6 +474,8 @@ # Discard the arguments. arguments = () name = child.GetName() + else: + assert False return ExtendedAttribute( key=key, values=values, arguments=arguments, name=name)
diff --git a/third_party/blink/renderer/core/css/resolver/scoped_style_resolver.cc b/third_party/blink/renderer/core/css/resolver/scoped_style_resolver.cc index 8e3f2394..90ee5a8 100644 --- a/third_party/blink/renderer/core/css/resolver/scoped_style_resolver.cc +++ b/third_party/blink/renderer/core/css/resolver/scoped_style_resolver.cc
@@ -123,6 +123,7 @@ AddKeyframeRules(rule_set); AddFontFaceRules(rule_set); AddCounterStyleRules(rule_set); + AddPositionFallbackRules(rule_set); } } @@ -149,6 +150,7 @@ viewport_dependent_media_query_results_.clear(); device_dependent_media_query_results_.clear(); keyframes_rule_map_.clear(); + position_fallback_rule_map_.clear(); if (counter_style_map_) counter_style_map_->Dispose(); cascade_layer_map_ = nullptr; @@ -299,12 +301,31 @@ cascade_layer_map_ = MakeGarbageCollected<CascadeLayerMap>(sheets); } +void ScopedStyleResolver::AddPositionFallbackRules(const RuleSet& rule_set) { + // TODO(crbug.com/1309178): Support @position-fallback rules in shadow DOM. + if (!GetTreeScope().RootNode().IsDocumentNode()) + return; + // TODO(crbug.com/1309178): Reorder @position-fallback rules according to + // cascade layers. + for (StyleRulePositionFallback* rule : rule_set.PositionFallbackRules()) + position_fallback_rule_map_.Set(rule->Name(), rule); +} + +StyleRulePositionFallback* ScopedStyleResolver::PositionFallbackForName( + const AtomicString& fallback_name) { + auto iter = position_fallback_rule_map_.find(fallback_name); + if (iter != position_fallback_rule_map_.end()) + return iter->value; + return nullptr; +} + void ScopedStyleResolver::Trace(Visitor* visitor) const { visitor->Trace(scope_); visitor->Trace(style_sheets_); visitor->Trace(viewport_dependent_media_query_results_); visitor->Trace(device_dependent_media_query_results_); visitor->Trace(keyframes_rule_map_); + visitor->Trace(position_fallback_rule_map_); visitor->Trace(counter_style_map_); visitor->Trace(cascade_layer_map_); }
diff --git a/third_party/blink/renderer/core/css/resolver/scoped_style_resolver.h b/third_party/blink/renderer/core/css/resolver/scoped_style_resolver.h index 608fd34..31c0683 100644 --- a/third_party/blink/renderer/core/css/resolver/scoped_style_resolver.h +++ b/third_party/blink/renderer/core/css/resolver/scoped_style_resolver.h
@@ -65,6 +65,9 @@ CounterStyleMap* GetCounterStyleMap() { return counter_style_map_; } static void CounterStyleRulesChanged(TreeScope& scope); + StyleRulePositionFallback* PositionFallbackForName( + const AtomicString& fallback_name); + void RebuildCascadeLayerMap(const ActiveStyleSheetVector&); bool HasCascadeLayerMap() const { return cascade_layer_map_.Get(); } const CascadeLayerMap* GetCascadeLayerMap() const { @@ -104,6 +107,7 @@ bool KeyframeStyleShouldOverride( const StyleRuleKeyframes* new_rule, const StyleRuleKeyframes* existing_rule) const; + void AddPositionFallbackRules(const RuleSet&); CounterStyleMap& EnsureCounterStyleMap(); @@ -117,6 +121,10 @@ HeapHashMap<AtomicString, Member<StyleRuleKeyframes>>; KeyframesRuleMap keyframes_rule_map_; + using PositionFallbackRuleMap = + HeapHashMap<AtomicString, Member<StyleRulePositionFallback>>; + PositionFallbackRuleMap position_fallback_rule_map_; + Member<CounterStyleMap> counter_style_map_; Member<CascadeLayerMap> cascade_layer_map_;
diff --git a/third_party/blink/renderer/core/css/rule_set.cc b/third_party/blink/renderer/core/css/rule_set.cc index 0fa611e..b2cb0128 100644 --- a/third_party/blink/renderer/core/css/rule_set.cc +++ b/third_party/blink/renderer/core/css/rule_set.cc
@@ -474,6 +474,11 @@ scroll_timeline_rules_.push_back(rule); } +void RuleSet::AddPositionFallbackRule(StyleRulePositionFallback* rule) { + need_compaction_ = true; + position_fallback_rules_.push_back(rule); +} + void RuleSet::AddChildRules(const HeapVector<Member<StyleRuleBase>>& rules, const MediaQueryEvaluator& medium, AddRuleFlags add_rule_flags, @@ -521,6 +526,10 @@ DynamicTo<StyleRuleScrollTimeline>(rule)) { scroll_timeline_rule->SetCascadeLayer(cascade_layer); AddScrollTimelineRule(scroll_timeline_rule); + } else if (auto* position_fallback_rule = + DynamicTo<StyleRulePositionFallback>(rule)) { + // TODO(crbug.com/1309178): Handle interaction with cascade layers. + AddPositionFallbackRule(position_fallback_rule); } else if (auto* supports_rule = DynamicTo<StyleRuleSupports>(rule)) { if (supports_rule->ConditionIsSupported()) { AddChildRules(supports_rule->ChildRules(), medium, add_rule_flags, @@ -750,6 +759,7 @@ property_rules_.ShrinkToFit(); counter_style_rules_.ShrinkToFit(); scroll_timeline_rules_.ShrinkToFit(); + position_fallback_rules_.ShrinkToFit(); layer_intervals_.ShrinkToFit(); #if EXPENSIVE_DCHECKS_ARE_ON() @@ -850,6 +860,7 @@ visitor->Trace(property_rules_); visitor->Trace(counter_style_rules_); visitor->Trace(scroll_timeline_rules_); + visitor->Trace(position_fallback_rules_); visitor->Trace(media_query_set_results_); visitor->Trace(implicit_outer_layer_); visitor->Trace(layer_intervals_);
diff --git a/third_party/blink/renderer/core/css/rule_set.h b/third_party/blink/renderer/core/css/rule_set.h index 3955b5e..94e7f2dc4 100644 --- a/third_party/blink/renderer/core/css/rule_set.h +++ b/third_party/blink/renderer/core/css/rule_set.h
@@ -28,6 +28,7 @@ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/cascade_layer.h" #include "third_party/blink/renderer/core/css/css_keyframes_rule.h" +#include "third_party/blink/renderer/core/css/css_position_fallback_rule.h" #include "third_party/blink/renderer/core/css/media_query_evaluator.h" #include "third_party/blink/renderer/core/css/resolver/media_query_result.h" #include "third_party/blink/renderer/core/css/rule_feature_set.h" @@ -275,6 +276,10 @@ const { return scroll_timeline_rules_; } + const HeapVector<Member<StyleRulePositionFallback>>& PositionFallbackRules() + const { + return position_fallback_rules_; + } const HeapVector<RuleData>* SlottedPseudoElementRules() const { return &slotted_pseudo_element_rules_; } @@ -364,6 +369,7 @@ void AddScrollTimelineRule(StyleRuleScrollTimeline*); void AddCounterStyleRule(StyleRuleCounterStyle*); void AddFontPaletteValuesRule(StyleRuleFontPaletteValues*); + void AddPositionFallbackRule(StyleRulePositionFallback*); bool MatchMediaForAddRules(const MediaQueryEvaluator& evaluator, const MediaQuerySet* media_queries); @@ -452,6 +458,7 @@ HeapVector<Member<StyleRuleProperty>> property_rules_; HeapVector<Member<StyleRuleCounterStyle>> counter_style_rules_; HeapVector<Member<StyleRuleScrollTimeline>> scroll_timeline_rules_; + HeapVector<Member<StyleRulePositionFallback>> position_fallback_rules_; HeapVector<MediaQuerySetResult> media_query_set_results_; // Whether there is a ruleset bucket for rules with a selector on
diff --git a/third_party/blink/renderer/core/css/style_engine.cc b/third_party/blink/renderer/core/css/style_engine.cc index 418ccdf..066d50e 100644 --- a/third_party/blink/renderer/core/css/style_engine.cc +++ b/third_party/blink/renderer/core/css/style_engine.cc
@@ -2275,6 +2275,9 @@ } } + // TODO(crbug.com/1309178): Invalidate style & layout for @position-fallback + // rule changes. + if (!new_style_sheets.IsEmpty()) { tree_scope.EnsureScopedStyleResolver().AppendActiveStyleSheets( append_start_index, new_style_sheets);
diff --git a/third_party/blink/renderer/core/display_lock/display_lock_document_state.cc b/third_party/blink/renderer/core/display_lock/display_lock_document_state.cc index a6390ba3..d899c37 100644 --- a/third_party/blink/renderer/core/display_lock/display_lock_document_state.cc +++ b/third_party/blink/renderer/core/display_lock/display_lock_document_state.cc
@@ -10,6 +10,7 @@ #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/dom/flat_tree_traversal.h" #include "third_party/blink/renderer/core/dom/slot_assignment_engine.h" +#include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/intersection_observer/intersection_observer.h" #include "third_party/blink/renderer/core/intersection_observer/intersection_observer_entry.h" #include "third_party/blink/renderer/core/layout/layout_block.h" @@ -396,9 +397,17 @@ return; if (LockedDisplayLockCount() == DisplayLockBlockingAllActivationCount()) return; + + size_t count = 0; for (auto& context : display_lock_contexts_) { - if (context->HasElement() && context->IsShapingDeferred()) + if (context->HasElement() && context->IsShapingDeferred()) { context->SetRequestedState(EContentVisibility::kVisible); + ++count; + } + } + if (count > 0) { + UseCounter::Count(document_, + WebFeature::kDeferredShapingReshapedByForceLayout); } } @@ -411,6 +420,8 @@ return; // Need to update layout tree because we access the tree and style. target.GetDocument().UpdateStyleAndLayoutTreeForNode(&target); + if (LockedDisplayLockCount() == DisplayLockBlockingAllActivationCount()) + return; LayoutObject* target_object = target.GetLayoutObject(); if (!target_object) return; @@ -484,12 +495,18 @@ UnlockToDetermineWidth(*target_object->ContainingBlock()); return; - default: - // No optimization. Unlock everything. - for (auto& context : display_lock_contexts_) { - if (context->HasElement() && context->IsShapingDeferred()) - context->SetRequestedState(EContentVisibility::kVisible); - } + default: { + LayoutObject* object = target_object; + while (!object->ContainingBlock()->IsLayoutView()) + object = object->ContainingBlock(); + const ComputedStyle& style = object->StyleRef(); + if (object->IsOutOfFlowPositioned() && + (!style.Left().IsAuto() || !style.Right().IsAuto()) && + (!style.Top().IsAuto() || !style.Bottom().IsAuto())) + UnlockShapingDeferredInclusiveDescendants(*object); + else + UnlockShapingDeferredElements(); + } } }
diff --git a/third_party/blink/renderer/core/display_lock/display_lock_document_state.h b/third_party/blink/renderer/core/display_lock/display_lock_document_state.h index 069d9c3..776eda33 100644 --- a/third_party/blink/renderer/core/display_lock/display_lock_document_state.h +++ b/third_party/blink/renderer/core/display_lock/display_lock_document_state.h
@@ -174,8 +174,11 @@ void UnlockShapingDeferredElements(); // Unlock shaping-deferred elements so that |target| can return the precise // value of |property_id|. - void UnlockShapingDeferredElements(const Node& target, - CSSPropertyID property_id); + // If |property_id| is kInvalid, this function unlocks elements necessary for + // any geometry of the target node. + void UnlockShapingDeferredElements( + const Node& target, + CSSPropertyID property_id = CSSPropertyID::kInvalid); // Unlock shaping-deferred elements so that |object| can return the precise // width. void UnlockToDetermineWidth(const LayoutObject& object);
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index f019833..132624c1 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc
@@ -2663,7 +2663,7 @@ if (!node->InActiveDocument()) return; - GetDisplayLockDocumentState().UnlockShapingDeferredElements(); + GetDisplayLockDocumentState().UnlockShapingDeferredElements(*node); DisplayLockUtilities::ScopedForcedUpdate scoped_update_forced( node, DisplayLockContext::ForcedPhase::kLayout);
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index 78fb39e..350a9ee 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -5440,7 +5440,7 @@ bool Element::ActivateDisplayLockIfNeeded(DisplayLockActivationReason reason) { auto& state = GetDocument().GetDisplayLockDocumentState(); - state.UnlockShapingDeferredElements(); + state.UnlockShapingDeferredElements(*this); if (state.LockedDisplayLockCount() == state.DisplayLockBlockingAllActivationCount()) return false;
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index 863e6a9..d3c4659 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -1937,6 +1937,7 @@ context.SetRequestedState(EContentVisibility::kAuto); } deferred_to_be_locked_.resize(0); + UseCounter::Count(document, WebFeature::kDeferredShapingWorked); } }
diff --git a/third_party/blink/renderer/core/html/forms/base_button_input_type.cc b/third_party/blink/renderer/core/html/forms/base_button_input_type.cc index 5e76416..758cf016 100644 --- a/third_party/blink/renderer/core/html/forms/base_button_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/base_button_input_type.cc
@@ -75,6 +75,10 @@ void BaseButtonInputType::AppendToFormData(FormData&) const {} +ControlPart BaseButtonInputType::AutoAppearance() const { + return kPushButtonPart; +} + LayoutObject* BaseButtonInputType::CreateLayoutObject( const ComputedStyle& style, LegacyLayout legacy) const {
diff --git a/third_party/blink/renderer/core/html/forms/base_button_input_type.h b/third_party/blink/renderer/core/html/forms/base_button_input_type.h index c2cdc3d..39df1f3 100644 --- a/third_party/blink/renderer/core/html/forms/base_button_input_type.h +++ b/third_party/blink/renderer/core/html/forms/base_button_input_type.h
@@ -54,6 +54,7 @@ InputTypeView* CreateView() override; bool ShouldSaveAndRestoreFormControlState() const override; void AppendToFormData(FormData&) const override; + ControlPart AutoAppearance() const override; LayoutObject* CreateLayoutObject(const ComputedStyle&, LegacyLayout) const override; ValueMode GetValueMode() const override;
diff --git a/third_party/blink/renderer/core/html/forms/checkbox_input_type.cc b/third_party/blink/renderer/core/html/forms/checkbox_input_type.cc index 5686c40..7f4e86a2 100644 --- a/third_party/blink/renderer/core/html/forms/checkbox_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/checkbox_input_type.cc
@@ -50,6 +50,10 @@ return input_type_names::kCheckbox; } +ControlPart CheckboxInputType::AutoAppearance() const { + return kCheckboxPart; +} + bool CheckboxInputType::ValueMissing(const String&) const { return GetElement().IsRequired() && !GetElement().Checked(); }
diff --git a/third_party/blink/renderer/core/html/forms/checkbox_input_type.h b/third_party/blink/renderer/core/html/forms/checkbox_input_type.h index afca5bb..552953e 100644 --- a/third_party/blink/renderer/core/html/forms/checkbox_input_type.h +++ b/third_party/blink/renderer/core/html/forms/checkbox_input_type.h
@@ -43,6 +43,7 @@ private: void CountUsage() override; const AtomicString& FormControlType() const override; + ControlPart AutoAppearance() const override; bool ValueMissing(const String&) const override; String ValueMissingText() const override; void HandleKeyupEvent(KeyboardEvent&) override;
diff --git a/third_party/blink/renderer/core/html/forms/chooser_only_temporal_input_type_view.cc b/third_party/blink/renderer/core/html/forms/chooser_only_temporal_input_type_view.cc index f94c811..a2d5651 100644 --- a/third_party/blink/renderer/core/html/forms/chooser_only_temporal_input_type_view.cc +++ b/third_party/blink/renderer/core/html/forms/chooser_only_temporal_input_type_view.cc
@@ -76,6 +76,10 @@ OpenPopupView(); } +ControlPart ChooserOnlyTemporalInputTypeView::AutoAppearance() const { + return kMenulistPart; +} + void ChooserOnlyTemporalInputTypeView::OpenPopupView() { DateTimeChooserParameters parameters; if (GetElement().SetupDateTimeChooserParameters(parameters)) {
diff --git a/third_party/blink/renderer/core/html/forms/chooser_only_temporal_input_type_view.h b/third_party/blink/renderer/core/html/forms/chooser_only_temporal_input_type_view.h index 6143dd7..bcaeb379 100644 --- a/third_party/blink/renderer/core/html/forms/chooser_only_temporal_input_type_view.h +++ b/third_party/blink/renderer/core/html/forms/chooser_only_temporal_input_type_view.h
@@ -56,6 +56,7 @@ void ValueAttributeChanged() override; void DidSetValue(const String&, bool value_changed) override; void HandleDOMActivateEvent(Event&) override; + ControlPart AutoAppearance() const override; void OpenPopupView() override; void UpdateView() override;
diff --git a/third_party/blink/renderer/core/html/forms/color_input_type.cc b/third_party/blink/renderer/core/html/forms/color_input_type.cc index 23f28b0e..e9299c4 100644 --- a/third_party/blink/renderer/core/html/forms/color_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/color_input_type.cc
@@ -170,6 +170,12 @@ event.SetDefaultHandled(); } +ControlPart ColorInputType::AutoAppearance() const { + return GetElement().FastHasAttribute(html_names::kListAttr) + ? kMenulistPart + : kSquareButtonPart; +} + void ColorInputType::OpenPopupView() { ChromeClient* chrome_client = GetChromeClient(); Document& document = GetElement().GetDocument();
diff --git a/third_party/blink/renderer/core/html/forms/color_input_type.h b/third_party/blink/renderer/core/html/forms/color_input_type.h index 1043d28..dd0ef8f 100644 --- a/third_party/blink/renderer/core/html/forms/color_input_type.h +++ b/third_party/blink/renderer/core/html/forms/color_input_type.h
@@ -69,6 +69,7 @@ void CreateShadowSubtree() override; void DidSetValue(const String&, bool value_changed) override; void HandleDOMActivateEvent(Event&) override; + ControlPart AutoAppearance() const override; void OpenPopupView() override; void ClosePopupView() override; bool HasOpenedPopup() const override;
diff --git a/third_party/blink/renderer/core/html/forms/html_input_element.cc b/third_party/blink/renderer/core/html/forms/html_input_element.cc index 30d1447..9f7c3ab 100644 --- a/third_party/blink/renderer/core/html/forms/html_input_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_input_element.cc
@@ -1689,6 +1689,10 @@ return input_type_->SupportsReadOnly() && !IsDisabledOrReadOnly(); } +ControlPart HTMLInputElement::AutoAppearance() const { + return input_type_view_->AutoAppearance(); +} + void HTMLInputElement::OnSearch() { input_type_->DispatchSearchEvent(); }
diff --git a/third_party/blink/renderer/core/html/forms/html_input_element.h b/third_party/blink/renderer/core/html/forms/html_input_element.h index 9018bb5..3ac575e 100644 --- a/third_party/blink/renderer/core/html/forms/html_input_element.h +++ b/third_party/blink/renderer/core/html/forms/html_input_element.h
@@ -35,6 +35,7 @@ #include "third_party/blink/renderer/core/dom/events/simulated_click_options.h" #include "third_party/blink/renderer/core/html/forms/step_range.h" #include "third_party/blink/renderer/core/html/forms/text_control_element.h" +#include "third_party/blink/renderer/platform/theme_types.h" namespace blink { @@ -311,6 +312,8 @@ bool MatchesReadOnlyPseudoClass() const final; bool MatchesReadWritePseudoClass() const final; + ControlPart AutoAppearance() const; + void setRangeText(const String& replacement, ExceptionState&) final; void setRangeText(const String& replacement, unsigned start,
diff --git a/third_party/blink/renderer/core/html/forms/image_input_type.cc b/third_party/blink/renderer/core/html/forms/image_input_type.cc index f5d0c311..d95bdff 100644 --- a/third_party/blink/renderer/core/html/forms/image_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/image_input_type.cc
@@ -105,6 +105,10 @@ event.SetDefaultHandled(); } +ControlPart ImageInputType::AutoAppearance() const { + return kNoControlPart; +} + LayoutObject* ImageInputType::CreateLayoutObject(const ComputedStyle& style, LegacyLayout legacy) const { if (use_fallback_content_)
diff --git a/third_party/blink/renderer/core/html/forms/image_input_type.h b/third_party/blink/renderer/core/html/forms/image_input_type.h index ec11957..bae3d9f 100644 --- a/third_party/blink/renderer/core/html/forms/image_input_type.h +++ b/third_party/blink/renderer/core/html/forms/image_input_type.h
@@ -50,6 +50,7 @@ void AppendToFormData(FormData&) const override; String ResultForDialogSubmit() const override; bool SupportsValidation() const override; + ControlPart AutoAppearance() const override; LayoutObject* CreateLayoutObject(const ComputedStyle&, LegacyLayout) const override; void HandleDOMActivateEvent(Event&) override;
diff --git a/third_party/blink/renderer/core/html/forms/input_type_view.cc b/third_party/blink/renderer/core/html/forms/input_type_view.cc index 376bf86acb..f285ce0 100644 --- a/third_party/blink/renderer/core/html/forms/input_type_view.cc +++ b/third_party/blink/renderer/core/html/forms/input_type_view.cc
@@ -100,6 +100,10 @@ void InputTypeView::CustomStyleForLayoutObject(ComputedStyle&) {} +ControlPart InputTypeView::AutoAppearance() const { + return kNoControlPart; +} + TextDirection InputTypeView::ComputedTextDirection() { return GetElement().ComputedStyleRef().Direction(); }
diff --git a/third_party/blink/renderer/core/html/forms/input_type_view.h b/third_party/blink/renderer/core/html/forms/input_type_view.h index bc7065dc..7bb5707 100644 --- a/third_party/blink/renderer/core/html/forms/input_type_view.h +++ b/third_party/blink/renderer/core/html/forms/input_type_view.h
@@ -40,6 +40,7 @@ #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/heap/member.h" #include "third_party/blink/renderer/platform/text/text_direction.h" +#include "third_party/blink/renderer/platform/theme_types.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/forward.h" @@ -109,6 +110,7 @@ virtual LayoutObject* CreateLayoutObject(const ComputedStyle&, LegacyLayout) const; virtual void CustomStyleForLayoutObject(ComputedStyle& style); + virtual ControlPart AutoAppearance() const; virtual TextDirection ComputedTextDirection(); virtual void OpenPopupView(); virtual void ClosePopupView();
diff --git a/third_party/blink/renderer/core/html/forms/multiple_fields_temporal_input_type_view.cc b/third_party/blink/renderer/core/html/forms/multiple_fields_temporal_input_type_view.cc index d4e2e864..ae72027c 100644 --- a/third_party/blink/renderer/core/html/forms/multiple_fields_temporal_input_type_view.cc +++ b/third_party/blink/renderer/core/html/forms/multiple_fields_temporal_input_type_view.cc
@@ -595,6 +595,10 @@ UpdateClearButtonVisibility(); } +ControlPart MultipleFieldsTemporalInputTypeView::AutoAppearance() const { + return kTextFieldPart; +} + void MultipleFieldsTemporalInputTypeView::OpenPopupView() { if (PickerIndicatorElement* picker = GetPickerIndicatorElement()) picker->OpenPopup();
diff --git a/third_party/blink/renderer/core/html/forms/multiple_fields_temporal_input_type_view.h b/third_party/blink/renderer/core/html/forms/multiple_fields_temporal_input_type_view.h index 7306a3d..c00ad8f2 100644 --- a/third_party/blink/renderer/core/html/forms/multiple_fields_temporal_input_type_view.h +++ b/third_party/blink/renderer/core/html/forms/multiple_fields_temporal_input_type_view.h
@@ -94,6 +94,7 @@ // InputTypeView functions void Blur() final; + ControlPart AutoAppearance() const override; void OpenPopupView() override; void ClosePopupView() override; bool HasOpenedPopup() const override;
diff --git a/third_party/blink/renderer/core/html/forms/radio_input_type.cc b/third_party/blink/renderer/core/html/forms/radio_input_type.cc index d2ee69d..1ed18b1 100644 --- a/third_party/blink/renderer/core/html/forms/radio_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/radio_input_type.cc
@@ -57,6 +57,10 @@ return input_type_names::kRadio; } +ControlPart RadioInputType::AutoAppearance() const { + return kRadioPart; +} + bool RadioInputType::ValueMissing(const String&) const { HTMLInputElement& input = GetElement(); if (auto* scope = input.GetRadioButtonGroupScope())
diff --git a/third_party/blink/renderer/core/html/forms/radio_input_type.h b/third_party/blink/renderer/core/html/forms/radio_input_type.h index f305055..192340b 100644 --- a/third_party/blink/renderer/core/html/forms/radio_input_type.h +++ b/third_party/blink/renderer/core/html/forms/radio_input_type.h
@@ -46,6 +46,7 @@ private: void CountUsage() override; const AtomicString& FormControlType() const override; + ControlPart AutoAppearance() const override; void WillUpdateCheckedness(bool new_checked) override; bool ValueMissing(const String&) const override; String ValueMissingText() const override;
diff --git a/third_party/blink/renderer/core/html/forms/range_input_type.cc b/third_party/blink/renderer/core/html/forms/range_input_type.cc index 89997202..ed6f557 100644 --- a/third_party/blink/renderer/core/html/forms/range_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/range_input_type.cc
@@ -298,6 +298,10 @@ GetElement().UpdateView(); } +ControlPart RangeInputType::AutoAppearance() const { + return kSliderHorizontalPart; +} + void RangeInputType::UpdateView() { GetSliderThumbElement()->SetPositionFromValue(); }
diff --git a/third_party/blink/renderer/core/html/forms/range_input_type.h b/third_party/blink/renderer/core/html/forms/range_input_type.h index 2dc25f5..72b01e6 100644 --- a/third_party/blink/renderer/core/html/forms/range_input_type.h +++ b/third_party/blink/renderer/core/html/forms/range_input_type.h
@@ -83,6 +83,7 @@ void UpdateTickMarkValues(); // InputTypeView function: + ControlPart AutoAppearance() const override; void UpdateView() override; void ValueAttributeChanged() override; bool IsDraggedSlider() const override;
diff --git a/third_party/blink/renderer/core/html/forms/search_input_type.cc b/third_party/blink/renderer/core/html/forms/search_input_type.cc index a6fbe93..4d64a0b 100644 --- a/third_party/blink/renderer/core/html/forms/search_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/search_input_type.cc
@@ -62,6 +62,10 @@ return input_type_names::kSearch; } +ControlPart SearchInputType::AutoAppearance() const { + return kSearchFieldPart; +} + bool SearchInputType::NeedsContainer() const { return true; }
diff --git a/third_party/blink/renderer/core/html/forms/search_input_type.h b/third_party/blink/renderer/core/html/forms/search_input_type.h index e9dccbf7..e29aad7 100644 --- a/third_party/blink/renderer/core/html/forms/search_input_type.h +++ b/third_party/blink/renderer/core/html/forms/search_input_type.h
@@ -45,6 +45,7 @@ private: void CountUsage() override; const AtomicString& FormControlType() const override; + ControlPart AutoAppearance() const override; bool NeedsContainer() const override; void CreateShadowSubtree() override; void HandleKeydownEvent(KeyboardEvent&) override;
diff --git a/third_party/blink/renderer/core/html/forms/text_field_input_type.cc b/third_party/blink/renderer/core/html/forms/text_field_input_type.cc index 4dc4e3f2..6b514f4 100644 --- a/third_party/blink/renderer/core/html/forms/text_field_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/text_field_input_type.cc
@@ -299,6 +299,10 @@ legacy); } +ControlPart TextFieldInputType::AutoAppearance() const { + return kTextFieldPart; +} + void TextFieldInputType::CreateShadowSubtree() { DCHECK(IsShadowHost(GetElement())); ShadowRoot* shadow_root = GetElement().UserAgentShadowRoot();
diff --git a/third_party/blink/renderer/core/html/forms/text_field_input_type.h b/third_party/blink/renderer/core/html/forms/text_field_input_type.h index e9b89b6..229b00f 100644 --- a/third_party/blink/renderer/core/html/forms/text_field_input_type.h +++ b/third_party/blink/renderer/core/html/forms/text_field_input_type.h
@@ -70,6 +70,7 @@ void CustomStyleForLayoutObject(ComputedStyle& style) override; LayoutObject* CreateLayoutObject(const ComputedStyle&, LegacyLayout) const override; + ControlPart AutoAppearance() const override; virtual bool NeedsContainer() const { return false; } virtual String ConvertFromVisibleValue(const String&) const;
diff --git a/third_party/blink/renderer/core/layout/deferred_shaping_test.cc b/third_party/blink/renderer/core/layout/deferred_shaping_test.cc index 1c55e415..2f4a3dc 100644 --- a/third_party/blink/renderer/core/layout/deferred_shaping_test.cc +++ b/third_party/blink/renderer/core/layout/deferred_shaping_test.cc
@@ -486,7 +486,9 @@ <p id="ancestor">IFC <span id="inline_target">inline</span> </p> -<div id="block_target"><p id="inner">IFC</p></div>)HTML"); +<div id="block_target"><p id="inner">IFC</p></div> +<div id="abs_block" style="position:absolute; right:10px; bottom:42px"></div> +)HTML"); UpdateAllLifecyclePhasesForTest(); EXPECT_TRUE(IsDefer("previous")); EXPECT_TRUE(IsLocked("previous")); @@ -506,6 +508,12 @@ EXPECT_TRUE(IsLocked("previous")); EXPECT_FALSE(IsDefer("inner")); EXPECT_FALSE(IsLocked("inner")); + + To<HTMLElement>(GetElementById("abs_block"))->getBoundingClientRect(); + EXPECT_TRUE(IsDefer("previous")); + EXPECT_TRUE(IsLocked("previous")); + EXPECT_FALSE(IsDefer("abs_block")); + EXPECT_FALSE(IsLocked("abs_block")); } TEST_F(DeferredShapingTest, RangeGetClientRects) {
diff --git a/third_party/blink/renderer/core/layout/layout_theme.cc b/third_party/blink/renderer/core/layout/layout_theme.cc index 2c581b2f..5212d4d 100644 --- a/third_party/blink/renderer/core/layout/layout_theme.cc +++ b/third_party/blink/renderer/core/layout/layout_theme.cc
@@ -83,40 +83,8 @@ if (const auto* select = DynamicTo<HTMLSelectElement>(element)) return select->UsesMenuList() ? kMenulistPart : kListboxPart; - if (const auto* input = DynamicTo<HTMLInputElement>(element)) { - const AtomicString& type = input->type(); - if (type == input_type_names::kCheckbox) - return kCheckboxPart; - if (type == input_type_names::kRadio) - return kRadioPart; - if (input->IsTextButton()) - return kPushButtonPart; - if (type == input_type_names::kColor) { - return input->FastHasAttribute(html_names::kListAttr) ? kMenulistPart - : kSquareButtonPart; - } - if (type == input_type_names::kRange) - return kSliderHorizontalPart; - if (type == input_type_names::kSearch) - return kSearchFieldPart; - if (type == input_type_names::kDate || - type == input_type_names::kDatetimeLocal || - type == input_type_names::kMonth || type == input_type_names::kTime || - type == input_type_names::kWeek) { -#if BUILDFLAG(IS_ANDROID) - return kMenulistPart; -#else - return kTextFieldPart; -#endif - } - if (type == input_type_names::kEmail || type == input_type_names::kNumber || - type == input_type_names::kPassword || type == input_type_names::kTel || - type == input_type_names::kText || type == input_type_names::kUrl) - return kTextFieldPart; - - // Type=hidden/image/file. - return kNoControlPart; - } + if (const auto* input = DynamicTo<HTMLInputElement>(element)) + return input->AutoAppearance(); if (element.IsInUserAgentShadowRoot()) { const AtomicString& id_value =
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc index f581ff2..27292d7e 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc
@@ -717,6 +717,33 @@ if (!obj) return nullptr; + Settings* settings = GetSettings(); + if (settings && settings->GetAriaModalPrunesAXTree()) { + // It is possible for the active_aria_modal_dialog_ to become detached in + // between the time a node claims focus and the time we notify platforms + // of that focus change. For instance given an aria-modal dialog which was + // newly unhidden (rather than newly added to the DOM): + // * HandleFocusedUIElementChanged calls UpdateActiveAriaModalDialog + // * UpdateActiveAriaModalDialog sets the value of active_aria_modal_dialog_ + // and then marks the entire tree dirty if that value changed. + // * The subsequent tree update results in the stored active dialog being + // detached and replaced. + // Should this occur, the focused node we're getting or creating here is + // not a descendant of active_aria_modal_dialog_ and is thus pruned from + // the tree. This leads to firing the event on the included parent object, + // which is likely a non-focusable container. + // We could probably address this situation in one of the clean-layout + // functions (e.g. HandleNodeGainedFocusWithCleanLayout). However, because + // both HandleNodeGainedFocusWithCleanLayout and FocusedObject call + // GetOrCreateFocusedObjectFromNode, detecting and correcting this issue + // here seems like it covers more bases. + // TODO(crbug.com/1328815): We need to take a close look at the aria-modal + // tree pruning logic to be sure there are not other situations where we + // incorrectly prune content which should be exposed. + if (active_aria_modal_dialog_ && active_aria_modal_dialog_->IsDetached()) + UpdateActiveAriaModalDialog(node); + } + // the HTML element, for example, is focusable but has an AX object that is // ignored if (!obj->AccessibilityIsIncludedInTree())
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio.cc b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio.cc index 67a3fbd..ace1cff 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio.cc
@@ -1149,12 +1149,21 @@ ProcessingBasedContainer::CreateNoApmProcessedContainer( source_info, is_device_capture, device_parameters_, is_reconfiguration_allowed)); - processing_based_containers_.push_back( - ProcessingBasedContainer::CreateApmProcessedContainer( - source_info, stream_type, is_device_capture, device_parameters_, - is_reconfiguration_allowed)); - - DCHECK_EQ(processing_based_containers_.size(), 3u); + // TODO(https://crbug.com/1332484): Sample rates not divisible by 100 are + // not reliably supported due to the common assumption that sample_rate/100 + // corresponds to 10 ms of audio. This needs to be addressed in order to + // support these rates for WebRTC audio processing in the audio process. + if ((device_parameters_.sample_rate() % 100 == 0) || + !(media::IsChromeWideEchoCancellationEnabled() && + stream_type == mojom::blink::MediaStreamType::DEVICE_AUDIO_CAPTURE)) { + processing_based_containers_.push_back( + ProcessingBasedContainer::CreateApmProcessedContainer( + source_info, stream_type, is_device_capture, device_parameters_, + is_reconfiguration_allowed)); + DCHECK_EQ(processing_based_containers_.size(), 3u); + } else { + DCHECK_EQ(processing_based_containers_.size(), 2u); + } if (source_info.type() == SourceType::kNone) return;
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio_test.cc b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio_test.cc index ad70402..7e54112 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio_test.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio_test.cc
@@ -594,8 +594,8 @@ break; } return testing::Message() - << "GetMediaStreamSource()=" << GetMediaStreamSource() - << ", GetChromeWideAecExperiment()=" << experiment_string; + << "GetMediaStreamSource()=\"" << GetMediaStreamSource() + << "\", GetChromeWideAecExperiment()=" << experiment_string; } // Indicates where and how audio processing is applied. @@ -2122,6 +2122,30 @@ EXPECT_TRUE(result.HasValue()); } +// TODO(https://crbug.com/1332484): Support sample rates not divisible by 100 in +// the audio service. +TEST_P(MediaStreamConstraintsRemoteAPMTest, + NonDivisibleSampleRatesAreNotSupportedInAudioService) { + SCOPED_TRACE(GetMessageForScopedTrace()); + + const std::string k22050HzDeviceId = "22050hz_device"; + capabilities_.emplace_back( + k22050HzDeviceId.c_str(), "22050hz_fake_group", + media::AudioParameters(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, + media::CHANNEL_LAYOUT_STEREO, 22050, 1000)); + + ResetFactory(); + constraint_factory_.basic().device_id.SetExact(k22050HzDeviceId.c_str()); + constraint_factory_.basic().echo_cancellation.SetExact(true); + AudioCaptureSettings result = SelectSettings(); + + // Audio processing is only supported when APM runs in the renderer. + if (GetApmLocation() == ApmLocation::kProcessedLocalAudioSource) + EXPECT_TRUE(result.HasValue()); + else + EXPECT_FALSE(result.HasValue()); +} + TEST_P(MediaStreamConstraintsUtilAudioTest, LatencyConstraint) { if (!IsDeviceCapture()) return;
diff --git a/third_party/blink/renderer/modules/notifications/notification.cc b/third_party/blink/renderer/modules/notifications/notification.cc index f716380..55f10b6 100644 --- a/third_party/blink/renderer/modules/notifications/notification.cc +++ b/third_party/blink/renderer/modules/notifications/notification.cc
@@ -418,6 +418,15 @@ if (!context->IsSecureContext()) return PermissionString(mojom::blink::PermissionStatus::DENIED); + // If the current global object's browsing context is a prerendering browsing + // context, then return "default". + // https://wicg.github.io/nav-speculation/prerendering.html#patch-notifications + if (auto* window = DynamicTo<LocalDOMWindow>(context)) { + if (Document* document = window->document(); document->IsPrerendering()) { + return PermissionString(mojom::blink::PermissionStatus::ASK); + } + } + mojom::blink::PermissionStatus status = NotificationManager::From(context)->GetPermissionStatus();
diff --git a/third_party/blink/renderer/modules/notifications/notification_manager.cc b/third_party/blink/renderer/modules/notifications/notification_manager.cc index cc07a6e8..310b6ad 100644 --- a/third_party/blink/renderer/modules/notifications/notification_manager.cc +++ b/third_party/blink/renderer/modules/notifications/notification_manager.cc
@@ -60,6 +60,17 @@ if (GetSupplementable()->IsContextDestroyed()) return mojom::blink::PermissionStatus::DENIED; + // Tentatively have an early return to avoid calling GetNotificationService() + // during prerendering. The return value is the same as + // `Notification::permission`'s. + // TODO(1280155): defer the construction of notification to ensure this method + // is not called during prerendering instead. + if (auto* window = DynamicTo<LocalDOMWindow>(GetSupplementable())) { + if (Document* document = window->document(); document->IsPrerendering()) { + return mojom::blink::PermissionStatus::ASK; + } + } + SCOPED_UMA_HISTOGRAM_TIMER( "Blink.NotificationManager.GetPermissionStatusTime"); mojom::blink::PermissionStatus permission_status;
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc b/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc index 124aca1..6384a6a 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc
@@ -34,15 +34,19 @@ DCHECK(webgpu_desc); WGPURenderPassColorAttachment dawn_desc = {}; + // TODO(dawn:1269): Remove after the deprecation period. + // clearColor needs to be set to all NaNs to signal that it is not in use. + dawn_desc.clearColor = {NAN, NAN, NAN, NAN}; + dawn_desc.view = webgpu_desc->view()->GetHandle(); dawn_desc.resolveTarget = webgpu_desc->hasResolveTarget() ? webgpu_desc->resolveTarget()->GetHandle() : nullptr; if (webgpu_desc->hasClearValue()) { - dawn_desc.clearColor = AsDawnType(webgpu_desc->clearValue()); + dawn_desc.clearValue = AsDawnType(webgpu_desc->clearValue()); } else { - dawn_desc.clearColor = {}; + dawn_desc.clearValue = {}; } if (webgpu_desc->hasLoadOp()) { @@ -56,12 +60,12 @@ break; case V8UnionGPUColorOrGPULoadOp::ContentType::kGPUColorDict: dawn_desc.loadOp = WGPULoadOp_Clear; - dawn_desc.clearColor = + dawn_desc.clearValue = AsDawnType(webgpu_desc->loadValue()->GetAsGPUColorDict()); break; case V8UnionGPUColorOrGPULoadOp::ContentType::kDoubleSequence: dawn_desc.loadOp = WGPULoadOp_Clear; - dawn_desc.clearColor = + dawn_desc.clearValue = AsDawnColor(webgpu_desc->loadValue()->GetAsDoubleSequence()); break; } @@ -85,62 +89,66 @@ DCHECK(webgpu_desc); WGPURenderPassDepthStencilAttachment dawn_desc = {}; - dawn_desc.view = webgpu_desc->view()->GetHandle(); + // TODO(dawn:1269): Remove after the deprecation period. + // clearDepth needs to be set to NaN to signal that it is not in use. + dawn_desc.clearDepth = NAN; - if (webgpu_desc->hasDepthLoadOp()) { - dawn_desc.depthLoadOp = AsDawnEnum(webgpu_desc->depthLoadOp()); - dawn_desc.clearDepth = webgpu_desc->depthClearValue(); - } else if (webgpu_desc->hasDepthLoadValue()) { - // TODO(dawn:1269): Remove this branch after the deprecation period. - device->AddConsoleWarning( - "depthLoadValue has been deprecated and will soon be removed. Use " - "depthLoadOp and depthClearValue instead."); + dawn_desc.view = webgpu_desc->view()->GetHandle(); - switch (webgpu_desc->depthLoadValue()->GetContentType()) { - case V8UnionFloatOrGPULoadOp::ContentType::kGPULoadOp: - dawn_desc.depthLoadOp = - AsDawnEnum(webgpu_desc->depthLoadValue()->GetAsGPULoadOp()); - dawn_desc.clearDepth = 1.0f; - break; - case V8UnionFloatOrGPULoadOp::ContentType::kFloat: - dawn_desc.depthLoadOp = WGPULoadOp_Clear; - dawn_desc.clearDepth = webgpu_desc->depthLoadValue()->GetAsFloat(); - break; - } + if (webgpu_desc->hasDepthLoadOp()) { + dawn_desc.depthLoadOp = AsDawnEnum(webgpu_desc->depthLoadOp()); + dawn_desc.depthClearValue = webgpu_desc->depthClearValue(); + } else if (webgpu_desc->hasDepthLoadValue()) { + // TODO(dawn:1269): Remove this branch after the deprecation period. + device->AddConsoleWarning( + "depthLoadValue has been deprecated and will soon be removed. Use " + "depthLoadOp and depthClearValue instead."); + + switch (webgpu_desc->depthLoadValue()->GetContentType()) { + case V8UnionFloatOrGPULoadOp::ContentType::kGPULoadOp: + dawn_desc.depthLoadOp = + AsDawnEnum(webgpu_desc->depthLoadValue()->GetAsGPULoadOp()); + dawn_desc.depthClearValue = 1.0f; + break; + case V8UnionFloatOrGPULoadOp::ContentType::kFloat: + dawn_desc.depthLoadOp = WGPULoadOp_Clear; + dawn_desc.depthClearValue = webgpu_desc->depthLoadValue()->GetAsFloat(); + break; } + } - if (webgpu_desc->hasDepthStoreOp()) { - dawn_desc.depthStoreOp = AsDawnEnum(webgpu_desc->depthStoreOp()); + if (webgpu_desc->hasDepthStoreOp()) { + dawn_desc.depthStoreOp = AsDawnEnum(webgpu_desc->depthStoreOp()); + } + + dawn_desc.depthReadOnly = webgpu_desc->depthReadOnly(); + + if (webgpu_desc->hasStencilLoadOp()) { + dawn_desc.stencilLoadOp = AsDawnEnum(webgpu_desc->stencilLoadOp()); + dawn_desc.clearStencil = webgpu_desc->stencilClearValue(); + } else if (webgpu_desc->hasStencilLoadValue()) { + // TODO(dawn:1269): Remove this branch after the deprecation period. + device->AddConsoleWarning( + "stencilLoadValue has been deprecated and will soon be removed. Use " + "stencilLoadOp and stencilClearValue instead."); + + switch (webgpu_desc->stencilLoadValue()->GetContentType()) { + case V8UnionGPULoadOpOrGPUStencilValue::ContentType::kGPULoadOp: + dawn_desc.stencilLoadOp = + AsDawnEnum(webgpu_desc->stencilLoadValue()->GetAsGPULoadOp()); + dawn_desc.clearStencil = 0; + break; + case V8UnionGPULoadOpOrGPUStencilValue::ContentType::kV8GPUStencilValue: + dawn_desc.stencilLoadOp = WGPULoadOp_Clear; + dawn_desc.clearStencil = + webgpu_desc->stencilLoadValue()->GetAsV8GPUStencilValue(); + break; } + } - dawn_desc.depthReadOnly = webgpu_desc->depthReadOnly(); - - if (webgpu_desc->hasStencilLoadOp()) { - dawn_desc.stencilLoadOp = AsDawnEnum(webgpu_desc->stencilLoadOp()); - dawn_desc.clearStencil = webgpu_desc->stencilClearValue(); - } else if (webgpu_desc->hasStencilLoadValue()) { - // TODO(dawn:1269): Remove this branch after the deprecation period. - device->AddConsoleWarning( - "stencilLoadValue has been deprecated and will soon be removed. Use " - "stencilLoadOp and stencilClearValue instead."); - - switch (webgpu_desc->stencilLoadValue()->GetContentType()) { - case V8UnionGPULoadOpOrGPUStencilValue::ContentType::kGPULoadOp: - dawn_desc.stencilLoadOp = - AsDawnEnum(webgpu_desc->stencilLoadValue()->GetAsGPULoadOp()); - dawn_desc.clearStencil = 0; - break; - case V8UnionGPULoadOpOrGPUStencilValue::ContentType::kV8GPUStencilValue: - dawn_desc.stencilLoadOp = WGPULoadOp_Clear; - dawn_desc.clearStencil = - webgpu_desc->stencilLoadValue()->GetAsV8GPUStencilValue(); - break; - } - } - - if (webgpu_desc->hasStencilStoreOp()) { - dawn_desc.stencilStoreOp = AsDawnEnum(webgpu_desc->stencilStoreOp()); - } + if (webgpu_desc->hasStencilStoreOp()) { + dawn_desc.stencilStoreOp = AsDawnEnum(webgpu_desc->stencilStoreOp()); + } dawn_desc.stencilReadOnly = webgpu_desc->stencilReadOnly();
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 1047d28..b5f061b 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -7085,3 +7085,6 @@ crbug.com/1273409 [ Mac11-arm64 ] fast/canvas/OffscreenCanvas-2d-drawImage.html [ Failure Pass ] crbug.com/1273409 [ Linux ] fast/canvas/OffscreenCanvas-2d-drawImage.html [ Failure Pass ] crbug.com/1273409 [ Win10.20h2 ] fast/canvas/OffscreenCanvas-2d-drawImage.html [ Failure Pass ] + +# Temporarily allow pass or failure while new WebRTC stats are added and rolled into Chromium. +crbug.com/webrtc/14147 external/wpt/webrtc-stats/supported-stats.html [ Failure Pass ]
diff --git a/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/resources/notification-before-activation.html b/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/resources/notification-before-activation.html new file mode 100644 index 0000000..16aab48 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/resources/notification-before-activation.html
@@ -0,0 +1,40 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/speculation-rules/prerender/resources/utils.js"></script> +<script src="/speculation-rules/prerender/resources/deferred-promise-utils.js"></script> +<script> + +const params = new URLSearchParams(location.search); + +// The main test page (restriction-notification.https.html) loads the +// initiator page, then the initiator page will prerender itself with the +// `prerendering` parameter. +const isPrerendering = params.has('prerendering'); + +if (!isPrerendering) { + loadInitiatorPage(); +} else { + const prerenderEventCollector = new PrerenderEventCollector(); + prerenderEventCollector.addEvent( + `Notification permission is ${Notification.permission}`); + const promise = Notification.requestPermission() + .then(permission => { + prerenderEventCollector.addEvent(`permission was ${permission}`); + if (permission !== "granted") return; + const displayPromise = new Promise((resolve, reject) => { + const notification = new Notification("Prerender Notification"); + notification.onshow = () => { + prerenderEventCollector.addEvent('notification displayed'); + resolve("Displayed"); + }; + notification.onerror = () => { + reject("Error on displaying notification"); + }; + }); + return displayPromise; + }); + prerenderEventCollector.start(promise, 'notification'); +} + +</script> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/resources/notification.html b/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/resources/notification-on-activation.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/speculation-rules/prerender/resources/notification.html rename to third_party/blink/web_tests/external/wpt/speculation-rules/prerender/resources/notification-on-activation.html
diff --git a/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/restriction-notification.https.html b/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/restriction-notification.https.html index e9d3ba2..205d020c 100644 --- a/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/restriction-notification.https.html +++ b/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/restriction-notification.https.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- +https://wicg.github.io/nav-speculation/prerendering.html#patch-notifications TODO(https://crbug.com/1198110): Add the following tests: -* Test the deferral of the promise if it is used during prerendering. -* Test Notification.permission returns "default" synchronously. +* Test the constructor returns synchronously while the creation of the + notification is deferred until activation. --> -<title>Access to the Notification API is allowed after the prerendering state - changed </title> +<title>Access to the Notification API before and after prerender activation</title> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -23,7 +23,9 @@ const bc = new PrerenderChannel('test-channel', uid); t.add_cleanup(_ => bc.close()); - await test_driver.set_permission({name: 'notifications'}, 'granted', true); + await test_driver.set_permission({ + name: 'notifications' + }, 'granted', true); const gotMessage = new Promise(resolve => { bc.addEventListener('message', e => { resolve(e.data); @@ -31,7 +33,7 @@ once: true }); }); - const url = `resources/notification.html?uid=${uid}`; + const url = `resources/notification-on-activation.html?uid=${uid}`; window.open(url, '_blank', 'noopener'); const result = await gotMessage; @@ -39,5 +41,66 @@ }, `it is allowed to access the notification API in the prerenderingchange event`); +promise_test(async t => { + const uid = token(); + const bc = new PrerenderChannel('test-channel', uid); + t.add_cleanup(_ => bc.close()); + + await test_driver.set_permission({ + name: 'notifications' + }, 'granted', true); + const gotMessage = new Promise(resolve => { + bc.addEventListener('message', e => { + resolve(e.data); + }, { + once: true + }); + }); + const url = `resources/notification-before-activation.html?uid=${uid}`; + window.open(url, '_blank', 'noopener'); + + const result = await gotMessage; + + const expected = [{ + event: 'Notification permission is default', + prerendering: true + }, + { + event: 'started waiting notification', + prerendering: true + }, + { + event: 'prerendering change', + prerendering: false + }, + { + event: 'permission was granted', + prerendering: false + }, + { + event: 'notification displayed', + prerendering: false + }, + { + event: 'finished waiting notification', + prerendering: false + }, + ]; + + length = Math.min(result.length, expected.length); + let i = 0; + for (i = 0; i < length; i++) { + assert_equals(result[i].event, expected[i].event, `event[${i}]`); + assert_equals(result[i].prerendering, expected[i].prerendering, + `prerendering[${i}]`); + } + assert_equals(i, expected.length); + + // Send a close signal to PrerenderEventCollector on the prerendered page. + new PrerenderChannel('close', uid).postMessage(''); +}, +`Displaying Notification should be deferred until the prerendered page is + activated`); + </script> </body>
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/css/content-visibility-console-messages-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/css/content-visibility-console-messages-expected.txt new file mode 100644 index 0000000..8f91f50 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/css/content-visibility-console-messages-expected.txt
@@ -0,0 +1,10 @@ +CONSOLE MESSAGE: forcing layout on c-v:hidden should make a console warning. +CONSOLE DEBUG: Rendering was performed in a subtree hidden by content-visibility:hidden. +CONSOLE MESSAGE: forcing layout on c-v:auto should NOT make a console warning. +CONSOLE MESSAGE: calling isVisible should NOT make a console warning. +CONSOLE MESSAGE: forcing layout via range APIs on c-v:hidden should make a console warning. +CONSOLE DEBUG: Rendering was performed in a subtree hidden by content-visibility:hidden. +CONSOLE MESSAGE: forcing layout via range APIs on c-v:auto should NOT make a console warning. +CONSOLE MESSAGE: forcing layout on c-v:hidden inside c-v:auto should make a console warning. +CONSOLE DEBUG: Rendering was performed in a subtree hidden by content-visibility:hidden. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/webrtc-stats/supported-stats-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/webrtc-stats/supported-stats-expected.txt index 09420f17..8881c15 100644 --- a/third_party/blink/web_tests/platform/generic/external/wpt/webrtc-stats/supported-stats-expected.txt +++ b/third_party/blink/web_tests/platform/generic/external/wpt/webrtc-stats/supported-stats-expected.txt
@@ -41,6 +41,7 @@ PASS inbound-rtp's totalProcessingDelay FAIL inbound-rtp's estimatedPlayoutTimestamp assert_true: Is estimatedPlayoutTimestamp present expected true got false PASS inbound-rtp's jitterBufferDelay +PASS inbound-rtp's jitterBufferTargetDelay PASS inbound-rtp's jitterBufferEmittedCount PASS inbound-rtp's totalSamplesReceived FAIL inbound-rtp's totalSamplesDecoded assert_true: Is totalSamplesDecoded present expected true got false
diff --git a/third_party/blink/web_tests/platform/generic/fast/css/content-visibility-console-messages-expected.txt b/third_party/blink/web_tests/platform/generic/fast/css/content-visibility-console-messages-expected.txt index 8f91f50..85eff85 100644 --- a/third_party/blink/web_tests/platform/generic/fast/css/content-visibility-console-messages-expected.txt +++ b/third_party/blink/web_tests/platform/generic/fast/css/content-visibility-console-messages-expected.txt
@@ -7,4 +7,5 @@ CONSOLE MESSAGE: forcing layout via range APIs on c-v:auto should NOT make a console warning. CONSOLE MESSAGE: forcing layout on c-v:hidden inside c-v:auto should make a console warning. CONSOLE DEBUG: Rendering was performed in a subtree hidden by content-visibility:hidden. +CONSOLE DEBUG: Rendering was performed in a subtree hidden by content-visibility:hidden.
diff --git a/third_party/wayland-protocols/unstable/keyboard/keyboard-configuration-unstable-v1.xml b/third_party/wayland-protocols/unstable/keyboard/keyboard-configuration-unstable-v1.xml index 6bb361a..aa0ea23 100644 --- a/third_party/wayland-protocols/unstable/keyboard/keyboard-configuration-unstable-v1.xml +++ b/third_party/wayland-protocols/unstable/keyboard/keyboard-configuration-unstable-v1.xml
@@ -24,7 +24,7 @@ DEALINGS IN THE SOFTWARE. </copyright> - <interface name="zcr_keyboard_configuration_v1" version="2"> + <interface name="zcr_keyboard_configuration_v1" version="3"> <description summary="extends wl_keyboard with events for device configuration change"> Allows a wl_keyboard to notify device configuration change events of the keyboard to the client. @@ -57,7 +57,7 @@ </request> </interface> - <interface name="zcr_keyboard_device_configuration_v1" version="2"> + <interface name="zcr_keyboard_device_configuration_v1" version="3"> <description summary="extension of wl_keyboard protocol"> The zcr_keyboard_device_configuration_v1 interface extends the wl_keyboard interface with events to describe device configuration of a keyboard. @@ -93,6 +93,14 @@ </description> <arg name="name" type="string" summary="XKB layout name e.g. us(dvorak)"/> </event> + + <!-- Version 3 additions --> + <event name="supported_key_bits" since="3"> + <description summary="supported key bits"> + Union of supported scan code key bits of all connected keyboards. + </description> + <arg name="key_bits" type="array" summary="Uint64 key bits" /> + </event> </interface> </protocol>
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec index e36e971..70a1901 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec
@@ -497,6 +497,10 @@ "META": {"sizes": {"includes": [10]}}, "includes": [3020], }, + "<(SHARED_INTERMEDIATE_DIR)/ash/webui/guest_os_installer/resources/ash_guest_os_installer_resources.grd": { + "META": {"sizes": {"includes": [10]}}, + "includes": [3030], + }, "ash/webui/help_app_ui/resources/help_app_resources.grd": { "includes": [3040], },
diff --git a/tools/idl_parser/idl_parser.py b/tools/idl_parser/idl_parser.py index 743a31b..1ec7054 100755 --- a/tools/idl_parser/idl_parser.py +++ b/tools/idl_parser/idl_parser.py
@@ -1042,9 +1042,10 @@ # [ identifier = identifier ] # [ identifier = ( IdentifierList ) ] # [ identifier = identifier ( ArgumentList ) ] + # [ identifier = StringLiteral ] # [ identifier = ( StringList ) ] - # The first five patterns are specified in the Web IDL spec and the last - # pattern is Blink's custom extension to support [ReflectOnly]. + # The first five patterns are specified in the Web IDL spec and the last two + # patterns are Blink's custom extension to support [ReflectOnly]. def p_ExtendedAttribute(self, p): """ExtendedAttribute : ExtendedAttributeNoArgs | ExtendedAttributeArgList @@ -1096,11 +1097,6 @@ value = self.BuildNamed('Call', p, 3, args) p[0] = self.BuildNamed('ExtAttribute', p, 1, value) - - - - - # Blink extension: Add support for string literal Extended Attribute values def p_ExtendedAttributeStringLiteral(self, p): """ExtendedAttributeStringLiteral : identifier '=' StringLiteral"""
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index dcad7e7..a275e6ad 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -33416,6 +33416,8 @@ label="For ChromeHomeMenuHeader feature."/> <suffix name="ChromeHomePullToRefresh" label="For ChromeHomePullToRefresh feature."/> + <suffix name="ContextualPageActions_PriceTracking" + label="For Contextual page actions price tracking feature."/> <suffix name="ContextualSearch" label="For ContextualSearch feature."/> <suffix name="ContextualSearchInPanelHelp" label="For ContextualSearchInPanelHelp feature."/>
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index caae52fe..2ba1a80 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -40267,6 +40267,8 @@ <int value="4256" label="EventTimingInteractionId"/> <int value="4257" label="SecurePaymentConfirmationOptOut"/> <int value="4258" label="AnyPopupAttribute"/> + <int value="4259" label="DeferredShapingWorked"/> + <int value="4260" label="DeferredShapingReshapedByForceLayout"/> </enum> <enum name="FeaturePolicyAllowlistType"> @@ -54926,6 +54928,7 @@ <int value="-1953121360" label="EphemeralTab:disabled"/> <int value="-1951046208" label="SidePanelPrototype:disabled"/> <int value="-1950469963" label="SeparatePointingStickSettings:enabled"/> + <int value="-1949364473" label="webview-disable-app-recovery"/> <int value="-1948540128" label="disable-webrtc-hw-encoding (deprecated)"/> <int value="-1948261745" label="EnforceAshExtensionKeeplist:disabled"/> <int value="-1948236151" label="DrawPredictedInkPoint:disabled"/> @@ -76853,7 +76856,7 @@ <int value="0" label="kUnknown"/> <int value="1" label="kGamepadHapticsManager"/> <int value="2" label="kGamepadMonitor"/> - <int value="3" label="kNotificationService"/> + <int value="3" label="kNotificationService (Obsolete)"/> <int value="4" label="kSyncEncryptionKeysExtension"/> </enum>
diff --git a/tools/metrics/histograms/metadata/accessibility/histograms.xml b/tools/metrics/histograms/metadata/accessibility/histograms.xml index ae12f8cc4..c5e212b 100644 --- a/tools/metrics/histograms/metadata/accessibility/histograms.xml +++ b/tools/metrics/histograms/metadata/accessibility/histograms.xml
@@ -190,7 +190,7 @@ </histogram> <histogram name="Accessibility.Android.OnDemand.OneHundredPercentEventsDropped" - units="count" expires_after="2022-11-27"> + units="count" expires_after="2022-12-04"> <owner>mschillaci@google.com</owner> <owner>abigailbklein@google.com</owner> <summary> @@ -221,7 +221,7 @@ </histogram> <histogram name="Accessibility.Android.OnDemand.PercentageDropped" units="%" - expires_after="2022-11-27"> + expires_after="2022-12-04"> <owner>mschillaci@google.com</owner> <owner>abigailbklein@google.com</owner> <summary> @@ -909,7 +909,7 @@ </histogram> <histogram name="Accessibility.ImageLabels.Android" enum="BooleanEnabled" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>dtseng@chromium.org</owner> <owner>mschillaci@google.com</owner> <owner>chrome-a11y-core@google.com</owner> @@ -1520,7 +1520,7 @@ </histogram> <histogram name="Accessibility.WinAPIs" enum="AccessibilityWinAPIEnum" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>aleventhal@chromium.org</owner> <owner>nektar@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> @@ -2004,7 +2004,7 @@ </histogram> <histogram name="TextToSpeech.Utterance.FromExtensionAPI" - enum="TextToSpeechFromExtensionAPI" expires_after="2022-10-04"> + enum="TextToSpeechFromExtensionAPI" expires_after="2022-12-04"> <owner>dtseng@chromium.org</owner> <owner>katie@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/android/histograms.xml b/tools/metrics/histograms/metadata/android/histograms.xml index 08df051..d539788 100644 --- a/tools/metrics/histograms/metadata/android/histograms.xml +++ b/tools/metrics/histograms/metadata/android/histograms.xml
@@ -223,7 +223,7 @@ </histogram> <histogram name="Android.AdaptiveToolbarButton.SettingsToggle.Changed" - enum="BooleanEnabled" expires_after="2022-09-18"> + enum="BooleanEnabled" expires_after="2022-12-04"> <owner>shaktisahu@chromium.org</owner> <owner>chrome-segmentation-platform@google.com</owner> <summary> @@ -351,7 +351,7 @@ </histogram> <histogram name="Android.AutofillAssistant.DropOutReason{Intent}" - enum="AutofillAssistantDropOutReason" expires_after="2022-06-08"> + enum="AutofillAssistantDropOutReason" expires_after="2023-06-08"> <owner>brunobraga@google.com</owner> <owner>vizcay@google.com</owner> <owner>mcarlen@chromium.org</owner> @@ -597,7 +597,7 @@ </histogram> <histogram name="Android.BackgroundTaskScheduler.TaskLoadedNative.FullBrowser" - enum="BackgroundTaskId" expires_after="2022-10-04"> + enum="BackgroundTaskId" expires_after="2022-12-04"> <owner>mheikal@chromium.org</owner> <owner>hanxi@chromium.org</owner> <owner>hnakashima@chromium.org</owner> @@ -885,7 +885,7 @@ </histogram> <histogram name="Android.DarkTheme.ThemeSettingsEntry" - enum="AndroidThemeSettingsEntry" expires_after="2022-10-01"> + enum="AndroidThemeSettingsEntry" expires_after="2022-12-04"> <owner>nemco@google.com</owner> <owner>wenyufu@chromium.org</owner> <owner>clank-app-team@google.com</owner> @@ -2339,7 +2339,7 @@ </histogram> <histogram name="Android.Omnibox.RefineActionUsage" enum="RefineActionUsage" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>ender@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> <summary> @@ -2742,7 +2742,7 @@ </histogram> <histogram name="Android.PhotoPicker.DialogAction" - enum="PhotoPickerDialogAction" expires_after="2022-10-04"> + enum="PhotoPickerDialogAction" expires_after="2022-12-04"> <owner>finnur@chromium.org</owner> <owner>twellington@chromium.org</owner> <summary> @@ -3118,7 +3118,7 @@ </histogram> <histogram name="Android.Survey.DownloadRequested2" enum="BooleanRequested" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>twellington@chromium.org</owner> <owner>wenyufu@chromium.org</owner> <owner>clank-app-team@google.com</owner> @@ -3130,7 +3130,7 @@ </histogram> <histogram name="Android.Survey.DownloadResponseCode2" - enum="SurveyDownloadResponseCodes2" expires_after="2022-10-04"> + enum="SurveyDownloadResponseCodes2" expires_after="2022-12-04"> <owner>skym@chromium.org</owner> <owner>wenyufu@chromium.org</owner> <owner>clank-app-team@google.com</owner> @@ -3143,7 +3143,7 @@ </histogram> <histogram name="Android.Survey.InfoBarClosingState" - enum="InfoBarClosingStates" expires_after="2022-10-04"> + enum="InfoBarClosingStates" expires_after="2022-12-04"> <owner>twellington@chromium.org</owner> <owner>wenyufu@chromium.org</owner> <owner>clank-app-team@google.com</owner> @@ -3194,7 +3194,7 @@ </histogram> <histogram name="Android.Survey.SurveyFilteringResults" - enum="SurveyFilteringResult" expires_after="2022-10-04"> + enum="SurveyFilteringResult" expires_after="2022-12-04"> <owner>twellington@chromium.org</owner> <owner>wenyufu@chromium.org</owner> <owner>clank-app-team@google.com</owner> @@ -3240,7 +3240,7 @@ </histogram> <histogram name="Android.TabStrip.TimeToSwitchTab" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>gauravjj@google.com</owner> <owner>twellington@chromium.org</owner> <owner>clank-large-form-factors@google.com</owner> @@ -3265,7 +3265,7 @@ </histogram> <histogram name="Android.TaskScheduling.BootstrapTaskRunnerType" - enum="BootstrapTaskRunnerType" expires_after="2022-10-04"> + enum="BootstrapTaskRunnerType" expires_after="2022-12-04"> <owner>blundell@chromium.org</owner> <owner>scheduler-dev@chromium.org</owner> <summary> @@ -3276,7 +3276,7 @@ </histogram> <histogram name="Android.TaskScheduling.PreNativeTaskPostType" - enum="PreNativeTaskPostType" expires_after="2022-10-04"> + enum="PreNativeTaskPostType" expires_after="2022-12-04"> <owner>blundell@chromium.org</owner> <owner>scheduler-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/apps/histograms.xml b/tools/metrics/histograms/metadata/apps/histograms.xml index 2384df6..70c4a50 100644 --- a/tools/metrics/histograms/metadata/apps/histograms.xml +++ b/tools/metrics/histograms/metadata/apps/histograms.xml
@@ -220,7 +220,7 @@ </histogram> <histogram name="Apps.AppLaunchPerAppType" enum="AppType" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>chromeos-apps-foundation-team@google.com</owner> <summary> @@ -230,7 +230,7 @@ </histogram> <histogram name="Apps.AppLaunchPerAppTypeV2" enum="AppTypeV2" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>chromeos-apps-foundation-team@google.com</owner> <summary> @@ -240,7 +240,7 @@ </histogram> <histogram name="Apps.AppLaunchSource" enum="LaunchSource" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>chromeos-apps-foundation-team@google.com</owner> <summary>Records an app launch grouped by launch source.</summary> @@ -466,7 +466,7 @@ </histogram> <histogram name="Apps.AppList.DriveZeroStateProvider.HypotheticalQuery" - enum="DriveZeroStateProviderThrottleInterval" expires_after="2022-10-04"> + enum="DriveZeroStateProviderThrottleInterval" expires_after="2022-12-04"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <owner>wrong@chromium.org</owner> @@ -478,7 +478,7 @@ </histogram> <histogram name="Apps.AppList.DriveZeroStateProvider.Latency" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>tby@chromium.org</owner> <owner>thanhdng@chromium.org</owner> <owner>wrong@chromium.org</owner> @@ -1839,7 +1839,7 @@ </histogram> <histogram name="Apps.ArcGhostWindowLaunch" enum="Boolean" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>sstan@chromium.org</owner> <summary> @@ -2102,7 +2102,7 @@ </histogram> <histogram name="Apps.IconLoadingMethod" enum="IconLoadingMethod" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>chromeos-apps-foundation-team@google.com</owner> <summary>Records the app icon loading method when loading app icons.</summary> @@ -2563,7 +2563,7 @@ <histogram base="true" name="Apps.PaginationTransition.DragScroll.PresentationTime" units="ms" - expires_after="2022-10-03"> + expires_after="2022-12-04"> <!-- Name completed by histogram_suffixes name="TabletOrClamshellMode" --> @@ -2615,7 +2615,7 @@ </histogram> <histogram name="Apps.RestoreArcAppStates" enum="ArcRestoreState" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>sstan@chromium.org</owner> <summary> @@ -2625,7 +2625,7 @@ </histogram> <histogram name="Apps.RestoreArcWindowCount" units="units" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>sstan@chromium.org</owner> <summary> @@ -2636,7 +2636,7 @@ </histogram> <histogram name="Apps.RestoreBrowserResult" enum="RestoreTabResult" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <summary> @@ -2646,7 +2646,7 @@ </histogram> <histogram name="Apps.RestoredAppLaunch" enum="AppType" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <summary> @@ -2656,7 +2656,7 @@ </histogram> <histogram name="Apps.RestoreForCrashNotification" enum="RestoreAction" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <summary> @@ -2666,7 +2666,7 @@ </histogram> <histogram name="Apps.RestoreInitSetting" enum="RestoreSetting" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <summary> @@ -2676,7 +2676,7 @@ </histogram> <histogram name="Apps.RestoreNoGhostWindowReason" enum="ArcNoWindowReason" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>sstan@chromium.org</owner> <summary> @@ -2685,7 +2685,7 @@ </histogram> <histogram name="Apps.RestoreNotification" enum="RestoreAction" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <summary> @@ -2695,7 +2695,7 @@ </histogram> <histogram name="Apps.RestoreSetting" enum="RestoreSetting" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <summary> @@ -2776,7 +2776,7 @@ </histogram> <histogram name="Apps.SessionRestoreExitResult" enum="SessionRestoreExitResult" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <summary> @@ -2786,7 +2786,7 @@ </histogram> <histogram name="Apps.SessionRestoreWindowCount" - enum="SessionRestoreWindowCount" expires_after="2022-10-04"> + enum="SessionRestoreWindowCount" expires_after="2022-12-04"> <owner>nancylingwang@chromium.org</owner> <owner>sammiequon@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/arc/histograms.xml b/tools/metrics/histograms/metadata/arc/histograms.xml index 6d53898..ba4942d 100644 --- a/tools/metrics/histograms/metadata/arc/histograms.xml +++ b/tools/metrics/histograms/metadata/arc/histograms.xml
@@ -230,7 +230,7 @@ </histogram> <histogram name="Arc.App.LowMemoryKills.LinuxOOMCount10Minutes" units="Apps" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>cwd@google.com</owner> <owner>cros-platform-kernel-core@google.com</owner> <summary> @@ -240,7 +240,7 @@ </histogram> <histogram name="Arc.App.LowMemoryKills.LMKD.CachedCount10Minutes" units="Apps" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>cwd@google.com</owner> <owner>cros-platform-kernel-core@google.com</owner> <summary> @@ -250,7 +250,7 @@ </histogram> <histogram name="Arc.App.LowMemoryKills.LMKD.ForegroundCount10Minutes" - units="Apps" expires_after="2022-10-04"> + units="Apps" expires_after="2022-12-04"> <owner>cwd@google.com</owner> <owner>cros-platform-kernel-core@google.com</owner> <summary> @@ -260,7 +260,7 @@ </histogram> <histogram name="Arc.App.LowMemoryKills.LMKD.PerceptibleCount10Minutes" - units="Apps" expires_after="2022-10-04"> + units="Apps" expires_after="2022-12-04"> <owner>cwd@google.com</owner> <owner>cros-platform-kernel-core@google.com</owner> <summary> @@ -271,7 +271,7 @@ </histogram> <histogram name="Arc.App.LowMemoryKills.Pressure.CachedCount10Minutes" - units="Apps" expires_after="2022-10-04"> + units="Apps" expires_after="2022-12-04"> <owner>cwd@google.com</owner> <owner>cros-platform-kernel-core@google.com</owner> <summary> @@ -282,7 +282,7 @@ </histogram> <histogram name="Arc.App.LowMemoryKills.Pressure.ForegroundCount10Minutes" - units="Apps" expires_after="2022-10-04"> + units="Apps" expires_after="2022-12-04"> <owner>cwd@google.com</owner> <owner>cros-platform-kernel-core@google.com</owner> <summary> @@ -293,7 +293,7 @@ </histogram> <histogram name="Arc.App.LowMemoryKills.Pressure.PerceptibleCount10Minutes" - units="Apps" expires_after="2022-10-04"> + units="Apps" expires_after="2022-12-04"> <owner>cwd@google.com</owner> <owner>cros-platform-kernel-core@google.com</owner> <summary> @@ -314,7 +314,7 @@ </summary> </histogram> -<histogram name="Arc.AppCount" units="units" expires_after="2022-11-27"> +<histogram name="Arc.AppCount" units="units" expires_after="2022-12-04"> <owner>elijahtaylor@google.com</owner> <owner>fahdi@google.com</owner> <summary> @@ -384,7 +384,7 @@ </histogram> <histogram name="Arc.AppShortcutSearchResult.ShortcutStatus" - enum="ArcAppShortcutStatus" expires_after="2022-10-04"> + enum="ArcAppShortcutStatus" expires_after="2022-12-04"> <owner>batoon@google.com</owner> <owner>arc-core@google.com</owner> <summary> @@ -395,7 +395,7 @@ </histogram> <histogram name="Arc.AppShortcutsRequest.ShortcutStatus" - enum="ArcAppShortcutStatus" expires_after="2022-10-04"> + enum="ArcAppShortcutStatus" expires_after="2022-12-04"> <owner>batoon@google.com</owner> <owner>arc-core@google.com</owner> <summary> @@ -507,7 +507,7 @@ </histogram> <histogram name="Arc.Auth.MainAccountHashMigration.Status" - enum="ArcMainAccountHashMigrationStatus" expires_after="2022-10-04"> + enum="ArcMainAccountHashMigrationStatus" expires_after="2022-12-04"> <owner>vsomani@google.com</owner> <owner>arc-core@google.com</owner> <summary> @@ -561,7 +561,7 @@ </histogram> <histogram name="Arc.Auth.RequestAccountInfoResult.Primary" - enum="ArcAuthCodeStatus" expires_after="2022-10-04"> + enum="ArcAuthCodeStatus" expires_after="2022-12-04"> <owner>anastasiian@google.com</owner> <owner>mhasank@google.com</owner> <owner>arc-core@google.com</owner> @@ -727,7 +727,7 @@ </histogram> <histogram name="Arc.CompatMode.InitialResizeLockState" - enum="ArcResizeLockState" expires_after="2022-10-04"> + enum="ArcResizeLockState" expires_after="2022-12-04"> <owner>toshikikikuchi@google.com</owner> <owner>takise@google.com</owner> <summary> @@ -737,7 +737,7 @@ </histogram> <histogram name="Arc.CompatMode.RightClickConversion" - enum="ArcRightClickConversionResult" expires_after="2022-10-04"> + enum="ArcRightClickConversionResult" expires_after="2022-12-04"> <owner>yhanada@google.com</owner> <owner>arc-framework@google.com</owner> <summary> @@ -1045,7 +1045,7 @@ </histogram> <histogram name="Arc.Fixup.Entire.Failures" units="units" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>risan@google.com</owner> <owner>arc-storage@google.com</owner> <summary> @@ -1141,7 +1141,7 @@ </summary> </histogram> -<histogram name="Arc.ImeCount" units="units" expires_after="2022-10-01"> +<histogram name="Arc.ImeCount" units="units" expires_after="2022-12-04"> <owner>yhanada@chromium.org</owner> <owner>arc-framework@chromium.org</owner> <summary> @@ -1542,7 +1542,7 @@ </histogram> <histogram name="Arc.PlayStoreLaunchWithinAWeek" enum="BooleanUsage" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>rsorokin@chromium.org</owner> <owner>cros-oac@google.com</owner> <summary> @@ -2027,7 +2027,7 @@ </histogram> <histogram name="Arc.Wayland.LateTiming.Duration" units="ms" - expires_after="2022-10-05"> + expires_after="2022-12-04"> <owner>alanding@google.com</owner> <owner>arc-performance@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/ash/histograms.xml b/tools/metrics/histograms/metadata/ash/histograms.xml index 84263ae..3e44cc8 100644 --- a/tools/metrics/histograms/metadata/ash/histograms.xml +++ b/tools/metrics/histograms/metadata/ash/histograms.xml
@@ -252,6 +252,28 @@ </summary> </histogram> +<histogram name="Ash.AmbientMode.StartupTime.{Theme}" units="ms" + expires_after="2022-12-01"> + <owner>esum@google.com</owner> + <owner>xiaohuic@google.com</owner> + <summary> + Records the amount of time it takes for {Theme} in ambient mode to start. + This includes tasks such as downloading an initial set of photos from IMAX + server, decoding them, loading the animation from resource pak, etc. Note + this measurement does not include the lock screen inactivity timeout + (currently 7 seconds). So ideally, this should be 0. Also note that ambient + mode should start after a 10 second timeout if at least 1 photo has been + downloaded from IMAX. Hitting the 10 second timeout is considered non-ideal, + but acceptable behavior. However, anything over that is very bad. Thus, this + histogram has a 15 second maximum (added a 5 second buffer to the timeout + just to be safe). Anything over the 15 second maximum goes in the overflow + bucket and is considered a total failure to start ambient mode. This should + be extremely rare. Emitted each time the {Theme} UI starts rendering, or + when ambient mode exits in the event that the UI never started rendering. + </summary> + <token key="Theme" variants="AmbientModeThemes"/> +</histogram> + <histogram name="Ash.AmbientMode.TotalNumberOfAlbums" units="int" expires_after="2022-12-01"> <owner>cowmoo@google.com</owner> @@ -297,7 +319,7 @@ </histogram> <histogram name="Ash.BackGesture.EndScenarioType" - enum="BackGestureEndScenarioType" expires_after="2022-10-01"> + enum="BackGestureEndScenarioType" expires_after="2022-12-04"> <owner>minch@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> <summary> @@ -307,7 +329,7 @@ </histogram> <histogram name="Ash.BackGesture.StartScenarioType" - enum="BackGestureStartScenarioType" expires_after="2022-10-01"> + enum="BackGestureStartScenarioType" expires_after="2022-12-04"> <owner>minch@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> <summary> @@ -317,7 +339,7 @@ </histogram> <histogram name="Ash.BackGesture.UnderneathWindowType" - enum="BackGestureUnderneathWindowType" expires_after="2022-10-01"> + enum="BackGestureUnderneathWindowType" expires_after="2022-12-04"> <owner>minch@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> <summary> @@ -1639,7 +1661,7 @@ </histogram> <histogram name="Ash.Desks.DesksCount3" units="units" - expires_after="2022-10-03"> + expires_after="2022-12-04"> <owner>afakhry@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> <summary> @@ -1661,7 +1683,7 @@ </histogram> <histogram name="Ash.Desks.MoveWindowFromActiveDesk" - enum="DesksMoveWindowFromActiveDeskSource" expires_after="2022-10-03"> + enum="DesksMoveWindowFromActiveDeskSource" expires_after="2022-12-04"> <owner>afakhry@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> <summary> @@ -1678,7 +1700,7 @@ </histogram> <histogram name="Ash.Desks.NewDesk2" enum="DesksCreationRemovalSource" - expires_after="2022-10-03"> + expires_after="2022-12-04"> <owner>afakhry@chromium.org</owner> <owner>tclaiborne@chromium.org</owner> <summary> @@ -1854,7 +1876,7 @@ </histogram> <histogram name="Ash.Desks.WeeklyActiveDesks" units="active desks" - expires_after="2022-10-03"> + expires_after="2022-12-04"> <owner>afakhry@chromium.org</owner> <owner>janetmac@chromium.org</owner> <summary> @@ -1897,7 +1919,7 @@ </histogram> <histogram name="Ash.DeskTemplate.LaunchFromTemplate" enum="BooleanHit" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>richui@chromium.org</owner> <owner>janetmac@chromium.org</owner> <summary> @@ -1975,7 +1997,7 @@ </histogram> <histogram name="Ash.DeskTemplate.TabCount" units="count" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>richui@chromium.org</owner> <owner>janetmac@chromium.org</owner> <summary>Records the number of tabs in a template when it is saved.</summary> @@ -2024,7 +2046,7 @@ </histogram> <histogram name="Ash.DeskTemplate.WindowAndTabCount" units="count" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>richui@chromium.org</owner> <owner>janetmac@chromium.org</owner> <summary> @@ -2033,7 +2055,7 @@ </histogram> <histogram name="Ash.DeskTemplate.WindowCount" units="count" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>richui@chromium.org</owner> <owner>janetmac@chromium.org</owner> <summary> @@ -2453,7 +2475,7 @@ </histogram> <histogram name="Ash.Login.Lock.AuthMethod.Switched" - enum="AuthMethodSwitchType" expires_after="2022-10-04"> + enum="AuthMethodSwitchType" expires_after="2022-12-04"> <owner>emaamari@google.com</owner> <owner>cros-lurs@google.com</owner> <summary> @@ -2462,7 +2484,7 @@ </histogram> <histogram name="Ash.Login.Lock.AuthMethod.Used.ClamShellMode" - enum="AuthMethod" expires_after="2022-10-04"> + enum="AuthMethod" expires_after="2022-12-04"> <owner>emaamari@google.com</owner> <owner>cros-lurs@google.com</owner> <summary> @@ -2473,7 +2495,7 @@ </histogram> <histogram name="Ash.Login.Lock.AuthMethod.Used.TabletMode" enum="AuthMethod" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>emaamari@google.com</owner> <owner>cros-lurs@google.com</owner> <summary> @@ -2483,7 +2505,7 @@ </histogram> <histogram name="Ash.Login.Lock.NbPasswordAttempts.UntilFailure" - units="attempts" expires_after="2022-10-04"> + units="attempts" expires_after="2022-12-04"> <owner>emaamari@google.com</owner> <owner>cros-lurs@google.com</owner> <summary> @@ -2494,7 +2516,7 @@ </histogram> <histogram name="Ash.Login.Lock.NbPasswordAttempts.UntilSuccess" - units="attempts" expires_after="2022-10-04"> + units="attempts" expires_after="2022-12-04"> <owner>emaamari@google.com</owner> <owner>cros-lurs@google.com</owner> <summary> @@ -2504,7 +2526,7 @@ </histogram> <histogram name="Ash.Login.Lock.UserClicks" enum="LockScreenUserClickTarget" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>emaamari@google.com</owner> <owner>cros-lurs@google.com</owner> <summary> @@ -2523,7 +2545,7 @@ </histogram> <histogram name="Ash.Login.Login.AuthMethod.Used.ClamShellMode" - enum="AuthMethod" expires_after="2022-10-04"> + enum="AuthMethod" expires_after="2022-12-04"> <owner>emaamari@google.com</owner> <owner>cros-lurs@google.com</owner> <summary> @@ -2544,7 +2566,7 @@ </histogram> <histogram name="Ash.Login.Login.MigrationBanner" enum="BooleanShown" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>emaamari@google.com</owner> <owner>cros-lurs@google.com</owner> <summary> @@ -2554,7 +2576,7 @@ </histogram> <histogram name="Ash.Login.Login.UserClicks" enum="LoginScreenUserClickTarget" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>emaamari@google.com</owner> <owner>cros-lurs@google.com</owner> <summary> @@ -2564,7 +2586,7 @@ </histogram> <histogram name="Ash.Login.OOBE.UserClicks" enum="OobeUserClickTarget" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>emaamari@google.com</owner> <owner>raleksandrov@google.com</owner> <owner>cros-lurs@google.com</owner> @@ -2697,7 +2719,7 @@ </histogram> <histogram name="Ash.MessageCenter.Scroll.PresentationTime.MaxLatency" - units="ms" expires_after="2022-10-04"> + units="ms" expires_after="2022-12-04"> <owner>leandre@chromium.org</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -2812,7 +2834,7 @@ </histogram> <histogram name="Ash.Notification.ClearAllStacked.AnimationSmoothness" - units="%" expires_after="2022-10-04"> + units="%" expires_after="2022-12-04"> <owner>leandre@chromium.org</owner> <owner>cros-status-area-eng@google.com</owner> <summary> @@ -3934,7 +3956,7 @@ </histogram> <histogram name="Ash.SplitView.EntryPoint.DeviceOrientation" - enum="DeviceOrientation" expires_after="2022-10-04"> + enum="DeviceOrientation" expires_after="2022-12-04"> <owner>xdai@chromium.org</owner> <owner>zxdan@chromium.org</owner> <owner>nupurjain@chromium.org</owner> @@ -3947,7 +3969,7 @@ </histogram> <histogram name="Ash.SplitView.EntryPoint.DeviceUIMode" enum="DeviceMode" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>xdai@chromium.org</owner> <owner>zxdan@chromium.org</owner> <owner>nupurjain@chromium.org</owner> @@ -4331,7 +4353,7 @@ </histogram> <histogram name="Ash.TouchView.LidAngle" units="degrees" - expires_after="2022-10-03"> + expires_after="2022-12-04"> <owner>oshima@chromium.org</owner> <summary> Chrome OS only. The computed angle between the lid and the keyboard panel. @@ -4605,7 +4627,7 @@ </histogram> <histogram name="Ash.Wallpaper.Image" enum="WallpaperImage" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jasontt@chromium.org</owner> <owner>assistive-eng@google.com</owner> <summary> @@ -4615,7 +4637,7 @@ </histogram> <histogram name="Ash.Wallpaper.Preview.Show" enum="BooleanHit" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jasontt@chromium.org</owner> <owner>assistive-eng@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/autofill/histograms.xml b/tools/metrics/histograms/metadata/autofill/histograms.xml index 88a1380..2887681 100644 --- a/tools/metrics/histograms/metadata/autofill/histograms.xml +++ b/tools/metrics/histograms/metadata/autofill/histograms.xml
@@ -455,7 +455,7 @@ </histogram> <histogram name="Autofill.BetterAuth.CardUnmaskDuration.Fido" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jsaul@google.com</owner> <owner>siyua@chromium.org</owner> <owner>autofill-auth-team@google.com</owner> @@ -633,7 +633,7 @@ <histogram name="Autofill.BetterAuth.UserPerceivedLatencyOnCardSelection.OptedIn.Duration" - units="ms" expires_after="2022-10-04"> + units="ms" expires_after="2022-12-04"> <owner>jsaul@google.com</owner> <owner>siyua@chromium.org</owner> <owner>autofill-auth-team@google.com</owner> @@ -649,7 +649,7 @@ <histogram name="Autofill.BetterAuth.UserPerceivedLatencyOnCardSelection.OptedIn.TimedOutCvcFallback" enum="AutofillCreditCardUserPerceivedLatencyFollowUp" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jsaul@google.com</owner> <owner>siyua@chromium.org</owner> <owner>autofill-auth-team@google.com</owner> @@ -766,7 +766,7 @@ </histogram> <histogram name="Autofill.CardUploadEnabled" enum="AutofillCardUploadEnabled" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jsaul@google.com</owner> <owner>aneeshali@google.com</owner> <summary> @@ -777,7 +777,7 @@ </histogram> <histogram name="Autofill.CreditCard.IsEnabled.PageLoad" enum="BooleanEnabled" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jsaul@google.com</owner> <owner>chrome-autofill-alerts@google.com</owner> <summary> @@ -2066,7 +2066,7 @@ </histogram> <histogram name="Autofill.Offer.StoredOfferCount" units="offers" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>siyua@chromium.org</owner> <owner>payments-autofill-team@google.com</owner> <summary> @@ -2076,7 +2076,7 @@ </histogram> <histogram name="Autofill.Offer.StoredOfferRelatedCardCount" units="cards" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>siyua@chromium.org</owner> <owner>payments-autofill-team@google.com</owner> <summary> @@ -2086,7 +2086,7 @@ </histogram> <histogram name="Autofill.Offer.StoredOfferRelatedMerchantCount" - units="merchants" expires_after="2022-10-01"> + units="merchants" expires_after="2022-12-04"> <owner>siyua@chromium.org</owner> <owner>payments-autofill-team@google.com</owner> <summary> @@ -2108,7 +2108,7 @@ </histogram> <histogram name="Autofill.Offer.SuggestedCardsHaveOffer" - enum="AutofillCreditCardOfferSuggestion" expires_after="2022-10-01"> + enum="AutofillCreditCardOfferSuggestion" expires_after="2022-12-04"> <owner>siyua@chromium.org</owner> <owner>payments-autofill-team@google.com</owner> <summary> @@ -2119,7 +2119,7 @@ </histogram> <histogram name="Autofill.Offer.SyncedOfferDataBeingValid" units="offers" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>siyua@chromium.org</owner> <owner>payments-autofill-team@google.com</owner> <summary> @@ -2436,7 +2436,7 @@ <histogram name="Autofill.ProfileImport.NewProfileWithComplementedCountryDecision" - enum="AutofillProfileImportDecision" expires_after="2022-10-04"> + enum="AutofillProfileImportDecision" expires_after="2022-12-04"> <owner>fleimgruber@google.com</owner> <owner>chrome-autofill-team@google.com</owner> <summary> @@ -2451,7 +2451,7 @@ <histogram name="Autofill.ProfileImport.NewProfileWithRemovedPhoneNumberDecision" - enum="AutofillProfileImportDecision" expires_after="2022-10-04"> + enum="AutofillProfileImportDecision" expires_after="2022-12-04"> <owner>fleimgruber@google.com</owner> <owner>chrome-autofill-team@google.com</owner> <summary> @@ -3105,7 +3105,7 @@ </histogram> <histogram name="Autofill.StoredProfileWithoutCountryCount" units="units" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>fleimgruber@google.com</owner> <owner>chrome-autofill-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/blink/histograms.xml b/tools/metrics/histograms/metadata/blink/histograms.xml index 2ba6e8fe..712f2e83 100644 --- a/tools/metrics/histograms/metadata/blink/histograms.xml +++ b/tools/metrics/histograms/metadata/blink/histograms.xml
@@ -717,7 +717,7 @@ </histogram> <histogram name="Blink.DecodedImage.JpegDensity.KiBWeighted" - units="0.01 bits per pixel" expires_after="2022-10-01"> + units="0.01 bits per pixel" expires_after="2022-12-04"> <owner>jyrki@google.com</owner> <owner>compression-dev@google.com</owner> <summary> @@ -1726,7 +1726,7 @@ </histogram> <histogram name="Blink.Layout.NGRatio.Blocks" units="%" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>tkent@chromium.org</owner> <owner>layout-dev@chromium.org</owner> <summary> @@ -1741,7 +1741,7 @@ </histogram> <histogram name="Blink.Layout.NGRatio.Calls" units="%" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>tkent@chromium.org</owner> <owner>layout-dev@chromium.org</owner> <summary> @@ -2839,7 +2839,7 @@ </histogram> <histogram name="Blink.UseCounter.PermissionsPolicy.Allow2" - enum="FeaturePolicyFeature" expires_after="2022-10-04"> + enum="FeaturePolicyFeature" expires_after="2022-12-04"> <owner>iclelland@chromium.org</owner> <owner>feature-control@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/bluetooth/histograms.xml b/tools/metrics/histograms/metadata/bluetooth/histograms.xml index 2ff1055..d1684ba4 100644 --- a/tools/metrics/histograms/metadata/bluetooth/histograms.xml +++ b/tools/metrics/histograms/metadata/bluetooth/histograms.xml
@@ -1054,7 +1054,7 @@ </histogram> <histogram name="Bluetooth.ChromeOS.UiSurfaceDisplayed" - enum="BluetoothUiSurface" expires_after="2022-10-04"> + enum="BluetoothUiSurface" expires_after="2022-12-04"> <owner>khorimoto@chromium.org</owner> <owner>cros-connectivity@google.com</owner> <summary>Metric emmitted each time a UI surface is shown.</summary> @@ -1239,7 +1239,7 @@ <histogram name="Bluetooth.Mojo.PendingConnectAtShutdown.NumberOfServiceDiscoveriesInProgress" - units="count" expires_after="2022-10-04"> + units="count" expires_after="2022-12-04"> <owner>jonmann@chromium.org</owner> <owner>cros-system-services-networking@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/chrome/histograms.xml b/tools/metrics/histograms/metadata/chrome/histograms.xml index b03d76e..80cf76a 100644 --- a/tools/metrics/histograms/metadata/chrome/histograms.xml +++ b/tools/metrics/histograms/metadata/chrome/histograms.xml
@@ -178,7 +178,7 @@ </histogram> <histogram name="Chrome.Tabs.AnimationSmoothness.HoverCard.FadeOut" units="%" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>yichenz@chromium.org</owner> <owner>chromeos-wmp@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/chromeos/histograms.xml b/tools/metrics/histograms/metadata/chromeos/histograms.xml index 2e17a70..2758eea 100644 --- a/tools/metrics/histograms/metadata/chromeos/histograms.xml +++ b/tools/metrics/histograms/metadata/chromeos/histograms.xml
@@ -254,7 +254,7 @@ </histogram> <histogram name="ChromeOS.Camera.ErrorType" enum="ChromeOSCameraErrorType" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>wtlee@chromium.org</owner> <owner>chromeos-camera-eng@google.com</owner> <summary> @@ -285,7 +285,7 @@ </histogram> <histogram name="ChromeOS.Camera.Facing" enum="ChromeOSCameraFacing" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>wtlee@chromium.org</owner> <owner>chromeos-camera-eng@google.com</owner> <summary> @@ -474,7 +474,7 @@ </histogram> <histogram name="ChromeOS.Camera.SessionDuration" units="seconds" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>wtlee@chromium.org</owner> <owner>chromeos-camera-eng@google.com</owner> <summary>Records the session duration in Chrome OS camera service.</summary> @@ -599,7 +599,7 @@ </histogram> <histogram name="ChromeOS.CWP.ParsePSIMemory" enum="ChromeOSParsePSIMemStatus" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>raging@google.com</owner> <owner>chromeos-memory@google.com</owner> <summary> @@ -683,7 +683,7 @@ </histogram> <histogram name="ChromeOS.DiagnosticsUi.InitialScreen" - units="CrosDiagnosticsNavigationView" expires_after="2022-10-04"> + units="CrosDiagnosticsNavigationView" expires_after="2022-12-04"> <owner>ashleydp@google.com</owner> <owner>gavinwill@chromium.org</owner> <owner>zentaro@chromium.org</owner> @@ -694,7 +694,7 @@ </histogram> <histogram name="ChromeOS.DiagnosticsUi.MemoryRoutineDuration" units="s" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>ashleydp@google.com</owner> <owner>gavinwill@chromium.org</owner> <owner>zentaro@chromium.org</owner> @@ -706,7 +706,7 @@ </histogram> <histogram name="ChromeOS.DiagnosticsUi.OpenDuration" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>ashleydp@google.com</owner> <owner>gavinwill@chromium.org</owner> <owner>zentaro@chromium.org</owner> @@ -718,7 +718,7 @@ </histogram> <histogram name="ChromeOS.DiagnosticsUi.RoutineCount" units="routines" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>ashleydp@google.com</owner> <owner>gavinwill@chromium.org</owner> <owner>zentaro@chromium.org</owner> @@ -984,7 +984,7 @@ </histogram> <histogram name="ChromeOS.Intents.IntentPickerIconEvent" - enum="IntentPickerIconEvent" expires_after="2022-10-04"> + enum="IntentPickerIconEvent" expires_after="2022-12-04"> <owner>tsergeant@chromium.org</owner> <owner>chromeos-apps-foundation-team@google.com</owner> <summary> @@ -1124,7 +1124,7 @@ </histogram> <histogram name="ChromeOS.LanguagePacks.Mojo.GetPackInfo.Feature" - enum="LanguagePackMojoFeatureId" expires_after="2022-10-01"> + enum="LanguagePackMojoFeatureId" expires_after="2022-12-04"> <owner>mlcui@google.com</owner> <owner>cros-borders-eng@google.com</owner> <summary> @@ -1181,7 +1181,7 @@ </histogram> <histogram name="ChromeOS.Liveness.PingResponseTime" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>rtinkoff@google.com</owner> <owner>xiyuan@google.com</owner> <summary> @@ -1427,7 +1427,7 @@ </histogram> <histogram name="ChromeOS.SecurityAnomaly" enum="SecurityAnomaly" - expires_after="2022-10-03"> + expires_after="2022-12-04"> <owner>jorgelo@chromium.org</owner> <owner>chromeos-security-core@google.com</owner> <summary> @@ -1857,7 +1857,7 @@ </histogram> <histogram name="ChromeOS.WXMountCount" units="count" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jorgelo@chromium.org</owner> <owner>chromeos-security-core@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/commerce/histograms.xml b/tools/metrics/histograms/metadata/commerce/histograms.xml index f5b5c0b..c014c4c 100644 --- a/tools/metrics/histograms/metadata/commerce/histograms.xml +++ b/tools/metrics/histograms/metadata/commerce/histograms.xml
@@ -146,7 +146,7 @@ </histogram> <histogram name="Commerce.Heuristics.MerchantNameSource" - enum="CommerceHeuristicsDataSource" expires_after="2022-10-01"> + enum="CommerceHeuristicsDataSource" expires_after="2022-12-04"> <owner>yuezhanggg@chromium.org</owner> <owner>wychen@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -243,7 +243,7 @@ </histogram> <histogram name="Commerce.PriceDrop.NotificationChannelCreated" enum="Boolean" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>zhiyuancai@chromium.org</owner> <owner>chrome-shopping@google.com</owner> <summary> @@ -255,7 +255,7 @@ </histogram> <histogram name="Commerce.PriceDrop.SystemNotificationEnabled" enum="Boolean" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>zhiyuancai@chromium.org</owner> <owner>chrome-shopping@google.com</owner> <summary> @@ -344,7 +344,7 @@ </histogram> <histogram name="Commerce.SignIn.AccountWaaStatus" - enum="AccountWaaStatusForCommerce" expires_after="2022-10-01"> + enum="AccountWaaStatusForCommerce" expires_after="2022-12-04"> <owner>zhiyuancai@chromium.org</owner> <owner>ayman@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -496,7 +496,7 @@ </histogram> <histogram name="MerchantTrust.MessageImpact.BrowsingTime" units="ms" - expires_after="2022-11-27"> + expires_after="2022-12-04"> <owner>zhiyuancai@chromium.org</owner> <owner>ayman@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -523,7 +523,7 @@ </histogram> <histogram name="MerchantTrust.MessageImpact.NavigationCount" - units="navigations" expires_after="2022-11-27"> + units="navigations" expires_after="2022-12-04"> <owner>zhiyuancai@chromium.org</owner> <owner>ayman@chromium.org</owner> <owner>chrome-shopping@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/compositing/histograms.xml b/tools/metrics/histograms/metadata/compositing/histograms.xml index cf2c2f7..4c88c78 100644 --- a/tools/metrics/histograms/metadata/compositing/histograms.xml +++ b/tools/metrics/histograms/metadata/compositing/histograms.xml
@@ -228,7 +228,7 @@ </histogram> <histogram name="Compositing.Display.DrawToSwapUs" units="microseconds" - expires_after="2022-10-02"> + expires_after="2022-12-04"> <owner>backer@chromium.org</owner> <owner>rjkroege@chromium.org</owner> <summary> @@ -251,7 +251,7 @@ </histogram> <histogram name="Compositing.Display.DrmOverlayManager.TestPageFlipCount" - units="units" expires_after="2022-10-04"> + units="units" expires_after="2022-12-04"> <owner>khaslett@chromium.org</owner> <owner>kylechar@chromium.org</owner> <summary> @@ -261,7 +261,7 @@ </histogram> <histogram name="Compositing.Display.DrmOverlayManager.TestPageFlipUs" - units="microseconds" expires_after="2022-10-04"> + units="microseconds" expires_after="2022-12-04"> <owner>khaslett@chromium.org</owner> <owner>kylechar@chromium.org</owner> <summary> @@ -272,7 +272,7 @@ </histogram> <histogram name="Compositing.Display.DrmThread.CheckOverlayCapabilitiesSyncUs" - units="microseconds" expires_after="2022-10-04"> + units="microseconds" expires_after="2022-12-04"> <owner>khaslett@chromium.org</owner> <owner>kylechar@chromium.org</owner> <summary> @@ -628,7 +628,7 @@ </histogram> <histogram name="Compositing.SkiaRenderer.DrawTileDrawQuad.CDT.IsTranslateOnly" - units="boolean" expires_after="2022-10-04"> + units="boolean" expires_after="2022-12-04"> <owner>penghuang@chromium.org</owner> <owner>herb@google.com</owner> <summary> @@ -1303,7 +1303,7 @@ </histogram> <histogram name="Graphics.Smoothness.PercentMissedDeadlineFrames.AllSequences" - units="%" expires_after="2022-09-30"> + units="%" expires_after="2022-12-04"> <owner>sadrul@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1355,7 +1355,7 @@ <histogram name="Graphics.Smoothness.PerSession.MaxPercentDroppedFrames_1sWindow" - units="%" expires_after="2022-10-02"> + units="%" expires_after="2022-12-04"> <owner>sadrul@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/content_creation/histograms.xml b/tools/metrics/histograms/metadata/content_creation/histograms.xml index 54acfde..a105e8fb 100644 --- a/tools/metrics/histograms/metadata/content_creation/histograms.xml +++ b/tools/metrics/histograms/metadata/content_creation/histograms.xml
@@ -47,7 +47,7 @@ </histogram> <histogram name="LightweightReactions.AssetsFetchSuccess" enum="BooleanSuccess" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>gujen@google.com</owner> <owner>chrome-creation@google.com</owner> <summary> @@ -100,7 +100,7 @@ </histogram> <histogram name="LightweightReactions.Funnel" enum="LightweightReactionsFunnel" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>gujen@google.com</owner> <owner>chrome-creation@google.com</owner> <summary> @@ -258,7 +258,7 @@ </histogram> <histogram name="NoteCreation.SelectedDynamicTemplateID" units="count" - expires_after="2022-09-23"> + expires_after="2022-12-04"> <owner>graysonlafleur@google.com</owner> <owner>chrome-creation@google.com</owner> <summary> @@ -270,7 +270,7 @@ </histogram> <histogram name="NoteCreation.SelectedDynamicTemplateIndex" units="count" - expires_after="2022-09-23"> + expires_after="2022-12-04"> <owner>graysonlafleur@google.com</owner> <owner>chrome-creation@google.com</owner> <summary> @@ -300,7 +300,7 @@ </histogram> <histogram name="NoteCreation.TemplateFetchSuccess" enum="BooleanSuccess" - expires_after="2022-09-23"> + expires_after="2022-12-04"> <owner>graysonlafleur@google.com</owner> <owner>chrome-creation@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/cookie/histograms.xml b/tools/metrics/histograms/metadata/cookie/histograms.xml index 1b7ed99..e58aabe 100644 --- a/tools/metrics/histograms/metadata/cookie/histograms.xml +++ b/tools/metrics/histograms/metadata/cookie/histograms.xml
@@ -75,7 +75,7 @@ </histogram> <histogram name="Cookie.ControlCharacterTruncation" enum="Boolean" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>bingler@chromium.org</owner> <owner>miketaylr@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/cros/histograms.xml b/tools/metrics/histograms/metadata/cros/histograms.xml index 5827e9d..7d261c2 100644 --- a/tools/metrics/histograms/metadata/cros/histograms.xml +++ b/tools/metrics/histograms/metadata/cros/histograms.xml
@@ -95,7 +95,7 @@ </histogram> <histogram name="CrosDisksClient.FormatCompletedError" - enum="CrosDisksClientFormatError" expires_after="2022-10-04"> + enum="CrosDisksClientFormatError" expires_after="2022-12-04"> <owner>austinct@chromium.org</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/cros_ml/histograms.xml b/tools/metrics/histograms/metadata/cros_ml/histograms.xml index f79f808..dc6c842 100644 --- a/tools/metrics/histograms/metadata/cros_ml/histograms.xml +++ b/tools/metrics/histograms/metadata/cros_ml/histograms.xml
@@ -112,7 +112,7 @@ </histogram> <histogram name="MachineLearningService.HandwritingModel.Recognize.Event" - enum="Boolean" expires_after="2022-10-04"> + enum="Boolean" expires_after="2022-12-04"> <owner>amoylan@chromium.org</owner> <owner>alanlxl@chromium.org</owner> <owner>charleszhao@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/cryptohome/histograms.xml b/tools/metrics/histograms/metadata/cryptohome/histograms.xml index f784f62d..b9f6cd8 100644 --- a/tools/metrics/histograms/metadata/cryptohome/histograms.xml +++ b/tools/metrics/histograms/metadata/cryptohome/histograms.xml
@@ -53,7 +53,7 @@ </histogram> <histogram name="Cryptohome.DeletedUserProfiles" units="profiles" - expires_after="2022-10-02"> + expires_after="2022-12-04"> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -515,7 +515,7 @@ </histogram> <histogram name="Cryptohome.MaskedDownloadsItems" units="items" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>benreich@chromium.org</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary> @@ -687,7 +687,7 @@ </histogram> <histogram name="Cryptohome.TimeToGenerateEccAuthValue" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>yich@google.com</owner> <owner>cros-hwsec+uma@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/enterprise/histograms.xml b/tools/metrics/histograms/metadata/enterprise/histograms.xml index fcbe9b2..88b1b60c4 100644 --- a/tools/metrics/histograms/metadata/enterprise/histograms.xml +++ b/tools/metrics/histograms/metadata/enterprise/histograms.xml
@@ -629,7 +629,7 @@ </histogram> <histogram name="Enterprise.DeviceSettings.UpdatedStatus" - enum="DeviceSettingsStatus" expires_after="2022-10-04"> + enum="DeviceSettingsStatus" expires_after="2022-12-04"> <owner>rbock@google.com</owner> <owner>managed-devices@google.com</owner> <summary> @@ -1792,7 +1792,7 @@ </histogram> <histogram name="Enterprise.Policies.IgnoredByPolicyGroup" - enum="EnterprisePolicies" expires_after="2022-08-28"> + enum="EnterprisePolicies" expires_after="2022-12-04"> <owner>ydago@chromium.org</owner> <owner>pastarmovj@chromium.org</owner> <summary> @@ -2292,7 +2292,7 @@ </histogram> <histogram name="EnterpriseCheck.IsManaged2" enum="BooleanEnabled" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>rogerta@chromium.org</owner> <owner>pastarmovj@chromium.org</owner> <owner>zmin@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/event/histograms.xml b/tools/metrics/histograms/metadata/event/histograms.xml index 2fd509d8..49d69af 100644 --- a/tools/metrics/histograms/metadata/event/histograms.xml +++ b/tools/metrics/histograms/metadata/event/histograms.xml
@@ -1065,7 +1065,7 @@ </histogram> <histogram name="Event.Latency.ScrollUpdate.Scrollbar.TimeToHandled2" - units="microseconds" expires_after="2022-10-04"> + units="microseconds" expires_after="2022-12-04"> <owner>flackr@chromium.org</owner> <owner>arakeri@microsoft.com</owner> <owner>input-dev@chromium.org</owner> @@ -1445,7 +1445,7 @@ </histogram> <histogram name="Event.Latency.ScrollUpdate.Wheel.TimeToHandled2" - units="microseconds" expires_after="2022-10-04"> + units="microseconds" expires_after="2022-12-04"> <owner>flackr@chromium.org</owner> <owner>input-dev@chromium.org</owner> <summary> @@ -1520,7 +1520,7 @@ </histogram> <histogram name="Event.PageShow.Persisted" enum="EventPageShowPersisted" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>hajimehoshi@chromium.org</owner> <owner>fergal@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/extensions/histograms.xml b/tools/metrics/histograms/metadata/extensions/histograms.xml index 5530598..090fee21 100644 --- a/tools/metrics/histograms/metadata/extensions/histograms.xml +++ b/tools/metrics/histograms/metadata/extensions/histograms.xml
@@ -696,7 +696,7 @@ </histogram> <histogram name="Extensions.DeclarativeNetRequest.ManifestEnabledRulesCount2" - units="rules" expires_after="2022-10-01"> + units="rules" expires_after="2022-12-04"> <owner>kelvinjiang@chromium.org</owner> <owner>src/extensions/OWNERS</owner> <summary> @@ -743,7 +743,7 @@ </histogram> <histogram name="Extensions.DeclarativeNetRequest.RequestHeaderRemoved" - enum="WebRequest.RequestHeader" expires_after="2022-10-04"> + enum="WebRequest.RequestHeader" expires_after="2022-12-04"> <owner>rdevlin.cronin@chromium.org</owner> <owner>kelvinjiang@chromium.org</owner> <owner>src/extensions/OWNERS</owner> @@ -2056,7 +2056,7 @@ </histogram> <histogram name="Extensions.HostedAppLaunchContainer" enum="AppLaunchContainer" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>benwells@chromium.org</owner> <owner>dominickn@chromium.org</owner> <summary> @@ -2268,7 +2268,7 @@ </histogram> <histogram name="Extensions.InstallFrictionDialogAction" - enum="ExtensionInstallFrictionDialogAction" expires_after="2022-10-01"> + enum="ExtensionInstallFrictionDialogAction" expires_after="2022-12-04"> <owner>jeffcyr@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -2781,7 +2781,7 @@ </histogram> <histogram name="Extensions.NotAllowlistedDisabled" units="extensions" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>jeffcyr@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -2792,7 +2792,7 @@ </histogram> <histogram name="Extensions.NotAllowlistedDisabledAndEsbUser" - units="extensions" expires_after="2022-10-01"> + units="extensions" expires_after="2022-12-04"> <owner>jeffcyr@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -2814,7 +2814,7 @@ </histogram> <histogram name="Extensions.NotAllowlistedEnabledAndEsbUser" units="extensions" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>jeffcyr@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -3017,7 +3017,7 @@ </histogram> <histogram name="Extensions.SearchEngineOverrides" units="units" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>rdevlin.cronin@chromium.org</owner> <owner>kelvinjiang@chromium.org</owner> <summary> @@ -3050,7 +3050,7 @@ </histogram> <histogram name="Extensions.ServiceWorkerBackground.RegistrationStatus" - enum="Boolean" expires_after="2022-10-01"> + enum="Boolean" expires_after="2022-12-04"> <owner>lazyboy@chromium.org</owner> <owner>dbertoni@chromium.org</owner> <summary> @@ -3078,7 +3078,7 @@ </histogram> <histogram name="Extensions.ServiceWorkerBackground.StartWorkerStatus" - enum="Boolean" expires_after="2022-10-01"> + enum="Boolean" expires_after="2022-12-04"> <owner>lazyboy@chromium.org</owner> <owner>dbertoni@chromium.org</owner> <summary> @@ -3112,7 +3112,7 @@ <histogram name="Extensions.SettingsOverridden.BackToGoogleSearchOverriddenDialogResult" - enum="SettingsOverriddenDialogResult" expires_after="2022-10-04"> + enum="SettingsOverriddenDialogResult" expires_after="2022-12-04"> <owner>rdevlin.cronin@chromium.org</owner> <owner>extensions-core@chromium.org</owner> <summary> @@ -3619,7 +3619,7 @@ <histogram name="Extensions.WebStoreInstall.NotAllowlistedInstalledWithFriction" - enum="Boolean" expires_after="2022-10-01"> + enum="Boolean" expires_after="2022-12-04"> <owner>jeffcyr@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -3632,7 +3632,7 @@ <histogram name="Extensions.WebStoreInstall.NotAllowlistedInstalledWithoutFriction" - enum="Boolean" expires_after="2022-10-01"> + enum="Boolean" expires_after="2022-12-04"> <owner>jeffcyr@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/feature_engagement/histograms.xml b/tools/metrics/histograms/metadata/feature_engagement/histograms.xml index 0629426..009192a6 100644 --- a/tools/metrics/histograms/metadata/feature_engagement/histograms.xml +++ b/tools/metrics/histograms/metadata/feature_engagement/histograms.xml
@@ -68,6 +68,8 @@ summary="Chrome Home shown on cold start"/> <variant name="IPH_ChromeHomePullToRefresh" summary="Chrome Home shown after a pull-to-refresh"/> + <variant name="IPH_ContextualPageActions_PriceTracking" + summary="contextual page price tracking action in the top toolbar"/> <variant name="IPH_ContextualSearchInPanelHelp" summary="promoting longpress from within the panel"/> <variant name="IPH_ContextualSearchOptIn" @@ -366,7 +368,7 @@ </histogram> <histogram name="InProductHelp.SnoozeAction" enum="InProductHelpSnoozeAction" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>haileywang@chromium.org</owner> <owner>shaktisahu@chromium.org</owner> <summary> @@ -375,7 +377,7 @@ </histogram> <histogram name="InProductHelp.TextBubble.ShownTime" units="ms" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>haileywang@chromium.org</owner> <owner>shaktisahu@chromium.org</owner> <summary> @@ -384,7 +386,7 @@ </histogram> <histogram name="InProductHelp.TextBubble.ShowSnooze" enum="BooleanShown" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>haileywang@chromium.org</owner> <owner>shaktisahu@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/fingerprint/histograms.xml b/tools/metrics/histograms/metadata/fingerprint/histograms.xml index 40f33b1..04c651f7 100644 --- a/tools/metrics/histograms/metadata/fingerprint/histograms.xml +++ b/tools/metrics/histograms/metadata/fingerprint/histograms.xml
@@ -258,7 +258,7 @@ </histogram> <histogram name="Fingerprint.Unlock.Result" enum="FingerprintUnlockResult" - expires_after="2022-10-03"> + expires_after="2022-12-04"> <owner>emaamari@google.com</owner> <owner>tomhughes@chromium.org</owner> <owner>cros-lurs@google.com</owner> @@ -270,7 +270,7 @@ </histogram> <histogram name="Fingerprint.UnlockEnabled" enum="BooleanEnabled" - expires_after="2022-10-03"> + expires_after="2022-12-04"> <owner>tomhughes@chromium.org</owner> <owner>chromeos-fingerprint@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/geolocation/histograms.xml b/tools/metrics/histograms/metadata/geolocation/histograms.xml index 9d80bd7..abfe948 100644 --- a/tools/metrics/histograms/metadata/geolocation/histograms.xml +++ b/tools/metrics/histograms/metadata/geolocation/histograms.xml
@@ -93,7 +93,7 @@ </histogram> <histogram name="Geolocation.NetworkLocationRequest.Event" - enum="NetworkLocationRequestEvent" expires_after="2022-10-04"> + enum="NetworkLocationRequestEvent" expires_after="2022-12-04"> <owner>mattreynolds@chromium.org</owner> <owner>device-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/gpu/histograms.xml b/tools/metrics/histograms/metadata/gpu/histograms.xml index ae3fcdb..afb1674d 100644 --- a/tools/metrics/histograms/metadata/gpu/histograms.xml +++ b/tools/metrics/histograms/metadata/gpu/histograms.xml
@@ -304,7 +304,7 @@ </histogram> <histogram name="GPU.ANGLE.D3D11FeatureLevel" enum="D3DFeatureLevel" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jonahr@google.com</owner> <owner>angle-team@google.com</owner> <summary> @@ -318,7 +318,7 @@ </histogram> <histogram name="GPU.ANGLE.D3D11InitializeResult" enum="D3D11InitializeResult" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jonahr@google.com</owner> <owner>angle-team@google.com</owner> <summary> @@ -329,7 +329,7 @@ </histogram> <histogram name="GPU.ANGLE.D3D9InitializeResult" enum="D3D9InitializeResult" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jonahr@google.com</owner> <owner>angle-team@google.com</owner> <summary> @@ -339,7 +339,7 @@ </summary> </histogram> -<histogram name="GPU.ANGLE.D3DCompileMS" units="ms" expires_after="2022-10-04"> +<histogram name="GPU.ANGLE.D3DCompileMS" units="ms" expires_after="2022-12-04"> <owner>jonahr@google.com</owner> <owner>angle-team@google.com</owner> <summary> @@ -548,7 +548,7 @@ </histogram> <histogram name="GPU.D3DShaderModel" enum="ShaderModel" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jonahr@google.com</owner> <owner>angle-team@google.com</owner> <summary> @@ -675,7 +675,7 @@ </histogram> <histogram name="GPU.DirectComposition.HardwareOverlaysSupported" - enum="BooleanOverlaySupported" expires_after="2022-10-01"> + enum="BooleanOverlaySupported" expires_after="2022-12-04"> <owner>magchen@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -734,7 +734,7 @@ </histogram> <histogram base="true" name="GPU.DirectComposition.SwapChainCreationResult3" - enum="Hresult" expires_after="2022-10-01"> + enum="Hresult" expires_after="2022-12-04"> <!-- Name completed by histogram_suffixes name="GPU.ProtectedVideoType" --> <owner>magchen@chromium.org</owner> @@ -1077,7 +1077,7 @@ </histogram> <histogram name="Gpu.Metal.ReadWriteTextureSupport" - enum="MetalReadWriteTextureSupportTier" expires_after="2022-10-04"> + enum="MetalReadWriteTextureSupportTier" expires_after="2022-12-04"> <owner>cwallez@chromium.org</owner> <owner>graphics-dev@chromium.org</owner> <summary> @@ -1441,7 +1441,7 @@ </histogram> <histogram name="GPU.SharedImage.DmaBufSupportedType" - enum="DmaBufSupportedType" expires_after="2022-09-30"> + enum="DmaBufSupportedType" expires_after="2022-12-04"> <owner>vasilyt@chromium.org</owner> <owner>hitawala@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/history/histograms.xml b/tools/metrics/histograms/metadata/history/histograms.xml index 766a64c..3d2f809e 100644 --- a/tools/metrics/histograms/metadata/history/histograms.xml +++ b/tools/metrics/histograms/metadata/history/histograms.xml
@@ -68,7 +68,7 @@ </histogram> <histogram name="History.BrowsingDataLifetime.State.BrowserShutdownDeletion" - enum="BooleanStartedCompleted" expires_after="2022-10-01"> + enum="BooleanStartedCompleted" expires_after="2022-12-04"> <owner>ydago@chromium.org</owner> <owner>dullweber@chromium.org</owner> <component>UI>Browser>History</component>
diff --git a/tools/metrics/histograms/metadata/input/histograms.xml b/tools/metrics/histograms/metadata/input/histograms.xml index d2fb66d..92e1250 100644 --- a/tools/metrics/histograms/metadata/input/histograms.xml +++ b/tools/metrics/histograms/metadata/input/histograms.xml
@@ -90,7 +90,7 @@ </histogram> <histogram name="InputMethod.Assistive.Coverage" enum="IMEAssistiveAction" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>jiwan@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -100,7 +100,7 @@ </histogram> <histogram name="InputMethod.Assistive.Disabled" enum="IMEAssistiveAction" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>jiwan@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -171,7 +171,7 @@ </histogram> <histogram name="InputMethod.Assistive.Grammar.Actions" - enum="IMEGrammarActions" expires_after="2022-09-30"> + enum="IMEGrammarActions" expires_after="2022-12-04"> <owner>jiwan@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -206,7 +206,7 @@ </histogram> <histogram name="InputMethod.Assistive.Match" enum="IMEAssistiveAction" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>jiwan@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -219,7 +219,7 @@ </histogram> <histogram name="InputMethod.Assistive.MultiWord.InputState" - enum="IMEAssistiveTextInputState" expires_after="2022-10-04"> + enum="IMEAssistiveTextInputState" expires_after="2022-12-04"> <owner>curtismcmullan@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -254,7 +254,7 @@ </histogram> <histogram name="InputMethod.Assistive.Success" enum="IMEAssistiveAction" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>jiwan@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -529,7 +529,7 @@ </histogram> <histogram name="InputMethod.Handwriting.LanguagePackState" - enum="LanguagePackState" expires_after="2022-10-04"> + enum="LanguagePackState" expires_after="2022-12-04"> <owner>curtismcmullan@chromium.org</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -750,7 +750,7 @@ </histogram> <histogram name="InputMethod.SessionDuration" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>keithlee@chromium.org</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -1017,7 +1017,7 @@ </histogram> <histogram name="InputMethod.VirtualKeyboard.Layout" enum="IMEVKLayout" - expires_after="2022-10-03"> + expires_after="2022-12-04"> <owner>shend@chromium.org</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -1123,7 +1123,7 @@ </histogram> <histogram name="InputMethod.VirtualKeyboard.SessionDuration" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>keithlee@chromium.org</owner> <owner>essential-inputs-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/installer/histograms.xml b/tools/metrics/histograms/metadata/installer/histograms.xml index 4e04e2ef..97576a1 100644 --- a/tools/metrics/histograms/metadata/installer/histograms.xml +++ b/tools/metrics/histograms/metadata/installer/histograms.xml
@@ -46,7 +46,7 @@ </histogram> <histogram name="Installer.PowerwashDays" units="powerwashdays" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>qianwan@google.com</owner> <owner>chromeos-data@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/interstitial/histograms.xml b/tools/metrics/histograms/metadata/interstitial/histograms.xml index 2fc3af6..8503a65 100644 --- a/tools/metrics/histograms/metadata/interstitial/histograms.xml +++ b/tools/metrics/histograms/metadata/interstitial/histograms.xml
@@ -27,7 +27,7 @@ </variants> <histogram name="interstitial.captive_portal" - enum="CaptivePortalBlockingPageEvent" expires_after="2022-10-04"> + enum="CaptivePortalBlockingPageEvent" expires_after="2022-12-04"> <owner>meacer@chromium.org</owner> <owner>michaeldo@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/login/histograms.xml b/tools/metrics/histograms/metadata/login/histograms.xml index edf1856..540524c7 100644 --- a/tools/metrics/histograms/metadata/login/histograms.xml +++ b/tools/metrics/histograms/metadata/login/histograms.xml
@@ -48,7 +48,7 @@ </histogram> <histogram name="Login.ArcContinueBootImpulseStatus" - enum="ArcContinueBootImpulseStatus" expires_after="2022-10-04"> + enum="ArcContinueBootImpulseStatus" expires_after="2022-12-04"> <owner>vsomani@google.com</owner> <owner>arc-core@google.com</owner> <summary> @@ -71,7 +71,7 @@ </histogram> <histogram name="Login.ArcContinueBootImpulseTime2" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>mhasank@google.com</owner> <owner>arc-core@google.com</owner> <summary> @@ -185,7 +185,7 @@ </histogram> <histogram name="Login.NumberOfUsersOnLoginScreen" units="units" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>mslus@chromium.org</owner> <owner>chromeos-commercial-identity@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/media/histograms.xml b/tools/metrics/histograms/metadata/media/histograms.xml index aca41a42..157d4cd1 100644 --- a/tools/metrics/histograms/metadata/media/histograms.xml +++ b/tools/metrics/histograms/metadata/media/histograms.xml
@@ -740,7 +740,7 @@ </histogram> <histogram name="Media.Audio.OutputDeviceMixer.MixedPlaybackStatus" - enum="AudioOutputDeviceMixerMixedPlaybackStatus" expires_after="2022-10-04"> + enum="AudioOutputDeviceMixerMixedPlaybackStatus" expires_after="2022-12-04"> <owner>olka@chromium.org</owner> <owner>tguilbert@chromium.org</owner> <summary> @@ -783,7 +783,7 @@ </histogram> <histogram name="Media.Audio.OutputDeviceMixer.OvertimeCount" units="count" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>olka@chromium.org</owner> <owner>saza@chromium.org</owner> <owner>tguilbert@chromium.org</owner> @@ -1037,7 +1037,7 @@ </histogram> <histogram name="Media.Audio.Render.OutputDeviceStartTime2" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>dalecurtis@chromium.org</owner> <owner>olka@chromium.org</owner> <owner>tguilbert@chromium.org</owner> @@ -1215,7 +1215,7 @@ </histogram> <histogram name="Media.AudioCapturerAudioGlitches" enum="AudioGlitchResult" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>olka@chromium.org</owner> <owner>gustaf@chromium.org</owner> <summary> @@ -1225,7 +1225,7 @@ </histogram> <histogram name="Media.AudioCapturerDroppedData" units="%" - expires_after="2022-11-27"> + expires_after="2022-12-04"> <owner>olka@chromium.org</owner> <owner>gustaf@chromium.org</owner> <summary> @@ -1252,7 +1252,7 @@ </histogram> <histogram name="Media.AudioCapturerMissedReadDeadline" units="%" - expires_after="2022-02-04"> + expires_after="2022-12-04"> <owner>olka@chromium.org</owner> <owner>gustaf@chromium.org</owner> <summary> @@ -1490,7 +1490,7 @@ </histogram> <histogram name="Media.AudioRendererAudioGlitches" enum="AudioGlitchResult" - expires_after="2022-11-27"> + expires_after="2022-12-04"> <owner>henrika@chromium.org</owner> <owner>olka@chromium.org</owner> <summary> @@ -1533,7 +1533,7 @@ </histogram> <histogram name="Media.AudioRendererMissedDeadline" units="%" - expires_after="2022-11-27"> + expires_after="2022-12-04"> <owner>dalecurtis@chromium.org</owner> <owner>olka@chromium.org</owner> <summary> @@ -2571,7 +2571,7 @@ </histogram> <histogram name="Media.GlobalMediaControls.DeviceSelectorAvailable" - enum="Boolean" expires_after="2022-10-04"> + enum="Boolean" expires_after="2022-12-04"> <owner>steimel@chromium.org</owner> <owner>media-dev@chromium.org</owner> <summary> @@ -2582,7 +2582,7 @@ </histogram> <histogram name="Media.GlobalMediaControls.DeviceSelectorOpened" enum="Boolean" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>steimel@chromium.org</owner> <owner>media-dev@chromium.org</owner> <summary> @@ -2640,7 +2640,7 @@ </histogram> <histogram name="Media.GlobalMediaControls.NumberOfAvailableAudioDevices" - units="devices" expires_after="2022-10-04"> + units="devices" expires_after="2022-12-04"> <owner>steimel@chromium.org</owner> <owner>media-dev@chromium.org</owner> <summary> @@ -4448,7 +4448,7 @@ </histogram> <histogram name="Media.VaapiVideoDecoder.DecodeError" enum="BooleanError" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>mcasas@chromium.org</owner> <owner>chromeos-gfx@chromium.org</owner> <summary> @@ -4468,7 +4468,7 @@ </histogram> <histogram name="Media.VaapiWrapper.VADisplayStateInitializeSuccess" - enum="BooleanSuccess" expires_after="2022-10-04"> + enum="BooleanSuccess" expires_after="2022-12-04"> <owner>mcasas@chromium.org</owner> <owner>chromeos-gfx-video@google.com</owner> <summary> @@ -4498,7 +4498,7 @@ </histogram> <histogram name="Media.VAVDA.VaapiWrapperCreationSuccess" enum="BooleanSuccess" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>mcasas@chromium.org</owner> <owner>chromeos-gfx-video@google.com</owner> <summary> @@ -5786,7 +5786,7 @@ </histogram> <histogram name="MediaRouter.CastStreaming.Start.Failure.Native" - enum="MirroringServiceErrorType" expires_after="2022-10-04"> + enum="MirroringServiceErrorType" expires_after="2022-12-04"> <owner>takumif@chromium.org</owner> <owner>openscreen-eng@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/memory/histograms.xml b/tools/metrics/histograms/metadata/memory/histograms.xml index 816962a..c25ba63 100644 --- a/tools/metrics/histograms/metadata/memory/histograms.xml +++ b/tools/metrics/histograms/metadata/memory/histograms.xml
@@ -2299,7 +2299,7 @@ </histogram> <histogram name="Memory.PartitionAlloc.MemoryReclaim" units="microseconds" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>lizeb@chromium.org</owner> <owner>bartekn@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/na_cl/histograms.xml b/tools/metrics/histograms/metadata/na_cl/histograms.xml index dfc0b010..744353f 100644 --- a/tools/metrics/histograms/metadata/na_cl/histograms.xml +++ b/tools/metrics/histograms/metadata/na_cl/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="NaCl.AppType" enum="NaClAppTypeEnum" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>dschuff@chromium.org</owner> <owner>adamk@chromium.org</owner> <owner>bbudge@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/net/histograms.xml b/tools/metrics/histograms/metadata/net/histograms.xml index 6dad867..a3007f7 100644 --- a/tools/metrics/histograms/metadata/net/histograms.xml +++ b/tools/metrics/histograms/metadata/net/histograms.xml
@@ -1661,7 +1661,7 @@ </histogram> <histogram name="Net.HttpJob.PrefilterBytesRead" units="bytes" - expires_after="2022-09-11"> + expires_after="2022-12-04"> <owner>jkarlin@chromium.org</owner> <owner>shivanisha@chromium.org</owner> <summary> @@ -4756,7 +4756,7 @@ </histogram> <histogram name="Net.SSLVersionGoogle" enum="SSLOrQUICVersion" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>davidben@chromium.org</owner> <owner>rsleevi@chromium.org</owner> <summary> @@ -5025,7 +5025,7 @@ </histogram> <histogram name="Net.URLRequest.ReferrerHasInformativePath" - enum="BooleanPathIsInformative" expires_after="2022-10-04"> + enum="BooleanPathIsInformative" expires_after="2022-12-04"> <!-- Name completed by histogram_suffixes name="ReferrerPolicySameOrigin" --> <owner>davidvc@chromium.org</owner> @@ -5039,7 +5039,7 @@ </histogram> <histogram name="Net.URLRequest.ReferrerPolicyForRequest" - enum="URLRequestReferrerPolicy" expires_after="2022-10-04"> + enum="URLRequestReferrerPolicy" expires_after="2022-12-04"> <!-- Name completed by histogram_suffixes name="ReferrerPolicySameOrigin" --> <owner>davidvc@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/network/histograms.xml b/tools/metrics/histograms/metadata/network/histograms.xml index 37e73c5..c086797 100644 --- a/tools/metrics/histograms/metadata/network/histograms.xml +++ b/tools/metrics/histograms/metadata/network/histograms.xml
@@ -1082,7 +1082,7 @@ </histogram> <histogram name="Network.Radio.PossibleWakeupTrigger.RadioUtilsOverhead" - units="ms" expires_after="2022-10-04"> + units="ms" expires_after="2022-12-04"> <owner>bashi@chromium.org</owner> <owner>blink-network-stack@google.com</owner> <summary> @@ -1092,7 +1092,7 @@ </histogram> <histogram name="Network.Radio.PossibleWakeupTrigger.ResolveHostPurpose2" - enum="ResolveHostPurpose" expires_after="2022-10-04"> + enum="ResolveHostPurpose" expires_after="2022-12-04"> <owner>bashi@chromium.org</owner> <owner>blink-network-stack@google.com</owner> <summary> @@ -1103,7 +1103,7 @@ </histogram> <histogram name="Network.Radio.PossibleWakeupTrigger.URLLoaderAnnotationId2" - enum="TrafficAnnotationUniqueIdHash" expires_after="2022-10-04"> + enum="TrafficAnnotationUniqueIdHash" expires_after="2022-12-04"> <owner>bashi@chromium.org</owner> <owner>blink-network-stack@google.com</owner> <summary> @@ -1114,7 +1114,7 @@ <histogram name="Network.Radio.PossibleWakeupTrigger.URLLoaderRequestDestination" - enum="RequestDestination" expires_after="2022-10-04"> + enum="RequestDestination" expires_after="2022-12-04"> <owner>bashi@chromium.org</owner> <owner>blink-network-stack@google.com</owner> <summary> @@ -1125,7 +1125,7 @@ <histogram name="Network.Radio.PossibleWakeupTrigger.URLLoaderRequestIsPrefetch" - enum="Boolean" expires_after="2022-10-04"> + enum="Boolean" expires_after="2022-12-04"> <owner>bashi@chromium.org</owner> <owner>blink-network-stack@google.com</owner> <summary> @@ -1135,7 +1135,7 @@ </histogram> <histogram name="Network.Radio.PossibleWakeupTrigger.URLLoaderRequestPriority" - enum="NetRequestPriority" expires_after="2022-10-04"> + enum="NetRequestPriority" expires_after="2022-12-04"> <owner>bashi@chromium.org</owner> <owner>blink-network-stack@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/new_tab_page/histograms.xml b/tools/metrics/histograms/metadata/new_tab_page/histograms.xml index bb52880..f185ce6 100644 --- a/tools/metrics/histograms/metadata/new_tab_page/histograms.xml +++ b/tools/metrics/histograms/metadata/new_tab_page/histograms.xml
@@ -172,7 +172,7 @@ </histogram> <histogram name="NewTabPage.Carts.DiscountConsentStatusAtLoad" - enum="CartDiscountConsentStatus" expires_after="2022-11-27"> + enum="CartDiscountConsentStatus" expires_after="2022-12-04"> <owner>yuezhanggg@chromium.org</owner> <owner>wychen@chromium.org</owner> <owner>chrome-shopping@google.com</owner> @@ -269,7 +269,7 @@ </histogram> <histogram name="NewTabPage.ConcretePage" enum="NewTabPageConcretePage" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>danpeng@google.com</owner> <owner>tiborg@chromium.org</owner> <owner>chrome-desktop-ntp@google.com</owner> @@ -1145,7 +1145,7 @@ </histogram> <histogram name="NewTabPage.Modules.Hover" enum="NtpModules" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>danpeng@google.com</owner> <owner>tiborg@chromium.org</owner> <owner>chrome-desktop-ntp@google.com</owner> @@ -1228,7 +1228,7 @@ </histogram> <histogram name="NewTabPage.Modules.LoadedModulesCount" units="count" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>danpeng@google.com</owner> <owner>tiborg@chromium.org</owner> <owner>chrome-desktop-ntp@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/notifications/histograms.xml b/tools/metrics/histograms/metadata/notifications/histograms.xml index 81f26ea5..efdd1fb 100644 --- a/tools/metrics/histograms/metadata/notifications/histograms.xml +++ b/tools/metrics/histograms/metadata/notifications/histograms.xml
@@ -426,7 +426,7 @@ </histogram> <histogram name="Notifications.Database.ReadResult" - enum="NotificationDatabaseStatus" expires_after="2022-08-14"> + enum="NotificationDatabaseStatus" expires_after="2022-12-04"> <owner>knollr@chromium.org</owner> <owner>peter@chromium.org</owner> <summary> @@ -436,7 +436,7 @@ </histogram> <histogram name="Notifications.Database.WriteResult" - enum="NotificationDatabaseStatus" expires_after="2022-08-21"> + enum="NotificationDatabaseStatus" expires_after="2022-12-04"> <owner>knollr@chromium.org</owner> <owner>peter@chromium.org</owner> <summary> @@ -667,7 +667,7 @@ </histogram> <histogram name="Notifications.PersistentNotificationActionCount" - units="buttons" expires_after="2022-08-21"> + units="buttons" expires_after="2022-12-04"> <owner>peter@chromium.org</owner> <summary> The number of action buttons the developer provided for a persistent Web
diff --git a/tools/metrics/histograms/metadata/omnibox/histograms.xml b/tools/metrics/histograms/metadata/omnibox/histograms.xml index 4b3327b..61c4d31 100644 --- a/tools/metrics/histograms/metadata/omnibox/histograms.xml +++ b/tools/metrics/histograms/metadata/omnibox/histograms.xml
@@ -197,7 +197,7 @@ </histogram> <histogram name="Omnibox.ClipboardSuggestionShownNumTimes" units="units" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>gangwu@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> <summary> @@ -713,7 +713,7 @@ </histogram> <histogram name="Omnibox.MatchStability.AsyncMatchChange2" units="position" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>tommycli@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> <summary> @@ -746,7 +746,7 @@ </histogram> <histogram name="Omnibox.MatchStability.AsyncMatchChangedInAnyPosition" - enum="BooleanChanged" expires_after="2022-10-04"> + enum="BooleanChanged" expires_after="2022-12-04"> <owner>tommycli@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> <summary> @@ -822,7 +822,7 @@ </summary> </histogram> -<histogram name="Omnibox.PaintTime" units="ms" expires_after="2022-09-11"> +<histogram name="Omnibox.PaintTime" units="ms" expires_after="2022-12-04"> <owner>asvitkine@chromium.org</owner> <owner>mpearson@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> @@ -1201,7 +1201,7 @@ </histogram> <histogram name="Omnibox.Start.WantAsyncMatches" enum="Boolean" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>tommycli@chromium.org</owner> <owner>jdonnelly@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/oobe/histograms.xml b/tools/metrics/histograms/metadata/oobe/histograms.xml index 1d67b5d8..54b726f8 100644 --- a/tools/metrics/histograms/metadata/oobe/histograms.xml +++ b/tools/metrics/histograms/metadata/oobe/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="OOBE.ArcTermsOfServiceScreen.ReviewFollowingSetup" - enum="BooleanChecked" expires_after="2022-10-01"> + enum="BooleanChecked" expires_after="2022-12-04"> <owner>raleksandrov@google.com</owner> <owner>cros-oac@google.com</owner> <summary> @@ -81,7 +81,7 @@ </histogram> <histogram name="OOBE.EulaScreen.UserActions" enum="EulaScreenUserAction" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>raleksandrov@google.com</owner> <owner>cros-oac@google.com</owner> <summary> @@ -123,7 +123,7 @@ </histogram> <histogram name="OOBE.GaiaPasswordChangedScreen.UserActions" - enum="GaiaPasswordChangedScreenUserAction" expires_after="2022-10-01"> + enum="GaiaPasswordChangedScreenUserAction" expires_after="2022-12-04"> <owner>raleksandrov@google.com</owner> <owner>cros-oac@google.com</owner> <summary> @@ -409,7 +409,7 @@ </histogram> <histogram name="OOBE.UpdateScreen.StageTime.Check" units="ms" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>dkuzmin@google.com</owner> <owner>cros-oac@google.com</owner> <summary> @@ -481,7 +481,7 @@ </histogram> <histogram name="OOBE.WelcomeScreen.AcceptChromeVoxHint" enum="BooleanEnabled" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>akihiroota@google.com</owner> <owner>cros-oac@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/optimization/histograms.xml b/tools/metrics/histograms/metadata/optimization/histograms.xml index ceb9094..8d85d1b9 100644 --- a/tools/metrics/histograms/metadata/optimization/histograms.xml +++ b/tools/metrics/histograms/metadata/optimization/histograms.xml
@@ -706,7 +706,7 @@ <histogram name="OptimizationGuide.PageContentAnnotationsService.ContentAnnotationsStorageStatus" enum="OptimizationGuidePageContentAnnotationsStorageStatus" - expires_after="2022-11-27"> + expires_after="2022-12-04"> <owner>sophiechang@chromium.org</owner> <owner>mcrouse@chromium.org</owner> <summary> @@ -1118,7 +1118,7 @@ <histogram name="OptimizationGuide.PredictionModelFetcher.GetModelsResponse.NetErrorCode" - enum="NetErrorCodes" expires_after="2022-11-27"> + enum="NetErrorCodes" expires_after="2022-12-04"> <owner>mcrouse@chromium.org</owner> <owner>sophiechang@chromium.org</owner> <summary> @@ -1148,7 +1148,7 @@ <histogram name="OptimizationGuide.PredictionModelFetcher.GetModelsResponse.Status" - enum="HttpResponseCode" expires_after="2022-11-27"> + enum="HttpResponseCode" expires_after="2022-12-04"> <owner>mcrouse@chromium.org</owner> <owner>sophiechang@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml index a90e897..2474c59 100644 --- a/tools/metrics/histograms/metadata/others/histograms.xml +++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -1097,7 +1097,7 @@ <histogram name="AutocompleteActionPredictor.NoStatePrefetchStatus" enum="AutocompleteActionPredictorPredictionStatus" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>spelchat@chromium.org</owner> <owner>chrome-brapp-loading@google.com</owner> <summary> @@ -2205,7 +2205,7 @@ </histogram> <histogram name="ChromiumAndroidLinker.ChildProcessZygoteState" - enum="ZygoteChildState" expires_after="2022-10-01"> + enum="ZygoteChildState" expires_after="2022-12-04"> <owner>pasko@chromium.org</owner> <owner>boliu@chromium.org</owner> <summary> @@ -2286,7 +2286,7 @@ </histogram> <histogram name="ChromiumAndroidLinker.ModernLinkerDlopenExtTime" units="ms" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>pasko@chromium.org</owner> <owner>agrieve@chromium.org</owner> <summary> @@ -2297,7 +2297,7 @@ </histogram> <histogram name="ChromiumAndroidLinker.ModernLinkerIteratePhdrTime" units="ms" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>pasko@chromium.org</owner> <owner>agrieve@chromium.org</owner> <summary> @@ -2350,7 +2350,7 @@ </histogram> <histogram name="ChromiumAndroidLinker.RelroSharingStatus2" - enum="RelroSharingStatus" expires_after="2022-10-01"> + enum="RelroSharingStatus" expires_after="2022-12-04"> <owner>lizeb@chromium.org</owner> <owner>pasko@chromium.org</owner> <summary> @@ -3036,7 +3036,7 @@ </histogram> <histogram name="ContextMenu.LensSupportStatus" enum="LensSupportStatus" - expires_after="2022-10-02"> + expires_after="2022-12-04"> <owner>benwgold@google.com</owner> <owner>lens-chrome@google.com</owner> <summary> @@ -3171,7 +3171,7 @@ </histogram> <histogram name="ContextMenu.TimeToTakeAction.Abandoned" units="ms" - expires_after="2022-10-02"> + expires_after="2022-12-04"> <owner>twellington@chromium.org</owner> <owner>clank-app-team@google.com</owner> <summary> @@ -3283,7 +3283,7 @@ </histogram> <histogram name="Conversions.AggregatableReport.CreateReportStatus2" - enum="ConversionCreateAggregatableReportStatus" expires_after="2022-10-01"> + enum="ConversionCreateAggregatableReportStatus" expires_after="2022-12-04"> <owner>linnan@chromium.org</owner> <owner>johnidel@chromium.org</owner> <owner>measurement-api-dev+metrics@google.com</owner> @@ -3416,7 +3416,7 @@ </histogram> <histogram name="Conversions.ClearDataTime" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>johnidel@chromium.org</owner> <owner>csharrison@chromium.org</owner> <summary> @@ -3474,7 +3474,7 @@ </histogram> <histogram name="Conversions.CreateReportStatus3" - enum="ConversionStorageCreateReportStatus" expires_after="2022-10-04"> + enum="ConversionStorageCreateReportStatus" expires_after="2022-12-04"> <owner>apaseltiner@chromium.org</owner> <owner>johnidel@chromium.org</owner> <owner>measurement-api-dev+metrics@google.com</owner> @@ -3582,7 +3582,7 @@ </histogram> <histogram name="Conversions.ImpressionsDeletedInDataClearOperation" - units="impressions" expires_after="2022-10-04"> + units="impressions" expires_after="2022-12-04"> <owner>johnidel@chromium.org</owner> <owner>csharrison@chromium.org</owner> <owner>linnan@chromium.org</owner> @@ -3619,7 +3619,7 @@ </histogram> <histogram name="Conversions.RegisterConversionAllowed" enum="BooleanAllowed" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>apaseltiner@chromium.org</owner> <owner>johnidel@chromium.org</owner> <owner>measurement-api-dev+metrics@google.com</owner> @@ -3735,7 +3735,7 @@ </histogram> <histogram name="Conversions.ReportsDeletedInDataClearOperation" - units="conversions" expires_after="2022-10-04"> + units="conversions" expires_after="2022-12-04"> <owner>johnidel@chromium.org</owner> <owner>csharrison@chromium.org</owner> <owner>linnan@chromium.org</owner> @@ -3889,7 +3889,7 @@ </histogram> <histogram name="Conversions.Storage.Sql.InitStatus2" - enum="ConversionStorageSqlInitStatus" expires_after="2022-10-04"> + enum="ConversionStorageSqlInitStatus" expires_after="2022-12-04"> <owner>johnidel@chromium.org</owner> <owner>csharrison@chromium.org</owner> <summary> @@ -4605,7 +4605,7 @@ </histogram> <histogram name="DisplayManager.InternalDisplayZoomPercentage" units="%" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>zentaro@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary> @@ -4616,7 +4616,7 @@ </histogram> <histogram name="DisplayManager.MirroringDisplayCountRanges" - enum="MultiDisplayModeDisplayCountRanges" expires_after="2022-10-04"> + enum="MultiDisplayModeDisplayCountRanges" expires_after="2022-12-04"> <owner>zentaro@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary> @@ -4628,7 +4628,7 @@ </histogram> <histogram name="DisplayManager.MirrorModeTypes" enum="DisplayMirrorModeTypes" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>zentaro@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary> @@ -4640,7 +4640,7 @@ </histogram> <histogram name="DisplayManager.MultiDisplayMode" enum="MultiDisplayModes" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>zentaro@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary> @@ -4662,7 +4662,7 @@ </histogram> <histogram name="DisplayManager.UpdateDisplayConfigurationTask.ExecutionTime" - units="ms" expires_after="2022-10-04"> + units="ms" expires_after="2022-12-04"> <owner>zentaro@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary> @@ -5197,7 +5197,7 @@ </histogram> <histogram name="Eche.Connection.Result" enum="BooleanSuccess" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>samchiu@chromium.org</owner> <owner>better-together-dev@google.com</owner> <summary> @@ -5207,7 +5207,7 @@ </histogram> <histogram name="Eche.Connectivity.Latency" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>samchiu@chromium.org</owner> <owner>better-together-dev@google.com</owner> <summary> @@ -5217,7 +5217,7 @@ </histogram> <histogram name="Eche.NotificationClicked" enum="EcheNotificationInteraction" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>samchiu@chromium.org</owner> <owner>andychou@chromium.org</owner> <summary> @@ -5227,7 +5227,7 @@ </histogram> <histogram name="Eche.Onboarding.UserAction" enum="OnboardingUserActionMetric" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>paulzchen@google.com</owner> <owner>andychou@google.com</owner> <owner>samchiu@google.com</owner> @@ -5238,7 +5238,7 @@ </histogram> <histogram name="Eche.StreamEvent" enum="StreamState" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>paulzchen@google.com</owner> <owner>andychou@google.com</owner> <summary> @@ -5249,7 +5249,7 @@ </histogram> <histogram name="Eche.StreamEvent.Duration.FromInitializeToClose" units="ms" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>paulzchen@google.com</owner> <owner>andychou@google.com</owner> <owner>exo-core-eng@google.com</owner> @@ -5508,7 +5508,7 @@ </histogram> <histogram name="ExploreSites.RequestStatus" enum="ExploreSitesRequestStatus" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>dimich@chromium.org</owner> <owner>freedjm@chromium.org</owner> <summary> @@ -8110,7 +8110,7 @@ </histogram> <histogram name="Mouse.PointerSensitivity.Changed" enum="PointerSensitivity" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>zentaro@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary> @@ -8120,7 +8120,7 @@ </histogram> <histogram name="Mouse.PointerSensitivity.Started" enum="PointerSensitivity" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>zentaro@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary> @@ -8647,14 +8647,14 @@ </histogram> <histogram name="OAuth2Login.SessionRestoreTimeToFailure" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>anastasiian@chromium.org</owner> <owner>sinhak@chromium.org</owner> <summary>How long it takes for the session restore to fail.</summary> </histogram> <histogram name="OAuth2Login.SessionRestoreTimeToSuccess" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>anastasiian@chromium.org</owner> <owner>sinhak@chromium.org</owner> <summary> @@ -9613,7 +9613,7 @@ </histogram> <histogram name="PrefetchedSignedExchangeCache.Count" units="count" - expires_after="2022-09-29"> + expires_after="2022-12-04"> <owner>ksakamoto@chromium.org</owner> <owner>webpackage-dev@chromium.org</owner> <summary> @@ -10152,7 +10152,7 @@ </histogram> <histogram name="PushMessaging.UnregistrationReason" - enum="PushUnregistrationReason" expires_after="2022-08-28"> + enum="PushUnregistrationReason" expires_after="2022-12-04"> <owner>peter@chromium.org</owner> <owner>knollr@chromium.org</owner> <summary> @@ -11215,7 +11215,7 @@ </histogram> <histogram name="SB2.RemoteCall.Result" enum="SB2RemoteCallResult" - expires_after="2022-10-02"> + expires_after="2022-12-04"> <owner>vakh@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -12720,7 +12720,7 @@ </histogram> <histogram name="Tablet.CountOfVolumeAdjustType" units="numbers" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>minch@chromium.org</owner> <owner>omrilio@chromium.org</owner> <summary> @@ -13265,7 +13265,7 @@ </histogram> <histogram name="Touchpad.NaturalScroll.Started" enum="BooleanEnabled" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>zentaro@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary> @@ -13346,7 +13346,7 @@ </histogram> <histogram name="Touchpad.TapToClick.Started" enum="BooleanEnabled" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>zentaro@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/page/histograms.xml b/tools/metrics/histograms/metadata/page/histograms.xml index f004e2f..554953a 100644 --- a/tools/metrics/histograms/metadata/page/histograms.xml +++ b/tools/metrics/histograms/metadata/page/histograms.xml
@@ -212,7 +212,7 @@ </histogram> <histogram name="PageLoad.Clients.Ads.HeavyAds.DisallowedByBlocklist" - enum="BooleanBlocked" expires_after="2022-10-04"> + enum="BooleanBlocked" expires_after="2022-12-04"> <owner>johnidel@chromium.org</owner> <owner>jkarlin@chromium.org</owner> <summary> @@ -1365,8 +1365,9 @@ </histogram> <histogram name="PageLoad.Experimental.InputTiming.InputToNavigationStart" - units="ms" expires_after="2021-12-26"> - <owner>sullivan@chromium.org</owner> + units="ms" expires_after="2022-12-01"> + <owner>spelchat@chromium.org</owner> + <owner>chrome-brapp-loading@google.com</owner> <summary> The time between the OS-level input event that initiated a navigation, and the navigation actually starting. @@ -1375,8 +1376,9 @@ <histogram name="PageLoad.Experimental.InputTiming.InputToNavigationStart.Background" - units="ms" expires_after="2020-09-05"> - <owner>sullivan@chromium.org</owner> + units="ms" expires_after="2022-12-01"> + <owner>spelchat@chromium.org</owner> + <owner>chrome-brapp-loading@google.com</owner> <summary> The time between the OS-level input event that initiated a navigation, and the navigation actually starting, for background loads. @@ -1385,8 +1387,9 @@ <histogram name="PageLoad.Experimental.InputTiming.InputToNavigationStart.FromLinkClick" - units="ms" expires_after="2020-09-05"> - <owner>sullivan@chromium.org</owner> + units="ms" expires_after="2022-12-01"> + <owner>spelchat@chromium.org</owner> + <owner>chrome-brapp-loading@google.com</owner> <summary> The time between the OS-level click/tap event and navigation start, for clicks on links in the renderer. @@ -1395,8 +1398,9 @@ <histogram name="PageLoad.Experimental.InputTiming.InputToNavigationStart.FromOmnibox" - units="ms" expires_after="2020-09-05"> - <owner>sullivan@chromium.org</owner> + units="ms" expires_after="2022-12-01"> + <owner>spelchat@chromium.org</owner> + <owner>chrome-brapp-loading@google.com</owner> <summary> The time between the OS-level keypress/tap event in the omnibox and navigation start, for navigations from the omnibox.
diff --git a/tools/metrics/histograms/metadata/password/histograms.xml b/tools/metrics/histograms/metadata/password/histograms.xml index d966ff8..c4593ac1 100644 --- a/tools/metrics/histograms/metadata/password/histograms.xml +++ b/tools/metrics/histograms/metadata/password/histograms.xml
@@ -140,7 +140,7 @@ </histogram> <histogram name="KeyboardAccessory.AccessoryToggleClicked" - enum="AccessoryToggleType" expires_after="2022-10-04"> + enum="AccessoryToggleType" expires_after="2022-12-04"> <owner>ioanap@chromium.org</owner> <owner>fhorschig@chromium.org</owner> <summary> @@ -355,7 +355,7 @@ </histogram> <histogram name="PasswordManager.AccountStorage.ClearedOnStartup" - enum="PasswordAccountStoreClearedOnStartup" expires_after="2022-10-04"> + enum="PasswordAccountStoreClearedOnStartup" expires_after="2022-12-04"> <owner>mamir@chromium.org</owner> <owner>treib@chromium.org</owner> <summary> @@ -365,7 +365,7 @@ </histogram> <histogram name="PasswordManager.AccountStorage.ClearedOptInForAllAccounts" - units="accounts" expires_after="2022-10-04"> + units="accounts" expires_after="2022-12-04"> <owner>mamir@chromium.org</owner> <owner>treib@chromium.org</owner> <summary> @@ -377,7 +377,7 @@ </histogram> <histogram name="PasswordManager.AccountStorage.MoveToAccountStoreFlowAccepted" - enum="PasswordManager.MoveToAccountStoreTrigger" expires_after="2022-10-04"> + enum="PasswordManager.MoveToAccountStoreTrigger" expires_after="2022-12-04"> <owner>treib@chromium.org</owner> <owner>victorvianna@google.com</owner> <owner>mamir@chromium.org</owner> @@ -390,7 +390,7 @@ </histogram> <histogram name="PasswordManager.AccountStorage.MoveToAccountStoreFlowOffered" - enum="PasswordManager.MoveToAccountStoreTrigger" expires_after="2022-10-04"> + enum="PasswordManager.MoveToAccountStoreTrigger" expires_after="2022-12-04"> <owner>treib@chromium.org</owner> <owner>victorvianna@google.com</owner> <owner>mamir@chromium.org</owner> @@ -418,7 +418,7 @@ </histogram> <histogram name="PasswordManager.AccountStorage.NumOptedInAccountsAfterOptIn" - units="accounts" expires_after="2022-10-04"> + units="accounts" expires_after="2022-12-04"> <owner>mamir@chromium.org</owner> <owner>treib@chromium.org</owner> <summary> @@ -429,7 +429,7 @@ </histogram> <histogram name="PasswordManager.AccountStorage.NumOptedInAccountsAfterOptOut" - units="accounts" expires_after="2022-10-04"> + units="accounts" expires_after="2022-12-04"> <owner>mamir@chromium.org</owner> <owner>treib@chromium.org</owner> <summary> @@ -469,7 +469,7 @@ </histogram> <histogram base="true" name="PasswordManager.AccountStorageUserStateDuration" - units="ms" expires_after="2022-10-04"> + units="ms" expires_after="2022-12-04"> <!-- Name completed by histogram_suffixes name="PasswordAccountStorageUserState" --> <owner>mamir@chromium.org</owner> @@ -503,7 +503,7 @@ </histogram> <histogram name="PasswordManager.AccountStoreBlocklistedEntriesAfterOptIn" - units="credentials" expires_after="2022-10-04"> + units="credentials" expires_after="2022-12-04"> <owner>treib@chromium.org</owner> <owner>mamir@chromium.org</owner> <summary> @@ -513,7 +513,7 @@ </histogram> <histogram name="PasswordManager.AccountStoreCredentialsAfterOptIn" - units="credentials" expires_after="2022-10-04"> + units="credentials" expires_after="2022-12-04"> <owner>treib@chromium.org</owner> <owner>mamir@chromium.org</owner> <summary> @@ -1105,7 +1105,7 @@ </histogram> <histogram name="PasswordManager.CertificateErrorsWhileSeeingForms" - enum="PasswordCertificateError" expires_after="2022-10-04"> + enum="PasswordCertificateError" expires_after="2022-12-04"> <owner>battre@chromium.org</owner> <owner>kazinova@google.com</owner> <owner>chrome-password-manager-metrics-alerts@google.com</owner> @@ -1924,7 +1924,7 @@ </histogram> <histogram name="PasswordManager.NonSyncPasswordHashChange" - enum="GaiaPasswordHashChange" expires_after="2022-10-04"> + enum="GaiaPasswordHashChange" expires_after="2022-12-04"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -2103,7 +2103,7 @@ </histogram> <histogram name="PasswordManager.PasswordReuse.PasswordFieldDetected" - enum="PasswordReusePasswordFieldDetected" expires_after="2022-10-04"> + enum="PasswordReusePasswordFieldDetected" expires_after="2022-12-04"> <owner>vakh@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -2587,7 +2587,7 @@ </histogram> <histogram name="PasswordManager.RequirementsSpecFetcher.NetErrorCode" - enum="NetErrorCodes" expires_after="2022-10-04"> + enum="NetErrorCodes" expires_after="2022-12-04"> <owner>kazinova@google.com</owner> <owner>battre@chromium.org</owner> <summary> @@ -2596,7 +2596,7 @@ </histogram> <histogram name="PasswordManager.RequirementsSpecFetcher.NetworkDuration" - units="ms" expires_after="2022-10-04"> + units="ms" expires_after="2022-12-04"> <owner>kazinova@google.com</owner> <owner>battre@chromium.org</owner> <summary> @@ -2606,7 +2606,7 @@ </histogram> <histogram name="PasswordManager.RequirementsSpecFetcher.Result" - enum="PasswordRequirementsFetcherResult" expires_after="2022-10-04"> + enum="PasswordRequirementsFetcherResult" expires_after="2022-12-04"> <owner>kazinova@google.com</owner> <owner>battre@chromium.org</owner> <summary> @@ -2615,7 +2615,7 @@ </histogram> <histogram name="PasswordManager.ReusedPasswordType" enum="ReusedPasswordType" - expires_after="2022-10-02"> + expires_after="2022-12-04"> <owner>vakh@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -2692,7 +2692,7 @@ <histogram name="PasswordManager.SaveUIOnClearedPasswordChangeFormDismissalReason" - enum="PasswordManagerUIDismissalReason" expires_after="2022-10-04"> + enum="PasswordManagerUIDismissalReason" expires_after="2022-12-04"> <owner>kazinova@google.com</owner> <owner>khamutov@google.com</owner> <summary> @@ -2899,7 +2899,7 @@ </histogram> <histogram name="PasswordManager.SyncPasswordHashChange" - enum="GaiaPasswordHashChange" expires_after="2022-10-02"> + enum="GaiaPasswordHashChange" expires_after="2022-12-04"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -3077,7 +3077,7 @@ <histogram name="PasswordManager.UpdateUIOnClearedPasswordChangeFormDismissalReason" - enum="PasswordManagerUIDismissalReason" expires_after="2022-10-04"> + enum="PasswordManagerUIDismissalReason" expires_after="2022-12-04"> <owner>kazinova@google.com</owner> <owner>khamutov@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/platform/histograms.xml b/tools/metrics/histograms/metadata/platform/histograms.xml index de90762..df4ba168 100644 --- a/tools/metrics/histograms/metadata/platform/histograms.xml +++ b/tools/metrics/histograms/metadata/platform/histograms.xml
@@ -298,7 +298,7 @@ </histogram> <histogram name="Platform.DiskUsage.NumUserHomeDirectories" - units="home directories" expires_after="2022-10-04"> + units="home directories" expires_after="2022-12-04"> <owner>achuith@chromium.org</owner> <owner>tls@chromium.org</owner> <summary> @@ -364,7 +364,7 @@ </histogram> <histogram name="Platform.Emmc.LifeUsed" enum="EmmcLifeUsed" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>gwendal@google.com</owner> <summary> eMMC [5.0] Device lifetime estimation for flash. This field provides an @@ -855,7 +855,7 @@ </histogram> <histogram name="Platform.ReadSectorsShort" units="sectors per second" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>gwendal@google.com</owner> <summary> Number of disk sectors per second read by Chrome OS in a short interval @@ -1264,7 +1264,7 @@ </histogram> <histogram name="Platform.UnaggregatedUsageTime" units="seconds" - expires_after="2022-10-03"> + expires_after="2022-12-04"> <owner>mutexlox@chromium.org</owner> <owner>iby@chromium.org</owner> <owner>cros-telemetry@google.com</owner> @@ -1374,7 +1374,7 @@ </histogram> <histogram name="Platform.WriteSectorsShort" units="sectors per second" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>gwendal@google.com</owner> <summary> Number of disk sectors per second written by Chrome OS in a short interval
diff --git a/tools/metrics/histograms/metadata/print/histograms.xml b/tools/metrics/histograms/metadata/print/histograms.xml index d7ea69a9..ff76cf8 100644 --- a/tools/metrics/histograms/metadata/print/histograms.xml +++ b/tools/metrics/histograms/metadata/print/histograms.xml
@@ -210,7 +210,7 @@ </histogram> <histogram name="PrintPreview.PrintSettings" enum="PrintSettings" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>thestig@chromium.org</owner> <owner>awscreen@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/printing/histograms.xml b/tools/metrics/histograms/metadata/printing/histograms.xml index 0003b32..8355fdb1 100644 --- a/tools/metrics/histograms/metadata/printing/histograms.xml +++ b/tools/metrics/histograms/metadata/printing/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="Printing.ConversionSize.Emf" units="KB" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>thestig@chromium.org</owner> <owner>awscreen@chromium.org</owner> <summary> @@ -259,7 +259,7 @@ </histogram> <histogram name="Printing.CUPS.PrinterStatusReasons" - enum="PrinterStatusReasons" expires_after="2022-10-04"> + enum="PrinterStatusReasons" expires_after="2022-12-04"> <owner>gavinwill@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/profile/histograms.xml b/tools/metrics/histograms/metadata/profile/histograms.xml index 5231e90..a6a71eee 100644 --- a/tools/metrics/histograms/metadata/profile/histograms.xml +++ b/tools/metrics/histograms/metadata/profile/histograms.xml
@@ -393,7 +393,7 @@ </histogram> <histogram name="Profile.NumberOfActiveProfiles" units="profiles" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>droger@chromium.org</owner> <owner>feuunk@chromium.org</owner> <summary> @@ -613,7 +613,7 @@ </histogram> <histogram name="Profile.UserAction.PerProfile" enum="Profile" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>msarda@chromium.org</owner> <owner>tangltom@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/renderer/histograms.xml b/tools/metrics/histograms/metadata/renderer/histograms.xml index 9dec7d0..0b511bcb 100644 --- a/tools/metrics/histograms/metadata/renderer/histograms.xml +++ b/tools/metrics/histograms/metadata/renderer/histograms.xml
@@ -408,7 +408,7 @@ </histogram> <histogram name="Renderer.RenderThreadImpl.Init" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jam@chromium.org</owner> <owner>sky@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/safe_browsing/histograms.xml b/tools/metrics/histograms/metadata/safe_browsing/histograms.xml index 4414220..f40c584 100644 --- a/tools/metrics/histograms/metadata/safe_browsing/histograms.xml +++ b/tools/metrics/histograms/metadata/safe_browsing/histograms.xml
@@ -1162,7 +1162,7 @@ </histogram> <histogram name="SafeBrowsing.ExtensionTelemetry.UploadSize" units="bytes" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>anunoy@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -1173,7 +1173,7 @@ </histogram> <histogram name="SafeBrowsing.ExtensionTelemetry.UploadSuccess" - enum="BooleanSuccess" expires_after="2022-10-04"> + enum="BooleanSuccess" expires_after="2022-12-04"> <owner>anunoy@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -1257,7 +1257,7 @@ </histogram> <histogram name="SafeBrowsing.HasCookieAtStartup" enum="Boolean" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -1280,7 +1280,7 @@ </histogram> <histogram name="SafeBrowsing.MetricsCollector.IsPrefValid" enum="BooleanValid" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -1385,7 +1385,7 @@ </histogram> <histogram name="SafeBrowsing.PageLoadToken.Duration" units="ms" - expires_after="2022-10-05"> + expires_after="2022-12-04"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -1540,7 +1540,7 @@ </histogram> <histogram name="SafeBrowsing.Pref.MainProfile.SafeBrowsingState" - enum="SafeBrowsingState" expires_after="2022-10-01"> + enum="SafeBrowsingState" expires_after="2022-12-04"> <owner>jeffcyr@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -1573,7 +1573,7 @@ <histogram name="SafeBrowsing.RendererThrottle.IsCheckCompletedOnProcessResponse" - enum="BooleanCompleted" expires_after="2022-10-04"> + enum="BooleanCompleted" expires_after="2022-12-04"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -1586,7 +1586,7 @@ </histogram> <histogram name="SafeBrowsing.RendererThrottle.TotalDelay" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -1633,7 +1633,7 @@ </histogram> <histogram name="SafeBrowsing.RT.CacheManager.CleanUpTime" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -2106,7 +2106,7 @@ </histogram> <histogram name="SafeBrowsing.V4Database.Size" units="KB" - expires_after="2022-11-27"> + expires_after="2022-12-04"> <owner>vakh@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -2157,7 +2157,7 @@ </histogram> <histogram name="SafeBrowsing.V4GetHash.CountOfPrefixes" units="prefixes" - expires_after="2022-08-21"> + expires_after="2022-12-04"> <owner>vakh@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -2424,7 +2424,7 @@ </histogram> <histogram name="SafeBrowsing.V4Store.IsStoreValid" enum="BooleanValid" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -2487,7 +2487,7 @@ </histogram> <histogram name="SafeBrowsing.V4StoreRead.Result" - enum="SafeBrowsingV4StoreReadResult" expires_after="2022-10-04"> + enum="SafeBrowsingV4StoreReadResult" expires_after="2022-12-04"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/sb_client/histograms.xml b/tools/metrics/histograms/metadata/sb_client/histograms.xml index 89d67897..de586f6 100644 --- a/tools/metrics/histograms/metadata/sb_client/histograms.xml +++ b/tools/metrics/histograms/metadata/sb_client/histograms.xml
@@ -85,7 +85,7 @@ </histogram> <histogram name="SBClientDownload.DmgHasAPFS" enum="Boolean" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -105,7 +105,7 @@ </histogram> <histogram name="SBClientDownload.DmgParsedUdif" enum="BooleanSuccess" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -193,7 +193,7 @@ </histogram> <histogram name="SBClientDownload.DownloadRequestNetworkDuration" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>vakh@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <owner>mattm@chromium.org</owner> @@ -207,7 +207,7 @@ </histogram> <histogram name="SBClientDownload.DownloadRequestNetworkStats" - enum="SBClientDownloadCheckDownloadStats" expires_after="2022-10-04"> + enum="SBClientDownloadCheckDownloadStats" expires_after="2022-12-04"> <owner>vakh@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <owner>mattm@chromium.org</owner> @@ -731,7 +731,7 @@ </histogram> <histogram name="SBClientPhishing.RequestWithToken" enum="BooleanSent" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>bhatiarohit@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/scanning/histograms.xml b/tools/metrics/histograms/metadata/scanning/histograms.xml index 8031bb6..57cdb2e 100644 --- a/tools/metrics/histograms/metadata/scanning/histograms.xml +++ b/tools/metrics/histograms/metadata/scanning/histograms.xml
@@ -94,7 +94,7 @@ </histogram> <histogram name="Scanning.NumCompletedScansInSession" units="scans" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>gavinwill@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary> @@ -105,7 +105,7 @@ </histogram> <histogram name="Scanning.NumDetectedScanners" units="scanners" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>gavinwill@chromium.org</owner> <owner>cros-peripherals@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/search/histograms.xml b/tools/metrics/histograms/metadata/search/histograms.xml index 9a85a1c..3ec68454 100644 --- a/tools/metrics/histograms/metadata/search/histograms.xml +++ b/tools/metrics/histograms/metadata/search/histograms.xml
@@ -1344,7 +1344,7 @@ </histogram> <histogram name="Search.QueryTiles.RequestStatus" - enum="QueryTilesRequestStatus" expires_after="2022-10-01"> + enum="QueryTilesRequestStatus" expires_after="2022-12-04"> <owner>qinmin@chromium.org</owner> <owner>chrome-upboarding-eng@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/security/histograms.xml b/tools/metrics/histograms/metadata/security/histograms.xml index 3557ec3..98af262 100644 --- a/tools/metrics/histograms/metadata/security/histograms.xml +++ b/tools/metrics/histograms/metadata/security/histograms.xml
@@ -487,7 +487,7 @@ </histogram> <histogram name="Security.SCTAuditing.OptOut.LookupQueryResult" - enum="SCTLookupQueryResult" expires_after="2022-10-04"> + enum="SCTLookupQueryResult" expires_after="2022-12-04"> <owner>cthomp@chromium.org</owner> <owner>nsatragno@chromium.org</owner> <owner>trusty-transport@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/segmentation_platform/histograms.xml b/tools/metrics/histograms/metadata/segmentation_platform/histograms.xml index 17cf760..c35e9a9 100644 --- a/tools/metrics/histograms/metadata/segmentation_platform/histograms.xml +++ b/tools/metrics/histograms/metadata/segmentation_platform/histograms.xml
@@ -90,7 +90,7 @@ <histogram name="SegmentationPlatform.AdaptiveToolbar.SegmentSelection.Computed" - enum="AdaptiveToolbarButtonVariant" expires_after="2022-11-27"> + enum="AdaptiveToolbarButtonVariant" expires_after="2022-12-04"> <owner>shaktisahu@chromium.org</owner> <owner>chrome-segmentation-platform@google.com</owner> <summary> @@ -431,7 +431,7 @@ </histogram> <histogram name="SegmentationPlatform.SelectionFailedReason" - enum="SegmentationSelectionFailureReason" expires_after="2022-11-27"> + enum="SegmentationSelectionFailureReason" expires_after="2022-12-04"> <owner>ssid@chromium.org</owner> <owner>chrome-segmentation-platform@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/service/histograms.xml b/tools/metrics/histograms/metadata/service/histograms.xml index 62b22a3..2bcaf41 100644 --- a/tools/metrics/histograms/metadata/service/histograms.xml +++ b/tools/metrics/histograms/metadata/service/histograms.xml
@@ -891,7 +891,7 @@ </histogram> <histogram name="ServiceWorker.StartWorker.Status" - enum="ServiceWorkerStatusCode" expires_after="2022-11-20"> + enum="ServiceWorkerStatusCode" expires_after="2022-12-04"> <owner>wanderview@chromium.org</owner> <owner>asamidoi@chromium.org</owner> <owner>chrome-worker@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/settings/histograms.xml b/tools/metrics/histograms/metadata/settings/histograms.xml index e242928b..61b7390 100644 --- a/tools/metrics/histograms/metadata/settings/histograms.xml +++ b/tools/metrics/histograms/metadata/settings/histograms.xml
@@ -171,7 +171,7 @@ </histogram> <histogram name="Settings.PinUnlockSetup" enum="LockScreenProgress" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>anastasiian@chromium.org</owner> <owner>teresachow@google.com</owner> <owner>cros-lurs@google.com</owner> @@ -237,7 +237,7 @@ <histogram name="Settings.PrivacySandbox.DialogDisplayHost" enum="SettingsPrivacySandboxDialogDisplayHostHash" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>sauski@google.com</owner> <owner>chrome-friendly-settings@google.com</owner> <summary> @@ -250,7 +250,7 @@ </histogram> <histogram name="Settings.PrivacySandbox.DialogLoadTime" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>olesiamarukhno@google.com</owner> <owner>sauski@google.com</owner> <owner>chrome-friendly-settings@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/sharing/histograms.xml b/tools/metrics/histograms/metadata/sharing/histograms.xml index 19fe716f..4f37c915 100644 --- a/tools/metrics/histograms/metadata/sharing/histograms.xml +++ b/tools/metrics/histograms/metadata/sharing/histograms.xml
@@ -341,7 +341,7 @@ </histogram> <histogram name="Sharing.Screenshot.Action" enum="SharingScreenshotAction" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jeffreycohen@chromium.org</owner> <owner>src/chrome/browser/share/OWNERS</owner> <summary> @@ -586,7 +586,7 @@ </histogram> <histogram name="Sharing.SharingHubDesktop.CrOSSharesheetResult" - enum="SharingHubSharesheetResult" expires_after="2022-10-04"> + enum="SharingHubSharesheetResult" expires_after="2022-12-04"> <owner>kristipark@chromium.org</owner> <owner>src/chrome/browser/share/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/side_search/histograms.xml b/tools/metrics/histograms/metadata/side_search/histograms.xml index d19f4a2..21ad059 100644 --- a/tools/metrics/histograms/metadata/side_search/histograms.xml +++ b/tools/metrics/histograms/metadata/side_search/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="SideSearch.AvailabilityChanged" - enum="SideSearchAvailabilityChangeType" expires_after="2022-09-29"> + enum="SideSearchAvailabilityChangeType" expires_after="2022-12-04"> <owner>yuhengh@chromium.org</owner> <owner>tluk@chromium.org</owner> <owner>romanarora@chromium.org</owner> @@ -35,7 +35,7 @@ </histogram> <histogram name="SideSearch.CloseAction" enum="SideSearchCloseActionType" - expires_after="2022-09-29"> + expires_after="2022-12-04"> <owner>yuhengh@chromium.org</owner> <owner>tluk@chromium.org</owner> <owner>romanarora@chromium.org</owner> @@ -70,7 +70,7 @@ </histogram> <histogram name="SideSearch.Navigation" enum="SideSearchNavigationType" - expires_after="2022-09-29"> + expires_after="2022-12-04"> <owner>yuhengh@chromium.org</owner> <owner>tluk@chromium.org</owner> <owner>romanarora@chromium.org</owner> @@ -82,7 +82,7 @@ </histogram> <histogram name="SideSearch.NavigationCommittedWithinSideSearchCountPerJourney" - units="navigations" expires_after="2022-09-29"> + units="navigations" expires_after="2022-12-04"> <owner>yuhengh@chromium.org</owner> <owner>tluk@chromium.org</owner> <owner>romanarora@chromium.org</owner> @@ -94,7 +94,7 @@ </histogram> <histogram name="SideSearch.OpenAction" enum="SideSearchOpenActionType" - expires_after="2022-09-29"> + expires_after="2022-12-04"> <owner>yuhengh@chromium.org</owner> <owner>tluk@chromium.org</owner> <owner>romanarora@chromium.org</owner> @@ -116,7 +116,7 @@ </histogram> <histogram name="SideSearch.RedirectionToTabCountPerJourney" - units="navigations" expires_after="2022-09-29"> + units="navigations" expires_after="2022-12-04"> <owner>yuhengh@chromium.org</owner> <owner>tluk@chromium.org</owner> <owner>romanarora@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/software/histograms.xml b/tools/metrics/histograms/metadata/software/histograms.xml index 9d46e34..ac47ff3 100644 --- a/tools/metrics/histograms/metadata/software/histograms.xml +++ b/tools/metrics/histograms/metadata/software/histograms.xml
@@ -223,7 +223,7 @@ </histogram> <histogram name="SoftwareReporter.MemoryUsed" units="KB" - expires_after="2022-10-02"> + expires_after="2022-12-04"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/startup/histograms.xml b/tools/metrics/histograms/metadata/startup/histograms.xml index 1d0ae66..94e581c 100644 --- a/tools/metrics/histograms/metadata/startup/histograms.xml +++ b/tools/metrics/histograms/metadata/startup/histograms.xml
@@ -601,7 +601,7 @@ </histogram> <histogram name="Startup.ConsecutiveLoadsWithoutLaunch" units="count" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>olivierrobin@chromium.org</owner> <owner>ajuma@chromium.org</owner> <summary> @@ -899,7 +899,7 @@ </histogram> <histogram name="Startup.TimeFromProcessCreationToDidFinishLaunchingCall" - units="ms" expires_after="2022-09-30"> + units="ms" expires_after="2022-12-04"> <owner>olivierrobin@chromium.org</owner> <owner>ajuma@chromium.org</owner> <summary> @@ -910,7 +910,7 @@ </histogram> <histogram name="Startup.TimeFromProcessCreationToLoad" units="ms" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>olivierrobin@chromium.org</owner> <owner>ajuma@chromium.org</owner> <summary> @@ -920,7 +920,7 @@ </histogram> <histogram name="Startup.TimeFromProcessCreationToMainCall" units="ms" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>olivierrobin@chromium.org</owner> <owner>ajuma@chromium.org</owner> <summary> @@ -930,7 +930,7 @@ </histogram> <histogram name="Startup.TimeFromProcessCreationToSceneConnection" units="ms" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>olivierrobin@chromium.org</owner> <owner>ajuma@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/storage/histograms.xml b/tools/metrics/histograms/metadata/storage/histograms.xml index 554920f..01a1457 100644 --- a/tools/metrics/histograms/metadata/storage/histograms.xml +++ b/tools/metrics/histograms/metadata/storage/histograms.xml
@@ -148,7 +148,7 @@ </histogram> <histogram name="LevelDBEnv.DeleteTableBackupFile" enum="BooleanSuccess" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>cmumford@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary> @@ -176,7 +176,7 @@ </histogram> <histogram name="LevelDBWrapper.CommitDelay" units="ms" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>mek@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/sync/histograms.xml b/tools/metrics/histograms/metadata/sync/histograms.xml index 49f4401..5f5b1e91 100644 --- a/tools/metrics/histograms/metadata/sync/histograms.xml +++ b/tools/metrics/histograms/metadata/sync/histograms.xml
@@ -582,7 +582,7 @@ </histogram> <histogram name="Sync.ModelTypeCommitWithDepletedQuota" enum="SyncModelTypes" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>rushans@google.com</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component> @@ -1138,7 +1138,7 @@ </histogram> <histogram name="Sync.TrustedVaultAddKeysAttemptIsSuccessful" enum="Boolean" - expires_after="2022-09-25"> + expires_after="2022-12-04"> <owner>mmoskvitin@google.com</owner> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> @@ -1262,7 +1262,7 @@ </histogram> <histogram name="Sync.TypedURLDatabaseError" enum="SyncTypedUrlDatabaseError" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>mastiz@chromium.org</owner> <component>Services>Sync</component> <summary> @@ -1273,7 +1273,7 @@ </histogram> <histogram name="Sync.URLFetchResponse" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2022-10-02"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2022-12-04"> <owner>mastiz@chromium.org</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component> @@ -1285,7 +1285,7 @@ </histogram> <histogram name="Sync.URLFetchTimedOut" enum="BooleanTimedOut" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>mastiz@chromium.org</owner> <owner>treib@chromium.org</owner> <component>Services>Sync</component>
diff --git a/tools/metrics/histograms/metadata/tab/histograms.xml b/tools/metrics/histograms/metadata/tab/histograms.xml index 4097711d..a9038a3 100644 --- a/tools/metrics/histograms/metadata/tab/histograms.xml +++ b/tools/metrics/histograms/metadata/tab/histograms.xml
@@ -1964,7 +1964,7 @@ </histogram> <histogram name="Tabs.RecentlyClosed.HistoricalSaverCloseType" - enum="HistoricalSaverCloseType" expires_after="2022-10-01"> + enum="HistoricalSaverCloseType" expires_after="2022-12-04"> <owner>ckitagawa@chromium.org</owner> <owner>fredmello@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/translate/histograms.xml b/tools/metrics/histograms/metadata/translate/histograms.xml index 2c1555f..09817b0 100644 --- a/tools/metrics/histograms/metadata/translate/histograms.xml +++ b/tools/metrics/histograms/metadata/translate/histograms.xml
@@ -121,7 +121,7 @@ </histogram> <histogram name="Translate.CLD3.LanguageDetected" enum="LocaleCodeISO639" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>megjablon@google.com</owner> <owner>chrome-language@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/uma/histograms.xml b/tools/metrics/histograms/metadata/uma/histograms.xml index bd543b5..0805e58 100644 --- a/tools/metrics/histograms/metadata/uma/histograms.xml +++ b/tools/metrics/histograms/metadata/uma/histograms.xml
@@ -80,7 +80,7 @@ </histogram> <histogram name="UMA.ActualLogUploadInterval" units="minutes" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -195,7 +195,7 @@ </histogram> <histogram name="UMA.ClientIdBackupRecoveredWithAge" units="hours" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -206,7 +206,7 @@ </summary> </histogram> -<histogram name="UMA.ClientIdCleared" enum="Boolean" expires_after="2022-10-04"> +<histogram name="UMA.ClientIdCleared" enum="Boolean" expires_after="2022-12-04"> <owner>pdyson@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -216,14 +216,14 @@ </histogram> <histogram name="UMA.ClientIdSource" enum="ClientIdSource" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>pdyson@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary>The source of the client id when its creation is forced.</summary> </histogram> <histogram name="UMA.CrosPerUser.DaemonStoreWriteFailed" - enum="PerUserDaemonStoreFail" expires_after="2022-10-01"> + enum="PerUserDaemonStoreFail" expires_after="2022-12-04"> <owner>jongahn@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -308,7 +308,7 @@ </histogram> <histogram name="UMA.FileMetricsProvider.AccessResult" - enum="FileMetricsProviderAccessResult" expires_after="2022-10-04"> + enum="FileMetricsProviderAccessResult" expires_after="2022-12-04"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -327,7 +327,7 @@ </histogram> <histogram name="UMA.InitSequence" enum="UmaInitSequence" - expires_after="2022-10-02"> + expires_after="2022-12-04"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -340,7 +340,7 @@ </histogram> <histogram name="UMA.IsClonedInstall" enum="BooleanCloned" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -420,7 +420,7 @@ </summary> </histogram> -<histogram name="UMA.LogSize.OnSuccess" units="KB" expires_after="2022-10-02"> +<histogram name="UMA.LogSize.OnSuccess" units="KB" expires_after="2022-12-04"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -444,7 +444,7 @@ </histogram> <histogram name="UMA.LogUpload.ResponseOrErrorCode" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2022-10-02"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2022-12-04"> <owner>holte@chromium.org</owner> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> @@ -466,7 +466,7 @@ </histogram> <histogram name="UMA.LowEntropySource3Value" units="units" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>asvitkine@chromium.org</owner> <owner>mpearson@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> @@ -491,7 +491,7 @@ </histogram> <histogram name="UMA.MachineIdState" enum="UmaMachineIdState" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jwd@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -503,7 +503,7 @@ </histogram> <histogram name="UMA.MetricsIDsReset" enum="BooleanHit" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jwd@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -529,7 +529,7 @@ </histogram> <histogram name="UMA.MetricsService.Initialize.Time" units="microseconds" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -591,7 +591,7 @@ </histogram> <histogram name="UMA.PersistentHistograms.InitResult" - enum="PersistentHistogramsInitResult" expires_after="2022-10-02"> + enum="PersistentHistogramsInitResult" expires_after="2022-12-04"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -601,7 +601,7 @@ </histogram> <histogram name="UMA.PrimaryUserType" enum="UserType" - expires_after="2022-10-02"> + expires_after="2022-12-04"> <owner>michaelpg@chromium.org</owner> <owner>yilkal@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> @@ -708,7 +708,7 @@ </histogram> <histogram name="UMA.ProtoCompressionRatio" units="%" - expires_after="2022-10-02"> + expires_after="2022-12-04"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -743,7 +743,7 @@ </histogram> <histogram name="UMA.SamplingRatePerMille" units="samples per mille" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jwd@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -771,7 +771,7 @@ </histogram> <histogram name="UMA.Startup.LocalStateFileExistence" enum="BooleanExists" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>caitlinfischer@google.com</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -803,7 +803,7 @@ </histogram> <histogram name="UMA.StructuredMetrics.EventsRecordedBeforeInit" units="count" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>jongahn@chromium.org</owner> <owner>tby@chromium.org</owner> <summary> @@ -867,7 +867,7 @@ </histogram> <histogram name="UMA.TruncatedEvents.UserAction" units="events" - expires_after="2022-11-27"> + expires_after="2022-12-04"> <owner>rkaplow@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -877,7 +877,7 @@ </histogram> <histogram name="UMA.UnsentLogs.Dropped" units="units" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>holte@chromium.org</owner> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> @@ -887,7 +887,7 @@ </histogram> <histogram name="UMA.UnsentLogs.DroppedSize" units="bytes" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>akirabaruah@chromium.org</owner> <owner>rkaplow@chromium.org</owner> <owner>asvitkine@chromium.org</owner> @@ -979,7 +979,7 @@ </histogram> <histogram name="UMA.UserDemographics.Status" enum="UserDemographicsStatus" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>rogerm@google.com</owner> <owner>src/base/metrics/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/v8/histograms.xml b/tools/metrics/histograms/metadata/v8/histograms.xml index dbde1584..c93664f7 100644 --- a/tools/metrics/histograms/metadata/v8/histograms.xml +++ b/tools/metrics/histograms/metadata/v8/histograms.xml
@@ -42,7 +42,7 @@ </histogram> <histogram name="V8.CagedMemoryAllocationOutcome" - enum="V8CagedMemoryAllocationOutcome" expires_after="2022-09-30"> + enum="V8CagedMemoryAllocationOutcome" expires_after="2022-12-04"> <owner>saelo@chromium.org</owner> <owner>ishell@chromium.org</owner> <summary> @@ -94,7 +94,7 @@ </histogram> <histogram name="V8.CompileDeserializeMicroSeconds" units="microseconds" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>vogelheim@chromium.org</owner> <summary> Time spent deseriailzing code, used by V8 code caching. @@ -1616,7 +1616,7 @@ </histogram> <histogram name="V8.VirtualMemoryCageMode" enum="V8VirtualMemoryCageMode" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>saelo@chromium.org</owner> <owner>ishell@chromium.org</owner> <summary> @@ -1632,7 +1632,7 @@ </histogram> <histogram name="V8.VirtualMemoryCageSizeGB" units="GB" - expires_after="2022-09-30"> + expires_after="2022-12-04"> <owner>saelo@chromium.org</owner> <owner>ishell@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/web_apk/histograms.xml b/tools/metrics/histograms/metadata/web_apk/histograms.xml index 787b1ef..fe4e5ee 100644 --- a/tools/metrics/histograms/metadata/web_apk/histograms.xml +++ b/tools/metrics/histograms/metadata/web_apk/histograms.xml
@@ -177,7 +177,7 @@ </histogram> <histogram name="WebApk.Notification.Permission.Status" - enum="BooleanWebApkNotificationPermission" expires_after="2022-10-04"> + enum="BooleanWebApkNotificationPermission" expires_after="2022-12-04"> <owner>hartmanng@chromium.org</owner> <owner> src/chrome/android/java/src/org/chromium/chrome/browser/webapps/OWNERS @@ -250,7 +250,7 @@ </histogram> <histogram name="WebApk.Startup.Cold.ShellLaunchToSplashscreenVisible" - units="ms" expires_after="2022-10-02"> + units="ms" expires_after="2022-12-04"> <owner>mheikal@chromium.org</owner> <owner>yfriedman@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/web_core/histograms.xml b/tools/metrics/histograms/metadata/web_core/histograms.xml index 53f1037..dd85769 100644 --- a/tools/metrics/histograms/metadata/web_core/histograms.xml +++ b/tools/metrics/histograms/metadata/web_core/histograms.xml
@@ -328,7 +328,7 @@ </histogram> <histogram name="WebCore.IndexedDB.FoundBlobFileForValue" enum="Boolean" - expires_after="2022-10-04"> + expires_after="2022-12-04"> <owner>enne@chromium.org</owner> <owner>mek@chromium.org</owner> <owner>storage-dev@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/web_rtc/histograms.xml b/tools/metrics/histograms/metadata/web_rtc/histograms.xml index 603e4c7..6afaf1f 100644 --- a/tools/metrics/histograms/metadata/web_rtc/histograms.xml +++ b/tools/metrics/histograms/metadata/web_rtc/histograms.xml
@@ -304,7 +304,7 @@ </histogram> <histogram name="WebRTC.Audio.ApmAnalogGainDecreaseAverage" units="level" - expires_after="2022-10-05"> + expires_after="2022-12-04"> <owner>silen@chromium.org</owner> <owner>alessiob@chromium.org</owner> <summary> @@ -315,7 +315,7 @@ </histogram> <histogram name="WebRTC.Audio.ApmAnalogGainDecreaseRate" units="changes/minute" - expires_after="2022-10-05"> + expires_after="2022-12-04"> <owner>silen@chromium.org</owner> <owner>alessiob@chromium.org</owner> <summary> @@ -326,7 +326,7 @@ </histogram> <histogram name="WebRTC.Audio.ApmAnalogGainIncreaseAverage" units="level" - expires_after="2022-10-05"> + expires_after="2022-12-04"> <owner>silen@chromium.org</owner> <owner>alessiob@chromium.org</owner> <summary> @@ -348,7 +348,7 @@ </histogram> <histogram name="WebRTC.Audio.ApmAnalogGainUpdateAverage" units="level" - expires_after="2022-10-05"> + expires_after="2022-12-04"> <owner>silen@chromium.org</owner> <owner>alessiob@chromium.org</owner> <summary> @@ -359,7 +359,7 @@ </histogram> <histogram name="WebRTC.Audio.ApmAnalogGainUpdateRate" units="changes/minute" - expires_after="2022-10-05"> + expires_after="2022-12-04"> <owner>silen@chromium.org</owner> <owner>alessiob@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/webapps/histograms.xml b/tools/metrics/histograms/metadata/webapps/histograms.xml index 07b43ff..db63f03a 100644 --- a/tools/metrics/histograms/metadata/webapps/histograms.xml +++ b/tools/metrics/histograms/metadata/webapps/histograms.xml
@@ -23,7 +23,7 @@ <histograms> <histogram name="AppBanners.BeforeInstallEvent" - enum="AppBannersBeforeInstallEvent" expires_after="2022-10-04"> + enum="AppBannersBeforeInstallEvent" expires_after="2022-12-04"> <owner>dominickn@chromium.org</owner> <owner>pjmclachlan@google.com</owner> <owner>desktop-pwas-team@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/windows/histograms.xml b/tools/metrics/histograms/metadata/windows/histograms.xml index 3140e92..e6a216b 100644 --- a/tools/metrics/histograms/metadata/windows/histograms.xml +++ b/tools/metrics/histograms/metadata/windows/histograms.xml
@@ -218,7 +218,7 @@ </histogram> <histogram name="Windows.OnCurrentWorkspaceCached" enum="BooleanCacheHit" - expires_after="2022-10-01"> + expires_after="2022-12-04"> <owner>davidbienvenu@chromium.org</owner> <owner>sky@chromium.org</owner> <summary>
diff --git a/tools/metrics/ukm/ukm.xml b/tools/metrics/ukm/ukm.xml index a88ef7b..acc0926 100644 --- a/tools/metrics/ukm/ukm.xml +++ b/tools/metrics/ukm/ukm.xml
@@ -9299,9 +9299,10 @@ </event> <event name="Identifiability"> - <owner>asanka@chromium.org</owner> - <owner>pauljensen@chromium.org</owner> + <owner>antoniosartori@chromium.org</owner> <owner>caraitto@chromium.org</owner> + <owner>mkwst@chromium.org</owner> + <owner>pauljensen@chromium.org</owner> <summary> Identifiability metrics are used to measure the diversity of web clients as observed by individual web sites. @@ -16653,6 +16654,24 @@ UMA. </summary> </metric> + <metric name="InteractiveTiming.FirstInputDelay4"> + <summary> + The duration between the hardware timestamp and the start of event + processing on the main thread for the first meaningful input. Recorded on + the prerender activation. + </summary> + </metric> + <metric + name="LayoutInstability.MaxCumulativeShiftScore.SessionWindow.Gap1000ms.Max5000ms"> + <summary> + Measures the maximum cumulative layout shift (bit.ly/cls-explainer) that + has occurred on the prerendered page that is successfully activated in a + session window. The gap between two consecutive shifts in a window is not + bigger than 1000ms and the maximum window size is 5000ms. This metric's + integral value is 100x the fractional cumulative layout shift score + described in the explainer. + </summary> + </metric> <metric name="Timing.ActivationToFirstContentfulPaint"> <summary> The duration in milliseconds from time of activation navigation start to
diff --git a/tools/style_variable_generator/base_generator.py b/tools/style_variable_generator/base_generator.py index 052ea1f..dacd1fd 100644 --- a/tools/style_variable_generator/base_generator.py +++ b/tools/style_variable_generator/base_generator.py
@@ -62,7 +62,7 @@ with open(path, 'r') as f: self.AddJSONToModel(f.read(), path) except ValueError as err: - raise ValueError('\n%s:\n %s' % (path, err)) + raise ValueError(f'Could not add {path}') from err self.model.PostProcess() @@ -79,6 +79,7 @@ object_pairs_hook=collections.OrderedDict) context = data.get('options', {}) + context['token_namespace'] = data.get('token_namespace', '') self.in_file_to_context[in_file] = context # Add variables to the model.
diff --git a/tools/style_variable_generator/color.py b/tools/style_variable_generator/color.py index dc2f1fc..feaaad61 100755 --- a/tools/style_variable_generator/color.py +++ b/tools/style_variable_generator/color.py
@@ -87,9 +87,10 @@ return False def _ParseRGBRef(self, rgb_ref): - match = re.match('^\$([a-z0-9_]+)\.rgb$', rgb_ref) + match = re.match(r'^\$([a-z0-9_\.\-]+)\.rgb$', rgb_ref) if not match: - raise ValueError('Expected a reference to an RGB variable') + raise ValueError( + f'Expected a reference to an RGB variable: {rgb_ref}') rgb_var = match.group(1) @@ -102,7 +103,7 @@ def Parse(self, value): def ParseHex(value): - match = re.match('^#([0-9a-f]*)$', value) + match = re.match(r'^#([0-9a-f]*)$', value) if not match: return False @@ -116,7 +117,7 @@ return True def ParseRGB(value): - match = re.match('^rgb\((.*)\)$', value) + match = re.match(r'^rgb\((.*)\)$', value) if not match: return False @@ -135,7 +136,7 @@ 'rgb() expected to have either 1 reference or 3 ints') def ParseRGBA(value): - match = re.match('^rgba\((.*)\)$', value) + match = re.match(r'^rgba\((.*)\)$', value) if not match: return False @@ -154,7 +155,7 @@ '1 reference + alpha, or 3 ints + alpha') def ParseBlend(value): - match = re.match('^blend\((.*)\)$', value) + match = re.match(r'^blend\((.*)\)$', value) if not match: return False @@ -167,7 +168,7 @@ raise ValueError('blend() expected to have 2 colors') def ParseVariableReference(value): - match = re.match('^\$([\w\d_]+)$', value) + match = re.match(r'^\$([\w\d_\.\-]+)$', value) if not match: return False
diff --git a/tools/style_variable_generator/css_generator.py b/tools/style_variable_generator/css_generator.py index 47c741ec..20162f90 100644 --- a/tools/style_variable_generator/css_generator.py +++ b/tools/style_variable_generator/css_generator.py
@@ -120,7 +120,10 @@ return prefix + '-' if prefix else '' def ToCSSVarName(self, name): - return '--%s%s' % (self._GetCSSVarPrefix(name), name.replace('_', '-')) + # This handles old_semantic_names as well as new.token-names. + var_name = name.translate(str.maketrans('-_.', '_--')) + + return '--%s%s' % (self._GetCSSVarPrefix(name), var_name) def _CSSOpacity(self, opacity): if opacity.var:
diff --git a/tools/style_variable_generator/model.py b/tools/style_variable_generator/model.py index df3f9129c..b1b3611 100644 --- a/tools/style_variable_generator/model.py +++ b/tools/style_variable_generator/model.py
@@ -38,7 +38,7 @@ ''' def __init__(self, variable_type, name, json_value, context): - if not re.match('^[a-z0-9_]+$', name): + if not re.match(r'^[a-z0-9_\.\-]+$', name): raise ValueError(name + ' is not a valid variable name ' + '(lower case, 0-9, _)') self.variable_type = variable_type @@ -302,17 +302,25 @@ '''Adds a new variable to the submodel for |variable_type|. ''' try: - added = self.submodels[variable_type].Add(name, value_obj, context) + full_name = self.FullTokenName(name, context) + added = self.submodels[variable_type].Add(full_name, value_obj, + context) except ValueError as err: raise ValueError( - f'Error parsing {variable_type} "{name}": {value_obj}\n {err}' - ) + f'Error parsing {variable_type} "{full_name}": {value_obj}' + ) from err for var in added: if var.name in self.variable_map: raise ValueError('Variable name "%s" is reused' % name) self.variable_map[var.name] = var + def FullTokenName(self, name, context): + namespace = context['token_namespace'] + if namespace: + return f'{namespace}.{name}' + return name + def PostProcess(self): '''Called after all variables have been added to perform operations that require a complete worldview.
diff --git a/tools/style_variable_generator/opacity.py b/tools/style_variable_generator/opacity.py index cc4c93e3..a3f70e6 100644 --- a/tools/style_variable_generator/opacity.py +++ b/tools/style_variable_generator/opacity.py
@@ -24,7 +24,7 @@ def Parse(self, value): if isinstance(value, str): - match = re.match('^\$([a-z0-9_]+_opacity)$', value) + match = re.match(r'^\$([a-z0-9_\-\.]+)$', value) if match: self.var = match.group(1) return
diff --git a/tools/style_variable_generator/tests/colors_ref_tokens_test.json5 b/tools/style_variable_generator/tests/colors_ref_tokens_test.json5 new file mode 100644 index 0000000..14f1bceb --- /dev/null +++ b/tools/style_variable_generator/tests/colors_ref_tokens_test.json5
@@ -0,0 +1,6 @@ +{ + token_namespace: 'cros.ref', + colors: { + primary50: "#202124", + }, +}
diff --git a/tools/style_variable_generator/tests/colors_sys_tokens_test.json5 b/tools/style_variable_generator/tests/colors_sys_tokens_test.json5 new file mode 100644 index 0000000..82b36e66 --- /dev/null +++ b/tools/style_variable_generator/tests/colors_sys_tokens_test.json5
@@ -0,0 +1,29 @@ +{ + token_namespace: 'cros.sys', + colors: { + /* Primary */ + primary: { + light: '$cros.ref.primary50', + dark: 'rgba($black.rgb, 0.5)', + }, + 'on-primary': { + light: '$white', + dark: '$cros.ref.primary50', + }, + 'primary-container': { + light: "rgba($cros.ref.primary50.rgb, 0.1)", + dark: "rgba($cros.ref.primary50.rgb, $cros.sys.disabled-opacity)", + }, + 'on-primary-container': { + light: "$white", + dark: "blend(rgba($white.rgb, 0.04), $cros.ref.primary50)", + }, + }, + opacities: { + 'disabled-opacity': 0.38, + 'reference-opacity': { + light: '$cros.sys.disabled-opacity', + dark: 1, + }, + }, +}
diff --git a/tools/style_variable_generator/tests/goldens/colors_tokens_test_expected.cc.generated b/tools/style_variable_generator/tests/goldens/colors_tokens_test_expected.cc.generated new file mode 100644 index 0000000..4d2ed428 --- /dev/null +++ b/tools/style_variable_generator/tests/goldens/colors_tokens_test_expected.cc.generated
@@ -0,0 +1,89 @@ +// 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. + +// This file is generated from: +// tests/colors_ref_tokens_test.json5 +// tests/colors_sys_tokens_test.json5 + +#include "tools/style_variable_generator/colors_test_expected.h" + +#include "third_party/abseil-cpp/absl/types/optional.h" +#include "third_party/skia/include/core/SkColor.h" + +namespace colors_test_expected { + +bool g_dark_mode_enabled = false; +bool g_debug_colors_enabled = false; + +bool DarkModeEnabled() { + return g_dark_mode_enabled; +} + +bool DebugColorsEnabled() { + return g_debug_colors_enabled; +} + +void SetDarkModeEnabled(bool enabled) { + g_dark_mode_enabled = enabled; +} + +void SetDebugColorsEnabled(bool enabled) { + g_debug_colors_enabled = enabled; +} + +SkAlpha GetOpacity(OpacityName opacity_name, bool is_dark_mode) { + switch (opacity_name) { + case OpacityName::kCrosSysDisabledOpacity: + return 0x60; + case OpacityName::kCrosSysReferenceOpacity: + if (is_dark_mode) { + return 0xFF; + } else { + return GetOpacity(OpacityName::kCrosSysDisabledOpacity, is_dark_mode); + } + } +} + +absl::optional<SkColor> GetDebugColor(ColorName color_name, bool is_dark_mode) { + switch (color_name) { + default: + return absl::nullopt; + } +} + +SkColor ResolveColor(ColorName color_name, + bool is_dark_mode, + bool use_debug_colors) { + if (use_debug_colors) { + auto debug_color = GetDebugColor(color_name, is_dark_mode); + if (debug_color) { + return *debug_color; + } + } + switch (color_name) { + case ColorName::kCrosRefPrimary50: + return SkColorSetRGB(0x20, 0x21, 0x24); + case ColorName::kCrosSysPrimary: + if (is_dark_mode) + return SkColorSetARGB(0x7F, 0x0, 0x0, 0x0); + return ResolveColor(ColorName::kCrosRefPrimary50, is_dark_mode); + case ColorName::kCrosSysOnPrimary: + if (is_dark_mode) + return ResolveColor(ColorName::kCrosRefPrimary50, is_dark_mode); + return SkColorSetRGB(0xFF, 0xFF, 0xFF); + case ColorName::kCrosSysPrimaryContainer: + if (is_dark_mode) + return SkColorSetA(ResolveColor(ColorName::kCrosRefPrimary50, is_dark_mode), GetOpacity(OpacityName::kCrosSysDisabledOpacity, is_dark_mode)); + return SkColorSetA(ResolveColor(ColorName::kCrosRefPrimary50, is_dark_mode), 0x19); + case ColorName::kCrosSysOnPrimaryContainer: + if (is_dark_mode) + return SkColorSetRGB(0x29, 0x2A, 0x2D); + return SkColorSetRGB(0xFF, 0xFF, 0xFF); + } +} + +char kDebugOverrideCssString[] = "html:not(body) {\n" + "}\n"; + +} // namespace colors_test_expected
diff --git a/tools/style_variable_generator/tests/goldens/colors_tokens_test_expected.css b/tools/style_variable_generator/tests/goldens/colors_tokens_test_expected.css new file mode 100644 index 0000000..ea6b156 --- /dev/null +++ b/tools/style_variable_generator/tests/goldens/colors_tokens_test_expected.css
@@ -0,0 +1,50 @@ +/* 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. */ + +/* This file is generated from: + * tests/colors_ref_tokens_test.json5 + * tests/colors_sys_tokens_test.json5 + */ +:root { + color-scheme: light dark; +} + +html:not(body) { + --cros-ref-primary50-rgb: 32, 33, 36; + --cros-ref-primary50: rgb(var(--cros-ref-primary50-rgb)); + + --cros-sys-primary-rgb: var(--cros-ref-primary50-rgb); + --cros-sys-primary: var(--cros-ref-primary50); + + --cros-sys-on_primary-rgb: 255, 255, 255; + --cros-sys-on_primary: rgb(var(--cros-sys-on_primary-rgb)); + + --cros-sys-primary_container-rgb: var(--cros-ref-primary50-rgb); + --cros-sys-primary_container: rgba(var(--cros-sys-primary_container-rgb), 0.1); + + --cros-sys-on_primary_container-rgb: 255, 255, 255; + --cros-sys-on_primary_container: rgb(var(--cros-sys-on_primary_container-rgb)); + + --cros-sys-disabled_opacity: 0.38; + + --cros-sys-reference_opacity: var(--cros-sys-disabled_opacity); +} + +@media (prefers-color-scheme: dark) { +html:not(body) { + --cros-sys-primary-rgb: 0, 0, 0; + --cros-sys-primary: rgba(var(--cros-sys-primary-rgb), 0.5); + + --cros-sys-on_primary-rgb: var(--cros-ref-primary50-rgb); + --cros-sys-on_primary: var(--cros-ref-primary50); + + --cros-sys-primary_container-rgb: var(--cros-ref-primary50-rgb); + --cros-sys-primary_container: rgba(var(--cros-sys-primary_container-rgb), var(--cros-sys-disabled_opacity)); + + --cros-sys-on_primary_container-rgb: 41, 42, 45; + --cros-sys-on_primary_container: rgb(var(--cros-sys-on_primary_container-rgb)); + + --cros-sys-reference_opacity: 1; +} +}
diff --git a/tools/style_variable_generator/tests/goldens/colors_tokens_test_expected.h.generated b/tools/style_variable_generator/tests/goldens/colors_tokens_test_expected.h.generated new file mode 100644 index 0000000..03d40b6 --- /dev/null +++ b/tools/style_variable_generator/tests/goldens/colors_tokens_test_expected.h.generated
@@ -0,0 +1,47 @@ +// 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. + +// This file is generated from: +// tests/colors_ref_tokens_test.json5 +// tests/colors_sys_tokens_test.json5 + +#ifndef NONE_ +#define NONE_ + +#include "base/component_export.h" +#include "third_party/skia/include/core/SkColor.h" + +namespace None { + +COMPONENT_EXPORT(None) bool DarkModeEnabled(); +COMPONENT_EXPORT(None) bool DebugColorsEnabled(); +COMPONENT_EXPORT(None) void SetDarkModeEnabled(bool enabled); +COMPONENT_EXPORT(None) void SetDebugColorsEnabled(bool enabled); + +enum class ColorName { + kCrosRefPrimary50, + kCrosSysPrimary, + kCrosSysOnPrimary, + kCrosSysPrimaryContainer, + kCrosSysOnPrimaryContainer, +}; + +enum class OpacityName { + kCrosSysDisabledOpacity, + kCrosSysReferenceOpacity, +}; + +COMPONENT_EXPORT(None) SkAlpha GetOpacity( + OpacityName opacity_name, + bool is_dark_mode = DarkModeEnabled()); + +COMPONENT_EXPORT(None) SkColor ResolveColor( + ColorName color_name, + bool is_dark_mode = DarkModeEnabled(), + bool use_debug_colors = DebugColorsEnabled()); + +COMPONENT_EXPORT(None) extern char kDebugOverrideCssString[]; + +} // namespace None +#endif // NONE_
diff --git a/tools/style_variable_generator/tests/goldens/colors_tokens_test_expected.ts b/tools/style_variable_generator/tests/goldens/colors_tokens_test_expected.ts new file mode 100644 index 0000000..763fa48 --- /dev/null +++ b/tools/style_variable_generator/tests/goldens/colors_tokens_test_expected.ts
@@ -0,0 +1,18 @@ +/* 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 file is generated from: + * tests/colors_ref_tokens_test.json5 + * tests/colors_sys_tokens_test.json5 + */ + +import {css} from 'lit'; + +export const CROS_REF_PRIMARY50 = css`var(--cros-ref-primary50)`; +export const CROS_SYS_PRIMARY = css`var(--cros-sys-primary)`; +export const CROS_SYS_ON_PRIMARY = css`var(--cros-sys-on_primary)`; +export const CROS_SYS_PRIMARY_CONTAINER = css`var(--cros-sys-primary_container)`; +export const CROS_SYS_ON_PRIMARY_CONTAINER = css`var(--cros-sys-on_primary_container)`; +export const CROS_SYS_DISABLED_OPACITY = css`var(--cros-sys-disabled_opacity)`; +export const CROS_SYS_REFERENCE_OPACITY = css`var(--cros-sys-reference_opacity)`;
diff --git a/tools/style_variable_generator/tests/style_variable_generator_test.py b/tools/style_variable_generator/tests/style_variable_generator_test.py index 4b9f1d7..773a19f 100755 --- a/tools/style_variable_generator/tests/style_variable_generator_test.py +++ b/tools/style_variable_generator/tests/style_variable_generator_test.py
@@ -48,6 +48,12 @@ ['colors_test_palette.json5', 'colors_test.json5']) self.expected_output_file = 'colors_test_expected.h.generated' + def testTokenStyleNames(self): + self.generator = ViewsHStyleGenerator() + self.AddJSONFilesToModel( + ['colors_ref_tokens_test.json5', 'colors_sys_tokens_test.json5']) + self.expected_output_file = 'colors_tokens_test_expected.h.generated' + class ViewsStyleCCGeneratorTest(unittest.TestCase, BaseStyleGeneratorTest): def setUp(self): @@ -56,6 +62,12 @@ ['colors_test_palette.json5', 'colors_test.json5']) self.expected_output_file = 'colors_test_expected.cc.generated' + def testTokenStyleNames(self): + self.generator = ViewsCCStyleGenerator() + self.AddJSONFilesToModel( + ['colors_ref_tokens_test.json5', 'colors_sys_tokens_test.json5']) + self.expected_output_file = 'colors_tokens_test_expected.cc.generated' + class CSSStyleGeneratorTest(unittest.TestCase, BaseStyleGeneratorTest): def setUp(self): @@ -100,6 +112,13 @@ expected_file_name = 'suppress_sources_comment_test_expected.css' self.assertEqualToFile(self.generator.Render(), expected_file_name) + def testTokenStyleNames(self): + self.generator = CSSStyleGenerator() + self.AddJSONFilesToModel( + ['colors_ref_tokens_test.json5', 'colors_sys_tokens_test.json5']) + expected_file_name = 'colors_tokens_test_expected.css' + self.assertEqualToFile(self.generator.Render(), expected_file_name) + class TSStyleGeneratorTest(unittest.TestCase, BaseStyleGeneratorTest): def setUp(self): @@ -138,6 +157,13 @@ expected_file_name = 'suppress_sources_comment_test_expected.ts' self.assertEqualToFile(self.generator.Render(), expected_file_name) + def testTokenStyleNames(self): + self.generator = TSStyleGenerator() + self.AddJSONFilesToModel( + ['colors_ref_tokens_test.json5', 'colors_sys_tokens_test.json5']) + expected_file_name = 'colors_tokens_test_expected.ts' + self.assertEqualToFile(self.generator.Render(), expected_file_name) + class ProtoStyleGeneratorTest(unittest.TestCase, BaseStyleGeneratorTest): def setUp(self):
diff --git a/tools/style_variable_generator/ts_generator.py b/tools/style_variable_generator/ts_generator.py index 9858d8d4..217ada6 100644 --- a/tools/style_variable_generator/ts_generator.py +++ b/tools/style_variable_generator/ts_generator.py
@@ -2,9 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import re from style_variable_generator.css_generator import CSSStyleGenerator - class TSStyleGenerator(CSSStyleGenerator): '''Generator for TS Variables''' @@ -28,4 +28,4 @@ return filters def ToTSVarName(self, model_name): - return model_name.upper() + return re.sub(r'[\.\-]', '_', model_name.upper())
diff --git a/tools/style_variable_generator/views_generator.py b/tools/style_variable_generator/views_generator.py index 68b187c..be4feff5 100644 --- a/tools/style_variable_generator/views_generator.py +++ b/tools/style_variable_generator/views_generator.py
@@ -59,7 +59,7 @@ return color_list def _ToConstName(self, var_name): - return 'k%s' % var_name.title().replace('_', '') + return 'k%s' % re.sub(r'[_\-\.]', '', var_name.title()) def _AlphaToHex(self, opacity): return '0x%X' % math.floor(opacity.a * 255)
diff --git a/ui/accessibility/ax_tree.h b/ui/accessibility/ax_tree.h index 7ef983cc..5bf1e1b 100644 --- a/ui/accessibility/ax_tree.h +++ b/ui/accessibility/ax_tree.h
@@ -496,7 +496,7 @@ const ScopedTreeUpdateInProgressStateSetter&) = delete; private: - AXTree* const tree_; + const raw_ptr<AXTree> tree_; bool last_tree_update_in_progress_; };
diff --git a/ui/aura/screen_ozone.cc b/ui/aura/screen_ozone.cc index d133110..a78a6a4 100644 --- a/ui/aura/screen_ozone.cc +++ b/ui/aura/screen_ozone.cc
@@ -13,10 +13,13 @@ namespace aura { -ScreenOzone::ScreenOzone() = default; +ScreenOzone::ScreenOzone() { + DCHECK(!display::Screen::HasScreen()); + display::Screen::SetScreenInstance(this); +} ScreenOzone::~ScreenOzone() { - display::Screen::SetScreenInstance(old_screen_); + display::Screen::SetScreenInstance(nullptr); } void ScreenOzone::Initialize() { @@ -34,6 +37,11 @@ } } +// static +bool ScreenOzone::IsOzoneInitialized() { + return ui::OzonePlatform::IsInitialized(); +} + gfx::Point ScreenOzone::GetCursorScreenPoint() { return platform_screen_->GetCursorScreenPoint(); } @@ -149,4 +157,17 @@ void ScreenOzone::OnBeforePlatformScreenInit() {} +ScopedScreenOzone::ScopedScreenOzone(const base::Location& location) + : ScopedNativeScreen(/*call_maybe_init=*/false, location) { + MaybeInit(); +} + +ScopedScreenOzone::~ScopedScreenOzone() = default; + +display::Screen* ScopedScreenOzone::CreateScreen() { + auto* screen = new ScreenOzone(); + screen->Initialize(); + return screen; +} + } // namespace aura
diff --git a/ui/aura/screen_ozone.h b/ui/aura/screen_ozone.h index 980c083b..2970a0e 100644 --- a/ui/aura/screen_ozone.h +++ b/ui/aura/screen_ozone.h
@@ -60,6 +60,8 @@ virtual gfx::NativeWindow GetNativeWindowFromAcceleratedWidget( gfx::AcceleratedWidget widget) const; + static bool IsOzoneInitialized(); + protected: ui::PlatformScreen* platform_screen() { return platform_screen_.get(); } @@ -73,10 +75,22 @@ virtual void OnBeforePlatformScreenInit(); - display::Screen* const old_screen_ = display::Screen::SetScreenInstance(this); std::unique_ptr<ui::PlatformScreen> platform_screen_; }; +// ScopedScreenOzone creates a ScreenOzone instead of NativeScreen +// (created by `CreateNativeScreen()`) if the screen hasn't been set. +class AURA_EXPORT ScopedScreenOzone : public display::ScopedNativeScreen { + public: + explicit ScopedScreenOzone(const base::Location& location = FROM_HERE); + ScopedScreenOzone(const ScopedScreenOzone&) = delete; + ScopedScreenOzone operator=(const ScopedScreenOzone&) = delete; + ~ScopedScreenOzone() override; + + private: + display::Screen* CreateScreen() override; +}; + } // namespace aura #endif // UI_AURA_SCREEN_OZONE_H_
diff --git a/ui/base/resource/data_pack.h b/ui/base/resource/data_pack.h index 00e7a40..9107928 100644 --- a/ui/base/resource/data_pack.h +++ b/ui/base/resource/data_pack.h
@@ -104,8 +104,8 @@ void UpdateResourceData(); const uint8_t* data_source_; - ResourceData* resource_data_; - const Entry* entry_; + raw_ptr<ResourceData> resource_data_; + raw_ptr<const Entry> entry_; }; Iterator begin() const;
diff --git a/ui/base/test/cocoa_helper.h b/ui/base/test/cocoa_helper.h index 4ec09b1..c9030fe 100644 --- a/ui/base/test/cocoa_helper.h +++ b/ui/base/test/cocoa_helper.h
@@ -13,6 +13,7 @@ #import "base/mac/scoped_nsobject.h" #import "base/strings/sys_string_conversions.h" #include "testing/platform_test.h" +#include "ui/display/screen.h" // CocoaTestHelperWindow behaves differently from a regular NSWindow in the // following ways: @@ -74,6 +75,8 @@ CocoaTestHelperWindow* test_window(); private: + display::ScopedNativeScreen screen_; + // Return a set of currently open windows. Avoiding NSArray so // contents aren't retained, the pointer values can only be used for // comparison purposes. Using std::set to make progress-checking
diff --git a/ui/base/ui_base_features.cc b/ui/base/ui_base_features.cc index 35a4838..d45fc0a 100644 --- a/ui/base/ui_base_features.cc +++ b/ui/base/ui_base_features.cc
@@ -95,6 +95,10 @@ "LacrosResourcesFileSharing", base::FEATURE_DISABLED_BY_DEFAULT}; #endif // BUILDFLAG(IS_CHROMEOS_ASH) +// Enable or disable multitouch for virtual keyboard on ChromeOS. +const base::Feature kVirtualKeyboardMultitouch{ + "VirtualKeyboardMultitouch", base::FEATURE_DISABLED_BY_DEFAULT}; + // Update of the virtual keyboard settings UI as described in // https://crbug.com/876901. const base::Feature kInputMethodSettingsUiUpdate = {
diff --git a/ui/base/ui_base_features.h b/ui/base/ui_base_features.h index a5d86c3..de987b6 100644 --- a/ui/base/ui_base_features.h +++ b/ui/base/ui_base_features.h
@@ -38,6 +38,8 @@ extern const base::Feature kSystemKeyboardLock; COMPONENT_EXPORT(UI_BASE_FEATURES) extern const base::Feature kUiCompositorScrollWithLayers; +COMPONENT_EXPORT(UI_BASE_FEATURES) +extern const base::Feature kVirtualKeyboardMultitouch; COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsUiGpuRasterizationEnabled();
diff --git a/ui/color/color_provider_manager.cc b/ui/color/color_provider_manager.cc index fd2f2537..8718e88 100644 --- a/ui/color/color_provider_manager.cc +++ b/ui/color/color_provider_manager.cc
@@ -46,6 +46,10 @@ ColorProviderManager::InitializerSupplier::~InitializerSupplier() = default; +ColorProviderManager::ThemeInitializerSupplier::ThemeInitializerSupplier( + ThemeType theme_type) + : theme_type_(theme_type) {} + ColorProviderManager::Key::Key() : Key(ColorMode::kLight, ContrastMode::kNormal,
diff --git a/ui/color/color_provider_manager.h b/ui/color/color_provider_manager.h index 03556fc3..58b3cc2 100644 --- a/ui/color/color_provider_manager.h +++ b/ui/color/color_provider_manager.h
@@ -79,16 +79,29 @@ : public InitializerSupplier, public base::RefCountedThreadSafe<ThemeInitializerSupplier> { public: + enum class ThemeType { + kExtension, + kAutogenerated, + kIncreasedContrast, + kNativeX11, + }; + + explicit ThemeInitializerSupplier(ThemeType theme_type); + virtual bool GetColor(int id, SkColor* color) const = 0; virtual bool GetTint(int id, color_utils::HSL* hsl) const = 0; virtual bool GetDisplayProperty(int id, int* result) const = 0; virtual bool HasCustomImage(int id) const = 0; + ThemeType get_theme_type() const { return theme_type_; } + protected: ~ThemeInitializerSupplier() override = default; private: friend class base::RefCountedThreadSafe<ThemeInitializerSupplier>; + + ThemeType theme_type_; }; struct COMPONENT_EXPORT(COLOR) Key {
diff --git a/ui/compositor/presentation_time_recorder.cc b/ui/compositor/presentation_time_recorder.cc index 739ab60e..6b2a8b5d9 100644 --- a/ui/compositor/presentation_time_recorder.cc +++ b/ui/compositor/presentation_time_recorder.cc
@@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/logging.h" #include "base/memory/ptr_util.h" +#include "base/memory/raw_ptr.h" #include "ui/gfx/presentation_feedback.h" namespace ui { @@ -127,7 +128,7 @@ int total_latency_ms_ = 0; int max_latency_ms_ = 0; - ui::Compositor* compositor_ = nullptr; + raw_ptr<ui::Compositor> compositor_ = nullptr; bool recording_ = true; base::WeakPtrFactory<PresentationTimeRecorderInternal> weak_ptr_factory_{ @@ -269,7 +270,7 @@ } private: - base::HistogramBase* presentation_time_histogram_; + raw_ptr<base::HistogramBase> presentation_time_histogram_; std::string max_latency_histogram_name_; };
diff --git a/ui/compositor/presentation_time_recorder.h b/ui/compositor/presentation_time_recorder.h index bfdd594..750ba4cc 100644 --- a/ui/compositor/presentation_time_recorder.h +++ b/ui/compositor/presentation_time_recorder.h
@@ -6,6 +6,7 @@ #define UI_COMPOSITOR_PRESENTATION_TIME_RECORDER_H_ #include "base/gtest_prod_util.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/metrics/histogram_macros.h" #include "base/time/time.h" @@ -40,7 +41,7 @@ int GetFailureRatio() const; private: - PresentationTimeRecorder* recorder_; + raw_ptr<PresentationTimeRecorder> recorder_; }; explicit PresentationTimeRecorder(
diff --git a/ui/display/display_list.h b/ui/display/display_list.h index 2eb14bc..4c90bea3 100644 --- a/ui/display/display_list.h +++ b/ui/display/display_list.h
@@ -71,6 +71,9 @@ bool IsValid() const; base::ObserverList<DisplayObserver>* observers() { return &observers_; } + const base::ObserverList<DisplayObserver>* observers() const { + return &observers_; + } private: // A non-const version of FindDisplayById.
diff --git a/ui/display/screen.cc b/ui/display/screen.cc index 2225ae6..b972388 100644 --- a/ui/display/screen.cc +++ b/ui/display/screen.cc
@@ -31,8 +31,7 @@ // static Screen* Screen::GetScreen() { -#if BUILDFLAG(IS_APPLE) - // TODO(scottmg): https://crbug.com/558054 +#if BUILDFLAG(IS_IOS) if (!g_screen) g_screen = CreateNativeScreen(); #endif @@ -40,10 +39,23 @@ } // static -Screen* Screen::SetScreenInstance(Screen* instance) { +Screen* Screen::SetScreenInstance(Screen* instance, + const base::Location& location) { + // Do not allow screen instance override. The screen object has a lot of + // states, such as current display settings as well as observers, and safely + // transferring these to new screen implementation is very difficult and not + // safe. If you hit the DCHECK in a test, please look for other examples that + // that set a test screen instance in the setup process. + DCHECK(!g_screen || !instance || (instance && instance->shutdown_)) + << "fail=" << location.ToString(); return std::exchange(g_screen, instance); } +// static +bool Screen::HasScreen() { + return !!g_screen; +} + void Screen::SetCursorScreenPointForTesting(const gfx::Point& point) { NOTIMPLEMENTED_LOG_ONCE(); } @@ -213,4 +225,49 @@ return result; } +#if !BUILDFLAG(IS_ANDROID) + +ScopedNativeScreen::ScopedNativeScreen(const base::Location& location) { + MaybeInit(location); +} + +ScopedNativeScreen::ScopedNativeScreen(bool call_maybe_init, + const base::Location& location) { + if (call_maybe_init) + MaybeInit(location); +} + +ScopedNativeScreen::~ScopedNativeScreen() { + Shutdown(); +} + +void ScopedNativeScreen::MaybeInit(const base::Location& location) { + maybe_init_called_ = true; + if (!Screen::HasScreen()) { +#if BUILDFLAG(IS_IOS) + Screen::GetScreen(); +#else + screen_ = base::WrapUnique(CreateScreen()); + // ScreenOzone and DesktopScreenWin sets the instance by itself. + if (Screen::GetScreen() != screen_.get()) + Screen::SetScreenInstance(screen_.get(), location); +#endif + } +} + +void ScopedNativeScreen::Shutdown() { + DCHECK(maybe_init_called_); + if (screen_) { + DCHECK_EQ(screen_.get(), Screen::GetScreen()); + Screen::SetScreenInstance(nullptr); + screen_.reset(); + } +} + +Screen* ScopedNativeScreen::CreateScreen() { + return CreateNativeScreen(); +} + +#endif + } // namespace display
diff --git a/ui/display/screen.h b/ui/display/screen.h index 3771a345..a86c5b6 100644 --- a/ui/display/screen.h +++ b/ui/display/screen.h
@@ -9,8 +9,9 @@ #include <set> #include <vector> +#include "base/location.h" #include "base/values.h" -#include "build/chromeos_buildflags.h" +#include "build/build_config.h" #include "ui/display/display.h" #include "ui/display/display_export.h" #include "ui/display/screen_infos.h" @@ -47,13 +48,20 @@ virtual ~Screen(); - // Retrieves the single Screen object; this may be null (e.g. in some tests). + // Retrieves the single Screen object; this may be null if it's not already + // created, except for IOS where it creates a native screen instance + // automatically. static Screen* GetScreen(); + // Returns whether a Screen singleton exists or not. + static bool HasScreen(); + + // [Deprecated] as a public method. Do not use this. // Sets the global screen. Returns the previously installed screen, if any. // NOTE: this does not take ownership of |screen|. Tests must be sure to reset // any state they install. - static Screen* SetScreenInstance(Screen* instance); + static Screen* SetScreenInstance(Screen* instance, + const base::Location& location = FROM_HERE); // Returns the current absolute position of the mouse pointer. virtual gfx::Point GetCursorScreenPoint() = 0; @@ -198,6 +206,8 @@ virtual bool SetScreenSaverSuspended(bool suspend); #endif // BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) + void set_shutdown(bool shutdown) { shutdown_ = shutdown; } + private: friend class ScopedDisplayForNewWindows; @@ -208,6 +218,9 @@ static gfx::NativeWindow GetWindowForView(gfx::NativeView view); + // A flag indicates that the instance is a special one used during shutdown. + bool shutdown_ = false; + int64_t display_id_for_new_windows_; int64_t scoped_display_id_for_new_windows_ = display::kInvalidDisplayId; @@ -216,7 +229,41 @@ #endif // BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX) }; -Screen* CreateNativeScreen(); +// TODO(crbug.com/1317416): Make this static private member of +// ScopedNativeScreen. +DISPLAY_EXPORT Screen* CreateNativeScreen(); + +// Android does not have `CreateNativeScreen()`. +#if !BUILDFLAG(IS_ANDROID) + +// ScopedNativeScreen creates a native screen if there is no screen created yet +// (e.g. by a unit test). +class DISPLAY_EXPORT ScopedNativeScreen { + public: + explicit ScopedNativeScreen(const base::Location& location = FROM_HERE); + ScopedNativeScreen(const ScopedNativeScreen&) = delete; + ScopedNativeScreen& operator=(const ScopedNativeScreen&) = delete; + virtual ~ScopedNativeScreen(); + + // Create and initialize the screen instance if the screen instance does not + // exist yet. + void MaybeInit(const base::Location& location = FROM_HERE); + void Shutdown(); + + Screen* screen() { return screen_.get(); } + + virtual Screen* CreateScreen(); + + protected: + explicit ScopedNativeScreen(bool call_maybe_init, + const base::Location& location = FROM_HERE); + + private: + bool maybe_init_called_{false}; + std::unique_ptr<Screen> screen_; +}; + +#endif } // namespace display
diff --git a/ui/display/screen_base.cc b/ui/display/screen_base.cc index 03d89f0..2e9e375 100644 --- a/ui/display/screen_base.cc +++ b/ui/display/screen_base.cc
@@ -75,6 +75,10 @@ display_list_.RemoveObserver(observer); } +bool ScreenBase::HasDisplayObservers() const { + return !display_list_.observers()->empty(); +} + void ScreenBase::SetPanelRotationForTesting(int64_t display_id, Display::Rotation rotation) { Display display = *display_list_.FindDisplayById(display_id);
diff --git a/ui/display/screen_base.h b/ui/display/screen_base.h index 1b63863..ef3f7013 100644 --- a/ui/display/screen_base.h +++ b/ui/display/screen_base.h
@@ -45,6 +45,8 @@ void SetPanelRotationForTesting(int64_t display_id, Display::Rotation rotation) override; + bool HasDisplayObservers() const; + protected: // Invoked when a display changed in some way, including being added. // If |is_primary| is true, |changed_display| is the primary display.
diff --git a/ui/display/test/scoped_screen_override.h b/ui/display/test/scoped_screen_override.h index 0ba1c31..aba5307f 100644 --- a/ui/display/test/scoped_screen_override.h +++ b/ui/display/test/scoped_screen_override.h
@@ -11,6 +11,8 @@ namespace test { +// [Deprecated] Do not use this in new code. +// // This class represents a RAII wrapper for global screen overriding. An object // of this class restores original display::Screen instance when it goes out of // scope. Prefer to use it instead of directly call of
diff --git a/ui/display/test/test_screen.cc b/ui/display/test/test_screen.cc index e2ae5bb5..af96e29 100644 --- a/ui/display/test/test_screen.cc +++ b/ui/display/test/test_screen.cc
@@ -10,18 +10,33 @@ namespace display { namespace test { +namespace { +TestScreen* test_screen = nullptr; +} // static constexpr gfx::Rect TestScreen::kDefaultScreenBounds; TestScreen::TestScreen(bool create_display) { + DCHECK(!test_screen); + test_screen = this; + if (!create_display) return; Display display(1, kDefaultScreenBounds); ProcessDisplayChanged(display, /* is_primary = */ true); } -TestScreen::~TestScreen() {} +TestScreen::~TestScreen() { + DCHECK_EQ(test_screen, this); + test_screen = nullptr; +} + +// static +TestScreen* TestScreen::Get() { + DCHECK_EQ(Screen::GetScreen(), test_screen); + return test_screen; +} void TestScreen::set_cursor_screen_point(const gfx::Point& point) { cursor_screen_point_ = point;
diff --git a/ui/display/test/test_screen.h b/ui/display/test/test_screen.h index ff7fe07..9962e07 100644 --- a/ui/display/test/test_screen.h +++ b/ui/display/test/test_screen.h
@@ -21,6 +21,8 @@ public: static constexpr gfx::Rect kDefaultScreenBounds = gfx::Rect(0, 0, 800, 600); + static TestScreen* Get(); + // TODO(weili): Split this into a protected no-argument constructor for // subclass uses and the public one with gfx::Size argument. explicit TestScreen(bool create_display = true);
diff --git a/ui/display/win/test/scoped_screen_win.cc b/ui/display/win/test/scoped_screen_win.cc index 84c1b4ca..edb39b8c 100644 --- a/ui/display/win/test/scoped_screen_win.cc +++ b/ui/display/win/test/scoped_screen_win.cc
@@ -20,10 +20,6 @@ gfx::Vector2dF(96.0, 96.0), DISPLAYCONFIG_OUTPUT_TECHNOLOGY_OTHER}}); } -ScopedScreenWin::~ScopedScreenWin() { - Screen::SetScreenInstance(old_screen_); -} - } // namespace test } // namespace win } // namespace display
diff --git a/ui/display/win/test/scoped_screen_win.h b/ui/display/win/test/scoped_screen_win.h index ca6cb2c..0633d2e 100644 --- a/ui/display/win/test/scoped_screen_win.h +++ b/ui/display/win/test/scoped_screen_win.h
@@ -12,6 +12,10 @@ namespace win { namespace test { +// [Deprecated] +// TODO(crbug.com/1317416): The initialization code of this class should be +// moved to the test that depends on it. +// // ScopedScreenWin construct a instance of ScreenWinDisplay with bounds // (1920,1080). This will allow unittests to query the details about ScreenWin // using static methods. ScopedScreenWin needs to be initialized before running @@ -23,10 +27,7 @@ ScopedScreenWin(const ScopedScreenWin&) = delete; ScopedScreenWin& operator=(const ScopedScreenWin&) = delete; - ~ScopedScreenWin() override; - - private: - raw_ptr<Screen> old_screen_ = Screen::SetScreenInstance(this); + ~ScopedScreenWin() override = default; }; } // namespace test
diff --git a/ui/events/ozone/evdev/device_event_dispatcher_evdev.h b/ui/events/ozone/evdev/device_event_dispatcher_evdev.h index ec84afe..0b4f26a 100644 --- a/ui/events/ozone/evdev/device_event_dispatcher_evdev.h +++ b/ui/events/ozone/evdev/device_event_dispatcher_evdev.h
@@ -196,7 +196,8 @@ // Device lifecycle events. virtual void DispatchKeyboardDevicesUpdated( - const std::vector<InputDevice>& devices) = 0; + const std::vector<InputDevice>& devices, + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) = 0; virtual void DispatchTouchscreenDevicesUpdated( const std::vector<TouchscreenDevice>& devices) = 0; virtual void DispatchMouseDevicesUpdated(
diff --git a/ui/events/ozone/evdev/event_converter_evdev.cc b/ui/events/ozone/evdev/event_converter_evdev.cc index d63905f..a5bf680 100644 --- a/ui/events/ozone/evdev/event_converter_evdev.cc +++ b/ui/events/ozone/evdev/event_converter_evdev.cc
@@ -245,6 +245,10 @@ void EventConverterEvdev::SetReceivedValidInputCallback( ReceivedValidInputCallback callback) {} +std::vector<uint64_t> EventConverterEvdev::GetKeyboardKeyBits() const { + return std::vector<uint64_t>(); +} + base::TimeTicks EventConverterEvdev::TimeTicksFromInputEvent( const input_event& event) { base::TimeTicks timestamp =
diff --git a/ui/events/ozone/evdev/event_converter_evdev.h b/ui/events/ozone/evdev/event_converter_evdev.h index d607811..8c9ee75 100644 --- a/ui/events/ozone/evdev/event_converter_evdev.h +++ b/ui/events/ozone/evdev/event_converter_evdev.h
@@ -190,6 +190,9 @@ virtual void SetReceivedValidInputCallback( ReceivedValidInputCallback callback); + // Returns supported key bits of the keyboard. + virtual std::vector<uint64_t> GetKeyboardKeyBits() const; + // Helper to generate a base::TimeTicks from an input_event's time static base::TimeTicks TimeTicksFromInputEvent(const input_event& event);
diff --git a/ui/events/ozone/evdev/event_converter_evdev_impl.cc b/ui/events/ozone/evdev/event_converter_evdev_impl.cc index 7eaaa48..60835c6 100644 --- a/ui/events/ozone/evdev/event_converter_evdev_impl.cc +++ b/ui/events/ozone/evdev/event_converter_evdev_impl.cc
@@ -65,6 +65,14 @@ if (has_numberpad_) NumberpadMetricsRecorder::GetInstance()->AddDevice(input_device_); #endif + // Converts unsigned long to uint64_t. + const auto key_bits = devinfo.GetKeyBits(); + key_bits_.resize(key_bits.size()); + for (int i = 0; i < KEY_CNT; i++) { + if (EvdevBitIsSet(key_bits.data(), i)) { + EvdevSetUint64Bit(key_bits_.data(), i); + } + } } EventConverterEvdevImpl::~EventConverterEvdevImpl() { @@ -141,6 +149,10 @@ ReleaseMouseButtons(); } +std::vector<uint64_t> EventConverterEvdevImpl::GetKeyboardKeyBits() const { + return key_bits_; +} + ui::StylusState EventConverterEvdevImpl::GetStylusSwitchState() { if (!HasStylusSwitch()) { return ui::StylusState::REMOVED;
diff --git a/ui/events/ozone/evdev/event_converter_evdev_impl.h b/ui/events/ozone/evdev/event_converter_evdev_impl.h index f277e27..12c4e37 100644 --- a/ui/events/ozone/evdev/event_converter_evdev_impl.h +++ b/ui/events/ozone/evdev/event_converter_evdev_impl.h
@@ -54,6 +54,7 @@ void SetKeyFilter(bool enable_filter, std::vector<DomCode> allowed_keys) override; void OnDisabled() override; + std::vector<uint64_t> GetKeyboardKeyBits() const override; void ProcessEvents(const struct input_event* inputs, int count); @@ -127,6 +128,9 @@ // Callback to update keyboard devices when valid input is received. ReceivedValidInputCallback received_valid_input_callback_; + + // Supported keyboard key bits. + std::vector<uint64_t> key_bits_; }; } // namespace ui
diff --git a/ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc b/ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc index ec9a214..0ceac82f 100644 --- a/ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc +++ b/ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc
@@ -18,6 +18,7 @@ #include "ui/events/keycodes/keyboard_codes.h" #include "ui/events/ozone/device/device_manager.h" #include "ui/events/ozone/evdev/event_converter_test_util.h" +#include "ui/events/ozone/evdev/event_device_test_util.h" #include "ui/events/ozone/evdev/event_factory_evdev.h" #include "ui/events/ozone/evdev/keyboard_evdev.h" #include "ui/events/ozone/evdev/testing/fake_cursor_delegate_evdev.h" @@ -31,12 +32,13 @@ class MockEventConverterEvdevImpl : public EventConverterEvdevImpl { public: MockEventConverterEvdevImpl(base::ScopedFD fd, + const ui::EventDeviceInfo& info, CursorDelegateEvdev* cursor, DeviceEventDispatcherEvdev* dispatcher) : EventConverterEvdevImpl(std::move(fd), base::FilePath(kTestDevicePath), 1, - EventDeviceInfo(), + info, cursor, dispatcher) { SetEnabled(true); @@ -65,7 +67,16 @@ delete; // Overridden from testing::Test: - void SetUp() override { + void SetUp() override { SetUpDevice(ui::EventDeviceInfo()); } + + void TearDown() override { + device_.reset(); + cursor_.reset(); + events_out_.reset(); + test_clock_.reset(); + } + + void SetUpDevice(const ui::EventDeviceInfo& info) { // Set up pipe to satisfy message pump (unused). int evdev_io[2]; if (pipe(evdev_io)) @@ -84,18 +95,10 @@ dispatcher_ = ui::CreateDeviceEventDispatcherEvdevForTest(event_factory_.get()); device_ = std::make_unique<ui::MockEventConverterEvdevImpl>( - std::move(events_in), cursor_.get(), dispatcher_.get()); - + std::move(events_in), info, cursor_.get(), dispatcher_.get()); test_clock_ = std::make_unique<ui::test::ScopedEventTestTickClock>(); } - void TearDown() override { - device_.reset(); - cursor_.reset(); - events_out_.reset(); - test_clock_.reset(); - } - ui::FakeCursorDelegateEvdev* cursor() { return cursor_.get(); } ui::MockEventConverterEvdevImpl* device() { return device_.get(); } @@ -148,6 +151,21 @@ base::ScopedFD events_out_; }; +// Test fixture which defers device set up, tests need to call SetUpDevice(). +class DeferDeviceSetUpEventConverterEvdevImplTest + : public EventConverterEvdevImplTest { + public: + DeferDeviceSetUpEventConverterEvdevImplTest() = default; + + DeferDeviceSetUpEventConverterEvdevImplTest( + const DeferDeviceSetUpEventConverterEvdevImplTest&) = delete; + DeferDeviceSetUpEventConverterEvdevImplTest& operator=( + const DeferDeviceSetUpEventConverterEvdevImplTest&) = delete; + + // Overridden from EventConverterEvdevImplTest: + void SetUp() override {} +}; + TEST_F(EventConverterEvdevImplTest, KeyPress) { ui::MockEventConverterEvdevImpl* dev = device(); @@ -750,3 +768,17 @@ EXPECT_EQ(ui::ET_MOUSE_RELEASED, event->type()); EXPECT_EQ(true, event->IsLeftMouseButton()); } + +TEST_F(DeferDeviceSetUpEventConverterEvdevImplTest, KeyboardHasKeys) { + ui::EventDeviceInfo devinfo; + CapabilitiesToDeviceInfo(ui::kLogitechKeyboardK120, &devinfo); + SetUpDevice(devinfo); + ui::MockEventConverterEvdevImpl* dev = device(); + + const std::vector<uint64_t> key_bits = dev->GetKeyboardKeyBits(); + + // KEY_A should be supported. + EXPECT_TRUE(ui::EvdevBitUint64IsSet(key_bits.data(), 30)); + // BTN_A shouldn't be supported. + EXPECT_FALSE(ui::EvdevBitUint64IsSet(key_bits.data(), 305)); +}
diff --git a/ui/events/ozone/evdev/event_converter_test_util.cc b/ui/events/ozone/evdev/event_converter_test_util.cc index 0c17fa2..604e07d 100644 --- a/ui/events/ozone/evdev/event_converter_test_util.cc +++ b/ui/events/ozone/evdev/event_converter_test_util.cc
@@ -67,8 +67,10 @@ } void DispatchKeyboardDevicesUpdated( - const std::vector<InputDevice>& devices) override { - event_factory_evdev_->DispatchKeyboardDevicesUpdated(devices); + const std::vector<InputDevice>& devices, + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) override { + event_factory_evdev_->DispatchKeyboardDevicesUpdated(devices, + key_bits_mapping); } void DispatchTouchscreenDevicesUpdated( const std::vector<TouchscreenDevice>& devices) override {
diff --git a/ui/events/ozone/evdev/event_device_info.h b/ui/events/ozone/evdev/event_device_info.h index 4bab8ae..090d247a 100644 --- a/ui/events/ozone/evdev/event_device_info.h +++ b/ui/events/ozone/evdev/event_device_info.h
@@ -203,8 +203,7 @@ // The device type (internal or external.) InputDeviceType device_type() const { return device_type_; } - std::array<unsigned long, EVDEV_BITS_TO_LONGS(KEY_CNT)> GetGamepadKeyBits() - const { + std::array<unsigned long, EVDEV_BITS_TO_LONGS(KEY_CNT)> GetKeyBits() const { return key_bits_; }
diff --git a/ui/events/ozone/evdev/event_factory_evdev.cc b/ui/events/ozone/evdev/event_factory_evdev.cc index b1d9f3b..671439ee 100644 --- a/ui/events/ozone/evdev/event_factory_evdev.cc +++ b/ui/events/ozone/evdev/event_factory_evdev.cc
@@ -94,11 +94,13 @@ } void DispatchKeyboardDevicesUpdated( - const std::vector<InputDevice>& devices) override { + const std::vector<InputDevice>& devices, + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) override { ui_thread_runner_->PostTask( FROM_HERE, base::BindOnce(&EventFactoryEvdev::DispatchKeyboardDevicesUpdated, - event_factory_evdev_, devices)); + event_factory_evdev_, devices, + std::move(key_bits_mapping))); } void DispatchTouchscreenDevicesUpdated( const std::vector<TouchscreenDevice>& devices) override { @@ -396,8 +398,10 @@ } void EventFactoryEvdev::DispatchKeyboardDevicesUpdated( - const std::vector<InputDevice>& devices) { + const std::vector<InputDevice>& devices, + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) { TRACE_EVENT0("evdev", "EventFactoryEvdev::DispatchKeyboardDevicesUpdated"); + input_controller_.SetKeyboardKeyBitsMapping(std::move(key_bits_mapping)); DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); observer->OnKeyboardDevicesUpdated(devices); }
diff --git a/ui/events/ozone/evdev/event_factory_evdev.h b/ui/events/ozone/evdev/event_factory_evdev.h index 3d37911..f3980da 100644 --- a/ui/events/ozone/evdev/event_factory_evdev.h +++ b/ui/events/ozone/evdev/event_factory_evdev.h
@@ -78,7 +78,9 @@ void DispatchTouchEvent(const TouchEventParams& params); // Device lifecycle events. - void DispatchKeyboardDevicesUpdated(const std::vector<InputDevice>& devices); + void DispatchKeyboardDevicesUpdated( + const std::vector<InputDevice>& devices, + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping); void DispatchTouchscreenDevicesUpdated( const std::vector<TouchscreenDevice>& devices); void DispatchMouseDevicesUpdated(const std::vector<InputDevice>& devices,
diff --git a/ui/events/ozone/evdev/gamepad_event_converter_evdev.cc b/ui/events/ozone/evdev/gamepad_event_converter_evdev.cc index 96644da..fec1d4fa 100644 --- a/ui/events/ozone/evdev/gamepad_event_converter_evdev.cc +++ b/ui/events/ozone/evdev/gamepad_event_converter_evdev.cc
@@ -59,7 +59,7 @@ } supports_rumble_ = devinfo.SupportsRumble(); // Converts unsigned long to uint64_t. - const auto key_bits = devinfo.GetGamepadKeyBits(); + const auto key_bits = devinfo.GetKeyBits(); key_bits_.resize(key_bits.size()); for (int i = 0; i < KEY_CNT; i++) { if (EvdevBitIsSet(key_bits.data(), i)) {
diff --git a/ui/events/ozone/evdev/input_controller_evdev.cc b/ui/events/ozone/evdev/input_controller_evdev.cc index 8f8a74b..5e42002 100644 --- a/ui/events/ozone/evdev/input_controller_evdev.cc +++ b/ui/events/ozone/evdev/input_controller_evdev.cc
@@ -108,6 +108,18 @@ keyboard_->GetAutoRepeatRate(delay, interval); } +void InputControllerEvdev::SetKeyboardKeyBitsMapping( + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) { + keyboard_key_bits_mapping_ = std::move(key_bits_mapping); +} + +std::vector<uint64_t> InputControllerEvdev::GetKeyboardKeyBits(int id) { + auto key_bits_mapping_iter = keyboard_key_bits_mapping_.find(id); + return key_bits_mapping_iter == keyboard_key_bits_mapping_.end() + ? std::vector<uint64_t>() + : key_bits_mapping_iter->second; +} + void InputControllerEvdev::SetCurrentLayoutByName( const std::string& layout_name) { keyboard_->SetCurrentLayoutByName(layout_name);
diff --git a/ui/events/ozone/evdev/input_controller_evdev.h b/ui/events/ozone/evdev/input_controller_evdev.h index 3ee1608..6aa1b8bd 100644 --- a/ui/events/ozone/evdev/input_controller_evdev.h +++ b/ui/events/ozone/evdev/input_controller_evdev.h
@@ -61,6 +61,9 @@ void GetAutoRepeatRate(base::TimeDelta* delay, base::TimeDelta* interval) override; void SetCurrentLayoutByName(const std::string& layout_name) override; + void SetKeyboardKeyBitsMapping( + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) override; + std::vector<uint64_t> GetKeyboardKeyBits(int id) override; void SetTouchEventLoggingEnabled(bool enabled) override; void SetTouchpadSensitivity(int value) override; void SetTouchpadScrollSensitivity(int value) override; @@ -149,6 +152,9 @@ // Keyboard state. KeyboardEvdev* const keyboard_; + // Keyboard keybits. + base::flat_map<int, std::vector<uint64_t>> keyboard_key_bits_mapping_; + // Mouse button map. MouseButtonMapEvdev* const mouse_button_map_;
diff --git a/ui/events/ozone/evdev/input_device_factory_evdev.cc b/ui/events/ozone/evdev/input_device_factory_evdev.cc index f5111cba..766677af 100644 --- a/ui/events/ozone/evdev/input_device_factory_evdev.cc +++ b/ui/events/ozone/evdev/input_device_factory_evdev.cc
@@ -527,14 +527,16 @@ } void InputDeviceFactoryEvdev::NotifyKeyboardsUpdated() { + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping; std::vector<InputDevice> keyboards; for (auto it = converters_.begin(); it != converters_.end(); ++it) { if (it->second->HasKeyboard()) { keyboards.push_back(InputDevice(it->second->input_device())); + key_bits_mapping[it->second->id()] = it->second->GetKeyboardKeyBits(); } } - - dispatcher_->DispatchKeyboardDevicesUpdated(keyboards); + dispatcher_->DispatchKeyboardDevicesUpdated(keyboards, + std::move(key_bits_mapping)); } void InputDeviceFactoryEvdev::NotifyMouseDevicesUpdated() {
diff --git a/ui/events/ozone/evdev/input_device_factory_evdev_unittest.cc b/ui/events/ozone/evdev/input_device_factory_evdev_unittest.cc index 6cbfacc..a6e97a1bc 100644 --- a/ui/events/ozone/evdev/input_device_factory_evdev_unittest.cc +++ b/ui/events/ozone/evdev/input_device_factory_evdev_unittest.cc
@@ -78,7 +78,8 @@ void DispatchMicrophoneMuteSwitchValueChanged(bool muted) override {} void DispatchKeyboardDevicesUpdated( - const std::vector<InputDevice>& devices) override { + const std::vector<InputDevice>& devices, + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) override { callback_.Run(devices); } void DispatchTouchscreenDevicesUpdated(
diff --git a/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc b/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc index 14cdd16..e79ac42 100644 --- a/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc +++ b/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc
@@ -166,7 +166,8 @@ void DispatchMicrophoneMuteSwitchValueChanged(bool muted) override {} void DispatchKeyboardDevicesUpdated( - const std::vector<InputDevice>& devices) override {} + const std::vector<InputDevice>& devices, + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) override {} void DispatchTouchscreenDevicesUpdated( const std::vector<TouchscreenDevice>& devices) override {} void DispatchMouseDevicesUpdated(const std::vector<InputDevice>& devices,
diff --git a/ui/file_manager/file_manager/common/js/filtered_volume_manager.js b/ui/file_manager/file_manager/common/js/filtered_volume_manager.js index 90245ad1..d0f2533 100644 --- a/ui/file_manager/file_manager/common/js/filtered_volume_manager.js +++ b/ui/file_manager/file_manager/common/js/filtered_volume_manager.js
@@ -67,6 +67,16 @@ } /** + * Volume types that match the Android 'media-store-files-only' volume filter, + * viz., the volume content is indexed by the Android MediaStore. + * @const !Array<!VolumeManagerCommon.VolumeType> + */ +const MEDIA_STORE_VOLUME_TYPES = [ + VolumeManagerCommon.VolumeType.DOWNLOADS, + VolumeManagerCommon.VolumeType.REMOVABLE, +]; + +/** * Thin wrapper for VolumeManager. This should be an interface proxy to talk * to VolumeManager. This class also filters some "disallowed" volumes; * for example, Drive volumes are dropped if Drive is disabled, and read-only @@ -179,6 +189,17 @@ } /** + * True if the volume content is indexed by the Android MediaStore. + * + * @param {!VolumeInfo} volumeInfo + * @return {boolean} + * @private + */ + isMediaStoreVolume(volumeInfo) { + return MEDIA_STORE_VOLUME_TYPES.indexOf(volumeInfo.volumeType) >= 0; + } + + /** * Checks if a volume is allowed. * * @param {!VolumeInfo} volumeInfo @@ -194,13 +215,17 @@ return false; } - // If the volume type is supported by fusebox, we have to decide whether - // to use the fusebox or non-fusebox version in the UI. + // If the media store filter is enabled and the volume is not supported + // by the Android MediaStore, remove the volume from the UI. + if (this.isMediaStoreOnly_ && !this.isMediaStoreVolume(volumeInfo)) { + return false; + } + // If the volume type is supported by fusebox, decide whether to show + // fusebox or non-fusebox volumes in the UI. if (this.isFuseBoxDebugEnabled_) { - // Do nothing (code-wise), which means that we don't filter out any - // volumes. This makes us show both fusebox and non-fusebox versions in - // the UI, which aids manually testing fusebox. + // Do nothing: show the fusebox and non-fusebox versions in the files + // app UI. Used for manually testing fusebox. } else if (this.isFuseBoxOnly_) { // SelectFileAsh requires native volumes. Note: DocumentsProvider and // FSPs return false here, until they are implemented in the fusebox. @@ -303,9 +328,10 @@ } break; case VolumeManagerCommon.ARCHIVE_OPENED_EVENT_TYPE: - this.dispatchEvent(new CustomEvent( - VolumeManagerCommon.ARCHIVE_OPENED_EVENT_TYPE, - {detail: event.detail})); + if (this.getVolumeInfo(event.detail.mountPoint)) { + this.dispatchEvent( + new CustomEvent(event.type, {detail: event.detail})); + } break; } }
diff --git a/ui/file_manager/file_manager/common/js/filtered_volume_manager_unittest.m.js b/ui/file_manager/file_manager/common/js/filtered_volume_manager_unittest.m.js index c04d7c0..a94ee2d 100644 --- a/ui/file_manager/file_manager/common/js/filtered_volume_manager_unittest.m.js +++ b/ui/file_manager/file_manager/common/js/filtered_volume_manager_unittest.m.js
@@ -91,6 +91,9 @@ // Check: getFuseBoxOnlyFilterEnabled should return false. assertFalse(filteredVolumeManager.getFuseBoxOnlyFilterEnabled()); + // Check: getMediaStoreFilesOnlyFilterEnabled should return false. + assertFalse(filteredVolumeManager.getMediaStoreFilesOnlyFilterEnabled()); + // Check: filteredVolumeManager.volumeInfoList should have 4 volumes. assertEquals(4, filteredVolumeManager.volumeInfoList.length); @@ -166,8 +169,8 @@ assertEquals(5, volumeManager.volumeInfoList.length); /** - * SelectFileAsh sets ['fusebox-only'] filter: FilteredVolumeManager should - * only show native and fusebox volumes in the files app UI. + * SelectFileAsh (Lacros) ['fusebox-only'] filter: FilteredVolumeManager + * should only show native and fusebox volumes in the files app UI. */ const filteredVolumeManager = new FilteredVolumeManager( AllowedPaths.ANY_PATH_OR_URL, false, Promise.resolve(volumeManager), @@ -177,6 +180,9 @@ // Check: getFuseBoxOnlyFilterEnabled should return true. assertTrue(filteredVolumeManager.getFuseBoxOnlyFilterEnabled()); + // Check: getMediaStoreFilesOnlyFilterEnabled should return false. + assertFalse(filteredVolumeManager.getMediaStoreFilesOnlyFilterEnabled()); + // Check: filteredVolumeManager.volumeInfoList should have 3 volumes. assertEquals(3, filteredVolumeManager.volumeInfoList.length); @@ -203,3 +209,103 @@ done(); }); } + +/** + * Tests FilteredVolumeManager 'media-store-files-only' volume filter. + */ +export function testVolumeMediaStoreFilesOnlyFilter(done) { + // Create mock volume manager. + const volumeManager = createMockVolumeManager(); + + // Get `DRIVE` volume. + const driveVolumeInfo = volumeManager.getCurrentProfileVolumeInfo( + VolumeManagerCommon.VolumeType.DRIVE); + assert(driveVolumeInfo); + + // Get `DOWNLOADS` volume. + const downloadsVolumeInfo = volumeManager.getCurrentProfileVolumeInfo( + VolumeManagerCommon.VolumeType.DOWNLOADS); + assert(downloadsVolumeInfo); + + // Add `ARCHIVE` volume. + const zipArchiveVolumeInfo = MockVolumeManager.createMockVolumeInfo( + VolumeManagerCommon.VolumeType.ARCHIVE, 'zipArchiveVolumeId', + 'zip archive volume', 'zip-archive-volume-path'); + volumeManager.volumeInfoList.add(zipArchiveVolumeInfo); + + // Add `REMOVABLE` volume. + const removableVolumeInfo = MockVolumeManager.createMockVolumeInfo( + VolumeManagerCommon.VolumeType.REMOVABLE, 'removableVolumeId', + 'removable volume', 'removable-volume-path'); + volumeManager.volumeInfoList.add(removableVolumeInfo); + + // Add `MTP` volume. + const mtpVolumeInfo = MockVolumeManager.createMockVolumeInfo( + VolumeManagerCommon.VolumeType.MTP, 'mtpNormalVolumeId', + 'MTP normal volume', 'mtp-path'); + volumeManager.volumeInfoList.add(mtpVolumeInfo); + + // Add `MTP` fusebox volume. + const mtpFuseBoxVolumeInfo = MockVolumeManager.createMockVolumeInfo( + VolumeManagerCommon.VolumeType.MTP, 'mtpFuseBoxVolumeId', + 'MTP fusebox volume', 'fusebox/mtp-path'); + volumeManager.volumeInfoList.add(mtpFuseBoxVolumeInfo); + + // Add `DOCUMENTS_PROVIDER` volume. + const documentsProviderVolumeInfo = MockVolumeManager.createMockVolumeInfo( + VolumeManagerCommon.VolumeType.DOCUMENTS_PROVIDER, 'adpNormalVolumeId', + 'Documents provider normal volume', 'documents-provider-path'); + volumeManager.volumeInfoList.add(documentsProviderVolumeInfo); + + // Add `PROVIDED` volume. + const fspVolumeInfo = MockVolumeManager.createMockVolumeInfo( + VolumeManagerCommon.VolumeType.PROVIDED, 'fspNormalVolumeId', + 'FSP normal volume', 'fsp-provider-path'); + volumeManager.volumeInfoList.add(fspVolumeInfo); + + // Add `PROVIDED` fusebox volume. + const fspFuseBoxVolumeInfo = MockVolumeManager.createMockVolumeInfo( + VolumeManagerCommon.VolumeType.PROVIDED, 'fspFuseBoxVolumeId', + 'FSP fusebox volume', 'fusebox/fsp-provider-path'); + volumeManager.volumeInfoList.add(fspFuseBoxVolumeInfo); + + // Add `SMB` volume. + const smbVolumeInfo = MockVolumeManager.createMockVolumeInfo( + VolumeManagerCommon.VolumeType.SMB, 'smbVolumeId', + 'SMB server message block volume', 'server-message-block-path'); + volumeManager.volumeInfoList.add(smbVolumeInfo); + + // Check: volumeManager.volumeInfoList should have 10 volumes. + assertEquals(10, volumeManager.volumeInfoList.length); + + /** + * ArcSelectFile ['media-store-files-only'] filter: FilteredVolumeManager + * should only allow volumes that are indexed by the Android MediaStore. + */ + const filteredVolumeManager = new FilteredVolumeManager( + AllowedPaths.ANY_PATH_OR_URL, false, Promise.resolve(volumeManager), + ['media-store-files-only']); + + filteredVolumeManager.ensureInitialized(() => { + // Check: getFuseBoxOnlyFilterEnabled should return false. + assertFalse(filteredVolumeManager.getFuseBoxOnlyFilterEnabled()); + + // Check: getMediaStoreFilesOnlyFilterEnabled should return true. + assertTrue(filteredVolumeManager.getMediaStoreFilesOnlyFilterEnabled()); + + // Check: filteredVolumeManager.volumeInfoList should have 2 volumes. + assertEquals(2, filteredVolumeManager.volumeInfoList.length); + + // Get `DOWNLOADS` volume. + let info = filteredVolumeManager.volumeInfoList.item(0); + assert(info, 'volume[0] DOWNLOADS expected'); + assertEquals(VolumeManagerCommon.VolumeType.DOWNLOADS, info.volumeType); + + // Get `REMOVABLE` volume. + info = filteredVolumeManager.volumeInfoList.item(1); + assert(info, 'volume[1] REMOVABLE expected'); + assertEquals(VolumeManagerCommon.VolumeType.REMOVABLE, info.volumeType); + + done(); + }); +}
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager.js b/ui/file_manager/file_manager/foreground/js/file_manager.js index fc7578b..f10b27ff 100644 --- a/ui/file_manager/file_manager/foreground/js/file_manager.js +++ b/ui/file_manager/file_manager/foreground/js/file_manager.js
@@ -1311,15 +1311,18 @@ * @private */ async initDirectoryTree_() { - const directoryTree = /** @type {DirectoryTree} */ - (this.dialogDom_.querySelector('#directory-tree')); + this.navigationUma_ = new NavigationUma(assert(this.volumeManager_)); + const fakeEntriesVisible = this.dialogType !== DialogType.SELECT_SAVEAS_FILE; - this.navigationUma_ = new NavigationUma(assert(this.volumeManager_)); + + const directoryTree = /** @type {DirectoryTree} */ + (this.dialogDom_.querySelector('#directory-tree')); DirectoryTree.decorate( directoryTree, assert(this.directoryModel_), assert(this.volumeManager_), assert(this.metadataModel_), assert(this.fileOperationManager_), fakeEntriesVisible); + directoryTree.dataModel = new NavigationListModel( assert(this.volumeManager_), assert(this.folderShortcutsModel_), fakeEntriesVisible && @@ -1331,6 +1334,20 @@ assert(this.directoryModel_), assert(this.androidAppListModel_)); this.ui_.initDirectoryTree(directoryTree); + + // If 'media-store-files-only' volume filter is enabled, then Android ARC + // SelectFile opened files app to pick files from volumes that are indexed + // by the Android MediaStore. Never add Drive, Crostini, GuestOS, to the + // directory tree in that case: their volume content is not indexed by the + // Android MediaStore, and being indexed there is needed for this Android + // ARC SelectFile MediaStore filter mode to work: crbug.com/1333385 + if (this.volumeManager_.getMediaStoreFilesOnlyFilterEnabled()) { + return; + } + + // Drive add/removes itself from directory tree in onPreferencesChanged_. + // Setup a prefs change listener then call onPreferencesChanged_() to add + // Drive to the directory tree if Drive is enabled by prefs. chrome.fileManagerPrivate.onPreferencesChanged.addListener(() => { this.onPreferencesChanged_(); }); @@ -1360,8 +1377,8 @@ } /** - * Listens for the enable/disable events in order to show/hide - * the 'Linux files' root. + * Listens for the enable and disable events in order to add or remove the + * directory tree 'Linux files' root item. * * @param {chrome.fileManagerPrivate.CrostiniEvent} event * @return {!Promise<void>} @@ -1727,9 +1744,9 @@ } /** - * Refreshes Drive prefs when they change. If Drive has been enabled or - * disabled, add or remove, respectively, the fake Drive item, creating it if - * necessary. + * Add or remove fake Drive item from the directory tree when Drive prefs + * change. If Drive has been enabled by prefs, add the fake Drive item. + * Remove the fake Drive item if Drive has been disabled. */ onPreferencesChanged_() { chrome.fileManagerPrivate.getPreferences(
diff --git a/ui/file_manager/file_manager/foreground/js/file_tasks.js b/ui/file_manager/file_manager/foreground/js/file_tasks.js index 69b82e0..4be957ee 100644 --- a/ui/file_manager/file_manager/foreground/js/file_tasks.js +++ b/ui/file_manager/file_manager/foreground/js/file_tasks.js
@@ -920,31 +920,35 @@ item.type = ProgressItemType.MOUNT_ARCHIVE; item.message = strf('ARCHIVE_MOUNT_MESSAGE', filename); - item.cancelCallback = () => { - this.volumeManager_.cancelMounting(url); + item.cancelCallback = async () => { + // Remove progress panel. + item.state = ProgressItemState.CANCELED; + this.progressCenter_.updateItem(item); + + // Cancel archive mounting. + try { + await this.volumeManager_.cancelMounting(url); + } catch (error) { + console.warn('Cannot cancel archive (redacted):', error); + console.log(`Cannot cancel archive '${url}':`, error); + } }; // Display progress panel. item.state = ProgressItemState.PROGRESSING; this.progressCenter_.updateItem(item); - let wasCancelled = false; - // First time, try without providing a password. try { return await this.volumeManager_.mountArchive(url); } catch (error) { // If error is not about needing a password, propagate it. - if (error === VolumeManagerCommon.VolumeError.CANCELLED) { - wasCancelled = true; - } if (error !== VolumeManagerCommon.VolumeError.NEED_PASSWORD) { throw error; } } finally { // Remove progress panel. - item.state = wasCancelled ? ProgressItemState.CANCELED : - ProgressItemState.COMPLETED; + item.state = ProgressItemState.COMPLETED; this.progressCenter_.updateItem(item); }
diff --git a/ui/gl/delegated_ink_point_renderer_gpu_unittest.cc b/ui/gl/delegated_ink_point_renderer_gpu_unittest.cc index 12d4fe0..d5e1089 100644 --- a/ui/gl/delegated_ink_point_renderer_gpu_unittest.cc +++ b/ui/gl/delegated_ink_point_renderer_gpu_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/time/time.h" #include "testing/gtest/include/gtest/gtest.h" @@ -164,7 +165,7 @@ HWND parent_window_; scoped_refptr<DirectCompositionSurfaceWin> surface_; scoped_refptr<GLContext> context_; - GLDisplay* display_ = nullptr; + raw_ptr<GLDisplay> display_ = nullptr; // Used as a reference when making DelegatedInkMetadatas based on previously // sent points.
diff --git a/ui/gl/direct_composition_surface_win_unittest.cc b/ui/gl/direct_composition_surface_win_unittest.cc index a7b6ec9..879ed3c 100644 --- a/ui/gl/direct_composition_surface_win_unittest.cc +++ b/ui/gl/direct_composition_surface_win_unittest.cc
@@ -8,6 +8,7 @@ #include <wrl/implements.h> #include "base/callback_helpers.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted_memory.h" #include "base/memory/weak_ptr.h" #include "base/run_loop.h" @@ -176,7 +177,7 @@ scoped_refptr<DirectCompositionSurfaceWin> surface_; scoped_refptr<GLContext> context_; base::test::ScopedPowerMonitorTestSource fake_power_monitor_source_; - GLDisplay* display_ = nullptr; + raw_ptr<GLDisplay> display_ = nullptr; }; TEST_F(DirectCompositionSurfaceTest, TestMakeCurrent) {
diff --git a/ui/gl/egl_api_unittest.cc b/ui/gl/egl_api_unittest.cc index 37e9790..b452167 100644 --- a/ui/gl/egl_api_unittest.cc +++ b/ui/gl/egl_api_unittest.cc
@@ -4,6 +4,7 @@ #include <memory> +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gl/gl_display.h" @@ -110,7 +111,7 @@ static const char* fake_extension_string_; static const char* fake_client_extension_string_; - GLDisplayEGL* display_ = nullptr; + raw_ptr<GLDisplayEGL> display_ = nullptr; std::unique_ptr<RealEGLApi> api_; };
diff --git a/ui/gl/generate_bindings.py b/ui/gl/generate_bindings.py index b9760e9..ab5602d 100755 --- a/ui/gl/generate_bindings.py +++ b/ui/gl/generate_bindings.py
@@ -3363,6 +3363,9 @@ 'memcmp(this_bytes, this_bytes + 1, sizeof(*this) - 1) == 0);\n'); file.write('\n') + def BindingsAreAllStatic(api_set_name): + return api_set_name == 'egl' + def WriteFuncBinding(file, known_as, version_name): file.write( ' fn.%sFn = reinterpret_cast<%sProc>(GetGLProcAddress("%s"));\n' % @@ -3371,7 +3374,7 @@ for func in functions: if 'static_binding' in func: WriteFuncBinding(file, func['known_as'], func['static_binding']) - elif set_name == 'egl': + elif BindingsAreAllStatic(set_name): assert len(func['versions']) == 1 version = func['versions'][0] WriteFuncBinding(file, func['known_as'], version['name']) @@ -3468,8 +3471,8 @@ OutputExtensionSettings( 'extensions', sorted(used_client_extensions), - '' if set_name == 'egl' else 'ext.') - if set_name == 'gl' or set_name == 'glx': + '' if BindingsAreAllStatic(set_name) else 'ext.') + if not BindingsAreAllStatic(set_name): OutputExtensionBindings( [ f for f in functions if IsClientExtensionFunc(f) ]) @@ -3487,8 +3490,8 @@ OutputExtensionSettings( 'extensions', sorted(used_extensions), - '' if set_name == 'egl' else 'ext.') - if set_name == 'gl' or set_name == 'glx': + '' if BindingsAreAllStatic(set_name) else 'ext.') + if not BindingsAreAllStatic(set_name): OutputExtensionBindings( [ f for f in functions if not IsClientExtensionFunc(f) ]) file.write('}\n')
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc index 930c8f6..91645a0 100644 --- a/ui/gl/gl_surface_egl.cc +++ b/ui/gl/gl_surface_egl.cc
@@ -17,6 +17,7 @@ #include "base/debug/crash_logging.h" #include "base/lazy_instance.h" #include "base/logging.h" +#include "base/memory/raw_ptr.h" #include "base/metrics/histogram_macros.h" #include "base/scoped_environment_variable_override.h" #include "base/strings/string_number_conversions.h" @@ -255,7 +256,7 @@ private: EGLSurface surface_; - GLDisplayEGL* display_; + raw_ptr<GLDisplayEGL> display_; }; class EGLGpuSwitchingObserver final : public ui::GpuSwitchingObserver { @@ -270,7 +271,7 @@ } private: - GLDisplayEGL* display_ = nullptr; + raw_ptr<GLDisplayEGL> display_ = nullptr; }; std::vector<const char*> GetAttribArrayFromStringVector(
diff --git a/ui/gl/gl_surface_egl.h b/ui/gl/gl_surface_egl.h index 56d276e..8b24400 100644 --- a/ui/gl/gl_surface_egl.h +++ b/ui/gl/gl_surface_egl.h
@@ -5,6 +5,7 @@ #ifndef UI_GL_GL_SURFACE_EGL_H_ #define UI_GL_GL_SURFACE_EGL_H_ +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #if BUILDFLAG(IS_WIN) @@ -80,7 +81,7 @@ EGLConfig config_ = nullptr; GLSurfaceFormat format_; - GLDisplayEGL* display_ = nullptr; + raw_ptr<GLDisplayEGL> display_ = nullptr; private: static void InitializeOneOffCommon(GLDisplayEGL* display);
diff --git a/ui/gl/gl_surface_egl_unittest.cc b/ui/gl/gl_surface_egl_unittest.cc index c27bef3..9bbf088b 100644 --- a/ui/gl/gl_surface_egl_unittest.cc +++ b/ui/gl/gl_surface_egl_unittest.cc
@@ -4,6 +4,7 @@ #include "ui/gl/gl_surface_egl.h" +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -43,7 +44,7 @@ void TearDown() override { GLSurfaceTestSupport::ShutdownGL(display_); } private: - GLDisplay* display_ = nullptr; + raw_ptr<GLDisplay> display_ = nullptr; }; #if !defined(MEMORY_SANITIZER)
diff --git a/ui/gl/gpu_timing_unittest.cc b/ui/gl/gpu_timing_unittest.cc index 096b52e5..4354066 100644 --- a/ui/gl/gpu_timing_unittest.cc +++ b/ui/gl/gpu_timing_unittest.cc
@@ -9,6 +9,7 @@ #include <memory> #include "base/bind.h" +#include "base/memory/raw_ptr.h" #include "base/time/time.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gl/gl_context_stub.h" @@ -86,7 +87,7 @@ scoped_refptr<GLContextStub> context_; scoped_refptr<GLSurfaceStub> surface_; GPUTimingFake gpu_timing_fake_queries_; - GLDisplay* display_ = nullptr; + raw_ptr<GLDisplay> display_ = nullptr; }; TEST_F(GPUTimingTest, FakeTimerTest) {
diff --git a/ui/gl/swap_chain_presenter.cc b/ui/gl/swap_chain_presenter.cc index e9378c7..134c921 100644 --- a/ui/gl/swap_chain_presenter.cc +++ b/ui/gl/swap_chain_presenter.cc
@@ -10,6 +10,7 @@ #include "base/debug/alias.h" #include "base/debug/dump_without_crashing.h" #include "base/feature_list.h" +#include "base/memory/raw_ptr.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/synchronization/waitable_event.h" @@ -203,7 +204,7 @@ struct IntelVpeExt { UINT function; - void* param; + raw_ptr<void> param; }; void ToggleIntelVpSuperResolution(ID3D11VideoContext* video_context,
diff --git a/ui/message_center/views/notification_control_buttons_unittest.cc b/ui/message_center/views/notification_control_buttons_unittest.cc index 8035655..dda253d 100644 --- a/ui/message_center/views/notification_control_buttons_unittest.cc +++ b/ui/message_center/views/notification_control_buttons_unittest.cc
@@ -4,6 +4,7 @@ #include "ui/message_center/views/notification_control_buttons_view.h" +#include "base/memory/raw_ptr.h" #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/color_palette.h" @@ -35,7 +36,7 @@ } private: - NotificationControlButtonsView* buttons_view_ = nullptr; + raw_ptr<NotificationControlButtonsView> buttons_view_ = nullptr; }; } // namespace
diff --git a/ui/ozone/platform/wayland/host/wayland_event_source.cc b/ui/ozone/platform/wayland/host/wayland_event_source.cc index 993979f..a619b69 100644 --- a/ui/ozone/platform/wayland/host/wayland_event_source.cc +++ b/ui/ozone/platform/wayland/host/wayland_event_source.cc
@@ -359,8 +359,10 @@ std::make_unique<TouchFrame>(event, base::NullCallback())); } -void WaylandEventSource::OnTouchReleaseEvent(base::TimeTicks timestamp, - PointerId id) { +void WaylandEventSource::OnTouchReleaseEvent( + base::TimeTicks timestamp, + PointerId id, + EventDispatchPolicy dispatch_policy) { // Make sure this touch point was present before. const auto it = touch_points_.find(id); if (it == touch_points_.end()) { @@ -374,8 +376,17 @@ TouchEvent event(ET_TOUCH_RELEASED, location, location, timestamp, details, keyboard_modifiers_); - DispatchEvent(&event); + if (dispatch_policy == EventDispatchPolicy::kImmediate) { + DispatchEvent(&event); + OnTouchReleaseInternal(id); + } else { + touch_frames_.push_front(std::make_unique<TouchFrame>( + event, base::BindOnce(&WaylandEventSource::OnTouchReleaseInternal, + base::Unretained(this), id))); + } +} +void WaylandEventSource::OnTouchReleaseInternal(PointerId id) { // It is possible that an user interaction triggers nested loops // in higher levels of the application stack in order to process a // given touch down/up action. @@ -384,11 +395,13 @@ // The auxiliary flow might clear entries in touch_points_. // // Hence, we check whether the TouchId is still being held. - if (touch_points_.find(id) == touch_points_.end()) { + const auto it = touch_points_.find(id); + if (it == touch_points_.end()) { LOG(WARNING) << "Touch has been released during processing."; return; } + TouchPoint* touch_point = it->second.get(); HandleTouchFocusChange(touch_point->window, false, id); touch_points_.erase(it);
diff --git a/ui/ozone/platform/wayland/host/wayland_event_source.h b/ui/ozone/platform/wayland/host/wayland_event_source.h index 67e2057..9f6f40d 100644 --- a/ui/ozone/platform/wayland/host/wayland_event_source.h +++ b/ui/ozone/platform/wayland/host/wayland_event_source.h
@@ -122,7 +122,9 @@ base::TimeTicks timestamp, PointerId id, EventDispatchPolicy dispatch_policy) override; - void OnTouchReleaseEvent(base::TimeTicks timestamp, PointerId id) override; + void OnTouchReleaseEvent(base::TimeTicks timestamp, + PointerId id, + EventDispatchPolicy dispatch_policy) override; void OnTouchMotionEvent(const gfx::PointF& location, base::TimeTicks timestamp, PointerId id, @@ -197,6 +199,9 @@ // For touch events. PointerDetails PointerDetailsForDispatching(PointerId pointer_id) const; + // Wrap up method to support async touch release processing. + void OnTouchReleaseInternal(PointerId id); + WaylandWindowManager* const window_manager_; WaylandConnection* const connection_;
diff --git a/ui/ozone/platform/wayland/host/wayland_touch.cc b/ui/ozone/platform/wayland/host/wayland_touch.cc index 4196c7c..2f09d66 100644 --- a/ui/ozone/platform/wayland/host/wayland_touch.cc +++ b/ui/ozone/platform/wayland/host/wayland_touch.cc
@@ -68,7 +68,8 @@ DCHECK(touch); base::TimeTicks timestamp = base::TimeTicks() + base::Milliseconds(time); - touch->delegate_->OnTouchReleaseEvent(timestamp, id); + touch->delegate_->OnTouchReleaseEvent( + timestamp, id, Delegate::EventDispatchPolicy::kOnFrame); } void WaylandTouch::Motion(void* data,
diff --git a/ui/ozone/platform/wayland/host/wayland_touch.h b/ui/ozone/platform/wayland/host/wayland_touch.h index 41751714..4b7b336 100644 --- a/ui/ozone/platform/wayland/host/wayland_touch.h +++ b/ui/ozone/platform/wayland/host/wayland_touch.h
@@ -93,7 +93,9 @@ base::TimeTicks timestamp, PointerId id, EventDispatchPolicy dispatch_policy) = 0; - virtual void OnTouchReleaseEvent(base::TimeTicks timestamp, PointerId id) = 0; + virtual void OnTouchReleaseEvent(base::TimeTicks timestamp, + PointerId id, + EventDispatchPolicy dispatch_policy) = 0; virtual void OnTouchMotionEvent(const gfx::PointF& location, base::TimeTicks timestamp, PointerId id,
diff --git a/ui/ozone/platform/wayland/host/wayland_touch_unittest.cc b/ui/ozone/platform/wayland/host/wayland_touch_unittest.cc index 52845ac..95f5601 100644 --- a/ui/ozone/platform/wayland/host/wayland_touch_unittest.cc +++ b/ui/ozone/platform/wayland/host/wayland_touch_unittest.cc
@@ -93,6 +93,7 @@ CheckEventType(ui::ET_TOUCH_MOVED, event.get()); wl_touch_send_up(touch_->resource(), 1, 1000, 0 /* id */); + wl_touch_send_frame(touch_->resource()); Sync(); CheckEventType(ui::ET_TOUCH_RELEASED, event.get()); @@ -122,6 +123,7 @@ CheckEventType(ui::ET_TOUCH_MOVED, event.get(), ui::EventPointerType::kPen); wl_touch_send_up(touch_->resource(), 1, 1000, 0 /* id */); + wl_touch_send_frame(touch_->resource()); Sync(); CheckEventType(ui::ET_TOUCH_RELEASED, event.get()); @@ -144,6 +146,7 @@ EXPECT_TRUE(window_->has_touch_focus()); wl_touch_send_up(touch_->resource(), ++serial, ++time, touch_id1); + wl_touch_send_frame(touch_->resource()); Sync(); @@ -169,18 +172,21 @@ EXPECT_TRUE(window_->has_touch_focus()); wl_touch_send_up(touch_->resource(), ++serial, ++time, touch_id2); + wl_touch_send_frame(touch_->resource()); Sync(); EXPECT_TRUE(window_->has_touch_focus()); wl_touch_send_up(touch_->resource(), ++serial, ++time, touch_id1); + wl_touch_send_frame(touch_->resource()); Sync(); EXPECT_TRUE(window_->has_touch_focus()); wl_touch_send_up(touch_->resource(), ++serial, ++time, touch_id3); + wl_touch_send_frame(touch_->resource()); Sync(); @@ -243,7 +249,9 @@ EXPECT_TRUE(event->flags() & ui::EF_CONTROL_DOWN); wl_touch_send_up(touch_->resource(), ++serial, ++timestamp, 0 /* id */); + wl_touch_send_frame(touch_->resource()); Sync(); + CheckEventType(ui::ET_TOUCH_RELEASED, event.get()); EXPECT_TRUE(event->flags() & ui::EF_CONTROL_DOWN); @@ -268,6 +276,7 @@ EXPECT_FALSE(event->flags() & ui::EF_CONTROL_DOWN); wl_touch_send_up(touch_->resource(), ++serial, ++timestamp, 0 /* id */); + wl_touch_send_frame(touch_->resource()); Sync(); CheckEventType(ui::ET_TOUCH_RELEASED, event.get()); EXPECT_FALSE(event->flags() & ui::EF_CONTROL_DOWN);
diff --git a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc index 9443c29..f9e99208 100644 --- a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc +++ b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc
@@ -503,8 +503,9 @@ } else { auto touch_pointer_ids = touch_delegate_->GetActiveTouchPointIds(); DCHECK_EQ(touch_pointer_ids.size(), 1u); - touch_delegate_->OnTouchReleaseEvent(base::TimeTicks::Now(), - touch_pointer_ids[0]); + touch_delegate_->OnTouchReleaseEvent( + base::TimeTicks::Now(), touch_pointer_ids[0], + WaylandTouch::Delegate::EventDispatchPolicy::kImmediate); } pointer_grab_owner_ = nullptr;
diff --git a/ui/ozone/platform/wayland/host/wayland_window_unittest.cc b/ui/ozone/platform/wayland/host/wayland_window_unittest.cc index 1ef9834..7df9e99 100644 --- a/ui/ozone/platform/wayland/host/wayland_window_unittest.cc +++ b/ui/ozone/platform/wayland/host/wayland_window_unittest.cc
@@ -1748,6 +1748,8 @@ menu_window_surface->resource(), 0, 0); wl_touch_send_up(server_.seat()->touch()->resource(), ++serial, 1000, 0 /* id */); + wl_touch_send_frame(server_.seat()->touch()->resource()); + wl_keyboard_send_leave(server_.seat()->keyboard()->resource(), ++serial, toplevel_surface->resource()); @@ -2956,6 +2958,7 @@ wl_touch_send_up(server_.seat()->touch()->resource(), touch_up_serial, 1000, 0 /* id */); + wl_touch_send_frame(server_.seat()->touch()->resource()); Sync(); @@ -3580,6 +3583,7 @@ wl_fixed_from_int(100), wl_fixed_from_int(100)); wl_touch_send_up(server_.seat()->touch()->resource(), ++serial, 2000, 0 /* id */); + wl_touch_send_frame(server_.seat()->touch()->resource()); Sync(); std::move(closure).Run(); @@ -3592,6 +3596,7 @@ wl_fixed_from_int(50), wl_fixed_from_int(50)); wl_touch_send_up(server_.seat()->touch()->resource(), ++serial, 1000, 0 /* id */); + wl_touch_send_frame(server_.seat()->touch()->resource()); Sync(); }
diff --git a/ui/ozone/platform/wayland/test/wayland_drag_drop_test.cc b/ui/ozone/platform/wayland/test/wayland_drag_drop_test.cc index 24fa853..9c1397c 100644 --- a/ui/ozone/platform/wayland/test/wayland_drag_drop_test.cc +++ b/ui/ozone/platform/wayland/test/wayland_drag_drop_test.cc
@@ -108,6 +108,7 @@ void WaylandDragDropTest::SendTouchUp(int id) { wl_touch_send_up(touch_->resource(), NextSerial(), NextTime(), id); + wl_touch_send_frame(touch_->resource()); } void WaylandDragDropTest::SendTouchMotion(WaylandWindow* window,
diff --git a/ui/ozone/platform/x11/BUILD.gn b/ui/ozone/platform/x11/BUILD.gn index b1180a8..252986e 100644 --- a/ui/ozone/platform/x11/BUILD.gn +++ b/ui/ozone/platform/x11/BUILD.gn
@@ -151,6 +151,7 @@ "//ui/base/x", "//ui/base/x:test_support", "//ui/base/x:unittests", + "//ui/display:test_support", "//ui/events:test_support", "//ui/events/devices/x11", "//ui/events/platform/x11",
diff --git a/ui/ozone/platform/x11/test/x11_window_unittest.cc b/ui/ozone/platform/x11/test/x11_window_unittest.cc index f499dbe..cccb2e24 100644 --- a/ui/ozone/platform/x11/test/x11_window_unittest.cc +++ b/ui/ozone/platform/x11/test/x11_window_unittest.cc
@@ -15,6 +15,7 @@ #include "ui/base/x/x11_util.h" #include "ui/display/display_switches.h" #include "ui/display/screen_base.h" +#include "ui/display/test/test_screen.h" #include "ui/events/devices/x11/touch_factory_x11.h" #include "ui/events/event.h" #include "ui/events/platform/x11/x11_event_source.h" @@ -215,8 +216,8 @@ ui::TouchFactory::GetInstance()->SetPointerDeviceForTest(pointer_devices); // X11 requires display::Screen instance. - test_screen_ = new TestScreen(); - display::Screen::SetScreenInstance(test_screen_); + test_screen_.emplace(); + display::Screen::SetScreenInstance(&test_screen_.value()); // Make X11 synchronous for our display connection. This does not force the // window manager to behave synchronously. @@ -226,6 +227,8 @@ protected: void TearDown() override { x11::Connection::Get()->SynchronizeForTest(false); + display::Screen::SetScreenInstance(nullptr); + test_screen_.reset(); } std::unique_ptr<X11Window> CreateX11Window( @@ -252,7 +255,7 @@ std::unique_ptr<base::test::TaskEnvironment> task_env_; std::unique_ptr<X11EventSource> event_source_; - TestScreen* test_screen_ = nullptr; + absl::optional<TestScreen> test_screen_; }; // https://crbug.com/898742: Test is flaky.
diff --git a/ui/ozone/platform/x11/x11_window_ozone_unittest.cc b/ui/ozone/platform/x11/x11_window_ozone_unittest.cc index f130507c..8f8953c 100644 --- a/ui/ozone/platform/x11/x11_window_ozone_unittest.cc +++ b/ui/ozone/platform/x11/x11_window_ozone_unittest.cc
@@ -78,12 +78,13 @@ void SetUp() override { event_source_ = std::make_unique<X11EventSource>(x11::Connection::Get()); - test_screen_ = new TestScreen(); - display::Screen::SetScreenInstance(test_screen_); + display::Screen::SetScreenInstance(&test_screen_); TouchFactory::GetInstance()->SetPointerDeviceForTest({kPointerDeviceId}); } + void TearDown() override { display::Screen::SetScreenInstance(nullptr); } + protected: std::unique_ptr<PlatformWindow> CreatePlatformWindow( MockPlatformWindowDelegate* delegate, @@ -112,7 +113,7 @@ return window_manager; } - TestScreen* test_screen_ = nullptr; + TestScreen test_screen_; private: std::unique_ptr<base::test::TaskEnvironment> task_env_; @@ -283,7 +284,7 @@ // Verifies X11Window sets fullscreen bounds in pixels when going to fullscreen. TEST_F(X11WindowOzoneTest, ToggleFullscreen) { constexpr gfx::Rect screen_bounds_in_px(640, 480, 1280, 720); - test_screen_->SetScaleAndBoundsForPrimaryDisplay(2, screen_bounds_in_px); + test_screen_.SetScaleAndBoundsForPrimaryDisplay(2, screen_bounds_in_px); MockPlatformWindowDelegate delegate; gfx::AcceleratedWidget widget;
diff --git a/ui/ozone/public/input_controller.cc b/ui/ozone/public/input_controller.cc index d9d91e3..21f637b8 100644 --- a/ui/ozone/public/input_controller.cc +++ b/ui/ozone/public/input_controller.cc
@@ -39,6 +39,11 @@ void GetAutoRepeatRate(base::TimeDelta* delay, base::TimeDelta* interval) override {} void SetCurrentLayoutByName(const std::string& layout_name) override {} + void SetKeyboardKeyBitsMapping( + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) override {} + std::vector<uint64_t> GetKeyboardKeyBits(int id) override { + return std::vector<uint64_t>(); + } void SetTouchEventLoggingEnabled(bool enabled) override { NOTIMPLEMENTED_LOG_ONCE(); }
diff --git a/ui/ozone/public/input_controller.h b/ui/ozone/public/input_controller.h index 6da381e..e02af2ca 100644 --- a/ui/ozone/public/input_controller.h +++ b/ui/ozone/public/input_controller.h
@@ -68,6 +68,9 @@ virtual void GetAutoRepeatRate(base::TimeDelta* delay, base::TimeDelta* interval) = 0; virtual void SetCurrentLayoutByName(const std::string& layout_name) = 0; + virtual void SetKeyboardKeyBitsMapping( + base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) = 0; + virtual std::vector<uint64_t> GetKeyboardKeyBits(int id) = 0; // Touchpad settings. virtual void SetTouchpadSensitivity(int value) = 0;
diff --git a/ui/ozone/public/ozone_platform.cc b/ui/ozone/public/ozone_platform.cc index aa32ca5..30fcf86d 100644 --- a/ui/ozone/public/ozone_platform.cc +++ b/ui/ozone/public/ozone_platform.cc
@@ -97,6 +97,11 @@ } // static +bool OzonePlatform::IsInitialized() { + return !!g_instance; +} + +// static std::string OzonePlatform::GetPlatformNameForTest() { return GetOzonePlatformName(); }
diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h index 22ba323..df6b551 100644 --- a/ui/ozone/public/ozone_platform.h +++ b/ui/ozone/public/ozone_platform.h
@@ -240,6 +240,8 @@ static OzonePlatform* GetInstance(); + static bool IsInitialized(); + // Returns the current ozone platform name. // Some tests may skip based on the platform name. static std::string GetPlatformNameForTest();
diff --git a/ui/views/bubble/bubble_dialog_delegate_view_unittest.cc b/ui/views/bubble/bubble_dialog_delegate_view_unittest.cc index f786b1b..45189c7 100644 --- a/ui/views/bubble/bubble_dialog_delegate_view_unittest.cc +++ b/ui/views/bubble/bubble_dialog_delegate_view_unittest.cc
@@ -820,30 +820,33 @@ : public BubbleDialogDelegateViewTest, public testing::WithParamInterface<ArrowTestParameters> { public: - BubbleDialogDelegateViewArrowTest() : screen_override_(SetUpTestScreen()) {} + BubbleDialogDelegateViewArrowTest() { SetUpTestScreen(); } BubbleDialogDelegateViewArrowTest(const BubbleDialogDelegateViewArrowTest&) = delete; BubbleDialogDelegateViewArrowTest& operator=( const BubbleDialogDelegateViewArrowTest&) = delete; - ~BubbleDialogDelegateViewArrowTest() override = default; + ~BubbleDialogDelegateViewArrowTest() override { + display::Screen::SetScreenInstance(nullptr); + } private: - display::Screen* SetUpTestScreen() { - const display::Display test_display = test_screen_.GetPrimaryDisplay(); + void SetUpTestScreen() { + DCHECK(!display::test::TestScreen::Get()); + test_screen_ = std::make_unique<display::test::TestScreen>(); + display::Screen::SetScreenInstance(test_screen_.get()); + const display::Display test_display = test_screen_->GetPrimaryDisplay(); display::Display display(test_display); display.set_id(0x2); display.set_bounds(gfx::Rect(0, 0, kScreenWidth, kScreenHeight)); display.set_work_area(gfx::Rect(0, 0, kScreenWidth, kScreenHeight)); - test_screen_.display_list().RemoveDisplay(test_display.id()); - test_screen_.display_list().AddDisplay(display, - display::DisplayList::Type::PRIMARY); - return &test_screen_; + test_screen_->display_list().RemoveDisplay(test_display.id()); + test_screen_->display_list().AddDisplay( + display, display::DisplayList::Type::PRIMARY); } - display::test::TestScreen test_screen_; - display::test::ScopedScreenOverride screen_override_; + std::unique_ptr<display::test::TestScreen> test_screen_; }; TEST_P(BubbleDialogDelegateViewArrowTest, AvailableScreenSpaceTest) {
diff --git a/ui/views/bubble/bubble_dialog_model_host.cc b/ui/views/bubble/bubble_dialog_model_host.cc index 389925a..4f9efb89 100644 --- a/ui/views/bubble/bubble_dialog_model_host.cc +++ b/ui/views/bubble/bubble_dialog_model_host.cc
@@ -191,7 +191,7 @@ } private: - BubbleDialogModelHost* const parent_; + const raw_ptr<BubbleDialogModelHost> parent_; }; class BubbleDialogModelHost::LayoutConsensusView : public View {
diff --git a/ui/views/cocoa/bridged_native_widget_unittest.mm b/ui/views/cocoa/bridged_native_widget_unittest.mm index 4c219d938..34b4af7 100644 --- a/ui/views/cocoa/bridged_native_widget_unittest.mm +++ b/ui/views/cocoa/bridged_native_widget_unittest.mm
@@ -24,6 +24,7 @@ #import "ui/base/cocoa/window_size_constants.h" #include "ui/base/ime/input_method.h" #import "ui/base/test/cocoa_helper.h" +#include "ui/display/screen.h" #include "ui/events/test/cocoa_test_event_utils.h" #import "ui/gfx/mac/coordinate_conversion.h" #import "ui/views/cocoa/native_widget_mac_ns_window_host.h" @@ -385,6 +386,8 @@ private: TestViewsDelegate test_views_delegate_; + + display::ScopedNativeScreen screen_; }; class BridgedNativeWidgetTest : public BridgedNativeWidgetTestBase,
diff --git a/ui/views/controls/base_control_test_widget.cc b/ui/views/controls/base_control_test_widget.cc index 1bee91040..1131f0eb 100644 --- a/ui/views/controls/base_control_test_widget.cc +++ b/ui/views/controls/base_control_test_widget.cc
@@ -23,8 +23,6 @@ BaseControlTestWidget::~BaseControlTestWidget() = default; void BaseControlTestWidget::SetUp() { - ViewsTestBase::SetUp(); - #if BUILDFLAG(IS_MAC) test_screen_ = std::make_unique<display::test::TestScreenMac>(gfx::Size()); // Purposely not use ScopedScreenOverride, in which GetScreen() will @@ -32,6 +30,8 @@ display::Screen::SetScreenInstance(test_screen_.get()); #endif + ViewsTestBase::SetUp(); + widget_ = std::make_unique<Widget>(); Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW_FRAMELESS); @@ -47,10 +47,10 @@ void BaseControlTestWidget::TearDown() { widget_.reset(); + ViewsTestBase::TearDown(); #if BUILDFLAG(IS_MAC) display::Screen::SetScreenInstance(nullptr); #endif - ViewsTestBase::TearDown(); } void BaseControlTestWidget::CreateWidgetContent(View* container) {}
diff --git a/ui/views/controls/native/native_view_host_aura_unittest.cc b/ui/views/controls/native/native_view_host_aura_unittest.cc index b1d7084..a582930 100644 --- a/ui/views/controls/native/native_view_host_aura_unittest.cc +++ b/ui/views/controls/native/native_view_host_aura_unittest.cc
@@ -608,7 +608,7 @@ } private: - aura::Window* window_ = nullptr; + raw_ptr<aura::Window> window_ = nullptr; }; TEST_F(NativeViewHostAuraTest, ShouldDescendIntoChildForEventHandling) {
diff --git a/ui/views/dialog_model_context_menu_controller.h b/ui/views/dialog_model_context_menu_controller.h index f91bee8..bbdcfa5 100644 --- a/ui/views/dialog_model_context_menu_controller.h +++ b/ui/views/dialog_model_context_menu_controller.h
@@ -7,6 +7,7 @@ #include <memory> +#include "base/memory/raw_ptr.h" #include "ui/base/models/dialog_model_menu_model_adapter.h" #include "ui/views/context_menu_controller.h" #include "ui/views/controls/menu/menu_runner.h" @@ -41,7 +42,7 @@ ui::MenuSourceType source_type) override; private: - View* const host_; + const raw_ptr<View> host_; const int run_types_; const MenuAnchorPosition anchor_position_; const base::RepeatingCallback<std::unique_ptr<ui::DialogModel>()>
diff --git a/ui/views/examples/designer_example.h b/ui/views/examples/designer_example.h index 0bc1309..f3007b6 100644 --- a/ui/views/examples/designer_example.h +++ b/ui/views/examples/designer_example.h
@@ -8,6 +8,7 @@ #include <memory> #include <vector> +#include "base/memory/raw_ptr.h" #include "third_party/skia/include/core/SkPath.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_types.h" @@ -100,8 +101,8 @@ static bool IsRight(GrabHandlePosition position); GrabHandlePosition position_; - GrabHandles* grab_handles_; - View* attached_view_ = nullptr; + raw_ptr<GrabHandles> grab_handles_; + raw_ptr<View> attached_view_ = nullptr; gfx::Point mouse_drag_pos_; }; @@ -153,10 +154,10 @@ Combobox* view_type_ = nullptr; TableView* inspector_ = nullptr; - ui::TableModelObserver* model_observer_ = nullptr; + raw_ptr<ui::TableModelObserver> model_observer_ = nullptr; - View* selected_ = nullptr; - View* dragging_ = nullptr; + raw_ptr<View> selected_ = nullptr; + raw_ptr<View> dragging_ = nullptr; gfx::Point last_mouse_pos_; std::vector<ui::metadata::MemberMetaDataBase*> selected_members_;
diff --git a/ui/views/test/test_desktop_screen_ozone.cc b/ui/views/test/test_desktop_screen_ozone.cc index 7f018a7..61684a2 100644 --- a/ui/views/test/test_desktop_screen_ozone.cc +++ b/ui/views/test/test_desktop_screen_ozone.cc
@@ -4,22 +4,20 @@ #include "ui/views/test/test_desktop_screen_ozone.h" -#include <memory> - -#include "base/memory/singleton.h" - -namespace views { -namespace test { - +namespace views::test { namespace { TestDesktopScreenOzone* g_instance = nullptr; } +// static +std::unique_ptr<display::Screen> TestDesktopScreenOzone::Create() { + auto screen = std::make_unique<TestDesktopScreenOzone>(); + screen->Initialize(); + return screen; +} + TestDesktopScreenOzone* TestDesktopScreenOzone::GetInstance() { - if (!g_instance) { - g_instance = base::Singleton<TestDesktopScreenOzone>::get(); - g_instance->Initialize(); - } + DCHECK_EQ(display::Screen::GetScreen(), g_instance); return g_instance; } @@ -27,8 +25,13 @@ return cursor_screen_point_; } -TestDesktopScreenOzone::TestDesktopScreenOzone() = default; -TestDesktopScreenOzone::~TestDesktopScreenOzone() = default; +TestDesktopScreenOzone::TestDesktopScreenOzone() { + DCHECK(!g_instance); + g_instance = this; +} -} // namespace test -} // namespace views +TestDesktopScreenOzone::~TestDesktopScreenOzone() { + g_instance = nullptr; +} + +} // namespace views::test
diff --git a/ui/views/test/test_desktop_screen_ozone.h b/ui/views/test/test_desktop_screen_ozone.h index abaea86..1054c1c 100644 --- a/ui/views/test/test_desktop_screen_ozone.h +++ b/ui/views/test/test_desktop_screen_ozone.h
@@ -5,12 +5,13 @@ #ifndef UI_VIEWS_TEST_TEST_DESKTOP_SCREEN_OZONE_H_ #define UI_VIEWS_TEST_TEST_DESKTOP_SCREEN_OZONE_H_ +#include <memory> + #include "ui/gfx/geometry/point.h" #include "ui/views/widget/desktop_aura/desktop_screen_ozone.h" -namespace base { -template <typename T> -struct DefaultSingletonTraits; +namespace display { +class Screen; } namespace views { @@ -26,6 +27,7 @@ TestDesktopScreenOzone(const TestDesktopScreenOzone&) = delete; TestDesktopScreenOzone& operator=(const TestDesktopScreenOzone&) = delete; + static std::unique_ptr<display::Screen> Create(); static TestDesktopScreenOzone* GetInstance(); // DesktopScreenOzone: @@ -35,12 +37,10 @@ cursor_screen_point_ = point; } - private: - friend struct base::DefaultSingletonTraits<TestDesktopScreenOzone>; - TestDesktopScreenOzone(); ~TestDesktopScreenOzone() override; + private: gfx::Point cursor_screen_point_; };
diff --git a/ui/views/test/views_test_helper_mac.h b/ui/views/test/views_test_helper_mac.h index a9abea1..3d5eb38 100644 --- a/ui/views/test/views_test_helper_mac.h +++ b/ui/views/test/views_test_helper_mac.h
@@ -7,9 +7,11 @@ #include <memory> +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/test/scoped_fake_full_keyboard_access.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/compositor/test/test_context_factories.h" +#include "ui/display/screen.h" #include "ui/views/test/views_test_helper.h" namespace ui { @@ -58,6 +60,8 @@ // more consistent with other platforms, where most views are focusable by // default. ui::test::ScopedFakeFullKeyboardAccess faked_full_keyboard_access_; + + display::ScopedNativeScreen screen_; }; } // namespace views
diff --git a/ui/views/test/widget_test.cc b/ui/views/test/widget_test.cc index ac1e3a965..459e046 100644 --- a/ui/views/test/widget_test.cc +++ b/ui/views/test/widget_test.cc
@@ -12,8 +12,12 @@ #include "ui/views/test/native_widget_factory.h" #include "ui/views/widget/root_view.h" -namespace views { -namespace test { +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ + !BUILDFLAG(IS_CHROMECAST) +#include "ui/views/test/test_desktop_screen_ozone.h" +#endif + +namespace views::test { namespace { @@ -130,9 +134,21 @@ void DesktopWidgetTestInteractive::SetUp() { SetUpForInteractiveTests(); +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ + !BUILDFLAG(IS_CHROMECAST) + screen_ = views::test::TestDesktopScreenOzone::Create(); +#endif DesktopWidgetTest::SetUp(); } +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ + !BUILDFLAG(IS_CHROMECAST) +void DesktopWidgetTestInteractive::TearDown() { + DesktopWidgetTest::TearDown(); + screen_.reset(); +} +#endif + TestDesktopWidgetDelegate::TestDesktopWidgetDelegate() : TestDesktopWidgetDelegate(nullptr) {} @@ -270,5 +286,4 @@ widget_observation_.Reset(); } -} // namespace test -} // namespace views +} // namespace views::test
diff --git a/ui/views/test/widget_test.h b/ui/views/test/widget_test.h index 24b792f..1ba22f67 100644 --- a/ui/views/test/widget_test.h +++ b/ui/views/test/widget_test.h
@@ -14,11 +14,17 @@ #include "base/scoped_observation.h" #include "base/test/bind.h" #include "build/build_config.h" +#include "build/chromecast_buildflags.h" #include "ui/gfx/native_widget_types.h" #include "ui/views/test/views_test_base.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_observer.h" +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ + !BUILDFLAG(IS_CHROMECAST) +#include "ui/display/screen.h" +#endif + namespace ui { namespace internal { class InputMethodDelegate; @@ -156,6 +162,12 @@ // DesktopWidgetTest void SetUp() override; + +#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ + !BUILDFLAG(IS_CHROMECAST) + void TearDown() override; + std::unique_ptr<display::Screen> screen_; +#endif }; // A helper WidgetDelegate for tests that require hooks into WidgetDelegate
diff --git a/ui/views/widget/desktop_aura/desktop_screen_win.cc b/ui/views/widget/desktop_aura/desktop_screen_win.cc index 7c352dd..b5ad964 100644 --- a/ui/views/widget/desktop_aura/desktop_screen_win.cc +++ b/ui/views/widget/desktop_aura/desktop_screen_win.cc
@@ -13,10 +13,13 @@ namespace views { -DesktopScreenWin::DesktopScreenWin() = default; +DesktopScreenWin::DesktopScreenWin() { + DCHECK(!display::Screen::HasScreen()); + display::Screen::SetScreenInstance(this); +} DesktopScreenWin::~DesktopScreenWin() { - display::Screen::SetScreenInstance(old_screen_); + display::Screen::SetScreenInstance(nullptr); } HWND DesktopScreenWin::GetHWNDFromNativeWindow(gfx::NativeWindow window) const {
diff --git a/ui/views/widget/desktop_aura/desktop_screen_win.h b/ui/views/widget/desktop_aura/desktop_screen_win.h index 6ab217c..c2cbf5a 100644 --- a/ui/views/widget/desktop_aura/desktop_screen_win.h +++ b/ui/views/widget/desktop_aura/desktop_screen_win.h
@@ -23,9 +23,6 @@ HWND GetHWNDFromNativeWindow(gfx::NativeWindow window) const override; gfx::NativeWindow GetNativeWindowFromHWND(HWND hwnd) const override; bool IsNativeWindowOccluded(gfx::NativeWindow window) const override; - - const raw_ptr<display::Screen> old_screen_ = - display::Screen::SetScreenInstance(this); }; } // namespace views
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h index d8fdd0f8..505fc97 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h
@@ -12,6 +12,7 @@ #include <vector> #include "base/gtest_prod_util.h" +#include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "build/build_config.h" #include "ui/aura/window_tree_host_platform.h" @@ -212,8 +213,8 @@ // Helper method that returns the display for the |window()|. display::Display GetDisplayNearestRootWindow() const; - internal::NativeWidgetDelegate* const native_widget_delegate_; - DesktopNativeWidgetAura* const desktop_native_widget_aura_; + const raw_ptr<internal::NativeWidgetDelegate> native_widget_delegate_; + const raw_ptr<DesktopNativeWidgetAura> desktop_native_widget_aura_; bool is_active_ = false; @@ -221,7 +222,7 @@ // We can optionally have a parent which can order us to close, or own // children who we're responsible for closing when we CloseNow(). - DesktopWindowTreeHostPlatform* window_parent_ = nullptr; + raw_ptr<DesktopWindowTreeHostPlatform> window_parent_ = nullptr; std::set<DesktopWindowTreeHostPlatform*> window_children_; // Used for tab dragging in move loop requests.
diff --git a/ui/views/widget/desktop_aura/window_move_client_platform.h b/ui/views/widget/desktop_aura/window_move_client_platform.h index 09d46399..909e37e 100644 --- a/ui/views/widget/desktop_aura/window_move_client_platform.h +++ b/ui/views/widget/desktop_aura/window_move_client_platform.h
@@ -5,6 +5,7 @@ #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_WINDOW_MOVE_CLIENT_PLATFORM_H_ #define UI_VIEWS_WIDGET_DESKTOP_AURA_WINDOW_MOVE_CLIENT_PLATFORM_H_ +#include "base/memory/raw_ptr.h" #include "ui/views/views_export.h" #include "ui/wm/public/window_move_client.h" @@ -29,7 +30,7 @@ private: // The RunMoveLoop request is forwarded to this host. - DesktopWindowTreeHostPlatform* host_ = nullptr; + raw_ptr<DesktopWindowTreeHostPlatform> host_ = nullptr; }; } // namespace views
diff --git a/ui/wm/BUILD.gn b/ui/wm/BUILD.gn index 660b5a3..d006f7979 100644 --- a/ui/wm/BUILD.gn +++ b/ui/wm/BUILD.gn
@@ -100,10 +100,15 @@ sources = [ "test/testing_cursor_client_observer.cc", "test/testing_cursor_client_observer.h", - "test/wm_test_helper.cc", - "test/wm_test_helper.h", ] + if (is_chromeos_ash) { + sources += [ + "test/wm_test_helper.cc", + "test/wm_test_helper.h", + ] + } + public_deps = [ "//ui/base/cursor" ] deps = [
diff --git a/ui/wm/test/wm_test_helper.cc b/ui/wm/test/wm_test_helper.cc index 5088317..6e09afb6 100644 --- a/ui/wm/test/wm_test_helper.cc +++ b/ui/wm/test/wm_test_helper.cc
@@ -8,6 +8,7 @@ #include <utility> #include "base/memory/ptr_util.h" +#include "build/build_config.h" #include "ui/aura/client/default_capture_client.h" #include "ui/aura/test/test_focus_client.h" #include "ui/aura/test/test_screen.h" @@ -21,10 +22,10 @@ WMTestHelper::WMTestHelper(const gfx::Size& default_window_size) { wm_state_ = std::make_unique<WMState>(); - - // Install a screen, like TestWindowService's AuraTestHelper for InitMusHost. - test_screen_ = base::WrapUnique(aura::TestScreen::Create(gfx::Size())); - display::Screen::SetScreenInstance(test_screen_.get()); + if (!display::Screen::HasScreen()) { + test_screen_ = base::WrapUnique(aura::TestScreen::Create(gfx::Size())); + display::Screen::SetScreenInstance(test_screen_.get()); + } host_ = aura::WindowTreeHost::Create( ui::PlatformWindowInitProperties{gfx::Rect(default_window_size)}); @@ -46,8 +47,7 @@ WMTestHelper::~WMTestHelper() { host_->window()->RemovePreTargetHandler(root_window_event_filter_.get()); - - if (display::Screen::GetScreen() == test_screen_.get()) + if (test_screen_) display::Screen::SetScreenInstance(nullptr); }