diff --git a/BUILD.gn b/BUILD.gn index 4551707e..ccf7c5e5 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -849,6 +849,7 @@ "//mojo/public/rust", "//mojo/public/rust:mojo_rust_tests", "//third_party/rust/autocxx/chromium_integration/tests", + "//tools/crates/gnrt($host_toolchain)", ] } if (enable_rust) {
diff --git a/DEPS b/DEPS index d9cc85f..a9cc3f4 100644 --- a/DEPS +++ b/DEPS
@@ -284,7 +284,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '044a8d7a3cb81cc00591e249c20a0caf810d6447', + 'v8_revision': '98eebd6178b516440aba5dda369d15fa4442dff2', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. @@ -296,7 +296,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': 'ce72527c01dc086acf407b82d0a69874ea426711', + 'pdfium_revision': 'a6646dbea44e0da6e789e5bb2cc8972afa678270', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -423,7 +423,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling nearby # and whatever else without interference from each other. - 'nearby_revision': 'd8453565db739ebbfbbeade9ec8f8239057b1e13', + 'nearby_revision': '6ebf3731c8d23eed49f39813f5a6fa57d3baf5c5', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling securemessage # and whatever else without interference from each other. @@ -1542,7 +1542,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'e203cbf28e303aa502f63f046d70fdbf894d4a13', + Var('android_git') + '/platform/external/perfetto.git' + '@' + 'd3300e34ed8ad844a4f18a9067cac38b0d950dbc', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1785,7 +1785,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@e7a746f7ba522253b0c777e6ff50982b17e4ac61', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@9568d0745e60c99787ea5b35ad249b65ad3b9e22', 'condition': 'checkout_src_internal', }, @@ -1815,7 +1815,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': 'sb-wuUZYCzLO3jj8F8-34EU_hfm2j-ZWpv_izCD9j-cC', + 'version': '1f-1Zo_9yDMzgebtJdnZSqKtnLdMEFO-ZlfQ0BZYrLEC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal',
diff --git a/android_webview/browser/gfx/display_webview.cc b/android_webview/browser/gfx/display_webview.cc index 886292e..4071627 100644 --- a/android_webview/browser/gfx/display_webview.cc +++ b/android_webview/browser/gfx/display_webview.cc
@@ -109,11 +109,8 @@ } } -std::vector<viz::SurfaceId> DisplayWebView::GetContainedSurfaceIds() { - std::vector<viz::SurfaceId> surfaces; - for (auto& surface : aggregator_->previous_contained_surfaces()) - surfaces.push_back(surface.first); - return surfaces; +const base::flat_set<viz::SurfaceId>& DisplayWebView::GetContainedSurfaceIds() { + return aggregator_->previous_contained_surfaces(); } } // namespace android_webview
diff --git a/android_webview/browser/gfx/display_webview.h b/android_webview/browser/gfx/display_webview.h index 5596bb9..a3799488 100644 --- a/android_webview/browser/gfx/display_webview.h +++ b/android_webview/browser/gfx/display_webview.h
@@ -5,6 +5,7 @@ #ifndef ANDROID_WEBVIEW_BROWSER_GFX_DISPLAY_WEBVIEW_H_ #define ANDROID_WEBVIEW_BROWSER_GFX_DISPLAY_WEBVIEW_H_ +#include "base/containers/flat_set.h" #include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" #include "components/viz/service/display/display.h" @@ -33,7 +34,7 @@ return overlay_processor_webview_; } - std::vector<viz::SurfaceId> GetContainedSurfaceIds(); + const base::flat_set<viz::SurfaceId>& GetContainedSurfaceIds(); // viz::FrameSinkObserver implenentation: void OnRegisteredFrameSinkId(const viz::FrameSinkId& frame_sink_id) override {
diff --git a/android_webview/browser/gfx/root_frame_sink.cc b/android_webview/browser/gfx/root_frame_sink.cc index 87d4c1b..a2215fb 100644 --- a/android_webview/browser/gfx/root_frame_sink.cc +++ b/android_webview/browser/gfx/root_frame_sink.cc
@@ -211,8 +211,8 @@ } void RootFrameSink::SetContainedSurfaces( - const std::vector<viz::SurfaceId>& ids) { - contained_surfaces_ = base::flat_set<viz::SurfaceId>(ids.begin(), ids.end()); + const base::flat_set<viz::SurfaceId>& ids) { + contained_surfaces_ = ids; for (auto it = last_invalidated_frame_id_.begin(); it != last_invalidated_frame_id_.end();) { if (!contained_surfaces_.contains(it->first))
diff --git a/android_webview/browser/gfx/root_frame_sink.h b/android_webview/browser/gfx/root_frame_sink.h index 54ebe0c..b0895d0 100644 --- a/android_webview/browser/gfx/root_frame_sink.h +++ b/android_webview/browser/gfx/root_frame_sink.h
@@ -8,6 +8,7 @@ #include <memory> #include "base/callback.h" +#include "base/containers/flat_set.h" #include "base/memory/raw_ptr.h" #include "base/threading/thread_checker.h" #include "components/viz/common/frame_sinks/begin_frame_source.h" @@ -73,7 +74,7 @@ bool IsChildSurface(const viz::FrameSinkId& frame_sink_id); void DettachClient(); void EvictChildSurface(const viz::SurfaceId& surface_id); - void SetContainedSurfaces(const std::vector<viz::SurfaceId>& ids); + void SetContainedSurfaces(const base::flat_set<viz::SurfaceId>& ids); void SubmitChildCompositorFrame(ChildFrame* child_frame); viz::FrameTimingDetailsMap TakeChildFrameTimingDetailsMap();
diff --git a/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/WebSettingsBoundaryInterface.java b/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/WebSettingsBoundaryInterface.java index dd3f383..ba2fd39 100644 --- a/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/WebSettingsBoundaryInterface.java +++ b/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/WebSettingsBoundaryInterface.java
@@ -64,4 +64,7 @@ void setRequestedWithHeaderMode(@RequestedWithHeaderMode int mode); @RequestedWithHeaderMode int getRequestedWithHeaderMode(); + + void setEnterpriseAuthenticationAppLinkPolicyEnabled(boolean enabled); + boolean getEnterpriseAuthenticationAppLinkPolicyEnabled(); }
diff --git a/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/util/Features.java b/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/util/Features.java index 97ca100..4c38495 100644 --- a/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/util/Features.java +++ b/android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/util/Features.java
@@ -205,4 +205,9 @@ // WebViewCompat.getVariationsHeader public static final String GET_VARIATIONS_HEADER = "GET_VARIATIONS_HEADER"; + + // WebSettingsCompat.setEnterpriseAuthenticationAppLinkPolicyEnabled + // WebSettingsCompat.getEnterpriseAuthenticationAppLinkPolicyEnabled + public static final String ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY = + "ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY"; }
diff --git a/android_webview/support_library/java/src/org/chromium/support_lib_glue/SupportLibWebSettingsAdapter.java b/android_webview/support_library/java/src/org/chromium/support_lib_glue/SupportLibWebSettingsAdapter.java index 53ee4787..00432fbb 100644 --- a/android_webview/support_library/java/src/org/chromium/support_lib_glue/SupportLibWebSettingsAdapter.java +++ b/android_webview/support_library/java/src/org/chromium/support_lib_glue/SupportLibWebSettingsAdapter.java
@@ -189,4 +189,15 @@ } return RequestedWithHeaderMode.APP_PACKAGE_NAME; } + + @Override + public void setEnterpriseAuthenticationAppLinkPolicyEnabled(boolean enabled) { + recordApiCall(ApiCall.WEB_SETTINGS_SET_ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY_ENABLED); + mAwSettings.setEnterpriseAuthenticationAppLinkPolicyEnabled(enabled); + } + @Override + public boolean getEnterpriseAuthenticationAppLinkPolicyEnabled() { + recordApiCall(ApiCall.WEB_SETTINGS_GET_ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY_ENABLED); + return mAwSettings.getEnterpriseAuthenticationAppLinkPolicyEnabled(); + } }
diff --git a/android_webview/support_library/java/src/org/chromium/support_lib_glue/SupportLibWebViewChromiumFactory.java b/android_webview/support_library/java/src/org/chromium/support_lib_glue/SupportLibWebViewChromiumFactory.java index 71ed7955..1ad63938 100644 --- a/android_webview/support_library/java/src/org/chromium/support_lib_glue/SupportLibWebViewChromiumFactory.java +++ b/android_webview/support_library/java/src/org/chromium/support_lib_glue/SupportLibWebViewChromiumFactory.java
@@ -87,6 +87,7 @@ Features.REQUESTED_WITH_HEADER_CONTROL + Features.DEV_SUFFIX, Features.GET_VARIATIONS_HEADER, Features.ALGORITHMIC_DARKENING, + Features.ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY + Features.DEV_SUFFIX, // Add new features above. New features must include `+ Features.DEV_SUFFIX` // when they're initially added (this can be removed in a future CL). The final // feature should have a trailing comma for cleaner diffs. @@ -155,6 +156,8 @@ ApiCall.SERVICE_WORKER_SETTINGS_SET_REQUESTED_WITH_HEADER_MODE, ApiCall.SERVICE_WORKER_SETTINGS_GET_REQUESTED_WITH_HEADER_MODE, ApiCall.GET_VARIATIONS_HEADER, + ApiCall.WEB_SETTINGS_GET_ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY_ENABLED, + ApiCall.WEB_SETTINGS_SET_ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY_ENABLED, // Add new constants above. The final constant should have a trailing comma for cleaner // diffs. }) @@ -220,8 +223,10 @@ int SERVICE_WORKER_SETTINGS_SET_REQUESTED_WITH_HEADER_MODE = 58; int SERVICE_WORKER_SETTINGS_GET_REQUESTED_WITH_HEADER_MODE = 59; int GET_VARIATIONS_HEADER = 60; + int WEB_SETTINGS_GET_ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY_ENABLED = 61; + int WEB_SETTINGS_SET_ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY_ENABLED = 62; // Remember to update AndroidXWebkitApiCall in enums.xml when adding new values here - int COUNT = 61; + int COUNT = 63; } // clang-format on
diff --git a/ash/accelerators/accelerator_controller_impl.cc b/ash/accelerators/accelerator_controller_impl.cc index 1a6edde..30e48a38 100644 --- a/ash/accelerators/accelerator_controller_impl.cc +++ b/ash/accelerators/accelerator_controller_impl.cc
@@ -183,48 +183,6 @@ UMA_HISTOGRAM_ENUMERATION(kTabletCountOfVolumeAdjustType, type); } -// Returns the number of times the startup notification has been shown -// from prefs. -int GetStartupNotificationPrefCount(PrefService* pref_service) { - DCHECK(pref_service); - return pref_service->GetInteger( - prefs::kImprovedShortcutsNotificationShownCount); -} - -bool ShouldShowStartupNotificationForCurrentUser() { - const absl::optional<user_manager::UserType> user_type = - Shell::Get()->session_controller()->GetUserType(); - return user_type && - (*user_type == user_manager::USER_TYPE_REGULAR || - *user_type == user_manager::USER_TYPE_CHILD) && - !Shell::Get()->session_controller()->IsUserFirstLogin(); -} - -// Increments the number of times the startup notification has been shown -// in prefs. -void IncrementStartupNotificationCount(PrefService* pref_service) { - DCHECK(pref_service); - int count = GetStartupNotificationPrefCount(pref_service); - - // Increment the pref count. - pref_service->SetInteger(prefs::kImprovedShortcutsNotificationShownCount, - count + 1); -} - -// Shows a notification that accelerators/shortcuts have changed in this -// release. -// TODO(crbug.com/1179893): Remove this function in M97/M98. -void NotifyShortcutChangesInRelease(PrefService* pref_service) { - DCHECK(::features::IsImprovedKeyboardShortcutsEnabled()); - DCHECK(pref_service); - - if (GetStartupNotificationPrefCount(pref_service) > 0) - return; - - ShowShortcutsChangedNotification(); - IncrementStartupNotificationCount(pref_service); -} - void ShowToast(std::string id, ToastCatalogName catalog_name, const std::u16string& text) { @@ -1515,8 +1473,6 @@ //////////////////////////////////////////////////////////////////////////////// // AcceleratorControllerImpl, public: -bool AcceleratorControllerImpl::should_show_shortcut_notification_ = true; - AcceleratorControllerImpl::TestApi::TestApi( AcceleratorControllerImpl* controller) : controller_(controller) { @@ -1580,16 +1536,6 @@ accelerator_history_(std::make_unique<AcceleratorHistoryImpl>()), side_volume_button_location_file_path_( base::FilePath(kSideVolumeButtonLocationFilePath)) { - if (::features::IsImprovedKeyboardShortcutsEnabled()) { - // Observe input method changes to determine when to use positional - // shortcuts. Calling AddObserver will cause InputMethodChanged to be - // called once even when the method does not change. - InputMethodManager::Get()->AddObserver(this); - - // Observe session changes. - Shell::Get()->session_controller()->AddObserver(this); - } - Init(); ParseSideVolumeButtonLocationInfo(); @@ -1606,24 +1552,6 @@ aura::Env::GetInstance()->RemovePreTargetHandler(accelerator_history_.get()); } -// static -void AcceleratorControllerImpl::RegisterProfilePrefs( - PrefRegistrySimple* registry) { - registry->RegisterIntegerPref(prefs::kImprovedShortcutsNotificationShownCount, - 0); -} - -void AcceleratorControllerImpl::OnActiveUserPrefServiceChanged( - PrefService* pref_service) { - DCHECK(pref_service); - if (::features::IsImprovedKeyboardShortcutsEnabled()) { - if (should_show_shortcut_notification_ && - ShouldShowStartupNotificationForCurrentUser()) { - NotifyShortcutChangesInRelease(pref_service); - } - } -} - void AcceleratorControllerImpl::InputMethodChanged(InputMethodManager* manager, Profile* profile, bool show_message) { @@ -2625,13 +2553,6 @@ confirmation_dialog_ = dialog->GetWeakPtr(); } -void AcceleratorControllerImpl::Shutdown() { - if (::features::IsImprovedKeyboardShortcutsEnabled()) { - InputMethodManager::Get()->RemoveObserver(this); - Shell::Get()->session_controller()->RemoveObserver(this); - } -} - bool AcceleratorControllerImpl::IsInternalKeyboardOrUncategorizedDevice( int source_device_id) const { if (source_device_id == ui::ED_UNKNOWN_DEVICE)
diff --git a/ash/accelerators/accelerator_controller_impl.h b/ash/accelerators/accelerator_controller_impl.h index f6adddb..7d6d599f 100644 --- a/ash/accelerators/accelerator_controller_impl.h +++ b/ash/accelerators/accelerator_controller_impl.h
@@ -18,14 +18,11 @@ #include "ash/accessibility/ui/accessibility_confirmation_dialog.h" #include "ash/ash_export.h" #include "ash/public/cpp/accelerators.h" -#include "ash/public/cpp/session/session_observer.h" #include "base/gtest_prod_util.h" #include "ui/base/accelerators/accelerator.h" #include "ui/base/accelerators/accelerator_map.h" #include "ui/base/ime/ash/input_method_manager.h" -class PrefRegistrySimple; - namespace ui { class AcceleratorManager; } @@ -75,7 +72,6 @@ class ASH_EXPORT AcceleratorControllerImpl : public ui::AcceleratorTarget, public AcceleratorController, - public SessionObserver, public input_method::InputMethodManager::Observer { public: // Some Chrome OS devices have volume up and volume down buttons on their @@ -156,14 +152,6 @@ delete; ~AcceleratorControllerImpl() override; - static void RegisterProfilePrefs(PrefRegistrySimple* registry); - - // Allows overriding whether the new shortcuts notification should be shown - // for tests. - static void SetShouldShowShortcutNotificationForTest(bool value) { - should_show_shortcut_notification_ = value; - } - // A list of possible ways in which an accelerator should be restricted before // processing. Any target registered with this controller should respect // restrictions by calling GetAcceleratorProcessingRestriction() during @@ -179,9 +167,6 @@ RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION }; - // SessionObserver overrides: - void OnActiveUserPrefServiceChanged(PrefService* pref_service) override; - // input_method::InputMethodManager::Observer overrides: void InputMethodChanged(input_method::InputMethodManager* manager, Profile* profile, @@ -243,9 +228,6 @@ base::OnceClosure on_accept_callback, base::OnceClosure on_cancel_callback); - // Remove the observers. - void Shutdown(); - private: // A map for looking up actions from accelerators. using AcceleratorActionMap = ui::AcceleratorMap<AcceleratorAction>; @@ -320,13 +302,6 @@ // VOLUME_DOWN acceleration action when in tablet mode. void StartTabletModeVolumeAdjustTimer(AcceleratorAction action); - // Determines whether the notification about changed shortcuts at startup - // should show. This needs to be overridden in tests and set to false, - // because many tests rely on knowing the current active window, or test - // for the number of notifications visible. - // TODO(crbug.com/1179893): Remove in M94. - static bool should_show_shortcut_notification_; - std::unique_ptr<ui::AcceleratorManager> accelerator_manager_; // A tracker for the current and previous accelerators.
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc index 9bf8f0ee..0a0ca28 100644 --- a/ash/accelerators/accelerator_controller_unittest.cc +++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -2343,185 +2343,6 @@ ui::VKEY_OEM_MINUS, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN))); } -// Overrides SetUp() to do nothing so that the flag can be tested in both -// directions during setup. -// TODO(crbug.com/1179893): Remove suite once the feature is enabled by -// default. -class AcceleratorControllerStartupNotificationTest - : public NoSessionAshTestBase { - public: - AcceleratorControllerStartupNotificationTest() { - auto delegate = std::make_unique<MockNewWindowDelegate>(); - new_window_delegate_ = delegate.get(); - delegate_provider_ = - std::make_unique<TestNewWindowDelegateProvider>(std::move(delegate)); - } - - ~AcceleratorControllerStartupNotificationTest() override { - // Set back to false to avoid any future test having the wrong value. - AcceleratorControllerImpl::SetShouldShowShortcutNotificationForTest(false); - } - - // Setup is a no-op to allow changing features/flags before SetUp(). Tests - // need to call SetupLater() manually. - void SetUp() override {} - - protected: - // Perform the setup, but defer it to be called manually by the test. - void SetUpLater(bool improved_shortcuts_enabled) { - if (improved_shortcuts_enabled) { - scoped_feature_list_.InitAndEnableFeature( - ::features::kImprovedKeyboardShortcuts); - } else { - scoped_feature_list_.InitAndDisableFeature( - ::features::kImprovedKeyboardShortcuts); - } - - NoSessionAshTestBase::SetUp(); - AcceleratorControllerImpl::SetShouldShowShortcutNotificationForTest(true); - } - - message_center::MessageCenter* message_center() const { - return message_center::MessageCenter::Get(); - } - - MockNewWindowDelegate* new_window_delegate_ = nullptr; // Not owned. - std::unique_ptr<TestNewWindowDelegateProvider> delegate_provider_; - base::test::ScopedFeatureList scoped_feature_list_; -}; - -TEST_F(AcceleratorControllerStartupNotificationTest, - StartupNotificationShownWhenEnabled) { - // Set up the shell and controller. - SetUpLater(/*improved_shortcuts_enabled=*/true); - - // Notification should be shown at login. - SimulateUserLogin("user1@email.com"); - EXPECT_TRUE(FindShortcutsChangedNotificationForTest()); -} - -TEST_F(AcceleratorControllerStartupNotificationTest, - StartupNotificationNotShownWhenDisabled) { - // Set up the shell and controller. - SetUpLater(/*improved_shortcuts_enabled=*/false); - - // Notification should not be shown at login. - SimulateUserLogin("user1@email.com"); - EXPECT_FALSE(FindShortcutsChangedNotificationForTest()); -} - -TEST_F(AcceleratorControllerStartupNotificationTest, - StartupNotificationNotShownWhenInGuestMode) { - // Set up the shell and controller. - SetUpLater(/*improved_shortcuts_enabled=*/true); - - // Notification should not be shown at login. - SimulateUserLogin("user1@email.com", user_manager::USER_TYPE_GUEST); - EXPECT_FALSE(FindShortcutsChangedNotificationForTest()); -} - -TEST_F(AcceleratorControllerStartupNotificationTest, - StartupNotificationNotShownWhenInFirstLogin) { - // Set up the shell and controller. - SetUpLater(/*improved_shortcuts_enabled=*/true); - - SimulateNewUserFirstLogin("user1@email.com"); - - // Notification should not be shown at a new user's first login. - EXPECT_FALSE(FindShortcutsChangedNotificationForTest()); -} - -TEST_F(AcceleratorControllerStartupNotificationTest, - StartupNotificationShownOnlyOnce) { - // Set up the shell and controller. - SetUpLater(/*improved_shortcuts_enabled=*/true); - - // Notification should be shown at login. - SimulateUserLogin("user1@email.com"); - EXPECT_TRUE(FindShortcutsChangedNotificationForTest()); - - // Reset the notifications. - message_center()->RemoveAllNotifications( - /*by_user=*/false, message_center::MessageCenter::RemoveType::ALL); - - // Login again and there should not be another notification. - SimulateUserLogin("user1@email.com"); - EXPECT_FALSE(FindShortcutsChangedNotificationForTest()); -} - -TEST_F(AcceleratorControllerStartupNotificationTest, - StartupNotificationShownToEachUser) { - // Set up the shell and controller. - SetUpLater(/*improved_shortcuts_enabled=*/true); - - // Notification should be shown at first login. - SimulateUserLogin("user1@email.com"); - EXPECT_TRUE(FindShortcutsChangedNotificationForTest()); - - // Reset the notifications. - message_center()->RemoveAllNotifications( - /*by_user=*/false, message_center::MessageCenter::RemoveType::ALL); - - // Switch to user 2, and also should be shown at first login. - SimulateUserLogin("user2@email.com"); - EXPECT_TRUE(FindShortcutsChangedNotificationForTest()); - - // Reset the notifications. - message_center()->RemoveAllNotifications( - /*by_user=*/false, message_center::MessageCenter::RemoveType::ALL); - - // Switch back to to user 1, and it should not be shown. - auto* session = GetSessionControllerClient(); - session->SwitchActiveUser(AccountId::FromUserEmail("user1@email.com")); - EXPECT_FALSE(FindShortcutsChangedNotificationForTest()); - - // Switch again to user 2, and it should not be shown. - session->SwitchActiveUser(AccountId::FromUserEmail("user2@email.com")); - EXPECT_FALSE(FindShortcutsChangedNotificationForTest()); -} - -TEST_F(AcceleratorControllerStartupNotificationTest, - StartupNotificationLearnMoreLink) { - // Set up the shell and controller. - SetUpLater(/*improved_shortcuts_enabled=*/true); - - // Notification should be shown at login. - SimulateUserLogin("user1@email.com"); - auto* notification = FindShortcutsChangedNotificationForTest(); - EXPECT_TRUE(notification); - - // Setup the expectation that the learn more button opens this shortcut - // help link. - EXPECT_CALL(*new_window_delegate_, - OpenUrl(GURL(kKeyboardShortcutHelpPageUrl), - NewWindowDelegate::OpenUrlFrom::kUserInteraction)); - // Clicking the learn more button should trigger the NewWindowDelegate and - // complete the expectation above. - notification->delegate()->Click(/*button_index=*/0, - /*reply=*/absl::nullopt); -} - -TEST_F(AcceleratorControllerStartupNotificationTest, - StartupNotificationOpenShortcutViewer) { - // Set up the shell and controller. - SetUpLater(/*improved_shortcuts_enabled=*/true); - - // Notification should be shown at login. - SimulateUserLogin("user1@email.com"); - auto* notification = FindShortcutsChangedNotificationForTest(); - EXPECT_TRUE(notification); - - // Setup the expectation that clicking the message body will show the - // shortcut viewer. - EXPECT_CALL(*new_window_delegate_, ShowKeyboardShortcutViewer) - .WillOnce(testing::Return()); - - // Clicking the message body should trigger the NewWindowDelegate and - // complete the expectation above. - notification->delegate()->Click(/*button_index=*/absl::nullopt, - /*reply=*/absl::nullopt); -} - // defines a class to test the behavior of deprecated accelerators. class DeprecatedAcceleratorTester : public AcceleratorControllerTest { public:
diff --git a/ash/ambient/ui/ambient_animation_view.cc b/ash/ambient/ui/ambient_animation_view.cc index 21897ef..db4cecb 100644 --- a/ash/ambient/ui/ambient_animation_view.cc +++ b/ash/ambient/ui/ambient_animation_view.cc
@@ -85,12 +85,28 @@ void LogCompositorThroughput(AmbientAnimationTheme theme, int smoothness) { // Use VLOG instead of DVLOG since this log is performance-related and // developers will almost certainly only care about this log on non-debug - // builds. The overhead of "--vmodule" regex matching is very minor so far to - // performance/CPU. + // builds. VLOG(1) << "Compositor throughput report: smoothness=" << smoothness; ambient::RecordAmbientModeAnimationSmoothness(smoothness, theme); } +void OnCompositorThroughputReported( + base::TimeTicks logging_start_time, + AmbientAnimationTheme theme, + const cc::FrameSequenceMetrics::CustomReportData& data) { + base::TimeDelta duration = base::TimeTicks::Now() - logging_start_time; + float duration_sec = duration.InSecondsF(); + VLOG(1) << "Compositor throughput report: frames_expected=" + << data.frames_expected << " frames_produced=" << data.frames_produced + << " jank_count=" << data.jank_count + << " expected_fps=" << data.frames_expected / duration_sec + << " actual_fps=" << data.frames_produced / duration_sec + << " duration=" << duration; + metrics_util::ForSmoothness( + base::BindRepeating(&LogCompositorThroughput, theme)) + .Run(data); +} + // Returns the maximum possible displacement in either dimension from the // original unshifted position when jitter is applied. int GetPaddingForAnimationJitter() { @@ -369,9 +385,10 @@ ui::Compositor* compositor = widget->GetCompositor(); DCHECK(compositor); throughput_tracker_ = compositor->RequestNewThroughputTracker(); - throughput_tracker_->Start(metrics_util::ForSmoothness( - base::BindRepeating(&LogCompositorThroughput, - static_resources_->GetAmbientAnimationTheme()))); + throughput_tracker_->Start( + base::BindOnce(&OnCompositorThroughputReported, + /*logging_start_time=*/base::TimeTicks::Now(), + static_resources_->GetAmbientAnimationTheme())); } void AmbientAnimationView::ApplyJitter() {
diff --git a/ash/app_list/app_list_controller_impl.cc b/ash/app_list/app_list_controller_impl.cc index c2c36161..1df40a5 100644 --- a/ash/app_list/app_list_controller_impl.cc +++ b/ash/app_list/app_list_controller_impl.cc
@@ -1664,6 +1664,9 @@ void AppListControllerImpl::SetHideContinueSection(bool hide) { PrefService* prefs = GetLastActiveUserPrefService(); + bool is_hidden = prefs->GetBoolean(prefs::kLauncherContinueSectionHidden); + if (hide == is_hidden) + return; prefs->SetBoolean(prefs::kLauncherContinueSectionHidden, hide); fullscreen_presenter_->UpdateContinueSectionVisibility(); bubble_presenter_->UpdateContinueSectionVisibility();
diff --git a/ash/app_list/app_list_controller_impl_unittest.cc b/ash/app_list/app_list_controller_impl_unittest.cc index 84ba4d5..371da3b 100644 --- a/ash/app_list/app_list_controller_impl_unittest.cc +++ b/ash/app_list/app_list_controller_impl_unittest.cc
@@ -340,7 +340,7 @@ // Pins |item2| by dragging it to ShelfView. ShelfView* shelf_view = GetPrimaryShelf()->GetShelfViewForTesting(); - ASSERT_EQ(0, shelf_view->view_model()->view_size()); + ASSERT_EQ(0u, shelf_view->view_model()->view_size()); GetEventGenerator()->MoveMouseTo(item2->GetBoundsInScreen().CenterPoint()); GetEventGenerator()->PressLeftButton(); item2->FireMouseDragTimerForTest(); @@ -348,7 +348,7 @@ shelf_view->GetBoundsInScreen().CenterPoint()); ASSERT_TRUE(GetAppsGridView()->FireDragToShelfTimerForTest()); GetEventGenerator()->ReleaseLeftButton(); - ASSERT_EQ(1, shelf_view->view_model()->view_size()); + ASSERT_EQ(1u, shelf_view->view_model()->view_size()); // Verifies that the dragged item has the correct previous/next focusable // view after drag.
diff --git a/ash/app_list/app_list_presenter_unittest.cc b/ash/app_list/app_list_presenter_unittest.cc index c65b9cf..5e0d49b9 100644 --- a/ash/app_list/app_list_presenter_unittest.cc +++ b/ash/app_list/app_list_presenter_unittest.cc
@@ -888,7 +888,7 @@ EXPECT_EQ(original_folder_item_bounds, folder_item_view->GetBoundsInScreen()); // No item layers are expected to be created. - for (int i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { + for (size_t i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { views::View* item_view = apps_grid_view_->view_model()->view_at(i); EXPECT_FALSE(item_view->layer()) << "at " << i; } @@ -1003,7 +1003,7 @@ apps_grid_view_->GetItemViewAt(2)->GetBoundsInScreen()); // Verify that item view layers have been deleted. - for (int i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { + for (size_t i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { views::View* item_view = apps_grid_view_->view_model()->view_at(i); EXPECT_FALSE(item_view->layer()) << "at " << i; } @@ -1122,7 +1122,7 @@ apps_grid_view_->GetItemViewAt(2)->GetBoundsInScreen()); // Verify that item view layers have been deleted. - for (int i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { + for (size_t i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { views::View* item_view = apps_grid_view_->view_model()->view_at(i); EXPECT_FALSE(item_view->layer()) << "at " << i; } @@ -1241,7 +1241,7 @@ apps_grid_view_->GetItemViewAt(3)->GetBoundsInScreen()); // Verify that item view layers have been deleted. - for (int i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { + for (size_t i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { views::View* item_view = apps_grid_view_->view_model()->view_at(i); EXPECT_FALSE(item_view->layer()) << "at " << i; } @@ -1324,7 +1324,7 @@ apps_grid_view_->GetItemViewAt(3)->GetBoundsInScreen()); // Verify that item view layers have been deleted. - for (int i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { + for (size_t i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { views::View* item_view = apps_grid_view_->view_model()->view_at(i); EXPECT_FALSE(item_view->layer()) << "at " << i; } @@ -1422,7 +1422,7 @@ apps_grid_view_->GetItemViewAt(3)->GetBoundsInScreen()); // Verify that item view layers have been deleted. - for (int i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { + for (size_t i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { views::View* item_view = apps_grid_view_->view_model()->view_at(i); EXPECT_FALSE(item_view->layer()) << "at " << i; } @@ -1519,7 +1519,7 @@ apps_grid_view_->GetItemViewAt(3)->GetBoundsInScreen()); // Verify that item view layers have been deleted. - for (int i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { + for (size_t i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { views::View* item_view = apps_grid_view_->view_model()->view_at(i); EXPECT_FALSE(item_view->layer()) << "at " << i; } @@ -2969,7 +2969,7 @@ // Verify that item layers have been destroyed after the drag operation ended. apps_grid_test_api_->WaitForItemMoveAnimationDone(); - for (int i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { + for (size_t i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { views::View* item_view = apps_grid_view_->view_model()->view_at(i); EXPECT_FALSE(item_view->layer()) << "at " << i; } @@ -2984,7 +2984,7 @@ EXPECT_EQ(expected_folder_item_view_bounds, folder_item_view->GetBoundsInScreen()); EXPECT_TRUE(AppListIsInFolderView()); - for (int i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { + for (size_t i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { views::View* item_view = apps_grid_view_->view_model()->view_at(i); EXPECT_FALSE(item_view->layer()) << "at " << i; } @@ -3043,7 +3043,7 @@ // Verify that item layers have been destroyed after the drag operation ended. apps_grid_test_api_->WaitForItemMoveAnimationDone(); - for (int i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { + for (size_t i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { views::View* item_view = apps_grid_view_->view_model()->view_at(i); EXPECT_FALSE(item_view->layer()) << "at " << i; } @@ -3065,7 +3065,7 @@ // Verify that item views have no layers after the folder has been opened. apps_grid_test_api_->WaitForItemMoveAnimationDone(); EXPECT_TRUE(AppListIsInFolderView()); - for (int i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { + for (size_t i = 0; i < apps_grid_view_->view_model()->view_size(); ++i) { views::View* item_view = apps_grid_view_->view_model()->view_at(i); EXPECT_FALSE(item_view->layer()) << "at " << i; } @@ -5965,7 +5965,7 @@ // of the layers, including items on the second page. generator->MoveMouseTo(start_point.x(), 0); generator->ReleaseLeftButton(); - for (int i = 0; i < apps_grid_view->view_model()->view_size(); ++i) { + for (size_t i = 0; i < apps_grid_view->view_model()->view_size(); ++i) { views::View* item_view = apps_grid_view->view_model()->view_at(i); EXPECT_FALSE(item_view->layer()) << "at " << i; }
diff --git a/ash/app_list/app_list_test_api.cc b/ash/app_list/app_list_test_api.cc index 4bcefff..d67e0faa 100644 --- a/ash/app_list/app_list_test_api.cc +++ b/ash/app_list/app_list_test_api.cc
@@ -97,7 +97,7 @@ ash::AppListItemView* FindFolderItemView(ash::AppsGridView* apps_grid_view) { auto* model = apps_grid_view->view_model(); - for (int index = 0; index < model->view_size(); ++index) { + for (size_t index = 0; index < model->view_size(); ++index) { ash::AppListItemView* current_view = model->view_at(index); if (current_view->is_folder()) return current_view; @@ -108,7 +108,7 @@ ash::AppListItemView* FindNonFolderItemView(ash::AppsGridView* apps_grid_view) { auto* model = apps_grid_view->view_model(); - for (int index = 0; index < model->view_size(); ++index) { + for (size_t index = 0; index < model->view_size(); ++index) { ash::AppListItemView* current_view = model->view_at(index); if (!current_view->is_folder()) return current_view; @@ -158,7 +158,7 @@ ui::test::EventGenerator* event_generator) { views::MenuItemView* root_menu = nullptr; - EXPECT_GT(apps_grid_view->view_model()->view_size(), 0); + EXPECT_GT(apps_grid_view->view_model()->view_size(), 0u); switch (menu_type) { case AppListTestApi::MenuType::kAppListPageMenu: @@ -415,7 +415,7 @@ const std::string& item_id) { views::ViewModelT<AppListItemView>* view_model = GetTopLevelAppsGridView()->view_model(); - for (int i = 0; i < view_model->view_size(); ++i) { + for (size_t i = 0; i < view_model->view_size(); ++i) { AppListItemView* app_list_item_view = view_model->view_at(i); if (app_list_item_view->item()->id() == item_id) return app_list_item_view->title()->GetText(); @@ -426,7 +426,7 @@ std::vector<std::string> AppListTestApi::GetTopLevelViewIdList() { std::vector<std::string> id_list; auto* view_model = GetTopLevelAppsGridView()->view_model(); - for (int i = 0; i < view_model->view_size(); ++i) { + for (size_t i = 0; i < view_model->view_size(); ++i) { AppListItem* app_list_item = view_model->view_at(i)->item(); if (app_list_item) { id_list.push_back(app_list_item->id()); @@ -633,7 +633,8 @@ void AppListTestApi::VerifyTopLevelItemVisibility() { auto* view_model = GetTopLevelAppsGridView()->view_model(); std::vector<std::string> invisible_item_names; - for (int view_index = 0; view_index < view_model->view_size(); ++view_index) { + for (size_t view_index = 0; view_index < view_model->view_size(); + ++view_index) { auto* item_view = view_model->view_at(view_index); if (!item_view->GetVisible()) invisible_item_names.push_back(item_view->item()->name());
diff --git a/ash/app_list/paged_view_structure.cc b/ash/app_list/paged_view_structure.cc index 29441dd1..38864e5 100644 --- a/ash/app_list/paged_view_structure.cc +++ b/ash/app_list/paged_view_structure.cc
@@ -67,7 +67,7 @@ if (mode_ == Mode::kSinglePage) { // Copy the view model to a single page. pages_[0].reserve(view_model->view_size()); - for (int i = 0; i < view_model->view_size(); ++i) { + for (size_t i = 0; i < view_model->view_size(); ++i) { pages_[0].push_back(view_model->view_at(i)); } return; @@ -75,7 +75,7 @@ if (mode_ == Mode::kFullPages) { // Copy the view model to N full pages. - for (int i = 0; i < view_model->view_size(); ++i) { + for (size_t i = 0; i < view_model->view_size(); ++i) { if (pages_.back().size() == static_cast<size_t>(TilesPerPage(pages_.size() - 1))) { pages_.emplace_back(); @@ -264,7 +264,7 @@ return view_model->view_size(); AppListItemView* view = pages_[index.page][index.slot]; - return view_model->GetIndexOfView(view); + return view_model->GetIndexOfView(view).value(); } GridIndex PagedViewStructure::GetLastTargetIndex() const { @@ -272,7 +272,7 @@ return GridIndex(0, 0); if (mode_ == Mode::kSinglePage || mode_ == Mode::kFullPages) { - int view_index = apps_grid_view_->view_model()->view_size(); + size_t view_index = apps_grid_view_->view_model()->view_size(); // If a view in the current view model is being dragged, then ignore it. if (apps_grid_view_->drag_view()) @@ -304,7 +304,7 @@ } const int page_size = total_pages(); - DCHECK_LT(0, apps_grid_view_->view_model()->view_size()); + DCHECK_LT(0u, apps_grid_view_->view_model()->view_size()); DCHECK_LE(page_index, page_size); if (page_index == page_size)
diff --git a/ash/app_list/views/app_list_bubble_apps_page.cc b/ash/app_list/views/app_list_bubble_apps_page.cc index ce97e18..7822b166 100644 --- a/ash/app_list/views/app_list_bubble_apps_page.cc +++ b/ash/app_list/views/app_list_bubble_apps_page.cc
@@ -893,6 +893,8 @@ // The animation has a delay to give the separator and apps grid time to // partially slide out of the way. views::AnimationBuilder() + .SetPreemptionStrategy(ui::LayerAnimator::PreemptionStrategy:: + IMMEDIATELY_ANIMATE_TO_NEW_TARGET) .OnEnded(cleanup) .OnAborted(cleanup) .Once()
diff --git a/ash/app_list/views/app_list_bubble_view_unittest.cc b/ash/app_list/views/app_list_bubble_view_unittest.cc index 845568ff..dbc27b26 100644 --- a/ash/app_list/views/app_list_bubble_view_unittest.cc +++ b/ash/app_list/views/app_list_bubble_view_unittest.cc
@@ -989,7 +989,7 @@ // There are only 2 folders, and hence 2 columns, in the top level apps grid. auto* apps_grid_view = GetAppsGridView(); - ASSERT_EQ(2, apps_grid_view->view_model()->view_size()); + ASSERT_EQ(2u, apps_grid_view->view_model()->view_size()); // Focus the 5th recent app. auto* recent_apps_view = GetRecentAppsView();
diff --git a/ash/app_list/views/app_list_main_view_unittest.cc b/ash/app_list/views/app_list_main_view_unittest.cc index 7adb0cffc..f1bd064 100644 --- a/ash/app_list/views/app_list_main_view_unittest.cc +++ b/ash/app_list/views/app_list_main_view_unittest.cc
@@ -38,7 +38,7 @@ namespace ash { namespace { -const int kInitialItems = 2; +const size_t kInitialItems = 2; } // namespace @@ -184,7 +184,7 @@ delegate_->GetTestModel()->FindFolderItem("single_item_folder")); EXPECT_EQ(AppListFolderItem::kItemType, folder_item->GetItemType()); - EXPECT_EQ(1, GetRootViewModel()->view_size()); + EXPECT_EQ(1u, GetRootViewModel()->view_size()); AppListItemView* folder_item_view = static_cast<AppListItemView*>(GetRootViewModel()->view_at(0)); EXPECT_EQ(folder_item_view->item(), folder_item); @@ -287,7 +287,7 @@ std::unique_ptr<SearchModel> old_search_model( delegate_->ReleaseTestSearchModel()); - const int kReplacementItems = 5; + const size_t kReplacementItems = 5; delegate_->ReplaceTestModel(kReplacementItems); EXPECT_EQ(kReplacementItems, GetRootViewModel()->view_size()); } @@ -300,11 +300,11 @@ // Number of apps to populate. Should provide more than 1 page of apps (5*4 = // 20). - const int kNumApps = 30; + const size_t kNumApps = 30; delegate_->GetTestModel()->PopulateApps(kNumApps); GetRootGridView()->Layout(); - EXPECT_EQ(1, GetFolderViewModel()->view_size()); + EXPECT_EQ(1u, GetFolderViewModel()->view_size()); EXPECT_EQ(kNumApps + 1, GetRootViewModel()->view_size()); AppListItemView* dragged = StartDragForReparent(0); @@ -372,7 +372,7 @@ GetFolderGridView()->EndDrag(false); // The app list model should remain unchanged. - EXPECT_EQ(2, GetRootViewModel()->view_size()); + EXPECT_EQ(2u, GetRootViewModel()->view_size()); EXPECT_EQ(folder_id, GetRootGridView()->GetItemViewAt(0)->item()->id()); AppListFolderItem* const folder_item = delegate_->GetTestModel()->FindFolderItem("single_item_folder");
diff --git a/ash/app_list/views/app_list_view_unittest.cc b/ash/app_list/views/app_list_view_unittest.cc index d26880ab..6977cd3c 100644 --- a/ash/app_list/views/app_list_view_unittest.cc +++ b/ash/app_list/views/app_list_view_unittest.cc
@@ -1454,7 +1454,7 @@ forward_view_list.push_back(suggestions[0]); const views::ViewModelT<AppListItemView>* view_model = apps_grid_view()->view_model(); - for (int i = 0; i < view_model->view_size(); i += apps_grid_view()->cols()) + for (size_t i = 0; i < view_model->view_size(); i += apps_grid_view()->cols()) forward_view_list.push_back(view_model->view_at(i)); forward_view_list.push_back(search_box_view()->search_box()); @@ -1463,7 +1463,7 @@ std::vector<views::View*> backward_view_list; backward_view_list.push_back(search_box_view()->search_box()); - for (int i = view_model->view_size() - 1; i >= 0; + for (size_t i = view_model->view_size() - 1; i < view_model->view_size(); i -= apps_grid_view()->cols()) backward_view_list.push_back(view_model->view_at(i)); // Up key will always move focus to the last suggestion chip from first row @@ -1531,7 +1531,7 @@ std::vector<views::View*> forward_view_list; const views::ViewModelT<AppListItemView>* view_model = app_list_folder_view()->items_grid_view()->view_model(); - for (int i = 0; i < view_model->view_size(); + for (size_t i = 0; i < view_model->view_size(); i += app_list_folder_view()->items_grid_view()->cols()) { forward_view_list.push_back(view_model->view_at(i)); } @@ -1548,7 +1548,7 @@ backward_view_list.push_back(search_box_view()->search_box()); backward_view_list.push_back( app_list_folder_view()->folder_header_view()->GetFolderNameViewForTest()); - for (int i = view_model->view_size() - 1; i >= 0; + for (size_t i = view_model->view_size() - 1; i < view_model->view_size(); i -= app_list_folder_view()->items_grid_view()->cols()) { backward_view_list.push_back(view_model->view_at(i)); } @@ -1579,7 +1579,7 @@ std::vector<views::View*> forward_view_list; const views::ViewModelT<AppListItemView>* view_model = app_list_folder_view()->items_grid_view()->view_model(); - for (int i = kMaxItemsPerFolderPage; i < view_model->view_size(); + for (size_t i = kMaxItemsPerFolderPage; i < view_model->view_size(); i += app_list_folder_view()->items_grid_view()->cols()) { forward_view_list.push_back(view_model->view_at(i)); } @@ -1596,7 +1596,7 @@ backward_view_list.push_back(search_box_view()->search_box()); backward_view_list.push_back( app_list_folder_view()->folder_header_view()->GetFolderNameViewForTest()); - for (int i = view_model->view_size() - 1; i >= 0; + for (size_t i = view_model->view_size() - 1; i < view_model->view_size(); i -= app_list_folder_view()->items_grid_view()->cols()) { backward_view_list.push_back(view_model->view_at(i)); }
diff --git a/ash/app_list/views/apps_container_view.cc b/ash/app_list/views/apps_container_view.cc index 10eb785..5d8dc7d 100644 --- a/ash/app_list/views/apps_container_view.cc +++ b/ash/app_list/views/apps_container_view.cc
@@ -41,6 +41,7 @@ #include "base/command_line.h" #include "base/cxx17_backports.h" #include "base/metrics/histogram_macros.h" +#include "base/time/time.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/color/color_id.h" @@ -52,9 +53,11 @@ #include "ui/display/screen.h" #include "ui/events/event.h" #include "ui/gfx/geometry/rect_conversions.h" +#include "ui/gfx/geometry/transform.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/accessibility/view_accessibility.h" +#include "ui/views/animation/animation_builder.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/focus/focus_manager.h" @@ -211,6 +214,23 @@ UpdateSeparatorVisibility(); } + // Animates a fade-in for the continue section, recent apps and separator. + void FadeInViews() { + continue_section_->layer()->SetOpacity(0.0f); + recent_apps_->layer()->SetOpacity(0.0f); + separator_->layer()->SetOpacity(0.0f); + + views::AnimationBuilder() + .SetPreemptionStrategy(ui::LayerAnimator::PreemptionStrategy:: + IMMEDIATELY_ANIMATE_TO_NEW_TARGET) + .Once() + .At(base::Milliseconds(100)) + .SetOpacity(continue_section_, 1.0f) + .SetOpacity(recent_apps_, 1.0f) + .SetOpacity(separator_, 1.0f) + .SetDuration(base::Milliseconds(200)); + } + ContinueSectionView* continue_section() { return continue_section_; } RecentAppsView* recent_apps() { return recent_apps_; } @@ -807,8 +827,42 @@ } void AppsContainerView::UpdateContinueSectionVisibility() { - if (continue_container_) - continue_container_->UpdateContinueSectionVisibility(); + if (!continue_container_) + return; + + // Get the continue container's height before Layout(). + const int initial_height = continue_container_->height(); + + // Update continue container visibility and bounds. + continue_container_->UpdateContinueSectionVisibility(); + Layout(); + + // The change in continue container height is the amount by which the apps + // grid view will be offset. + const int vertical_offset = initial_height - continue_container_->height(); + + // Transform the apps grid view to its original pre-Layout() position. + gfx::Transform transform; + transform.Translate(0, vertical_offset); + apps_grid_view_->SetTransform(transform); + + // Animate to the identity transform to slide the apps grid view into its + // final position. + views::AnimationBuilder() + .SetPreemptionStrategy(ui::LayerAnimator::PreemptionStrategy:: + IMMEDIATELY_ANIMATE_TO_NEW_TARGET) + .Once() + .SetTransform(apps_grid_view_, gfx::Transform(), + gfx::Tween::ACCEL_LIN_DECEL_100_3) + .SetDuration(base::Milliseconds(300)); + + // If the continue section is being shown, fade in the continue tasks and + // recent apps views. Don't try to fade out the views on hide because they + // are already invisible. + AppListViewDelegate* view_delegate = + contents_view_->GetAppListMainView()->view_delegate(); + if (!view_delegate->ShouldHideContinueSection()) + continue_container_->FadeInViews(); } ContinueSectionView* AppsContainerView::GetContinueSection() {
diff --git a/ash/app_list/views/apps_container_view_unittest.cc b/ash/app_list/views/apps_container_view_unittest.cc index 2d46062..a1adf5d 100644 --- a/ash/app_list/views/apps_container_view_unittest.cc +++ b/ash/app_list/views/apps_container_view_unittest.cc
@@ -12,6 +12,9 @@ #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "base/test/scoped_feature_list.h" +#include "ui/compositor/layer.h" +#include "ui/compositor/layer_animator.h" +#include "ui/compositor/scoped_animation_duration_scale_mode.h" namespace ash { @@ -62,6 +65,31 @@ EXPECT_FALSE(helper->GetAppsContainerView()->separator()->GetVisible()); } +TEST_F(AppsContainerViewTest, HideContinueSectionPlaysAnimation) { + // Show the app list without animation. + ASSERT_EQ(ui::ScopedAnimationDurationScaleMode::duration_multiplier(), + ui::ScopedAnimationDurationScaleMode::ZERO_DURATION); + auto* helper = GetAppListTestHelper(); + helper->AddContinueSuggestionResults(4); + helper->AddRecentApps(5); + helper->AddAppItems(5); + TabletMode::Get()->SetEnabledForTest(true); + + // Enable animations. + ui::ScopedAnimationDurationScaleMode duration( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); + + // Hide the continue section. + Shell::Get()->app_list_controller()->SetHideContinueSection(true); + + // Apps grid is animating its transform. + auto* apps_grid_view = helper->GetRootPagedAppsGridView(); + ASSERT_TRUE(apps_grid_view->layer()); + EXPECT_TRUE(apps_grid_view->layer()->GetAnimator()->is_animating()); + EXPECT_TRUE(apps_grid_view->layer()->GetAnimator()->IsAnimatingProperty( + ui::LayerAnimationElement::TRANSFORM)); +} + TEST_F(AppsContainerViewTest, CanShowContinueSection) { // Simulate a user with the continue section hidden on startup. Shell::Get()->app_list_controller()->SetHideContinueSection(true); @@ -88,4 +116,52 @@ EXPECT_TRUE(helper->GetAppsContainerView()->separator()->GetVisible()); } +TEST_F(AppsContainerViewTest, ShowContinueSectionPlaysAnimation) { + // Simulate a user with the continue section hidden on startup. + Shell::Get()->app_list_controller()->SetHideContinueSection(true); + + // Show the app list with enough items to make the continue section and + // recent apps visible. + auto* helper = GetAppListTestHelper(); + helper->AddContinueSuggestionResults(4); + helper->AddRecentApps(5); + helper->AddAppItems(5); + TabletMode::Get()->SetEnabledForTest(true); + + // Enable animations. + ui::ScopedAnimationDurationScaleMode duration( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); + + // Show the continue section. + Shell::Get()->app_list_controller()->SetHideContinueSection(false); + + // Continue section is fading in. + auto* continue_section = helper->GetFullscreenContinueSectionView(); + ASSERT_TRUE(continue_section->layer()); + EXPECT_TRUE(continue_section->layer()->GetAnimator()->is_animating()); + EXPECT_EQ(continue_section->layer()->opacity(), 0.0f); + EXPECT_EQ(continue_section->layer()->GetTargetOpacity(), 1.0f); + + // Recent apps view is fading in. + auto* recent_apps = helper->GetFullscreenRecentAppsView(); + ASSERT_TRUE(recent_apps->layer()); + EXPECT_TRUE(recent_apps->layer()->GetAnimator()->is_animating()); + EXPECT_EQ(recent_apps->layer()->opacity(), 0.0f); + EXPECT_EQ(recent_apps->layer()->GetTargetOpacity(), 1.0f); + + // Separator view is fading in. + auto* separator = helper->GetAppsContainerView()->separator(); + ASSERT_TRUE(separator->layer()); + EXPECT_TRUE(separator->layer()->GetAnimator()->is_animating()); + EXPECT_EQ(separator->layer()->opacity(), 0.0f); + EXPECT_EQ(separator->layer()->GetTargetOpacity(), 1.0f); + + // Apps grid is animating its transform. + auto* apps_grid_view = helper->GetRootPagedAppsGridView(); + ASSERT_TRUE(apps_grid_view->layer()); + EXPECT_TRUE(apps_grid_view->layer()->GetAnimator()->is_animating()); + EXPECT_TRUE(apps_grid_view->layer()->GetAnimator()->IsAnimatingProperty( + ui::LayerAnimationElement::TRANSFORM)); +} + } // namespace ash
diff --git a/ash/app_list/views/apps_grid_view.cc b/ash/app_list/views/apps_grid_view.cc index 7851b1c..caed8df 100644 --- a/ash/app_list/views/apps_grid_view.cc +++ b/ash/app_list/views/apps_grid_view.cc
@@ -364,7 +364,7 @@ // The app list item view icon sizes depend on the app list config, so they // have to be refreshed. - for (int i = 0; i < view_model_.view_size(); ++i) + for (size_t i = 0; i < view_model_.view_size(); ++i) view_model_.view_at(i)->UpdateAppListConfig(app_list_config); if (current_ghost_view_) @@ -413,7 +413,7 @@ // The number of non-page-break-items should be the same as item views. if (item_list_) { - int item_count = 0; + size_t item_count = 0; for (size_t i = 0; i < item_list_->item_count(); ++i) { if (!item_list_->item_at(i)->is_page_break()) ++item_count; @@ -758,7 +758,7 @@ if (!cancel) { // Select the page where dragged item is dropped. Avoid doing so when the // dragged item ends up in a folder. - const int model_index = GetModelIndexOfItem(drag_item); + const size_t model_index = GetModelIndexOfItem(drag_item); if (model_index < view_model_.view_size()) EnsureViewVisible(view_structure_.GetIndexFromModelIndex(model_index)); } @@ -781,7 +781,7 @@ } AppListItemView* AppsGridView::GetItemViewAt(int index) const { - if (index < 0 || index >= view_model_.view_size()) + if (index < 0 || static_cast<size_t>(index) >= view_model_.view_size()) return nullptr; return view_model_.view_at(index); } @@ -863,7 +863,7 @@ // the folder location change should be animated). AppListItemView* item_view = nullptr; int model_index = -1; - for (int i = 0; i < view_model_.view_size(); ++i) { + for (size_t i = 0; i < view_model_.view_size(); ++i) { AppListItemView* view = view_model_.view_at(i); if (view == drag_view_) continue; @@ -1052,7 +1052,7 @@ const views::ViewHierarchyChangedDetails& details) { if (!details.is_add && details.parent == items_container_) { // The view being delete should not have reference in |view_model_|. - CHECK_EQ(-1, view_model_.GetIndexOfView(details.child)); + CHECK(!view_model_.GetIndexOfView(details.child).has_value()); if (selected_view_ == details.child) selected_view_ = nullptr; @@ -1142,14 +1142,15 @@ AppListItemView* app_view) { delete placeholder; - if (view_model_.GetIndexOfView(app_view) != -1 && !ItemViewsRequireLayers()) + if (view_model_.GetIndexOfView(app_view).has_value() && + !ItemViewsRequireLayers()) app_view->DestroyLayer(); UpdatePulsingBlockViews(); } AppListItemView* AppsGridView::MaybeSwapPlaceholderAsset(size_t index) { - int model_index = GetTargetModelIndexFromItemIndex(index); + size_t model_index = GetTargetModelIndexFromItemIndex(index); AppListItemView* view = items_container_->AddChildViewAt( CreateViewForItemAtIndex(index), model_index); view_model_.Add(view, model_index); @@ -1200,9 +1201,9 @@ if (existing_items > TilesPerPage(0)) existing_items -= TilesPerPage(0); } - const int available_slots = + const size_t available_slots = tiles_per_page - (existing_items % tiles_per_page); - const int desired = + const size_t desired = model_ && model_->status() == AppListModelStatus::kStatusSyncing ? available_slots : 0; @@ -1259,11 +1260,11 @@ } GridIndex AppsGridView::GetIndexOfView(const AppListItemView* view) const { - const int model_index = view_model_.GetIndexOfView(view); - if (model_index == -1) + const auto model_index = view_model_.GetIndexOfView(view); + if (!model_index.has_value()) return GridIndex(); - return view_structure_.GetIndexFromModelIndex(model_index); + return view_structure_.GetIndexFromModelIndex(model_index.value()); } AppListItemView* AppsGridView::GetViewAtIndex(const GridIndex& index) const { @@ -1304,7 +1305,7 @@ } void AppsGridView::SetIdealBoundsForViewToGridIndex( - int view_index_in_model, + size_t view_index_in_model, const GridIndex& view_grid_index) { gfx::Rect tile_bounds = GetExpectedTileBounds(view_grid_index); tile_bounds.Offset(CalculateTransitionOffset(view_grid_index.page)); @@ -1332,10 +1333,10 @@ reserved_slots.insert(open_folder_info_->grid_index); } - const int total_views = + const size_t total_views = view_model_.view_size() + pulsing_blocks_model_.view_size(); int slot_index = 0; - for (int i = 0; i < total_views; ++i) { + for (size_t i = 0; i < total_views; ++i) { // NOTE: Because of pulsing blocks, `i` can count up to a value higher than // the view model size. So verify that `i` is less than the view model size // before fetching at index `i` from the view model. @@ -1417,7 +1418,7 @@ // All pulsing blocks come after item views. GridIndex pulsing_block_index = copied_view_structure.GetLastTargetIndex(); - for (int i = 0; i < pulsing_blocks_model().view_size(); ++i) { + for (size_t i = 0; i < pulsing_blocks_model().view_size(); ++i) { if (pulsing_block_index.slot == TilesPerPage(pulsing_block_index.page)) { ++pulsing_block_index.page; pulsing_block_index.slot = 0; @@ -1436,7 +1437,7 @@ visible_bounds.set_origin(visible_origin); CalculateIdealBounds(); - for (int i = 0; i < view_model_.view_size(); ++i) { + for (size_t i = 0; i < view_model_.view_size(); ++i) { AppListItemView* view = GetItemViewAt(i); const gfx::Rect& target = view_model_.ideal_bounds(i); const gfx::Rect& current = view->bounds(); @@ -1569,7 +1570,7 @@ if (target_folder_id.empty()) { // Find the view for drag item, and use its ideal bounds to calculate target // drop bounds. - for (int i = 0; i < view_model_.view_size(); ++i) { + for (size_t i = 0; i < view_model_.view_size(); ++i) { if (view_model_.view_at(i)->item() != drag_item) continue; @@ -1768,8 +1769,8 @@ gfx::Rect AppsGridView::GetTargetIconRectInFolder( AppListItem* drag_item, AppListItemView* folder_item_view) { - const gfx::Rect view_ideal_bounds = - view_model_.ideal_bounds(view_model_.GetIndexOfView(folder_item_view)); + const gfx::Rect view_ideal_bounds = view_model_.ideal_bounds( + view_model_.GetIndexOfView(folder_item_view).value()); const gfx::Rect icon_ideal_bounds = folder_item_view->GetIconBoundsForTargetViewBounds( app_list_config_, view_ideal_bounds, @@ -1945,7 +1946,7 @@ bool cancel_drag, std::unique_ptr<AppDragIconProxy> drag_icon_proxy) { DCHECK(!IsInFolder()); - DCHECK_NE(-1, view_model_.GetIndexOfView(original_parent_item_view)); + DCHECK(view_model_.GetIndexOfView(original_parent_item_view).has_value()); // EndDrag was called before if |drag_view_| is nullptr. if (!drag_item_) @@ -2039,7 +2040,7 @@ DCHECK(key_code == ui::VKEY_LEFT || key_code == ui::VKEY_RIGHT || key_code == ui::VKEY_UP || key_code == ui::VKEY_DOWN); DCHECK(!folder_delegate_); - DCHECK_NE(-1, view_model_.GetIndexOfView(original_parent_item_view)); + DCHECK(view_model_.GetIndexOfView(original_parent_item_view).has_value()); // Set |original_parent_item_view| selected so |target_index| will be // computed relative to the open folder. @@ -2190,8 +2191,8 @@ bounds_animator_->Cancel(); drag_icon_proxy_.reset(); - const int total_views = view_model_.view_size(); - for (int i = 0; i < total_views; ++i) { + const size_t total_views = view_model_.view_size(); + for (size_t i = 0; i < total_views; ++i) { if (view_model_.view_at(i)->layer()) view_model_.view_at(i)->layer()->CompleteAllAnimations(); } @@ -2456,10 +2457,10 @@ GridIndex start_index(GetSelectedPage(), 0); if (!IsValidIndex(start_index)) return; - int start = view_structure_.GetModelIndexFromIndex(start_index); - int end = + size_t start = view_structure_.GetModelIndexFromIndex(start_index); + size_t end = std::min(view_model_.view_size(), start + TilesPerPage(start_index.page)); - for (int i = start; i < end; ++i) + for (size_t i = start; i < end; ++i) GetItemViewAt(i)->CancelContextMenu(); } @@ -2761,8 +2762,10 @@ const ui::KeyboardCode backward = base::i18n::IsRTL() ? ui::VKEY_RIGHT : ui::VKEY_LEFT; - const int target_model_index = view_model_.GetIndexOfView(selected_view_) + - ((key_code == backward) ? -1 : 1); + size_t target_model_index = + view_model_.GetIndexOfView(selected_view_).value(); + if (target_model_index > 0 || key_code != backward) + target_model_index += (key_code == backward) ? -1 : 1; // A forward move on the last item in |view_model_| should result in page // creation. @@ -2779,8 +2782,7 @@ } target_index = GetIndexOfView( - static_cast<const AppListItemView*>(GetItemViewAt(std::min( - std::max(0, target_model_index), view_model_.view_size() - 1)))); + static_cast<const AppListItemView*>(GetItemViewAt(target_model_index))); if (view_structure_.mode() == PagedViewStructure::Mode::kPartialPages && key_code == backward && target_index.page < source_index.page && !view_structure_.IsFullPage(target_index.page)) { @@ -2940,7 +2942,7 @@ bool AppsGridView::IsValidIndex(const GridIndex& index) const { return index.page >= 0 && index.page < GetTotalPages() && index.slot >= 0 && index.slot < TilesPerPage(index.page) && - view_structure_.GetModelIndexFromIndex(index) < + static_cast<size_t>(view_structure_.GetModelIndexFromIndex(index)) < view_model_.view_size(); } @@ -2982,7 +2984,7 @@ return TilesPerPage(page); // We are on the last page, so calculate the number of items on the page. - int item_count = view_model_.view_size(); + size_t item_count = view_model_.view_size(); int current_page = 0; while (current_page < GetTotalPages() - 1) { item_count -= TilesPerPage(current_page); @@ -3105,7 +3107,7 @@ } void AppsGridView::PrepareItemsForBoundsAnimation() { - for (int i = 0; i < view_model_.view_size(); ++i) + for (size_t i = 0; i < view_model_.view_size(); ++i) view_model_.view_at(i)->EnsureLayer(); } @@ -3165,7 +3167,7 @@ // painting cost incurred by the bounds changes because of reorder. The // fade in animation should be responsible for reshowing the item views that // are within the visible view port after reorder. - for (int view_index = 0; view_index < view_model_.view_size(); + for (size_t view_index = 0; view_index < view_model_.view_size(); ++view_index) { view_model_.view_at(view_index)->SetVisible(false); } @@ -3208,7 +3210,8 @@ layer()->SetOpacity(1.f); // Ensure that all item views are visible after fade in animation completes. - for (int view_index = 0; view_index < view_model_.view_size(); ++view_index) { + for (size_t view_index = 0; view_index < view_model_.view_size(); + ++view_index) { view_model_.view_at(view_index)->SetVisible(true); }
diff --git a/ash/app_list/views/apps_grid_view.h b/ash/app_list/views/apps_grid_view.h index a68e060..16f6f6d6 100644 --- a/ash/app_list/views/apps_grid_view.h +++ b/ash/app_list/views/apps_grid_view.h
@@ -469,7 +469,7 @@ // Sets the ideal bounds for view at index `view_inde_in_model` in // `view_model_`. The bounds are set to match the expected tile bounds at // `view_grid_index` in the apps grid. - void SetIdealBoundsForViewToGridIndex(int view_index_in_model, + void SetIdealBoundsForViewToGridIndex(size_t view_index_in_model, const GridIndex& view_grid_index); // Calculates the item views' bounds for both folder and non-folder.
diff --git a/ash/app_list/views/apps_grid_view_test_api.cc b/ash/app_list/views/apps_grid_view_test_api.cc index ffe23666..fadb2b6 100644 --- a/ash/app_list/views/apps_grid_view_test_api.cc +++ b/ash/app_list/views/apps_grid_view_test_api.cc
@@ -92,7 +92,7 @@ ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_RETURN, ui::EF_NONE)); } -int AppsGridViewTestApi::TilesPerPage(int page) const { +size_t AppsGridViewTestApi::TilesPerPage(int page) const { return view_->TilesPerPage(page); }
diff --git a/ash/app_list/views/apps_grid_view_test_api.h b/ash/app_list/views/apps_grid_view_test_api.h index 4e26b2f..d4c0664 100644 --- a/ash/app_list/views/apps_grid_view_test_api.h +++ b/ash/app_list/views/apps_grid_view_test_api.h
@@ -48,7 +48,7 @@ void PressItemAt(int index); - int TilesPerPage(int page) const; + size_t TilesPerPage(int page) const; int AppsOnPage(int page) const;
diff --git a/ash/app_list/views/apps_grid_view_unittest.cc b/ash/app_list/views/apps_grid_view_unittest.cc index a3fbce6..2a19bd4 100644 --- a/ash/app_list/views/apps_grid_view_unittest.cc +++ b/ash/app_list/views/apps_grid_view_unittest.cc
@@ -423,7 +423,9 @@ return test_api_->GetItemTileRectOnCurrentPageAt(row, col); } - int GetTilesPerPage(int page) const { return test_api_->TilesPerPage(page); } + size_t GetTilesPerPage(int page) const { + return test_api_->TilesPerPage(page); + } PaginationModel* GetPaginationModel() const { DCHECK(paged_apps_grid_view_) << "Only available in tablet mode or when " @@ -505,11 +507,11 @@ void TestAppListItemViewIndice() { const views::ViewModelT<AppListItemView>* view_model = apps_grid_view_->view_model(); - DCHECK_GT(view_model->view_size(), 0); + DCHECK_GT(view_model->view_size(), 0u); views::View* items_container = apps_grid_view_->items_container_; auto app_iter = items_container->FindChild(view_model->view_at(0)); DCHECK(app_iter != items_container->children().cend()); - for (int i = 1; i < view_model->view_size(); ++i) { + for (size_t i = 1; i < view_model->view_size(); ++i) { ++app_iter; ASSERT_NE(items_container->children().cend(), app_iter); EXPECT_EQ(view_model->view_at(i), *app_iter); @@ -1024,7 +1026,7 @@ // Four items should have a layer copy used for animating between rows. EXPECT_EQ(4, GetNumberOfRowChangeLayersForTest()); - for (int i = 1; i < view_model->view_size(); i++) { + for (size_t i = 1; i < view_model->view_size(); i++) { AppListItemView* item_view = view_model->view_at(i); // The first item and items off screen on the second page should not // animate. @@ -1383,33 +1385,33 @@ AppsGridView* items_grid_view = app_list_folder_view()->items_grid_view(); AppsGridViewTestApi folder_grid_test_api(items_grid_view); test_api_->PressItemAt(0); - EXPECT_EQ(2, items_grid_view->view_model()->view_size()); + EXPECT_EQ(2u, items_grid_view->view_model()->view_size()); EXPECT_EQ(2, items_grid_view->cols()); - EXPECT_EQ(2, folder_grid_test_api.TilesPerPage(0)); + EXPECT_EQ(2u, folder_grid_test_api.TilesPerPage(0)); app_list_folder_view()->CloseFolderPage(); test_api_->PressItemAt(1); - EXPECT_EQ(5, items_grid_view->view_model()->view_size()); + EXPECT_EQ(5u, items_grid_view->view_model()->view_size()); EXPECT_EQ(3, items_grid_view->cols()); - EXPECT_EQ(6, folder_grid_test_api.TilesPerPage(0)); + EXPECT_EQ(6u, folder_grid_test_api.TilesPerPage(0)); app_list_folder_view()->CloseFolderPage(); test_api_->PressItemAt(2); - EXPECT_EQ(9, items_grid_view->view_model()->view_size()); + EXPECT_EQ(9u, items_grid_view->view_model()->view_size()); EXPECT_EQ(3, items_grid_view->cols()); - EXPECT_EQ(9, folder_grid_test_api.TilesPerPage(0)); + EXPECT_EQ(9u, folder_grid_test_api.TilesPerPage(0)); app_list_folder_view()->CloseFolderPage(); test_api_->PressItemAt(3); - EXPECT_EQ(15, items_grid_view->view_model()->view_size()); + EXPECT_EQ(15u, items_grid_view->view_model()->view_size()); EXPECT_EQ(4, items_grid_view->cols()); - EXPECT_EQ(16, folder_grid_test_api.TilesPerPage(0)); + EXPECT_EQ(16u, folder_grid_test_api.TilesPerPage(0)); app_list_folder_view()->CloseFolderPage(); test_api_->PressItemAt(4); - EXPECT_EQ(17, items_grid_view->view_model()->view_size()); + EXPECT_EQ(17u, items_grid_view->view_model()->view_size()); EXPECT_EQ(4, items_grid_view->cols()); - EXPECT_EQ(features::IsProductivityLauncherEnabled() ? 20 : 16, + EXPECT_EQ(features::IsProductivityLauncherEnabled() ? 20u : 16u, folder_grid_test_api.TilesPerPage(0)); app_list_folder_view()->CloseFolderPage(); } @@ -1926,7 +1928,8 @@ EXPECT_EQ(4, folder_apps_grid_view()->cols()); // Productivity launcher uses scrollable folders, not paged. if (!features::IsProductivityLauncherEnabled()) { - EXPECT_EQ(16, AppsGridViewTestApi(folder_apps_grid_view()).TilesPerPage(0)); + EXPECT_EQ(16u, + AppsGridViewTestApi(folder_apps_grid_view()).TilesPerPage(0)); EXPECT_EQ(1, GetTotalPages(folder_apps_grid_view())); EXPECT_EQ(0, GetSelectedPage(folder_apps_grid_view())); } @@ -2193,7 +2196,7 @@ EXPECT_EQ(1, GetSelectedPage(folder_apps_grid_view())); EXPECT_EQ(4, folder_apps_grid_view()->cols()); - EXPECT_EQ(16, AppsGridViewTestApi(folder_apps_grid_view()).TilesPerPage(0)); + EXPECT_EQ(16u, AppsGridViewTestApi(folder_apps_grid_view()).TilesPerPage(0)); EXPECT_TRUE(folder_apps_grid_view()->IsInFolder()); } @@ -3516,7 +3519,7 @@ ASSERT_TRUE(reparented_item_view->item()); std::string reparented_item_id = reparented_item_view->item()->id(); - EXPECT_EQ(base::StringPrintf("Item %d", GetTilesPerPage(0) - 2), + EXPECT_EQ("Item " + base::NumberToString(GetTilesPerPage(0) - 2), reparented_item_id); ASSERT_TRUE(reparented_item_view->HasFocus()); @@ -3880,7 +3883,7 @@ ASSERT_TRUE(paged_apps_grid_view_); // Create 2 full pages of apps, and add another app to overflow to third page. - const int kTotalApps = GetTilesPerPage(0) + GetTilesPerPage(1) + 1; + const size_t kTotalApps = GetTilesPerPage(0) + GetTilesPerPage(1) + 1; model_->PopulateApps(kTotalApps); EXPECT_EQ(3, GetPaginationModel()->total_pages()); @@ -3898,7 +3901,7 @@ ASSERT_TRUE(paged_apps_grid_view_); // Create 2 full pages of apps, and add another app to overflow to third page. - const int kTotalApps = GetTilesPerPage(0) + GetTilesPerPage(1) - 1; + const size_t kTotalApps = GetTilesPerPage(0) + GetTilesPerPage(1) - 1; model_->PopulateApps(kTotalApps); EXPECT_EQ(2, GetPaginationModel()->total_pages()); @@ -3917,7 +3920,7 @@ UpdateDisplay("1024x768/r"); // Create 2 full pages of apps, and add another app to overflow to third page. - const int kTotalApps = GetTilesPerPage(0) + GetTilesPerPage(1) + 1; + const size_t kTotalApps = GetTilesPerPage(0) + GetTilesPerPage(1) + 1; model_->PopulateApps(kTotalApps); EXPECT_EQ(3, GetPaginationModel()->total_pages()); @@ -3936,7 +3939,7 @@ UpdateDisplay("1024x768/r"); // Create 2 full pages of apps, and add another app to overflow to third page. - const int kTotalApps = GetTilesPerPage(0) + GetTilesPerPage(1) - 1; + const size_t kTotalApps = GetTilesPerPage(0) + GetTilesPerPage(1) - 1; model_->PopulateApps(kTotalApps); EXPECT_EQ(2, GetPaginationModel()->total_pages()); @@ -4064,7 +4067,7 @@ // Leave the dragged item as a single folder child. model_->DeleteItem("Item 1"); // One folder and one app. Therefore the top level view count is 2. - EXPECT_EQ(2, apps_grid_view_->view_model()->view_size()); + EXPECT_EQ(2u, apps_grid_view_->view_model()->view_size()); // Open the folder. test_api_->PressItemAt(0); @@ -4094,7 +4097,7 @@ // The folder should be deleted. The first item should be Item 2, the second // item should be Item 0. - EXPECT_EQ(2, apps_grid_view_->view_model()->view_size()); + EXPECT_EQ(2u, apps_grid_view_->view_model()->view_size()); EXPECT_EQ("Item 2", GetItemViewInTopLevelGrid(0)->item()->id()); EXPECT_EQ("Item 0", GetItemViewInTopLevelGrid(1)->item()->id()); @@ -4549,7 +4552,7 @@ TestAppListItemViewIndice(); const views::ViewModelT<AppListItemView>* view_model = apps_grid_view_->view_model(); - EXPECT_EQ(2, view_model->view_size()); + EXPECT_EQ(2u, view_model->view_size()); EXPECT_EQ(view_model->view_at(0), test_api_->GetViewAtVisualIndex(0 /* page */, 0 /* slot */)); EXPECT_EQ("Item 0", view_model->view_at(0)->item()->id()); @@ -4574,7 +4577,7 @@ model_->top_level_item_list()->item_at(0)->GetItemType()); EXPECT_EQ(kTotalItems, folder_item->ChildItemCount()); EXPECT_EQ(4, folder_apps_grid_view()->cols()); - EXPECT_EQ(16, AppsGridViewTestApi(folder_apps_grid_view()).TilesPerPage(0)); + EXPECT_EQ(16u, AppsGridViewTestApi(folder_apps_grid_view()).TilesPerPage(0)); EXPECT_EQ(1, GetTotalPages(folder_apps_grid_view())); EXPECT_EQ(0, GetSelectedPage(folder_apps_grid_view())); EXPECT_TRUE(folder_apps_grid_view()->IsInFolder()); @@ -4601,7 +4604,7 @@ EXPECT_EQ(1, GetPaginationModel()->selected_page()); EXPECT_EQ(2, GetPaginationModel()->total_pages()); TestAppListItemViewIndice(); - EXPECT_EQ(2, view_model->view_size()); + EXPECT_EQ(2u, view_model->view_size()); EXPECT_EQ(view_model->view_at(0), test_api_->GetViewAtVisualIndex(0 /* page */, 0 /* slot */)); EXPECT_EQ("Item 1", view_model->view_at(0)->item()->id()); @@ -4641,7 +4644,7 @@ EXPECT_EQ("1,0", page_flip_waiter_->selected_pages()); EXPECT_EQ(0, GetPaginationModel()->selected_page()); TestAppListItemViewIndice(); - EXPECT_EQ(1, view_model->view_size()); + EXPECT_EQ(1u, view_model->view_size()); EXPECT_EQ(view_model->view_at(0), test_api_->GetViewAtVisualIndex(0 /* page */, 0 /* slot */)); const AppListItem* folder_item = view_model->view_at(0)->item(); @@ -4681,7 +4684,7 @@ EXPECT_EQ("1,0", page_flip_waiter_->selected_pages()); EXPECT_EQ(0, GetPaginationModel()->selected_page()); TestAppListItemViewIndice(); - EXPECT_EQ(2, view_model->view_size()); + EXPECT_EQ(2u, view_model->view_size()); EXPECT_EQ(view_model->view_at(0), test_api_->GetViewAtVisualIndex(0 /* page */, 0 /* slot */)); EXPECT_EQ("Item 1", view_model->view_at(0)->item()->id()); @@ -4721,7 +4724,7 @@ EXPECT_EQ("1,0", page_flip_waiter_->selected_pages()); EXPECT_EQ(0, GetPaginationModel()->selected_page()); TestAppListItemViewIndice(); - EXPECT_EQ(1, view_model->view_size()); + EXPECT_EQ(1u, view_model->view_size()); EXPECT_EQ(view_model->view_at(0), test_api_->GetViewAtVisualIndex(0 /* page */, 0 /* slot */)); EXPECT_EQ("Item 0", view_model->view_at(0)->item()->id()); @@ -4747,7 +4750,7 @@ const views::ViewModelT<AppListItemView>* view_model = apps_grid_view_->view_model(); - EXPECT_EQ(2, view_model->view_size()); + EXPECT_EQ(2u, view_model->view_size()); TestAppListItemViewIndice(); // Update the model, and verify the apps grid gets updated. @@ -4763,7 +4766,7 @@ UpdateLayout(); // Verify that the view model size matches the new model. - EXPECT_EQ(7, view_model->view_size()); + EXPECT_EQ(7u, view_model->view_size()); TestAppListItemViewIndice(); // Verify that clicking an item activates it. @@ -4774,7 +4777,7 @@ LeftClickOn(view_model->view_at(3)); EXPECT_TRUE(GetAppListTestHelper()->IsInFolderView()); - ASSERT_EQ(5, folder_apps_grid_view()->view_model()->view_size()); + ASSERT_EQ(5u, folder_apps_grid_view()->view_model()->view_size()); // Click on an item within the folder. LeftClickOn(folder_apps_grid_view()->view_model()->view_at(1)); @@ -4785,14 +4788,14 @@ /*profile_id=*/1, model_.get(), search_model_.get()); UpdateLayout(); EXPECT_FALSE(GetAppListTestHelper()->IsInFolderView()); - EXPECT_EQ(2, view_model->view_size()); + EXPECT_EQ(2u, view_model->view_size()); TestAppListItemViewIndice(); LeftClickOn(view_model->view_at(1)); EXPECT_EQ("Item 1", GetTestAppListClient()->activate_item_last_id()); Shell::Get()->app_list_controller()->ClearActiveModel(); - EXPECT_EQ(0, view_model->view_size()); + EXPECT_EQ(0u, view_model->view_size()); } TEST_P(AppsGridViewClamshellAndTabletTest, @@ -4802,7 +4805,7 @@ model_->CreateAndPopulateFolderWithApps(5); // `GetTilesPerPage()` may return a large number for bubble launcher - ensure // the number of test apps is not excessive. - model_->PopulateApps(std::min(30, GetTilesPerPage(0))); + model_->PopulateApps(std::min(size_t{30}, GetTilesPerPage(0))); UpdateLayout(); // Open the folder view. @@ -4865,7 +4868,7 @@ model_->CreateAndPopulateFolderWithApps(5); // `GetTilesPerPage()` may return a large number for bubble launcher - ensure // the number of test apps is not excessive. - model_->PopulateApps(std::min(30, GetTilesPerPage(0))); + model_->PopulateApps(std::min(size_t{30}, GetTilesPerPage(0))); UpdateLayout(); // Open the folder view. @@ -4928,7 +4931,7 @@ // ProductivityLauncher feature. TEST_P(AppsGridViewDragNonBubbleTest, PageBreakItemAddedAfterDrag) { // There are two pages and last item is on second page. - const int kApps = 2 + GetTilesPerPage(0); + const size_t kApps = 2 + GetTilesPerPage(0); model_->PopulateApps(kApps); GetPaginationModel()->SelectPage(1, false); InitiateDragForItemAtCurrentPageAt(AppsGridView::MOUSE, 0, 1, @@ -4942,7 +4945,7 @@ // A "page break" item is added to split the pages. std::string model_content = "Item " + base::NumberToString(kApps - 1); - for (int i = 1; i < kApps; ++i) { + for (size_t i = 1; i < kApps; ++i) { model_content.append(",Item " + base::NumberToString(i - 1)); if (i == GetTilesPerPage(0) - 1) model_content.append(",PageBreakItem"); @@ -4952,7 +4955,7 @@ TEST_P(AppsGridViewTabletTest, MoveItemToPreviousFullPage) { // There are two pages and last item is on second page. - const int kApps = 2 + GetTilesPerPage(0); + const size_t kApps = 2 + GetTilesPerPage(0); model_->PopulateApps(kApps); const views::ViewModelT<AppListItemView>* view_model = apps_grid_view_->view_model(); @@ -4974,7 +4977,7 @@ EXPECT_EQ(0, GetPaginationModel()->selected_page()); TestAppListItemViewIndice(); EXPECT_EQ(kApps, view_model->view_size()); - for (int i = 0; i < kApps; ++i) { + for (size_t i = 0; i < kApps; ++i) { int page = i / GetTilesPerPage(0); int slot = i % GetTilesPerPage(0); EXPECT_EQ(view_model->view_at(i), @@ -4989,7 +4992,7 @@ // ProductivityLauncher feature. TEST_P(AppsGridViewDragNonBubbleTest, MoveItemSubsequentDragKeepPageBreak) { // There are two pages and last item is on second page. - const int kApps = 2 + GetTilesPerPage(0); + const size_t kApps = 2 + GetTilesPerPage(0); model_->PopulateApps(kApps); const views::ViewModelT<AppListItemView>* view_model = apps_grid_view_->view_model(); @@ -5016,9 +5019,9 @@ EXPECT_EQ(0, GetPaginationModel()->selected_page()); TestAppListItemViewIndice(); EXPECT_EQ(kApps, view_model->view_size()); - for (int i = 0; i < kApps; ++i) { - int page = i / GetTilesPerPage(0); - int slot = i % GetTilesPerPage(0); + for (size_t i = 0; i < kApps; ++i) { + size_t page = i / GetTilesPerPage(0); + size_t slot = i % GetTilesPerPage(0); EXPECT_EQ(view_model->view_at(i), test_api_->GetViewAtVisualIndex(page, slot)); EXPECT_EQ("Item " + base::NumberToString((i + kApps - 2) % kApps), @@ -5027,7 +5030,7 @@ // A "page break" item still exists. std::string model_content = "Item " + base::NumberToString(kApps - 2) + ",Item " + base::NumberToString(kApps - 1); - for (int i = 2; i < kApps; ++i) { + for (size_t i = 2; i < kApps; ++i) { model_content.append(",Item " + base::NumberToString(i - 2)); if (i == GetTilesPerPage(0) - 1) model_content.append(",PageBreakItem"); @@ -5762,18 +5765,18 @@ TEST_F(AppsGridViewTest, PulsingBlocksShowDuringAppListSync) { model_->PopulateApps(3); UpdateLayout(); - EXPECT_EQ(0, GetPulsingBlocksModel().view_size()); + EXPECT_EQ(0u, GetPulsingBlocksModel().view_size()); // Set the model status as syncing. The Pulsing blocks model should not be // empty. model_->SetStatus(AppListModelStatus::kStatusSyncing); UpdateLayout(); - EXPECT_NE(0, GetPulsingBlocksModel().view_size()); + EXPECT_NE(0u, GetPulsingBlocksModel().view_size()); // Set the model status as normal. The Pulsing blocks model should be empty. model_->SetStatus(AppListModelStatus::kStatusNormal); UpdateLayout(); - EXPECT_EQ(0, GetPulsingBlocksModel().view_size()); + EXPECT_EQ(0u, GetPulsingBlocksModel().view_size()); } } // namespace test
diff --git a/ash/app_list/views/paged_apps_grid_view.cc b/ash/app_list/views/paged_apps_grid_view.cc index 171567f..1206967 100644 --- a/ash/app_list/views/paged_apps_grid_view.cc +++ b/ash/app_list/views/paged_apps_grid_view.cc
@@ -547,7 +547,7 @@ } CalculateIdealBounds(); - for (int i = 0; i < view_model()->view_size(); ++i) { + for (size_t i = 0; i < view_model()->view_size(); ++i) { AppListItemView* view = GetItemViewAt(i); view->SetBoundsRect(view_model()->ideal_bounds(i)); } @@ -704,9 +704,9 @@ // Folders have the same number of tiles on every page, while the root // level grid can have a different number of tiles per page. - int tiles = view_model()->view_size(); + size_t tiles = view_model()->view_size(); int total_pages = 1; - int tiles_on_page = TilesPerPage(0); + size_t tiles_on_page = TilesPerPage(0); while (tiles > tiles_on_page) { tiles -= tiles_on_page; ++total_pages; @@ -1180,7 +1180,7 @@ RecenterItemsContainer(); // Drag view can be nullptr or moved from the model by EndDrag. - const int number_of_views_to_animate = view_model()->view_size(); + const size_t number_of_views_to_animate = view_model()->view_size(); base::RepeatingClosure on_bounds_animator_callback; if (number_of_views_to_animate > 0) { @@ -1211,7 +1211,7 @@ gfx::Vector2d translate_offset( 0, start_position.y() - items_container()->origin().y()); - for (int i = 0; i < view_model()->view_size(); ++i) { + for (size_t i = 0; i < view_model()->view_size(); ++i) { AppListItemView* entry_view = view_model()->view_at(i); // Reposition view bounds to compensate for the translation offset. gfx::Rect current_bounds = entry_view->bounds();
diff --git a/ash/app_list/views/paged_apps_grid_view_unittest.cc b/ash/app_list/views/paged_apps_grid_view_unittest.cc index 1f46cbc9..028e8d000 100644 --- a/ash/app_list/views/paged_apps_grid_view_unittest.cc +++ b/ash/app_list/views/paged_apps_grid_view_unittest.cc
@@ -656,7 +656,7 @@ // Item views should animate upwards to take the place of the closed reorder // toast. - for (int i = 1; i < view_model->view_size(); i++) { + for (size_t i = 1; i < view_model->view_size(); i++) { AppListItemView* item_view = view_model->view_at(i); // The items off screen on the second page should not animate. if (i >= grid_test_api_->TilesPerPage(0)) {
diff --git a/ash/app_list/views/scrollable_apps_grid_view.cc b/ash/app_list/views/scrollable_apps_grid_view.cc index fc10bb0..58c5821 100644 --- a/ash/app_list/views/scrollable_apps_grid_view.cc +++ b/ash/app_list/views/scrollable_apps_grid_view.cc
@@ -86,7 +86,7 @@ items_container()->SetBoundsRect(GetContentsBounds()); CalculateIdealBounds(); - for (int i = 0; i < view_model()->view_size(); ++i) { + for (size_t i = 0; i < view_model()->view_size(); ++i) { AppListItemView* view = GetItemViewAt(i); view->SetBoundsRect(view_model()->ideal_bounds(i)); } @@ -119,7 +119,7 @@ gfx::Size ScrollableAppsGridView::GetTileGridSize() const { // AppListItemList may contain page break items, so use the view_model(). - int items = view_model()->view_size(); + size_t items = view_model()->view_size(); // Tests sometimes start with 0 items. Ensure space for at least 1 item. if (items == 0) { items = 1; @@ -313,7 +313,7 @@ absl::optional<int> first_invisible_row; const gfx::Rect scroll_view_visible_rect = scroll_view_->GetVisibleRect(); - for (int view_index = 0; view_index < view_model()->view_size(); + for (size_t view_index = 0; view_index < view_model()->view_size(); view_index += cols()) { // Calculate an item view's bounds in the scroll content's coordinates. gfx::Point item_view_local_origin;
diff --git a/ash/app_list/views/search_result_actions_view.cc b/ash/app_list/views/search_result_actions_view.cc index c1d48ec..98747df3 100644 --- a/ash/app_list/views/search_result_actions_view.cc +++ b/ash/app_list/views/search_result_actions_view.cc
@@ -16,8 +16,10 @@ #include "ash/public/cpp/app_list/app_list_color_provider.h" #include "ash/public/cpp/app_list/app_list_config.h" #include "ash/public/cpp/app_list/vector_icons/vector_icons.h" +#include "ash/public/cpp/style/scoped_light_mode_as_default.h" #include "ash/style/icon_button.h" #include "base/bind.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/insets.h" @@ -56,6 +58,7 @@ // IconButton: void OnGestureEvent(ui::GestureEvent* event) override; + void OnThemeChanged() override; // Updates the button visibility upon state change of the button or the // search result view associated with it. @@ -113,6 +116,15 @@ Button::OnGestureEvent(event); } +void SearchResultActionButton::OnThemeChanged() { + absl::optional<ScopedLightModeAsDefault> default_light_mode; + // Non-productivity launcher search UI has light background. + if (!features::IsProductivityLauncherEnabled()) + default_light_mode.emplace(); + + IconButton::OnThemeChanged(); +} + void SearchResultActionButton::UpdateOnStateChanged() { // Show button if the associated result row is hovered or selected, or one // of the action buttons is selected.
diff --git a/ash/ash_prefs.cc b/ash/ash_prefs.cc index bab8b82..44bc8ab 100644 --- a/ash/ash_prefs.cc +++ b/ash/ash_prefs.cc
@@ -4,7 +4,6 @@ #include "ash/public/cpp/ash_prefs.h" -#include "ash/accelerators/accelerator_controller_impl.h" #include "ash/accessibility/accessibility_controller_impl.h" #include "ash/accessibility/magnifier/docked_magnifier_controller.h" #include "ash/ambient/ambient_controller.h" @@ -69,7 +68,6 @@ // Registers prefs whose default values are same in user and signin prefs. void RegisterProfilePrefs(PrefRegistrySimple* registry, bool for_test) { - AcceleratorControllerImpl::RegisterProfilePrefs(registry); AccessibilityControllerImpl::RegisterProfilePrefs(registry); AppListControllerImpl::RegisterProfilePrefs(registry); AssistantControllerImpl::RegisterProfilePrefs(registry);
diff --git a/ash/capture_mode/capture_mode_session.cc b/ash/capture_mode/capture_mode_session.cc index a2bca072..5c1a878 100644 --- a/ash/capture_mode/capture_mode_session.cc +++ b/ash/capture_mode/capture_mode_session.cc
@@ -26,11 +26,13 @@ #include "ash/constants/ash_features.h" #include "ash/display/mouse_cursor_event_filter.h" #include "ash/display/screen_orientation_controller.h" +#include "ash/display/window_tree_host_manager.h" #include "ash/keyboard/ui/keyboard_ui_controller.h" #include "ash/projector/projector_controller_impl.h" #include "ash/public/cpp/resources/grit/ash_public_unscaled_resources.h" #include "ash/public/cpp/shell_window_ids.h" #include "ash/resources/vector_icons/vector_icons.h" +#include "ash/root_window_controller.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" #include "ash/style/ash_color_provider.h" @@ -662,7 +664,6 @@ UpdateRootWindowDimmers(); TabletModeController::Get()->AddObserver(this); - current_root_->AddObserver(this); display_observer_.emplace(this); // Our event handling code assumes the capture bar widget has been initialized // already. So we start handling events after everything has been setup. @@ -686,6 +687,8 @@ auto* camera_controller = controller_->camera_controller(); if (is_in_projector_mode_ && camera_controller) camera_controller->MaybeSelectFirstCamera(); + + Shell::Get()->AddShellObserver(this); } void CaptureModeSession::Shutdown() { @@ -694,7 +697,6 @@ aura::Env::GetInstance()->RemovePreTargetHandler(this); display_observer_.reset(); user_nudge_controller_.reset(); - current_root_->RemoveObserver(this); TabletModeController::Get()->RemoveObserver(this); if (input_capture_window_) { input_capture_window_->RemoveObserver(this); @@ -730,6 +732,8 @@ controller_->camera_controller()->SetShouldShowPreview(false); } } + + Shell::Get()->RemoveShellObserver(this); } aura::Window* CaptureModeSession::GetSelectedWindow() const { @@ -1214,13 +1218,17 @@ } void CaptureModeSession::OnWindowDestroying(aura::Window* window) { - if (window == input_capture_window_) { - input_capture_window_->RemoveObserver(this); - input_capture_window_ = nullptr; - return; + DCHECK_EQ(window, input_capture_window_); + input_capture_window_->RemoveObserver(this); + input_capture_window_ = nullptr; +} + +void CaptureModeSession::OnRootWindowWillShutdown(aura::Window* root_window) { + if (root_window == current_root_) { + // There should always be a primary root window. + DCHECK_NE(Shell::GetPrimaryRootWindow(), current_root_); + MaybeChangeRoot(Shell::GetPrimaryRootWindow()); } - DCHECK_EQ(current_root_, window); - MaybeChangeRoot(Shell::GetPrimaryRootWindow()); } void CaptureModeSession::OnDisplayMetricsChanged( @@ -2613,9 +2621,6 @@ if (new_root == current_root_) return; - current_root_->RemoveObserver(this); - new_root->AddObserver(this); - auto* new_parent = GetParentContainer(new_root); parent_container_observer_ = std::make_unique<ParentContainerObserver>(new_parent, this);
diff --git a/ash/capture_mode/capture_mode_session.h b/ash/capture_mode/capture_mode_session.h index 52210beb..38ae036 100644 --- a/ash/capture_mode/capture_mode_session.h +++ b/ash/capture_mode/capture_mode_session.h
@@ -14,6 +14,7 @@ #include "ash/capture_mode/capture_mode_types.h" #include "ash/capture_mode/folder_selection_dialog_controller.h" #include "ash/public/cpp/tablet_mode_observer.h" +#include "ash/shell_observer.h" #include "base/containers/flat_set.h" #include "base/memory/weak_ptr.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -57,7 +58,8 @@ public TabletModeObserver, public aura::WindowObserver, public display::DisplayObserver, - public FolderSelectionDialogController::Delegate { + public FolderSelectionDialogController::Delegate, + public ShellObserver { public: // Creates the bar widget on a calculated root window. |projector_mode| // specifies whether this session was started for the projector workflow. @@ -192,6 +194,9 @@ // aura::WindowObserver: void OnWindowDestroying(aura::Window* window) override; + // ShellObserver: + void OnRootWindowWillShutdown(aura::Window* root_window) override; + // display::DisplayObserver: void OnDisplayMetricsChanged(const display::Display& display, uint32_t metrics) override;
diff --git a/ash/capture_mode/capture_mode_unittests.cc b/ash/capture_mode/capture_mode_unittests.cc index 75b883ee..e1426cb 100644 --- a/ash/capture_mode/capture_mode_unittests.cc +++ b/ash/capture_mode/capture_mode_unittests.cc
@@ -1154,6 +1154,26 @@ ASSERT_EQ(Shell::GetAllRootWindows()[0], session->current_root()); } +// Tests behavior of a capture mode session if the active display is removed +// and countdown running. +TEST_F(CaptureModeTest, DisplayRemovalWithCountdownVisible) { + UpdateDisplay("800x700,801+0-800x700"); + + // Start capture mode on the secondary display. + auto recorded_window = CreateTestWindow(gfx::Rect(1000, 200, 400, 400)); + auto* controller = + StartCaptureSession(CaptureModeSource::kWindow, CaptureModeType::kVideo); + GetEventGenerator()->MoveMouseToCenterOf(recorded_window.get()); + + auto* session = controller->capture_mode_session(); + + RemoveSecondaryDisplay(); + + ASSERT_EQ(Shell::GetAllRootWindows()[0], session->current_root()); + + // Test passes if no crash. +} + // Tests that using fullscreen or window source, moving the mouse across // displays will change the root window of the capture session. TEST_F(CaptureModeTest, MultiDisplayFullscreenOrWindowSourceRootWindow) {
diff --git a/ash/components/audio/cros_audio_config.cc b/ash/components/audio/cros_audio_config.cc index 6377fd2..a137acc 100644 --- a/ash/components/audio/cros_audio_config.cc +++ b/ash/components/audio/cros_audio_config.cc
@@ -23,6 +23,7 @@ mojom::AudioSystemPropertiesPtr CrosAudioConfig::GetAudioSystemProperties() { auto properties = mojom::AudioSystemProperties::New(); properties->output_volume_percent = GetOutputVolumePercent(); + properties->output_mute_state = GetOutputMuteState(); return properties; }
diff --git a/ash/components/audio/cros_audio_config.h b/ash/components/audio/cros_audio_config.h index 50bd1f9..0ce52784 100644 --- a/ash/components/audio/cros_audio_config.h +++ b/ash/components/audio/cros_audio_config.h
@@ -31,7 +31,8 @@ void NotifyObserversAudioSystemPropertiesChanged(); - virtual uint8_t GetOutputVolumePercent() = 0; + virtual uint8_t GetOutputVolumePercent() const = 0; + virtual mojom::MuteState GetOutputMuteState() const = 0; private: // mojom::CrosAudioConfig:
diff --git a/ash/components/audio/cros_audio_config_impl.cc b/ash/components/audio/cros_audio_config_impl.cc index 5658355c..62d891b 100644 --- a/ash/components/audio/cros_audio_config_impl.cc +++ b/ash/components/audio/cros_audio_config_impl.cc
@@ -18,13 +18,25 @@ } } -uint8_t CrosAudioConfigImpl::GetOutputVolumePercent() { +uint8_t CrosAudioConfigImpl::GetOutputVolumePercent() const { return CrasAudioHandler::Get()->GetOutputVolumePercent(); }; +mojom::MuteState CrosAudioConfigImpl::GetOutputMuteState() const { + // TODO(owenzhang): Add kMutedByPolicy and kMutedExternally. + if (CrasAudioHandler::Get()->IsOutputMuted()) { + return mojom::MuteState::kMutedByUser; + } + return mojom::MuteState::kNotMuted; +}; + void CrosAudioConfigImpl::OnOutputNodeVolumeChanged(uint64_t node_id, int volume) { NotifyObserversAudioSystemPropertiesChanged(); }; +void CrosAudioConfigImpl::OnOutputMuteChanged(bool mute_on) { + NotifyObserversAudioSystemPropertiesChanged(); +}; + } // namespace ash::audio_config \ No newline at end of file
diff --git a/ash/components/audio/cros_audio_config_impl.h b/ash/components/audio/cros_audio_config_impl.h index e5c795ee..56be453 100644 --- a/ash/components/audio/cros_audio_config_impl.h +++ b/ash/components/audio/cros_audio_config_impl.h
@@ -20,10 +20,12 @@ private: // CrosAudioConfig: - uint8_t GetOutputVolumePercent() override; + uint8_t GetOutputVolumePercent() const override; + mojom::MuteState GetOutputMuteState() const override; // CrasAudioHandler::AudioObserver: void OnOutputNodeVolumeChanged(uint64_t node_id, int volume) override; + void OnOutputMuteChanged(bool mute_on) override; }; } // namespace ash::audio_config
diff --git a/ash/components/audio/cros_audio_config_impl_unittest.cc b/ash/components/audio/cros_audio_config_impl_unittest.cc index 53cc1be..9d297b9 100644 --- a/ash/components/audio/cros_audio_config_impl_unittest.cc +++ b/ash/components/audio/cros_audio_config_impl_unittest.cc
@@ -56,12 +56,9 @@ cros_audio_config_ = std::make_unique<CrosAudioConfigImpl>(); } - protected: - void SetOutputVolumePercent(uint8_t volume_percent) { - cras_audio_handler_->SetOutputVolumePercent(volume_percent); - base::RunLoop().RunUntilIdle(); - } + void TearDown() override { CrasAudioHandler::Shutdown(); } + protected: std::unique_ptr<FakeAudioSystemPropertiesObserver> Observe() { cros_audio_config_->BindPendingReceiver( remote_.BindNewPipeAndPassReceiver()); @@ -72,6 +69,23 @@ return fake_observer; } + void SetOutputVolumePercent(uint8_t volume_percent) { + cras_audio_handler_->SetOutputVolumePercent(volume_percent); + base::RunLoop().RunUntilIdle(); + } + + void SetOutputMuteState(mojom::MuteState mute_state) { + switch (mute_state) { + case mojom::MuteState::kMutedByUser: + cras_audio_handler_->SetOutputMute(true); + break; + case mojom::MuteState::kNotMuted: + cras_audio_handler_->SetOutputMute(false); + break; + } + base::RunLoop().RunUntilIdle(); + } + private: base::test::TaskEnvironment task_environment_; base::test::ScopedFeatureList scoped_feature_list_; @@ -83,6 +97,7 @@ TEST_F(CrosAudioConfigImplTest, GetOutputVolumePercent) { std::unique_ptr<FakeAudioSystemPropertiesObserver> fake_observer = Observe(); + // fake_observer count is first incremented in observe() method. ASSERT_EQ(1u, fake_observer->num_properties_updated_calls_); ASSERT_TRUE(fake_observer->last_audio_system_properties_.has_value()); ASSERT_EQ(kDefaultOutputVolumePercent, @@ -96,4 +111,25 @@ ->output_volume_percent); } +TEST_F(CrosAudioConfigImplTest, GetOutputMuteState) { + std::unique_ptr<FakeAudioSystemPropertiesObserver> fake_observer = Observe(); + ASSERT_EQ(1u, fake_observer->num_properties_updated_calls_); + ASSERT_TRUE(fake_observer->last_audio_system_properties_.has_value()); + EXPECT_EQ( + mojom::MuteState::kNotMuted, + fake_observer->last_audio_system_properties_.value()->output_mute_state); + + SetOutputMuteState(mojom::MuteState::kMutedByUser); + ASSERT_EQ(2u, fake_observer->num_properties_updated_calls_); + EXPECT_EQ( + mojom::MuteState::kMutedByUser, + fake_observer->last_audio_system_properties_.value()->output_mute_state); + + SetOutputMuteState(mojom::MuteState::kNotMuted); + ASSERT_EQ(3u, fake_observer->num_properties_updated_calls_); + EXPECT_EQ( + mojom::MuteState::kNotMuted, + fake_observer->last_audio_system_properties_.value()->output_mute_state); +} + } // namespace ash::audio_config
diff --git a/ash/components/audio/public/mojom/cros_audio_config.mojom b/ash/components/audio/public/mojom/cros_audio_config.mojom index 523d116c..69e77a9b 100644 --- a/ash/components/audio/public/mojom/cros_audio_config.mojom +++ b/ash/components/audio/public/mojom/cros_audio_config.mojom
@@ -4,10 +4,22 @@ module ash.audio_config.mojom; +// Represents the mute state of a user's audio device. +enum MuteState { + // The device is not muted. + kNotMuted, + + // The device is muted by the user. + kMutedByUser +}; + // Represents the audio state of the Audio system. struct AudioSystemProperties { // The volume of the active output device. uint8 output_volume_percent; + + // The mute state of the active output device. + MuteState output_mute_state; }; // Observer for changes to audio system properties.
diff --git a/ash/components/peripheral_notification/peripheral_notification_manager.cc b/ash/components/peripheral_notification/peripheral_notification_manager.cc index cab5909c..799b1f5 100644 --- a/ash/components/peripheral_notification/peripheral_notification_manager.cc +++ b/ash/components/peripheral_notification/peripheral_notification_manager.cc
@@ -130,9 +130,6 @@ void PeripheralNotificationManager::OnCableWarning( typecd::CableWarningType cable_warning_type) { - if (!base::FeatureList::IsEnabled(features::kUsbNotificationController)) - return; - // Decode cable warnging signal. switch (cable_warning_type) { case typecd::CableWarningType::kInvalidDpCable:
diff --git a/ash/components/peripheral_notification/peripheral_notification_manager_unittest.cc b/ash/components/peripheral_notification/peripheral_notification_manager_unittest.cc index 3a7436f..08799f2 100644 --- a/ash/components/peripheral_notification/peripheral_notification_manager_unittest.cc +++ b/ash/components/peripheral_notification/peripheral_notification_manager_unittest.cc
@@ -498,9 +498,6 @@ } TEST_F(PeripheralNotificationManagerTest, InvalidDpCableWarning) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(features::kUsbNotificationController); - InitializeManager(/*is_guest_profile=*/false, /*is_pcie_tunneling_allowed=*/false); @@ -525,8 +522,6 @@ } TEST_F(PeripheralNotificationManagerTest, InvalidUSB4ValidTBTCableWarning) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(features::kUsbNotificationController); InitializeManager(/*is_guest_profile=*/false, /*is_pcie_tunneling_allowed=*/false); EXPECT_EQ(0u, GetInvalidUSB4ValidTBTCableNotificationObserverCalls()); @@ -548,8 +543,6 @@ } TEST_F(PeripheralNotificationManagerTest, InvalidUSB4CableWarning) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(features::kUsbNotificationController); InitializeManager(/*is_guest_profile=*/false, /*is_pcie_tunneling_allowed=*/false); EXPECT_EQ(0u, GetInvalidUSB4CableNotificationObserverCalls()); @@ -571,8 +564,6 @@ } TEST_F(PeripheralNotificationManagerTest, InvalidTBTCableWarning) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(features::kUsbNotificationController); InitializeManager(/*is_guest_profile=*/false, /*is_pcie_tunneling_allowed=*/false); EXPECT_EQ(0u, GetInvalidTBTCableNotificationObserverCalls()); @@ -594,8 +585,6 @@ } TEST_F(PeripheralNotificationManagerTest, SpeedLimitingCableWarning) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(features::kUsbNotificationController); InitializeManager(/*is_guest_profile=*/false, /*is_pcie_tunneling_allowed=*/false); EXPECT_EQ(0u, GetSpeedLimitingCableNotificationObserverCalls());
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index 8ad0ef3..98e91f12 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -1481,11 +1481,6 @@ const base::Feature kUploadOfficeToCloud("UploadOfficeToCloud", base::FEATURE_DISABLED_BY_DEFAULT); -// Unblock the UsbPeripheralNotificationController class in ash to display -// USB related notifications from the type-c daemon in ChromeOS. -const base::Feature kUsbNotificationController{ - "UsbNotificationController", base::FEATURE_ENABLED_BY_DEFAULT}; - // Uses new AuthSession-based API in cryptohome to authenticate users during // sign-in. const base::Feature kUseAuthsessionAuthentication{
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index f6f96388..55219770 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -591,8 +591,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kTrilinearFiltering; COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kUploadOfficeToCloud; COMPONENT_EXPORT(ASH_CONSTANTS) -extern const base::Feature kUsbNotificationController; -COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kUseAuthsessionAuthentication; COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kUseBluetoothSystemInAsh;
diff --git a/ash/constants/ash_pref_names.cc b/ash/constants/ash_pref_names.cc index 960075c..2b98ce1 100644 --- a/ash/constants/ash_pref_names.cc +++ b/ash/constants/ash_pref_names.cc
@@ -922,11 +922,6 @@ // legacy shortcuts. const char kDeviceI18nShortcutsEnabled[] = "ash.device_i18n_shortcuts_enabled"; -// An integer pref that tracks how many times the user has been shown the -// notification about shortcuts changing. -const char kImprovedShortcutsNotificationShownCount[] = - "ash.improved_shortcuts_notification_shown_count"; - // If a user installs an extension which controls the proxy settings in the // primary profile of Chrome OS, this dictionary will contain information about // the extension controlling the proxy (name, id and if it can be disabled by
diff --git a/ash/constants/ash_pref_names.h b/ash/constants/ash_pref_names.h index 024838c..eaae5be5 100644 --- a/ash/constants/ash_pref_names.h +++ b/ash/constants/ash_pref_names.h
@@ -418,9 +418,6 @@ extern const char kDeviceI18nShortcutsEnabled[]; COMPONENT_EXPORT(ASH_CONSTANTS) -extern const char kImprovedShortcutsNotificationShownCount[]; - -COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kLacrosProxyControllingExtension[]; COMPONENT_EXPORT(ASH_CONSTANTS)
diff --git a/ash/constants/ash_switches.cc b/ash/constants/ash_switches.cc index a0df38c5..f387695 100644 --- a/ash/constants/ash_switches.cc +++ b/ash/constants/ash_switches.cc
@@ -866,6 +866,10 @@ // (e.g. via rootfs or downloadable content). const char kOndeviceHandwritingSwitch[] = "ondevice_handwriting"; +// Enable the getAccessToken autotest API which creates access tokens using +// the internal OAuth client ID. +const char kGetAccessTokenForTest[] = "get-access-token-for-test"; + bool IsAuthSessionCryptohomeEnabled() { return base::CommandLine::ForCurrentProcess()->HasSwitch( kCryptohomeUseAuthSession);
diff --git a/ash/constants/ash_switches.h b/ash/constants/ash_switches.h index 06f18bd..30b6663 100644 --- a/ash/constants/ash_switches.h +++ b/ash/constants/ash_switches.h
@@ -278,6 +278,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kWaitForInitialPolicyFetchForTest[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kOndeviceHandwritingSwitch[]; +COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kGetAccessTokenForTest[]; ////////////////////////////////////////////////////////////////////////////////
diff --git a/ash/display/window_tree_host_manager.h b/ash/display/window_tree_host_manager.h index 49bfa260..89de7dc 100644 --- a/ash/display/window_tree_host_manager.h +++ b/ash/display/window_tree_host_manager.h
@@ -124,7 +124,7 @@ // returns the primary root window only. aura::Window::Windows GetAllRootWindows(); - // Returns all oot window controllers. In non extended desktop + // Returns all root window controllers. In non extended desktop // mode, this return a RootWindowController for the primary root window only. std::vector<RootWindowController*> GetAllRootWindowControllers();
diff --git a/ash/in_session_auth/in_session_auth_dialog_controller_impl.cc b/ash/in_session_auth/in_session_auth_dialog_controller_impl.cc index a34b75b99..cd36813c 100644 --- a/ash/in_session_auth/in_session_auth_dialog_controller_impl.cc +++ b/ash/in_session_auth/in_session_auth_dialog_controller_impl.cc
@@ -17,6 +17,7 @@ OnAuthComplete on_auth_complete) { auto account_id = Shell::Get()->session_controller()->GetActiveAccountId(); DCHECK(account_id.is_valid()); + DCHECK_NE(auth_token_provider_, nullptr); // We don't manage the lifetime of `AuthenticationDialog` here. // `AuthenticatonDialog` is-a View and it is instead owned by it's widget,
diff --git a/ash/in_session_auth/in_session_auth_dialog_controller_impl.h b/ash/in_session_auth/in_session_auth_dialog_controller_impl.h index b9504e9..098add3 100644 --- a/ash/in_session_auth/in_session_auth_dialog_controller_impl.h +++ b/ash/in_session_auth/in_session_auth_dialog_controller_impl.h
@@ -23,7 +23,8 @@ // InSessionAuthDialogController overrides void ShowAuthDialog(Reason reason, OnAuthComplete on_auth_complete) override; - void SetTokenProvider(InSessionAuthTokenProvider* auth_token_provider); + void SetTokenProvider( + InSessionAuthTokenProvider* auth_token_provider) override; private: // Non owning pointer, initialized and owned by
diff --git a/ash/public/cpp/in_session_auth_dialog_controller.h b/ash/public/cpp/in_session_auth_dialog_controller.h index 14d3e14..c43f6bc7 100644 --- a/ash/public/cpp/in_session_auth_dialog_controller.h +++ b/ash/public/cpp/in_session_auth_dialog_controller.h
@@ -7,6 +7,7 @@ #include "ash/public/cpp/ash_public_export.h" #include "ash/public/cpp/in_session_auth_dialog_client.h" +#include "ash/public/cpp/in_session_auth_token_provider.h" #include "base/unguessable_token.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -44,6 +45,13 @@ // saved passwords"). virtual void ShowAuthDialog(Reason reason, OnAuthComplete on_auth_complete) = 0; + + // Must be called with a non null auth_token_provider prior to calling + // `ShowAuthDialog`. + // Injects a specific implementation of `InSessionAuthTokenProvider` + // for generating an `AuthToken` after successful authentication. + virtual void SetTokenProvider( + InSessionAuthTokenProvider* auth_token_provider) = 0; }; } // namespace ash
diff --git a/ash/public/cpp/test/shell_test_api.h b/ash/public/cpp/test/shell_test_api.h index 8e3e1f9e..d3386e6 100644 --- a/ash/public/cpp/test/shell_test_api.h +++ b/ash/public/cpp/test/shell_test_api.h
@@ -58,11 +58,6 @@ // disabled to prevent failing subsequent tests. static void SetUseLoginNotificationDelayForTest(bool use_delay); - // Whether a notification is shown at startup about new shortcuts. This - // can interfere with tests that expect a certain window to be active, - // that count notifications, or that test ChromeVox output. - static void SetShouldShowShortcutNotificationForTest(bool show_notification); - MessageCenterController* message_center_controller(); WorkspaceController* workspace_controller(); ScreenPositionController* screen_position_controller();
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index 06d97d5..7694ff3 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc
@@ -645,6 +645,8 @@ } void RootWindowController::Shutdown() { + Shell::Get()->OnRootWindowWillShutdown(GetRootWindow()); + auto targeter = GetRootWindow()->SetEventTargeter( std::make_unique<aura::NullWindowTargeter>());
diff --git a/ash/services/device_sync/cryptauth_key_bundle.cc b/ash/services/device_sync/cryptauth_key_bundle.cc index b910d9d..7fdfa39 100644 --- a/ash/services/device_sync/cryptauth_key_bundle.cc +++ b/ash/services/device_sync/cryptauth_key_bundle.cc
@@ -178,30 +178,28 @@ } base::Value CryptAuthKeyBundle::AsDictionary() const { - base::Value dict(base::Value::Type::DICTIONARY); + base::Value::Dict dict; - dict.SetKey(kBundleNameDictKey, - base::Value(KeyBundleNameEnumToString(name_))); + dict.Set(kBundleNameDictKey, KeyBundleNameEnumToString(name_)); - std::vector<base::Value> keys; - std::transform( - handle_to_key_map_.begin(), handle_to_key_map_.end(), - std::back_inserter(keys), - [](const std::pair<std::string, CryptAuthKey>& handle_key_pair) { - if (handle_key_pair.second.IsSymmetricKey()) - return handle_key_pair.second.AsSymmetricKeyDictionary(); + base::Value::List keys; + for (const auto& handle_key_pair : handle_to_key_map_) { + if (handle_key_pair.second.IsSymmetricKey()) { + keys.Append(handle_key_pair.second.AsSymmetricKeyDictionary()); + continue; + } - DCHECK(handle_key_pair.second.IsAsymmetricKey()); - return handle_key_pair.second.AsAsymmetricKeyDictionary(); - }); - dict.SetKey(kKeyListDictKey, base::Value(keys)); + DCHECK(handle_key_pair.second.IsAsymmetricKey()); + keys.Append(handle_key_pair.second.AsAsymmetricKeyDictionary()); + } + dict.Set(kKeyListDictKey, std::move(keys)); if (key_directive_) { - dict.SetKey(kKeyDirectiveDictKey, - util::EncodeProtoMessageAsValueString(&key_directive_.value())); + dict.Set(kKeyDirectiveDictKey, + util::EncodeProtoMessageAsValueString(&key_directive_.value())); } - return dict; + return base::Value(std::move(dict)); } bool CryptAuthKeyBundle::operator==(const CryptAuthKeyBundle& other) const {
diff --git a/ash/shelf/hotseat_widget_unittest.cc b/ash/shelf/hotseat_widget_unittest.cc index a810124..83103fa 100644 --- a/ash/shelf/hotseat_widget_unittest.cc +++ b/ash/shelf/hotseat_widget_unittest.cc
@@ -516,7 +516,7 @@ ->hotseat_widget() ->scrollable_shelf_view() ->shelf_view(); - EXPECT_EQ(2, shelf_view->view_model_for_test()->view_size()); + EXPECT_EQ(2u, shelf_view->view_model_for_test()->view_size()); // Show the in-app shelf. SwipeUpOnShelf(); @@ -539,7 +539,7 @@ // 1. Shelf item count decreases by one; and // 2. Hotseat is still extended. GetEventGenerator()->ReleaseLeftButton(); - EXPECT_EQ(1, shelf_view->view_model_for_test()->view_size()); + EXPECT_EQ(1u, shelf_view->view_model_for_test()->view_size()); EXPECT_EQ(HotseatState::kExtended, GetShelfLayoutManager()->hotseat_state()); }
diff --git a/ash/shelf/scrollable_shelf_view.cc b/ash/shelf/scrollable_shelf_view.cc index c2a1c611..87b82ad 100644 --- a/ash/shelf/scrollable_shelf_view.cc +++ b/ash/shelf/scrollable_shelf_view.cc
@@ -288,14 +288,17 @@ // Scrolls to the new page if the focused shelf item is not tappable // on the current page. - if (new_index < 0) + if (new_index < 0) { new_index = focusable_views.size() - 1; - else if (new_index >= static_cast<int>(focusable_views.size())) + } else if (static_cast<size_t>(new_index) >= focusable_views.size()) { new_index = 0; - else if (new_index < scrollable_shelf_view_->first_tappable_app_index()) + } else if (static_cast<size_t>(new_index) < + scrollable_shelf_view_->first_tappable_app_index()) { scrollable_shelf_view_->ScrollToNewPage(/*forward=*/false); - else if (new_index > scrollable_shelf_view_->last_tappable_app_index()) + } else if (static_cast<size_t>(new_index) > + scrollable_shelf_view_->last_tappable_app_index()) { scrollable_shelf_view_->ScrollToNewPage(/*forward=*/true); + } return focusable_views[new_index]; } @@ -1030,8 +1033,13 @@ // to be removed, i.e. `view_size_before_removal_` is one. In this case, // both `first_tappable_app_index_` and `last_tappable_app_index_` are reset // to invalid values (see https://crbug.com/1300561). - last_tappable_app_index_ = - std::min(last_tappable_app_index_, view_size_before_removal - 2); + if (view_size_before_removal < 2) { + last_tappable_app_index_ = absl::nullopt; + } else { + last_tappable_app_index_ = std::min( + last_tappable_app_index_, + absl::make_optional(static_cast<size_t>(view_size_before_removal - 2))); + } first_tappable_app_index_ = std::min(first_tappable_app_index_, last_tappable_app_index_); } @@ -1723,23 +1731,23 @@ // The value returned by CalculateMainAxisScrollDistance() can be casted into // an integer without losing precision since the decimal part is zero. - const std::pair<int, int> tappable_indices = CalculateTappableIconIndices( + const auto tappable_indices = CalculateTappableIconIndices( layout_strategy_, CalculateMainAxisScrollDistance()); first_tappable_app_index_ = tappable_indices.first; last_tappable_app_index_ = tappable_indices.second; } -std::pair<int, int> ScrollableShelfView::CalculateTappableIconIndices( +std::pair<absl::optional<size_t>, absl::optional<size_t>> +ScrollableShelfView::CalculateTappableIconIndices( ScrollableShelfView::LayoutStrategy layout_strategy, int scroll_distance_on_main_axis) const { const auto& visible_views_indices = shelf_view_->visible_views_indices(); if (visible_views_indices.empty() || visible_space_.IsEmpty()) - return std::pair<int, int>(-1, -1); + return {absl::nullopt, absl::nullopt}; if (layout_strategy == ScrollableShelfView::kNotShowArrowButtons) { - return std::pair<int, int>(visible_views_indices.front(), - visible_views_indices.back()); + return {visible_views_indices.front(), visible_views_indices.back()}; } const int visible_size = GetShelf()->IsHorizontalAlignment() @@ -1752,8 +1760,8 @@ // are on an inactive desk. Therefore, the indices of tappable apps may not be // contiguous, so we need to map from a visible view index back to an app // index. The below are indices into the |visible_views_indices| vector. - int first_visible_view_index = -1; - int last_visible_view_index = -1; + size_t first_visible_view_index; + size_t last_visible_view_index; if (layout_strategy == kShowRightArrowButton || layout_strategy == kShowButtons) { first_visible_view_index = @@ -1785,15 +1793,11 @@ : last_visible_view_index; } - DCHECK_GE(first_visible_view_index, 0); - DCHECK_LT(first_visible_view_index, - static_cast<int>(visible_views_indices.size())); - DCHECK_GE(last_visible_view_index, 0); - DCHECK_LT(last_visible_view_index, - static_cast<int>(visible_views_indices.size())); + DCHECK_LT(first_visible_view_index, visible_views_indices.size()); + DCHECK_LT(last_visible_view_index, visible_views_indices.size()); - return std::pair<int, int>(visible_views_indices[first_visible_view_index], - visible_views_indices[last_visible_view_index]); + return {visible_views_indices[first_visible_view_index], + visible_views_indices[last_visible_view_index]}; } views::View* ScrollableShelfView::FindFirstFocusableChild() { @@ -2140,21 +2144,23 @@ if (during_scroll_animation_) return should_count; - if (first_tappable_app_index_ == -1 || last_tappable_app_index_ == -1) { + if (!first_tappable_app_index_.has_value() || + !last_tappable_app_index_.has_value()) { // Verify that `first_tappable_app_index_` and `last_tappable_app_index_` - // may be both illegal. In that case, return early. - DCHECK_EQ(first_tappable_app_index_, last_tappable_app_index_); + // are both illegal. In that case, return early. + DCHECK(first_tappable_app_index_ == last_tappable_app_index_); return false; } // The ink drop needs to be clipped only if |sender| is the app at one of the // corners of the shelf. This happens if it is either the first or the last // tappable app and no arrow is showing on its side. - if (shelf_view_->view_model()->view_at(first_tappable_app_index_) == sender) { + if (shelf_view_->view_model()->view_at(first_tappable_app_index_.value()) == + sender) { should_count = !(layout_strategy_ == kShowButtons || layout_strategy_ == kShowLeftArrowButton); - } else if (shelf_view_->view_model()->view_at(last_tappable_app_index_) == - sender) { + } else if (shelf_view_->view_model()->view_at( + last_tappable_app_index_.value()) == sender) { should_count = !(layout_strategy_ == kShowButtons || layout_strategy_ == kShowRightArrowButton); }
diff --git a/ash/shelf/scrollable_shelf_view.h b/ash/shelf/scrollable_shelf_view.h index a10702d..5411168 100644 --- a/ash/shelf/scrollable_shelf_view.h +++ b/ash/shelf/scrollable_shelf_view.h
@@ -22,6 +22,7 @@ #include "base/callback_helpers.h" #include "base/cancelable_callback.h" #include "base/time/time.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/compositor/layer_animation_observer.h" #include "ui/views/animation/ink_drop_host_view.h" #include "ui/views/context_menu_controller.h" @@ -149,8 +150,12 @@ LayoutStrategy layout_strategy_for_test() const { return layout_strategy_; } gfx::Vector2dF scroll_offset_for_test() const { return scroll_offset_; } - int first_tappable_app_index() const { return first_tappable_app_index_; } - int last_tappable_app_index() const { return last_tappable_app_index_; } + absl::optional<size_t> first_tappable_app_index() const { + return first_tappable_app_index_; + } + absl::optional<size_t> last_tappable_app_index() const { + return last_tappable_app_index_; + } void set_default_last_focusable_child(bool default_last_focusable_child) { default_last_focusable_child_ = default_last_focusable_child; @@ -361,9 +366,9 @@ // layout strategy and offset along the main axis (that is the x-axis when // shelf is horizontally aligned or the y-axis if the shelf is vertically // aligned). - std::pair<int, int> CalculateTappableIconIndices( - LayoutStrategy layout_strategy, - int scroll_distance_on_main_axis) const; + std::pair<absl::optional<size_t>, absl::optional<size_t>> + CalculateTappableIconIndices(LayoutStrategy layout_strategy, + int scroll_distance_on_main_axis) const; views::View* FindFirstFocusableChild(); views::View* FindLastFocusableChild(); @@ -510,8 +515,8 @@ std::unique_ptr<views::FocusSearch> focus_search_; // The index of the first/last tappable app index. - int first_tappable_app_index_ = -1; - int last_tappable_app_index_ = -1; + absl::optional<size_t> first_tappable_app_index_ = absl::nullopt; + absl::optional<size_t> last_tappable_app_index_ = absl::nullopt; // The number of corner buttons whose ink drop is activated. int activated_corner_buttons_ = 0;
diff --git a/ash/shelf/scrollable_shelf_view_unittest.cc b/ash/shelf/scrollable_shelf_view_unittest.cc index fce7116..10df04c 100644 --- a/ash/shelf/scrollable_shelf_view_unittest.cc +++ b/ash/shelf/scrollable_shelf_view_unittest.cc
@@ -173,8 +173,8 @@ GetEventGenerator()->MoveMouseTo( GetPrimaryDisplay().bounds().CenterPoint()); - for (int i = scrollable_shelf_view_->first_tappable_app_index(); - i <= scrollable_shelf_view_->last_tappable_app_index(); ++i) { + for (size_t i = scrollable_shelf_view_->first_tappable_app_index().value(); + i <= scrollable_shelf_view_->last_tappable_app_index().value(); ++i) { const auto* shelf_app_icon = test_api_->GetButton(i); const gfx::Rect app_icon_screen_bounds = shelf_app_icon->GetBoundsInScreen(); @@ -205,16 +205,16 @@ views::View::ConvertRectToScreen(scrollable_shelf_view_, &visible_space_in_screen); - views::View* last_tappable_icon = - view_model->view_at(scrollable_shelf_view_->last_tappable_app_index()); + views::View* last_tappable_icon = view_model->view_at( + scrollable_shelf_view_->last_tappable_app_index().value()); const gfx::Rect last_tappable_icon_bounds = last_tappable_icon->GetBoundsInScreen(); // Expects that the last tappable icon is fully shown. EXPECT_TRUE(visible_space_in_screen.Contains(last_tappable_icon_bounds)); - views::View* first_tappable_icon = - view_model->view_at(scrollable_shelf_view_->first_tappable_app_index()); + views::View* first_tappable_icon = view_model->view_at( + scrollable_shelf_view_->first_tappable_app_index().value()); const gfx::Rect first_tappable_icon_bounds = first_tappable_icon->GetBoundsInScreen(); @@ -328,8 +328,8 @@ EXPECT_EQ(ScrollableShelfView::kShowLeftArrowButton, scrollable_shelf_view_->layout_strategy_for_test()); views::ViewModel* view_model = shelf_view_->view_model_for_test(); - const views::View* last_visible_icon = - view_model->view_at(scrollable_shelf_view_->last_tappable_app_index()); + const views::View* last_visible_icon = view_model->view_at( + scrollable_shelf_view_->last_tappable_app_index().value()); const gfx::Rect icon_bounds = last_visible_icon->GetBoundsInScreen(); gfx::Rect visible_space = scrollable_shelf_view_->visible_space(); views::View::ConvertRectToScreen(scrollable_shelf_view_, &visible_space); @@ -396,7 +396,6 @@ ASSERT_EQ(ScrollableShelfView::kShowRightArrowButton, scrollable_shelf_view_->layout_strategy_for_test()); - scrollable_shelf_view_->first_tappable_app_index(); views::ViewModel* view_model = shelf_view_->view_model_for_test(); @@ -405,8 +404,8 @@ EXPECT_FALSE(tooltip_manager->IsVisible()); // Verifies that tooltip should show for a visible shelf item. - views::View* visible_icon = - view_model->view_at(scrollable_shelf_view_->first_tappable_app_index()); + views::View* visible_icon = view_model->view_at( + scrollable_shelf_view_->first_tappable_app_index().value()); GetEventGenerator()->MoveMouseTo( visible_icon->GetBoundsInScreen().CenterPoint()); tooltip_manager->ShowTooltip(visible_icon); @@ -419,7 +418,7 @@ // Verifies that tooltip should not show for a hidden shelf item. views::View* hidden_icon = view_model->view_at( - scrollable_shelf_view_->last_tappable_app_index() + 1); + scrollable_shelf_view_->last_tappable_app_index().value() + 1); GetEventGenerator()->MoveMouseTo( hidden_icon->GetBoundsInScreen().CenterPoint()); tooltip_manager->ShowTooltip(hidden_icon); @@ -558,8 +557,8 @@ scrollable_shelf_view_->layout_strategy_for_test()); views::ViewModel* view_model = shelf_view_->view_model_for_test(); - views::View* dragged_view = - view_model->view_at(scrollable_shelf_view_->last_tappable_app_index()); + views::View* dragged_view = view_model->view_at( + scrollable_shelf_view_->last_tappable_app_index().value()); const gfx::Point drag_start_point = dragged_view->GetBoundsInScreen().CenterPoint(); @@ -570,7 +569,7 @@ scrollable_shelf_view_->left_arrow()->GetBoundsInScreen().origin() - gfx::Vector2d(10, 0); - ASSERT_NE(0, view_model->GetIndexOfView(dragged_view)); + ASSERT_NE(0u, view_model->GetIndexOfView(dragged_view)); // Drag |dragged_view| from |drag_start_point| to |drag_end_point|. Wait // for enough time before releasing the mouse button. @@ -599,17 +598,19 @@ // (2) The dragged view has the correct view index. EXPECT_EQ(ScrollableShelfView::kShowRightArrowButton, scrollable_shelf_view_->layout_strategy_for_test()); - const int view_index = view_model->GetIndexOfView(dragged_view); - EXPECT_GE(view_index, scrollable_shelf_view_->first_tappable_app_index()); - EXPECT_LE(view_index, scrollable_shelf_view_->last_tappable_app_index()); + const auto view_index = view_model->GetIndexOfView(dragged_view); + EXPECT_GE(view_index, + scrollable_shelf_view_->first_tappable_app_index().value()); + EXPECT_LE(view_index, + scrollable_shelf_view_->last_tappable_app_index().value()); } // Verifies that after adding the second display, shelf icons showing on // the primary display are also visible on the second display // (https://crbug.com/1035596). TEST_P(ScrollableShelfViewRTLTest, CheckTappableIndicesOnSecondDisplay) { - constexpr int icon_number = 5; - for (int i = 0; i < icon_number; i++) + constexpr size_t icon_number = 5; + for (size_t i = 0; i < icon_number; i++) AddAppShortcut(); // Adds the second display. @@ -625,8 +626,9 @@ // Verifies that the all icons are visible on the secondary display. EXPECT_EQ(icon_number - 1, - secondary_scrollable_shelf_view->last_tappable_app_index()); - EXPECT_EQ(0, secondary_scrollable_shelf_view->first_tappable_app_index()); + secondary_scrollable_shelf_view->last_tappable_app_index().value()); + EXPECT_EQ( + 0u, secondary_scrollable_shelf_view->first_tappable_app_index().value()); } // Verifies that the scrollable shelf in oveflow mode has the correct layout @@ -663,8 +665,8 @@ base::RunLoop().RunUntilIdle(); views::ViewModel* view_model = shelf_view_->view_model_for_test(); - views::View* first_tappable_view = - view_model->view_at(scrollable_shelf_view_->first_tappable_app_index()); + views::View* first_tappable_view = view_model->view_at( + scrollable_shelf_view_->first_tappable_app_index().value()); // Verifies that the gap between the left arrow button and the first tappable // icon is expected. @@ -705,10 +707,12 @@ views::ViewModel* view_model = shelf_view_->view_model_for_test(); const gfx::Rect first_tappable_icon_bounds = - view_model->view_at(scrollable_shelf_view_->first_tappable_app_index()) + view_model + ->view_at(scrollable_shelf_view_->first_tappable_app_index().value()) ->GetBoundsInScreen(); const gfx::Rect last_tappable_icon_bounds = - view_model->view_at(scrollable_shelf_view_->last_tappable_app_index()) + view_model + ->view_at(scrollable_shelf_view_->last_tappable_app_index().value()) ->GetBoundsInScreen(); if (base::i18n::IsRTL()) { @@ -757,9 +761,9 @@ ShelfViewTestAPI shelf_view_test_api(shelf_view_); ShelfAppButton* first_icon = shelf_view_test_api.GetButton( - scrollable_shelf_view_->first_tappable_app_index()); + scrollable_shelf_view_->first_tappable_app_index().value()); ShelfAppButton* last_icon = shelf_view_test_api.GetButton( - scrollable_shelf_view_->last_tappable_app_index()); + scrollable_shelf_view_->last_tappable_app_index().value()); // When the right arrow is showing, check rounded corners are set if the ink // drop is visible for the first visible app. @@ -778,9 +782,9 @@ // Recalculate first and last icons. first_icon = shelf_view_test_api.GetButton( - scrollable_shelf_view_->first_tappable_app_index()); + scrollable_shelf_view_->first_tappable_app_index().value()); last_icon = shelf_view_test_api.GetButton( - scrollable_shelf_view_->last_tappable_app_index()); + scrollable_shelf_view_->last_tappable_app_index().value()); // When the left arrow is showing, check rounded corners are set if the ink // drop is visible for the last visible app. @@ -849,7 +853,7 @@ AddAppShortcut(); const ShelfID app_id = AddAppShortcut(); - ASSERT_EQ(2, test_api_->GetButtonCount()); + ASSERT_EQ(2u, test_api_->GetButtonCount()); ShelfModel* shelf_model = ShelfModel::Get(); const int index = shelf_model->ItemIndexByID(app_id); @@ -869,7 +873,7 @@ // Emulate to remove a shelf icon from context menu. shelf_model->RemoveItemAt(index); test_api_->RunMessageLoopUntilAnimationsDone(); - ASSERT_EQ(1, test_api_->GetButtonCount()); + ASSERT_EQ(1u, test_api_->GetButtonCount()); // Verify the count of activated corner buttons. EXPECT_FALSE( @@ -977,7 +981,8 @@ views::ViewModel* view_model = shelf_view_->view_model_for_test(); const gfx::Rect first_tappable_view_bounds = - view_model->view_at(scrollable_shelf_view_->first_tappable_app_index()) + view_model + ->view_at(scrollable_shelf_view_->first_tappable_app_index().value()) ->GetBoundsInScreen(); const gfx::Point drag_start_location = @@ -1195,7 +1200,7 @@ ShelfViewTestAPI shelf_view_test_api(shelf_view_); ShelfAppButton* first_app_button = shelf_view_test_api.GetButton( - scrollable_shelf_view_->first_tappable_app_index()); + scrollable_shelf_view_->first_tappable_app_index().value()); VeirifyRippleRingWithinShelfContainer(*first_app_button); // Tap at the right arrow. Hotseat layout should show the left arrow. @@ -1206,7 +1211,7 @@ scrollable_shelf_view_->layout_strategy_for_test()); ShelfAppButton* last_app_button = shelf_view_test_api.GetButton( - scrollable_shelf_view_->last_tappable_app_index()); + scrollable_shelf_view_->last_tappable_app_index().value()); VeirifyRippleRingWithinShelfContainer(*last_app_button); } @@ -1226,7 +1231,7 @@ // Right-click on the edge of the last icon. const views::View* last_icon = shelf_view_->view_model_for_test()->view_at( - scrollable_shelf_view_->last_tappable_app_index()); + scrollable_shelf_view_->last_tappable_app_index().value()); gfx::Point click_point = last_icon->GetBoundsInScreen().right_center(); click_point.Offset(-1, 0); GetEventGenerator()->MoveMouseTo(click_point); @@ -1279,7 +1284,7 @@ scrollable_shelf_view_->layout_strategy_for_test()); views::ViewModel* view_model = shelf_view_->view_model_for_test(); - ASSERT_GT(view_model->view_size(), 2); + ASSERT_GT(view_model->view_size(), 2u); // |gesture_start_point| is between the first and the second shelf icon. It // ensures that gesture scroll does not start from a point within any shelf @@ -1359,14 +1364,14 @@ scrollable_shelf_view_->layout_strategy_for_test()); // |num| is the minimum of app icons to enter overflow mode. - const int num = shelf_view_->view_model_for_test()->view_size(); + const size_t num = shelf_view_->view_model_for_test()->view_size(); ShelfModel::ScopedUserTriggeredMutation user_triggered( scrollable_shelf_view_->shelf_view()->model()); { ShelfID shelf_id = AddAppShortcut(); - const int view_index = + const size_t view_index = shelf_view_->model()->ItemIndexByAppID(shelf_id.app_id); ASSERT_EQ(view_index, num); @@ -1382,20 +1387,22 @@ scrollable_shelf_view_->layout_strategy_for_test()); // Pins the icons of running apps to the shelf. - for (int i = 0; i < 2 * num; i++) + for (size_t i = 0; i < 2 * num; i++) AddAppShortcut(ShelfItemType::TYPE_APP); { ShelfID shelf_id = AddAppShortcut(); - const int view_index = + const size_t view_index = shelf_view_->model()->ItemIndexByAppID(shelf_id.app_id); ASSERT_EQ(view_index, num + 1); // Scrolls the shelf to show the pinned app. Expects that the shelf is // scrolled to the correct page. Notes that the pinned app should be placed // ahead of running apps. - EXPECT_LT(view_index, scrollable_shelf_view_->last_tappable_app_index()); - EXPECT_GT(view_index, scrollable_shelf_view_->first_tappable_app_index()); + EXPECT_LT(view_index, + scrollable_shelf_view_->last_tappable_app_index().value()); + EXPECT_GT(view_index, + scrollable_shelf_view_->first_tappable_app_index().value()); EXPECT_EQ(ScrollableShelfView::kShowButtons, scrollable_shelf_view_->layout_strategy_for_test()); }
diff --git a/ash/shelf/shelf_app_button.cc b/ash/shelf/shelf_app_button.cc index e27964b..da5a47a 100644 --- a/ash/shelf/shelf_app_button.cc +++ b/ash/shelf/shelf_app_button.cc
@@ -613,7 +613,8 @@ // the shelf when there is a non-zero padding between the app icon and the // end of scrollable shelf. if (TabletModeController::Get()->InTabletMode() && padding > 0) { - const int current_index = shelf_view_->view_model()->GetIndexOfView(this); + const size_t current_index = + shelf_view_->view_model()->GetIndexOfView(this).value(); int left_padding = (shelf_view_->visible_views_indices().front() == current_index) ? padding
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index 65c3a728..8388a72 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -3074,10 +3074,10 @@ EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); // Create an app that we can use to pull up a context menu. - EXPECT_EQ(0, + EXPECT_EQ(0u, ShelfViewTestAPI(shelf->GetShelfViewForTesting()).GetButtonCount()); AddApp(); - EXPECT_EQ(1, + EXPECT_EQ(1u, ShelfViewTestAPI(shelf->GetShelfViewForTesting()).GetButtonCount()); // Swipe up to show the shelf. @@ -4476,8 +4476,8 @@ // Keep this low so that all apps fit at the center of the screen on all // displays. - const int max_app_count = 4; - for (int app_count = 1; app_count <= max_app_count; ++app_count) { + const size_t max_app_count = 4; + for (size_t app_count = 1; app_count <= max_app_count; ++app_count) { AddApp(); // Wait for everything to settle down.
diff --git a/ash/shelf/shelf_tooltip_manager_unittest.cc b/ash/shelf/shelf_tooltip_manager_unittest.cc index 6ec00058..c0da227 100644 --- a/ash/shelf/shelf_tooltip_manager_unittest.cc +++ b/ash/shelf/shelf_tooltip_manager_unittest.cc
@@ -47,7 +47,7 @@ views::Widget* GetTooltip() { return tooltip_manager_->bubble_->GetWidget(); } void ShowTooltipForFirstAppIcon() { - EXPECT_GE(shelf_view_->number_of_visible_apps(), 1); + EXPECT_GE(shelf_view_->number_of_visible_apps(), 1u); tooltip_manager_->ShowTooltip( shelf_view_->first_visible_button_for_testing()); }
diff --git a/ash/shelf/shelf_unittest.cc b/ash/shelf/shelf_unittest.cc index 5e34c9a4..90a0745 100644 --- a/ash/shelf/shelf_unittest.cc +++ b/ash/shelf/shelf_unittest.cc
@@ -70,7 +70,7 @@ // Confirms that ShelfItem reflects the appropriated state. TEST_F(ShelfTest, StatusReflection) { // Initially we have the app list. - int button_count = test_api()->GetButtonCount(); + size_t button_count = test_api()->GetButtonCount(); // Add a running app. ShelfItem item; @@ -92,7 +92,7 @@ // browser test we check this here. TEST_F(ShelfTest, CheckHoverAfterMenu) { // Initially we have the app list. - int button_count = test_api()->GetButtonCount(); + size_t button_count = test_api()->GetButtonCount(); // Add a running app. ShelfItem item;
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc index 65d1a5b..d077aac 100644 --- a/ash/shelf/shelf_view.cc +++ b/ash/shelf/shelf_view.cc
@@ -457,10 +457,12 @@ gfx::Rect ShelfView::GetIdealBoundsOfItemIcon(const ShelfID& id) { int index = model_->ItemIndexByID(id); - if (!base::Contains(visible_views_indices_, index)) + if (index < 0 || + !base::Contains(visible_views_indices_, static_cast<size_t>(index))) return gfx::Rect(); - const gfx::Rect& ideal_bounds(view_model_->ideal_bounds(index)); + const gfx::Rect& ideal_bounds( + view_model_->ideal_bounds(static_cast<size_t>(index))); ShelfAppButton* button = GetShelfAppButton(id); gfx::Rect icon_bounds = button->GetIconBounds(); return gfx::Rect(GetMirroredXWithWidthInView( @@ -476,7 +478,7 @@ void ShelfView::UpdateVisibleShelfItemBoundsUnion() { visible_shelf_item_bounds_union_.SetRect(0, 0, 0, 0); - for (const int i : visible_views_indices_) { + for (const auto i : visible_views_indices_) { const views::View* child = view_model_->view_at(i); if (ShouldShowTooltipForChildView(child)) { visible_shelf_item_bounds_union_.Union( @@ -718,11 +720,11 @@ if (!details.is_add) { if (details.child == current_ghost_view_) { current_ghost_view_ = nullptr; - current_ghost_view_index_ = -1; + current_ghost_view_index_ = absl::nullopt; } if (details.child == last_ghost_view_) { last_ghost_view_ = nullptr; - current_ghost_view_index_ = -1; + current_ghost_view_index_ = absl::nullopt; } } } @@ -757,7 +759,7 @@ // Record the index for the last pressed shelf item. last_pressed_index_ = view_model_->GetIndexOfView(sender); - DCHECK_LT(-1, last_pressed_index_); + DCHECK(last_pressed_index_.has_value()); // Place new windows on the same display as the button. Opening windows is // usually an async operation so we wait until window activation changes @@ -782,7 +784,7 @@ } // Collect usage statistics before we decide what to do with the click. - switch (model_->items()[last_pressed_index_].type) { + switch (model_->items()[last_pressed_index_.value()].type) { case TYPE_PINNED_APP: case TYPE_BROWSER_SHORTCUT: case TYPE_APP: @@ -799,7 +801,7 @@ } // Run AfterItemSelected directly if the item has no delegate (ie. in tests). - const ShelfItem& item = model_->items()[last_pressed_index_]; + const ShelfItem& item = model_->items()[last_pressed_index_.value()]; if (!model_->GetShelfItemDelegate(item.id)) { AfterItemSelected(item, sender, ui::Event::Clone(event), ink_drop, SHELF_ACTION_NONE, {}); @@ -847,7 +849,7 @@ } return; } - last_pressed_index_ = -1; + last_pressed_index_ = absl::nullopt; if (!item || !model_->GetShelfItemDelegate(item->id)) { ShowShelfContextMenu(ShelfID(), point, source, source_type, nullptr); return; @@ -880,7 +882,7 @@ void ShelfView::OnShelfConfigUpdated() { // Ensure the shelf app buttons have an icon which is up to date with the // current ShelfConfig sizing. - for (int i = 0; i < view_model_->view_size(); i++) { + for (size_t i = 0; i < view_model_->view_size(); i++) { ShelfAppButton* button = static_cast<ShelfAppButton*>(view_model_->view_at(i)); if (!button->IsIconSizeCurrent()) @@ -909,8 +911,8 @@ const bool repost = IsRepostEvent(event); // Ignore if this is a repost event on the last pressed shelf item. - int index = view_model_->GetIndexOfView(view); - if (index == -1) + auto index = view_model_->GetIndexOfView(view); + if (!index.has_value()) return false; return !repost || last_pressed_index_ != index; } @@ -972,7 +974,8 @@ } void ShelfView::CalculateIdealBounds() { - DCHECK(model()->item_count() == view_model_->view_size()); + DCHECK(static_cast<size_t>(model()->item_count()) == + view_model_->view_size()); const int button_spacing = ShelfConfig::Get()->button_spacing(); UpdateSeparatorIndex(); @@ -981,11 +984,11 @@ // Don't show the separator if it isn't needed, or would appear after all // visible items. - separator_->SetVisible(separator_index_ != -1 && + separator_->SetVisible(separator_index_.has_value() && separator_index_ < visible_views_indices_.back()); - // Set |separator_index_| to -1 if it is not visible. + // Set |separator_index_| to nullopt if it is not visible. if (!separator_->GetVisible()) - separator_index_ = -1; + separator_index_ = absl::nullopt; app_icons_layout_offset_ = CalculateAppIconsLayoutOffset(); int x = shelf()->PrimaryAxisValue(app_icons_layout_offset_, 0); @@ -994,7 +997,7 @@ // The padding is handled in ScrollableShelfView. const int button_size = GetButtonSize(); - for (int i = 0; i < view_model_->view_size(); ++i) { + for (size_t i = 0; i < view_model_->view_size(); ++i) { if (view_model_->view_at(i)->GetVisible()) { gfx::Rect ideal_view_bounds(x, y, button_size, button_size); view_model_->set_ideal_bounds(i, ideal_view_bounds); @@ -1084,16 +1087,17 @@ void ShelfView::UpdateSeparatorIndex() { // A separator is shown after the last pinned item only if it's followed by a // visible app item. - int first_unpinned_index = -1; - int last_pinned_index = -1; + absl::optional<size_t> first_unpinned_index = absl::nullopt; + absl::optional<size_t> last_pinned_index = absl::nullopt; - int dragged_item_index = -1; + absl::optional<size_t> dragged_item_index = absl::nullopt; if (drag_view_) dragged_item_index = view_model_->GetIndexOfView(drag_view_); const bool can_drag_view_across_separator = drag_view_ && CanDragAcrossSeparator(drag_view_); - for (int i = model()->item_count() - 1; i >= 0; --i) { + for (size_t index = model()->item_count(); index > 0; --index) { + const size_t i = index - 1; const auto& item = model()->items()[i]; if (IsItemPinned(item)) { // Dragged pinned item may be moved to the unpinned side of the shelf and @@ -1112,8 +1116,8 @@ // If there is no unpinned item in shelf, return -1 as the separator should be // hidden. - if (first_unpinned_index == -1) { - separator_index_ = -1; + if (!first_unpinned_index.has_value()) { + separator_index_ = absl::nullopt; return; } @@ -1161,7 +1165,7 @@ // If the AppsGridView (which was dispatching this event) was opened by our // button, ShelfView dragging operations are locked and we have to unlock. - CancelDrag(-1); + CancelDrag(absl::nullopt); drag_and_drop_item_pinned_ = false; drag_and_drop_shelf_id_ = ShelfID(app_id); // Check if the application is pinned - if not, we have to pin it so @@ -1276,8 +1280,8 @@ return; // Find the index of the button to swap in the view model. - int src_index = -1; - for (int i = 0; i < view_model_->view_size(); ++i) { + size_t src_index = static_cast<size_t>(-1); + for (size_t i = 0; i < view_model_->view_size(); ++i) { View* view = view_model_->view_at(i); if (view == button_to_swap) { src_index = i; @@ -1305,8 +1309,8 @@ if (IsShowingMenu()) shelf_menu_model_adapter_->Cancel(); - int index = view_model_->GetIndexOfView(view); - if (index == -1 || view_model_->view_size() < 1) + auto index = view_model_->GetIndexOfView(view); + if (!index.has_value() || view_model_->view_size() < 1) return; // View is being deleted, ignore request. // Reset drag icon proxy from previous drag (which could be set if the drop @@ -1351,7 +1355,7 @@ is_repost_event_on_same_item_ = false; if (canceled) { - CancelDrag(-1); + CancelDrag(absl::nullopt); } else if (drag_pointer_ == pointer) { FinalizeRipOffDrag(false); drag_pointer_ = NONE; @@ -1360,7 +1364,8 @@ // |drag_view_| is dragged over the separator. Do nothing if |drag_view_| is // already handled in FinalizedRipOffDrag. if (drag_view_) { - if (ShouldUpdateDraggedViewPinStatus(view_model_->GetIndexOfView(view))) { + if (ShouldUpdateDraggedViewPinStatus( + view_model_->GetIndexOfView(view).value())) { const std::string drag_app_id = ShelfItemForView(drag_view_)->id.app_id; ShelfModel::ScopedUserTriggeredMutation user_triggered(model_); if (model_->IsAppPinned(drag_app_id)) { @@ -1382,8 +1387,8 @@ drag_icon_proxy_.reset(); if (drag_icon_proxy_) { - const gfx::Rect drag_view_ideal_bounds = - view_model_->ideal_bounds(view_model_->GetIndexOfView(drag_view_)); + const gfx::Rect drag_view_ideal_bounds = view_model_->ideal_bounds( + view_model_->GetIndexOfView(drag_view_).value()); gfx::Rect target_bounds_in_screen = drag_view_->GetIdealIconBounds(drag_view_ideal_bounds.size(), /*icon_scale=*/1.0f); @@ -1449,7 +1454,7 @@ move_animation_tracker_->Start(metrics_util::ForSmoothness( base::BindRepeating(&ReportMoveAnimationSmoothness))); - for (int i = 0; i < view_model_->view_size(); ++i) { + for (size_t i = 0; i < view_model_->view_size(); ++i) { View* view = view_model_->view_at(i); bounds_animator_->AnimateViewTo(view, view_model_->ideal_bounds(i)); // Now that the item animation starts, we have to make sure that the @@ -1485,8 +1490,8 @@ start_drag_index_ = view_model_->GetIndexOfView(drag_view_); drag_scroll_dir_ = 0; - if (start_drag_index_ == -1) { - CancelDrag(-1); + if (!start_drag_index_.has_value()) { + CancelDrag(absl::nullopt); return; } @@ -1532,15 +1537,15 @@ void ShelfView::ContinueDrag(const ui::LocatedEvent& event) { DCHECK(dragging()); DCHECK(drag_view_); - DCHECK_NE(-1, view_model_->GetIndexOfView(drag_view_)); + const auto index = view_model_->GetIndexOfView(drag_view_); + DCHECK(index.has_value()); const bool dragged_off_shelf_before = dragged_off_shelf_; // Handle rip off functionality if this is not a drag and drop host operation // and not the app list item. if (drag_and_drop_shelf_id_.IsNull() && - RemovableByRipOff(view_model_->GetIndexOfView(drag_view_)) != - NOT_REMOVABLE) { + RemovableByRipOff(index.value()) != NOT_REMOVABLE) { HandleRipOffDrag(event); // Check if the item got ripped off the shelf - if it did we are done. if (dragged_off_shelf_) { @@ -1573,13 +1578,16 @@ : drag_icon_bounds_in_screen_; delegate_->ScheduleScrollForItemDragIfNeeded(drag_icon_bounds_in_screen); - if (dragged_off_shelf_before) - model_->OnItemReturnedFromRipOff(view_model_->GetIndexOfView(drag_view_)); + if (dragged_off_shelf_before) { + model_->OnItemReturnedFromRipOff( + static_cast<int>(view_model_->GetIndexOfView(drag_view_).value())); + } } void ShelfView::MoveDragViewTo(int primary_axis_coordinate) { - const int current_item_index = view_model_->GetIndexOfView(drag_view_); - const std::pair<int, int> indices(GetDragRange(current_item_index)); + const size_t current_item_index = + view_model_->GetIndexOfView(drag_view_).value(); + const std::pair<size_t, size_t> indices(GetDragRange(current_item_index)); if (shelf_->IsHorizontalAlignment()) { int x = GetMirroredXWithWidthInView(primary_axis_coordinate, drag_view_->width()); @@ -1599,7 +1607,7 @@ drag_view_->SetY(y); } - int target_index = views::ViewModelUtils::DetermineMoveIndex( + size_t target_index = views::ViewModelUtils::DetermineMoveIndex( *view_model_, drag_view_, shelf_->IsHorizontalAlignment(), drag_view_->x(), drag_view_->y()); target_index = base::clamp(target_index, indices.first, indices.second); @@ -1638,9 +1646,9 @@ } void ShelfView::HandleRipOffDrag(const ui::LocatedEvent& event) { - int current_index = view_model_->GetIndexOfView(drag_view_); - DCHECK_NE(-1, current_index); - std::string dragged_app_id = model_->items()[current_index].id.app_id; + auto current_index = view_model_->GetIndexOfView(drag_view_); + DCHECK(current_index.has_value()); + std::string dragged_app_id = model_->items()[current_index.value()].id.app_id; aura::Window* root_window = GetWidget()->GetNativeWindow()->GetRootWindow(); gfx::Point screen_location = event.root_location(); @@ -1691,11 +1699,13 @@ dragged_off_shelf_ = true; RemoveGhostView(); - if (RemovableByRipOff(current_index) == REMOVABLE) { + if (RemovableByRipOff(current_index.value()) == REMOVABLE) { // Move the item to the back and hide it. ShelfItemMoved() callback will // handle the |view_model_| update and call AnimateToIdealBounds(). - if (current_index != model_->item_count() - 1) - model_->Move(current_index, model_->item_count() - 1); + if (current_index.value() != + static_cast<size_t>(model_->item_count() - 1)) { + model_->Move(current_index.value(), model_->item_count() - 1); + } // Make the item partially disappear to show that it will get removed if // dropped. drag_icon_proxy_->SetOpacity(kDraggedImageOpacity); @@ -1715,11 +1725,11 @@ delegate_->CancelScrollForItemDrag(); - int current_index = view_model_->GetIndexOfView(drag_view_); - // If the view isn't part of the model anymore (|current_index| == -1), a sync - // operation must have removed it. In that case we shouldn't change the model - // and only delete the proxy image. - if (current_index == -1) { + auto current_index = view_model_->GetIndexOfView(drag_view_); + // If the view isn't part of the model anymore, a sync operation must have + // removed it. In that case we shouldn't change the model and only delete the + // proxy image. + if (!current_index.has_value()) { drag_icon_proxy_.reset(); return; } @@ -1728,7 +1738,7 @@ bool snap_back = false; // Items which cannot be dragged off will be handled as a cancel. if (!cancel) { - if (RemovableByRipOff(current_index) != REMOVABLE) { + if (RemovableByRipOff(current_index.value()) != REMOVABLE) { // Make sure we do not try to remove un-removable items like items which // were not pinned or have to be always there. cancel = true; @@ -1737,7 +1747,7 @@ // Make sure the item stays invisible upon removal. drag_view_->SetVisible(false); ShelfModel::ScopedUserTriggeredMutation user_triggered(model_); - model_->UnpinAppWithID(model_->items()[current_index].id.app_id); + model_->UnpinAppWithID(model_->items()[current_index.value()].id.app_id); } } if (cancel || snap_back) { @@ -1756,7 +1766,7 @@ drag_view_->AddState(ShelfAppButton::STATE_HIDDEN); // When a canceling drag model is happening, the view model is diverged // from the menu model and movements / animations should not be done. - model_->Move(current_index, start_drag_index_); + model_->Move(current_index.value(), start_drag_index_.value()); AnimateToIdealBounds(); } drag_view_->layer()->SetOpacity(1.0f); @@ -1805,7 +1815,7 @@ (!reverse && button == FindFirstFocusableChild()); } -std::pair<int, int> ShelfView::GetDragRange(int index) { +std::pair<size_t, size_t> ShelfView::GetDragRange(size_t index) { DCHECK(base::Contains(visible_views_indices_, index)); const ShelfItem& dragged_item = model_->items()[index]; @@ -1816,34 +1826,34 @@ visible_views_indices_.back()); } - int first = -1; - int last = -1; - for (int i : visible_views_indices_) { + absl::optional<size_t> first = absl::nullopt; + absl::optional<size_t> last = absl::nullopt; + for (size_t i : visible_views_indices_) { if (SameDragType(model_->items()[i].type, dragged_item.type)) { - if (first == -1) + if (!first.has_value()) first = i; last = i; - } else if (first != -1) { + } else if (first.has_value()) { break; } } - DCHECK_NE(first, -1); - DCHECK_NE(last, -1); + DCHECK(first.has_value()); + DCHECK(last.has_value()); // TODO(afakhry): Consider changing this when taking into account inactive // desks. - return std::make_pair(first, last); + return std::make_pair(first.value(), last.value()); } -bool ShelfView::ShouldUpdateDraggedViewPinStatus(int dragged_view_index) { +bool ShelfView::ShouldUpdateDraggedViewPinStatus(size_t dragged_view_index) { if (!features::IsDragUnpinnedAppToPinEnabled()) return false; DCHECK(base::Contains(visible_views_indices_, dragged_view_index)); bool is_moved_item_pinned = IsPinnedShelfItemType(model_->items()[dragged_view_index].type); - if (separator_index_ == -1) { - // If |separator_index_| equals to -1, all the apps in shelf are expected to + if (!separator_index_.has_value()) { + // If there is no |separator_index_|, all the apps in shelf are expected to // have the same pinned status. for (auto index : visible_views_indices_) { if (index != dragged_view_index) { @@ -1858,7 +1868,8 @@ // If the separator is shown, check whether the pin status of dragged item // matches the pin status implied by the dragged view position relative to the // separator. - bool should_pinned_by_position = dragged_view_index <= separator_index_; + bool should_pinned_by_position = + dragged_view_index <= separator_index_.value(); return should_pinned_by_position != is_moved_item_pinned; } @@ -2020,7 +2031,8 @@ return bounds; } -int ShelfView::CancelDrag(int modified_index) { +absl::optional<size_t> ShelfView::CancelDrag( + absl::optional<size_t> modified_index) { drag_scroll_dir_ = 0; scrolling_timer_.Stop(); speed_up_drag_scrolling_.Stop(); @@ -2033,7 +2045,7 @@ if (!drag_view_) return modified_index; bool was_dragging = dragging(); - int drag_view_index = view_model_->GetIndexOfView(drag_view_); + auto drag_view_index = view_model_->GetIndexOfView(drag_view_); drag_pointer_ = NONE; drag_view_ = nullptr; if (drag_view_index == modified_index) { @@ -2045,16 +2057,18 @@ // Restore previous position, tracking the position of the modified view. bool at_end = modified_index == view_model_->view_size(); - views::View* modified_view = (modified_index >= 0 && !at_end) - ? view_model_->view_at(modified_index) - : nullptr; - model_->Move(drag_view_index, start_drag_index_); + views::View* modified_view = + (modified_index.has_value() && !at_end) + ? view_model_->view_at(modified_index.value()) + : nullptr; + model_->Move(drag_view_index.value(), start_drag_index_.value()); // If the modified view will be at the end of the list, return the new end of // the list. if (at_end) return view_model_->view_size(); - return modified_view ? view_model_->GetIndexOfView(modified_view) : -1; + return modified_view ? view_model_->GetIndexOfView(modified_view) + : absl::nullopt; } void ShelfView::OnGestureEvent(ui::GestureEvent* event) { @@ -2076,9 +2090,9 @@ { base::AutoReset<bool> cancelling_drag(&cancelling_drag_model_changed_, true); - model_index = CancelDrag(model_index); + model_index = static_cast<int>(CancelDrag(model_index).value()); } - view_model_->Add(view, model_index); + view_model_->Add(view, static_cast<size_t>(model_index)); // If |item| is pinned and the mutation is user-triggered, report the pinning // action for accessibility and UMA. Do it now, because if |item| is hidden @@ -2108,7 +2122,8 @@ // spot (because it was in the middle of animating from 0,0 0x0 to its // target). CalculateIdealBounds(); - view->SetBoundsRect(view_model_->ideal_bounds(model_index)); + view->SetBoundsRect( + view_model_->ideal_bounds(static_cast<size_t>(model_index))); if (model_->is_current_mutation_user_triggered() && drag_and_drop_shelf_id_ != item.id) { @@ -2119,7 +2134,7 @@ // is hidden, so it visually appears as though we are providing space for // it. When done we'll fade the view in. AnimateToIdealBounds(); - DCHECK_LE(model_index, visible_views_indices_.back()); + DCHECK_LE(static_cast<size_t>(model_index), visible_views_indices_.back()); bounds_animator_->SetAnimationDelegate( view, std::unique_ptr<gfx::AnimationDelegate>( new StartFadeAnimationDelegate(this, view))); @@ -2147,7 +2162,7 @@ { base::AutoReset<bool> cancelling_drag(&cancelling_drag_model_changed_, true); - CancelDrag(-1); + CancelDrag(absl::nullopt); } if (view.get() == shelf_->tooltip()->GetCurrentAnchorView()) @@ -2199,7 +2214,7 @@ // Bail if the view and shelf sizes do not match. ShelfItemChanged may be // called here before ShelfItemAdded, due to ChromeShelfController's // item initialization, which calls SetItem during ShelfItemAdded. - if (static_cast<int>(model_->items().size()) != view_model_->view_size()) + if (model_->items().size() != view_model_->view_size()) return; const ShelfItem& item = model_->items()[model_index]; @@ -2215,7 +2230,7 @@ if (old_item.type != item.type) { // Type changed, swap the views. - model_index = CancelDrag(model_index); + model_index = static_cast<int>(CancelDrag(model_index).value()); std::unique_ptr<views::View> old_view(view_model_->view_at(model_index)); bounds_animator_->StopAnimatingView(old_view.get()); // Removing and re-inserting a view in our view model will strip the ideal @@ -2353,7 +2368,7 @@ void ShelfView::OnShelfAlignmentChanged(aura::Window* root_window, ShelfAlignment old_alignment) { LayoutToIdealBounds(); - for (const auto& visible_index : visible_views_indices_) + for (size_t visible_index : visible_views_indices_) view_model_->view_at(visible_index)->Layout(); AnnounceShelfAlignment(); @@ -2539,8 +2554,9 @@ } const ShelfItem* ShelfView::ShelfItemForView(const views::View* view) const { - const int view_index = view_model_->GetIndexOfView(view); - return (view_index < 0) ? nullptr : &(model_->items()[view_index]); + const auto view_index = view_model_->GetIndexOfView(view); + return (!view_index.has_value()) ? nullptr + : &(model_->items()[view_index.value()]); } int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { @@ -2586,7 +2602,7 @@ void ShelfView::UpdateShelfItemViewsVisibility() { visible_views_indices_.clear(); - for (int i = 0; i < view_model_->view_size(); ++i) { + for (size_t i = 0; i < view_model_->view_size(); ++i) { View* view = view_model_->view_at(i); // To receive drag event continuously from |drag_view_| during the dragging // off from the shelf, don't make |drag_view_| invisible. It will be @@ -2634,7 +2650,7 @@ void ShelfView::RemoveGhostView() { if (current_ghost_view_) { - current_ghost_view_index_ = -1; + current_ghost_view_index_ = absl::nullopt; current_ghost_view_->FadeOut(); current_ghost_view_ = nullptr; }
diff --git a/ash/shelf/shelf_view.h b/ash/shelf/shelf_view.h index a9bfd4b..1e1f210c 100644 --- a/ash/shelf/shelf_view.h +++ b/ash/shelf/shelf_view.h
@@ -305,10 +305,12 @@ ShelfAppButton* drag_view() { return drag_view_; } - const std::vector<int>& visible_views_indices() const { + const std::vector<size_t>& visible_views_indices() const { return visible_views_indices_; } - int number_of_visible_apps() const { return visible_views_indices_.size(); } + size_t number_of_visible_apps() const { + return visible_views_indices_.size(); + } ShelfWidget* shelf_widget() const { return shelf_->shelf_widget(); } const views::ViewModel* view_model() const { return view_model_.get(); } ShelfID drag_and_drop_shelf_id() const { return drag_and_drop_shelf_id_; } @@ -322,7 +324,9 @@ return shelf_menu_model_adapter_.get(); } - int current_ghost_view_index() const { return current_ghost_view_index_; } + absl::optional<size_t> current_ghost_view_index() const { + return current_ghost_view_index_; + } private: friend class ShelfViewTestAPI; @@ -421,11 +425,11 @@ // Returns the range (in the model) the item at the specified index can be // dragged to. - std::pair<int, int> GetDragRange(int index); + std::pair<size_t, size_t> GetDragRange(size_t index); // Checks if the item at |dragged_item_index| should be pinned or unpinned on // pointer release. - bool ShouldUpdateDraggedViewPinStatus(int dragged_item_index); + bool ShouldUpdateDraggedViewPinStatus(size_t dragged_item_index); // Checks if |dragged_view| is allowed to be dragged across the separator to // perform pinning and unpinning. Note that this function doesn't check if the @@ -434,7 +438,7 @@ // If there is a drag operation in progress it's canceled. If |modified_index| // is valid, the new position of the corresponding item is returned. - int CancelDrag(int modified_index); + absl::optional<size_t> CancelDrag(absl::optional<size_t> modified_index); // Returns rectangle bounds used for drag insertion. gfx::Rect GetBoundsForDragInsertInScreen(); @@ -569,7 +573,7 @@ std::unique_ptr<views::ViewModel> view_model_; // The indices of the views in |view_model_| that are visible. - std::vector<int> visible_views_indices_; + std::vector<size_t> visible_views_indices_; std::unique_ptr<views::BoundsAnimator> bounds_animator_; @@ -589,8 +593,8 @@ // items. views::Separator* separator_ = nullptr; - // Index of |separator_|. It is set to -1 if it is invisible. - int separator_index_ = -1; + // Index of |separator_|. It is set to nullopt if it is invisible. + absl::optional<size_t> separator_index_ = absl::nullopt; // Used in |drag_view_relative_to_ideal_bounds_| to represent the relative // position between |drag_view_| and its ideal bounds in shelf. @@ -612,7 +616,7 @@ gfx::Point drag_origin_; // Index |drag_view_| was initially at. - int start_drag_index_ = -1; + absl::optional<size_t> start_drag_index_ = absl::nullopt; // Used for the context menu of a particular item. ShelfID context_menu_id_; @@ -671,7 +675,7 @@ // Record the index for the last pressed shelf item. This variable is used to // check if a repost event occurs on the same shelf item as previous one. If // so, the repost event should be ignored. - int last_pressed_index_ = -1; + absl::optional<size_t> last_pressed_index_ = absl::nullopt; // Tracks UMA metrics based on shelf button press actions. ShelfButtonPressedMetricTracker shelf_button_pressed_metric_tracker_; @@ -720,7 +724,7 @@ GhostImageView* last_ghost_view_ = nullptr; // The index in the shelf app icons where the |current_ghost_view_| will show. - int current_ghost_view_index_ = -1; + absl::optional<size_t> current_ghost_view_index_ = absl::nullopt; // When the scrollable shelf is enabled, |shelf_button_delegate_| should // be ScrollableShelfView.
diff --git a/ash/shelf/shelf_view_test_api.cc b/ash/shelf/shelf_view_test_api.cc index a8be137..72ee4b3 100644 --- a/ash/shelf/shelf_view_test_api.cc +++ b/ash/shelf/shelf_view_test_api.cc
@@ -47,7 +47,7 @@ ShelfViewTestAPI::~ShelfViewTestAPI() = default; -int ShelfViewTestAPI::GetButtonCount() { +size_t ShelfViewTestAPI::GetButtonCount() { return shelf_view_->view_model_->view_size(); } @@ -159,7 +159,7 @@ shelf_view_->context_menu_shown_callback_ = std::move(closure); } -int ShelfViewTestAPI::GetSeparatorIndex() const { +absl::optional<size_t> ShelfViewTestAPI::GetSeparatorIndex() const { return shelf_view_->separator_index_; }
diff --git a/ash/shelf/shelf_view_test_api.h b/ash/shelf/shelf_view_test_api.h index 5420ac3..02354667 100644 --- a/ash/shelf/shelf_view_test_api.h +++ b/ash/shelf/shelf_view_test_api.h
@@ -7,6 +7,7 @@ #include "ash/public/cpp/shelf_item.h" #include "base/callback_forward.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/ui_base_types.h" namespace base { @@ -41,7 +42,7 @@ ~ShelfViewTestAPI(); // Number of icons displayed. - int GetButtonCount(); + size_t GetButtonCount(); // Retrieve the button at |index|, doesn't support the home button, // because the home button is not a ShelfAppButton. @@ -122,7 +123,7 @@ void SetShelfContextMenuCallback(base::RepeatingClosure closure); // Returns |separator_index_|. - int GetSeparatorIndex() const; + absl::optional<size_t> GetSeparatorIndex() const; // Checks whether the separator is visible or not. bool IsSeparatorVisible() const;
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc index 8fe3a1c..b1a7895 100644 --- a/ash/shelf/shelf_view_unittest.cc +++ b/ash/shelf/shelf_view_unittest.cc
@@ -667,14 +667,16 @@ AddAppShortcut(); const auto app_id = AddApp(); - EXPECT_EQ(model_->item_count(), shelf_view_->number_of_visible_apps()); + EXPECT_EQ(static_cast<size_t>(model_->item_count()), + shelf_view_->number_of_visible_apps()); const gfx::Rect visible_items_bounds = test_api_->visible_shelf_item_bounds_union(); // Pin the app with `app_id` and expect that the visible items bounds union // remains the same. SetShelfItemTypeToAppShortcut(app_id); - EXPECT_EQ(model_->item_count(), shelf_view_->number_of_visible_apps()); + EXPECT_EQ(static_cast<size_t>(model_->item_count()), + shelf_view_->number_of_visible_apps()); EXPECT_EQ(visible_items_bounds, test_api_->visible_shelf_item_bounds_union()); } @@ -803,7 +805,7 @@ TEST_F(ShelfViewDragToPinTest, DragAppsToPinAndUnpin) { std::vector<std::pair<ShelfID, views::View*>> id_map; SetupForDragTest(&id_map); - int pinned_apps_size = id_map.size(); + size_t pinned_apps_size = id_map.size(); const ShelfID open_app_id = AddApp(); id_map.emplace_back(open_app_id, GetButtonByID(open_app_id)); @@ -869,7 +871,7 @@ TEST_F(ShelfViewDragToPinTest, BlockBrowserShortcutFromUnpinningByDragging) { std::vector<std::pair<ShelfID, views::View*>> id_map; SetupForDragTest(&id_map); - const int pinned_apps_size = id_map.size(); + const size_t pinned_apps_size = id_map.size(); const ShelfID open_app_id = AddApp(); id_map.emplace_back(open_app_id, GetButtonByID(open_app_id)); @@ -898,7 +900,7 @@ TEST_F(ShelfViewDragToPinTest, DragAppAroundSeparator) { std::vector<std::pair<ShelfID, views::View*>> id_map; SetupForDragTest(&id_map); - const int pinned_apps_size = id_map.size(); + const size_t pinned_apps_size = id_map.size(); const ShelfID open_app_id = AddApp(); id_map.emplace_back(open_app_id, GetButtonByID(open_app_id)); @@ -913,8 +915,8 @@ // Drag an unpinned open app that is beside the separator around and check // that the separator is correctly placed. - ASSERT_EQ(model_->ItemIndexByID(open_app_id), - test_api_->GetSeparatorIndex() + 1); + ASSERT_EQ(static_cast<size_t>(model_->ItemIndexByID(open_app_id)), + test_api_->GetSeparatorIndex().value() + 1); gfx::Point unpinned_app_location = GetButtonCenter(GetButtonByID(open_app_id)); generator->set_current_screen_location(unpinned_app_location); @@ -924,9 +926,9 @@ generator->MoveMouseBy(-button_width / 4, 0); EXPECT_EQ(1, GetHapticTickEventsCount()); // In this case, the separator is moved to the end of the shelf so it is set - // invisible and the |separator_index_| will be updated to -1. + // invisible and the |separator_index_| will be updated to nullopt. EXPECT_FALSE(test_api_->IsSeparatorVisible()); - EXPECT_EQ(test_api_->GetSeparatorIndex(), -1); + EXPECT_FALSE(test_api_->GetSeparatorIndex().has_value()); // Drag the mouse slightly to the right where the dragged app will stay at the // same index. generator->MoveMouseBy(button_width / 2, 0); @@ -940,7 +942,8 @@ // separator is correctly placed. Check that the dragged app is not a browser // shortcut, which can not be dragged across the separator. ASSERT_NE(model_->items()[pinned_apps_size - 1].type, TYPE_BROWSER_SHORTCUT); - ASSERT_EQ(model_->ItemIndexByID(id_map[pinned_apps_size - 1].first), + ASSERT_EQ(static_cast<size_t>( + model_->ItemIndexByID(id_map[pinned_apps_size - 1].first)), test_api_->GetSeparatorIndex()); gfx::Point pinned_app_location = GetButtonCenter(id_map[pinned_apps_size - 1].first); @@ -1383,7 +1386,7 @@ << "We should not be showing the app list"; // The tooltip shouldn't hide if the mouse is on normal buttons. - for (int i = 0; i < test_api_->GetButtonCount(); i++) { + for (size_t i = 0; i < test_api_->GetButtonCount(); i++) { ShelfAppButton* button = test_api_->GetButton(i); if (!button) continue; @@ -1397,7 +1400,7 @@ const int left = home_button->GetBoundsInScreen().right(); // Find the first shelf button that's to the right of the home button. int right = 0; - for (int i = 0; i < test_api_->GetButtonCount(); ++i) { + for (size_t i = 0; i < test_api_->GetButtonCount(); ++i) { ShelfAppButton* button = test_api_->GetButton(i); if (!button) continue; @@ -1423,7 +1426,7 @@ // The tooltip should hide if it's outside of all buttons. gfx::Rect all_area; - for (int i = 0; i < test_api_->GetButtonCount(); i++) { + for (size_t i = 0; i < test_api_->GetButtonCount(); i++) { ShelfAppButton* button = test_api_->GetButton(i); if (!button) continue; @@ -1447,7 +1450,7 @@ GetAppListTestHelper()->ShowAndRunLoop(GetPrimaryDisplayId()); // The tooltip shouldn't hide if the mouse is on normal buttons. - for (int i = 2; i < test_api_->GetButtonCount(); i++) { + for (size_t i = 2; i < test_api_->GetButtonCount(); i++) { ShelfAppButton* button = test_api_->GetButton(i); if (!button) continue; @@ -2226,16 +2229,16 @@ // At the start, the only visible app on the shelf is the browser app button // (index 0). ASSERT_EQ(1u, shelf_view_->visible_views_indices().size()); - EXPECT_EQ(0, shelf_view_->visible_views_indices()[0]); + EXPECT_EQ(0u, shelf_view_->visible_views_indices()[0]); // By enabling tablet mode, the back button (index 0) should become visible, // but that does not change the first and last visible indices. Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true); ASSERT_EQ(1u, shelf_view_->visible_views_indices().size()); - EXPECT_EQ(0, shelf_view_->visible_views_indices()[0]); + EXPECT_EQ(0u, shelf_view_->visible_views_indices()[0]); // Turn tablet mode off again. Shell::Get()->tablet_mode_controller()->SetEnabledForTest(false); ASSERT_EQ(1u, shelf_view_->visible_views_indices().size()); - EXPECT_EQ(0, shelf_view_->visible_views_indices()[0]); + EXPECT_EQ(0u, shelf_view_->visible_views_indices()[0]); } TEST_P(LtrRtlShelfViewTest, ReplacingDelegateCancelsContextMenu) { @@ -2344,7 +2347,7 @@ // Start shelf party. model_->ToggleShelfParty(); { - const std::vector<int> not_partying = {1, 3}; + const std::vector<size_t> not_partying = {1, 3}; EXPECT_EQ(not_partying, shelf_view_->visible_views_indices()); } test_api_->RunMessageLoopUntilAnimationsDone(); @@ -2354,7 +2357,7 @@ // End shelf party. model_->ToggleShelfParty(); { - const std::vector<int> not_partying = {0, 1, 2, 3}; + const std::vector<size_t> not_partying = {0, 1, 2, 3}; EXPECT_EQ(not_partying, shelf_view_->visible_views_indices()); } test_api_->RunMessageLoopUntilAnimationsDone(); @@ -2457,21 +2460,21 @@ EXPECT_TRUE(first_app->state() & ShelfAppButton::STATE_DRAGGING); EXPECT_FALSE(shelf_view_->drag_view()); - EXPECT_EQ(-1, shelf_view_->current_ghost_view_index()); + EXPECT_FALSE(shelf_view_->current_ghost_view_index().has_value()); ShelfID second_app_id = id_map[1].first; GetEventGenerator()->MoveTouch(GetButtonCenter(second_app_id)); EXPECT_TRUE(first_app->state() & ShelfAppButton::STATE_DRAGGING); EXPECT_TRUE(shelf_view_->drag_view()); - EXPECT_EQ(1, shelf_view_->current_ghost_view_index()); + EXPECT_EQ(1u, shelf_view_->current_ghost_view_index()); GetEventGenerator()->ReleaseTouch(); EXPECT_EQ(0, GetHapticTickEventsCount()); EXPECT_FALSE(first_app->state() & ShelfAppButton::STATE_DRAGGING); EXPECT_FALSE(shelf_view_->drag_view()); - EXPECT_EQ(-1, shelf_view_->current_ghost_view_index()); + EXPECT_FALSE(shelf_view_->current_ghost_view_index().has_value()); } // Tests that the ghost image is removed if the app is dragged outide of the @@ -2486,14 +2489,14 @@ EXPECT_TRUE(first_app->state() & ShelfAppButton::STATE_DRAGGING); EXPECT_FALSE(shelf_view_->drag_view()); - EXPECT_EQ(-1, shelf_view_->current_ghost_view_index()); + EXPECT_FALSE(shelf_view_->current_ghost_view_index().has_value()); ShelfID second_app_id = id_map[1].first; GetEventGenerator()->MoveTouch(GetButtonCenter(second_app_id)); EXPECT_TRUE(first_app->state() & ShelfAppButton::STATE_DRAGGING); EXPECT_TRUE(shelf_view_->drag_view()); - EXPECT_EQ(1, shelf_view_->current_ghost_view_index()); + EXPECT_EQ(1u, shelf_view_->current_ghost_view_index()); // The rip off threshold. Taken from |kRipOffDistance| in shelf_view.cc. constexpr int kRipOffDistance = 48; @@ -2503,14 +2506,14 @@ EXPECT_TRUE(first_app->state() & ShelfAppButton::STATE_DRAGGING); EXPECT_TRUE(shelf_view_->drag_view()); - EXPECT_EQ(-1, shelf_view_->current_ghost_view_index()); + EXPECT_FALSE(shelf_view_->current_ghost_view_index().has_value()); GetEventGenerator()->ReleaseTouch(); EXPECT_EQ(0, GetHapticTickEventsCount()); EXPECT_FALSE(first_app->state() & ShelfAppButton::STATE_DRAGGING); EXPECT_FALSE(shelf_view_->drag_view()); - EXPECT_EQ(-1, shelf_view_->current_ghost_view_index()); + EXPECT_FALSE(shelf_view_->current_ghost_view_index().has_value()); } // Disabled as likely to cause builder failure, see https://crbug.com/1334936. @@ -2526,14 +2529,14 @@ EXPECT_TRUE(first_app->state() & ShelfAppButton::STATE_DRAGGING); EXPECT_FALSE(shelf_view_->drag_view()); - EXPECT_EQ(-1, shelf_view_->current_ghost_view_index()); + EXPECT_FALSE(shelf_view_->current_ghost_view_index().has_value()); ShelfID second_app_id = id_map[1].first; GetEventGenerator()->MoveTouch(GetButtonCenter(second_app_id)); EXPECT_TRUE(first_app->state() & ShelfAppButton::STATE_DRAGGING); EXPECT_TRUE(shelf_view_->drag_view()); - EXPECT_EQ(1, shelf_view_->current_ghost_view_index()); + EXPECT_EQ(1u, shelf_view_->current_ghost_view_index()); // The rip off threshold. Taken from |kRipOffDistance| in shelf_view.cc. constexpr int kRipOffDistance = 48; @@ -2543,20 +2546,20 @@ EXPECT_TRUE(first_app->state() & ShelfAppButton::STATE_DRAGGING); EXPECT_TRUE(shelf_view_->drag_view()); - EXPECT_EQ(-1, shelf_view_->current_ghost_view_index()); + EXPECT_FALSE(shelf_view_->current_ghost_view_index().has_value()); GetEventGenerator()->MoveTouch(GetButtonCenter(second_app_id)); EXPECT_TRUE(first_app->state() & ShelfAppButton::STATE_DRAGGING); EXPECT_TRUE(shelf_view_->drag_view()); - EXPECT_EQ(1, shelf_view_->current_ghost_view_index()); + EXPECT_EQ(1u, shelf_view_->current_ghost_view_index()); GetEventGenerator()->ReleaseTouch(); EXPECT_EQ(0, GetHapticTickEventsCount()); EXPECT_FALSE(first_app->state() & ShelfAppButton::STATE_DRAGGING); EXPECT_FALSE(shelf_view_->drag_view()); - EXPECT_EQ(-1, shelf_view_->current_ghost_view_index()); + EXPECT_FALSE(shelf_view_->current_ghost_view_index().has_value()); } class ShelfViewVisibleBoundsTest : public ShelfViewTest, @@ -2572,7 +2575,7 @@ gfx::Rect visible_bounds = shelf_view_->GetVisibleItemsBoundsInScreen(); gfx::Rect shelf_bounds = shelf_view_->GetBoundsInScreen(); EXPECT_TRUE(shelf_bounds.Contains(visible_bounds)); - for (int i = 0; i < test_api_->GetButtonCount(); ++i) + for (size_t i = 0; i < test_api_->GetButtonCount(); ++i) if (ShelfAppButton* button = test_api_->GetButton(i)) { if (button->GetVisible()) EXPECT_TRUE(visible_bounds.Contains(button->GetBoundsInScreen())); @@ -3227,7 +3230,7 @@ // There are five buttons, including 3 app buttons. The back button and // launcher are always there, the browser shortcut is added in // ShelfViewTest and the two test apps added in ShelfViewFocusTest. - EXPECT_EQ(3, test_api_->GetButtonCount()); + EXPECT_EQ(3u, test_api_->GetButtonCount()); EXPECT_TRUE(GetPrimaryShelf()->navigation_widget()->IsActive()); // The home button is focused initially because the back button is only
diff --git a/ash/shell.cc b/ash/shell.cc index 22be1719..5f66a36 100644 --- a/ash/shell.cc +++ b/ash/shell.cc
@@ -436,6 +436,11 @@ observer.OnRootWindowAdded(root_window); } +void Shell::OnRootWindowWillShutdown(aura::Window* root_window) { + for (auto& observer : shell_observers_) + observer.OnRootWindowWillShutdown(root_window); +} + void Shell::OnDictationStarted() { for (auto& observer : shell_observers_) observer.OnDictationStarted(); @@ -718,10 +723,6 @@ // it before destroying |tablet_mode_controller_|. accessibility_controller_->Shutdown(); - // Because this function will call |SessionController::RemoveObserver|, do it - // before destroying |session_controller_|. - accelerator_controller_->Shutdown(); - // Must be destructed before human_presence_orientation_controller_. power_prefs_.reset();
diff --git a/ash/shell.h b/ash/shell.h index c50b35e..c9c2f11 100644 --- a/ash/shell.h +++ b/ash/shell.h
@@ -326,6 +326,9 @@ // Called when a root window is created. void OnRootWindowAdded(aura::Window* root_window); + // Called when a root window is about to shutdown. + void OnRootWindowWillShutdown(aura::Window* root_window); + // Called when dictation is activated. void OnDictationStarted();
diff --git a/ash/shell_observer.h b/ash/shell_observer.h index 8c6f537..b6bc14c1 100644 --- a/ash/shell_observer.h +++ b/ash/shell_observer.h
@@ -23,6 +23,9 @@ // Invoked after a non-primary root window is created. virtual void OnRootWindowAdded(aura::Window* root_window) {} + // Invoked when a root window is about to be shutdown. + virtual void OnRootWindowWillShutdown(aura::Window* root_window) {} + // Invoked when the shelf alignment in |root_window| is changed. virtual void OnShelfAlignmentChanged(aura::Window* root_window, ShelfAlignment old_alignment) {}
diff --git a/ash/shell_test_api.cc b/ash/shell_test_api.cc index e48f7a8..8e7c4665 100644 --- a/ash/shell_test_api.cc +++ b/ash/shell_test_api.cc
@@ -126,13 +126,6 @@ use_delay); } -// static -void ShellTestApi::SetShouldShowShortcutNotificationForTest( - bool show_notification) { - AcceleratorControllerImpl::SetShouldShowShortcutNotificationForTest( - show_notification); -} - MessageCenterController* ShellTestApi::message_center_controller() { return shell_->message_center_controller_.get(); }
diff --git a/ash/system/OWNERS b/ash/system/OWNERS index 3885bf6a..b262985 100644 --- a/ash/system/OWNERS +++ b/ash/system/OWNERS
@@ -2,3 +2,9 @@ leandre@chromium.org newcomer@chromium.org tbarzic@chromium.org + +per-file caps_lock_notification_controller*=zentaro@chromium.org +per-file caps_lock_notification_controller*=jimmyxgong@chromium.org +per-file *brightness*=zentaro@chromium.org +per-file *brightness*=jimmyxgong@chromium.org +
diff --git a/ash/system/firmware_update/OWNERS b/ash/system/firmware_update/OWNERS new file mode 100644 index 0000000..b1bc9ccf --- /dev/null +++ b/ash/system/firmware_update/OWNERS
@@ -0,0 +1,2 @@ +jimmyxgong@chromium.org +zentaro@chromium.org
diff --git a/ash/system/keyboard_brightness/OWNERS b/ash/system/keyboard_brightness/OWNERS new file mode 100644 index 0000000..b1bc9ccf --- /dev/null +++ b/ash/system/keyboard_brightness/OWNERS
@@ -0,0 +1,2 @@ +jimmyxgong@chromium.org +zentaro@chromium.org
diff --git a/ash/system/keyboard_brightness/keyboard_backlight_color_controller.cc b/ash/system/keyboard_brightness/keyboard_backlight_color_controller.cc index f84570f..094b6c2 100644 --- a/ash/system/keyboard_brightness/keyboard_backlight_color_controller.cc +++ b/ash/system/keyboard_brightness/keyboard_backlight_color_controller.cc
@@ -94,12 +94,8 @@ prefs::kPersonalizationKeyboardBacklightColor)); } -void KeyboardBacklightColorController::OnActiveUserSessionChanged( - const AccountId& account_id) { - auto* session_controller = Shell::Get()->session_controller(); - DCHECK(session_controller); - PrefService* pref_service = - session_controller->GetUserPrefServiceForUser(account_id); +void KeyboardBacklightColorController::OnActiveUserPrefServiceChanged( + PrefService* pref_service) { DCHECK(pref_service); auto backlight_color = static_cast<personalization_app::mojom::BacklightColor>(
diff --git a/ash/system/keyboard_brightness/keyboard_backlight_color_controller.h b/ash/system/keyboard_brightness/keyboard_backlight_color_controller.h index 467fd4a..04f9225 100644 --- a/ash/system/keyboard_brightness/keyboard_backlight_color_controller.h +++ b/ash/system/keyboard_brightness/keyboard_backlight_color_controller.h
@@ -42,7 +42,7 @@ personalization_app::mojom::BacklightColor GetBacklightColor(); // SessionObserver: - void OnActiveUserSessionChanged(const AccountId& account_id) override; + void OnActiveUserPrefServiceChanged(PrefService* pref_service) override; // WallpaperControllerObserver: void OnWallpaperColorsChanged() override;
diff --git a/ash/system/message_center/unified_message_list_view.cc b/ash/system/message_center/unified_message_list_view.cc index 27e94c21..174e060c 100644 --- a/ash/system/message_center/unified_message_list_view.cc +++ b/ash/system/message_center/unified_message_list_view.cc
@@ -696,8 +696,10 @@ void UnifiedMessageListView::ConvertNotificationViewToGroupedNotificationView( const std::string& ungrouped_notification_id, const std::string& new_grouped_notification_id) { - GetMessageViewForNotificationId(ungrouped_notification_id) - ->set_notification_id(new_grouped_notification_id); + auto* message_view = + GetMessageViewForNotificationId(ungrouped_notification_id); + if (message_view) + message_view->set_notification_id(new_grouped_notification_id); } void UnifiedMessageListView::ConvertGroupedNotificationViewToNotificationView(
diff --git a/ash/system/pcie_peripheral/OWNERS b/ash/system/pcie_peripheral/OWNERS new file mode 100644 index 0000000..b1bc9ccf --- /dev/null +++ b/ash/system/pcie_peripheral/OWNERS
@@ -0,0 +1,2 @@ +jimmyxgong@chromium.org +zentaro@chromium.org
diff --git a/ash/system/phonehub/camera_roll_view.cc b/ash/system/phonehub/camera_roll_view.cc index 3ce8ef0..468cac3 100644 --- a/ash/system/phonehub/camera_roll_view.cc +++ b/ash/system/phonehub/camera_roll_view.cc
@@ -108,7 +108,7 @@ void CameraRollView::CameraRollItemsView::AddCameraRollItem( views::View* camera_roll_item) { - int view_size = camera_roll_items_.view_size(); + size_t view_size = camera_roll_items_.view_size(); camera_roll_items_.Add(camera_roll_item, view_size); AddChildView(camera_roll_item); } @@ -135,7 +135,7 @@ void CameraRollView::CameraRollItemsView::Layout() { views::View::Layout(); CalculateIdealBounds(); - for (int i = 0; i < camera_roll_items_.view_size(); ++i) { + for (size_t i = 0; i < camera_roll_items_.view_size(); ++i) { auto* thumbnail = camera_roll_items_.view_at(i); thumbnail->SetBoundsRect(camera_roll_items_.ideal_bounds(i)); } @@ -158,7 +158,7 @@ } void CameraRollView::CameraRollItemsView::CalculateIdealBounds() { - for (int i = 0; i < camera_roll_items_.view_size(); ++i) { + for (size_t i = 0; i < camera_roll_items_.view_size(); ++i) { gfx::Rect camera_roll_item_bounds = gfx::Rect(GetCameraRollItemPosition(i), GetCameraRollItemSize()); camera_roll_items_.set_ideal_bounds(i, camera_roll_item_bounds);
diff --git a/ash/system/phonehub/task_continuation_view.cc b/ash/system/phonehub/task_continuation_view.cc index 9c0c967e..2df9381 100644 --- a/ash/system/phonehub/task_continuation_view.cc +++ b/ash/system/phonehub/task_continuation_view.cc
@@ -104,7 +104,7 @@ TaskContinuationView::TaskChipsView::~TaskChipsView() = default; void TaskContinuationView::TaskChipsView::AddTaskChip(views::View* task_chip) { - int view_size = task_chips_.view_size(); + size_t view_size = task_chips_.view_size(); task_chips_.Add(task_chip, view_size); AddChildView(task_chip); } @@ -127,7 +127,7 @@ void TaskContinuationView::TaskChipsView::Layout() { views::View::Layout(); CalculateIdealBounds(); - for (int i = 0; i < task_chips_.view_size(); ++i) { + for (size_t i = 0; i < task_chips_.view_size(); ++i) { auto* button = task_chips_.view_at(i); button->SetBoundsRect(task_chips_.ideal_bounds(i)); } @@ -154,7 +154,7 @@ } void TaskContinuationView::TaskChipsView::CalculateIdealBounds() { - for (int i = 0; i < task_chips_.view_size(); ++i) { + for (size_t i = 0; i < task_chips_.view_size(); ++i) { gfx::Rect tile_bounds = gfx::Rect(GetButtonPosition(i), GetTaskContinuationChipSize()); task_chips_.set_ideal_bounds(i, tile_bounds);
diff --git a/ash/system/unified/feature_pods_container_view.cc b/ash/system/unified/feature_pods_container_view.cc index 9b932372..e800760 100644 --- a/ash/system/unified/feature_pods_container_view.cc +++ b/ash/system/unified/feature_pods_container_view.cc
@@ -116,7 +116,7 @@ void FeaturePodsContainerView::Layout() { UpdateCollapsedSidePadding(); CalculateIdealBoundsForFeaturePods(); - for (int i = 0; i < visible_buttons_.view_size(); ++i) { + for (size_t i = 0; i < visible_buttons_.view_size(); ++i) { auto* button = visible_buttons_.view_at(i); button->SetBoundsRect(visible_buttons_.ideal_bounds(i)); } @@ -136,12 +136,14 @@ bool visible = IsButtonVisible(child, visible_count); child->SetVisibleByContainer(visible); if (visible) { - if (visible_buttons_.GetIndexOfView(child) < 0) + if (!visible_buttons_.GetIndexOfView(child).has_value()) visible_buttons_.Add(child, visible_count); ++visible_count; } else { - if (visible_buttons_.GetIndexOfView(child)) - visible_buttons_.Remove(visible_buttons_.GetIndexOfView(child)); + if (auto index = visible_buttons_.GetIndexOfView(child); + index.has_value()) { + visible_buttons_.Remove(index.value()); + } } } UpdateTotalPages(); @@ -163,17 +165,17 @@ } void FeaturePodsContainerView::EnsurePageWithButton(views::View* button) { - int index = visible_buttons_.GetIndexOfView(button->parent()); - if (index < 0) + auto index = visible_buttons_.GetIndexOfView(button->parent()); + if (!index.has_value()) return; int tiles_per_page = GetTilesPerPage(); - int first_index = pagination_model_->selected_page() * tiles_per_page; - int last_index = + size_t first_index = pagination_model_->selected_page() * tiles_per_page; + size_t last_index = ((pagination_model_->selected_page() + 1) * tiles_per_page) - 1; - if (index < first_index || index > last_index) { - int page = ((index + 1) / tiles_per_page) + - ((index + 1) % tiles_per_page ? 1 : 0) - 1; + if (index.value() < first_index || index.value() > last_index) { + int page = ((index.value() + 1) / tiles_per_page) + + ((index.value() + 1) % tiles_per_page ? 1 : 0) - 1; pagination_model_->SelectPage(page, true /*animate*/); } @@ -273,7 +275,7 @@ } void FeaturePodsContainerView::AddFeaturePodButton(FeaturePodButton* button) { - int view_size = visible_buttons_.view_size(); + size_t view_size = visible_buttons_.view_size(); if (IsButtonVisible(button, view_size)) { visible_buttons_.Add(button, view_size); } @@ -318,7 +320,7 @@ } void FeaturePodsContainerView::CalculateIdealBoundsForFeaturePods() { - for (int i = 0; i < visible_buttons_.view_size(); ++i) { + for (size_t i = 0; i < visible_buttons_.view_size(); ++i) { gfx::Rect tile_bounds; gfx::Size child_size; // When we are on the first page we calculate bounds for an expanded tray @@ -358,7 +360,7 @@ void FeaturePodsContainerView::UpdateTotalPages() { int total_pages = 0; - int total_visible = visible_buttons_.view_size(); + size_t total_visible = visible_buttons_.view_size(); int tiles_per_page = GetTilesPerPage(); if (!visible_buttons_.view_size() || !tiles_per_page) {
diff --git a/ash/system/usb_peripheral/OWNERS b/ash/system/usb_peripheral/OWNERS new file mode 100644 index 0000000..b1bc9ccf --- /dev/null +++ b/ash/system/usb_peripheral/OWNERS
@@ -0,0 +1,2 @@ +jimmyxgong@chromium.org +zentaro@chromium.org
diff --git a/ash/system/usb_peripheral/usb_peripheral_notification_controller_unittest.cc b/ash/system/usb_peripheral/usb_peripheral_notification_controller_unittest.cc index 3f76eaf6..ffaac4c 100644 --- a/ash/system/usb_peripheral/usb_peripheral_notification_controller_unittest.cc +++ b/ash/system/usb_peripheral/usb_peripheral_notification_controller_unittest.cc
@@ -7,7 +7,6 @@ #include "ash/constants/ash_features.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" -#include "base/test/scoped_feature_list.h" #include "ui/message_center/message_center.h" using message_center::MessageCenter; @@ -31,9 +30,7 @@ class UsbPeripheralNotificationControllerTest : public AshTestBase { public: - UsbPeripheralNotificationControllerTest() { - feature_list_.InitAndEnableFeature(features::kUsbNotificationController); - } + UsbPeripheralNotificationControllerTest() = default; UsbPeripheralNotificationControllerTest( const UsbPeripheralNotificationControllerTest&) = delete; UsbPeripheralNotificationControllerTest& operator=( @@ -45,7 +42,6 @@ } private: - base::test::ScopedFeatureList feature_list_; }; TEST_F(UsbPeripheralNotificationControllerTest, InvalidDpCableNotification) {
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc index 69272766..66bca5e 100644 --- a/ash/test/ash_test_helper.cc +++ b/ash/test/ash_test_helper.cc
@@ -265,11 +265,6 @@ ambient_ash_test_helper_ = std::make_unique<AmbientAshTestHelper>(); - // There is a temporary M92-M94 notification that shows once to users - // at startup, but this interferes with many tests that expect a - // specific active window, or a certain number of notifications. - AcceleratorControllerImpl::SetShouldShowShortcutNotificationForTest(false); - ShellInitParams shell_init_params; shell_init_params.delegate = std::move(init_params.delegate); if (!shell_init_params.delegate)
diff --git a/ash/wm/desks/desk_mini_view.cc b/ash/wm/desks/desk_mini_view.cc index bb7f63c..bd5b83f 100644 --- a/ash/wm/desks/desk_mini_view.cc +++ b/ash/wm/desks/desk_mini_view.cc
@@ -93,6 +93,7 @@ desk_name_view->AddObserver(this); desk_name_view->set_controller(this); desk_name_view->SetText(desk_->name()); + desk_name_view->SetAccessibleName(desk_->name()); SetPaintToLayer(); layer()->SetFillsBoundsOpaquely(false);
diff --git a/ash/wm/desks/desk_preview_view.cc b/ash/wm/desks/desk_preview_view.cc index 554fbd83..37f9869 100644 --- a/ash/wm/desks/desk_preview_view.cc +++ b/ash/wm/desks/desk_preview_view.cc
@@ -27,6 +27,7 @@ #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" #include "base/cxx17_backports.h" +#include "ui/accessibility/ax_node_data.h" #include "ui/aura/client/aura_constants.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_tree_owner.h" @@ -386,6 +387,13 @@ return "DeskPreviewView"; } +void DeskPreviewView::GetAccessibleNodeData(ui::AXNodeData* node_data) { + // Avoid failing accessibility checks if we don't have a name. + views::Button::GetAccessibleNodeData(node_data); + if (GetAccessibleName().empty()) + node_data->SetNameExplicitlyEmpty(); +} + void DeskPreviewView::Layout() { const gfx::Rect bounds = GetContentsBounds(); shadow_->SetContentBounds(bounds);
diff --git a/ash/wm/desks/desk_preview_view.h b/ash/wm/desks/desk_preview_view.h index 6f5438b1..0d98527 100644 --- a/ash/wm/desks/desk_preview_view.h +++ b/ash/wm/desks/desk_preview_view.h
@@ -102,6 +102,7 @@ // views::View: const char* GetClassName() const override; + void GetAccessibleNodeData(ui::AXNodeData* node_data) override; void Layout() override; bool OnMousePressed(const ui::MouseEvent& event) override; bool OnMouseDragged(const ui::MouseEvent& event) override;
diff --git a/ash/wm/desks/desks_unittests.cc b/ash/wm/desks/desks_unittests.cc index 848bddf..3036d80e 100644 --- a/ash/wm/desks/desks_unittests.cc +++ b/ash/wm/desks/desks_unittests.cc
@@ -4271,8 +4271,7 @@ // given |window| is equal to the given |expected_visibility|. void VerifyViewVisibility(aura::Window* window, bool expected_visibility) const { - const int index = GetShelfItemIndexForWindow(window); - EXPECT_GE(index, 0); + const size_t index = GetShelfItemIndexForWindow(window); auto* shelf_view = GetShelfView(); auto* view_model = shelf_view->view_model();
diff --git a/base/bind_internal.h b/base/bind_internal.h index 7618e87..fe0ab2d 100644 --- a/base/bind_internal.h +++ b/base/bind_internal.h
@@ -87,10 +87,10 @@ // Trick to only instantiate this constructor if it is used. Otherwise, // instantiating UnretainedWrapper with a T that is not supported by // raw_ptr would trigger raw_ptr<T>'s static_assert. - template <typename U = T> + template <typename U = T, typename Option> // Avoids having a raw_ptr<T> -> T* -> raw_ptr<T> round trip, which // would trigger the raw_ptr error detector if T* was dangling. - explicit UnretainedWrapper(const raw_ptr<U>& o) : ptr_(o) {} + explicit UnretainedWrapper(const raw_ptr<U, Option>& o) : ptr_(o) {} T* get() const { return ptr_; } private:
diff --git a/base/check.cc b/base/check.cc index bcc48b1..a62f5fc 100644 --- a/base/check.cc +++ b/base/check.cc
@@ -22,37 +22,37 @@ CheckError CheckError::Check(const char* file, int line, const char* condition) { - CheckError check_error(new LogMessage(file, line, LOGGING_FATAL)); - check_error.stream() << "Check failed: " << condition << ". "; - return check_error; + auto* const log_message = new LogMessage(file, line, LOGGING_FATAL); + log_message->stream() << "Check failed: " << condition << ". "; + return CheckError(log_message); } CheckError CheckError::CheckOp(const char* file, int line, CheckOpResult* check_op_result) { - CheckError check_error(new LogMessage(file, line, LOGGING_FATAL)); - check_error.stream() << "Check failed: " << check_op_result->message_; + auto* const log_message = new LogMessage(file, line, LOGGING_FATAL); + log_message->stream() << "Check failed: " << check_op_result->message_; free(check_op_result->message_); check_op_result->message_ = nullptr; - return check_error; + return CheckError(log_message); } CheckError CheckError::DCheck(const char* file, int line, const char* condition) { - CheckError check_error(new LogMessage(file, line, LOGGING_DCHECK)); - check_error.stream() << "Check failed: " << condition << ". "; - return check_error; + auto* const log_message = new LogMessage(file, line, LOGGING_DCHECK); + log_message->stream() << "Check failed: " << condition << ". "; + return CheckError(log_message); } CheckError CheckError::DCheckOp(const char* file, int line, CheckOpResult* check_op_result) { - CheckError check_error(new LogMessage(file, line, LOGGING_DCHECK)); - check_error.stream() << "Check failed: " << check_op_result->message_; + auto* const log_message = new LogMessage(file, line, LOGGING_DCHECK); + log_message->stream() << "Check failed: " << check_op_result->message_; free(check_op_result->message_); check_op_result->message_ = nullptr; - return check_error; + return CheckError(log_message); } CheckError CheckError::PCheck(const char* file, @@ -60,14 +60,14 @@ const char* condition) { SystemErrorCode err_code = logging::GetLastSystemErrorCode(); #if BUILDFLAG(IS_WIN) - CheckError check_error( - new Win32ErrorLogMessage(file, line, LOGGING_FATAL, err_code)); + auto* const log_message = + new Win32ErrorLogMessage(file, line, LOGGING_FATAL, err_code); #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) - CheckError check_error( - new ErrnoLogMessage(file, line, LOGGING_FATAL, err_code)); + auto* const log_message = + new ErrnoLogMessage(file, line, LOGGING_FATAL, err_code); #endif - check_error.stream() << "Check failed: " << condition << ". "; - return check_error; + log_message->stream() << "Check failed: " << condition << ". "; + return CheckError(log_message); } CheckError CheckError::PCheck(const char* file, int line) { @@ -79,22 +79,22 @@ const char* condition) { SystemErrorCode err_code = logging::GetLastSystemErrorCode(); #if BUILDFLAG(IS_WIN) - CheckError check_error( - new Win32ErrorLogMessage(file, line, LOGGING_DCHECK, err_code)); + auto* const log_message = + new Win32ErrorLogMessage(file, line, LOGGING_DCHECK, err_code); #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) - CheckError check_error( - new ErrnoLogMessage(file, line, LOGGING_DCHECK, err_code)); + auto* const log_message = + new ErrnoLogMessage(file, line, LOGGING_DCHECK, err_code); #endif - check_error.stream() << "Check failed: " << condition << ". "; - return check_error; + log_message->stream() << "Check failed: " << condition << ". "; + return CheckError(log_message); } CheckError CheckError::NotImplemented(const char* file, int line, const char* function) { - CheckError check_error(new LogMessage(file, line, LOGGING_ERROR)); - check_error.stream() << "Not implemented reached in " << function; - return check_error; + auto* const log_message = new LogMessage(file, line, LOGGING_ERROR); + log_message->stream() << "Not implemented reached in " << function; + return CheckError(log_message); } std::ostream& CheckError::stream() {
diff --git a/base/check.h b/base/check.h index 6b4de3a..7561cd3 100644 --- a/base/check.h +++ b/base/check.h
@@ -87,15 +87,13 @@ NOMERGE ~CheckError(); - CheckError(const CheckError& other) = delete; - CheckError& operator=(const CheckError& other) = delete; - CheckError(CheckError&& other) = default; - CheckError& operator=(CheckError&& other) = default; + CheckError(const CheckError&) = delete; + CheckError& operator=(const CheckError&) = delete; private: explicit CheckError(LogMessage* log_message); - LogMessage* log_message_; + LogMessage* const log_message_; }; #if defined(OFFICIAL_BUILD) && defined(NDEBUG)
diff --git a/build/android/gyp/jacoco_instr.py b/build/android/gyp/jacoco_instr.py index ff8c5fa0..a602f0a5 100755 --- a/build/android/gyp/jacoco_instr.py +++ b/build/android/gyp/jacoco_instr.py
@@ -101,6 +101,7 @@ data = {} data['source_dirs'] = relative_sources data['input_path'] = [] + data['output_dir'] = src_root if input_path: data['input_path'].append(os.path.abspath(input_path)) with open(sources_json_file, 'w') as f:
diff --git a/build/fuchsia/ffx_session.py b/build/fuchsia/ffx_session.py index 7d3c9e7..282ea64 100755 --- a/build/fuchsia/ffx_session.py +++ b/build/fuchsia/ffx_session.py
@@ -283,7 +283,9 @@ An FfxTarget for interacting with the target. """ target_id = format_host_port(address, port) - self.run_ffx(['target', 'add', target_id]) + # -n allows `target add` to skip waiting for the device to come up, + # as this can take longer than the default wait period. + self.run_ffx(['target', 'add', '-n', target_id]) try: yield FfxTarget.from_address(self, address, port) finally:
diff --git a/build/fuchsia/linux_internal.sdk.sha1 b/build/fuchsia/linux_internal.sdk.sha1 index dc7141d..9900cb4 100644 --- a/build/fuchsia/linux_internal.sdk.sha1 +++ b/build/fuchsia/linux_internal.sdk.sha1
@@ -1 +1 @@ -8.20220623.1.1 +8.20220623.2.1
diff --git a/build/rust/rust_executable.gni b/build/rust/rust_executable.gni index ab22c51..2791616 100644 --- a/build/rust/rust_executable.gni +++ b/build/rust/rust_executable.gni
@@ -34,6 +34,12 @@ # crates.io. Each feature in the list will be passed to rustc as # '--cfg feature=XXX' # +# inputs (optional) +# Additional input files needed for compilation (such as `include!`ed files) +# +# test_inputs (optional) +# Same as above but for the unit tests target +# # Example of usage: # # rust_executable("foo_bar") {
diff --git a/build/rust/rust_static_library.gni b/build/rust/rust_static_library.gni index 666ef91..cf98ed8 100644 --- a/build/rust/rust_static_library.gni +++ b/build/rust/rust_static_library.gni
@@ -121,6 +121,12 @@ # crate_name (optional) # Per the usual gn meaning for Rust targets. # +# inputs (optional) +# Additional input files needed for compilation (such as `include!`ed files) +# +# test_inputs (optional) +# Same as above but for the unit tests target +# # Example of usage: # # rust_static_library("foo_bar") {
diff --git a/build/rust/rust_target.gni b/build/rust/rust_target.gni index c4c1d35..fa2d4d4 100644 --- a/build/rust/rust_target.gni +++ b/build/rust/rust_target.gni
@@ -321,6 +321,7 @@ "configs", "output_dir", "unit_test_target", + "test_inputs", ]) testonly = _testonly @@ -394,6 +395,13 @@ if (defined(invoker.test_deps)) { deps += invoker.test_deps } + inputs = [] + if (defined(invoker.inputs)) { + inputs += invoker.inputs + } + if (defined(invoker.test_inputs)) { + inputs += invoker.test_inputs + } if (defined(_mutually_dependent_target)) { # This routes through the C++ mixed target rule to get back to the # Rust $_target_name.
diff --git a/build/rust/rust_unit_test.gni b/build/rust/rust_unit_test.gni index c5ca024..1dd9d07 100644 --- a/build/rust/rust_unit_test.gni +++ b/build/rust/rust_unit_test.gni
@@ -20,6 +20,7 @@ # crate_root (optional) # features (optional) # rustflags (optional) +# inputs (optional) # All as in rust_static_library. # # Example of usage:
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PartialCustomTabHeightStrategy.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PartialCustomTabHeightStrategy.java index d2aef1e..630bebb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PartialCustomTabHeightStrategy.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/PartialCustomTabHeightStrategy.java
@@ -14,17 +14,18 @@ import android.content.Context; import android.content.res.Configuration; import android.graphics.Color; +import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.util.DisplayMetrics; +import android.view.Display; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.ViewStub; -import android.view.ViewTreeObserver.OnGlobalLayoutListener; import android.view.WindowInsets; import android.view.WindowManager; import android.widget.ImageView; @@ -307,21 +308,21 @@ }; // On pre-R devices, We wait till the layout is complete and get the content - // |android.R.id.content| view height. See |getAppUsableScreenHeight|. + // |android.R.id.content| view height. See |getAppUsableScreenHeightFromContent|. mPositionUpdater = Build.VERSION.SDK_INT >= Build.VERSION_CODES.R ? this::updatePosition : () -> { // Maybe invoked before layout inflation? Simply return here - postion update will be // executed by |onPostInflationStartUp| anyway. if (mContentFrame == null) return; - mContentFrame.getViewTreeObserver().addOnGlobalLayoutListener( - new OnGlobalLayoutListener() { - @Override - public void onGlobalLayout() { - mContentFrame.getViewTreeObserver().removeOnGlobalLayoutListener(this); - updatePosition(); - } - }); + mContentFrame.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { + @Override + public void onLayoutChange(View v, int left, int top, int right, int bottom, + int oldLeft, int oldTop, int oldRight, int oldBottom) { + mContentFrame.removeOnLayoutChangeListener(this); + updatePosition(); + } + }); }; } @@ -356,21 +357,34 @@ .getInsets(WindowInsets.Type.navigationBars()) .bottom; } - // On pre-R devices, there is no official way to get the navigation bar height. A common way - // was to get it from a resource definition('navigation_bar_height') but it fails on some - // vendor-customized devices. A workaround here is to subtract the app-usable height - // (client view height + status bar height) from the whole display height. - return mDisplayHeight - getAppUsableScreenHeight(); + // Pre-R OS offers no official way to get the navigation bar height. A common way was + // to get it from a resource definition('navigation_bar_height') but it fails on some + // vendor-customized devices. + // A workaround here is to subtract the app-usable height from the whole display height. + // There are a couple of ways to get the app-usable height: + // 1) content frame + status bar height + // 2) |display.getSize| + // On some devices, only one returns the right height, the other returning a height + // bigger that the actual value. Heuristically we choose the smaller of the two. + return mDisplayHeight + - Math.max(getAppUsableScreenHeightFromContent(), + getAppUsableScreenHeightFromDisplay()); } - private int getAppUsableScreenHeight() { - // A correct way to get the client area height would be to use |decor_content_parent|, - // the parent of |content|, to make sure to include the top action bar dimension. But - // CCT (or Chrome for that matter) doesn't have the top action bar. So getting the height - // of |content| is enough. + private int getAppUsableScreenHeightFromContent() { + // A correct way to get the client area height would be to use the parent of |content| + // to make sure to include the top action bar dimension. But CCT (or Chrome for that + // matter) doesn't have the top action bar. So getting the height of |content| is enough. return mContentFrame.getHeight() + getStatusBarHeight(); } + private int getAppUsableScreenHeightFromDisplay() { + Display display = mActivity.getWindowManager().getDefaultDisplay(); + Point size = new Point(); + display.getSize(size); + return size.y; + } + @Override public void onToolbarInitialized( View coordinatorView, CustomTabToolbar toolbar, @Px int toolbarCornerRadius) {
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index 4988b7e..211b62b 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd
@@ -1579,6 +1579,97 @@ <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BOTTOM_SUMMARY" desc="A conclusion paragraph for the entire page. It sits beneath the “More control over the ads you see” subtitle but it’s no more associated with that topic than “Limit sharing between sites”. * “in Chrome settings”: The URL is chrome://settings/privacySandbox. We don’t make it a live link because we need the users to stay in this moment until they make a choice."> You can learn more about these features in Chrome settings. </message> + + <!-- GoogleUpdater Strings --> + <if expr="is_win"> + <message name="IDS_FRIENDLY_COMPANY_NAME" desc="Company name"> + Google + </message> + <message name="IDS_NO_UPDATE_RESPONSE" desc="Updater response for no updates when handling install result."> + No update is available. + </message> + <message name="IDS_INSTALL_UPDATER_FAILED" desc="Updater response for failure when handling install result."> + Installation failed. Please try again. + </message> + <message name="IDS_INSTALLER_DISPLAY_NAME" desc="Name for the updater metainstaller."> + <ph name="COMPANY_NAME">$1<ex>Google</ex></ph> Installer + </message> + <message name="IDS_CLOSE_BUTTON" desc="Close button tooltip"> + Close + </message> + <message name="IDS_MINIMIZE_BUTTON" desc="Minimize button tooltip"> + Minimize + </message> + <message name="IDS_INITIALIZING" desc="Initial message for the progress window."> + Initializing... + </message> + <message name="IDS_WAITING_TO_CONNECT" desc="Message to show while checking for updates."> + Connecting to the Internet... + </message> + <message name="IDS_DOWNLOADING_SHORT" desc="Shows how many seconds are remaining in the download."> + Downloading... <ph name="SECONDS">$1<ex>0</ex></ph> second(s) remaining + </message> + <message name="IDS_DOWNLOADING_LONG" desc="Shows how many minutes are remaining in the download."> + Downloading... <ph name="MINUTE">$1<ex>0</ex></ph> minute(s) remaining + </message> + <message name="IDS_DOWNLOADING_VERY_LONG" desc="Shows how many hours are remaining in the download."> + Downloading... <ph name="HOURS">$1<ex>0</ex></ph> hour(s) remaining + </message> + <message name="IDS_DOWNLOADING_COMPLETED" desc="For when donwload is completed."> + Download complete. + </message> + <message name="IDS_DOWNLOADING" desc="For when time remaining is less than 0."> + Downloading... + </message> + <message name="IDS_WAITING_TO_INSTALL" desc="While waiting to install between downloading and installing."> + Waiting to install... + </message> + <message name="IDS_INSTALLING" desc="Message shown during install."> + Installing... + </message> + <message name="IDS_CANCELING" desc="For when requesting to cancel the installation."> + Canceling... + </message> + <message name="IDS_TEXT_RESTART_BROWSER" desc="For when a browser must be restarted to complete the installation."> + Thanks for installing. You must restart your browser before using <ph name="BUNDLE_NAME">$1<ex>Chrome</ex></ph>. + </message> + <message name="IDS_TEXT_RESTART_ALL_BROWSERS" desc="For when all browsers must be restarted to complete the installation."> + Thanks for installing. You must restart all your browsers before using <ph name="BUNDLE_NAME">$1<ex>Chrome</ex></ph>. + </message> + <message name="IDS_TEXT_RESTART_COMPUTER" desc="For when the computer must be restarted to complete the installation."> + Thanks for installing. You must restart your computer before using <ph name="BUNDLE_NAME">$1<ex>Chrome</ex></ph>. + </message> + <message name="IDS_UPDATER_CLOSE" desc="For close button on the UI post install completion."> + Close + </message> + <message name="IDS_RESTART_NOW" desc="For button to restart now to complete installation."> + Restart Now + </message> + <message name="IDS_RESTART_LATER" desc="For button to restart later to complete installation."> + Restart Later + </message> + <message name="IDS_GET_HELP_TEXT" desc="For button to get help."> + Help + </message> + <message name="IDS_INSTALLATION_STOPPED_WINDOW_TITLE" desc="For dialog when user chooses to close the installation window."> + Installation Stopped. + </message> + <message name="IDS_INSTALL_STOPPED" desc="Message of the dialog when user chooses to close the installation window."> + Installation not complete. Are you sure you want to cancel? + </message> + <message name="IDS_RESUME_INSTALLATION" desc="For button to resume the installation."> + Resume Installation + </message> + <message name="IDS_CANCEL_INSTALLATION" desc="For button to cancel the installation."> + Cancel Installation + </message> + <message name="IDS_SPLASH_SCREEN_MESSAGE" desc="Main message on the splash screen."> + On your marks... + </message> + <message name="IDS_BUNDLE_INSTALLED_SUCCESSFULLY" desc="Installation complete message."> + Installation complete. + </message> + </if> </messages> </release> </grit>
diff --git a/chrome/app/google_chrome_strings_grd/IDS_BUNDLE_INSTALLED_SUCCESSFULLY.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_BUNDLE_INSTALLED_SUCCESSFULLY.png.sha1 new file mode 100644 index 0000000..5237766 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_BUNDLE_INSTALLED_SUCCESSFULLY.png.sha1
@@ -0,0 +1 @@ +b451d5eacb13b4519d26c3e1db0d0af6152ab928 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_CANCELING.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_CANCELING.png.sha1 new file mode 100644 index 0000000..5014ae0 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_CANCELING.png.sha1
@@ -0,0 +1 @@ +b6c993c3c79c8a302797372652e5a155e1077ee2 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_CANCEL_INSTALLATION.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_CANCEL_INSTALLATION.png.sha1 new file mode 100644 index 0000000..c510077 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_CANCEL_INSTALLATION.png.sha1
@@ -0,0 +1 @@ +5499a870d5b63f043ce1e6f8678a237be0d894f4 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_CLOSE.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_CLOSE.png.sha1 new file mode 100644 index 0000000..8d321e2 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_CLOSE.png.sha1
@@ -0,0 +1 @@ +43678fe55d7069c3537f827f336f866aaa8414c2 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_CLOSE_BUTTON.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_CLOSE_BUTTON.png.sha1 new file mode 100644 index 0000000..c558486 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_CLOSE_BUTTON.png.sha1
@@ -0,0 +1 @@ +55e0d2035af0a1b4653d2915685220bc2569947d \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING.png.sha1 new file mode 100644 index 0000000..34d4082 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING.png.sha1
@@ -0,0 +1 @@ +17a2ef1e3c2e390ae9c92d37f8c13a4f89d0fa46 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING_COMPLETED.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING_COMPLETED.png.sha1 new file mode 100644 index 0000000..cd126a3 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING_COMPLETED.png.sha1
@@ -0,0 +1 @@ +278054b2910a8afce25f76d35d8fdd707a348dff \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING_LONG.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING_LONG.png.sha1 new file mode 100644 index 0000000..d61dddd --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING_LONG.png.sha1
@@ -0,0 +1 @@ +567bf476c661202576fae5aa650f663486d431eb \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING_SHORT.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING_SHORT.png.sha1 new file mode 100644 index 0000000..a7af9cd4 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING_SHORT.png.sha1
@@ -0,0 +1 @@ +2390c87850c60ffd972c0226a72936470dca7438 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING_VERY_LONG.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING_VERY_LONG.png.sha1 new file mode 100644 index 0000000..674461f --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_DOWNLOADING_VERY_LONG.png.sha1
@@ -0,0 +1 @@ +c2f2279fa5d65c2fb7721804f710846f5d48fbef \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_FRIENDLY_COMPANY_NAME.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_FRIENDLY_COMPANY_NAME.png.sha1 new file mode 100644 index 0000000..34916ef64 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_FRIENDLY_COMPANY_NAME.png.sha1
@@ -0,0 +1 @@ +03112a6f79304a544644109e940be165aecb4831 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_GET_HELP_TEXT.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_GET_HELP_TEXT.png.sha1 new file mode 100644 index 0000000..8d321e2 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_GET_HELP_TEXT.png.sha1
@@ -0,0 +1 @@ +43678fe55d7069c3537f827f336f866aaa8414c2 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_INITIALIZING.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_INITIALIZING.png.sha1 new file mode 100644 index 0000000..60257172 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_INITIALIZING.png.sha1
@@ -0,0 +1 @@ +cbb18fe2496f1a2f47ca8e921235b68c9973d23d \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_INSTALLATION_STOPPED_WINDOW_TITLE.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_INSTALLATION_STOPPED_WINDOW_TITLE.png.sha1 new file mode 100644 index 0000000..c510077 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_INSTALLATION_STOPPED_WINDOW_TITLE.png.sha1
@@ -0,0 +1 @@ +5499a870d5b63f043ce1e6f8678a237be0d894f4 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_INSTALLER_DISPLAY_NAME.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_INSTALLER_DISPLAY_NAME.png.sha1 new file mode 100644 index 0000000..34916ef64 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_INSTALLER_DISPLAY_NAME.png.sha1
@@ -0,0 +1 @@ +03112a6f79304a544644109e940be165aecb4831 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_INSTALLING.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_INSTALLING.png.sha1 new file mode 100644 index 0000000..b555e9d --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_INSTALLING.png.sha1
@@ -0,0 +1 @@ +1d6b94c555e17c15a49c61df63ad09e222a40362 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_INSTALL_STOPPED.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_INSTALL_STOPPED.png.sha1 new file mode 100644 index 0000000..c510077 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_INSTALL_STOPPED.png.sha1
@@ -0,0 +1 @@ +5499a870d5b63f043ce1e6f8678a237be0d894f4 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_INSTALL_UPDATER_FAILED.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_INSTALL_UPDATER_FAILED.png.sha1 new file mode 100644 index 0000000..8d321e2 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_INSTALL_UPDATER_FAILED.png.sha1
@@ -0,0 +1 @@ +43678fe55d7069c3537f827f336f866aaa8414c2 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_MINIMIZE_BUTTON.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_MINIMIZE_BUTTON.png.sha1 new file mode 100644 index 0000000..1ca2503 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_MINIMIZE_BUTTON.png.sha1
@@ -0,0 +1 @@ +a7dee107ecac164fdb63d028e6869a9ecc939fe1 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_NO_UPDATE_RESPONSE.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_NO_UPDATE_RESPONSE.png.sha1 new file mode 100644 index 0000000..232485fd --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_NO_UPDATE_RESPONSE.png.sha1
@@ -0,0 +1 @@ +aa08f6cc910b8d2b413f7f984880fd5d3c414f3c \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_RESTART_LATER.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_RESTART_LATER.png.sha1 new file mode 100644 index 0000000..a4b25c5 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_RESTART_LATER.png.sha1
@@ -0,0 +1 @@ +671c7cb54428721ac05560fc3fff45ddcac1da76 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_RESTART_NOW.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_RESTART_NOW.png.sha1 new file mode 100644 index 0000000..a4b25c5 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_RESTART_NOW.png.sha1
@@ -0,0 +1 @@ +671c7cb54428721ac05560fc3fff45ddcac1da76 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_RESUME_INSTALLATION.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_RESUME_INSTALLATION.png.sha1 new file mode 100644 index 0000000..c510077 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_RESUME_INSTALLATION.png.sha1
@@ -0,0 +1 @@ +5499a870d5b63f043ce1e6f8678a237be0d894f4 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_SPLASH_SCREEN_MESSAGE.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_SPLASH_SCREEN_MESSAGE.png.sha1 new file mode 100644 index 0000000..2e1bd799 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_SPLASH_SCREEN_MESSAGE.png.sha1
@@ -0,0 +1 @@ +de7135b6ff16de65f19bcb47b0422b0855ea2646 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_TEXT_RESTART_ALL_BROWSERS.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_TEXT_RESTART_ALL_BROWSERS.png.sha1 new file mode 100644 index 0000000..6ffd944 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_TEXT_RESTART_ALL_BROWSERS.png.sha1
@@ -0,0 +1 @@ +9a5da422cf7f7c80974a06befd009d1314ee0b92 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_TEXT_RESTART_BROWSER.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_TEXT_RESTART_BROWSER.png.sha1 new file mode 100644 index 0000000..575a5e5 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_TEXT_RESTART_BROWSER.png.sha1
@@ -0,0 +1 @@ +9b7159d120cf501c26ee089ac4eac5f467e49a92 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_TEXT_RESTART_COMPUTER.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_TEXT_RESTART_COMPUTER.png.sha1 new file mode 100644 index 0000000..89a38ba1 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_TEXT_RESTART_COMPUTER.png.sha1
@@ -0,0 +1 @@ +e7e221bc834e13b3b0e8e3c49dd81c519b659bc0 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_UPDATER_CLOSE.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_UPDATER_CLOSE.png.sha1 new file mode 100644 index 0000000..8d321e2 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_UPDATER_CLOSE.png.sha1
@@ -0,0 +1 @@ +43678fe55d7069c3537f827f336f866aaa8414c2 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_WAITING_TO_CONNECT.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_WAITING_TO_CONNECT.png.sha1 new file mode 100644 index 0000000..7c889ae --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_WAITING_TO_CONNECT.png.sha1
@@ -0,0 +1 @@ +7d2f7c36a8d8019886a74d28b45c4cda0616ecaf \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_WAITING_TO_INSTALL.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_WAITING_TO_INSTALL.png.sha1 new file mode 100644 index 0000000..fb4d20e --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_WAITING_TO_INSTALL.png.sha1
@@ -0,0 +1 @@ +e2d2c2ac14587b4f11363e7a2d9bf16a1b1a0a99 \ No newline at end of file
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index fa472ddf..e87bc7f 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -3263,7 +3263,6 @@ "//chrome/browser/bluetooth/android:jni_headers", "//chrome/browser/commerce/android:shopping_service_jni", "//chrome/browser/commerce/merchant_viewer:merchant_signal_db", - "//chrome/browser/commerce/merchant_viewer:merchant_signal_db_content_proto", "//chrome/browser/commerce/merchant_viewer:merchant_viewer_data_manager", "//chrome/browser/commerce/merchant_viewer/android:jni_headers", "//chrome/browser/commerce/shopping_list:shopping_list", @@ -3333,6 +3332,7 @@ "//components/cbor", "//components/cdm/browser", "//components/commerce/core:feature_list", + "//components/commerce/core:merchant_signal_db_proto", "//components/commerce/core:proto", "//components/component_updater/android:native_background_task_update_scheduler", "//components/content_capture/android",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index c77784c9..00c4dcea 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -8365,13 +8365,6 @@ "UseMultipleOverlays")}, #endif -#if BUILDFLAG(IS_CHROMEOS_ASH) - {"usb-notification-controller", - flag_descriptions::kUsbNotificationControllerName, - flag_descriptions::kUsbNotificationControllerDescription, kOsCrOS, - FEATURE_VALUE_TYPE(ash::features::kUsbNotificationController)}, -#endif - #if BUILDFLAG(IS_CHROMEOS) {"link-capturing-ui-update", flag_descriptions::kLinkCapturingUiUpdateName, flag_descriptions::kLinkCapturingUiUpdateDescription, kOsCrOS | kOsLacros, @@ -8744,6 +8737,12 @@ FEATURE_VALUE_TYPE( blink::features::kQuickIntensiveWakeUpThrottlingAfterLoading)}, +#if BUILDFLAG(IS_MAC) + {"system-color-chooser", flag_descriptions::kSystemColorChooserName, + flag_descriptions::kSystemColorChooserDescription, kOsMac, + FEATURE_VALUE_TYPE(blink::features::kSystemColorChooser)}, +#endif // BUILDFLAG(IS_MAC) + // NOTE: Adding a new flag requires adding a corresponding entry to enum // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag // Histograms" in tools/metrics/histograms/README.md (run the
diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc index 2676211..56b47d4 100644 --- a/chrome/browser/apps/guest_view/web_view_browsertest.cc +++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -6220,6 +6220,153 @@ EXPECT_EQ(subframe->GetProcess(), subframe2->GetProcess()); } +// Helper class to turn off strict site isolation while still using site +// isolation paths for <webview>. This forces <webview> to use the default +// SiteInstance paths. The helper also defines one isolated origin at +// isolated.com, which takes precedence over the command-line switch to disable +// site isolation and can be used to test a combination of SiteInstances that +// require and don't require dedicated processes. +class WebViewWithDefaultSiteInstanceTest : public SitePerProcessWebViewTest { + public: + WebViewWithDefaultSiteInstanceTest() = default; + ~WebViewWithDefaultSiteInstanceTest() override = default; + WebViewWithDefaultSiteInstanceTest( + const WebViewWithDefaultSiteInstanceTest&) = delete; + WebViewWithDefaultSiteInstanceTest& operator=( + const WebViewWithDefaultSiteInstanceTest&) = delete; + + void SetUpCommandLine(base::CommandLine* command_line) override { + command_line->AppendSwitch(switches::kDisableSiteIsolation); + command_line->AppendSwitchASCII(switches::kIsolateOrigins, + "http://isolated.com"); + SitePerProcessWebViewTest::SetUpCommandLine(command_line); + } +}; + +// Check that when strict site isolation is turned off (via a command-line flag +// or from chrome://flags), the <webview> site isolation paths still work. In +// particular, <webview> navigations should use a default SiteInstance which +// should still be considered a guest SiteInstance in the guest's +// StoragePartition. Cross-site navigations in the guest should stay in the +// same SiteInstance, and the guest process shouldn't be locked. +IN_PROC_BROWSER_TEST_F(WebViewWithDefaultSiteInstanceTest, SimpleNavigations) { + ASSERT_TRUE(StartEmbeddedTestServer()); + + // Load an app with a <webview> guest that starts at a data: URL. + LoadAppWithGuest("web_view/simple"); + content::WebContents* guest = GetGuestWebContents(); + ASSERT_TRUE(guest); + content::RenderFrameHost* main_frame = guest->GetPrimaryMainFrame(); + auto original_id = main_frame->GetGlobalId(); + scoped_refptr<content::SiteInstance> starting_instance = + main_frame->GetSiteInstance(); + + // Because this test runs without strict site isolation, the <webview> + // process shouldn't be locked. However, the <webview>'s process and + // SiteInstance should still be for a guest. + EXPECT_FALSE( + starting_instance->GetProcess()->IsProcessLockedToSiteForTesting()); + EXPECT_FALSE(starting_instance->RequiresDedicatedProcess()); + EXPECT_TRUE(starting_instance->IsGuest()); + EXPECT_TRUE(starting_instance->GetProcess()->IsForGuestsOnly()); + EXPECT_FALSE(starting_instance->GetStoragePartitionConfig().is_default()); + + // Navigate <webview> to a cross-site page with a same-site iframe. + const GURL start_url = + embedded_test_server()->GetURL("a.test", "/iframe.html"); + { + content::TestNavigationObserver load_observer(guest); + EXPECT_TRUE( + ExecuteScript(guest, "location.href = '" + start_url.spec() + "';")); + load_observer.Wait(); + } + + // Expect that we stayed in the same (default) SiteInstance and + // RenderFrameHost. + main_frame = guest->GetPrimaryMainFrame(); + EXPECT_EQ(main_frame->GetGlobalId(), original_id); + EXPECT_EQ(starting_instance, main_frame->GetSiteInstance()); + EXPECT_FALSE(main_frame->GetSiteInstance()->RequiresDedicatedProcess()); + EXPECT_FALSE(main_frame->GetProcess()->IsProcessLockedToSiteForTesting()); + + // Navigate <webview> subframe cross-site. Check that it stays in the same + // SiteInstance and process. + const GURL frame_url = + embedded_test_server()->GetURL("b.test", "/title1.html"); + EXPECT_TRUE(NavigateIframeToURL(guest, "test", frame_url)); + content::RenderFrameHost* subframe = content::ChildFrameAt(main_frame, 0); + EXPECT_EQ(main_frame->GetSiteInstance(), subframe->GetSiteInstance()); + EXPECT_EQ(main_frame->GetProcess(), subframe->GetProcess()); + EXPECT_TRUE(subframe->GetSiteInstance()->IsGuest()); + EXPECT_FALSE(subframe->GetSiteInstance()->RequiresDedicatedProcess()); + EXPECT_FALSE(subframe->GetProcess()->IsProcessLockedToSiteForTesting()); +} + +// Similar to the test above, but also exercises navigations to an isolated +// origin, which takes precedence over switches::kDisableSiteIsolation. In this +// setup, navigations to the isolated origin should use a normal SiteInstance +// that requires a dedicated process, while all other navigations should use +// the default SiteInstance and an unlocked process. +IN_PROC_BROWSER_TEST_F(WebViewWithDefaultSiteInstanceTest, IsolatedOrigin) { + ASSERT_TRUE(StartEmbeddedTestServer()); + + // Load an app with a <webview> guest that starts at a data: URL. + LoadAppWithGuest("web_view/simple"); + content::WebContents* guest = GetGuestWebContents(); + ASSERT_TRUE(guest); + content::RenderFrameHost* main_frame = guest->GetPrimaryMainFrame(); + auto original_id = main_frame->GetGlobalId(); + scoped_refptr<content::SiteInstance> starting_instance = + main_frame->GetSiteInstance(); + + // Because this test runs without strict site isolation, the <webview> + // process shouldn't be locked. However, the <webview>'s process and + // SiteInstance should still be for a guest. + EXPECT_FALSE( + starting_instance->GetProcess()->IsProcessLockedToSiteForTesting()); + EXPECT_FALSE(starting_instance->RequiresDedicatedProcess()); + EXPECT_TRUE(starting_instance->IsGuest()); + EXPECT_TRUE(starting_instance->GetProcess()->IsForGuestsOnly()); + EXPECT_FALSE(starting_instance->GetStoragePartitionConfig().is_default()); + + // Navigate to an isolated origin. Isolated origins take precedence over + // switches::kDisableSiteIsolation, so we should swap SiteInstances and + // processes, ending up in a locked process. + const GURL start_url = + embedded_test_server()->GetURL("isolated.com", "/iframe.html"); + { + content::TestNavigationObserver load_observer(guest); + EXPECT_TRUE( + ExecuteScript(guest, "location.href = '" + start_url.spec() + "';")); + load_observer.Wait(); + } + + main_frame = guest->GetPrimaryMainFrame(); + EXPECT_NE(main_frame->GetGlobalId(), original_id); + EXPECT_NE(starting_instance, main_frame->GetSiteInstance()); + EXPECT_TRUE(main_frame->GetSiteInstance()->RequiresDedicatedProcess()); + EXPECT_TRUE(main_frame->GetProcess()->IsProcessLockedToSiteForTesting()); + + // Navigate a subframe on the isolated origin cross-site to a non-isolated + // URL. The subframe should go back into a default SiteInstance in a + // different unlocked process. + const GURL frame_url = + embedded_test_server()->GetURL("b.test", "/title1.html"); + EXPECT_TRUE(NavigateIframeToURL(guest, "test", frame_url)); + content::RenderFrameHost* subframe = content::ChildFrameAt(main_frame, 0); + EXPECT_NE(main_frame->GetSiteInstance(), subframe->GetSiteInstance()); + EXPECT_NE(main_frame->GetProcess(), subframe->GetProcess()); + EXPECT_TRUE(subframe->GetSiteInstance()->IsGuest()); + EXPECT_FALSE(subframe->GetSiteInstance()->RequiresDedicatedProcess()); + EXPECT_FALSE(subframe->GetProcess()->IsProcessLockedToSiteForTesting()); + + // Check that all frames stayed in the same guest StoragePartition. + EXPECT_EQ(main_frame->GetSiteInstance()->GetStoragePartitionConfig(), + subframe->GetSiteInstance()->GetStoragePartitionConfig()); + EXPECT_EQ(main_frame->GetSiteInstance()->GetStoragePartitionConfig(), + starting_instance->GetStoragePartitionConfig()); +} + class WebViewFencedFrameTest : public WebViewTest { public: ~WebViewFencedFrameTest() override = default;
diff --git a/chrome/browser/ash/arc/input_overlay/arc_input_overlay_uma.cc b/chrome/browser/ash/arc/input_overlay/arc_input_overlay_uma.cc index 5a8332a5..7dc9575 100644 --- a/chrome/browser/ash/arc/input_overlay/arc_input_overlay_uma.cc +++ b/chrome/browser/ash/arc/input_overlay/arc_input_overlay_uma.cc
@@ -9,24 +9,16 @@ namespace arc { namespace input_overlay { -void RecordInputOverlayFeatureState(const std::string& package_name, - bool enable) { +void RecordInputOverlayFeatureState(bool enable) { base::UmaHistogramBoolean("Arc.InputOverlay.FeatureState", enable); - base::UmaHistogramBoolean("Arc.InputOverlay.FeatureState." + package_name, - enable); } -void RecordInputOverlayMappingHintState(const std::string& package_name, - bool enable) { +void RecordInputOverlayMappingHintState(bool enable) { base::UmaHistogramBoolean("Arc.InputOverlay.MappingHintState", enable); - base::UmaHistogramBoolean("Arc.InputOverlay.MappingHintState." + package_name, - enable); } -void RecordInputOverlayCustomizedUsage(const std::string& package_name) { +void RecordInputOverlayCustomizedUsage() { base::UmaHistogramBoolean("Arc.InputOverlay.Customized", true); - base::UmaHistogramBoolean("Arc.InputOverlay.Customized." + package_name, - true); } } // namespace input_overlay
diff --git a/chrome/browser/ash/arc/input_overlay/arc_input_overlay_uma.h b/chrome/browser/ash/arc/input_overlay/arc_input_overlay_uma.h index 32179206..11cc2c0 100644 --- a/chrome/browser/ash/arc/input_overlay/arc_input_overlay_uma.h +++ b/chrome/browser/ash/arc/input_overlay/arc_input_overlay_uma.h
@@ -5,18 +5,14 @@ #ifndef CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_ARC_INPUT_OVERLAY_UMA_H_ #define CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_ARC_INPUT_OVERLAY_UMA_H_ -#include <string> - namespace arc { namespace input_overlay { -void RecordInputOverlayFeatureState(const std::string& package_name, - bool enable); +void RecordInputOverlayFeatureState(bool enable); -void RecordInputOverlayMappingHintState(const std::string& package_name, - bool enable); +void RecordInputOverlayMappingHintState(bool enable); -void RecordInputOverlayCustomizedUsage(const std::string& package_name); +void RecordInputOverlayCustomizedUsage(); } // namespace input_overlay } // namespace arc
diff --git a/chrome/browser/ash/arc/input_overlay/display_overlay_controller.cc b/chrome/browser/ash/arc/input_overlay/display_overlay_controller.cc index 953260e..3ee731d 100644 --- a/chrome/browser/ash/arc/input_overlay/display_overlay_controller.cc +++ b/chrome/browser/ash/arc/input_overlay/display_overlay_controller.cc
@@ -350,6 +350,7 @@ switch (mode) { case DisplayMode::kNone: + RemoveEditMessage(); RemoveMenuEntryView(); RemoveInputMappingView(); RemoveEducationalView(); @@ -364,6 +365,7 @@ aura::EventTargetingPolicy::kTargetAndDescendants); break; case DisplayMode::kView: + RemoveEditMessage(); RemoveInputMenuView(); RemoveEditFinishView(); RemoveEducationalView();
diff --git a/chrome/browser/ash/arc/input_overlay/touch_injector.cc b/chrome/browser/ash/arc/input_overlay/touch_injector.cc index 0276d832..2b7a8439 100644 --- a/chrome/browser/ash/arc/input_overlay/touch_injector.cc +++ b/chrome/browser/ash/arc/input_overlay/touch_injector.cc
@@ -244,18 +244,16 @@ void TouchInjector::OnInputMenuViewRemoved() { OnSaveProtoFile(); - const auto* package_name = GetPackageName(); // Record UMA stats upon |InputMenuView| close because it needs to ignore the // unfinalized menu state change. if (touch_injector_enable_ != touch_injector_enable_uma_) { touch_injector_enable_uma_ = touch_injector_enable_; - RecordInputOverlayFeatureState(*package_name, touch_injector_enable_uma_); + RecordInputOverlayFeatureState(touch_injector_enable_uma_); } if (input_mapping_visible_ != input_mapping_visible_uma_) { input_mapping_visible_uma_ = input_mapping_visible_; - RecordInputOverlayMappingHintState(*package_name, - input_mapping_visible_uma_); + RecordInputOverlayMappingHintState(input_mapping_visible_uma_); } } @@ -635,9 +633,8 @@ void TouchInjector::RecordMenuStateOnLaunch() { touch_injector_enable_uma_ = touch_injector_enable_; input_mapping_visible_uma_ = input_mapping_visible_; - const auto* package_name = GetPackageName(); - RecordInputOverlayFeatureState(*package_name, touch_injector_enable_uma_); - RecordInputOverlayMappingHintState(*package_name, input_mapping_visible_uma_); + RecordInputOverlayFeatureState(touch_injector_enable_uma_); + RecordInputOverlayMappingHintState(input_mapping_visible_uma_); } int TouchInjector::GetRewrittenTouchIdForTesting(ui::PointerId original_id) {
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 84eb8bac..bddfc30 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
@@ -360,8 +360,7 @@ } // Change display mode, load edit UI per action and overall edit buttons. display_overlay_controller_->SetDisplayMode(DisplayMode::kEdit); - const auto* package_name = display_overlay_controller_->GetPackageName(); - RecordInputOverlayCustomizedUsage(*package_name); + RecordInputOverlayCustomizedUsage(); } void InputMenuView::OnButtonSendFeedbackPressed() {
diff --git a/chrome/browser/ash/file_manager/path_util.cc b/chrome/browser/ash/file_manager/path_util.cc index 45ea82d..15deb3f 100644 --- a/chrome/browser/ash/file_manager/path_util.cc +++ b/chrome/browser/ash/file_manager/path_util.cc
@@ -324,8 +324,6 @@ const base::FilePath& old_base, const base::FilePath& old_path, base::FilePath* new_path) { - const base::FilePath new_base = GetMyFilesFolderForProfile(profile); - // Special case, migrating /home/chronos/user which is set early (before a // profile is attached to the browser process) to default to // /home/chronos/u-{hash}/MyFiles/Downloads. @@ -335,6 +333,12 @@ return true; } + // If the `new_base` is already parent of `old_path`, no need to migrate. + const base::FilePath new_base = GetMyFilesFolderForProfile(profile); + if (new_base.IsParent(old_path)) { + return false; + } + base::FilePath relative; if (old_base.AppendRelativePath(old_path, &relative)) { *new_path = new_base.Append(relative);
diff --git a/chrome/browser/ash/file_manager/path_util_unittest.cc b/chrome/browser/ash/file_manager/path_util_unittest.cc index 55fc47e..305863f 100644 --- a/chrome/browser/ash/file_manager/path_util_unittest.cc +++ b/chrome/browser/ash/file_manager/path_util_unittest.cc
@@ -282,6 +282,11 @@ EXPECT_FALSE(MigratePathFromOldFormat( profile_.get(), DownloadPrefs::GetDefaultDownloadDirectory(), FilePath::FromUTF8Unsafe("/home/chronos/user/dl"), &path)); + + // Won't migrate because old_path is already migrated. + EXPECT_FALSE( + MigratePathFromOldFormat(profile_.get(), kMyFilesFolder.DirName(), + kMyFilesFolder.AppendASCII("a/b"), &path)); } TEST_F(FileManagerPathUtilTest, MigrateToDriveFs) {
diff --git a/chrome/browser/ash/login/wizard_controller.cc b/chrome/browser/ash/login/wizard_controller.cc index b3bc017..4c4f4f7 100644 --- a/chrome/browser/ash/login/wizard_controller.cc +++ b/chrome/browser/ash/login/wizard_controller.cc
@@ -1308,7 +1308,7 @@ return; wizard_context_->skip_to_login_for_tests = true; - if (!chromeos::features::IsOobeConsolidatedConsentEnabled()) + if (chromeos::features::IsOobeConsolidatedConsentEnabled()) StartupUtils::MarkEulaAccepted(); PerformPostEulaActions();
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index f61d18f..597018f9 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -4049,7 +4049,9 @@ return std::wstring(); case sandbox::mojom::Sandbox::kGpu: return std::wstring(); +#if BUILDFLAG(ENABLE_PLUGINS) case sandbox::mojom::Sandbox::kPpapi: +#endif case sandbox::mojom::Sandbox::kNoSandbox: case sandbox::mojom::Sandbox::kNoSandboxAndElevatedPrivileges: case sandbox::mojom::Sandbox::kXrCompositing: @@ -4134,7 +4136,9 @@ break; case sandbox::mojom::Sandbox::kUtility: case sandbox::mojom::Sandbox::kGpu: +#if BUILDFLAG(ENABLE_PLUGINS) case sandbox::mojom::Sandbox::kPpapi: +#endif case sandbox::mojom::Sandbox::kNoSandbox: case sandbox::mojom::Sandbox::kNoSandboxAndElevatedPrivileges: case sandbox::mojom::Sandbox::kXrCompositing:
diff --git a/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.cc b/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.cc index f2e51aee..2511c36 100644 --- a/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.cc +++ b/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.cc
@@ -51,6 +51,7 @@ #include "base/feature_list.h" #include "base/i18n/base_i18n_switches.h" #include "base/json/json_reader.h" +#include "base/json/values_util.h" #include "base/lazy_instance.h" #include "base/no_destructor.h" #include "base/numerics/safe_conversions.h" @@ -112,6 +113,7 @@ #include "chrome/browser/policy/chrome_policy_conversions_client.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" #include "chrome/browser/ui/ash/default_pinned_apps.h" @@ -160,6 +162,8 @@ #include "components/services/app_service/public/cpp/app_types.h" #include "components/services/app_service/public/cpp/types_util.h" #include "components/services/app_service/public/mojom/types.mojom.h" +#include "components/signin/public/identity_manager/access_token_info.h" +#include "components/signin/public/identity_manager/identity_manager.h" #include "components/update_client/update_client_errors.h" #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" @@ -5741,6 +5745,85 @@ } /////////////////////////////////////////////////////////////////////////////// +// AutotestPrivateGetAccessTokenFunction +////////////////////////////////////////////////////////////////////////////// + +AutotestPrivateGetAccessTokenFunction::AutotestPrivateGetAccessTokenFunction() = + default; + +AutotestPrivateGetAccessTokenFunction:: + ~AutotestPrivateGetAccessTokenFunction() = default; + +ExtensionFunction::ResponseAction AutotestPrivateGetAccessTokenFunction::Run() { + // Require a command line switch to avoid crashing on accident. + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + ash::switches::kGetAccessTokenForTest)) { + return RespondNow( + Error("* switch is not set", ash::switches::kGetAccessTokenForTest)); + } + // This API is available only on test images. + base::SysInfo::CrashIfChromeOSNonTestImage(); + + auto params(api::autotest_private::GetAccessToken::Params::Create(args())); + EXTENSION_FUNCTION_VALIDATE(params.get()); + + timeout_timer_.Start( + FROM_HERE, + base::Milliseconds(params->access_token_params.timeout_ms + ? *params->access_token_params.timeout_ms + : 90000), + base::BindOnce( + &AutotestPrivateGetAccessTokenFunction::RespondWithTimeoutError, + this)); + + Profile* profile = Profile::FromBrowserContext(browser_context()); + signin::IdentityManager* identity_manager = + IdentityManagerFactory::GetForProfile(profile); + OAuth2AccessTokenManager::ScopeSet scopes( + params->access_token_params.scopes.begin(), + params->access_token_params.scopes.end()); + access_token_fetcher_ = identity_manager->CreateAccessTokenFetcherForAccount( + identity_manager + ->FindExtendedAccountInfoByEmailAddress( + params->access_token_params.email) + .account_id, + /*oauth_consumer_name=*/"cros_autotest_private", scopes, + base::BindOnce(&AutotestPrivateGetAccessTokenFunction::OnAccessToken, + this), + signin::AccessTokenFetcher::Mode::kImmediate); + return RespondLater(); +} + +void AutotestPrivateGetAccessTokenFunction::RespondWithTimeoutError() { + if (did_respond()) { + return; + } + Respond(Error("Timed out fetching access token")); + access_token_fetcher_.reset(); +} + +void AutotestPrivateGetAccessTokenFunction::OnAccessToken( + GoogleServiceAuthError error, + signin::AccessTokenInfo token_info) { + access_token_fetcher_.reset(); + timeout_timer_.AbandonAndStop(); + if (did_respond()) { + return; + } + if (error.state() != GoogleServiceAuthError::NONE) { + Respond(Error("Failed to get access token: *", error.ToString())); + return; + } + auto token_dict = std::make_unique<base::DictionaryValue>(); + token_dict->SetStringKey("accessToken", token_info.token); + token_dict->SetKey( + "expirationTimeUnixMs", + base::Int64ToValue((token_info.expiration_time - base::Time::UnixEpoch()) + .InMilliseconds())); + Respond(OneArgument(base::Value::FromUniquePtrValue(std::move(token_dict)))); +} + +/////////////////////////////////////////////////////////////////////////////// // AutotestPrivateAPI /////////////////////////////////////////////////////////////////////////////// @@ -5775,7 +5858,7 @@ std::unique_ptr<Event> event( new Event(events::AUTOTESTPRIVATE_ON_CLIPBOARD_DATA_CHANGED, api::autotest_private::OnClipboardDataChanged::kEventName, - std::vector<base::Value>())); + base::Value::List())); event_router->BroadcastEvent(std::move(event)); }
diff --git a/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h b/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h index a48338c..e53cda7 100644 --- a/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h +++ b/chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h
@@ -29,10 +29,17 @@ #include "ui/display/display.h" #include "ui/snapshot/screenshot_grabber.h" +class GoogleServiceAuthError; + namespace crostini { enum class CrostiniResult; } +namespace signin { +class AccessTokenFetcher; +struct AccessTokenInfo; +} // namespace signin + namespace update_client { enum class Error; } @@ -1571,6 +1578,25 @@ ResponseAction Run() override; }; +class AutotestPrivateGetAccessTokenFunction : public ExtensionFunction { + public: + AutotestPrivateGetAccessTokenFunction(); + DECLARE_EXTENSION_FUNCTION("autotestPrivate.getAccessToken", + AUTOTESTPRIVATE_GETACCESSTOKEN) + + private: + ~AutotestPrivateGetAccessTokenFunction() override; + ResponseAction Run() override; + + void RespondWithTimeoutError(); + + void OnAccessToken(GoogleServiceAuthError error, + signin::AccessTokenInfo access_token_info); + + std::unique_ptr<signin::AccessTokenFetcher> access_token_fetcher_; + base::OneShotTimer timeout_timer_; +}; + template <> KeyedService* BrowserContextKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor(
diff --git a/chrome/browser/chromeos/extensions/dictionary_event_router.cc b/chrome/browser/chromeos/extensions/dictionary_event_router.cc index 28289cde..f2492629 100644 --- a/chrome/browser/chromeos/extensions/dictionary_event_router.cc +++ b/chrome/browser/chromeos/extensions/dictionary_event_router.cc
@@ -54,7 +54,7 @@ // The router will only send the event to extensions that are listening. auto event = std::make_unique<extensions::Event>( extensions::events::INPUT_METHOD_PRIVATE_ON_DICTIONARY_LOADED, - OnDictionaryLoaded::kEventName, std::vector<base::Value>(), context_); + OnDictionaryLoaded::kEventName, base::Value::List(), context_); router->BroadcastEvent(std::move(event)); } @@ -88,8 +88,7 @@ // The router will only send the event to extensions that are listening. auto event = std::make_unique<extensions::Event>( extensions::events::INPUT_METHOD_PRIVATE_ON_DICTIONARY_CHANGED, - OnDictionaryChanged::kEventName, - base::Value(std::move(args)).TakeListDeprecated(), context_); + OnDictionaryChanged::kEventName, std::move(args), context_); router->BroadcastEvent(std::move(event)); }
diff --git a/chrome/browser/chromeos/extensions/ime_menu_event_router.cc b/chrome/browser/chromeos/extensions/ime_menu_event_router.cc index 01f77642..d5b7d51 100644 --- a/chrome/browser/chromeos/extensions/ime_menu_event_router.cc +++ b/chrome/browser/chromeos/extensions/ime_menu_event_router.cc
@@ -39,14 +39,13 @@ if (!router->HasEventListener(OnImeMenuActivationChanged::kEventName)) return; - std::unique_ptr<base::ListValue> args(new base::ListValue()); - args->Append(activation); + base::Value::List args; + args.Append(activation); // The router will only send the event to extensions that are listening. auto event = std::make_unique<extensions::Event>( extensions::events::INPUT_METHOD_PRIVATE_ON_IME_MENU_ACTIVATION_CHANGED, - OnImeMenuActivationChanged::kEventName, - std::move(*args).TakeListDeprecated(), context_); + OnImeMenuActivationChanged::kEventName, std::move(args), context_); router->BroadcastEvent(std::move(event)); } @@ -59,7 +58,7 @@ // The router will only send the event to extensions that are listening. auto event = std::make_unique<extensions::Event>( extensions::events::INPUT_METHOD_PRIVATE_ON_IME_MENU_LIST_CHANGED, - OnImeMenuListChanged::kEventName, std::vector<base::Value>(), context_); + OnImeMenuListChanged::kEventName, base::Value::List(), context_); router->BroadcastEvent(std::move(event)); }
diff --git a/chrome/browser/chromeos/extensions/input_method_event_router.cc b/chrome/browser/chromeos/extensions/input_method_event_router.cc index b846e88..d7347e3 100644 --- a/chrome/browser/chromeos/extensions/input_method_event_router.cc +++ b/chrome/browser/chromeos/extensions/input_method_event_router.cc
@@ -44,13 +44,13 @@ if (!router->HasEventListener(OnChanged::kEventName)) return; - std::unique_ptr<base::ListValue> args(new base::ListValue()); - args->Append(manager->GetActiveIMEState()->GetCurrentInputMethod().id()); + base::Value::List args; + args.Append(manager->GetActiveIMEState()->GetCurrentInputMethod().id()); // The router will only send the event to extensions that are listening. auto event = std::make_unique<extensions::Event>( extensions::events::INPUT_METHOD_PRIVATE_ON_CHANGED, - OnChanged::kEventName, std::move(*args).TakeListDeprecated(), context_); + OnChanged::kEventName, std::move(args), context_); router->BroadcastEvent(std::move(event)); }
diff --git a/chrome/browser/chromeos/extensions/media_player_event_router.cc b/chrome/browser/chromeos/extensions/media_player_event_router.cc index 071a6090..e12c78a 100644 --- a/chrome/browser/chromeos/extensions/media_player_event_router.cc +++ b/chrome/browser/chromeos/extensions/media_player_event_router.cc
@@ -20,7 +20,7 @@ const std::string& event_name) { if (context && EventRouter::Get(context)) { std::unique_ptr<Event> event( - new Event(histogram_value, event_name, std::vector<base::Value>())); + new Event(histogram_value, event_name, base::Value::List())); EventRouter::Get(context)->BroadcastEvent(std::move(event)); } }
diff --git a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.cc b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.cc index 979307ec..35bb618 100644 --- a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.cc +++ b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.cc
@@ -153,8 +153,8 @@ if (client_id.has_value()) return_dict.SetIntKey("clientId", client_id.value()); - auto event_args = std::vector<base::Value>(); - event_args.push_back(std::move(return_dict)); + base::Value::List event_args; + event_args.Append(std::move(return_dict)); std::unique_ptr<Event> event = std::make_unique<Event>( events::SPEECH_RECOGNITION_PRIVATE_ON_STOP, api::speech_recognition_private::OnStop::kEventName,
diff --git a/chrome/browser/commerce/merchant_viewer/BUILD.gn b/chrome/browser/commerce/merchant_viewer/BUILD.gn index 9df49d51..65a474f 100644 --- a/chrome/browser/commerce/merchant_viewer/BUILD.gn +++ b/chrome/browser/commerce/merchant_viewer/BUILD.gn
@@ -13,10 +13,10 @@ ] deps = [ - ":merchant_signal_db_content_proto", "//base:base", "//chrome/browser/commerce/merchant_viewer/android:jni_headers", "//chrome/browser/persisted_state_db:persisted_state_db", + "//components/commerce/core:merchant_signal_db_proto", "//components/keyed_service/content", "//components/leveldb_proto", "//content/public/browser:browser", @@ -34,19 +34,15 @@ deps = [ ":merchant_signal_db", - ":merchant_signal_db_content_proto", "//base:base", "//chrome/browser/persisted_state_db:persisted_state_db", "//chrome/browser/profiles", "//chrome/browser/profiles:profile", "//components/commerce/core:feature_list", + "//components/commerce/core:merchant_signal_db_proto", "//components/keyed_service/content", "//components/leveldb_proto", "//content/public/browser:browser", "//third_party/leveldatabase", ] } - -proto_library("merchant_signal_db_content_proto") { - sources = [ "merchant_signal_db_content.proto" ] -}
diff --git a/chrome/browser/commerce/merchant_viewer/merchant_signal_db.cc b/chrome/browser/commerce/merchant_viewer/merchant_signal_db.cc index f97ae1b..128b162 100644 --- a/chrome/browser/commerce/merchant_viewer/merchant_signal_db.cc +++ b/chrome/browser/commerce/merchant_viewer/merchant_signal_db.cc
@@ -13,8 +13,8 @@ #include "base/containers/fixed_flat_map.h" #include "chrome/browser/commerce/merchant_viewer/android/jni_headers/MerchantTrustSignalsEventStorage_jni.h" #include "chrome/browser/commerce/merchant_viewer/android/jni_headers/MerchantTrustSignalsEvent_jni.h" -#include "chrome/browser/commerce/merchant_viewer/merchant_signal_db_content.pb.h" #include "chrome/browser/persisted_state_db/profile_proto_db_factory.h" +#include "components/commerce/core/proto/merchant_signal_db_content.pb.h" #include "content/public/browser/android/browser_context_handle.h" namespace {
diff --git a/chrome/browser/commerce/merchant_viewer/merchant_signal_db.h b/chrome/browser/commerce/merchant_viewer/merchant_signal_db.h index 2794989..52ab475 100644 --- a/chrome/browser/commerce/merchant_viewer/merchant_signal_db.h +++ b/chrome/browser/commerce/merchant_viewer/merchant_signal_db.h
@@ -8,7 +8,7 @@ #include "base/android/scoped_java_ref.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" -#include "chrome/browser/commerce/merchant_viewer/merchant_signal_db_content.pb.h" +#include "components/commerce/core/proto/merchant_signal_db_content.pb.h" #include "components/keyed_service/core/keyed_service.h" #include "components/leveldb_proto/public/proto_database.h"
diff --git a/chrome/browser/feature_guide/notifications/internal/feature_notification_guide_service_impl_unittest.cc b/chrome/browser/feature_guide/notifications/internal/feature_notification_guide_service_impl_unittest.cc index fcdd9cc..45fb4b71 100644 --- a/chrome/browser/feature_guide/notifications/internal/feature_notification_guide_service_impl_unittest.cc +++ b/chrome/browser/feature_guide/notifications/internal/feature_notification_guide_service_impl_unittest.cc
@@ -118,9 +118,8 @@ void UnregisterOnDemandSegmentSelectionCallback( segmentation_platform::CallbackId callback_id, const std::string& segmentation_key) override {} - void OnTrigger( - segmentation_platform::TriggerType trigger, - const segmentation_platform::TriggerContext& trigger_context) override {} + void OnTrigger(std::unique_ptr<segmentation_platform::TriggerContext> + trigger_context) override {} void EnableMetrics(bool signal_collection_allowed) override {} segmentation_platform::ServiceProxy* GetServiceProxy() override { return nullptr;
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index f8ff838..869797ed 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -5810,6 +5810,11 @@ "expiry_milestone": 110 }, { + "name": "system-color-chooser", + "owners": [ "bur", "chrome-mac-dev@google.com" ], + "expiry_milestone": 115 + }, + { "name": "system-extensions", "owners": [ "calamity", "dominicschulz" ], "expiry_milestone": 110 @@ -6099,11 +6104,6 @@ "expiry_milestone": 120 }, { - "name": "usb-notification-controller", - "owners": [ "jthies", "bleung" ], - "expiry_milestone": 105 - }, - { "name": "use-angle", "owners": [ "angle-team@google.com" ], // This flag is used by certain customers to set ANGLE to use its OpenGL
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 336efc3..902b55a31 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -4176,6 +4176,10 @@ const char kUseAngleMetal[] = "Metal"; +const char kSystemColorChooserName[] = "System Color Chooser"; +const char kSystemColorChooserDescription[] = + "Enables a button that launches the macOS native color chooser."; + #endif // Windows and Mac ------------------------------------------------------------- @@ -5577,11 +5581,6 @@ const char kUiSlowAnimationsName[] = "Slow UI animations"; const char kUiSlowAnimationsDescription[] = "Makes all UI animations slow."; -const char kUsbNotificationControllerName[] = - "Enable USB Notification Controller"; -const char kUsbNotificationControllerDescription[] = - "Enables USB related notifications from the ChromeOS type-c daemon."; - const char kVaapiJpegImageDecodeAccelerationName[] = "VA-API JPEG decode acceleration for images"; const char kVaapiJpegImageDecodeAccelerationDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index f569b2c..aea5ed72 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -2382,6 +2382,9 @@ extern const char kUseAngleDescriptionMac[]; extern const char kUseAngleMetal[]; +extern const char kSystemColorChooserName[]; +extern const char kSystemColorChooserDescription[]; + #endif // BUILDFLAG(IS_MAC) // Windows and Mac ------------------------------------------------------------ @@ -3183,9 +3186,6 @@ extern const char kUploadOfficeToCloudName[]; extern const char kUploadOfficeToCloudDescription[]; -extern const char kUsbNotificationControllerName[]; -extern const char kUsbNotificationControllerDescription[]; - extern const char kUseFakeDeviceForMediaStreamName[]; extern const char kUseFakeDeviceForMediaStreamDescription[];
diff --git a/chrome/browser/history/chrome_history_client.cc b/chrome/browser/history/chrome_history_client.cc index c529158..eb4d8d28 100644 --- a/chrome/browser/history/chrome_history_client.cc +++ b/chrome/browser/history/chrome_history_client.cc
@@ -7,11 +7,13 @@ #include "base/bind.h" #include "base/callback.h" #include "base/check_op.h" +#include "base/time/time.h" #include "chrome/browser/history/chrome_history_backend_client.h" #include "chrome/browser/history/history_utils.h" #include "chrome/browser/profiles/sql_init_error_message_ids.h" #include "chrome/browser/ui/profile_error_dialog.h" #include "components/bookmarks/browser/bookmark_model.h" +#include "components/bookmarks/browser/bookmark_utils.h" #include "components/bookmarks/browser/model_loader.h" #include "components/history/core/browser/history_service.h" @@ -60,6 +62,18 @@ bookmark_model_ ? bookmark_model_->model_loader() : nullptr); } +void ChromeHistoryClient::UpdateBookmarkLastUsedTime(int64_t bookmark_node_id, + base::Time time) { + if (!bookmark_model_) + return; + const bookmarks::BookmarkNode* node = + GetBookmarkNodeByID(bookmark_model_, bookmark_node_id); + // This call is async so the BookmarkNode could have already been deleted. + if (!node) + return; + bookmark_model_->UpdateLastUsedTime(node, time); +} + void ChromeHistoryClient::StopObservingBookmarkModel() { if (!bookmark_model_) return;
diff --git a/chrome/browser/history/chrome_history_client.h b/chrome/browser/history/chrome_history_client.h index 5e90cd2c..294d8f634 100644 --- a/chrome/browser/history/chrome_history_client.h +++ b/chrome/browser/history/chrome_history_client.h
@@ -42,6 +42,8 @@ void NotifyProfileError(sql::InitStatus init_status, const std::string& diagnostics) override; std::unique_ptr<history::HistoryBackendClient> CreateBackendClient() override; + void UpdateBookmarkLastUsedTime(int64_t bookmark_node_id, + base::Time time) override; private: void StopObservingBookmarkModel();
diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc index 74e062d..9edcfb9 100644 --- a/chrome/browser/history/history_tab_helper.cc +++ b/chrome/browser/history/history_tab_helper.cc
@@ -11,6 +11,7 @@ #include "chrome/browser/history_clusters/history_clusters_tab_helper.h" #include "chrome/browser/prefetch/no_state_prefetch/no_state_prefetch_manager_factory.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/renderer_host/chrome_navigation_ui_data.h" #include "components/history/content/browser/history_context_helper.h" #include "components/history/core/browser/history_constants.h" #include "components/history/core/browser/history_service.h" @@ -144,6 +145,11 @@ referrer_url = navigation_handle->GetPreviousPrimaryMainFrameURL(); } + ChromeNavigationUIData* chrome_ui_data = + navigation_handle->GetNavigationUIData() == nullptr + ? nullptr + : static_cast<ChromeNavigationUIData*>( + navigation_handle->GetNavigationUIData()); // Note: floc_allowed is set to false initially and is later updated by the // floc eligibility observer. Eventually it will be removed from the history // service API. @@ -173,7 +179,9 @@ history::ContextIDForWebContents(web_contents()), nav_entry_id, navigation_handle->GetPreviousPrimaryMainFrameURL())) - : absl::nullopt)); + : absl::nullopt), + chrome_ui_data == nullptr ? absl::nullopt + : chrome_ui_data->bookmark_id()); if (ui::PageTransitionIsMainFrame(page_transition) && virtual_url != navigation_handle->GetURL()) {
diff --git a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordSettingsAccessorFactory.java b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordSettingsAccessorFactory.java index 4665d84e..d361e269 100644 --- a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordSettingsAccessorFactory.java +++ b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordSettingsAccessorFactory.java
@@ -4,30 +4,11 @@ package org.chromium.chrome.browser.password_manager; -import static org.chromium.base.ThreadUtils.assertOnUiThread; - -import androidx.annotation.VisibleForTesting; - /** * This factory returns an implementation for the password settings accessor. The factory itself is * also implemented downstream. */ public abstract class PasswordSettingsAccessorFactory { - private static PasswordSettingsAccessorFactory sInstance; - - PasswordSettingsAccessorFactory() {} - - /** - * Returns an accessor factory to be invoked whenever {@link #createAccessor()} is called. If no - * factory was used yet, it is created. - * - * @return The shared {@link PasswordSettingsAccessorFactory} instance. - */ - public static PasswordSettingsAccessorFactory getOrCreate() { - assertOnUiThread(); - return sInstance != null ? sInstance : new PasswordSettingsAccessorFactoryImpl(); - } - /** * Returns the downstream implementation provided by subclasses. * @@ -40,9 +21,4 @@ public boolean canCreateAccessor() { return false; } - - @VisibleForTesting - public static void setupFactoryForTesting(PasswordSettingsAccessorFactory accessorFactory) { - sInstance = accessorFactory; - } }
diff --git a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordSettingsUpdaterBridge.java b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordSettingsUpdaterBridge.java index eb7b43e1..cfe486976c 100644 --- a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordSettingsUpdaterBridge.java +++ b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordSettingsUpdaterBridge.java
@@ -34,12 +34,12 @@ @CalledByNative static PasswordSettingsUpdaterBridge create(long nativeSettingsUpdaterBridge) { return new PasswordSettingsUpdaterBridge(nativeSettingsUpdaterBridge, - PasswordSettingsAccessorFactoryImpl.getOrCreate().createAccessor()); + new PasswordSettingsAccessorFactoryImpl().createAccessor()); } @CalledByNative static boolean canCreateAccessor() { - return PasswordSettingsAccessorFactoryImpl.getOrCreate().canCreateAccessor(); + return new PasswordSettingsAccessorFactoryImpl().canCreateAccessor(); } @CalledByNative
diff --git a/chrome/browser/password_manager/password_manager_settings_service_factory.cc b/chrome/browser/password_manager/password_manager_settings_service_factory.cc index 335c80c..22d785c 100644 --- a/chrome/browser/password_manager/password_manager_settings_service_factory.cc +++ b/chrome/browser/password_manager/password_manager_settings_service_factory.cc
@@ -34,7 +34,10 @@ : BrowserContextKeyedServiceFactory( "PasswordManagerSettingsService", BrowserContextDependencyManager::GetInstance()) { +#if BUILDFLAG(IS_ANDROID) + // The sync status is necessary on Android to decide which prefs to check. DependsOn(SyncServiceFactory::GetInstance()); +#endif } PasswordManagerSettingsServiceFactory:: @@ -61,11 +64,10 @@ content::BrowserContext* PasswordManagerSettingsServiceFactory::GetBrowserContextToUse( content::BrowserContext* context) const { - // As the service is used to read prefs and that checking them depends on - // sync status it needs to be accessed as for the regular profile. + // On Android, the sync service is used to read prefs and checking them + // depends on the sync status, thus the service needs to be accessed as for + // the regular profile. On desktop, the sync service is not used, but since + // this service is used to access settings which are not specific to incognito + // the service can still be used as for the regular profile. return chrome::GetBrowserContextRedirectedInIncognito(context); } - -bool PasswordManagerSettingsServiceFactory::ServiceIsNULLWhileTesting() const { - return true; -}
diff --git a/chrome/browser/password_manager/password_manager_settings_service_factory.h b/chrome/browser/password_manager/password_manager_settings_service_factory.h index 5823ff9..cd10f20 100644 --- a/chrome/browser/password_manager/password_manager_settings_service_factory.h +++ b/chrome/browser/password_manager/password_manager_settings_service_factory.h
@@ -37,7 +37,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - bool ServiceIsNULLWhileTesting() const override; }; #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_SETTINGS_SERVICE_FACTORY_H_
diff --git a/chrome/browser/persisted_state_db/BUILD.gn b/chrome/browser/persisted_state_db/BUILD.gn index 015f8cd..710aed1 100644 --- a/chrome/browser/persisted_state_db/BUILD.gn +++ b/chrome/browser/persisted_state_db/BUILD.gn
@@ -29,9 +29,9 @@ ] if (is_android) { deps += [ - "//chrome/browser/commerce/merchant_viewer:merchant_signal_db_content_proto", "//chrome/browser/commerce/subscriptions:commerce_subscription_db_content_proto", "//chrome/browser/tab:jni_headers", + "//components/commerce/core:merchant_signal_db_proto", ] } else { deps += [
diff --git a/chrome/browser/persisted_state_db/profile_proto_db_factory.h b/chrome/browser/persisted_state_db/profile_proto_db_factory.h index 5ba9d30..47f8e78d 100644 --- a/chrome/browser/persisted_state_db/profile_proto_db_factory.h +++ b/chrome/browser/persisted_state_db/profile_proto_db_factory.h
@@ -17,8 +17,8 @@ #include "chrome/browser/cart/cart_db_content.pb.h" #include "chrome/browser/commerce/coupons/coupon_db_content.pb.h" #else -#include "chrome/browser/commerce/merchant_viewer/merchant_signal_db_content.pb.h" #include "chrome/browser/commerce/subscriptions/commerce_subscription_db_content.pb.h" +#include "components/commerce/core/proto/merchant_signal_db_content.pb.h" #endif namespace {
diff --git a/chrome/browser/policy/cloud/chrome_browser_cloud_management_browsertest.cc b/chrome/browser/policy/cloud/chrome_browser_cloud_management_browsertest.cc index 0a6ba57..cdadd6a 100644 --- a/chrome/browser/policy/cloud/chrome_browser_cloud_management_browsertest.cc +++ b/chrome/browser/policy/cloud/chrome_browser_cloud_management_browsertest.cc
@@ -94,6 +94,8 @@ "Enterprise.MachineLevelUserCloudPolicyEnrollment.Result"; const char kUnenrollmentSuccessMetrics[] = "Enterprise.MachineLevelUserCloudPolicyEnrollment.UnenrollSuccess"; +const char kDmTokenDeletionMetrics[] = + "Enterprise.MachineLevelUserCloudPolicyEnrollment.DMTokenDeletion"; #if BUILDFLAG(IS_ANDROID) typedef ChromeBrowserCloudManagementBrowserTestDelegateAndroid @@ -782,11 +784,13 @@ EXPECT_TRUE(token.is_invalid()); histogram_tester_.ExpectUniqueSample(kUnenrollmentSuccessMetrics, storage_enabled(), 1); + histogram_tester_.ExpectTotalCount(kDmTokenDeletionMetrics, 0); } else if (dm_token() == kDeletionDMToken) { EXPECT_EQ(0u, policy_map.size()); // The token in storage should be empty. EXPECT_TRUE(token.is_empty()); - histogram_tester_.ExpectUniqueSample(kUnenrollmentSuccessMetrics, + histogram_tester_.ExpectTotalCount(kUnenrollmentSuccessMetrics, 0); + histogram_tester_.ExpectUniqueSample(kDmTokenDeletionMetrics, storage_enabled(), 1); } else { EXPECT_EQ(1u, policy_map.size()); @@ -805,6 +809,7 @@ EXPECT_EQ(token.value(), kDMToken); histogram_tester_.ExpectTotalCount(kUnenrollmentSuccessMetrics, 0); + histogram_tester_.ExpectTotalCount(kDmTokenDeletionMetrics, 0); } }
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index 646d7cf..4a6a777 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc
@@ -750,6 +750,12 @@ "user_experience_metrics.stability.page_load_count"; #endif +#if BUILDFLAG(IS_CHROMEOS_ASH) +// Deprecated 06/2022. +const char kImprovedShortcutsNotificationShownCount[] = + "ash.improved_shortcuts_notification_shown_count"; +#endif // BUILDFLAG(IS_CHROMEOS_ASH) + // Register local state used only for migration (clearing or moving to a new // key). void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) { @@ -821,6 +827,8 @@ ash::HelpAppNotificationController::RegisterObsoletePrefsForMigration( registry); registry->RegisterBooleanPref(kHasCameraAppMigratedToSWA, false); + + registry->RegisterIntegerPref(kImprovedShortcutsNotificationShownCount, 0); #endif // BUILDFLAG(IS_CHROMEOS_ASH) chrome_browser_net::secure_dns::RegisterProbesSettingBackupPref(registry); @@ -1934,6 +1942,11 @@ syncer::MigrateSyncRequestedPrefPostMice(profile_prefs); #endif // BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_CHROMEOS_ASH) + // Added 06/2022. + profile_prefs->ClearPref(kImprovedShortcutsNotificationShownCount); +#endif // BUILDFLAG(IS_CHROMEOS_ASH) + // Please don't delete the following line. It is used by PRESUBMIT.py. // END_MIGRATE_OBSOLETE_PROFILE_PREFS
diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc index 16b1c4c..6cba8255 100644 --- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc +++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
@@ -137,11 +137,11 @@ #include "chrome/browser/android/reading_list/reading_list_notification_service_factory.h" #include "chrome/browser/android/search_permissions/search_permissions_service.h" #include "chrome/browser/android/thin_webview/chrome_thin_webview_initializer.h" -#include "chrome/browser/commerce/merchant_viewer/merchant_signal_db_content.pb.h" #include "chrome/browser/commerce/merchant_viewer/merchant_viewer_data_manager_factory.h" #include "chrome/browser/commerce/subscriptions/commerce_subscription_db_content.pb.h" #include "chrome/browser/media/android/cdm/media_drm_origin_id_manager_factory.h" #include "components/commerce/core/commerce_feature_list.h" +#include "components/commerce/core/proto/merchant_signal_db_content.pb.h" #else #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" #include "chrome/browser/browsing_data/chrome_browsing_data_lifetime_manager_factory.h"
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc b/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc index a817e20..018a847 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc
@@ -13,6 +13,7 @@ #include "build/branding_buildflags.h" #include "build/build_config.h" #include "chrome/app/chrome_command_ids.h" +#include "chrome/browser/autofill/personal_data_manager_factory.h" #include "chrome/browser/download/chrome_download_manager_delegate.h" #include "chrome/browser/download/download_core_service.h" #include "chrome/browser/download/download_core_service_factory.h" @@ -33,6 +34,9 @@ #include "chrome/test/base/search_test_utils.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" +#include "components/autofill/core/browser/autofill_test_utils.h" +#include "components/autofill/core/browser/personal_data_manager.h" +#include "components/autofill/core/common/autofill_features.h" #include "components/custom_handlers/protocol_handler_registry.h" #include "components/feed/feed_feature_list.h" #include "components/lens/lens_features.h" @@ -818,6 +822,61 @@ } } +class RenderViewContestMenuAutofillTest + : public RenderViewContextMenuPrefsTest, + public testing::WithParamInterface<bool> { + public: + RenderViewContestMenuAutofillTest() { + feature_list_.InitAndEnableFeature( + autofill::features::kAutofillShowManualFallbackInContextMenu); + } + + protected: + // Returns true if the test needs to run in incognito mode. + bool IsIncognito() const { return GetParam(); } + + private: + base::test::ScopedFeatureList feature_list_; +}; + +INSTANTIATE_TEST_SUITE_P(AutofillContextMenuTest, + RenderViewContestMenuAutofillTest, + testing::Bool()); + +// Verify that Autofill context menu items are displayed on a plain text field. +TEST_P(RenderViewContestMenuAutofillTest, ShowAutofillOptions) { + autofill::PersonalDataManager* pdm = + autofill::PersonalDataManagerFactory::GetForProfile( + profile()->GetOriginalProfile()); + DCHECK(pdm); + pdm->AddServerCreditCardForTest( + std::make_unique<autofill::CreditCard>(autofill::test::GetCreditCard())); + + if (IsIncognito()) { + // Verify that Autofill context menu items are displayed on a number field + // in Incognito. + std::unique_ptr<content::WebContents> incognito_web_contents( + content::WebContentsTester::CreateTestWebContents( + profile()->GetPrimaryOTRProfile(/*create_if_needed=*/true), + nullptr)); + + content::WebContentsTester::For(incognito_web_contents.get()) + ->NavigateAndCommit(GURL("http://www.foo.com/")); + } else { + NavigateAndCommit(GURL("http://www.foo.com/")); + } + content::ContextMenuParams params = CreateParams(MenuItem::EDITABLE); + params.input_field_type = + blink::mojom::ContextMenuDataInputFieldType::kPlainText; + auto menu = std::make_unique<TestRenderViewContextMenu>( + *web_contents()->GetPrimaryMainFrame(), params); + menu->Init(); + + EXPECT_TRUE( + menu->IsItemInRangePresent(IDC_CONTENT_CONTEXT_AUTOFILL_CUSTOM_FIRST, + IDC_CONTENT_CONTEXT_AUTOFILL_CUSTOM_LAST)); +} + #if BUILDFLAG(GOOGLE_CHROME_BRANDING) // Verify that the Lens Region Search menu item is displayed when the feature // is enabled.
diff --git a/chrome/browser/renderer_host/chrome_navigation_ui_data.h b/chrome/browser/renderer_host/chrome_navigation_ui_data.h index 1662382c..4aca0ea 100644 --- a/chrome/browser/renderer_host/chrome_navigation_ui_data.h +++ b/chrome/browser/renderer_host/chrome_navigation_ui_data.h
@@ -12,6 +12,7 @@ #include "components/offline_pages/core/request_header/offline_page_navigation_ui_data.h" #include "content/public/browser/navigation_ui_data.h" #include "extensions/buildflags/buildflags.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/browser/extension_navigation_ui_data.h" @@ -82,6 +83,9 @@ return is_using_https_as_default_scheme_; } + absl::optional<int64_t> bookmark_id() { return bookmark_id_; } + void set_bookmark_id(absl::optional<int64_t> id) { bookmark_id_ = id; } + private: #if BUILDFLAG(ENABLE_EXTENSIONS) // Manages the lifetime of optional ExtensionNavigationUIData information. @@ -103,6 +107,9 @@ // TypedNavigationUpgradeThrottle to determine if the navigation should be // observed and fall back to using http scheme if necessary. bool is_using_https_as_default_scheme_ = false; + + // Id of the bookmark which started this navigation. + absl::optional<int64_t> bookmark_id_ = absl::nullopt; }; #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_UI_DATA_H_
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/panel/panel_background.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/panel/panel_background.js index 9d39ce1..c765247 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/panel/panel_background.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/panel/panel_background.js
@@ -35,6 +35,7 @@ window.panelBackground = PanelBackground.instance; PanelBackground.stateObserver_ = new PanelStateObserver(); + ChromeVoxState.addObserver(PanelBackground.stateObserver_); BridgeHelper.registerHandler( BridgeTargets.PANEL_BACKGROUND, BridgeActions.CLEAR_SAVED_NODE,
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel.js b/chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel.js index b1bf87ad..8716d81 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel.js
@@ -1215,7 +1215,8 @@ static onCurrentRangeChanged() { if (Panel.mode_ === PanelMode.FULLSCREEN_TUTORIAL) { - if (Panel.tutorial && Panel.tutorial.restartNudges) { + if (Panel.tutorial && Panel.tutorial.restartNudges && + !Panel.disableRestartTutorialNudgesForTesting) { Panel.tutorial.restartNudges(); } }
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/panel/tutorial_test.js b/chrome/browser/resources/chromeos/accessibility/chromevox/panel/tutorial_test.js index b6a4cc9..717320ed 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/panel/tutorial_test.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/panel/tutorial_test.js
@@ -207,6 +207,7 @@ // Afterward, general hints will be given about using ChromeVox. Lastly, // we will give a hint for exiting the tutorial. TEST_F('ChromeVoxTutorialTest', 'GeneralNudgesTest', async function() { + this.getPanel().disableRestartTutorialNudgesForTesting = true; const mockFeedback = this.createMockFeedback(); const root = await this.runWithLoadedTree(this.simpleDoc); await this.launchAndWaitForTutorial(); @@ -548,41 +549,23 @@ const root = await this.runWithLoadedTree(this.simpleDoc); await this.launchAndWaitForTutorial(); const tutorial = this.getTutorial(); - let restart = false; // Swap in below function to track when nudges get restarted. - tutorial.restartNudges = () => { - restart = true; - }; - const waitForRestartNudges = async () => { - return new Promise(resolve => { - let intervalId; - const nudgesRestarted = () => { - return restart; - }; - if (nudgesRestarted()) { - resolve(); - } else { - intervalId = setInterval(() => { - if (nudgesRestarted()) { - clearInterval(intervalId); - resolve(); - } - }, 500); - } - }); - }; - restart = false; + const reset = () => new Promise(resolve => tutorial.restartNudges = resolve); + + let nudgesHaveRestarted = reset(); CommandHandlerInterface.instance.onCommand('nextObject'); - await waitForRestartNudges(); + await nudgesHaveRestarted; + // Show a lesson. tutorial.curriculum = 'essential_keys'; tutorial.showLesson_(0); - restart = false; + nudgesHaveRestarted = reset(); CommandHandlerInterface.instance.onCommand('nextObject'); - await waitForRestartNudges(); - restart = false; + await nudgesHaveRestarted; + + nudgesHaveRestarted = reset(); CommandHandlerInterface.instance.onCommand('nextObject'); - await waitForRestartNudges(); + await nudgesHaveRestarted; }); // Tests that the tutorial closes and ChromeVox navigates to a resource link. @@ -745,6 +728,7 @@ }); TEST_F('ChromeVoxTutorialTest', 'GeneralTouchNudges', async function() { + this.getPanel().disableRestartTutorialNudgesForTesting = true; const mockFeedback = this.createMockFeedback(); const root = await this.runWithLoadedTree(this.simpleDoc); await this.launchAndWaitForTutorial();
diff --git a/chrome/browser/resources/side_panel/BUILD.gn b/chrome/browser/resources/side_panel/BUILD.gn index 949776b..5385fbb 100644 --- a/chrome/browser/resources/side_panel/BUILD.gn +++ b/chrome/browser/resources/side_panel/BUILD.gn
@@ -83,6 +83,25 @@ outputs = [ "$target_gen_dir/$preprocess_folder/read_anything/{{source_file_part}}", ] + + # TODO(abigailbklein): Remove this when ReadAnythingAppController is wired up. + deps += [ + "//ui/accessibility:ax_constants_mojo_webui_js", + "//ui/accessibility:ax_enums_mojo_webui_js", + "//ui/accessibility/mojom:mojom_webui_js", + ] + sources += [ + "$root_gen_dir/mojom-webui/ui/accessibility/ax_constants.mojom-webui.js", + "$root_gen_dir/mojom-webui/ui/accessibility/ax_enums.mojom-webui.js", + "$root_gen_dir/mojom-webui/ui/accessibility/mojom/ax_action_data.mojom-webui.js", + "$root_gen_dir/mojom-webui/ui/accessibility/mojom/ax_event.mojom-webui.js", + "$root_gen_dir/mojom-webui/ui/accessibility/mojom/ax_event_intent.mojom-webui.js", + "$root_gen_dir/mojom-webui/ui/accessibility/mojom/ax_node_data.mojom-webui.js", + "$root_gen_dir/mojom-webui/ui/accessibility/mojom/ax_relative_bounds.mojom-webui.js", + "$root_gen_dir/mojom-webui/ui/accessibility/mojom/ax_tree_data.mojom-webui.js", + "$root_gen_dir/mojom-webui/ui/accessibility/mojom/ax_tree_id.mojom-webui.js", + "$root_gen_dir/mojom-webui/ui/accessibility/mojom/ax_tree_update.mojom-webui.js", + ] } copy("copy_mojo_reading_list") {
diff --git a/chrome/browser/resources/side_panel/history_clusters/history_clusters.html b/chrome/browser/resources/side_panel/history_clusters/history_clusters.html index e92bfe1..7de9aaa1 100644 --- a/chrome/browser/resources/side_panel/history_clusters/history_clusters.html +++ b/chrome/browser/resources/side_panel/history_clusters/history_clusters.html
@@ -32,8 +32,7 @@ </script> </head> <body> - <history-clusters id="history-clusters" query="" path="journeys" - in-side-panel> + <history-clusters id="history-clusters" query="" path="journeys"> </history-clusters> </body> </html>
diff --git a/chrome/browser/resources/side_panel/side_panel.gni b/chrome/browser/resources/side_panel/side_panel.gni index 3d304c0..8fe8e31 100644 --- a/chrome/browser/resources/side_panel/side_panel.gni +++ b/chrome/browser/resources/side_panel/side_panel.gni
@@ -40,3 +40,17 @@ "read_anything/read_anything.mojom-webui.js", "reading_list/reading_list.mojom-webui.js", ] + +# TODO(abigailbklein): Remove this when ReadAnythingAppController is wired up. +mojo_files += [ + "read_anything/ax_constants.mojom-webui.js", + "read_anything/ax_enums.mojom-webui.js", + "read_anything/ax_action_data.mojom-webui.js", + "read_anything/ax_event.mojom-webui.js", + "read_anything/ax_event_intent.mojom-webui.js", + "read_anything/ax_node_data.mojom-webui.js", + "read_anything/ax_relative_bounds.mojom-webui.js", + "read_anything/ax_tree_data.mojom-webui.js", + "read_anything/ax_tree_id.mojom-webui.js", + "read_anything/ax_tree_update.mojom-webui.js", +]
diff --git a/chrome/browser/segmentation_platform/segmentation_platform_profile_observer_unittest.cc b/chrome/browser/segmentation_platform/segmentation_platform_profile_observer_unittest.cc index 6e6585f..05f945b4 100644 --- a/chrome/browser/segmentation_platform/segmentation_platform_profile_observer_unittest.cc +++ b/chrome/browser/segmentation_platform/segmentation_platform_profile_observer_unittest.cc
@@ -10,6 +10,7 @@ #include "chrome/test/base/testing_profile_manager.h" #include "components/segmentation_platform/public/segment_selection_result.h" #include "components/segmentation_platform/public/segmentation_platform_service.h" +#include "components/segmentation_platform/public/trigger_context.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -39,7 +40,7 @@ MOCK_METHOD(void, UnregisterOnDemandSegmentSelectionCallback, (CallbackId, const std::string&)); - MOCK_METHOD(void, OnTrigger, (TriggerType, const TriggerContext&)); + MOCK_METHOD(void, OnTrigger, (std::unique_ptr<TriggerContext>)); MOCK_METHOD(void, EnableMetrics, (bool)); MOCK_METHOD(void, GetServiceStatus, ()); MOCK_METHOD(bool, IsPlatformInitialized, ());
diff --git a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc index 4b0dcde8..53c9bf2 100644 --- a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc +++ b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc
@@ -277,7 +277,7 @@ auto event = std::make_unique<extensions::Event>( extensions::events::TTS_ENGINE_ON_SPEAK, tts_engine_events::kOnSpeak, - std::move(*args).TakeListDeprecated(), profile); + std::move(args->GetList()), profile); event_router->DispatchEventToExtension(engine_id, std::move(event)); } @@ -286,7 +286,7 @@ Profile::FromBrowserContext(utterance->GetBrowserContext()); auto event = std::make_unique<extensions::Event>( extensions::events::TTS_ENGINE_ON_STOP, tts_engine_events::kOnStop, - std::vector<base::Value>(), profile); + base::Value::List(), profile); EventRouter::Get(profile)->DispatchEventToExtension(utterance->GetEngineId(), std::move(event)); } @@ -296,7 +296,7 @@ Profile::FromBrowserContext(utterance->GetBrowserContext()); auto event = std::make_unique<extensions::Event>( extensions::events::TTS_ENGINE_ON_PAUSE, tts_engine_events::kOnPause, - std::vector<base::Value>(), profile); + base::Value::List(), profile); EventRouter* event_router = EventRouter::Get(profile); std::string id = utterance->GetEngineId(); event_router->DispatchEventToExtension(id, std::move(event)); @@ -308,7 +308,7 @@ Profile::FromBrowserContext(utterance->GetBrowserContext()); auto event = std::make_unique<extensions::Event>( extensions::events::TTS_ENGINE_ON_RESUME, tts_engine_events::kOnResume, - std::vector<base::Value>(), profile); + base::Value::List(), profile); EventRouter* event_router = EventRouter::Get(profile); std::string id = utterance->GetEngineId(); event_router->DispatchEventToExtension(id, std::move(event));
diff --git a/chrome/browser/speech/extension_api/tts_engine_extension_api_chromeos.cc b/chrome/browser/speech/extension_api/tts_engine_extension_api_chromeos.cc index 4ac5e1a..9d03bcbca 100644 --- a/chrome/browser/speech/extension_api/tts_engine_extension_api_chromeos.cc +++ b/chrome/browser/speech/extension_api/tts_engine_extension_api_chromeos.cc
@@ -254,5 +254,5 @@ engine_id, std::make_unique<extensions::Event>( extensions::events::TTS_ENGINE_ON_SPEAK_WITH_AUDIO_STREAM, tts_engine_events::kOnSpeakWithAudioStream, - std::move(*args).TakeListDeprecated(), profile)); + std::move(args->GetList()), profile)); }
diff --git a/chrome/browser/speech/extension_api/tts_extension_api.cc b/chrome/browser/speech/extension_api/tts_extension_api.cc index 23dd8597..273e564 100644 --- a/chrome/browser/speech/extension_api/tts_extension_api.cc +++ b/chrome/browser/speech/extension_api/tts_extension_api.cc
@@ -168,13 +168,12 @@ details.Set(constants::kSrcIdKey, utterance->GetSrcId()); details.Set(constants::kIsFinalEventKey, utterance->IsFinished()); - std::unique_ptr<base::ListValue> arguments(new base::ListValue()); - arguments->Append(base::Value(std::move(details))); + base::Value::List arguments; + arguments.Append(std::move(details)); auto event = std::make_unique<extensions::Event>( ::extensions::events::TTS_ON_EVENT, ::events::kOnEvent, - std::move(*arguments).TakeListDeprecated(), - utterance->GetBrowserContext()); + std::move(arguments), utterance->GetBrowserContext()); event->event_url = utterance->GetSrcUrl(); extensions::EventRouter::Get(utterance->GetBrowserContext()) ->DispatchEventToExtension(src_extension_id_, std::move(event));
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 5f04be0..3fd3d0e3 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -2276,6 +2276,8 @@ "ash/ime_controller_client_impl.h", "ash/in_session_auth_dialog_client.cc", "ash/in_session_auth_dialog_client.h", + "ash/in_session_auth_token_provider_impl.cc", + "ash/in_session_auth_token_provider_impl.h", "ash/keyboard/chrome_keyboard_bounds_observer.cc", "ash/keyboard/chrome_keyboard_bounds_observer.h", "ash/keyboard/chrome_keyboard_controller_client.cc",
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java index ce74358..0adc1992 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java
@@ -305,7 +305,11 @@ @Nullable public static String getGeoHeader(String url, Tab tab) { Profile profile = Profile.fromWebContents(tab.getWebContents()); - if (profile == null) return null; + Log.i(TAG, "[getGeoHeader] getGeoHeader for url " + url); + if (profile == null) { + Log.i(TAG, "[getGeoHeader] getGeoHeader failed because of a null profile"); + return null; + } return getGeoHeader(url, profile, tab); } @@ -356,6 +360,7 @@ long locationAge = Long.MAX_VALUE; @HeaderState int headerState = geoHeaderStateForUrl(profile, url, true); + Log.i(TAG, "[getGeoHeader] headerState: " + headerState); if (headerState == HeaderState.HEADER_ENABLED) { locationToAttach = GeolocationTracker.getLastKnownLocation( ContextUtils.getApplicationContext()); @@ -408,6 +413,10 @@ String visibleNetworksProtoEncoding = encodeProtoVisibleNetworks(visibleNetworksToAttach); + Log.i(TAG, "[getGeoHeader] locationProtoEncoding: " + locationProtoEncoding); + Log.i(TAG, + "[getGeoHeader] visibleNetworksProtoEncoding: " + visibleNetworksProtoEncoding); + if (locationProtoEncoding == null && visibleNetworksProtoEncoding == null) return null; StringBuilder header = new StringBuilder(XGEO_HEADER_PREFIX);
diff --git a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc index 580ab05..e6051e6 100644 --- a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc +++ b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
@@ -39,6 +39,7 @@ #include "chrome/browser/ui/ash/desks/desks_client.h" #include "chrome/browser/ui/ash/ime_controller_client_impl.h" #include "chrome/browser/ui/ash/in_session_auth_dialog_client.h" +#include "chrome/browser/ui/ash/in_session_auth_token_provider_impl.h" #include "chrome/browser/ui/ash/login_screen_client_impl.h" #include "chrome/browser/ui/ash/media_client_impl.h" #include "chrome/browser/ui/ash/microphone_mute_notification_delegate_impl.h" @@ -179,6 +180,9 @@ in_session_auth_dialog_client_ = std::make_unique<InSessionAuthDialogClient>(); + in_session_auth_token_provider_ = + std::make_unique<ash::InSessionAuthTokenProviderImpl>(); + // NOTE: The WallpaperControllerClientImpl must be initialized before the // session controller, because the session controller triggers the loading // of users, which itself calls a code path which eventually reaches the
diff --git a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.h b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.h index 74149aa0..d21bde53 100644 --- a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.h +++ b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.h
@@ -8,6 +8,7 @@ #include <memory> #include "chrome/browser/chrome_browser_main_extra_parts.h" +#include "chrome/browser/ui/ash/in_session_auth_token_provider_impl.h" #include "chrome/common/buildflags.h" namespace ash { @@ -99,6 +100,8 @@ std::unique_ptr<ArcOpenUrlDelegateImpl> arc_open_url_delegate_impl_; std::unique_ptr<ImeControllerClientImpl> ime_controller_client_; std::unique_ptr<InSessionAuthDialogClient> in_session_auth_dialog_client_; + std::unique_ptr<ash::InSessionAuthTokenProviderImpl> + in_session_auth_token_provider_; std::unique_ptr<ScreenOrientationDelegateChromeos> screen_orientation_delegate_; std::unique_ptr<SessionControllerClientImpl> session_controller_client_;
diff --git a/chrome/browser/ui/ash/in_session_auth_token_provider_impl.cc b/chrome/browser/ui/ash/in_session_auth_token_provider_impl.cc new file mode 100644 index 0000000..994a9ffd --- /dev/null +++ b/chrome/browser/ui/ash/in_session_auth_token_provider_impl.cc
@@ -0,0 +1,38 @@ +// 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/ash/in_session_auth_token_provider_impl.h" + +#include "ash/public/cpp/in_session_auth_token_provider.h" +#include "ash/shell.h" +#include "base/check.h" +#include "base/time/time.h" +#include "chrome/browser/ash/login/quick_unlock/auth_token.h" +#include "chrome/browser/ash/login/quick_unlock/quick_unlock_factory.h" +#include "chrome/browser/ash/login/quick_unlock/quick_unlock_storage.h" +#include "chrome/browser/profiles/profile_manager.h" + +namespace ash { + +InSessionAuthTokenProviderImpl::InSessionAuthTokenProviderImpl() { + ash::Shell::Get()->in_session_auth_dialog_controller()->SetTokenProvider( + this); +} + +void InSessionAuthTokenProviderImpl::ExchangeForToken( + std::unique_ptr<UserContext> user_context, + OnAuthTokenGenerated callback) { + auto* quick_unlock_storage = + quick_unlock::QuickUnlockFactory::GetForAccountId( + user_context->GetAccountId()); + quick_unlock_storage->MarkStrongAuth(); + quick_unlock_storage->CreateAuthToken(*user_context); + auto token = quick_unlock_storage->GetAuthToken()->GetUnguessableToken(); + DCHECK(token.has_value()); + std::move(callback).Run( + token.value(), + base::Seconds(quick_unlock::AuthToken::kTokenExpirationSeconds)); +} + +} // namespace ash
diff --git a/chrome/browser/ui/ash/in_session_auth_token_provider_impl.h b/chrome/browser/ui/ash/in_session_auth_token_provider_impl.h new file mode 100644 index 0000000..a54f071e --- /dev/null +++ b/chrome/browser/ui/ash/in_session_auth_token_provider_impl.h
@@ -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. + +#ifndef CHROME_BROWSER_UI_ASH_IN_SESSION_AUTH_TOKEN_PROVIDER_IMPL_H_ +#define CHROME_BROWSER_UI_ASH_IN_SESSION_AUTH_TOKEN_PROVIDER_IMPL_H_ + +#include "ash/components/login/auth/user_context.h" +#include "ash/public/cpp/ash_public_export.h" +#include "ash/public/cpp/in_session_auth_token_provider.h" +#include "base/callback_forward.h" +#include "base/time/time.h" +#include "base/unguessable_token.h" + +namespace ash { + +class ASH_PUBLIC_EXPORT InSessionAuthTokenProviderImpl + : public InSessionAuthTokenProvider { + public: + using OnAuthTokenGenerated = + base::OnceCallback<void(const base::UnguessableToken&, base::TimeDelta)>; + + InSessionAuthTokenProviderImpl(); + ~InSessionAuthTokenProviderImpl() override = default; + + // InSessionAuthTokenProvider + void ExchangeForToken(std::unique_ptr<UserContext> user_context, + OnAuthTokenGenerated callback) override; +}; + +} // namespace ash + +#endif // CHROME_BROWSER_UI_ASH_IN_SESSION_AUTH_TOKEN_PROVIDER_IMPL_H_
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc index c34c08e9..ea0cfac1 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -96,6 +96,7 @@ #include "ui/base/theme_provider.h" #include "ui/base/window_open_disposition.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/compositor/paint_recorder.h" #include "ui/events/event_constants.h" #include "ui/events/types/event_type.h" @@ -938,7 +939,7 @@ // TODO(sky/glen): make me pretty! recorder.canvas()->FillRect( indicator_bounds, - GetThemeProvider()->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT)); + GetColorProvider()->GetColor(kColorBookmarkBarForeground)); } } @@ -1580,11 +1581,11 @@ button->SetText(node->GetTitle()); button->SetAccessibleName(node->GetTitle()); button->SetID(VIEW_ID_BOOKMARK_BAR_ELEMENT); - // We don't always have a theme provider (ui tests, for example). + // We don't always have a color provider (ui tests, for example). SkColor text_color = gfx::kPlaceholderColor; - const ui::ThemeProvider* const tp = GetThemeProvider(); - if (tp) { - text_color = tp->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT); + const ui::ColorProvider* const cp = GetColorProvider(); + if (cp) { + text_color = cp->GetColor(kColorBookmarkBarForeground); button->SetEnabledTextColors(text_color); if (node->is_folder()) { button->SetImageModel( @@ -1602,7 +1603,7 @@ bool themify_icon = node->url().SchemeIs(content::kChromeUIScheme); gfx::ImageSkia favicon = bookmark_model_->GetFavicon(node).AsImageSkia(); if (favicon.isNull()) { - if (ui::TouchUiController::Get()->touch_ui() && tp) { + if (ui::TouchUiController::Get()->touch_ui() && cp) { // This favicon currently does not match the default favicon icon used // elsewhere in the codebase. // See https://crbug/814447 @@ -1619,9 +1620,8 @@ themify_icon = true; } - if (themify_icon && tp) { - SkColor favicon_color = - tp->GetColor(ThemeProperties::COLOR_BOOKMARK_FAVICON); + if (themify_icon && cp) { + SkColor favicon_color = cp->GetColor(kColorBookmarkFavicon); if (favicon_color != SK_ColorTRANSPARENT) { favicon = gfx::ImageSkiaOperations::CreateColorMask(favicon, favicon_color); @@ -1949,17 +1949,16 @@ } void BookmarkBarView::UpdateAppearanceForTheme() { - // We don't always have a theme provider (ui tests, for example). - const ui::ThemeProvider* theme_provider = GetThemeProvider(); - if (!theme_provider) + // We don't always have a color provider (ui tests, for example). + const ui::ColorProvider* color_provider = GetColorProvider(); + if (!color_provider) return; for (size_t i = 0; i < bookmark_buttons_.size(); ++i) { ConfigureButton(bookmark_model_->bookmark_bar_node()->children()[i].get(), bookmark_buttons_[i]); } - const SkColor color = - theme_provider->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT); + const SkColor color = color_provider->GetColor(kColorBookmarkBarForeground); other_bookmarks_button_->SetEnabledTextColors(color); managed_bookmarks_button_->SetEnabledTextColors(color); other_bookmarks_button_->SetImageModel( @@ -1975,7 +1974,7 @@ apps_page_shortcut_->SetEnabledTextColors(color); const SkColor overflow_color = - GetColorProvider()->GetColor(kColorBookmarkButtonIcon); + color_provider->GetColor(kColorBookmarkButtonIcon); const bool touch_ui = ui::TouchUiController::Get()->touch_ui(); overflow_button_->SetImageModel( views::Button::STATE_NORMAL,
diff --git a/chrome/browser/ui/views/device_chooser_content_view_unittest.cc b/chrome/browser/ui/views/device_chooser_content_view_unittest.cc index 60805ff..16de3ea2 100644 --- a/chrome/browser/ui/views/device_chooser_content_view_unittest.cc +++ b/chrome/browser/ui/views/device_chooser_content_view_unittest.cc
@@ -317,7 +317,7 @@ widget()->LayoutRootViewIfNecessary(); EXPECT_CALL(*controller(), OpenAdapterOffHelpUrl()).Times(1); static_cast<views::StyledLabel*>(adapter_off_view()->children().front()) - ->ClickLinkForTesting(); + ->ClickFirstLinkForTesting(); } TEST_F(DeviceChooserContentViewTest, ClickRescanButton) {
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view_browsertest_win.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view_browsertest_win.cc index a3f66c1..c47ef23b 100644 --- a/chrome/browser/ui/views/frame/glass_browser_frame_view_browsertest_win.cc +++ b/chrome/browser/ui/views/frame/glass_browser_frame_view_browsertest_win.cc
@@ -13,7 +13,6 @@ #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/views/frame/app_menu_button.h" @@ -34,6 +33,8 @@ #include "content/public/test/browser_test.h" #include "content/public/test/test_navigation_observer.h" #include "third_party/blink/public/mojom/manifest/display_mode.mojom.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/views/view_utils.h" class WebAppGlassBrowserFrameViewTest : public InProcessBrowserTest { @@ -105,9 +106,9 @@ if (!InstallAndLaunchWebApp()) return; - EXPECT_EQ(glass_frame_view_->GetTitlebarColor(), - browser()->window()->GetThemeProvider()->GetColor( - ThemeProperties::COLOR_FRAME_ACTIVE)); + EXPECT_EQ( + glass_frame_view_->GetTitlebarColor(), + browser()->window()->GetColorProvider()->GetColor(ui::kColorFrameActive)); } IN_PROC_BROWSER_TEST_F(WebAppGlassBrowserFrameViewTest, MaximizedLayout) {
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc index ca28063..e8754a8 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -673,7 +673,7 @@ // (&processed_bg_image) to create a local copy, so it's safe for this // to be locally scoped. button->SetBackgroundImage( - tp->GetColor(ThemeProperties::COLOR_CONTROL_BUTTON_BACKGROUND), + frame()->GetColorProvider()->GetColor(kColorCaptionButtonBackground), (processed_bg_image.isNull() ? nullptr : &processed_bg_image), tp->GetImageSkiaNamed(mask_image_id)); }
diff --git a/chrome/browser/ui/views/frame/windows_10_caption_button.cc b/chrome/browser/ui/views/frame/windows_10_caption_button.cc index 0352490..13ebcaa 100644 --- a/chrome/browser/ui/views/frame/windows_10_caption_button.cc +++ b/chrome/browser/ui/views/frame/windows_10_caption_button.cc
@@ -76,8 +76,8 @@ // Paint the background of the button (the semi-transparent rectangle that // appears when you hover or press the button). const ui::ThemeProvider* theme_provider = GetThemeProvider(); - const SkColor bg_color = theme_provider->GetColor( - ThemeProperties::COLOR_CONTROL_BUTTON_BACKGROUND); + const SkColor bg_color = + GetColorProvider()->GetColor(kColorCaptionButtonBackground); const SkAlpha theme_alpha = SkColorGetA(bg_color); gfx::Rect bounds = GetContentsBounds(); bounds.Inset(gfx::Insets::TLBR(0, GetBetweenButtonSpacing(), 0, 0));
diff --git a/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view_browsertest.cc b/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view_browsertest.cc index 1468e49..9ab5d87 100644 --- a/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view_browsertest.cc
@@ -346,7 +346,7 @@ static_cast<views::StyledLabel*>( page_info->GetViewByID( PageInfoViewFactory::VIEW_ID_PAGE_INFO_SECURITY_DETAILS_LABEL)) - ->ClickLinkForTesting(); + ->ClickFirstLinkForTesting(); EXPECT_EQ(chrome::kSafetyTipHelpCenterURL, new_tab_observer.GetWebContents()->GetVisibleURL()); } @@ -367,7 +367,7 @@ static_cast<views::StyledLabel*>( page_info->GetViewByID( PageInfoViewFactory::VIEW_ID_PAGE_INFO_SECURITY_DETAILS_LABEL)) - ->ClickLinkForTesting(); + ->ClickFirstLinkForTesting(); EXPECT_EQ(chrome::kPageInfoHelpCenterURL, new_tab_observer.GetWebContents()->GetVisibleURL()); }
diff --git a/chrome/browser/ui/views/payments/payment_request_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_browsertest.cc index e2b59a8c..f0e5507 100644 --- a/chrome/browser/ui/views/payments/payment_request_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_browsertest.cc
@@ -636,7 +636,7 @@ static_cast<int>(DialogViewID::DATA_SOURCE_LABEL))); EXPECT_TRUE(styled_label); content::WebContentsAddedObserver web_contents_added_observer; - styled_label->ClickLinkForTesting(); + styled_label->ClickFirstLinkForTesting(); content::WebContents* new_tab_contents = web_contents_added_observer.GetWebContents(); @@ -694,7 +694,7 @@ static_cast<int>(DialogViewID::DATA_SOURCE_LABEL))); EXPECT_TRUE(styled_label); content::WebContentsAddedObserver web_contents_added_observer; - styled_label->ClickLinkForTesting(); + styled_label->ClickFirstLinkForTesting(); content::WebContents* new_tab_contents = web_contents_added_observer.GetWebContents();
diff --git a/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view_browsertest.cc b/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view_browsertest.cc index d3691b7..51a40175 100644 --- a/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view_browsertest.cc
@@ -296,7 +296,7 @@ views::StyledLabel* opt_out_label = static_cast<views::StyledLabel*>( test_delegate_->dialog_view()->GetFootnoteViewForTesting()); - opt_out_label->ClickLinkForTesting(); + opt_out_label->ClickFirstLinkForTesting(); event_waiter_->Wait();
diff --git a/chrome/browser/ui/views/payments/secure_payment_confirmation_no_creds_dialog_view_browsertest.cc b/chrome/browser/ui/views/payments/secure_payment_confirmation_no_creds_dialog_view_browsertest.cc index ee513c1..d5fbd3e 100644 --- a/chrome/browser/ui/views/payments/secure_payment_confirmation_no_creds_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/payments/secure_payment_confirmation_no_creds_dialog_view_browsertest.cc
@@ -125,7 +125,7 @@ // Now click the Opt Out link and make sure that the expected events occur. ResetEventWaiter(DialogEvent::OPT_OUT_CLICKED); - opt_out_label->ClickLinkForTesting(); + opt_out_label->ClickFirstLinkForTesting(); // If we make it past this wait, the delegate was correctly called. event_waiter_->Wait();
diff --git a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble_browsertest.cc b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble_browsertest.cc index 2887e67..a72fbeb0 100644 --- a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble_browsertest.cc +++ b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble_browsertest.cc
@@ -38,19 +38,6 @@ return waiter.WaitIfNeededAndGet(); } -void ClickButton(views::BubbleDialogDelegate* bubble_delegate, - views::View* button) { - // Reset the timer to make sure that test click isn't discarded as possibly - // unintended. - bubble_delegate->ResetViewShownTimeStampForTesting(); - gfx::Point center(button->width() / 2, button->height() / 2); - const ui::MouseEvent event(ui::ET_MOUSE_PRESSED, center, center, - ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, - ui::EF_LEFT_MOUSE_BUTTON); - button->OnMousePressed(event); - button->OnMouseReleased(event); -} - } // namespace class PrivacySandboxNoticeBubbleBrowserTest : public DialogBrowserTest { @@ -75,23 +62,6 @@ MockPrivacySandboxService* mock_service() { return mock_service_; } - void VerifyBubbleWasClosed(views::Widget* bubble) { - EXPECT_TRUE(bubble->IsClosed()); - - // While IsClosed updated immediately, the widget will only actually close, - // and thus inform the service asynchronously so must be waited for. - base::RunLoop().RunUntilIdle(); - - // Shutting down the browser test will naturally shut the bubble, verify - // expectations before that happens. - testing::Mock::VerifyAndClearExpectations(mock_service()); - } - - ui::TrackedElement* GetElement(ui::ElementIdentifier id) { - return ui::ElementTracker::GetElementTracker()->GetFirstMatchingElement( - id, browser()->window()->GetElementContext()); - } - private: raw_ptr<MockPrivacySandboxService> mock_service_; base::test::ScopedFeatureList feature_list_; @@ -108,109 +78,3 @@ PrivacySandboxService::PromptAction::kNoticeClosedNoInteraction)); ShowAndVerifyUi(); } - -IN_PROC_BROWSER_TEST_F(PrivacySandboxNoticeBubbleBrowserTest, - EscapeClosesNotice) { - // Check that when the escape key is pressed, the notice bubble is closed. - EXPECT_CALL( - *mock_service(), - PromptActionOccurred(PrivacySandboxService::PromptAction::kNoticeShown)); - EXPECT_CALL(*mock_service(), - PromptActionOccurred( - PrivacySandboxService::PromptAction::kNoticeDismiss)); - EXPECT_CALL( - *mock_service(), - PromptActionOccurred( - PrivacySandboxService::PromptAction::kNoticeClosedNoInteraction)) - .Times(0); - auto* bubble = ShowBubble(browser()); - bubble->CloseWithReason(views::Widget::ClosedReason::kEscKeyPressed); - VerifyBubbleWasClosed(bubble); -} - -// TODO(crbug.com/1321587): Figure out what to do with the bubble when the app -// menu is shown. Update the test to test that. -IN_PROC_BROWSER_TEST_F(PrivacySandboxNoticeBubbleBrowserTest, - DISABLED_AppMenuClosesNotice) { - // Check that when the app menu is opened, the notice bubble is closed. - EXPECT_CALL( - *mock_service(), - PromptActionOccurred(PrivacySandboxService::PromptAction::kNoticeShown)); - EXPECT_CALL(*mock_service(), - PromptActionOccurred( - PrivacySandboxService::PromptAction::kNoticeDismiss)); - EXPECT_CALL( - *mock_service(), - PromptActionOccurred( - PrivacySandboxService::PromptAction::kNoticeClosedNoInteraction)) - .Times(0); - auto* bubble = ShowBubble(browser()); - chrome::ShowAppMenu(browser()); - VerifyBubbleWasClosed(bubble); -} - -IN_PROC_BROWSER_TEST_F(PrivacySandboxNoticeBubbleBrowserTest, - AcknowledgeNotice) { - EXPECT_CALL( - *mock_service(), - PromptActionOccurred(PrivacySandboxService::PromptAction::kNoticeShown)); - EXPECT_CALL(*mock_service(), - PromptActionOccurred( - PrivacySandboxService::PromptAction::kNoticeAcknowledge)); - EXPECT_CALL( - *mock_service(), - PromptActionOccurred( - PrivacySandboxService::PromptAction::kNoticeClosedNoInteraction)) - .Times(0); - - auto* bubble = ShowBubble(browser()); - auto* bubble_delegate = bubble->widget_delegate()->AsBubbleDialogDelegate(); - ClickButton(bubble_delegate, bubble_delegate->GetOkButton()); - VerifyBubbleWasClosed(bubble); -} - -IN_PROC_BROWSER_TEST_F(PrivacySandboxNoticeBubbleBrowserTest, - OpenSettingsNotice) { - EXPECT_CALL( - *mock_service(), - PromptActionOccurred(PrivacySandboxService::PromptAction::kNoticeShown)); - EXPECT_CALL(*mock_service(), - PromptActionOccurred( - PrivacySandboxService::PromptAction::kNoticeOpenSettings)); - EXPECT_CALL( - *mock_service(), - PromptActionOccurred( - PrivacySandboxService::PromptAction::kNoticeClosedNoInteraction)) - .Times(0); - - auto* bubble = ShowBubble(browser()); - auto* bubble_delegate = bubble->widget_delegate()->AsBubbleDialogDelegate(); - ClickButton(bubble_delegate, bubble_delegate->GetExtraView()); - // TODO(crbug.com/1321587): Bubble should be closed. Figure out why opening - // settings page doesn't take over the focus (only in tests). -} - -// TODO(crbug.com/1321587, crbug.com/1327190): Update how the link is accessed -// after the API for DialogModel is added. -IN_PROC_BROWSER_TEST_F(PrivacySandboxNoticeBubbleBrowserTest, - OpenLearnMoreNotice) { - EXPECT_CALL( - *mock_service(), - PromptActionOccurred(PrivacySandboxService::PromptAction::kNoticeShown)); - EXPECT_CALL(*mock_service(), - PromptActionOccurred( - PrivacySandboxService::PromptAction::kNoticeLearnMore)); - EXPECT_CALL( - *mock_service(), - PromptActionOccurred( - PrivacySandboxService::PromptAction::kNoticeClosedNoInteraction)) - .Times(0); - - ShowBubble(browser()); - auto* view = GetElement(kPrivacySandboxLearnMoreTextForTesting) - ->AsA<views::TrackedElementViews>() - ->view(); - static_cast<views::StyledLabel*>(view)->ClickLinkForTesting(); - // TODO(crbug.com/1321587): Bubble should be closed. Figure out why opening - // settings page doesn't take over the focus (only in tests). -}
diff --git a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble_interactive_ui_test.cc b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble_interactive_ui_test.cc new file mode 100644 index 0000000..883cf3c --- /dev/null +++ b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble_interactive_ui_test.cc
@@ -0,0 +1,173 @@ +// 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 "base/test/scoped_feature_list.h" +#include "build/build_config.h" +#include "chrome/browser/privacy_sandbox/mock_privacy_sandbox_service.h" +#include "chrome/browser/privacy_sandbox/privacy_sandbox_service_factory.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_commands.h" +#include "chrome/browser/ui/privacy_sandbox/privacy_sandbox_prompt.h" +#include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "chrome/browser/ui/test/test_browser_dialog.h" +#include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble.h" +#include "chrome/common/webui_url_constants.h" +#include "chrome/test/base/interactive_test_utils.h" +#include "chrome/test/base/ui_test_utils.h" +#include "components/privacy_sandbox/privacy_sandbox_features.h" +#include "components/privacy_sandbox/privacy_sandbox_prefs.h" +#include "content/public/browser/web_contents.h" +#include "content/public/test/browser_test.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "ui/events/base_event_utils.h" +#include "ui/views/controls/button/label_button.h" +#include "ui/views/controls/styled_label.h" +#include "ui/views/interaction/element_tracker_views.h" +#include "ui/views/test/widget_test.h" +#include "ui/views/widget/any_widget_observer.h" +#include "ui/views/widget/widget.h" + +namespace { + +views::Widget* ShowBubble(Browser* browser) { + views::NamedWidgetShownWaiter waiter(views::test::AnyWidgetTestPasskey{}, + kPrivacySandboxNoticeBubbleName); + ShowPrivacySandboxPrompt(browser, PrivacySandboxService::PromptType::kNotice); + return waiter.WaitIfNeededAndGet(); +} + +void ClickOnViewInBubble(views::BubbleDialogDelegate* bubble_delegate, + views::View* button) { + // Reset the timer to make sure that test click isn't discarded as possibly + // unintended. + bubble_delegate->ResetViewShownTimeStampForTesting(); + ui_test_utils::ClickOnView(button); +} + +} // namespace + +class PrivacySandboxNoticeBubbleInteractiveUiTest + : public InProcessBrowserTest { + public: + void SetUpOnMainThread() override { + mock_service_ = static_cast<MockPrivacySandboxService*>( + PrivacySandboxServiceFactory::GetInstance()->SetTestingFactoryAndUse( + browser()->profile(), + base::BindRepeating(&BuildMockPrivacySandboxService))); + } + + void SetUp() override { + const base::FieldTrialParams params = { + {privacy_sandbox::kPrivacySandboxSettings3NewNotice.name, "true"}}; + feature_list_.InitWithFeaturesAndParameters( + {{privacy_sandbox::kPrivacySandboxSettings3, params}}, {}); + InProcessBrowserTest::SetUp(); + } + + MockPrivacySandboxService* mock_service() { return mock_service_; } + + ui::TrackedElement* GetElement(ui::ElementIdentifier id) { + return ui::ElementTracker::GetElementTracker()->GetFirstMatchingElement( + id, browser()->window()->GetElementContext()); + } + + private: + raw_ptr<MockPrivacySandboxService> mock_service_; + base::test::ScopedFeatureList feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(PrivacySandboxNoticeBubbleInteractiveUiTest, + AcknowledgeNotice) { + EXPECT_CALL( + *mock_service(), + PromptActionOccurred(PrivacySandboxService::PromptAction::kNoticeShown)); + EXPECT_CALL(*mock_service(), + PromptActionOccurred( + PrivacySandboxService::PromptAction::kNoticeAcknowledge)); + EXPECT_CALL( + *mock_service(), + PromptActionOccurred( + PrivacySandboxService::PromptAction::kNoticeClosedNoInteraction)) + .Times(0); + + auto* bubble = ShowBubble(browser()); + auto* bubble_delegate = bubble->widget_delegate()->AsBubbleDialogDelegate(); + views::test::WidgetDestroyedWaiter observer(bubble); + ClickOnViewInBubble(bubble_delegate, bubble_delegate->GetOkButton()); + observer.Wait(); + testing::Mock::VerifyAndClearExpectations(mock_service()); +} + +IN_PROC_BROWSER_TEST_F(PrivacySandboxNoticeBubbleInteractiveUiTest, + OpenSettingsNotice) { + EXPECT_CALL( + *mock_service(), + PromptActionOccurred(PrivacySandboxService::PromptAction::kNoticeShown)); + EXPECT_CALL(*mock_service(), + PromptActionOccurred( + PrivacySandboxService::PromptAction::kNoticeOpenSettings)); + EXPECT_CALL( + *mock_service(), + PromptActionOccurred( + PrivacySandboxService::PromptAction::kNoticeClosedNoInteraction)) + .Times(0); + + auto* bubble = ShowBubble(browser()); + auto* bubble_delegate = bubble->widget_delegate()->AsBubbleDialogDelegate(); + views::test::WidgetDestroyedWaiter observer(bubble); + ClickOnViewInBubble(bubble_delegate, bubble_delegate->GetExtraView()); + observer.Wait(); + testing::Mock::VerifyAndClearExpectations(mock_service()); +} + +IN_PROC_BROWSER_TEST_F(PrivacySandboxNoticeBubbleInteractiveUiTest, + OpenLearnMoreNotice) { + EXPECT_CALL( + *mock_service(), + PromptActionOccurred(PrivacySandboxService::PromptAction::kNoticeShown)); + EXPECT_CALL(*mock_service(), + PromptActionOccurred( + PrivacySandboxService::PromptAction::kNoticeLearnMore)); + EXPECT_CALL( + *mock_service(), + PromptActionOccurred( + PrivacySandboxService::PromptAction::kNoticeClosedNoInteraction)) + .Times(0); + + auto* bubble = ShowBubble(browser()); + auto* bubble_delegate = bubble->widget_delegate()->AsBubbleDialogDelegate(); + bubble->GetRootView()->RequestFocus(); + auto* view = GetElement(kPrivacySandboxLearnMoreTextForTesting) + ->AsA<views::TrackedElementViews>() + ->view(); + views::test::WidgetDestroyedWaiter observer(bubble); + ClickOnViewInBubble( + bubble_delegate, + static_cast<views::StyledLabel*>(view)->GetFirstLinkForTesting()); + observer.Wait(); + testing::Mock::VerifyAndClearExpectations(mock_service()); +} + +IN_PROC_BROWSER_TEST_F(PrivacySandboxNoticeBubbleInteractiveUiTest, + EscapeClosesNotice) { + // Check that when the escape key is pressed, the notice bubble is closed. + EXPECT_CALL( + *mock_service(), + PromptActionOccurred(PrivacySandboxService::PromptAction::kNoticeShown)); + EXPECT_CALL(*mock_service(), + PromptActionOccurred( + PrivacySandboxService::PromptAction::kNoticeDismiss)); + EXPECT_CALL( + *mock_service(), + PromptActionOccurred( + PrivacySandboxService::PromptAction::kNoticeClosedNoInteraction)) + .Times(0); + auto* bubble = ShowBubble(browser()); + views::test::WidgetDestroyedWaiter observer(bubble); + bubble->CloseWithReason(views::Widget::ClosedReason::kEscKeyPressed); + observer.Wait(); + testing::Mock::VerifyAndClearExpectations(mock_service()); +}
diff --git a/chrome/browser/ui/views/tabs/tab_container.cc b/chrome/browser/ui/views/tabs/tab_container.cc index 0cabdf4e..7e58a7e 100644 --- a/chrome/browser/ui/views/tabs/tab_container.cc +++ b/chrome/browser/ui/views/tabs/tab_container.cc
@@ -505,8 +505,11 @@ group_views->second->UpdateBounds(); } +// TODO(pkasting): This should really return an optional<size_t> int TabContainer::GetModelIndexOf(const TabSlotView* slot_view) const { - return tabs_view_model_.GetIndexOfView(slot_view); + const absl::optional<size_t> index = + tabs_view_model_.GetIndexOfView(slot_view); + return index.has_value() ? static_cast<int>(index.value()) : -1; } Tab* TabContainer::GetTabAtModelIndex(int index) const { @@ -563,9 +566,9 @@ // A hit on the tab is not in the caption unless it is in the thin strip // mentioned above. - const int tab_index = tabs_view_model_.GetIndexOfView(v); - if (IsValidModelIndex(tab_index)) { - Tab* tab = GetTabAtModelIndex(tab_index); + const absl::optional<size_t> tab_index = tabs_view_model_.GetIndexOfView(v); + if (tab_index.has_value() && IsValidModelIndex(tab_index.value())) { + Tab* tab = GetTabAtModelIndex(tab_index.value()); gfx::Rect tab_drag_handle = tab->GetMirroredBounds(); tab_drag_handle.set_height(drag_handle_extension); return extend_drag_handle && !tab->IsActive() &&
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc index 3e88c25..fcabe66d 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
@@ -487,7 +487,7 @@ INPUT_SOURCE_MOUSE : INPUT_SOURCE_TOUCH; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) bool SendTouchEventsSync(int action, int id, const gfx::Point& location) { base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed); if (!ui_controls::SendTouchEventsNotifyWhenDone( @@ -507,7 +507,7 @@ ui_test_utils::SendMouseEventsSync( ui_controls::LEFT, ui_controls::DOWN); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) return SendTouchEventsSync(ui_controls::PRESS, id, location); #else NOTREACHED(); @@ -518,7 +518,7 @@ bool DragInputTo(const gfx::Point& location) { if (input_source() == INPUT_SOURCE_MOUSE) return ui_test_utils::SendMouseMoveSync(location); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) return SendTouchEventsSync(ui_controls::MOVE, 0, location); #else NOTREACHED(); @@ -529,7 +529,7 @@ bool DragInputToAsync(const gfx::Point& location) { if (input_source() == INPUT_SOURCE_MOUSE) return ui_controls::SendMouseMove(location.x(), location.y()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) return ui_controls::SendTouchEvents(ui_controls::MOVE, 0, location.x(), location.y()); #else @@ -545,7 +545,7 @@ location.x(), location.y(), std::move(task)); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) return ui_controls::SendTouchEventsNotifyWhenDone( ui_controls::MOVE, 0, location.x(), location.y(), std::move(task)); #else @@ -561,7 +561,7 @@ : ui_test_utils::SendMouseEventsSync(ui_controls::LEFT, ui_controls::UP); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) return async ? ui_controls::SendTouchEvents(ui_controls::RELEASE, id, 0, 0) : SendTouchEventsSync(ui_controls::RELEASE, id, gfx::Point()); #else @@ -4675,7 +4675,7 @@ ASSERT_TRUE(ReleaseInput()); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) INSTANTIATE_TEST_SUITE_P(TabDragging, DetachToBrowserTabDragControllerTest, ::testing::Values("mouse", "touch")); @@ -4683,6 +4683,17 @@ TabDragging, DetachToBrowserTabDragControllerTestWithScrollableTabStripEnabled, ::testing::Values("mouse", "touch")); +#else +INSTANTIATE_TEST_SUITE_P(TabDragging, + DetachToBrowserTabDragControllerTest, + ::testing::Values("mouse")); +INSTANTIATE_TEST_SUITE_P( + TabDragging, + DetachToBrowserTabDragControllerTestWithScrollableTabStripEnabled, + ::testing::Values("mouse")); +#endif + +#if BUILDFLAG(IS_CHROMEOS_ASH) INSTANTIATE_TEST_SUITE_P(TabDragging, DetachToBrowserInSeparateDisplayTabDragControllerTest, ::testing::Values("mouse")); @@ -4700,12 +4711,4 @@ TabDragging, DetachToBrowserTabDragControllerTestWithTabbedSystemApp, ::testing::Values("mouse", "touch")); -#else -INSTANTIATE_TEST_SUITE_P(TabDragging, - DetachToBrowserTabDragControllerTest, - ::testing::Values("mouse")); -INSTANTIATE_TEST_SUITE_P( - TabDragging, - DetachToBrowserTabDragControllerTestWithScrollableTabStripEnabled, - ::testing::Values("mouse")); #endif
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 4a7ea25..d110b49 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -2095,8 +2095,8 @@ } void TabStrip::OnViewFocused(views::View* observed_view) { - int index = tab_container_->tabs_view_model()->GetIndexOfView(observed_view); - if (index != -1) + auto index = tab_container_->tabs_view_model()->GetIndexOfView(observed_view); + if (index.has_value()) controller_->OnKeyboardFocusedTabChanged(index); }
diff --git a/chrome/browser/ui/views/tabs/tab_strip_layout_helper.cc b/chrome/browser/ui/views/tabs/tab_strip_layout_helper.cc index 0beed83..507a3e78 100644 --- a/chrome/browser/ui/views/tabs/tab_strip_layout_helper.cc +++ b/chrome/browser/ui/views/tabs/tab_strip_layout_helper.cc
@@ -93,9 +93,9 @@ return views; } -int TabStripLayoutHelper::GetPinnedTabCount() const { +size_t TabStripLayoutHelper::GetPinnedTabCount() const { views::ViewModelT<Tab>* tabs = get_tabs_callback_.Run(); - int pinned_count = 0; + size_t pinned_count = 0; while (pinned_count < tabs->view_size() && tabs->view_at(pinned_count)->data().pinned) { pinned_count++;
diff --git a/chrome/browser/ui/views/tabs/tab_strip_layout_helper.h b/chrome/browser/ui/views/tabs/tab_strip_layout_helper.h index 6401ae89..bc0b9c3 100644 --- a/chrome/browser/ui/views/tabs/tab_strip_layout_helper.h +++ b/chrome/browser/ui/views/tabs/tab_strip_layout_helper.h
@@ -54,7 +54,7 @@ int first_non_pinned_tab_x() { return first_non_pinned_tab_x_; } // Returns the number of pinned tabs in the tabstrip. - int GetPinnedTabCount() const; + size_t GetPinnedTabCount() const; // Returns a map of all tab groups and their bounds. const std::map<tab_groups::TabGroupId, gfx::Rect>& group_header_ideal_bounds()
diff --git a/chrome/browser/ui/webui/cr_components/history_clusters/history_clusters_util.cc b/chrome/browser/ui/webui/cr_components/history_clusters/history_clusters_util.cc index 35beebe..0c4ddff2 100644 --- a/chrome/browser/ui/webui/cr_components/history_clusters/history_clusters_util.cc +++ b/chrome/browser/ui/webui/cr_components/history_clusters/history_clusters_util.cc
@@ -16,10 +16,12 @@ // Static void HistoryClustersUtil::PopulateSource(content::WebUIDataSource* source, - Profile* profile) { + Profile* profile, + bool in_side_panel) { PrefService* prefs = profile->GetPrefs(); source->AddBoolean("allowDeletingHistory", prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory)); + source->AddBoolean("inSidePanel", in_side_panel); auto* history_clusters_service = HistoryClustersServiceFactory::GetForBrowserContext(profile); source->AddBoolean("isHistoryClustersEnabled",
diff --git a/chrome/browser/ui/webui/cr_components/history_clusters/history_clusters_util.h b/chrome/browser/ui/webui/cr_components/history_clusters/history_clusters_util.h index 2bf10b5..15ea4d8 100644 --- a/chrome/browser/ui/webui/cr_components/history_clusters/history_clusters_util.h +++ b/chrome/browser/ui/webui/cr_components/history_clusters/history_clusters_util.h
@@ -18,7 +18,8 @@ class HistoryClustersUtil { public: static void PopulateSource(content::WebUIDataSource* source, - Profile* profile); + Profile* profile, + bool in_side_panel); }; #endif // CHROME_BROWSER_UI_WEBUI_CR_COMPONENTS_HISTORY_CLUSTERS_HISTORY_CLUSTERS_UTIL_H_
diff --git a/chrome/browser/ui/webui/customize_themes/chrome_customize_themes_handler.cc b/chrome/browser/ui/webui/customize_themes/chrome_customize_themes_handler.cc index 6003a83..9078d9b4 100644 --- a/chrome/browser/ui/webui/customize_themes/chrome_customize_themes_handler.cc +++ b/chrome/browser/ui/webui/customize_themes/chrome_customize_themes_handler.cc
@@ -8,16 +8,18 @@ #include "chrome/browser/new_tab_page/chrome_colors/chrome_colors_service.h" #include "chrome/browser/new_tab_page/chrome_colors/generated_colors_info.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_window.h" +#include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/common/themes/autogenerated_theme_util.h" #include "content/public/browser/web_contents.h" #include "extensions/browser/extension_registry.h" #include "extensions/common/extension.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_palette.h" #include "ui/webui/resources/cr_components/customize_themes/customize_themes.mojom.h" @@ -141,17 +143,16 @@ // logic that returns a placeholder color. const BrowserWindow* browser_window = BrowserWindow::FindBrowserWindowWithWebContents(web_contents_); - const ui::ThemeProvider* theme_provider = - browser_window ? browser_window->GetThemeProvider() : nullptr; + const ui::ColorProvider* color_provider = + browser_window ? browser_window->GetColorProvider() : nullptr; theme->type = customize_themes::mojom::ThemeType::kAutogenerated; auto theme_colors = customize_themes::mojom::ThemeColors::New(); - if (theme_provider) { - theme_colors->frame = - theme_provider->GetColor(ThemeProperties::COLOR_FRAME_ACTIVE); + if (color_provider) { + theme_colors->frame = color_provider->GetColor(ui::kColorFrameActive); theme_colors->active_tab = - theme_provider->GetColor(ThemeProperties::COLOR_NTP_BACKGROUND); + color_provider->GetColor(kColorNewTabPageBackground); theme_colors->active_tab_text = - theme_provider->GetColor(ThemeProperties::COLOR_NTP_TEXT); + color_provider->GetColor(kColorNewTabPageText); } else { theme_colors->frame = gfx::kPlaceholderColor; theme_colors->active_tab = gfx::kPlaceholderColor;
diff --git a/chrome/browser/ui/webui/history/history_ui.cc b/chrome/browser/ui/webui/history/history_ui.cc index 983eb85..f035df1 100644 --- a/chrome/browser/ui/webui/history/history_ui.cc +++ b/chrome/browser/ui/webui/history/history_ui.cc
@@ -125,7 +125,7 @@ source->AddBoolean(kIsUserSignedInKey, IsUserSignedIn(profile)); // History clusters - HistoryClustersUtil::PopulateSource(source, profile); + HistoryClustersUtil::PopulateSource(source, profile, /*in_side_panel=*/false); webui::SetupWebUIDataSource( source, base::make_span(kHistoryResources, kHistoryResourcesSize),
diff --git a/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc b/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc index 1d5cb9b..40c1733 100644 --- a/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc +++ b/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc
@@ -39,6 +39,8 @@ #include "content/public/browser/web_contents.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/l10n/time_format.h" +#include "ui/base/mojom/window_open_disposition.mojom.h" +#include "ui/base/window_open_disposition.h" #include "ui/webui/mojo_bubble_web_ui_controller.h" #include "ui/webui/resources/cr_components/history_clusters/history_clusters.mojom.h" #include "url/gurl.h" @@ -220,6 +222,27 @@ history_clusters_side_panel_embedder_ = side_panel_embedder; } +void HistoryClustersHandler::OpenHistoryCluster( + const GURL& url, + ui::mojom::ClickModifiersPtr click_modifiers) { + Browser* browser = chrome::FindLastActive(); + if (!browser) + return; + + // Used to determine if default behavior should be open in current tab or new + // tab since it differs for side panel. + const bool in_side_panel = history_clusters_side_panel_embedder_ != nullptr; + + WindowOpenDisposition open_location = ui::DispositionFromClick( + /*middle_button=*/!in_side_panel, click_modifiers->alt_key, + click_modifiers->ctrl_key, click_modifiers->meta_key, + click_modifiers->shift_key); + content::OpenURLParams params(url, content::Referrer(), open_location, + ui::PAGE_TRANSITION_AUTO_BOOKMARK, + /*is_renderer_initiated=*/false); + browser->OpenURL(params); +} + void HistoryClustersHandler::SetPage( mojo::PendingRemote<mojom::Page> pending_page) { page_.Bind(std::move(pending_page));
diff --git a/chrome/browser/ui/webui/history_clusters/history_clusters_handler.h b/chrome/browser/ui/webui/history_clusters/history_clusters_handler.h index 796da58..74ad997e 100644 --- a/chrome/browser/ui/webui/history_clusters/history_clusters_handler.h +++ b/chrome/browser/ui/webui/history_clusters/history_clusters_handler.h
@@ -64,6 +64,9 @@ side_panel_embedder); // mojom::PageHandler: + void OpenHistoryCluster( + const GURL& url, + ui::mojom::ClickModifiersPtr click_modifiers) override; void SetPage(mojo::PendingRemote<mojom::Page> pending_page) override; void ShowSidePanelUI() override; void ToggleVisibility(bool visible,
diff --git a/chrome/browser/ui/webui/side_panel/history_clusters/history_clusters_side_panel_ui.cc b/chrome/browser/ui/webui/side_panel/history_clusters/history_clusters_side_panel_ui.cc index 87bd910..5584fe57 100644 --- a/chrome/browser/ui/webui/side_panel/history_clusters/history_clusters_side_panel_ui.cc +++ b/chrome/browser/ui/webui/side_panel/history_clusters/history_clusters_side_panel_ui.cc
@@ -27,7 +27,7 @@ Profile* const profile = Profile::FromWebUI(web_ui); - HistoryClustersUtil::PopulateSource(source, profile); + HistoryClustersUtil::PopulateSource(source, profile, /*in_side_panel=*/true); content::URLDataSource::Add( profile, std::make_unique<FaviconSource>(
diff --git a/chrome/browser/web_applications/BUILD.gn b/chrome/browser/web_applications/BUILD.gn index 7b44bf0..918027f 100644 --- a/chrome/browser/web_applications/BUILD.gn +++ b/chrome/browser/web_applications/BUILD.gn
@@ -634,6 +634,7 @@ "commands/fetch_manifest_and_install_command_browsertest.cc", "commands/install_from_info_command_browsertest.cc", "commands/install_from_sync_command_browsertest.cc", + "commands/install_isolated_app_command_browsertest.cc", "commands/install_web_app_with_params_command_browsertest.cc", "externally_installed_web_app_prefs_browsertest.cc", "externally_managed_app_manager_impl_browsertest.cc",
diff --git a/chrome/browser/web_applications/chrome_pwa_launcher/launcher_update.cc b/chrome/browser/web_applications/chrome_pwa_launcher/launcher_update.cc index 16d57de..c666697 100644 --- a/chrome/browser/web_applications/chrome_pwa_launcher/launcher_update.cc +++ b/chrome/browser/web_applications/chrome_pwa_launcher/launcher_update.cc
@@ -4,8 +4,6 @@ #include "chrome/browser/web_applications/chrome_pwa_launcher/launcher_update.h" -#include <windows.h> - #include "base/bind.h" #include "base/check.h" #include "base/files/file_enumerator.h"
diff --git a/chrome/browser/web_applications/commands/install_isolated_app_command_browsertest.cc b/chrome/browser/web_applications/commands/install_isolated_app_command_browsertest.cc new file mode 100644 index 0000000..3a16f6ec --- /dev/null +++ b/chrome/browser/web_applications/commands/install_isolated_app_command_browsertest.cc
@@ -0,0 +1,21 @@ +// 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/web_applications/web_app_controller_browsertest.h" +#include "chrome/browser/web_applications/commands/install_isolated_app_command.h" +#include "chrome/browser/web_applications/web_app_command_manager.h" +#include "chrome/browser/web_applications/web_app_provider.h" +#include "content/public/test/browser_test.h" +#include "url/gurl.h" + +namespace web_app { + +using InstallIsolatedAppCommandBrowserTest = WebAppControllerBrowserTest; + +IN_PROC_BROWSER_TEST_F(InstallIsolatedAppCommandBrowserTest, DoesFoo) { + const GURL kWebAppUrl = + https_server()->GetURL(R"(/banners/manifest_test_page.html)"); +} + +} // namespace web_app
diff --git a/chrome/browser/web_applications/url_handler_prefs.cc b/chrome/browser/web_applications/url_handler_prefs.cc index 51e9476..ee881d3 100644 --- a/chrome/browser/web_applications/url_handler_prefs.cc +++ b/chrome/browser/web_applications/url_handler_prefs.cc
@@ -377,16 +377,11 @@ std::vector<std::string> origins_to_remove; for (auto origin_value : pref_value.DictItems()) { - base::Value::ListStorage handlers = - std::move(origin_value.second).TakeListDeprecated(); - handlers.erase( - std::remove_if(handlers.begin(), handlers.end(), - [&app_id, &profile_path](const base::Value& handler) { - return IsHandlerForApp( - app_id, profile_path, + base::Value::List handlers = std::move(origin_value.second.GetList()); + handlers.EraseIf([&app_id, &profile_path](const base::Value& handler) { + return IsHandlerForApp(app_id, profile_path, /*match_app_id=*/!app_id.empty(), handler); - }), - handlers.end()); + }); // Replace list if any entries remain. if (!handlers.empty()) { origin_value.second = base::Value(std::move(handlers)); @@ -413,20 +408,20 @@ // "path": "/abc", // "timestamp": "-9223372036854775808" // } ] - auto include_paths_list = std::move(all_include_paths).TakeListDeprecated(); - for (base::Value& include_path_dict : include_paths_list) { - if (!include_path_dict.is_dict()) + auto& include_paths_list = all_include_paths.GetList(); + for (base::Value& include_path_value : include_paths_list) { + if (!include_path_value.is_dict()) continue; - const std::string* path = include_path_dict.FindStringKey(kPath); + base::Value::Dict& include_path_dict = include_path_value.GetDict(); + const std::string* path = include_path_dict.FindString(kPath); if (!path) continue; if (updated_include_paths.contains(*path)) { - include_path_dict.SetIntKey(kChoice, static_cast<int>(choice)); - include_path_dict.SetKey(kTimestamp, base::TimeToValue(time)); + include_path_dict.Set(kChoice, static_cast<int>(choice)); + include_path_dict.Set(kTimestamp, base::TimeToValue(time)); } } - all_include_paths = base::Value(std::move(include_paths_list)); } // Sets |choice| on every path in |include_paths| that matches |url|. Returns @@ -441,24 +436,24 @@ // "path": "/abc", // "timestamp": "-9223372036854775808" // } ] - auto include_paths_list = std::move(include_paths).TakeListDeprecated(); + auto& include_paths_list = std::move(include_paths).GetList(); std::vector<std::string> updated_include_paths; - for (base::Value& include_path_dict : include_paths_list) { - if (!include_path_dict.is_dict()) + for (base::Value& include_path_value : include_paths_list) { + if (!include_path_value.is_dict()) continue; - const std::string* path = include_path_dict.FindStringKey(kPath); + base::Value::Dict& include_path_dict = include_path_value.GetDict(); + const std::string* path = include_path_dict.FindString(kPath); if (!path) continue; // Any matching path dict. will be updated with the input choice and // timestamp. if (PathMatchesPathPattern(url.path(), *path)) { - include_path_dict.SetIntKey(kChoice, static_cast<int>(choice)); - include_path_dict.SetKey(kTimestamp, base::TimeToValue(time)); + include_path_dict.Set(kChoice, static_cast<int>(choice)); + include_path_dict.Set(kTimestamp, base::TimeToValue(time)); updated_include_paths.push_back(*path); } } - include_paths = base::Value(std::move(include_paths_list)); return std::move(updated_include_paths); } @@ -466,7 +461,7 @@ void SaveChoiceToAllMatchingIncludePaths(const GURL& url, const UrlHandlerSavedChoice choice, const base::Time& time, - base::Value::ListStorage& handlers) { + base::Value::List& handlers) { for (auto& handler : handlers) { auto handler_view = GetHandlerView(handler); if (!handler_view) @@ -490,7 +485,7 @@ const base::FilePath* profile_path, const GURL& url, const base::Time& time, - base::Value::ListStorage& handlers) { + base::Value::List& handlers) { PathSet updated_include_paths; for (auto& handler : handlers) { auto handler_view = GetHandlerView(handler); @@ -514,7 +509,7 @@ const base::FilePath* profile_path, const base::Time& time, PathSet updated_include_paths, - base::Value::ListStorage& handlers) { + base::Value::List& handlers) { for (auto& handler : handlers) { auto handler_view = GetHandlerView(handler); if (!handler_view || @@ -533,7 +528,7 @@ const base::FilePath* profile_path, const GURL& url, const base::Time& time, - base::Value::ListStorage& handlers) { + base::Value::List& handlers) { PathSet updated_include_paths = SaveInAppChoiceToSelectedApp(app_id, profile_path, url, time, handlers); @@ -552,21 +547,17 @@ base::Value& pref_value, const std::string& origin_str, const bool origin_trimmed) { - base::Value* const handlers_mutable = pref_value.FindListKey(origin_str); - if (!handlers_mutable) + base::Value::List* handlers = pref_value.GetDict().FindList(origin_str); + if (!handlers) return; DCHECK(UrlMatchesOrigin(url, origin_str, origin_trimmed)); - base::Value::ListStorage handlers = - std::move(*handlers_mutable).TakeListDeprecated(); if (choice == UrlHandlerSavedChoice::kInApp) { - SaveAppChoice(app_id, profile_path, url, time, handlers); + SaveAppChoice(app_id, profile_path, url, time, *handlers); } else { - SaveChoiceToAllMatchingIncludePaths(url, choice, time, handlers); + SaveChoiceToAllMatchingIncludePaths(url, choice, time, *handlers); } - - *handlers_mutable = base::Value(std::move(handlers)); } // Saves |choice| and |time| to all handler include_paths that match |app_id|, @@ -728,30 +719,27 @@ base::Value new_handler( NewHandler(app_id, profile_path, handler_info, time)); - base::Value* const handlers_mutable = - pref_value->FindListKey(origin.Serialize()); + base::Value::List* const handlers = + pref_value->GetDict().FindList(origin.Serialize()); // One or more apps are already associated with this origin. - if (handlers_mutable) { - base::Value::ListStorage handlers = - std::move(*handlers_mutable).TakeListDeprecated(); + if (handlers) { auto it = - std::find_if(handlers.begin(), handlers.end(), + std::find_if(handlers->begin(), handlers->end(), [&app_id, &profile_path](const base::Value& handler) { return IsHandlerForApp(app_id, profile_path, /*match_app_id=*/true, handler); }); // If there is already an entry with the same app_id and profile, replace // it. Otherwise, add new entry to the end. - if (it != handlers.end()) { + if (it != handlers->end()) { *it = std::move(new_handler); } else { - handlers.push_back(std::move(new_handler)); + handlers->Append(std::move(new_handler)); } - *handlers_mutable = base::Value(std::move(handlers)); } else { - base::Value new_handlers(base::Value::Type::LIST); + base::Value::List new_handlers; new_handlers.Append(std::move(new_handler)); - pref_value->SetKey(origin.Serialize(), std::move(new_handlers)); + pref_value->GetDict().Set(origin.Serialize(), std::move(new_handlers)); } } } @@ -773,14 +761,13 @@ std::vector<std::string> origins_to_remove; for (auto origin_value : pref_value->DictItems()) { const std::string& origin_str = origin_value.first; - base::Value::ListStorage curent_handlers = - std::move(origin_value.second).TakeListDeprecated(); + base::Value::List curent_handlers = + std::move(origin_value.second.GetList()); // Remove any existing handler values that were written previously for the // same app_id and profile but are no longer found in 'new_url_handlers'. - curent_handlers.erase( - base::ranges::remove_if( - curent_handlers, + curent_handlers + .EraseIf( // Returns true if 'current_handler' should be removed because it // was previously added for 'app_id' and 'profile_path' but is no // longer found in 'new_url_handlers' from the update. @@ -829,8 +816,7 @@ new_url_handlers.erase(same_origin_it); return false; - }), - curent_handlers.end()); + }); // Replace list if it contains entries or remove its origin key from prefs. if (!curent_handlers.empty()) {
diff --git a/chrome/browser/web_applications/web_app_install_manager.cc b/chrome/browser/web_applications/web_app_install_manager.cc index 72f25e50..3f424a7 100644 --- a/chrome/browser/web_applications/web_app_install_manager.cc +++ b/chrome/browser/web_applications/web_app_install_manager.cc
@@ -407,7 +407,7 @@ return; WriteErrorLog(GetWebAppsRootDirectory(profile_), kWebAppInstallManagerName, - base::Value(*error_log_), + base::Value(error_log_->Clone()), base::BindOnce(&WebAppInstallManager::OnWriteErrorLog, weak_ptr_factory_.GetWeakPtr())); @@ -427,19 +427,20 @@ return; ErrorLog early_error_log = std::move(*error_log_); - *error_log_ = std::move(error_log).TakeListDeprecated(); + *error_log_ = std::move(error_log.GetList()); // Appends the `early_error_log` at the end. - error_log_->insert(error_log_->end(), - std::make_move_iterator(early_error_log.begin()), - std::make_move_iterator(early_error_log.end())); + error_log_->reserve(error_log_->size() + early_error_log.size()); + for (auto& error : early_error_log) { + error_log_->Append(std::move(error)); + } } void WebAppInstallManager::LogErrorObject(base::Value object) { if (!error_log_) return; - error_log_->push_back(std::move(object)); + error_log_->Append(std::move(object)); error_log_updated_ = true; MaybeWriteErrorLog(); }
diff --git a/chrome/browser/web_applications/web_app_install_manager.h b/chrome/browser/web_applications/web_app_install_manager.h index c19eaba4..a942d51d 100644 --- a/chrome/browser/web_applications/web_app_install_manager.h +++ b/chrome/browser/web_applications/web_app_install_manager.h
@@ -101,7 +101,7 @@ // Collects icon read/write errors (unbounded) if the |kRecordWebAppDebugInfo| // flag is enabled to be used by: chrome://web-app-internals - using ErrorLog = base::Value::ListStorage; + using ErrorLog = base::Value::List; const ErrorLog* error_log() const { return error_log_.get(); } using DataRetrieverFactory =
diff --git a/chrome/browser/web_applications/web_app_internals_browsertest.cc b/chrome/browser/web_applications/web_app_internals_browsertest.cc index 247626e..460f145 100644 --- a/chrome/browser/web_applications/web_app_internals_browsertest.cc +++ b/chrome/browser/web_applications/web_app_internals_browsertest.cc
@@ -164,7 +164,7 @@ ASSERT_EQ(1u, GetProvider().install_manager().error_log()->size()); const base::Value& error_log = - GetProvider().install_manager().error_log()->at(0); + (*GetProvider().install_manager().error_log())[0]; EXPECT_EQ(4u, error_log.DictSize()); @@ -181,7 +181,7 @@ ASSERT_EQ(1u, GetProvider().install_manager().error_log()->size()); const base::Value& error_log = - GetProvider().install_manager().error_log()->at(0); + (*GetProvider().install_manager().error_log())[0]; EXPECT_EQ(4u, error_log.DictSize());
diff --git a/chrome/browser/web_applications/web_app_registrar.h b/chrome/browser/web_applications/web_app_registrar.h index 6bb73c5..65b498f7 100644 --- a/chrome/browser/web_applications/web_app_registrar.h +++ b/chrome/browser/web_applications/web_app_registrar.h
@@ -89,8 +89,6 @@ // Returns whether the app is currently being uninstalled. This will be true // after uninstall has begun but before the OS integration hooks for uninstall // have completed. It will return false after uninstallation has completed. - // Note that the underlying field this checks is not yet persisted to the - // database; see https://crbug.com/1162477 bool IsUninstalling(const AppId& app_id) const; // Returns whether the app with |app_id| is currently fully locally installed.
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 9005b2a..2d158cb 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1655985325-0ad3877c848458f35d30e37c9a14c369fbd726b0.profdata +chrome-linux-main-1656006882-770b4812ac51fc810aa4a754075de80aeb003049.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index d76b445..58a183cd 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1655985325-6f6182935a953f45cbec3f1793a60e78db167f25.profdata +chrome-mac-arm-main-1656006882-ca562aed5dc993c28f1fa17dff9d9663dcd827f6.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index c59be6a..738f1b4 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1655985325-c0392975b86ed798389ed2bbf42ade1304080f78.profdata +chrome-mac-main-1656006882-22bc251c36b8eea2cd35419eeae183790cc056fa.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index b292b26..1b8e2d98 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1655963931-d840b259996e03c76aa9f55097006e49466d872b.profdata +chrome-win32-main-1655996214-7aa4a369d12fc0d08c51e088b712d7b3563322ed.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index b66ef5d..3492b74 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1655985325-9941b52a138cb7c20452f6004f98be84dd27b30b.profdata +chrome-win64-main-1656006882-048b87c1bd945b18109948ad217dfe049d5905e7.profdata
diff --git a/chrome/child/pdf_child_init.cc b/chrome/child/pdf_child_init.cc index e53cfc6..8e0d726 100644 --- a/chrome/child/pdf_child_init.cc +++ b/chrome/child/pdf_child_init.cc
@@ -14,6 +14,7 @@ #include "base/win/windows_version.h" #include "content/public/child/child_thread.h" #include "content/public/common/content_switches.h" +#include "ppapi/buildflags/buildflags.h" #include "sandbox/policy/mojom/sandbox.mojom.h" #include "sandbox/policy/sandbox_type.h" #include "sandbox/policy/switches.h" @@ -57,7 +58,9 @@ auto service_sandbox_type = sandbox::policy::SandboxTypeFromCommandLine(command_line); bool need_gdi = +#if BUILDFLAG(ENABLE_PLUGINS) service_sandbox_type == sandbox::mojom::Sandbox::kPpapi || +#endif service_sandbox_type == sandbox::mojom::Sandbox::kPrintCompositor || service_sandbox_type == sandbox::mojom::Sandbox::kPdfConversion || (service_sandbox_type == sandbox::mojom::Sandbox::kRenderer &&
diff --git a/chrome/common/extensions/api/autotest_private.idl b/chrome/common/extensions/api/autotest_private.idl index b430095..fbb886dc 100644 --- a/chrome/common/extensions/api/autotest_private.idl +++ b/chrome/common/extensions/api/autotest_private.idl
@@ -663,6 +663,29 @@ callback GetLoginEventRecorderLoginEventsCallback = void (LoginEventRecorderData[] data); + // Request parameters for <code>getAccessToken</code>. + dictionary GetAccessTokenParams { + // An email associated with the account to get a token for. + DOMString email; + // A list of OAuth scopes to request. + DOMString[] scopes; + // An optional timeout in milliseconds for the request. + // Default: 90 seconds + long? timeoutMs; + }; + + // Response data for <code>getAccessToken</code>. + dictionary GetAccessTokenData { + // The access token + DOMString accessToken; + // The time the access token will expire as a unix timestamp in + // milliseconds. + DOMString expirationTimeUnixMs; + }; + + // Reponse callback for <code>getAccessToken</code>. + callback GetAccessTokenCallback = void(GetAccessTokenData data); + interface Functions { // Must be called to allow autotestPrivateAPI events to be fired. static void initializeEvents(); @@ -1335,6 +1358,11 @@ // Force auto theme mode in dark mode or light mode for testing. [supportsPromises] static void forceAutoThemeMode(boolean darkModeEnabled, VoidCallback callback); + + // Fetches an access token from Chrome. + [supportsPromises] static void getAccessToken( + GetAccessTokenParams accessTokenParams, + GetAccessTokenCallback callback); }; interface Events {
diff --git a/chrome/services/sharing/nearby/platform/wifi_lan_medium.cc b/chrome/services/sharing/nearby/platform/wifi_lan_medium.cc index c773054..acf39ea 100644 --- a/chrome/services/sharing/nearby/platform/wifi_lan_medium.cc +++ b/chrome/services/sharing/nearby/platform/wifi_lan_medium.cc
@@ -98,6 +98,15 @@ shutdown_waitable_event.Wait(); } +bool WifiLanMedium::IsNetworkConnected() const { + // This is not used by ChromeOS. A virtual function was created in the base + // class to support Windows, so this implementation only exists to override + // that function. This may be implemented correctly at a later date if + // Wi-Fi LAN would need similar functionality. + // Context: cl/452402734 + return true; +} + /*============================================================================*/ // Begin: ConnectToService() /*============================================================================*/
diff --git a/chrome/services/sharing/nearby/platform/wifi_lan_medium.h b/chrome/services/sharing/nearby/platform/wifi_lan_medium.h index 527a8097..9d8a3f2 100644 --- a/chrome/services/sharing/nearby/platform/wifi_lan_medium.h +++ b/chrome/services/sharing/nearby/platform/wifi_lan_medium.h
@@ -61,6 +61,9 @@ WifiLanMedium& operator=(const WifiLanMedium&) = delete; ~WifiLanMedium() override; + // Check if a network connection to a primary router exist. + bool IsNetworkConnected() const override; + // api::WifiLanMedium: std::unique_ptr<api::WifiLanSocket> ConnectToService( const NsdServiceInfo& remote_service_info,
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index ca236e5..89fbc64 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -9044,6 +9044,7 @@ "../browser/ui/views/extensions/extensions_tabbed_menu_view_interactive_uitest.cc", "../browser/ui/views/page_info/page_info_bubble_view_interactive_uitest.cc", "../browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view_interactive_ui_test.cc", + "../browser/ui/views/privacy_sandbox/privacy_sandbox_notice_bubble_interactive_ui_test.cc", "../browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_interactive_uitest.cc", "../browser/ui/views/web_dialog_view_browsertest.cc", "../browser/ui/webui/settings/settings_interactive_uitest.cc", @@ -9126,6 +9127,8 @@ "//components/media_message_center", "//components/media_router/browser:test_support", "//components/metrics:content", + "//components/privacy_sandbox:privacy_sandbox", + "//components/privacy_sandbox:privacy_sandbox_prefs", "//components/reading_list/core", "//components/reading_list/features:flags", "//components/renderer_context_menu",
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc index 9c4f5d5..ed06c3e 100644 --- a/chrome/test/base/in_process_browser_test.cc +++ b/chrome/test/base/in_process_browser_test.cc
@@ -448,10 +448,6 @@ // Disable the notification delay timer used to prevent non system // notifications from showing up right after login. ash::ShellTestApi::SetUseLoginNotificationDelayForTest(false); - - // Don't show the new shortcuts notification at startup. - ash::ShellTestApi::SetShouldShowShortcutNotificationForTest(false); - #endif // BUILDFLAG(IS_CHROMEOS_ASH) // Redirect the default download directory to a temporary directory.
diff --git a/chrome/test/data/webui/settings/chromeos/switch_access_subpage_tests.js b/chrome/test/data/webui/settings/chromeos/switch_access_subpage_tests.js index dd91093b..16e40d08 100644 --- a/chrome/test/data/webui/settings/chromeos/switch_access_subpage_tests.js +++ b/chrome/test/data/webui/settings/chromeos/switch_access_subpage_tests.js
@@ -48,7 +48,7 @@ } } -suite('ManageAccessibilityPageTests', function() { +suite('SwitchAccessSubpageTests', function() { let page = null; let browserProxy = null;
diff --git a/chrome/updater/check_for_updates_task.cc b/chrome/updater/check_for_updates_task.cc index 8dee326..3881801 100644 --- a/chrome/updater/check_for_updates_task.cc +++ b/chrome/updater/check_for_updates_task.cc
@@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/logging.h" #include "base/memory/scoped_refptr.h" +#include "base/rand_util.h" #include "base/sequence_checker.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/time/time.h" @@ -28,9 +29,12 @@ bool ShouldSkipCheck(scoped_refptr<Configurator> config, scoped_refptr<updater::PersistedData> persisted_data) { + // To spread out synchronized load, sometimes use a higher delay. + const base::TimeDelta check_delay = base::Seconds( + config->NextCheckDelay() * (base::RandDouble() < 0.1 ? 1.2 : 1)); + // Skip if periodic updates are disabled altogether. - const int check_delay_seconds = config->NextCheckDelay(); - if (check_delay_seconds == 0) { + if (check_delay.is_zero()) { VLOG(0) << "Skipping checking for updates: NextCheckDelay is 0."; return true; } @@ -38,8 +42,7 @@ // Skip if the most recent check was too recent (and not in the future). const base::TimeDelta time_since_update = base::Time::NowFromSystemTime() - persisted_data->GetLastChecked(); - if (base::TimeDelta() < time_since_update && - time_since_update < base::Seconds(check_delay_seconds)) { + if (time_since_update.is_positive() && time_since_update < check_delay) { VLOG(0) << "Skipping checking for updates: last update was " << time_since_update.InMinutes() << " minutes ago."; return true;
diff --git a/chrome/updater/configurator.cc b/chrome/updater/configurator.cc index 19dac39b..0b9d152 100644 --- a/chrome/updater/configurator.cc +++ b/chrome/updater/configurator.cc
@@ -80,7 +80,7 @@ int minutes = 0; return policy_service_->GetLastCheckPeriodMinutes(nullptr, &minutes) ? minutes * kDelayOneMinute - : 5 * kDelayOneHour; + : 4 * kDelayOneHour + 30 * kDelayOneMinute; } int Configurator::OnDemandDelay() const {
diff --git a/chrome/updater/win/ui/resources/BUILD.gn b/chrome/updater/win/ui/resources/BUILD.gn index 8d2854a..51f134b 100644 --- a/chrome/updater/win/ui/resources/BUILD.gn +++ b/chrome/updater/win/ui/resources/BUILD.gn
@@ -20,12 +20,14 @@ visibility = [ ":strings" ] extractor_datafile = "//chrome/updater/win/ui/resources/create_metainstaller_string_rc.py" - grdfile_folder = "//chrome/app/" - # TODO(crbug.com/1316513) - Implement strings into google_chrome_strings.grd - # and use the filename here for is_chrome_branded. - grdfile_name = "chromium_strings" + if (is_chrome_branded) { + grdfile_name = "google_chrome_strings" + } else { + grdfile_name = "chromium_strings" + } + xtb_relative_path = "resources" grd_files_info = [ [ grdfile_folder,
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index 0f1c655..9cc3c2b 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -14929.0.0 \ No newline at end of file +14933.0.0 \ No newline at end of file
diff --git a/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker.h b/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker.h index 66927dd..6ba252e9 100644 --- a/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker.h +++ b/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker.h
@@ -50,6 +50,8 @@ // // If the caller paused a connection previously, the connection to the // source device will resume via OnConnectionAccepted(). + // Clients should check GetFeatureSupportStatus() before calling + // StartAdvertising(). virtual void StartAdvertising( ConnectionLifecycleListener* listener, ResultCallback on_start_advertising_callback) = 0;
diff --git a/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl.cc b/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl.cc index 96eda672..aa5fbee 100644 --- a/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl.cc +++ b/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl.cc
@@ -6,8 +6,11 @@ #include <memory> +#include "base/bind.h" #include "base/callback.h" +#include "base/logging.h" #include "base/threading/sequenced_task_runner_handle.h" +#include "chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser.h" #include "device/bluetooth/bluetooth_adapter.h" #include "device/bluetooth/bluetooth_adapter_factory.h" @@ -58,13 +61,39 @@ void TargetDeviceConnectionBrokerImpl::StartAdvertising( ConnectionLifecycleListener* listener, ResultCallback on_start_advertising_callback) { - // TODO(b/234655072): Implement StartAdvertising - std::move(on_start_advertising_callback).Run(true); + // TODO(b/234655072): Notify client about incoming connections on the started + // advertisement via ConnectionLifecycleListener. + CHECK(GetFeatureSupportStatus() == FeatureSupportStatus::kSupported); + + if (!bluetooth_adapter_->IsPowered()) { + LOG(ERROR) << __func__ + << " failed to start advertising because the bluetooth adapter " + "is not powered."; + std::move(on_start_advertising_callback).Run(/*success=*/false); + return; + } + + fast_pair_advertiser_ = + FastPairAdvertiser::Factory::Create(bluetooth_adapter_); + auto [success_callback, failure_callback] = + base::SplitOnceCallback(std::move(on_start_advertising_callback)); + + fast_pair_advertiser_->StartAdvertising( + base::BindOnce(std::move(success_callback), /*success=*/true), + base::BindOnce( + &TargetDeviceConnectionBrokerImpl::OnStartFastPairAdvertisingError, + weak_ptr_factory_.GetWeakPtr(), std::move(failure_callback))); +} + +void TargetDeviceConnectionBrokerImpl::OnStartFastPairAdvertisingError( + ResultCallback callback) { + fast_pair_advertiser_.reset(); + std::move(callback).Run(/*success=*/false); } void TargetDeviceConnectionBrokerImpl::StopAdvertising( ResultCallback on_stop_advertising_callback) { - // TODO(b/234655072): Implement StopAdvertising + fast_pair_advertiser_.reset(); std::move(on_stop_advertising_callback).Run(true); }
diff --git a/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl.h b/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl.h index 13d3b27a..edf6dfb 100644 --- a/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl.h +++ b/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl.h
@@ -8,6 +8,8 @@ #include "base/memory/weak_ptr.h" #include "chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker.h" +class FastPairAdvertiser; + namespace device { class BluetoothAdapter; } @@ -35,9 +37,12 @@ private: void GetBluetoothAdapter(); void OnGetBluetoothAdapter(scoped_refptr<device::BluetoothAdapter> adapter); + void OnStartFastPairAdvertisingError(ResultCallback callback); scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_; + std::unique_ptr<FastPairAdvertiser> fast_pair_advertiser_; + base::WeakPtrFactory<TargetDeviceConnectionBrokerImpl> weak_ptr_factory_{ this}; };
diff --git a/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl_unittest.cc b/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl_unittest.cc index 564339d7..eb5ac98 100644 --- a/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl_unittest.cc +++ b/chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl_unittest.cc
@@ -4,7 +4,9 @@ #include "chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_impl.h" +#include "base/bind.h" #include "base/test/task_environment.h" +#include "chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser.h" #include "chromeos/ash/components/oobe_quick_start/connectivity/target_device_connection_broker_factory.h" #include "device/bluetooth/bluetooth_adapter_factory.h" #include "device/bluetooth/test/mock_bluetooth_adapter.h" @@ -20,6 +22,73 @@ using TargetDeviceConnectionBrokerImpl = ash::quick_start::TargetDeviceConnectionBrokerImpl; +class FakeFastPairAdvertiser : public FastPairAdvertiser { + public: + explicit FakeFastPairAdvertiser( + scoped_refptr<device::BluetoothAdapter> adapter, + bool should_succeed_on_start, + base::OnceCallback<void()> on_destroy_callback) + : FastPairAdvertiser(adapter), + should_succeed_on_start_(should_succeed_on_start), + on_destroy_callback_(std::move(on_destroy_callback)) {} + + ~FakeFastPairAdvertiser() override { std::move(on_destroy_callback_).Run(); } + + void StartAdvertising(base::OnceCallback<void()> callback, + base::OnceCallback<void()> error_callback) override { + ++start_advertising_call_count_; + if (should_succeed_on_start_) + std::move(callback).Run(); + else + std::move(error_callback).Run(); + } + + size_t start_advertising_call_count() { + return start_advertising_call_count_; + } + + private: + bool should_succeed_on_start_; + size_t start_advertising_call_count_ = 0u; + base::OnceCallback<void()> on_destroy_callback_; +}; + +class FakeFastPairAdvertiserFactory : public FastPairAdvertiser::Factory { + public: + explicit FakeFastPairAdvertiserFactory(bool should_succeed_on_start) + : should_succeed_on_start_(should_succeed_on_start) {} + + std::unique_ptr<FastPairAdvertiser> CreateInstance( + scoped_refptr<device::BluetoothAdapter> adapter) override { + auto fake_fast_pair_advertiser = std::make_unique<FakeFastPairAdvertiser>( + adapter, should_succeed_on_start_, + base::BindOnce( + &FakeFastPairAdvertiserFactory::OnFastPairAdvertiserDestroyed, + weak_ptr_factory_.GetWeakPtr())); + last_fake_fast_pair_advertiser_ = fake_fast_pair_advertiser.get(); + return std::move(fake_fast_pair_advertiser); + } + + void OnFastPairAdvertiserDestroyed() { + fast_pair_advertiser_destroyed_ = true; + last_fake_fast_pair_advertiser_ = nullptr; + } + + size_t StartAdvertisingCount() { + return last_fake_fast_pair_advertiser_ + ? last_fake_fast_pair_advertiser_->start_advertising_call_count() + : 0; + } + + bool AdvertiserDestroyed() { return fast_pair_advertiser_destroyed_; } + + private: + FakeFastPairAdvertiser* last_fake_fast_pair_advertiser_ = nullptr; + bool should_succeed_on_start_ = false; + bool fast_pair_advertiser_destroyed_ = false; + base::WeakPtrFactory<FakeFastPairAdvertiserFactory> weak_ptr_factory_{this}; +}; + } // namespace class TargetDeviceConnectionBrokerImplTest : public testing::Test { @@ -37,11 +106,14 @@ ON_CALL(*mock_bluetooth_adapter_, IsPresent()) .WillByDefault(Invoke( this, &TargetDeviceConnectionBrokerImplTest::IsBluetoothPresent)); + ON_CALL(*mock_bluetooth_adapter_, IsPowered()) + .WillByDefault(Invoke( + this, &TargetDeviceConnectionBrokerImplTest::IsBluetoothPowered)); device::BluetoothAdapterFactory::SetAdapterForTesting( mock_bluetooth_adapter_); CreateConnectionBroker(); - + SetFakeFastPairAdvertiserFactory(/*should_succeed_on_start=*/true); // Allow the Bluetooth adapter to be fetched. base::RunLoop().RunUntilIdle(); } @@ -51,15 +123,42 @@ ash::quick_start::TargetDeviceConnectionBrokerFactory::Create(); } + bool IsBluetoothPowered() { return is_bluetooth_powered_; } + bool IsBluetoothPresent() { return is_bluetooth_present_; } + void SetBluetoothIsPowered(bool powered) { is_bluetooth_powered_ = powered; } + void SetBluetoothIsPresent(bool present) { is_bluetooth_present_ = present; } + void SetFakeFastPairAdvertiserFactory(bool should_succeed_on_start) { + fast_pair_advertiser_factory_ = + std::make_unique<FakeFastPairAdvertiserFactory>( + should_succeed_on_start); + FastPairAdvertiser::Factory::SetFactoryForTesting( + fast_pair_advertiser_factory_.get()); + } + + void AdvertisingResultCallback(bool success) { + advertising_callback_called_ = true; + if (success) { + advertising_callback_success_ = true; + return; + } + advertising_callback_success_ = false; + } + protected: + bool is_bluetooth_powered_ = true; bool is_bluetooth_present_ = true; + bool advertising_callback_called_ = false; + bool advertising_callback_success_ = true; scoped_refptr<NiceMock<device::MockBluetoothAdapter>> mock_bluetooth_adapter_; std::unique_ptr<TargetDeviceConnectionBroker> connection_broker_; + std::unique_ptr<FakeFastPairAdvertiserFactory> fast_pair_advertiser_factory_; base::test::SingleThreadTaskEnvironment task_environment_; + base::WeakPtrFactory<TargetDeviceConnectionBrokerImplTest> weak_ptr_factory_{ + this}; }; TEST_F(TargetDeviceConnectionBrokerImplTest, GetFeatureSupportStatus) { @@ -72,3 +171,46 @@ EXPECT_EQ(TargetDeviceConnectionBrokerImpl::FeatureSupportStatus::kSupported, connection_broker_->GetFeatureSupportStatus()); } + +TEST_F(TargetDeviceConnectionBrokerImplTest, StartFastPairAdvertising) { + EXPECT_EQ(0u, fast_pair_advertiser_factory_->StartAdvertisingCount()); + + connection_broker_->StartAdvertising( + nullptr, + base::BindOnce( + &TargetDeviceConnectionBrokerImplTest::AdvertisingResultCallback, + weak_ptr_factory_.GetWeakPtr())); + EXPECT_EQ(1u, fast_pair_advertiser_factory_->StartAdvertisingCount()); + EXPECT_TRUE(advertising_callback_called_); + EXPECT_TRUE(advertising_callback_success_); +} + +TEST_F(TargetDeviceConnectionBrokerImplTest, + StartFastPairAdvertisingError_BluetoothNotPowered) { + SetBluetoothIsPowered(false); + EXPECT_EQ(0u, fast_pair_advertiser_factory_->StartAdvertisingCount()); + + connection_broker_->StartAdvertising( + nullptr, + base::BindOnce( + &TargetDeviceConnectionBrokerImplTest::AdvertisingResultCallback, + weak_ptr_factory_.GetWeakPtr())); + EXPECT_EQ(0u, fast_pair_advertiser_factory_->StartAdvertisingCount()); + EXPECT_TRUE(advertising_callback_called_); + EXPECT_FALSE(advertising_callback_success_); +} + +TEST_F(TargetDeviceConnectionBrokerImplTest, + StartFastPairAdvertisingError_Unsuccessful) { + SetFakeFastPairAdvertiserFactory(/*should_succeed_on_start=*/false); + EXPECT_EQ(0u, fast_pair_advertiser_factory_->StartAdvertisingCount()); + + connection_broker_->StartAdvertising( + nullptr, + base::BindOnce( + &TargetDeviceConnectionBrokerImplTest::AdvertisingResultCallback, + weak_ptr_factory_.GetWeakPtr())); + EXPECT_TRUE(advertising_callback_called_); + EXPECT_FALSE(advertising_callback_success_); + EXPECT_TRUE(fast_pair_advertiser_factory_->AdvertiserDestroyed()); +}
diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmarks/browser/bookmark_model.cc index 7b947f0..e16531f 100644 --- a/components/bookmarks/browser/bookmark_model.cc +++ b/components/bookmarks/browser/bookmark_model.cc
@@ -326,6 +326,11 @@ observer.BookmarkNodeMoved(this, old_parent, old_index, new_parent, index); } +void BookmarkModel::UpdateLastUsedTime(const BookmarkNode* node, + base::Time time) { + // TODO(crbug.com/1320950): Use this hook to update the relevant field. +} + void BookmarkModel::Copy(const BookmarkNode* node, const BookmarkNode* new_parent, size_t index) {
diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmarks/browser/bookmark_model.h index ef48bc6..6117be3c 100644 --- a/components/bookmarks/browser/bookmark_model.h +++ b/components/bookmarks/browser/bookmark_model.h
@@ -263,6 +263,9 @@ // combobox of most recently modified folders. void ResetDateFolderModified(const BookmarkNode* node); + // Updates the last used `time` for the given `id` / `url`. + void UpdateLastUsedTime(const BookmarkNode* node, base::Time time); + // Returns up to |max_count| bookmarks containing each term from |query| in // either the title, URL, or, if |match_ancestor_titles| is true, the titles // of ancestors. |matching_algorithm| determines the algorithm used by
diff --git a/components/commerce/core/BUILD.gn b/components/commerce/core/BUILD.gn index 9318dd5..ea9ebd2b 100644 --- a/components/commerce/core/BUILD.gn +++ b/components/commerce/core/BUILD.gn
@@ -74,6 +74,11 @@ proto_path = "." sources = [ "proto/price_tracking.proto" ] } + + proto_library("merchant_signal_db_proto") { + proto_in_dir = "//" + sources = [ "proto/merchant_signal_db_content.proto" ] + } } source_set("commerce_heuristics_data") {
diff --git a/chrome/browser/commerce/merchant_viewer/merchant_signal_db_content.proto b/components/commerce/core/proto/merchant_signal_db_content.proto similarity index 100% rename from chrome/browser/commerce/merchant_viewer/merchant_signal_db_content.proto rename to components/commerce/core/proto/merchant_signal_db_content.proto
diff --git a/components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc b/components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc index 63e90c8..20d3b98 100644 --- a/components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc +++ b/components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc
@@ -14,6 +14,7 @@ #include "base/notreached.h" #include "base/observer_list.h" #include "base/path_service.h" +#include "base/strings/strcat.h" #include "base/task/thread_pool.h" #include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" @@ -278,7 +279,7 @@ DVLOG(1) << "Browser unenrollment: Attempting DMToken deletion"; BrowserDMTokenStorage::Get()->ClearDMToken(base::BindOnce( &ChromeBrowserCloudManagementController::UnenrollCallback, - weak_factory_.GetWeakPtr())); + weak_factory_.GetWeakPtr(), "DMTokenDeletion")); return; } @@ -286,7 +287,7 @@ DVLOG(1) << "Browser unenrollment: Attempting DMToken invalidation"; BrowserDMTokenStorage::Get()->InvalidateDMToken( base::BindOnce(&ChromeBrowserCloudManagementController::UnenrollCallback, - weak_factory_.GetWeakPtr())); + weak_factory_.GetWeakPtr(), "UnenrollSuccess")); } void ChromeBrowserCloudManagementController::InvalidatePolicies() { @@ -302,11 +303,14 @@ report_scheduler_->OnDMTokenUpdated(); } -void ChromeBrowserCloudManagementController::UnenrollCallback(bool success) { +void ChromeBrowserCloudManagementController::UnenrollCallback( + const std::string& metric_name, + bool success) { UMA_HISTOGRAM_BOOLEAN( - "Enterprise.MachineLevelUserCloudPolicyEnrollment.UnenrollSuccess", + base::StrCat( + {"Enterprise.MachineLevelUserCloudPolicyEnrollment.", metric_name}), success); - DVLOG(1) << "Browser unenrollment: " << (success ? "Successful" : "Failed"); + DVLOG(1) << "Browser unenrollment: " << (success ? "succeeded" : "failed"); if (success) InvalidatePolicies();
diff --git a/components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h b/components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h index 38d474aa..28ef339 100644 --- a/components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h +++ b/components/enterprise/browser/controller/chrome_browser_cloud_management_controller.h
@@ -268,7 +268,7 @@ const std::string& client_id); void InvalidatePolicies(); - void UnenrollCallback(bool success); + void UnenrollCallback(const std::string& metric_name, bool success); void CreateReportScheduler();
diff --git a/components/exo/wayland/protocol/README.md b/components/exo/wayland/protocol/README.md new file mode 100644 index 0000000..5c32847 --- /dev/null +++ b/components/exo/wayland/protocol/README.md
@@ -0,0 +1,18 @@ +This directory contains exo-specific extensions to the Wayland protocol. + +To begin with, we recommend this +[link](https://wayland-book.com/xdg-shell-basics/xdg-surface.html) for more +about wayland basics. The short summary is that: +* wl_surface is the compositing window primitive. It is capable of receiving a + series of buffers representing contents. It only provides basic functionality. + Other functionality like pip/decorations are implemented through extensions. +* It is possible to extend a wl_surface as xdg_surface via + xdg_wm_base.get_surface. This extension is not permanent: it is possible to + destroy and/or recreate the xdg_surface. +* Once an xdg_surface is created, it can be assigned a role: xdg_toplevel or + xdg_popup. +* exo has extensions for each of these primitives that implement aura shell + (ash) specific functionalities: + * wl_surface is extended by zaura_surface + * xdg_toplevel is extended by zaura_toplevel + * xdg_popup is extended by zaura_popup
diff --git a/components/exo/wayland/protocol/aura-shell.xml b/components/exo/wayland/protocol/aura-shell.xml index cdfad46..d621134 100644 --- a/components/exo/wayland/protocol/aura-shell.xml +++ b/components/exo/wayland/protocol/aura-shell.xml
@@ -24,7 +24,7 @@ DEALINGS IN THE SOFTWARE. </copyright> - <interface name="zaura_shell" version="34"> + <interface name="zaura_shell" version="35"> <description summary="aura_shell"> The global interface exposing aura shell capabilities is used to instantiate an interface extension for a wl_surface object. @@ -165,7 +165,9 @@ <request name="set_frame"> <description summary="request a frame for surface"> - Suggests a surface should use a specific frame. + [Deprecated] Suggests a surface should use a specific frame. Deprecated + since M105. See the set_decoration method on zaura_toplevel and + zaura_popup. </description> <arg name="type" type="uint" summary="the new frame type"/> </request> @@ -647,7 +649,7 @@ </event> </interface> - <interface name="zaura_toplevel" version="32"> + <interface name="zaura_toplevel" version="35"> <description summary="aura shell interface to the toplevel shell"> An interface to the toplevel shell, which allows the client to access shell specific functionality. @@ -743,7 +745,7 @@ <arg name="restore_session_id" type="int" summary="unique browser session id"/> <arg name="restore_window_id" type="int" summary="restore browser window id"/> </request> - + <request name="set_system_modal" since="31"> <description summary="make window a system modal"> Requests that the toplevel surface should become a system modal. The @@ -767,9 +769,27 @@ <arg name="restore_session_id" type="int" summary="unique browser session id"/> <arg name="restore_window_id_source" type="string" summary="restore window id source"/> </request> + + <request name="set_decoration" since="35"> + <description summary="request a decoration for surface"> + Clients are allowed to request a particular decoration for a + zaura_toplevel. The server is not required to honor this request. See + decoration_type for available options. Available since M105. + </description> + <arg name="type" type="uint" summary="the new frame type"/> + </request> + + <enum name="decoration_type"> + <description summary="different decoration types"> + Decoration types are used to modify the surface (e.g. drop shadow). + </description> + <entry name="none" value="0" summary="no frame"/> + <entry name="normal" value="1" summary="caption with shadow"/> + <entry name="shadow" value="2" summary="shadow only"/> + </enum> </interface> - <interface name="zaura_popup" version="28"> + <interface name="zaura_popup" version="35"> <description summary="aura shell interface to the popup shell"> An interface to the popup shell, which allows the client to access shell specific functionality. @@ -783,5 +803,23 @@ scale transform for the submitted buffers to be composited correctly. </description> </request> + + <request name="set_decoration" since="35"> + <description summary="request a decoration for surface"> + Clients are allowed to request a particular decoration for a + zaura_toplevel. The server is not required to honor this request. See + decoration_type for available options. Available since M105. + </description> + <arg name="type" type="uint" summary="the new frame type"/> + </request> + + <enum name="decoration_type"> + <description summary="different decoration types"> + Decoration types are used to modify the surface (e.g. drop shadow). + </description> + <entry name="none" value="0" summary="no frame"/> + <entry name="normal" value="1" summary="caption with shadow"/> + <entry name="shadow" value="2" summary="shadow only"/> + </enum> </interface> </protocol>
diff --git a/components/exo/wayland/weston_test.cc b/components/exo/wayland/weston_test.cc index d147205..d97a1b72 100644 --- a/components/exo/wayland/weston_test.cc +++ b/components/exo/wayland/weston_test.cc
@@ -69,6 +69,17 @@ constexpr uint32_t kWestonTestVersion = 1; +int WaylandToUIControlsTouchType(int type) { + switch (type) { + case WL_TOUCH_DOWN: + return ui_controls::PRESS; + case WL_TOUCH_UP: + return ui_controls::RELEASE; + default: + return ui_controls::MOVE; + } +} + static void weston_test_move_surface(struct wl_client* client, struct wl_resource* resource, struct wl_resource* surface_resource, @@ -104,7 +115,8 @@ } // TODO(https://crbug.com/1284726): This should not be necessary. - weston_test_send_pointer_position(resource, x, y); + weston_test_send_pointer_position(resource, wl_fixed_from_int(x), + wl_fixed_from_int(y)); } static void weston_test_send_button(struct wl_client* client, @@ -297,7 +309,20 @@ wl_fixed_t x, wl_fixed_t y, uint32_t touch_type) { - NOTIMPLEMENTED(); + auto* weston_test = GetUserDataAs<WestonTestState>(resource); + + base::RunLoop run_loop; + ui_controls::SendTouchEventsNotifyWhenDone( + WaylandToUIControlsTouchType(touch_type), touch_id, wl_fixed_to_int(x), + wl_fixed_to_int(y), run_loop.QuitClosure()); + { + // Do not process incoming wayland events which may destroy resources. + ScopedEventDispatchDisabler disable(weston_test->server); + run_loop.Run(); + } + + // TODO(https://crbug.com/1284726): This should not be necessary. + weston_test_send_touch_received(resource, x, y); } const struct weston_test_interface weston_test_implementation = {
diff --git a/components/exo/wayland/zaura_shell.cc b/components/exo/wayland/zaura_shell.cc index 1ae22aa..1bbfa83c 100644 --- a/components/exo/wayland/zaura_shell.cc +++ b/components/exo/wayland/zaura_shell.cc
@@ -723,6 +723,10 @@ wl_client_flush(wl_resource_get_client(aura_toplevel_resource_)); } +void AuraToplevel::SetDecoration(SurfaceFrameType type) { + shell_surface_->OnSetFrame(type); +} + void AuraToplevel::SetClientUsesScreenCoordinates() { supports_window_bounds_ = true; shell_surface_->set_client_supports_window_bounds(true); @@ -780,6 +784,10 @@ shell_surface_->set_client_submits_surfaces_in_pixel_coordinates(enable); } +void AuraPopup::SetDecoration(SurfaceFrameType type) { + shell_surface_->OnSetFrame(type); +} + #endif // BUILDFLAG(IS_CHROMEOS_ASH) //////////////////////////////////////////////////////////////////////////////// @@ -1104,6 +1112,27 @@ restore_session_id, restore_window_id_source); } +SurfaceFrameType AuraTopLevelDecorationType(uint32_t decoration_type) { + switch (decoration_type) { + case ZAURA_TOPLEVEL_DECORATION_TYPE_NONE: + return SurfaceFrameType::NONE; + case ZAURA_TOPLEVEL_DECORATION_TYPE_NORMAL: + return SurfaceFrameType::NORMAL; + case ZAURA_TOPLEVEL_DECORATION_TYPE_SHADOW: + return SurfaceFrameType::SHADOW; + default: + VLOG(2) << "Unknown aura-toplevel decoration type: " << decoration_type; + return SurfaceFrameType::NONE; + } +} + +void aura_toplevel_set_decoration(wl_client* client, + wl_resource* resource, + uint32_t type) { + GetUserDataAs<AuraToplevel>(resource)->SetDecoration( + AuraTopLevelDecorationType(type)); +} + const struct zaura_toplevel_interface aura_toplevel_implementation = { aura_toplevel_set_orientation_lock, aura_toplevel_surface_submission_in_pixel_coordinates, @@ -1113,6 +1142,7 @@ aura_toplevel_set_system_modal, aura_toplevel_unset_system_modal, aura_toplevel_set_restore_info_with_window_id_source, + aura_toplevel_set_decoration, }; void aura_popup_surface_submission_in_pixel_coordinates(wl_client* client, @@ -1121,8 +1151,30 @@ ->SetClientSubmitsSurfacesInPixelCoordinates(true); } +SurfaceFrameType AuraPopupDecorationType(uint32_t decoration_type) { + switch (decoration_type) { + case ZAURA_POPUP_DECORATION_TYPE_NONE: + return SurfaceFrameType::NONE; + case ZAURA_POPUP_DECORATION_TYPE_NORMAL: + return SurfaceFrameType::NORMAL; + case ZAURA_POPUP_DECORATION_TYPE_SHADOW: + return SurfaceFrameType::SHADOW; + default: + VLOG(2) << "Unknown aura-popup decoration type: " << decoration_type; + return SurfaceFrameType::NONE; + } +} + +void aura_popup_set_decoration(wl_client* client, + wl_resource* resource, + uint32_t type) { + GetUserDataAs<AuraPopup>(resource)->SetDecoration( + AuraPopupDecorationType(type)); +} + const struct zaura_popup_interface aura_popup_implementation = { aura_popup_surface_submission_in_pixel_coordinates, + aura_popup_set_decoration, }; void aura_shell_get_aura_toplevel(wl_client* client,
diff --git a/components/exo/wayland/zaura_shell.h b/components/exo/wayland/zaura_shell.h index dd49ec25..f1cab973 100644 --- a/components/exo/wayland/zaura_shell.h +++ b/components/exo/wayland/zaura_shell.h
@@ -130,6 +130,7 @@ bool resizing, bool activated); virtual void OnOriginChange(const gfx::Point& origin); + void SetDecoration(SurfaceFrameType type); ShellSurface* shell_surface_; SerialTracker* const serial_tracker_; @@ -148,6 +149,7 @@ ~AuraPopup(); void SetClientSubmitsSurfacesInPixelCoordinates(bool enable); + void SetDecoration(SurfaceFrameType type); private: ShellSurfaceBase* shell_surface_;
diff --git a/components/history/core/browser/history_client.h b/components/history/core/browser/history_client.h index 357b476..e212f694 100644 --- a/components/history/core/browser/history_client.h +++ b/components/history/core/browser/history_client.h
@@ -7,6 +7,7 @@ #include <memory> +#include "base/time/time.h" #include "sql/init_status.h" class GURL; @@ -43,6 +44,10 @@ // Returns a new HistoryBackendClient instance. virtual std::unique_ptr<HistoryBackendClient> CreateBackendClient() = 0; + + // Update the last used `time` for the given bookmark node `id`. + virtual void UpdateBookmarkLastUsedTime(int64_t bookmark_node_id, + base::Time time) = 0; }; } // namespace history
diff --git a/components/history/core/browser/history_service.cc b/components/history/core/browser/history_service.cc index ce9cdaf..4bb717f6 100644 --- a/components/history/core/browser/history_service.cc +++ b/components/history/core/browser/history_service.cc
@@ -430,6 +430,13 @@ } } + // In extremely rare cases an in-flight clear history task posted to the UI + // thread could cause this last used time to be dropped. + if (add_page_args.bookmark_id.has_value()) { + history_client_->UpdateBookmarkLastUsedTime( + add_page_args.bookmark_id.value(), add_page_args.time); + } + ScheduleTask(PRIORITY_NORMAL, base::BindOnce(&HistoryBackend::AddPage, history_backend_, add_page_args));
diff --git a/components/history/core/browser/history_types.cc b/components/history/core/browser/history_types.cc index 36a1ea8..1751ca9 100644 --- a/components/history/core/browser/history_types.cc +++ b/components/history/core/browser/history_types.cc
@@ -278,6 +278,7 @@ true, false, absl::nullopt, + absl::nullopt, absl::nullopt) {} HistoryAddPageArgs::HistoryAddPageArgs(const GURL& url, @@ -293,7 +294,8 @@ bool consider_for_ntp_most_visited, bool floc_allowed, absl::optional<std::u16string> title, - absl::optional<Opener> opener) + absl::optional<Opener> opener, + absl::optional<int64_t> bookmark_id) : url(url), time(time), context_id(context_id), @@ -307,7 +309,8 @@ consider_for_ntp_most_visited(consider_for_ntp_most_visited), floc_allowed(floc_allowed), title(title), - opener(opener) {} + opener(opener), + bookmark_id(bookmark_id) {} HistoryAddPageArgs::HistoryAddPageArgs(const HistoryAddPageArgs& other) = default;
diff --git a/components/history/core/browser/history_types.h b/components/history/core/browser/history_types.h index faee96eb..85963b5f 100644 --- a/components/history/core/browser/history_types.h +++ b/components/history/core/browser/history_types.h
@@ -440,7 +440,8 @@ bool consider_for_ntp_most_visited, bool floc_allowed, absl::optional<std::u16string> title = absl::nullopt, - absl::optional<Opener> opener = absl::nullopt); + absl::optional<Opener> opener = absl::nullopt, + absl::optional<int64_t> bookmark_id = absl::nullopt); HistoryAddPageArgs(const HistoryAddPageArgs& other); ~HistoryAddPageArgs(); @@ -464,6 +465,7 @@ bool floc_allowed; absl::optional<std::u16string> title; absl::optional<Opener> opener; + absl::optional<int64_t> bookmark_id; }; // TopSites -------------------------------------------------------------------
diff --git a/components/history/core/test/history_client_fake_bookmarks.cc b/components/history/core/test/history_client_fake_bookmarks.cc index 8ad84ef..0e514c7 100644 --- a/components/history/core/test/history_client_fake_bookmarks.cc +++ b/components/history/core/test/history_client_fake_bookmarks.cc
@@ -8,6 +8,7 @@ #include <memory> #include "base/synchronization/lock.h" +#include "base/time/time.h" #include "build/build_config.h" #include "components/history/core/browser/history_backend_client.h" #include "url/gurl.h" @@ -165,4 +166,8 @@ return std::make_unique<HistoryBackendClientFakeBookmarks>(bookmarks_); } +void HistoryClientFakeBookmarks::UpdateBookmarkLastUsedTime( + int64_t bookmark_node_id, + base::Time time) {} + } // namespace history
diff --git a/components/history/core/test/history_client_fake_bookmarks.h b/components/history/core/test/history_client_fake_bookmarks.h index ad87481..ab41af0 100644 --- a/components/history/core/test/history_client_fake_bookmarks.h +++ b/components/history/core/test/history_client_fake_bookmarks.h
@@ -42,6 +42,8 @@ void NotifyProfileError(sql::InitStatus init_status, const std::string& diagnostics) override; std::unique_ptr<HistoryBackendClient> CreateBackendClient() override; + void UpdateBookmarkLastUsedTime(int64_t bookmark_node_id, + base::Time time) override; private: scoped_refptr<FakeBookmarkDatabase> bookmarks_;
diff --git a/components/metrics/clean_exit_beacon.cc b/components/metrics/clean_exit_beacon.cc index 6cdf9a133..13933d0 100644 --- a/components/metrics/clean_exit_beacon.cc +++ b/components/metrics/clean_exit_beacon.cc
@@ -288,20 +288,6 @@ return; UpdateLastLiveTimestamp(); -#if BUILDFLAG(IS_ANDROID) - if (!extended_monitoring_stage_start_time_.is_null()) { - // The time exists, so this is the transition from the extended browser - // crash monitoring stage to the status quo stage. - // - // TODO(crbug/1321989): Clean up this metric and - // |extended_monitoring_stage_start_time_| once Android Chrome - // stakeholders have enough data on the duration. - base::UmaHistogramLongTimes( - "UMA.CleanExitBeacon.ExtendedMonitoringStageDuration", - base::TimeTicks::Now() - extended_monitoring_stage_start_time_); - extended_monitoring_stage_start_time_ = base::TimeTicks(); // Null time. - } -#endif // BUILDFLAG(IS_ANDROID) if (has_exited_cleanly_ && has_exited_cleanly_.value() == exited_cleanly) { // It is possible to call WriteBeaconValue() with the same value for @@ -325,10 +311,6 @@ // Extended Variations Safe Mode, the only valid value for |exited_cleanly| // is `false`. `true` signals that Chrome should stop watching for crashes. DCHECK(!exited_cleanly); -#if BUILDFLAG(IS_ANDROID) - extended_monitoring_stage_start_time_ = base::TimeTicks::Now(); -#endif - WriteBeaconFile(exited_cleanly); } else { local_state_->SetBoolean(prefs::kStabilityExitedCleanly, exited_cleanly);
diff --git a/components/metrics/clean_exit_beacon.h b/components/metrics/clean_exit_beacon.h index 8a560a6..868e2de 100644 --- a/components/metrics/clean_exit_beacon.h +++ b/components/metrics/clean_exit_beacon.h
@@ -178,12 +178,6 @@ static void ResetUserDefaultsBeacon(); #endif // BUILDFLAG(IS_IOS) -#if BUILDFLAG(IS_ANDROID) - // Denotes the time at which Chrome clients in the Extended Variations Safe - // Mode experiment's enabled group start watching for browser crashes. - base::TimeTicks extended_monitoring_stage_start_time_; -#endif - // Indicates whether the CleanExitBeacon has been initialized. bool initialized_ = false;
diff --git a/components/metrics/clean_exit_beacon_unittest.cc b/components/metrics/clean_exit_beacon_unittest.cc index d5c6d7ab..a5006be 100644 --- a/components/metrics/clean_exit_beacon_unittest.cc +++ b/components/metrics/clean_exit_beacon_unittest.cc
@@ -520,67 +520,4 @@ } #endif // BUILDFLAG(IS_IOS) -#if BUILDFLAG(IS_ANDROID) -TEST_F(CleanExitBeaconTest, EnabledGroupEmitsStageDurationMetric) { - // Force the client into the Extended Variations Safe Mode experiment's - // enabled group. - SetUpExtendedSafeModeExperiment(variations::kEnabledGroup); - - // Create and initialize the CleanExitBeacon. - TestCleanExitBeacon clean_exit_beacon(&prefs_); - - // Simulate Chrome starting to watch for browser crashes for enabled-group - // clients. - clean_exit_beacon.WriteBeaconValue(/*exited_cleanly=*/false, - /*is_extended_safe_mode=*/true); - // Verify that the metric has not yet been emitted. - histogram_tester_.ExpectTotalCount( - "UMA.CleanExitBeacon.ExtendedMonitoringStageDuration", 0); - - // Simulate Chrome continuing to watch for crashes once the app enters the - // foreground. - clean_exit_beacon.WriteBeaconValue(/*exited_cleanly=*/false, - /*is_extended_safe_mode=*/false); - // Verify that the metric was emitted. - histogram_tester_.ExpectTotalCount( - "UMA.CleanExitBeacon.ExtendedMonitoringStageDuration", 1); - - // Make the same call. Note that these two identical, consecutive calls to - // WriteBeaconValue() shouldn't actually happen, but this is done for the - // purpose of the test. - clean_exit_beacon.WriteBeaconValue(/*exited_cleanly=*/false, - /*is_extended_safe_mode=*/false); - // Verify that the metric was not emitted again. - histogram_tester_.ExpectTotalCount( - "UMA.CleanExitBeacon.ExtendedMonitoringStageDuration", 1); -} - -TEST_F(CleanExitBeaconTest, ControlGroupDoesNotEmitStageDurationMetric) { - // Force the client into the Extended Variations Safe Mode experiment's - // control group. - SetUpExtendedSafeModeExperiment(variations::kControlGroup); - - // Create and initialize the CleanExitBeacon. - TestCleanExitBeacon clean_exit_beacon(&prefs_); - - // Simulate Chrome starting to watch for browser crashes for control-group - // clients once the app enters the foreground. - clean_exit_beacon.WriteBeaconValue(/*exited_cleanly=*/false, - /*is_extended_safe_mode=*/false); - // Verify that the metric was not emitted. - histogram_tester_.ExpectTotalCount( - "UMA.CleanExitBeacon.ExtendedMonitoringStageDuration", 0); - - // Make the same call. Note that these two identical, consecutive calls to - // WriteBeaconValue() shouldn't actually happen, but this is done for the - // purpose of the test. - clean_exit_beacon.WriteBeaconValue(/*exited_cleanly=*/false, - /*is_extended_safe_mode=*/false); - // Verify that the metric was not emitted. - histogram_tester_.ExpectTotalCount( - "UMA.CleanExitBeacon.ExtendedMonitoringStageDuration", 0); -} - -#endif // BUILDFLAG(IS_ANDROID) - } // namespace metrics
diff --git a/components/omnibox/browser/local_history_zero_suggest_provider_unittest.cc b/components/omnibox/browser/local_history_zero_suggest_provider_unittest.cc index 350fa99..d01a17b 100644 --- a/components/omnibox/browser/local_history_zero_suggest_provider_unittest.cc +++ b/components/omnibox/browser/local_history_zero_suggest_provider_unittest.cc
@@ -329,11 +329,7 @@ // on Desktop and Android NTP. scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>(); StartProviderAndWaitUntilDone(); -#if !BUILDFLAG(IS_IOS) // Enabled by default on Desktop and Android NTP. ExpectMatches({{"hello world", kLocalHistoryZPSUnauthenticatedRelevance}}); -#else - ExpectMatches({}); -#endif } // Tests that search terms are extracted from the default search provider's
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc index d2bcad7..013a41d 100644 --- a/components/omnibox/browser/omnibox_field_trial.cc +++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -227,7 +227,7 @@ // integer, return the default value. unsigned int param_value_as_int = 0; if (!base::StringToUint(param_value, ¶m_value_as_int)) { -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) +#if BUILDFLAG(IS_ANDROID) param_value_as_int = 7; #else param_value_as_int = 60;
diff --git a/components/omnibox/browser/omnibox_field_trial_unittest.cc b/components/omnibox/browser/omnibox_field_trial_unittest.cc index 5a3e3d0..1c6fe407 100644 --- a/components/omnibox/browser/omnibox_field_trial_unittest.cc +++ b/components/omnibox/browser/omnibox_field_trial_unittest.cc
@@ -373,7 +373,7 @@ {{omnibox::kOmniboxLocalZeroSuggestAgeThreshold, {{OmniboxFieldTrial::kOmniboxLocalZeroSuggestAgeThresholdParam, "j"}}}}, {}); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) +#if BUILDFLAG(IS_ANDROID) int expected_age_threshold_days = 7; #else int expected_age_threshold_days = 60;
diff --git a/components/omnibox/browser/shortcuts_backend.cc b/components/omnibox/browser/shortcuts_backend.cc index d9e829d..7096b97 100644 --- a/components/omnibox/browser/shortcuts_backend.cc +++ b/components/omnibox/browser/shortcuts_backend.cc
@@ -64,7 +64,7 @@ // Get either `description_for_shortcuts` if non-empty or fallback to // `description`. -std::u16string GetDescription(const AutocompleteMatch& match) { +const std::u16string& GetDescription(const AutocompleteMatch& match) { return match.description_for_shortcuts.empty() ? match.description : match.description_for_shortcuts; @@ -72,7 +72,8 @@ // Get either `description_class_for_shortcuts` if non-empty or fallback to // `description_class`. -ACMatchClassifications GetDescriptionClass(const AutocompleteMatch& match) { +const ACMatchClassifications& GetDescriptionClass( + const AutocompleteMatch& match) { return match.description_class_for_shortcuts.empty() ? match.description_class : match.description_class_for_shortcuts; @@ -83,6 +84,8 @@ // 'Charles Aznavour', will return 'Ch Aznavour'. std::u16string ExpandToFullWord(const std::u16string& text, const AutocompleteMatch& match) { + DCHECK(!text.empty()); + // Look at the description (i.e. title) only. Contents (i.e. URLs) and // destination URLs both contain garble often; e.g., // 'docs.google.com/d/3SyB0Y83dG_WuxX'. @@ -187,6 +190,14 @@ #if DCHECK_IS_ON() match.Validate(); #endif // DCHECK_IS_ON() + + // `text` may be empty for pedal and zero suggest navigations. It's unlikely + // users will have a predictable empty-input navigation, so early exit. + // Besides, `ShortcutsProvider::Start()` also early exits on empty inputs, so + // there's no reason to add empty-text shortcuts if they won't be used. + if (text.empty()) + return; + // Trim `text` since `ExpandToFullWord()` trims the shortcut text; otherwise, // inputs with trailing whitespace wouldn't match a shortcut even if the user // previously used the input with a trailing whitespace.
diff --git a/components/omnibox/browser/shortcuts_backend_unittest.cc b/components/omnibox/browser/shortcuts_backend_unittest.cc index ef4584d..b8c008e 100644 --- a/components/omnibox/browser/shortcuts_backend_unittest.cc +++ b/components/omnibox/browser/shortcuts_backend_unittest.cc
@@ -216,23 +216,22 @@ std::string output_description_class; AutocompleteMatch::Type output_type; } cases[] = { - { "0,1,4,0", "0,3,4,1", AutocompleteMatchType::URL_WHAT_YOU_TYPED, - "0,1,4,0", "0,1", AutocompleteMatchType::HISTORY_URL }, - { "0,3,5,1", "0,2,5,0", AutocompleteMatchType::NAVSUGGEST, - "0,1", "0,0", AutocompleteMatchType::HISTORY_URL }, - { "0,1", "0,0,11,2,15,0", - AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, - "0,1", "0,0", AutocompleteMatchType::SEARCH_HISTORY }, - { "0,1", "0,0", AutocompleteMatchType::SEARCH_SUGGEST, - "0,1", "0,0", AutocompleteMatchType::SEARCH_HISTORY }, - { "0,1", "0,0", AutocompleteMatchType::SEARCH_SUGGEST_ENTITY, - "", "", AutocompleteMatchType::SEARCH_HISTORY }, - { "0,1", "0,0", AutocompleteMatchType::SEARCH_SUGGEST_TAIL, - "", "", AutocompleteMatchType::SEARCH_HISTORY }, - { "0,1", "0,0", AutocompleteMatchType::SEARCH_SUGGEST_PERSONALIZED, - "", "", AutocompleteMatchType::SEARCH_HISTORY }, - { "0,1", "0,0", AutocompleteMatchType::SEARCH_SUGGEST_PROFILE, - "", "", AutocompleteMatchType::SEARCH_HISTORY }, + {"0,1,4,0", "0,3,4,1", AutocompleteMatchType::URL_WHAT_YOU_TYPED, + "0,1,4,0", "0,1", AutocompleteMatchType::HISTORY_URL}, + {"0,3,5,1", "0,2,5,0", AutocompleteMatchType::NAVSUGGEST, "0,1", "0,0", + AutocompleteMatchType::HISTORY_URL}, + {"0,1", "0,0,11,2,15,0", AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, + "0,1", "0,0", AutocompleteMatchType::SEARCH_HISTORY}, + {"0,1", "0,0", AutocompleteMatchType::SEARCH_SUGGEST, "0,1", "0,0", + AutocompleteMatchType::SEARCH_HISTORY}, + {"0,1", "0,0", AutocompleteMatchType::SEARCH_SUGGEST_ENTITY, "", "", + AutocompleteMatchType::SEARCH_HISTORY}, + {"0,1", "0,0", AutocompleteMatchType::SEARCH_SUGGEST_TAIL, "", "", + AutocompleteMatchType::SEARCH_HISTORY}, + {"0,1", "0,0", AutocompleteMatchType::SEARCH_SUGGEST_PERSONALIZED, "", "", + AutocompleteMatchType::SEARCH_HISTORY}, + {"0,1", "0,0", AutocompleteMatchType::SEARCH_SUGGEST_PROFILE, "", "", + AutocompleteMatchType::SEARCH_HISTORY}, }; for (size_t i = 0; i < std::size(cases); ++i) { @@ -533,4 +532,18 @@ backend()->AddOrUpdateShortcut(u"appl ", match); EXPECT_EQ(shortcuts_map().size(), 7u); EXPECT_TRUE(ShortcutExists(u"apple")); + + // Should neither crash nor add a shortcut when text is empty. + backend()->AddOrUpdateShortcut(u"", match); + EXPECT_EQ(shortcuts_map().size(), 7u); + EXPECT_FALSE(ShortcutExists(u"")); + + // Should not expand when match description is empty. + AutocompleteMatch match_without_description; + match_without_description.destination_url = GURL("https://www.google.com"); + match_without_description.contents = u"https://www.google.com"; + match_without_description.contents_class.emplace_back(0, 0); + backend()->AddOrUpdateShortcut(u"xyz", match_without_description); + EXPECT_EQ(shortcuts_map().size(), 8u); + EXPECT_TRUE(ShortcutExists(u"xyz")); }
diff --git a/components/omnibox/common/omnibox_features.cc b/components/omnibox/common/omnibox_features.cc index cae64e2..29c10ac06 100644 --- a/components/omnibox/common/omnibox_features.cc +++ b/components/omnibox/common/omnibox_features.cc
@@ -151,8 +151,8 @@ "LocalHistorySuggestRevamp", base::FEATURE_DISABLED_BY_DEFAULT}; // Allows the LocalHistoryZeroSuggestProvider to use local search history. -const base::Feature kLocalHistoryZeroSuggest{ - "LocalHistoryZeroSuggest", enabled_by_default_desktop_android}; +const base::Feature kLocalHistoryZeroSuggest{"LocalHistoryZeroSuggest", + base::FEATURE_ENABLED_BY_DEFAULT}; // Enables prefetching of the zero prefix suggestions for signed-in users. const base::Feature kZeroSuggestPrefetching{"ZeroSuggestPrefetching",
diff --git a/components/performance_manager/graph/process_node_impl.cc b/components/performance_manager/graph/process_node_impl.cc index 0e9a577..6e31d48 100644 --- a/components/performance_manager/graph/process_node_impl.cc +++ b/components/performance_manager/graph/process_node_impl.cc
@@ -15,7 +15,6 @@ #include "components/performance_manager/graph/worker_node_impl.h" #include "components/performance_manager/public/execution_context/execution_context_registry.h" #include "components/performance_manager/v8_memory/v8_context_tracker.h" -#include "content/public/browser/background_tracing_manager.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" @@ -25,26 +24,24 @@ void FireBackgroundTracingTriggerOnUI( const std::string& trigger_name, - content::BackgroundTracingManager* manager) { + content::BackgroundTracingManager& manager) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // Don't fire a trigger unless we're in an active tracing scenario. // Renderer-initiated background tracing triggers are always "preemptive" // traces so we expect a scenario to be active. - if (!manager) - manager = &content::BackgroundTracingManager::GetInstance(); - if (!manager->HasActiveScenario()) + if (!manager.HasActiveScenario()) return; static content::BackgroundTracingManager::TriggerHandle trigger_handle = -1; if (trigger_handle == -1) { - trigger_handle = manager->RegisterTriggerType( + trigger_handle = manager.RegisterTriggerType( content::BackgroundTracingManager::kContentTriggerConfig); } // Actually fire the trigger. We don't need to know when the trace is being // finalized so pass an empty callback. - manager->TriggerNamedEvent( + manager.TriggerNamedEvent( trigger_handle, content::BackgroundTracingManager::StartedFinalizingCallback()); } @@ -152,7 +149,9 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); content::GetUIThreadTaskRunner({})->PostTask( FROM_HERE, - base::BindOnce(&FireBackgroundTracingTriggerOnUI, trigger_name, nullptr)); + base::BindOnce( + &FireBackgroundTracingTriggerOnUI, trigger_name, + std::ref(content::BackgroundTracingManager::GetInstance()))); } void ProcessNodeImpl::SetProcessExitStatus(int32_t exit_status) { @@ -247,7 +246,7 @@ // static void ProcessNodeImpl::FireBackgroundTracingTriggerOnUIForTesting( const std::string& trigger_name, - content::BackgroundTracingManager* manager) { + content::BackgroundTracingManager& manager) { FireBackgroundTracingTriggerOnUI(trigger_name, manager); }
diff --git a/components/performance_manager/graph/process_node_impl.h b/components/performance_manager/graph/process_node_impl.h index 502ef6dd..d6216d05 100644 --- a/components/performance_manager/graph/process_node_impl.h +++ b/components/performance_manager/graph/process_node_impl.h
@@ -21,15 +21,12 @@ #include "components/performance_manager/public/mojom/coordination_unit.mojom.h" #include "components/performance_manager/public/mojom/v8_contexts.mojom.h" #include "components/performance_manager/public/render_process_host_proxy.h" +#include "content/public/browser/background_tracing_manager.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/common/tokens/tokens.h" -namespace content { -class BackgroundTracingManager; -} // namespace content - namespace performance_manager { class FrameNodeImpl; @@ -183,7 +180,7 @@ void OnAllFramesInProcessFrozenForTesting() { OnAllFramesInProcessFrozen(); } static void FireBackgroundTracingTriggerOnUIForTesting( const std::string& trigger_name, - content::BackgroundTracingManager* manager); + content::BackgroundTracingManager& manager); base::WeakPtr<ProcessNodeImpl> GetWeakPtrOnUIThread(); base::WeakPtr<ProcessNodeImpl> GetWeakPtr();
diff --git a/components/performance_manager/graph/process_node_impl_unittest.cc b/components/performance_manager/graph/process_node_impl_unittest.cc index 6c5f26f4..67a834c 100644 --- a/components/performance_manager/graph/process_node_impl_unittest.cc +++ b/components/performance_manager/graph/process_node_impl_unittest.cc
@@ -348,7 +348,7 @@ // it that function returns false. EXPECT_CALL(manager, HasActiveScenario()).WillOnce(Return(false)); ProcessNodeImpl::FireBackgroundTracingTriggerOnUIForTesting(kTrigger1, - &manager); + manager); testing::Mock::VerifyAndClear(&manager); // If HasActiveScenario returns true, expect a new trigger to be registered @@ -357,7 +357,7 @@ EXPECT_CALL(manager, RegisterTriggerType(_)).WillOnce(Return(kHandle1)); EXPECT_CALL(manager, TriggerNamedEvent(_, _)); ProcessNodeImpl::FireBackgroundTracingTriggerOnUIForTesting(kTrigger1, - &manager); + manager); testing::Mock::VerifyAndClear(&manager); // Now that a trigger is registered, expect the trigger to be validated, and @@ -365,7 +365,7 @@ EXPECT_CALL(manager, HasActiveScenario()).WillOnce(Return(true)); EXPECT_CALL(manager, TriggerNamedEvent(_, _)); ProcessNodeImpl::FireBackgroundTracingTriggerOnUIForTesting(kTrigger1, - &manager); + manager); testing::Mock::VerifyAndClear(&manager); }
diff --git a/components/reporting/storage/storage_queue.cc b/components/reporting/storage/storage_queue.cc index d2e9af5..b491c7d8 100644 --- a/components/reporting/storage/storage_queue.cc +++ b/components/reporting/storage/storage_queue.cc
@@ -1384,6 +1384,16 @@ return; } + // UTC time of 2122-01-01T00:00:00Z since Unix epoch 1970-01-01T00:00:00Z in + // microseconds + static constexpr int64_t kTime2122 = 4'796'668'800'000'000; + // Log an error if the timestamp is larger than 2122-01-01T00:00:00Z. This + // is the latest spot in the code before a record is compressed or + // encrypted. + LOG_IF(ERROR, wrapped_record.record().timestamp_us() > kTime2122) + << "Unusually large timestamp (in milliseconds): " + << wrapped_record.record().timestamp_us(); + std::string buffer; if (!wrapped_record.SerializeToString(&buffer)) { Schedule(&ReadContext::Response, base::Unretained(this),
diff --git a/components/segmentation_platform/content/page_load_trigger_context.cc b/components/segmentation_platform/content/page_load_trigger_context.cc index bc84fd9..853ad68 100644 --- a/components/segmentation_platform/content/page_load_trigger_context.cc +++ b/components/segmentation_platform/content/page_load_trigger_context.cc
@@ -13,12 +13,28 @@ namespace segmentation_platform { +namespace { +// TODO(ssid): Figure out a good place to keep the param names for InputContext. +constexpr char kUrlKey[] = "url"; +} // namespace + PageLoadTriggerContext::PageLoadTriggerContext( content::WebContents* web_contents) - : web_contents_(web_contents->GetWeakPtr()) {} + : TriggerContext(TriggerType::kPageLoad), + web_contents_(web_contents->GetWeakPtr()) {} PageLoadTriggerContext::~PageLoadTriggerContext() = default; +base::flat_map<std::string, processing::ProcessedValue> +PageLoadTriggerContext::GetSelectionInputArgs() const { + base::flat_map<std::string, processing::ProcessedValue> args; + if (web_contents_) { + args.emplace(kUrlKey, processing::ProcessedValue( + web_contents_->GetLastCommittedURL())); + } + return args; +} + #if BUILDFLAG(IS_ANDROID) base::android::ScopedJavaLocalRef<jobject> PageLoadTriggerContext::CreateJavaObject() const {
diff --git a/components/segmentation_platform/content/page_load_trigger_context.h b/components/segmentation_platform/content/page_load_trigger_context.h index 34c5fe4..bda3845 100644 --- a/components/segmentation_platform/content/page_load_trigger_context.h +++ b/components/segmentation_platform/content/page_load_trigger_context.h
@@ -24,6 +24,9 @@ explicit PageLoadTriggerContext(content::WebContents* web_contents); ~PageLoadTriggerContext() override; + base::flat_map<std::string, processing::ProcessedValue> + GetSelectionInputArgs() const override; + #if BUILDFLAG(IS_ANDROID) base::android::ScopedJavaLocalRef<jobject> CreateJavaObject() const override; #endif // BUILDFLAG(IS_ANDROID)
diff --git a/components/segmentation_platform/content/segmentation_platform_tab_helper.cc b/components/segmentation_platform/content/segmentation_platform_tab_helper.cc index 04a96ca..f01bfe0 100644 --- a/components/segmentation_platform/content/segmentation_platform_tab_helper.cc +++ b/components/segmentation_platform/content/segmentation_platform_tab_helper.cc
@@ -32,9 +32,8 @@ if (GetWebContents().GetVisibility() == content::Visibility::HIDDEN) return; - PageLoadTriggerContext trigger_context(&GetWebContents()); - segmentation_platform_service_->OnTrigger(TriggerType::kPageLoad, - trigger_context); + segmentation_platform_service_->OnTrigger( + std::make_unique<PageLoadTriggerContext>(&GetWebContents())); } WEB_CONTENTS_USER_DATA_KEY_IMPL(SegmentationPlatformTabHelper);
diff --git a/components/segmentation_platform/internal/dummy_segmentation_platform_service.cc b/components/segmentation_platform/internal/dummy_segmentation_platform_service.cc index 1ea3bcd..bc34846b 100644 --- a/components/segmentation_platform/internal/dummy_segmentation_platform_service.cc +++ b/components/segmentation_platform/internal/dummy_segmentation_platform_service.cc
@@ -45,8 +45,7 @@ const std::string& segmentation_key) {} void DummySegmentationPlatformService::OnTrigger( - TriggerType trigger, - const TriggerContext& trigger_context) {} + std::unique_ptr<TriggerContext> trigger_context) {} void DummySegmentationPlatformService::EnableMetrics( bool signal_collection_allowed) {}
diff --git a/components/segmentation_platform/internal/dummy_segmentation_platform_service.h b/components/segmentation_platform/internal/dummy_segmentation_platform_service.h index 8cf9fd80..6b4eb90c 100644 --- a/components/segmentation_platform/internal/dummy_segmentation_platform_service.h +++ b/components/segmentation_platform/internal/dummy_segmentation_platform_service.h
@@ -35,8 +35,7 @@ void UnregisterOnDemandSegmentSelectionCallback( CallbackId callback_id, const std::string& segmentation_key) override; - void OnTrigger(TriggerType trigger, - const TriggerContext& trigger_context) override; + void OnTrigger(std::unique_ptr<TriggerContext> trigger_context) override; void EnableMetrics(bool signal_collection_allowed) override; bool IsPlatformInitialized() override; };
diff --git a/components/segmentation_platform/internal/input_context.cc b/components/segmentation_platform/internal/input_context.cc index ffa7632..203ff7e7 100644 --- a/components/segmentation_platform/internal/input_context.cc +++ b/components/segmentation_platform/internal/input_context.cc
@@ -4,9 +4,15 @@ #include "components/segmentation_platform/internal/input_context.h" +#include "components/segmentation_platform/public/trigger_context.h" + namespace segmentation_platform { InputContext::InputContext() = default; + +InputContext::InputContext(const TriggerContext& trigger_context) + : metadata_args(trigger_context.GetSelectionInputArgs()) {} + InputContext::~InputContext() = default; } // namespace segmentation_platform
diff --git a/components/segmentation_platform/internal/input_context.h b/components/segmentation_platform/internal/input_context.h index 01d5988d..5ff8cfe 100644 --- a/components/segmentation_platform/internal/input_context.h +++ b/components/segmentation_platform/internal/input_context.h
@@ -8,7 +8,8 @@ #include "base/containers/flat_map.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" -#include "base/values.h" +#include "components/segmentation_platform/public/trigger_context.h" +#include "components/segmentation_platform/public/types/processed_value.h" namespace segmentation_platform { @@ -20,6 +21,7 @@ struct InputContext : base::RefCounted<InputContext> { public: InputContext(); + explicit InputContext(const TriggerContext& trigger_context); InputContext(InputContext&) = delete; InputContext& operator=(InputContext&) = delete; @@ -27,7 +29,7 @@ // Input values that can be used to input to model directly if the type is // `Type::INTEGER` or `Type::DOUBLE`. Inputs can be substituted to SQL queries // if the type is not `Type::DICT` or `Type::LIST`. - base::flat_map<std::string, base::Value> metadata_args; + base::flat_map<std::string, processing::ProcessedValue> metadata_args; private: friend class RefCounted<InputContext>;
diff --git a/components/segmentation_platform/internal/segmentation_platform_service_impl.cc b/components/segmentation_platform/internal/segmentation_platform_service_impl.cc index f37f983f..d3adfc7 100644 --- a/components/segmentation_platform/internal/segmentation_platform_service_impl.cc +++ b/components/segmentation_platform/internal/segmentation_platform_service_impl.cc
@@ -10,6 +10,7 @@ #include "base/callback_helpers.h" #include "base/command_line.h" #include "base/files/file_path.h" +#include "base/memory/scoped_refptr.h" #include "base/metrics/histogram_functions.h" #include "base/system/sys_info.h" #include "base/task/sequenced_task_runner.h" @@ -163,11 +164,12 @@ } void SegmentationPlatformServiceImpl::OnTrigger( - TriggerType trigger, - const TriggerContext& trigger_context) { + std::unique_ptr<TriggerContext> trigger_context) { + const TriggerType trigger = trigger_context->trigger_type(); if (clients_for_trigger_.find(trigger) == clients_for_trigger_.end()) return; - scoped_refptr<InputContext> input_context; + scoped_refptr<InputContext> input_context = + base::MakeRefCounted<InputContext>(*trigger_context); for (const auto& segmentation_key : clients_for_trigger_[trigger]) { CHECK(segment_selectors_.find(segmentation_key) != segment_selectors_.end()); @@ -176,17 +178,18 @@ input_context, base::BindOnce( &SegmentationPlatformServiceImpl::OnSegmentSelectionForTrigger, - weak_ptr_factory_.GetWeakPtr(), segmentation_key, trigger_context)); + weak_ptr_factory_.GetWeakPtr(), segmentation_key, + std::move(trigger_context))); } } void SegmentationPlatformServiceImpl::OnSegmentSelectionForTrigger( const std::string& segmentation_key, - const TriggerContext& trigger_context, + std::unique_ptr<TriggerContext> trigger_context, const SegmentSelectionResult& selected_segment) { for (auto callback_id : segment_selection_callback_ids_[segmentation_key]) { const auto& callback = callback_map_[callback_id]; - callback.Run(selected_segment, trigger_context); + callback.Run(selected_segment, *trigger_context); } }
diff --git a/components/segmentation_platform/internal/segmentation_platform_service_impl.h b/components/segmentation_platform/internal/segmentation_platform_service_impl.h index 399f5508..8073f8c6 100644 --- a/components/segmentation_platform/internal/segmentation_platform_service_impl.h +++ b/components/segmentation_platform/internal/segmentation_platform_service_impl.h
@@ -105,8 +105,7 @@ void UnregisterOnDemandSegmentSelectionCallback( CallbackId callback_id, const std::string& segmentation_key) override; - void OnTrigger(TriggerType trigger, - const TriggerContext& trigger_context) override; + void OnTrigger(std::unique_ptr<TriggerContext> trigger_context) override; void EnableMetrics(bool signal_collection_allowed) override; ServiceProxy* GetServiceProxy() override; bool IsPlatformInitialized() override; @@ -133,7 +132,7 @@ // Callback to run after on-demand segment selection. void OnSegmentSelectionForTrigger( const std::string& segmentation_key, - const TriggerContext& trigger_context, + std::unique_ptr<TriggerContext> trigger_context, const SegmentSelectionResult& selected_segment); std::unique_ptr<ModelProviderFactory> model_provider_factory_;
diff --git a/components/segmentation_platform/public/segmentation_platform_service.h b/components/segmentation_platform/public/segmentation_platform_service.h index dac91f3..87934a2 100644 --- a/components/segmentation_platform/public/segmentation_platform_service.h +++ b/components/segmentation_platform/public/segmentation_platform_service.h
@@ -24,7 +24,7 @@ namespace segmentation_platform { class ServiceProxy; struct SegmentSelectionResult; -struct TriggerContext; +class TriggerContext; using CallbackId = base::IdType32<class OnDemandSegmentSelectionCallbackTag>; @@ -84,8 +84,7 @@ const std::string& segmentation_key) = 0; // Called when a trigger event happens. - virtual void OnTrigger(TriggerType trigger, - const TriggerContext& trigger_context) = 0; + virtual void OnTrigger(std::unique_ptr<TriggerContext> trigger_context) = 0; // Called to enable or disable metrics collection. Must be explicitly called // on startup.
diff --git a/components/segmentation_platform/public/trigger_context.cc b/components/segmentation_platform/public/trigger_context.cc index 59c9735..10b1315 100644 --- a/components/segmentation_platform/public/trigger_context.cc +++ b/components/segmentation_platform/public/trigger_context.cc
@@ -13,10 +13,16 @@ namespace segmentation_platform { -TriggerContext::TriggerContext() = default; +TriggerContext::TriggerContext(TriggerType trigger_type) + : trigger_type_(trigger_type) {} TriggerContext::~TriggerContext() = default; +base::flat_map<std::string, processing::ProcessedValue> +TriggerContext::GetSelectionInputArgs() const { + return {}; +} + #if BUILDFLAG(IS_ANDROID) base::android::ScopedJavaLocalRef<jobject> TriggerContext::CreateJavaObject() const {
diff --git a/components/segmentation_platform/public/trigger_context.h b/components/segmentation_platform/public/trigger_context.h index c45343b..e2b17aa5 100644 --- a/components/segmentation_platform/public/trigger_context.h +++ b/components/segmentation_platform/public/trigger_context.h
@@ -5,8 +5,11 @@ #ifndef COMPONENTS_SEGMENTATION_PLATFORM_PUBLIC_TRIGGER_CONTEXT_H_ #define COMPONENTS_SEGMENTATION_PLATFORM_PUBLIC_TRIGGER_CONTEXT_H_ +#include "base/containers/flat_map.h" #include "base/memory/raw_ptr.h" #include "build/build_config.h" +#include "components/segmentation_platform/public/trigger.h" +#include "components/segmentation_platform/public/types/processed_value.h" #if BUILDFLAG(IS_ANDROID) #include "base/android/jni_android.h" @@ -15,15 +18,26 @@ namespace segmentation_platform { // Contains contextual information for a trigger event. -struct TriggerContext { +class TriggerContext { public: - TriggerContext(); + explicit TriggerContext(TriggerType type); virtual ~TriggerContext(); + TriggerContext(const TriggerContext&) = delete; + TriggerContext& operator=(const TriggerContext&) = delete; + + virtual base::flat_map<std::string, processing::ProcessedValue> + GetSelectionInputArgs() const; + #if BUILDFLAG(IS_ANDROID) // Returns a Java object representing the TriggerContext. virtual base::android::ScopedJavaLocalRef<jobject> CreateJavaObject() const; #endif // BUILDFLAG(IS_ANDROID) + + TriggerType trigger_type() const { return trigger_type_; } + + private: + const TriggerType trigger_type_; }; } // namespace segmentation_platform
diff --git a/components/viz/common/quads/render_pass_internal.h b/components/viz/common/quads/render_pass_internal.h index 7fee430..0934a50f 100644 --- a/components/viz/common/quads/render_pass_internal.h +++ b/components/viz/common/quads/render_pass_internal.h
@@ -74,6 +74,15 @@ // this list. std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests; + // `quad_list` + `shared_quad_state_list` store quad data in front-to-back + // order. Each DrawQuad must have a corresponding SharedQuadState but there be + // multiple DrawQuads for a single SharedQuadState. + // + // Note that `shared_quad_state_list` should be in the same front-to-back + // order as `quad_list`. This is a strict requirement if the CompositorFrame + // will be serialized as the mojom traits depends on it. Ideally the order is + // maintained in viz after deserialization, for cache efficiency while + // iterating through quads, but it's not a strict requirement. QuadList quad_list; SharedQuadStateList shared_quad_state_list;
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn index d6cce8a..a8e08ed 100644 --- a/components/viz/service/BUILD.gn +++ b/components/viz/service/BUILD.gn
@@ -188,6 +188,7 @@ "performance_hint/hint_session.h", "performance_hint/utils.cc", "performance_hint/utils.h", + "surfaces/frame_index_constants.h", "surfaces/latest_local_surface_id_lookup_delegate.h", "surfaces/pending_copy_output_request.cc", "surfaces/pending_copy_output_request.h",
diff --git a/components/viz/service/display/display.cc b/components/viz/service/display/display.cc index 07d38ad..b6b3bd8 100644 --- a/components/viz/service/display/display.cc +++ b/components/viz/service/display/display.cc
@@ -860,8 +860,8 @@ pending_presentation_group_timings_.emplace_back(); base::flat_set<base::PlatformThreadId> thread_ids; - for (const auto& id_entry : aggregator_->previous_contained_surfaces()) { - surface = surface_manager_->GetSurfaceForId(id_entry.first); + for (const auto& surface_id : aggregator_->previous_contained_surfaces()) { + surface = surface_manager_->GetSurfaceForId(surface_id); if (surface) { base::flat_set<base::PlatformThreadId> surface_thread_ids = surface->GetThreadIds(); @@ -871,8 +871,8 @@ presentation_group_timing.OnDraw(params.frame_time, draw_timer->Begin(), std::move(thread_ids)); - for (const auto& id_entry : aggregator_->previous_contained_surfaces()) { - surface = surface_manager_->GetSurfaceForId(id_entry.first); + for (const auto& surface_id : aggregator_->previous_contained_surfaces()) { + surface = surface_manager_->GetSurfaceForId(surface_id); if (surface) { std::unique_ptr<Surface::PresentationHelper> helper = surface->TakePresentationHelperForPresentNotification();
diff --git a/components/viz/service/display/display_damage_tracker.cc b/components/viz/service/display/display_damage_tracker.cc index 94bcdf6..b90571f 100644 --- a/components/viz/service/display/display_damage_tracker.cc +++ b/components/viz/service/display/display_damage_tracker.cc
@@ -203,8 +203,8 @@ surfaces_to_ack_on_next_draw_.clear(); // |surfaces_to_ack_on_next_draw_| does not cover surfaces that are being // embedded for the first time, so also go through SurfaceAggregator's list. - for (const auto& id_entry : aggregator_->previous_contained_surfaces()) { - Surface* surface = surface_manager_->GetSurfaceForId(id_entry.first); + for (const auto& surface_id : aggregator_->previous_contained_surfaces()) { + Surface* surface = surface_manager_->GetSurfaceForId(surface_id); if (surface) surface->SendAckToClient(); }
diff --git a/components/viz/service/display/resolved_frame_data.cc b/components/viz/service/display/resolved_frame_data.cc index a3df55b14..19546ed 100644 --- a/components/viz/service/display/resolved_frame_data.cc +++ b/components/viz/service/display/resolved_frame_data.cc
@@ -55,15 +55,35 @@ ResolvedPassData& ResolvedPassData::operator=(ResolvedPassData&& other) = default; -ResolvedFrameData::ResolvedFrameData(const SurfaceId& surface_id, - Surface* surface) - : surface_id_(surface_id), surface_(surface) {} +ResolvedFrameData::ResolvedFrameData(DisplayResourceProvider* resource_provider, + Surface* surface, + uint64_t previous_frame_index) + : resource_provider_(resource_provider), + surface_id_(surface->surface_id()), + surface_(surface), + previous_frame_index_(previous_frame_index) { + DCHECK(resource_provider_); + DCHECK(surface_); -ResolvedFrameData::~ResolvedFrameData() = default; + RegisterWithResourceProvider(); +} -ResourceIdSet ResolvedFrameData::UpdateForActiveFrame( - const std::unordered_map<ResourceId, ResourceId, ResourceIdHasher>& - child_to_parent_map, +ResolvedFrameData::~ResolvedFrameData() { + // Release resources used by this ResolvedFrameData. + resource_provider_->DestroyChild(child_resource_id_); +} + +void ResolvedFrameData::SetFullDamageForNextAggregation() { + previous_frame_index_ = kInvalidFrameIndex; +} + +void ResolvedFrameData::ForceReleaseResource() { + // Resources for future frames are stored under a new child id going forward. + resource_provider_->DestroyChild(child_resource_id_); + RegisterWithResourceProvider(); +} + +void ResolvedFrameData::UpdateForActiveFrame( AggregatedRenderPassId::Generator& render_pass_id_generator) { auto& compositor_frame = surface_->GetActiveOrInterpolatedFrame(); auto& resource_list = compositor_frame.resource_list; @@ -71,6 +91,8 @@ size_t num_render_pass = render_passes.size(); DCHECK(!render_passes.empty()); + resource_provider_->ReceiveFromChild(child_resource_id_, resource_list); + // Figure out which resources are actually used in the render pass. // Note that we first gather them in a vector, since ResourceIdSet (which we // actually need) is a flat_set, which means bulk insertion we do at the end @@ -86,6 +108,9 @@ root_damage_rect_ = render_passes.back()->damage_rect; + auto& child_to_parent_map = + resource_provider_->GetChildToParentMap(child_resource_id_); + // Reset and compute new render pass / quad data for this frame. This stores // remapped display resource ids. for (size_t i = 0; i < num_render_pass; ++i) { @@ -124,7 +149,7 @@ if (!base::Contains(render_pass_id_map_, quad_render_pass_id)) { DLOG(ERROR) << "CompositorRenderPassDrawQuad with invalid id"; SetInvalid(); - return {}; + return; } fixed.prewalk_quads.push_back(quad); @@ -140,7 +165,7 @@ if (iter == child_to_parent_map.end()) { DLOG(ERROR) << "Invalid resource for " << surface_id(); SetInvalid(); - return {}; + return; } referenced_resources.push_back(resource_id); @@ -156,7 +181,7 @@ .second) { DLOG(ERROR) << "Duplicate render pass ids"; SetInvalid(); - return {}; + return; } } @@ -169,7 +194,12 @@ }); valid_ = true; - return ResourceIdSet(std::move(referenced_resources)); + + // Declare the used resources to the provider. This will cause all resources + // that were received but not used in the render passes to be unreferenced in + // the surface, and returned to the child in the resource provider. + resource_provider_->DeclareUsedResourcesFromChild( + child_resource_id_, ResourceIdSet(std::move(referenced_resources))); } void ResolvedFrameData::SetInvalid() { @@ -179,17 +209,21 @@ valid_ = false; } -bool ResolvedFrameData::MarkAsUsed() { - // Returns true the first time this is called after reset. - return !std::exchange(used_, true); +void ResolvedFrameData::MarkAsUsedInAggregation() { + used_in_aggregation_ = true; } -bool ResolvedFrameData::CheckIfUsedAndReset() { +bool ResolvedFrameData::WasUsedInAggregation() const { + return used_in_aggregation_; +} + +void ResolvedFrameData::ResetAfterAggregation() { // Reset aggregation scoped data. for (auto& resolved_pass : resolved_passes_) resolved_pass.aggregation().Reset(); - return std::exchange(used_, false); + previous_frame_index_ = frame_index_; + used_in_aggregation_ = false; } bool ResolvedFrameData::WillDraw() const { @@ -222,14 +256,43 @@ return resolved_passes_.back(); } -const gfx::Rect& ResolvedFrameData::GetDamageRect( +bool ResolvedFrameData::IsSameFrameAsLastAggregation() const { + DCHECK(valid_); + DCHECK(used_in_aggregation_); + return previous_frame_index_ == frame_index_; +} + +bool ResolvedFrameData::IsNextFrameSinceLastAggregation() const { + DCHECK(valid_); + DCHECK(used_in_aggregation_); + return previous_frame_index_ > kInvalidFrameIndex && + frame_index_ == previous_frame_index_ + 1; +} + +gfx::Rect ResolvedFrameData::GetSurfaceDamage( bool include_per_quad_damage) const { DCHECK(valid_); - if (include_per_quad_damage) - return root_damage_rect_; + // The |damage_rect| set in |SurfaceAnimationManager| is the |output_rect|. + // However, we dont use |damage_rect| because when we transition from + // interpolated frame we would end up using the |damage_rect| from the + // original non interpolated frame. + // TODO(vmpstr): This damage may be too large, but I think it's hard to figure + // out a small bounds on the damage given an animation that happens in + // SurfaceAnimationManager. + if (surface_->HasSurfaceAnimationDamage()) + return GetOutputRect(); - return resolved_passes_.back().render_pass().damage_rect; + if (IsSameFrameAsLastAggregation()) { + return gfx::Rect(); + } else if (IsNextFrameSinceLastAggregation()) { + if (include_per_quad_damage) + return root_damage_rect_; + + return resolved_passes_.back().render_pass().damage_rect; + } + + return GetOutputRect(); } const gfx::Rect& ResolvedFrameData::GetOutputRect() const { @@ -237,4 +300,10 @@ return resolved_passes_.back().render_pass().output_rect; } +void ResolvedFrameData::RegisterWithResourceProvider() { + child_resource_id_ = resource_provider_->CreateChild( + base::BindRepeating(&SurfaceClient::UnrefResources, surface_->client()), + surface_id_); +} + } // namespace viz
diff --git a/components/viz/service/display/resolved_frame_data.h b/components/viz/service/display/resolved_frame_data.h index ca324b5..0e16994 100644 --- a/components/viz/service/display/resolved_frame_data.h +++ b/components/viz/service/display/resolved_frame_data.h
@@ -15,6 +15,8 @@ #include "components/viz/common/quads/draw_quad.h" #include "components/viz/common/resources/resource_id.h" #include "components/viz/common/surfaces/surface_id.h" +#include "components/viz/service/display/display_resource_provider.h" +#include "components/viz/service/surfaces/frame_index_constants.h" #include "components/viz/service/viz_service_export.h" namespace viz { @@ -126,10 +128,13 @@ // Holds computed information for a particular Surface+CompositorFrame. The // CompositorFrame computed information will be updated whenever the active -// frame for the surface has changed. +// frame for the surface has changed. On destruction any resources registered +// with DisplayResourceProvider will be released. class VIZ_SERVICE_EXPORT ResolvedFrameData { public: - ResolvedFrameData(const SurfaceId& surface_id, Surface* surface); + ResolvedFrameData(DisplayResourceProvider* resource_provider, + Surface* surface, + uint64_t prev_frame_index); ~ResolvedFrameData(); ResolvedFrameData(ResolvedFrameData&& other) = delete; ResolvedFrameData& operator=(ResolvedFrameData&& other) = delete; @@ -137,13 +142,18 @@ const SurfaceId& surface_id() const { return surface_id_; } Surface* surface() const { return surface_; } bool is_valid() const { return valid_; } - uint64_t frame_index() const { return frame_index_; } + uint64_t previous_frame_index() const { return previous_frame_index_; } + + void SetFullDamageForNextAggregation(); + + // Force release all resources registered with display resource provider. Note + // there must be a new CompositorFrame available that doesn't use any existing + // resources since resources (might) be missing on next draw. + void ForceReleaseResource(); // Updates resolved frame data for a new active frame. This will recompute - // ResolvedPassData. |child_to_parent_map| is the ResourceId mapping provided - // from DisplayResourceProvider which includes all of ResourceIds referenced - // by quads in the active frame. Returns all ResourceIds that are used in the - // active frame. + // ResolvedPassData. It also updates display resource provider with resources + // used in new active frame. // // This performs the following validation on the active CompositorFrame. // 1. Checks each ResourceId was registered with DisplayResourceProvider and @@ -152,24 +162,20 @@ // 3. Checks that CompositorRenderPassDrawQuads only embed render passes that // are drawn before. This has the side effect of disallowing any cycles. // - // If validation fails then an empty set of resources will be returned, all - // ResolvedPassData will be cleared and is_valid() will return false. - ResourceIdSet UpdateForActiveFrame( - const std::unordered_map<ResourceId, ResourceId, ResourceIdHasher>& - child_to_parent_map, + // If validation fails then ResolvedPassData will be cleared and is_valid() + // will return false. + void UpdateForActiveFrame( AggregatedRenderPassId::Generator& render_pass_id_generator); // Sets frame index and marks as invalid. This also clears any existing // resolved pass data. void SetInvalid(); - // Marks this as used and returns true if this was the first time MarkAsUsed() - // was called since last reset. - bool MarkAsUsed(); + void MarkAsUsedInAggregation(); + bool WasUsedInAggregation() const; - // Returns true if MarkAsUsed() was called since last reset and then resets - // used to false. - bool CheckIfUsedAndReset(); + // Resets aggregation data and WasUsedInAggregation() will now return false. + void ResetAfterAggregation(); // All functions after this point are accessors for the resolved frame and // should only be called if is_valid() returns true. @@ -194,29 +200,46 @@ return resolved_passes_; } - // Returns active frame damage rect. If |include_per_quad_damage| then the - // damage_rect will include unioned per quad damage, otherwise it will be + // The active CompositorFrame is the same this aggregation as last + // aggregation, aka nothing has changed. + bool IsSameFrameAsLastAggregation() const; + + // The active CompositorFrame this aggregation is the next frame in the + // sequence compared to last aggregation. + bool IsNextFrameSinceLastAggregation() const; + + // Returns surface damage rect. This is based on changes from the + // CompositorFrame aggregated last frame. If |include_per_quad_damage| then + // the damage_rect will include unioned per quad damage, otherwise it will be // limited to the root render passes damage_rect. - const gfx::Rect& GetDamageRect(bool include_per_quad_damage) const; + gfx::Rect GetSurfaceDamage(bool include_per_quad_damage) const; // Returns the root render pass output_rect. const gfx::Rect& GetOutputRect() const; private: + void RegisterWithResourceProvider(); + + const raw_ptr<DisplayResourceProvider> resource_provider_; const SurfaceId surface_id_; const raw_ptr<Surface> surface_; + // Child resource ID assigned by `resource_provider_`. + int child_resource_id_ = 0; + // Data associated with CompositorFrame with |frame_index_|. bool valid_ = false; - uint64_t frame_index_ = 0; + uint64_t frame_index_ = kInvalidFrameIndex; std::vector<ResolvedPassData> resolved_passes_; base::flat_map<CompositorRenderPassId, ResolvedPassData*> render_pass_id_map_; base::flat_map<CompositorRenderPassId, AggregatedRenderPassId> aggregated_id_map_; gfx::Rect root_damage_rect_; - // Track if the this resolved frame was used this frame. - bool used_ = false; + uint64_t previous_frame_index_ = kInvalidFrameIndex; + + // Track if the this resolved frame was used this aggregation. + bool used_in_aggregation_ = false; }; } // namespace viz
diff --git a/components/viz/service/display/resolved_frame_data_unittest.cc b/components/viz/service/display/resolved_frame_data_unittest.cc index 4800e53..bb93be4 100644 --- a/components/viz/service/display/resolved_frame_data_unittest.cc +++ b/components/viz/service/display/resolved_frame_data_unittest.cc
@@ -11,9 +11,11 @@ #include "components/viz/common/quads/texture_draw_quad.h" #include "components/viz/service/display/display_resource_provider_software.h" #include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" +#include "components/viz/service/frame_sinks/compositor_frame_sink_support.h" #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h" #include "components/viz/service/surfaces/surface.h" #include "components/viz/test/compositor_frame_helpers.h" +#include "components/viz/test/draw_quad_matchers.h" #include "components/viz/test/test_surface_id_allocator.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -23,6 +25,14 @@ constexpr gfx::Rect kOutputRect(100, 100); +CompositorFrame MakeSimpleFrame(const gfx::Rect& damage_rect = kOutputRect) { + return CompositorFrameBuilder() + .AddRenderPass(RenderPassBuilder(kOutputRect) + .AddSolidColorQuad(kOutputRect, SK_ColorRED) + .SetDamageRect(kOutputRect)) + .Build(); +} + std::unique_ptr<CompositorRenderPass> BuildRenderPass(int id) { auto render_pass = CompositorRenderPass::Create(); render_pass->SetNew(CompositorRenderPassId::FromUnsafeValue(id), kOutputRect, @@ -30,25 +40,6 @@ return render_pass; } -TextureDrawQuad* AddTextureQuad(CompositorRenderPass* render_pass, - ResourceId resource_id) { - auto* sqs = render_pass->CreateAndAppendSharedQuadState(); - sqs->SetAll(gfx::Transform(), kOutputRect, kOutputRect, gfx::MaskFilterInfo(), - absl::nullopt, /*are_contents_opaque=*/false, 1, - SkBlendMode::kSrcOver, 0); - auto* quad = render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); - const float vertex_opacity[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - const gfx::PointF uv_top_left(0.0f, 0.0f); - const gfx::PointF uv_bottom_right(1.0f, 1.0f); - quad->SetNew(sqs, kOutputRect, kOutputRect, /*needs_blending=*/false, - resource_id, /*premultiplied_alpha=*/false, uv_top_left, - uv_bottom_right, SK_ColorTRANSPARENT, vertex_opacity, - /*y_flipped=*/false, /*nearest_neighbor=*/false, - /*secure_output_only=*/false, gfx::ProtectedVideoType::kClear); - - return quad; -} - void AddRenderPassQuad(CompositorRenderPass* render_pass, CompositorRenderPassId render_pass_id) { auto* sqs = render_pass->CreateAndAppendSharedQuadState(); @@ -88,14 +79,13 @@ } ServerSharedBitmapManager shared_bitmap_manager_; + DisplayResourceProviderSoftware resource_provider_{&shared_bitmap_manager_}; FrameSinkManagerImpl frame_sink_manager_{ FrameSinkManagerImpl::InitParams(&shared_bitmap_manager_)}; TestSurfaceIdAllocator surface_id_{FrameSinkId(1, 1)}; std::unique_ptr<CompositorFrameSinkSupport> support_; - std::unordered_map<ResourceId, ResourceId, ResourceIdHasher> - child_to_parent_map_; AggregatedRenderPassId::Generator render_pass_id_generator_; }; @@ -109,15 +99,14 @@ .Build(); Surface* surface = SubmitCompositorFrame(std::move(frame)); - ResolvedFrameData resolved_frame(surface_id_, surface); + ResolvedFrameData resolved_frame(&resource_provider_, surface, 0u); // The resolved frame should be false after construction. EXPECT_FALSE(resolved_frame.is_valid()); // Resolved frame data should be valid after adding resolved render pass data // and have three render passes. - resolved_frame.UpdateForActiveFrame(child_to_parent_map_, - render_pass_id_generator_); + resolved_frame.UpdateForActiveFrame(render_pass_id_generator_); EXPECT_TRUE(resolved_frame.is_valid()); EXPECT_THAT(resolved_frame.GetResolvedPasses(), testing::SizeIs(3)); @@ -142,10 +131,9 @@ .Build(); Surface* surface = SubmitCompositorFrame(std::move(frame)); - ResolvedFrameData resolved_frame(surface_id_, surface); + ResolvedFrameData resolved_frame(&resource_provider_, surface, 0u); - resolved_frame.UpdateForActiveFrame(child_to_parent_map_, - render_pass_id_generator_); + resolved_frame.UpdateForActiveFrame(render_pass_id_generator_); EXPECT_FALSE(resolved_frame.is_valid()); } @@ -161,10 +149,9 @@ CompositorFrameBuilder().AddRenderPass(std::move(render_pass)).Build(); Surface* surface = SubmitCompositorFrame(std::move(frame)); - ResolvedFrameData resolved_frame(surface_id_, surface); + ResolvedFrameData resolved_frame(&resource_provider_, surface, 0u); - resolved_frame.UpdateForActiveFrame(child_to_parent_map_, - render_pass_id_generator_); + resolved_frame.UpdateForActiveFrame(render_pass_id_generator_); EXPECT_FALSE(resolved_frame.is_valid()); } @@ -183,12 +170,11 @@ .AddRenderPass(std::move(render_pass2)) .Build(); Surface* surface = SubmitCompositorFrame(std::move(frame)); - ResolvedFrameData resolved_frame(surface_id_, surface); + ResolvedFrameData resolved_frame(&resource_provider_, surface, 0u); // RenderPasses have duplicate IDs so the resolved frame should be marked as // invalid. - resolved_frame.UpdateForActiveFrame(child_to_parent_map_, - render_pass_id_generator_); + resolved_frame.UpdateForActiveFrame(render_pass_id_generator_); EXPECT_FALSE(resolved_frame.is_valid()); } @@ -196,53 +182,112 @@ TEST_F(ResolvedFrameDataTest, RenderPassWithPerQuadDamage) { constexpr gfx::Rect pass_damage_rect(80, 80, 10, 10); constexpr gfx::Rect quad_damage_rect(10, 10, 20, 20); - - auto render_pass = BuildRenderPass(1); - render_pass->damage_rect = pass_damage_rect; - render_pass->has_per_quad_damage = true; - constexpr ResourceId resource_id(1); - TextureDrawQuad* quad = AddTextureQuad(render_pass.get(), resource_id); - quad->damage_rect = quad_damage_rect; - auto frame = CompositorFrameBuilder() - .AddRenderPass(std::move(render_pass)) - .PopulateResources() - .Build(); + auto frame = + CompositorFrameBuilder() + .AddRenderPass(RenderPassBuilder(kOutputRect) + .SetDamageRect(pass_damage_rect) + .AddSolidColorQuad(kOutputRect, SK_ColorRED) + .AddTextureQuad(kOutputRect, resource_id) + .SetQuadDamageRect(quad_damage_rect)) + .PopulateResources() + .Build(); Surface* surface = SubmitCompositorFrame(std::move(frame)); - ResolvedFrameData resolved_frame(surface_id_, surface); + EXPECT_EQ(surface->GetActiveFrameIndex(), kFrameIndexStart); + ResolvedFrameData resolved_frame(&resource_provider_, surface, 1u); - child_to_parent_map_[resource_id] = resource_id; - resolved_frame.UpdateForActiveFrame(child_to_parent_map_, - render_pass_id_generator_); + resolved_frame.UpdateForActiveFrame(render_pass_id_generator_); ASSERT_TRUE(resolved_frame.is_valid()); - // GetDamageRect() should be the union of render pass and quad damage if + resolved_frame.MarkAsUsedInAggregation(); + + // GetSurfaceDamage() should be the union of render pass and quad damage if // `include_per_quad_damage` is true, otherwise just render pass damage. constexpr gfx::Rect full_damage_rect(10, 10, 80, 80); - EXPECT_EQ(resolved_frame.GetDamageRect(/*include_per_quad_damage=*/true), + EXPECT_EQ(resolved_frame.GetSurfaceDamage(/*include_per_quad_damage=*/true), full_damage_rect); - EXPECT_EQ(resolved_frame.GetDamageRect(/*include_per_quad_damage=*/false), + EXPECT_EQ(resolved_frame.GetSurfaceDamage(/*include_per_quad_damage=*/false), pass_damage_rect); } TEST_F(ResolvedFrameDataTest, MarkAsUsed) { - ResolvedFrameData resolved_frame(surface_id_, nullptr); + Surface* surface = SubmitCompositorFrame(MakeSimpleFrame()); + ResolvedFrameData resolved_frame(&resource_provider_, surface, 0u); - EXPECT_TRUE(resolved_frame.MarkAsUsed()); - EXPECT_FALSE(resolved_frame.MarkAsUsed()); - EXPECT_FALSE(resolved_frame.MarkAsUsed()); + resolved_frame.UpdateForActiveFrame(render_pass_id_generator_); + EXPECT_FALSE(resolved_frame.WasUsedInAggregation()); - // MarkAsUsed() was called so return true. - EXPECT_TRUE(resolved_frame.CheckIfUsedAndReset()); + // First aggregation. + resolved_frame.MarkAsUsedInAggregation(); + EXPECT_TRUE(resolved_frame.WasUsedInAggregation()); - // MarkAsUsed() wasn't called so return false. - EXPECT_FALSE(resolved_frame.CheckIfUsedAndReset()); + // This is the first frame this aggregation. + EXPECT_FALSE(resolved_frame.IsSameFrameAsLastAggregation()); + EXPECT_FALSE(resolved_frame.IsNextFrameSinceLastAggregation()); - // First usage after reset returns true then false again. - EXPECT_TRUE(resolved_frame.MarkAsUsed()); - EXPECT_FALSE(resolved_frame.MarkAsUsed()); + // Nothing changes if MarkAsUsedInAggregation() is called more than once + // before reset. + resolved_frame.MarkAsUsedInAggregation(); + EXPECT_TRUE(resolved_frame.WasUsedInAggregation()); + + // Reset after aggregation. + resolved_frame.ResetAfterAggregation(); + EXPECT_FALSE(resolved_frame.WasUsedInAggregation()); + + // Don't submit a new frame for the next aggregation. + resolved_frame.MarkAsUsedInAggregation(); + EXPECT_TRUE(resolved_frame.WasUsedInAggregation()); + EXPECT_TRUE(resolved_frame.IsSameFrameAsLastAggregation()); + EXPECT_FALSE(resolved_frame.IsNextFrameSinceLastAggregation()); + + resolved_frame.ResetAfterAggregation(); + + // Submit a new frame for the next aggregation. + SubmitCompositorFrame(MakeSimpleFrame()); + resolved_frame.UpdateForActiveFrame(render_pass_id_generator_); + resolved_frame.MarkAsUsedInAggregation(); + + EXPECT_FALSE(resolved_frame.IsSameFrameAsLastAggregation()); + EXPECT_TRUE(resolved_frame.IsNextFrameSinceLastAggregation()); + + resolved_frame.ResetAfterAggregation(); + + // Submit two new frames before the next aggregation. The damage rect from + // last frame aggregated + SubmitCompositorFrame(MakeSimpleFrame()); + SubmitCompositorFrame(MakeSimpleFrame()); + resolved_frame.UpdateForActiveFrame(render_pass_id_generator_); + resolved_frame.MarkAsUsedInAggregation(); + EXPECT_FALSE(resolved_frame.IsSameFrameAsLastAggregation()); + EXPECT_FALSE(resolved_frame.IsNextFrameSinceLastAggregation()); +} + +// Verifies that SetFullDamageForNextAggregation() +TEST_F(ResolvedFrameDataTest, SetFullDamageNextAggregation) { + Surface* surface = SubmitCompositorFrame(MakeSimpleFrame()); + ResolvedFrameData resolved_frame(&resource_provider_, surface, 0u); + + // First aggregation to setup existing state. + resolved_frame.UpdateForActiveFrame(render_pass_id_generator_); + resolved_frame.MarkAsUsedInAggregation(); + resolved_frame.ResetAfterAggregation(); + + resolved_frame.SetFullDamageForNextAggregation(); + + // Second aggregation with a new frame that has smaller damage rect. + constexpr gfx::Rect damage_rect(10, 10); + SubmitCompositorFrame(MakeSimpleFrame(damage_rect)); + resolved_frame.UpdateForActiveFrame(render_pass_id_generator_); + resolved_frame.MarkAsUsedInAggregation(); + + // This is the next frame so normally it would use `damage_rect` for damage. + // SetFullDamageForNextAggregation() changes that so the full output_rect is + // damaged. + EXPECT_FALSE(resolved_frame.IsNextFrameSinceLastAggregation()); + EXPECT_FALSE(resolved_frame.IsSameFrameAsLastAggregation()); + EXPECT_EQ(resolved_frame.GetSurfaceDamage(false), kOutputRect); } } // namespace
diff --git a/components/viz/service/display/surface_aggregator.cc b/components/viz/service/display/surface_aggregator.cc index 24d580b..ce6baf8 100644 --- a/components/viz/service/display/surface_aggregator.cc +++ b/components/viz/service/display/surface_aggregator.cc
@@ -318,60 +318,6 @@ ProcessAddedAndRemovedSurfaces(); } -int SurfaceAggregator::ChildIdForSurface(Surface* surface) { - auto it = surface_id_to_resource_child_id_.find(surface->surface_id()); - if (it == surface_id_to_resource_child_id_.end()) { - int child_id = provider_->CreateChild( - base::BindRepeating(&SurfaceClient::UnrefResources, surface->client()), - surface->surface_id()); - surface_id_to_resource_child_id_[surface->surface_id()] = child_id; - return child_id; - } else { - return it->second; - } -} - -gfx::Rect SurfaceAggregator::DamageRectForSurface( - const ResolvedFrameData& resolved_frame, - bool include_per_quad_damage) const { - const Surface* surface = resolved_frame.surface(); - - // The |damage_rect| set in |SurfaceAnimationManager| is the |output_rect|. - // However, we dont use |damage_rect| because when we transition from - // interpolated frame we would end up using the |damage_rect| from the - // original non interpolated frame. - // TODO(vmpstr): This damage may be too large, but I think it's hard to figure - // out a small bounds on the damage given an animation that happens in - // SurfaceAnimationManager. - if (surface->HasSurfaceAnimationDamage()) - return resolved_frame.GetOutputRect(); - - // TODO(crbug.com/1194082): Cache the previous frame_index in - // ResolvedFrameData to avoid multiple maps lookups here. - auto it = previous_contained_surfaces_.find(surface->surface_id()); - if (it != previous_contained_surfaces_.end()) { - uint64_t previous_index = it->second; - // The resolved frame index is unchanged from last aggregation so there is - // no damage. - if (previous_index == surface->GetActiveFrameIndex()) - return gfx::Rect(); - } - - const SurfaceId& previous_surface_id = surface->previous_frame_surface_id(); - if (surface->surface_id() != previous_surface_id) { - it = previous_contained_surfaces_.find(previous_surface_id); - } - - if (it != previous_contained_surfaces_.end()) { - uint64_t previous_index = it->second; - if (previous_index == surface->GetActiveFrameIndex() - 1) { - return resolved_frame.GetDamageRect(include_per_quad_damage); - } - } - - return resolved_frame.GetOutputRect(); -} - // This function is called at each render pass - CopyQuadsToPass(). void SurfaceAggregator::AddRenderPassFilterDamageToDamageList( const ResolvedFrameData& resolved_frame, @@ -445,7 +391,7 @@ if (RenderPassNeedsFullDamage(resolved_frame->GetRootRenderPassData())) { damage_rect = resolved_frame->GetOutputRect(); } else { - damage_rect = DamageRectForSurface(*resolved_frame, false); + damage_rect = resolved_frame->GetSurfaceDamage(false); } } @@ -543,7 +489,6 @@ auto iter = resolved_frames_.find(surface_id); if (iter != resolved_frames_.end()) { TRACE_EVENT0("viz", "SurfaceAggregator::SurfaceDestroyed"); - ReleaseResources(surface_id); resolved_frames_.erase(iter); } } @@ -586,25 +531,37 @@ return nullptr; } + uint64_t prev_frame_index = 0u; + // If this is the first frame in a new surface there might be damage + // compared to the previous frame in a different surface. + if (surface->surface_id() != surface->previous_frame_surface_id()) { + auto prev_resolved_frame_iter = + resolved_frames_.find(surface->previous_frame_surface_id()); + if (prev_resolved_frame_iter != resolved_frames_.end()) { + prev_frame_index = + prev_resolved_frame_iter->second.previous_frame_index(); + } + } + iter = resolved_frames_ - .emplace(std::piecewise_construct, - std::forward_as_tuple(surface_id), - std::forward_as_tuple(surface->surface_id(), surface)) + .emplace( + std::piecewise_construct, std::forward_as_tuple(surface_id), + std::forward_as_tuple(provider_, surface, prev_frame_index)) .first; } ResolvedFrameData& resolved_frame = iter->second; Surface* surface = resolved_frame.surface(); - // Mark the frame as used this aggregation so it persists. - bool first_use = is_inside_aggregate_ ? resolved_frame.MarkAsUsed() : true; + if (is_inside_aggregate_ && !resolved_frame.WasUsedInAggregation()) { + // Mark the frame as used this aggregation so it persists. + resolved_frame.MarkAsUsedInAggregation(); - if (first_use) { // If there is a new CompositorFrame for `surface` compute resolved frame // data for the new resolved CompositorFrame. - if (resolved_frame.frame_index() != surface->GetActiveFrameIndex() || + if (resolved_frame.previous_frame_index() != + surface->GetActiveFrameIndex() || surface->HasSurfaceAnimationDamage()) { - DCHECK(is_inside_aggregate_); base::ElapsedTimer timer; ProcessResolvedFrame(resolved_frame); stats_->declare_resources_time += timer.Elapsed(); @@ -1514,11 +1471,11 @@ } void SurfaceAggregator::ProcessAddedAndRemovedSurfaces() { - for (const auto& surface : previous_contained_surfaces_) { - if (!contained_surfaces_.count(surface.first)) - // Release resources of removed surface. - ReleaseResources(surface.first); - } + // Delete resolved frame data that wasn't used this aggregation. This releases + // resources associated with those resolved frames. + base::EraseIf(resolved_frames_, [](auto& entry) { + return !entry.second.WasUsedInAggregation(); + }); } gfx::Rect SurfaceAggregator::PrewalkRenderPass( @@ -1558,7 +1515,7 @@ // accumulated from all quads in the surface, and needs to be expanded by any // pixel-moving backdrop filter in the render pass if intersecting. Transform // this damage into the local space of the render pass for this purpose. - gfx::Rect surface_root_rp_damage = DamageRectForSurface(resolved_frame, true); + gfx::Rect surface_root_rp_damage = resolved_frame.GetSurfaceDamage(true); if (!surface_root_rp_damage.IsEmpty()) { gfx::Transform root_to_target_transform( gfx::Transform::kSkipInitialization); @@ -1786,27 +1743,18 @@ surface->GetActiveOrInterpolatedFrame(); auto& resource_list = compositor_frame.resource_list; - int child_id = ChildIdForSurface(surface); - // Ref the resources in the surface, and let the provider know we've received // new resources from the compositor frame. if (surface->client()) surface->client()->RefResources(resource_list); - provider_->ReceiveFromChild(child_id, resource_list); stats_->declare_resources_count += resource_list.size(); - ResourceIdSet resource_set = resolved_frame.UpdateForActiveFrame( - provider_->GetChildToParentMap(child_id), render_pass_id_generator_); - - // Declare the used resources to the provider. This will cause all resources - // that were received but not used in the render passes to be unreferenced in - // the surface, and returned to the child in the resource provider. - provider_->DeclareUsedResourcesFromChild(child_id, resource_set); + resolved_frame.UpdateForActiveFrame(render_pass_id_generator_); } bool SurfaceAggregator::CheckFrameSinksChanged(const Surface* surface) { - contained_surfaces_[surface->surface_id()] = surface->GetActiveFrameIndex(); + contained_surfaces_.insert(surface->surface_id()); LocalSurfaceId& local_surface_id = contained_frame_sinks_[surface->surface_id().frame_sink_id()]; bool frame_sinks_changed = (!previous_contained_frame_sinks_.contains( @@ -1839,7 +1787,7 @@ parent_pass->aggregation().embedded_passes.insert(&root_resolved_pass); } - gfx::Rect damage_rect = DamageRectForSurface(resolved_frame, true); + gfx::Rect damage_rect = resolved_frame.GetSurfaceDamage(true); // Avoid infinite recursion by adding current surface to // |referenced_surfaces_|. @@ -2122,8 +2070,8 @@ ResetAfterAggregate(); - for (auto it : previous_contained_surfaces_) { - surface = manager_->GetSurfaceForId(it.first); + for (auto& surface_id : previous_contained_surfaces_) { + surface = manager_->GetSurfaceForId(surface_id); if (surface) { surface->allocation_group()->TakeAggregatedLatencyInfoUpTo( surface, &frame.latency_info); @@ -2187,26 +2135,15 @@ contained_surfaces_.clear(); contained_frame_sinks_.clear(); - // Delete resolved frame data that wasn't used this frame. - base::EraseIf(resolved_frames_, [](auto& entry) { - return !entry.second.CheckIfUsedAndReset(); - }); -} - -void SurfaceAggregator::ReleaseResources(const SurfaceId& surface_id) { - auto it = surface_id_to_resource_child_id_.find(surface_id); - if (it != surface_id_to_resource_child_id_.end()) { - provider_->DestroyChild(it->second); - surface_id_to_resource_child_id_.erase(it); - } + // Reset resolved frame data from this aggregation. + for (auto& [surface_id, resolved_frame] : resolved_frames_) + resolved_frame.ResetAfterAggregation(); } void SurfaceAggregator::SetFullDamageForSurface(const SurfaceId& surface_id) { - auto it = previous_contained_surfaces_.find(surface_id); - if (it == previous_contained_surfaces_.end()) - return; - // Set the last drawn index as 0 to ensure full damage next time it's drawn. - it->second = 0; + auto iter = resolved_frames_.find(surface_id); + if (iter != resolved_frames_.end()) + iter->second.SetFullDamageForNextAggregation(); } void SurfaceAggregator::SetDisplayColorSpaces( @@ -2221,12 +2158,16 @@ bool SurfaceAggregator::NotifySurfaceDamageAndCheckForDisplayDamage( const SurfaceId& surface_id) { - if (previous_contained_surfaces_.count(surface_id)) { - Surface* surface = manager_->GetSurfaceForId(surface_id); - if (surface) { - DCHECK(surface->HasActiveFrame()); - if (surface->GetActiveOrInterpolatedFrame().resource_list.empty()) - ReleaseResources(surface_id); + auto iter = resolved_frames_.find(surface_id); + if (iter != resolved_frames_.end()) { + auto& resolved_frame = iter->second; + DCHECK(resolved_frame.surface()->HasActiveFrame()); + if (resolved_frame.surface() + ->GetActiveOrInterpolatedFrame() + .resource_list.empty()) { + // When a client submits a CompositorFrame without resources it's + // typically done to force return of existing resources to the client. + resolved_frame.ForceReleaseResource(); } return true; }
diff --git a/components/viz/service/display/surface_aggregator.h b/components/viz/service/display/surface_aggregator.h index 03482fd..ba8cd25 100644 --- a/components/viz/service/display/surface_aggregator.h +++ b/components/viz/service/display/surface_aggregator.h
@@ -40,7 +40,6 @@ class VIZ_SERVICE_EXPORT SurfaceAggregator : public SurfaceObserver { public: - using SurfaceIndexMap = base::flat_map<SurfaceId, uint64_t>; using FrameSinkIdMap = base::flat_map<FrameSinkId, LocalSurfaceId>; // To control when to add an extra render pass to avoid readback from the @@ -97,7 +96,7 @@ // Aggregate() to make sure no CompositorFrame did arrive between the calls. const ResolvedFrameData* GetLatestFrameData(const SurfaceId& surface_id); - const SurfaceIndexMap& previous_contained_surfaces() const { + const base::flat_set<SurfaceId>& previous_contained_surfaces() const { return previous_contained_surfaces_; } const FrameSinkIdMap& previous_contained_frame_sinks() const { @@ -138,8 +137,6 @@ // SurfaceObserver implementation. void OnSurfaceDestroyed(const SurfaceId& surface_id) override; - void ReleaseResources(const SurfaceId& surface_id); - // Get resolved frame data for the resolved surfaces active frame. Returns // null if there is no matching surface or the surface doesn't have an active // CompositorFrame. @@ -281,10 +278,6 @@ bool CheckFrameSinksChanged(const Surface* surface); - int ChildIdForSurface(Surface* surface); - gfx::Rect DamageRectForSurface(const ResolvedFrameData& resolved_frame, - bool include_per_quad_damage) const; - // This function adds a damage rect to |surface_damage_rect_list_|. The // surface damage rect comes from |resolved_frame| if provided, otherwise // |default_damage_rect| will be used. @@ -417,8 +410,6 @@ // Persistent storage for ResolvedFrameData. std::map<SurfaceId, ResolvedFrameData> resolved_frames_; - base::flat_map<SurfaceId, int> surface_id_to_resource_child_id_; - // The following state is only valid for the duration of one Aggregate call // and is only stored on the class to avoid having to pass through every // function call. @@ -434,8 +425,8 @@ // For each Surface used in the last aggregation, gives the frame_index at // that time. - SurfaceIndexMap previous_contained_surfaces_; - SurfaceIndexMap contained_surfaces_; + base::flat_set<SurfaceId> previous_contained_surfaces_; + base::flat_set<SurfaceId> contained_surfaces_; FrameSinkIdMap previous_contained_frame_sinks_; FrameSinkIdMap contained_frame_sinks_;
diff --git a/components/viz/service/display/surface_aggregator_unittest.cc b/components/viz/service/display/surface_aggregator_unittest.cc index 481853d..6d1dff16 100644 --- a/components/viz/service/display/surface_aggregator_unittest.cc +++ b/components/viz/service/display/surface_aggregator_unittest.cc
@@ -554,14 +554,12 @@ void VerifyExpectedSurfaceIds( const std::vector<SurfaceId>& expected_surface_ids) { - EXPECT_EQ(expected_surface_ids.size(), - aggregator_.previous_contained_surfaces().size()); + EXPECT_THAT(aggregator_.previous_contained_surfaces(), + testing::UnorderedElementsAreArray(expected_surface_ids)); + EXPECT_EQ(expected_surface_ids.size(), aggregator_.previous_contained_frame_sinks().size()); - for (const SurfaceId& surface_id : expected_surface_ids) { - EXPECT_THAT(aggregator_.previous_contained_surfaces(), - testing::Contains(testing::Key(surface_id))); EXPECT_THAT( aggregator_.previous_contained_frame_sinks(), testing::Contains(testing::Pair(surface_id.frame_sink_id(),
diff --git a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc index f10f27db..5075c12 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc +++ b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc
@@ -530,6 +530,10 @@ if (result != GrSemaphoresSubmitted::kYes && !(begin_semaphores.empty() && end_semaphores_empty)) { + if (!return_release_fence_cb.is_null()) { + PostTaskToClientThread(base::BindOnce( + std::move(return_release_fence_cb), gfx::GpuFenceHandle())); + } // TODO(penghuang): handle vulkan device lost. FailedSkiaFlush("output_sk_surface()->flush() failed."); return; @@ -679,6 +683,10 @@ auto result = surface->flush(flush_info); if (result != GrSemaphoresSubmitted::kYes && !(begin_semaphores.empty() && end_semaphores.empty())) { + if (!return_release_fence_cb.is_null()) { + PostTaskToClientThread(base::BindOnce( + std::move(return_release_fence_cb), gfx::GpuFenceHandle())); + } // TODO(penghuang): handle vulkan device lost. FailedSkiaFlush("offscreen.surface()->flush() failed."); return;
diff --git a/components/viz/service/frame_sinks/compositor_frame_sink_support.h b/components/viz/service/frame_sinks/compositor_frame_sink_support.h index 704adeff..6976efa6 100644 --- a/components/viz/service/frame_sinks/compositor_frame_sink_support.h +++ b/components/viz/service/frame_sinks/compositor_frame_sink_support.h
@@ -29,6 +29,7 @@ #include "components/viz/service/frame_sinks/surface_resource_holder_client.h" #include "components/viz/service/frame_sinks/video_capture/capturable_frame_sink.h" #include "components/viz/service/hit_test/hit_test_aggregator.h" +#include "components/viz/service/surfaces/frame_index_constants.h" #include "components/viz/service/surfaces/surface_client.h" #include "components/viz/service/transitions/surface_animation_manager.h" #include "components/viz/service/viz_service_export.h" @@ -69,8 +70,6 @@ const gfx::Rect& damage_rect, base::TimeTicks expected_display_time)>; - static constexpr uint64_t kFrameIndexStart = 2; - // Determines maximum number of allowed undrawn frames. Once this limit is // exceeded, we throttle sBeginFrames to 1 per second. Limit must be at least // 1, as the relative ordering of renderer / browser frame submissions allows
diff --git a/components/viz/service/frame_sinks/surface_synchronization_unittest.cc b/components/viz/service/frame_sinks/surface_synchronization_unittest.cc index 7aa65b0..ef57c2c 100644 --- a/components/viz/service/frame_sinks/surface_synchronization_unittest.cc +++ b/components/viz/service/frame_sinks/surface_synchronization_unittest.cc
@@ -8,6 +8,7 @@ #include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" #include "components/viz/service/frame_sinks/compositor_frame_sink_support.h" #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h" +#include "components/viz/service/surfaces/frame_index_constants.h" #include "components/viz/service/surfaces/surface.h" #include "components/viz/service/surfaces/surface_allocation_group.h" #include "components/viz/test/begin_frame_args_test.h" @@ -2129,7 +2130,7 @@ child_support2().SubmitCompositorFrame(child_id2.local_surface_id(), MakeDefaultCompositorFrame()); EXPECT_TRUE(parent_surface()->HasActiveFrame()); - uint64_t expected_index = CompositorFrameSinkSupport::kFrameIndexStart; + uint64_t expected_index = kFrameIndexStart; EXPECT_EQ(expected_index, parent_surface()->GetActiveFrameIndex()); }
diff --git a/components/viz/service/surfaces/frame_index_constants.h b/components/viz/service/surfaces/frame_index_constants.h new file mode 100644 index 0000000..9f17535 --- /dev/null +++ b/components/viz/service/surfaces/frame_index_constants.h
@@ -0,0 +1,19 @@ +// 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_VIZ_SERVICE_SURFACES_FRAME_INDEX_CONSTANTS_H_ +#define COMPONENTS_VIZ_SERVICE_SURFACES_FRAME_INDEX_CONSTANTS_H_ + +#include <cstdint> + +namespace viz { + +// Frame index values for the first frame received by from a viz client and an +// invalid value that will never be assigned to a frame. +inline constexpr uint64_t kFrameIndexStart = 2; +inline constexpr uint64_t kInvalidFrameIndex = 0; + +} // namespace viz + +#endif // COMPONENTS_VIZ_SERVICE_SURFACES_FRAME_INDEX_CONSTANTS_H_
diff --git a/components/viz/service/surfaces/surface.h b/components/viz/service/surfaces/surface.h index 565c043..64b14c1 100644 --- a/components/viz/service/surfaces/surface.h +++ b/components/viz/service/surfaces/surface.h
@@ -26,6 +26,7 @@ #include "components/viz/common/quads/compositor_frame.h" #include "components/viz/common/surfaces/frame_sink_id.h" #include "components/viz/common/surfaces/surface_info.h" +#include "components/viz/service/surfaces/frame_index_constants.h" #include "components/viz/service/surfaces/pending_copy_output_request.h" #include "components/viz/service/surfaces/surface_client.h" #include "components/viz/service/surfaces/surface_dependency_deadline.h" @@ -216,7 +217,8 @@ // Returns a number that increments by 1 every time a new frame is enqueued. uint64_t GetActiveFrameIndex() const { - return active_frame_data_ ? active_frame_data_->frame_index : 0; + return active_frame_data_ ? active_frame_data_->frame_index + : kInvalidFrameIndex; } void TakeActiveLatencyInfo(std::vector<ui::LatencyInfo>* latency_info);
diff --git a/components/viz/test/compositor_frame_helpers.cc b/components/viz/test/compositor_frame_helpers.cc index 2d8592a9..355ce75 100644 --- a/components/viz/test/compositor_frame_helpers.cc +++ b/components/viz/test/compositor_frame_helpers.cc
@@ -15,6 +15,7 @@ #include "components/viz/common/quads/solid_color_draw_quad.h" #include "components/viz/common/quads/surface_draw_quad.h" #include "components/viz/common/quads/texture_draw_quad.h" +#include "components/viz/common/quads/yuv_video_draw_quad.h" #include "components/viz/common/resources/resource_id.h" namespace viz { @@ -229,6 +230,25 @@ return *this; } +RenderPassBuilder& RenderPassBuilder::SetQuadDamageRect( + const gfx::Rect& damage_rect) { + CHECK(!pass_->quad_list.empty()); + DrawQuad* quad = pass_->quad_list.back(); + + if (quad->material == DrawQuad::Material::kTextureContent) { + auto* texture_quad = static_cast<TextureDrawQuad*>(quad); + texture_quad->damage_rect = damage_rect; + } else if (quad->material == DrawQuad::Material::kYuvVideoContent) { + auto* yuv_video_quad = static_cast<YUVVideoDrawQuad*>(quad); + yuv_video_quad->damage_rect = damage_rect; + } else { + NOTREACHED(); + } + + pass_->has_per_quad_damage = true; + return *this; +} + RenderPassBuilder& RenderPassBuilder::SetBlendMode(SkBlendMode blend_mode) { GetLastQuadSharedQuadState()->blend_mode = blend_mode; return *this; @@ -428,12 +448,16 @@ CompositorFrame MakeCompositorFrame( std::unique_ptr<CompositorRenderPass> render_pass) { - return CompositorFrameBuilder().AddRenderPass(std::move(render_pass)).Build(); + return CompositorFrameBuilder() + .AddRenderPass(std::move(render_pass)) + .PopulateResources() + .Build(); } CompositorFrame MakeCompositorFrame(CompositorRenderPassList render_pass_list) { return CompositorFrameBuilder() .SetRenderPassList(std::move(render_pass_list)) + .PopulateResources() .Build(); }
diff --git a/components/viz/test/compositor_frame_helpers.h b/components/viz/test/compositor_frame_helpers.h index a2e6141..00206b0 100644 --- a/components/viz/test/compositor_frame_helpers.h +++ b/components/viz/test/compositor_frame_helpers.h
@@ -150,6 +150,10 @@ // Sets SharedQuadState::clip_rect for the last quad. RenderPassBuilder& SetQuadClipRect(absl::optional<gfx::Rect> clip_rect); + // Sets the damage_rect for the last quad. This is only valid to call if the + // last quad has a `damage_rect` member. + RenderPassBuilder& SetQuadDamageRect(const gfx::Rect& damage_rect); + // Sets SharedQuadState::blend_mode for the last quad. RenderPassBuilder& SetBlendMode(SkBlendMode blend_mode);
diff --git a/content/BUILD.gn b/content/BUILD.gn index 5143494..8ab17def 100644 --- a/content/BUILD.gn +++ b/content/BUILD.gn
@@ -104,6 +104,11 @@ "//url/mojom:url_mojom_origin_js", "//url/mojom:url_mojom_origin_webui_js", ] + + # TODO(abigailbklein): Remove this when ReadAnythingAppController is wired up. + if (!is_android) { + deps += [ "//ui/gfx/mojom:mojom_js" ] + } } grit("dev_ui_content_resources") {
diff --git a/content/browser/accessibility/browser_accessibility_manager_fuchsia.cc b/content/browser/accessibility/browser_accessibility_manager_fuchsia.cc index c3337ef..17683bf 100644 --- a/content/browser/accessibility/browser_accessibility_manager_fuchsia.cc +++ b/content/browser/accessibility/browser_accessibility_manager_fuchsia.cc
@@ -6,12 +6,15 @@ #include <lib/sys/inspect/cpp/component.h> +#include "base/fuchsia/fuchsia_logging.h" #include "content/browser/accessibility/browser_accessibility_fuchsia.h" #include "content/public/browser/web_contents.h" #include "ui/accessibility/platform/fuchsia/accessibility_bridge_fuchsia_registry.h" namespace content { +const size_t kInspectNodeMaxSize = 16 * 1024 * 1024; + // static BrowserAccessibilityManager* BrowserAccessibilityManager::Create( const ui::AXTreeUpdate& initial_tree, @@ -37,10 +40,20 @@ if (accessibility_bridge) { inspect_node_ = accessibility_bridge->GetInspectNode(); tree_dump_node_ = inspect_node_.CreateLazyNode("tree-data", [this]() { - inspect::Inspector inspector; + inspect::Inspector inspector{{.maximum_size = kInspectNodeMaxSize}}; - inspector.GetRoot().CreateString(ax_tree_id().ToString(), - ax_tree()->ToString(), &inspector); + auto str = ax_tree()->ToString(); + auto str_capacity = str.capacity(); + inspector.GetRoot().CreateString(ax_tree_id().ToString(), std::move(str), + &inspector); + + // Test to check if the string fit in memory. + if (inspector.GetStats().failed_allocations > 0) { + ZX_LOG(WARNING, ZX_OK) + << "Inspector had failed allocations. Some semantic tree data may " + "be missing. Size of the string we tried to store: " + << str_capacity << " bytes"; + } return fpromise::make_ok_promise(inspector); });
diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc index 9729df85..5ac71295 100644 --- a/content/browser/child_process_security_policy_unittest.cc +++ b/content/browser/child_process_security_policy_unittest.cc
@@ -3187,7 +3187,8 @@ EXPECT_TRUE(foo_instance->HasSite()); EXPECT_EQ(foo_instance->GetSiteInfo(), SiteInfo::CreateForDefaultSiteInstance( - &context, StoragePartitionConfig::CreateDefault(&context), + foo_instance->GetIsolationContext(), + StoragePartitionConfig::CreateDefault(&context), WebExposedIsolationInfo::CreateNonIsolated())); EXPECT_FALSE(foo_instance->RequiresDedicatedProcess()); }
diff --git a/content/browser/devtools/protocol/tracing_handler.cc b/content/browser/devtools/protocol/tracing_handler.cc index bb1f21a..3b5fd32 100644 --- a/content/browser/devtools/protocol/tracing_handler.cc +++ b/content/browser/devtools/protocol/tracing_handler.cc
@@ -16,6 +16,7 @@ #include "base/format_macros.h" #include "base/json/json_writer.h" #include "base/memory/ref_counted_memory.h" +#include "base/numerics/safe_conversions.h" #include "base/strings/strcat.h" #include "base/strings/string_split.h" #include "base/strings/stringprintf.h" @@ -64,6 +65,7 @@ const double kMinimumReportingInterval = 250.0; const char kRecordModeParam[] = "record_mode"; +const char kTraceBufferSizeInKb[] = "trace_buffer_size_in_kb"; // Frames need to be at least 1x1, otherwise nothing would be captured. constexpr gfx::Size kMinFrameSize = gfx::Size(1, 1); @@ -1149,6 +1151,11 @@ base::Value config = ConvertDictKeyStyle(devtools_config); if (std::string* mode = config.FindStringPath(kRecordModeParam)) config.SetStringPath(kRecordModeParam, ConvertFromCamelCase(*mode, '-')); + if (absl::optional<double> buffer_size = + config.FindDoublePath(kTraceBufferSizeInKb)) { + config.SetIntKey(kTraceBufferSizeInKb, + base::saturated_cast<size_t>(buffer_size.value())); + } return base::trace_event::TraceConfig(config); }
diff --git a/content/browser/devtools/protocol/tracing_handler_unittest.cc b/content/browser/devtools/protocol/tracing_handler_unittest.cc index dbc15fbc..6ea7e15 100644 --- a/content/browser/devtools/protocol/tracing_handler_unittest.cc +++ b/content/browser/devtools/protocol/tracing_handler_unittest.cc
@@ -40,7 +40,8 @@ "}" "]" "}," - "\"record_mode\":\"record-continuously\"" + "\"record_mode\":\"record-continuously\"," + "\"trace_buffer_size_in_kb\":262144" "}"; const char kCustomTraceConfigStringDevToolsStyle[] = @@ -67,7 +68,8 @@ "}" "]" "}," - "\"recordMode\":\"recordContinuously\"" + "\"recordMode\":\"recordContinuously\"," + "\"traceBufferSizeInKb\":262144" "}"; } // namespace
diff --git a/content/browser/interest_group/ad_auction_service_impl.cc b/content/browser/interest_group/ad_auction_service_impl.cc index 0c848e6e..9de711c 100644 --- a/content/browser/interest_group/ad_auction_service_impl.cc +++ b/content/browser/interest_group/ad_auction_service_impl.cc
@@ -503,8 +503,10 @@ DCHECK(render_url->is_valid()); std::move(callback).Run(render_url); - auction_result_metrics->ReportAuctionResult( - AdAuctionResultMetrics::AuctionResult::kSucceeded); + if (auction_result_metrics) { + auction_result_metrics->ReportAuctionResult( + AdAuctionResultMetrics::AuctionResult::kSucceeded); + } GetInterestGroupManager().EnqueueReports( report_urls, debug_win_report_urls, debug_loss_report_urls, origin(), GetClientSecurityState(), GetRefCountedTrustedURLLoaderFactory());
diff --git a/content/browser/site_info.cc b/content/browser/site_info.cc index 45713abc..6bf82ea 100644 --- a/content/browser/site_info.cc +++ b/content/browser/site_info.cc
@@ -188,11 +188,13 @@ // static SiteInfo SiteInfo::CreateForDefaultSiteInstance( - BrowserContext* browser_context, + const IsolationContext& isolation_context, const StoragePartitionConfig storage_partition_config, const WebExposedIsolationInfo& web_exposed_isolation_info) { // Get default JIT policy for this browser_context by passing in an empty // site_url. + BrowserContext* browser_context = + isolation_context.browser_or_resource_context().ToBrowserContext(); bool is_jit_disabled = GetContentClient()->browser()->IsJitDisabledForSite( browser_context, GURL()); @@ -200,7 +202,7 @@ SiteInstanceImpl::GetDefaultSiteURL(), false /* requires_origin_keyed_process */, false /* is_sandboxed */, storage_partition_config, - web_exposed_isolation_info, false /* is_guest */, + web_exposed_isolation_info, isolation_context.is_guest(), false /* does_site_request_dedicated_process_for_coop */, is_jit_disabled, false /* is_pdf */); }
diff --git a/content/browser/site_info.h b/content/browser/site_info.h index 9467368..1ffbe88 100644 --- a/content/browser/site_info.h +++ b/content/browser/site_info.h
@@ -52,9 +52,11 @@ // Helper to create a SiteInfo for default SiteInstances. Default // SiteInstances are used for non-isolated sites on platforms without strict - // site isolation, such as on Android. + // site isolation, such as on Android. They may also be used on desktop + // platforms when strict site isolation is explicitly turned off (e.g., via + // switches::kDisableSiteIsolation). static SiteInfo CreateForDefaultSiteInstance( - BrowserContext* browser_context, + const IsolationContext& isolation_context, const StoragePartitionConfig storage_partition_config, const WebExposedIsolationInfo& web_exposed_isolation_info);
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc index 467325b..2ffea6d 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc
@@ -460,7 +460,7 @@ default_site_instance_state_ = std::make_unique<DefaultSiteInstanceState>(); original_url_ = GetDefaultSiteURL(); SetSiteInfoInternal(SiteInfo::CreateForDefaultSiteInstance( - GetBrowserContext(), storage_partition_config, + GetIsolationContext(), storage_partition_config, browsing_instance_->web_exposed_isolation_info())); } @@ -1135,7 +1135,7 @@ CanBePlacedInDefaultSiteInstance(GetIsolationContext(), url_info.url, site_info)) { site_info = SiteInfo::CreateForDefaultSiteInstance( - GetBrowserContext(), site_info.storage_partition_config(), + GetIsolationContext(), site_info.storage_partition_config(), GetWebExposedIsolationInfo()); }
diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc index cbf35d2..519e32f 100644 --- a/content/browser/site_instance_impl_unittest.cc +++ b/content/browser/site_instance_impl_unittest.cc
@@ -509,7 +509,7 @@ EXPECT_TRUE(site_instance->HasSite()); EXPECT_EQ(site_instance->GetSiteInfo(), SiteInfo::CreateForDefaultSiteInstance( - &browser_context, + site_instance->GetIsolationContext(), StoragePartitionConfig::CreateDefault(&browser_context), WebExposedIsolationInfo::CreateNonIsolated())); EXPECT_FALSE(site_instance->RequiresDedicatedProcess());
diff --git a/content/browser/webui/shared_resources_data_source.cc b/content/browser/webui/shared_resources_data_source.cc index 1c958f3..447fd63 100644 --- a/content/browser/webui/shared_resources_data_source.cc +++ b/content/browser/webui/shared_resources_data_source.cc
@@ -55,6 +55,11 @@ IDR_URL_MOJO_HTML, IDR_URL_MOJO_JS, #endif // !BUILDFLAG(IS_CHROMEOS_ASH) + +// TODO(abigailbklein): Remove this when ReadAnythingAppController is wired up. +#if !BUILDFLAG(IS_ANDROID) + IDR_TRANSFORM_MOJO_WEBUI_JS, +#endif }; }
diff --git a/content/content_resources.grd b/content/content_resources.grd index 21d50c1..9c1a1b5 100644 --- a/content/content_resources.grd +++ b/content/content_resources.grd
@@ -36,9 +36,14 @@ <include name="IDR_ORIGIN_MOJO_WEBUI_JS" file="${root_gen_dir}/mojom-webui/url/mojom/origin.mojom-webui.js" resource_path="mojo/url/mojom/origin.mojom-webui.js" use_base_dir="false" type="BINDATA" /> <include name="IDR_RANGE_MOJOM_WEBUI_JS" file="${root_gen_dir}/mojom-webui/ui/gfx/range/mojom/range.mojom-webui.js" resource_path="mojo/ui/gfx/range/mojom/range.mojom-webui.js" use_base_dir="false" type="BINDATA" /> <include name="IDR_TOKEN_MOJO_WEBUI_JS" file="${root_gen_dir}/mojom-webui/mojo/public/mojom/base/token.mojom-webui.js" resource_path="mojo/mojo/public/mojom/base/token.mojom-webui.js" use_base_dir="false" type="BINDATA" /> + <!-- TODO(abigailbklein): Remove this when ReadAnythingAppController is + wired up. --> + <if expr="not is_android"> + <include name="IDR_TRANSFORM_MOJO_WEBUI_JS" file="${root_gen_dir}/mojom-webui/ui/gfx/mojom/transform.mojom-webui.js" resource_path="mojo/ui/gfx/mojom/transform.mojom-webui.js" use_base_dir="false" type="BINDATA" /> + </if> <if expr="chromeos_ash"> <include name="IDR_UI_WINDOW_OPEN_DISPOSITION_MOJO_JS" file="${root_gen_dir}/ui/base/mojom/window_open_disposition.mojom-lite.js" resource_path="mojo/ui/base/mojom/window_open_disposition.mojom-lite.js" use_base_dir="false" type="BINDATA" /> - </if> + </if> <include name="IDR_UI_WINDOW_OPEN_DISPOSITION_MOJO_WEBUI_JS" file="${root_gen_dir}/mojom-webui/ui/base/mojom/window_open_disposition.mojom-webui.js" resource_path="mojo/ui/base/mojom/window_open_disposition.mojom-webui.js" use_base_dir="false" type="BINDATA" /> <include name="IDR_UKM_INTERNALS_HTML" file="../components/ukm/debug/ukm_internals.html" type="BINDATA" /> <include name="IDR_UKM_INTERNALS_JS" file="${root_gen_dir}/components/ukm/debug/tsc/ukm_internals.js" use_base_dir="false" resource_path="ukm_internals.js" type="BINDATA" />
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 62eb22a..381c852 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -2266,7 +2266,6 @@ "../browser/payments/payment_manager_unittest.cc", "../browser/permissions/permission_controller_impl_unittest.cc", "../browser/picture_in_picture/picture_in_picture_service_impl_unittest.cc", - "../browser/plugin_list_unittest.cc", "../browser/prerender/prerender_host_registry_unittest.cc", "../browser/prerender/prerender_host_unittest.cc", "../browser/presentation/presentation_service_impl_unittest.cc", @@ -2983,8 +2982,8 @@ deps += [ "//ui/events:test_support" ] } - if (!is_win && !is_mac) { - sources -= [ "../browser/plugin_list_unittest.cc" ] + if (enable_plugins && (is_win || is_mac)) { + sources += [ "../browser/plugin_list_unittest.cc" ] } if (use_ozone) {
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt index 6c915fe..890586c 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt
@@ -572,6 +572,19 @@ crbug.com/678850 [ android android-nexus-5 ] conformance/more/functions/vertexAttribPointerBadArgs.html [ Failure ] crbug.com/678850 [ android android-nexus-5 ] conformance/attribs/gl-vertexattribpointer.html [ Failure ] +crbug.com/1338214 [ android android-Nexus-5 passthrough ] conformance/glsl/constructors/glsl-construct-bvec4.html [ Failure ] +crbug.com/1338214 [ android android-Nexus-5 passthrough ] conformance/glsl/constructors/glsl-construct-ivec3.html [ Failure ] +crbug.com/1338214 [ android android-Nexus-5 passthrough ] conformance/glsl/constructors/glsl-construct-ivec4.html [ Failure ] +crbug.com/1338214 [ android android-Nexus-5 passthrough ] conformance/glsl/constructors/glsl-construct-mat2.html [ Failure ] +crbug.com/1338214 [ android android-Nexus-5 passthrough ] conformance/glsl/constructors/glsl-construct-mat3.html [ Failure ] +crbug.com/1338214 [ android android-Nexus-5 passthrough ] conformance/glsl/constructors/glsl-construct-vec-mat-index.html [ Failure ] +crbug.com/1338214 [ android android-Nexus-5 passthrough ] conformance/glsl/constructors/glsl-construct-vec3.html [ Failure ] +crbug.com/1338214 [ android android-Nexus-5 passthrough ] conformance/glsl/constructors/glsl-construct-vec4.html [ Failure ] +crbug.com/1338214 [ android android-chromium android-Nexus-5 passthrough ] conformance/textures/misc/texture-npot-video.html [ Failure ] +crbug.com/1338214 [ android android-Nexus-5 passthrough ] conformance/textures/misc/texture-upload-size.html [ Failure ] +crbug.com/1338214 [ android android-Nexus-5 passthrough ] conformance/textures/misc/video-rotation.html [ Failure ] +crbug.com/1338214 [ android android-Nexus-5 passthrough ] WebglExtension_OES_texture_float_linear [ Failure ] + # Started failing after the upgrade to Marshmallow. crbug.com/1264880 [ android-marshmallow android-nexus-5 ] conformance/extensions/webgl-multi-draw.html [ Failure ] crbug.com/1264882 [ android-marshmallow android-nexus-5 ] conformance/glsl/bugs/sketchfab-lighting-shader-crash.html [ Failure ]
diff --git a/docs/updater/functional_spec.md b/docs/updater/functional_spec.md index f8a8dfe..95ff18e 100644 --- a/docs/updater/functional_spec.md +++ b/docs/updater/functional_spec.md
@@ -527,29 +527,29 @@ ### Update Timing The updater runs periodic tasks every hour, checking its own status, detecting -application uninstalls, and potential checking for updates (if it has been at -least 5 hours since the last update check). +application uninstalls, and potentially checking for updates. -TODO(crbug.com/1329868): implement the following algorithm. -The updater scatters its routine updates: -* Two updaters installed in identical situations and at the same time, after - some period of time, do not have synchronized times at which they check - for updates. - * For example, the updater may randomly choose to wait 6 hours instead of 5 to - perform the next check. The probability of choosing 6 hours is .1. - * The change only applies to users who have not overridden their - `UpdateCheckMs` feature. - * For testing purposes, the feature can be disabled by creating an - DWORD value `DisableUpdateAppsHourlyJitter` in `UpdateDev`. - * For testing purposes, an `UpdateDev` value can set the jitter time to a - constant value, in the same [0, 60) seconds range. The name of the value is - `AutoUpdateJitterMs` and it represents the time to wait before an update - check is made in milliseconds. -* The global load from updaters is scattered among the minutes of the hour, the - seconds of the minute, and the milliseconds of the second. - * For example, load spikes on the first minute of the hour, or - the first second of every minute, or even the first millisecond of every - second are undesirable. +The updater has a base update check period of 4.5 hours (though this can be +overridden by policy). Each time the updater runs routine tasks, the update +check is only run if the period has elapsed since the last check. + +Since the updater's periodic tasks are run every hour, in practice the update +check period is always rounded up to the nearest hour. + +To prevent multiple updaters from synchronizing their update checks (for +example, if a large cohort of machines is powered on at the the same time), +the updater will randomly use a longer update check period (120% of the normal +period) with 10% probability. + +The updater will always check for updates if the time since the last check is +negative (e.g. due to clock wander). + +Once the updater commits to checking for updates, it will delay the actual +check by a random number of milliseconds up to one minute. This avoids +sychronizing traffic to the first second of each minute (or the first +millisecond of each second). + +Background updates can be disabled entirely through policy. #### Windows Scheduling of Updates The update tasks are scheduled using the OS task scheduler.
diff --git a/extensions/browser/extension_function_histogram_value.h b/extensions/browser/extension_function_histogram_value.h index c0ce996..68acfaf 100644 --- a/extensions/browser/extension_function_histogram_value.h +++ b/extensions/browser/extension_function_histogram_value.h
@@ -1734,6 +1734,7 @@ ENTERPRISE_REMOTEAPPS_DELETEAPP = 1671, ENTERPRISEREPORTINGPRIVATE_GETAVINFO = 1672, ENTERPRISEREPORTINGPRIVATE_GETHOTFIXES = 1673, + AUTOTESTPRIVATE_GETACCESSTOKEN = 1674, // Last entry: Add new entries above, then run: // tools/metrics/histograms/update_extension_histograms.py ENUM_BOUNDARY
diff --git a/infra/config/generated/luci/commit-queue.cfg b/infra/config/generated/luci/commit-queue.cfg index cc22aba06..334b86d 100644 --- a/infra/config/generated/luci/commit-queue.cfg +++ b/infra/config/generated/luci/commit-queue.cfg
@@ -69,6 +69,11 @@ name: "chrome/try/chromeos-jacuzzi-nearby-chrome-fyi" experiment_percentage: 100 location_regexp: ".+/[+]/third_party/nearby/README.chromium" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/nearby/README.chromium" + } owner_whitelist_group: "googlers" owner_whitelist_group: "project-chromium-robot-committers" } @@ -273,6 +278,23 @@ location_regexp: ".+/[+]/.+/3pp/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".+/3pp/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/3pp-mac-amd64-packager" @@ -296,6 +318,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/android-12-x64-rel-compilator" @@ -326,6 +365,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/android-chrome-pie-x86-wpt-fyi-rel" @@ -344,6 +400,44 @@ location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" location_regexp_exclude: ".+/[+]/components/cronet/ios/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "components/cronet/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "components/grpc_support/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "build/android/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "build/config/android/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "components/cronet/ios/.+" + exclude: true + } } builders { name: "chromium/try/android-cronet-arm64-dbg" @@ -370,6 +464,44 @@ location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" location_regexp_exclude: ".+/[+]/components/cronet/ios/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "components/cronet/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "components/grpc_support/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "build/android/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "build/config/android/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "components/cronet/ios/.+" + exclude: true + } } builders { name: "chromium/try/android-cronet-x86-dbg-11-tests" @@ -412,6 +544,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/android-marshmallow-arm64-rel-compilator" @@ -426,6 +575,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/android-marshmallow-x86-rel-compilator" @@ -461,6 +627,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/android-pie-arm64-coverage-rel" @@ -480,12 +663,91 @@ location_regexp: ".+/[+]/third_party/arcore-android-sdk-client/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/android/features/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/android/java/src/org/chromium/chrome/browser/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/android/javatests/src/org/chromium/chrome/browser/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/browser/android/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/browser/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/browser/xr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "device/vr/android/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/gvr-android-sdk/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/arcore-android-sdk/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/arcore-android-sdk-client/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/android-pie-arm64-rel" location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/android-pie-arm64-rel-compilator" @@ -576,6 +838,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/android_compile_x64_dbg" @@ -589,6 +868,58 @@ location_regexp: ".+/[+]/third_party/gvr-android-sdk/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/android/java/src/org/chromium/chrome/browser/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/browser/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/browser/xr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "sandbox/linux/seccomp-bpf/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "sandbox/linux/seccomp-bpf-helpers/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "sandbox/linux/system_headers/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "sandbox/linux/tests/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/gvr-android-sdk/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/android_compile_x86_dbg" @@ -602,12 +933,81 @@ location_regexp: ".+/[+]/third_party/gvr-android-sdk/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/android/java/src/org/chromium/chrome/browser/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/browser/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/browser/xr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "sandbox/linux/seccomp-bpf/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "sandbox/linux/seccomp-bpf-helpers/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "sandbox/linux/system_headers/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "sandbox/linux/tests/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/gvr-android-sdk/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/android_cronet" location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/android_n5x_swarming_dbg" @@ -641,6 +1041,138 @@ location_regexp: ".+/[+]/ui/gl/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "cc/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/browser/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/browser/xr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "components/viz/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/test/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/audio/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/base/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/capture/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/filters/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/mojo/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/renderers/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/video/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "services/viz/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "testing/buildbot/tryserver.chromium.android.json" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "testing/trigger_scripts/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/mediastream/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/webcodecs/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/webgl/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/platform/graphics/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/clang/scripts/update.py" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/mb/mb_config_expectations/tryserver.chromium.android.json" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "ui/gl/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/android_unswarmed_pixel_aosp" @@ -650,17 +1182,44 @@ name: "chromium/try/branch-config-verifier" disable_reuse: true location_regexp: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + } } builders { name: "chromium/try/builder-config-verifier" disable_reuse: true location_regexp: ".+/[+]/infra/config/generated/builders/.*" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/generated/builders/.*" + } } builders { name: "chromium/try/cast_shell_android" location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/cast_shell_audio_linux" @@ -671,18 +1230,69 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/cast_shell_linux_arm64" location_regexp: ".+/[+]/chromecast/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chromecast/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/cast_shell_linux_dbg" location_regexp: ".+/[+]/chromecast/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chromecast/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/chromeos-amd64-generic-cfi-thin-lto-rel" @@ -694,6 +1304,28 @@ location_regexp: ".+/[+]/media/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/chromeos-amd64-generic-lacros-dbg" @@ -704,6 +1336,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/chromeos-amd64-generic-rel-compilator" @@ -718,6 +1367,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/chromeos-arm64-generic-rel" @@ -734,6 +1400,33 @@ location_regexp: ".+/[+]/chromeos/CHROMEOS_LKGM" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "build/chromeos/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "build/config/chromeos/.*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chromeos/CHROMEOS_LKGM" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/chromium_presubmit" @@ -754,6 +1447,73 @@ location_regexp: ".+/[+]/ui/gl/features.gni" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/test/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "testing/buildbot/chromium.dawn.json" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/webgpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/external/wpt/webgpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/wpt_internal/webgpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/WebGPUExpectations" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/dawn/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/webgpu-cts/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/clang/scripts/update.py" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "ui/gl/features.gni" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/dawn-mac-x64-deps-rel" @@ -770,6 +1530,73 @@ location_regexp: ".+/[+]/ui/gl/features.gni" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/test/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "testing/buildbot/chromium.dawn.json" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/webgpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/external/wpt/webgpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/wpt_internal/webgpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/WebGPUExpectations" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/dawn/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/webgpu-cts/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/clang/scripts/update.py" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "ui/gl/features.gni" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/dawn-try-mac-amd-exp" @@ -802,6 +1629,73 @@ location_regexp: ".+/[+]/ui/gl/features.gni" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/test/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "testing/buildbot/chromium.dawn.json" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/webgpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/external/wpt/webgpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/wpt_internal/webgpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/WebGPUExpectations" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/dawn/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/webgpu-cts/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/clang/scripts/update.py" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "ui/gl/features.gni" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/dawn-win10-x86-deps-rel" @@ -818,6 +1712,73 @@ location_regexp: ".+/[+]/ui/gl/features.gni" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/test/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "testing/buildbot/chromium.dawn.json" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/webgpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/external/wpt/webgpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/wpt_internal/webgpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/WebGPUExpectations" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/dawn/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/webgpu-cts/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/clang/scripts/update.py" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "ui/gl/features.gni" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/fuchsia-angle-try" @@ -828,6 +1789,23 @@ location_regexp: ".+/[+]/chromecast/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chromecast/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/fuchsia-binary-size" @@ -835,6 +1813,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/fuchsia-clang-tidy-rel" @@ -847,6 +1842,33 @@ location_regexp: ".+/[+]/media/fuchsia/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "base/fuchsia/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "fuchsia/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/fuchsia/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/fuchsia-deterministic-dbg" @@ -877,18 +1899,69 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/fuchsia_arm64" location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/fuchsia_x64" location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/gpu-fyi-try-android-l-nexus-5-32" @@ -1123,6 +2196,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/ios-simulator-cronet" @@ -1132,12 +2222,62 @@ location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" location_regexp_exclude: ".+/[+]/components/cronet/android/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "components/cronet/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "components/grpc_support/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "ios/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "components/cronet/android/.+" + exclude: true + } } builders { name: "chromium/try/ios-simulator-full-configs" location_regexp: ".+/[+]/ios/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "ios/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/ios-simulator-inverse-fieldtrials-fyi" @@ -1152,6 +2292,23 @@ location_regexp: ".+/[+]/third_party/crashpad/crashpad/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/crashpad/crashpad/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/ios-simulator-rts" @@ -1178,12 +2335,46 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/lacros-arm-generic-rel" location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/layout_test_leak_detection" @@ -1199,6 +2390,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux-angle-chromium-try" @@ -1236,6 +2444,38 @@ location_regexp: ".+/[+]/third_party/blink/renderer/platform/graphics/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "cc/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/core/paint/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/core/svg/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/platform/graphics/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux-blink-v8-sandbox-future-rel" @@ -1256,6 +2496,53 @@ location_regexp: ".+/[+]/chrome/test/data/webui/chromeos/chromebox_for_meetings/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chromeos/ash/components/chromebox_for_meetings/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chromeos/ash/components/dbus/chromebox_for_meetings/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "ash/services/chromebox_for_meetings/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/browser/ash/chromebox_for_meetings/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/browser/resources/chromeos/chromebox_for_meetings/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/browser/ui/webui/chromeos/chromebox_for_meetings/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/test/data/webui/chromeos/chromebox_for_meetings/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux-chromeos-annotator-rel" @@ -1270,6 +2557,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux-chromeos-dbg" @@ -1288,6 +2592,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux-chromeos-rel-compilator" @@ -1299,6 +2620,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux-clang-tidy-dbg" @@ -1361,6 +2699,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux-lacros-version-skew-fyi" @@ -1375,6 +2730,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux-mbi-mode-per-render-process-host-rel" @@ -1397,12 +2769,66 @@ location_regexp: ".+/[+]/services/tracing/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "base/trace_event/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "base/tracing/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "components/tracing/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/browser/tracing/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "services/tracing/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux-rel" location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux-rel-compilator" @@ -1414,6 +2840,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux-rel-warmed" @@ -1456,6 +2899,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux-webkit-msan-rel" @@ -1490,6 +2950,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux_chromium_asan_rel_ng-compilator" @@ -1524,6 +3001,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux_chromium_compile_rel_ng" @@ -1534,6 +3028,23 @@ location_regexp: ".+/[+]/build/.*check_gn_headers.*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "build/.*check_gn_headers.*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux_chromium_msan_focal" @@ -1548,6 +3059,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux_chromium_tsan_rel_ng-compilator" @@ -1568,6 +3096,53 @@ location_regexp: ".+/[+]/third_party/blink/web_tests/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/core/editing/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/core/layout/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/core/paint/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/core/svg/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/platform/fonts/shaping/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/platform/graphics/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/web_tests/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux_optional_gpu_tests_rel" @@ -1594,6 +3169,123 @@ location_regexp: ".+/[+]/ui/gl/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/browser/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/browser/xr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/test/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/audio/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/base/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/capture/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/filters/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/mojo/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/renderers/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/video/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "testing/buildbot/tryserver.chromium.linux.json" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "testing/trigger_scripts/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/mediastream/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/webcodecs/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/webgl/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/platform/graphics/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/clang/scripts/update.py" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/mb/mb_config_expectations/tryserver.chromium.linux.json" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "ui/gl/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/linux_upload_clang" @@ -1605,6 +3297,28 @@ location_regexp: ".+/[+]/content/browser/xr/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/browser/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/browser/xr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/mac-angle-chromium-try" @@ -1647,6 +3361,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/mac-rel-compilator" @@ -1661,12 +3392,46 @@ location_regexp: ".+/[+]/chrome/updater/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/updater/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/mac-updater-try-builder-rel" location_regexp: ".+/[+]/chrome/updater/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/updater/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/mac10.13-blink-rel" @@ -1737,6 +3502,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/mac_chromium_compile_rel_ng" @@ -1772,6 +3554,128 @@ location_regexp: ".+/[+]/ui/gl/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/browser/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/browser/xr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/test/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/audio/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/base/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/capture/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/filters/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/mojo/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/renderers/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/video/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "services/shape_detection/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "testing/buildbot/tryserver.chromium.mac.json" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "testing/trigger_scripts/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/mediastream/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/webcodecs/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/webgl/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/platform/graphics/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/clang/scripts/update.py" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/mb/mb_config_expectations/tryserver.chromium.mac.json" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "ui/gl/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/mac_upload_clang" @@ -1790,6 +3694,16 @@ disable_reuse: true location_regexp: ".+/[+]/tools/clang/scripts/update.py" location_regexp: ".+/[+]/DEPS" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/clang/scripts/update.py" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "DEPS" + } } builders { name: "chromium/try/tricium-clang-tidy" @@ -1848,6 +3762,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/win-official" @@ -1878,12 +3809,46 @@ location_regexp: ".+/[+]/chrome/updater/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/updater/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/win-updater-try-builder-rel" location_regexp: ".+/[+]/chrome/updater/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/updater/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/win10-clang-tidy-rel" @@ -1906,6 +3871,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/win10_chromium_x64_rel_ng-compilator" @@ -1933,6 +3915,28 @@ location_regexp: ".+/[+]/sandbox/policy/win/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "sandbox/win/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "sandbox/policy/win/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/win_archive" @@ -1944,6 +3948,23 @@ location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: ".*" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/win_chromium_compile_rel_ng" @@ -1981,6 +4002,138 @@ location_regexp: ".+/[+]/ui/gl/.+" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+" + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "chrome/browser/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/browser/xr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "content/test/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "device/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/audio/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/base/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/capture/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/filters/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/mojo/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/renderers/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "media/video/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "testing/buildbot/tryserver.chromium.win.json" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "testing/trigger_scripts/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/vr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/mediastream/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/webcodecs/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/webgl/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/modules/xr/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "third_party/blink/renderer/platform/graphics/gpu/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/clang/scripts/update.py" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "tools/mb/mb_config_expectations/tryserver.chromium.win.json" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "ui/gl/.+" + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "docs/.+" + exclude: true + } + location_filters { + gerrit_host_regexp: ".*" + gerrit_project_regexp: ".*" + path_regexp: "infra/config/.+" + exclude: true + } } builders { name: "chromium/try/win_upload_clang"
diff --git a/infra/config/generated/luci/cr-buildbucket.cfg b/infra/config/generated/luci/cr-buildbucket.cfg index 7369b80..e32605f 100644 --- a/infra/config/generated/luci/cr-buildbucket.cfg +++ b/infra/config/generated/luci/cr-buildbucket.cfg
@@ -4841,7 +4841,7 @@ ' "led_builder_is_bootstrapped": true,' ' "recipe": "chromium"' '}' - execution_timeout_secs: 10800 + execution_timeout_secs: 21600 build_numbers: YES service_account: "chromium-ci-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" experiments { @@ -72424,7 +72424,7 @@ builders { name: "mac12-arm64-rel" swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" + dimensions: "builder:mac12-arm64-rel" dimensions: "cores:2" dimensions: "cpu:x86-64" dimensions: "os:Ubuntu-18.04" @@ -72514,7 +72514,7 @@ builders { name: "mac12-arm64-rel-compilator" swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" + dimensions: "builder:mac12-arm64-rel-compilator" dimensions: "cpu:x86-64" dimensions: "os:Mac-12" dimensions: "pool:luci.chromium.try"
diff --git a/infra/config/generated/luci/luci-milo.cfg b/infra/config/generated/luci/luci-milo.cfg index 56f9859..3c8c98f 100644 --- a/infra/config/generated/luci/luci-milo.cfg +++ b/infra/config/generated/luci/luci-milo.cfg
@@ -474,6 +474,11 @@ short_name: "lcr" } builders { + name: "buildbucket/luci.chrome.ci/lacros-arm64-generic-chrome" + category: "chrome" + short_name: "lcr" + } + builders { name: "buildbucket/luci.chrome.ci/linux-chromeos-chrome" category: "chrome" short_name: "cro"
diff --git a/infra/config/generated/luci/project.cfg b/infra/config/generated/luci/project.cfg index 5d4b8b8..174d8ab 100644 --- a/infra/config/generated/luci/project.cfg +++ b/infra/config/generated/luci/project.cfg
@@ -7,9 +7,10 @@ name: "chromium" access: "group:all" lucicfg { - version: "1.30.11" + version: "1.31.3" package_dir: "../.." config_dir: "generated/luci" entry_point: "main.star" + experiments: "crbug.com/1171945" experiments: "crbug.com/1182002" }
diff --git a/infra/config/main.star b/infra/config/main.star index 47e6656..1f252a25 100755 --- a/infra/config/main.star +++ b/infra/config/main.star
@@ -10,7 +10,7 @@ load("//project.star", "settings") lucicfg.check_version( - min = "1.30.9", + min = "1.31.1", message = "Update depot_tools", )
diff --git a/infra/config/subprojects/chromium/ci.star b/infra/config/subprojects/chromium/ci.star index dee8b6a..cdb0f56 100644 --- a/infra/config/subprojects/chromium/ci.star +++ b/infra/config/subprojects/chromium/ci.star
@@ -91,6 +91,7 @@ ) for name, short_name in ( ("lacros-amd64-generic-chrome", "lcr"), ("lacros-arm-generic-chrome", "lcr"), + ("lacros-arm64-generic-chrome", "lcr"), ("linux-chromeos-chrome", "cro"), ("linux-chrome", "lnx"), ("mac-chrome", "mac"),
diff --git a/infra/config/subprojects/chromium/ci/chromium.dawn.star b/infra/config/subprojects/chromium/ci/chromium.dawn.star index 05c9511..8aa5667 100644 --- a/infra/config/subprojects/chromium/ci/chromium.dawn.star +++ b/infra/config/subprojects/chromium/ci/chromium.dawn.star
@@ -290,6 +290,9 @@ short_name = "x64", ), reclient_jobs = rbe_jobs.LOW_JOBS_FOR_CI, + # Serially executed tests + ASAN = more than the default timeout needed in + # order to prevent build timeouts. + execution_timeout = 6 * time.hour, ) ci.gpu.windows_builder(
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.mac.star b/infra/config/subprojects/chromium/try/tryserver.chromium.mac.star index 3062c9a..98e89493 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.mac.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.mac.star
@@ -124,7 +124,6 @@ try_.orchestrator_builder( name = "mac12-arm64-rel", - builderless = True, check_for_flakiness = True, compilator = "mac12-arm64-rel-compilator", mirrors = [ @@ -136,7 +135,6 @@ try_.compilator_builder( name = "mac12-arm64-rel-compilator", - builderless = True, check_for_flakiness = True, main_list_view = "try", os = os.MAC_12,
diff --git a/ios/chrome/browser/download/browser_download_service.mm b/ios/chrome/browser/download/browser_download_service.mm index 296440e..285bdbe 100644 --- a/ios/chrome/browser/download/browser_download_service.mm +++ b/ios/chrome/browser/download/browser_download_service.mm
@@ -52,8 +52,9 @@ return; } - base::UmaHistogramEnumeration("Download.IOSDownloadMimeType", - GetUmaResult(task->GetMimeType())); + base::UmaHistogramEnumeration( + "Download.IOSDownloadMimeType", + GetDownloadMimeTypeResultFromMimeType(task->GetMimeType())); base::UmaHistogramEnumeration("Download.IOSDownloadFileUI", DownloadFileUI::DownloadFilePresented, DownloadFileUI::Count);
diff --git a/ios/chrome/browser/download/download_mimetype_util.cc b/ios/chrome/browser/download/download_mimetype_util.cc index b6b5fcb3..d3849a7 100644 --- a/ios/chrome/browser/download/download_mimetype_util.cc +++ b/ios/chrome/browser/download/download_mimetype_util.cc
@@ -5,7 +5,8 @@ #include "ios/chrome/browser/download/download_mimetype_util.h" #include "ios/chrome/browser/download/mime_type_util.h" -DownloadMimeTypeResult GetUmaResult(const std::string& mime_type) { +DownloadMimeTypeResult GetDownloadMimeTypeResultFromMimeType( + const std::string& mime_type) { if (mime_type == kPkPassMimeType) return DownloadMimeTypeResult::PkPass;
diff --git a/ios/chrome/browser/download/download_mimetype_util.h b/ios/chrome/browser/download/download_mimetype_util.h index 3a7eaa2..601837f 100644 --- a/ios/chrome/browser/download/download_mimetype_util.h +++ b/ios/chrome/browser/download/download_mimetype_util.h
@@ -126,6 +126,7 @@ }; // Returns DownloadMimeTypeResult for the given MIME type. -DownloadMimeTypeResult GetUmaResult(const std::string& mime_type); +DownloadMimeTypeResult GetDownloadMimeTypeResultFromMimeType( + const std::string& mime_type); #endif // IOS_CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MIMETYPE_UTIL_H_
diff --git a/ios/chrome/browser/history/history_client_impl.cc b/ios/chrome/browser/history/history_client_impl.cc index 61dcdb4..d0abfe1 100644 --- a/ios/chrome/browser/history/history_client_impl.cc +++ b/ios/chrome/browser/history/history_client_impl.cc
@@ -7,7 +7,9 @@ #include "base/bind.h" #include "base/callback.h" #include "base/check_op.h" +#include "base/time/time.h" #include "components/bookmarks/browser/bookmark_model.h" +#include "components/bookmarks/browser/bookmark_utils.h" #include "components/bookmarks/browser/model_loader.h" #include "components/history/core/browser/history_service.h" #include "ios/chrome/browser/history/history_backend_client_impl.h" @@ -62,6 +64,18 @@ bookmark_model_ ? bookmark_model_->model_loader() : nullptr); } +void HistoryClientImpl::UpdateBookmarkLastUsedTime(int64_t bookmark_node_id, + base::Time time) { + if (!bookmark_model_) + return; + const bookmarks::BookmarkNode* node = + GetBookmarkNodeByID(bookmark_model_, bookmark_node_id); + // This call is async so the BookmarkNode could have already been deleted. + if (!node) + return; + bookmark_model_->UpdateLastUsedTime(node, time); +} + void HistoryClientImpl::BookmarkModelChanged() { }
diff --git a/ios/chrome/browser/history/history_client_impl.h b/ios/chrome/browser/history/history_client_impl.h index d984ec0..68d5bc0 100644 --- a/ios/chrome/browser/history/history_client_impl.h +++ b/ios/chrome/browser/history/history_client_impl.h
@@ -42,6 +42,8 @@ void NotifyProfileError(sql::InitStatus init_status, const std::string& diagnostics) override; std::unique_ptr<history::HistoryBackendClient> CreateBackendClient() override; + void UpdateBookmarkLastUsedTime(int64_t bookmark_node_id, + base::Time time) override; // bookmarks::BaseBookmarkModelObserver implementation. void BookmarkModelChanged() override;
diff --git a/media/gpu/v4l2/v4l2_video_decoder_delegate_h264.cc b/media/gpu/v4l2/v4l2_video_decoder_delegate_h264.cc index d6342f7d..6b6c8c83 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_delegate_h264.cc +++ b/media/gpu/v4l2/v4l2_video_decoder_delegate_h264.cc
@@ -21,6 +21,20 @@ namespace media { +namespace { + +constexpr uint8_t zigzag_4x4[] = { + 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15, +}; + +constexpr uint8_t zigzag_8x8[] = { + 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63}; + +} // namespace + // This struct contains the kernel-specific parts of the H264 acceleration, // that we don't want to expose in the .h file since they may differ from // upstream. @@ -251,13 +265,23 @@ for (size_t i = 0; i < std::size(v4l2_scaling_matrix.scaling_list_4x4); ++i) { for (size_t j = 0; j < std::size(v4l2_scaling_matrix.scaling_list_4x4[i]); ++j) { - v4l2_scaling_matrix.scaling_list_4x4[i][j] = scaling_list4x4[i][j]; + // Parser uses source (zigzag) order, while V4L2 API requires raster + // order. + static_assert( + std::extent<decltype(v4l2_scaling_matrix.scaling_list_4x4), 1>() == + std::extent<decltype(zigzag_4x4)>()); + v4l2_scaling_matrix.scaling_list_4x4[i][zigzag_4x4[j]] = + scaling_list4x4[i][j]; } } for (size_t i = 0; i < std::size(v4l2_scaling_matrix.scaling_list_8x8); ++i) { for (size_t j = 0; j < std::size(v4l2_scaling_matrix.scaling_list_8x8[i]); ++j) { - v4l2_scaling_matrix.scaling_list_8x8[i][j] = scaling_list8x8[i][j]; + static_assert( + std::extent<decltype(v4l2_scaling_matrix.scaling_list_8x8), 1>() == + std::extent<decltype(zigzag_8x8)>()); + v4l2_scaling_matrix.scaling_list_8x8[i][zigzag_8x8[j]] = + scaling_list8x8[i][j]; } }
diff --git a/remoting/codec/webrtc_video_encoder.h b/remoting/codec/webrtc_video_encoder.h index c7d8aeb..325d63a 100644 --- a/remoting/codec/webrtc_video_encoder.h +++ b/remoting/codec/webrtc_video_encoder.h
@@ -12,6 +12,7 @@ #include "base/callback.h" #include "base/time/time.h" +#include "third_party/webrtc/api/video/encoded_image.h" #include "third_party/webrtc/api/video/video_codec_type.h" #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" @@ -78,12 +79,13 @@ EncodedFrame& operator=(EncodedFrame&&); ~EncodedFrame(); - webrtc::DesktopSize size; - std::string data; + webrtc::DesktopSize dimensions; + rtc::scoped_refptr<webrtc::EncodedImageBuffer> data; bool key_frame; int quantizer; webrtc::VideoCodecType codec; + uint32_t rtp_timestamp; std::unique_ptr<FrameStats> stats; };
diff --git a/remoting/codec/webrtc_video_encoder_av1.cc b/remoting/codec/webrtc_video_encoder_av1.cc index 2221d70..fe0ef844 100644 --- a/remoting/codec/webrtc_video_encoder_av1.cc +++ b/remoting/codec/webrtc_video_encoder_av1.cc
@@ -336,7 +336,7 @@ bool got_data = false; auto encoded_frame = std::make_unique<EncodedFrame>(); - encoded_frame->size = frame_size; + encoded_frame->dimensions = frame_size; encoded_frame->codec = webrtc::kVideoCodecAV1; while (!got_data) { @@ -348,8 +348,8 @@ switch (aom_packet->kind) { case AOM_CODEC_CX_FRAME_PKT: { got_data = true; - encoded_frame->data.assign( - reinterpret_cast<const char*>(aom_packet->data.frame.buf), + encoded_frame->data = webrtc::EncodedImageBuffer::Create( + reinterpret_cast<const uint8_t*>(aom_packet->data.frame.buf), aom_packet->data.frame.sz); encoded_frame->key_frame = aom_packet->data.frame.flags & AOM_FRAME_IS_KEY;
diff --git a/remoting/codec/webrtc_video_encoder_gpu.cc b/remoting/codec/webrtc_video_encoder_gpu.cc index eeaee9e..7b38df7 100644 --- a/remoting/codec/webrtc_video_encoder_gpu.cc +++ b/remoting/codec/webrtc_video_encoder_gpu.cc
@@ -316,16 +316,17 @@ const media::BitstreamBufferMetadata& metadata) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - std::unique_ptr<EncodedFrame> encoded_frame = - std::make_unique<EncodedFrame>(); + auto encoded_frame = std::make_unique<EncodedFrame>(); OutputBuffer* output_buffer = output_buffers_[bitstream_buffer_id].get(); DCHECK(output_buffer->IsValid()); - base::span<char> data_span = - output_buffer->mapping.GetMemoryAsSpan<char>(metadata.payload_size_bytes); - encoded_frame->data.assign(data_span.begin(), data_span.end()); + base::span<uint8_t> data_span = + output_buffer->mapping.GetMemoryAsSpan<uint8_t>( + metadata.payload_size_bytes); + encoded_frame->data = + webrtc::EncodedImageBuffer::Create(data_span.data(), data_span.size()); encoded_frame->key_frame = metadata.key_frame; - encoded_frame->size = webrtc::DesktopSize(input_coded_size_.width(), - input_coded_size_.height()); + encoded_frame->dimensions = {input_coded_size_.width(), + input_coded_size_.height()}; encoded_frame->quantizer = 0; encoded_frame->codec = webrtc::kVideoCodecH264;
diff --git a/remoting/codec/webrtc_video_encoder_vpx.cc b/remoting/codec/webrtc_video_encoder_vpx.cc index 206d0fe3..65ca035 100644 --- a/remoting/codec/webrtc_video_encoder_vpx.cc +++ b/remoting/codec/webrtc_video_encoder_vpx.cc
@@ -319,8 +319,8 @@ vpx_codec_iter_t iter = nullptr; bool got_data = false; - std::unique_ptr<EncodedFrame> encoded_frame(new EncodedFrame()); - encoded_frame->size = frame_size; + auto encoded_frame = std::make_unique<EncodedFrame>(); + encoded_frame->dimensions = frame_size; if (use_vp9_) { encoded_frame->codec = webrtc::kVideoCodecVP9; } else { @@ -336,9 +336,8 @@ switch (vpx_packet->kind) { case VPX_CODEC_CX_FRAME_PKT: { got_data = true; - // TODO(sergeyu): Avoid copying the data here. - encoded_frame->data.assign( - reinterpret_cast<const char*>(vpx_packet->data.frame.buf), + encoded_frame->data = webrtc::EncodedImageBuffer::Create( + reinterpret_cast<const uint8_t*>(vpx_packet->data.frame.buf), vpx_packet->data.frame.sz); encoded_frame->key_frame = vpx_packet->data.frame.flags & VPX_FRAME_IS_KEY;
diff --git a/remoting/protocol/webrtc_frame_scheduler_constant_rate.cc b/remoting/protocol/webrtc_frame_scheduler_constant_rate.cc index 4011598..1f760a4 100644 --- a/remoting/protocol/webrtc_frame_scheduler_constant_rate.cc +++ b/remoting/protocol/webrtc_frame_scheduler_constant_rate.cc
@@ -9,8 +9,7 @@ #include "base/logging.h" #include "base/time/time.h" -namespace remoting { -namespace protocol { +namespace remoting::protocol { WebrtcFrameSchedulerConstantRate::WebrtcFrameSchedulerConstantRate() = default; @@ -133,5 +132,4 @@ capture_callback_.Run(); } -} // namespace protocol -} // namespace remoting +} // namespace remoting::protocol
diff --git a/remoting/protocol/webrtc_frame_scheduler_unittest.cc b/remoting/protocol/webrtc_frame_scheduler_unittest.cc index 40f9d5d..aaf1b29 100644 --- a/remoting/protocol/webrtc_frame_scheduler_unittest.cc +++ b/remoting/protocol/webrtc_frame_scheduler_unittest.cc
@@ -40,11 +40,11 @@ if (simulate_capture_) { // Simulate a completed capture and encode. scheduler_->OnFrameCaptured(&frame_); - WebrtcVideoEncoder::EncodedFrame encoded; - encoded.key_frame = false; - encoded.data = 'X'; + WebrtcVideoEncoder::EncodedFrame encoded_frame; + encoded_frame.key_frame = false; + encoded_frame.data = webrtc::EncodedImageBuffer::Create(1); scheduler_->OnFrameEncoded(WebrtcVideoEncoder::EncodeResult::SUCCEEDED, - &encoded); + &encoded_frame); } }
diff --git a/remoting/protocol/webrtc_video_encoder_factory.cc b/remoting/protocol/webrtc_video_encoder_factory.cc index 71fcac8..e27f10a 100644 --- a/remoting/protocol/webrtc_video_encoder_factory.cc +++ b/remoting/protocol/webrtc_video_encoder_factory.cc
@@ -5,6 +5,7 @@ #include "remoting/protocol/webrtc_video_encoder_factory.h" #include "base/check.h" +#include "base/task/thread_pool.h" #include "base/threading/thread_task_runner_handle.h" #include "remoting/protocol/video_channel_state_observer.h" #include "remoting/protocol/webrtc_video_encoder_wrapper.h" @@ -43,6 +44,9 @@ const webrtc::SdpVideoFormat& format) { return std::make_unique<WebrtcVideoEncoderWrapper>( format, session_options_, main_task_runner_, + base::ThreadPool::CreateSingleThreadTaskRunner( + {base::TaskPriority::HIGHEST}, + base::SingleThreadTaskRunnerThreadMode::DEDICATED), video_channel_state_observer_); }
diff --git a/remoting/protocol/webrtc_video_encoder_wrapper.cc b/remoting/protocol/webrtc_video_encoder_wrapper.cc index be6263c..9b3b567 100644 --- a/remoting/protocol/webrtc_video_encoder_wrapper.cc +++ b/remoting/protocol/webrtc_video_encoder_wrapper.cc
@@ -92,8 +92,10 @@ const webrtc::SdpVideoFormat& format, const SessionOptions& session_options, scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner, base::WeakPtr<VideoChannelStateObserver> video_channel_state_observer) : main_task_runner_(main_task_runner), + encode_task_runner_(encode_task_runner), video_channel_state_observer_(video_channel_state_observer) { // Set the target frame rate based on the session options. absl::optional<int> frame_rate = session_options.GetInt("Video-Frame-Rate"); @@ -146,6 +148,11 @@ WebrtcVideoEncoderWrapper::~WebrtcVideoEncoderWrapper() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (encode_pending_) { + // If the encoder is still running, then delete it on |encode_task_runner_| + // as it will no longer be called on this sequence and isn't sequence bound. + encode_task_runner_->DeleteSoon(FROM_HERE, encoder_.release()); + } } void WebrtcVideoEncoderWrapper::SetEncoderForTest( @@ -210,12 +217,24 @@ } next_frame_id_++; + // WebRTC calls Encode() after each successful capture. If we drop the frame + // immediately when we are currently encoding instead of storing the frame + // data, then the encoder would need to wait until the next capture request + // has succeeded before it can encode another frame, this period can be + // several milliseconds or more. To reduce this latency, we store the new + // frame when the encoder is busy so it can be encoded immediately after the + // encoder finishes the current frame. if (encode_pending_) { - accumulated_update_rect_.Union(frame.update_rect()); - base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::BindOnce(&WebrtcVideoEncoderWrapper::NotifyFrameDropped, - weak_factory_.GetWeakPtr())); + if (pending_frame_) { + accumulated_update_rect_.Union(pending_frame_->update_rect()); + + base::SequencedTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::BindOnce(&WebrtcVideoEncoderWrapper::NotifyFrameDropped, + weak_factory_.GetWeakPtr())); + } + pending_frame_ = std::make_unique<webrtc::VideoFrame>(frame); + return WEBRTC_VIDEO_CODEC_OK; } @@ -317,10 +336,15 @@ encode_pending_ = true; - auto encode_callback = base::BindOnce( - &WebrtcVideoEncoderWrapper::OnFrameEncoded, weak_factory_.GetWeakPtr()); - encoder_->Encode(std::move(desktop_frame), frame_params, - std::move(encode_callback)); + auto encode_callback = base::BindPostTask( + base::SequencedTaskRunnerHandle::Get(), + base::BindOnce(&WebrtcVideoEncoderWrapper::OnFrameEncoded, + weak_factory_.GetWeakPtr())); + encode_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&WebrtcVideoEncoder::Encode, + base::Unretained(encoder_.get()), std::move(desktop_frame), + frame_params, std::move(encode_callback))); return WEBRTC_VIDEO_CODEC_OK; } @@ -355,28 +379,23 @@ const WebrtcVideoEncoder::EncodedFrame& frame) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - const uint8_t* buffer = - reinterpret_cast<const uint8_t*>(std::data(frame.data)); - size_t buffer_size = frame.data.size(); + // Non-null, because WebRTC registers a callback before calling Encode(). + DCHECK(encoded_callback_); - // TODO(crbug.com/1208215): Avoid copying/allocating frame data here, by - // implementing EncodedImageBufferInterface. webrtc::EncodedImage encoded_image; - encoded_image.SetEncodedData( - webrtc::EncodedImageBuffer::Create(buffer, buffer_size)); - encoded_image._encodedWidth = frame.size.width(); - encoded_image._encodedHeight = frame.size.height(); + encoded_image.SetEncodedData(frame.data); + encoded_image._encodedWidth = frame.dimensions.width(); + encoded_image._encodedHeight = frame.dimensions.height(); encoded_image._frameType = frame.key_frame ? webrtc::VideoFrameType::kVideoFrameKey : webrtc::VideoFrameType::kVideoFrameDelta; - encoded_image.SetTimestamp(rtp_timestamp_); + encoded_image.SetTimestamp(frame.rtp_timestamp); encoded_image.playout_delay_.min_ms = 0; encoded_image.playout_delay_.max_ms = 0; encoded_image.content_type_ = webrtc::VideoContentType::SCREENSHARE; webrtc::CodecSpecificInfo codec_specific_info; codec_specific_info.codecType = frame.codec; - if (frame.codec == webrtc::kVideoCodecVP8) { webrtc::CodecSpecificInfoVP8* vp8_info = &codec_specific_info.codecSpecific.VP8; @@ -388,8 +407,8 @@ vp9_info->ss_data_available = frame.key_frame; vp9_info->spatial_layer_resolution_present = frame.key_frame; if (frame.key_frame) { - vp9_info->width[0] = frame.size.width(); - vp9_info->height[0] = frame.size.height(); + vp9_info->width[0] = frame.dimensions.width(); + vp9_info->height[0] = frame.dimensions.height(); } vp9_info->num_spatial_layers = 1; vp9_info->gof_idx = webrtc::kNoGofIdx; @@ -415,7 +434,6 @@ NOTREACHED(); } - DCHECK(encoded_callback_); return encoded_callback_->OnEncodedImage(encoded_image, &codec_specific_info); } @@ -433,6 +451,7 @@ DCHECK(encode_pending_); encode_pending_ = false; + // Transfer the cached frame stats into the encoded frame. if (frame) { // This is non-null because the |encode_pending_| flag ensures that // frame-encodings are serialized. So there cannot be 2 consecutive calls to @@ -443,6 +462,8 @@ frame_stats_->rtt_estimate = rtt_estimate_; frame_stats_->bandwidth_estimate_kbps = bitrate_kbps_; frame->stats = std::move(frame_stats_); + + frame->rtp_timestamp = rtp_timestamp_; } main_task_runner_->PostTask( @@ -457,20 +478,31 @@ LOG(ERROR) << "Video encoder returned error " << EncodeResultToString(encode_result); NotifyFrameDropped(); + DropPendingFrame(); return; } - if (!frame || frame->data.empty()) { + if (!frame || !frame->data || !frame->data->size()) { top_off_active_ = false; NotifyFrameDropped(); + DropPendingFrame(); return; } // Top-off until the best quantizer value is reached. top_off_active_ = (frame->quantizer > kMinQuantizer); - // Non-null, because WebRTC registers a callback before calling Encode(). - DCHECK(encoded_callback_); + // If there was a successful capture while the encoder was working then there + // will be a frame waiting to be encoded. Send it to the encoder now that its + // no longer busy and we've copied the frame stats for the current frame. + // Note: This function is called here instead of at the end of the function as + // this saves a few hundred microseconds per frame. It can certainly be moved + // if ever there is a need but be sure to profile the per-frame cost. + SchedulePendingFrame(); + + // WARNING: No frame-specific class members should be accessed after this + // point as they may be updated in Encode() when the pending frame is sent to + // the encoder. webrtc::EncodedImageCallback::Result send_result = ReturnEncodedFrame(*frame); @@ -519,4 +551,20 @@ return should_drop_quality; } +void WebrtcVideoEncoderWrapper::SchedulePendingFrame() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (pending_frame_) { + auto pending_frame = std::move(pending_frame_); + Encode(*pending_frame, nullptr); + } +} + +void WebrtcVideoEncoderWrapper::DropPendingFrame() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (pending_frame_) { + pending_frame_.reset(); + NotifyFrameDropped(); + } +} + } // namespace remoting::protocol
diff --git a/remoting/protocol/webrtc_video_encoder_wrapper.h b/remoting/protocol/webrtc_video_encoder_wrapper.h index c6d82a71..57a0d0f 100644 --- a/remoting/protocol/webrtc_video_encoder_wrapper.h +++ b/remoting/protocol/webrtc_video_encoder_wrapper.h
@@ -36,6 +36,7 @@ const webrtc::SdpVideoFormat& format, const SessionOptions& session_options, scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner, base::WeakPtr<VideoChannelStateObserver> video_channel_state_observer); ~WebrtcVideoEncoderWrapper() override; @@ -75,6 +76,13 @@ // (compared with recent history) and the current bandwidth-estimation. bool ShouldDropQualityForLargeFrame(const webrtc::DesktopFrame& frame); + // Begins encoding |pending_frame_| if it contains valid frame data. + void SchedulePendingFrame(); + + // Clears |pending_frame_| and notifies WebRTC of the dropped frame when + // |pending_frame_| contains valid frame data. + void DropPendingFrame(); + std::unique_ptr<WebrtcVideoEncoder> encoder_ GUARDED_BY_CONTEXT(sequence_checker_); @@ -107,6 +115,8 @@ // True when a frame is being encoded. This guards against encoding multiple // frames in parallel, which the encoders are not prepared to handle. bool encode_pending_ GUARDED_BY_CONTEXT(sequence_checker_) = false; + std::unique_ptr<webrtc::VideoFrame> pending_frame_ + GUARDED_BY_CONTEXT(sequence_checker_); // Stores the expected id of the next incoming frame to be encoded. If this // does not match, it means that WebRTC dropped a frame, and the original @@ -149,6 +159,9 @@ // TaskRunner used for notifying |video_channel_state_observer_|. scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; + // TaskRunner used for scheduling encoding tasks. + scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner_; + // Stores the taret frame rate used for capture and encode scheduling. May be // overridden by the client via SessionOptions. This value is applied to all // codecs and cannot be changed during a session.
diff --git a/remoting/protocol/webrtc_video_encoder_wrapper_unittest.cc b/remoting/protocol/webrtc_video_encoder_wrapper_unittest.cc index cf6968d..8a9e331 100644 --- a/remoting/protocol/webrtc_video_encoder_wrapper_unittest.cc +++ b/remoting/protocol/webrtc_video_encoder_wrapper_unittest.cc
@@ -35,8 +35,7 @@ using webrtc::VideoFrame; using webrtc::VideoFrameType; -namespace remoting { -namespace protocol { +namespace remoting::protocol { namespace { @@ -174,29 +173,14 @@ WebrtcVideoEncoder::EncodeCallback done) { auto encoded_frame = std::make_unique<WebrtcVideoEncoder::EncodedFrame>(); - std::move(done).Run(WebrtcVideoEncoder::EncodeResult::SUCCEEDED, - std::move(encoded_frame)); - }); - - // Configure this mock encoder's behavior to mimic a real async encoder. - mock_video_encoder_async_ = std::make_unique<NiceMock<MockVideoEncoder>>(); - ON_CALL(*mock_video_encoder_async_, Encode) - .WillByDefault([this](std::unique_ptr<webrtc::DesktopFrame> frame, - const WebrtcVideoEncoder::FrameParams& param, - WebrtcVideoEncoder::EncodeCallback done) { - auto encoded_frame = - std::make_unique<WebrtcVideoEncoder::EncodedFrame>(); - encoded_frame->size = frame->size(); - encoded_frame->data.assign( - frame->size().width() * frame->size().height(), 'a'); + encoded_frame->dimensions = frame->size(); + encoded_frame->data = webrtc::EncodedImageBuffer::Create( + frame->size().width() * frame->size().height()); encoded_frame->key_frame = param.key_frame; encoded_frame->quantizer = param.vpx_min_quantizer; encoded_frame->codec = kVideoCodecVP9; - task_environment_.GetMainThreadTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce(std::move(done), - WebrtcVideoEncoder::EncodeResult::SUCCEEDED, - std::move(encoded_frame))); + std::move(done).Run(WebrtcVideoEncoder::EncodeResult::SUCCEEDED, + std::move(encoded_frame)); }); } @@ -204,7 +188,7 @@ VideoCodec codec) { auto encoder = std::make_unique<WebrtcVideoEncoderWrapper>( sdp, SessionOptions(), task_environment_.GetMainThreadTaskRunner(), - observer_.GetWeakPtr()); + task_environment_.GetMainThreadTaskRunner(), observer_.GetWeakPtr()); encoder->InitEncode(&codec, kVideoEncoderSettings); encoder->RegisterEncodeCompleteCallback(&callback_); encoder->SetRates(DefaultRateControlParameters()); @@ -226,7 +210,6 @@ NiceMock<MockVideoChannelStateObserver> observer_; MockEncodedImageCallback callback_; std::unique_ptr<NiceMock<MockVideoEncoder>> mock_video_encoder_; - std::unique_ptr<NiceMock<MockVideoEncoder>> mock_video_encoder_async_; }; TEST_F(WebrtcVideoEncoderWrapperTest, ReturnsVP8EncodedFrames) { @@ -282,15 +265,30 @@ TEST_F(WebrtcVideoEncoderWrapperTest, FrameDroppedIfAsyncEncoderBusy) { EXPECT_CALL(callback_, OnEncodedImage(_, Field(&CodecSpecificInfo::codecType, kVideoCodecVP9))) - .WillOnce(Return(kResultOk)); - + .Times(2) + .WillRepeatedly(Return(kResultOk)); auto frame1 = MakeVideoFrame(); auto frame2 = MakeVideoFrame(); + auto frame3 = MakeVideoFrame(); + auto frame4 = MakeVideoFrame(); + auto frame5 = MakeVideoFrame(); + auto frame6 = MakeVideoFrame(); auto encoder = InitEncoder(GetVp9Format(), GetVp9Codec()); - encoder->SetEncoderForTest(std::move(mock_video_encoder_async_)); + encoder->SetEncoderForTest(std::move(mock_video_encoder_)); std::vector<VideoFrameType> frame_types{VideoFrameType::kVideoFrameKey}; + // Encode task will be posted immediately. encoder->Encode(frame1, &frame_types); + // Frame2 contents will be stored in 'pending' frame while frame 1 is encoded. encoder->Encode(frame2, &frame_types); + // Frame3 contents will be replace the frame2 contents in 'pending' and cause + // frame2 to be dropped. + encoder->Encode(frame3, &frame_types); + // Replace frame3 contents with frame4. + encoder->Encode(frame4, &frame_types); + // Replace frame4 contents with frame5. + encoder->Encode(frame5, &frame_types); + // Replace frame5 contents with frame6. + encoder->Encode(frame6, &frame_types); PostQuitAndRun(); } @@ -301,7 +299,7 @@ InSequence s; // Encode frame1. - EXPECT_CALL(*mock_video_encoder_async_, Encode); + EXPECT_CALL(*mock_video_encoder_, Encode); EXPECT_CALL( callback_, OnEncodedImage(_, Field(&CodecSpecificInfo::codecType, kVideoCodecVP9))) @@ -310,7 +308,7 @@ // Encode frame3. Its update-region should be the rectangle-union of frame2 // and frame3. auto combined_rect = DesktopRect::MakeLTRB(100, 200, 310, 410); - EXPECT_CALL(*mock_video_encoder_async_, + EXPECT_CALL(*mock_video_encoder_, Encode(Pointee(MatchesUpdateRect(combined_rect)), _, _)); EXPECT_CALL( callback_, @@ -327,15 +325,12 @@ .offset_x = 300, .offset_y = 400, .width = 10, .height = 10}); auto encoder = InitEncoder(GetVp9Format(), GetVp9Codec()); - encoder->SetEncoderForTest(std::move(mock_video_encoder_async_)); + encoder->SetEncoderForTest(std::move(mock_video_encoder_)); std::vector<VideoFrameType> frame_types{VideoFrameType::kVideoFrameKey}; - // frame2 should be dropped since the encoder is busy. - // RunUntilIdle() will wait until frame1 is encoded so that frame3 will not - // be dropped. + // Frame2 will be dropped and replaced by frame3 since the encoder is busy. encoder->Encode(frame1, &frame_types); encoder->Encode(frame2, &frame_types); - task_environment_.RunUntilIdle(); encoder->Encode(frame3, &frame_types); PostQuitAndRun(); } @@ -400,15 +395,15 @@ KeyFrameRequestRememberedIfAsyncEncoderBusy) { // Three frames are used for this test: // Frame 1 kicks off the encoder. - // Frame 2 is a key-frame request, which is dropped because frame 1 is still - // being encoded. - // Frame 3 is a delta-frame request from WebRTC (after frame 1 has been - // encoded), but the encoder-wrapper should encode it as a key-frame because - // of the previous key-frame request from WebRTC. + // Frame 2 is a key-frame request, which is dropped because it is replaced by + // frame 3 while frame 1 is being encoded. + // Frame 3 is a delta-frame request from WebRTC, but the encoder-wrapper + // should encode it as a key-frame because of the previous key-frame + // request from WebRTC. // // The end-result is that the encoder should see two key-frame requests (for // frames 1 and 3). - EXPECT_CALL(*mock_video_encoder_async_, Encode(_, IsKeyFrame(), _)).Times(2); + EXPECT_CALL(*mock_video_encoder_, Encode(_, IsKeyFrame(), _)).Times(2); EXPECT_CALL(callback_, OnEncodedImage(_, _)) .Times(2) .WillRepeatedly(Return(kResultOk)); @@ -420,17 +415,13 @@ std::vector<VideoFrameType> frame_types2{VideoFrameType::kVideoFrameKey}; std::vector<VideoFrameType> frame_types3{VideoFrameType::kVideoFrameDelta}; auto encoder = InitEncoder(GetVp9Format(), GetVp9Codec()); - encoder->SetEncoderForTest(std::move(mock_video_encoder_async_)); + encoder->SetEncoderForTest(std::move(mock_video_encoder_)); encoder->Encode(frame1, &frame_types1); encoder->Encode(frame2, &frame_types2); - - // Wait a bit, so the encoder is no longer busy. - task_environment_.FastForwardBy(base::Milliseconds(500)); encoder->Encode(frame3, &frame_types3); PostQuitAndRun(); } -} // namespace protocol -} // namespace remoting +} // namespace remoting::protocol
diff --git a/remoting/protocol/webrtc_video_stream.cc b/remoting/protocol/webrtc_video_stream.cc index 9e5ea86c..c6b4fcd 100644 --- a/remoting/protocol/webrtc_video_stream.cc +++ b/remoting/protocol/webrtc_video_stream.cc
@@ -219,7 +219,7 @@ stats.rtt_estimate = current_frame_stats->rtt_estimate; stats.send_pending_delay = current_frame_stats->send_pending_delay; - stats.frame_size = frame.data.size(); + stats.frame_size = frame.data->size(); if (!current_frame_stats->input_event_timestamps.is_null()) { stats.capture_pending_delay =
diff --git a/sandbox/policy/win/sandbox_win.cc b/sandbox/policy/win/sandbox_win.cc index b1ec529..f7b0de8 100644 --- a/sandbox/policy/win/sandbox_win.cc +++ b/sandbox/policy/win/sandbox_win.cc
@@ -40,6 +40,7 @@ #include "base/win/sid.h" #include "base/win/win_util.h" #include "base/win/windows_version.h" +#include "ppapi/buildflags/buildflags.h" #include "printing/buildflags/buildflags.h" #include "sandbox/features.h" #include "sandbox/policy/features.h" @@ -1245,8 +1246,10 @@ return "Utility"; case Sandbox::kGpu: return "GPU"; +#if BUILDFLAG(ENABLE_PLUGINS) case Sandbox::kPpapi: return "PPAPI"; +#endif case Sandbox::kNetwork: return "Network"; case Sandbox::kCdm:
diff --git a/services/network/network_service_unittest.cc b/services/network/network_service_unittest.cc index e62b9e25..67563bd 100644 --- a/services/network/network_service_unittest.cc +++ b/services/network/network_service_unittest.cc
@@ -1471,7 +1471,7 @@ class ClearSiteDataAuthCertObserver : public TestURLLoaderNetworkObserver { public: - explicit ClearSiteDataAuthCertObserver() = default; + ClearSiteDataAuthCertObserver() = default; ~ClearSiteDataAuthCertObserver() override = default; void OnClearSiteData(
diff --git a/testing/buildbot/chrome.json b/testing/buildbot/chrome.json index cb50bdc..7d449a4 100644 --- a/testing/buildbot/chrome.json +++ b/testing/buildbot/chrome.json
@@ -37,7 +37,7 @@ "idempotent": false, "io_timeout": 3600, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 + "shards": 10 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/" @@ -114,7 +114,7 @@ ] }, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 + "shards": 10 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/" @@ -346,7 +346,7 @@ ] }, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 + "shards": 10 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/" @@ -1241,7 +1241,7 @@ "idempotent": false, "io_timeout": 3600, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 + "shards": 10 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/", @@ -1331,7 +1331,7 @@ "idempotent": false, "io_timeout": 3600, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 + "shards": 10 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/", @@ -1490,7 +1490,7 @@ "idempotent": false, "io_timeout": 3600, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 + "shards": 10 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/", @@ -1639,7 +1639,7 @@ ] }, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 + "shards": 10 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/" @@ -2266,6 +2266,38 @@ } ] }, + "lacros-arm64-generic-chrome": { + "additional_compile_targets": [ + "chrome", + "lacros_version_metadata", + "linux_symbols", + "symupload", + "strip_chrome_binary" + ], + "isolated_scripts": [ + { + "isolate_name": "chrome_sizes", + "merge": { + "script": "//tools/perf/process_perf_results.py" + }, + "name": "chrome_sizes", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "pool": "chrome.tests" + } + ], + "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:chrome_sizes/" + } + ] + }, "linux-chrome": { "additional_compile_targets": [ "chrome",
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index e4905e4..5aa313b 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -1175,7 +1175,7 @@ "idempotent": false, "io_timeout": 3600, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 + "shards": 10 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/", @@ -5591,7 +5591,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v102.0.5005.75/test_ash_chrome" ], "isolate_profile_data": true, @@ -5623,7 +5623,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v103.0.5060.15/test_ash_chrome" ], "isolate_profile_data": true, @@ -5655,7 +5655,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v103.0.5060.22/test_ash_chrome" ], "isolate_profile_data": true, @@ -5687,7 +5687,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v104.0.5101.0/test_ash_chrome" ], "isolate_profile_data": true,
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 3416efc..68721d1 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -17607,7 +17607,7 @@ ] }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 + "shards": 10 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/" @@ -18662,7 +18662,7 @@ ] }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 + "shards": 10 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/" @@ -74695,7 +74695,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -74707,7 +74707,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "absl_hardening_tests iPhone 6s 14.5", + "name": "absl_hardening_tests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -74733,14 +74733,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://third_party/abseil-cpp:absl_hardening_tests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -75059,7 +75059,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -75071,7 +75071,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "boringssl_crypto_tests iPhone 6s 14.5", + "name": "boringssl_crypto_tests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -75097,14 +75097,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://third_party/boringssl:boringssl_crypto_tests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -75215,7 +75215,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -75227,7 +75227,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "boringssl_ssl_tests iPhone 6s 14.5", + "name": "boringssl_ssl_tests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -75253,14 +75253,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://third_party/boringssl:boringssl_ssl_tests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -75631,7 +75631,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -75643,7 +75643,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "crypto_unittests iPhone 6s 14.5", + "name": "crypto_unittests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -75669,14 +75669,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://crypto:crypto_unittests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -75995,7 +75995,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -76007,7 +76007,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "google_apis_unittests iPhone 6s 14.5", + "name": "google_apis_unittests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -76033,14 +76033,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://google_apis:google_apis_unittests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -76204,7 +76204,7 @@ "--platform", "iPad Air 2", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -76217,7 +76217,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_bookmarks_eg2tests_module iPad Air 2 14.5", + "name": "ios_chrome_bookmarks_eg2tests_module iPad Air 2 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -76243,14 +76243,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_bookmarks_eg2tests_module/", - "variant_id": "iPad Air 2 14.5" + "variant_id": "iPad Air 2 14.4" }, { "args": [ @@ -76310,7 +76310,7 @@ "--platform", "iPhone 7", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -76323,7 +76323,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_bookmarks_eg2tests_module iPhone 7 14.5", + "name": "ios_chrome_bookmarks_eg2tests_module iPhone 7 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -76349,14 +76349,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_bookmarks_eg2tests_module/", - "variant_id": "iPhone 7 14.5" + "variant_id": "iPhone 7 14.4" }, { "args": [ @@ -76469,7 +76469,7 @@ "--platform", "iPhone X", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -76482,7 +76482,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_bookmarks_eg2tests_module iPhone X 14.5", + "name": "ios_chrome_bookmarks_eg2tests_module iPhone X 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -76508,14 +76508,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_bookmarks_eg2tests_module/", - "variant_id": "iPhone X 14.5" + "variant_id": "iPhone X 14.4" }, { "args": [ @@ -76682,7 +76682,7 @@ "--platform", "iPad Air 2", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -76695,7 +76695,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_integration_eg2tests_module iPad Air 2 14.5", + "name": "ios_chrome_integration_eg2tests_module iPad Air 2 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -76721,15 +76721,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 8 }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_integration_eg2tests_module/", - "variant_id": "iPad Air 2 14.5" + "variant_id": "iPad Air 2 14.4" }, { "args": [ @@ -76790,7 +76790,7 @@ "--platform", "iPhone 7", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -76803,7 +76803,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_integration_eg2tests_module iPhone 7 14.5", + "name": "ios_chrome_integration_eg2tests_module iPhone 7 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -76829,15 +76829,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 8 }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_integration_eg2tests_module/", - "variant_id": "iPhone 7 14.5" + "variant_id": "iPhone 7 14.4" }, { "args": [ @@ -76952,7 +76952,7 @@ "--platform", "iPhone X", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -76965,7 +76965,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_integration_eg2tests_module iPhone X 14.5", + "name": "ios_chrome_integration_eg2tests_module iPhone X 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -76991,15 +76991,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 8 }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_integration_eg2tests_module/", - "variant_id": "iPhone X 14.5" + "variant_id": "iPhone X 14.4" }, { "args": [ @@ -77168,7 +77168,7 @@ "--platform", "iPad Air 2", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -77181,7 +77181,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_settings_eg2tests_module iPad Air 2 14.5", + "name": "ios_chrome_settings_eg2tests_module iPad Air 2 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -77207,15 +77207,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 3 }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_settings_eg2tests_module/", - "variant_id": "iPad Air 2 14.5" + "variant_id": "iPad Air 2 14.4" }, { "args": [ @@ -77276,7 +77276,7 @@ "--platform", "iPhone 7", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -77289,7 +77289,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_settings_eg2tests_module iPhone 7 14.5", + "name": "ios_chrome_settings_eg2tests_module iPhone 7 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -77315,15 +77315,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 3 }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_settings_eg2tests_module/", - "variant_id": "iPhone 7 14.5" + "variant_id": "iPhone 7 14.4" }, { "args": [ @@ -77438,7 +77438,7 @@ "--platform", "iPhone X", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -77451,7 +77451,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_settings_eg2tests_module iPhone X 14.5", + "name": "ios_chrome_settings_eg2tests_module iPhone X 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -77477,15 +77477,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 3 }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_settings_eg2tests_module/", - "variant_id": "iPhone X 14.5" + "variant_id": "iPhone X 14.4" }, { "args": [ @@ -77654,7 +77654,7 @@ "--platform", "iPad Air 2", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -77667,7 +77667,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_signin_eg2tests_module iPad Air 2 14.5", + "name": "ios_chrome_signin_eg2tests_module iPad Air 2 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -77693,15 +77693,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 5 }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_signin_eg2tests_module/", - "variant_id": "iPad Air 2 14.5" + "variant_id": "iPad Air 2 14.4" }, { "args": [ @@ -77762,7 +77762,7 @@ "--platform", "iPhone 7", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -77775,7 +77775,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_signin_eg2tests_module iPhone 7 14.5", + "name": "ios_chrome_signin_eg2tests_module iPhone 7 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -77801,15 +77801,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 5 }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_signin_eg2tests_module/", - "variant_id": "iPhone 7 14.5" + "variant_id": "iPhone 7 14.4" }, { "args": [ @@ -77924,7 +77924,7 @@ "--platform", "iPhone X", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -77937,7 +77937,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_signin_eg2tests_module iPhone X 14.5", + "name": "ios_chrome_signin_eg2tests_module iPhone X 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -77963,15 +77963,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 5 }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_signin_eg2tests_module/", - "variant_id": "iPhone X 14.5" + "variant_id": "iPhone X 14.4" }, { "args": [ @@ -78139,7 +78139,7 @@ "--platform", "iPad Air 2", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -78152,7 +78152,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_smoke_eg2tests_module iPad Air 2 14.5", + "name": "ios_chrome_smoke_eg2tests_module iPad Air 2 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -78178,14 +78178,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_smoke_eg2tests_module/", - "variant_id": "iPad Air 2 14.5" + "variant_id": "iPad Air 2 14.4" }, { "args": [ @@ -78245,7 +78245,7 @@ "--platform", "iPhone 7", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -78258,7 +78258,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_smoke_eg2tests_module iPhone 7 14.5", + "name": "ios_chrome_smoke_eg2tests_module iPhone 7 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -78284,14 +78284,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_smoke_eg2tests_module/", - "variant_id": "iPhone 7 14.5" + "variant_id": "iPhone 7 14.4" }, { "args": [ @@ -78404,7 +78404,7 @@ "--platform", "iPhone X", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -78417,7 +78417,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_smoke_eg2tests_module iPhone X 14.5", + "name": "ios_chrome_smoke_eg2tests_module iPhone X 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -78443,14 +78443,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_smoke_eg2tests_module/", - "variant_id": "iPhone X 14.5" + "variant_id": "iPhone X 14.4" }, { "args": [ @@ -78617,7 +78617,7 @@ "--platform", "iPad Air 2", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -78630,7 +78630,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_ui_eg2tests_module iPad Air 2 14.5", + "name": "ios_chrome_ui_eg2tests_module iPad Air 2 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -78656,15 +78656,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 12 }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_ui_eg2tests_module/", - "variant_id": "iPad Air 2 14.5" + "variant_id": "iPad Air 2 14.4" }, { "args": [ @@ -78725,7 +78725,7 @@ "--platform", "iPhone 7", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -78738,7 +78738,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_ui_eg2tests_module iPhone 7 14.5", + "name": "ios_chrome_ui_eg2tests_module iPhone 7 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -78764,15 +78764,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 12 }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_ui_eg2tests_module/", - "variant_id": "iPhone 7 14.5" + "variant_id": "iPhone 7 14.4" }, { "args": [ @@ -78887,7 +78887,7 @@ "--platform", "iPhone X", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -78900,7 +78900,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_ui_eg2tests_module iPhone X 14.5", + "name": "ios_chrome_ui_eg2tests_module iPhone X 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -78926,15 +78926,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 12 }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_ui_eg2tests_module/", - "variant_id": "iPhone X 14.5" + "variant_id": "iPhone X 14.4" }, { "args": [ @@ -79310,7 +79310,7 @@ "--platform", "iPad Air 2", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -79323,7 +79323,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_web_eg2tests_module iPad Air 2 14.5", + "name": "ios_chrome_web_eg2tests_module iPad Air 2 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -79349,14 +79349,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_web_eg2tests_module/", - "variant_id": "iPad Air 2 14.5" + "variant_id": "iPad Air 2 14.4" }, { "args": [ @@ -79416,7 +79416,7 @@ "--platform", "iPhone 7", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -79429,7 +79429,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_web_eg2tests_module iPhone 7 14.5", + "name": "ios_chrome_web_eg2tests_module iPhone 7 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -79455,14 +79455,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_web_eg2tests_module/", - "variant_id": "iPhone 7 14.5" + "variant_id": "iPhone 7 14.4" }, { "args": [ @@ -79575,7 +79575,7 @@ "--platform", "iPhone X", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -79588,7 +79588,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_chrome_web_eg2tests_module iPhone X 14.5", + "name": "ios_chrome_web_eg2tests_module iPhone X 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -79614,14 +79614,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/chrome/test/earl_grey2:ios_chrome_web_eg2tests_module/", - "variant_id": "iPhone X 14.5" + "variant_id": "iPhone X 14.4" }, { "args": [ @@ -79734,7 +79734,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -79746,7 +79746,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_components_unittests iPhone 6s 14.5", + "name": "ios_components_unittests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -79772,14 +79772,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/components:ios_components_unittests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -79890,7 +79890,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -79903,7 +79903,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_crash_xcuitests_module iPhone 6s 14.5", + "name": "ios_crash_xcuitests_module iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -79929,14 +79929,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://third_party/crashpad/crashpad/test/ios:ios_crash_xcuitests_module/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -80049,7 +80049,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -80061,7 +80061,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_net_unittests iPhone 6s 14.5", + "name": "ios_net_unittests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -80087,15 +80087,15 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 3 }, "test_id_prefix": "ninja://ios/net:ios_net_unittests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -80208,7 +80208,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -80220,7 +80220,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_remoting_unittests iPhone 6s 14.5", + "name": "ios_remoting_unittests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -80246,14 +80246,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://remoting/ios:ios_remoting_unittests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -80417,7 +80417,7 @@ "--platform", "iPad Air 2", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -80430,7 +80430,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_showcase_eg2tests_module iPad Air 2 14.5", + "name": "ios_showcase_eg2tests_module iPad Air 2 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -80456,14 +80456,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/showcase:ios_showcase_eg2tests_module/", - "variant_id": "iPad Air 2 14.5" + "variant_id": "iPad Air 2 14.4" }, { "args": [ @@ -80523,7 +80523,7 @@ "--platform", "iPhone 7", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -80536,7 +80536,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_showcase_eg2tests_module iPhone 7 14.5", + "name": "ios_showcase_eg2tests_module iPhone 7 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -80562,14 +80562,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/showcase:ios_showcase_eg2tests_module/", - "variant_id": "iPhone 7 14.5" + "variant_id": "iPhone 7 14.4" }, { "args": [ @@ -80682,7 +80682,7 @@ "--platform", "iPhone X", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -80695,7 +80695,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_showcase_eg2tests_module iPhone X 14.5", + "name": "ios_showcase_eg2tests_module iPhone X 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -80721,14 +80721,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/showcase:ios_showcase_eg2tests_module/", - "variant_id": "iPhone X 14.5" + "variant_id": "iPhone X 14.4" }, { "args": [ @@ -80841,7 +80841,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -80853,7 +80853,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_testing_unittests iPhone 6s 14.5", + "name": "ios_testing_unittests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -80879,14 +80879,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/testing:ios_testing_unittests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -81258,7 +81258,7 @@ "--platform", "iPad Air 2", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -81271,7 +81271,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_web_shell_eg2tests_module iPad Air 2 14.5", + "name": "ios_web_shell_eg2tests_module iPad Air 2 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -81297,14 +81297,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/web/shell/test:ios_web_shell_eg2tests_module/", - "variant_id": "iPad Air 2 14.5" + "variant_id": "iPad Air 2 14.4" }, { "args": [ @@ -81364,7 +81364,7 @@ "--platform", "iPhone 7", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -81377,7 +81377,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_web_shell_eg2tests_module iPhone 7 14.5", + "name": "ios_web_shell_eg2tests_module iPhone 7 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -81403,14 +81403,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/web/shell/test:ios_web_shell_eg2tests_module/", - "variant_id": "iPhone 7 14.5" + "variant_id": "iPhone 7 14.4" }, { "args": [ @@ -81523,7 +81523,7 @@ "--platform", "iPhone X", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -81536,7 +81536,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "ios_web_shell_eg2tests_module iPhone X 14.5", + "name": "ios_web_shell_eg2tests_module iPhone X 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -81562,14 +81562,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://ios/web/shell/test:ios_web_shell_eg2tests_module/", - "variant_id": "iPhone X 14.5" + "variant_id": "iPhone X 14.4" }, { "args": [ @@ -82306,7 +82306,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -82318,7 +82318,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "net_unittests iPhone 6s 14.5", + "name": "net_unittests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -82344,14 +82344,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://net:net_unittests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -82462,7 +82462,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -82474,7 +82474,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "services_unittests iPhone 6s 14.5", + "name": "services_unittests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -82500,14 +82500,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://services:services_unittests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -82826,7 +82826,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -82838,7 +82838,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "sql_unittests iPhone 6s 14.5", + "name": "sql_unittests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -82864,14 +82864,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://sql:sql_unittests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -83190,7 +83190,7 @@ "--platform", "iPhone 6s", "--version", - "14.5", + "14.4", "--out-dir", "${ISOLATED_OUTDIR}", "--xcode-build-version", @@ -83202,7 +83202,7 @@ "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, - "name": "url_unittests iPhone 6s 14.5", + "name": "url_unittests iPhone 6s 14.4", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -83228,14 +83228,14 @@ "path": "Xcode.app" }, { - "name": "runtime_ios_14_5", - "path": "Runtime-ios-14.5" + "name": "runtime_ios_14_4", + "path": "Runtime-ios-14.4" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://url:url_unittests/", - "variant_id": "iPhone 6s 14.5" + "variant_id": "iPhone 6s 14.4" }, { "args": [ @@ -92772,7 +92772,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v102.0.5005.75/test_ash_chrome" ], "isolate_profile_data": true, @@ -92799,7 +92799,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v103.0.5060.15/test_ash_chrome" ], "isolate_profile_data": true, @@ -92826,7 +92826,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v103.0.5060.22/test_ash_chrome" ], "isolate_profile_data": true, @@ -92853,7 +92853,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v104.0.5101.0/test_ash_chrome" ], "isolate_profile_data": true, @@ -94372,7 +94372,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v102.0.5005.75/test_ash_chrome" ], "merge": { @@ -94404,7 +94404,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v103.0.5060.15/test_ash_chrome" ], "merge": { @@ -94436,7 +94436,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v103.0.5060.22/test_ash_chrome" ], "merge": { @@ -94468,7 +94468,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v104.0.5101.0/test_ash_chrome" ], "merge": { @@ -96205,7 +96205,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v102.0.5005.75/test_ash_chrome" ], "merge": { @@ -96237,7 +96237,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v103.0.5060.15/test_ash_chrome" ], "merge": { @@ -96269,7 +96269,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v103.0.5060.22/test_ash_chrome" ], "merge": { @@ -96301,7 +96301,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v104.0.5101.0/test_ash_chrome" ], "merge": { @@ -97280,7 +97280,7 @@ "gtest_tests": [ { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v102.0.5005.75/test_ash_chrome" ], "merge": { @@ -97311,7 +97311,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v103.0.5060.15/test_ash_chrome" ], "merge": { @@ -97342,7 +97342,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v103.0.5060.22/test_ash_chrome" ], "merge": { @@ -97373,7 +97373,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v104.0.5101.0/test_ash_chrome" ], "merge": {
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index 3b08dff..e8098c5 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -18988,7 +18988,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v102.0.5005.75/test_ash_chrome" ], "isolate_profile_data": true, @@ -19020,7 +19020,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v103.0.5060.15/test_ash_chrome" ], "isolate_profile_data": true, @@ -19052,7 +19052,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v103.0.5060.22/test_ash_chrome" ], "isolate_profile_data": true, @@ -19084,7 +19084,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "--ash-chrome-path-override=../../lacros_version_skew_tests_v104.0.5101.0/test_ash_chrome" ], "isolate_profile_data": true,
diff --git a/testing/buildbot/chromium.rust.json b/testing/buildbot/chromium.rust.json index 90002a2..d4ef32e 100644 --- a/testing/buildbot/chromium.rust.json +++ b/testing/buildbot/chromium.rust.json
@@ -161,6 +161,7 @@ }, "linux-rust-x64-dbg": { "additional_compile_targets": [ + "gnrt_tests", "mojo_rust", "mojo_rust_tests", "rust_build_tests", @@ -248,6 +249,20 @@ "test_id_prefix": "ninja://build/rust/tests:build_rust_tests/" }, { + "isolate_name": "gnrt_tests", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "gnrt_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gnrt_tests", + "test_id_prefix": "ninja://tools/crates/gnrt:gnrt_tests/" + }, + { "isolate_name": "mojo_rust_tests", "merge": { "args": [], @@ -265,6 +280,7 @@ }, "linux-rust-x64-rel": { "additional_compile_targets": [ + "gnrt_tests", "mojo_rust", "mojo_rust_tests", "rust_build_tests", @@ -352,6 +368,20 @@ "test_id_prefix": "ninja://build/rust/tests:build_rust_tests/" }, { + "isolate_name": "gnrt_tests", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "gnrt_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gnrt_tests", + "test_id_prefix": "ninja://tools/crates/gnrt:gnrt_tests/" + }, + { "isolate_name": "mojo_rust_tests", "merge": { "args": [], @@ -369,6 +399,7 @@ }, "linux-rust-x64-rel-android-toolchain": { "additional_compile_targets": [ + "gnrt_tests", "mojo_rust", "mojo_rust_tests", "rust_build_tests", @@ -456,6 +487,20 @@ "test_id_prefix": "ninja://build/rust/tests:build_rust_tests/" }, { + "isolate_name": "gnrt_tests", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "gnrt_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gnrt_tests", + "test_id_prefix": "ninja://tools/crates/gnrt:gnrt_tests/" + }, + { "isolate_name": "mojo_rust_tests", "merge": { "args": [],
diff --git a/testing/buildbot/filters/BUILD.gn b/testing/buildbot/filters/BUILD.gn index e93be27..f6c44f55 100644 --- a/testing/buildbot/filters/BUILD.gn +++ b/testing/buildbot/filters/BUILD.gn
@@ -281,6 +281,7 @@ data = [ "//testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", + "//testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", "//testing/buildbot/filters/ozone-linux.interactive_ui_tests_wayland.filter", "//testing/buildbot/filters/pixel_tests.filter", ]
diff --git a/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter b/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter index 669a661..896c2ff 100644 --- a/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter +++ b/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter
@@ -17,7 +17,6 @@ -OmniboxViewViewsTest.SelectionClipboard -SameSiteSubframe* -SitePerProcessInteractiveBrowserTest.TabAndMouseFocusNavigation --TabDragging* -TabMetricsLoggerTest.CreateWindowFeaturesTestWindowActivation -WidgetInputMethodInteractiveTest.Activation -WidgetInputMethodInteractiveTest.OneWindow @@ -36,3 +35,44 @@ -CommandsApiTest.PageActionKeyUpdated -CommandsApiTest.UnpinnedPageActionTriggers -PrivacySandboxDialogViewInteractiveUiTest.EscapeClosesNotice + +# TODO(crbug.com/1336691) Most tab dragging tests are failing, or flaky, but a +# few consistently pass when run using touch interactions. +-TabDragging/DetachToBrowserTabDragControllerTest.CancelOnNewTabWhenDragging/* +-TabDragging/DetachToBrowserTabDragControllerTest.CaptureLostDuringDrag/* +-TabDragging/DetachToBrowserTabDragControllerTest.DeleteBeforeStartedDragging/* +-TabDragging/DetachToBrowserTabDragControllerTest.DeleteTabsWhileDetached/* +-TabDragging/DetachToBrowserTabDragControllerTest.DeleteTabWhileAttached/* +-TabDragging/DetachToBrowserTabDragControllerTest.DetachFromFullsizeWindow/* +-TabDragging/DetachToBrowserTabDragControllerTest.DetachToOwnWindow/* +-TabDragging/DetachToBrowserTabDragControllerTest.DetachToOwnWindowFromMaximizedWindow/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragAll/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragAllToSeparateWindow/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragCollapsedGroupHeaderExpandsGroup/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragDirectlyToSecondWindow/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragDoesntStartFromClick/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragGroupHeaderDragsGroup/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragGroupHeaderLeftAvoidsOtherGroups/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragGroupHeaderRightAvoidsOtherGroups/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragGroupHeaderToSeparateWindow/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragInSameWindow/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragLeftToUngroupTab/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragMultipleTabsLeftIntoGroup/0 +-TabDragging/DetachToBrowserTabDragControllerTest.DragMultipleTabsRightIntoGroup/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragOnlyTabInGroupRemovesGroup/0 +-TabDragging/DetachToBrowserTabDragControllerTest.DragPinnedTabDoesNotGroup/0 +-TabDragging/DetachToBrowserTabDragControllerTest.DragRightToUngroupTab/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragSingleTabLeftIntoGroup/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragSingleTabRightIntoGroup/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragSingleTabRightOfRightmostGroup/0 +-TabDragging/DetachToBrowserTabDragControllerTest.DragSingleTabToSeparateWindow/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragTabLeftPastCollapsedGroupHeader/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragTabRightPastCollapsedGroupHeader/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragTabWithinGroupDoesNotModifyGroup/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragToSeparateWindow/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragWindowIntoGroup/* +-TabDragging/DetachToBrowserTabDragControllerTest.DragWithMaskedWindows/* +-TabDragging/DetachToBrowserTabDragControllerTest.KeyPressShouldEndDragTest/* +-TabDragging/DetachToBrowserTabDragControllerTest.OffsetForDraggingTab/* +-TabDragging/DetachToBrowserTabDragControllerTest.Revert* +-TabDragging/DetachToBrowserTabDragControllerTest.SelectTabDuringDrag/*
diff --git a/testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter b/testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter new file mode 100644 index 0000000..d6df265 --- /dev/null +++ b/testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter
@@ -0,0 +1,7 @@ +# This filter is used for version skew testing. +# +# If you want to disable a test only for version skew testing, +# you should add the test here, not in the source code. + +# Older versions of ash don't support injecting touch events via weston-test. +-TabDragging/*/1
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index 6ef83a3..72c6d37 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -726,6 +726,10 @@ "label": "//third_party/crashpad/crashpad:crashpad_tests", "type": "console_test_launcher", }, + "gnrt_tests": { + "label": "//tools/crates/gnrt:gnrt_tests", + "type": "generated_script", + }, "cronet_package": { "label": "//components/cronet:cronet_package", "type": "additional_compile_target",
diff --git a/testing/buildbot/internal.chromeos.fyi.json b/testing/buildbot/internal.chromeos.fyi.json index e14faaf..aa6e81e 100644 --- a/testing/buildbot/internal.chromeos.fyi.json +++ b/testing/buildbot/internal.chromeos.fyi.json
@@ -185,7 +185,7 @@ ] }, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 7 + "shards": 10 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/"
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index ce82c18..91c5bbd 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -1122,6 +1122,7 @@ 'chromeos-amd64-generic-rel': { 'swarming': { 'quickrun_shards': 8, + 'shards': 7, }, }, 'chromeos-betty-pi-arc-cfi-thin-lto-chrome': {
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index e0dec26..fe4516e 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -639,7 +639,7 @@ 'idempotent': False, # https://crbug.com/923426#c27 # Tast test doesn't always output. See crbug.com/1306300 'io_timeout': 3600, - 'shards': 7, + 'shards': 10, }, 'mixins': [ 'has_native_resultdb_integration', @@ -4327,6 +4327,7 @@ 'test': 'interactive_ui_tests', 'args': [ '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter', + '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter', ], 'swarming': { 'shards': 3, @@ -4784,6 +4785,10 @@ 'swarming': {}, 'test': 'build_rust_tests', }, + 'gnrt_tests': { + 'swarming': {}, + 'test': 'gnrt_tests', + }, 'mojo_rust_tests': { 'swarming': {}, 'test': 'mojo_rust_tests', @@ -7057,7 +7062,7 @@ 'variants': [ 'SIM_IPHONE_8_16_0', 'SIM_IPHONE_6S_15_5', - 'SIM_IPHONE_6S_14_5', + 'SIM_IPHONE_6S_14_4', ], }, 'ios_crash_unittests': { @@ -7070,7 +7075,7 @@ 'variants': [ 'SIM_IPHONE_X_16_0', 'SIM_IPHONE_6S_15_5', - 'SIM_IPHONE_6S_14_5', + 'SIM_IPHONE_6S_14_4', ] }, 'ios_eg2_tests': { @@ -7082,9 +7087,9 @@ 'SIM_IPHONE_7_15_5', 'SIM_IPAD_AIR_2_15_5', 'SIM_IPHONE_X_15_5', - 'SIM_IPHONE_7_14_5', - 'SIM_IPAD_AIR_2_14_5', - 'SIM_IPHONE_X_14_5', + 'SIM_IPHONE_7_14_4', + 'SIM_IPAD_AIR_2_14_4', + 'SIM_IPHONE_X_14_4', ] }, 'ios_eg2_cq_tests': { @@ -7096,9 +7101,9 @@ 'SIM_IPHONE_7_15_5', 'SIM_IPAD_AIR_2_15_5', 'SIM_IPHONE_X_15_5', - 'SIM_IPHONE_7_14_5', - 'SIM_IPAD_AIR_2_14_5', - 'SIM_IPHONE_X_14_5', + 'SIM_IPHONE_7_14_4', + 'SIM_IPAD_AIR_2_14_4', + 'SIM_IPHONE_X_14_4', ] }, 'ios_screen_size_dependent_tests': {
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 2454466d..2fdc21d 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -122,6 +122,18 @@ 'ios_runtime_cache_14_5', ], }, + 'SIM_IPAD_AIR_2_14_4': { + 'args': [ + '--platform', + 'iPad Air 2', + '--version', + '14.4' + ], + 'identifier': 'iPad Air 2 14.4', + 'mixins': [ + 'ios_runtime_cache_14_4', + ], + }, 'SIM_IPAD_AIR_2_15_0': { 'args': [ '--platform', @@ -208,6 +220,18 @@ 'ios_runtime_cache_16_0', ], }, + 'SIM_IPHONE_6S_14_4': { + 'args': [ + '--platform', + 'iPhone 6s', + '--version', + '14.4', + ], + 'identifier': 'iPhone 6s 14.4', + 'mixins': [ + 'ios_runtime_cache_14_4', + ], + }, 'SIM_IPHONE_6S_14_5': { 'args': [ '--platform', @@ -280,6 +304,18 @@ 'ios_runtime_cache_15_5', ], }, + 'SIM_IPHONE_7_14_4': { + 'args': [ + '--platform', + 'iPhone 7', + '--version', + '14.4', + ], + 'identifier': 'iPhone 7 14.4', + 'mixins': [ + 'ios_runtime_cache_14_4', + ], + }, 'SIM_IPHONE_7_14_5': { 'args': [ '--platform', @@ -1192,4 +1228,4 @@ 'win10_nvidia_gtx_1660_stable', ], }, -} \ No newline at end of file +}
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index 3b82f6f..3ab5f56 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -249,6 +249,22 @@ }, 'os_type': 'chromeos', }, + 'lacros-arm64-generic-chrome': { + 'additional_compile_targets': [ + 'chrome', + 'lacros_version_metadata', + 'linux_symbols', + 'symupload', + 'strip_chrome_binary' + ], + 'mixins': [ + 'chrome-swarming-pool', + ], + 'test_suites': { + 'isolated_scripts': 'chrome_sizes', + }, + 'os_type': 'chromeos', + }, 'linux-chrome': { 'additional_compile_targets': [ 'chrome', @@ -5425,6 +5441,7 @@ }, 'linux-rust-x64-dbg' : { 'additional_compile_targets': [ + 'gnrt_tests', 'mojo_rust', 'mojo_rust_tests', 'rust_build_tests', @@ -5437,6 +5454,7 @@ }, 'linux-rust-x64-rel' : { 'additional_compile_targets': [ + 'gnrt_tests', 'mojo_rust', 'mojo_rust_tests', 'rust_build_tests', @@ -5449,6 +5467,7 @@ }, 'linux-rust-x64-rel-android-toolchain' : { 'additional_compile_targets': [ + 'gnrt_tests', 'mojo_rust', 'mojo_rust_tests', 'rust_build_tests',
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 2738c98..3c474034 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -4500,6 +4500,21 @@ ] } ], + "IOSEnableFaviconForPasswords": [ + { + "platforms": [ + "ios" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "EnableFaviconForPasswords" + ] + } + ] + } + ], "IOSEnableUnrealizedWebStates": [ { "platforms": [ @@ -5870,25 +5885,6 @@ ] } ], - "OmniboxLocalHistoryZPSoniOS": [ - { - "platforms": [ - "ios" - ], - "experiments": [ - { - "name": "Enabled_60_Days_Stable_GWS", - "params": { - "OmniboxLocalZeroSuggestAgeThreshold": "60" - }, - "enable_features": [ - "LocalHistoryZeroSuggest", - "OmniboxLocalZeroSuggestAgeThreshold" - ] - } - ] - } - ], "OmniboxLoggingMigration": [ { "platforms": [
diff --git a/third_party/blink/public/devtools_protocol/browser_protocol.pdl b/third_party/blink/public/devtools_protocol/browser_protocol.pdl index a420bb1..96cc1841 100644 --- a/third_party/blink/public/devtools_protocol/browser_protocol.pdl +++ b/third_party/blink/public/devtools_protocol/browser_protocol.pdl
@@ -9533,6 +9533,9 @@ recordContinuously recordAsMuchAsPossible echoToConsole + # Size of the trace buffer in kilobytes. If not specified or zero is passed, a default value + # of 200 MB would be used. + optional number traceBufferSizeInKb # Turns on JavaScript stack sampling. optional boolean enableSampling # Turns on system tracing.
diff --git a/third_party/blink/renderer/core/layout/layout_object_hot.cc b/third_party/blink/renderer/core/layout/layout_object_hot.cc index e1e739a0..2669818 100644 --- a/third_party/blink/renderer/core/layout/layout_object_hot.cc +++ b/third_party/blink/renderer/core/layout/layout_object_hot.cc
@@ -186,11 +186,6 @@ if (pseudo_id == kPseudoIdMarker && StyleRef().ContentBehavesAsNormal()) return; - // Don't propagate style from markers with 'content: normal' because it's not - // needed and it would be slow. - if (pseudo_id == kPseudoIdMarker && StyleRef().ContentBehavesAsNormal()) - return; - // Propagate style from pseudo elements to generated content. We skip children // with pseudo element StyleType() in the for-loop above and skip over // descendants which are not generated content in this subtree traversal.
diff --git a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc index e27eb1e..83f5d99 100644 --- a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc +++ b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
@@ -549,6 +549,9 @@ if (auto* window = DynamicTo<LocalDOMWindow>(GetExecutionContext())) { return window->document()->GetStyleEngine().GetFontSelector(); } + // TODO(crbug.com/1334864): Temporary mitigation. Remove the following + // CHECK once a more comprehensive solution has been implemented. + CHECK(GetExecutionContext()->IsWorkerGlobalScope()); return To<WorkerGlobalScope>(GetExecutionContext())->GetFontSelector(); }
diff --git a/third_party/blink/web_tests/PRESUBMIT.py b/third_party/blink/web_tests/PRESUBMIT.py index f07a96a..0de56440 100644 --- a/third_party/blink/web_tests/PRESUBMIT.py +++ b/third_party/blink/web_tests/PRESUBMIT.py
@@ -183,6 +183,7 @@ dirs_from_build_gn = [] start_line = '# === List Test Cases folders here ===' end_line = '# === Test Case Folders Ends ===' + end_line_count = 0 find_start_line = False for line in input_api.ReadFile(path_build_gn).splitlines(): line = line.strip() @@ -191,7 +192,11 @@ continue if find_start_line: if line.startswith(end_line): - break + find_start_line = False + end_line_count += 1 + if end_line_count == 2: + break + continue if len(line.split('/')) > 1: dirs_from_build_gn.append(line.split('/')[-2]) dirs_from_build_gn.extend(
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 6b6a665..5340cb3 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -4777,10 +4777,6 @@ # Sheriff 2019-03-05 crbug.com/938200 http/tests/devtools/network/network-blocked-reason.js [ Pass Timeout ] -# Skip before rebaselining expectations -crbug.com/v8/12808 external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/v8-code-cache.html [ Skip ] -crbug.com/v8/12808 virtual/v8-off-thread-finalization/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/v8-code-cache.html [ Skip ] - # Caused a revert of a good change. crbug.com/931533 media/video-played-collapse.html [ Failure Pass ]
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/v8-code-cache-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/v8-code-cache-expected.txt index 63bda116..85cfb60 100644 --- a/third_party/blink/web_tests/platform/generic/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/v8-code-cache-expected.txt +++ b/third_party/blink/web_tests/platform/generic/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/v8-code-cache-expected.txt
@@ -7,7 +7,7 @@ PASS module: Run #1 PASS module: Run #2 PASS module: Run #3 -FAIL module: Run #4 promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch dynamically imported module: http://web-platform.test:8001/html/semantics/scripting-1/the-script-element/module/imports-a.js" +PASS module: Run #4 FAIL module: Run #5 promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch dynamically imported module: http://web-platform.test:8001/html/semantics/scripting-1/the-script-element/module/imports-a.js" Harness: the test ran to completion.
diff --git a/third_party/nearby/README.chromium b/third_party/nearby/README.chromium index dd72fb0..350aab6 100644 --- a/third_party/nearby/README.chromium +++ b/third_party/nearby/README.chromium
@@ -1,7 +1,7 @@ Name: Nearby Connections Library Short Name: Nearby URL: https://github.com/google/nearby -Version: d8453565db739ebbfbbeade9ec8f8239057b1e13 +Version: 6ebf3731c8d23eed49f39813f5a6fa57d3baf5c5 License: Apache 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/rust/Cargo.lock b/third_party/rust/Cargo.lock new file mode 100644 index 0000000..47bcc79a --- /dev/null +++ b/third_party/rust/Cargo.lock
@@ -0,0 +1,884 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.17.0" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" + +[[package]] +name = "aho-corasick" +version = "0.7.18" +dependencies = [ + "memchr", +] + +[[package]] +name = "ansi_term" +version = "0.11.0" +dependencies = [ + "winapi", +] + +[[package]] +name = "aquamarine" +version = "0.1.11" +dependencies = [ + "itertools 0.9.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atty" +version = "0.2.14" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" + +[[package]] +name = "autocxx" +version = "0.22.2" +dependencies = [ + "aquamarine", + "autocxx-macro", + "cxx", + "moveit", +] + +[[package]] +name = "autocxx-bindgen" +version = "0.59.17" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "clap 2.33.3", + "env_logger", + "itertools 0.10.3", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "which", +] + +[[package]] +name = "autocxx-engine" +version = "0.22.2" +dependencies = [ + "aquamarine", + "autocxx-bindgen", + "autocxx-parser", + "cxx-gen", + "indexmap", + "indoc", + "itertools 0.10.3", + "log", + "miette", + "once_cell", + "proc-macro2", + "quote", + "regex", + "serde_json", + "strum_macros", + "syn", + "tempfile", + "thiserror", + "version_check", +] + +[[package]] +name = "autocxx-gen" +version = "0.22.2" +dependencies = [ + "autocxx-engine", + "clap 3.1.12", + "env_logger", + "indexmap", + "miette", + "pathdiff", + "proc-macro2", +] + +[[package]] +name = "autocxx-macro" +version = "0.22.2" +dependencies = [ + "autocxx-parser", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocxx-parser" +version = "0.22.2" +dependencies = [ + "indexmap", + "itertools 0.10.3", + "log", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn", + "thiserror", +] + +[[package]] +name = "backtrace" +version = "0.3.64" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "bindgen" +version = "0.59.2" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "clap 2.33.3", + "env_logger", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "which", +] + +[[package]] +name = "bitflags" +version = "1.3.2" + +[[package]] +name = "camino" +version = "1.0.9" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.2" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.14.2" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" + +[[package]] +name = "chromium" +version = "0.1.0" +dependencies = [ + "autocxx", + "autocxx-bindgen", + "autocxx-gen", + "bindgen", + "cargo-platform", + "cargo_metadata", + "clap 3.1.12", + "cxx", + "cxxbridge-cmd", + "once_cell", + "rstest", + "rustversion", + "serde", + "serde_json_lenient", + "small_ctor", + "syn", + "tempfile", + "toml", + "unicode-linebreak", +] + +[[package]] +name = "clang-sys" +version = "1.3.0" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "2.33.3" +dependencies = [ + "ansi_term", + "atty", + "bitflags", + "strsim 0.8.0", + "textwrap 0.11.0", + "unicode-width", + "vec_map", +] + +[[package]] +name = "clap" +version = "3.1.12" +dependencies = [ + "atty", + "bitflags", + "clap_lex", + "indexmap", + "lazy_static", + "strsim 0.10.0", + "termcolor", + "textwrap 0.15.0", +] + +[[package]] +name = "clap_lex" +version = "0.1.1" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "cxx" +version = "1.0.68" +dependencies = [ + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-gen" +version = "0.7.68" +dependencies = [ + "codespan-reporting", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cxxbridge-cmd" +version = "1.0.68" +dependencies = [ + "clap 3.1.12", + "codespan-reporting", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cxxbridge-macro" +version = "1.0.68" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "either" +version = "1.6.1" + +[[package]] +name = "env_logger" +version = "0.9.0" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "fastrand" +version = "1.7.0" +dependencies = [ + "instant", +] + +[[package]] +name = "gimli" +version = "0.26.1" + +[[package]] +name = "glob" +version = "0.3.0" + +[[package]] +name = "hashbrown" +version = "0.11.2" + +[[package]] +name = "heck" +version = "0.4.0" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "humantime" +version = "2.1.0" + +[[package]] +name = "indexmap" +version = "1.8.1" +dependencies = [ + "autocfg", + "hashbrown", + "serde", +] + +[[package]] +name = "indoc" +version = "1.0.3" +dependencies = [ + "unindent", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "is_ci" +version = "1.1.1" + +[[package]] +name = "itertools" +version = "0.9.0" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.10.3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.8" + +[[package]] +name = "itoa" +version = "1.0.1" + +[[package]] +name = "lazy_static" +version = "1.4.0" + +[[package]] +name = "lazycell" +version = "1.3.0" + +[[package]] +name = "libc" +version = "0.2.105" + +[[package]] +name = "libloading" +version = "0.7.3" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "link-cplusplus" +version = "1.0.5" + +[[package]] +name = "log" +version = "0.4.14" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memchr" +version = "2.4.1" + +[[package]] +name = "miette" +version = "4.3.0" +dependencies = [ + "atty", + "backtrace", + "miette-derive", + "once_cell", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap 0.15.0", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "4.3.0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" + +[[package]] +name = "miniz_oxide" +version = "0.4.4" +dependencies = [ + "adler", + "autocfg", +] + +[[package]] +name = "moveit" +version = "0.5.0" +dependencies = [ + "cxx", +] + +[[package]] +name = "nom" +version = "7.1.0" +dependencies = [ + "memchr", + "minimal-lexical", + "version_check", +] + +[[package]] +name = "object" +version = "0.27.1" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.10.0" + +[[package]] +name = "os_str_bytes" +version = "6.0.0" + +[[package]] +name = "owo-colors" +version = "3.3.0" + +[[package]] +name = "pathdiff" +version = "0.2.1" + +[[package]] +name = "peeking_take_while" +version = "0.1.2" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.32" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.10" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.5.4" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.25" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +dependencies = [ + "winapi", +] + +[[package]] +name = "rstest" +version = "0.12.0" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "rustc_version", + "syn", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.21" + +[[package]] +name = "rustc-hash" +version = "1.1.0" + +[[package]] +name = "rustc_version" +version = "0.4.0" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.6" + +[[package]] +name = "ryu" +version = "1.0.5" + +[[package]] +name = "semver" +version = "1.0.4" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.130" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.130" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.78" +dependencies = [ + "itoa 1.0.1", + "ryu", + "serde", +] + +[[package]] +name = "serde_json_lenient" +version = "0.1.4" +dependencies = [ + "itoa 0.4.8", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "1.1.0" + +[[package]] +name = "small_ctor" +version = "0.1.0" + +[[package]] +name = "smawk" +version = "0.3.1" + +[[package]] +name = "strsim" +version = "0.8.0" + +[[package]] +name = "strsim" +version = "0.10.0" + +[[package]] +name = "strum_macros" +version = "0.24.0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "supports-color" +version = "1.3.0" +dependencies = [ + "atty", + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "1.2.0" +dependencies = [ + "atty", +] + +[[package]] +name = "supports-unicode" +version = "1.0.2" +dependencies = [ + "atty", +] + +[[package]] +name = "syn" +version = "1.0.81" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.2" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminal_size" +version = "0.1.17" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "textwrap" +version = "0.15.0" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.30" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.30" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "toml" +version = "0.5.9" +dependencies = [ + "serde", +] + +[[package]] +name = "unicode-linebreak" +version = "0.1.2" +dependencies = [ + "regex", +] + +[[package]] +name = "unicode-width" +version = "0.1.9" + +[[package]] +name = "unicode-xid" +version = "0.2.2" + +[[package]] +name = "unindent" +version = "0.1.7" + +[[package]] +name = "vec_map" +version = "0.8.2" + +[[package]] +name = "version_check" +version = "0.9.4" + +[[package]] +name = "which" +version = "4.2.4" +dependencies = [ + "either", + "lazy_static", + "libc", +] + +[[package]] +name = "winapi" +version = "0.3.9" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
diff --git a/third_party/rust/Cargo.toml b/third_party/rust/Cargo.toml new file mode 100644 index 0000000..8eb0194 --- /dev/null +++ b/third_party/rust/Cargo.toml
@@ -0,0 +1,490 @@ +# !!! DO NOT EDIT -- Autogenerated by gnrt from third_party.toml. Edit that file instead. See tools/crates/gnrt. + +[package] +name = "chromium" +version = "0.1.0" +edition = "2021" + +[workspace] +members = ["autocxx_gen/v0_22/crate"] + +[dependencies] +cxxbridge-cmd = "1" +cxx = "1" +autocxx = "0.22" +serde = "1" + +[dependencies.rustversion] +version = "1" +build-script-outputs = ["version.rs"] + +[dependencies.autocxx-bindgen] +version = "0.59" +features = ["static"] +build-script-outputs = ["host-target.txt"] + +[dependencies.autocxx-gen] +version = "0.22" +features = ["static"] + +[dependencies.serde_json_lenient] +version = "0.1" +features = ["unbounded_depth", "float_roundtrip"] + +[dependencies.unicode-linebreak] +version = "0.1" +build-script-outputs = ["tables.rs"] + +[dependencies.bindgen] +version = "0.59" +features = ["static"] +build-script-outputs = ["host-target.txt"] + +[dev-dependencies] +tempfile = "3" +toml = "0.5" +cargo-platform = "0.1" +cargo_metadata = "0.14" +rstest = "0.12" +clap = "3" +small_ctor = "0.1" +once_cell = "1" + +[dev-dependencies.syn] +version = "1" +features = ["full"] +[patch.crates-io.libloading_v0_7] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/libloading/v0_7/crate" +package = "libloading" + +[patch.crates-io.rustversion_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/rustversion/v1/crate" +package = "rustversion" + +[patch.crates-io.vec_map_v0_8] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/vec_map/v0_8/crate" +package = "vec_map" + +[patch.crates-io.owo-colors_v3] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/owo_colors/v3/crate" +package = "owo-colors" + +[patch.crates-io.toml_v0_5] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/toml/v0_5/crate" +package = "toml" + +[patch.crates-io.autocxx_v0_22] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/autocxx/v0_22/crate" +package = "autocxx" + +[patch.crates-io.strsim_v0_8] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/strsim/v0_8/crate" +package = "strsim" + +[patch.crates-io.tempfile_v3] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/tempfile/v3/crate" +package = "tempfile" + +[patch.crates-io.termcolor_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/termcolor/v1/crate" +package = "termcolor" + +[patch.crates-io.aho-corasick_v0_7] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/aho_corasick/v0_7/crate" +package = "aho-corasick" + +[patch.crates-io.autocxx-macro_v0_22] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/autocxx_macro/v0_22/crate" +package = "autocxx-macro" + +[patch.crates-io.unicode-linebreak_v0_1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/unicode_linebreak/v0_1/crate" +package = "unicode-linebreak" + +[patch.crates-io.ryu_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/ryu/v1/crate" +package = "ryu" + +[patch.crates-io.winapi_v0_3] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/winapi/v0_3/crate" +package = "winapi" + +[patch.crates-io.winapi-util_v0_1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/winapi_util/v0_1/crate" +package = "winapi-util" + +[patch.crates-io.link-cplusplus_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/link_cplusplus/v1/crate" +package = "link-cplusplus" + +[patch.crates-io.indoc_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/indoc/v1/crate" +package = "indoc" + +[patch.crates-io.cargo-platform_v0_1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/cargo_platform/v0_1/crate" +package = "cargo-platform" + +[patch.crates-io.once_cell_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/once_cell/v1/crate" +package = "once_cell" + +[patch.crates-io.proc-macro-error-attr_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/proc_macro_error_attr/v1/crate" +package = "proc-macro-error-attr" + +[patch.crates-io.nom_v7] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/nom/v7/crate" +package = "nom" + +[patch.crates-io.heck_v0_4] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/heck/v0_4/crate" +package = "heck" + +[patch.crates-io.hashbrown_v0_11] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/hashbrown/v0_11/crate" +package = "hashbrown" + +[patch.crates-io.ansi_term_v0_11] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/ansi_term/v0_11/crate" +package = "ansi_term" + +[patch.crates-io.quote_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/quote/v1/crate" +package = "quote" + +[patch.crates-io.miniz_oxide_v0_4] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/miniz_oxide/v0_4/crate" +package = "miniz_oxide" + +[patch.crates-io.cxx_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/cxx/v1/crate" +package = "cxx" + +[patch.crates-io.itoa_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/itoa/v1/crate" +package = "itoa" + +[patch.crates-io.memchr_v2] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/memchr/v2/crate" +package = "memchr" + +[patch.crates-io.rustc-demangle_v0_1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/rustc_demangle/v0_1/crate" +package = "rustc-demangle" + +[patch.crates-io.bitflags_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/bitflags/v1/crate" +package = "bitflags" + +[patch.crates-io.autocxx-gen_v0_22] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/autocxx_gen/v0_22/crate" +package = "autocxx-gen" + +[patch.crates-io.clap_v3] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/clap/v3/crate" +package = "clap" + +[patch.crates-io.proc-macro2_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/proc_macro2/v1/crate" +package = "proc-macro2" + +[patch.crates-io.rstest_v0_12] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/rstest/v0_12/crate" +package = "rstest" + +[patch.crates-io.rustc_version_v0_4] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/rustc_version/v0_4/crate" +package = "rustc_version" + +[patch.crates-io.autocfg_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/autocfg/v1/crate" +package = "autocfg" + +[patch.crates-io.serde_json_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/serde_json/v1/crate" +package = "serde_json" + +[patch.crates-io.object_v0_27] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/object/v0_27/crate" +package = "object" + +[patch.crates-io.small_ctor_v0_1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/small_ctor/v0_1/crate" +package = "small_ctor" + +[patch.crates-io.minimal-lexical_v0_2] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/minimal_lexical/v0_2/crate" +package = "minimal-lexical" + +[patch.crates-io.lazycell_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/lazycell/v1/crate" +package = "lazycell" + +[patch.crates-io.semver_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/semver/v1/crate" +package = "semver" + +[patch.crates-io.glob_v0_3] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/glob/v0_3/crate" +package = "glob" + +[patch.crates-io.terminal_size_v0_1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/terminal_size/v0_1/crate" +package = "terminal_size" + +[patch.crates-io.adler_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/adler/v1/crate" +package = "adler" + +[patch.crates-io.unindent_v0_1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/unindent/v0_1/crate" +package = "unindent" + +[patch.crates-io.rustc-hash_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/rustc_hash/v1/crate" +package = "rustc-hash" + +[patch.crates-io.humantime_v2] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/humantime/v2/crate" +package = "humantime" + +[patch.crates-io.atty_v0_2] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/atty/v0_2/crate" +package = "atty" + +[patch.crates-io.cxx-gen_v0_7] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/cxx_gen/v0_7/crate" +package = "cxx-gen" + +[patch.crates-io.clap_v2] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/clap/v2/crate" +package = "clap" + +[patch.crates-io.autocxx-parser_v0_22] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/autocxx_parser/v0_22/crate" +package = "autocxx-parser" + +[patch.crates-io.clap_lex_v0_1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/clap_lex/v0_1/crate" +package = "clap_lex" + +[patch.crates-io.regex_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/regex/v1/crate" +package = "regex" + +[patch.crates-io.autocxx-engine_v0_22] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/autocxx_engine/v0_22/crate" +package = "autocxx-engine" + +[patch.crates-io.cxxbridge-macro_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/cxxbridge_macro/v1/crate" +package = "cxxbridge-macro" + +[patch.crates-io.fastrand_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/fastrand/v1/crate" +package = "fastrand" + +[patch.crates-io.aquamarine_v0_1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/aquamarine/v0_1/crate" +package = "aquamarine" + +[patch.crates-io.gimli_v0_26] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/gimli/v0_26/crate" +package = "gimli" + +[patch.crates-io.serde_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/serde/v1/crate" +package = "serde" + +[patch.crates-io.indexmap_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/indexmap/v1/crate" +package = "indexmap" + +[patch.crates-io.peeking_take_while_v0_1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/peeking_take_while/v0_1/crate" +package = "peeking_take_while" + +[patch.crates-io.serde_json_lenient_v0_1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/serde_json_lenient/v0_1/crate" +package = "serde_json_lenient" + +[patch.crates-io.cfg-if_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/cfg_if/v1/crate" +package = "cfg-if" + +[patch.crates-io.either_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/either/v1/crate" +package = "either" + +[patch.crates-io.shlex_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/shlex/v1/crate" +package = "shlex" + +[patch.crates-io.remove_dir_all_v0_5] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/remove_dir_all/v0_5/crate" +package = "remove_dir_all" + +[patch.crates-io.smawk_v0_3] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/smawk/v0_3/crate" +package = "smawk" + +[patch.crates-io.miette-derive_v4] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/miette_derive/v4/crate" +package = "miette-derive" + +[patch.crates-io.supports-color_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/supports_color/v1/crate" +package = "supports-color" + +[patch.crates-io.supports-unicode_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/supports_unicode/v1/crate" +package = "supports-unicode" + +[patch.crates-io.syn_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/syn/v1/crate" +package = "syn" + +[patch.crates-io.cargo_metadata_v0_14] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/cargo_metadata/v0_14/crate" +package = "cargo_metadata" + +[patch.crates-io.thiserror_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/thiserror/v1/crate" +package = "thiserror" + +[patch.crates-io.libc_v0_2] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/libc/v0_2/crate" +package = "libc" + +[patch.crates-io.thiserror-impl_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/thiserror_impl/v1/crate" +package = "thiserror-impl" + +[patch.crates-io.strsim_v0_10] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/strsim/v0_10/crate" +package = "strsim" + +[patch.crates-io.codespan-reporting_v0_11] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/codespan_reporting/v0_11/crate" +package = "codespan-reporting" + +[patch.crates-io.autocxx-bindgen_v0_59] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/autocxx_bindgen/v0_59/crate" +package = "autocxx-bindgen" + +[patch.crates-io.itertools_v0_9] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/itertools/v0_9/crate" +package = "itertools" + +[patch.crates-io.regex-syntax_v0_6] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/regex_syntax/v0_6/crate" +package = "regex-syntax" + +[patch.crates-io.strum_macros_v0_24] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/strum_macros/v0_24/crate" +package = "strum_macros" + +[patch.crates-io.textwrap_v0_15] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/textwrap/v0_15/crate" +package = "textwrap" + +[patch.crates-io.unicode-width_v0_1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/unicode_width/v0_1/crate" +package = "unicode-width" + +[patch.crates-io.which_v4] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/which/v4/crate" +package = "which" + +[patch.crates-io.log_v0_4] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/log/v0_4/crate" +package = "log" + +[patch.crates-io.env_logger_v0_9] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/env_logger/v0_9/crate" +package = "env_logger" + +[patch.crates-io.itoa_v0_4] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/itoa/v0_4/crate" +package = "itoa" + +[patch.crates-io.os_str_bytes_v6] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/os_str_bytes/v6/crate" +package = "os_str_bytes" + +[patch.crates-io.pathdiff_v0_2] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/pathdiff/v0_2/crate" +package = "pathdiff" + +[patch.crates-io.bindgen_v0_59] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/bindgen/v0_59/crate" +package = "bindgen" + +[patch.crates-io.unicode-xid_v0_2] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/unicode_xid/v0_2/crate" +package = "unicode-xid" + +[patch.crates-io.textwrap_v0_11] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/textwrap/v0_11/crate" +package = "textwrap" + +[patch.crates-io.cexpr_v0_6] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/cexpr/v0_6/crate" +package = "cexpr" + +[patch.crates-io.moveit_v0_5] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/moveit/v0_5/crate" +package = "moveit" + +[patch.crates-io.clang-sys_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/clang_sys/v1/crate" +package = "clang-sys" + +[patch.crates-io.lazy_static_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/lazy_static/v1/crate" +package = "lazy_static" + +[patch.crates-io.supports-hyperlinks_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/supports_hyperlinks/v1/crate" +package = "supports-hyperlinks" + +[patch.crates-io.addr2line_v0_17] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/addr2line/v0_17/crate" +package = "addr2line" + +[patch.crates-io.version_check_v0_9] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/version_check/v0_9/crate" +package = "version_check" + +[patch.crates-io.miette_v4] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/miette/v4/crate" +package = "miette" + +[patch.crates-io.proc-macro-error_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/proc_macro_error/v1/crate" +package = "proc-macro-error" + +[patch.crates-io.itertools_v0_10] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/itertools/v0_10/crate" +package = "itertools" + +[patch.crates-io.camino_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/camino/v1/crate" +package = "camino" + +[patch.crates-io.is_ci_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/is_ci/v1/crate" +package = "is_ci" + +[patch.crates-io.cxxbridge-cmd_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/cxxbridge_cmd/v1/crate" +package = "cxxbridge-cmd" + +[patch.crates-io.backtrace_v0_3] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/backtrace/v0_3/crate" +package = "backtrace" + +[patch.crates-io.serde_derive_v1] +path = "/usr/local/google/home/collinbaker/chromium/src/third_party/rust/serde_derive/v1/crate" +package = "serde_derive"
diff --git a/third_party/rust/src/main.rs b/third_party/rust/src/main.rs new file mode 100644 index 0000000..c8cca56 --- /dev/null +++ b/third_party/rust/src/main.rs
@@ -0,0 +1 @@ +// !!! DO NOT EDIT -- Autogenerated by gnrt from third_party.toml. Edit that file instead. See tools/crates/gnrt. \ No newline at end of file
diff --git a/third_party/rust/third_party.toml b/third_party/rust/third_party.toml index fbc8b9d..078ac11 100644 --- a/third_party/rust/third_party.toml +++ b/third_party/rust/third_party.toml
@@ -33,6 +33,15 @@ # their BUILD.gn file. The :lib target can be depended on from Chromium # production and test code. Third-party crates that are not listed in this # file are not visible to Chromium code. + +# Since autocxx-gen is used as a standalone binary, rather than as a library, we +# can't depend on it in the usual way. Add it as a workspace member so cargo can +# resolve its dependencies. +[workspace] +members = [ + "autocxx_gen/v0_22/crate", +] + [dependencies] cxxbridge-cmd = "1" cxx = "1"
diff --git a/third_party/wayland-protocols/unstable/weston-test/weston-test.xml b/third_party/wayland-protocols/unstable/weston-test/weston-test.xml index 53e7a40..3de00fc 100644 --- a/third_party/wayland-protocols/unstable/weston-test/weston-test.xml +++ b/third_party/wayland-protocols/unstable/weston-test/weston-test.xml
@@ -162,6 +162,14 @@ <arg name="y" type="fixed"/> <arg name="touch_type" type="uint"/> </request> + <event name="touch_received"> + <description summary="a callback event that is called upon send_touch request"> + Signals that the event has been sent. The x and y are the same values + sent via the send_touch request. + </description> + <arg name="x" type="fixed"/> + <arg name="y" type="fixed"/> + </event> </interface> <interface name="weston_test_runner" version="1">
diff --git a/tools/android/native_lib_memory/PRESUBMIT.py b/tools/android/native_lib_memory/PRESUBMIT.py index b5a8c19..87683bb 100644 --- a/tools/android/native_lib_memory/PRESUBMIT.py +++ b/tools/android/native_lib_memory/PRESUBMIT.py
@@ -19,7 +19,7 @@ input_api.canned_checks.RunPylint(input_api, output_api, files_to_skip=files_to_skip, - version='1.5')) + version='2.7')) # These tests don't run on Windows and give verbose and cryptic failure # messages. if input_api.sys.platform != 'win32':
diff --git a/tools/android/native_lib_memory/parse_smaps.py b/tools/android/native_lib_memory/parse_smaps.py index d0d449de..9dbf4453 100755 --- a/tools/android/native_lib_memory/parse_smaps.py +++ b/tools/android/native_lib_memory/parse_smaps.py
@@ -19,7 +19,7 @@ from devil.android import device_utils -class Mapping(object): +class Mapping: """A single entry (mapping) in /proc/[pid]/smaps.""" def __init__(self, start, end, permissions, offset, pathname): @@ -129,6 +129,8 @@ if line.startswith('VmPTE:'): value = int(line[len('VmPTE: '):line.index('kB')]) return value + # Should not be reached. + return None def _SummarizeMapping(mapping, metric): @@ -171,8 +173,7 @@ # libc_malloc mappings can come from the zygote. In this case, the shared # dirty memory is likely dirty in the zygote, don't count it. return mapping.fields['Rss'] - else: - return mapping.fields['Private_Dirty'] + return mapping.fields['Private_Dirty'] def _PrintEstimatedFootprintStats(mappings, page_table_kb):
diff --git a/tools/checkperms/PRESUBMIT.py b/tools/checkperms/PRESUBMIT.py index f2a8640..4faa6b2 100644 --- a/tools/checkperms/PRESUBMIT.py +++ b/tools/checkperms/PRESUBMIT.py
@@ -15,7 +15,7 @@ def CommonChecks(input_api, output_api): output = [] output.extend( - input_api.canned_checks.RunPylint(input_api, output_api, version='1.5')) + input_api.canned_checks.RunPylint(input_api, output_api, version='2.7')) # Run it like if it were a unit test. output.extend( input_api.canned_checks.RunUnitTests(input_api,
diff --git a/tools/checkperms/checkperms.py b/tools/checkperms/checkperms.py index 37a1d0ed..259bfc13 100755 --- a/tools/checkperms/checkperms.py +++ b/tools/checkperms/checkperms.py
@@ -192,7 +192,7 @@ VALID_CHARS = set(string.ascii_lowercase + string.digits + '/-_.') for paths in (EXECUTABLE_PATHS, NON_EXECUTABLE_PATHS, IGNORED_PATHS): - assert all([set(path).issubset(VALID_CHARS) for path in paths]) + assert all(set(path).issubset(VALID_CHARS) for path in paths) git_name = 'git.bat' if sys.platform.startswith('win') else 'git' @@ -215,6 +215,8 @@ root = capture([git_name, 'rev-parse', '--show-toplevel'], dir_path).strip() if root: return root + # Should not be reached. + return None def is_ignored(rel_path): @@ -261,7 +263,8 @@ def has_shebang_or_is_elf_or_mach_o(full_path): - """Returns if the file starts with #!/ or is an ELF or Mach-O binary. + """Returns a three-element tuple that indicates if the file starts with #!/, + is an ELF binary, or Mach-O binary. full_path is the absolute path to the file. """ @@ -312,13 +315,13 @@ if must_be_executable(rel_path): if not bit: return result_dict('Must have executable bit set: %s' % exec_add) - return + return None if must_not_be_executable(rel_path): if bit: return result_dict('Must not have executable bit set: %s' % exec_remove) - return + return None if ignored_extension(rel_path): - return + return None # For the others, it depends on the file header. (shebang, elf, mach_o) = has_shebang_or_is_elf_or_mach_o(full_path) @@ -332,6 +335,7 @@ if elf: return result_dict('Has ELF header but not executable bit: %s' % exec_add) # Mach-O is allowed to exist in the tree with or without an executable bit. + return None def check_files(root, files): @@ -340,7 +344,7 @@ return filter(None, gen) -class ApiBase(object): +class ApiBase: def __init__(self, root_dir, bare_output): self.root_dir = root_dir self.bare_output = bare_output
diff --git a/tools/code_coverage/create_js_source_maps/PRESUBMIT.py b/tools/code_coverage/create_js_source_maps/PRESUBMIT.py index 0cfee788..f125bf8 100644 --- a/tools/code_coverage/create_js_source_maps/PRESUBMIT.py +++ b/tools/code_coverage/create_js_source_maps/PRESUBMIT.py
@@ -6,6 +6,8 @@ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on the presubmit API built into gcl. """ +import sys + USE_PYTHON3 = True PRESUBMIT_VERSION = '2.0.0' @@ -13,15 +15,17 @@ def CheckLint(input_api, output_api): results = input_api.canned_checks.RunPylint(input_api, output_api, - version='1.5') + version='2.7') results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api, check_js=True) try: - import sys old_sys_path = sys.path[:] cwd = input_api.PresubmitLocalPath() sys.path += [input_api.os_path.join(cwd, '..', '..')] + # Suppress import warning because the import needs to be done inside a + # try/finally block with sys.path modifications. + # pylint: disable=import-outside-toplevel from web_dev_style import presubmit_support results += presubmit_support.CheckStyleESLint(input_api, output_api) finally:
diff --git a/tools/crates/gnrt/BUILD.gn b/tools/crates/gnrt/BUILD.gn new file mode 100644 index 0000000..1d948921 --- /dev/null +++ b/tools/crates/gnrt/BUILD.gn
@@ -0,0 +1,46 @@ +# 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/rust.gni") +import("//build/rust/rust_executable.gni") +import("//build/rust/rust_unit_tests_group.gni") + +if (toolchain_has_rust && rustc_can_link) { + rust_executable("gnrt") { + # Mark this tool testonly so we can use more third-party crates. This tool + # is neither built into Chromium nor used directly in the build process. It + # is only run by developers and the output is checked in. + testonly = true + + crate_root = "main.rs" + sources = [ + "main.rs", + "manifest.rs", + "paths.rs", + ] + + deps = [ + "//third_party/rust/cargo_metadata/v0_14:test_support", + "//third_party/rust/cargo_platform/v0_1:test_support", + "//third_party/rust/clap/v3:test_support", + "//third_party/rust/heck/v0_4:lib", + "//third_party/rust/once_cell/v1:test_support", + "//third_party/rust/serde/v1:lib", + "//third_party/rust/serde_json/v1:lib", + "//third_party/rust/tempfile/v3:test_support", + "//third_party/rust/toml/v0_5:test_support", + ] + + test_inputs = [ "test_metadata.json" ] + + build_native_rust_unit_tests = true + } +} + +rust_unit_tests_group("gnrt_tests") { + deps = [] + if (can_build_rust_unit_tests) { + deps += [ ":gnrt_unittests" ] + } +}
diff --git a/tools/crates/gnrt/README.md b/tools/crates/gnrt/README.md new file mode 100644 index 0000000..bf374d8 --- /dev/null +++ b/tools/crates/gnrt/README.md
@@ -0,0 +1,4 @@ +gnrt: GN from Rust third_party (pronounced "generate") + +gnrt is a tool to generate GN build rules from vendored Rust crates in +//third_party/rust.
diff --git a/tools/crates/gnrt/crates.rs b/tools/crates/gnrt/crates.rs new file mode 100644 index 0000000..d156056 --- /dev/null +++ b/tools/crates/gnrt/crates.rs
@@ -0,0 +1,294 @@ +// 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. + +//! Utilities to handle vendored third-party crates. + +use crate::manifest; + +use std::fmt::{self, Display}; +use std::fs; +use std::io; +use std::path::{Path, PathBuf}; +use std::str::FromStr; + +/// A normalized version as used in third_party/rust crate paths. +/// +/// A crate version is identified by the major version, if it's >= 1, or the +/// minor version, if the major version is 0. There is a many-to-one +/// relationship between crate versions and epochs. +#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub enum Epoch { + /// Epoch with major version == 0. The field is the minor version. It is an + /// error to use 0: methods may panic in this case. + Minor(u32), + /// Epoch with major version >= 1. It is an error to use 0: methods may + /// panic in this case. + Major(u32), +} + +// This gives us a ToString implementation for free. +impl Display for Epoch { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + // These should never return Err since formatting an integer is + // infallible. + Epoch::Minor(minor) => { + assert_ne!(minor, 0); + f.write_fmt(format_args!("v0_{minor}")).unwrap() + } + Epoch::Major(major) => { + assert_ne!(major, 0); + f.write_fmt(format_args!("v{major}")).unwrap() + } + } + + Ok(()) + } +} + +impl FromStr for Epoch { + type Err = EpochParseError; + + /// A valid input string is of the form: + /// * "v{i}", where i >= 1, or + /// * "v0_{i}", where i >= 1 + /// + /// Any other string is invalid. If the "v" is missing, there are extra + /// underscore-separated components, or there are two numbers but both + /// are 0 or greater than zero are all invalid strings. + fn from_str(s: &str) -> Result<Self, Self::Err> { + // Split off the "v" prefix. + let mut iter = s.split_inclusive('v'); + if iter.next() != Some("v") { + return Err(EpochParseError::BadFormat); + } + let s = iter.next().ok_or(EpochParseError::BadFormat)?; + if iter.next() != None { + return Err(EpochParseError::BadFormat); + } + + // Split the major and minor version numbers. + let mut parts = s.split('_'); + let major: Option<u32> = + parts.next().map(|s| s.parse().map_err(EpochParseError::InvalidInt)).transpose()?; + let minor: Option<u32> = + parts.next().map(|s| s.parse().map_err(EpochParseError::InvalidInt)).transpose()?; + + // Get the final epoch, checking that the (major, minor) pair is valid. + let result = match (major, minor) { + (Some(0), Some(0)) => Err(EpochParseError::BadVersion), + (Some(0), Some(minor)) => Ok(Epoch::Minor(minor)), + (Some(major), None) => Ok(Epoch::Major(major)), + (Some(_), Some(_)) => Err(EpochParseError::BadVersion), + (None, None) => Err(EpochParseError::BadFormat), + _ => unreachable!(), + }?; + + // Ensure there's no remaining parts. + if parts.next() == None { Ok(result) } else { Err(EpochParseError::BadFormat) } + } +} + +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum EpochParseError { + /// An integer could not be parsed where expected. + InvalidInt(std::num::ParseIntError), + /// The string was not formatted correctly. It was missing the 'v' prefix, + /// was missing the '_' separator, or had a tail after the last integer. + BadFormat, + /// The epoch had an invalid combination of versions: e.g. "v0_0", "v1_0", + /// "v1_1". + BadVersion, +} + +impl Display for EpochParseError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + use EpochParseError::*; + match self { + InvalidInt(parse_int_error) => parse_int_error.fmt(f), + BadFormat => f.write_str("epoch string had incorrect format"), + BadVersion => f.write_str("epoch string had invalid version"), + } + } +} + +impl std::error::Error for EpochParseError {} + +/// A crate name normalized to the format we use in //third_party. +#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub struct NormalizedName(String); + +impl NormalizedName { + /// Wrap a normalized name, checking that it is valid. + pub fn new(normalized_name: &str) -> Option<NormalizedName> { + let converted_name = Self::from_crate_name(normalized_name); + if converted_name.0 == normalized_name { Some(converted_name) } else { None } + } + + /// Normalize a crate name. `crate_name` is the name Cargo uses to refer to + /// the crate. + pub fn from_crate_name(crate_name: &str) -> NormalizedName { + NormalizedName( + crate_name + .chars() + .map(|c| match c { + '-' | '.' => '_', + c => c, + }) + .collect(), + ) + } +} + +impl fmt::Display for NormalizedName { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(&self.0) + } +} + +/// Identifies a vendored third-party crate. +#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub struct ThirdPartyCrate { + /// The upstream name as specified in its Cargo.toml. + pub name: String, + /// The crate's epoch, as defined by `Epoch`. + pub epoch: Epoch, +} + +impl ThirdPartyCrate { + /// The location of this crate relative to the third-party Rust crate + /// directory. Crates are laid out according to their name and epoch. + pub fn crate_path(&self) -> PathBuf { + let mut path = PathBuf::new(); + path.push(NormalizedName::from_crate_name(&self.name).0); + path.push(self.epoch.to_string()); + path.push("crate"); + path + } + + /// Unique but arbitrary name for this (crate, epoch) pair. Suitable for use + /// in Cargo.toml [patch] sections. + pub fn patch_name(&self) -> String { + format!("{}_{}", self.name, self.epoch) + } +} + +impl fmt::Display for ThirdPartyCrate { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_fmt(format_args!("{} {}", self.name, self.epoch)) + } +} + +/// Traverse vendored third-party crates and collect the set of names and +/// epochs. The returned list is in unspecified order. +pub fn collect_third_party_crates<P: AsRef<Path>>( + crates_path: P, +) -> io::Result<Vec<ThirdPartyCrate>> { + let mut crates = Vec::new(); + + for crate_dir in fs::read_dir(crates_path)? { + // Look at each crate directory. + let crate_dir: fs::DirEntry = crate_dir?; + if !crate_dir.file_type()?.is_dir() { + continue; + } + + let crate_path = crate_dir.path(); + + // Ensure the path has a valid name: is UTF8, has our normalized format. + let normalized_name = path_as_str(crate_path.file_name().unwrap())?; + into_io_result(NormalizedName::new(normalized_name).ok_or_else(|| { + format!("unnormalized crate name in path {}", crate_path.to_string_lossy()) + }))?; + + for epoch_dir in fs::read_dir(crate_dir.path())? { + // Look at each epoch of the crate we have checked in. + let epoch_dir: fs::DirEntry = epoch_dir?; + if !crate_dir.file_type()?.is_dir() { + continue; + } + + let epoch_path = epoch_dir.path(); + let epoch_name = path_as_str(epoch_path.file_name().unwrap())?; + let epoch = match Epoch::from_str(epoch_name) { + Ok(epoch) => epoch, + // Skip if we can't parse the directory as a valid epoch. + Err(_) => continue, + }; + + // Try to read the Cargo.toml, since we need the package name. The + // directory name on disk is normalized but we need to refer to the + // package the way Cargo expects. + let manifest_path = epoch_path.join("crate/Cargo.toml"); + let manifest_contents = match fs::read_to_string(&manifest_path) { + Ok(s) => s, + Err(e) => match e.kind() { + // Skip this directory and log a message if a Cargo.toml + // doesn't exist. + io::ErrorKind::NotFound => { + println!( + "Warning: directory name parsed as valid epoch but \ + contained no Cargo.toml: {}", + manifest_path.to_string_lossy() + ); + continue; + } + _ => return Err(e), + }, + }; + let manifest: manifest::CargoManifest = toml::de::from_str(&manifest_contents).unwrap(); + let package_name = manifest.package.name; + + crates.push(ThirdPartyCrate { name: package_name, epoch }); + } + } + + Ok(crates) +} + +/// Utility to read a path as a `&str` with an informative error message if it +/// had invalid UTF8. +fn path_as_str<T: AsRef<Path> + ?Sized>(path: &T) -> io::Result<&str> { + let path = path.as_ref(); + into_io_result( + path.to_str().ok_or_else(|| format!("invalid utf8 in path {}", path.to_string_lossy())), + ) +} + +/// Utility to convert a `Result<T, E>` into `io::Result<T>` for any compatible +/// error type `E`. +fn into_io_result<T, E: Into<Box<dyn std::error::Error + Send + Sync>>>( + result: Result<T, E>, +) -> io::Result<T> { + result.map_err(|e| io::Error::new(io::ErrorKind::Other, e)) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn epoch_from_str() { + use Epoch::{Major, Minor}; + use EpochParseError::*; + assert_eq!(Epoch::from_str("v1"), Ok(Major(1))); + assert_eq!(Epoch::from_str("v2"), Ok(Major(2))); + assert_eq!(Epoch::from_str("v0_3"), Ok(Minor(3))); + assert_eq!(Epoch::from_str("0_1"), Err(BadFormat)); + assert_eq!(Epoch::from_str("v1_9"), Err(BadVersion)); + assert_eq!(Epoch::from_str("v0_0"), Err(BadVersion)); + assert_eq!(Epoch::from_str("v0_1_2"), Err(BadFormat)); + assert_eq!(Epoch::from_str("v1_0"), Err(BadVersion)); + assert!(matches!(Epoch::from_str("v1_0foo"), Err(InvalidInt(_)))); + assert!(matches!(Epoch::from_str("vx_1"), Err(InvalidInt(_)))); + } + + #[test] + fn epoch_to_string() { + use Epoch::{Major, Minor}; + assert_eq!(Major(1).to_string(), "v1"); + assert_eq!(Major(2).to_string(), "v2"); + assert_eq!(Minor(3).to_string(), "v0_3"); + } +}
diff --git a/tools/crates/gnrt/deps.rs b/tools/crates/gnrt/deps.rs new file mode 100644 index 0000000..36413893 --- /dev/null +++ b/tools/crates/gnrt/deps.rs
@@ -0,0 +1,490 @@ +// 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. + +//! Utilities to process `cargo metadata` dependency graph. + +use crate::crates::{Epoch, NormalizedName}; +use crate::platforms::{self, Platform, PlatformSet}; + +use std::collections::{hash_map::Entry, HashMap, HashSet}; +use std::iter; +use std::path::PathBuf; + +pub use cargo_metadata::DependencyKind; +pub use cargo_metadata::Version; + +/// A single transitive third-party dependency. Includes information needed for +/// generating build files later. +#[derive(Clone, Debug)] +pub struct Dependency { + /// The package name as used by cargo. + pub package_name: String, + /// The normalized name we use in vendored crate paths. + pub normalized_name: NormalizedName, + /// The package version as used by cargo. + pub version: Version, + /// The epoch derived from the dependency version. Used for our vendored + /// third-party crates. + pub epoch: Epoch, + /// A package can be depended upon in different ways: as a normal + /// dependency, just for build scripts, or just for tests. `kinds` contains + /// an entry for each way this package is depended on. + pub dependency_kinds: HashMap<DependencyKind, PerKindInfo>, + /// The package's lib target, or `None` if it doesn't have one. + pub lib_target: Option<LibTarget>, + /// List of binaries provided by the package. + pub bin_targets: Vec<BinTarget>, + /// The build script's absolute path, or `None` if the package does not use + /// one. + pub build_script: Option<PathBuf>, + /// The path in the dependency graph to this package. This is intended for + /// human consumption when debugging missing packages. + pub dependency_path: Vec<String>, + /// Whether the source is a local path. Is `false` if cargo resolved this + /// dependency from online (crates.io or git). This should be `true` for all + /// valid packages. Returning `false` for a dependency allows better error + /// messages later. + pub is_local: bool, +} + +/// Information specific to the dependency kind: for normal, build script, or +/// test dependencies. +#[derive(Clone, Debug)] +pub struct PerKindInfo { + /// The set of platforms this kind is needed on. + pub platforms: PlatformSet, + /// The resovled feature set for this kind. + pub features: Vec<String>, +} + +/// Description of a package's lib target. +#[derive(Clone, Debug)] +pub struct LibTarget { + /// The absolute path of the lib target's `lib.rs`. + pub root: PathBuf, + /// The type of the lib target. This is "rlib" for normal dependencies and + /// "proc-macro" for proc macros. + pub lib_type: LibType, +} + +/// A binary provided by a package. +#[derive(Clone, Debug)] +pub struct BinTarget { + /// The absolute path of the binary's root source file (e.g. `main.rs`). + pub root: PathBuf, + /// The binary name. + pub name: String, +} + +/// The type of lib target. Only includes types supported by this tool. +#[derive(Clone, Copy, Debug)] +pub enum LibType { + /// A normal Rust rlib library. + Rlib, + /// A procedural macro. + ProcMacro, +} + +impl std::fmt::Display for LibType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match *self { + Self::Rlib => f.write_str("rlib"), + Self::ProcMacro => f.write_str("proc-macro"), + } + } +} + +/// Process the dependency graph in `metadata` to a flat list of transitive +/// dependencies. Each element in the result corresponds to a cargo package. A +/// package may have multiple crates, each of which corresponds to a single +/// rustc invocation: e.g. a package may have a lib crate as well as multiple +/// binary crates. +pub fn collect_dependencies(metadata: &cargo_metadata::Metadata) -> Vec<Dependency> { + // The metadata is split into two parts: + // 1. A list of packages and associated info: targets (e.g. lib, bin, + // tests), source path, etc. This includes all workspace members and all + // transitive dependencies. Deps are not filtered based on platform or + // features: it is the maximal set of dependencies. + // 2. Resolved dependency graph. There is a node for each package pointing + // to its dependencies in each configuration (normal, build, dev), and + // the resolved feature set. This includes platform-specific info so one + // can filter based on target platform. Nodes include an ID that uniquely + // refers to a package in both (1) and (2). + // + // We need info from both parts. Traversing the graph tells us exactly which + // crates are needed for a given configuration and platform. In the process, + // we must collect package IDs then look up other data in (1). + // + // Note the difference between "packages" and "crates" as described in + // https://doc.rust-lang.org/book/ch07-01-packages-and-crates.html + + // `metadata`'s structures are flattened into lists. Make it easy to index + // by package ID. + let dep_graph: MetadataGraph = build_graph(metadata); + + // `cargo metadata`'s resolved dependency graph. + let resolved_graph: &cargo_metadata::Resolve = metadata.resolve.as_ref().unwrap(); + + // The ID of the fake root package. Do not include it in the dependency list + // since it is not actually built. + let fake_root: &cargo_metadata::PackageId = resolved_graph.root.as_ref().unwrap(); + + // `explore_node`, our recursive depth-first traversal function, needs to + // share state between stack frames. Construct the shared state. + let mut traversal_state = TraversalState { + dep_graph: &dep_graph, + root: fake_root, + visited: HashSet::new(), + path: Vec::new(), + dependencies: HashMap::new(), + }; + + // Do a depth-first traversal of the graph to find all relevant + // dependencies. Start from each workspace package ("chromium" and + // additional binary members used in the build). + for root_id in dep_graph.roots.iter() { + let node_map: &HashMap<&cargo_metadata::PackageId, &cargo_metadata::Node> = + &dep_graph.nodes; + explore_node(&mut traversal_state, node_map.get(*root_id).unwrap()); + } + + // `traversal_state.dependencies` is the output of `explore_node`. Pull it + // out for processing. + let mut dependencies = traversal_state.dependencies; + + // Fill in the per-package data for each dependency. Check that there are no + // duplicate (package, epoch) pairs while we do so. + let mut version_set = HashSet::<(&NormalizedName, Epoch)>::new(); + for (id, dep) in dependencies.iter_mut() { + let node: &cargo_metadata::Node = traversal_state.dep_graph.nodes.get(id).unwrap(); + let package: &cargo_metadata::Package = traversal_state.dep_graph.packages.get(id).unwrap(); + + dep.package_name = package.name.clone(); + dep.normalized_name = NormalizedName::from_crate_name(&package.name); + + // TODO(crbug.com/1291994): Resolve features independently per kind + // and platform. This may require using the unstable unit-graph feature: + // https://doc.rust-lang.org/cargo/reference/unstable.html#unit-graph + for (_, kind_info) in dep.dependency_kinds.iter_mut() { + kind_info.features = node.features.clone(); + } + + for target in package.targets.iter() { + let src_root = target.src_path.clone().into_std_path_buf(); + let target_type = match target.kind.iter().find_map(|s| TargetType::from_name(s)) { + Some(target_type) => target_type, + // Skip other targets, such as test, example, etc. + None => continue, + }; + + match target_type { + TargetType::Lib(lib_type) => { + // There can only be one lib target. + assert!( + dep.lib_target.is_none(), + "found duplicate lib target:\n{:?}\n{:?}", + dep.lib_target, + target + ); + dep.lib_target = Some(LibTarget { root: src_root, lib_type }); + } + TargetType::Bin => { + dep.bin_targets.push(BinTarget { root: src_root, name: target.name.clone() }); + } + TargetType::BuildScript => { + assert_eq!( + dep.build_script, None, + "found duplicate build script target {:?}", + target + ); + dep.build_script = Some(src_root); + } + } + } + + dep.version = package.version.clone(); + dep.epoch = match package.version.major { + 0 => Epoch::Minor(package.version.minor.try_into().unwrap()), + x => Epoch::Major(x.try_into().unwrap()), + }; + + // Make sure the package comes from our vendored source. If not, report the + // error for later. + dep.is_local = package.source == None; + + if !version_set.insert((&dep.normalized_name, dep.epoch)) { + panic!("found another package version with the same name and epoch: {:?}", dep); + } + } + + // Return a flat list of dependencies. + dependencies.into_iter().map(|(_, v)| v).collect() +} + +/// Graph traversal state shared by recursive calls of `explore_node`. +struct TraversalState<'a> { + /// The graph from "cargo metadata", processed for indexing by package id. + dep_graph: &'a MetadataGraph<'a>, + /// The fake root package that we exclude from `dependencies`. + root: &'a cargo_metadata::PackageId, + /// Set of packages already visited by `explore_node`. + visited: HashSet<&'a cargo_metadata::PackageId>, + /// The path of package IDs to the current node. For human consumption. + path: Vec<String>, + /// The final set of dependencies. + dependencies: HashMap<&'a cargo_metadata::PackageId, Dependency>, +} + +/// Recursively explore a particular node in the dependency graph. Fills data in +/// `state`. The final output is in `state.dependencies`. +fn explore_node<'a>(state: &mut TraversalState<'a>, node: &'a cargo_metadata::Node) { + // Mark the node as visited, or continue if it's already visited. + if !state.visited.insert(&node.id) { + return; + } + + // Helper to insert a placeholder `Dependency` into a map. We fill in the + // fields later. + let init_dep = |path| Dependency { + package_name: String::new(), + normalized_name: NormalizedName::from_crate_name(""), + // Dummy value to be filled in later. + version: Version::new(0, 0, 0), + // Dummy value to be filled in later. + epoch: Epoch::Minor(1), + dependency_kinds: HashMap::new(), + lib_target: None, + bin_targets: Vec::new(), + build_script: None, + dependency_path: path, + is_local: false, + }; + + state.path.push(node.id.repr.clone()); + + // Each node contains a list of enabled features plus a list of + // dependencies. Each dependency has a platform filter if applicable. + for dep_edge in iter_node_deps(node) { + // Explore the target of this edge next. Note that we may visit the same + // node multiple times, but this is OK since we'll skip it in the + // recursive call. + let target_node: &cargo_metadata::Node = state.dep_graph.nodes.get(&dep_edge.pkg).unwrap(); + explore_node(state, target_node); + + // Merge this with the existing entry for the dep. + let dep: &mut Dependency = + state.dependencies.entry(dep_edge.pkg).or_insert_with(|| init_dep(state.path.clone())); + let info: &mut PerKindInfo = dep + .dependency_kinds + .entry(dep_edge.kind) + .or_insert(PerKindInfo { platforms: PlatformSet::empty(), features: Vec::new() }); + info.platforms.add(dep_edge.target); + } + + state.path.pop(); + + // Initialize the dependency entry for this node's package if it's not our + // fake root. + if &node.id != state.root { + state.dependencies.entry(&node.id).or_insert_with(|| init_dep(state.path.clone())); + } +} + +struct DependencyEdge<'a> { + pkg: &'a cargo_metadata::PackageId, + kind: DependencyKind, + target: Option<Platform>, +} + +/// Iterates over the dependencies of `node`, filtering out platforms we don't +/// support. +fn iter_node_deps(node: &cargo_metadata::Node) -> impl Iterator<Item = DependencyEdge<'_>> + '_ { + node.deps + .iter() + .map(|node_dep| { + // Each NodeDep has information about the package depended on, as well + // as the kinds of dependence: as a normal, build script, or test + // dependency. For each kind there is an optional platform filter. + // + // Filter out kinds for unsupported platforms while mapping the + // dependency edges to our own type. + node_dep.dep_kinds.iter().filter_map(|dep_kind_info| { + // Filter if it's for a platform we don't support. + match &dep_kind_info.target { + None => (), + Some(platform) => { + if !platforms::is_supported(platform) { + return None; + } + } + }; + + Some(DependencyEdge { + pkg: &node_dep.pkg, + kind: dep_kind_info.kind, + target: dep_kind_info.target.clone(), + }) + }) + }) + .flatten() +} + +/// Indexable representation of the `cargo_metadata::Metadata` fields we need. +struct MetadataGraph<'a> { + nodes: HashMap<&'a cargo_metadata::PackageId, &'a cargo_metadata::Node>, + packages: HashMap<&'a cargo_metadata::PackageId, &'a cargo_metadata::Package>, + roots: Vec<&'a cargo_metadata::PackageId>, +} + +/// Convert the flat lists in `metadata` to maps indexable by PackageId. +fn build_graph<'a>(metadata: &'a cargo_metadata::Metadata) -> MetadataGraph<'a> { + // `metadata` always has `resolve` unless cargo was explicitly asked not to + // output the dependency graph. + let resolve = metadata.resolve.as_ref().unwrap(); + let mut graph = HashMap::new(); + for node in resolve.nodes.iter() { + match graph.entry(&node.id) { + Entry::Vacant(e) => e.insert(node), + Entry::Occupied(_) => panic!("duplicate entries in dependency graph"), + }; + } + + let packages = metadata.packages.iter().map(|p| (&p.id, p)).collect(); + + let roots = iter::once(resolve.root.as_ref().unwrap()) + .chain(metadata.workspace_members.iter()) + .collect(); + + MetadataGraph { nodes: graph, packages, roots } +} + +/// A crate target type we support. +#[derive(Clone, Copy, Debug)] +enum TargetType { + Lib(LibType), + Bin, + BuildScript, +} + +impl TargetType { + fn from_name(name: &str) -> Option<Self> { + if name == "lib" || name == "rlib" { + Some(Self::Lib(LibType::Rlib)) + } else if name == "bin" { + Some(Self::Bin) + } else if name == "custom-build" { + Some(Self::BuildScript) + } else if name == "proc-macro" { + Some(Self::Lib(LibType::ProcMacro)) + } else if name == "dylib" || name == "cdylib" { + panic!("unsupported lib target type {:?}", name) + } else { + None + } + } +} + +impl std::fmt::Display for TargetType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match *self { + Self::Lib(typ) => typ.fmt(f), + Self::Bin => f.write_str("bin"), + Self::BuildScript => f.write_str("custom-build"), + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_sample_output() { + let metadata: cargo_metadata::Metadata = + serde_json::from_str(SAMPLE_CARGO_METADATA).unwrap(); + let mut dependencies = collect_dependencies(&metadata); + dependencies.sort_by(|left, right| { + left.package_name.cmp(&right.package_name).then(left.epoch.cmp(&right.epoch)) + }); + + let empty_str_slice: &'static [&'static str] = &[]; + + assert_eq!(dependencies[0].package_name, "cc"); + assert_eq!(dependencies[0].epoch, Epoch::Major(1)); + assert_eq!( + dependencies[0].dependency_kinds.get(&DependencyKind::Build).unwrap().features, + empty_str_slice + ); + + assert_eq!(dependencies[1].package_name, "more-asserts"); + assert_eq!(dependencies[1].epoch, Epoch::Minor(3)); + assert_eq!( + dependencies[1].dependency_kinds.get(&DependencyKind::Development).unwrap().features, + empty_str_slice + ); + + assert_eq!(dependencies[2].package_name, "once_cell"); + assert_eq!(dependencies[2].epoch, Epoch::Major(1)); + assert_eq!( + dependencies[2].dependency_kinds.get(&DependencyKind::Normal).unwrap().features, + &["alloc", "default", "race", "std"], + "{:?}", + dependencies[2] + ); + + assert_eq!(dependencies[3].package_name, "proc-macro2"); + assert_eq!(dependencies[3].epoch, Epoch::Major(1)); + assert_eq!( + dependencies[3].dependency_kinds.get(&DependencyKind::Normal).unwrap().features, + &["default", "proc-macro"] + ); + + assert_eq!(dependencies[4].package_name, "quote"); + assert_eq!(dependencies[4].epoch, Epoch::Major(1)); + assert_eq!( + dependencies[4].dependency_kinds.get(&DependencyKind::Normal).unwrap().features, + &["default", "proc-macro"] + ); + + assert_eq!(dependencies[5].package_name, "serde"); + assert_eq!(dependencies[5].epoch, Epoch::Major(1)); + assert_eq!( + dependencies[5].dependency_kinds.get(&DependencyKind::Normal).unwrap().features, + &["default", "derive", "serde_derive", "std"] + ); + + assert_eq!(dependencies[6].package_name, "serde_derive"); + assert_eq!(dependencies[6].epoch, Epoch::Major(1)); + assert_eq!( + dependencies[6].dependency_kinds.get(&DependencyKind::Normal).unwrap().features, + &["default"] + ); + + assert_eq!(dependencies[7].package_name, "syn"); + assert_eq!(dependencies[7].epoch, Epoch::Major(1)); + assert_eq!( + dependencies[7].dependency_kinds.get(&DependencyKind::Normal).unwrap().features, + &["clone-impls", "default", "derive", "parsing", "printing", "proc-macro", "quote"] + ); + + assert_eq!(dependencies[8].package_name, "termcolor"); + assert_eq!(dependencies[8].epoch, Epoch::Major(1)); + assert_eq!( + dependencies[8].dependency_kinds.get(&DependencyKind::Normal).unwrap().features, + empty_str_slice + ); + + assert_eq!(dependencies[9].package_name, "unicode-ident"); + assert_eq!(dependencies[9].epoch, Epoch::Major(1)); + assert_eq!( + dependencies[9].dependency_kinds.get(&DependencyKind::Normal).unwrap().features, + empty_str_slice + ); + } + + // test_metadata.json contains the output of "cargo metadata" run in + // sample_package. The dependency graph is relatively simple but includes + // transitive deps. + static SAMPLE_CARGO_METADATA: &'static str = include_str!("test_metadata.json"); +}
diff --git a/tools/crates/gnrt/main.rs b/tools/crates/gnrt/main.rs new file mode 100644 index 0000000..3d7ee30 --- /dev/null +++ b/tools/crates/gnrt/main.rs
@@ -0,0 +1,131 @@ +// 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. + +mod crates; +mod deps; +mod manifest; +mod paths; +mod platforms; + +use crates::ThirdPartyCrate; +use manifest::*; + +use std::collections::HashSet; +use std::fs; +use std::io::{self, Write}; +use std::path::Path; + +fn main() { + let args = clap::Command::new("gnrt") + .about("Generate GN build rules from third_party/rust crates") + .arg( + clap::Arg::new("output_cargo_toml") + .help("Output third_party/rust/Cargo.toml then exit immediately"), + ) + .get_matches(); + + let paths = paths::ChromiumPaths::new().unwrap(); + + let manifest_contents = + String::from_utf8(fs::read(paths.third_party.join("third_party.toml")).unwrap()).unwrap(); + let third_party_manifest: ThirdPartyManifest = toml::de::from_str(&manifest_contents).unwrap(); + + // Traverse our third-party directory to collect the set of vendored crates. + // Used to generate Cargo.toml [patch] sections, and later to check against + // `cargo metadata`'s dependency resolution to ensure we have all the crates + // we need. We sort `crates` for a stable ordering of [patch] sections. + let mut crates = crates::collect_third_party_crates(paths.third_party.clone()).unwrap(); + crates.sort(); + + // Generate a fake Cargo.toml for dependency resolution. + let cargo_manifest = generate_fake_cargo_toml( + third_party_manifest, + crates.iter().map(|c| { + let crate_path = paths.third_party.join(c.crate_path()).canonicalize().unwrap(); + manifest::PatchSpecification { + package_name: c.name.clone(), + patch_name: c.patch_name(), + path: crate_path, + } + }), + ); + + if args.is_present("output_cargo_toml") { + println!("{}", toml::ser::to_string(&cargo_manifest).unwrap()); + return; + } + + // Create a fake package: Cargo.toml and an empty main.rs. This allows cargo + // to construct a full dependency graph as if Chrome were a cargo package. + write!( + io::BufWriter::new(fs::File::create(paths.third_party.join("Cargo.toml")).unwrap()), + "# {}\n\n{}", + AUTOGENERATED_FILE_HEADER, + toml::to_string(&cargo_manifest).unwrap() + ) + .unwrap(); + create_dirs_if_needed(&paths.third_party.join("src")).unwrap(); + write!( + io::BufWriter::new(fs::File::create(paths.third_party.join("src/main.rs")).unwrap()), + "// {}", + AUTOGENERATED_FILE_HEADER + ) + .unwrap(); + + // Run `cargo metadata` and process the output to get a list of crates we + // depend on. + let mut command = cargo_metadata::MetadataCommand::new(); + command.current_dir(paths.third_party.clone()); + let dependencies = deps::collect_dependencies(&command.exec().unwrap()); + + // Compare cargo's dependency resolution with the crates we have on disk. + let present_crates: HashSet<&ThirdPartyCrate> = crates.iter().collect(); + let mut unused_crates: HashSet<&ThirdPartyCrate> = present_crates.clone(); + let mut missing_deps: Vec<&deps::Dependency> = Vec::new(); + for dep in dependencies.iter() { + let dep_crate = ThirdPartyCrate { name: dep.package_name.clone(), epoch: dep.epoch }; + + if present_crates.contains(&dep_crate) { + assert!(unused_crates.remove(&dep_crate)); + } else { + missing_deps.push(dep); + } + } + + for dep in missing_deps.iter() { + println!("Missing dependency: {} {}", dep.package_name, dep.epoch); + for edge in dep.dependency_path.iter() { + println!(" {edge}"); + } + } + + for c in unused_crates.iter() { + println!("Crate not used: {c}"); + } + + for nonlocal_dep in dependencies.iter().filter(|dep| !dep.is_local) { + println!( + "Error: dependency {} {} resolved to an upstream source. The checked-in version likely \ + does not satisfy another crate's dependency version requirement. Resolved \ + version: {}", + nonlocal_dep.package_name, nonlocal_dep.epoch, nonlocal_dep.version + ); + } +} + +fn create_dirs_if_needed(path: &Path) -> io::Result<()> { + if path.is_dir() { + return Ok(()); + } + + if let Some(parent) = path.parent() { + create_dirs_if_needed(parent)?; + } + + fs::create_dir(path) +} + +/// A message prepended to autogenerated files. Notes this tool generated it and +/// not to edit directly. +static AUTOGENERATED_FILE_HEADER: &'static str = "!!! DO NOT EDIT -- Autogenerated by gnrt from third_party.toml. Edit that file instead. See tools/crates/gnrt.";
diff --git a/tools/crates/gnrt/manifest.rs b/tools/crates/gnrt/manifest.rs new file mode 100644 index 0000000..1efd9b5 --- /dev/null +++ b/tools/crates/gnrt/manifest.rs
@@ -0,0 +1,332 @@ +// 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. + +//! Utilities for parsing and generating Cargo.toml and related manifest files. + +use std::collections::HashMap; +use std::path::PathBuf; + +use serde::{Deserialize, Serialize}; + +/// Set of dependencies for a particular usage: final artifacts, tests, or +/// build scripts. +pub type DependencySet = HashMap<String, Dependency>; + +pub type CargoPatchSet = HashMap<String, CargoPatch>; + +/// A crate version in a dependency specification. +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] +// From serde's perspective we serialize and deserialize this as a plain string. +#[serde(transparent)] +pub struct Version(pub String); + +/// Parsed third_party.toml. This is a limited variant of Cargo.toml. +#[derive(Clone, Debug, Deserialize)] +pub struct ThirdPartyManifest { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub workspace: Option<WorkspaceSpec>, + #[serde(flatten)] + pub dependency_spec: DependencySpec, +} + +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(rename_all = "kebab-case")] +pub struct WorkspaceSpec { + pub members: Vec<String>, +} + +/// The sets of all types of dependencies for a manifest: regular, build script, +/// and test. This should be included in other structs with `#[serde(flatten)]` +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(rename_all = "kebab-case")] +pub struct DependencySpec { + /// Regular dependencies built into production code. + #[serde( + default, + skip_serializing_if = "DependencySet::is_empty", + serialize_with = "toml::ser::tables_last" + )] + pub dependencies: DependencySet, + /// Test-only dependencies. + #[serde( + default, + skip_serializing_if = "DependencySet::is_empty", + serialize_with = "toml::ser::tables_last" + )] + pub dev_dependencies: DependencySet, + /// Build script dependencies. + #[serde( + default, + skip_serializing_if = "DependencySet::is_empty", + serialize_with = "toml::ser::tables_last" + )] + pub build_dependencies: DependencySet, +} + +/// A single crate dependency. +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] +#[serde(untagged)] +pub enum Dependency { + /// A dependency of the form `foo = "1.0.11"`: just the package name as key + /// and the version as value. The sole field is the crate version. + Short(Version), + /// A dependency that specifies other fields in the form of `foo = { ... }` + /// or `[dependencies.foo] ... `. + Full(FullDependency), +} + +/// A single crate dependency with some extra fields from third_party.toml. +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] +#[serde(rename_all = "kebab-case")] +pub struct FullDependency { + /// Version constraint on dependency. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option<Version>, + /// Required features. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub features: Vec<String>, + /// Whether this can be used directly from Chromium code, or only from other + /// third-party crates. + #[serde(default = "get_true", skip_serializing_if = "is_true")] + pub allow_first_party_usage: bool, + /// List of files generated by build.rs script. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub build_script_outputs: Vec<String>, +} + +/// Representation of a Cargo.toml file. +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(rename_all = "kebab-case")] +pub struct CargoManifest { + pub package: CargoPackage, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub workspace: Option<WorkspaceSpec>, + #[serde(flatten)] + pub dependency_spec: DependencySpec, + #[serde(default, rename = "patch")] + pub patches: HashMap<String, CargoPatchSet>, +} + +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(rename_all = "kebab-case")] +pub struct CargoPackage { + pub name: String, + pub version: Version, + #[serde(default)] + pub edition: Edition, +} + +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(transparent)] +pub struct Edition(pub String); + +impl Default for Edition { + fn default() -> Self { + Edition("2021".to_string()) + } +} + +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(rename_all = "kebab-case")] +pub struct CargoPatch { + pub path: String, + pub package: String, +} + +// Used to set the serde default of a field to true. +fn get_true() -> bool { + true +} + +fn is_true(b: &bool) -> bool { + *b +} + +#[derive(Debug)] +pub struct PatchSpecification { + pub package_name: String, + pub patch_name: String, + pub path: PathBuf, +} + +pub fn generate_fake_cargo_toml<Iter: IntoIterator<Item = PatchSpecification>>( + third_party_manifest: ThirdPartyManifest, + patches: Iter, +) -> CargoManifest { + let ThirdPartyManifest { workspace, mut dependency_spec } = third_party_manifest; + + // Hack: set all `allow_first_party_usage` fields to true so they are + // suppressed in the Cargo.toml. + for dep in [ + dependency_spec.dependencies.values_mut(), + dependency_spec.build_dependencies.values_mut(), + dependency_spec.dev_dependencies.values_mut(), + ] + .into_iter() + .flatten() + { + if let Dependency::Full(ref mut dep) = dep { + dep.allow_first_party_usage = true; + } + } + + let mut patch_sections: HashMap<String, CargoPatch> = HashMap::new(); + // Generate patch section. + for PatchSpecification { package_name, patch_name, path } in patches { + patch_sections.insert( + patch_name, + CargoPatch { path: path.to_str().unwrap().to_string(), package: package_name }, + ); + } + + let package = CargoPackage { + name: "chromium".to_string(), + version: Version("0.1.0".to_string()), + edition: Default::default(), + }; + + CargoManifest { + package, + workspace, + dependency_spec, + patches: std::iter::once(("crates-io".to_string(), patch_sections)).collect(), + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn parse_single_full_dependency() { + assert_eq!( + toml::de::from_str(concat!( + "version = \"1.0.0\"\n", + "features = [\"foo\", \"bar\"]\n", + "allow-first-party-usage = false\n", + "build-script-outputs = [\"stuff.rs\"]\n", + )), + Ok(FullDependency { + version: Some(Version("1.0.0".to_string())), + features: vec!["foo".to_string(), "bar".to_string()], + allow_first_party_usage: false, + build_script_outputs: vec!["stuff.rs".to_string()], + }) + ); + + assert_eq!( + toml::de::from_str(concat!( + "version = \"3.14.159\"\n", + "build-script-outputs = [\"generated.rs\"]\n", + )), + Ok(FullDependency { + version: Some(Version("3.14.159".to_string())), + features: vec![], + allow_first_party_usage: true, + build_script_outputs: vec!["generated.rs".to_string()], + }) + ); + } + + #[test] + fn parse_manifest() { + let manifest: ThirdPartyManifest = toml::de::from_str(concat!( + "[dependencies]\n", + "cxx = \"1\"\n", + "serde = \"1\"\n", + "rustversion = {version = \"1\", build-script-outputs = [\"version.rs\"]}", + "\n", + "[dependencies.unicode-linebreak]\n", + "version = \"0.1\"\n", + "allow-first-party-usage = false\n", + "build-script-outputs = [ \"table.rs\" ]\n", + "\n", + "[dev-dependencies]\n", + "syn = {version = \"1\", features = [\"full\"]}\n", + )) + .unwrap(); + + assert_eq!( + manifest.dependency_spec.dependencies.get("cxx"), + Some(&Dependency::Short(Version("1".to_string()))) + ); + assert_eq!( + manifest.dependency_spec.dependencies.get("serde"), + Some(&Dependency::Short(Version("1".to_string()))) + ); + + assert_eq!( + manifest.dependency_spec.dependencies.get("rustversion"), + Some(&Dependency::Full(FullDependency { + version: Some(Version("1".to_string())), + features: vec![], + allow_first_party_usage: true, + build_script_outputs: vec!["version.rs".to_string()], + })) + ); + + assert_eq!( + manifest.dependency_spec.dependencies.get("unicode-linebreak"), + Some(&Dependency::Full(FullDependency { + version: Some(Version("0.1".to_string())), + features: vec![], + allow_first_party_usage: false, + build_script_outputs: vec!["table.rs".to_string()], + })) + ); + + assert_eq!( + manifest.dependency_spec.dev_dependencies.get("syn"), + Some(&Dependency::Full(FullDependency { + version: Some(Version("1".to_string())), + features: vec!["full".to_string()], + allow_first_party_usage: true, + build_script_outputs: vec![], + })) + ); + } + + #[test] + fn cargo_manifest_with_patches() { + let manifest = CargoManifest { + package: CargoPackage { + name: "chromium".to_string(), + version: Version("0.1.0".to_string()), + edition: Default::default(), + }, + workspace: None, + dependency_spec: DependencySpec { + dependencies: DependencySet::new(), + dev_dependencies: DependencySet::new(), + build_dependencies: DependencySet::new(), + }, + patches: vec![( + "crates-io".to_string(), + vec![( + "foo_v1".to_string(), + CargoPatch { + path: "third_party/rust/foo/v1/crate".to_string(), + package: "foo".to_string(), + }, + )] + .into_iter() + .collect(), + )] + .into_iter() + .collect(), + }; + + assert_eq!( + toml::to_string(&manifest).unwrap(), + "[package] +name = \"chromium\" +version = \"0.1.0\" +edition = \"2021\" +[patch.crates-io.foo_v1] +path = \"third_party/rust/foo/v1/crate\" +package = \"foo\" +" + ) + } +}
diff --git a/tools/crates/gnrt/paths.rs b/tools/crates/gnrt/paths.rs new file mode 100644 index 0000000..78aa00bf --- /dev/null +++ b/tools/crates/gnrt/paths.rs
@@ -0,0 +1,40 @@ +// 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. + +//! Paths and helpers for running within a Chromium checkout. + +use std::env; +use std::io; +use std::path::{Path, PathBuf}; + +pub struct ChromiumPaths { + /// The chromium/src checkout root, as an absolute path. + pub root: PathBuf, + /// The third_party/rust directory, relative to `root`. + pub third_party: PathBuf, +} + +impl ChromiumPaths { + /// Create the `ChromiumPaths` resolver. Accesses the filesystem to get the + /// checkout root. + pub fn new() -> io::Result<ChromiumPaths> { + // We should be invoked from the repository root. + let cur_dir = env::current_dir()?; + + let third_party = Path::new(RUST_THIRD_PARTY_DIR).to_path_buf(); + if !cur_dir.join(&third_party).is_dir() { + return Err(io::Error::new( + io::ErrorKind::Other, + format!( + "could not find {} (was this invoked from the Chromium checkout root?)", + third_party.display() + ), + )); + } + + Ok(ChromiumPaths { root: cur_dir, third_party: third_party }) + } +} + +static RUST_THIRD_PARTY_DIR: &str = "third_party/rust";
diff --git a/tools/crates/gnrt/platforms.rs b/tools/crates/gnrt/platforms.rs new file mode 100644 index 0000000..16a95e92 --- /dev/null +++ b/tools/crates/gnrt/platforms.rs
@@ -0,0 +1,126 @@ +// 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. + +//! Maps Rust targets to Chromium targets. + +use std::collections::HashSet; +use std::iter::Iterator; + +use cargo_platform::Cfg; +use once_cell::sync::OnceCell; + +pub use cargo_platform::Platform; + +/// A set of platforms: either the set of all platforms, or a finite set of +/// platform configurations. +#[derive(Clone, Debug)] +pub enum PlatformSet { + /// Matches any platform configuration. + All, + /// Matches a finite set of configurations. + Platforms(HashSet<Platform>), +} + +impl PlatformSet { + /// A `PlatformSet` that matches no platforms. Useful as a starting point + /// when iteratively adding platforms with `add`. + pub fn empty() -> Self { + Self::Platforms(HashSet::new()) + } + + /// Add a single platform filter to `self`. The resulting set is superset of + /// the original. If `filter` is `None`, `self` becomes `PlatformSet::All`. + pub fn add(&mut self, filter: Option<Platform>) { + let set = match self { + // If the set is already all platforms, no need to add `filter`. + Self::All => return, + Self::Platforms(set) => set, + }; + + match filter { + None => *self = Self::All, + Some(platform) => { + set.insert(platform); + } + } + } +} + +/// Whether `platform`, either an explicit rustc target triple or a `cfg(...)` +/// expression, is supported in Chromium. +pub fn is_supported(platform: &Platform) -> bool { + match platform { + Platform::Name(name) => SUPPORTED_NAMED_PLATFORMS.iter().any(|p| *p == name), + Platform::Cfg(cfg_expr) => { + supported_os_cfgs().iter().any(|c| cfg_expr.matches(std::slice::from_ref(c))) + } + } +} + +fn supported_os_cfgs() -> &'static [Cfg] { + static CFG_SET: OnceCell<Vec<Cfg>> = OnceCell::new(); + CFG_SET.get_or_init(|| { + let mut cfg_set: Vec<Cfg> = [ + // Set of supported OSes for `cfg(target_os = ...)`. + "android", "darwin", "fuchsia", "ios", "linux", "windows", + ] + .into_iter() + .map(|os| Cfg::KeyPair("target_os".to_string(), os.to_string())) + .collect(); + + cfg_set.extend( + // Alternative syntax `cfg(unix)` or `cfg(windows)`. + ["unix", "windows"].into_iter().map(|os| Cfg::Name(os.to_string())), + ); + cfg_set + }) +} + +static SUPPORTED_NAMED_PLATFORMS: &'static [&'static str] = &[ + "i686-linux-android", + "x86_64-linux-android", + "armv7-linux-android", + "aarch64-linux-android", + "aarch64-fuchsia", + "x86_64-fuchsia", + "aarch64-apple-ios", + "armv7-apple-ios", + "x86_64-apple-ios", + "i386-apple-ios", + "i686-pc-windows-msvc", + "x86_64-pc-windows-msvc", + "i686-unknown-linux-gnu", + "x86_64-unknown-linux-gnu", + "x86_64-apple-darwin", + "aarch64-apple-darwin", +]; + +#[cfg(test)] +mod tests { + use super::*; + + use std::str::FromStr; + + use cargo_platform::CfgExpr; + + #[test] + fn test_is_supported() { + for named_platform in SUPPORTED_NAMED_PLATFORMS { + assert!(is_supported(&Platform::Name(named_platform.to_string()))); + } + + assert!(!is_supported(&Platform::Name("x86_64-unknown-redox".to_string()))); + assert!(!is_supported(&Platform::Name("wasm32-wasi".to_string()))); + + for os in supported_os_cfgs() { + assert!(is_supported(&Platform::Cfg(CfgExpr::Value(os.clone())))); + } + + assert!(!is_supported(&Platform::Cfg(CfgExpr::from_str("target_os = \"redox\"").unwrap()))); + assert!(!is_supported(&Platform::Cfg(CfgExpr::from_str("target_os = \"haiku\"").unwrap()))); + assert!(!is_supported(&Platform::Cfg( + CfgExpr::from_str("target_arch = \"sparc\"").unwrap() + ))); + } +}
diff --git a/tools/crates/gnrt/sample_package/Cargo.lock b/tools/crates/gnrt/sample_package/Cargo.lock new file mode 100644 index 0000000..97663383 --- /dev/null +++ b/tools/crates/gnrt/sample_package/Cargo.lock
@@ -0,0 +1,127 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" + +[[package]] +name = "more-asserts" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5474f8732dc7e0635ae9df6595bcd39cd30e3cfe8479850d4fa3e69306c19712" + +[[package]] +name = "once_cell" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" + +[[package]] +name = "proc-macro2" +version = "1.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "sample_package" +version = "0.1.0" +dependencies = [ + "cc", + "more-asserts", + "once_cell", + "serde", + "termcolor", +] + +[[package]] +name = "serde" +version = "1.0.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "unicode-ident" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
diff --git a/tools/crates/gnrt/sample_package/Cargo.toml b/tools/crates/gnrt/sample_package/Cargo.toml new file mode 100644 index 0000000..637374c --- /dev/null +++ b/tools/crates/gnrt/sample_package/Cargo.toml
@@ -0,0 +1,15 @@ +[package] +name = "sample_package" +version = "0.1.0" +edition = "2021" + +[dependencies] +once_cell = "1.12" +serde = { version = "1.0", features = ["derive"] } +termcolor = "1.1" + +[build-dependencies] +cc = "1.0" + +[dev-dependencies] +more-asserts = "0.3"
diff --git a/tools/crates/gnrt/sample_package/README.md b/tools/crates/gnrt/sample_package/README.md new file mode 100644 index 0000000..b2213d4 --- /dev/null +++ b/tools/crates/gnrt/sample_package/README.md
@@ -0,0 +1,5 @@ +This is a sample Cargo package to test crates_rs's dependency resolution. The +output of `cargo metadata` is recorded and used as test data. + +tools/crates/gnrt/test_metadata.json is generated by the output of running +`cargo metadata --format-version 1` in this directory.
diff --git a/tools/crates/gnrt/sample_package/src/main.rs b/tools/crates/gnrt/sample_package/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/tools/crates/gnrt/sample_package/src/main.rs
@@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}
diff --git a/tools/crates/gnrt/test_metadata.json b/tools/crates/gnrt/test_metadata.json new file mode 100644 index 0000000..4c83c68 --- /dev/null +++ b/tools/crates/gnrt/test_metadata.json
@@ -0,0 +1 @@ +{"packages":[{"name":"cc","version":"1.0.73","id":"cc 1.0.73 (registry+https://github.com/rust-lang/crates.io-index)","license":"MIT/Apache-2.0","license_file":null,"description":"A build-time dependency for Cargo build scripts to assist in invoking the native\nC compiler to compile native C code into a static archive to be linked into Rust\ncode.\n","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[{"name":"jobserver","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.1.16","kind":null,"rename":null,"optional":true,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"tempfile","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^3","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null}],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"cc","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.73/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},{"kind":["bin"],"crate_types":["bin"],"name":"gcc-shim","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.73/src/bin/gcc-shim.rs","edition":"2018","doc":true,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"cxxflags","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.73/tests/cxxflags.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"cflags","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.73/tests/cflags.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"cc_env","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.73/tests/cc_env.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.73/tests/test.rs","edition":"2018","doc":false,"doctest":false,"test":true}],"features":{"jobserver":["dep:jobserver"],"parallel":["jobserver"]},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.73/Cargo.toml","metadata":null,"publish":null,"authors":["Alex Crichton <alex@alexcrichton.com>"],"categories":["development-tools::build-utils"],"keywords":["build-dependencies"],"readme":"README.md","repository":"https://github.com/alexcrichton/cc-rs","homepage":"https://github.com/alexcrichton/cc-rs","documentation":"https://docs.rs/cc","edition":"2018","links":null,"default_run":null,"rust_version":null},{"name":"more-asserts","version":"0.3.0","id":"more-asserts 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)","license":"CC0-1.0","license_file":null,"description":"Small library providing additional assert_* and debug_assert_* macros.","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"more-asserts","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/more-asserts-0.3.0/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/more-asserts-0.3.0/tests/test.rs","edition":"2018","doc":false,"doctest":false,"test":true}],"features":{},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/more-asserts-0.3.0/Cargo.toml","metadata":null,"publish":null,"authors":["Thom Chiovoloni <chiovolonit@gmail.com>"],"categories":[],"keywords":["assert","debug_assert","debug","assertions","testing"],"readme":"README.md","repository":"https://github.com/thomcc/rust-more-asserts","homepage":"https://github.com/thomcc/rust-more-asserts","documentation":"https://docs.rs/more-asserts","edition":"2018","links":null,"default_run":null,"rust_version":null},{"name":"once_cell","version":"1.12.0","id":"once_cell 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)","license":"MIT OR Apache-2.0","license_file":null,"description":"Single assignment cells and lazy values.","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[{"name":"atomic-polyfill","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.1","kind":null,"rename":null,"optional":true,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"parking_lot_core","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.9.3","kind":null,"rename":null,"optional":true,"uses_default_features":false,"features":[],"target":null,"registry":null},{"name":"crossbeam-utils","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.8.7","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"lazy_static","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"regex","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.2.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null}],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"once_cell","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},{"kind":["example"],"crate_types":["bin"],"name":"bench","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/examples/bench.rs","edition":"2018","required-features":["std"],"doc":false,"doctest":false,"test":false},{"kind":["example"],"crate_types":["bin"],"name":"bench_acquire","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/examples/bench_acquire.rs","edition":"2018","required-features":["std"],"doc":false,"doctest":false,"test":false},{"kind":["example"],"crate_types":["bin"],"name":"bench_vs_lazy_static","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/examples/bench_vs_lazy_static.rs","edition":"2018","required-features":["std"],"doc":false,"doctest":false,"test":false},{"kind":["example"],"crate_types":["bin"],"name":"lazy_static","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/examples/lazy_static.rs","edition":"2018","required-features":["std"],"doc":false,"doctest":false,"test":false},{"kind":["example"],"crate_types":["bin"],"name":"reentrant_init_deadlocks","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/examples/reentrant_init_deadlocks.rs","edition":"2018","required-features":["std"],"doc":false,"doctest":false,"test":false},{"kind":["example"],"crate_types":["bin"],"name":"regex","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/examples/regex.rs","edition":"2018","required-features":["std"],"doc":false,"doctest":false,"test":false},{"kind":["example"],"crate_types":["bin"],"name":"test_synchronization","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/examples/test_synchronization.rs","edition":"2018","required-features":["std"],"doc":false,"doctest":false,"test":false},{"kind":["test"],"crate_types":["bin"],"name":"it","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/tests/it.rs","edition":"2018","doc":false,"doctest":false,"test":true}],"features":{"alloc":["race"],"atomic-polyfill":["dep:atomic-polyfill"],"default":["std"],"parking_lot":["parking_lot_core"],"parking_lot_core":["dep:parking_lot_core"],"race":[],"std":["alloc"],"unstable":[]},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/Cargo.toml","metadata":{"docs":{"rs":{"all-features":true}}},"publish":null,"authors":["Aleksey Kladov <aleksey.kladov@gmail.com>"],"categories":["rust-patterns","memory-management"],"keywords":["lazy","static"],"readme":"README.md","repository":"https://github.com/matklad/once_cell","homepage":null,"documentation":"https://docs.rs/once_cell","edition":"2018","links":null,"default_run":null,"rust_version":null},{"name":"proc-macro2","version":"1.0.39","id":"proc-macro2 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)","license":"MIT OR Apache-2.0","license_file":null,"description":"A substitute implementation of the compiler's `proc_macro` API to decouple\ntoken-based libraries from the procedural macro use case.\n","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[{"name":"unicode-ident","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"quote","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"dev","rename":null,"optional":false,"uses_default_features":false,"features":[],"target":null,"registry":null}],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"proc-macro2","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.39/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"features","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.39/tests/features.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_fmt","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.39/tests/test_fmt.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"marker","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.39/tests/marker.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.39/tests/test.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"comments","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.39/tests/comments.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.39/build.rs","edition":"2018","doc":false,"doctest":false,"test":false}],"features":{"default":["proc-macro"],"nightly":[],"proc-macro":[],"span-locations":[]},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.39/Cargo.toml","metadata":{"docs":{"rs":{"rustc-args":["--cfg","procmacro2_semver_exempt"],"rustdoc-args":["--cfg","procmacro2_semver_exempt","--cfg","doc_cfg"],"targets":["x86_64-unknown-linux-gnu"]}},"playground":{"features":["span-locations"]}},"publish":null,"authors":["David Tolnay <dtolnay@gmail.com>","Alex Crichton <alex@alexcrichton.com>"],"categories":["development-tools::procedural-macro-helpers"],"keywords":["macros"],"readme":"README.md","repository":"https://github.com/dtolnay/proc-macro2","homepage":null,"documentation":"https://docs.rs/proc-macro2","edition":"2018","links":null,"default_run":null,"rust_version":"1.31"},{"name":"quote","version":"1.0.18","id":"quote 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)","license":"MIT OR Apache-2.0","license_file":null,"description":"Quasi-quoting macro quote!(...)","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[{"name":"proc-macro2","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0.36","kind":null,"rename":null,"optional":false,"uses_default_features":false,"features":[],"target":null,"registry":null},{"name":"rustversion","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"trybuild","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0.52","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":["diff"],"target":null,"registry":null}],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"quote","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.18/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"compiletest","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.18/tests/compiletest.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.18/tests/test.rs","edition":"2018","doc":false,"doctest":false,"test":true}],"features":{"default":["proc-macro"],"proc-macro":["proc-macro2/proc-macro"]},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.18/Cargo.toml","metadata":{"docs":{"rs":{"targets":["x86_64-unknown-linux-gnu"]}}},"publish":null,"authors":["David Tolnay <dtolnay@gmail.com>"],"categories":["development-tools::procedural-macro-helpers"],"keywords":["syn"],"readme":"README.md","repository":"https://github.com/dtolnay/quote","homepage":null,"documentation":"https://docs.rs/quote/","edition":"2018","links":null,"default_run":null,"rust_version":"1.31"},{"name":"sample_package","version":"0.1.0","id":"sample_package 0.1.0 (path+file:///usr/local/google/home/collinbaker/chromium/src/tools/crates/crates_rs/sample_package)","license":null,"license_file":null,"description":null,"source":null,"dependencies":[{"name":"once_cell","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.12","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"serde","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":["derive"],"target":null,"registry":null},{"name":"termcolor","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.1","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"more-asserts","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.3","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"cc","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"build","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null}],"targets":[{"kind":["bin"],"crate_types":["bin"],"name":"sample_package","src_path":"/usr/local/google/home/collinbaker/chromium/src/tools/crates/crates_rs/sample_package/src/main.rs","edition":"2021","doc":true,"doctest":false,"test":true}],"features":{},"manifest_path":"/usr/local/google/home/collinbaker/chromium/src/tools/crates/crates_rs/sample_package/Cargo.toml","metadata":null,"publish":null,"authors":[],"categories":[],"keywords":[],"readme":"README.md","repository":null,"homepage":null,"documentation":null,"edition":"2021","links":null,"default_run":null,"rust_version":null},{"name":"serde","version":"1.0.137","id":"serde 1.0.137 (registry+https://github.com/rust-lang/crates.io-index)","license":"MIT OR Apache-2.0","license_file":null,"description":"A generic serialization/deserialization framework","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[{"name":"serde_derive","source":"registry+https://github.com/rust-lang/crates.io-index","req":"=1.0.137","kind":null,"rename":null,"optional":true,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"serde_derive","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null}],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"serde","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.137/src/lib.rs","edition":"2015","doc":true,"doctest":true,"test":true},{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.137/build.rs","edition":"2015","doc":false,"doctest":false,"test":false}],"features":{"alloc":[],"default":["std"],"derive":["serde_derive"],"rc":[],"serde_derive":["dep:serde_derive"],"std":[],"unstable":[]},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.137/Cargo.toml","metadata":{"playground":{"features":["derive","rc"]},"docs":{"rs":{"targets":["x86_64-unknown-linux-gnu"]}}},"publish":null,"authors":["Erick Tryzelaar <erick.tryzelaar@gmail.com>","David Tolnay <dtolnay@gmail.com>"],"categories":["encoding"],"keywords":["serde","serialization","no_std"],"readme":"crates-io.md","repository":"https://github.com/serde-rs/serde","homepage":"https://serde.rs","documentation":"https://docs.serde.rs/serde/","edition":"2015","links":null,"default_run":null,"rust_version":"1.13"},{"name":"serde_derive","version":"1.0.137","id":"serde_derive 1.0.137 (registry+https://github.com/rust-lang/crates.io-index)","license":"MIT OR Apache-2.0","license_file":null,"description":"Macros 1.1 implementation of #[derive(Serialize, Deserialize)]","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[{"name":"proc-macro2","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"quote","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"syn","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0.90","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"serde","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null}],"targets":[{"kind":["proc-macro"],"crate_types":["proc-macro"],"name":"serde_derive","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.137/src/lib.rs","edition":"2015","doc":true,"doctest":true,"test":true},{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.137/build.rs","edition":"2015","doc":false,"doctest":false,"test":false}],"features":{"default":[],"deserialize_in_place":[]},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.137/Cargo.toml","metadata":{"docs":{"rs":{"targets":["x86_64-unknown-linux-gnu"]}}},"publish":null,"authors":["Erick Tryzelaar <erick.tryzelaar@gmail.com>","David Tolnay <dtolnay@gmail.com>"],"categories":[],"keywords":["serde","serialization","no_std"],"readme":"crates-io.md","repository":"https://github.com/serde-rs/serde","homepage":"https://serde.rs","documentation":"https://serde.rs/derive.html","edition":"2015","links":null,"default_run":null,"rust_version":"1.31"},{"name":"syn","version":"1.0.96","id":"syn 1.0.96 (registry+https://github.com/rust-lang/crates.io-index)","license":"MIT OR Apache-2.0","license_file":null,"description":"Parser for Rust source code","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[{"name":"proc-macro2","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0.39","kind":null,"rename":null,"optional":false,"uses_default_features":false,"features":[],"target":null,"registry":null},{"name":"quote","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":null,"rename":null,"optional":true,"uses_default_features":false,"features":[],"target":null,"registry":null},{"name":"unicode-ident","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"anyhow","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"automod","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"flate2","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"insta","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"rayon","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"ref-cast","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"regex","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"reqwest","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.11","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":["blocking"],"target":null,"registry":null},{"name":"syn-test-suite","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"tar","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.4.16","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"termcolor","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"walkdir","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^2.1","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null}],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"syn","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_token_trees","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_token_trees.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_receiver","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_receiver.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_expr","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_expr.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_ty","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_ty.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_size","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_size.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_stmt","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_stmt.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_attribute","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_attribute.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_parse_buffer","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_parse_buffer.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_shebang","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_shebang.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_ident","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_ident.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_grouping","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_grouping.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_parse_stream","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_parse_stream.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_path","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_path.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_derive_input","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_derive_input.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_iterators","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_iterators.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"zzz_stable","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/zzz_stable.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_item","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_item.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"regression","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/regression.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_should_parse","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_should_parse.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_pat","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_pat.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_lit","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_lit.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_meta","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_meta.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_round_trip","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_round_trip.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_precedence","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_precedence.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_generics","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_generics.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_asyncness","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_asyncness.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"test_visibility","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/tests/test_visibility.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["bench"],"crate_types":["bin"],"name":"rust","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/benches/rust.rs","edition":"2018","required-features":["full","parsing"],"doc":false,"doctest":false,"test":false},{"kind":["bench"],"crate_types":["bin"],"name":"file","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/benches/file.rs","edition":"2018","required-features":["full","parsing"],"doc":false,"doctest":false,"test":false},{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/build.rs","edition":"2018","doc":false,"doctest":false,"test":false}],"features":{"clone-impls":[],"default":["derive","parsing","printing","clone-impls","proc-macro"],"derive":[],"extra-traits":[],"fold":[],"full":[],"parsing":[],"printing":["quote"],"proc-macro":["proc-macro2/proc-macro","quote/proc-macro"],"quote":["dep:quote"],"test":["syn-test-suite/all-features"],"visit":[],"visit-mut":[]},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.96/Cargo.toml","metadata":{"docs":{"rs":{"all-features":true,"targets":["x86_64-unknown-linux-gnu"],"rustdoc-args":["--cfg","doc_cfg"]}},"playground":{"features":["full","visit","visit-mut","fold","extra-traits"]}},"publish":null,"authors":["David Tolnay <dtolnay@gmail.com>"],"categories":["development-tools::procedural-macro-helpers"],"keywords":[],"readme":"README.md","repository":"https://github.com/dtolnay/syn","homepage":null,"documentation":"https://docs.rs/syn","edition":"2018","links":null,"default_run":null,"rust_version":"1.31"},{"name":"termcolor","version":"1.1.3","id":"termcolor 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)","license":"Unlicense OR MIT","license_file":null,"description":"A simple cross platform library for writing colored text to a terminal.\n","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[{"name":"winapi-util","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.1.3","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":"cfg(windows)","registry":null}],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"termcolor","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/termcolor-1.1.3/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true}],"features":{},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/termcolor-1.1.3/Cargo.toml","metadata":null,"publish":null,"authors":["Andrew Gallant <jamslam@gmail.com>"],"categories":[],"keywords":["windows","win","color","ansi","console"],"readme":"README.md","repository":"https://github.com/BurntSushi/termcolor","homepage":"https://github.com/BurntSushi/termcolor","documentation":"https://docs.rs/termcolor","edition":"2018","links":null,"default_run":null,"rust_version":null},{"name":"unicode-ident","version":"1.0.0","id":"unicode-ident 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)","license":"MIT OR Apache-2.0","license_file":null,"description":"Determine whether characters have the XID_Start or XID_Continue properties according to Unicode Standard Annex #31","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[{"name":"criterion","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.3","kind":"dev","rename":null,"optional":false,"uses_default_features":false,"features":[],"target":null,"registry":null},{"name":"fst","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.4","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"rand","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.8","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":["small_rng"],"target":null,"registry":null},{"name":"roaring","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.9","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"ucd-trie","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.1","kind":"dev","rename":null,"optional":false,"uses_default_features":false,"features":[],"target":null,"registry":null},{"name":"unicode-xid","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.2","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null}],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"unicode-ident","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-ident-1.0.0/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"static_size","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-ident-1.0.0/tests/static_size.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["test"],"crate_types":["bin"],"name":"compare","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-ident-1.0.0/tests/compare.rs","edition":"2018","doc":false,"doctest":false,"test":true},{"kind":["bench"],"crate_types":["bin"],"name":"xid","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-ident-1.0.0/benches/xid.rs","edition":"2018","doc":false,"doctest":false,"test":false}],"features":{},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-ident-1.0.0/Cargo.toml","metadata":{"docs":{"rs":{"targets":["x86_64-unknown-linux-gnu"]}}},"publish":null,"authors":["David Tolnay <dtolnay@gmail.com>"],"categories":[],"keywords":[],"readme":"README.md","repository":"https://github.com/dtolnay/unicode-ident","homepage":null,"documentation":"https://docs.rs/unicode-ident","edition":"2018","links":null,"default_run":null,"rust_version":"1.31"},{"name":"winapi","version":"0.3.9","id":"winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)","license":"MIT/Apache-2.0","license_file":null,"description":"Raw FFI bindings for all of Windows API.","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[{"name":"winapi-i686-pc-windows-gnu","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.4","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":"i686-pc-windows-gnu","registry":null},{"name":"winapi-x86_64-pc-windows-gnu","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.4","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":"x86_64-pc-windows-gnu","registry":null}],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"winapi","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.9/src/lib.rs","edition":"2015","doc":true,"doctest":true,"test":true},{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.9/build.rs","edition":"2015","doc":false,"doctest":false,"test":false}],"features":{"accctrl":[],"aclapi":[],"activation":[],"adhoc":[],"appmgmt":[],"audioclient":[],"audiosessiontypes":[],"avrt":[],"basetsd":[],"bcrypt":[],"bits":[],"bits10_1":[],"bits1_5":[],"bits2_0":[],"bits2_5":[],"bits3_0":[],"bits4_0":[],"bits5_0":[],"bitscfg":[],"bitsmsg":[],"bluetoothapis":[],"bluetoothleapis":[],"bthdef":[],"bthioctl":[],"bthledef":[],"bthsdpdef":[],"bugcodes":[],"cderr":[],"cfg":[],"cfgmgr32":[],"cguid":[],"combaseapi":[],"coml2api":[],"commapi":[],"commctrl":[],"commdlg":[],"commoncontrols":[],"consoleapi":[],"corecrt":[],"corsym":[],"d2d1":[],"d2d1_1":[],"d2d1_2":[],"d2d1_3":[],"d2d1effectauthor":[],"d2d1effects":[],"d2d1effects_1":[],"d2d1effects_2":[],"d2d1svg":[],"d2dbasetypes":[],"d3d":[],"d3d10":[],"d3d10_1":[],"d3d10_1shader":[],"d3d10effect":[],"d3d10misc":[],"d3d10sdklayers":[],"d3d10shader":[],"d3d11":[],"d3d11_1":[],"d3d11_2":[],"d3d11_3":[],"d3d11_4":[],"d3d11on12":[],"d3d11sdklayers":[],"d3d11shader":[],"d3d11tokenizedprogramformat":[],"d3d12":[],"d3d12sdklayers":[],"d3d12shader":[],"d3d9":[],"d3d9caps":[],"d3d9types":[],"d3dcommon":[],"d3dcompiler":[],"d3dcsx":[],"d3dkmdt":[],"d3dkmthk":[],"d3dukmdt":[],"d3dx10core":[],"d3dx10math":[],"d3dx10mesh":[],"datetimeapi":[],"davclnt":[],"dbghelp":[],"dbt":[],"dcommon":[],"dcomp":[],"dcompanimation":[],"dcomptypes":[],"dde":[],"ddraw":[],"ddrawi":[],"ddrawint":[],"debug":["impl-debug"],"debugapi":[],"devguid":[],"devicetopology":[],"devpkey":[],"devpropdef":[],"dinput":[],"dinputd":[],"dispex":[],"dmksctl":[],"dmusicc":[],"docobj":[],"documenttarget":[],"dot1x":[],"dpa_dsa":[],"dpapi":[],"dsgetdc":[],"dsound":[],"dsrole":[],"dvp":[],"dwmapi":[],"dwrite":[],"dwrite_1":[],"dwrite_2":[],"dwrite_3":[],"dxdiag":[],"dxfile":[],"dxgi":[],"dxgi1_2":[],"dxgi1_3":[],"dxgi1_4":[],"dxgi1_5":[],"dxgi1_6":[],"dxgidebug":[],"dxgiformat":[],"dxgitype":[],"dxva2api":[],"dxvahd":[],"eaptypes":[],"enclaveapi":[],"endpointvolume":[],"errhandlingapi":[],"everything":[],"evntcons":[],"evntprov":[],"evntrace":[],"excpt":[],"exdisp":[],"fibersapi":[],"fileapi":[],"functiondiscoverykeys_devpkey":[],"gl-gl":[],"guiddef":[],"handleapi":[],"heapapi":[],"hidclass":[],"hidpi":[],"hidsdi":[],"hidusage":[],"highlevelmonitorconfigurationapi":[],"hstring":[],"http":[],"ifdef":[],"ifmib":[],"imm":[],"impl-debug":[],"impl-default":[],"in6addr":[],"inaddr":[],"inspectable":[],"interlockedapi":[],"intsafe":[],"ioapiset":[],"ipexport":[],"iphlpapi":[],"ipifcons":[],"ipmib":[],"iprtrmib":[],"iptypes":[],"jobapi":[],"jobapi2":[],"knownfolders":[],"ks":[],"ksmedia":[],"ktmtypes":[],"ktmw32":[],"l2cmn":[],"libloaderapi":[],"limits":[],"lmaccess":[],"lmalert":[],"lmapibuf":[],"lmat":[],"lmcons":[],"lmdfs":[],"lmerrlog":[],"lmjoin":[],"lmmsg":[],"lmremutl":[],"lmrepl":[],"lmserver":[],"lmshare":[],"lmstats":[],"lmsvc":[],"lmuse":[],"lmwksta":[],"lowlevelmonitorconfigurationapi":[],"lsalookup":[],"memoryapi":[],"minschannel":[],"minwinbase":[],"minwindef":[],"mmdeviceapi":[],"mmeapi":[],"mmreg":[],"mmsystem":[],"mprapidef":[],"msaatext":[],"mscat":[],"mschapp":[],"mssip":[],"mstcpip":[],"mswsock":[],"mswsockdef":[],"namedpipeapi":[],"namespaceapi":[],"nb30":[],"ncrypt":[],"netioapi":[],"nldef":[],"ntddndis":[],"ntddscsi":[],"ntddser":[],"ntdef":[],"ntlsa":[],"ntsecapi":[],"ntstatus":[],"oaidl":[],"objbase":[],"objidl":[],"objidlbase":[],"ocidl":[],"ole2":[],"oleauto":[],"olectl":[],"oleidl":[],"opmapi":[],"pdh":[],"perflib":[],"physicalmonitorenumerationapi":[],"playsoundapi":[],"portabledevice":[],"portabledeviceapi":[],"portabledevicetypes":[],"powerbase":[],"powersetting":[],"powrprof":[],"processenv":[],"processsnapshot":[],"processthreadsapi":[],"processtopologyapi":[],"profileapi":[],"propidl":[],"propkey":[],"propkeydef":[],"propsys":[],"prsht":[],"psapi":[],"qos":[],"realtimeapiset":[],"reason":[],"restartmanager":[],"restrictederrorinfo":[],"rmxfguid":[],"roapi":[],"robuffer":[],"roerrorapi":[],"rpc":[],"rpcdce":[],"rpcndr":[],"rtinfo":[],"sapi":[],"sapi51":[],"sapi53":[],"sapiddk":[],"sapiddk51":[],"schannel":[],"sddl":[],"securityappcontainer":[],"securitybaseapi":[],"servprov":[],"setupapi":[],"shellapi":[],"shellscalingapi":[],"shlobj":[],"shobjidl":[],"shobjidl_core":[],"shtypes":[],"softpub":[],"spapidef":[],"spellcheck":[],"sporder":[],"sql":[],"sqlext":[],"sqltypes":[],"sqlucode":[],"sspi":[],"std":[],"stralign":[],"stringapiset":[],"strmif":[],"subauth":[],"synchapi":[],"sysinfoapi":[],"systemtopologyapi":[],"taskschd":[],"tcpestats":[],"tcpmib":[],"textstor":[],"threadpoolapiset":[],"threadpoollegacyapiset":[],"timeapi":[],"timezoneapi":[],"tlhelp32":[],"transportsettingcommon":[],"tvout":[],"udpmib":[],"unknwnbase":[],"urlhist":[],"urlmon":[],"usb":[],"usbioctl":[],"usbiodef":[],"usbscan":[],"usbspec":[],"userenv":[],"usp10":[],"utilapiset":[],"uxtheme":[],"vadefs":[],"vcruntime":[],"vsbackup":[],"vss":[],"vsserror":[],"vswriter":[],"wbemads":[],"wbemcli":[],"wbemdisp":[],"wbemprov":[],"wbemtran":[],"wct":[],"werapi":[],"winbase":[],"wincodec":[],"wincodecsdk":[],"wincon":[],"wincontypes":[],"wincred":[],"wincrypt":[],"windef":[],"windot11":[],"windowsceip":[],"windowsx":[],"winefs":[],"winerror":[],"winevt":[],"wingdi":[],"winhttp":[],"wininet":[],"winineti":[],"winioctl":[],"winnetwk":[],"winnls":[],"winnt":[],"winreg":[],"winsafer":[],"winscard":[],"winsmcrd":[],"winsock2":[],"winspool":[],"winstring":[],"winsvc":[],"wintrust":[],"winusb":[],"winusbio":[],"winuser":[],"winver":[],"wlanapi":[],"wlanihv":[],"wlanihvtypes":[],"wlantypes":[],"wlclient":[],"wmistr":[],"wnnc":[],"wow64apiset":[],"wpdmtpextensions":[],"ws2bth":[],"ws2def":[],"ws2ipdef":[],"ws2spi":[],"ws2tcpip":[],"wtsapi32":[],"wtypes":[],"wtypesbase":[],"xinput":[]},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.9/Cargo.toml","metadata":{"docs":{"rs":{"default-target":"x86_64-pc-windows-msvc","features":["everything","impl-debug","impl-default"],"targets":["aarch64-pc-windows-msvc","i686-pc-windows-msvc","x86_64-pc-windows-msvc"]}}},"publish":null,"authors":["Peter Atashian <retep998@gmail.com>"],"categories":["external-ffi-bindings","no-std","os::windows-apis"],"keywords":["windows","ffi","win32","com","directx"],"readme":"README.md","repository":"https://github.com/retep998/winapi-rs","homepage":null,"documentation":"https://docs.rs/winapi/","edition":"2015","links":null,"default_run":null,"rust_version":null},{"name":"winapi-i686-pc-windows-gnu","version":"0.4.0","id":"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)","license":"MIT/Apache-2.0","license_file":null,"description":"Import libraries for the i686-pc-windows-gnu target. Please don't use this crate directly, depend on winapi instead.","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"winapi-i686-pc-windows-gnu","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-i686-pc-windows-gnu-0.4.0/src/lib.rs","edition":"2015","doc":true,"doctest":true,"test":true},{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-i686-pc-windows-gnu-0.4.0/build.rs","edition":"2015","doc":false,"doctest":false,"test":false}],"features":{},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-i686-pc-windows-gnu-0.4.0/Cargo.toml","metadata":null,"publish":null,"authors":["Peter Atashian <retep998@gmail.com>"],"categories":[],"keywords":["windows"],"readme":null,"repository":"https://github.com/retep998/winapi-rs","homepage":null,"documentation":null,"edition":"2015","links":null,"default_run":null,"rust_version":null},{"name":"winapi-util","version":"0.1.5","id":"winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)","license":"Unlicense/MIT","license_file":null,"description":"A dumping ground for high level safe wrappers over winapi.","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[{"name":"winapi","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.3","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":["std","consoleapi","errhandlingapi","fileapi","minwindef","processenv","winbase","wincon","winerror","winnt"],"target":"cfg(windows)","registry":null}],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"winapi-util","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-util-0.1.5/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true}],"features":{},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-util-0.1.5/Cargo.toml","metadata":{"docs":{"rs":{"targets":["x86_64-pc-windows-msvc"]}}},"publish":null,"authors":["Andrew Gallant <jamslam@gmail.com>"],"categories":["os::windows-apis","external-ffi-bindings"],"keywords":["windows","winapi","util","win"],"readme":"README.md","repository":"https://github.com/BurntSushi/winapi-util","homepage":"https://github.com/BurntSushi/winapi-util","documentation":"https://docs.rs/winapi-util","edition":"2018","links":null,"default_run":null,"rust_version":null},{"name":"winapi-x86_64-pc-windows-gnu","version":"0.4.0","id":"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)","license":"MIT/Apache-2.0","license_file":null,"description":"Import libraries for the x86_64-pc-windows-gnu target. Please don't use this crate directly, depend on winapi instead.","source":"registry+https://github.com/rust-lang/crates.io-index","dependencies":[],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"winapi-x86_64-pc-windows-gnu","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-x86_64-pc-windows-gnu-0.4.0/src/lib.rs","edition":"2015","doc":true,"doctest":true,"test":true},{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-x86_64-pc-windows-gnu-0.4.0/build.rs","edition":"2015","doc":false,"doctest":false,"test":false}],"features":{},"manifest_path":"/usr/local/google/home/collinbaker/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-x86_64-pc-windows-gnu-0.4.0/Cargo.toml","metadata":null,"publish":null,"authors":["Peter Atashian <retep998@gmail.com>"],"categories":[],"keywords":["windows"],"readme":null,"repository":"https://github.com/retep998/winapi-rs","homepage":null,"documentation":null,"edition":"2015","links":null,"default_run":null,"rust_version":null}],"workspace_members":["sample_package 0.1.0 (path+file:///usr/local/google/home/collinbaker/chromium/src/tools/crates/crates_rs/sample_package)"],"resolve":{"nodes":[{"id":"cc 1.0.73 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":[],"deps":[],"features":[]},{"id":"more-asserts 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":[],"deps":[],"features":[]},{"id":"once_cell 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":[],"deps":[],"features":["alloc","default","race","std"]},{"id":"proc-macro2 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["unicode-ident 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"unicode_ident","pkg":"unicode-ident 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]}],"features":["default","proc-macro"]},{"id":"quote 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["proc-macro2 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"proc_macro2","pkg":"proc-macro2 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]}],"features":["default","proc-macro"]},{"id":"sample_package 0.1.0 (path+file:///usr/local/google/home/collinbaker/chromium/src/tools/crates/crates_rs/sample_package)","dependencies":["cc 1.0.73 (registry+https://github.com/rust-lang/crates.io-index)","more-asserts 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)","once_cell 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)","serde 1.0.137 (registry+https://github.com/rust-lang/crates.io-index)","termcolor 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"cc","pkg":"cc 1.0.73 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":"build","target":null}]},{"name":"more_asserts","pkg":"more-asserts 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":"dev","target":null}]},{"name":"once_cell","pkg":"once_cell 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"serde","pkg":"serde 1.0.137 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"termcolor","pkg":"termcolor 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]}],"features":[]},{"id":"serde 1.0.137 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["serde_derive 1.0.137 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"serde_derive","pkg":"serde_derive 1.0.137 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]}],"features":["default","derive","serde_derive","std"]},{"id":"serde_derive 1.0.137 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["proc-macro2 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)","quote 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)","syn 1.0.96 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"proc_macro2","pkg":"proc-macro2 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"quote","pkg":"quote 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"syn","pkg":"syn 1.0.96 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]}],"features":["default"]},{"id":"syn 1.0.96 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["proc-macro2 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)","quote 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)","unicode-ident 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"proc_macro2","pkg":"proc-macro2 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"quote","pkg":"quote 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"unicode_ident","pkg":"unicode-ident 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]}],"features":["clone-impls","default","derive","parsing","printing","proc-macro","quote"]},{"id":"termcolor 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"winapi_util","pkg":"winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":"cfg(windows)"}]}],"features":[]},{"id":"unicode-ident 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":[],"deps":[],"features":[]},{"id":"winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)","winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"winapi_i686_pc_windows_gnu","pkg":"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":"i686-pc-windows-gnu"}]},{"name":"winapi_x86_64_pc_windows_gnu","pkg":"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":"x86_64-pc-windows-gnu"}]}],"features":["consoleapi","errhandlingapi","fileapi","minwindef","processenv","std","winbase","wincon","winerror","winnt"]},{"id":"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":[],"deps":[],"features":[]},{"id":"winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"winapi","pkg":"winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":"cfg(windows)"}]}],"features":[]},{"id":"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":[],"deps":[],"features":[]}],"root":"sample_package 0.1.0 (path+file:///usr/local/google/home/collinbaker/chromium/src/tools/crates/crates_rs/sample_package)"},"target_directory":"/usr/local/google/home/collinbaker/chromium/src/tools/crates/crates_rs/sample_package/target","version":1,"workspace_root":"/usr/local/google/home/collinbaker/chromium/src/tools/crates/crates_rs/sample_package","metadata":null}
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec index a1ab356..c7937223 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec
@@ -268,7 +268,7 @@ "includes": [1930], }, "<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/side_panel/side_panel_resources.grd": { - "META": {"sizes": {"includes": [20],}}, + "META": {"sizes": {"includes": [40],}}, "includes": [1935], }, "<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/settings/chromeos/os_settings_resources.grd": {
diff --git a/tools/ipc_fuzzer/fuzzer/DEPS b/tools/ipc_fuzzer/fuzzer/DEPS index e3b85c4..f9f6f78 100644 --- a/tools/ipc_fuzzer/fuzzer/DEPS +++ b/tools/ipc_fuzzer/fuzzer/DEPS
@@ -3,6 +3,7 @@ "+components/viz/common", "+gpu/ipc/common", "+media/gpu/ipc/common", + "+ppapi/buildflags/buildflags.h", "+printing/mojom", "+services/device/public/mojom/screen_orientation_lock_types.mojom-shared.h", "+third_party/skia/include",
diff --git a/tools/ipc_fuzzer/fuzzer/fuzzer.cc b/tools/ipc_fuzzer/fuzzer/fuzzer.cc index 758e694..d9ace88 100644 --- a/tools/ipc_fuzzer/fuzzer/fuzzer.cc +++ b/tools/ipc_fuzzer/fuzzer/fuzzer.cc
@@ -27,6 +27,7 @@ #include "ipc/ipc_sync_channel.h" #include "ipc/ipc_sync_message.h" #include "media/gpu/ipc/common/media_param_traits.h" +#include "ppapi/buildflags/buildflags.h" #include "printing/mojom/print.mojom-shared.h" #include "services/device/public/mojom/screen_orientation_lock_types.mojom-shared.h" #include "third_party/blink/public/common/page_state/page_state.h" @@ -1365,6 +1366,7 @@ } }; +#if BUILDFLAG(ENABLE_PLUGINS) // PP_ traits. template <> struct FuzzTraits<PP_Bool> { @@ -1526,6 +1528,7 @@ return true; } }; +#endif // BUILDFLAG(ENABLE_PLUGINS) template <> struct FuzzTraits<printing::mojom::MarginType> {
diff --git a/tools/ipc_fuzzer/message_lib/BUILD.gn b/tools/ipc_fuzzer/message_lib/BUILD.gn index 00618d9..71cb3f87 100644 --- a/tools/ipc_fuzzer/message_lib/BUILD.gn +++ b/tools/ipc_fuzzer/message_lib/BUILD.gn
@@ -3,6 +3,7 @@ # found in the LICENSE file. import("//components/nacl/features.gni") +import("//ppapi/buildflags/buildflags.gni") import("//remoting/remoting_enable.gni") static_library("ipc_message_lib") { @@ -22,7 +23,6 @@ "//ipc", "//media/cast:net", "//media/gpu/ipc/common", - "//ppapi/proxy:ipc", "//skia", "//third_party/blink/public:blink", "//third_party/blink/public:blink_headers", @@ -32,6 +32,9 @@ if (is_win) { public_deps += [ "//chrome/chrome_elf:test_stubs" ] } + if (enable_plugins) { + public_deps += [ "//ppapi/proxy:ipc" ] + } deps = [ "//remoting/host/base" ] sources = [ "all_messages.h",
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index adc660d..74573bc 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -29,6 +29,7 @@ 'lacros-amd64-generic-chrome-skylab': 'chromeos_amd64-generic_lacros_official_skylab', 'lacros-arm-generic-chrome': 'chromeos_arm-generic_lacros_official', 'lacros-arm-generic-chrome-skylab': 'chromeos_arm-generic_lacros_official_skylab', + 'lacros-arm64-generic-chrome': 'chromeos_arm64-generic_lacros_official', # Don't include unwind tables for linux-/mac-/win-/win64-chrome builders. # They monitor binary size growth, which may be affected by the tables. 'linux-chrome': 'official_goma', @@ -332,8 +333,8 @@ 'reclient': 'gpu_tests_release_bot_minimal_symbols_reclient', }, 'Comparison ios (reclient)': { - 'goma': 'ios_simulator_code_coverage_partial_instrumentation_xctest', - 'reclient': 'ios_simulator_code_coverage_partial_instrumentation_xctest_reclient', + 'goma': 'ios_simulator_debug_static_bot_xctest', + 'reclient': 'ios_simulator_debug_static_bot_xctest_reclient', }, 'Libfuzzer Upload Chrome OS ASan': 'libfuzzer_chromeos_asan_release_bot', 'Libfuzzer Upload Linux ASan': 'libfuzzer_asan_release_bot', @@ -658,8 +659,8 @@ 'Simple Chrome Builder reclient test': 'chromeos_amd64-generic-vm_use_fake_dbus_clients_reclient', 'Win x64 Builder reclient staging': 'gpu_tests_release_bot_minimal_symbols_reclient', 'Win x64 Builder reclient test': 'gpu_tests_release_bot_minimal_symbols_reclient', - 'ios-simulator reclient staging': 'ios_simulator_code_coverage_partial_instrumentation_xctest_reclient', - 'ios-simulator reclient test': 'ios_simulator_code_coverage_partial_instrumentation_xctest_reclient', + 'ios-simulator reclient staging': 'ios_simulator_debug_static_bot_xctest_reclient', + 'ios-simulator reclient test': 'ios_simulator_debug_static_bot_xctest_reclient', }, 'chromium.rust': { @@ -853,6 +854,7 @@ 'lacros-amd64-generic-chrome-skylab': 'chromeos_amd64-generic_lacros_official_skylab', 'lacros-arm-generic-chrome': 'chromeos_arm-generic_lacros_official', 'lacros-arm-generic-chrome-skylab': 'chromeos_arm-generic_lacros_official_skylab', + 'lacros-arm64-generic-chrome': 'chromeos_arm64-generic_lacros_official', 'linux-chrome': 'official_goma', 'linux-chrome-beta': 'official_goma', 'linux-chrome-stable': 'official_goma', @@ -2064,6 +2066,10 @@ 'chromeos_device', 'arm64-generic', 'dcheck_always_on', ], + 'chromeos_arm64-generic_lacros_official': [ + 'chromeos_arm64-generic-crostoolchain', 'lacros', 'official', 'minimal_symbols', 'cfi', 'thin_lto', + ], + 'chromeos_asan_lsan_fuzzer_v8_heap_release_bot_reclient': [ 'chromeos', 'asan', 'lsan', 'fuzzer', 'v8_heap', 'release_bot_reclient', ], @@ -2800,10 +2806,6 @@ 'use_clang_coverage', 'debug_static_bot', 'x64', 'ios', 'ios_simulator', 'partial_code_coverage_instrumentation', 'xctest', 'ios_disable_xcode_project_generation', ], - 'ios_simulator_code_coverage_partial_instrumentation_xctest_reclient': [ - 'use_clang_coverage', 'x64', 'ios', 'ios_simulator', 'xctest', 'ios_disable_xcode_project_generation', 'release_bot_reclient', - ], - 'ios_simulator_debug_static_bot_invert_fieldtrials_xctest': [ 'debug_static_bot', 'ios', 'ios_simulator', 'ios_cpu_x64', 'invert_fieldtrials', 'xctest', 'ios_disable_xcode_project_generation', ], @@ -3587,6 +3589,10 @@ 'args_file': '//build/args/chromeos/arm64-generic.gni', }, + 'arm64-generic-crostoolchain': { + 'args_file': '//build/args/chromeos/arm64-generic-crostoolchain.gni', + }, + 'arm64_host': { 'gn_args': 'test_host_cpu="arm64"', }, @@ -3701,6 +3707,10 @@ 'mixins': ['chromeos_device_reclient', 'arm-generic-crostoolchain',] }, + 'chromeos_arm64-generic-crostoolchain': { + 'mixins': ['chromeos_device', 'arm64-generic-crostoolchain',] + }, + 'chromeos_codecs': { 'mixins': ['ffmpeg_branding_chromeos', 'proprietary_codecs'], },
diff --git a/tools/mb/mb_config_expectations/chrome.json b/tools/mb/mb_config_expectations/chrome.json index 1e85efb..92a77f0 100644 --- a/tools/mb/mb_config_expectations/chrome.json +++ b/tools/mb/mb_config_expectations/chrome.json
@@ -208,6 +208,22 @@ "use_thin_lto": true } }, + "lacros-arm64-generic-chrome": { + "args_file": "//build/args/chromeos/arm64-generic-crostoolchain.gni", + "gn_args": { + "chromeos_is_browser_only": true, + "dcheck_always_on": false, + "is_cfi": true, + "is_chrome_branded": true, + "is_chromeos_device": true, + "is_official_build": true, + "ozone_platform_headless": true, + "symbol_level": 1, + "target_os": "chromeos", + "use_goma": true, + "use_thin_lto": true + } + }, "linux-chrome": { "gn_args": { "is_chrome_branded": true,
diff --git a/tools/mb/mb_config_expectations/chromium.fyi.json b/tools/mb/mb_config_expectations/chromium.fyi.json index aafcbf4..b5b736f 100644 --- a/tools/mb/mb_config_expectations/chromium.fyi.json +++ b/tools/mb/mb_config_expectations/chromium.fyi.json
@@ -152,7 +152,6 @@ "Comparison ios (reclient)": { "goma": { "gn_args": { - "coverage_instrumentation_input_file": "//.code-coverage/files_to_instrument.txt", "enable_run_ios_unittests_with_xctest": true, "ios_set_attributes_for_xcode_project_generation": false, "is_component_build": false, @@ -161,21 +160,19 @@ "target_cpu": "x64", "target_environment": "simulator", "target_os": "ios", - "use_clang_coverage": true, "use_goma": true } }, "reclient": { "gn_args": { - "dcheck_always_on": false, "enable_run_ios_unittests_with_xctest": true, "ios_set_attributes_for_xcode_project_generation": false, "is_component_build": false, - "is_debug": false, + "is_debug": true, + "symbol_level": 1, "target_cpu": "x64", "target_environment": "simulator", "target_os": "ios", - "use_clang_coverage": true, "use_remoteexec": true } }
diff --git a/tools/mb/mb_config_expectations/chromium.reclient.fyi.json b/tools/mb/mb_config_expectations/chromium.reclient.fyi.json index 15f84ac..725b4e6 100644 --- a/tools/mb/mb_config_expectations/chromium.reclient.fyi.json +++ b/tools/mb/mb_config_expectations/chromium.reclient.fyi.json
@@ -85,29 +85,27 @@ }, "ios-simulator reclient staging": { "gn_args": { - "dcheck_always_on": false, "enable_run_ios_unittests_with_xctest": true, "ios_set_attributes_for_xcode_project_generation": false, "is_component_build": false, - "is_debug": false, + "is_debug": true, + "symbol_level": 1, "target_cpu": "x64", "target_environment": "simulator", "target_os": "ios", - "use_clang_coverage": true, "use_remoteexec": true } }, "ios-simulator reclient test": { "gn_args": { - "dcheck_always_on": false, "enable_run_ios_unittests_with_xctest": true, "ios_set_attributes_for_xcode_project_generation": false, "is_component_build": false, - "is_debug": false, + "is_debug": true, + "symbol_level": 1, "target_cpu": "x64", "target_environment": "simulator", "target_os": "ios", - "use_clang_coverage": true, "use_remoteexec": true } }
diff --git a/tools/mb/mb_config_expectations/tryserver.chrome.json b/tools/mb/mb_config_expectations/tryserver.chrome.json index 9007692..05d3191 100644 --- a/tools/mb/mb_config_expectations/tryserver.chrome.json +++ b/tools/mb/mb_config_expectations/tryserver.chrome.json
@@ -269,6 +269,22 @@ "use_thin_lto": true } }, + "lacros-arm64-generic-chrome": { + "args_file": "//build/args/chromeos/arm64-generic-crostoolchain.gni", + "gn_args": { + "chromeos_is_browser_only": true, + "dcheck_always_on": false, + "is_cfi": true, + "is_chrome_branded": true, + "is_chromeos_device": true, + "is_official_build": true, + "ozone_platform_headless": true, + "symbol_level": 1, + "target_os": "chromeos", + "use_goma": true, + "use_thin_lto": true + } + }, "linux-chrome": { "gn_args": { "is_chrome_branded": true,
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 95a94d4..ca31025 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -2924,6 +2924,14 @@ <int value="60" label="GET_VARIATIONS_HEADER"> WebViewCompat#getVariationsHeader() </int> + <int value="61" + label="WEB_SETTINGS_SET_ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY_ENABLED"> + WebSettingsCompat#setEnterpriseAuthenticationAppLinkPolicyEnabled(boolean) + </int> + <int value="62" + label="WEB_SETTINGS_GET_ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY_ENABLED"> + WebSettingsCompat#getEnterpriseAuthenticationAppLinkPolicyEnabled() + </int> </enum> <enum name="ANGLEProgramCacheResult"> @@ -34838,6 +34846,7 @@ <int value="1671" label="ENTERPRISE_REMOTEAPPS_DELETEAPP"/> <int value="1672" label="ENTERPRISEREPORTINGPRIVATE_GETAVINFO"/> <int value="1673" label="ENTERPRISEREPORTINGPRIVATE_GETHOTFIXES"/> + <int value="1674" label="AUTOTESTPRIVATE_GETACCESSTOKEN"/> </enum> <enum name="ExtensionIconState"> @@ -55031,6 +55040,7 @@ <int value="-2101338272" label="EnablePciguardUi:disabled"/> <int value="-2101337189" label="AutofillOffNoServerData:disabled"/> <int value="-2101091929" label="MessagesForAndroidAdsBlocked:disabled"/> + <int value="-2100134911" label="SystemColorChooser:disabled"/> <int value="-2099608999" label="CrOSEnforceSystemAecNs:enabled"/> <int value="-2099486626" label="DownloadLater:enabled"/> <int value="-2099457894" label="Mash:enabled"/> @@ -59705,6 +59715,7 @@ <int value="908302031" label="OmniboxUIExperimentElideSuggestionUrlAfterHost:enabled"/> <int value="908370794" label="UserActivityPredictionMlService:enabled"/> + <int value="908460495" label="SystemColorChooser:enabled"/> <int value="908523940" label="PassiveEventListenersDueToFling:disabled"/> <int value="909439558" label="disable-device-discovery"/> <int value="909525364" label="ExtensionsCheckup:enabled"/> @@ -60285,7 +60296,6 @@ <int value="1284910808" label="disable-checker-imaging"/> <int value="1285169797" label="ClipboardHistoryNudgeSessionReset:disabled"/> <int value="1285905715" label="WebXRHitTest:enabled"/> - <int value="1286564383" label="UsbNotificationController:enabled"/> <int value="1286692760" label="NtpMiddleSlotPromoDismissal:enabled"/> <int value="1287625114" label="EnableIncognitoShortcutOnDesktop:disabled"/> <int value="1287947083" label="WebAssemblyCodeProtectionPku:enabled"/> @@ -60706,7 +60716,6 @@ <int value="1582004845" label="ChromeOSAmbientModeAnimation:enabled"/> <int value="1582400283" label="VideoTutorials:enabled"/> <int value="1583543236" label="QuickSettingsNetworkRevamp:disabled"/> - <int value="1584012382" label="UsbNotificationController:disabled"/> <int value="1584039096" label="highlight-all-webviews"/> <int value="1584425198" label="NtpModules:enabled"/> <int value="1584536816" label="LimitAltTabToActiveDesk:enabled"/>
diff --git a/tools/metrics/histograms/metadata/arc/histograms.xml b/tools/metrics/histograms/metadata/arc/histograms.xml index a08f344f..8135b294 100644 --- a/tools/metrics/histograms/metadata/arc/histograms.xml +++ b/tools/metrics/histograms/metadata/arc/histograms.xml
@@ -68,10 +68,6 @@ <variant name="RegularBoot" summary="For a regular boot."/> </variants> -<variants name="ArcInputOverlayPackageNames"> - <variant name="com.habby.archero" summary="Virtual Joystick Game: Archero"/> -</variants> - <variants name="ArcPerformanceAppCategories"> <variant name=".GachaClub" summary="Casual game 2: Gacha Club"/> <variant name=".GarenaFreeFire" summary="Shooter game: Garena Free Fire"/> @@ -1138,19 +1134,6 @@ </summary> </histogram> -<histogram name="Arc.InputOverlay.Customized.{ArcInputOverlayPackageName}" - enum="BooleanEnabled" expires_after="2022-11-12"> - <owner>cuicuiruan@google.com</owner> - <owner>arc-gaming@google.com</owner> - <summary> - Count the usage of input overlay editing feature on app - {ArcInputOverlayPackageName}. The metric is recorded when users press the - Customize button. Refer to InputMenuView::OnButtonCustomizedPressed(). - </summary> - <token key="ArcInputOverlayPackageName" - variants="ArcInputOverlayPackageNames"/> -</histogram> - <histogram name="Arc.InputOverlay.FeatureState" enum="BooleanEnabled" expires_after="2022-11-12"> <owner>cuicuiruan@google.com</owner> @@ -1164,22 +1147,6 @@ </summary> </histogram> -<histogram name="Arc.InputOverlay.FeatureState.{ArcInputOverlayPackageName}" - enum="BooleanEnabled" expires_after="2022-11-12"> - <owner>cuicuiruan@google.com</owner> - <owner>arc-gaming@google.com</owner> - <summary> - Check whether users play the game with input overlay feature enabled or - disabled on app {ArcInputOverlayPackageName}. The metric is recorded when - users launch the app {ArcInputOverlayPackageName} and when users have menu - state changed upon on closing the input menu only. Refer to - TouchInjector::RecordMenuStateOnLaunch() and - TouchInjector::OnInputMenuViewRemoved(). - </summary> - <token key="ArcInputOverlayPackageName" - variants="ArcInputOverlayPackageNames"/> -</histogram> - <histogram name="Arc.InputOverlay.MappingHintState" enum="BooleanEnabled" expires_after="2022-11-12"> <owner>cuicuiruan@google.com</owner> @@ -1193,23 +1160,6 @@ </summary> </histogram> -<histogram - name="Arc.InputOverlay.MappingHintState.{ArcInputOverlayPackageName}" - enum="BooleanEnabled" expires_after="2022-11-12"> - <owner>cuicuiruan@google.com</owner> - <owner>arc-gaming@google.com</owner> - <summary> - Check whether users play the game with input overlay mapping hint enabled or - disabled on app {ArcInputOverlayPackageName}. The metric is recorded when - users launch the app {ArcInputOverlayPackageName} and when users have menu - state changed upon on closing the input menu only. Refer to - TouchInjector::RecordMenuStateOnLaunch() and - TouchInjector::OnInputMenuViewRemoved(). - </summary> - <token key="ArcInputOverlayPackageName" - variants="ArcInputOverlayPackageNames"/> -</histogram> - <histogram name="Arc.IntentHelper.OpenAppWithIntentAction" enum="ArcIntentHelperIntentAction" expires_after="2022-10-17"> <owner>tsergeant@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/enterprise/histograms.xml b/tools/metrics/histograms/metadata/enterprise/histograms.xml index 6c023c7..4912c002 100644 --- a/tools/metrics/histograms/metadata/enterprise/histograms.xml +++ b/tools/metrics/histograms/metadata/enterprise/histograms.xml
@@ -1669,6 +1669,17 @@ </histogram> <histogram + name="Enterprise.MachineLevelUserCloudPolicyEnrollment.DMTokenDeletion" + enum="BooleanSuccess" expires_after="2023-06-01"> + <owner>igorruvinov@chromium.org</owner> + <owner>zmin@chromium.org</owner> + <summary> + Records whether browser unenrollment via DMToken deletion completed + succcessfully after attempting to delete the token. + </summary> +</histogram> + +<histogram name="Enterprise.MachineLevelUserCloudPolicyEnrollment.RequestFailureTime" units="ms" expires_after="2022-06-01"> <owner>rogerta@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/power/histograms.xml b/tools/metrics/histograms/metadata/power/histograms.xml index e058564..a43c3d36 100644 --- a/tools/metrics/histograms/metadata/power/histograms.xml +++ b/tools/metrics/histograms/metadata/power/histograms.xml
@@ -896,7 +896,7 @@ </histogram> <histogram name="Power.CpuTimeSecondsPerPowerMode.{ProcessType}" - enum="PowerMode" expires_after="2022-06-30"> + enum="PowerMode" expires_after="2022-12-31"> <owner>eseckler@chromium.org</owner> <owner>oksamyt@chromium.org</owner> <owner>woa-performance@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/uma/histograms.xml b/tools/metrics/histograms/metadata/uma/histograms.xml index 69df974..c85899a 100644 --- a/tools/metrics/histograms/metadata/uma/histograms.xml +++ b/tools/metrics/histograms/metadata/uma/histograms.xml
@@ -120,20 +120,6 @@ </summary> </histogram> -<histogram name="UMA.CleanExitBeacon.ExtendedMonitoringStageDuration" - units="ms" expires_after="2022-11-01"> - <owner>ssid@chromium.org</owner> - <owner>wnwen@chromium.org</owner> - <summary> - The amount of time in ms between the extended and status quo browser crash - monitoring stages. The extended monitoring stage may begin in - MaybeExtendVariationsSafeMode(), and the status quo stage begins in - MetricsService::OnAppEnterForeground(). Emitted when the status quo - monitoring stage begins. Recorded by Extended Variations Safe Mode - enabled-group clients on Android Chrome. - </summary> -</histogram> - <histogram name="UMA.CleanExitBeacon.MonitoringStage" enum="BeaconMonitoringStage" expires_after="2022-10-04"> <obsolete>
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index 87116453..e9e6d06 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -5,24 +5,24 @@ "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux_arm64/49b4b5dcbc312d8d2c3751cf29238b8efeb4e494/trace_processor_shell" }, "win": { - "hash": "9a036613eb5405c4d5f82b39c460d999922624b2", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/0eba417b2c72264fa825dc21067b9adc9b8adf70/trace_processor_shell.exe" + "hash": "c7eea54f488c5df4f905beec98965e6427726d2b", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/8cafb589b7e414c21a0ef2647fd30c1d1a3a0572/trace_processor_shell.exe" }, "linux_arm": { "hash": "58893933be305d3bfe0a72ebebcacde2ac3ca893", "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux_arm/49b4b5dcbc312d8d2c3751cf29238b8efeb4e494/trace_processor_shell" }, "mac": { - "hash": "fc4705a4c9288cdf500d3b34c92e2f3be5c43be6", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/mac/0eba417b2c72264fa825dc21067b9adc9b8adf70/trace_processor_shell" + "hash": "6a29803a2c5e4602d40d2fdb508c22fdf451219b", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/mac/e203cbf28e303aa502f63f046d70fdbf894d4a13/trace_processor_shell" }, "mac_arm64": { "hash": "e1ad4861384b06d911a65f035317914b8cc975c6", "full_remote_path": "perfetto-luci-artifacts/v25.0/mac-arm64/trace_processor_shell" }, "linux": { - "hash": "9fe6d658ba5981186786d2d82191b5b002bd66e3", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/eba209175d8cb8a5d1708a2858ff2d0c3a53dcd3/trace_processor_shell" + "hash": "2723a44176ec3acd25b62574390a8b722ab0c2b4", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/8cafb589b7e414c21a0ef2647fd30c1d1a3a0572/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/ui/accessibility/BUILD.gn b/ui/accessibility/BUILD.gn index d673292..2ac0e7b 100644 --- a/ui/accessibility/BUILD.gn +++ b/ui/accessibility/BUILD.gn
@@ -21,11 +21,21 @@ mojom("ax_constants_mojo") { sources = [ "ax_constants.mojom" ] + + # TODO(abigailbklein): Remove this when ReadAnythingAppController is wired up. + if (!is_android) { + webui_module_path = "/" + } } mojom_component("ax_enums_mojo") { sources = [ "ax_enums.mojom" ] + # TODO(abigailbklein): Remove this when ReadAnythingAppController is wired up. + if (!is_android) { + webui_module_path = "/" + } + macro_prefix = "UI_ACCESSIBILITY_AX_MOJOM" output_prefix = "ui_accessibility_ax_mojom" }
diff --git a/ui/accessibility/mojom/BUILD.gn b/ui/accessibility/mojom/BUILD.gn index 3302ef74..aa5e33d 100644 --- a/ui/accessibility/mojom/BUILD.gn +++ b/ui/accessibility/mojom/BUILD.gn
@@ -26,6 +26,11 @@ "//url/mojom:url_mojom_gurl", ] + # TODO(abigailbklein): Remove this when ReadAnythingAppController is wired up. + if (!is_android) { + webui_module_path = "/" + } + cpp_typemaps = [ { types = [
diff --git a/ui/aura/test/ui_controls_ozone.cc b/ui/aura/test/ui_controls_ozone.cc index 1baa18b7..b2f598a 100644 --- a/ui/aura/test/ui_controls_ozone.cc +++ b/ui/aura/test/ui_controls_ozone.cc
@@ -208,7 +208,7 @@ ui_controls::kNoAccelerator); } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) bool UIControlsOzone::SendTouchEvents(int action, int id, int x, int y) { return SendTouchEventsNotifyWhenDone(action, id, x, y, base::OnceClosure()); }
diff --git a/ui/aura/test/ui_controls_ozone.h b/ui/aura/test/ui_controls_ozone.h index 0cc3978..68fe5840 100644 --- a/ui/aura/test/ui_controls_ozone.h +++ b/ui/aura/test/ui_controls_ozone.h
@@ -60,7 +60,7 @@ base::OnceClosure closure, int accelerator_state) override; bool SendMouseClick(ui_controls::MouseButton type) override; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) bool SendTouchEvents(int action, int id, int x, int y) override; bool SendTouchEventsNotifyWhenDone(int action, int id,
diff --git a/ui/base/test/ui_controls.h b/ui/base/test/ui_controls.h index 22ca4b5..deef0b6 100644 --- a/ui/base/test/ui_controls.h +++ b/ui/base/test/ui_controls.h
@@ -118,7 +118,7 @@ // pointers, |screen_x| and |screen_y| are the screen coordinates of a touch // pointer. bool SendTouchEvents(int action, int num, int screen_x, int screen_y); -#elif BUILDFLAG(IS_CHROMEOS_ASH) +#elif BUILDFLAG(IS_CHROMEOS) // Sends a TouchEvent to the window system. |action| is a bitmask of the // TouchType constants that indicates what events are generated, |id| identifies // the touch point.
diff --git a/ui/base/test/ui_controls_aura.cc b/ui/base/test/ui_controls_aura.cc index e96a8cd..4a2b86e 100644 --- a/ui/base/test/ui_controls_aura.cc +++ b/ui/base/test/ui_controls_aura.cc
@@ -86,7 +86,7 @@ CHECK(g_ui_controls_enabled); return instance_->SendTouchEvents(action, num, x, y); } -#elif BUILDFLAG(IS_CHROMEOS_ASH) +#elif BUILDFLAG(IS_CHROMEOS) // static bool SendTouchEvents(int action, int id, int x, int y) { CHECK(g_ui_controls_enabled);
diff --git a/ui/base/test/ui_controls_aura.h b/ui/base/test/ui_controls_aura.h index f3840f47..6752fa8 100644 --- a/ui/base/test/ui_controls_aura.h +++ b/ui/base/test/ui_controls_aura.h
@@ -55,7 +55,7 @@ #if BUILDFLAG(IS_WIN) virtual bool SendTouchEvents(int action, int num, int x, int y) = 0; -#elif BUILDFLAG(IS_CHROMEOS_ASH) +#elif BUILDFLAG(IS_CHROMEOS) virtual bool SendTouchEvents(int action, int id, int x, int y) = 0; virtual bool SendTouchEventsNotifyWhenDone(int action, int id,
diff --git a/ui/compositor/layer_animator_collection.cc b/ui/compositor/layer_animator_collection.cc index fd9873e..5e997fb 100644 --- a/ui/compositor/layer_animator_collection.cc +++ b/ui/compositor/layer_animator_collection.cc
@@ -14,6 +14,10 @@ LayerAnimatorCollection::LayerAnimatorCollection(Compositor* compositor) : compositor_(compositor), last_tick_time_(base::TimeTicks::Now()) { + // Do not check the active duration for the LayerAnimationCollection because + // new animation can be added while running existing animation, which + // extends the duration. + set_check_active_duration(false); } LayerAnimatorCollection::~LayerAnimatorCollection() {
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc index 0e4996eb..19ff00f3 100644 --- a/ui/gfx/render_text.cc +++ b/ui/gfx/render_text.cc
@@ -1686,7 +1686,6 @@ static_cast<float>(display_rect_.width()), elide_behavior_)); } else { - bool was_elided = text_elided_; text_elided_ = false; display_text_.clear(); @@ -1711,12 +1710,7 @@ Elide(text_to_elide, 0, static_cast<float>(display_rect_.width()), ELIDE_TAIL)); - // Have GetLineBreaks() re-calculate. - line_breaks_.SetMax(0); } else { - // If elision changed, re-calculate. - if (was_elided) - line_breaks_.SetMax(0); // Initial state above is fine. return; } @@ -1726,26 +1720,6 @@ display_text_.clear(); } -const BreakList<size_t>& RenderText::GetLineBreaks() { - if (line_breaks_.max() != 0) - return line_breaks_; - - const std::u16string& layout_text = GetDisplayText(); - const size_t text_length = layout_text.length(); - line_breaks_.SetValue(0); - line_breaks_.SetMax(text_length); - base::i18n::BreakIterator iter(layout_text, - base::i18n::BreakIterator::BREAK_LINE); - const bool success = iter.Init(); - DCHECK(success); - if (success) { - do { - line_breaks_.ApplyValue(iter.pos(), Range(iter.pos(), text_length)); - } while (iter.Advance()); - } - return line_breaks_; -} - Point RenderText::ToViewPoint(const PointF& point, size_t line) { if (GetNumLines() == 1) { return Point(base::ClampCeil(Clamp(point.x())), @@ -2017,7 +1991,6 @@ layout_text_.clear(); display_text_.clear(); text_elided_ = false; - line_breaks_.SetMax(0); layout_text_up_to_date_ = false;
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h index 983cba19..81ac620c 100644 --- a/ui/gfx/render_text.h +++ b/ui/gfx/render_text.h
@@ -768,9 +768,6 @@ // Update the display text. void UpdateDisplayText(float text_width); - // Returns display text positions that are suitable for breaking lines. - const BreakList<size_t>& GetLineBreaks(); - // Convert points from the text space to the view space. Handles the display // area, display offset, application LTR/RTL mode and multiline. |line| is the // index of the line in which |point| is found, and is required to be passed @@ -1038,9 +1035,6 @@ // Text shadows to be drawn. ShadowValues shadows_; - // A list of valid display text line break positions. - BreakList<size_t> line_breaks_; - // Text shaping computed by EnsureLayout. This should be invalidated upon // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. std::unique_ptr<internal::ShapedText> shaped_text_;
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc index 5b17e41..09429ce 100644 --- a/ui/gfx/render_text_harfbuzz.cc +++ b/ui/gfx/render_text_harfbuzz.cc
@@ -413,7 +413,6 @@ float glyph_height_for_test, WordWrapBehavior word_wrap_behavior, const std::u16string& text, - const BreakList<size_t>* words, const internal::TextRunList& run_list) : max_width_((max_width == 0) ? SK_ScalarMax : SkIntToScalar(max_width)), min_baseline_(min_baseline), @@ -421,7 +420,6 @@ glyph_height_for_test_(glyph_height_for_test), word_wrap_behavior_(word_wrap_behavior), text_(text), - words_(words), run_list_(run_list), max_descent_(0), max_ascent_(0), @@ -448,10 +446,17 @@ // Constructs multiple lines for |text_| based on words iteration approach. void ConstructMultiLines() { - DCHECK(words_); - for (auto iter = words_->breaks().begin(); iter != words_->breaks().end(); - iter++) { - const Range word_range = words_->GetRange(iter); + // Get an iterator that pass through valid line breaking positions. + // See https://www.unicode.org/reports/tr14/tr14-11.html for lines breaking. + base::i18n::BreakIterator words(text_, + base::i18n::BreakIterator::BREAK_LINE); + const bool success = words.Init(); + DCHECK(success); + if (!success) + return; + + while (words.Advance()) { + const Range word_range = Range(words.prev(), words.pos()); std::vector<internal::LineSegment> word_segments; SkScalar word_width = GetWordWidth(word_range, &word_segments); @@ -699,7 +704,6 @@ // segments based on its runs. SkScalar GetWordWidth(const Range& word_range, std::vector<internal::LineSegment>* segments) const { - DCHECK(words_); if (word_range.is_empty() || segments == nullptr) return 0; size_t run_start_index = run_list_.GetRunIndexAt(word_range.start()); @@ -745,7 +749,6 @@ const float glyph_height_for_test_; const WordWrapBehavior word_wrap_behavior_; const std::u16string& text_; - const raw_ptr<const BreakList<size_t>> words_; const internal::TextRunList& run_list_; // Stores the resulting lines. @@ -1705,7 +1708,7 @@ display_rect().width(), DetermineBaselineCenteringText(height, font_list()), height, glyph_height_for_test_, word_wrap_behavior(), GetDisplayText(), - multiline() ? &GetLineBreaks() : nullptr, *run_list); + *run_list); if (multiline()) line_breaker.ConstructMultiLines();
diff --git a/ui/ozone/platform/wayland/emulate/wayland_input_emulate.cc b/ui/ozone/platform/wayland/emulate/wayland_input_emulate.cc index 1c968ff6..1e64f8e 100644 --- a/ui/ozone/platform/wayland/emulate/wayland_input_emulate.cc +++ b/ui/ozone/platform/wayland/emulate/wayland_input_emulate.cc
@@ -7,11 +7,13 @@ #include <linux/input.h> #include <wayland-client-protocol.h> #include <weston-test-client-protocol.h> +#include <weston-test-server-protocol.h> #include <memory> #include "base/logging.h" #include "base/time/time.h" +#include "ui/base/test/ui_controls.h" #include "ui/events/keycodes/dom/keycode_converter.h" #include "ui/platform_window/common/platform_window_defaults.h" @@ -25,9 +27,27 @@ type == ui::EventType::ET_MOUSE_PRESSED || type == ui::EventType::ET_MOUSE_RELEASED || type == ui::EventType::ET_KEY_PRESSED || - type == ui::EventType::ET_KEY_RELEASED); + type == ui::EventType::ET_KEY_RELEASED || + type == ui::EventType::ET_TOUCH_PRESSED || + type == ui::EventType::ET_TOUCH_MOVED || + type == ui::EventType::ET_TOUCH_RELEASED); } +namespace { + +int EventTypeToWaylandTouchType(ui::EventType event_type) { + switch (event_type) { + case ui::EventType::ET_TOUCH_PRESSED: + return WL_TOUCH_DOWN; + case ui::EventType::ET_TOUCH_MOVED: + return WL_TOUCH_MOTION; + default: + return WL_TOUCH_UP; + } +} + +} // namespace + WaylandInputEmulate::PendingEvent::~PendingEvent() = default; WaylandInputEmulate::TestWindow::TestWindow( @@ -61,6 +81,8 @@ &WaylandInputEmulate::HandlePointerPosition, &WaylandInputEmulate::HandlePointerButton, &WaylandInputEmulate::HandleKeyboardKey, + nullptr, // capture_screenshot_done + &WaylandInputEmulate::HandleTouchReceived, }; weston_test_add_listener(weston_test_, &test_listener, this); } @@ -83,8 +105,9 @@ observers_.RemoveObserver(obs); } -void WaylandInputEmulate::EmulatePointerMotion(gfx::AcceleratedWidget widget, - gfx::Point mouse_surface_loc) { +void WaylandInputEmulate::EmulatePointerMotion( + gfx::AcceleratedWidget widget, + const gfx::Point& mouse_surface_loc) { auto it = windows_.find(widget); DCHECK(it != windows_.end()); @@ -92,7 +115,7 @@ if (!test_window->buffer_attached_and_configured) { auto pending_event = std::make_unique<PendingEvent>(ui::EventType::ET_MOUSE_MOVED, widget); - pending_event->pointer_surface_location_in_px = mouse_surface_loc; + pending_event->location_in_px = mouse_surface_loc; test_window->pending_events.emplace_back(std::move(pending_event)); return; } @@ -182,6 +205,45 @@ wayland_proxy->ScheduleDisplayFlush(); } +void WaylandInputEmulate::EmulateTouch(gfx::AcceleratedWidget widget, + ui::EventType event_type, + int id, + const gfx::Point& touch_screen_loc) { + auto it = windows_.find(widget); + DCHECK(it != windows_.end()); + + auto* test_window = it->second.get(); + if (!test_window->buffer_attached_and_configured) { + auto pending_event = std::make_unique<PendingEvent>(event_type, widget); + pending_event->location_in_px = touch_screen_loc; + pending_event->touch_id = id; + test_window->pending_events.emplace_back(std::move(pending_event)); + return; + } + + auto* wayland_proxy = wl::WaylandProxy::GetInstance(); + DCHECK(wayland_proxy); + + auto* wlsurface = wayland_proxy->GetWlSurfaceForAcceleratedWidget(widget); + + // If it's a toplevel window, activate it. This results in raising the the + // parent window and its children windows. + auto window_type = wayland_proxy->GetWindowType(widget); + if (window_type != ui::PlatformWindowType::kTooltip && + window_type != ui::PlatformWindowType::kMenu && + !wayland_proxy->WindowHasPointerFocus(widget)) { + weston_test_activate_surface(weston_test_, wlsurface); + } + + timespec ts = (base::TimeTicks::Now() - base::TimeTicks()).ToTimeSpec(); + weston_test_send_touch(weston_test_, static_cast<uint64_t>(ts.tv_sec) >> 32, + ts.tv_sec & 0xffffffff, ts.tv_nsec, id, + wl_fixed_from_int(touch_screen_loc.x()), + wl_fixed_from_int(touch_screen_loc.y()), + EventTypeToWaylandTouchType(event_type)); + wayland_proxy->ScheduleDisplayFlush(); +} + void WaylandInputEmulate::OnWindowConfigured(gfx::AcceleratedWidget widget, bool is_configured) { auto it = windows_.find(widget); @@ -315,6 +377,18 @@ } // static +void WaylandInputEmulate::HandleTouchReceived(void* data, + struct weston_test* weston_test, + wl_fixed_t x, + wl_fixed_t y) { + WaylandInputEmulate* emulate = static_cast<WaylandInputEmulate*>(data); + auto touch_position_on_screen_px = + gfx::Point(wl_fixed_to_int(x), wl_fixed_to_int(y)); + for (WaylandInputEmulate::Observer& observer : emulate->observers_) + observer.OnTouchReceived(touch_position_on_screen_px); +} + +// static void WaylandInputEmulate::Global(void* data, wl_registry* registry, uint32_t name, @@ -363,8 +437,8 @@ switch (event->type) { case ui::EventType::ET_MOUSE_MOVED: - input_emulate->EmulatePointerMotion( - window->widget, event->pointer_surface_location_in_px); + input_emulate->EmulatePointerMotion(window->widget, + event->location_in_px); break; case ui::EventType::ET_MOUSE_PRESSED: case ui::EventType::ET_MOUSE_RELEASED: @@ -376,6 +450,12 @@ input_emulate->EmulateKeyboardKey(window->widget, event->type, event->key_dom_code); break; + case ui::EventType::ET_TOUCH_PRESSED: + case ui::EventType::ET_TOUCH_MOVED: + case ui::EventType::ET_TOUCH_RELEASED: + input_emulate->EmulateTouch(window->widget, event->type, + event->touch_id, event->location_in_px); + break; default: NOTREACHED(); break;
diff --git a/ui/ozone/platform/wayland/emulate/wayland_input_emulate.h b/ui/ozone/platform/wayland/emulate/wayland_input_emulate.h index 7e0c7824..bb3e2c2 100644 --- a/ui/ozone/platform/wayland/emulate/wayland_input_emulate.h +++ b/ui/ozone/platform/wayland/emulate/wayland_input_emulate.h
@@ -27,7 +27,7 @@ namespace wl { -// Emulates Keyboard, Pointer, Touch events that ui_interactive_tests test +// Emulates Keyboard, Pointer, and Touch events that ui_interactive_tests test // suite sends. Mustn't be used in production code. class WaylandInputEmulate : public wl::WaylandProxy::Delegate { public: @@ -44,6 +44,10 @@ // event codes in Linux's input-event-codes.h. virtual void OnKeyboardKey(int32_t key, bool pressed) = 0; + // Notifies that the Wayland compositor has sent a touch event to + // |screen_position|. + virtual void OnTouchReceived(const gfx::Point& screen_position) = 0; + protected: ~Observer() override = default; }; @@ -54,17 +58,22 @@ void AddObserver(Observer* obs); void RemoveObserver(Observer* obs); void EmulatePointerMotion(gfx::AcceleratedWidget widget, - gfx::Point mouse_surface_loc); + const gfx::Point& mouse_surface_loc); void EmulatePointerButton(gfx::AcceleratedWidget widget, ui::EventType event_type, uint32_t changed_button); void EmulateKeyboardKey(gfx::AcceleratedWidget widget, ui::EventType event_type, ui::DomCode dom_code); + void EmulateTouch(gfx::AcceleratedWidget widget, + ui::EventType event_type, + int id, + const gfx::Point& touch_screen_loc); private: // Pending emulated events. Can be ET_MOUSE_MOVED, - // ET_MOUSE_PRESSED/ET_MOUSE_RELEASED, or ET_KEY_PRESSED/ET_KEY_RELEASED. + // ET_MOUSE_PRESSED/ET_MOUSE_RELEASED, ET_KEY_PRESSED/ET_KEY_RELEASED, or + // ET_TOUCH_PRESSED/ET_TOUCH_MOVED/ET_TOUCH_RELEASED. struct PendingEvent { PendingEvent(ui::EventType event_type, gfx::AcceleratedWidget target_widget); @@ -73,14 +82,19 @@ ui::EventType type; gfx::AcceleratedWidget widget; - // Set for type == ET_MOUSE_MOVED. - gfx::Point pointer_surface_location_in_px; + // Set for type == ET_MOUSE_MOVED || type == ET_TOUCH_*. Location is in + // surface coordinates for mouse events, and in root coordinates for touch + // events. + gfx::Point location_in_px; // Set for type == ET_MOUSE_PRESSED || type == ET_MOUSE_RELEASED. uint32_t mouse_button = 0; // Set for type == ET_KEY_PRESSED || type == ET_KEY_RELEASED. ui::DomCode key_dom_code = ui::DomCode::NONE; + + // Set for type == ET_TOUCH_*. + int touch_id = 0; }; // A container that tracks created WaylandWindows and keeps some fundamental @@ -135,6 +149,10 @@ struct weston_test* weston_test, uint32_t key, uint32_t state); + static void HandleTouchReceived(void* data, + struct weston_test* weston_test, + wl_fixed_t x, + wl_fixed_t y); // wl_registry_listener. static void Global(void* data,
diff --git a/ui/ozone/platform/wayland/gpu/wayland_gl_egl_utility.cc b/ui/ozone/platform/wayland/gpu/wayland_gl_egl_utility.cc index 0f43dda..a71b56c 100644 --- a/ui/ozone/platform/wayland/gpu/wayland_gl_egl_utility.cc +++ b/ui/ozone/platform/wayland/gpu/wayland_gl_egl_utility.cc
@@ -16,7 +16,6 @@ #ifndef EGL_ANGLE_platform_angle #define EGL_ANGLE_platform_angle 1 #define EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE 0x348F -#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE 0x3209 #endif /* EGL_ANGLE_platform_angle */ #ifndef EGL_ANGLE_platform_angle_vulkan @@ -24,21 +23,9 @@ #define EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE 0x34A5 #endif /* EGL_ANGLE_platform_angle_vulkan */ -#ifndef EGL_ANGLE_platform_angle_device_type_egl_angle -#define EGL_ANGLE_platform_angle_device_type_egl_angle -#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE 0x348E -#endif /* EGL_ANGLE_platform_angle_device_type_egl_angle */ - -#ifndef EGL_ANGLE_platform_angle_opengl -#define EGL_ANGLE_platform_angle_opengl 1 -#define EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE 0x320D -#define EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE 0x320E -#endif /* EGL_ANGLE_platform_angle_opengl */ - namespace ui { WaylandGLEGLUtility::WaylandGLEGLUtility() = default; - WaylandGLEGLUtility::~WaylandGLEGLUtility() = default; void WaylandGLEGLUtility::GetAdditionalEGLAttributes( @@ -53,17 +40,6 @@ EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE); return; } - - if (std::find(display_attributes->begin(), display_attributes->end(), - EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE) != - display_attributes->end() || - std::find(display_attributes->begin(), display_attributes->end(), - EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE) != - display_attributes->end()) { - display_attributes->push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE); - display_attributes->push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE); - return; - } } void WaylandGLEGLUtility::ChooseEGLAlphaAndBufferSize(EGLint* alpha_size,
diff --git a/ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc b/ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc index 1e135da..5ba93b8 100644 --- a/ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc +++ b/ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc
@@ -153,14 +153,8 @@ if (egl_implementation_) { impls.emplace_back( gl::GLImplementationParts(gl::kGLImplementationEGLGLES2)); - // Add only supported ANGLE implementations. Otherwise, angle-vulkan might - // be requested, which is not supported with this backend yet. impls.emplace_back( gl::GLImplementationParts(gl::ANGLEImplementation::kSwiftShader)); - impls.emplace_back( - gl::GLImplementationParts(gl::ANGLEImplementation::kOpenGL)); - impls.emplace_back( - gl::GLImplementationParts(gl::ANGLEImplementation::kOpenGLES)); } return impls; }
diff --git a/ui/ozone/platform/wayland/test/wayland_ozone_ui_controls_test_helper.cc b/ui/ozone/platform/wayland/test/wayland_ozone_ui_controls_test_helper.cc index 5562111..8567f42 100644 --- a/ui/ozone/platform/wayland/test/wayland_ozone_ui_controls_test_helper.cc +++ b/ui/ozone/platform/wayland/test/wayland_ozone_ui_controls_test_helper.cc
@@ -29,6 +29,7 @@ kMotion, kButton, kKey, + kTouch, kUnknown, }; @@ -108,6 +109,12 @@ } } + void OnTouchReceived(const gfx::Point& screen_position) override { + if (event_type_ == WaylandEventType::kTouch) { + ExecuteClosure(); + } + } + void ExecuteClosure() { DCHECK(!closure_.is_null()); base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, @@ -228,6 +235,35 @@ } } +#if BUILDFLAG(IS_CHROMEOS_LACROS) +void WaylandOzoneUIControlsTestHelper::SendTouchEvent( + gfx::AcceleratedWidget widget, + int action, + int id, + const gfx::Point& touch_loc, + base::OnceClosure closure) { + WaylandGlobalEventWaiter::Create( + WaylandGlobalEventWaiter::WaylandEventType::kTouch, touch_loc, + std::move(closure), input_emulate_.get()); + + // TODO(rivr): ui_controls::TouchType is a bitmask, do we need to handle the + // case where multiple actions are requested together? + ui::EventType event_type; + switch (action) { + case ui_controls::PRESS: + event_type = ui::EventType::ET_TOUCH_PRESSED; + break; + case ui_controls::RELEASE: + event_type = ui::EventType::ET_TOUCH_RELEASED; + break; + default: + event_type = ui::EventType::ET_TOUCH_MOVED; + } + + input_emulate_->EmulateTouch(widget, event_type, id, touch_loc); +} +#endif + void WaylandOzoneUIControlsTestHelper::RunClosureAfterAllPendingUIEvents( base::OnceClosure closure) { NOTREACHED();
diff --git a/ui/ozone/platform/wayland/test/wayland_ozone_ui_controls_test_helper.h b/ui/ozone/platform/wayland/test/wayland_ozone_ui_controls_test_helper.h index e89aff5..2264adf 100644 --- a/ui/ozone/platform/wayland/test/wayland_ozone_ui_controls_test_helper.h +++ b/ui/ozone/platform/wayland/test/wayland_ozone_ui_controls_test_helper.h
@@ -41,6 +41,13 @@ const gfx::Point& mouse_loc, const gfx::Point& mouse_root_loc, base::OnceClosure closure) override; +#if BUILDFLAG(IS_CHROMEOS_LACROS) + void SendTouchEvent(gfx::AcceleratedWidget widget, + int action, + int id, + const gfx::Point& touch_loc, + base::OnceClosure closure) override; +#endif void RunClosureAfterAllPendingUIEvents(base::OnceClosure closure) override; bool MustUseUiControlsForMoveCursorTo() override;
diff --git a/ui/ozone/public/ozone_ui_controls_test_helper.h b/ui/ozone/public/ozone_ui_controls_test_helper.h index a0bdd18..0a67db3d 100644 --- a/ui/ozone/public/ozone_ui_controls_test_helper.h +++ b/ui/ozone/public/ozone_ui_controls_test_helper.h
@@ -50,6 +50,15 @@ const gfx::Point& mouse_root_loc, base::OnceClosure closure) = 0; +#if BUILDFLAG(IS_CHROMEOS_LACROS) + // Sends touch event and executes |closure| when done. + virtual void SendTouchEvent(gfx::AcceleratedWidget widget, + int action, + int id, + const gfx::Point& touch_loc, + base::OnceClosure closure) = 0; +#endif + // Executes closure after all pending ui events are sent. virtual void RunClosureAfterAllPendingUIEvents(base::OnceClosure closure) = 0;
diff --git a/ui/qt/DEPS b/ui/qt/DEPS index a41bfb8..4393b3b 100644 --- a/ui/qt/DEPS +++ b/ui/qt/DEPS
@@ -1,4 +1,5 @@ include_rules = [ + "+chrome/browser/themes/theme_properties.h", "+third_party/skia", "+ui/color", "+ui/gfx",
diff --git a/ui/qt/qt_interface.h b/ui/qt/qt_interface.h index 9fe904e..24627bd 100644 --- a/ui/qt/qt_interface.h +++ b/ui/qt/qt_interface.h
@@ -125,10 +125,12 @@ virtual Image GetIconForContentType(const String& content_type, int size) const = 0; virtual SkColor GetColor(ColorType role, ColorState state) const = 0; + virtual SkColor GetFrameColor(ColorState state, + bool use_custom_frame) const = 0; virtual Image DrawHeader(int width, int height, SkColor default_color, - bool is_active, + ColorState state, bool use_custom_frame) const = 0; virtual int GetCursorBlinkIntervalMs() const = 0; virtual int GetAnimationDurationMs() const = 0;
diff --git a/ui/qt/qt_shim.cc b/ui/qt/qt_shim.cc index fe891af..5bdcf61 100644 --- a/ui/qt/qt_shim.cc +++ b/ui/qt/qt_shim.cc
@@ -93,12 +93,13 @@ size_t r = 0; size_t g = 0; size_t b = 0; - const auto* pixels = image.bits(); + const auto* pixels = reinterpret_cast<QRgb*>(image.bits()); for (size_t i = 0; i < size; i++) { - a += pixels[4 * i + 0]; - r += pixels[4 * i + 1]; - g += pixels[4 * i + 2]; - b += pixels[4 * i + 3]; + auto color = QColor::fromRgba(pixels[i]); + a += color.alpha(); + r += color.red(); + g += color.green(); + b += color.blue(); } return qRgba(r / size, g / size, b / size, a / size); } @@ -254,6 +255,13 @@ ColorTypeToColorRole(role))); } +SkColor QtShim::GetFrameColor(ColorState state, bool use_custom_frame) const { + constexpr int kSampleSize = 32; + return TextureColor(DrawHeaderImpl(kSampleSize, kSampleSize, + GetColor(ColorType::kWindowBg, state), + state, use_custom_frame)); +} + int QtShim::GetCursorBlinkIntervalMs() const { return app_.cursorFlashTime(); } @@ -273,8 +281,18 @@ Image QtShim::DrawHeader(int width, int height, SkColor default_color, - bool is_active, + ColorState state, bool use_custom_frame) const { + QImage image = + DrawHeaderImpl(width, height, default_color, state, use_custom_frame); + return {width, height, 1.0f, Buffer(image.bits(), image.sizeInBytes())}; +} + +QImage QtShim::DrawHeaderImpl(int width, + int height, + SkColor default_color, + ColorState state, + bool use_custom_frame) const { QImage image(width, height, QImage::Format_ARGB32_Premultiplied); image.fill(default_color); QPainter painter(&image); @@ -286,17 +304,16 @@ QStyleOptionTitleBar opt; opt.rect = QRect(-kBorderWidth, -kBorderWidth, width + 2 * kBorderWidth, height + 2 * kBorderWidth); - if (is_active) + if (state == ColorState::kNormal) opt.titleBarState = QStyle::State_Active; app_.style()->drawComplexControl(QStyle::CC_TitleBar, &opt, &painter, nullptr); } else { painter.fillRect( 0, 0, width, height, - app_.palette().brush(is_active ? QPalette::Normal : QPalette::Active, - QPalette::Window)); + app_.palette().brush(ColorStateToColorGroup(state), QPalette::Window)); } - return {width, height, 1.0f, Buffer(image.bits(), image.sizeInBytes())}; + return image; } } // namespace qt
diff --git a/ui/qt/qt_shim.h b/ui/qt/qt_shim.h index c7351a9..3255eb5 100644 --- a/ui/qt/qt_shim.h +++ b/ui/qt/qt_shim.h
@@ -6,6 +6,7 @@ #define UI_QT_QT_SHIM_H_ #include <QApplication> +#include <QImage> #include <QObject> #include "ui/qt/qt_interface.h" @@ -29,10 +30,11 @@ Image GetIconForContentType(const String& content_type, int size) const override; SkColor GetColor(ColorType role, ColorState state) const override; + SkColor GetFrameColor(ColorState state, bool use_custom_frame) const override; Image DrawHeader(int width, int height, SkColor default_color, - bool is_active, + ColorState state, bool use_custom_frame) const override; int GetCursorBlinkIntervalMs() const override; int GetAnimationDurationMs() const override; @@ -42,6 +44,11 @@ void PaletteChanged(const QPalette& palette); private: + QImage DrawHeaderImpl(int width, + int height, + SkColor default_color, + ColorState state, + bool use_custom_frame) const; QtInterface::Delegate* const delegate_; QApplication app_;
diff --git a/ui/qt/qt_ui.cc b/ui/qt/qt_ui.cc index b0f06921..52531d5 100644 --- a/ui/qt/qt_ui.cc +++ b/ui/qt/qt_ui.cc
@@ -13,11 +13,13 @@ #include "base/notreached.h" #include "base/path_service.h" #include "base/time/time.h" +#include "chrome/browser/themes/theme_properties.h" // nogncheck #include "third_party/skia/include/core/SkBitmap.h" #include "ui/color/color_mixer.h" #include "ui/color/color_provider.h" #include "ui/color/color_recipe.h" #include "ui/gfx/color_palette.h" +#include "ui/gfx/color_utils.h" #include "ui/gfx/font.h" #include "ui/gfx/font_render_params.h" #include "ui/gfx/font_render_params_linux.h" @@ -94,7 +96,8 @@ ColorScheme color_scheme) const override { auto image = shim_->DrawHeader( rect.width(), rect.height(), frame_top_area.default_background_color, - frame_top_area.is_active, frame_top_area.use_custom_frame); + frame_top_area.is_active ? ColorState::kNormal : ColorState::kInactive, + frame_top_area.use_custom_frame); SkImageInfo image_info = SkImageInfo::Make( image.width, image.height, kBGRA_8888_SkColorType, kPremul_SkAlphaType); SkBitmap bitmap; @@ -172,13 +175,20 @@ } bool QtUi::GetColor(int id, SkColor* color, bool use_custom_frame) const { - NOTIMPLEMENTED_LOG_ONCE(); - return false; + auto value = GetColor(id, use_custom_frame); + if (value) + *color = *value; + return value.has_value(); } bool QtUi::GetDisplayProperty(int id, int* result) const { - NOTIMPLEMENTED_LOG_ONCE(); - return false; + switch (id) { + case ThemeProperties::SHOULD_FILL_BACKGROUND_TAB_COLOR: + *result = false; + return true; + default: + return false; + } } SkColor QtUi::GetFocusRingColor() const { @@ -402,6 +412,76 @@ }; for (const auto& map : kMaps) mixer[map.id] = {shim_->GetColor(map.role, map.state)}; + + mixer[ui::kColorFrameActive] = { + shim_->GetFrameColor(ColorState::kNormal, true)}; + mixer[ui::kColorFrameInactive] = { + shim_->GetFrameColor(ColorState::kInactive, true)}; +} + +absl::optional<SkColor> QtUi::GetColor(int id, bool use_custom_frame) const { + switch (id) { + case ThemeProperties::COLOR_LOCATION_BAR_BORDER: + return shim_->GetColor(ColorType::kEntryFg, ColorState::kNormal); + case ThemeProperties::COLOR_TOOLBAR_CONTENT_AREA_SEPARATOR: + return shim_->GetColor(ColorType::kButtonFg, ColorState::kNormal); + case ThemeProperties::COLOR_TOOLBAR_VERTICAL_SEPARATOR: + return shim_->GetColor(ColorType::kButtonFg, ColorState::kNormal); + case ThemeProperties::COLOR_NTP_BACKGROUND: + return shim_->GetColor(ColorType::kEntryBg, ColorState::kNormal); + case ThemeProperties::COLOR_NTP_TEXT: + return shim_->GetColor(ColorType::kEntryFg, ColorState::kNormal); + case ThemeProperties::COLOR_NTP_HEADER: + return shim_->GetColor(ColorType::kButtonFg, ColorState::kNormal); + case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON: + return shim_->GetColor(ColorType::kWindowFg, ColorState::kNormal); + case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON_HOVERED: + return shim_->GetColor(ColorType::kWindowFg, ColorState::kNormal); + case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON_PRESSED: + return shim_->GetColor(ColorType::kWindowFg, ColorState::kNormal); + case ThemeProperties::COLOR_TOOLBAR_TEXT: + return shim_->GetColor(ColorType::kWindowFg, ColorState::kNormal); + case ThemeProperties::COLOR_NTP_LINK: + return shim_->GetColor(ColorType::kHighlightBg, ColorState::kNormal); + case ThemeProperties::COLOR_FRAME_ACTIVE: + return shim_->GetFrameColor(ColorState::kNormal, use_custom_frame); + case ThemeProperties::COLOR_FRAME_INACTIVE: + return shim_->GetFrameColor(ColorState::kInactive, use_custom_frame); + case ThemeProperties::COLOR_FRAME_ACTIVE_INCOGNITO: + return shim_->GetFrameColor(ColorState::kNormal, use_custom_frame); + case ThemeProperties::COLOR_FRAME_INACTIVE_INCOGNITO: + return shim_->GetFrameColor(ColorState::kInactive, use_custom_frame); + case ThemeProperties::COLOR_TOOLBAR: + return shim_->GetColor(ColorType::kButtonBg, ColorState::kNormal); + case ThemeProperties::COLOR_TAB_BACKGROUND_ACTIVE_FRAME_ACTIVE: + return shim_->GetColor(ColorType::kButtonBg, ColorState::kNormal); + case ThemeProperties::COLOR_TAB_BACKGROUND_ACTIVE_FRAME_INACTIVE: + return shim_->GetColor(ColorType::kButtonBg, ColorState::kInactive); + case ThemeProperties::COLOR_TAB_FOREGROUND_INACTIVE_FRAME_ACTIVE: + return color_utils::BlendForMinContrast( + shim_->GetColor(ColorType::kButtonBg, ColorState::kNormal), + shim_->GetFrameColor(ColorState::kNormal, use_custom_frame)) + .color; + case ThemeProperties::COLOR_TAB_FOREGROUND_INACTIVE_FRAME_INACTIVE: + return color_utils::BlendForMinContrast( + shim_->GetColor(ColorType::kButtonBg, ColorState::kInactive), + shim_->GetFrameColor(ColorState::kInactive, use_custom_frame)) + .color; + case ThemeProperties::COLOR_TAB_STROKE_FRAME_ACTIVE: + return color_utils::BlendForMinContrast( + shim_->GetColor(ColorType::kButtonBg, ColorState::kNormal), + shim_->GetColor(ColorType::kButtonBg, ColorState::kNormal), + SK_ColorBLACK, 2.0) + .color; + case ThemeProperties::COLOR_TAB_STROKE_FRAME_INACTIVE: + return color_utils::BlendForMinContrast( + shim_->GetColor(ColorType::kButtonBg, ColorState::kInactive), + shim_->GetColor(ColorType::kButtonBg, ColorState::kInactive), + SK_ColorBLACK, 2.0) + .color; + default: + return absl::nullopt; + } } std::unique_ptr<views::LinuxUI> CreateQtUi() {
diff --git a/ui/qt/qt_ui.h b/ui/qt/qt_ui.h index 03de193..42bc5bd 100644 --- a/ui/qt/qt_ui.h +++ b/ui/qt/qt_ui.h
@@ -8,6 +8,7 @@ #include <memory> #include "base/component_export.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/qt/qt_interface.h" #include "ui/views/linux_ui/linux_ui.h" @@ -83,6 +84,8 @@ void AddNativeColorMixer(ui::ColorProvider* provider, const ui::ColorProviderManager::Key& key); + absl::optional<SkColor> GetColor(int id, bool use_custom_frame) const; + // QT modifies argc and argv, and they must be kept alive while // `shim_` is alive. CmdLineArgs cmd_line_;
diff --git a/ui/views/controls/styled_label.cc b/ui/views/controls/styled_label.cc index 8f25251d..8d03c42 100644 --- a/ui/views/controls/styled_label.cc +++ b/ui/views/controls/styled_label.cc
@@ -326,12 +326,16 @@ PreferredSizeChanged(); } -void StyledLabel::ClickLinkForTesting() { +void StyledLabel::ClickFirstLinkForTesting() { + GetFirstLinkForTesting()->OnKeyPressed( // IN-TEST + ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_SPACE, ui::EF_NONE)); +} + +views::Link* StyledLabel::GetFirstLinkForTesting() { const auto it = base::ranges::find(children(), Link::kViewClassName, &View::GetClassName); DCHECK(it != children().cend()); - (*it)->OnKeyPressed( - ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_SPACE, ui::EF_NONE)); + return static_cast<views::Link*>(*it); } int StyledLabel::StartX(int excess_space) const {
diff --git a/ui/views/controls/styled_label.h b/ui/views/controls/styled_label.h index bff92d2..0693236 100644 --- a/ui/views/controls/styled_label.h +++ b/ui/views/controls/styled_label.h
@@ -181,7 +181,10 @@ // Sends a space keypress to the first child that is a link. Assumes at least // one such child exists. - void ClickLinkForTesting(); + void ClickFirstLinkForTesting(); + + // Get the first child that is a link. + views::Link* GetFirstLinkForTesting(); private: struct StyleRange {
diff --git a/ui/views/test/ui_controls_factory_desktop_aura_ozone.cc b/ui/views/test/ui_controls_factory_desktop_aura_ozone.cc index bec549b8..8205a81 100644 --- a/ui/views/test/ui_controls_factory_desktop_aura_ozone.cc +++ b/ui/views/test/ui_controls_factory_desktop_aura_ozone.cc
@@ -151,6 +151,43 @@ return SendMouseEvents(type, UP | DOWN, ui_controls::kNoAccelerator); } +#if BUILDFLAG(IS_CHROMEOS) + bool SendTouchEvents(int action, int id, int x, int y) override { + return SendTouchEventsNotifyWhenDone(action, id, x, y, base::OnceClosure()); + } + bool SendTouchEventsNotifyWhenDone(int action, + int id, + int x, + int y, + base::OnceClosure closure) override { + gfx::Point screen_location(x, y); + gfx::Point root_location = screen_location; + aura::Window* root_window; + // Touch release events might not have coordinates that match any window, so + // just use whichever window is on top. + if (action & ui_controls::RELEASE) + root_window = TopRootWindow(); + else + root_window = RootWindowForPoint(screen_location); + + aura::client::ScreenPositionClient* screen_position_client = + aura::client::GetScreenPositionClient(root_window); + if (screen_position_client) { + screen_position_client->ConvertPointFromScreen(root_window, + &root_location); + } + + aura::WindowTreeHost* host = root_window->GetHost(); + gfx::Point screen_point(root_location); + host->ConvertDIPToScreenInPixels(&screen_point); + ozone_ui_controls_test_helper_->SendTouchEvent( + root_window->GetHost()->GetAcceleratedWidget(), action, id, + screen_point, std::move(closure)); + + return true; + } +#endif + private: aura::Window* RootWindowForPoint(const gfx::Point& point) { // Most interactive_ui_tests run inside of the aura_test_helper @@ -170,6 +207,13 @@ return (*i)->GetRootWindow(); } + aura::Window* TopRootWindow() { + std::vector<aura::Window*> windows = + DesktopWindowTreeHostPlatform::GetAllOpenWindows(); + DCHECK(!windows.empty()); + return windows[0]->GetRootWindow(); + } + std::unique_ptr<ui::OzoneUIControlsTestHelper> ozone_ui_controls_test_helper_; };
diff --git a/ui/views/view_model.cc b/ui/views/view_model.cc index e3ba79f..d059ecc6 100644 --- a/ui/views/view_model.cc +++ b/ui/views/view_model.cc
@@ -15,19 +15,14 @@ // view are owned by their parent, no need to delete them. } -void ViewModelBase::Remove(int index) { - if (index == -1) - return; - +void ViewModelBase::Remove(size_t index) { check_index(index); entries_.erase(entries_.begin() + index); } -void ViewModelBase::Move(int index, int target_index) { - DCHECK_LT(index, static_cast<int>(entries_.size())); - DCHECK_GE(index, 0); - DCHECK_LT(target_index, static_cast<int>(entries_.size())); - DCHECK_GE(target_index, 0); +void ViewModelBase::Move(size_t index, size_t target_index) { + check_index(index); + check_index(target_index); if (index == target_index) return; @@ -36,15 +31,15 @@ entries_.insert(entries_.begin() + target_index, entry); } -void ViewModelBase::MoveViewOnly(int index, int target_index) { +void ViewModelBase::MoveViewOnly(size_t index, size_t target_index) { if (target_index < index) { View* view = entries_[index].view; - for (int i = index; i > target_index; --i) + for (size_t i = index; i > target_index; --i) entries_[i].view = entries_[i - 1].view; entries_[target_index].view = view; } else if (target_index > index) { View* view = entries_[index].view; - for (int i = index; i < target_index; ++i) + for (size_t i = index; i < target_index; ++i) entries_[i].view = entries_[i + 1].view; entries_[target_index].view = view; } @@ -57,18 +52,18 @@ delete entry.view; } -int ViewModelBase::GetIndexOfView(const View* view) const { +absl::optional<size_t> ViewModelBase::GetIndexOfView(const View* view) const { const auto i = std::find_if(entries_.cbegin(), entries_.cend(), [view](const auto& entry) { return entry.view == view; }); - return (i == entries_.cend()) ? -1 : (i - entries_.cbegin()); + return (i == entries_.cend()) ? absl::nullopt + : absl::make_optional(i - entries_.cbegin()); } ViewModelBase::ViewModelBase() = default; -void ViewModelBase::AddUnsafe(View* view, int index) { - DCHECK_LE(index, static_cast<int>(entries_.size())); - DCHECK_GE(index, 0); +void ViewModelBase::AddUnsafe(View* view, size_t index) { + check_index(index); Entry entry; entry.view = view; entries_.insert(entries_.begin() + index, entry);
diff --git a/ui/views/view_model.h b/ui/views/view_model.h index ae64bae..e8eeb73 100644 --- a/ui/views/view_model.h +++ b/ui/views/view_model.h
@@ -8,6 +8,7 @@ #include <vector> #include "base/check_op.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/views_export.h" @@ -40,37 +41,37 @@ // Removes the view at the specified index. This does not actually remove the // view from the view hierarchy. - void Remove(int index); + void Remove(size_t index); // Moves the view at |index| to |target_index|. |target_index| is in terms // of the model *after* the view at |index| is removed. - void Move(int index, int target_index); + void Move(size_t index, size_t target_index); // Variant of Move() that leaves the bounds as is. That is, after invoking // this the bounds of the view at |target_index| (and all other indices) are // exactly the same as the bounds of the view at |target_index| before // invoking this. - void MoveViewOnly(int index, int target_index); + void MoveViewOnly(size_t index, size_t target_index); // Returns the number of views. - int view_size() const { return static_cast<int>(entries_.size()); } + size_t view_size() const { return entries_.size(); } // Removes and deletes all the views. void Clear(); - void set_ideal_bounds(int index, const gfx::Rect& bounds) { + void set_ideal_bounds(size_t index, const gfx::Rect& bounds) { check_index(index); entries_[index].ideal_bounds = bounds; } - const gfx::Rect& ideal_bounds(int index) const { + const gfx::Rect& ideal_bounds(size_t index) const { check_index(index); return entries_[index].ideal_bounds; } - // Returns the index of the specified view, or -1 if the view isn't in the - // model. - int GetIndexOfView(const View* view) const; + // Returns the index of the specified view, or nullopt if the view isn't in + // the model. + absl::optional<size_t> GetIndexOfView(const View* view) const; protected: ViewModelBase(); @@ -78,26 +79,23 @@ // Returns the view at the specified index. Note: Most users should use // view_at() in the subclass, to get a view of the correct type. (Do not call // ViewAtBase then static_cast to the desired type.) - View* ViewAtBase(int index) const { + View* ViewAtBase(size_t index) const { check_index(index); return entries_[index].view; } // Adds |view| to this model. This does not add |view| to a view hierarchy, // only to this model. - void AddUnsafe(View* view, int index); + void AddUnsafe(View* view, size_t index); private: // For access to ViewAtBase(). friend class ViewModelUtils; #if !defined(NDEBUG) - void check_index(int index) const { - DCHECK_LT(index, static_cast<int>(entries_.size())); - DCHECK_GE(index, 0); - } + void check_index(size_t index) const { DCHECK_LT(index, entries_.size()); } #else - void check_index(int index) const {} + void check_index(size_t index) const {} #endif Entries entries_; @@ -118,10 +116,10 @@ // Adds |view| to this model. This does not add |view| to a view hierarchy, // only to this model. - void Add(T* view, int index) { AddUnsafe(view, index); } + void Add(T* view, size_t index) { AddUnsafe(view, index); } // Returns the view at the specified index. - T* view_at(int index) const { return static_cast<T*>(ViewAtBase(index)); } + T* view_at(size_t index) const { return static_cast<T*>(ViewAtBase(index)); } }; // ViewModel is a collection of views with no specfic type. If all views have
diff --git a/ui/views/view_model_unittest.cc b/ui/views/view_model_unittest.cc index a922bfc..169d17b 100644 --- a/ui/views/view_model_unittest.cc +++ b/ui/views/view_model_unittest.cc
@@ -17,7 +17,7 @@ // Returns a string containing the x-coordinate of each of the views in |model|. std::string BoundsString(const ViewModel& model) { std::string result; - for (int i = 0; i < model.view_size(); ++i) { + for (size_t i = 0; i < model.view_size(); ++i) { if (i != 0) result += " "; result += base::NumberToString(model.ideal_bounds(i).x()); @@ -28,7 +28,7 @@ // Returns a string containing the id of each of the views in |model|. std::string ViewIDsString(const ViewModel& model) { std::string result; - for (int i = 0; i < model.view_size(); ++i) { + for (size_t i = 0; i < model.view_size(); ++i) { if (i != 0) result += " "; result += base::NumberToString(model.view_at(i)->GetID()); @@ -42,12 +42,12 @@ View v1; ViewModel model; model.Add(&v1, 0); - EXPECT_EQ(1, model.view_size()); + EXPECT_EQ(1u, model.view_size()); EXPECT_EQ(&v1, model.view_at(0)); gfx::Rect v1_bounds(1, 2, 3, 4); model.set_ideal_bounds(0, v1_bounds); EXPECT_EQ(v1_bounds, model.ideal_bounds(0)); - EXPECT_EQ(0, model.GetIndexOfView(&v1)); + EXPECT_EQ(0u, model.GetIndexOfView(&v1)); } TEST(ViewModel, Move) {
diff --git a/ui/views/view_model_utils.cc b/ui/views/view_model_utils.cc index 8788a7b..3e1a71a 100644 --- a/ui/views/view_model_utils.cc +++ b/ui/views/view_model_utils.cc
@@ -35,25 +35,25 @@ } // static -int ViewModelUtils::DetermineMoveIndex(const ViewModelBase& model, - View* view, - bool is_horizontal, - int x, - int y) { +size_t ViewModelUtils::DetermineMoveIndex(const ViewModelBase& model, + View* view, + bool is_horizontal, + int x, + int y) { const auto& entries = model.entries(); const int value = primary_axis_coordinate(is_horizontal, gfx::Point(x, y)); - DCHECK_NE(-1, model.GetIndexOfView(view)); + DCHECK(model.GetIndexOfView(view).has_value()); auto iter = entries.begin(); for (; iter->view != view; ++iter) { const int mid_point = primary_axis_coordinate( is_horizontal, iter->ideal_bounds.CenterPoint()); if (value < mid_point) - return std::distance(entries.begin(), iter); + return static_cast<size_t>(std::distance(entries.begin(), iter)); } if (std::next(iter) == entries.end()) - return std::distance(entries.begin(), iter); + return static_cast<size_t>(std::distance(entries.begin(), iter)); // For indices after the current index ignore the bounds of the view being // dragged. This keeps the view from bouncing around as moved. @@ -66,7 +66,7 @@ is_horizontal, iter->ideal_bounds.CenterPoint()) - delta; if (value < mid_point) - return std::distance(entries.begin(), iter) - 1; + return static_cast<size_t>(std::distance(entries.begin(), iter)) - 1; } return entries.size() - 1; }
diff --git a/ui/views/view_model_utils.h b/ui/views/view_model_utils.h index af200bc..e33d5ff 100644 --- a/ui/views/view_model_utils.h +++ b/ui/views/view_model_utils.h
@@ -5,6 +5,8 @@ #ifndef UI_VIEWS_VIEW_MODEL_UTILS_H_ #define UI_VIEWS_VIEW_MODEL_UTILS_H_ +#include <stddef.h> + #include "ui/views/views_export.h" namespace views { @@ -25,11 +27,11 @@ static bool IsAtIdealBounds(const ViewModelBase& model); // Returns the index to move |view| to based on a coordinate of |x| and |y|. - static int DetermineMoveIndex(const ViewModelBase& model, - View* view, - bool is_horizontal, - int x, - int y); + static size_t DetermineMoveIndex(const ViewModelBase& model, + View* view, + bool is_horizontal, + int x, + int y); }; } // namespace views
diff --git a/ui/views/view_model_utils_unittest.cc b/ui/views/view_model_utils_unittest.cc index 5b9349e..2895ac9 100644 --- a/ui/views/view_model_utils_unittest.cc +++ b/ui/views/view_model_utils_unittest.cc
@@ -32,30 +32,30 @@ model.set_ideal_bounds(1, gfx::Rect(10, 0, 1000, 10)); model.set_ideal_bounds(2, gfx::Rect(1010, 0, 2, 10)); - EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v1, true, -10, 0)); - EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v1, true, 4, 0)); - EXPECT_EQ(1, ViewModelUtils::DetermineMoveIndex(model, &v1, true, 506, 0)); - EXPECT_EQ(2, ViewModelUtils::DetermineMoveIndex(model, &v1, true, 1010, 0)); - EXPECT_EQ(2, ViewModelUtils::DetermineMoveIndex(model, &v1, true, 2000, 0)); + EXPECT_EQ(0u, ViewModelUtils::DetermineMoveIndex(model, &v1, true, -10, 0)); + EXPECT_EQ(0u, ViewModelUtils::DetermineMoveIndex(model, &v1, true, 4, 0)); + EXPECT_EQ(1u, ViewModelUtils::DetermineMoveIndex(model, &v1, true, 506, 0)); + EXPECT_EQ(2u, ViewModelUtils::DetermineMoveIndex(model, &v1, true, 1010, 0)); + EXPECT_EQ(2u, ViewModelUtils::DetermineMoveIndex(model, &v1, true, 2000, 0)); - EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v2, true, -10, 0)); - EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v2, true, 4, 0)); - EXPECT_EQ(2, ViewModelUtils::DetermineMoveIndex(model, &v2, true, 12, 0)); + EXPECT_EQ(0u, ViewModelUtils::DetermineMoveIndex(model, &v2, true, -10, 0)); + EXPECT_EQ(0u, ViewModelUtils::DetermineMoveIndex(model, &v2, true, 4, 0)); + EXPECT_EQ(2u, ViewModelUtils::DetermineMoveIndex(model, &v2, true, 12, 0)); // Try the same when vertical. model.set_ideal_bounds(0, gfx::Rect(0, 0, 10, 10)); model.set_ideal_bounds(1, gfx::Rect(0, 10, 10, 1000)); model.set_ideal_bounds(2, gfx::Rect(0, 1010, 10, 2)); - EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v1, false, 0, -10)); - EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v1, false, 0, 4)); - EXPECT_EQ(1, ViewModelUtils::DetermineMoveIndex(model, &v1, false, 0, 506)); - EXPECT_EQ(2, ViewModelUtils::DetermineMoveIndex(model, &v1, false, 0, 1010)); - EXPECT_EQ(2, ViewModelUtils::DetermineMoveIndex(model, &v1, false, 0, 2000)); + EXPECT_EQ(0u, ViewModelUtils::DetermineMoveIndex(model, &v1, false, 0, -10)); + EXPECT_EQ(0u, ViewModelUtils::DetermineMoveIndex(model, &v1, false, 0, 4)); + EXPECT_EQ(1u, ViewModelUtils::DetermineMoveIndex(model, &v1, false, 0, 506)); + EXPECT_EQ(2u, ViewModelUtils::DetermineMoveIndex(model, &v1, false, 0, 1010)); + EXPECT_EQ(2u, ViewModelUtils::DetermineMoveIndex(model, &v1, false, 0, 2000)); - EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v2, false, 0, -10)); - EXPECT_EQ(0, ViewModelUtils::DetermineMoveIndex(model, &v2, false, 0, 4)); - EXPECT_EQ(2, ViewModelUtils::DetermineMoveIndex(model, &v2, false, 0, 12)); + EXPECT_EQ(0u, ViewModelUtils::DetermineMoveIndex(model, &v2, false, 0, -10)); + EXPECT_EQ(0u, ViewModelUtils::DetermineMoveIndex(model, &v2, false, 0, 4)); + EXPECT_EQ(2u, ViewModelUtils::DetermineMoveIndex(model, &v2, false, 0, 12)); } } // namespace views
diff --git a/ui/views/widget/widget_delegate.cc b/ui/views/widget/widget_delegate.cc index f3323412..6d58e740 100644 --- a/ui/views/widget/widget_delegate.cc +++ b/ui/views/widget/widget_delegate.cc
@@ -31,11 +31,6 @@ widget, delegate->TransferOwnershipOfContentsView()); } -std::unique_ptr<NonClientFrameView> CreateDefaultNonClientFrameView( - Widget* widget) { - return nullptr; -} - std::unique_ptr<View> CreateDefaultOverlayView() { return nullptr; } @@ -52,8 +47,6 @@ : widget_initialized_callbacks_(std::make_unique<ClosureVector>()), client_view_factory_( base::BindOnce(&CreateDefaultClientView, base::Unretained(this))), - non_client_frame_view_factory_( - base::BindRepeating(&CreateDefaultNonClientFrameView)), overlay_view_factory_(base::BindOnce(&CreateDefaultOverlayView)) {} WidgetDelegate::~WidgetDelegate() { @@ -284,8 +277,7 @@ std::unique_ptr<NonClientFrameView> WidgetDelegate::CreateNonClientFrameView( Widget* widget) { - DCHECK(non_client_frame_view_factory_); - return non_client_frame_view_factory_.Run(widget); + return nullptr; } View* WidgetDelegate::CreateOverlayView() { @@ -431,12 +423,6 @@ client_view_factory_ = std::move(factory); } -void WidgetDelegate::SetNonClientFrameViewFactory( - NonClientFrameViewFactory factory) { - DCHECK(!GetWidget()); - non_client_frame_view_factory_ = std::move(factory); -} - void WidgetDelegate::SetOverlayViewFactory(OverlayViewFactory factory) { DCHECK(!GetWidget()); overlay_view_factory_ = std::move(factory);
diff --git a/ui/views/widget/widget_delegate.h b/ui/views/widget/widget_delegate.h index 8176aa0..431d19f 100644 --- a/ui/views/widget/widget_delegate.h +++ b/ui/views/widget/widget_delegate.h
@@ -41,14 +41,6 @@ base::OnceCallback<std::unique_ptr<ClientView>(Widget*)>; using OverlayViewFactory = base::OnceCallback<std::unique_ptr<View>()>; - // NonClientFrameViewFactory is a RepeatingCallback because the - // NonClientFrameView is rebuilt on Aura platforms when WindowTreeHost - // properties that might affect its appearance change. Rebuilding the entire - // NonClientFrameView is a pretty big hammer for that but it's the one we - // have. - using NonClientFrameViewFactory = - base::RepeatingCallback<std::unique_ptr<NonClientFrameView>(Widget*)>; - struct Params { Params(); ~Params(); @@ -371,7 +363,6 @@ void RegisterDeleteDelegateCallback(base::OnceClosure callback); void SetClientViewFactory(ClientViewFactory factory); - void SetNonClientFrameViewFactory(NonClientFrameViewFactory factory); void SetOverlayViewFactory(OverlayViewFactory factory); // Called to notify the WidgetDelegate of changes to the state of its Widget. @@ -431,7 +422,6 @@ ClosureVector delete_delegate_callbacks_; ClientViewFactory client_view_factory_; - NonClientFrameViewFactory non_client_frame_view_factory_; OverlayViewFactory overlay_view_factory_; };
diff --git a/ui/views/widget/widget_delegate_unittest.cc b/ui/views/widget/widget_delegate_unittest.cc index 7c79bc7..d1b6815 100644 --- a/ui/views/widget/widget_delegate_unittest.cc +++ b/ui/views/widget/widget_delegate_unittest.cc
@@ -72,22 +72,6 @@ EXPECT_EQ(tracker.view(), client.get()); } -TEST_F(WidgetDelegateTest, - NonClientFrameViewFactoryCanReplaceNonClientFrameView) { - ViewTracker tracker; - - auto delegate = std::make_unique<WidgetDelegate>(); - delegate->SetNonClientFrameViewFactory( - base::BindLambdaForTesting([&tracker](Widget* widget) { - auto view = std::make_unique<NonClientFrameView>(); - tracker.SetView(view.get()); - return view; - })); - - auto nonclient = delegate->CreateNonClientFrameView(nullptr); - EXPECT_EQ(tracker.view(), nonclient.get()); -} - TEST_F(WidgetDelegateTest, OverlayViewFactoryCanReplaceOverlayView) { ViewTracker tracker;
diff --git a/ui/webui/resources/cr_components/history_clusters/BUILD.gn b/ui/webui/resources/cr_components/history_clusters/BUILD.gn index cc3758de..1528e25 100644 --- a/ui/webui/resources/cr_components/history_clusters/BUILD.gn +++ b/ui/webui/resources/cr_components/history_clusters/BUILD.gn
@@ -22,6 +22,7 @@ sources = [ "history_clusters.mojom" ] public_deps = [ "//mojo/public/mojom/base", + "//ui/base/mojom", "//url/mojom:url_mojom_gurl", ] webui_module_path = "chrome://resources/cr_components/history_clusters/"
diff --git a/ui/webui/resources/cr_components/history_clusters/clusters.ts b/ui/webui/resources/cr_components/history_clusters/clusters.ts index 1549b2f..3aa60920 100644 --- a/ui/webui/resources/cr_components/history_clusters/clusters.ts +++ b/ui/webui/resources/cr_components/history_clusters/clusters.ts
@@ -68,15 +68,6 @@ static get properties() { return { /** - * Whether the clusters are in the side panel. - */ - inSidePanel: { - type: Boolean, - reflectToAttribute: true, - value: false, - }, - - /** * The current query for which related clusters are requested and shown. */ query: { @@ -122,7 +113,6 @@ // Properties //============================================================================ - inSidePanel: boolean; query: string; private callbackRouter_: PageCallbackRouter; private headerText_: string; @@ -337,7 +327,7 @@ }); this.showSpinner_ = false; - if (this.inSidePanel) { + if (loadTimeData.getBoolean('inSidePanel')) { this.pageHandler_.showSidePanelUI(); } }
diff --git a/ui/webui/resources/cr_components/history_clusters/history_clusters.gni b/ui/webui/resources/cr_components/history_clusters/history_clusters.gni index 9f906b9..e7b7653 100644 --- a/ui/webui/resources/cr_components/history_clusters/history_clusters.gni +++ b/ui/webui/resources/cr_components/history_clusters/history_clusters.gni
@@ -27,7 +27,6 @@ ts_files = _web_component_files + [ "browser_proxy.ts", "metrics_proxy.ts", - "open_window_proxy.ts", "utils.ts", ]
diff --git a/ui/webui/resources/cr_components/history_clusters/history_clusters.mojom b/ui/webui/resources/cr_components/history_clusters/history_clusters.mojom index 88854f4..ed99ee5 100644 --- a/ui/webui/resources/cr_components/history_clusters/history_clusters.mojom +++ b/ui/webui/resources/cr_components/history_clusters/history_clusters.mojom
@@ -5,6 +5,7 @@ module history_clusters.mojom; import "mojo/public/mojom/base/time.mojom"; +import "ui/base/mojom/window_open_disposition.mojom"; import "url/mojom/url.mojom"; // Represents a search query related to a visit to the search results page. @@ -159,6 +160,10 @@ // Browser-side handler for requests from WebUI page. interface PageHandler { + // Opens the history cluster specified by url + OpenHistoryCluster(url.mojom.Url url, + ui.mojom.ClickModifiers click_modifiers); + // The ClustersBrowserProxy singleton calls this when it's first initialized. SetPage(pending_remote<Page> page);
diff --git a/ui/webui/resources/cr_components/history_clusters/open_window_proxy.ts b/ui/webui/resources/cr_components/history_clusters/open_window_proxy.ts deleted file mode 100644 index 24f31b8..0000000 --- a/ui/webui/resources/cr_components/history_clusters/open_window_proxy.ts +++ /dev/null
@@ -1,30 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview This file provides an abstraction layer for Window.open() for - * for mocking in tests. - * TODO(http://crbug.com/1250487): Refactor this file and similar files into - * ui/webui/resources/js/ - */ - -export interface OpenWindowProxy { - open(url: string): void; -} - -export class OpenWindowProxyImpl implements OpenWindowProxy { - open(url: string) { - window.open(url); - } - - static getInstance(): OpenWindowProxy { - return instance || (instance = new OpenWindowProxyImpl()); - } - - static setInstance(obj: OpenWindowProxy) { - instance = obj; - } -} - -let instance: OpenWindowProxy|null = null;
diff --git a/ui/webui/resources/cr_components/history_clusters/search_query.ts b/ui/webui/resources/cr_components/history_clusters/search_query.ts index ba00f45..5e441e1 100644 --- a/ui/webui/resources/cr_components/history_clusters/search_query.ts +++ b/ui/webui/resources/cr_components/history_clusters/search_query.ts
@@ -6,9 +6,9 @@ import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {BrowserProxyImpl} from './browser_proxy.js'; import {RelatedSearchAction, SearchQuery} from './history_clusters.mojom-webui.js'; import {MetricsProxyImpl} from './metrics_proxy.js'; -import {OpenWindowProxyImpl} from './open_window_proxy.js'; import {getTemplate} from './search_query.html.js'; /** @@ -75,7 +75,7 @@ // To record metrics. this.onAuxClick_(); - OpenWindowProxyImpl.getInstance().open(this.searchQuery.url.url); + this.openUrl_(event); } private onKeydown_(e: KeyboardEvent) { @@ -87,7 +87,18 @@ // To record metrics. this.onAuxClick_(); - OpenWindowProxyImpl.getInstance().open(this.searchQuery.url.url); + this.openUrl_(e); + } + + private openUrl_(event: MouseEvent|KeyboardEvent) { + BrowserProxyImpl.getInstance().handler.openHistoryCluster( + this.searchQuery.url, { + middleButton: false, + altKey: event.altKey, + ctrlKey: event.ctrlKey, + metaKey: event.metaKey, + shiftKey: event.shiftKey, + }); } }
diff --git a/ui/webui/resources/cr_components/history_clusters/url_visit.ts b/ui/webui/resources/cr_components/history_clusters/url_visit.ts index 91bd214..9d4302b 100644 --- a/ui/webui/resources/cr_components/history_clusters/url_visit.ts +++ b/ui/webui/resources/cr_components/history_clusters/url_visit.ts
@@ -15,8 +15,8 @@ import {CrLazyRenderElement} from '../../cr_elements/cr_lazy_render/cr_lazy_render.m.js'; import {loadTimeData} from '../../js/load_time_data.m.js'; +import {BrowserProxyImpl} from './browser_proxy.js'; import {Annotation, URLVisit} from './history_clusters.mojom-webui.js'; -import {OpenWindowProxyImpl} from './open_window_proxy.js'; import {getTemplate} from './url_visit.html.js'; import {insertHighlightedTextWithMatchesIntoElement} from './utils.js'; @@ -144,7 +144,7 @@ })); } - private onClick_(event: Event) { + private onClick_(event: MouseEvent) { // Ignore previously handled events. if (event.defaultPrevented) { return; @@ -155,7 +155,7 @@ // To record metrics. this.onAuxClick_(); - OpenWindowProxyImpl.getInstance().open(this.visit.normalizedUrl.url); + this.openUrl_(event); } private onKeydown_(e: KeyboardEvent) { @@ -167,7 +167,7 @@ // To record metrics. this.onAuxClick_(); - OpenWindowProxyImpl.getInstance().open(this.visit.normalizedUrl.url); + this.openUrl_(e); } private onActionMenuButtonClick_(event: Event) { @@ -222,6 +222,17 @@ this.visit.urlForDisplayMatchPositions); return this.visit.urlForDisplay; } + + private openUrl_(event: MouseEvent|KeyboardEvent) { + BrowserProxyImpl.getInstance().handler.openHistoryCluster( + this.visit.normalizedUrl, { + middleButton: false, + altKey: event.altKey, + ctrlKey: event.ctrlKey, + metaKey: event.metaKey, + shiftKey: event.shiftKey, + }); + } } customElements.define(VisitRowElement.is, VisitRowElement);
diff --git a/ui/webui/resources/mojo/BUILD.gn b/ui/webui/resources/mojo/BUILD.gn index be2fcb4f..91ee7830 100644 --- a/ui/webui/resources/mojo/BUILD.gn +++ b/ui/webui/resources/mojo/BUILD.gn
@@ -61,6 +61,12 @@ "//ui/gfx/range/mojom:mojom_js__generator", ] } + + # TODO(abigailbklein): Remove this when ReadAnythingAppController is wired up. + if (!is_android) { + in_files += [ "ui/gfx/mojom/transform.mojom-webui.js" ] + extra_deps += [ "//ui/gfx/mojom:mojom_js__generator" ] + } } # Copy bindings.d.ts file under the same location where other shared Mojo JS