diff --git a/DEPS b/DEPS index a0158ff6..76869eb 100644 --- a/DEPS +++ b/DEPS
@@ -304,11 +304,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'src_internal_revision': '37f52328751db24eeb28788ab1b5bd5efe83c033', + 'src_internal_revision': '5999cbe0580df1964f3cbb1d85a1f14c333ac8f0', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '93912d50850d3f783e2e4dc51bda5667e798dddb', + 'skia_revision': '7045b90f1ef853dc95347501704eed6e5e39b8b5', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -316,7 +316,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': 'df2e7bd7c99e27868947f887355ad11979f6d492', + 'angle_revision': 'a1665d2fc335ef1481c76d4066cb2e22bab83ba7', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -399,7 +399,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '6314cf83ab35394ed50877ac2db3b6d845cb46cf', + 'devtools_frontend_revision': 'dfbfe0429ad85c3d1323f6a597507c137f7106d6', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -427,7 +427,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'quiche_revision': 'ee237e96f18ef123af9992f74645a8a0ce9ef6ef', + 'quiche_revision': 'd3bc5ffc929b0895ae9e16774069a04ae6fe3c58', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ios_webkit # and whatever else without interference from each other. @@ -1004,7 +1004,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - '5581d135e7c2a518da3872aa95fe0d94d259d1bf', + '55acde27d581490cdf12e8877e38f0e9410c1705', 'condition': 'checkout_android and checkout_src_internal', }, @@ -1163,7 +1163,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'wca_lJQ6FRpEyA5uKD90LCn02gX5VM9Z4mniCykiW-AC', + 'version': 'f1Bj3ULRcpJf4oqa2lCfAQvtCeeyVsDq876w4esaoT8C', }, ], 'condition': 'checkout_android', @@ -1460,13 +1460,13 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'af58dae320bbe5b28ff312cca870ecbdb6751763', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '84798693112c7e241d8c560ea6090e5d91a12fa2', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), 'src/third_party/devtools-frontend-internal': { - 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + 'e9acc8fd5e4c24452adb8085b0cefd7fdb1af097', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '90c2de6df6113049ac08d6e40546d81e700ae740', 'condition': 'checkout_src_internal', }, @@ -1930,7 +1930,7 @@ Var('chromium_git') + '/external/github.com/cisco/openh264' + '@' + '09a4f3ec842a8932341b195c5b01e141c8a16eb7', 'src/third_party/openscreen/src': - Var('chromium_git') + '/openscreen' + '@' + '97d0a7fd9e51669930f8376e069599acc1c2de2e', + Var('chromium_git') + '/openscreen' + '@' + 'bb80e497bf91b9e38ff58072e2f4cd04b8f2e14b', 'src/third_party/openxr/src': { 'url': Var('chromium_git') + '/external/github.com/KhronosGroup/OpenXR-SDK' + '@' + '95fe35ffb383710a6e0567e958ead9a3b66e930c', @@ -2120,7 +2120,7 @@ Var('chromium_git') + '/external/github.com/GoogleChromeLabs/text-fragments-polyfill.git' + '@' + 'c036420683f672d685e27415de0a5f5e85bdc23f', 'src/third_party/tflite/src': - Var('chromium_git') + '/external/github.com/tensorflow/tensorflow.git' + '@' + '1187fe26a8a52029b23e0832356989ab44a540c3', + Var('chromium_git') + '/external/github.com/tensorflow/tensorflow.git' + '@' + '6b9a25f438944132acc54ecf2c59af53c10fd6a1', 'src/third_party/turbine': { 'packages': [ @@ -2133,7 +2133,7 @@ 'dep_type': 'cipd', }, - 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@e2486aa9a1f0cb28dfa714232dcd1d0d5ec5dca4', + 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@a5193d466640077b4c0d42a9e9420fc32ccf8855', 'src/third_party/vulkan_memory_allocator': Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + '56300b29fbfcc693ee6609ddad3fdd5b7a449a21', @@ -2173,7 +2173,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '762a3dfb42095c6084da99b630eea6bef9dc1db8', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '16fb7903e546051483720548168cd40cded7a040', + Var('webrtc_git') + '/src.git' + '@' + '95fc15b5a1c2285966854eceb68ea095a4538fd8', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -2198,7 +2198,7 @@ }, 'src/third_party/xnnpack/src': - Var('chromium_git') + '/external/github.com/google/XNNPACK.git' + '@' + 'e73fb4a03f658fd48cc10c8a7cf48fe7eeab9114', + Var('chromium_git') + '/external/github.com/google/XNNPACK.git' + '@' + 'c9f0470750e7c3c71974cdb997aeb2990d2e2137', 'src/tools/page_cycler/acid3': Var('chromium_git') + '/chromium/deps/acid3.git' + '@' + 'a926d0a32e02c4c03ae95bb798e6c780e0e184ba', @@ -4350,7 +4350,7 @@ 'src/components/optimization_guide/internal': { 'url': Var('chrome_git') + '/chrome/components/optimization_guide.git' + '@' + - '005ad665fd92f7a71818f9f97d5a603b46f47eab', + 'e47d902eb037b995eb07330a5fb9e7ecd29d3f23', 'condition': 'checkout_src_internal', }, @@ -4410,7 +4410,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - '907f103a518c8e15bd3cbe6b8b31ec8bbdddb94e', + '26b19279cd7cc0917d6b09746440c1411a0063eb', 'condition': 'checkout_ios and checkout_src_internal', },
diff --git a/android_webview/browser/aw_contents_io_thread_client.cc b/android_webview/browser/aw_contents_io_thread_client.cc index 4d12b8c3..557bb16 100644 --- a/android_webview/browser/aw_contents_io_thread_client.cc +++ b/android_webview/browser/aw_contents_io_thread_client.cc
@@ -169,7 +169,7 @@ HostsAndWeakGlobalRefPair& current_entry = frame_tree_node_to_weak_global_ref_[frame_tree_node_id]; size_t num_erased = current_entry.first.erase(rfh); - DCHECK(num_erased == 1); + DCHECK_EQ(num_erased, 1u); // Only remove this entry from the FrameTreeNodeId map if there are no more // live RenderFrameHosts. if (current_entry.first.empty()) { @@ -185,10 +185,6 @@ RenderFrameHost* new_rfh) { // Handles FrameTree swap, which occurs only in prerender activation. - if (!base::FeatureList::IsEnabled(features::kWebViewPrerender2)) { - return; - } - if (old_rfh == nullptr) { return; }
diff --git a/ash/components/arc/mojom/BUILD.gn b/ash/components/arc/mojom/BUILD.gn index 950c645..ad30d73 100644 --- a/ash/components/arc/mojom/BUILD.gn +++ b/ash/components/arc/mojom/BUILD.gn
@@ -45,6 +45,7 @@ "midis.mojom", "nearby_share.mojom", "net.mojom", + "net_shared.mojom", "obb_mounter.mojom", "pip.mojom", "policy.mojom",
diff --git a/ash/components/arc/mojom/arc_wifi.mojom b/ash/components/arc/mojom/arc_wifi.mojom index c32f5d0d..f18948a 100644 --- a/ash/components/arc/mojom/arc_wifi.mojom +++ b/ash/components/arc/mojom/arc_wifi.mojom
@@ -11,10 +11,45 @@ // Chrome OS. There are several different groups of interactions: // - WiFi RPCs to get/set WiFi enabled state and gets notified when WiFi // enabled state changes. +// - WiFi RPCs to start scan, notify completion of scan and get scan +// results from host. + +// Note: The reason for using int for uint fields such as port is: Mojo uint +// values are byte cast when deserialized in Java, the practical and safe +// solution is to pick the next signed type that includes the whole unsigned +// range of possible values. Otherwise it forces writing error-prone conversion +// code at the entry or exit of mojo data. module arc.mojom; -// Next Method ID: 3 +import "ash/components/arc/mojom/net_shared.mojom"; + +struct WifiScanResult { + // The network SSID encoded as an hexadecimal string. + // The host always uses hex byte string representation which directly comes + // from the driver/chip, so no extra validation needed. Encoding is + // contextual and not specified by the WiFi layer. + string hex_ssid@0; + + // The network BSSID in the format of an Ethernet MAC address. ARC is + // responsibility for validating this field and error handling. + string bssid@1; + + // The frequency of this network, in MHz. + int32 frequency@2; + + // The type of wireless security protocol used by this network. + SecurityType security@3; + + // The current RSSI (Received Signal Strength Indicator) in dBm of this + // network. This is typically between -90 and -20 dBm. Unknown value + // is represented as -32768 dBm (int16 min value). Note that updates for this + // value are not sent to ARC for connected WiFi networks and should be + // considered precise only for scanning results. + int32 rssi@4; +}; + +// Next Method ID: 5 // Mojo interface exposed by the Chrome browser process for WiFi, ARC is the // client. interface ArcWifiHost { @@ -25,9 +60,22 @@ // when the state has been successfully set or WiFi is already in the desired // state. Otherwise, it is false if the state was not set. SetWifiEnabledState@2(bool enabled) => (bool enabled_state); + + // Sends a request to start scan of WiFi APs asynchronously. The request may + // be ignored or coalesced into a prior request if a scanning operation is + // already on-going. + // Note that the client is not aware of the completion of this scan and + // GetScanResults() may retrieve the previous result even after this call. + StartScan@3(); + + // Sends a request to get currently available scan results for WiFi networks. + // The host periodically refreshes the scan results, and this method allows a + // client to obtain the cached last results. In practice scan results will + // always be available by the time that ARC has started. + GetScanResults@4() => (array<WifiScanResult> response); }; -// Next Method ID: 3 +// Next Method ID: 4 // Mojo interface exposed by ARC for WiFi, the Chrome browser process is the // client. interface ArcWifiInstance { @@ -36,4 +84,9 @@ // Notifies ARC of a change in the state of WiFi on the host. WifiEnabledStateChanged@2(bool enabled); + + // Notifies ARC of a WiFi AP scan being completed. This call is not + // necessarily called every time `StartScan()` is called, since `StartScan()` + // might be ignore or coalesced into a prior request. + ScanCompleted@3(); };
diff --git a/ash/components/arc/mojom/net.mojom b/ash/components/arc/mojom/net.mojom index 64570a5f..d8f06e2 100644 --- a/ash/components/arc/mojom/net.mojom +++ b/ash/components/arc/mojom/net.mojom
@@ -13,6 +13,7 @@ module arc.mojom; import "ash/components/arc/mojom/app.mojom"; +import "ash/components/arc/mojom/net_shared.mojom"; import "services/network/public/mojom/ip_address.mojom"; import "url/mojom/url.mojom"; @@ -283,18 +284,6 @@ IPAddressType type; }; -// The subset of wireless security protocols that Android defines in -// android.net.wifi.WifiConfiguration and that can be supported by the -// host. -[Extensible] -enum SecurityType { - NONE, - WEP_PSK, - WEP_8021X, - WPA_PSK, - WPA_EAP, -}; - // Deprecated enum. |is_metered| in NetworkConfiguration should be // used instead. [Extensible]
diff --git a/ash/components/arc/mojom/net_shared.mojom b/ash/components/arc/mojom/net_shared.mojom new file mode 100644 index 0000000..d24f639a --- /dev/null +++ b/ash/components/arc/mojom/net_shared.mojom
@@ -0,0 +1,20 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file includes shared components used by both arc_wifi.mojom and +// net.mojom. + +module arc.mojom; + +// The subset of wireless security protocols that Android defines in +// android.net.wifi.WifiConfiguration and that can be supported by the +// host. +[Extensible] +enum SecurityType { + [Default] NONE, + WEP_PSK, + WEP_8021X, + WPA_PSK, + WPA_EAP, +};
diff --git a/ash/components/arc/net/arc_net_host_impl.h b/ash/components/arc/net/arc_net_host_impl.h index 897d7bb0..6855833 100644 --- a/ash/components/arc/net/arc_net_host_impl.h +++ b/ash/components/arc/net/arc_net_host_impl.h
@@ -6,6 +6,7 @@ #define ASH_COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_ #include <stdint.h> + #include <map> #include <memory> #include <string> @@ -66,6 +67,11 @@ void SetCertManager(std::unique_ptr<CertManager> cert_manager); // Overridden from mojom::NetHost. + + // TODO(b/329552433): Delete get visible networks part in this method after + // pi-arc is removed. + // Deprecated for getting visible networks. ArcWifiHostImpl::GetScanResults() + // should be used. void GetNetworks(mojom::GetNetworksRequestType type, GetNetworksCallback callback) override; // TODO(b/329552433): Delete this method after pi-arc is removed. @@ -75,6 +81,8 @@ // Deprecated. ArcWifiHostImpl::SetWifiEnabledState() should be used. void SetWifiEnabledState(bool is_enabled, SetWifiEnabledStateCallback callback) override; + // TODO(b/329552433): Delete this method after pi-arc is removed. + // Deprecated. ArcWifiHostImpl::StartScan() should be used. void StartScan() override; void CreateNetwork(mojom::WifiConfigurationPtr cfg, CreateNetworkCallback callback) override;
diff --git a/ash/components/arc/net/arc_net_utils.cc b/ash/components/arc/net/arc_net_utils.cc index 293f6f6..deb1c35 100644 --- a/ash/components/arc/net/arc_net_utils.cc +++ b/ash/components/arc/net/arc_net_utils.cc
@@ -6,6 +6,7 @@ #include <netinet/in.h> +#include "ash/components/arc/mojom/arc_wifi.mojom.h" #include "ash/components/arc/mojom/net.mojom-shared.h" #include "ash/components/arc/mojom/net.mojom.h" #include "base/containers/map_util.h" @@ -301,6 +302,17 @@ } } +arc::mojom::WifiScanResultPtr NetworkStateToWifiScanResult( + const ash::NetworkState& network_state) { + auto mojo = arc::mojom::WifiScanResult::New(); + mojo->bssid = network_state.bssid(); + mojo->hex_ssid = network_state.GetHexSsid(); + mojo->security = TranslateWiFiSecurity(network_state.security_class()); + mojo->frequency = network_state.frequency(); + mojo->rssi = network_state.rssi(); + return mojo; +} + void FillConfigurationsFromDevice(const patchpanel::NetworkDevice& device, arc::mojom::NetworkConfiguration* mojo) { mojo->network_interface = device.phys_ifname(); @@ -615,6 +627,20 @@ return networks; } +std::vector<arc::mojom::WifiScanResultPtr> TranslateScanResults( + const ash::NetworkStateHandler::NetworkStateList& network_states) { + std::vector<arc::mojom::WifiScanResultPtr> results; + for (const ash::NetworkState* const state : network_states) { + if (state->GetNetworkTechnologyType() != + ash::NetworkState::NetworkTechnologyType::kWiFi) { + continue; + } + + results.push_back(NetworkStateToWifiScanResult(*state)); + } + return results; +} + base::Value::List TranslateSubjectNameMatchListToValue( const std::vector<std::string>& string_list) { base::Value::List result;
diff --git a/ash/components/arc/net/arc_net_utils.h b/ash/components/arc/net/arc_net_utils.h index a2dc1fa..2a36e4a 100644 --- a/ash/components/arc/net/arc_net_utils.h +++ b/ash/components/arc/net/arc_net_utils.h
@@ -12,6 +12,7 @@ #include <string> #include <vector> +#include "ash/components/arc/mojom/arc_wifi.mojom.h" #include "ash/components/arc/mojom/net.mojom.h" #include "base/values.h" #include "chromeos/ash/components/dbus/patchpanel/patchpanel_service.pb.h" @@ -69,6 +70,12 @@ const ash::NetworkStateHandler::NetworkStateList& network_states, const std::map<std::string, base::Value::Dict>& shill_network_properties); +// Translates a vector of NetworkStates to a vector of ScanResults. +// For each state, fill the fields in ScanResult. +// TODO(b/329552433): Move this method to a separate util file for WiFi. +std::vector<arc::mojom::WifiScanResultPtr> TranslateScanResults( + const ash::NetworkStateHandler::NetworkStateList& network_states); + // Translates a vector of NetworkDevices to a vector of NetworkConfigurations. // For each device, fill the fields in NetworkConfiguration. For each active // state, the corresponding fields of the associated device is added. A state
diff --git a/ash/components/arc/net/arc_net_utils_unittest.cc b/ash/components/arc/net/arc_net_utils_unittest.cc index 745d1fdf..8712a70 100644 --- a/ash/components/arc/net/arc_net_utils_unittest.cc +++ b/ash/components/arc/net/arc_net_utils_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include <string> +#include "ash/components/arc/mojom/arc_wifi.mojom.h" #include "base/test/task_environment.h" #include "chromeos/ash/components/network/device_state.h" #include "chromeos/ash/components/network/network_state_test_helper.h" @@ -531,5 +532,20 @@ SocketConnectionEvent_IpProtocol_TCP, msg->proto()); } + +TEST_F(ArcNetUtilsTest, TranslateScanResults) { + ash::NetworkStateHandler::NetworkStateList network_states; + network_states.push_back(GetNetworkState()); + std::vector<arc::mojom::WifiScanResultPtr> res = + net_utils::TranslateScanResults(network_states); + base::RunLoop().RunUntilIdle(); + + EXPECT_EQ(1u, res.size()); + EXPECT_EQ(kBssid, res[0]->bssid); + EXPECT_EQ(kHexSsid, res[0]->hex_ssid); + EXPECT_EQ(arc::mojom::SecurityType::WPA_PSK, res[0]->security); + EXPECT_EQ(kFrequency, res[0]->frequency); + EXPECT_EQ(kRssi, res[0]->rssi); +} } // namespace } // namespace arc
diff --git a/ash/components/arc/net/arc_wifi_host_impl.cc b/ash/components/arc/net/arc_wifi_host_impl.cc index 782c5c43..0578cbac 100644 --- a/ash/components/arc/net/arc_wifi_host_impl.cc +++ b/ash/components/arc/net/arc_wifi_host_impl.cc
@@ -5,15 +5,18 @@ #include "ash/components/arc/net/arc_wifi_host_impl.h" #include "ash/components/arc/arc_browser_context_keyed_service_factory_base.h" +#include "ash/components/arc/net/arc_net_utils.h" #include "ash/components/arc/session/arc_bridge_service.h" #include "base/memory/singleton.h" #include "chromeos/ash/components/network/network_event_log.h" #include "chromeos/ash/components/network/network_handler.h" #include "chromeos/ash/components/network/network_state_handler.h" #include "chromeos/ash/components/network/network_type_pattern.h" +#include "chromeos/ash/components/network/onc/network_onc_utils.h" #include "chromeos/ash/components/network/technology_state_controller.h" namespace { +constexpr int kGetScanResultsListLimit = 100; ash::NetworkStateHandler* GetStateHandler() { return ash::NetworkHandler::Get()->network_state_handler(); @@ -116,4 +119,20 @@ std::move(callback).Run(true); } +void ArcWifiHostImpl::StartScan() { + GetStateHandler()->RequestScan(ash::NetworkTypePattern::WiFi()); +} + +void ArcWifiHostImpl::GetScanResults(GetScanResultsCallback callback) { + ash::NetworkTypePattern network_pattern = + ash::onc::NetworkTypePatternFromOncType(onc::network_type::kWiFi); + + ash::NetworkStateHandler::NetworkStateList network_states; + GetStateHandler()->GetNetworkListByType( + network_pattern, /*configured_only=*/false, /*visible_only=*/true, + kGetScanResultsListLimit, &network_states); + + std::move(callback).Run(net_utils::TranslateScanResults(network_states)); +} + } // namespace arc
diff --git a/ash/components/arc/net/arc_wifi_host_impl.h b/ash/components/arc/net/arc_wifi_host_impl.h index cd09a006..6ac66a5 100644 --- a/ash/components/arc/net/arc_wifi_host_impl.h +++ b/ash/components/arc/net/arc_wifi_host_impl.h
@@ -44,6 +44,8 @@ void GetWifiEnabledState(GetWifiEnabledStateCallback callback) override; void SetWifiEnabledState(bool is_enabled, SetWifiEnabledStateCallback callback) override; + void StartScan() override; + void GetScanResults(GetScanResultsCallback callback) override; static void EnsureFactoryBuilt();
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index c5eab10..6cb122fd 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -101,11 +101,6 @@ "AltClickAndSixPackCustomization", base::FEATURE_ENABLED_BY_DEFAULT); -// Controls whether to enable AutoEnrollment for Kiosk in OOBE -BASE_FEATURE(kAutoEnrollmentKioskInOobe, - "AutoEnrollmentKioskInOobe", - base::FEATURE_ENABLED_BY_DEFAULT); - // Controls whether to allow Dev channel to use Prod server feature. BASE_FEATURE(kAmbientModeDevUseProdFeature, "ChromeOSAmbientModeDevChannelUseProdServer", @@ -818,11 +813,6 @@ "EnableOobeChromeVoxHint", base::FEATURE_ENABLED_BY_DEFAULT); -// Enables Kiosk enrollment option in OOBE. -BASE_FEATURE(kEnableKioskEnrollmentInOobe, - "EnableKioskEnrollmentInOobe", - base::FEATURE_ENABLED_BY_DEFAULT); - // Enables Kiosk UI in Login screen. BASE_FEATURE(kEnableKioskLoginScreen, "EnableKioskLoginScreen", @@ -1832,11 +1822,6 @@ "FeatureManagementLocalImageSearch", base::FEATURE_DISABLED_BY_DEFAULT); -// Enables new flow for license packaged devices with enterprise license. -BASE_FEATURE(kLicensePackagedOobeFlow, - "LicensePackagedOobeFlow", - base::FEATURE_ENABLED_BY_DEFAULT); - // Enables cross device supported reports within the feedback tool. // (This feature is only available for dogfooders) BASE_FEATURE(kLinkCrossDeviceDogfoodFeedback, @@ -1867,11 +1852,6 @@ "LockScreenInlineReply", base::FEATURE_DISABLED_BY_DEFAULT); -// Enables new flow for Education license packaged devices. -BASE_FEATURE(kEducationEnrollmentOobeFlow, - "EducationEnrollmentOobeFlow", - base::FEATURE_ENABLED_BY_DEFAULT); - // Enables notifications on the lock screen. BASE_FEATURE(kLockScreenNotifications, "LockScreenNotifications", @@ -3207,10 +3187,6 @@ return base::FeatureList::IsEnabled(kAudioSelectionImprovement); } -bool IsAutoEnrollmentKioskInOobeEnabled() { - return base::FeatureList::IsEnabled(kAutoEnrollmentKioskInOobe); -} - bool Is16DesksEnabled() { return base::FeatureList::IsEnabled(kFeatureManagement16Desks); } @@ -3917,10 +3893,6 @@ base::FeatureList::IsEnabled(kFeatureManagementLocalImageSearch); } -bool IsLicensePackagedOobeFlowEnabled() { - return base::FeatureList::IsEnabled(kLicensePackagedOobeFlow); -} - bool IsLinkCrossDeviceDogfoodFeedbackEnabled() { return base::FeatureList::IsEnabled(kLinkCrossDeviceDogfoodFeedback); } @@ -3946,10 +3918,6 @@ kLockScreenHideSensitiveNotificationsSupport); } -bool IsEducationEnrollmentOobeFlowEnabled() { - return base::FeatureList::IsEnabled(kEducationEnrollmentOobeFlow); -} - bool IsGameDashboardEnabled() { return base::FeatureList::IsEnabled(kGameDashboard); } @@ -4085,10 +4053,6 @@ return base::FeatureList::IsEnabled(kOobeGaiaInfoScreen); } -bool IsKioskEnrollmentInOobeEnabled() { - return base::FeatureList::IsEnabled(kEnableKioskEnrollmentInOobe); -} - bool IsKioskLoginScreenEnabled() { return base::FeatureList::IsEnabled(kEnableKioskLoginScreen); }
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index 13f11d0..8428799 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -259,8 +259,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kEnableLocalSearchService); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kEnableOAuthIpp); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kEnableOobeChromeVoxHint); -COMPONENT_EXPORT(ASH_CONSTANTS) -BASE_DECLARE_FEATURE(kEnableKioskEnrollmentInOobe); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kEnableKioskLoginScreen); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kEnableSamlNotificationOnPasswordChangeSuccess); @@ -546,8 +544,6 @@ BASE_DECLARE_FEATURE(kKerberosRememberPasswordByDefault); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kKioskEnableImeButton); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kKioskEnableSystemWebApps); -COMPONENT_EXPORT(ASH_CONSTANTS) -BASE_DECLARE_FEATURE(kAutoEnrollmentKioskInOobe); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kLacrosWaylandLogging); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kLacrosProfileBackwardMigration); @@ -571,7 +567,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kLauncherSearchControl); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kFeatureManagementLocalImageSearch); -COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kLicensePackagedOobeFlow); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kLinkCrossDeviceDogfoodFeedback); COMPONENT_EXPORT(ASH_CONSTANTS) @@ -585,8 +580,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kMacAddressRandomization); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kMediaAppPdfA11yOcr); -COMPONENT_EXPORT(ASH_CONSTANTS) -BASE_DECLARE_FEATURE(kEducationEnrollmentOobeFlow); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kMinimumChromeVersion); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kModifierSplit); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kModifierSplitDogfood); @@ -947,7 +940,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool ArePromiseIconsForWebAppsEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool AreSideAlignedToastsEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool ForceOnDeviceAppControlsForAllRegions(); -COMPONENT_EXPORT(ASH_CONSTANTS) bool IsAutoEnrollmentKioskInOobeEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool AreImprovedScreenCaptureSettingsEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool Is16DesksEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsAdaptiveChargingEnabled(); @@ -1161,7 +1153,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsLauncherNudgeShortIntervalEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsLauncherNudgeSessionResetEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsLauncherSearchControlEnabled(); -COMPONENT_EXPORT(ASH_CONSTANTS) bool IsLicensePackagedOobeFlowEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsLinkCrossDeviceDogfoodFeedbackEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsLinkCrossDeviceInternalsEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool AreLocalPasswordsEnabledForConsumers(); @@ -1179,7 +1170,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsNearbyPresenceEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsNotificationLimitEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsNotifierCollisionEnabled(); -COMPONENT_EXPORT(ASH_CONSTANTS) bool IsEducationEnrollmentOobeFlowEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsEnrollmentNudgingForTestingEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsNewLockScreenReauthLayoutEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsSysUiDownloadsIntegrationV2Enabled(); @@ -1207,7 +1197,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsOobePersonalizedOnboardingEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsOobeSoftwareUpdateEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsOobeTunaEnabled(); -COMPONENT_EXPORT(ASH_CONSTANTS) bool IsKioskEnrollmentInOobeEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsKioskLoginScreenEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsDeprecateOldKeyboardShortcutsAcceleratorEnabled();
diff --git a/ash/picker/picker_controller.cc b/ash/picker/picker_controller.cc index dc7828d1..33f3e740 100644 --- a/ash/picker/picker_controller.cc +++ b/ash/picker/picker_controller.cc
@@ -361,7 +361,7 @@ : model_->GetAvailableCategories(); } -bool PickerController::ShouldShowSuggestedResults() { +bool PickerController::ShouldShowRecentResults() { return model_ && !model_->HasSelectedText(); }
diff --git a/ash/picker/picker_controller.h b/ash/picker/picker_controller.h index 8de48ee..e811d92e 100644 --- a/ash/picker/picker_controller.h +++ b/ash/picker/picker_controller.h
@@ -75,7 +75,7 @@ // PickerViewDelegate: std::vector<PickerCategory> GetAvailableCategories() override; - bool ShouldShowSuggestedResults() override; + bool ShouldShowRecentResults() override; void GetResultsForCategory(PickerCategory category, SearchResultsCallback callback) override; void TransformSelectedText(PickerCategory category) override;
diff --git a/ash/picker/views/picker_view.cc b/ash/picker/views/picker_view.cc index a57dfc3..e2c42a0 100644 --- a/ash/picker/views/picker_view.cc +++ b/ash/picker/views/picker_view.cc
@@ -205,8 +205,7 @@ SelectCategory(category); } -void PickerView::SelectSuggestedZeroStateResult( - const PickerSearchResult& result) { +void PickerView::SelectZeroStateResult(const PickerSearchResult& result) { SelectSearchResult(result); } @@ -398,7 +397,7 @@ zero_state_view_ = contents_view_->AddPage(std::make_unique<PickerZeroStateView>( this, delegate_->GetAvailableCategories(), - delegate_->ShouldShowSuggestedResults(), kMaxSize.width())); + delegate_->ShouldShowRecentResults(), kMaxSize.width())); category_view_ = contents_view_->AddPage(std::make_unique<PickerCategoryView>( this, kMaxSize.width(), delegate_->GetAssetFetcher()));
diff --git a/ash/picker/views/picker_view.h b/ash/picker/views/picker_view.h index cea6dac..bbc6ddf4 100644 --- a/ash/picker/views/picker_view.h +++ b/ash/picker/views/picker_view.h
@@ -72,8 +72,7 @@ // PickerZeroStateViewDelegate: void SelectZeroStateCategory(PickerCategory category) override; - void SelectSuggestedZeroStateResult( - const PickerSearchResult& result) override; + void SelectZeroStateResult(const PickerSearchResult& result) override; void GetSuggestedZeroStateEditorResults( SuggestedEditorResultsCallback callback) override; void NotifyPseudoFocusChanged(views::View* view) override;
diff --git a/ash/picker/views/picker_view_delegate.h b/ash/picker/views/picker_view_delegate.h index e549267f..c269d38c 100644 --- a/ash/picker/views/picker_view_delegate.h +++ b/ash/picker/views/picker_view_delegate.h
@@ -33,7 +33,7 @@ virtual std::vector<PickerCategory> GetAvailableCategories() = 0; // Returns whether we should show suggested results in zero state view. - virtual bool ShouldShowSuggestedResults() = 0; + virtual bool ShouldShowRecentResults() = 0; // Gets initially suggested results for category. Results will be returned via // `callback`, which may be called multiples times to update the results.
diff --git a/ash/picker/views/picker_view_unittest.cc b/ash/picker/views/picker_view_unittest.cc index 54dbed9..5847477 100644 --- a/ash/picker/views/picker_view_unittest.cc +++ b/ash/picker/views/picker_view_unittest.cc
@@ -115,7 +115,7 @@ requested_case_transformation_category_ = category; } - bool ShouldShowSuggestedResults() override { return true; } + bool ShouldShowRecentResults() override { return true; } void GetResultsForCategory(PickerCategory category, SearchResultsCallback callback) override {
diff --git a/ash/picker/views/picker_widget_unittest.cc b/ash/picker/views/picker_widget_unittest.cc index f7533e6..3740cfd7 100644 --- a/ash/picker/views/picker_widget_unittest.cc +++ b/ash/picker/views/picker_widget_unittest.cc
@@ -32,7 +32,7 @@ public: // PickerViewDelegate: std::vector<PickerCategory> GetAvailableCategories() override { return {}; } - bool ShouldShowSuggestedResults() override { return false; } + bool ShouldShowRecentResults() override { return false; } void GetResultsForCategory(PickerCategory category, SearchResultsCallback callback) override {} void TransformSelectedText(PickerCategory category) override {}
diff --git a/ash/picker/views/picker_zero_state_view.cc b/ash/picker/views/picker_zero_state_view.cc index 53670ff..278d4dc 100644 --- a/ash/picker/views/picker_zero_state_view.cc +++ b/ash/picker/views/picker_zero_state_view.cc
@@ -94,7 +94,7 @@ PickerZeroStateView::PickerZeroStateView( PickerZeroStateViewDelegate* delegate, base::span<const PickerCategory> available_categories, - bool show_suggested_results, + bool show_recent_results, int picker_view_width) : delegate_(delegate) { SetLayoutManager(std::make_unique<views::FlexLayout>()) @@ -103,10 +103,10 @@ section_list_view_ = AddChildView(std::make_unique<PickerSectionListView>(picker_view_width)); - if (show_suggested_results) { + if (show_recent_results) { clipboard_provider_ = std::make_unique<PickerClipboardProvider>(); clipboard_provider_->FetchResults( - base::BindRepeating(&PickerZeroStateView::OnFetchSuggestedResults, + base::BindRepeating(&PickerZeroStateView::OnFetchRecentResults, weak_ptr_factory_.GetWeakPtr()), u"", kClipboardRecency); } @@ -269,9 +269,8 @@ delegate_->SelectZeroStateCategory(category); } -void PickerZeroStateView::OnSuggestedResultSelected( - const PickerSearchResult& result) { - delegate_->SelectSuggestedZeroStateResult(result); +void PickerZeroStateView::OnResultSelected(const PickerSearchResult& result) { + delegate_->SelectZeroStateResult(result); } void PickerZeroStateView::SetPseudoFocusedView(views::View* view) { @@ -312,23 +311,23 @@ } } -void PickerZeroStateView::OnFetchSuggestedResults( +void PickerZeroStateView::OnFetchRecentResults( std::vector<PickerSearchResult> results) { if (results.empty()) { return; } - if (!suggested_section_view_) { - suggested_section_view_ = section_list_view_->AddSectionAt(0); - suggested_section_view_->AddTitleLabel( - l10n_util::GetStringUTF16(IDS_PICKER_SUGGESTED_SECTION_TITLE)); + if (!recent_section_view_) { + recent_section_view_ = section_list_view_->AddSectionAt(0); + recent_section_view_->AddTitleLabel( + GetSectionTitleForPickerSectionType(PickerSectionType::kRecentlyUsed)); } for (const auto& result : results) { if (std::unique_ptr<PickerListItemView> item_view = CreateListItemViewForSearchResult( - result, base::BindRepeating( - &PickerZeroStateView::OnSuggestedResultSelected, - weak_ptr_factory_.GetWeakPtr(), result))) { - suggested_section_view_->AddListItem(std::move(item_view)); + result, + base::BindRepeating(&PickerZeroStateView::OnResultSelected, + weak_ptr_factory_.GetWeakPtr(), result))) { + recent_section_view_->AddListItem(std::move(item_view)); } } SetPseudoFocusedView(section_list_view_->GetTopItem()); @@ -348,7 +347,7 @@ CHECK(editor_data); auto item_view = std::make_unique<PickerListItemView>( - base::BindRepeating(&PickerZeroStateView::OnSuggestedResultSelected, + base::BindRepeating(&PickerZeroStateView::OnResultSelected, weak_ptr_factory_.GetWeakPtr(), result)); item_view->SetPrimaryText(editor_data->display_name); if (editor_data->category.has_value()) {
diff --git a/ash/picker/views/picker_zero_state_view.h b/ash/picker/views/picker_zero_state_view.h index 24ab4f2..a39e648 100644 --- a/ash/picker/views/picker_zero_state_view.h +++ b/ash/picker/views/picker_zero_state_view.h
@@ -57,13 +57,13 @@ return section_views_; } - PickerSectionView* SuggestedSectionForTesting() const { - return suggested_section_view_; + PickerSectionView* RecentSectionForTesting() const { + return recent_section_view_; } private: void OnCategorySelected(PickerCategory category); - void OnSuggestedResultSelected(const PickerSearchResult& result); + void OnResultSelected(const PickerSearchResult& result); // Gets or creates the section to contain `category`. PickerSectionView* GetOrCreateSectionView(PickerCategory category); @@ -72,7 +72,7 @@ void ScrollPseudoFocusedViewToVisible(); - void OnFetchSuggestedResults(std::vector<PickerSearchResult> result); + void OnFetchRecentResults(std::vector<PickerSearchResult> result); void OnFetchZeroStateEditorResults(PickerCategory category, std::vector<PickerSearchResult> result); @@ -89,7 +89,7 @@ // trigger `DoPseudoFocusedAction`. raw_ptr<views::View> pseudo_focused_view_ = nullptr; - raw_ptr<PickerSectionView> suggested_section_view_ = nullptr; + raw_ptr<PickerSectionView> recent_section_view_ = nullptr; std::unique_ptr<PickerClipboardProvider> clipboard_provider_; base::WeakPtrFactory<PickerZeroStateView> weak_ptr_factory_{this};
diff --git a/ash/picker/views/picker_zero_state_view_delegate.h b/ash/picker/views/picker_zero_state_view_delegate.h index 5fcec6f..134e7660 100644 --- a/ash/picker/views/picker_zero_state_view_delegate.h +++ b/ash/picker/views/picker_zero_state_view_delegate.h
@@ -24,8 +24,7 @@ virtual void SelectZeroStateCategory(PickerCategory category) = 0; - virtual void SelectSuggestedZeroStateResult( - const PickerSearchResult& result) = 0; + virtual void SelectZeroStateResult(const PickerSearchResult& result) = 0; virtual void GetSuggestedZeroStateEditorResults( SuggestedEditorResultsCallback callback) = 0;
diff --git a/ash/picker/views/picker_zero_state_view_unittest.cc b/ash/picker/views/picker_zero_state_view_unittest.cc index 572c3ef..f7c7fd0 100644 --- a/ash/picker/views/picker_zero_state_view_unittest.cc +++ b/ash/picker/views/picker_zero_state_view_unittest.cc
@@ -71,7 +71,7 @@ public: MOCK_METHOD(void, SelectZeroStateCategory, (PickerCategory), (override)); MOCK_METHOD(void, - SelectSuggestedZeroStateResult, + SelectZeroStateResult, (const PickerSearchResult&), (override)); MOCK_METHOD(void, @@ -95,7 +95,7 @@ Key(PickerCategoryType::kEditorRewrite), Key(PickerCategoryType::kGeneral), Key(PickerCategoryType::kCalculations))); - EXPECT_THAT(view.SuggestedSectionForTesting(), IsNull()); + EXPECT_THAT(view.RecentSectionForTesting(), IsNull()); } TEST_F(PickerZeroStateViewTest, LeftClickSelectsCategory) { @@ -150,7 +150,7 @@ EXPECT_CALL( mock_delegate, - SelectSuggestedZeroStateResult(Property( + SelectZeroStateResult(Property( "data", &ash::PickerSearchResult::data, VariantWith<ash::PickerSearchResult::ClipboardData>(AllOf( Field("item_id", &ash::PickerSearchResult::ClipboardData::item_id, @@ -163,14 +163,14 @@ u"test")))))) .Times(1); - ASSERT_THAT(view->SuggestedSectionForTesting(), Not(IsNull())); + ASSERT_THAT(view->RecentSectionForTesting(), Not(IsNull())); PickerItemView* item_view = - view->SuggestedSectionForTesting()->item_views_for_testing()[0]; + view->RecentSectionForTesting()->item_views_for_testing()[0]; ViewDrawnWaiter().Wait(item_view); LeftClickOn(*item_view); } -TEST_F(PickerZeroStateViewTest, HidesSuggestedSectionWhenNoItemsToDisplay) { +TEST_F(PickerZeroStateViewTest, HidesRecentSectionWhenNoItemsToDisplay) { testing::StrictMock<MockClipboardHistoryController> mock_clipboard; EXPECT_CALL(mock_clipboard, GetHistoryValues) .WillOnce( @@ -185,7 +185,7 @@ &mock_delegate, kAllCategories, true, kPickerWidth)); widget->Show(); - EXPECT_THAT(view->SuggestedSectionForTesting(), IsNull()); + EXPECT_THAT(view->RecentSectionForTesting(), IsNull()); } TEST_F(PickerZeroStateViewTest, DoesntShowClipboardItems) { @@ -196,7 +196,7 @@ &mock_delegate, kAllCategories, false, kPickerWidth)); widget->Show(); - EXPECT_THAT(view->SuggestedSectionForTesting(), IsNull()); + EXPECT_THAT(view->RecentSectionForTesting(), IsNull()); } TEST_F(PickerZeroStateViewTest,
diff --git a/ash/system/input_device_settings/input_device_settings_metrics_manager.cc b/ash/system/input_device_settings/input_device_settings_metrics_manager.cc index 9b18d6d..6f6990d 100644 --- a/ash/system/input_device_settings/input_device_settings_metrics_manager.cc +++ b/ash/system/input_device_settings/input_device_settings_metrics_manager.cc
@@ -447,60 +447,6 @@ return *iter; } -uint32_t CountNumberOfDevicesUsedInLast28Days(std::string_view pref_name) { - constexpr base::TimeDelta k28Days = base::Days(28); - - PrefService* pref_service = - Shell::Get()->session_controller()->GetActivePrefService(); - CHECK(pref_service); - - uint32_t num_devices_used = 0; - const base::Value::Dict& devices_dict = pref_service->GetDict(pref_name); - for (const auto device_entry : devices_dict) { - const auto* device = device_entry.second.GetIfDict(); - if (!device) { - continue; - } - - const auto* last_updated_value = device->Find(prefs::kLastUpdatedKey); - if (!last_updated_value) { - continue; - } - - const auto last_updated_time = base::ValueToTime(*last_updated_value); - if (!last_updated_time) { - continue; - } - - if (base::Time::Now() - *last_updated_time <= k28Days) { - num_devices_used++; - } - } - - return num_devices_used; -} - -void RecordNumberOfMiceUsedInLast28Days() { - base::UmaHistogramCounts100( - "ChromeOS.Settings.Device.Mouse.External.NumConnectedLast28Days", - CountNumberOfDevicesUsedInLast28Days( - prefs::kMouseDeviceSettingsDictPref)); -} - -void RecordNumberOfKeyboardsUsedInLast28Days() { - base::UmaHistogramCounts100( - "ChromeOS.Settings.Device.Keyboard.External.NumConnectedLast28Days", - CountNumberOfDevicesUsedInLast28Days( - prefs::kKeyboardDeviceSettingsDictPref)); -} - -void RecordNumberOfTouchpadsUsedInLast28Days() { - base::UmaHistogramCounts100( - "ChromeOS.Settings.Device.Touchpad.External.NumConnectedLast28Days", - CountNumberOfDevicesUsedInLast28Days( - prefs::kTouchpadDeviceSettingsDictPref)); -} - } // namespace InputDeviceSettingsMetricsManager::InputDeviceSettingsMetricsManager() = @@ -510,12 +456,6 @@ void InputDeviceSettingsMetricsManager::RecordKeyboardInitialMetrics( const mojom::Keyboard& keyboard) { - // Record this metric every time a mouse is plugged/unplugged to account for - // if a user session lasts for >28 days. - if (keyboard.is_external) { - RecordNumberOfKeyboardsUsedInLast28Days(); - } - // Only record the metrics once for each keyboard. const auto account_id = Shell::Get()->session_controller()->GetActiveAccountId(); @@ -680,10 +620,6 @@ void InputDeviceSettingsMetricsManager::RecordMouseInitialMetrics( const mojom::Mouse& mouse) { - // Record this metric every time a mouse is plugged/unplugged to account for - // if a user session lasts for >28 days. - RecordNumberOfMiceUsedInLast28Days(); - // Only record the metrics once for each mouse. const auto account_id = Shell::Get()->session_controller()->GetActiveAccountId(); @@ -862,12 +798,6 @@ void InputDeviceSettingsMetricsManager::RecordTouchpadInitialMetrics( const mojom::Touchpad& touchpad) { - // Record this metric every time a mouse is plugged/unplugged to account for - // if a user session lasts for >28 days. - if (touchpad.is_external) { - RecordNumberOfTouchpadsUsedInLast28Days(); - } - // Only record the metrics once for each Touchpad. const auto account_id = Shell::Get()->session_controller()->GetActiveAccountId();
diff --git a/ash/system/input_device_settings/input_device_settings_metrics_manager_unittest.cc b/ash/system/input_device_settings/input_device_settings_metrics_manager_unittest.cc index 0a8f762..e024dac5 100644 --- a/ash/system/input_device_settings/input_device_settings_metrics_manager_unittest.cc +++ b/ash/system/input_device_settings/input_device_settings_metrics_manager_unittest.cc
@@ -17,13 +17,10 @@ #include "ash/system/input_device_settings/input_device_settings_pref_names.h" #include "ash/system/input_device_settings/settings_updated_metrics_info.h" #include "ash/test/ash_test_base.h" -#include "base/json/values_util.h" #include "base/strings/strcat.h" -#include "base/strings/string_number_conversions.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/time/time.h" -#include "base/values.h" #include "device/udev_linux/fake_udev_loader.h" #include "ui/base/ui_base_features.h" #include "ui/events/ash/mojom/extended_fkeys_modifier.mojom-shared.h" @@ -1291,121 +1288,6 @@ /*expected_count=*/1u); } -TEST_F(InputDeviceSettingsMetricsManagerTest, RecordNumMiceUsedInLast28Days) { - mojom::Mouse mouse; - mouse.device_key = kExternalMouseId; - mouse.settings = mojom::MouseSettings::New(); - - base::Value::Dict test_pref_dict; - - // Add 5 devices in the window we care about. - for (int i = 1; i <= 5; i++) { - base::Value::Dict device_dict; - device_dict.Set(prefs::kLastUpdatedKey, - base::TimeToValue(base::Time::Now() - base::Days(4 * i))); - test_pref_dict.Set("in_window_" + base::NumberToString(i), - std::move(device_dict)); - } - - // Add a device that is outside the window we want to measure. - { - base::Value::Dict device_dict; - device_dict.Set(prefs::kLastUpdatedKey, - base::TimeToValue(base::Time::Now() - base::Days(29))); - test_pref_dict.Set("out_of_window", std::move(device_dict)); - } - - PrefService* pref_service = - Shell::Get()->session_controller()->GetActivePrefService(); - pref_service->SetDict(prefs::kMouseDeviceSettingsDictPref, - std::move(test_pref_dict)); - - base::HistogramTester histogram_tester; - - manager_->RecordMouseInitialMetrics(mouse); - histogram_tester.ExpectUniqueSample( - "ChromeOS.Settings.Device.Mouse.External.NumConnectedLast28Days", 5, 1); -} - -TEST_F(InputDeviceSettingsMetricsManagerTest, - RecordNumKeyboardsUsedInLast28Days) { - mojom::Keyboard keyboard; - keyboard.device_key = kExternalMouseId; - keyboard.is_external = true; - keyboard.settings = mojom::KeyboardSettings::New(); - keyboard.settings->six_pack_key_remappings = mojom::SixPackKeyInfo::New(); - - base::Value::Dict test_pref_dict; - - // Add 5 devices in the window we care about. - for (int i = 1; i <= 5; i++) { - base::Value::Dict device_dict; - device_dict.Set(prefs::kLastUpdatedKey, - base::TimeToValue(base::Time::Now() - base::Days(4 * i))); - test_pref_dict.Set("in_window_" + base::NumberToString(i), - std::move(device_dict)); - } - - // Add a device that is outside the window we want to measure. - { - base::Value::Dict device_dict; - device_dict.Set(prefs::kLastUpdatedKey, - base::TimeToValue(base::Time::Now() - base::Days(29))); - test_pref_dict.Set("out_of_window", std::move(device_dict)); - } - - PrefService* pref_service = - Shell::Get()->session_controller()->GetActivePrefService(); - pref_service->SetDict(prefs::kKeyboardDeviceSettingsDictPref, - std::move(test_pref_dict)); - - base::HistogramTester histogram_tester; - - manager_->RecordKeyboardInitialMetrics(keyboard); - histogram_tester.ExpectUniqueSample( - "ChromeOS.Settings.Device.Keyboard.External.NumConnectedLast28Days", 5, - 1); -} - -TEST_F(InputDeviceSettingsMetricsManagerTest, - RecordNumTouchpadsUsedInLast28Days) { - mojom::Touchpad touchpad; - touchpad.device_key = kExternalTouchpadId; - touchpad.is_external = true; - touchpad.settings = mojom::TouchpadSettings::New(); - - base::Value::Dict test_pref_dict; - - // Add 5 devices in the window we care about. - for (int i = 1; i <= 5; i++) { - base::Value::Dict device_dict; - device_dict.Set(prefs::kLastUpdatedKey, - base::TimeToValue(base::Time::Now() - base::Days(4 * i))); - test_pref_dict.Set("in_window_" + base::NumberToString(i), - std::move(device_dict)); - } - - // Add a device that is outside the window we want to measure. - { - base::Value::Dict device_dict; - device_dict.Set(prefs::kLastUpdatedKey, - base::TimeToValue(base::Time::Now() - base::Days(29))); - test_pref_dict.Set("out_of_window", std::move(device_dict)); - } - - PrefService* pref_service = - Shell::Get()->session_controller()->GetActivePrefService(); - pref_service->SetDict(prefs::kTouchpadDeviceSettingsDictPref, - std::move(test_pref_dict)); - - base::HistogramTester histogram_tester; - - manager_->RecordTouchpadInitialMetrics(touchpad); - histogram_tester.ExpectUniqueSample( - "ChromeOS.Settings.Device.Touchpad.External.NumConnectedLast28Days", 5, - 1); -} - class SettingsUpdatedTimePeriodMetricsTest : public InputDeviceSettingsMetricsManagerTest, public testing::WithParamInterface<
diff --git a/base/test/gmock_expected_support.h b/base/test/gmock_expected_support.h index 3ea2a7e..2b4f2ac 100644 --- a/base/test/gmock_expected_support.h +++ b/base/test/gmock_expected_support.h
@@ -24,12 +24,10 @@ // `HasVoidValueType<T>` is true iff `T` satisfies // `base::internal::IsExpected<T>` and `T`'s `value_type` is `void`. -template <typename T, typename = void> -constexpr bool HasVoidValueType = false; template <typename T> -constexpr bool - HasVoidValueType<T, std::enable_if_t<base::internal::IsExpected<T>>> = - std::is_void_v<typename std::remove_cvref_t<T>::value_type>; +concept HasVoidValueType = + base::internal::IsExpected<T> && + std::is_void_v<typename std::remove_cvref_t<T>::value_type>; // Implementation for matcher `HasValue`. class HasValueMatcher { @@ -42,17 +40,9 @@ } private: - // Reject instantiation with types that do not satisfy - // `base::internal::IsExpected<T>`. - template <typename T, typename = void> - class Impl { - static_assert(base::internal::IsExpected<T>, - "Must be used with base::expected<T, E>"); - }; - template <typename T> - class Impl<T, std::enable_if_t<base::internal::IsExpected<T>>> - : public ::testing::MatcherInterface<T> { + requires(base::internal::IsExpected<T>) + class Impl : public ::testing::MatcherInterface<T> { public: Impl() = default; @@ -87,21 +77,9 @@ } private: - // Reject instantiation with types that do not satisfy - // `base::internal::IsExpected<U> && !HasVoidValueType<U>`. - template <typename U, typename = void> - class Impl { - static_assert(base::internal::IsExpected<U>, - "Must be used with base::expected<T, E>"); - static_assert(!HasVoidValueType<U>, - "expected object must have non-void value type"); - }; - template <typename U> - class Impl< - U, - std::enable_if_t<base::internal::IsExpected<U> && !HasVoidValueType<U>>> - : public ::testing::MatcherInterface<U> { + requires(base::internal::IsExpected<U> && !HasVoidValueType<U>) + class Impl : public ::testing::MatcherInterface<U> { public: explicit Impl(const T& matcher) : matcher_(::testing::SafeMatcherCast<const V&>(matcher)) {} @@ -156,17 +134,9 @@ } private: - // Reject instantiation with types that do not satisfy - // `base::internal::IsExpected<U>`. - template <typename U, typename = void> - class Impl { - static_assert(base::internal::IsExpected<U>, - "Must be used with base::expected<T, E>"); - }; - template <typename U> - class Impl<U, std::enable_if_t<base::internal::IsExpected<U>>> - : public ::testing::MatcherInterface<U> { + requires(base::internal::IsExpected<U>) + class Impl : public ::testing::MatcherInterface<U> { public: explicit Impl(const T& matcher) : matcher_(::testing::SafeMatcherCast<const E&>(matcher)) {}
diff --git a/base/test/metrics/histogram_tester.h b/base/test/metrics/histogram_tester.h index b77c0bf..461c9553 100644 --- a/base/test/metrics/histogram_tester.h +++ b/base/test/metrics/histogram_tester.h
@@ -206,8 +206,8 @@ // // The constructor forwards to the above non-templated constructor. Therefore, // `EnumType` must be implicitly convertible to `HistogramBase::Sample`. - template <typename MetricEnum, - typename = std::enable_if_t<std::is_enum_v<MetricEnum>>> + template <typename MetricEnum> + requires(std::is_enum_v<MetricEnum>) Bucket(MetricEnum min, HistogramBase::Count count) : Bucket(static_cast<std::underlying_type_t<MetricEnum>>(min), count) {}
diff --git a/base/test/repeating_test_future.h b/base/test/repeating_test_future.h index 4ea1f85..52946c21 100644 --- a/base/test/repeating_test_future.h +++ b/base/test/repeating_test_future.h
@@ -111,7 +111,8 @@ // Wait for an element to arrive, and move its value out. // // Will DCHECK if a timeout happens. - template <typename T = TupleType, internal::EnableIfSingleValue<T> = true> + template <typename T = TupleType> + requires(internal::IsSingleValuedTuple<T>) auto Take() { return std::get<0>(TakeTuple()); } @@ -124,7 +125,8 @@ // Wait for an element to arrive, and move a tuple with its values out. // // Will DCHECK if a timeout happens. - template <typename T = TupleType, internal::EnableIfMultiValue<T> = true> + template <typename T = TupleType> + requires(internal::IsMultiValuedTuple<T>) TupleType Take() { return TakeTuple(); }
diff --git a/base/test/test_future.h b/base/test/test_future.h index 4affa3e..5e1d87a0 100644 --- a/base/test/test_future.h +++ b/base/test/test_future.h
@@ -222,9 +222,8 @@ // int first = future.Get<0>(); // std::string second = future.Get<1>(); // - template <std::size_t I, - typename T = TupleType, - internal::EnableIfOneOrMoreValues<T> = true> + template <std::size_t I, typename T = TupleType> + requires(internal::IsNonEmptyTuple<T>) const auto& Get() { return std::get<I>(GetTuple()); } @@ -421,7 +420,8 @@ // Waits for the value to arrive, and returns a reference to it. // // Will CHECK if a timeout happens. - template <typename T = TupleType, internal::EnableIfSingleValue<T> = true> + template <typename T = TupleType> + requires(internal::IsSingleValuedTuple<T>) [[nodiscard]] const auto& Get() { return std::get<0>(GetTuple()); } @@ -429,7 +429,8 @@ // Waits for the value to arrive, and returns it. // // Will CHECK if a timeout happens. - template <typename T = TupleType, internal::EnableIfSingleValue<T> = true> + template <typename T = TupleType> + requires(internal::IsSingleValuedTuple<T>) [[nodiscard]] auto Take() { return std::get<0>(TakeTuple()); } @@ -441,7 +442,8 @@ // Waits for the values to arrive, and returns a tuple with the values. // // Will CHECK if a timeout happens. - template <typename T = TupleType, internal::EnableIfMultiValue<T> = true> + template <typename T = TupleType> + requires(internal::IsMultiValuedTuple<T>) [[nodiscard]] const TupleType& Get() { return GetTuple(); } @@ -449,7 +451,8 @@ // Waits for the values to arrive, and moves a tuple with the values out. // // Will CHECK if a timeout happens. - template <typename T = TupleType, internal::EnableIfMultiValue<T> = true> + template <typename T = TupleType> + requires(internal::IsMultiValuedTuple<T>) [[nodiscard]] TupleType Take() { return TakeTuple(); }
diff --git a/base/test/test_future_internal.h b/base/test/test_future_internal.h index 350e841..d98d4b5 100644 --- a/base/test/test_future_internal.h +++ b/base/test/test_future_internal.h
@@ -10,20 +10,17 @@ namespace base::test::internal { -// Helper to only implement a method if the future holds one or more values +// Helper to only implement a method if the future holds one or more values. template <typename Tuple> -using EnableIfOneOrMoreValues = - std::enable_if_t<(std::tuple_size<Tuple>::value > 0), bool>; +concept IsNonEmptyTuple = std::tuple_size<Tuple>::value > 0; -// Helper to only implement a method if the future holds a single value +// Helper to only implement a method if the future holds a single value. template <typename Tuple> -using EnableIfSingleValue = - std::enable_if_t<(std::tuple_size<Tuple>::value == 1), bool>; +concept IsSingleValuedTuple = std::tuple_size<Tuple>::value == 1; -// Helper to only implement a method if the future holds multiple values +// Helper to only implement a method if the future holds multiple values. template <typename Tuple> -using EnableIfMultiValue = - std::enable_if_t<(std::tuple_size<Tuple>::value > 1), bool>; +concept IsMultiValuedTuple = std::tuple_size<Tuple>::value > 1; } // namespace base::test::internal
diff --git a/cc/mojo_embedder/DEPS b/cc/mojo_embedder/DEPS index b29b822..8d61945 100644 --- a/cc/mojo_embedder/DEPS +++ b/cc/mojo_embedder/DEPS
@@ -1,4 +1,5 @@ include_rules = [ + "+gpu/command_buffer/client/test_gpu_memory_buffer_manager.h", "+gpu/ipc/client/client_shared_image_interface.h", "+mojo/public/cpp/bindings", "+services/viz/public/mojom/compositing",
diff --git a/cc/mojo_embedder/async_layer_tree_frame_sink_unittest.cc b/cc/mojo_embedder/async_layer_tree_frame_sink_unittest.cc index 840f2524..14cc08f6 100644 --- a/cc/mojo_embedder/async_layer_tree_frame_sink_unittest.cc +++ b/cc/mojo_embedder/async_layer_tree_frame_sink_unittest.cc
@@ -21,7 +21,7 @@ #include "components/viz/common/surfaces/surface_range.h" #include "components/viz/test/compositor_frame_helpers.h" #include "components/viz/test/test_context_provider.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "services/viz/public/mojom/compositing/compositor_frame_sink.mojom.h" @@ -67,7 +67,7 @@ scoped_refptr<viz::TestContextProvider> provider = viz::TestContextProvider::CreateRaster(); - viz::TestGpuMemoryBufferManager test_gpu_memory_buffer_manager; + gpu::TestGpuMemoryBufferManager test_gpu_memory_buffer_manager; mojo::PendingRemote<viz::mojom::CompositorFrameSink> sink_remote; mojo::PendingReceiver<viz::mojom::CompositorFrameSink> sink_receiver = @@ -170,7 +170,7 @@ AsyncLayerTreeFrameSink::InitParams init_params_; scoped_refptr<base::TestMockTimeTaskRunner> task_runner_; - viz::TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_; + gpu::TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_; gfx::Rect display_rect_; std::unique_ptr<AsyncLayerTreeFrameSink> layer_tree_frame_sink_; FakeLayerTreeFrameSinkClient layer_tree_frame_sink_client_;
diff --git a/cc/paint/transfer_cache_unittest.cc b/cc/paint/transfer_cache_unittest.cc index 2bfc302..8ec1cc31 100644 --- a/cc/paint/transfer_cache_unittest.cc +++ b/cc/paint/transfer_cache_unittest.cc
@@ -9,7 +9,6 @@ #include "cc/paint/image_transfer_cache_entry.h" #include "cc/paint/raw_memory_transfer_cache_entry.h" #include "cc/paint/transfer_cache_entry.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "components/viz/test/test_gpu_service_holder.h" #include "components/viz/test/test_in_process_context_provider.h" #include "gpu/command_buffer/client/client_transfer_cache.h" @@ -17,6 +16,7 @@ #include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/command_buffer/client/raster_interface.h" #include "gpu/command_buffer/client/shared_memory_limits.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" #include "gpu/command_buffer/common/context_creation_attribs.h" #include "gpu/command_buffer/service/service_transfer_cache.h" #include "gpu/config/gpu_switches.h" @@ -78,7 +78,7 @@ } private: - viz::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; + gpu::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; std::unique_ptr<gpu::RasterInProcessContext> context_; gl::DisableNullDrawGLBindings enable_pixel_output_; ClientRawMemoryTransferCacheEntry test_client_entry_;
diff --git a/cc/test/DEPS b/cc/test/DEPS index 462e5d6..7aae687 100644 --- a/cc/test/DEPS +++ b/cc/test/DEPS
@@ -6,6 +6,7 @@ "+gpu/command_buffer/client/gles2_interface.h", "+gpu/command_buffer/client/raster_implementation_gles.h", "+gpu/command_buffer/client/shared_memory_limits.h", + "+gpu/command_buffer/client/test_gpu_memory_buffer_manager.h", "+gpu/command_buffer/common", "+gpu/command_buffer/service/gpu_switches.h", "+gpu/config/gpu_feature_type.h",
diff --git a/cc/test/fake_layer_tree_frame_sink.h b/cc/test/fake_layer_tree_frame_sink.h index 6cf264ea..abd7f54 100644 --- a/cc/test/fake_layer_tree_frame_sink.h +++ b/cc/test/fake_layer_tree_frame_sink.h
@@ -23,8 +23,8 @@ #include "components/viz/service/display/software_output_device.h" #include "components/viz/test/test_context_provider.h" #include "components/viz/test/test_gles2_interface.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "components/viz/test/test_raster_interface.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" namespace viz { class BeginFrameSource; @@ -132,7 +132,7 @@ scoped_refptr<viz::RasterContextProvider> context_provider, scoped_refptr<viz::RasterContextProvider> worker_context_provider); - viz::TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_; + gpu::TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_; std::vector<viz::SharedBitmapId> shared_bitmaps_; std::unique_ptr<viz::CompositorFrame> last_sent_frame_;
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 5d791be..2991e59 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc
@@ -1175,7 +1175,7 @@ ASSERT_TRUE(image_worker_->Start()); gpu_memory_buffer_manager_ = - std::make_unique<viz::TestGpuMemoryBufferManager>(); + std::make_unique<gpu::TestGpuMemoryBufferManager>(); task_graph_runner_ = std::make_unique<TestTaskGraphRunner>(); if (mode == CompositorMode::THREADED) {
diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h index 40bbaae6..b5c974b 100644 --- a/cc/test/layer_tree_test.h +++ b/cc/test/layer_tree_test.h
@@ -26,8 +26,8 @@ #include "cc/trees/layer_tree_host.h" #include "cc/trees/layer_tree_host_impl.h" #include "components/viz/common/surfaces/parent_local_surface_id_allocator.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "components/viz/test/test_gpu_service_holder.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" #include "testing/gtest/include/gtest/gtest.h" namespace base { @@ -294,7 +294,7 @@ scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; std::unique_ptr<base::Thread> impl_thread_; std::unique_ptr<base::Thread> image_worker_; - std::unique_ptr<viz::TestGpuMemoryBufferManager> gpu_memory_buffer_manager_; + std::unique_ptr<gpu::TestGpuMemoryBufferManager> gpu_memory_buffer_manager_; std::unique_ptr<TestTaskGraphRunner> task_graph_runner_; base::CancelableOnceClosure timeout_; base::OnceClosure quit_closure_;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java index 6f31a5b..c71c768 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java
@@ -496,6 +496,7 @@ return new GoogleBottomBarCoordinator( mActivity, + mActivityTabProvider, CustomTabsConnection.getInstance() .getGoogleBottomBarIntentParams(intentDataProvider), intentDataProvider.getCustomButtonsOnGoogleBottomBar());
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninAndHistoryOptInActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninAndHistoryOptInActivity.java index b4054455..ef7a6a9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninAndHistoryOptInActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninAndHistoryOptInActivity.java
@@ -9,6 +9,7 @@ import android.content.Context; import android.content.Intent; import android.content.res.Configuration; +import android.graphics.drawable.ColorDrawable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -100,6 +101,8 @@ PrivacyPreferencesManagerImpl.getInstance(), this); + // Reset the activity background to transparent for fullscreen upgrade promo view. + getWindow().setBackgroundDrawable(new ColorDrawable(0)); setContentView(mUpgradePromoCoordinator.getViewSwitcher()); onInitialLayoutInflationComplete(); return;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java index 7b03195b..d9f55d72 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java
@@ -402,6 +402,7 @@ @Test @SmallTest @Feature({"Preferences"}) + @DisableFeatures(ChromeFeatureList.PERMISSION_DEDICATED_CPSS_SETTING_ANDROID) public void testSetAllowLocationEnabled() throws Exception { LocationSettingsTestUtil.setSystemLocationSettingEnabled(true); LocationProviderOverrider.setLocationProviderImpl(new MockLocationProvider()); @@ -1646,6 +1647,7 @@ @Test @SmallTest @Feature({"Preferences"}) + @DisableFeatures(ChromeFeatureList.PERMISSION_DEDICATED_CPSS_SETTING_ANDROID) public void testOnlyExpectedPreferencesDeviceLocation() { LocationSettingsTestUtil.setSystemLocationSettingEnabled(true); @@ -1712,6 +1714,7 @@ @SmallTest @Feature({"Preferences"}) @EnableFeatures("QuietNotificationPrompts") + @DisableFeatures(ChromeFeatureList.PERMISSION_DEDICATED_CPSS_SETTING_ANDROID) public void testOnlyExpectedPreferencesNotifications() { String[] notifications_enabled; String[] notifications_disabled; @@ -2713,6 +2716,7 @@ @Test @SmallTest @Feature({"RenderTest"}) + @DisableFeatures(ChromeFeatureList.PERMISSION_DEDICATED_CPSS_SETTING_ANDROID) public void testRenderLocationPage() throws Exception { createCookieExceptions(); renderCategoryPage(
diff --git a/chrome/android/profiles/arm.newest.txt b/chrome/android/profiles/arm.newest.txt index 473120b..576d178 100644 --- a/chrome/android/profiles/arm.newest.txt +++ b/chrome/android/profiles/arm.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-126.0.6477.0_rc-r1-merged.afdo.bz2 +chromeos-chrome-arm-126.0.6478.0_rc-r1-merged.afdo.bz2
diff --git a/chrome/android/profiles/newest.txt b/chrome/android/profiles/newest.txt index 36029f6..a5369b9 100644 --- a/chrome/android/profiles/newest.txt +++ b/chrome/android/profiles/newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-126.0.6476.0_rc-r1-merged.afdo.bz2 +chromeos-chrome-amd64-126.0.6478.0_rc-r1-merged.afdo.bz2
diff --git a/chrome/app/os_settings_strings.grdp b/chrome/app/os_settings_strings.grdp index 421f57a..c61fb5f 100644 --- a/chrome/app/os_settings_strings.grdp +++ b/chrome/app/os_settings_strings.grdp
@@ -6351,8 +6351,8 @@ <message name="IDS_SETTINGS_STORAGE_ITEM_AVAILABLE" desc="In Device Settings > Storage, label for the available storage size of ChromeOS internal storage."> Available </message> - <message name="IDS_SETTINGS_STORAGE_ITEM_MY_FILES" desc="In Device Settings > Storage, label for the size of My files root."> - My files + <message name="IDS_SETTINGS_STORAGE_ITEM_MY_FILES" desc="In Device Settings > Storage, label for the size of local files in 'This Chromebook' folder."> + Files on this Chromebook </message> <message name="IDS_SETTINGS_STORAGE_ITEM_BROWSING_DATA" desc="In Device Settings > Storage, label for the size of browsing data."> Browsing data
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_STORAGE_ITEM_MY_FILES.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_STORAGE_ITEM_MY_FILES.png.sha1 new file mode 100644 index 0000000..dc28733 --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_STORAGE_ITEM_MY_FILES.png.sha1
@@ -0,0 +1 @@ +7ad8fc251b0b85d04d29a7cc5967e6383a01d508 \ No newline at end of file
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 0063a49..96ca3c5 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -8688,6 +8688,13 @@ kOsAll, FEATURE_VALUE_TYPE(features::kSupportSearchSuggestionForPrerender2)}, + {"prerender-early-document-lifecycle-update", + flag_descriptions::kPrerender2EarlyDocumentLifecycleUpdateName, + flag_descriptions::kPrerender2EarlyDocumentLifecycleUpdateDescription, + kOsAll, + FEATURE_VALUE_TYPE( + blink::features::kPrerender2EarlyDocumentLifecycleUpdate)}, + {"omnibox-search-prefetch", flag_descriptions::kEnableOmniboxSearchPrefetchName, flag_descriptions::kEnableOmniboxSearchPrefetchDescription, kOsAll,
diff --git a/chrome/browser/apps/app_service/app_install/BUILD.gn b/chrome/browser/apps/app_service/app_install/BUILD.gn index a928ef3..496fea1 100644 --- a/chrome/browser/apps/app_service/app_install/BUILD.gn +++ b/chrome/browser/apps/app_service/app_install/BUILD.gn
@@ -46,6 +46,8 @@ sources += [ "app_install_almanac_endpoint.cc", "app_install_almanac_endpoint.h", + "app_install_discovery_metrics.cc", + "app_install_discovery_metrics.h", "app_install_service_ash.cc", "app_install_service_ash.h", "arc_app_installer.cc", @@ -67,6 +69,7 @@ "//chrome/browser/profiles:profile", "//chrome/browser/ui/webui/ash/app_install:mojo_bindings", "//chrome/browser/web_applications", + "//chromeos/components/mgs", "//chromeos/constants:constants", "//components/webapps/browser", "//components/webapps/common",
diff --git a/chrome/browser/apps/app_service/app_install/app_install_discovery_metrics.cc b/chrome/browser/apps/app_service/app_install/app_install_discovery_metrics.cc new file mode 100644 index 0000000..1defc03 --- /dev/null +++ b/chrome/browser/apps/app_service/app_install/app_install_discovery_metrics.cc
@@ -0,0 +1,75 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/apps/app_service/app_install/app_install_discovery_metrics.h" + +#include "chrome/browser/apps/app_service/metrics/app_discovery_metrics.h" +#include "chrome/browser/apps/app_service/metrics/app_platform_metrics_utils.h" +#include "chrome/browser/profiles/profile.h" +#include "chromeos/components/mgs/managed_guest_session_utils.h" +#include "components/metrics/structured/structured_events.h" +#include "components/metrics/structured/structured_metrics_client.h" +#include "components/services/app_service/public/cpp/app_types.h" +#include "components/services/app_service/public/cpp/package_id.h" + +namespace apps { + +namespace { + +namespace cros_events = metrics::structured::events::v2::cr_os_events; + +cros_events::AppInstallSurface ToCrosEventsAppInstallSurface( + AppInstallSurface surface) { + switch (surface) { + case AppInstallSurface::kAppPreloadServiceOem: + return cros_events::AppInstallSurface::APP_PRELOAD_SERVICE_OEM; + case AppInstallSurface::kAppPreloadServiceDefault: + return cros_events::AppInstallSurface::APP_PRELOAD_SERVICE_DEFAULT; + case AppInstallSurface::kOobeAppRecommendations: + return cros_events::AppInstallSurface::OOBE_APP_RECOMMENDATIONS; + case AppInstallSurface::kAppInstallUriUnknown: + return cros_events::AppInstallSurface::APP_INSTALL_URI_UNKNOWN; + case AppInstallSurface::kAppInstallUriShowoff: + return cros_events::AppInstallSurface::APP_INSTALL_URI_SHOWOFF; + case AppInstallSurface::kAppInstallUriMall: + return cros_events::AppInstallSurface::APP_INSTALL_URI_MALL; + case AppInstallSurface::kAppInstallUriGetit: + return cros_events::AppInstallSurface::APP_INSTALL_URI_GETIT; + case AppInstallSurface::kAppInstallUriLauncher: + return cros_events::AppInstallSurface::APP_INSTALL_URI_LAUNCHER; + case AppInstallSurface::kAppInstallUriPeripherals: + return cros_events::AppInstallSurface::APP_INSTALL_URI_PERIPHERALS; + } +} + +} // namespace + +void RecordAppDiscoveryMetricForInstallRequest(Profile* profile, + AppInstallSurface surface, + const PackageId& package_id) { + // App Discovery metrics record App IDs, and so use the same app sync consent + // as AppKM. + if (!ShouldRecordAppKM(profile)) { + return; + } + + // App metrics are allowed in MGS for system/policy installed apps only. + // Only record metrics for Surfaces initiated by the system, like Preloads. + if (chromeos::IsManagedGuestSession() && + !(surface == AppInstallSurface::kAppPreloadServiceDefault || + surface == AppInstallSurface::kAppPreloadServiceOem)) { + return; + } + + if (std::optional<std::string> metrics_app_id = + apps::AppDiscoveryMetrics::GetAppStringToRecordForPackage( + package_id)) { + metrics::structured::StructuredMetricsClient::Record( + cros_events::AppDiscovery_AppInstallService_InstallRequested() + .SetAppId(*metrics_app_id) + .SetSurface(ToCrosEventsAppInstallSurface(surface))); + } +} + +} // namespace apps
diff --git a/chrome/browser/apps/app_service/app_install/app_install_discovery_metrics.h b/chrome/browser/apps/app_service/app_install/app_install_discovery_metrics.h new file mode 100644 index 0000000..dc218270 --- /dev/null +++ b/chrome/browser/apps/app_service/app_install/app_install_discovery_metrics.h
@@ -0,0 +1,20 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_APPS_APP_SERVICE_APP_INSTALL_APP_INSTALL_DISCOVERY_METRICS_H_ +#define CHROME_BROWSER_APPS_APP_SERVICE_APP_INSTALL_APP_INSTALL_DISCOVERY_METRICS_H_ + +#include "chrome/browser/apps/app_service/app_install/app_install_types.h" + +class Profile; + +namespace apps { +class PackageId; + +void RecordAppDiscoveryMetricForInstallRequest(Profile* profile, + AppInstallSurface surface, + const PackageId& package_id); +} // namespace apps + +#endif // CHROME_BROWSER_APPS_APP_SERVICE_APP_INSTALL_APP_INSTALL_DISCOVERY_METRICS_H_
diff --git a/chrome/browser/apps/app_service/app_install/app_install_service_ash.cc b/chrome/browser/apps/app_service/app_install/app_install_service_ash.cc index 2f6436f..8ee4255 100644 --- a/chrome/browser/apps/app_service/app_install/app_install_service_ash.cc +++ b/chrome/browser/apps/app_service/app_install/app_install_service_ash.cc
@@ -13,6 +13,7 @@ #include "base/metrics/histogram_functions.h" #include "base/ranges/algorithm.h" #include "chrome/browser/apps/app_service/app_install/app_install.pb.h" +#include "chrome/browser/apps/app_service/app_install/app_install_discovery_metrics.h" #include "chrome/browser/apps/app_service/app_install/app_install_types.h" #include "chrome/browser/apps/app_service/launch_utils.h" #include "chrome/browser/ash/borealis/borealis_game_install_flow.h" @@ -158,6 +159,9 @@ std::move(InstallAppCallbackForTesting()).Run(package_id); } + RecordAppDiscoveryMetricForInstallRequest(&profile_.get(), surface, + package_id); + base::OnceCallback<void(AppInstallResult)> result_callback = base::BindOnce(&RecordInstallResult, std::move(callback), surface); @@ -305,6 +309,9 @@ return; } + RecordAppDiscoveryMetricForInstallRequest(&profile_.get(), surface, + expected_package_id); + PerformInstall(surface, *data, std::move(callback)); }
diff --git a/chrome/browser/apps/app_service/metrics/app_discovery_metrics.cc b/chrome/browser/apps/app_service/metrics/app_discovery_metrics.cc index b776655c..0361e263d 100644 --- a/chrome/browser/apps/app_service/metrics/app_discovery_metrics.cc +++ b/chrome/browser/apps/app_service/metrics/app_discovery_metrics.cc
@@ -15,6 +15,7 @@ #include "chrome/browser/ash/guest_os/guest_os_registry_service.h" #include "chrome/browser/ash/guest_os/guest_os_registry_service_factory.h" #include "chrome/browser/sync/sync_service_factory.h" +#include "chrome/browser/web_applications/web_app_helpers.h" #include "components/metrics/structured/structured_events.h" #include "components/metrics/structured/structured_metrics_client.h" #include "components/prefs/pref_service.h" @@ -24,6 +25,7 @@ #include "components/services/app_service/public/cpp/package_id.h" #include "components/sync/base/model_type.h" #include "components/sync/service/sync_service.h" +#include "components/ukm/app_source_url_recorder.h" namespace apps { @@ -78,6 +80,31 @@ registry->RegisterListPref(prefs::kAppDiscoveryAppsInstallList); } +std::optional<std::string> AppDiscoveryMetrics::GetAppStringToRecordForPackage( + const PackageId& package_id) { + switch (package_id.package_type()) { + case apps::PackageType::kArc: + return ukm::AppSourceUrlRecorder::GetURLForArcPackageName( + package_id.identifier()) + .spec(); + case apps::PackageType::kBorealis: + return ukm::AppSourceUrlRecorder::GetURLForBorealis( + package_id.identifier()) + .spec(); + case apps::PackageType::kChromeApp: + return ukm::AppSourceUrlRecorder::GetURLForChromeApp( + package_id.identifier()) + .spec(); + case apps::PackageType::kWeb: + return web_app::GenerateAppIdFromManifestId( + GURL(package_id.identifier())); + case apps::PackageType::kGeForceNow: + // GFN is not currently supported by the metrics system. + case apps::PackageType::kUnknown: + return std::nullopt; + } +} + void AppDiscoveryMetrics::OnAppInstalled(const std::string& app_id, AppType app_type, InstallSource app_install_source, @@ -102,7 +129,7 @@ } // Do not record cros-events if app-sync is disabled. - if (!ShouldRecordUkmForAppId(app_id)) { + if (!ShouldRecordAppKMForAppId(app_id)) { return; } @@ -118,7 +145,7 @@ AppType app_type, LaunchSource launch_source) { // Do not record if app-sync is disabled. - if (!ShouldRecordUkmForAppId(app_id)) { + if (!ShouldRecordAppKMForAppId(app_id)) { return; } @@ -149,7 +176,7 @@ base::UmaHistogramEnumeration("Apps.AppDiscovery.Uninstall", app_type_name); // Do not record cros-events if app-sync is disabled. - if (!ShouldRecordUkmForAppId(app_id)) { + if (!ShouldRecordAppKMForAppId(app_id)) { return; } @@ -180,7 +207,7 @@ // Check whether the app is installed or not since there is a maximum // number of apps we want to kepp track of. If the app is not in the installed // apps list, do not emit state changes of the app. - if (ShouldRecordUkmForAppId(app_id) && + if (ShouldRecordAppKMForAppId(app_id) && IsAppInstalled(GetAppStringToRecord(app_id, app_type))) { RecordAppState(instance_update); } @@ -220,9 +247,9 @@ instance_registry_observation_.Reset(); } -bool AppDiscoveryMetrics::ShouldRecordUkmForAppId(const std::string& app_id) { - return ::apps::ShouldRecordUkmForAppId(profile_, app_registry_cache_.get(), - app_id); +bool AppDiscoveryMetrics::ShouldRecordAppKMForAppId(const std::string& app_id) { + return ::apps::ShouldRecordAppKMForAppId(profile_, app_registry_cache_.get(), + app_id); } bool AppDiscoveryMetrics::IsAnyAppInstanceActive(
diff --git a/chrome/browser/apps/app_service/metrics/app_discovery_metrics.h b/chrome/browser/apps/app_service/metrics/app_discovery_metrics.h index 9e4fd50..610c44a3 100644 --- a/chrome/browser/apps/app_service/metrics/app_discovery_metrics.h +++ b/chrome/browser/apps/app_service/metrics/app_discovery_metrics.h
@@ -43,6 +43,19 @@ static void RegisterProfilePrefs(PrefRegistrySimple* registry); + // Returns the string identifier to be logged in app discovery metrics for the + // given `package_id`. + // + // This can be used for apps which aren't installed yet (but have, for + // example, been shown in an app discovery surface), and so aren't registered + // in App Service and don't have an App ID. + // + // This returns the same value as `GetAppStringToRecord(app_id, app_type)` + // would if the package was installed. Returns std::nullopt if metrics for + // this package shouldn't be recorded. + static std::optional<std::string> GetAppStringToRecordForPackage( + const PackageId& package_id); + // AppPlatformMetrics::Observer void OnAppInstalled(const std::string& app_id, AppType app_type, @@ -63,8 +76,8 @@ private: // Returns whether app sync is enabled for |profile_| and it's allowed to - // record UKM for |app_id|. - bool ShouldRecordUkmForAppId(const std::string& app_id); + // record AppKM for |app_id|. + bool ShouldRecordAppKMForAppId(const std::string& app_id); // Returns true if there is an active instance of an app other than // |exclude_instance_id|. If |exclude_instance_id| is nullopt, then all
diff --git a/chrome/browser/apps/app_service/metrics/app_platform_input_metrics.cc b/chrome/browser/apps/app_service/metrics/app_platform_input_metrics.cc index c5fc2807..eb540b9b 100644 --- a/chrome/browser/apps/app_service/metrics/app_platform_input_metrics.cc +++ b/chrome/browser/apps/app_service/metrics/app_platform_input_metrics.cc
@@ -184,14 +184,14 @@ // been recorded yet, read the input events saved in the user pref, and record // the input events UKM, then save the new input events to the user pref. if (should_record_ukm_from_pref_) { - RecordInputEventsUkmFromPref(); + RecordInputEventsAppKMFromPref(); should_record_ukm_from_pref_ = false; } SaveInputEvents(); } void AppPlatformInputMetrics::OnTwoHours() { - RecordInputEventsUkm(); + RecordInputEventsAppKM(); } void AppPlatformInputMetrics::OnInstanceUpdate(const InstanceUpdate& update) { @@ -231,7 +231,7 @@ void AppPlatformInputMetrics::OnStartingShutdown() { CHECK(chromeos::IsManagedGuestSession()); - RecordInputEventsUkm(); + RecordInputEventsAppKM(); } void AppPlatformInputMetrics::SetAppInfoForActivatedWindow( @@ -316,7 +316,7 @@ return; } - if (!ShouldRecordUkmForApp(it->second.app_id)) { + if (!ShouldRecordAppKMForApp(it->second.app_id)) { return; } @@ -324,24 +324,24 @@ [it->second.app_type_name]; } -void AppPlatformInputMetrics::RecordInputEventsUkm() { - if (!ShouldRecordUkm(profile_)) { +void AppPlatformInputMetrics::RecordInputEventsAppKM() { + if (!ShouldRecordAppKM(profile_)) { return; } for (const auto& event_counts : app_id_to_event_count_per_two_hours_) { - if (!ShouldRecordUkmForApp(event_counts.first)) { + if (!ShouldRecordAppKMForApp(event_counts.first)) { continue; } // `event_counts.second` is the map from InputEventSource to the event // counts. - RecordInputEventsUkmForApp(event_counts.first, event_counts.second); + RecordInputEventsAppKMForApp(event_counts.first, event_counts.second); } app_id_to_event_count_per_two_hours_.clear(); } -void AppPlatformInputMetrics::RecordInputEventsUkmForApp( +void AppPlatformInputMetrics::RecordInputEventsAppKMForApp( const std::string& app_id, const EventSourceToCounts& event_counts) { for (const auto& counts : event_counts) { @@ -374,8 +374,8 @@ } } -void AppPlatformInputMetrics::RecordInputEventsUkmFromPref() { - if (!ShouldRecordUkm(profile_)) { +void AppPlatformInputMetrics::RecordInputEventsAppKMFromPref() { + if (!ShouldRecordAppKM(profile_)) { return; } @@ -383,7 +383,7 @@ kAppInputEventsKey); for (const auto [app_id, events] : *input_events_update) { - if (!ShouldRecordUkmForApp(app_id)) { + if (!ShouldRecordAppKMForApp(app_id)) { continue; } @@ -394,13 +394,15 @@ EventSourceToCounts event_counts = ConvertDictValueToEventCounts(*events_dict); - RecordInputEventsUkmForApp(app_id, event_counts); + RecordInputEventsAppKMForApp(app_id, event_counts); } } -bool AppPlatformInputMetrics::ShouldRecordUkmForApp(const std::string& app_id) { - return ShouldRecordUkmForAppId(profile_, app_registry_cache_.get(), app_id) && - ShouldRecordUkmForAppTypeName(GetAppType(profile_, app_id)); +bool AppPlatformInputMetrics::ShouldRecordAppKMForApp( + const std::string& app_id) { + return ShouldRecordAppKMForAppId(profile_, app_registry_cache_.get(), + app_id) && + ShouldRecordAppKMForAppTypeName(GetAppType(profile_, app_id)); } } // namespace apps
diff --git a/chrome/browser/apps/app_service/metrics/app_platform_input_metrics.h b/chrome/browser/apps/app_service/metrics/app_platform_input_metrics.h index 6d3d8eb..a400cce 100644 --- a/chrome/browser/apps/app_service/metrics/app_platform_input_metrics.h +++ b/chrome/browser/apps/app_service/metrics/app_platform_input_metrics.h
@@ -96,10 +96,10 @@ ukm::SourceId GetSourceId(const std::string& app_id); - void RecordInputEventsUkm(); + void RecordInputEventsAppKM(); - void RecordInputEventsUkmForApp(const std::string& app_id, - const EventSourceToCounts& event_counts); + void RecordInputEventsAppKMForApp(const std::string& app_id, + const EventSourceToCounts& event_counts); // Saves the input events in `app_id_to_event_count_per_two_hours_` to the // user pref each 2 hours. For example: @@ -116,11 +116,11 @@ // }, void SaveInputEvents(); - // Records the input events UKM saved in the user pref. - void RecordInputEventsUkmFromPref(); + // Records the input events AppKM saved in the user pref. + void RecordInputEventsAppKMFromPref(); // Returns true if recording is allowed for this app. - bool ShouldRecordUkmForApp(const std::string& app_id); + bool ShouldRecordAppKMForApp(const std::string& app_id); raw_ptr<Profile> profile_;
diff --git a/chrome/browser/apps/app_service/metrics/app_platform_metrics.cc b/chrome/browser/apps/app_service/metrics/app_platform_metrics.cc index bdadf9d..8d15542 100644 --- a/chrome/browser/apps/app_service/metrics/app_platform_metrics.cc +++ b/chrome/browser/apps/app_service/metrics/app_platform_metrics.cc
@@ -436,7 +436,7 @@ } AppType app_type = GetAppType(profile, app_id); - if (!ShouldRecordUkmForAppTypeName(app_type)) { + if (!ShouldRecordAppKMForAppTypeName(app_type)) { return ukm::kInvalidSourceId; } @@ -486,7 +486,7 @@ // If the app should not be recorded, then emit an empty URL so the URL is not // recorded for the associated app. - if (!ShouldRecordUkmForAppTypeName(app_type)) { + if (!ShouldRecordAppKMForAppTypeName(app_type)) { return GURL(); } @@ -728,7 +728,7 @@ } if (app_type == AppType::kUnknown || - !ShouldRecordUkmForAppId(profile_, app_registry_cache_.get(), app_id)) { + !ShouldRecordAppKMForAppId(profile_, app_registry_cache_.get(), app_id)) { return; } @@ -758,7 +758,7 @@ for (auto& observer : observers_) { observer.OnAppUninstalled(app_id, app_type, uninstall_source); } - if (!ShouldRecordUkmForAppId(profile_, app_registry_cache_.get(), app_id)) { + if (!ShouldRecordAppKMForAppId(profile_, app_registry_cache_.get(), app_id)) { return; } @@ -818,8 +818,8 @@ install_time); } - if (!ShouldRecordUkmForAppId(profile_, app_registry_cache_.get(), - update.AppId())) { + if (!ShouldRecordAppKMForAppId(profile_, app_registry_cache_.get(), + update.AppId())) { return; } @@ -1066,8 +1066,8 @@ void AppPlatformMetrics::ReadInstalledApps() { app_registry_cache_->ForEachApp([this](const apps::AppUpdate& update) { - if (ShouldRecordUkmForAppId(profile_, app_registry_cache_.get(), - update.AppId())) { + if (ShouldRecordAppKMForAppId(profile_, app_registry_cache_.get(), + update.AppId())) { RecordAppsInstallUkm(update, InstallTime::kInit); } }); @@ -1179,7 +1179,7 @@ } void AppPlatformMetrics::RecordAppsUsageTimeUkm() { - if (!ShouldRecordUkm(profile_)) { + if (!ShouldRecordAppKM(profile_)) { // Attempt to clean up pre-existing data in the pref store. This is useful // (and harmless) because we routinely clean up usage data that has already // been reported. @@ -1193,8 +1193,8 @@ ukm::SourceId source_id = it.second.source_id; DCHECK_NE(source_id, ukm::kInvalidSourceId); if (!it.second.running_time.is_zero()) { - if (ShouldRecordUkmForAppId(profile_, app_registry_cache_.get(), - it.second.app_id)) { + if (ShouldRecordAppKMForAppId(profile_, app_registry_cache_.get(), + it.second.app_id)) { auto new_source_id = GetSourceId(profile_, it.second.app_id); if (new_source_id != ukm::kInvalidSourceId) { ukm::builders::ChromeOSApp_UsageTime builder(new_source_id); @@ -1273,7 +1273,7 @@ observer.OnAppUsage(app_id, GetAppType(profile_, app_id), instance_id, running_time); } - if (!ShouldRecordUkm(profile_)) { + if (!ShouldRecordAppKM(profile_)) { // Avoid incrementing app usage counters if it cannot be reported. This // ensures we only track usage for the period the user has sync enabled. return; @@ -1295,7 +1295,7 @@ } void AppPlatformMetrics::SaveUsageTime() { - if (!ShouldRecordUkm(profile_)) { + if (!ShouldRecordAppKM(profile_)) { // Do not persist usage data to the pref store if it cannot be reported. // This will prevent unnecessary disk space usage. return; @@ -1335,13 +1335,13 @@ } void AppPlatformMetrics::RecordAppsUsageTimeUkmFromPref() { - if (!ShouldRecordUkm(profile_) || usage_times_from_pref_.empty()) { + if (!ShouldRecordAppKM(profile_) || usage_times_from_pref_.empty()) { return; } for (auto& it : usage_times_from_pref_) { - if (ShouldRecordUkmForAppId(profile_, app_registry_cache_.get(), - it->app_id)) { + if (ShouldRecordAppKMForAppId(profile_, app_registry_cache_.get(), + it->app_id)) { auto source_id = GetSourceId(profile_, it->app_id); if (source_id != ukm::kInvalidSourceId) { ukm::builders::ChromeOSApp_UsageTime builder(source_id);
diff --git a/chrome/browser/apps/app_service/metrics/app_platform_metrics_utils.cc b/chrome/browser/apps/app_service/metrics/app_platform_metrics_utils.cc index c426354..cf19665 100644 --- a/chrome/browser/apps/app_service/metrics/app_platform_metrics_utils.cc +++ b/chrome/browser/apps/app_service/metrics/app_platform_metrics_utils.cc
@@ -430,7 +430,7 @@ } } -bool ShouldRecordUkm(Profile* profile) { +bool ShouldRecordAppKM(Profile* profile) { // Bypass AppKM App Sync check for Demo Mode devices to collect app metrics. if (ash::DemoSession::IsDeviceInDemoMode()) { return true; @@ -453,10 +453,10 @@ } } -bool ShouldRecordUkmForAppId(Profile* profile, - const AppRegistryCache& cache, - const std::string& app_id) { - if (!ShouldRecordUkm(profile)) { +bool ShouldRecordAppKMForAppId(Profile* profile, + const AppRegistryCache& cache, + const std::string& app_id) { + if (!ShouldRecordAppKM(profile)) { return false; } @@ -467,7 +467,7 @@ return true; } -bool ShouldRecordUkmForAppTypeName(AppType app_type) { +bool ShouldRecordAppKMForAppTypeName(AppType app_type) { switch (app_type) { case AppType::kArc: case AppType::kBuiltIn:
diff --git a/chrome/browser/apps/app_service/metrics/app_platform_metrics_utils.h b/chrome/browser/apps/app_service/metrics/app_platform_metrics_utils.h index 6b05a2f..29534e47 100644 --- a/chrome/browser/apps/app_service/metrics/app_platform_metrics_utils.h +++ b/chrome/browser/apps/app_service/metrics/app_platform_metrics_utils.h
@@ -176,25 +176,26 @@ // Returns InstallReason string to use in UMA names. std::string GetInstallReason(InstallReason install_reason); -// Returns true if it's permitted to record UKM for `app_id` in `profile`. -bool ShouldRecordUkmForAppId(Profile* profile, - const AppRegistryCache& cache, - const std::string& app_id); +// Returns true if it's permitted to record App keyed metrics (AppKM) for +// `app_id` in `profile`. +bool ShouldRecordAppKMForAppId(Profile* profile, + const AppRegistryCache& cache, + const std::string& app_id); -// Returns true if we are allowed to record UKM for `profile`. When recording -// UKM for a particular app, prefer `ShouldRecordUkmForAppId`, which also checks -// this function. This function can be used to disable functionality entirely -// when UKM is not allowed. -bool ShouldRecordUkm(Profile* profile); +// Returns true if we are allowed to record AppKM for `profile`. When recording +// AppKM for a particular app, prefer `ShouldRecordAppKMForAppId`, which also +// checks this function. This function can be used to disable functionality +// entirely when AppKM is not allowed. +bool ShouldRecordAppKM(Profile* profile); // Due to the privacy limitation, only ARC apps, Chrome apps and web apps(PWA), // system web apps, builtin apps, Borealis apps, and Crostini apps are recorded // because they are synced to server/cloud, or part of OS. Other app types, // e.g. remote apps, etc, are not recorded. So returns true if the -// app_type_name is allowed to record UKM. Otherwise, returns false. +// app_type_name is allowed to record AppKM. Otherwise, returns false. // // See DD: go/app-platform-metrics-using-ukm for details. -bool ShouldRecordUkmForAppTypeName(AppType app_type_name); +bool ShouldRecordAppKMForAppTypeName(AppType app_type_name); int GetUserTypeByDeviceTypeMetrics();
diff --git a/chrome/browser/ash/arc/input_overlay/ui/nudge_view.cc b/chrome/browser/ash/arc/input_overlay/ui/nudge_view.cc index 68cb1346f..70d3ce41 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/nudge_view.cc +++ b/chrome/browser/ash/arc/input_overlay/ui/nudge_view.cc
@@ -118,13 +118,17 @@ gfx::Size CalculatePreferredSize( const views::SizeBounds& available_size) const override { - int button_width = std::min( - label()->GetPreferredSize(views::SizeBounds(label()->width(), {})) - .width() + - 2 * kHorizontalInset + kSpaceIconLabel + kIconSize, - available_width_); - int button_height = GetHeightForWidth(button_width); - return gfx::Size(button_width, button_height); + constexpr int extra_width = + 2 * kHorizontalInset + kSpaceIconLabel + kIconSize; + const views::SizeBound label_available_width = + std::max<views::SizeBound>(0, available_size.width() - extra_width); + + const int label_width = + label() + ->GetPreferredSize(views::SizeBounds(label_available_width, {})) + .width(); + return views::LabelButton::CalculatePreferredSize(views::SizeBounds( + std::min(label_width + extra_width, available_width_), {})); } ~ContentView() override = default;
diff --git a/chrome/browser/ash/arc/tracing/arc_app_performance_tracing.cc b/chrome/browser/ash/arc/tracing/arc_app_performance_tracing.cc index 8c24f1d..1f0815b 100644 --- a/chrome/browser/ash/arc/tracing/arc_app_performance_tracing.cc +++ b/chrome/browser/ash/arc/tracing/arc_app_performance_tracing.cc
@@ -209,7 +209,8 @@ .Set("commitDeviation", success ? result->commit_deviation : 0) .Set("presentDeviation", success ? result->present_deviation : 0) .Set("renderQuality", success ? result->render_quality : 0) - .Set("janksPerMinute", success ? result->janks_per_minute : 0)); + .Set("janksPerMinute", success ? result->janks_per_minute : 0) + .Set("janksPercentage", success ? result->janks_percentage : 0)); } bool ExpectingPresentEvents() {
diff --git a/chrome/browser/ash/arc/tracing/arc_app_performance_tracing_session.cc b/chrome/browser/ash/arc/tracing/arc_app_performance_tracing_session.cc index c1458344..13f3c42c 100644 --- a/chrome/browser/ash/arc/tracing/arc_app_performance_tracing_session.cc +++ b/chrome/browser/ash/arc/tracing/arc_app_performance_tracing_session.cc
@@ -48,8 +48,7 @@ return (vsync_error.InMicrosecondsF() * vsync_error.InMicrosecondsF()); } -double CalcJanksPerMinute(const std::deque<int64_t>& presents, - const base::TimeDelta& duration) { +int CalcJankCount(const std::deque<int64_t>& presents) { int jank_count = 0; ArcGraphicsJankDetector jank_detector(base::BindRepeating( [](int* out_count, base::Time timestamp) { (*out_count)++; }, @@ -74,7 +73,7 @@ jank_detector.OnSample( base::Time::FromDeltaSinceWindowsEpoch(base::Microseconds(ts_usec))); } - return jank_count / (duration.InSecondsF() / 60.0); + return jank_count; } } // namespace @@ -240,7 +239,8 @@ // Number of presents could be zero if display-less device (e.g. Chromebox), // in this case skip calculating present metrics with less than two frames. - result.present_deviation = result.perceived_fps = result.janks_per_minute = 0; + result.present_deviation = result.perceived_fps = result.janks_per_minute = + result.janks_percentage = 0; if (num_presents > 1) { present_deltas.reserve(num_presents - 1); vsync_error_deviation_accumulator = 0; @@ -253,7 +253,10 @@ sqrt(vsync_error_deviation_accumulator / present_deltas.size()); result.perceived_fps = num_presents / tracing_period.InSecondsF(); if (ArcGraphicsJankDetector::IsEnoughSamplesToDetect(num_presents)) { - result.janks_per_minute = CalcJanksPerMinute(presents, tracing_period); + const double jank_count = static_cast<double>(CalcJankCount(presents)); + result.janks_per_minute = + jank_count / (tracing_period.InSecondsF() / 60.0); + result.janks_percentage = jank_count / num_presents * 100.0; } }
diff --git a/chrome/browser/ash/arc/tracing/arc_app_performance_tracing_session.h b/chrome/browser/ash/arc/tracing/arc_app_performance_tracing_session.h index 8100782..8436df8 100644 --- a/chrome/browser/ash/arc/tracing/arc_app_performance_tracing_session.h +++ b/chrome/browser/ash/arc/tracing/arc_app_performance_tracing_session.h
@@ -29,7 +29,7 @@ struct PerfTraceResult { double fps, commit_deviation, perceived_fps, present_deviation, - render_quality, janks_per_minute; + render_quality, janks_per_minute, janks_percentage; }; using TicksNowCallback = base::RepeatingCallback<base::TimeTicks()>;
diff --git a/chrome/browser/ash/arc/tracing/arc_app_performance_tracing_unittest.cc b/chrome/browser/ash/arc/tracing/arc_app_performance_tracing_unittest.cc index f326d02..c306ba7 100644 --- a/chrome/browser/ash/arc/tracing/arc_app_performance_tracing_unittest.cc +++ b/chrome/browser/ash/arc/tracing/arc_app_performance_tracing_unittest.cc
@@ -168,6 +168,8 @@ GetStatisticName("RenderQuality2", category)); base::StatisticsRecorder::ForgetHistogramForTesting( GetStatisticName("JanksPerMinute2", category)); + base::StatisticsRecorder::ForgetHistogramForTesting( + GetStatisticName("JanksPercentage2", category)); } // Ensures that tracing is ready to begin, which means up to the point that @@ -385,6 +387,7 @@ EXPECT_EQ(216L, ReadFocusStatistics("PresentDeviation2")); EXPECT_EQ(48L, ReadFocusStatistics("RenderQuality2")); EXPECT_EQ(0L, ReadFocusStatistics("JanksPerMinute2")); + EXPECT_EQ(0L, ReadFocusStatistics("JanksPercentage2")); arc_widget->Close(); arc_widget = PrepareArcFocusAppTracing(); @@ -429,6 +432,7 @@ EXPECT_EQ(216L, ReadStatistics("PresentDeviation2", application.name)); EXPECT_EQ(48L, ReadStatistics("RenderQuality2", application.name)); EXPECT_EQ(0L, ReadStatistics("JanksPerMinute2", application.name)); + EXPECT_EQ(0L, ReadStatistics("JanksPercentage2", application.name)); arc_widget->Close(); } }
diff --git a/chrome/browser/ash/arc/tracing/uma_perf_reporting.cc b/chrome/browser/ash/arc/tracing/uma_perf_reporting.cc index fafa09cc..b9415c0f 100644 --- a/chrome/browser/ash/arc/tracing/uma_perf_reporting.cc +++ b/chrome/browser/ash/arc/tracing/uma_perf_reporting.cc
@@ -77,6 +77,15 @@ static_cast<int>(std::round(janks_per_minute))); } +void ReportJanksPercentage(const std::string& category_name, + double janks_percentage) { + DCHECK(!category_name.empty()); + DCHECK_GE(janks_percentage, 0); + base::UmaHistogramCounts100( + GetHistogramName(category_name, "JanksPercentage2"), + static_cast<int>(std::round(janks_percentage))); +} + } // namespace UmaPerfReporting::UmaPerfReporting() : weak_ptr_factory_(this) {} @@ -110,7 +119,8 @@ << ", commit_deviation: " << result->commit_deviation << ", present_deviation: " << result->present_deviation << ", render_quality: " << result->render_quality - << ", janks_per_minute: " << result->janks_per_minute; + << ", janks_per_minute: " << result->janks_per_minute + << ", janks_percentage: " << result->janks_percentage; ReportFPS(category, result->fps); ReportPerceivedFPS(category, result->perceived_fps); @@ -118,6 +128,7 @@ ReportPresentDeviation(category, result->present_deviation); ReportQuality(category, result->render_quality); ReportJanksPerMinute(category, result->janks_per_minute); + ReportJanksPercentage(category, result->janks_percentage); reported_categories_.insert(category); }
diff --git a/chrome/browser/ash/file_system_provider/cloud_file_system.cc b/chrome/browser/ash/file_system_provider/cloud_file_system.cc index b44144d2c..412bc4a 100644 --- a/chrome/browser/ash/file_system_provider/cloud_file_system.cc +++ b/chrome/browser/ash/file_system_provider/cloud_file_system.cc
@@ -521,6 +521,11 @@ VLOG(2) << "Notify {fsid = '" << GetFileSystemId() << "', recursive = '" << recursive << "', change_type = '" << change_type << "', tag = '" << tag << "', changes = {" << changes.get() << "}}"; + + if (content_cache_ && changes) { + content_cache_->Notify(*changes); + } + return file_system_->Notify(entry_path, recursive, change_type, std::move(changes), tag, std::move(callback)); } @@ -597,7 +602,7 @@ GetMetadataCallback callback, std::unique_ptr<EntryMetadata> entry_metadata, base::File::Error result) { - if (result == base::File::FILE_ERROR_NOT_FOUND) { + if (content_cache_ && result == base::File::FILE_ERROR_NOT_FOUND) { // The file doesn't exist on the FSP, evict it from the cache. content_cache_->Evict(entry_path); }
diff --git a/chrome/browser/ash/file_system_provider/cloud_file_system_unittest.cc b/chrome/browser/ash/file_system_provider/cloud_file_system_unittest.cc index 04a9e821..ef425a7 100644 --- a/chrome/browser/ash/file_system_provider/cloud_file_system_unittest.cc +++ b/chrome/browser/ash/file_system_provider/cloud_file_system_unittest.cc
@@ -90,6 +90,10 @@ MOCK_METHOD(void, CloseFile, (const OpenedCloudFile& file), (override)); MOCK_METHOD(void, LoadFromDisk, (base::OnceClosure callback), (override)); MOCK_METHOD(std::vector<base::FilePath>, GetCachedFilePaths, (), (override)); + MOCK_METHOD(void, + Notify, + (ProvidedFileSystemObserver::Changes & changes), + (override)); MOCK_METHOD(void, Evict, (const base::FilePath& file_path), (override)); MOCK_METHOD(void, SetOnItemEvictedCallback,
diff --git a/chrome/browser/ash/file_system_provider/content_cache/content_cache.h b/chrome/browser/ash/file_system_provider/content_cache/content_cache.h index 0610f9c3..fadc3c40 100644 --- a/chrome/browser/ash/file_system_provider/content_cache/content_cache.h +++ b/chrome/browser/ash/file_system_provider/content_cache/content_cache.h
@@ -82,6 +82,10 @@ // used order. virtual std::vector<base::FilePath> GetCachedFilePaths() = 0; + // Called with the changes in the file system. This potentially indicates + // cached files are deleted or changes. + virtual void Notify(ProvidedFileSystemObserver::Changes& changes) = 0; + // Evict the item with path `file_path` from the cache, if it exists. The item // is inaccessible from this point onwards despite it remaining on disk and // the database. It will be removed when `RemoveItems()` is called.
diff --git a/chrome/browser/ash/file_system_provider/content_cache/content_cache_impl.cc b/chrome/browser/ash/file_system_provider/content_cache/content_cache_impl.cc index 080a756..2057c13 100644 --- a/chrome/browser/ash/file_system_provider/content_cache/content_cache_impl.cc +++ b/chrome/browser/ash/file_system_provider/content_cache/content_cache_impl.cc
@@ -97,6 +97,32 @@ EvictItems(); } +void ContentCacheImpl::Notify(ProvidedFileSystemObserver::Changes& changes) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + for (const auto& change : changes) { + ContentLRUCache::iterator it = lru_cache_.Peek(change.entry_path); + if (it == lru_cache_.end()) { + VLOG(1) << "File is not in cache"; + continue; + } + CacheFileContext& ctx = it->second; + + // Evict any deleted items or items with mismatched version tags from the + // cache. + if (change.change_type == storage::WatcherManager::ChangeType::DELETED) { + VLOG(2) << "File is deleted, evict from the cache"; + EvictContext(change.entry_path, ctx); + } else if (change.cloud_file_info && + change.cloud_file_info->version_tag != ctx.version_tag()) { + VLOG(2) << "File version is out of date, evict from the cache"; + EvictContext(change.entry_path, ctx); + } + } + // Remove all evicted items. + RemoveItems(base::DoNothing()); +} + void ContentCacheImpl::Evict(const base::FilePath& file_path) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/chrome/browser/ash/file_system_provider/content_cache/content_cache_impl.h b/chrome/browser/ash/file_system_provider/content_cache/content_cache_impl.h index 9c1585a..2ae8284 100644 --- a/chrome/browser/ash/file_system_provider/content_cache/content_cache_impl.h +++ b/chrome/browser/ash/file_system_provider/content_cache/content_cache_impl.h
@@ -58,6 +58,8 @@ std::vector<base::FilePath> GetCachedFilePaths() override; + void Notify(ProvidedFileSystemObserver::Changes& changes) override; + void Evict(const base::FilePath& file_path) override; void SetOnItemEvictedCallback(
diff --git a/chrome/browser/ash/file_system_provider/content_cache/content_cache_impl_unittest.cc b/chrome/browser/ash/file_system_provider/content_cache/content_cache_impl_unittest.cc index 0d5db29..49b4a4c 100644 --- a/chrome/browser/ash/file_system_provider/content_cache/content_cache_impl_unittest.cc +++ b/chrome/browser/ash/file_system_provider/content_cache/content_cache_impl_unittest.cc
@@ -789,5 +789,42 @@ EXPECT_EQ(future.Take(), random_path1); } +TEST_F(FileSystemProviderContentCacheImplTest, + NotifyEvictsDeletedFilesAndFilesWithDifferentVersionTagsFromCache) { + // Insert files into cache. + const std::string version_tagA("versionA"); + const base::FilePath fsp_path1("random-path1"); + WriteFileToCache(fsp_path1, version_tagA, kDefaultChunkSize); + const base::FilePath fsp_path2("random-path2"); + WriteFileToCache(fsp_path2, version_tagA, kDefaultChunkSize); + const base::FilePath fsp_path3("random-path3"); + WriteFileToCache(fsp_path3, version_tagA, kDefaultChunkSize); + + // The files now exists in the cache. + EXPECT_THAT(content_cache_->GetCachedFilePaths(), + ElementsAre(fsp_path3, fsp_path2, fsp_path1)); + + auto changes = std::make_unique<ProvidedFileSystemObserver::Changes>(); + // Deleted file. + changes->emplace_back( + fsp_path1, storage::WatcherManager::ChangeType::DELETED, + std::make_unique<ash::file_system_provider::CloudFileInfo>(version_tagA)); + // Regular file. This change will be ignored. + changes->emplace_back( + fsp_path1, storage::WatcherManager::ChangeType::CHANGED, + std::make_unique<ash::file_system_provider::CloudFileInfo>(version_tagA)); + // File with different version tag. + changes->emplace_back( + fsp_path3, storage::WatcherManager::ChangeType::CHANGED, + std::make_unique<ash::file_system_provider::CloudFileInfo>("versionB")); + + // Notify of the file changes. + content_cache_->Notify(*changes); + + // The deleted file and file with different version tag are now evicted from + // the cache. + EXPECT_THAT(content_cache_->GetCachedFilePaths(), ElementsAre(fsp_path2)); +} + } // namespace } // namespace ash::file_system_provider
diff --git a/chrome/browser/ash/login/enrollment/enrollment_embedded_policy_server_browsertest.cc b/chrome/browser/ash/login/enrollment/enrollment_embedded_policy_server_browsertest.cc index 17bb3bb..5966647a 100644 --- a/chrome/browser/ash/login/enrollment/enrollment_embedded_policy_server_browsertest.cc +++ b/chrome/browser/ash/login/enrollment/enrollment_embedded_policy_server_browsertest.cc
@@ -5,7 +5,6 @@ #include <optional> #include <string> -#include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/login_screen_test_api.h" #include "base/check.h" @@ -164,14 +163,10 @@ test::OobeJS().ClickOnPath(kEnterprisePrimaryButton); SigninFrameJS().TypeIntoPath(FakeGaiaMixin::kFakeUserPassword, FakeGaiaMixin::kPasswordPath); - if (features::IsKioskEnrollmentInOobeEnabled()) { - if (enroll_kiosk) { - test::OobeJS().ClickOnPath(kKioskEnrollmentButton); - } else { - test::OobeJS().ClickOnPath(kEnterpriseEnrollmentButton); - } + if (enroll_kiosk) { + test::OobeJS().ClickOnPath(kKioskEnrollmentButton); } else { - test::OobeJS().ClickOnPath(kEnterprisePrimaryButton); + test::OobeJS().ClickOnPath(kEnterpriseEnrollmentButton); } } @@ -1272,11 +1267,6 @@ class KioskEnrollmentPolicyServerTest : public EnrollmentEmbeddedPolicyServerBase { public: - KioskEnrollmentPolicyServerTest() { - scoped_feature_list_.InitAndEnableFeature( - features::kEnableKioskEnrollmentInOobe); - } - void TriggerKioskEnrollmentAndSignInSuccessfully(bool enroll_kiosk = false) { host()->HandleAccelerator(LoginAcceleratorAction::kStartKioskEnrollment); OobeScreenWaiter(EnrollmentScreenView::kScreenId).Wait(); @@ -1296,9 +1286,6 @@ test::OobeJS().ClickOnPath(kKioskModeEnterpriseEnrollmentButton); } } - - private: - base::test::ScopedFeatureList scoped_feature_list_; }; IN_PROC_BROWSER_TEST_F(KioskEnrollmentPolicyServerTest, KioskEnrollment) {
diff --git a/chrome/browser/ash/login/enrollment/enrollment_screen.cc b/chrome/browser/ash/login/enrollment/enrollment_screen.cc index 1c1d627..d97ccaa 100644 --- a/chrome/browser/ash/login/enrollment/enrollment_screen.cc +++ b/chrome/browser/ash/login/enrollment/enrollment_screen.cc
@@ -289,15 +289,13 @@ if (!view_) { return; } - if (features::IsLicensePackagedOobeFlowEnabled() && - config_.license_type == policy::LicenseType::kEnterprise && + if (config_.license_type == policy::LicenseType::kEnterprise && config_.is_license_packaged_with_device) { view_->SetFlowType(EnrollmentScreenView::FlowType::kEnterpriseLicense); view_->SetGaiaButtonsType(EnrollmentScreenView::GaiaButtonsType::kDefault); return; } - if (features::IsEducationEnrollmentOobeFlowEnabled() && - config_.license_type == policy::LicenseType::kEducation && + if (config_.license_type == policy::LicenseType::kEducation && config_.is_license_packaged_with_device) { view_->SetFlowType(EnrollmentScreenView::FlowType::kEducationLicense); view_->SetGaiaButtonsType(EnrollmentScreenView::GaiaButtonsType::kDefault); @@ -314,11 +312,6 @@ } else { view_->SetFlowType(EnrollmentScreenView::FlowType::kEnterprise); } - if (!features::IsKioskEnrollmentInOobeEnabled()) { - view_->SetGaiaButtonsType( - EnrollmentScreenView::GaiaButtonsType::kDefault); - return; - } if (context()->enrollment_preference_ == WizardContext::EnrollmentPreference::kKiosk) { view_->SetGaiaButtonsType( @@ -486,10 +479,7 @@ // in the logs. LOG(WARNING) << "Authenticating using attestation."; elapsed_timer_ = std::make_unique<base::ElapsedTimer>(); - // TODO(b/333594657): Remove this flag check. - if (features::IsAutoEnrollmentKioskInOobeEnabled()) { - license_type_to_use_ = config_.license_type; - } + license_type_to_use_ = config_.license_type; if (view_) { view_->Show(); @@ -501,13 +491,10 @@ void EnrollmentScreen::AuthenticateUsingEnrollmentToken() { LOG(WARNING) << "Authenticating using enrollment token."; elapsed_timer_ = std::make_unique<base::ElapsedTimer>(); - // TODO(b/333594657): Remove this flag check. // Although license type is copied over blindly here, later in // enrollment_handler it's only propagated if the type is terminal (i.e. // kiosk), as unset license type is treated as enterprise. - if (features::IsAutoEnrollmentKioskInOobeEnabled()) { - license_type_to_use_ = config_.license_type; - } + license_type_to_use_ = config_.license_type; if (view_) { view_->Show();
diff --git a/chrome/browser/ash/login/screens/packaged_license_screen.cc b/chrome/browser/ash/login/screens/packaged_license_screen.cc index 5e8e70d..cd112d7 100644 --- a/chrome/browser/ash/login/screens/packaged_license_screen.cc +++ b/chrome/browser/ash/login/screens/packaged_license_screen.cc
@@ -4,7 +4,6 @@ #include "chrome/browser/ash/login/screens/packaged_license_screen.h" -#include "ash/constants/ash_features.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" #include "chrome/browser/ash/policy/enrollment/enrollment_config.h" @@ -48,14 +47,12 @@ // enrollment flows are not triggered by the device state. if (config.is_license_packaged_with_device && !config.should_enroll()) { // Skip to enroll since GAIA form has welcoming text for enterprise license. - if (features::IsLicensePackagedOobeFlowEnabled() && - config.license_type == policy::LicenseType::kEnterprise) { + if (config.license_type == policy::LicenseType::kEnterprise) { exit_callback_.Run(Result::NOT_APPLICABLE_SKIP_TO_ENROLL); return true; } // Skip to enroll since GAIA form has welcoming text for education license. - if (features::IsEducationEnrollmentOobeFlowEnabled() && - config.license_type == policy::LicenseType::kEducation) { + if (config.license_type == policy::LicenseType::kEducation) { exit_callback_.Run(Result::NOT_APPLICABLE_SKIP_TO_ENROLL); return true; }
diff --git a/chrome/browser/ash/policy/core/device_policy_decoder.cc b/chrome/browser/ash/policy/core/device_policy_decoder.cc index bf65b0b..935e7584 100644 --- a/chrome/browser/ash/policy/core/device_policy_decoder.cc +++ b/chrome/browser/ash/policy/core/device_policy_decoder.cc
@@ -275,112 +275,6 @@ } } - if (policy.has_device_local_accounts()) { - const em::DeviceLocalAccountsProto& container( - policy.device_local_accounts()); - const RepeatedPtrField<em::DeviceLocalAccountInfoProto>& accounts = - container.account(); - base::Value::List account_list; - for (const auto& entry : accounts) { - base::Value::Dict entry_dict; - if (entry.has_type()) { - if (entry.has_account_id()) { - entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyId, - entry.account_id()); - } - entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyType, - static_cast<int>(entry.type())); - if (entry.kiosk_app().has_app_id()) { - entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyKioskAppId, - entry.kiosk_app().app_id()); - } - if (entry.kiosk_app().has_update_url()) { - entry_dict.Set( - ash::kAccountsPrefDeviceLocalAccountsKeyKioskAppUpdateURL, - entry.kiosk_app().update_url()); - } - if (entry.android_kiosk_app().has_package_name()) { - entry_dict.Set( - ash::kAccountsPrefDeviceLocalAccountsKeyArcKioskPackage, - entry.android_kiosk_app().package_name()); - } - if (entry.android_kiosk_app().has_class_name()) { - entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyArcKioskClass, - entry.android_kiosk_app().class_name()); - } - if (entry.android_kiosk_app().has_action()) { - entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyArcKioskAction, - entry.android_kiosk_app().action()); - } - if (entry.android_kiosk_app().has_display_name()) { - entry_dict.Set( - ash::kAccountsPrefDeviceLocalAccountsKeyArcKioskDisplayName, - entry.android_kiosk_app().display_name()); - } - if (entry.web_kiosk_app().has_url()) { - entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyWebKioskUrl, - entry.web_kiosk_app().url()); - } - if (entry.web_kiosk_app().has_title()) { - entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyWebKioskTitle, - entry.web_kiosk_app().title()); - } - if (entry.web_kiosk_app().has_icon_url()) { - entry_dict.Set( - ash::kAccountsPrefDeviceLocalAccountsKeyWebKioskIconUrl, - entry.web_kiosk_app().icon_url()); - } - if (entry.has_ephemeral_mode()) { - entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyEphemeralMode, - static_cast<int>(entry.ephemeral_mode())); - } else { - entry_dict.Set( - ash::kAccountsPrefDeviceLocalAccountsKeyEphemeralMode, - static_cast<int>( - em::DeviceLocalAccountInfoProto::EPHEMERAL_MODE_UNSET)); - } - - } else if (entry.has_deprecated_public_session_id()) { - // Deprecated public session specification. - entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyId, - entry.deprecated_public_session_id()); - entry_dict.Set( - ash::kAccountsPrefDeviceLocalAccountsKeyType, - static_cast<int>(DeviceLocalAccount::TYPE_PUBLIC_SESSION)); - } - account_list.Append(std::move(entry_dict)); - } - policies->Set(key::kDeviceLocalAccounts, POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, - base::Value(std::move(account_list)), nullptr); - if (container.has_auto_login_id()) { - policies->Set(key::kDeviceLocalAccountAutoLoginId, POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, - base::Value(container.auto_login_id()), nullptr); - } - if (container.has_auto_login_delay()) { - std::unique_ptr<base::Value> value( - DecodeIntegerValue(container.auto_login_delay())); - if (value) { - policies->Set(key::kDeviceLocalAccountAutoLoginDelay, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, - POLICY_SOURCE_CLOUD, std::move(*value), nullptr); - } - } - if (container.has_enable_auto_login_bailout()) { - policies->Set( - key::kDeviceLocalAccountAutoLoginBailoutEnabled, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, - base::Value(container.enable_auto_login_bailout()), nullptr); - } - if (container.has_prompt_for_network_when_offline()) { - policies->Set( - key::kDeviceLocalAccountPromptForNetworkWhenOffline, - POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, - base::Value(container.prompt_for_network_when_offline()), nullptr); - } - } - if (policy.has_saml_settings()) { const em::SAMLSettingsProto& container(policy.saml_settings()); if (container.has_transfer_saml_cookies()) { @@ -766,6 +660,120 @@ } } +base::Value::Dict DecodeDeviceLocalAccountInfoProto( + const em::DeviceLocalAccountInfoProto& entry) { + if (!entry.has_type()) { + if (entry.has_deprecated_public_session_id()) { + // Deprecated public session specification. + return base::Value::Dict() + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyId, + entry.deprecated_public_session_id()) + .Set(ash::kAccountsPrefDeviceLocalAccountsKeyType, + static_cast<int>(DeviceLocalAccount::TYPE_PUBLIC_SESSION)); + } else { + return base::Value::Dict(); + } + } + + base::Value::Dict entry_dict; + if (entry.has_account_id()) { + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyId, + entry.account_id()); + } + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyType, + static_cast<int>(entry.type())); + if (entry.kiosk_app().has_app_id()) { + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyKioskAppId, + entry.kiosk_app().app_id()); + } + if (entry.kiosk_app().has_update_url()) { + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyKioskAppUpdateURL, + entry.kiosk_app().update_url()); + } + if (entry.android_kiosk_app().has_package_name()) { + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyArcKioskPackage, + entry.android_kiosk_app().package_name()); + } + if (entry.android_kiosk_app().has_class_name()) { + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyArcKioskClass, + entry.android_kiosk_app().class_name()); + } + if (entry.android_kiosk_app().has_action()) { + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyArcKioskAction, + entry.android_kiosk_app().action()); + } + if (entry.android_kiosk_app().has_display_name()) { + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyArcKioskDisplayName, + entry.android_kiosk_app().display_name()); + } + if (entry.web_kiosk_app().has_url()) { + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyWebKioskUrl, + entry.web_kiosk_app().url()); + } + if (entry.web_kiosk_app().has_title()) { + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyWebKioskTitle, + entry.web_kiosk_app().title()); + } + if (entry.web_kiosk_app().has_icon_url()) { + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyWebKioskIconUrl, + entry.web_kiosk_app().icon_url()); + } + if (entry.has_ephemeral_mode()) { + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyEphemeralMode, + static_cast<int>(entry.ephemeral_mode())); + } else { + entry_dict.Set(ash::kAccountsPrefDeviceLocalAccountsKeyEphemeralMode, + static_cast<int>( + em::DeviceLocalAccountInfoProto::EPHEMERAL_MODE_UNSET)); + } + return entry_dict; +} + +void DecodeDeviceLocalAccountsPolicy( + const em::ChromeDeviceSettingsProto& policy, + PolicyMap* policies) { + if (!policy.has_device_local_accounts()) { + return; + } + const em::DeviceLocalAccountsProto& container(policy.device_local_accounts()); + const RepeatedPtrField<em::DeviceLocalAccountInfoProto>& accounts = + container.account(); + base::Value::List account_list; + for (const auto& entry : accounts) { + account_list.Append(DecodeDeviceLocalAccountInfoProto(entry)); + } + + policies->Set(key::kDeviceLocalAccounts, POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, + base::Value(std::move(account_list)), nullptr); + if (container.has_auto_login_id()) { + policies->Set(key::kDeviceLocalAccountAutoLoginId, POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, + base::Value(container.auto_login_id()), nullptr); + } + if (container.has_auto_login_delay()) { + std::unique_ptr<base::Value> value( + DecodeIntegerValue(container.auto_login_delay())); + if (value) { + policies->Set(key::kDeviceLocalAccountAutoLoginDelay, + POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, + POLICY_SOURCE_CLOUD, std::move(*value), nullptr); + } + } + if (container.has_enable_auto_login_bailout()) { + policies->Set(key::kDeviceLocalAccountAutoLoginBailoutEnabled, + POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, + POLICY_SOURCE_CLOUD, + base::Value(container.enable_auto_login_bailout()), nullptr); + } + if (container.has_prompt_for_network_when_offline()) { + policies->Set( + key::kDeviceLocalAccountPromptForNetworkWhenOffline, + POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, + base::Value(container.prompt_for_network_when_offline()), nullptr); + } +} + void DecodeNetworkPolicies(const em::ChromeDeviceSettingsProto& policy, PolicyMap* policies) { if (policy.has_data_roaming_enabled()) { @@ -2337,6 +2345,7 @@ PolicyMap* policies) { // Decode the various groups of policies. DecodeLoginPolicies(policy, policies); + DecodeDeviceLocalAccountsPolicy(policy, policies); DecodeNetworkPolicies(policy, policies); DecodeReportingPolicies(policy, policies); DecodeAutoUpdatePolicies(policy, policies);
diff --git a/chrome/browser/ash/policy/enrollment/auto_enrollment_state_message_processor.cc b/chrome/browser/ash/policy/enrollment/auto_enrollment_state_message_processor.cc index bf63418..969052c 100644 --- a/chrome/browser/ash/policy/enrollment/auto_enrollment_state_message_processor.cc +++ b/chrome/browser/ash/policy/enrollment/auto_enrollment_state_message_processor.cc
@@ -8,7 +8,6 @@ #include <optional> #include <string> -#include "ash/constants/ash_features.h" #include "base/logging.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" @@ -278,12 +277,9 @@ // Package license is not available during the re-enrollment parsed_response.is_license_packaged_with_device.reset(); - if (ash::features::IsAutoEnrollmentKioskInOobeEnabled() && - state_response.has_license_type()) { + if (state_response.has_license_type()) { parsed_response.license_type = ConvertAutoEnrollmentLicenseType( state_response.license_type().license_type()); - } else { - parsed_response.license_type.reset(); } LOG(WARNING) << "Received restore_mode=" << restore_mode << " ("
diff --git a/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.cc b/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.cc index 96777597..431494cd 100644 --- a/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.cc +++ b/chrome/browser/ash/policy/enrollment/enrollment_state_fetcher.cc
@@ -10,7 +10,6 @@ #include <string_view> #include <tuple> -#include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "base/check.h" #include "base/functional/callback_forward.h" @@ -746,8 +745,7 @@ state_response.disabled_state().message()); } - if (ash::features::IsAutoEnrollmentKioskInOobeEnabled() && - state_response.has_license_type()) { + if (state_response.has_license_type()) { result.dict.Set(kDeviceStateLicenseType, ConvertAutoEnrollmentLicenseType( state_response.license_type().license_type()));
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc index 6680145..52ef9446 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc
@@ -4493,7 +4493,7 @@ : public ChromeBrowsingDataRemoverDelegateTest { public: ChromeBrowsingDataRemoverDelegateTpcdMetadataTest() { - feature_list_.InitWithFeatures({net::features::kTpcdMetadataStagedRollback}, + feature_list_.InitWithFeatures({net::features::kTpcdMetadataStageControl}, {}); } };
diff --git a/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.cc b/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.cc index e93d100..b91cbd7 100644 --- a/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.cc +++ b/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.cc
@@ -11,6 +11,7 @@ #include "chrome/browser/ui/autofill/risk_util.h" #include "components/autofill/core/browser/personal_data_manager.h" #include "components/facilitated_payments/core/browser/network_api/facilitated_payments_network_interface.h" +#include "components/signin/public/identity_manager/identity_manager.h" #include "content/public/browser/web_contents.h" ChromeFacilitatedPaymentsClient::ChromeFacilitatedPaymentsClient( @@ -58,6 +59,18 @@ return facilitated_payments_network_interface_.get(); } +std::optional<CoreAccountInfo> +ChromeFacilitatedPaymentsClient::GetCoreAccountInfo() { + Profile* profile = + Profile::FromBrowserContext(GetWebContents().GetBrowserContext()); + if (!profile) { + return std::nullopt; + } + auto* identity_manager = + IdentityManagerFactory::GetForProfile(profile->GetOriginalProfile()); + return identity_manager->GetPrimaryAccountInfo(signin::ConsentLevel::kSignin); +} + bool ChromeFacilitatedPaymentsClient::ShowPixPaymentPrompt( base::span<autofill::BankAccount> bank_account_suggestions, base::OnceCallback<void(bool, int64_t)> on_user_decision_callback) {
diff --git a/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.h b/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.h index fbd54e0..aab54c1 100644 --- a/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.h +++ b/chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.h
@@ -46,9 +46,13 @@ GetFacilitatedPaymentsNetworkInterface); // FacilitatedPaymentsClient: + // This returns nullptr if the `Profile` associated is null. autofill::PersonalDataManager* GetPersonalDataManager() override; + // This returns nullptr if the `Profile` associated is null. payments::facilitated::FacilitatedPaymentsNetworkInterface* GetFacilitatedPaymentsNetworkInterface() override; + // This returns std::nullopt if the `Profile` associated is null. + std::optional<CoreAccountInfo> GetCoreAccountInfo() override; bool ShowPixPaymentPrompt( base::span<autofill::BankAccount> bank_account_suggestions, base::OnceCallback<void(bool, int64_t)> on_user_decision_callback)
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 5dd7796..d2fa7190 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -6875,6 +6875,11 @@ "expiry_milestone": 123 }, { + "name": "prerender-early-document-lifecycle-update", + "owners": [ "lingqi@chromium.org", "//content/browser/preloading/prerender/OWNERS" ], + "expiry_milestone": 140 + }, + { "name": "prerender2", "owners": [ "//content/browser/preloading/prerender/OWNERS"
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index a230c09..0684e5d 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -2903,6 +2903,12 @@ "Allows Prerender2 to prerender search suggestions provided by the default " "search engine."; +const char kPrerender2EarlyDocumentLifecycleUpdateName[] = + "Prerender more document lifecycle phases"; +const char kPrerender2EarlyDocumentLifecycleUpdateDescription[] = + "Allows prerendering pages to execute more lifecycle updates, such as " + "prepaint, before activation"; + const char kEnableOmniboxSearchPrefetchName[] = "Omnibox prefetch Search"; const char kEnableOmniboxSearchPrefetchDescription[] = "Allows omnibox to prefetch likely search suggestions provided by the "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 2a3944e..7c9fe9a 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1686,6 +1686,9 @@ extern const char kSupportSearchSuggestionForPrerender2Name[]; extern const char kSupportSearchSuggestionForPrerender2Description[]; +extern const char kPrerender2EarlyDocumentLifecycleUpdateName[]; +extern const char kPrerender2EarlyDocumentLifecycleUpdateDescription[]; + extern const char kEnableOmniboxSearchPrefetchName[]; extern const char kEnableOmniboxSearchPrefetchDescription[];
diff --git a/chrome/browser/pdf/pdf_extension_test.cc b/chrome/browser/pdf/pdf_extension_test.cc index 0e40710..eb0798a 100644 --- a/chrome/browser/pdf/pdf_extension_test.cc +++ b/chrome/browser/pdf/pdf_extension_test.cc
@@ -9,6 +9,7 @@ #include <variant> #include <vector> +#include "base/feature_list.h" #include "base/files/file_enumerator.h" #include "base/files/file_util.h" #include "base/functional/bind.h" @@ -2669,6 +2670,32 @@ ASSERT_EQ(true, content::EvalJs(extension_host, script)); } +IN_PROC_BROWSER_TEST_P(PDFExtensionTest, PdfVisibility) { + GURL url = embedded_test_server()->GetURL("/pdf/pdf_embed.html"); + EXPECT_TRUE(ui_test_utils::NavigateToURL(browser(), url)); + WebContents* web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + EXPECT_EQ(content::Visibility::VISIBLE, web_contents->GetVisibility()); + + web_contents->WasHidden(); + EXPECT_EQ(content::Visibility::HIDDEN, web_contents->GetVisibility()); + + auto inner_contents = web_contents->GetInnerWebContents(); + if (base::FeatureList::IsEnabled(chrome_pdf::features::kPdfOopif)) { + // No inner WebContents, nothing to do. + EXPECT_EQ(0u, inner_contents.size()); + return; + } + + ASSERT_EQ(1u, inner_contents.size()); + WebContents* inner = inner_contents[0]; + EXPECT_EQ(content::Visibility::HIDDEN, inner->GetVisibility()); + + web_contents->WasShown(); + EXPECT_EQ(content::Visibility::VISIBLE, web_contents->GetVisibility()); + EXPECT_EQ(content::Visibility::VISIBLE, inner->GetVisibility()); +} + // A helper for waiting for the first request for |url_to_intercept|. class RequestWaiter { public:
diff --git a/chrome/browser/ssl/https_upgrades_browsertest.cc b/chrome/browser/ssl/https_upgrades_browsertest.cc index 4b7761e..82de04d3 100644 --- a/chrome/browser/ssl/https_upgrades_browsertest.cc +++ b/chrome/browser/ssl/https_upgrades_browsertest.cc
@@ -2972,6 +2972,34 @@ contents)); } +// Main window HTTP allowlist should not apply to Incognito window. +// Regression test for crbug.com/40949400. +IN_PROC_BROWSER_TEST_P(HttpsUpgradesBrowserTest, + IncognitoHasSeparateAllowlist) { + // This test only covers the case of HFM-in-Incognito. + if (!IsIncognito()) { + return; + } + // In a regular window, add a host to the HTTP allowlist. + // Note: This is explicitly done with HTTPS-First Mode disabled as that is the + // specific regression case for crbug.com/40949400, but HTTPS-First Mode and + // HTTPS-Upgrades may eventually have separate allowlists. + SetPref(false); + auto http_url = http_server()->GetURL("bad-https.com", "/simple.html"); + auto* normal_tab = browser()->tab_strip_model()->GetActiveWebContents(); + EXPECT_TRUE(content::NavigateToURL(normal_tab, http_url)); + EXPECT_FALSE( + chrome_browser_interstitials::IsShowingHttpsFirstModeInterstitial( + normal_tab)); + + // In an Incognito window, navigating to that same host should still trigger + // the HTTP interstitial, as the allowlist is not inherited. + auto* incognito_tab = GetBrowser()->tab_strip_model()->GetActiveWebContents(); + EXPECT_FALSE(content::NavigateToURL(incognito_tab, http_url)); + EXPECT_TRUE(chrome_browser_interstitials::IsShowingHttpsFirstModeInterstitial( + incognito_tab)); +} + // Tests that URLs typed with an explicit http:// scheme are opted out from // upgrades. IN_PROC_BROWSER_TEST_P(HttpsUpgradesBrowserTest,
diff --git a/chrome/browser/sync/test/integration/single_client_contact_info_sync_test.cc b/chrome/browser/sync/test/integration/single_client_contact_info_sync_test.cc index e5c63304..cc175221 100644 --- a/chrome/browser/sync/test/integration/single_client_contact_info_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_contact_info_sync_test.cc
@@ -356,6 +356,53 @@ .IsAutofillSyncToggleAvailable()); } +// Regression test for https://crbug.com/340194452 +IN_PROC_BROWSER_TEST_F(SingleClientContactInfoTransportSyncTest, + IsAutofillSyncToggleAvailable) { + // Setup transport mode. + ASSERT_TRUE(SetupClients()); + ASSERT_TRUE(GetClient(0)->SignInPrimaryAccount()); + ASSERT_TRUE(GetClient(0)->AwaitSyncTransportActive()); + EXPECT_TRUE( + GetSyncService(0)->GetActiveDataTypes().Has(syncer::CONTACT_INFO)); + // The toggle is available. + EXPECT_TRUE(GetPersonalDataManager() + ->address_data_manager() + .IsAutofillSyncToggleAvailable()); + + // Turn account storage OFF. + GetPersonalDataManager() + ->address_data_manager() + .SetAutofillSelectableTypeEnabled( + /*enabled=*/false); + EXPECT_TRUE(ContactInfoActiveChecker(GetSyncService(0), + /*expect_active=*/false) + .Wait()); + + // The toggle is still available. + EXPECT_TRUE(GetPersonalDataManager() + ->address_data_manager() + .IsAutofillSyncToggleAvailable()); + + // Turn on Sync. + ASSERT_TRUE(GetClient(0)->SignInPrimaryAccount(signin::ConsentLevel::kSync)); + + // The toggle is no longer available. + EXPECT_FALSE(GetPersonalDataManager() + ->address_data_manager() + .IsAutofillSyncToggleAvailable()); + +#if !BUILDFLAG(IS_CHROMEOS_ASH) + // Sign out. + GetClient(0)->SignOutPrimaryAccount(); + + // The toggle is not available. + EXPECT_FALSE(GetPersonalDataManager() + ->address_data_manager() + .IsAutofillSyncToggleAvailable()); +#endif +} + IN_PROC_BROWSER_TEST_F(SingleClientContactInfoSyncTest, PreservesUnsupportedFieldsDataOnCommits) { // Create an unsupported field with an unused tag.
diff --git a/chrome/browser/tpcd/metadata/manager_browsertest.cc b/chrome/browser/tpcd/metadata/manager_browsertest.cc index 33c87d9..e6fe97c 100644 --- a/chrome/browser/tpcd/metadata/manager_browsertest.cc +++ b/chrome/browser/tpcd/metadata/manager_browsertest.cc
@@ -89,7 +89,7 @@ scoped_feature_list_.InitWithFeatures( {content_settings::features::kTrackingProtection3pcd, net::features::kTpcdMetadataGrants, - net::features::kTpcdMetadataStagedRollback, + net::features::kTpcdMetadataStageControl, net::features::kTopLevelTpcdTrialSettings}, {});
diff --git a/chrome/browser/ui/android/google_bottom_bar/BUILD.gn b/chrome/browser/ui/android/google_bottom_bar/BUILD.gn index a918934..a279e3f 100644 --- a/chrome/browser/ui/android/google_bottom_bar/BUILD.gn +++ b/chrome/browser/ui/android/google_bottom_bar/BUILD.gn
@@ -9,6 +9,7 @@ sources = [ "java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfig.java", "java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfigCreator.java", + "java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarActionsHandler.java", "java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarCoordinator.java", "java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarViewCreator.java", ] @@ -18,16 +19,22 @@ "//base:base_java", "//chrome/browser/android/browserservices/intents:java", "//chrome/browser/flags:java", + "//chrome/browser/tab:java", + "//chrome/browser/util:java", + "//components/browser_ui/widget/android:java", "//components/optimization_guide/proto:optimization_guide_proto_java", "//third_party/android_deps:protobuf_lite_runtime_java", "//third_party/androidx:androidx_annotation_annotation_java", + "//third_party/androidx:androidx_core_core_java", + "//ui/android:ui_java", + "//url:url_java", ] resources_package = "org.chromium.chrome.browser.ui.google_bottom_bar" } android_resources("java_resources") { sources = [ - "java/res/drawable/bookmark_add.xml", + "java/res/drawable/bookmark.xml", "java/res/layout/google_bottom_bar_even.xml", "java/res/layout/google_bottom_bar_spotlight.xml", "java/res/values/colors.xml", @@ -42,15 +49,25 @@ } robolectric_library("junit") { - sources = [ "java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfigCreatorTest.java" ] + sources = [ + "java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfigCreatorTest.java", + "java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarActionsHandlerTest.java", + ] deps = [ ":java", "//base:base_java", "//base:base_java_test_support", "//base:base_junit_test_support", + "//chrome/android:chrome_java", "//chrome/browser/android/browserservices/intents:java", + "//chrome/browser/tab:java", + "//components/browser_ui/widget/android:java", + "//third_party/androidx:androidx_test_core_java", + "//third_party/androidx:androidx_test_ext_junit_java", "//third_party/junit", "//third_party/mockito:mockito_java", + "//ui/android:ui_java_test_support", + "//url:url_java", ] }
diff --git a/chrome/browser/ui/android/google_bottom_bar/java/res/drawable/bookmark.xml b/chrome/browser/ui/android/google_bottom_bar/java/res/drawable/bookmark.xml new file mode 100644 index 0000000..d515993 --- /dev/null +++ b/chrome/browser/ui/android/google_bottom_bar/java/res/drawable/bookmark.xml
@@ -0,0 +1,14 @@ +<!-- +Copyright 2024 The Chromium Authors +Use of this source code is governed by a BSD-style license that can be +found in the LICENSE file. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="@color/default_icon_color_baseline" + android:pathData="M17,3L7,3c-1.1,0 -2,0.9 -2,2v16l7,-3 7,3L19,5c0,-1.1 -0.9,-2 -2,-2zM17,17.97l-5,-2.14 -5,2.14L7,5h10v12.97z"/> +</vector>
diff --git a/chrome/browser/ui/android/google_bottom_bar/java/res/drawable/bookmark_add.xml b/chrome/browser/ui/android/google_bottom_bar/java/res/drawable/bookmark_add.xml deleted file mode 100644 index 169d7b8..0000000 --- a/chrome/browser/ui/android/google_bottom_bar/java/res/drawable/bookmark_add.xml +++ /dev/null
@@ -1,19 +0,0 @@ -<!-- -Copyright 2024 The Chromium Authors -Use of this source code is governed by a BSD-style license that can be -found in the LICENSE file. ---> -<!--TODO: Delete this in favor of drawable provided in CustomButtonParams--> -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="48dp" - android:height="48dp" - android:viewportWidth="48" - android:viewportHeight="48"> - <group> - <clip-path - android:pathData="M0,0h48v48h-48z"/> - <path - android:pathData="M17,33V17C17,16.45 17.192,15.983 17.575,15.6C17.975,15.2 18.45,15 19,15H25C25,15.383 25,15.717 25,16C25,16.283 25,16.617 25,17H19V29.95L24,27.8L29,29.95V23C29.383,23 29.717,23 30,23C30.283,23 30.617,23 31,23V33L24,30L17,33ZM19,17H25H24H19ZM29,21V19H27V17H29V15H31V17H33V19H31V21H29Z" - android:fillColor="#1F1F1F"/> - </group> -</vector>
diff --git a/chrome/browser/ui/android/google_bottom_bar/java/res/layout/google_bottom_bar_even.xml b/chrome/browser/ui/android/google_bottom_bar/java/res/layout/google_bottom_bar_even.xml index 8dcc6ffa..866bd4fb 100644 --- a/chrome/browser/ui/android/google_bottom_bar/java/res/layout/google_bottom_bar_even.xml +++ b/chrome/browser/ui/android/google_bottom_bar/java/res/layout/google_bottom_bar_even.xml
@@ -28,8 +28,7 @@ android:layout_gravity="center_vertical" android:importantForAccessibility="yes" android:contentDescription="@null" - android:src="@drawable/bookmark_add" - app:tint="@color/default_icon_color_baseline" /> + android:src="@drawable/bookmark" /> <ImageView android:id="@+id/google_bottom_bar_page_insights_icon" android:layout_width="0dp"
diff --git a/chrome/browser/ui/android/google_bottom_bar/java/res/layout/google_bottom_bar_spotlight.xml b/chrome/browser/ui/android/google_bottom_bar/java/res/layout/google_bottom_bar_spotlight.xml index 6db764f..2e1bde6 100644 --- a/chrome/browser/ui/android/google_bottom_bar/java/res/layout/google_bottom_bar_spotlight.xml +++ b/chrome/browser/ui/android/google_bottom_bar/java/res/layout/google_bottom_bar_spotlight.xml
@@ -49,8 +49,7 @@ android:layout_marginStart="@dimen/google_bottom_bar_button_padding" android:importantForAccessibility="yes" android:contentDescription="@null" - android:src="@drawable/bookmark_add" - app:tint="@color/default_icon_color_baseline" /> + android:src="@drawable/bookmark" /> <ImageView android:id="@+id/google_bottom_bar_share_button" android:layout_width="@dimen/google_bottom_bar_button_size"
diff --git a/chrome/browser/ui/android/google_bottom_bar/java/res/values/dimens.xml b/chrome/browser/ui/android/google_bottom_bar/java/res/values/dimens.xml index f3a1862e6..ad2c73d 100644 --- a/chrome/browser/ui/android/google_bottom_bar/java/res/values/dimens.xml +++ b/chrome/browser/ui/android/google_bottom_bar/java/res/values/dimens.xml
@@ -11,5 +11,6 @@ <dimen name="google_bottom_bar_expanded_button_padding_horizontal">10dp</dimen> <dimen name="google_bottom_bar_button_padding">12dp</dimen> <dimen name="google_bottom_bar_button_size">48dp</dimen> + <dimen name="google_bottom_bar_button_image_size">24dp</dimen> <dimen name="google_bottom_bar_button_margin_vertical">8dp</dimen> </resources> \ No newline at end of file
diff --git a/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfig.java b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfig.java index e15679e..2546be0 100644 --- a/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfig.java +++ b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfig.java
@@ -5,7 +5,6 @@ package org.chromium.chrome.browser.ui.google_bottom_bar; import android.app.PendingIntent; -import android.content.Context; import android.graphics.drawable.Drawable; import androidx.annotation.Nullable; @@ -60,18 +59,15 @@ private final @Nullable PendingIntent mPendingIntent; - ButtonConfig(@ButtonId int id, Drawable icon, String description) { + ButtonConfig( + @ButtonId int id, + Drawable icon, + String description, + @Nullable PendingIntent pendingIntent) { mId = id; mIcon = icon; mDescription = description; - mPendingIntent = null; - } - - ButtonConfig(Context context, @ButtonId int id, CustomButtonParams params) { - mId = id; - mIcon = params.getIcon(context); - mDescription = params.getDescription(); - mPendingIntent = params.getPendingIntent(); + mPendingIntent = pendingIntent; } public @ButtonId int getId() {
diff --git a/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfigCreator.java b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfigCreator.java index 8a243b02..e3855e5 100644 --- a/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfigCreator.java +++ b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfigCreator.java
@@ -4,6 +4,10 @@ package org.chromium.chrome.browser.ui.google_bottom_bar; import android.content.Context; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; import androidx.annotation.IntDef; import androidx.annotation.Nullable; @@ -11,6 +15,7 @@ import org.chromium.base.Log; import org.chromium.chrome.browser.browserservices.intents.CustomButtonParams; import org.chromium.chrome.browser.ui.google_bottom_bar.BottomBarConfig.ButtonConfig; +import org.chromium.ui.UiUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -51,9 +56,9 @@ */ static @Nullable ButtonConfig createButtonConfigFromCustomParams( Context context, CustomButtonParams params) { - Integer id = getButtonId(params.getId()); - if (id != null) { - return new ButtonConfig(context, id, params); + Integer buttonId = getButtonId(params.getId()); + if (buttonId != null) { + return getButtonConfigFromCustomButtonParams(context, buttonId, params); } return null; } @@ -145,7 +150,7 @@ for (CustomButtonParams params : customButtonParams) { Integer buttonId = getButtonId(params.getId()); if (buttonId == id) { - return new ButtonConfig(mContext, buttonId, params); + return getButtonConfigFromCustomButtonParams(mContext, buttonId, params); } } return null; @@ -171,22 +176,39 @@ return CUSTOM_BUTTON_PARAM_ID_TO_BUTTON_ID_MAP.get(customButtonParamId); } - /** - * {@link ButtonId.SAVE} and {@link ButtonId.ADD_NOTES} already receive all button configuration - * from the client, so they should never reach this switch statement. - * - * <p>Create a {@link ButtonConfig} from existing resources. TODO - when the icons and - * descriptions are defined in the codebase, update the implementation for each individual - * button - */ - private static @Nullable ButtonConfig createButtonConfigFromId(@ButtonId int id) { + /** Create default {@link ButtonConfig} for the given ID. */ + private @Nullable ButtonConfig createButtonConfigFromId(@ButtonId int id) { switch (id) { - case ButtonId.PIH_BASIC, - ButtonId.SHARE, - ButtonId.REFRESH, - ButtonId.PIH_COLORED, - ButtonId.PIH_EXPANDED: - return new ButtonConfig(id, null, ""); + case ButtonId.PIH_BASIC, ButtonId.PIH_COLORED, ButtonId.PIH_EXPANDED: + return new ButtonConfig( + id, + UiUtils.getTintedDrawable( + mContext, + R.drawable.page_insights_icon, + R.color.default_icon_color_baseline), + mContext.getString( + R.string.google_bottom_bar_page_insights_button_description), + /* pendingIntent= */ null); + case ButtonId.SAVE: + // If save button is not created from embedder-provided CustomButtonParams, provide + // disabled save + // button instead + return new ButtonConfig( + id, + UiUtils.getTintedDrawable( + mContext, R.drawable.bookmark, R.color.default_icon_color_disabled), + mContext.getString( + R.string.google_bottom_bar_save_disabled_button_description), + /* pendingIntent= */ null); + case ButtonId.SHARE: + return new ButtonConfig( + id, + UiUtils.getTintedDrawable( + mContext, + R.drawable.ic_share_white_24dp, + R.color.default_icon_color_baseline), + mContext.getString(R.string.google_bottom_bar_share_button_description), + /* pendingIntent= */ null); default: { Log.e(TAG, "The ID is not supported"); @@ -229,4 +251,31 @@ private static boolean isValidButtonId(int code) { return code > 0 && code <= ButtonId.MAX_BUTTON_ID; } + + private static Drawable getScaledAndTintedIcon( + Context context, Drawable drawable, int tintColorId) { + if (drawable instanceof BitmapDrawable) { + Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap(); + Resources resource = context.getResources(); + int dimen = resource.getDimensionPixelSize(R.dimen.google_bottom_bar_button_image_size); + BitmapDrawable bitmapDrawable = + new BitmapDrawable( + context.getResources(), + Bitmap.createScaledBitmap(bitmap, dimen, dimen, true)); + bitmapDrawable.setTint(context.getColor(tintColorId)); + return bitmapDrawable; + } + drawable.setTint(context.getColor(tintColorId)); + return drawable; + } + + private static ButtonConfig getButtonConfigFromCustomButtonParams( + Context context, int buttonId, CustomButtonParams params) { + return new ButtonConfig( + buttonId, + getScaledAndTintedIcon( + context, params.getIcon(context), R.color.default_icon_color_baseline), + params.getDescription(), + params.getPendingIntent()); + } }
diff --git a/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfigCreatorTest.java b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfigCreatorTest.java index 607c57bd..7bf1dcc 100644 --- a/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfigCreatorTest.java +++ b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/BottomBarConfigCreatorTest.java
@@ -19,6 +19,7 @@ import android.app.PendingIntent; import android.content.Context; +import android.graphics.drawable.Drawable; import org.junit.Before; import org.junit.Rule; @@ -47,11 +48,12 @@ @Mock private CustomButtonParams mCustomButtonParams; private BottomBarConfigCreator mConfigCreator; + private Context mContext; @Before public void setup() { - Context context = ContextUtils.getApplicationContext(); - mConfigCreator = new BottomBarConfigCreator(context); + mContext = ContextUtils.getApplicationContext(); + mConfigCreator = new BottomBarConfigCreator(mContext); } @Test @@ -61,7 +63,7 @@ @Test public void noSpotlightParamList_nullSpotlight_correctButtonList() { - BottomBarConfig buttonConfig = mConfigCreator.create("0,1,2,5", List.of()); + BottomBarConfig buttonConfig = mConfigCreator.create("0,1,2,3", List.of()); assertNull(buttonConfig.getSpotlightId()); assertEquals(3, buttonConfig.getButtonList().size()); @@ -70,7 +72,7 @@ @Test public void withSpotlightParamList_correctSpotlightSet_correctButtonList() { - BottomBarConfig buttonConfig = mConfigCreator.create("1,1,2,5", List.of()); + BottomBarConfig buttonConfig = mConfigCreator.create("1,1,2,3", List.of()); Integer spotlight = buttonConfig.getSpotlightId(); assertNotNull(spotlight); @@ -93,26 +95,26 @@ List.of( PIH_BASIC, PIH_BASIC, SHARE, SAVE, ADD_NOTES, REFRESH); // PIH_BASIC, SHARE, SAVE, ADD_NOTES, REFRESH - + Drawable drawable = mock(Drawable.class); when(mCustomButtonParams.getId()).thenReturn(100); // SAVE + when(mCustomButtonParams.getIcon(mContext)).thenReturn(drawable); - // ADD_NOTES is not included in the final list + // ADD_NOTES and REFRESH are not included in the final list as they are not supported BottomBarConfig buttonConfig = mConfigCreator.create(buttonIdList, List.of(mCustomButtonParams)); - assertEquals(4, buttonConfig.getButtonList().size()); + assertEquals(3, buttonConfig.getButtonList().size()); } @Test public void createButtonConfigList_buttonIdListWithoutCustomParamId() { - List<Integer> buttonIdList = - List.of(PIH_BASIC, PIH_BASIC, SHARE, REFRESH); // PIH_BASIC, SHARE, REFRESH + List<Integer> buttonIdList = List.of(PIH_BASIC, PIH_BASIC, SHARE); // PIH_BASIC, SHARE when(mCustomButtonParams.getId()).thenReturn(100); // SAVE // SAVE is not included in the final list BottomBarConfig buttonConfig = mConfigCreator.create(buttonIdList, List.of(mCustomButtonParams)); - assertEquals(3, buttonConfig.getButtonList().size()); + assertEquals(2, buttonConfig.getButtonList().size()); } @Test @@ -123,7 +125,9 @@ @Test public void withCorrectCustomParams_hasCorrectButtonConfig() { + Drawable drawable = mock(Drawable.class); when(mCustomButtonParams.getId()).thenReturn(100); // SAVE + when(mCustomButtonParams.getIcon(mContext)).thenReturn(drawable); var pendingIntent = mock(PendingIntent.class); when(mCustomButtonParams.getPendingIntent()).thenReturn(pendingIntent);
diff --git a/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarActionsHandler.java b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarActionsHandler.java new file mode 100644 index 0000000..a408d23e --- /dev/null +++ b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarActionsHandler.java
@@ -0,0 +1,101 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.ui.google_bottom_bar; + +import android.app.Activity; +import android.app.ActivityOptions; +import android.app.PendingIntent; +import android.content.Intent; +import android.net.Uri; +import android.view.View; + +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.base.Log; +import org.chromium.base.supplier.Supplier; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.ui.google_bottom_bar.BottomBarConfig.ButtonConfig; +import org.chromium.chrome.browser.ui.google_bottom_bar.BottomBarConfigCreator.ButtonId; +import org.chromium.chrome.browser.util.ChromeAccessibilityUtil; +import org.chromium.components.browser_ui.widget.textbubble.TextBubble; +import org.chromium.ui.widget.ViewRectProvider; + +/** A handler class for actions triggered by buttons in a GoogleBottomBar. */ +class GoogleBottomBarActionsHandler { + private static final String TAG = "GBBActionHandler"; + private final Activity mActivity; + private final Supplier<Tab> mTabProvider; + + GoogleBottomBarActionsHandler(Activity activity, Supplier<Tab> tabProvider) { + mActivity = activity; + mTabProvider = tabProvider; + } + + View.OnClickListener getClickListener(ButtonConfig buttonConfig) { + switch (buttonConfig.getId()) { + case ButtonId.SAVE -> { + return v -> onSaveButtonClick(buttonConfig, v); + } + case ButtonId.PIH_BASIC, + ButtonId.PIH_EXPANDED, + ButtonId.PIH_COLORED, + ButtonId.SHARE, + ButtonId.ADD_NOTES, + ButtonId.REFRESH -> { + Log.e(TAG, "Unsupported action: %s", buttonConfig.getId()); + return null; + } + } + return null; + } + + private void onSaveButtonClick(BottomBarConfig.ButtonConfig buttonConfig, View view) { + PendingIntent pendingIntent = buttonConfig.getPendingIntent(); + if (pendingIntent != null) { + sendPendingIntentWithUrl(pendingIntent); + } else { + showTooltip(view, R.string.google_bottom_bar_save_disabled_tooltip_message); + } + } + + private void showTooltip(View view, int messageId) { + ViewRectProvider rectProvider = new ViewRectProvider(view); + TextBubble textBubble = + new TextBubble( + view.getContext(), + view, + /* stringId= */ messageId, + /* accessibilityStringId= */ messageId, + /* showArrow= */ true, + rectProvider, + ChromeAccessibilityUtil.get().isAccessibilityEnabled()); + textBubble.setFocusable(true); + textBubble.setDismissOnTouchInteraction(true); + textBubble.show(); + } + + private void sendPendingIntentWithUrl(PendingIntent pendingIntent) { + Tab tab = mTabProvider.get(); + if (tab == null) { + Log.e(TAG, "Can't send pending intent as tab is null."); + return; + } + Intent addedIntent = new Intent(); + addedIntent.setData(Uri.parse(tab.getUrl().getSpec())); + try { + ActivityOptions options = ActivityOptions.makeBasic(); + ApiCompatibilityUtils.setActivityOptionsBackgroundActivityStartMode(options); + pendingIntent.send( + mActivity, + /* code= */ 0, + addedIntent, + /* onFinished= */ null, + /* handler= */ null, + /* requiredPermissions= */ null, + /* options= */ options.toBundle()); + } catch (PendingIntent.CanceledException e) { + Log.e(TAG, "CanceledException when sending pending intent.", e); + } + } +}
diff --git a/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarActionsHandlerTest.java b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarActionsHandlerTest.java new file mode 100644 index 0000000..fc342015 --- /dev/null +++ b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarActionsHandlerTest.java
@@ -0,0 +1,111 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.ui.google_bottom_bar; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import android.app.Activity; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.net.Uri; +import android.view.View; + +import androidx.test.ext.junit.rules.ActivityScenarioRule; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.robolectric.annotation.Config; + +import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.components.browser_ui.widget.textbubble.TextBubble; +import org.chromium.ui.base.TestActivity; +import org.chromium.url.GURL; + +import java.util.Set; + +/** Unit tests for {@link BottomBarConfig}. */ +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE) +public class GoogleBottomBarActionsHandlerTest { + private static final String TEST_URI = "https://www.test.com/"; + private final GURL mGURL = new GURL(TEST_URI); + + @Rule + public ActivityScenarioRule<TestActivity> mActivityScenarioRule = + new ActivityScenarioRule<>(TestActivity.class); + + @Mock private Tab mTab; + @Mock private ObservableSupplier<Tab> mTabSupplier; + + private Activity mActivity; + private GoogleBottomBarActionsHandler mGoogleBottomBarActionsHandler; + + @Before + public void setup() { + mActivityScenarioRule.getScenario().onActivity(activity -> mActivity = activity); + MockitoAnnotations.initMocks(this); + mGoogleBottomBarActionsHandler = new GoogleBottomBarActionsHandler(mActivity, mTabSupplier); + + when(mTabSupplier.get()).thenReturn(mTab); + when(mTab.getUrl()).thenReturn(mGURL); + } + + @Test + public void testSaveAction_buttonConfigHasPendingIntent_startsPendingIntent() + throws PendingIntent.CanceledException { + PendingIntent pendingIntent = mock(PendingIntent.class); + Context context = mActivity.getApplicationContext(); + BottomBarConfig.ButtonConfig buttonConfig = + new BottomBarConfig.ButtonConfig( + BottomBarConfigCreator.ButtonId.SAVE, + context.getDrawable(R.drawable.bookmark), + "Save button", + /* pendingIntent= */ pendingIntent); + + View.OnClickListener clickListener = + mGoogleBottomBarActionsHandler.getClickListener(buttonConfig); + clickListener.onClick(new View(context)); + + ArgumentCaptor<Intent> captor = ArgumentCaptor.forClass(Intent.class); + verify(pendingIntent) + .send(eq(mActivity), anyInt(), captor.capture(), any(), any(), any(), any()); + assertEquals(Uri.parse(TEST_URI), captor.getValue().getData()); + } + + @Test + public void testSaveAction_buttonConfigHasNoPendingIntent_showsTooltip() { + Context context = mActivity; + View buttonView = new View(context); + BottomBarConfig.ButtonConfig buttonConfig = + new BottomBarConfig.ButtonConfig( + BottomBarConfigCreator.ButtonId.SAVE, + context.getDrawable(R.drawable.bookmark), + context.getString( + R.string.google_bottom_bar_save_disabled_button_description), + /* pendingIntent= */ null); + TextBubble.setSkipShowCheckForTesting(true); + + View.OnClickListener clickListener = + mGoogleBottomBarActionsHandler.getClickListener(buttonConfig); + clickListener.onClick(buttonView); + + Set<TextBubble> textBubbleSet = TextBubble.getTextBubbleSetForTesting(); + assertEquals(1, textBubbleSet.size()); + } +}
diff --git a/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarCoordinator.java b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarCoordinator.java index b70ad7a..0a14f895 100644 --- a/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarCoordinator.java +++ b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarCoordinator.java
@@ -4,12 +4,15 @@ package org.chromium.chrome.browser.ui.google_bottom_bar; +import android.app.Activity; import android.content.Context; import android.view.View; import org.chromium.base.cached_flags.StringCachedFieldTrialParameter; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.browserservices.intents.CustomButtonParams; import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.ui.google_bottom_bar.proto.IntentParams.GoogleBottomBarIntentParams; import java.util.List; @@ -41,19 +44,22 @@ /** * Constructor. * - * @param context The associated {@link Context}. + * @param activity The associated {@link Activity}. + * @param tabProvider Supplier for the current activity tab. * @param googleBottomBarIntentParams The encoded button list provided through IntentParams * @param customButtonsOnGoogleBottomBar List of {@link CustomButtonParams} provided by the * embedder to be displayed in the Bottom Bar. */ public GoogleBottomBarCoordinator( - Context context, + Activity activity, + Supplier<Tab> tabProvider, GoogleBottomBarIntentParams googleBottomBarIntentParams, List<CustomButtonParams> customButtonsOnGoogleBottomBar) { - mContext = context; + mContext = activity; mGoogleBottomBarViewCreator = new GoogleBottomBarViewCreator( - context, + activity, + tabProvider, getButtonConfig( googleBottomBarIntentParams, customButtonsOnGoogleBottomBar)); }
diff --git a/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarViewCreator.java b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarViewCreator.java index 844d22d..4b5034f 100644 --- a/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarViewCreator.java +++ b/chrome/browser/ui/android/google_bottom_bar/java/src/org/chromium/chrome/browser/ui/google_bottom_bar/GoogleBottomBarViewCreator.java
@@ -4,51 +4,99 @@ package org.chromium.chrome.browser.ui.google_bottom_bar; +import android.app.Activity; import android.content.Context; import android.view.LayoutInflater; import android.view.View; +import android.widget.ImageView; +import androidx.annotation.Nullable; + +import org.chromium.base.supplier.Supplier; +import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.ui.google_bottom_bar.BottomBarConfig.ButtonConfig; +import org.chromium.chrome.browser.ui.google_bottom_bar.BottomBarConfigCreator.ButtonId; /** Builds the GoogleBottomBar view. */ public class GoogleBottomBarViewCreator { private final Context mContext; private final BottomBarConfig mConfig; + private final GoogleBottomBarActionsHandler mActionsHandler; + private View mRootView; /** * Constructor. * - * @param context An Android context. + * @param activity An Android activity. + * @param tabProvider Supplier for the current activity tab. * @param config Bottom bar configuration for the buttons that will be displayed. */ - public GoogleBottomBarViewCreator(Context context, BottomBarConfig config) { - mContext = context; + public GoogleBottomBarViewCreator( + Activity activity, Supplier<Tab> tabProvider, BottomBarConfig config) { + mContext = activity; mConfig = config; + mActionsHandler = new GoogleBottomBarActionsHandler(activity, tabProvider); } /** - * @return empty view. TODO: build view dynamically based on config + * Creates and initializes the bottom bar view. + * + * <p>This method dynamically determines the layout to use based on the presence of a spotlight + * ID in the configuration. If a spotlight ID exists, a specialized layout is used; otherwise, a + * standard even layout is used. TODO(b/290840238): Build view dynamically based on {@link + * BottomBarConfig}. + * + * @return The created and initialized bottom bar view. */ public View createGoogleBottomBarView() { - if (mConfig.getSpotlightId() != null) { - return createGoogleBottomBarSpotlightLayoutView(); - } else { - return createGoogleBottomBarEvenLayoutView(); + mRootView = + (mConfig.getSpotlightId() != null) + ? createGoogleBottomBarSpotlightLayoutView() + : createGoogleBottomBarEvenLayoutView(); + + initSaveButton(mRootView); + + return mRootView; + } + + boolean updateBottomBarButton(@Nullable ButtonConfig buttonConfig) { + if (buttonConfig == null) { + return false; } + ImageView button = mRootView.findViewById(buttonConfig.getId()); + return maybeUpdateButton(button, buttonConfig); + } + + private void initSaveButton(View rootView) { + ImageView imageView = rootView.findViewById(R.id.google_bottom_bar_save_button); + ButtonConfig buttonConfig = findButtonConfig(ButtonId.SAVE); + maybeUpdateButton(imageView, buttonConfig); + } + + private @Nullable ButtonConfig findButtonConfig(@ButtonId int buttonId) { + return mConfig.getButtonList().stream() + .filter(config -> config.getId() == buttonId) + .findFirst() + .orElse(null); } private View createGoogleBottomBarEvenLayoutView() { - return - LayoutInflater.from(mContext) - .inflate(R.layout.google_bottom_bar_even, null); + return LayoutInflater.from(mContext).inflate(R.layout.google_bottom_bar_even, null); } private View createGoogleBottomBarSpotlightLayoutView() { return LayoutInflater.from(mContext).inflate(R.layout.google_bottom_bar_spotlight, null); } - public boolean updateBottomBarButton(ButtonConfig buttonConfig) { - // TODO Add logic to update button - return buttonConfig != null; + private boolean maybeUpdateButton( + @Nullable ImageView button, @Nullable ButtonConfig buttonConfig) { + if (button == null || buttonConfig == null) { + return false; + } + button.setId(buttonConfig.getId()); + button.setImageDrawable(buttonConfig.getIcon()); + button.setContentDescription(buttonConfig.getDescription()); + button.setOnClickListener(mActionsHandler.getClickListener(buttonConfig)); + return true; } }
diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/SignOutCoordinator.java b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/SignOutCoordinator.java index 265f02e8..b48ed65 100644 --- a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/SignOutCoordinator.java +++ b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/SignOutCoordinator.java
@@ -213,10 +213,12 @@ public void preWipeData() { snackbarManager.showSnackbar( Snackbar.make( - context.getString(R.string.sign_out_snackbar_message), - /* controller= */ null, - Snackbar.TYPE_ACTION, - Snackbar.UMA_SIGN_OUT)); + context.getString( + R.string.sign_out_snackbar_message), + /* controller= */ null, + Snackbar.TYPE_ACTION, + Snackbar.UMA_SIGN_OUT) + .setSingleLine(false)); } @Override
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd index ee5cf6c..0d45cd3 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -2176,20 +2176,16 @@ <message name="IDS_SIGNOUT_MANAGED_ACCOUNT_MESSAGE" desc="Message to display for sign out of Chrome dialog when the account has enterprise management, and all user data will be erased"> Because you're signing out of an account managed by <ph name="DOMAIN_NAME">%1$s<ex>google.com</ex></ph>, your Chrome data will be deleted from this device. It will remain in your Google Account. </message> - <!-- TODO(crbug.com/41493790): Add description and remove translateable once strings are finalized. --> - <message name="IDS_SIGN_OUT_SNACKBAR_MESSAGE" desc="to be added" translateable="false"> - Signed out. Sign back in to use the bookmarks, passwords and more in your account. + <message name="IDS_SIGN_OUT_SNACKBAR_MESSAGE" desc="Snackbar message shown after signing out from account settings"> + Signed out. Sign back in to use the bookmarks, passwords and more in your account. </message> - <!-- TODO(crbug.com/41493791): Add description and remove translateable once strings are finalized. --> - <message name="IDS_SIGN_OUT_UNSAVED_DATA_TITLE" desc="to be added" translateable="false"> - Unsaved data + <message name="IDS_SIGN_OUT_UNSAVED_DATA_TITLE" desc="Title of a dialog shown to users when they sign out of Chrome but Chrome hasn't synced some data yet, which is permanently deleted if the user proceeds."> + Some data isn\u2019t saved yet </message> - <!-- TODO(crbug.com/41493791): Add description and remove translateable once strings are finalized. --> - <message name="IDS_SIGN_OUT_UNSAVED_DATA_MESSAGE" desc="to be added" translateable="false"> + <message name="IDS_SIGN_OUT_UNSAVED_DATA_MESSAGE" desc="Body of a dialog shown to users when they sign out of Chrome but Chrome hasn't synced some data yet, which is permanently deleted if the user proceeds."> Some of your Chrome data hasn\u2019t been saved in your Google Account yet.\nTry waiting a few minutes before signing out. If you sign out now, this data will be deleted. </message> - <!-- TODO(crbug.com/41493791): Add description and remove translateable once strings are finalized. --> - <message name="IDS_SIGN_OUT_UNSAVED_DATA_PRIMARY_BUTTON" desc="to be added" translateable="false"> + <message name="IDS_SIGN_OUT_UNSAVED_DATA_PRIMARY_BUTTON" desc="Button title of a dialog shown to users when they sign out of Chrome but Chrome hasn't synced some data yet, which is parmanently deleted if the user proceeds by pressing this button"> Delete and sign out </message> <message name="IDS_SIGN_IN_GETTING_ACCOUNT_MANAGEMENT_POLICY" desc="Title of progress bar dialog for getting management policy"> @@ -4672,6 +4668,20 @@ Close button to close privacy notice of page insights hub. </message> + <!-- GoogleBottomBar --> + <message name="IDS_GOOGLE_BOTTOM_BAR_SAVE_DISABLED_TOOLTIP_MESSAGE" desc="Tooltip message when disabled save button is clicked"> + Sign in to save this page + </message> + <message name="IDS_GOOGLE_BOTTOM_BAR_SAVE_DISABLED_BUTTON_DESCRIPTION" desc="Content description for disabled save button"> + Disabled save button + </message> + <message name="IDS_GOOGLE_BOTTOM_BAR_SHARE_BUTTON_DESCRIPTION" desc="Content description for share button"> + Share button + </message> + <message name="IDS_GOOGLE_BOTTOM_BAR_PAGE_INSIGHTS_BUTTON_DESCRIPTION" desc="Content description for page insights button"> + Page insights button + </message> + <!-- WebFeed --> <message name="IDS_WEB_FEED_FOLLOW_LOADING_DESCRIPTION" desc="The content description of the loading spinner after the user presses Follow and is waiting for a response."> Following...
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_GOOGLE_BOTTOM_BAR_PAGE_INSIGHTS_BUTTON_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_GOOGLE_BOTTOM_BAR_PAGE_INSIGHTS_BUTTON_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..70a3353b --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_GOOGLE_BOTTOM_BAR_PAGE_INSIGHTS_BUTTON_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +e998203fcf26811e79cd5437cf2bfc66567e4884 \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_GOOGLE_BOTTOM_BAR_SAVE_DISABLED_BUTTON_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_GOOGLE_BOTTOM_BAR_SAVE_DISABLED_BUTTON_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..70a3353b --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_GOOGLE_BOTTOM_BAR_SAVE_DISABLED_BUTTON_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +e998203fcf26811e79cd5437cf2bfc66567e4884 \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_GOOGLE_BOTTOM_BAR_SAVE_DISABLED_TOOLTIP_MESSAGE.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_GOOGLE_BOTTOM_BAR_SAVE_DISABLED_TOOLTIP_MESSAGE.png.sha1 new file mode 100644 index 0000000..391960c --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_GOOGLE_BOTTOM_BAR_SAVE_DISABLED_TOOLTIP_MESSAGE.png.sha1
@@ -0,0 +1 @@ +3b2f81195bf4d94b5059632008192cbba6b8f32e \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_GOOGLE_BOTTOM_BAR_SHARE_BUTTON_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_GOOGLE_BOTTOM_BAR_SHARE_BUTTON_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..e49a2b6 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_GOOGLE_BOTTOM_BAR_SHARE_BUTTON_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +a9f2ceec3d4bf88074df6aca92c961c5aea31488 \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_SIGN_OUT_SNACKBAR_MESSAGE.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_SIGN_OUT_SNACKBAR_MESSAGE.png.sha1 new file mode 100644 index 0000000..0273cd2 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_SIGN_OUT_SNACKBAR_MESSAGE.png.sha1
@@ -0,0 +1 @@ +f0ea48243d9409bae4ee60b7c1ada6a11aa96117 \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_SIGN_OUT_UNSAVED_DATA_MESSAGE.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_SIGN_OUT_UNSAVED_DATA_MESSAGE.png.sha1 new file mode 100644 index 0000000..a7eaa136 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_SIGN_OUT_UNSAVED_DATA_MESSAGE.png.sha1
@@ -0,0 +1 @@ +5c16afb0dd1d30a49ac2daaa0c10151c3e1651d7 \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_SIGN_OUT_UNSAVED_DATA_PRIMARY_BUTTON.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_SIGN_OUT_UNSAVED_DATA_PRIMARY_BUTTON.png.sha1 new file mode 100644 index 0000000..a7eaa136 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_SIGN_OUT_UNSAVED_DATA_PRIMARY_BUTTON.png.sha1
@@ -0,0 +1 @@ +5c16afb0dd1d30a49ac2daaa0c10151c3e1651d7 \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_SIGN_OUT_UNSAVED_DATA_TITLE.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_SIGN_OUT_UNSAVED_DATA_TITLE.png.sha1 new file mode 100644 index 0000000..a7eaa136 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_SIGN_OUT_UNSAVED_DATA_TITLE.png.sha1
@@ -0,0 +1 @@ +5c16afb0dd1d30a49ac2daaa0c10151c3e1651d7 \ No newline at end of file
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl_unittest.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl_unittest.cc index a1ba4e3..072408e 100644 --- a/chrome/browser/ui/autofill/autofill_popup_controller_impl_unittest.cc +++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl_unittest.cc
@@ -101,7 +101,7 @@ // Tests that the controller forwards calls to perform a button action (such as // clicking a close button on a suggestion) to its delegate. TEST_F(AutofillPopupControllerImplTest, ButtonActionsAreSentToDelegate) { - ShowSuggestions(manager(), {SuggestionType::kCompose}); + ShowSuggestions(manager(), {SuggestionType::kComposeResumeNudge}); EXPECT_CALL(manager().external_delegate(), DidPerformButtonActionForSuggestion); client().popup_controller(manager()).PerformButtonActionForSuggestion(0); @@ -143,7 +143,7 @@ // Tests that the popup controller queries the view for its screen location. TEST_F(AutofillPopupControllerImplTest, GetPopupScreenLocationCallsView) { - ShowSuggestions(manager(), {SuggestionType::kCompose}); + ShowSuggestions(manager(), {SuggestionType::kComposeResumeNudge}); using PopupScreenLocation = AutofillClient::PopupScreenLocation; constexpr gfx::Rect kSampleRect = gfx::Rect(123, 234); @@ -155,7 +155,7 @@ // Tests that a change to a text field hides a popup with a Compose suggestion. TEST_F(AutofillPopupControllerImplTest, HidesOnFieldChangeForComposeEntries) { - ShowSuggestions(manager(), {SuggestionType::kCompose}); + ShowSuggestions(manager(), {SuggestionType::kComposeResumeNudge}); EXPECT_CALL(client().popup_controller(manager()), Hide(SuggestionHidingReason::kFieldValueChanged)); manager().NotifyObservers(
diff --git a/chrome/browser/ui/autofill/autofill_suggestion_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_suggestion_controller_unittest.cc index af0edf4..f9597826 100644 --- a/chrome/browser/ui/autofill/autofill_suggestion_controller_unittest.cc +++ b/chrome/browser/ui/autofill/autofill_suggestion_controller_unittest.cc
@@ -131,10 +131,10 @@ // Regression test for (crbug.com/1513574): Showing an Autofill Compose // suggestion twice does not crash. TEST_F(AutofillSuggestionControllerTest, ShowTwice) { - ShowSuggestions(manager(), - {Suggestion(u"Help me write", SuggestionType::kCompose)}); - ShowSuggestions(manager(), - {Suggestion(u"Help me write", SuggestionType::kCompose)}); + ShowSuggestions(manager(), {Suggestion(u"Help me write", + SuggestionType::kComposeResumeNudge)}); + ShowSuggestions(manager(), {Suggestion(u"Help me write", + SuggestionType::kComposeResumeNudge)}); } // Tests that the AED is informed when suggestions were shown.
diff --git a/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.cc b/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.cc index b576637a..4335ed3 100644 --- a/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.cc +++ b/chrome/browser/ui/autofill/autofill_suggestion_controller_utils.cc
@@ -52,7 +52,8 @@ case SuggestionType::kAddressEntry: case SuggestionType::kAddressFieldByFieldFilling: case SuggestionType::kAutocompleteEntry: - case SuggestionType::kCompose: + case SuggestionType::kComposeResumeNudge: + case SuggestionType::kComposeProactiveNudge: case SuggestionType::kComposeDisable: case SuggestionType::kComposeGoToSettings: case SuggestionType::kComposeNeverShowOnThisSiteAgain:
diff --git a/chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.cc b/chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.cc index 7f611f702..07f2d48b 100644 --- a/chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.cc +++ b/chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.cc
@@ -694,8 +694,9 @@ } // static -void SaveCardBubbleControllerImpl::IgnoreWindowActivationForTesting() { - g_ignore_window_activation_for_testing = true; +base::AutoReset<bool> +SaveCardBubbleControllerImpl::IgnoreWindowActivationForTesting() { + return base::AutoReset<bool>(&g_ignore_window_activation_for_testing, true); } void SaveCardBubbleControllerImpl::OnVisibilityChanged(
diff --git a/chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.h b/chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.h index 433dc6a..93207780 100644 --- a/chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.h +++ b/chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.h
@@ -7,6 +7,7 @@ #include <memory> +#include "base/auto_reset.h" #include "base/memory/raw_ptr.h" #include "chrome/browser/ui/autofill/autofill_bubble_controller_base.h" #include "chrome/browser/ui/autofill/payments/save_card_bubble_controller.h" @@ -128,7 +129,7 @@ PaymentBubbleType GetPaymentBubbleType() const override; int GetSaveSuccessAnimationStringId() const override; - static void IgnoreWindowActivationForTesting(); + static base::AutoReset<bool> IgnoreWindowActivationForTesting(); protected: explicit SaveCardBubbleControllerImpl(content::WebContents* web_contents);
diff --git a/chrome/browser/ui/views/autofill/payments/save_card_bubble_views_browsertest.cc b/chrome/browser/ui/views/autofill/payments/save_card_bubble_views_browsertest.cc index 1763292..fd7349b1 100644 --- a/chrome/browser/ui/views/autofill/payments/save_card_bubble_views_browsertest.cc +++ b/chrome/browser/ui/views/autofill/payments/save_card_bubble_views_browsertest.cc
@@ -234,8 +234,6 @@ geolocation_overrider_ = std::make_unique<device::ScopedGeolocationOverrider>( kFakeGeolocationLatitude, kFakeGeolocationLongitude); - - SaveCardBubbleControllerImpl::IgnoreWindowActivationForTesting(); } void TearDownOnMainThread() override { @@ -768,6 +766,9 @@ scoped_refptr<network::SharedURLLoaderFactory> test_shared_loader_factory_; TestAutofillManagerInjector<TestAutofillManager> autofill_manager_injector_; std::unique_ptr<device::ScopedGeolocationOverrider> geolocation_overrider_; + + base::AutoReset<bool> ignore_window_activation_for_testing_{ + SaveCardBubbleControllerImpl::IgnoreWindowActivationForTesting()}; }; // Tests the local save bubble. Ensures that clicking the [No thanks] button
diff --git a/chrome/browser/ui/views/autofill/popup/popup_cell_utils_unittest.cc b/chrome/browser/ui/views/autofill/popup/popup_cell_utils_unittest.cc index 26bd69c..f15c3408 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_cell_utils_unittest.cc +++ b/chrome/browser/ui/views/autofill/popup/popup_cell_utils_unittest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/autofill/popup/popup_cell_utils.h" #include "chrome/app/vector_icons/vector_icons.h" +#include "chrome/browser/ui/views/autofill/popup/popup_view_utils.h" #include "components/autofill/core/browser/ui/suggestion_type.h" #include "components/vector_icons/vector_icons.h" #include "testing/gtest/include/gtest/gtest.h" @@ -21,12 +22,13 @@ TEST(PopupCellUtilsTest, GetExpandableMenuIcon_ComposeSuggestions_ReturnThreeDotsMenuIcon) { - EXPECT_EQ( - GetExpandableMenuIconNameFromSuggestionType(SuggestionType::kCompose), - kBrowserToolsChromeRefreshIcon.name); EXPECT_EQ(GetExpandableMenuIconNameFromSuggestionType( - SuggestionType::kComposeSavedStateNotification), + SuggestionType::kComposeProactiveNudge), kBrowserToolsChromeRefreshIcon.name); + // No other Compose type should allow an expandable menu. + EXPECT_FALSE(IsExpandableSuggestionType(SuggestionType::kComposeResumeNudge)); + EXPECT_FALSE(IsExpandableSuggestionType( + SuggestionType::kComposeSavedStateNotification)); } TEST(PopupCellUtilsTest,
diff --git a/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.cc b/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.cc index a2cb782..0e66d84 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.cc +++ b/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils.cc
@@ -479,7 +479,10 @@ a11y_selection_delegate, selection_delegate, controller, line_number, CreatePasswordPopupRowContentView(suggestion, std::move(filter_match))); - case SuggestionType::kCompose: { + case SuggestionType::kComposeResumeNudge: + case SuggestionType::kComposeProactiveNudge: { + // Todo (http://b/340147177): Confirm that both Compose popups should use + // the same feature for a new badge and update feature name. const bool show_new_badge = UserEducationService::MaybeShowNewBadge( controller->GetWebContents()->GetBrowserContext(), compose::features::kEnableComposeSavedStateNudge);
diff --git a/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils_browsertest.cc b/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils_browsertest.cc index afd428c..6c29aff 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils_browsertest.cc +++ b/chrome/browser/ui/views/autofill/popup/popup_row_factory_utils_browsertest.cc
@@ -70,7 +70,7 @@ "Minor text", "label", Suggestion::Icon::kMagic, - SuggestionType::kCompose), + SuggestionType::kComposeResumeNudge), Suggestion("Edit_address", "label", Suggestion::Icon::kEdit,
diff --git a/chrome/browser/ui/views/autofill/popup/popup_row_view_unittest.cc b/chrome/browser/ui/views/autofill/popup/popup_row_view_unittest.cc index 0661d85..319bcf5 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_row_view_unittest.cc +++ b/chrome/browser/ui/views/autofill/popup/popup_row_view_unittest.cc
@@ -467,7 +467,7 @@ .set_index = 2, }, PosInSetTestdata{ - .types = {SuggestionType::kCompose}, + .types = {SuggestionType::kComposeResumeNudge}, .line_number = 0, .set_size = 1, .set_index = 1,
diff --git a/chrome/browser/ui/views/autofill/popup/popup_view_utils.cc b/chrome/browser/ui/views/autofill/popup/popup_view_utils.cc index 9707a9a..f2e8a62 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_view_utils.cc +++ b/chrome/browser/ui/views/autofill/popup/popup_view_utils.cc
@@ -441,8 +441,7 @@ case SuggestionType::kAddressFieldByFieldFilling: case SuggestionType::kCreditCardEntry: case SuggestionType::kCreditCardFieldByFieldFilling: - case SuggestionType::kCompose: - case SuggestionType::kComposeSavedStateNotification: + case SuggestionType::kComposeProactiveNudge: case SuggestionType::kDevtoolsTestAddresses: case SuggestionType::kFillFullAddress: case SuggestionType::kFillFullEmail: @@ -455,9 +454,11 @@ case SuggestionType::kAutocompleteEntry: case SuggestionType::kAutofillOptions: case SuggestionType::kClearForm: + case SuggestionType::kComposeResumeNudge: case SuggestionType::kComposeDisable: case SuggestionType::kComposeGoToSettings: case SuggestionType::kComposeNeverShowOnThisSiteAgain: + case SuggestionType::kComposeSavedStateNotification: case SuggestionType::kCreateNewPlusAddress: case SuggestionType::kDatalistEntry: case SuggestionType::kDeleteAddressProfile:
diff --git a/chrome/browser/ui/views/autofill/popup/popup_view_views.cc b/chrome/browser/ui/views/autofill/popup/popup_view_views.cc index 8d110ef8..a51e04a 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_view_views.cc +++ b/chrome/browser/ui/views/autofill/popup/popup_view_views.cc
@@ -218,10 +218,28 @@ absl::get<PopupWarningView*>(rows_[0])->NotifyAccessibilityEvent( ax::mojom::Event::kAlert, true); } - // Compose popups are announced separately. + + // Compose has separate on show announcements. + // TODO(b/340359989): Replace with AutofillComposeDelegate::OnShow if (controller_->GetMainFillingProduct() == FillingProduct::kCompose) { - AxAnnounce( - l10n_util::GetStringUTF16(IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW)); + switch (controller_->GetSuggestionAt(0).type) { + case SuggestionType::kComposeResumeNudge: + case SuggestionType::kComposeSavedStateNotification: + AxAnnounce(l10n_util::GetStringUTF16( + IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW_RESUME)); + break; + case SuggestionType::kComposeProactiveNudge: + AxAnnounce(l10n_util::GetStringUTF16( + IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW_PROACTIVE)); + break; + case SuggestionType::kComposeDisable: + case SuggestionType::kComposeGoToSettings: + case SuggestionType::kComposeNeverShowOnThisSiteAgain: + break; + default: + // All Compose SuggestionTypes should already be handled. + NOTREACHED_NORETURN(); + } } return !CanActivate() || (GetWidget() && GetWidget()->IsActive());
diff --git a/chrome/browser/ui/views/autofill/popup/popup_view_views_unittest.cc b/chrome/browser/ui/views/autofill/popup/popup_view_views_unittest.cc index 448442ec..11815ced 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_view_views_unittest.cc +++ b/chrome/browser/ui/views/autofill/popup/popup_view_views_unittest.cc
@@ -848,7 +848,7 @@ // Tests that pressing TAB selects a previously unselected Compose suggestion. TEST_F(PopupViewViewsTest, ComposeSuggestion_TabSelects) { - CreateAndShowView({SuggestionType::kCompose}); + CreateAndShowView({SuggestionType::kComposeResumeNudge}); ASSERT_FALSE(view().GetSelectedCell().has_value()); SimulateKeyPress(ui::VKEY_TAB, /*shift_modifier_pressed=*/false); EXPECT_TRUE(view().GetSelectedCell().has_value()); @@ -859,7 +859,7 @@ TEST_F(PopupViewViewsTest, ComposeSuggestion_ShiftTabDoesNotAffect) { EXPECT_CALL(controller(), Hide).Times(0); - CreateAndShowView({SuggestionType::kCompose}); + CreateAndShowView({SuggestionType::kComposeResumeNudge}); ASSERT_FALSE(view().GetSelectedCell().has_value()); SimulateKeyPress(ui::VKEY_TAB, /*shift_modifier_pressed=*/true); EXPECT_FALSE(view().GetSelectedCell().has_value()); @@ -867,7 +867,7 @@ TEST_F(PopupViewViewsTest, ComposeSuggestion_LeftAndRightKeyEventsAreHandled) { controller().set_suggestions({CreateSuggestionWithChildren( - SuggestionType::kCompose, {Suggestion(u"Child #1")})}); + SuggestionType::kComposeProactiveNudge, {Suggestion(u"Child #1")})}); CreateAndShowView(); view().SetSelectedCell(CellIndex{0, CellType::kContent}, PopupCellSelectionSource::kNonUserInput); @@ -891,7 +891,7 @@ base::i18n::SetRTLForTesting(true); controller().set_suggestions({CreateSuggestionWithChildren( - SuggestionType::kCompose, {Suggestion(u"Child #1")})}); + SuggestionType::kComposeProactiveNudge, {Suggestion(u"Child #1")})}); CreateAndShowView(); view().SetSelectedCell(CellIndex{0, CellType::kContent}, PopupCellSelectionSource::kNonUserInput); @@ -955,7 +955,7 @@ ComposeSuggestion_TabWithSelectedComposeSuggestionHidesPopup) { EXPECT_CALL(controller(), Hide(SuggestionHidingReason::kUserAborted)); - CreateAndShowView({SuggestionType::kCompose}); + CreateAndShowView({SuggestionType::kComposeResumeNudge}); view().SetSelectedCell(CellIndex{0u, CellType::kContent}, PopupCellSelectionSource::kNonUserInput); SimulateKeyPress(ui::VKEY_TAB, /*shift_modifier_pressed=*/false); @@ -967,7 +967,7 @@ TEST_F(PopupViewViewsTest, ComposeSuggestion_NoSubPopup_ShiftTabUnselects) { EXPECT_CALL(controller(), Hide).Times(0); - CreateAndShowView({SuggestionType::kCompose}); + CreateAndShowView({SuggestionType::kComposeResumeNudge}); view().SetSelectedCell(CellIndex{0u, CellType::kContent}, PopupCellSelectionSource::kNonUserInput); SimulateKeyPress(ui::VKEY_TAB, /*shift_modifier_pressed=*/true); @@ -981,7 +981,7 @@ PopupViewViewsTest, ComposeSuggestion_SubPopupOpen_ShiftTabClosesSubpopupAndSelectsContentCell) { controller().set_suggestions({CreateSuggestionWithChildren( - SuggestionType::kCompose, {Suggestion(u"Child #1")})}); + SuggestionType::kComposeProactiveNudge, {Suggestion(u"Child #1")})}); CreateAndShowView(); CellIndex cell_content = CellIndex{0, CellType::kContent}; @@ -999,7 +999,7 @@ // Tests that pressing up/down cursor keys does not select a Compose suggestion. TEST_F(PopupViewViewsTest, ComposeSuggestion_CursorUpDownDoesNotSelect) { - CreateAndShowView({SuggestionType::kCompose}); + CreateAndShowView({SuggestionType::kComposeResumeNudge}); ASSERT_FALSE(view().GetSelectedCell().has_value()); SimulateKeyPress(ui::VKEY_DOWN, /*shift_modifier_pressed=*/false); EXPECT_FALSE(view().GetSelectedCell().has_value()); @@ -1011,7 +1011,7 @@ TEST_F(PopupViewViewsTest, ComposeSuggestion_EscapeClosesComposePopup) { EXPECT_CALL(controller(), Hide(SuggestionHidingReason::kUserAborted)); - CreateAndShowView({SuggestionType::kCompose}); + CreateAndShowView({SuggestionType::kComposeResumeNudge}); SimulateKeyPress(ui::VKEY_ESCAPE, /*shift_modifier_pressed=*/false); } @@ -1408,7 +1408,7 @@ // Tests that `GetPopupScreenLocation` returns the bounds and arrow position of // the popup. TEST_F(PopupViewViewsTest, GetPopupScreenLocation) { - CreateAndShowView({SuggestionType::kCompose}); + CreateAndShowView({SuggestionType::kComposeResumeNudge}); using PopupScreenLocation = AutofillClient::PopupScreenLocation; auto MatchesScreenLocation =
diff --git a/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc b/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc index f50663a..51dee2f 100644 --- a/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc +++ b/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc
@@ -78,13 +78,11 @@ } void OmniboxChipButton::AnimateCollapse(base::TimeDelta duration) { - base_width_ = 0; animation_->SetSlideDuration(duration); ForceAnimateCollapse(); } void OmniboxChipButton::AnimateExpand(base::TimeDelta duration) { - base_width_ = 0; animation_->SetSlideDuration(duration); ForceAnimateExpand(); } @@ -98,17 +96,18 @@ gfx::Size OmniboxChipButton::CalculatePreferredSize( const views::SizeBounds& available_size) const { const int fixed_width = GetIconSize() + GetInsets().width(); - const int collapsable_width = - label() - ->GetPreferredSize(views::SizeBounds(label()->width(), {})) - .width() + - kChipImagePadding + kExtraRightPadding; + constexpr int extra_width = kChipImagePadding + kExtraRightPadding; + views::SizeBound available_width = std::max<views::SizeBound>( + 0, available_size.width() - fixed_width - extra_width); + const int label_width = + label()->GetPreferredSize(views::SizeBounds(available_width, {})).width(); + const int collapsable_width = label_width + extra_width; const int width = - base_width_ + base::ClampRound(collapsable_width * animation_->GetCurrentValue()) + fixed_width; - return gfx::Size(width, GetHeightForWidth(width)); + return views::LabelButton::CalculatePreferredSize( + views::SizeBounds(width, {})); } void OmniboxChipButton::OnThemeChanged() {
diff --git a/chrome/browser/ui/views/location_bar/omnibox_chip_button.h b/chrome/browser/ui/views/location_bar/omnibox_chip_button.h index f7dd98e..8f7f306 100644 --- a/chrome/browser/ui/views/location_bar/omnibox_chip_button.h +++ b/chrome/browser/ui/views/location_bar/omnibox_chip_button.h
@@ -91,8 +91,6 @@ OmniboxChipTheme theme_ = OmniboxChipTheme::kLowVisibility; - int base_width_ = 0; - // If chip is collapsed. In the collapsed state, only an icon is visible, // without text. bool fully_collapsed_ = false;
diff --git a/chrome/browser/ui/views/permissions/chip/permission_chip_view.cc b/chrome/browser/ui/views/permissions/chip/permission_chip_view.cc index 996bb3e..bdf3b33 100644 --- a/chrome/browser/ui/views/permissions/chip/permission_chip_view.cc +++ b/chrome/browser/ui/views/permissions/chip/permission_chip_view.cc
@@ -102,18 +102,19 @@ gfx::Size PermissionChipView::CalculatePreferredSize( const views::SizeBounds& available_size) const { const int icon_width = GetIconViewWidth(); + const int extra_width = GetPadding().width() + icon_width; + views::SizeBound available_width = + std::max<views::SizeBound>(0, available_size.width() - extra_width); const int label_width = - label() - ->GetPreferredSize(views::SizeBounds(label()->width(), {})) - .width() + - GetPadding().width(); + label()->GetPreferredSize(views::SizeBounds(available_width, {})).width(); + const int collapsable_width = label_width + GetPadding().width(); const int width = - base_width_ + - base::ClampRound(label_width * animation_->GetCurrentValue()) + - icon_width; + base_width_ + icon_width + + base::ClampRound(collapsable_width * animation_->GetCurrentValue()); - return gfx::Size(width, GetHeightForWidth(width)); + return views::LabelButton::CalculatePreferredSize( + views::SizeBounds(width, {})); } void PermissionChipView::OnThemeChanged() {
diff --git a/chrome/browser/ui/views/translate/partial_translate_bubble_view.cc b/chrome/browser/ui/views/translate/partial_translate_bubble_view.cc index 3158c2f9..4ee8ce5 100644 --- a/chrome/browser/ui/views/translate/partial_translate_bubble_view.cc +++ b/chrome/browser/ui/views/translate/partial_translate_bubble_view.cc
@@ -355,7 +355,9 @@ std::unique_ptr<PartialTranslateBubbleModel> model, content::WebContents* web_contents, base::OnceClosure on_closing) - : LocationBarBubbleDelegateView(anchor_view, web_contents), + : LocationBarBubbleDelegateView(anchor_view, + web_contents, + /*autosize=*/true), model_(std::move(model)), on_closing_(std::move(on_closing)), web_contents_(web_contents) { @@ -432,7 +434,6 @@ } } else { SwitchView(PartialTranslateBubbleModel::VIEW_STATE_AFTER_TRANSLATE); - SizeToContents(); if (from_source_language_view) { translate::ReportPartialTranslateBubbleUiAction( translate::PartialTranslateBubbleUiEvent:: @@ -473,10 +474,6 @@ for (views::View* view : children()) { view->SetVisible(view == GetCurrentView()); } - - // BoxLayout only considers visible children, so ensure any newly visible - // child views are positioned correctly. - DeprecatedLayoutImmediately(); } std::unique_ptr<views::View> PartialTranslateBubbleView::CreateEmptyPane() { @@ -986,7 +983,6 @@ } UpdateChildVisibilities(); - SizeToContents(); } void PartialTranslateBubbleView::UpdateTextForViewState(
diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.cc b/chrome/browser/ui/views/translate/translate_bubble_view.cc index 960d4304..b8b37c4 100644 --- a/chrome/browser/ui/views/translate/translate_bubble_view.cc +++ b/chrome/browser/ui/views/translate/translate_bubble_view.cc
@@ -421,7 +421,9 @@ translate::TranslateErrors error_type, content::WebContents* web_contents, base::OnceClosure on_closing) - : LocationBarBubbleDelegateView(anchor_view, web_contents), + : LocationBarBubbleDelegateView(anchor_view, + web_contents, + /*autosize=*/true), model_(std::move(model)), error_type_(error_type), is_in_incognito_window_( @@ -472,7 +474,6 @@ model_->SetAlwaysTranslate(should_always_translate_); if (model_->IsPageTranslatedInCurrentLanguages()) { SwitchView(TranslateBubbleModel::VIEW_STATE_AFTER_TRANSLATE); - SizeToContents(); } else { std::u16string source_language_name; std::u16string target_language_name; @@ -527,10 +528,6 @@ for (views::View* view : children()) { view->SetVisible(view == GetCurrentView()); } - - // BoxLayout only considers visible children, so ensure any newly visible - // child views are positioned correctly. - DeprecatedLayoutImmediately(); } std::unique_ptr<views::View> TranslateBubbleView::CreateEmptyPane() { @@ -999,7 +996,6 @@ } UpdateChildVisibilities(); - SizeToContents(); if (view_state == TranslateBubbleModel::VIEW_STATE_AFTER_TRANSLATE) { AnnounceTextToScreenReader(l10n_util::GetStringFUTF16(
diff --git a/chrome/browser/ui/webui/ash/app_install/app_install_page_handler.cc b/chrome/browser/ui/webui/ash/app_install/app_install_page_handler.cc index 5d60c36..f92532e 100644 --- a/chrome/browser/ui/webui/ash/app_install/app_install_page_handler.cc +++ b/chrome/browser/ui/webui/ash/app_install/app_install_page_handler.cc
@@ -6,14 +6,15 @@ #include <utility> +#include "base/functional/callback_helpers.h" #include "base/functional/overloaded.h" #include "base/metrics/user_metrics.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" +#include "chrome/browser/apps/app_service/metrics/app_discovery_metrics.h" #include "chrome/browser/apps/app_service/package_id_util.h" #include "chrome/browser/ui/webui/ash/app_install/app_install.mojom.h" #include "chrome/browser/web_applications/web_app_constants.h" -#include "chrome/browser/web_applications/web_app_helpers.h" #include "components/metrics/structured/structured_events.h" #include "components/metrics/structured/structured_metrics_client.h" #include "components/services/app_service/public/cpp/app_launch_util.h" @@ -31,14 +32,6 @@ bool g_auto_accept_for_testing = false; -// TODO(b/330414871): AppInstallService shouldn't know about publisher specific -// logic, remove the generation of app_ids. -std::string GetAppId(const apps::PackageId& package_id) { - CHECK_EQ(package_id.package_type(), apps::PackageType::kWeb); - // data->package_id.identifier() is the manifest ID for web apps. - return web_app::GenerateAppIdFromManifestId(GURL(package_id.identifier())); -} - } // namespace // static @@ -87,26 +80,31 @@ return; } - if (auto* app_info_args = absl::get_if<AppInfoArgs>(&dialog_args_.value())) { - if (app_info_args->dialog_accepted_callback) { - base::RecordAction( - base::UserMetricsAction("ChromeOS.AppInstallDialog.Cancelled")); + // Ensure that `close_dialog_callback_` always runs. `close_dialog_callback_` + // could be null if the close button is clicked multiple times . In this case, + // the ScopedClosureRunner will not run anything. + base::ScopedClosureRunner close_callback_runner( + std::move(close_dialog_callback_)); + if (auto* app_info_args = absl::get_if<AppInfoArgs>(&dialog_args_.value())) { + if (!app_info_args->dialog_accepted_callback) { + return; + } + + base::RecordAction( + base::UserMetricsAction("ChromeOS.AppInstallDialog.Cancelled")); + + if (std::optional<std::string> metrics_id = + apps::AppDiscoveryMetrics::GetAppStringToRecordForPackage( + app_info_args->package_id)) { metrics::structured::StructuredMetricsClient::Record( cros_events::AppDiscovery_Browser_AppInstallDialogResult() .SetWebAppInstallStatus( ToLong(web_app::WebAppInstallStatus::kCancelled)) - // TODO(b/333643533): This should be using - // AppDiscoveryMetrics::GetAppStringToRecord(). - .SetAppId(GetAppId(app_info_args->package_id))); - std::move(app_info_args->dialog_accepted_callback).Run(false); + .SetAppId(*metrics_id)); } - } - // The callback could be null if the close button is clicked a second time - // before the dialog closes. - if (close_dialog_callback_) { - std::move(close_dialog_callback_).Run(); + std::move(app_info_args->dialog_accepted_callback).Run(false); } } @@ -119,13 +117,16 @@ base::RecordAction( base::UserMetricsAction("ChromeOS.AppInstallDialog.Installed")); - metrics::structured::StructuredMetricsClient::Record( - cros_events::AppDiscovery_Browser_AppInstallDialogResult() - .SetWebAppInstallStatus( - ToLong(web_app::WebAppInstallStatus::kAccepted)) - // TODO(b/333643533): This should be using - // AppDiscoveryMetrics::GetAppStringToRecord(). - .SetAppId(GetAppId(app_info_args.package_id))); + + if (std::optional<std::string> metrics_id = + apps::AppDiscoveryMetrics::GetAppStringToRecordForPackage( + app_info_args.package_id)) { + metrics::structured::StructuredMetricsClient::Record( + cros_events::AppDiscovery_Browser_AppInstallDialogResult() + .SetWebAppInstallStatus( + ToLong(web_app::WebAppInstallStatus::kAccepted)) + .SetAppId(*metrics_id)); + } install_app_callback_ = std::move(callback); std::move(app_info_args.dialog_accepted_callback).Run(true);
diff --git a/chrome/browser/ui/webui/ash/login/enrollment_screen_handler.cc b/chrome/browser/ui/webui/ash/login/enrollment_screen_handler.cc index 161778b5..798caaf 100644 --- a/chrome/browser/ui/webui/ash/login/enrollment_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/enrollment_screen_handler.cc
@@ -8,7 +8,6 @@ #include <utility> #include <vector> -#include "ash/constants/ash_features.h" #include "base/functional/bind.h" #include "base/json/json_reader.h" #include "base/logging.h" @@ -136,15 +135,10 @@ if (config.license_type == policy::LicenseType::kNone) { return false; } - // Retrieve if the device is Education for InitialEnrollment. - if (features::IsEducationEnrollmentOobeFlowEnabled()) { - return true; - } // Retrieve the License already used for enrollment from DMServer // for AutoEnrollment from message DeviceStateRetrievalResponse. - if (features::IsAutoEnrollmentKioskInOobeEnabled() && - config.is_automatic_enrollment()) { + if (config.is_automatic_enrollment()) { return true; } @@ -203,8 +197,7 @@ // start from enter your account view. CallExternalAPI("doReload"); - if (features::IsEducationEnrollmentOobeFlowEnabled() && - config_.license_type == policy::LicenseType::kEducation) { + if (config_.license_type == policy::LicenseType::kEducation) { ShowErrorMessage( l10n_util::GetStringFUTF8( IDS_ENTERPRISE_ENROLLMENT_CONSUMER_ACCOUNT_WITH_EDU_PACKAGED_LICENSE_ACCOUNT_CHECK, @@ -339,8 +332,7 @@ /*retry=*/true); break; case policy::DM_STATUS_SERVICE_CONSUMER_ACCOUNT_WITH_PACKAGED_LICENSE: - if (features::IsEducationEnrollmentOobeFlowEnabled() && - config_.license_type == policy::LicenseType::kEducation) { + if (config_.license_type == policy::LicenseType::kEducation) { ShowError( IDS_ENTERPRISE_ENROLLMENT_CONSUMER_ACCOUNT_WITH_EDU_PACKAGED_LICENSE, /*retry=*/true);
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index d334e0c..42554a5 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1715644735-73fcb0819a8b6db969d12583ee03571994532f7c-7967106f59cbb413e347d9c054076ca515b0be2b.profdata +chrome-android32-main-1715666021-ab6d170f507e0ae2976d400244744ab93e665868-e6894b870ff208ad340ce54dc08e7edc41edbe01.profdata
diff --git a/chrome/build/lacros64.pgo.txt b/chrome/build/lacros64.pgo.txt index ce7ded87..f4be530 100644 --- a/chrome/build/lacros64.pgo.txt +++ b/chrome/build/lacros64.pgo.txt
@@ -1 +1 @@ -chrome-chromeos-amd64-generic-main-1715601385-ade6988c636ab82d3c75605179f305b96268c935-dc3597a14f378c1b6397ce86ac44ae90d3440f10.profdata +chrome-chromeos-amd64-generic-main-1715645916-c675fc77c96d08df57cd43834815e004811591f8-c1a26ae8ea5563f75061d3f33e945f890dc0b8b5.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 4acc3fa2..03bca6e 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1715601385-e703d42f27777a5dad55fc8aa28241c8e38502c7-dc3597a14f378c1b6397ce86ac44ae90d3440f10.profdata +chrome-linux-main-1715666021-a517d558ad7d2127cbd2120ddbf62dd6263c3a01-e6894b870ff208ad340ce54dc08e7edc41edbe01.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index a7c5fda5..d3d5338 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1715651842-4e4d55063246423ddb40964131a4b87aa78b70a5-df2a15d6120cdf013ec902b0e92a63217569d53a.profdata +chrome-mac-arm-main-1715669519-035f439c47e56b7bf81bb06b85d961ba41ab5c36-65b9aed25b5698a5b5fa2095f2fab14f24db05db.profdata
diff --git a/chrome/build/win-arm64.pgo.txt b/chrome/build/win-arm64.pgo.txt index 345ec40..ca64f976 100644 --- a/chrome/build/win-arm64.pgo.txt +++ b/chrome/build/win-arm64.pgo.txt
@@ -1 +1 @@ -chrome-win-arm64-main-1715644735-602295160645439e887257a489b5e86aa3abfbcb-7967106f59cbb413e347d9c054076ca515b0be2b.profdata +chrome-win-arm64-main-1715666021-d061382ec3bd2f1097cb17052953b32a8d6da5ad-e6894b870ff208ad340ce54dc08e7edc41edbe01.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 8e70508..864518e 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1715644735-8a983c56105ad936efb4f08f8d1979ae916c5edc-7967106f59cbb413e347d9c054076ca515b0be2b.profdata +chrome-win32-main-1715666021-ff943ea0c1d8e9b05e64312a95667194301fce91-e6894b870ff208ad340ce54dc08e7edc41edbe01.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 3a48ab4..d9a7f313 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1715644735-0f5bf6e802f1ce0a0ab96d8ff2a8e86c305a27fb-7967106f59cbb413e347d9c054076ca515b0be2b.profdata +chrome-win64-main-1715666021-8c0a392b92b201a70fa64144484296b290acda96-e6894b870ff208ad340ce54dc08e7edc41edbe01.profdata
diff --git a/chrome/common/extensions/api/autotest_private.idl b/chrome/common/extensions/api/autotest_private.idl index 76be1b072..7474ab91 100644 --- a/chrome/common/extensions/api/autotest_private.idl +++ b/chrome/common/extensions/api/autotest_private.idl
@@ -382,6 +382,7 @@ double presentDeviation; double renderQuality; double janksPerMinute; + double janksPercentage; }; callback TakeScreenshotCallback = void (DOMString base64Png);
diff --git a/chrome/installer/setup/archive_patch_helper.cc b/chrome/installer/setup/archive_patch_helper.cc index c9fb7b93..fb1f3ebd 100644 --- a/chrome/installer/setup/archive_patch_helper.cc +++ b/chrome/installer/setup/archive_patch_helper.cc
@@ -41,7 +41,7 @@ UnPackConsumer consumer) { ArchivePatchHelper instance(working_directory, compressed_archive, patch_source, target, consumer); - return (instance.Uncompress(nullptr) && instance.ApplyPatch()); + return (instance.Uncompress(nullptr) && instance.ApplyAndDeletePatch()); } bool ArchivePatchHelper::Uncompress(base::FilePath* last_uncompressed_file) { @@ -62,12 +62,18 @@ return true; } -bool ArchivePatchHelper::ApplyPatch() { +bool ArchivePatchHelper::ApplyAndDeletePatch() { + bool succeeded = false; #if BUILDFLAG(ZUCCHINI) - if (ZucchiniEnsemblePatch()) - return true; + succeeded = ZucchiniEnsemblePatch(); #endif // BUILDFLAG(ZUCCHINI) - return CourgetteEnsemblePatch() || BinaryPatch(); + if (!succeeded) { + succeeded = CourgetteEnsemblePatch() || BinaryPatch(); + } + if (!last_uncompressed_file_.empty()) { + base::DeleteFile(last_uncompressed_file_); + } + return succeeded; } bool ArchivePatchHelper::CourgetteEnsemblePatch() {
diff --git a/chrome/installer/setup/archive_patch_helper.h b/chrome/installer/setup/archive_patch_helper.h index 3b39865..8c945d6 100644 --- a/chrome/installer/setup/archive_patch_helper.h +++ b/chrome/installer/setup/archive_patch_helper.h
@@ -64,7 +64,8 @@ // constructor using files from |patch_source|. Ensemble patching via // Zucchini is attempted first (if it is enabled). If that fails patching via // Courgette is attempted. Courgette falls back to bspatch if unsuccessful. - bool ApplyPatch(); + // The uncompressed patch file is unconditionally deleted at the end. + bool ApplyAndDeletePatch(); // Attempts to use Courgette to apply last_uncompressed_file() to // patch_source() to generate target(). Returns false if patching fails.
diff --git a/chrome/installer/setup/unpack_archive.cc b/chrome/installer/setup/unpack_archive.cc index a7d9791..1f4f4f77b 100644 --- a/chrome/installer/setup/unpack_archive.cc +++ b/chrome/installer/setup/unpack_archive.cc
@@ -141,7 +141,7 @@ // --- Background --- // 1m (50%ile) / >60m (99%ile) installer_state.SetStage(PATCHING); - if (!archive_helper->ApplyPatch()) { + if (!archive_helper->ApplyAndDeletePatch()) { installer_state.WriteInstallerResult(APPLY_DIFF_PATCH_FAILED, IDS_INSTALL_UNCOMPRESSION_FAILED_BASE, nullptr);
diff --git a/chrome/test/data/webui/settings/privacy_page_test.ts b/chrome/test/data/webui/settings/privacy_page_test.ts index ce899db80..47e5f018 100644 --- a/chrome/test/data/webui/settings/privacy_page_test.ts +++ b/chrome/test/data/webui/settings/privacy_page_test.ts
@@ -9,7 +9,7 @@ import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {ClearBrowsingDataBrowserProxyImpl, ContentSetting, ContentSettingsTypes, CookieControlsMode, SafetyHubBrowserProxyImpl, SafetyHubEvent, SiteSettingsPrefsBrowserProxyImpl} from 'chrome://settings/lazy_load.js'; import type {CrLinkRowElement, Route, SettingsPrefsElement, SettingsPrivacyPageElement, SyncStatus} from 'chrome://settings/settings.js'; -import {CrSettingsPrefs, HatsBrowserProxyImpl, MetricsBrowserProxyImpl, PrivacyGuideInteractions, PrivacyPageBrowserProxyImpl, Router, routes, StatusAction, TrustSafetyInteraction} from 'chrome://settings/settings.js'; +import {CrSettingsPrefs, HatsBrowserProxyImpl, MetricsBrowserProxyImpl, PrivacyGuideInteractions, PrivacyPageBrowserProxyImpl, resetPageVisibilityForTesting, resetRouterForTesting, Router, routes, StatusAction, TrustSafetyInteraction} from 'chrome://settings/settings.js'; import {assertEquals, assertFalse, assertTrue, assertThrows} from 'chrome://webui-test/chai_assert.js'; import {isChildVisible, isVisible} from 'chrome://webui-test/test_util.js'; import {flushTasks} from 'chrome://webui-test/polymer_test_util.js'; @@ -80,6 +80,7 @@ loadTimeData.overrideValues({ isPrivacySandboxRestricted: true, }); + resetRouterForTesting(); settingsPrefs = document.createElement('settings-prefs'); return CrSettingsPrefs.initialized; @@ -298,6 +299,7 @@ loadTimeData.overrideValues({ isPrivacySandboxRestricted: false, }); + resetRouterForTesting(); settingsPrefs = document.createElement('settings-prefs'); return CrSettingsPrefs.initialized; @@ -415,6 +417,7 @@ // This test covers the pre-3PCD subpage. is3pcdCookieSettingsRedesignEnabled: false, }); + resetRouterForTesting(); settingsPrefs = document.createElement('settings-prefs'); return CrSettingsPrefs.initialized; @@ -456,6 +459,7 @@ isPrivacySandboxRestricted: false, is3pcdCookieSettingsRedesignEnabled: true, }); + resetRouterForTesting(); settingsPrefs = document.createElement('settings-prefs'); return CrSettingsPrefs.initialized; @@ -472,7 +476,7 @@ }); teardown(function() { - Router.getInstance().resetRouteForTesting(); + resetRouterForTesting(); }); test('trackingProtectionSubpageAttributes', async function() { @@ -522,6 +526,7 @@ isPrivacySandboxRestricted: true, isPrivacySandboxRestrictedNoticeEnabled: false, }); + resetRouterForTesting(); settingsPrefs = document.createElement('settings-prefs'); return CrSettingsPrefs.initialized; @@ -564,6 +569,7 @@ isPrivacySandboxRestricted: true, isPrivacySandboxRestrictedNoticeEnabled: true, }); + resetRouterForTesting(); settingsPrefs = document.createElement('settings-prefs'); return CrSettingsPrefs.initialized; @@ -624,6 +630,7 @@ setup(function() { loadTimeData.overrideValues({showPrivacyGuide: true}); + resetRouterForTesting(); metricsBrowserProxy = new TestMetricsBrowserProxy(); MetricsBrowserProxyImpl.setInstance(metricsBrowserProxy); document.body.innerHTML = window.trustedTypes!.emptyHTML; @@ -635,6 +642,7 @@ test('rowNotShown', async function() { loadTimeData.overrideValues({showPrivacyGuide: false}); + resetRouterForTesting(); page.remove(); page = document.createElement('settings-privacy-page'); @@ -881,9 +889,9 @@ } test('InvisibleWhenGuestMode', async function() { - loadTimeData.overrideValues({ - isGuest: true, - }); + loadTimeData.overrideValues({isGuest: true}); + resetPageVisibilityForTesting(); + resetRouterForTesting(); await createPage(); // The UI should remain invisible even when there's an event that the @@ -896,9 +904,9 @@ assertFalse(isChildVisible(page, 'review-notification-permissions')); // Set guest mode back to false. - loadTimeData.overrideValues({ - isGuest: false, - }); + loadTimeData.overrideValues({isGuest: false}); + resetPageVisibilityForTesting(); + resetRouterForTesting(); }); test('VisibilityWithChangingPermissionList', async function() { @@ -941,6 +949,7 @@ loadTimeData.overrideValues({ enableSafetyHub: false, }); + resetRouterForTesting(); }); setup(function() { @@ -961,9 +970,9 @@ } test('InvisibleWhenGuestMode', async function() { - loadTimeData.overrideValues({ - isGuest: true, - }); + loadTimeData.overrideValues({isGuest: true}); + resetPageVisibilityForTesting(); + resetRouterForTesting(); await createPage(); // The UI should remain invisible even when there's an event that the @@ -976,9 +985,9 @@ assertFalse(isChildVisible(page, 'review-notification-permissions')); // Set guest mode back to false. - loadTimeData.overrideValues({ - isGuest: false, - }); + loadTimeData.overrideValues({isGuest: false}); + resetPageVisibilityForTesting(); + resetRouterForTesting(); }); test('VisibilityWithChangingPermissionList', async function() { @@ -1019,6 +1028,7 @@ isPrivacySandboxRestricted: true, enableWebBluetoothNewPermissionsBackend: true, }); + resetRouterForTesting(); settingsPrefs = document.createElement('settings-prefs'); return CrSettingsPrefs.initialized;
diff --git a/chrome/test/fuzzing/renderer_fuzzing/in_process_renderer_fuzzing.h b/chrome/test/fuzzing/renderer_fuzzing/in_process_renderer_fuzzing.h index f46b82c..6ce5a4b1 100644 --- a/chrome/test/fuzzing/renderer_fuzzing/in_process_renderer_fuzzing.h +++ b/chrome/test/fuzzing/renderer_fuzzing/in_process_renderer_fuzzing.h
@@ -51,6 +51,7 @@ RendererFuzzerProxy(InProcessFuzzerOptions options = {}); int Fuzz(const uint8_t* data, size_t size) override; + base::CommandLine::StringVector GetChromiumCommandLineArguments() override; private: std::string fuzzer_name_; @@ -96,6 +97,12 @@ return 0; } +template <typename RendererFuzzer> +base::CommandLine::StringVector +RendererFuzzerProxy<RendererFuzzer>::GetChromiumCommandLineArguments() { + return {FILE_PATH_LITERAL("--disable-kill-after-bad-ipc")}; +} + // Registers the given class as a renderer fuzzer which will be driven by an // `InProcessFuzzer` in the browser process. #define REGISTER_IN_PROCESS_RENDERER_FUZZER(RendererFuzzer) \
diff --git a/chromeos/profiles/arm.afdo.newest.txt b/chromeos/profiles/arm.afdo.newest.txt index c9f8c4e..cf2625c 100644 --- a/chromeos/profiles/arm.afdo.newest.txt +++ b/chromeos/profiles/arm.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-none-126-6422.19-1715600709-benchmark-126.0.6476.0-r1-redacted.afdo.xz +chromeos-chrome-arm-none-126-6422.19-1715600709-benchmark-126.0.6477.0-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/atom.afdo.newest.txt b/chromeos/profiles/atom.afdo.newest.txt index daa54b0c..ac625ec 100644 --- a/chromeos/profiles/atom.afdo.newest.txt +++ b/chromeos/profiles/atom.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-atom-126-6455.0-1715595660-benchmark-126.0.6476.0-r1-redacted.afdo.xz +chromeos-chrome-amd64-atom-126-6455.0-1715595660-benchmark-126.0.6477.0-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/bigcore.afdo.newest.txt b/chromeos/profiles/bigcore.afdo.newest.txt index 3269de1..c5f166a 100644 --- a/chromeos/profiles/bigcore.afdo.newest.txt +++ b/chromeos/profiles/bigcore.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-bigcore-126-6422.19-1715594232-benchmark-126.0.6476.0-r1-redacted.afdo.xz +chromeos-chrome-amd64-bigcore-126-6422.19-1715594232-benchmark-126.0.6477.0-r1-redacted.afdo.xz
diff --git a/clank b/clank index 5581d13..55acde2 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit 5581d135e7c2a518da3872aa95fe0d94d259d1bf +Subproject commit 55acde27d581490cdf12e8877e38f0e9410c1705
diff --git a/components/autofill/core/browser/address_data_manager.cc b/components/autofill/core/browser/address_data_manager.cc index 33877e2..f922ff23 100644 --- a/components/autofill/core/browser/address_data_manager.cc +++ b/components/autofill/core/browser/address_data_manager.cc
@@ -21,6 +21,7 @@ #include "components/autofill/core/browser/metrics/profile_deduplication_metrics.h" #include "components/autofill/core/browser/metrics/profile_token_quality_metrics.h" #include "components/autofill/core/browser/metrics/stored_profile_metrics.h" +#include "components/autofill/core/browser/webdata/addresses/contact_info_precondition_checker.h" #include "components/autofill/core/common/autofill_clock.h" #include "components/autofill/core/common/autofill_prefs.h" #include "components/prefs/pref_service.h" @@ -88,6 +89,13 @@ webdata_service_observer_.Observe(webdata_service_.get()); } + if (sync_service_ && identity_manager_) { + contact_info_precondition_checker_ = + std::make_unique<ContactInfoPreconditionChecker>( + sync_service_, identity_manager_, + /*on_precondition_changed=*/base::DoNothing()); + } + SetPrefService(pref_service); SetStrikeDatabase(strike_database); // `IsAutofillProfileEnabled()` relies on the `pref_service_`, which is only @@ -107,6 +115,7 @@ void AddressDataManager::Shutdown() { // These classes' sync observers needs to be unregistered. + contact_info_precondition_checker_.reset(); address_data_cleaner_.reset(); } @@ -586,13 +595,38 @@ } bool AddressDataManager::IsAutofillSyncToggleAvailable() const { - return IsEligibleForAddressAccountStorage() && sync_service_ && - !sync_service_->HasSyncConsent() && - !sync_service_->GetUserSettings()->IsTypeManagedByPolicy( - syncer::UserSelectableType::kAutofill) && - base::FeatureList::IsEnabled( - syncer::kSyncEnableContactInfoDataTypeInTransportMode) && - pref_service_->GetBoolean(::prefs::kExplicitBrowserSignin); + // These checks should be removed once the feature is fully launched. + if (!base::FeatureList::IsEnabled( + syncer::kSyncEnableContactInfoDataTypeInTransportMode) || + !pref_service_->GetBoolean(::prefs::kExplicitBrowserSignin)) { + return false; + } + + if (!sync_service_) { + return false; + } + + // Do not show the toggle if Sync is disabled on in error. + if (sync_service_->GetTransportState() == + syncer::SyncService::TransportState::PAUSED || + sync_service_->GetTransportState() == + syncer::SyncService::TransportState::DISABLED) { + return false; + } + + // Do not show the toggle for syncing users. + if (sync_service_->HasSyncConsent()) { + return false; + } + + if (sync_service_->GetUserSettings()->IsTypeManagedByPolicy( + syncer::UserSelectableType::kAutofill)) { + return false; + } + + return contact_info_precondition_checker_ && + contact_info_precondition_checker_->GetPreconditionState() == + syncer::ModelTypeController::PreconditionState::kPreconditionsMet; } void AddressDataManager::SetAutofillSelectableTypeEnabled(bool enabled) {
diff --git a/components/autofill/core/browser/address_data_manager.h b/components/autofill/core/browser/address_data_manager.h index 5446e4d..044a787b 100644 --- a/components/autofill/core/browser/address_data_manager.h +++ b/components/autofill/core/browser/address_data_manager.h
@@ -42,6 +42,7 @@ class AddressDataCleaner; class AlternativeStateNameMapUpdater; +class ContactInfoPreconditionChecker; // Contains all address-related logic of the `PersonalDataManager`. See comment // above the `PersonalDataManager` first. In the `AddressDataManager` (ADM), @@ -404,6 +405,9 @@ // has finished. void LogStoredDataMetrics() const; + std::unique_ptr<ContactInfoPreconditionChecker> + contact_info_precondition_checker_; + // A copy of the profiles stored in `AddressAutofillTable`. They come from // two sources: // - kLocalOrSyncable: Stored in `synced_local_profiles_`.
diff --git a/components/autofill/core/browser/autofill_external_delegate.cc b/components/autofill/core/browser/autofill_external_delegate.cc index a04f1172..3e7c221 100644 --- a/components/autofill/core/browser/autofill_external_delegate.cc +++ b/components/autofill/core/browser/autofill_external_delegate.cc
@@ -182,10 +182,11 @@ case SuggestionType::kAutocompleteEntry: case SuggestionType::kAutofillOptions: case SuggestionType::kClearForm: - case SuggestionType::kCompose: + case SuggestionType::kComposeResumeNudge: case SuggestionType::kComposeDisable: case SuggestionType::kComposeGoToSettings: case SuggestionType::kComposeNeverShowOnThisSiteAgain: + case SuggestionType::kComposeProactiveNudge: case SuggestionType::kComposeSavedStateNotification: case SuggestionType::kCreateNewPlusAddress: case SuggestionType::kDatalistEntry: @@ -479,10 +480,11 @@ case SuggestionType::kEditAddressProfile: case SuggestionType::kDeleteAddressProfile: case SuggestionType::kAutofillOptions: - case SuggestionType::kCompose: + case SuggestionType::kComposeResumeNudge: case SuggestionType::kComposeDisable: case SuggestionType::kComposeGoToSettings: case SuggestionType::kComposeNeverShowOnThisSiteAgain: + case SuggestionType::kComposeProactiveNudge: case SuggestionType::kComposeSavedStateNotification: case SuggestionType::kDatalistEntry: case SuggestionType::kShowAccountCards: @@ -614,7 +616,8 @@ std::move(callback)); break; } - case SuggestionType::kCompose: + case SuggestionType::kComposeResumeNudge: + case SuggestionType::kComposeProactiveNudge: case SuggestionType::kComposeSavedStateNotification: if (AutofillComposeDelegate* delegate = manager_->client().GetComposeDelegate()) { @@ -675,7 +678,7 @@ void AutofillExternalDelegate::DidPerformButtonActionForSuggestion( const Suggestion& suggestion) { switch (suggestion.type) { - case SuggestionType::kCompose: + case SuggestionType::kComposeResumeNudge: NOTIMPLEMENTED(); return; default: @@ -720,10 +723,11 @@ case SuggestionType::kAccountStoragePasswordEntry: case SuggestionType::kPasswordAccountStorageReSignin: case SuggestionType::kPasswordAccountStorageEmpty: - case SuggestionType::kCompose: + case SuggestionType::kComposeResumeNudge: case SuggestionType::kComposeDisable: case SuggestionType::kComposeGoToSettings: case SuggestionType::kComposeNeverShowOnThisSiteAgain: + case SuggestionType::kComposeProactiveNudge: case SuggestionType::kComposeSavedStateNotification: case SuggestionType::kDatalistEntry: case SuggestionType::kMerchantPromoCodeEntry:
diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc index bba346c..3d04cee2 100644 --- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc +++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
@@ -494,7 +494,7 @@ // Show compose suggestion in the popup. external_delegate().OnSuggestionsReturned( queried_field().global_id(), - {test::CreateAutofillSuggestion(SuggestionType::kCompose, + {test::CreateAutofillSuggestion(SuggestionType::kComposeResumeNudge, u"generated text")}); EXPECT_EQ(external_delegate().GetMainFillingProduct(), FillingProduct::kCompose); @@ -2136,12 +2136,12 @@ IssueOnQuery(); // Simulate receiving a Compose suggestion. - EXPECT_CALL( - client(), - ShowAutofillSuggestions( - PopupOpenArgsAre(SuggestionVectorIdsAre(SuggestionType::kCompose)), - _)); - std::vector<Suggestion> suggestions = {Suggestion(SuggestionType::kCompose)}; + EXPECT_CALL(client(), + ShowAutofillSuggestions(PopupOpenArgsAre(SuggestionVectorIdsAre( + SuggestionType::kComposeResumeNudge)), + _)); + std::vector<Suggestion> suggestions = { + Suggestion(SuggestionType::kComposeResumeNudge)}; external_delegate().OnSuggestionsReturned(queried_field().global_id(), suggestions);
diff --git a/components/autofill/core/browser/browser_autofill_manager.cc b/components/autofill/core/browser/browser_autofill_manager.cc index 6d9af73..b59a659 100644 --- a/components/autofill/core/browser/browser_autofill_manager.cc +++ b/components/autofill/core/browser/browser_autofill_manager.cc
@@ -347,10 +347,11 @@ case SuggestionType::kAllSavedPasswordsEntry: case SuggestionType::kAutofillOptions: case SuggestionType::kClearForm: - case SuggestionType::kCompose: + case SuggestionType::kComposeResumeNudge: case SuggestionType::kComposeDisable: case SuggestionType::kComposeGoToSettings: case SuggestionType::kComposeNeverShowOnThisSiteAgain: + case SuggestionType::kComposeProactiveNudge: case SuggestionType::kComposeSavedStateNotification: case SuggestionType::kCreateNewPlusAddress: case SuggestionType::kCreditCardEntry:
diff --git a/components/autofill/core/browser/browser_autofill_manager_unittest.cc b/components/autofill/core/browser/browser_autofill_manager_unittest.cc index 7c72d77..e00102a 100644 --- a/components/autofill/core/browser/browser_autofill_manager_unittest.cc +++ b/components/autofill/core/browser/browser_autofill_manager_unittest.cc
@@ -7121,7 +7121,8 @@ Eq(form.fields[3].global_id())), autofill::AutofillSuggestionTriggerSource:: kTextareaFocusedWithoutClick)) - .WillOnce(Return(Suggestion(u"Help me write", SuggestionType::kCompose))); + .WillOnce(Return( + Suggestion(u"Help me write", SuggestionType::kComposeResumeNudge))); GetAutofillSuggestions( form, form.fields[3], AutofillSuggestionTriggerSource::kTextareaFocusedWithoutClick); @@ -7150,7 +7151,8 @@ GetSuggestion( Property(&FormFieldData::global_id, Eq(form.fields[0].global_id())), autofill::AutofillSuggestionTriggerSource::kTextFieldDidChange)) - .WillOnce(Return(Suggestion(u"Help me write", SuggestionType::kCompose))); + .WillOnce(Return( + Suggestion(u"Help me write", SuggestionType::kComposeResumeNudge))); GetAutofillSuggestions(form, form.fields[0]); external_delegate()->CheckSuggestionCount(form.fields[0].global_id(), 1); }
diff --git a/components/autofill/core/browser/filling_product.cc b/components/autofill/core/browser/filling_product.cc index 116d1b6..f4e7ef3 100644 --- a/components/autofill/core/browser/filling_product.cc +++ b/components/autofill/core/browser/filling_product.cc
@@ -75,10 +75,11 @@ case SuggestionType::kFillPassword: case SuggestionType::kViewPasswordDetails: return FillingProduct::kPassword; - case SuggestionType::kCompose: + case SuggestionType::kComposeResumeNudge: case SuggestionType::kComposeDisable: case SuggestionType::kComposeGoToSettings: case SuggestionType::kComposeNeverShowOnThisSiteAgain: + case SuggestionType::kComposeProactiveNudge: case SuggestionType::kComposeSavedStateNotification: return FillingProduct::kCompose; case SuggestionType::kCreateNewPlusAddress:
diff --git a/components/autofill/core/browser/ui/suggestion_type.cc b/components/autofill/core/browser/ui/suggestion_type.cc index 76da731..ee3cfa2 100644 --- a/components/autofill/core/browser/ui/suggestion_type.cc +++ b/components/autofill/core/browser/ui/suggestion_type.cc
@@ -41,8 +41,8 @@ case SuggestionType::kAutofillOptions: os << "kAutofillOptions"; break; - case SuggestionType::kCompose: - os << "kCompose"; + case SuggestionType::kComposeResumeNudge: + os << "kComposeResumeNudge"; break; case SuggestionType::kComposeDisable: os << "kComposeDisable"; @@ -53,6 +53,9 @@ case SuggestionType::kComposeNeverShowOnThisSiteAgain: os << "kComposeNeverShowOnThisSiteAgain"; break; + case SuggestionType::kComposeProactiveNudge: + os << "kComposeProactiveNudge"; + break; case SuggestionType::kComposeSavedStateNotification: os << "kComposeSavedStateNotification"; break;
diff --git a/components/autofill/core/browser/ui/suggestion_type.h b/components/autofill/core/browser/ui/suggestion_type.h index 9988c64..f7983af 100644 --- a/components/autofill/core/browser/ui/suggestion_type.h +++ b/components/autofill/core/browser/ui/suggestion_type.h
@@ -18,7 +18,8 @@ kAutocompleteEntry, // Autofill profile suggestions. - // Fill the whole for the current address. On Desktop, it is triggered from the main (i.e. root popup) suggestion. + // Fill the whole for the current address. On Desktop, it is triggered from + // the main (i.e. root popup) suggestion. kAddressEntry, // Fills all address related fields, e.g ADDRESS_HOME_LINE1, // ADDRESS_HOME_HOUSE_NUMBER etc. @@ -43,12 +44,16 @@ kDeleteAddressProfile, kAutofillOptions, - // Compose suggestions. - kCompose, + // Compose popup suggestion shown when no Compose session exists. + kComposeProactiveNudge, + // Compose popup suggestion shown when there is an existing Compose session. + kComposeResumeNudge, + // Compose popup suggestion shown after the Compose dialog closes. + kComposeSavedStateNotification, + // Compose sub-menu suggestions kComposeDisable, kComposeGoToSettings, kComposeNeverShowOnThisSiteAgain, - kComposeSavedStateNotification, // Datalist suggestions. kDatalistEntry, @@ -106,12 +111,16 @@ std::ostream& operator<<(std::ostream& os, SuggestionType type); +// TODO(b/340323759): Find a better name since Compose actions do not trigger +// filling and kScanCreditCard should be included. // Set of `SuggestionType`s that trigger filling a value into an input element // when the user selects a suggestion with that id. inline constexpr auto kItemsTriggeringFieldFilling = DenseSet( - {SuggestionType::kAccountStoragePasswordEntry, SuggestionType::kAddressEntry, - SuggestionType::kAutocompleteEntry, SuggestionType::kCompose, - SuggestionType::kCreditCardEntry, SuggestionType::kDatalistEntry, + {SuggestionType::kAccountStoragePasswordEntry, + SuggestionType::kAddressEntry, SuggestionType::kAutocompleteEntry, + SuggestionType::kComposeResumeNudge, + SuggestionType::kComposeProactiveNudge, SuggestionType::kCreditCardEntry, + SuggestionType::kDatalistEntry, SuggestionType::kFillEverythingFromAddressProfile, SuggestionType::kMerchantPromoCodeEntry, SuggestionType::kPasswordEntry, SuggestionType::kVirtualCreditCardEntry});
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/textbubble/TextBubble.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/textbubble/TextBubble.java index 50db9fe..5ae1889 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/textbubble/TextBubble.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/textbubble/TextBubble.java
@@ -464,9 +464,11 @@ } mPopupWindow.show(); - assert sSkipShowCheckForTesting || mPopupWindow.isShowing() - : "TextBubble is not presented: " + mString; - if (!mPopupWindow.isShowing()) return; + + boolean popupShowing = sSkipShowCheckForTesting || mPopupWindow.isShowing(); + assert popupShowing : "TextBubble is not presented: " + mString; + + if (!popupShowing) return; sBubbles.add(this); sCountSupplier.set(sBubbles.size());
diff --git a/components/component_updater/installer_policies/tpcd_metadata_component_installer_policy_unittest.cc b/components/component_updater/installer_policies/tpcd_metadata_component_installer_policy_unittest.cc index 27f9e18..b34f883 100644 --- a/components/component_updater/installer_policies/tpcd_metadata_component_installer_policy_unittest.cc +++ b/components/component_updater/installer_policies/tpcd_metadata_component_installer_policy_unittest.cc
@@ -65,9 +65,9 @@ } if (IsTpcdMetadataStagingEnabled()) { - enabled_features.push_back(net::features::kTpcdMetadataStagedRollback); + enabled_features.push_back(net::features::kTpcdMetadataStageControl); } else { - disabled_features.push_back(net::features::kTpcdMetadataStagedRollback); + disabled_features.push_back(net::features::kTpcdMetadataStageControl); } scoped_list_.InitWithFeatures(enabled_features, disabled_features);
diff --git a/components/compose/core/browser/compose_manager_impl.cc b/components/compose/core/browser/compose_manager_impl.cc index 24d3605..cc14b06 100644 --- a/components/compose/core/browser/compose_manager_impl.cc +++ b/components/compose/core/browser/compose_manager_impl.cc
@@ -50,7 +50,8 @@ static_cast<autofill::BrowserAutofillManager*>(manager.get()) ->FillOrPreviewField(autofill::mojom::ActionPersistence::kFill, autofill::mojom::FieldActionType::kReplaceSelection, - form, field, trimmed_text, SuggestionType::kCompose); + form, field, trimmed_text, + SuggestionType::kComposeResumeNudge); } } // namespace @@ -167,7 +168,7 @@ } std::u16string suggestion_text; std::u16string label_text; - SuggestionType type = SuggestionType::kCompose; + SuggestionType type; // State is saved as a `ComposeSession` in the `ComposeClient`. A user can // resume where they left off in a field if the `ComposeClient` has a // `ComposeSession` for that field. @@ -178,15 +179,16 @@ suggestion_text = l10n_util::GetStringUTF16(IDS_COMPOSE_SUGGESTION_SAVED_TEXT); label_text = l10n_util::GetStringUTF16(IDS_COMPOSE_SUGGESTION_SAVED_LABEL); - if (trigger_source == - AutofillSuggestionTriggerSource::kComposeDialogLostFocus) { - type = SuggestionType::kComposeSavedStateNotification; - } + type = trigger_source == + AutofillSuggestionTriggerSource::kComposeDialogLostFocus + ? SuggestionType::kComposeSavedStateNotification + : SuggestionType::kComposeResumeNudge; } else { // Text for a new Compose session. suggestion_text = l10n_util::GetStringUTF16(IDS_COMPOSE_SUGGESTION_MAIN_TEXT); label_text = l10n_util::GetStringUTF16(IDS_COMPOSE_SUGGESTION_LABEL); + type = SuggestionType::kComposeProactiveNudge; } Suggestion suggestion(std::move(suggestion_text)); suggestion.labels = {{Suggestion::Text(std::move(label_text))}};
diff --git a/components/compose/core/browser/compose_manager_impl_unittest.cc b/components/compose/core/browser/compose_manager_impl_unittest.cc index b88dbe2..65b9c74 100644 --- a/components/compose/core/browser/compose_manager_impl_unittest.cc +++ b/components/compose/core/browser/compose_manager_impl_unittest.cc
@@ -232,7 +232,7 @@ {{autofill::Suggestion::Text(l10n_util::GetStringUTF16( IDS_COMPOSE_SUGGESTION_SAVED_LABEL))}}, autofill::Suggestion::Icon::kPenSpark, - autofill::SuggestionType::kCompose)); + autofill::SuggestionType::kComposeResumeNudge)); } TEST_F(ComposeManagerImplTest, @@ -247,7 +247,7 @@ {{autofill::Suggestion::Text( l10n_util::GetStringUTF16(IDS_COMPOSE_SUGGESTION_LABEL))}}, autofill::Suggestion::Icon::kPenSpark, - autofill::SuggestionType::kCompose)); + autofill::SuggestionType::kComposeProactiveNudge)); } TEST_F(ComposeManagerImplTest,
diff --git a/components/compose_strings.grdp b/components/compose_strings.grdp index a3fe78e..928f4324 100644 --- a/components/compose_strings.grdp +++ b/components/compose_strings.grdp
@@ -23,7 +23,10 @@ <message name="IDS_COMPOSE_SUGGESTION_SAVED_LABEL" desc="The label beneath the main text in the Autofill suggestion that a user sees after interacting with a supported text element, indicating that user state was saved."> Open to continue </message> - <message name="IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW" desc="The message read out by a screen reader whtn the Compose nudge is shown."> + <message name="IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW_PROACTIVE" desc="The message read out by a screen reader when the Compose nudge is shown."> + Help me write. Tab and press enter to open + </message> + <message name="IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW_RESUME" desc="The message read out by a screen reader when the Compose resume nudge is shown."> Resume Help me write. Tab and press enter to open </message> <message name="IDS_COMPOSE_DONT_SHOW_ON_THIS_SITE_CHILD_SUGGESTION_TEXT" desc="Text a user sees in one of the Autofill popup child suggestions for the Help me write feature. When selected, the Autofill popup will no longer be displayed on the current domain.">
diff --git a/components/compose_strings_grdp/IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW_PROACTIVE.png.sha1 b/components/compose_strings_grdp/IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW_PROACTIVE.png.sha1 new file mode 100644 index 0000000..f93ec1f --- /dev/null +++ b/components/compose_strings_grdp/IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW_PROACTIVE.png.sha1
@@ -0,0 +1 @@ +eb174d5a5c3a3ebf502c4ef93a6f35117ee7d9dc
diff --git a/components/compose_strings_grdp/IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW.png.sha1 b/components/compose_strings_grdp/IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW_RESUME.png.sha1 similarity index 100% rename from components/compose_strings_grdp/IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW.png.sha1 rename to components/compose_strings_grdp/IDS_COMPOSE_SUGGESTION_AX_MESSAGE_ON_SHOW_RESUME.png.sha1
diff --git a/components/content_settings/core/browser/website_settings_registry.cc b/components/content_settings/core/browser/website_settings_registry.cc index 16ee65c6..a5ddfd58 100644 --- a/components/content_settings/core/browser/website_settings_registry.cc +++ b/components/content_settings/core/browser/website_settings_registry.cc
@@ -248,7 +248,7 @@ Register(ContentSettingsType::HTTP_ALLOWED, "http-allowed", base::Value(), WebsiteSettingsInfo::UNSYNCABLE, WebsiteSettingsInfo::NOT_LOSSY, WebsiteSettingsInfo::GENERIC_SINGLE_ORIGIN_SCOPE, ALL_PLATFORMS, - WebsiteSettingsInfo::INHERIT_IN_INCOGNITO); + WebsiteSettingsInfo::DONT_INHERIT_IN_INCOGNITO); Register(ContentSettingsType::HTTPS_ENFORCED, "https-enforced", base::Value(), WebsiteSettingsInfo::UNSYNCABLE, WebsiteSettingsInfo::NOT_LOSSY, WebsiteSettingsInfo::GENERIC_SINGLE_ORIGIN_SCOPE, ALL_PLATFORMS,
diff --git a/components/content_settings/core/common/cookie_settings_base.cc b/components/content_settings/core/common/cookie_settings_base.cc index e7b6fd3..a290d06c 100644 --- a/components/content_settings/core/common/cookie_settings_base.cc +++ b/components/content_settings/core/common/cookie_settings_base.cc
@@ -501,8 +501,7 @@ // Whether to bypass any available grants from the Third Party Cookie // Deprecation TPCD Metadata. bool IgnoreTpcdDtGracePeriodMetadataEntry(const SettingInfo& info) { - if (!base::FeatureList::IsEnabled( - net::features::kTpcdMetadataStagedRollback)) { + if (!base::FeatureList::IsEnabled(net::features::kTpcdMetadataStageControl)) { return false; }
diff --git a/components/exo/sub_surface_unittest.cc b/components/exo/sub_surface_unittest.cc index f02f665..5999fa09 100644 --- a/components/exo/sub_surface_unittest.cc +++ b/components/exo/sub_surface_unittest.cc
@@ -65,6 +65,8 @@ ASSERT_EQ(2u, parent->window()->children().size()); EXPECT_EQ(surface1->window(), parent->window()->children()[0]); EXPECT_EQ(surface2->window(), parent->window()->children()[1]); + EXPECT_EQ(surface1.get(), parent->sub_surfaces().front().first); + EXPECT_EQ(surface2.get(), parent->sub_surfaces().back().first); sub_surface2->PlaceAbove(parent.get()); sub_surface1->PlaceAbove(non_sibling_surface.get()); // Invalid @@ -75,12 +77,25 @@ // order to take effect. EXPECT_EQ(surface1->window(), parent->window()->children()[0]); EXPECT_EQ(surface2->window(), parent->window()->children()[1]); + EXPECT_EQ(surface1.get(), parent->sub_surfaces().front().first); + EXPECT_EQ(surface2.get(), parent->sub_surfaces().back().first); parent->Commit(); // surface1 should now be stacked above surface2. EXPECT_EQ(surface2->window(), parent->window()->children()[0]); EXPECT_EQ(surface1->window(), parent->window()->children()[1]); + EXPECT_EQ(surface2.get(), parent->sub_surfaces().front().first); + EXPECT_EQ(surface1.get(), parent->sub_surfaces().back().first); + + sub_surface1->PlaceAbove(parent.get()); + parent->Commit(); + + // surface2 should now be stacked above surface1. + EXPECT_EQ(surface1->window(), parent->window()->children()[0]); + EXPECT_EQ(surface2->window(), parent->window()->children()[1]); + EXPECT_EQ(surface1.get(), parent->sub_surfaces().front().first); + EXPECT_EQ(surface2.get(), parent->sub_surfaces().back().first); } TEST_F(SubSurfaceTest, PlaceBelow) { @@ -97,6 +112,8 @@ ASSERT_EQ(2u, parent->window()->children().size()); EXPECT_EQ(surface1->window(), parent->window()->children()[0]); EXPECT_EQ(surface2->window(), parent->window()->children()[1]); + EXPECT_EQ(surface1.get(), parent->sub_surfaces().front().first); + EXPECT_EQ(surface2.get(), parent->sub_surfaces().back().first); sub_surface2->PlaceBelow(parent.get()); // Invalid sub_surface2->PlaceBelow(non_sibling_surface.get()); // Invalid @@ -107,12 +124,16 @@ // order to take effect. EXPECT_EQ(surface1->window(), parent->window()->children()[0]); EXPECT_EQ(surface2->window(), parent->window()->children()[1]); + EXPECT_EQ(surface1.get(), parent->sub_surfaces().front().first); + EXPECT_EQ(surface2.get(), parent->sub_surfaces().back().first); parent->Commit(); // surface1 should now be stacked above surface2. EXPECT_EQ(surface2->window(), parent->window()->children()[0]); EXPECT_EQ(surface1->window(), parent->window()->children()[1]); + EXPECT_EQ(surface2.get(), parent->sub_surfaces().front().first); + EXPECT_EQ(surface1.get(), parent->sub_surfaces().back().first); } TEST_F(SubSurfaceTest, ParentDamageOnReorder) {
diff --git a/components/exo/surface.cc b/components/exo/surface.cc index ba917872..f4c9c8e 100644 --- a/components/exo/surface.cc +++ b/components/exo/surface.cc
@@ -651,8 +651,10 @@ DCHECK(ListContainsEntry(list, child)); auto it = FindListEntry(list, child); - if (place_above && reference != this) { - ++position_it; + if (place_above) { + if (reference != this) { + ++position_it; + } } else { --position_it; }
diff --git a/components/facilitated_payments/content/browser/content_facilitated_payments_driver_unittest.cc b/components/facilitated_payments/content/browser/content_facilitated_payments_driver_unittest.cc index fa0367f0..7dc1676 100644 --- a/components/facilitated_payments/content/browser/content_facilitated_payments_driver_unittest.cc +++ b/components/facilitated_payments/content/browser/content_facilitated_payments_driver_unittest.cc
@@ -61,6 +61,10 @@ GetFacilitatedPaymentsNetworkInterface, (), (override)); + MOCK_METHOD(std::optional<CoreAccountInfo>, + GetCoreAccountInfo, + (), + (override)); }; class ContentFacilitatedPaymentsDriverTest
diff --git a/components/facilitated_payments/core/browser/BUILD.gn b/components/facilitated_payments/core/browser/BUILD.gn index c732128..fe03ebd 100644 --- a/components/facilitated_payments/core/browser/BUILD.gn +++ b/components/facilitated_payments/core/browser/BUILD.gn
@@ -28,6 +28,7 @@ "//components/facilitated_payments/core/metrics", "//components/facilitated_payments/core/mojom:facilitated_payments_agent_mojom", "//components/optimization_guide/core", + "//components/signin/public/identity_manager", "//services/data_decoder/public/cpp", "//services/metrics/public/cpp:metrics_cpp", "//services/metrics/public/cpp:ukm_builders",
diff --git a/components/facilitated_payments/core/browser/facilitated_payments_client.h b/components/facilitated_payments/core/browser/facilitated_payments_client.h index cc945e8..9806fe1 100644 --- a/components/facilitated_payments/core/browser/facilitated_payments_client.h +++ b/components/facilitated_payments/core/browser/facilitated_payments_client.h
@@ -6,10 +6,12 @@ #define COMPONENTS_FACILITATED_PAYMENTS_CORE_BROWSER_FACILITATED_PAYMENTS_CLIENT_H_ #include <cstdint> +#include <optional> #include "base/containers/span.h" #include "base/functional/callback_forward.h" #include "components/autofill/core/browser/payments/risk_data_loader.h" +#include "components/signin/public/identity_manager/account_info.h" namespace autofill { class BankAccount; @@ -35,6 +37,9 @@ virtual FacilitatedPaymentsNetworkInterface* GetFacilitatedPaymentsNetworkInterface() = 0; + // Provides access to the core information of the user's primary account. + virtual std::optional<CoreAccountInfo> GetCoreAccountInfo() = 0; + // Shows the user's PIX accounts from their Google Wallet, and prompts to pay. // If the UI was shown, then returns true and later invokes the // `on_user_decision_callback` with the result of user's selection: a boolean
diff --git a/components/facilitated_payments/core/browser/facilitated_payments_manager.cc b/components/facilitated_payments/core/browser/facilitated_payments_manager.cc index b057605..c6a1872f 100644 --- a/components/facilitated_payments/core/browser/facilitated_payments_manager.cc +++ b/components/facilitated_payments/core/browser/facilitated_payments_manager.cc
@@ -12,7 +12,6 @@ #include "components/autofill/core/browser/data_model/bank_account.h" #include "components/autofill/core/browser/payments/payments_util.h" #include "components/autofill/core/browser/personal_data_manager.h" -#include "components/facilitated_payments/core/browser/facilitated_payments_api_client.h" #include "components/facilitated_payments/core/browser/facilitated_payments_client.h" #include "components/facilitated_payments/core/browser/network_api/facilitated_payments_network_interface.h" #include "components/facilitated_payments/core/features/features.h" @@ -143,6 +142,8 @@ // If a valid PIX code is found, and the user has Google wallet linked PIX // accounts, verify that the payments API is available, and then show the PIX // payment prompt. + // TODO(b/339477906): The check for bank accounts should move to + // OnPixCodeValidated. auto* personal_data_manager = client_->GetPersonalDataManager(); if (!personal_data_manager) { Reset(); @@ -290,10 +291,33 @@ autofill::AutofillClient::PaymentsRpcResult result, std::unique_ptr<FacilitatedPaymentsInitiatePaymentResponseDetails> response_details) { - // TODO(b/300334855): Send the action token from the InitiatePayment response - // into the purchase manager. + if (result != autofill::AutofillClient::PaymentsRpcResult::kSuccess) { + // TODO(b/300335703): Show the error message. + Reset(); + return; + } + DCHECK(response_details); + if (response_details->action_token_.empty()) { + Reset(); + return; + } + std::optional<CoreAccountInfo> account_info = client_->GetCoreAccountInfo(); + // If the user logged out after selecting the payment method, the + // `account_info` would be empty, and the `FacilitatedPaymentsManager` should + // abandon the payment flow. + if (!account_info.has_value() || account_info.value().IsEmpty()) { + Reset(); + return; + } + api_client_->InvokePurchaseAction( + account_info.value(), response_details->action_token_, + base::BindOnce(&FacilitatedPaymentsManager::OnPurchaseActionResult, + weak_ptr_factory_.GetWeakPtr())); } +void FacilitatedPaymentsManager::OnPurchaseActionResult( + FacilitatedPaymentsApiClient::PurchaseActionResult result) {} + void FacilitatedPaymentsManager::ResetForTesting() { is_test_ = false; Reset();
diff --git a/components/facilitated_payments/core/browser/facilitated_payments_manager.h b/components/facilitated_payments/core/browser/facilitated_payments_manager.h index fc072221..c015dc2 100644 --- a/components/facilitated_payments/core/browser/facilitated_payments_manager.h +++ b/components/facilitated_payments/core/browser/facilitated_payments_manager.h
@@ -16,6 +16,7 @@ #include "base/timer/timer.h" #include "base/types/expected.h" #include "components/autofill/core/browser/autofill_client.h" +#include "components/facilitated_payments/core/browser/facilitated_payments_api_client.h" #include "components/facilitated_payments/core/browser/facilitated_payments_driver.h" #include "components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_request_details.h" #include "components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_response_details.h" @@ -28,7 +29,6 @@ namespace payments::facilitated { -class FacilitatedPaymentsApiClient; class FacilitatedPaymentsClient; class FacilitatedPaymentsDriver; @@ -171,7 +171,17 @@ PaymentNotOfferedReason_ApiNotAvailable); FRIEND_TEST_ALL_PREFIXES(FacilitatedPaymentsManagerWithPixPaymentsEnabledTest, SendInitiatePaymentRequest); - + FRIEND_TEST_ALL_PREFIXES(FacilitatedPaymentsManagerWithPixPaymentsEnabledTest, + OnInitiatePaymentResponseReceived_FailureResponse); + FRIEND_TEST_ALL_PREFIXES(FacilitatedPaymentsManagerWithPixPaymentsEnabledTest, + OnInitiatePaymentResponseReceived_NoActionToken); + FRIEND_TEST_ALL_PREFIXES(FacilitatedPaymentsManagerWithPixPaymentsEnabledTest, + OnInitiatePaymentResponseReceived_NoCoreAccountInfo); + FRIEND_TEST_ALL_PREFIXES(FacilitatedPaymentsManagerWithPixPaymentsEnabledTest, + OnInitiatePaymentResponseReceived_LoggedOutProfile); + FRIEND_TEST_ALL_PREFIXES( + FacilitatedPaymentsManagerWithPixPaymentsEnabledTest, + OnInitiatePaymentResponseReceived_InvokePurchaseActionTriggered); // Register optimization guide deciders for PIX. It is an allowlist of URLs // where we attempt PIX code detection. void RegisterPixAllowlist() const; @@ -234,6 +244,11 @@ std::unique_ptr<FacilitatedPaymentsInitiatePaymentResponseDetails> response_details); + // Called after receiving the `result` of invoking the purchase manager for + // payment. + void OnPurchaseActionResult( + FacilitatedPaymentsApiClient::PurchaseActionResult result); + // Calling `Reset` has no effect in tests. Adding this method to specifically // test `Resets` in tests. void ResetForTesting();
diff --git a/components/facilitated_payments/core/browser/facilitated_payments_manager_unittest.cc b/components/facilitated_payments/core/browser/facilitated_payments_manager_unittest.cc index df78200..4d1867c7 100644 --- a/components/facilitated_payments/core/browser/facilitated_payments_manager_unittest.cc +++ b/components/facilitated_payments/core/browser/facilitated_payments_manager_unittest.cc
@@ -4,7 +4,11 @@ #include "components/facilitated_payments/core/browser/facilitated_payments_manager.h" +#include <cstdint> +#include <memory> +#include <optional> #include <utility> +#include <vector> #include "base/functional/callback.h" #include "base/test/gmock_callback_support.h" @@ -32,6 +36,27 @@ #include "testing/gtest/include/gtest/gtest.h" namespace payments::facilitated { +namespace { + +// Returns a bank account enabled for Pix with fake data. +autofill::BankAccount CreatePixBankAccount(int64_t instrument_id) { + autofill::BankAccount bank_account( + instrument_id, u"nickname", GURL("http://www.example.com"), u"bank_name", + u"account_number", autofill::BankAccount::AccountType::kChecking); + return bank_account; +} + +// Returns an account info that has all the details a logged in account should +// have. +CoreAccountInfo CreateLoggedInAccountInfo() { + CoreAccountInfo account; + account.email = "foo@bar.com"; + account.gaia = "foo-gaia-id"; + account.account_id = CoreAccountId::FromGaiaId(account.gaia); + return account; +} + +} // namespace class MockFacilitatedPaymentsDriver : public FacilitatedPaymentsDriver { public: @@ -115,6 +140,10 @@ GetFacilitatedPaymentsNetworkInterface, (), (override)); + MOCK_METHOD(std::optional<CoreAccountInfo>, + GetCoreAccountInfo, + (), + (override)); MOCK_METHOD(bool, ShowPixPaymentPrompt, (base::span<autofill::BankAccount> pix_account_suggestions, @@ -279,15 +308,6 @@ task_environment_.RunUntilIdle(); } - // Returns a bank account enabled for Pix with fake data. - static autofill::BankAccount CreatePixBankAccount(int64_t instrument_id) { - autofill::BankAccount bank_account( - instrument_id, u"nickname", GURL("http://www.example.com"), - u"bank_name", u"account_number", - autofill::BankAccount::AccountType::kChecking); - return bank_account; - } - protected: base::test::ScopedFeatureList features_; optimization_guide::OptimizationGuideDecision allowlist_result_; @@ -1231,6 +1251,95 @@ manager_->SendInitiatePaymentRequest(); } +// Test that if the response from +// `FacilitatedPaymentsNetworkInterface::InitiatePayment` call has failure +// result, purchase action is not invoked. +TEST_F(FacilitatedPaymentsManagerWithPixPaymentsEnabledTest, + OnInitiatePaymentResponseReceived_FailureResponse) { + ON_CALL(*client_, GetCoreAccountInfo) + .WillByDefault(testing::Return(CreateLoggedInAccountInfo())); + + EXPECT_CALL(*api_client_, InvokePurchaseAction).Times(0); + + auto response_details = + std::make_unique<FacilitatedPaymentsInitiatePaymentResponseDetails>(); + response_details->action_token_ = + std::vector<uint8_t>{'t', 'o', 'k', 'e', 'n'}; + manager_->OnInitiatePaymentResponseReceived( + autofill::AutofillClient::PaymentsRpcResult::kPermanentFailure, + std::move(response_details)); +} + +// Test that if the response from +// `FacilitatedPaymentsNetworkInterface::InitiatePayment` has empty action +// token, purchase action is not invoked. +TEST_F(FacilitatedPaymentsManagerWithPixPaymentsEnabledTest, + OnInitiatePaymentResponseReceived_NoActionToken) { + ON_CALL(*client_, GetCoreAccountInfo) + .WillByDefault(testing::Return(CreateLoggedInAccountInfo())); + + EXPECT_CALL(*api_client_, InvokePurchaseAction).Times(0); + + auto response_details = + std::make_unique<FacilitatedPaymentsInitiatePaymentResponseDetails>(); + manager_->OnInitiatePaymentResponseReceived( + autofill::AutofillClient::PaymentsRpcResult::kSuccess, + std::move(response_details)); +} + +// Test that if the core account is std::nullopt, purchase action is not +// invoked. +TEST_F(FacilitatedPaymentsManagerWithPixPaymentsEnabledTest, + OnInitiatePaymentResponseReceived_NoCoreAccountInfo) { + ON_CALL(*client_, GetCoreAccountInfo) + .WillByDefault(testing::Return(std::nullopt)); + + EXPECT_CALL(*api_client_, InvokePurchaseAction).Times(0); + + auto response_details = + std::make_unique<FacilitatedPaymentsInitiatePaymentResponseDetails>(); + response_details->action_token_ = + std::vector<uint8_t>{'t', 'o', 'k', 'e', 'n'}; + manager_->OnInitiatePaymentResponseReceived( + autofill::AutofillClient::PaymentsRpcResult::kSuccess, + std::move(response_details)); +} + +// Test that if the user is logged out, purchase action is not invoked. +TEST_F(FacilitatedPaymentsManagerWithPixPaymentsEnabledTest, + OnInitiatePaymentResponseReceived_LoggedOutProfile) { + ON_CALL(*client_, GetCoreAccountInfo) + .WillByDefault(testing::Return(CoreAccountInfo())); + + EXPECT_CALL(*api_client_, InvokePurchaseAction).Times(0); + + auto response_details = + std::make_unique<FacilitatedPaymentsInitiatePaymentResponseDetails>(); + response_details->action_token_ = + std::vector<uint8_t>{'t', 'o', 'k', 'e', 'n'}; + manager_->OnInitiatePaymentResponseReceived( + autofill::AutofillClient::PaymentsRpcResult::kSuccess, + std::move(response_details)); +} + +// Test that the puchase action is invoked after receiving a success response +// from the `FacilitatedPaymentsNetworkInterface::InitiatePayment` call. +TEST_F(FacilitatedPaymentsManagerWithPixPaymentsEnabledTest, + OnInitiatePaymentResponseReceived_InvokePurchaseActionTriggered) { + ON_CALL(*client_, GetCoreAccountInfo) + .WillByDefault(testing::Return(CreateLoggedInAccountInfo())); + + EXPECT_CALL(*api_client_, InvokePurchaseAction); + + auto response_details = + std::make_unique<FacilitatedPaymentsInitiatePaymentResponseDetails>(); + response_details->action_token_ = + std::vector<uint8_t>{'t', 'o', 'k', 'e', 'n'}; + manager_->OnInitiatePaymentResponseReceived( + autofill::AutofillClient::PaymentsRpcResult::kSuccess, + std::move(response_details)); +} + // The `IsAvailable` async call is made after a valid Pix code has been // detected. This test verifies that the result and latency are logged after the // async call is completed.
diff --git a/components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_response_details.cc b/components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_response_details.cc index 1a2672e..c2b87e69 100644 --- a/components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_response_details.cc +++ b/components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_response_details.cc
@@ -9,4 +9,7 @@ FacilitatedPaymentsInitiatePaymentResponseDetails:: FacilitatedPaymentsInitiatePaymentResponseDetails() = default; +FacilitatedPaymentsInitiatePaymentResponseDetails:: + ~FacilitatedPaymentsInitiatePaymentResponseDetails() = default; + } // namespace payments::facilitated
diff --git a/components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_response_details.h b/components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_response_details.h index e05c95e9..9edcdd9d 100644 --- a/components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_response_details.h +++ b/components/facilitated_payments/core/browser/network_api/facilitated_payments_initiate_payment_response_details.h
@@ -5,6 +5,11 @@ #ifndef COMPONENTS_FACILITATED_PAYMENTS_CORE_BROWSER_NETWORK_API_FACILITATED_PAYMENTS_INITIATE_PAYMENT_RESPONSE_DETAILS_H_ #define COMPONENTS_FACILITATED_PAYMENTS_CORE_BROWSER_NETWORK_API_FACILITATED_PAYMENTS_INITIATE_PAYMENT_RESPONSE_DETAILS_H_ +#include <cstdint> +#include <optional> +#include <string> +#include <vector> + namespace payments::facilitated { // Contains information retrieved from an @@ -16,7 +21,14 @@ const FacilitatedPaymentsInitiatePaymentResponseDetails&) = delete; FacilitatedPaymentsInitiatePaymentResponseDetails& operator=( const FacilitatedPaymentsInitiatePaymentResponseDetails&) = delete; - ~FacilitatedPaymentsInitiatePaymentResponseDetails() = default; + ~FacilitatedPaymentsInitiatePaymentResponseDetails(); + + // Used to trigger `PurchaseManager`. + std::vector<uint8_t> action_token_; + // Set if the request to Payments API fails. The message is human-readable, + // and will be shown to the user. It could contain HTML <a> tags linking to + // help center docs. + std::optional<std::string> error_message_; }; } // namespace payments::facilitated
diff --git a/components/optimization_guide/core/model_execution/model_execution_util.cc b/components/optimization_guide/core/model_execution/model_execution_util.cc index ac4201c..001e12c33 100644 --- a/components/optimization_guide/core/model_execution/model_execution_util.cc +++ b/components/optimization_guide/core/model_execution/model_execution_util.cc
@@ -4,8 +4,10 @@ #include "components/optimization_guide/core/model_execution/model_execution_util.h" +#include "base/files/file_util.h" #include "components/optimization_guide/core/model_quality/feature_type_map.h" #include "components/optimization_guide/core/model_util.h" +#include "components/optimization_guide/core/optimization_guide_constants.h" #include "components/prefs/pref_service.h" #include "services/on_device_model/public/mojom/on_device_model.mojom.h" #include "services/on_device_model/public/mojom/on_device_model_service.mojom.h" @@ -137,4 +139,19 @@ } } +std::unique_ptr<proto::OnDeviceModelExecutionConfig> +ReadOnDeviceModelExecutionConfig(const base::FilePath& config_path) { + // Unpack and verify model config file. + std::string binary_config_pb; + if (!base::ReadFileToString(config_path, &binary_config_pb)) { + return nullptr; + } + + auto config = std::make_unique<proto::OnDeviceModelExecutionConfig>(); + if (!config->ParseFromString(binary_config_pb)) { + return nullptr; + } + return config; +} + } // namespace optimization_guide
diff --git a/components/optimization_guide/core/model_execution/model_execution_util.h b/components/optimization_guide/core/model_execution/model_execution_util.h index d04f53375..286d8dd 100644 --- a/components/optimization_guide/core/model_execution/model_execution_util.h +++ b/components/optimization_guide/core/model_execution/model_execution_util.h
@@ -12,6 +12,7 @@ #include "components/optimization_guide/core/optimization_guide_prefs.h" #include "components/optimization_guide/core/optimization_guide_util.h" #include "components/optimization_guide/proto/model_quality_service.pb.h" +#include "components/optimization_guide/proto/on_device_model_execution_config.pb.h" #include "services/on_device_model/public/cpp/model_assets.h" #include "services/on_device_model/public/mojom/on_device_model_service.mojom.h" @@ -81,6 +82,10 @@ OnDeviceModelLoadResult ConvertToOnDeviceModelLoadResult( on_device_model::mojom::LoadModelResult result); +// Returns the model execution config read from the `config_path`. +std::unique_ptr<proto::OnDeviceModelExecutionConfig> +ReadOnDeviceModelExecutionConfig(const base::FilePath& config_path); + } // namespace optimization_guide #endif // COMPONENTS_OPTIMIZATION_GUIDE_CORE_MODEL_EXECUTION_MODEL_EXECUTION_UTIL_H_
diff --git a/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.cc b/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.cc index d85bbba..e1e7bfe 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.cc
@@ -6,9 +6,11 @@ #include "base/metrics/histogram_functions.h" #include "base/strings/strcat.h" +#include "base/task/thread_pool.h" #include "components/optimization_guide/core/model_execution/feature_keys.h" #include "components/optimization_guide/core/model_execution/model_execution_features.h" #include "components/optimization_guide/core/model_execution/model_execution_util.h" +#include "components/optimization_guide/core/model_execution/on_device_model_feature_adapter.h" #include "components/optimization_guide/core/model_execution/on_device_model_service_controller.h" #include "components/optimization_guide/core/optimization_guide_constants.h" #include "components/optimization_guide/core/optimization_guide_enums.h" @@ -32,8 +34,64 @@ availability); } +base::expected<std::unique_ptr<OnDeviceModelAdaptationMetadata>, + OnDeviceModelAdaptationAvailability> +CreateAdaptatonMetadataFromModelExecutionConfig( + ModelBasedCapabilityKey feature, + std::unique_ptr<on_device_model::AdaptationAssetPaths> asset_paths, + std::unique_ptr<proto::OnDeviceModelExecutionConfig> execution_config) { + if (!execution_config) { + return base::unexpected(OnDeviceModelAdaptationAvailability:: + kAdaptationModelExecutionConfigInvalid); + } + if (execution_config->feature_configs_size() != 1) { + return base::unexpected(OnDeviceModelAdaptationAvailability:: + kAdaptationModelExecutionConfigInvalid); + } + auto& config = *execution_config->mutable_feature_configs(0); + if (config.feature() != ToModelExecutionFeatureProto(feature)) { + return base::unexpected(OnDeviceModelAdaptationAvailability:: + kAdaptationModelExecutionConfigInvalid); + } + return base::ok(OnDeviceModelAdaptationMetadata::New( + *asset_paths, + base::MakeRefCounted<OnDeviceModelFeatureAdapter>(std::move(config)))); +} + +std::unique_ptr<OnDeviceModelAdaptationMetadata> +OnDeviceModelAdaptationMetadataCreated( + ModelBasedCapabilityKey feature, + base::expected<std::unique_ptr<OnDeviceModelAdaptationMetadata>, + OnDeviceModelAdaptationAvailability> metadata) { + if (!metadata.has_value()) { + RecordAdaptationModelAvailability(feature, metadata.error()); + return nullptr; + } + RecordAdaptationModelAvailability( + feature, OnDeviceModelAdaptationAvailability::kAvailable); + return std::move(metadata.value()); +} + } // namespace +// static +std::unique_ptr<OnDeviceModelAdaptationMetadata> +OnDeviceModelAdaptationMetadata::New( + const on_device_model::AdaptationAssetPaths& asset_paths, + scoped_refptr<OnDeviceModelFeatureAdapter> adapter) { + return base::WrapUnique( + new OnDeviceModelAdaptationMetadata(asset_paths, std::move(adapter))); +} + +OnDeviceModelAdaptationMetadata::OnDeviceModelAdaptationMetadata( + const on_device_model::AdaptationAssetPaths& asset_paths, + scoped_refptr<OnDeviceModelFeatureAdapter> adapter) + : asset_paths_(std::move(asset_paths)), adapter_(std::move(adapter)) {} + +OnDeviceModelAdaptationMetadata::OnDeviceModelAdaptationMetadata( + const OnDeviceModelAdaptationMetadata&) = default; +OnDeviceModelAdaptationMetadata::~OnDeviceModelAdaptationMetadata() = default; + OnDeviceModelAdaptationLoader::OnDeviceModelAdaptationLoader( ModelBasedCapabilityKey feature, OptimizationGuideModelProvider* model_provider, @@ -42,7 +100,9 @@ OnLoadFn on_load_fn) : feature_(feature), on_load_fn_(on_load_fn), - model_provider_(model_provider) { + model_provider_(model_provider), + background_task_runner_(base::ThreadPool::CreateSequencedTaskRunner( + {base::MayBlock(), base::TaskPriority::BEST_EFFORT})) { CHECK(features::internal::IsOnDeviceModelAdaptationEnabled(feature_)); if (const auto adaptations_override = GetOnDeviceModelAdaptationOverride( ToModelExecutionFeatureProto(feature_))) { @@ -113,9 +173,24 @@ RecordAdaptationModelAvailability(feature_, result.error()); return; } - RecordAdaptationModelAvailability( - feature_, OnDeviceModelAdaptationAvailability::kAvailable); - on_load_fn_.Run(std::move(result.value())); + auto execution_config_file = model_info->GetAdditionalFileWithBaseName( + kOnDeviceModelExecutionConfigFile); + if (!execution_config_file) { + RecordAdaptationModelAvailability( + feature_, OnDeviceModelAdaptationAvailability:: + kAdaptationModelExecutionConfigInvalid); + + return; + } + + background_task_runner_->PostTaskAndReplyWithResult( + FROM_HERE, + base::BindOnce(&ReadOnDeviceModelExecutionConfig, *execution_config_file), + base::BindOnce(&CreateAdaptatonMetadataFromModelExecutionConfig, feature_, + std::move(result.value())) + .Then( + base::BindOnce(&OnDeviceModelAdaptationMetadataCreated, feature_)) + .Then(on_load_fn_)); } base::expected<std::unique_ptr<on_device_model::AdaptationAssetPaths>,
diff --git a/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.h b/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.h index c2001b1..4ab8027 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.h +++ b/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.h
@@ -4,19 +4,50 @@ #ifndef COMPONENTS_OPTIMIZATION_GUIDE_CORE_MODEL_EXECUTION_ON_DEVICE_ADAPTATION_MODEL_LOADER_H_ #define COMPONENTS_OPTIMIZATION_GUIDE_CORE_MODEL_EXECUTION_ON_DEVICE_ADAPTATION_MODEL_LOADER_H_ +#include "base/memory/scoped_refptr.h" #include "base/scoped_observation.h" +#include "base/task/sequenced_task_runner.h" #include "base/types/expected.h" #include "components/optimization_guide/core/model_execution/feature_keys.h" #include "components/optimization_guide/core/model_execution/on_device_model_component.h" #include "components/optimization_guide/core/optimization_target_model_observer.h" +#include "components/optimization_guide/proto/on_device_model_execution_config.pb.h" #include "services/on_device_model/public/cpp/model_assets.h" namespace optimization_guide { +class OnDeviceModelFeatureAdapter; class OnDeviceModelMetadata; class OptimizationGuideModelProvider; enum class OnDeviceModelAdaptationAvailability; +class OnDeviceModelAdaptationMetadata { + public: + static std::unique_ptr<OnDeviceModelAdaptationMetadata> New( + const on_device_model::AdaptationAssetPaths& asset_paths, + scoped_refptr<OnDeviceModelFeatureAdapter> adapter); + + OnDeviceModelAdaptationMetadata(const OnDeviceModelAdaptationMetadata&); + ~OnDeviceModelAdaptationMetadata(); + + const on_device_model::AdaptationAssetPaths& asset_paths() const { + return asset_paths_; + } + + scoped_refptr<const OnDeviceModelFeatureAdapter> adapter() const { + return adapter_; + } + + private: + friend class OnDeviceModelServiceControllerTest; + + OnDeviceModelAdaptationMetadata( + const on_device_model::AdaptationAssetPaths& asset_paths, + scoped_refptr<OnDeviceModelFeatureAdapter> adapter); + on_device_model::AdaptationAssetPaths asset_paths_; + scoped_refptr<OnDeviceModelFeatureAdapter> adapter_; +}; + // Loads model adaptation assets for a particular feature. Performs adaptation // model compatibility checks with the base model and reloads the assets if the // base model changes. @@ -25,7 +56,7 @@ public OnDeviceModelComponentStateManager::Observer { public: using OnLoadFn = base::RepeatingCallback<void( - std::unique_ptr<on_device_model::AdaptationAssetPaths>)>; + std::unique_ptr<OnDeviceModelAdaptationMetadata>)>; OnDeviceModelAdaptationLoader( ModelBasedCapabilityKey feature, @@ -70,6 +101,9 @@ // The model provider to observe for updates to model adaptations. raw_ptr<OptimizationGuideModelProvider> model_provider_; bool registered_with_model_provider_ = false; + + // Background thread where file processing should be performed. + scoped_refptr<base::SequencedTaskRunner> background_task_runner_; }; } // namespace optimization_guide
diff --git a/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader_unittest.cc b/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader_unittest.cc index b8eb0d5..9c68ce6 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader_unittest.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_adaptation_loader_unittest.cc
@@ -4,11 +4,14 @@ #include "components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.h" +#include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" +#include "base/test/task_environment.h" #include "components/optimization_guide/core/model_execution/feature_keys.h" #include "components/optimization_guide/core/model_execution/model_execution_features.h" +#include "components/optimization_guide/core/model_execution/on_device_model_feature_adapter.h" #include "components/optimization_guide/core/model_execution/test_on_device_model_component.h" #include "components/optimization_guide/core/optimization_guide_constants.h" #include "components/optimization_guide/core/test_model_info_builder.h" @@ -41,6 +44,13 @@ return any_proto; } +void WriteConfigToFile(const base::FilePath& file_path, + const proto::OnDeviceModelExecutionConfig& config) { + std::string serialized_config; + ASSERT_TRUE(config.SerializeToString(&serialized_config)); + ASSERT_TRUE(base::WriteFile(file_path, serialized_config)); +} + } // namespace class FakeOptimizationGuideModelProvider @@ -104,19 +114,19 @@ protected: void OnModelAdaptationLoaded( - std::unique_ptr<on_device_model::AdaptationAssetPaths> - adaptations_assets) { - adaptations_assets_ = std::move(adaptations_assets); + std::unique_ptr<OnDeviceModelAdaptationMetadata> adaptation_metadata) { + adaptation_metadata_ = std::move(adaptation_metadata); } base::test::ScopedFeatureList feature_list_; + base::test::TaskEnvironment task_environment_; TestingPrefServiceSimple pref_service_; base::ScopedTempDir temp_dir_; TestOnDeviceModelComponentStateManager on_device_component_state_manager_{ &pref_service_}; FakeOptimizationGuideModelProvider model_provider_; std::unique_ptr<OnDeviceModelAdaptationLoader> adaptation_loader_; - std::unique_ptr<on_device_model::AdaptationAssetPaths> adaptations_assets_; + std::unique_ptr<OnDeviceModelAdaptationMetadata> adaptation_metadata_; base::HistogramTester histogram_tester_; }; @@ -126,7 +136,7 @@ "OptimizationGuide.ModelExecution.OnDeviceAdaptationModelAvailability." "Test", OnDeviceModelAdaptationAvailability::kBaseModelUnavailable, 1); - EXPECT_FALSE(adaptations_assets_); + EXPECT_FALSE(adaptation_metadata_); } TEST_F(OnDeviceModelAdaptationLoaderTest, BaseModelSpecInvalid) { @@ -136,7 +146,7 @@ "OptimizationGuide.ModelExecution.OnDeviceAdaptationModelAvailability." "Test", OnDeviceModelAdaptationAvailability::kBaseModelSpecInvalid, 1); - EXPECT_FALSE(adaptations_assets_); + EXPECT_FALSE(adaptation_metadata_); } TEST_F(OnDeviceModelAdaptationLoaderTest, AdaptationModelUnavailable) { @@ -149,7 +159,7 @@ "OptimizationGuide.ModelExecution.OnDeviceAdaptationModelAvailability." "Test", OnDeviceModelAdaptationAvailability::kAdaptationModelUnavailable, 1); - EXPECT_FALSE(adaptations_assets_); + EXPECT_FALSE(adaptation_metadata_); } TEST_F(OnDeviceModelAdaptationLoaderTest, AdaptationModelInvalid) { @@ -165,7 +175,7 @@ "OptimizationGuide.ModelExecution.OnDeviceAdaptationModelAvailability." "Test", OnDeviceModelAdaptationAvailability::kAdaptationModelInvalid, 1); - EXPECT_FALSE(adaptations_assets_); + EXPECT_FALSE(adaptation_metadata_); } TEST_F(OnDeviceModelAdaptationLoaderTest, AdaptationModelIncompatible) { @@ -187,7 +197,130 @@ "OptimizationGuide.ModelExecution.OnDeviceAdaptationModelAvailability." "Test", OnDeviceModelAdaptationAvailability::kAdaptationModelIncompatible, 1); - EXPECT_FALSE(adaptations_assets_); + EXPECT_FALSE(adaptation_metadata_); +} + +TEST_F(OnDeviceModelAdaptationLoaderTest, + AdaptationModelInvalidWithoutExecutionConfig) { + SetBaseModelStateChanged( + OnDeviceBaseModelSpec{kBaseModelName, kBaseModelVersion}); + EXPECT_EQ(proto::OptimizationTarget::OPTIMIZATION_TARGET_MODEL_VALIDATION, + model_provider_.optimization_target_); + + TestModelInfoBuilder model_info_builder; + model_info_builder + .SetModelMetadata( + CreateOnDeviceBaseModelMetadata({kBaseModelName, kBaseModelVersion})) + .SetAdditionalFiles({ + temp_dir().Append(kOnDeviceModelAdaptationModelFile), + temp_dir().Append(kOnDeviceModelAdaptationWeightsFile), + temp_dir().Append(kOnDeviceModelExecutionConfigFile), + }); + + SendAdaptationModelUpdated(model_info_builder.Build().get()); + task_environment_.RunUntilIdle(); + histogram_tester_.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceAdaptationModelAvailability." + "Test", + OnDeviceModelAdaptationAvailability:: + kAdaptationModelExecutionConfigInvalid, + 1); + EXPECT_FALSE(adaptation_metadata_); +} + +TEST_F(OnDeviceModelAdaptationLoaderTest, + AdaptationModelInvalidMissingExecutionConfig) { + SetBaseModelStateChanged( + OnDeviceBaseModelSpec{kBaseModelName, kBaseModelVersion}); + EXPECT_EQ(proto::OptimizationTarget::OPTIMIZATION_TARGET_MODEL_VALIDATION, + model_provider_.optimization_target_); + + TestModelInfoBuilder model_info_builder; + model_info_builder + .SetModelMetadata( + CreateOnDeviceBaseModelMetadata({kBaseModelName, kBaseModelVersion})) + .SetAdditionalFiles({ + temp_dir().Append(kOnDeviceModelAdaptationModelFile), + }); + + proto::OnDeviceModelExecutionConfig config; + WriteConfigToFile(temp_dir().Append(kOnDeviceModelExecutionConfigFile), + config); + + SendAdaptationModelUpdated(model_info_builder.Build().get()); + histogram_tester_.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceAdaptationModelAvailability." + "Test", + OnDeviceModelAdaptationAvailability:: + kAdaptationModelExecutionConfigInvalid, + 1); + EXPECT_FALSE(adaptation_metadata_); +} + +TEST_F(OnDeviceModelAdaptationLoaderTest, + AdaptationModelInvalidMultipleFeaturesInExecutionConfig) { + SetBaseModelStateChanged( + OnDeviceBaseModelSpec{kBaseModelName, kBaseModelVersion}); + EXPECT_EQ(proto::OptimizationTarget::OPTIMIZATION_TARGET_MODEL_VALIDATION, + model_provider_.optimization_target_); + + TestModelInfoBuilder model_info_builder; + model_info_builder + .SetModelMetadata( + CreateOnDeviceBaseModelMetadata({kBaseModelName, kBaseModelVersion})) + .SetAdditionalFiles({ + temp_dir().Append(kOnDeviceModelAdaptationModelFile), + }); + + proto::OnDeviceModelExecutionConfig config; + config.add_feature_configs()->set_feature( + proto::MODEL_EXECUTION_FEATURE_TEST); + config.add_feature_configs()->set_feature( + proto::MODEL_EXECUTION_FEATURE_COMPOSE); + WriteConfigToFile(temp_dir().Append(kOnDeviceModelExecutionConfigFile), + config); + + SendAdaptationModelUpdated(model_info_builder.Build().get()); + histogram_tester_.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceAdaptationModelAvailability." + "Test", + OnDeviceModelAdaptationAvailability:: + kAdaptationModelExecutionConfigInvalid, + 1); + EXPECT_FALSE(adaptation_metadata_); +} + +TEST_F(OnDeviceModelAdaptationLoaderTest, AdaptationModelValidWithoutWeights) { + SetBaseModelStateChanged( + OnDeviceBaseModelSpec{kBaseModelName, kBaseModelVersion}); + EXPECT_EQ(proto::OptimizationTarget::OPTIMIZATION_TARGET_MODEL_VALIDATION, + model_provider_.optimization_target_); + + TestModelInfoBuilder model_info_builder; + model_info_builder + .SetModelMetadata( + CreateOnDeviceBaseModelMetadata({kBaseModelName, kBaseModelVersion})) + .SetAdditionalFiles({ + temp_dir().Append(kOnDeviceModelAdaptationModelFile), + temp_dir().Append(kOnDeviceModelExecutionConfigFile), + }); + + proto::OnDeviceModelExecutionConfig config; + config.add_feature_configs()->set_feature( + proto::MODEL_EXECUTION_FEATURE_TEST); + WriteConfigToFile(temp_dir().Append(kOnDeviceModelExecutionConfigFile), + config); + + SendAdaptationModelUpdated(model_info_builder.Build().get()); + task_environment_.RunUntilIdle(); + histogram_tester_.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceAdaptationModelAvailability." + "Test", + OnDeviceModelAdaptationAvailability::kAvailable, 1); + EXPECT_TRUE(adaptation_metadata_); + EXPECT_EQ(base::FilePath(kOnDeviceModelAdaptationModelFile), + adaptation_metadata_->asset_paths().model.BaseName()); + EXPECT_TRUE(adaptation_metadata_->asset_paths().weights.empty()); } TEST_F(OnDeviceModelAdaptationLoaderTest, AdaptationModelValid) { @@ -202,42 +335,27 @@ CreateOnDeviceBaseModelMetadata({kBaseModelName, kBaseModelVersion})) .SetAdditionalFiles({ temp_dir().Append(kOnDeviceModelAdaptationModelFile), - }); - SendAdaptationModelUpdated(model_info_builder.Build().get()); - histogram_tester_.ExpectUniqueSample( - "OptimizationGuide.ModelExecution.OnDeviceAdaptationModelAvailability." - "Test", - OnDeviceModelAdaptationAvailability::kAvailable, 1); - EXPECT_TRUE(adaptations_assets_); - EXPECT_EQ(base::FilePath(kOnDeviceModelAdaptationModelFile), - adaptations_assets_->model.BaseName()); - EXPECT_TRUE(adaptations_assets_->weights.empty()); -} - -TEST_F(OnDeviceModelAdaptationLoaderTest, AdaptationModelValidWithWeights) { - SetBaseModelStateChanged( - OnDeviceBaseModelSpec{kBaseModelName, kBaseModelVersion}); - EXPECT_EQ(proto::OptimizationTarget::OPTIMIZATION_TARGET_MODEL_VALIDATION, - model_provider_.optimization_target_); - - TestModelInfoBuilder model_info_builder; - model_info_builder - .SetModelMetadata( - CreateOnDeviceBaseModelMetadata({kBaseModelName, kBaseModelVersion})) - .SetAdditionalFiles({ - temp_dir().Append(kOnDeviceModelAdaptationModelFile), temp_dir().Append(kOnDeviceModelAdaptationWeightsFile), + temp_dir().Append(kOnDeviceModelExecutionConfigFile), }); + + proto::OnDeviceModelExecutionConfig config; + config.add_feature_configs()->set_feature( + proto::MODEL_EXECUTION_FEATURE_TEST); + WriteConfigToFile(temp_dir().Append(kOnDeviceModelExecutionConfigFile), + config); + SendAdaptationModelUpdated(model_info_builder.Build().get()); + task_environment_.RunUntilIdle(); histogram_tester_.ExpectUniqueSample( "OptimizationGuide.ModelExecution.OnDeviceAdaptationModelAvailability." "Test", OnDeviceModelAdaptationAvailability::kAvailable, 1); - EXPECT_TRUE(adaptations_assets_); + EXPECT_TRUE(adaptation_metadata_); EXPECT_EQ(base::FilePath(kOnDeviceModelAdaptationModelFile), - adaptations_assets_->model.BaseName()); + adaptation_metadata_->asset_paths().model.BaseName()); EXPECT_EQ(base::FilePath(kOnDeviceModelAdaptationWeightsFile), - adaptations_assets_->weights.BaseName()); + adaptation_metadata_->asset_paths().weights.BaseName()); } } // namespace optimization_guide
diff --git a/components/optimization_guide/core/model_execution/on_device_model_metadata.cc b/components/optimization_guide/core/model_execution/on_device_model_metadata.cc index aa87e7bf..b0946bc 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_metadata.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_metadata.cc
@@ -8,12 +8,12 @@ #include <memory> #include "base/containers/contains.h" -#include "base/files/file_util.h" #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/memory/scoped_refptr.h" #include "base/task/task_traits.h" #include "base/task/thread_pool.h" +#include "components/optimization_guide/core/model_execution/model_execution_util.h" #include "components/optimization_guide/core/model_execution/on_device_model_feature_adapter.h" #include "components/optimization_guide/core/model_util.h" #include "components/optimization_guide/core/optimization_guide_constants.h" @@ -22,27 +22,6 @@ namespace optimization_guide { -namespace { - -std::unique_ptr<proto::OnDeviceModelExecutionConfig> -ReadOnDeviceModelExecutionConfig(const base::FilePath& path) { - // Unpack and verify model config file. - base::FilePath config_path = path.Append(kOnDeviceModelExecutionConfigFile); - std::string binary_config_pb; - if (!base::ReadFileToString(config_path, &binary_config_pb)) { - return nullptr; - } - - auto config = std::make_unique<proto::OnDeviceModelExecutionConfig>(); - if (!config->ParseFromString(binary_config_pb)) { - return nullptr; - } - - return config; -} - -} // namespace - OnDeviceModelMetadata::OnDeviceModelMetadata( const base::FilePath& model_path, const std::string& version, @@ -114,7 +93,9 @@ void OnDeviceModelMetadataLoader::Load(const base::FilePath& model_path, const std::string& version) { background_task_runner_->PostTaskAndReplyWithResult( - FROM_HERE, base::BindOnce(&ReadOnDeviceModelExecutionConfig, model_path), + FROM_HERE, + base::BindOnce(&ReadOnDeviceModelExecutionConfig, + model_path.Append(kOnDeviceModelExecutionConfigFile)), base::BindOnce(&OnDeviceModelMetadata::New, model_path, version) .Then(on_load_fn_)); }
diff --git a/components/optimization_guide/core/model_execution/on_device_model_service_controller.cc b/components/optimization_guide/core/model_execution/on_device_model_service_controller.cc index 0a9c18f..0dc7a8f60 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_service_controller.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_service_controller.cc
@@ -19,6 +19,7 @@ #include "components/optimization_guide/core/model_execution/model_execution_util.h" #include "components/optimization_guide/core/model_execution/on_device_model_access_controller.h" #include "components/optimization_guide/core/model_execution/on_device_model_adaptation_controller.h" +#include "components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.h" #include "components/optimization_guide/core/model_execution/on_device_model_component.h" #include "components/optimization_guide/core/model_execution/on_device_model_metadata.h" #include "components/optimization_guide/core/model_execution/safety_model_info.h" @@ -102,10 +103,7 @@ } } - // Check feature config. - scoped_refptr<const OnDeviceModelFeatureAdapter> adapter = - model_metadata_->GetAdapter(ToModelExecutionFeatureProto(feature)); - if (!adapter) { + if (!GetFeatureAdapter(feature)) { return OnDeviceModelEligibilityReason::kConfigNotAvailableForFeature; } @@ -114,8 +112,7 @@ } if (features::internal::IsOnDeviceModelAdaptationEnabled(feature) && - !base::Contains(model_adaptation_assets_, - ToModelExecutionFeatureProto(feature))) { + !base::Contains(model_adaptation_metadata_, feature)) { return OnDeviceModelEligibilityReason::kModelAdaptationNotAvailable; } @@ -173,17 +170,14 @@ CHECK(!model_paths.language_detection_model.empty()); } } - - scoped_refptr<const OnDeviceModelFeatureAdapter> adapter = - model_metadata_->GetAdapter(ToModelExecutionFeatureProto(feature)); + auto adapter = GetFeatureAdapter(feature); CHECK(adapter); std::optional<on_device_model::AdaptationAssetPaths> adaptation_assets; if (features::internal::IsOnDeviceModelAdaptationEnabled(feature)) { - auto it = - model_adaptation_assets_.find(ToModelExecutionFeatureProto(feature)); - CHECK(it != model_adaptation_assets_.end()); - adaptation_assets = it->second; + auto it = model_adaptation_metadata_.find(feature); + CHECK(it != model_adaptation_metadata_.end()); + adaptation_assets = it->second.asset_paths(); } SessionImpl::OnDeviceOptions opts; @@ -302,12 +296,11 @@ void OnDeviceModelServiceController::MaybeUpdateModelAdaptation( ModelBasedCapabilityKey feature, - std::unique_ptr<on_device_model::AdaptationAssetPaths> adaptations_assets) { - if (!adaptations_assets) { - model_adaptation_assets_.erase(ToModelExecutionFeatureProto(feature)); + std::unique_ptr<OnDeviceModelAdaptationMetadata> adaptation_metadata) { + if (!adaptation_metadata) { + model_adaptation_metadata_.erase(feature); } else { - model_adaptation_assets_[ToModelExecutionFeatureProto(feature)] = - *adaptations_assets; + model_adaptation_metadata_.emplace(feature, *adaptation_metadata); } auto it = model_adaptation_controllers_.find(feature); if (it != model_adaptation_controllers_.end()) { @@ -407,4 +400,17 @@ } } +scoped_refptr<const OnDeviceModelFeatureAdapter> +OnDeviceModelServiceController::GetFeatureAdapter( + ModelBasedCapabilityKey feature) { + // Take the feature config from adaptation model metadata or base model + // metadata. + auto adaptation_metadata_it = model_adaptation_metadata_.find(feature); + if (adaptation_metadata_it != model_adaptation_metadata_.end() && + adaptation_metadata_it->second.adapter()) { + return adaptation_metadata_it->second.adapter(); + } + return model_metadata_->GetAdapter(ToModelExecutionFeatureProto(feature)); +} + } // namespace optimization_guide
diff --git a/components/optimization_guide/core/model_execution/on_device_model_service_controller.h b/components/optimization_guide/core/model_execution/on_device_model_service_controller.h index 8b21510..5407319 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_service_controller.h +++ b/components/optimization_guide/core/model_execution/on_device_model_service_controller.h
@@ -42,6 +42,7 @@ namespace optimization_guide { enum class OnDeviceModelEligibilityReason; class OnDeviceModelAccessController; +class OnDeviceModelAdaptationMetadata; class OnDeviceModelComponentStateManager; class OnDeviceModelMetadata; class ModelQualityLogsUploaderService; @@ -119,8 +120,7 @@ // Updates the model adaptation for the feature. void MaybeUpdateModelAdaptation( ModelBasedCapabilityKey feature, - std::unique_ptr<on_device_model::AdaptationAssetPaths> - adaptations_assets); + std::unique_ptr<OnDeviceModelAdaptationMetadata> adaptation_metadata); // Called when the model adaptation remote is disconnected. void OnModelAdaptationRemoteDisconnected(ModelBasedCapabilityKey feature, @@ -200,6 +200,9 @@ // idle. void OnRemoteIdle(); + scoped_refptr<const OnDeviceModelFeatureAdapter> GetFeatureAdapter( + ModelBasedCapabilityKey feature); + // This may be null in the destructor, otherwise non-null. std::unique_ptr<OnDeviceModelAccessController> access_controller_; std::optional<OnDeviceModelMetadataLoader> model_metadata_loader_; @@ -225,9 +228,8 @@ // Map from feature to its adaptation assets. Present only for features that // have valid model adaptation. It could be missing for features that require // model adaptation, but they have not been loaded yet. - base::flat_map<proto::ModelExecutionFeature, - on_device_model::AdaptationAssetPaths> - model_adaptation_assets_; + base::flat_map<ModelBasedCapabilityKey, OnDeviceModelAdaptationMetadata> + model_adaptation_metadata_; SEQUENCE_CHECKER(sequence_checker_);
diff --git a/components/optimization_guide/core/model_execution/on_device_model_service_controller_unittest.cc b/components/optimization_guide/core/model_execution/on_device_model_service_controller_unittest.cc index 867e67c..8cc9bf5 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_service_controller_unittest.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_service_controller_unittest.cc
@@ -22,6 +22,7 @@ #include "components/optimization_guide/core/model_execution/feature_keys.h" #include "components/optimization_guide/core/model_execution/model_execution_features.h" #include "components/optimization_guide/core/model_execution/on_device_model_access_controller.h" +#include "components/optimization_guide/core/model_execution/on_device_model_adaptation_loader.h" #include "components/optimization_guide/core/model_execution/on_device_model_metadata.h" #include "components/optimization_guide/core/model_execution/on_device_model_service_controller.h" #include "components/optimization_guide/core/model_execution/on_device_model_test_utils.h" @@ -442,10 +443,12 @@ test_controller_->MaybeUpdateModelAdaptation( ModelBasedCapabilityKey::kCompose, - std::make_unique<on_device_model::AdaptationAssetPaths>()); + OnDeviceModelAdaptationMetadata::New( + on_device_model::AdaptationAssetPaths(), /*adapter=*/nullptr)); test_controller_->MaybeUpdateModelAdaptation( ModelBasedCapabilityKey::kTest, - std::make_unique<on_device_model::AdaptationAssetPaths>()); + OnDeviceModelAdaptationMetadata::New( + on_device_model::AdaptationAssetPaths(), /*adapter=*/nullptr)); auto session_compose = test_controller_->CreateSession( ModelBasedCapabilityKey::kCompose, base::DoNothing(),
diff --git a/components/optimization_guide/core/optimization_guide_enums.h b/components/optimization_guide/core/optimization_guide_enums.h index f6c15b35..91ae0f2 100644 --- a/components/optimization_guide/core/optimization_guide_enums.h +++ b/components/optimization_guide/core/optimization_guide_enums.h
@@ -390,9 +390,12 @@ // The received adaptation model was incompatible with the base model. kAdaptationModelIncompatible = 5, + // The execution config in the adaptation model was invalid. + kAdaptationModelExecutionConfigInvalid = 6, + // This must be kept in sync with OnDeviceModelAdaptationAvailability in // optimization/enums.xml. - kMaxValue = kAdaptationModelIncompatible, + kMaxValue = kAdaptationModelExecutionConfigInvalid, }; } // namespace optimization_guide
diff --git a/components/optimization_guide/internal b/components/optimization_guide/internal index 005ad66..e47d902 160000 --- a/components/optimization_guide/internal +++ b/components/optimization_guide/internal
@@ -1 +1 @@ -Subproject commit 005ad665fd92f7a71818f9f97d5a603b46f47eab +Subproject commit e47d902eb037b995eb07330a5fb9e7ecd29d3f23
diff --git a/components/sync/protocol/proto_memory_estimations.cc b/components/sync/protocol/proto_memory_estimations.cc index 48365c4..1a83765 100644 --- a/components/sync/protocol/proto_memory_estimations.cc +++ b/components/sync/protocol/proto_memory_estimations.cc
@@ -6,6 +6,7 @@ #include "components/sync/protocol/proto_memory_estimations.h" +#include <concepts> #include <string> #include "base/trace_event/memory_usage_estimator.h" @@ -64,9 +65,8 @@ // Types derived from MessageLite (i.e. protos) template <class P, class F> - typename std::enable_if< - std::is_base_of<google::protobuf::MessageLite, F>::value>::type - Visit(const P&, const char* field_name, const F& field) { + requires(std::derived_from<F, google::protobuf::MessageLite>) + void Visit(const P&, const char* field_name, const F& field) { using base::trace_event::EstimateMemoryUsage; // All object fields are dynamically allocated. memory_usage_ += sizeof(F) + EstimateMemoryUsage(field); @@ -74,8 +74,8 @@ // Arithmetic types template <class P, class F> - typename std::enable_if<std::is_arithmetic<F>::value>::type - Visit(const P&, const char* field_name, const F& field) { + requires(std::is_arithmetic_v<F>) + void Visit(const P&, const char* field_name, const F& field) { // Arithmetic fields (integers, floats & bool) don't allocate. } @@ -105,10 +105,10 @@ // RepeatedField<arithmetic type> template <class P, class F> - typename std::enable_if<std::is_arithmetic<F>::value>::type Visit( - const P&, - const char* field_name, - const google::protobuf::RepeatedField<F>& fields) { + requires(std::is_arithmetic_v<F>) + void Visit(const P&, + const char* field_name, + const google::protobuf::RepeatedField<F>& fields) { memory_usage_ += fields.SpaceUsedExcludingSelf(); // Arithmetic fields (integers, floats & bool) don't allocate, so no point // in iterating over |fields|.
diff --git a/components/tpcd/metadata/browser/manager.cc b/components/tpcd/metadata/browser/manager.cc index a73ec51..4091bae 100644 --- a/components/tpcd/metadata/browser/manager.cc +++ b/components/tpcd/metadata/browser/manager.cc
@@ -120,8 +120,7 @@ ContentSettingsForOneType Manager::BuildGrantsWithPredicate( base::FunctionRef<bool(const MetadataEntry&)> predicate) { base::flat_set<std::string> remove_keys; - if (base::FeatureList::IsEnabled( - net::features::kTpcdMetadataStagedRollback) && + if (base::FeatureList::IsEnabled(net::features::kTpcdMetadataStageControl) && local_state_) { const base::Value::Dict& dict = local_state_->GetDict(prefs::kCohorts); for (const auto itr : dict) { @@ -154,7 +153,7 @@ if (!Parser::IsDtrpEligible( Parser::ToRuleSource(metadata_entry.source())) || !base::FeatureList::IsEnabled( - net::features::kTpcdMetadataStagedRollback)) { + net::features::kTpcdMetadataStageControl)) { cohort = content_settings::mojom::TpcdMetadataCohort::DEFAULT; } @@ -209,8 +208,7 @@ /*incognito=*/false, std::move(rule_metadata)); } - if (base::FeatureList::IsEnabled( - net::features::kTpcdMetadataStagedRollback) && + if (base::FeatureList::IsEnabled(net::features::kTpcdMetadataStageControl) && local_state_) { ScopedDictPrefUpdate update(local_state_, prefs::kCohorts); for (const auto& key : remove_keys) { @@ -247,8 +245,7 @@ } void Manager::ResetCohorts() { - if (!base::FeatureList::IsEnabled( - net::features::kTpcdMetadataStagedRollback)) { + if (!base::FeatureList::IsEnabled(net::features::kTpcdMetadataStageControl)) { return; }
diff --git a/components/tpcd/metadata/browser/manager_unittest.cc b/components/tpcd/metadata/browser/manager_unittest.cc index 122dc1a..05c783c 100644 --- a/components/tpcd/metadata/browser/manager_unittest.cc +++ b/components/tpcd/metadata/browser/manager_unittest.cc
@@ -264,9 +264,9 @@ content_settings::features::kIndexedHostContentSettingsMap); if (IsTpcdMetadataStagedRollbackEnabled()) { - enabled_features.push_back(net::features::kTpcdMetadataStagedRollback); + enabled_features.push_back(net::features::kTpcdMetadataStageControl); } else { - disabled_features.push_back(net::features::kTpcdMetadataStagedRollback); + disabled_features.push_back(net::features::kTpcdMetadataStageControl); } scoped_feature_list_.InitWithFeatures(enabled_features, disabled_features); @@ -555,7 +555,7 @@ void SetUp() override { scoped_list_.InitWithFeatures({net::features::kTpcdMetadataGrants, - net::features::kTpcdMetadataStagedRollback}, + net::features::kTpcdMetadataStageControl}, {}); RegisterLocalStatePrefs(local_state_.registry());
diff --git a/components/tpcd/metadata/browser/parser.cc b/components/tpcd/metadata/browser/parser.cc index ab1775a0..99548bf 100644 --- a/components/tpcd/metadata/browser/parser.cc +++ b/components/tpcd/metadata/browser/parser.cc
@@ -99,7 +99,7 @@ } if (base::FeatureList::IsEnabled( - net::features::kTpcdMetadataStagedRollback)) { + net::features::kTpcdMetadataStageControl)) { if (tpcd::metadata::Parser::IsDtrpEligible( tpcd::metadata::Parser::ToRuleSource(me.source()))) { if (!me.has_dtrp() || !IsValidDtrp(me.dtrp())) {
diff --git a/components/ukm/app_source_url_recorder.h b/components/ukm/app_source_url_recorder.h index af5a4ed3..63b878f 100644 --- a/components/ukm/app_source_url_recorder.h +++ b/components/ukm/app_source_url_recorder.h
@@ -15,6 +15,7 @@ class GURL; namespace apps { +class AppDiscoveryMetrics; class AppPlatformMetrics; } @@ -44,6 +45,8 @@ class AppSourceUrlRecorder { private: + friend class apps::AppDiscoveryMetrics; + friend class apps::AppPlatformMetrics; friend class AppSourceUrlRecorderTest;
diff --git a/components/viz/test/BUILD.gn b/components/viz/test/BUILD.gn index 25ba6880..6213553 100644 --- a/components/viz/test/BUILD.gn +++ b/components/viz/test/BUILD.gn
@@ -77,8 +77,6 @@ "test_frame_sink_manager.h", "test_gles2_interface.cc", "test_gles2_interface.h", - "test_gpu_memory_buffer_manager.cc", - "test_gpu_memory_buffer_manager.h", "test_gpu_service_holder.cc", "test_gpu_service_holder.h", "test_in_process_context_provider.cc",
diff --git a/components/viz/test/DEPS b/components/viz/test/DEPS index 326dda9..b5b21248 100644 --- a/components/viz/test/DEPS +++ b/components/viz/test/DEPS
@@ -12,6 +12,7 @@ "+gpu/command_buffer/client/raster_interface.h", "+gpu/command_buffer/client/shared_image_interface.h", "+gpu/command_buffer/client/shared_memory_limits.h", + "+gpu/command_buffer/client/test_gpu_memory_buffer_manager.h", "+gpu/command_buffer/common", "+gpu/command_buffer/service/shared_image/shared_image_format_service_utils.h", "+gpu/config/gpu_feature_info.h",
diff --git a/components/viz/test/test_context_provider.h b/components/viz/test/test_context_provider.h index f7a6992..7e972fc 100644 --- a/components/viz/test/test_context_provider.h +++ b/components/viz/test/test_context_provider.h
@@ -22,9 +22,9 @@ #include "components/viz/common/gpu/context_provider.h" #include "components/viz/common/gpu/raster_context_provider.h" #include "components/viz/test/test_context_support.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "gpu/command_buffer/client/gles2_interface_stub.h" #include "gpu/command_buffer/client/shared_image_interface.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" #include "gpu/command_buffer/common/shared_image_capabilities.h" #include "gpu/config/gpu_feature_info.h" #include "gpu/ipc/client/shared_image_interface_proxy.h" @@ -134,7 +134,7 @@ } void UseTestGMBInSharedImageCreationWithBufferUsage() { - test_gmb_manager_ = std::make_unique<TestGpuMemoryBufferManager>(); + test_gmb_manager_ = std::make_unique<gpu::TestGpuMemoryBufferManager>(); } protected: @@ -154,7 +154,7 @@ // If non-null, this will be used to back mappable SharedImages with test // GpuMemoryBuffers. - std::unique_ptr<TestGpuMemoryBufferManager> test_gmb_manager_; + std::unique_ptr<gpu::TestGpuMemoryBufferManager> test_gmb_manager_; }; class TestContextProvider
diff --git a/content/browser/accessibility/ax_platform_node_textrangeprovider_win_browsertest.cc b/content/browser/accessibility/ax_platform_node_textrangeprovider_win_browsertest.cc index a665f798..2a23065 100644 --- a/content/browser/accessibility/ax_platform_node_textrangeprovider_win_browsertest.cc +++ b/content/browser/accessibility/ax_platform_node_textrangeprovider_win_browsertest.cc
@@ -4029,8 +4029,9 @@ EXPECT_UIA_DOUBLE_SAFEARRAY_EQ(rectangles.Get(), expected_values); } +// TODO(crbug.com/340389557): This test is flaky. IN_PROC_BROWSER_TEST_F(AXPlatformNodeTextRangeProviderWinBrowserTest, - TextDeletedInTextFieldAdjustmentNeeded) { + DISABLED_TextDeletedInTextFieldAdjustmentNeeded) { // This test, tests a scenario where an AT is used to make a deletion on some // text and then manually moves the caret around: On the input "hello world // red green<> blue" where the caret position is noted by <>:
diff --git a/content/browser/compositor/test/test_image_transport_factory.h b/content/browser/compositor/test/test_image_transport_factory.h index 294078d..0fe8d53e 100644 --- a/content/browser/compositor/test/test_image_transport_factory.h +++ b/content/browser/compositor/test/test_image_transport_factory.h
@@ -13,8 +13,8 @@ #include "components/viz/common/surfaces/subtree_capture_id_allocator.h" #include "components/viz/host/host_frame_sink_manager.h" #include "components/viz/test/test_frame_sink_manager.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "content/browser/compositor/image_transport_factory.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "ui/compositor/compositor.h" @@ -52,7 +52,7 @@ private: cc::TestTaskGraphRunner task_graph_runner_; - viz::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; + gpu::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; viz::RendererSettings renderer_settings_; viz::FrameSinkIdAllocator frame_sink_id_allocator_; viz::SubtreeCaptureIdAllocator subtree_capture_id_allocator_;
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index d08ad3a..6535215 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -269,6 +269,11 @@ "CrashOnDanglingBrowserContext", base::FEATURE_ENABLED_BY_DEFAULT); +// Kill switch for inner WebContents visibility updates. +BASE_FEATURE(kUpdateInnerWebContentsVisibility, + "UpdateInnerWebContentsVisibility", + base::FEATURE_ENABLED_BY_DEFAULT); + using LifecycleState = RenderFrameHost::LifecycleState; using LifecycleStateImpl = RenderFrameHostImpl::LifecycleStateImpl; using AttributionReportingOsRegistrar = @@ -4334,6 +4339,19 @@ if (new_visibility != Visibility::VISIBLE) { SetVisibilityAndNotifyObservers(new_visibility); } + + if (base::FeatureList::IsEnabled(kUpdateInnerWebContentsVisibility)) { + // Inner WebContents are skipped in ForEachRenderViewHost() above, which + // causes inner WebContents to not be notified of visibility changes. + // + // Note: An inner WebContents that is hidden within the embedder could + // spuriously be set to visible (e.g. if its parent is display:none), but + // this is ignored here for now. + for (WebContents* inner : GetInnerWebContents()) { + static_cast<WebContentsImpl*>(inner) + ->UpdateVisibilityAndNotifyPageAndView(new_visibility, is_activity); + } + } } #if BUILDFLAG(IS_ANDROID)
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc index 9066b30..770e7db4 100644 --- a/content/browser/web_contents/web_contents_impl_browsertest.cc +++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -4348,6 +4348,33 @@ } } +// Non-regression test for crbug.com/336843455. +IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, InnerWebContentsVisibility) { + ASSERT_TRUE(embedded_test_server()->Start()); + GURL url_a(embedded_test_server()->GetURL("a.com", "/page_with_iframe.html")); + GURL url_b(embedded_test_server()->GetURL("b.com", "/title1.html")); + + EXPECT_TRUE(NavigateToURL(shell(), url_a)); + auto* root_contents = static_cast<WebContentsImpl*>(shell()->web_contents()); + + WebContentsImpl* inner_contents = + static_cast<WebContentsImpl*>(CreateAndAttachInnerContents( + ChildFrameAt(root_contents->GetPrimaryMainFrame(), 0))); + ASSERT_TRUE(NavigateToURLFromRenderer(inner_contents, url_b)); + + root_contents->WasShown(); + EXPECT_EQ(Visibility::VISIBLE, root_contents->GetVisibility()); + EXPECT_EQ(PageVisibilityState::kVisible, + root_contents->GetPrimaryMainFrame()->GetVisibilityState()); + EXPECT_EQ(Visibility::VISIBLE, inner_contents->GetVisibility()); + + root_contents->WasHidden(); + EXPECT_EQ(Visibility::HIDDEN, root_contents->GetVisibility()); + EXPECT_EQ(PageVisibilityState::kHidden, + root_contents->GetPrimaryMainFrame()->GetVisibilityState()); + EXPECT_EQ(Visibility::HIDDEN, inner_contents->GetVisibility()); +} + IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, ShutdownDuringSpeculativeNavigation) { ASSERT_TRUE(embedded_test_server()->Start());
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 4a295ca..ecd7c353 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -1221,7 +1221,7 @@ // NV12 is present (as determined by the relevant command-line flags). BASE_FEATURE(kGateNV12GMBVideoFramesOnHWSupport, "GateNV12GMBVideoFramesOnHWSupport", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); #endif #if BUILDFLAG(IS_MAC)
diff --git a/content/renderer/media/gpu/gpu_video_accelerator_factories_impl_unittest.cc b/content/renderer/media/gpu/gpu_video_accelerator_factories_impl_unittest.cc index e633fc0..ca0a1b1b 100644 --- a/content/renderer/media/gpu/gpu_video_accelerator_factories_impl_unittest.cc +++ b/content/renderer/media/gpu/gpu_video_accelerator_factories_impl_unittest.cc
@@ -5,6 +5,7 @@ #include "content/renderer/media/gpu/gpu_video_accelerator_factories_impl.h" #include <GLES2/gl2.h> + #include <cstddef> #include <memory> @@ -16,10 +17,10 @@ #include "build/build_config.h" #include "components/viz/common/gpu/context_cache_controller.h" #include "components/viz/common/gpu/context_lost_observer.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "content/public/common/gpu_stream_constants.h" #include "content/renderer/media/codec_factory.h" #include "gpu/command_buffer/client/gles2_interface_stub.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" #include "gpu/command_buffer/common/capabilities.h" #include "gpu/command_buffer/common/context_creation_attribs.h" #include "gpu/command_buffer/common/context_result.h" @@ -498,7 +499,7 @@ NiceMock<gpu::MockGpuChannel> mock_gpu_channel_; NiceMock<MockGLESInterface> mock_context_gl_; - viz::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; + gpu::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; scoped_refptr<TestGpuChannelHost> gpu_channel_host_; scoped_refptr<MockContextProviderCommandBuffer> mock_context_provider_; std::unique_ptr<gpu::CommandBufferProxyImpl> gpu_command_buffer_proxy_;
diff --git a/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt index c98f3794..7ba2d06 100644 --- a/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt
@@ -203,8 +203,6 @@ # Flaky failure to restore context crbug.com/338071088 [ amd-0x67ef angle-opengl graphite-disabled no-asan passthrough release sonoma ] ContextLost_WebGL2UnpackImageHeight [ Failure ] -# Flaky 3rd GPU crash -crbug.com/338570701 [ win angle-d3d11 graphite-enabled passthrough qualcomm-0x41333430 ] GpuCrash_GPUProcessCrashesExactlyOncePerVisitToAboutGpuCrash [ Failure ] ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here #
diff --git a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt index 06f3449c..e7606d00 100644 --- a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt
@@ -484,10 +484,6 @@ crbug.com/40935289 [ fuchsia no-clang-coverage web-engine-shell ] Pixel_Video_VP9 [ Failure ] # Failures on Windows with SkiaGraphite -crbug.com/329235191 [ amd-0x7340 graphite-enabled release-x64 win10 ] Pixel_VideoStreamFrom2DCanvas [ Failure ] -crbug.com/329235191 [ graphite-enabled qualcomm-0x41333430 win11 ] Pixel_VideoStreamFrom2DCanvas [ Failure ] -crbug.com/329235191 [ graphite-enabled qualcomm-0x41333430 win11 ] Pixel_VideoStreamFromWebGLCanvas [ Failure ] -crbug.com/329235191 [ graphite-enabled qualcomm-0x41333430 win11 ] Pixel_VideoStreamFromWebGLCanvas_OneCopy [ Failure ] crbug.com/329235191 [ graphite-enabled nvidia-0x2184 win10 ] Pixel_WebGL_PremultipliedAlpha_False [ Failure ] crbug.com/329235191 [ graphite-enabled qualcomm-0x41333430 target-cpu-64 win11 ] Pixel_WebGL_PremultipliedAlpha_False [ Failure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt index 0177064..c63e1d9 100644 --- a/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt
@@ -219,7 +219,6 @@ crbug.com/1201009 [ fuchsia ] WebGLCanvasCaptureTraceTest_VideoStreamFromWebGLCanvas_TwoCopy_Accelerated [ Failure ] -crbug.com/1402261 [ graphite-disabled intel-0x9bc5 win ] OverlayModeTraceTest_DirectComposition_Video_* [ RetryOnFailure ] # Broadly flaky unsymbolized crashes on Jacuzzi
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt index 27177759..77500c0 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt
@@ -501,8 +501,6 @@ crbug.com/1523401 [ win11 qualcomm-0x41333430 angle-d3d11 ] conformance2/rendering/framebuffer-mismatched-attachment-targets.html [ Failure ] crbug.com/338008895 [ win11 angle-d3d11 qualcomm-0x41333430 passthrough release ] conformance2/textures/image_bitmap_from_video/tex-2d-r32f-red-float.html [ Failure ] crbug.com/338008895 [ win11 angle-d3d11 qualcomm-0x41333430 passthrough release ] conformance2/textures/image_bitmap_from_video/tex-3d-rg16f-rg-float.html [ Failure ] -crbug.com/1523401 [ win11 qualcomm-0x41333430 angle-d3d11 ] conformance2/textures/image_bitmap_from_video/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html [ Failure ] -crbug.com/1523401 [ win11 qualcomm-0x41333430 angle-d3d11 ] conformance2/textures/video/tex-3d-rgba4-rgba-unsigned_byte.html [ Failure ] crbug.com/1523401 [ win11 qualcomm-0x41333430 angle-d3d11 ] deqp/data/gles3/shaders/linkage.html [ Failure ] crbug.com/1523401 [ win11 qualcomm-0x41333430 angle-d3d11 ] deqp/functional/gles3/shaderindexing/tmp.html [ Failure ] crbug.com/1523401 [ win11 qualcomm-0x41333430 angle-d3d11 ] deqp/functional/gles3/shaderindexing/varying.html [ Failure ] @@ -1041,10 +1039,6 @@ crbug.com/335203259 [ linux ] conformance2/wasm/readpixels-16gb-wasm-memory.html [ Failure ] crbug.com/335203259 [ linux ] conformance2/wasm/teximage2d-16gb-wasm-memory.html [ Failure ] crbug.com/335203259 [ linux ] conformance2/wasm/texsubimage2d-16gb-wasm-memory.html [ Failure ] -crbug.com/335203259 [ win target-cpu-64 ] conformance2/wasm/bufferdata-16gb-wasm-memory.html [ RetryOnFailure ] -crbug.com/335203259 [ win target-cpu-64 ] conformance2/wasm/buffersubdata-16gb-wasm-memory.html [ RetryOnFailure ] -crbug.com/335203259 [ win target-cpu-64 ] conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html [ RetryOnFailure ] -crbug.com/335203259 [ win target-cpu-64 ] conformance2/wasm/texsubimage2d-16gb-wasm-memory.html [ RetryOnFailure ] crbug.com/335203259 [ win target-cpu-32 ] conformance2/wasm/bufferdata-16gb-wasm-memory.html [ Failure ] crbug.com/335203259 [ win target-cpu-32 ] conformance2/wasm/bufferdata-4gb-wasm-memory.html [ Failure ] crbug.com/335203259 [ win target-cpu-32 ] conformance2/wasm/buffersubdata-16gb-wasm-memory.html [ Failure ]
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn index bb337b4..094d6e8 100644 --- a/gpu/BUILD.gn +++ b/gpu/BUILD.gn
@@ -173,6 +173,8 @@ "command_buffer/client/gles2_interface_stub.h", "command_buffer/client/gles2_interface_stub_autogen.h", "command_buffer/client/gles2_interface_stub_impl_autogen.h", + "command_buffer/client/test_gpu_memory_buffer_manager.cc", + "command_buffer/client/test_gpu_memory_buffer_manager.h", "command_buffer/client/webgpu_interface_stub.cc", "command_buffer/client/webgpu_interface_stub.h", "command_buffer/client/webgpu_interface_stub_autogen.h",
diff --git a/gpu/command_buffer/client/client_shared_image_unittest.cc b/gpu/command_buffer/client/client_shared_image_unittest.cc index c05dddd4..f1bab01 100644 --- a/gpu/command_buffer/client/client_shared_image_unittest.cc +++ b/gpu/command_buffer/client/client_shared_image_unittest.cc
@@ -384,10 +384,10 @@ } } -// When the client asks for WEBGPU usage with a single-plane format, -// GL_TEXTURE_2D should be used as the texture target on all platforms other -// than Mac, where the MacOS-specific target for native buffers should be used. -TEST(ClientSharedImageTest, GetTextureTarget_SinglePlaneFormats_WebGPUUsage) { +// When the client asks for WEBGPU usage, GL_TEXTURE_2D should be used as the +// texture target on all platforms other than Mac, where the MacOS-specific +// target for native buffers should be used. +TEST(ClientSharedImageTest, GetTextureTarget_WebGPUUsage) { auto sii = base::MakeRefCounted<TestSharedImageInterface>(); #if BUILDFLAG(IS_MAC) @@ -397,12 +397,22 @@ sii->set_macos_specific_texture_target(kMacOSSpecificTarget); #endif + // Test all single-plane formats as well as multiplane formats for which + // hardware GMBs are supported. + std::vector<viz::SharedImageFormat> formats_to_test; + for (auto format : viz::SinglePlaneFormat::kAll) { + formats_to_test.push_back(format); + } + for (auto format : kMultiPlaneFormatsWithHardwareGMBs) { + formats_to_test.push_back(format); + } + for (uint32_t webgpu_usage : {SHARED_IMAGE_USAGE_WEBGPU_READ, SHARED_IMAGE_USAGE_WEBGPU_WRITE}) { const gfx::Size kSize(256, 256); const uint32_t kUsage = webgpu_usage; - for (auto format : viz::SinglePlaneFormat::kAll) { + for (auto format : formats_to_test) { SharedImageInfo si_info{format, kSize, gfx::ColorSpace(),
diff --git a/components/viz/test/test_gpu_memory_buffer_manager.cc b/gpu/command_buffer/client/test_gpu_memory_buffer_manager.cc similarity index 98% rename from components/viz/test/test_gpu_memory_buffer_manager.cc rename to gpu/command_buffer/client/test_gpu_memory_buffer_manager.cc index cf1e17d..942beb4 100644 --- a/components/viz/test/test_gpu_memory_buffer_manager.cc +++ b/gpu/command_buffer/client/test_gpu_memory_buffer_manager.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/viz/test/test_gpu_memory_buffer_manager.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" #include <stddef.h> #include <stdint.h> @@ -14,7 +14,7 @@ #include "ui/gfx/buffer_format_util.h" #include "ui/gfx/gpu_memory_buffer.h" -namespace viz { +namespace gpu { namespace { class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { @@ -207,4 +207,4 @@ return false; } -} // namespace viz +} // namespace gpu
diff --git a/components/viz/test/test_gpu_memory_buffer_manager.h b/gpu/command_buffer/client/test_gpu_memory_buffer_manager.h similarity index 89% rename from components/viz/test/test_gpu_memory_buffer_manager.h rename to gpu/command_buffer/client/test_gpu_memory_buffer_manager.h index cebeceb..862cbee 100644 --- a/components/viz/test/test_gpu_memory_buffer_manager.h +++ b/gpu/command_buffer/client/test_gpu_memory_buffer_manager.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_VIZ_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ -#define COMPONENTS_VIZ_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ +#ifndef GPU_COMMAND_BUFFER_CLIENT_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ +#define GPU_COMMAND_BUFFER_CLIENT_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ #include <map> #include <memory> @@ -12,7 +12,7 @@ #include "base/synchronization/lock.h" #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" -namespace viz { +namespace gpu { class TestGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager { public: @@ -71,6 +71,6 @@ bool fail_on_create_ = false; }; -} // namespace viz +} // namespace gpu -#endif // COMPONENTS_VIZ_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ +#endif // GPU_COMMAND_BUFFER_CLIENT_TEST_GPU_MEMORY_BUFFER_MANAGER_H_
diff --git a/gpu/command_buffer/service/shared_image/shared_image_factory.cc b/gpu/command_buffer/service/shared_image/shared_image_factory.cc index de112a5..a581c02 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_factory.cc +++ b/gpu/command_buffer/service/shared_image/shared_image_factory.cc
@@ -87,6 +87,15 @@ namespace { +#if BUILDFLAG(IS_CHROMEOS) +// Feature enabling ExternalVkImageBacking use on ChromeOS. Serves as reverse +// killswitch while we roll out disabling of this backing on ChromeOS. +// TODO(crbug.com/336837285): Remove post-safe rollout. +BASE_FEATURE(kUseExternalVkImageBackingOnChromeOS, + "UseExternalVkImageBackingOnChromeOS", + base::FEATURE_DISABLED_BY_DEFAULT); +#endif + #if BUILDFLAG(IS_WIN) // Only allow shmem overlays for NV12 on Windows. constexpr bool kAllowShmOverlays = true; @@ -371,7 +380,11 @@ factories_.push_back(std::move(ozone_factory)); } #if BUILDFLAG(ENABLE_VULKAN) - if (gr_context_type_ == GrContextType::kVulkan) { + if (gr_context_type_ == GrContextType::kVulkan +#if BUILDFLAG(IS_CHROMEOS) + && base::FeatureList::IsEnabled(kUseExternalVkImageBackingOnChromeOS) +#endif + ) { auto external_vk_image_factory = std::make_unique<ExternalVkImageBackingFactory>(context_state_); factories_.push_back(std::move(external_vk_image_factory));
diff --git a/gpu/ipc/client/gpu_in_process_context_tests.cc b/gpu/ipc/client/gpu_in_process_context_tests.cc index 201acf6b..c57bd22 100644 --- a/gpu/ipc/client/gpu_in_process_context_tests.cc +++ b/gpu/ipc/client/gpu_in_process_context_tests.cc
@@ -11,9 +11,9 @@ #include "base/memory/raw_ptr.h" #include "build/build_config.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/command_buffer/client/shared_memory_limits.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" #include "gpu/ipc/common/surface_handle.h" #include "gpu/ipc/gl_in_process_context.h" #include "gpu/ipc/in_process_gpu_thread_holder.h"
diff --git a/gpu/ipc/client/raster_in_process_context_tests.cc b/gpu/ipc/client/raster_in_process_context_tests.cc index 79c8219a..0bdfd6959 100644 --- a/gpu/ipc/client/raster_in_process_context_tests.cc +++ b/gpu/ipc/client/raster_in_process_context_tests.cc
@@ -2,12 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "gpu/ipc/raster_in_process_context.h" + #include <memory> #include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "components/viz/common/resources/shared_image_format.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "gpu/command_buffer/client/client_shared_image.h" #include "gpu/command_buffer/client/raster_implementation.h" #include "gpu/command_buffer/client/shared_image_interface.h" @@ -15,7 +16,6 @@ #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/ipc/host/gpu_memory_buffer_support.h" #include "gpu/ipc/in_process_gpu_thread_holder.h" -#include "gpu/ipc/raster_in_process_context.h" #include "gpu/ipc/service/gpu_memory_buffer_factory.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/color_space.h"
diff --git a/infra/config/generated/builders/ci/mac-updater-builder-dbg/gn-args.json b/infra/config/generated/builders/ci/mac-updater-builder-dbg/gn-args.json index 9525472..87b16bb 100644 --- a/infra/config/generated/builders/ci/mac-updater-builder-dbg/gn-args.json +++ b/infra/config/generated/builders/ci/mac-updater-builder-dbg/gn-args.json
@@ -4,6 +4,7 @@ "is_component_build": false, "is_debug": true, "symbol_level": 1, + "target_cpu": "x64", "use_remoteexec": true, "use_siso": true }
diff --git a/infra/config/generated/builders/codesearch/gen-android-try/gn-args.json b/infra/config/generated/builders/codesearch/gen-android-try/gn-args.json index 63f8443..5e557342 100644 --- a/infra/config/generated/builders/codesearch/gen-android-try/gn-args.json +++ b/infra/config/generated/builders/codesearch/gen-android-try/gn-args.json
@@ -9,6 +9,7 @@ "is_debug": true, "symbol_level": 1, "target_os": "android", - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/codesearch/gen-chromiumos-try/gn-args.json b/infra/config/generated/builders/codesearch/gen-chromiumos-try/gn-args.json index 9fca33c..0bcdb9f 100644 --- a/infra/config/generated/builders/codesearch/gen-chromiumos-try/gn-args.json +++ b/infra/config/generated/builders/codesearch/gen-chromiumos-try/gn-args.json
@@ -9,6 +9,7 @@ "symbol_level": 1, "target_os": "chromeos", "use_cups": true, - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/codesearch/gen-fuchsia-try/gn-args.json b/infra/config/generated/builders/codesearch/gen-fuchsia-try/gn-args.json index 277d7cd..530566f 100644 --- a/infra/config/generated/builders/codesearch/gen-fuchsia-try/gn-args.json +++ b/infra/config/generated/builders/codesearch/gen-fuchsia-try/gn-args.json
@@ -8,6 +8,7 @@ "is_component_build": false, "is_debug": false, "target_os": "fuchsia", - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/codesearch/gen-ios-try/gn-args.json b/infra/config/generated/builders/codesearch/gen-ios-try/gn-args.json index ebcf0043..354f2ed 100644 --- a/infra/config/generated/builders/codesearch/gen-ios-try/gn-args.json +++ b/infra/config/generated/builders/codesearch/gen-ios-try/gn-args.json
@@ -8,6 +8,7 @@ "is_debug": true, "symbol_level": 1, "target_os": "ios", - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/codesearch/gen-lacros-try/gn-args.json b/infra/config/generated/builders/codesearch/gen-lacros-try/gn-args.json index 7ef4e59..c8aeba6 100644 --- a/infra/config/generated/builders/codesearch/gen-lacros-try/gn-args.json +++ b/infra/config/generated/builders/codesearch/gen-lacros-try/gn-args.json
@@ -10,6 +10,7 @@ "symbol_level": 1, "target_os": "chromeos", "use_cups": true, - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/codesearch/gen-linux-try/gn-args.json b/infra/config/generated/builders/codesearch/gen-linux-try/gn-args.json index 3a6fe5d0..5624946 100644 --- a/infra/config/generated/builders/codesearch/gen-linux-try/gn-args.json +++ b/infra/config/generated/builders/codesearch/gen-linux-try/gn-args.json
@@ -7,6 +7,7 @@ "is_component_build": true, "is_debug": true, "symbol_level": 1, - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/codesearch/gen-mac-try/gn-args.json b/infra/config/generated/builders/codesearch/gen-mac-try/gn-args.json index 22ef5da7..a845cf4 100644 --- a/infra/config/generated/builders/codesearch/gen-mac-try/gn-args.json +++ b/infra/config/generated/builders/codesearch/gen-mac-try/gn-args.json
@@ -8,6 +8,7 @@ "is_debug": true, "symbol_level": 1, "target_os": "mac", - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/codesearch/gen-webview-try/gn-args.json b/infra/config/generated/builders/codesearch/gen-webview-try/gn-args.json index 63f8443..5e557342 100644 --- a/infra/config/generated/builders/codesearch/gen-webview-try/gn-args.json +++ b/infra/config/generated/builders/codesearch/gen-webview-try/gn-args.json
@@ -9,6 +9,7 @@ "is_debug": true, "symbol_level": 1, "target_os": "android", - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/codesearch/gen-win-try/gn-args.json b/infra/config/generated/builders/codesearch/gen-win-try/gn-args.json index 3a6fe5d0..5624946 100644 --- a/infra/config/generated/builders/codesearch/gen-win-try/gn-args.json +++ b/infra/config/generated/builders/codesearch/gen-win-try/gn-args.json
@@ -7,6 +7,7 @@ "is_component_build": true, "is_debug": true, "symbol_level": 1, - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/try/mac-updater-try-builder-dbg/gn-args.json b/infra/config/generated/builders/try/mac-updater-try-builder-dbg/gn-args.json index 9525472..87b16bb 100644 --- a/infra/config/generated/builders/try/mac-updater-try-builder-dbg/gn-args.json +++ b/infra/config/generated/builders/try/mac-updater-try-builder-dbg/gn-args.json
@@ -4,6 +4,7 @@ "is_component_build": false, "is_debug": true, "symbol_level": 1, + "target_cpu": "x64", "use_remoteexec": true, "use_siso": true }
diff --git "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder \050dbg\051/gn-args.json" "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder \050dbg\051/gn-args.json" index 8ca9b028..e967594 100644 --- "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder \050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder \050dbg\051/gn-args.json"
@@ -7,6 +7,7 @@ "proprietary_codecs": true, "symbol_level": 1, "target_os": "android", - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder \050dbg\051/properties.json" "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder \050dbg\051/properties.json" index aa736af0..dd4a6daf 100644 --- "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder \050dbg\051/properties.json"
@@ -101,6 +101,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder ARM64 \050dbg\051/gn-args.json" "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder ARM64 \050dbg\051/gn-args.json" index 7b6092b..a19ca19 100644 --- "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder ARM64 \050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder ARM64 \050dbg\051/gn-args.json"
@@ -8,6 +8,7 @@ "symbol_level": 1, "target_cpu": "arm64", "target_os": "android", - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder ARM64 \050dbg\051/properties.json" "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder ARM64 \050dbg\051/properties.json" index 96f244b0..030c268 100644 --- "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder ARM64 \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder ARM64 \050dbg\051/properties.json"
@@ -101,6 +101,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder/gn-args.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder/gn-args.json index 680137c..0db56c4 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder/gn-args.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder/gn-args.json
@@ -9,6 +9,7 @@ "strip_debug_info": true, "symbol_level": 1, "target_os": "android", - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder/properties.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder/properties.json index db377a28..40f5298 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder/properties.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Builder/properties.json
@@ -56,6 +56,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Tests \050dbg\051/properties.json" "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Tests \050dbg\051/properties.json" index 47b3964..6d41fcce 100644 --- "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Tests \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Tests \050dbg\051/properties.json"
@@ -91,6 +91,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Tests ARM64 \050dbg\051/properties.json" "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Tests ARM64 \050dbg\051/properties.json" index b5f53fb..4285ffa 100644 --- "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Tests ARM64 \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Android Tests ARM64 \050dbg\051/properties.json"
@@ -91,6 +91,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder \050dbg\051/gn-args.json" "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder \050dbg\051/gn-args.json" index 0fb1499d..f73df1f 100644 --- "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder \050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder \050dbg\051/gn-args.json"
@@ -3,6 +3,7 @@ "is_component_build": true, "is_debug": true, "symbol_level": 1, - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder \050dbg\051/properties.json" "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder \050dbg\051/properties.json" index 916f287..82182f7 100644 --- "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder \050dbg\051/properties.json"
@@ -48,6 +48,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder/gn-args.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder/gn-args.json index 9343f21c..e088770 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder/gn-args.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder/gn-args.json
@@ -5,6 +5,7 @@ "is_component_build": false, "is_debug": false, "proprietary_codecs": true, - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder/properties.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder/properties.json index d931f1d..c3067d0 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder/properties.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Builder/properties.json
@@ -88,6 +88,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Tester/properties.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Tester/properties.json index 7fd5c688..01cc215b 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Tester/properties.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Linux Tester/properties.json
@@ -78,6 +78,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder \050dbg\051/gn-args.json" "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder \050dbg\051/gn-args.json" index 0fb1499d..f73df1f 100644 --- "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder \050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder \050dbg\051/gn-args.json"
@@ -3,6 +3,7 @@ "is_component_build": true, "is_debug": true, "symbol_level": 1, - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder \050dbg\051/properties.json" "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder \050dbg\051/properties.json" index 7417be2..2395b3b 100644 --- "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder \050dbg\051/properties.json"
@@ -48,6 +48,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder/gn-args.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder/gn-args.json index 9343f21c..e088770 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder/gn-args.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder/gn-args.json
@@ -5,6 +5,7 @@ "is_component_build": false, "is_debug": false, "proprietary_codecs": true, - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder/properties.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder/properties.json index 8984543..af585dd 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder/properties.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Builder/properties.json
@@ -88,6 +88,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Tester/properties.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Tester/properties.json index eb66be65..5acd8254 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Tester/properties.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Mac Tester/properties.json
@@ -78,6 +78,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder \050dbg\051/gn-args.json" "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder \050dbg\051/gn-args.json" index 832b0c05..a23d4a7 100644 --- "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder \050dbg\051/gn-args.json" +++ "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder \050dbg\051/gn-args.json"
@@ -6,6 +6,7 @@ "is_debug": true, "proprietary_codecs": true, "symbol_level": 1, - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder \050dbg\051/properties.json" "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder \050dbg\051/properties.json" index aadda8ae..070d97b 100644 --- "a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder \050dbg\051/properties.json" +++ "b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder \050dbg\051/properties.json"
@@ -48,6 +48,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder/gn-args.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder/gn-args.json index 2bcc948..57705e2 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder/gn-args.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder/gn-args.json
@@ -7,6 +7,7 @@ "is_debug": false, "proprietary_codecs": true, "symbol_level": 1, - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder/properties.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder/properties.json index e8cb162..86bbea8 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder/properties.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win Builder/properties.json
@@ -88,6 +88,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win10 Tester/properties.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win10 Tester/properties.json index 2b04e68ec..8ba9651 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win10 Tester/properties.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI Win10 Tester/properties.json
@@ -78,6 +78,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-device/gn-args.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-device/gn-args.json index 550c959..c8fc304 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-device/gn-args.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-device/gn-args.json
@@ -10,6 +10,7 @@ "target_cpu": "arm64", "target_environment": "device", "target_os": "ios", - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-device/properties.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-device/properties.json index 49825e9..ab1ea1c 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-device/properties.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-device/properties.json
@@ -48,6 +48,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-simulator/gn-args.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-simulator/gn-args.json index d4a8fd4..4be0c6b 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-simulator/gn-args.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-simulator/gn-args.json
@@ -8,6 +8,7 @@ "target_cpu": "x64", "target_environment": "simulator", "target_os": "ios", - "use_remoteexec": true + "use_remoteexec": true, + "use_siso": true } } \ No newline at end of file
diff --git a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-simulator/properties.json b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-simulator/properties.json index 51cea19c..9f4f2b8 100644 --- a/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-simulator/properties.json +++ b/infra/config/generated/builders/webrtc.fyi/WebRTC Chromium FYI ios-simulator/properties.json
@@ -48,6 +48,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-trusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/luci/cr-buildbucket.cfg b/infra/config/generated/luci/cr-buildbucket.cfg index a8513076..dcf12c4 100644 --- a/infra/config/generated/luci/cr-buildbucket.cfg +++ b/infra/config/generated/luci/cr-buildbucket.cfg
@@ -52996,7 +52996,7 @@ name: "mac-updater-builder-dbg" swarming_host: "chromium-swarm.appspot.com" dimensions: "builderless:1" - dimensions: "cpu:x86-64" + dimensions: "cpu:arm64" dimensions: "free_space:standard" dimensions: "os:Mac" dimensions: "pool:luci.chromium.ci" @@ -59686,6 +59686,15 @@ ' "metrics_project": "chromium-reclient-metrics",' ' "scandeps_server": true' ' },' + ' "$build/siso": {' + ' "configs": [' + ' "builder"' + ' ],' + ' "enable_cloud_profiler": true,' + ' "enable_cloud_trace": true,' + ' "experiments": [],' + ' "project": "rbe-chromium-untrusted"' + ' },' ' "$recipe_engine/resultdb/test_presentation": {' ' "column_keys": [],' ' "grouping_keys": [' @@ -59771,6 +59780,15 @@ ' "metrics_project": "chromium-reclient-metrics",' ' "scandeps_server": true' ' },' + ' "$build/siso": {' + ' "configs": [' + ' "builder"' + ' ],' + ' "enable_cloud_profiler": true,' + ' "enable_cloud_trace": true,' + ' "experiments": [],' + ' "project": "rbe-chromium-untrusted"' + ' },' ' "$recipe_engine/resultdb/test_presentation": {' ' "column_keys": [],' ' "grouping_keys": [' @@ -59856,6 +59874,15 @@ ' "metrics_project": "chromium-reclient-metrics",' ' "scandeps_server": true' ' },' + ' "$build/siso": {' + ' "configs": [' + ' "builder"' + ' ],' + ' "enable_cloud_profiler": true,' + ' "enable_cloud_trace": true,' + ' "experiments": [],' + ' "project": "rbe-chromium-untrusted"' + ' },' ' "$recipe_engine/resultdb/test_presentation": {' ' "column_keys": [],' ' "grouping_keys": [' @@ -59939,6 +59966,15 @@ ' "metrics_project": "chromium-reclient-metrics",' ' "scandeps_server": true' ' },' + ' "$build/siso": {' + ' "configs": [' + ' "builder"' + ' ],' + ' "enable_cloud_profiler": true,' + ' "enable_cloud_trace": true,' + ' "experiments": [],' + ' "project": "rbe-chromium-untrusted"' + ' },' ' "$recipe_engine/resultdb/test_presentation": {' ' "column_keys": [],' ' "grouping_keys": [' @@ -60025,6 +60061,15 @@ ' "metrics_project": "chromium-reclient-metrics",' ' "scandeps_server": true' ' },' + ' "$build/siso": {' + ' "configs": [' + ' "builder"' + ' ],' + ' "enable_cloud_profiler": true,' + ' "enable_cloud_trace": true,' + ' "experiments": [],' + ' "project": "rbe-chromium-untrusted"' + ' },' ' "$recipe_engine/resultdb/test_presentation": {' ' "column_keys": [],' ' "grouping_keys": [' @@ -60110,6 +60155,15 @@ ' "metrics_project": "chromium-reclient-metrics",' ' "scandeps_server": true' ' },' + ' "$build/siso": {' + ' "configs": [' + ' "builder"' + ' ],' + ' "enable_cloud_profiler": true,' + ' "enable_cloud_trace": true,' + ' "experiments": [],' + ' "project": "rbe-chromium-untrusted"' + ' },' ' "$recipe_engine/resultdb/test_presentation": {' ' "column_keys": [],' ' "grouping_keys": [' @@ -60189,6 +60243,15 @@ ' "metrics_project": "chromium-reclient-metrics",' ' "scandeps_server": true' ' },' + ' "$build/siso": {' + ' "configs": [' + ' "builder"' + ' ],' + ' "enable_cloud_profiler": true,' + ' "enable_cloud_trace": true,' + ' "experiments": [],' + ' "project": "rbe-chromium-untrusted"' + ' },' ' "$recipe_engine/resultdb/test_presentation": {' ' "column_keys": [],' ' "grouping_keys": [' @@ -60274,6 +60337,15 @@ ' "metrics_project": "chromium-reclient-metrics",' ' "scandeps_server": true' ' },' + ' "$build/siso": {' + ' "configs": [' + ' "builder"' + ' ],' + ' "enable_cloud_profiler": true,' + ' "enable_cloud_trace": true,' + ' "experiments": [],' + ' "project": "rbe-chromium-untrusted"' + ' },' ' "$recipe_engine/resultdb/test_presentation": {' ' "column_keys": [],' ' "grouping_keys": [' @@ -60359,6 +60431,15 @@ ' "metrics_project": "chromium-reclient-metrics",' ' "scandeps_server": true' ' },' + ' "$build/siso": {' + ' "configs": [' + ' "builder"' + ' ],' + ' "enable_cloud_profiler": true,' + ' "enable_cloud_trace": true,' + ' "experiments": [],' + ' "project": "rbe-chromium-untrusted"' + ' },' ' "$recipe_engine/resultdb/test_presentation": {' ' "column_keys": [],' ' "grouping_keys": [' @@ -60456,6 +60537,15 @@ ' "metrics_project": "chromium-reclient-metrics",' ' "scandeps_server": true' ' },' + ' "$build/siso": {' + ' "configs": [' + ' "builder"' + ' ],' + ' "enable_cloud_profiler": true,' + ' "enable_cloud_trace": true,' + ' "experiments": [],' + ' "project": "rbe-chromium-trusted"' + ' },' ' "$recipe_engine/resultdb/test_presentation": {' ' "column_keys": [],' ' "grouping_keys": [' @@ -60507,6 +60597,15 @@ ' "metrics_project": "chromium-reclient-metrics",' ' "scandeps_server": true' ' },' + ' "$build/siso": {' + ' "configs": [' + ' "builder"' + ' ],' + ' "enable_cloud_profiler": true,' + ' "enable_cloud_trace": true,' + ' "experiments": [],' + ' "project": "rbe-chromium-trusted"' + ' },' ' "$recipe_engine/resultdb/test_presentation": {' ' "column_keys": [],' ' "grouping_keys": ['
diff --git a/infra/config/subprojects/chromium/ci/chromium.updater.star b/infra/config/subprojects/chromium/ci/chromium.updater.star index c6a66452..312b00d 100644 --- a/infra/config/subprojects/chromium/ci/chromium.updater.star +++ b/infra/config/subprojects/chromium/ci/chromium.updater.star
@@ -176,11 +176,13 @@ "updater", "debug_static_builder", "reclient", + "x64", ], ), builderless = True, cores = None, os = os.MAC_ANY, + cpu = cpu.ARM64, console_view_entry = consoles.console_view_entry( category = "debug|mac", short_name = "bld",
diff --git a/infra/config/subprojects/codesearch/codesearch.star b/infra/config/subprojects/codesearch/codesearch.star index 2511244..3d5fb5f 100644 --- a/infra/config/subprojects/codesearch/codesearch.star +++ b/infra/config/subprojects/codesearch/codesearch.star
@@ -21,21 +21,24 @@ ], ) -try_.defaults.bucket.set("codesearch") -try_.defaults.build_numbers.set(True) -try_.defaults.builder_group.set("tryserver.chromium.codesearch") -try_.defaults.builderless.set(True) -try_.defaults.cores.set(8) -try_.defaults.cpu.set(cpu.X86_64) -try_.defaults.cq_group.set("cq") -try_.defaults.executable.set("recipe:chromium_codesearch") -try_.defaults.execution_timeout.set(9 * time.hour) -try_.defaults.expiration_timeout.set(2 * time.hour) -try_.defaults.os.set(os.LINUX_DEFAULT) -try_.defaults.pool.set("luci.chromium.try") -try_.defaults.reclient_instance.set(reclient.instance.DEFAULT_UNTRUSTED) -try_.defaults.reclient_jobs.set(reclient.jobs.LOW_JOBS_FOR_CQ) -try_.defaults.service_account.set("chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com") +try_.defaults.set( + bucket = "codesearch", + executable = "recipe:chromium_codesearch", + builder_group = "tryserver.chromium.codesearch", + pool = "luci.chromium.try", + builderless = True, + cores = 8, + os = os.LINUX_DEFAULT, + cpu = cpu.X86_64, + build_numbers = True, + cq_group = "cq", + execution_timeout = 9 * time.hour, + expiration_timeout = 2 * time.hour, + reclient_instance = reclient.instance.DEFAULT_UNTRUSTED, + reclient_jobs = reclient.jobs.LOW_JOBS_FOR_CQ, + service_account = "chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com", + siso_enabled = True, +) consoles.list_view( name = "tryserver.chromium.codesearch",
diff --git a/infra/config/subprojects/findit/findit.star b/infra/config/subprojects/findit/findit.star index d73a872..99f3cf2 100644 --- a/infra/config/subprojects/findit/findit.star +++ b/infra/config/subprojects/findit/findit.star
@@ -56,15 +56,18 @@ groups = ["project-findit-owners"], ) -defaults.auto_builder_dimension.set(False) -defaults.bucket.set("findit") -defaults.build_numbers.set(True) -defaults.builderless.set(True) -defaults.list_view.set("findit") -defaults.ssd.set(True) -defaults.execution_timeout.set(8 * time.hour) -defaults.pool.set("luci.chromium.findit") -defaults.service_account.set("findit-builder@chops-service-accounts.iam.gserviceaccount.com") +defaults.set( + bucket = "findit", + pool = "luci.chromium.findit", + builderless = True, + ssd = True, + list_view = "findit", + auto_builder_dimension = False, + build_numbers = True, + execution_timeout = 8 * time.hour, + service_account = "findit-builder@chops-service-accounts.iam.gserviceaccount.com", + siso_enabled = True, +) # Builders are defined in lexicographic order by name
diff --git a/infra/config/subprojects/webrtc/webrtc.fyi.star b/infra/config/subprojects/webrtc/webrtc.fyi.star index 20817436..605fe00 100644 --- a/infra/config/subprojects/webrtc/webrtc.fyi.star +++ b/infra/config/subprojects/webrtc/webrtc.fyi.star
@@ -36,19 +36,22 @@ refs = ["refs/heads/main"], ) -defaults.bucket.set("webrtc.fyi") -defaults.builder_group.set("chromium.webrtc.fyi") -defaults.builderless.set(None) -defaults.build_numbers.set(True) -defaults.cpu.set(cpu.X86_64) -defaults.executable.set("recipe:chromium") -defaults.execution_timeout.set(2 * time.hour) -defaults.os.set(os.LINUX_DEFAULT) -defaults.pool.set("luci.chromium.webrtc.fyi") -defaults.service_account.set("chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com") -defaults.triggered_by.set(["webrtc-gitiles-trigger"]) -defaults.reclient_instance.set(reclient.instance.DEFAULT_TRUSTED) -defaults.reclient_jobs.set(reclient.jobs.DEFAULT) +defaults.set( + bucket = "webrtc.fyi", + executable = "recipe:chromium", + triggered_by = ["webrtc-gitiles-trigger"], + builder_group = "chromium.webrtc.fyi", + pool = "luci.chromium.webrtc.fyi", + builderless = None, + os = os.LINUX_DEFAULT, + cpu = cpu.X86_64, + build_numbers = True, + execution_timeout = 2 * time.hour, + reclient_instance = reclient.instance.DEFAULT_TRUSTED, + reclient_jobs = reclient.jobs.DEFAULT, + service_account = "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com", + siso_enabled = True, +) # Builders are defined in lexicographic order by name
diff --git a/internal b/internal index 37f5232..5999cbe 160000 --- a/internal +++ b/internal
@@ -1 +1 @@ -Subproject commit 37f52328751db24eeb28788ab1b5bd5efe83c033 +Subproject commit 5999cbe0580df1964f3cbb1d85a1f14c333ac8f0
diff --git a/ios/chrome/browser/ui/authentication/account_switching/account_switcher_coordinator.h b/ios/chrome/browser/ui/authentication/account_switching/account_switcher_coordinator.h index 97565c5..a80dbf30 100644 --- a/ios/chrome/browser/ui/authentication/account_switching/account_switcher_coordinator.h +++ b/ios/chrome/browser/ui/authentication/account_switching/account_switcher_coordinator.h
@@ -12,6 +12,9 @@ // Coordinator to display the fast account switcher view controller. @interface AccountSwitcherCoordinator : ChromeCoordinator +// Click point to anchor the menu. +@property(nonatomic, assign) CGPoint anchorPoint; + @end #endif // IOS_CHROME_BROWSER_UI_AUTHENTICATION_ACCOUNT_SWITCHING_ACCOUNT_SWITCHER_COORDINATOR_H_
diff --git a/ios/chrome/browser/ui/authentication/account_switching/account_switcher_coordinator.mm b/ios/chrome/browser/ui/authentication/account_switching/account_switcher_coordinator.mm index 3def8d5e..5816092 100644 --- a/ios/chrome/browser/ui/authentication/account_switching/account_switcher_coordinator.mm +++ b/ios/chrome/browser/ui/authentication/account_switching/account_switcher_coordinator.mm
@@ -20,6 +20,7 @@ _viewController.modalPresentationStyle = UIModalPresentationCustom; AccountSwitcherTransitionDelegate* transitionController = [[AccountSwitcherTransitionDelegate alloc] init]; + transitionController.anchorPoint = self.anchorPoint; _viewController.transitioningDelegate = transitionController; [self.baseViewController presentViewController:_viewController
diff --git a/ios/chrome/browser/ui/authentication/account_switching/account_switcher_presentation_controller.h b/ios/chrome/browser/ui/authentication/account_switching/account_switcher_presentation_controller.h index 66465e6..7c953b0 100644 --- a/ios/chrome/browser/ui/authentication/account_switching/account_switcher_presentation_controller.h +++ b/ios/chrome/browser/ui/authentication/account_switching/account_switcher_presentation_controller.h
@@ -11,6 +11,8 @@ // it as a Modal. @interface AccountSwitcherPresentationController : UIPresentationController +@property(nonatomic, assign) CGPoint anchorPoint; + @end #endif // IOS_CHROME_BROWSER_UI_AUTHENTICATION_ACCOUNT_SWITCHING_ACCOUNT_SWITCHER_PRESENTATION_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/authentication/account_switching/account_switcher_presentation_controller.mm b/ios/chrome/browser/ui/authentication/account_switching/account_switcher_presentation_controller.mm index 5b00c2b..8b23626 100644 --- a/ios/chrome/browser/ui/authentication/account_switching/account_switcher_presentation_controller.mm +++ b/ios/chrome/browser/ui/authentication/account_switching/account_switcher_presentation_controller.mm
@@ -13,6 +13,8 @@ const CGFloat kMaxHeight = 350; const CGFloat kMinimumMarginHorizontal = 25; const CGFloat kMinimumMarginVertical = 35; +const CGFloat kNTPIdentityAvatarDimension = 32; +const CGFloat kAvatarToMenuMarginVertical = 20; } // namespace @@ -36,8 +38,12 @@ MIN(kMaxHeight, availableHeight - 2 * kMinimumMarginVertical); CGRect presentedViewFrame = safeAreaFrame; - presentedViewFrame.origin.x += (availableWidth - width) / 2; - presentedViewFrame.origin.y += (availableHeight - height) / 2; + presentedViewFrame.origin.x = + self.anchorPoint.x - width + kNTPIdentityAvatarDimension; + presentedViewFrame.origin.y = self.anchorPoint.y + + kAvatarToMenuMarginVertical + + kNTPIdentityAvatarDimension; + presentedViewFrame.size.width = width; presentedViewFrame.size.height = height;
diff --git a/ios/chrome/browser/ui/authentication/account_switching/account_switcher_transition_delegate.h b/ios/chrome/browser/ui/authentication/account_switching/account_switcher_transition_delegate.h index eee8767..94284ba 100644 --- a/ios/chrome/browser/ui/authentication/account_switching/account_switcher_transition_delegate.h +++ b/ios/chrome/browser/ui/authentication/account_switching/account_switcher_transition_delegate.h
@@ -11,6 +11,8 @@ @interface AccountSwitcherTransitionDelegate : NSObject <UIViewControllerTransitioningDelegate> +@property(nonatomic, assign) CGPoint anchorPoint; + @end #endif // IOS_CHROME_BROWSER_UI_AUTHENTICATION_ACCOUNT_SWITCHING_ACCOUNT_SWITCHER_TRANSITION_DELEGATE_H_
diff --git a/ios/chrome/browser/ui/authentication/account_switching/account_switcher_transition_delegate.mm b/ios/chrome/browser/ui/authentication/account_switching/account_switcher_transition_delegate.mm index 463424d..597f3ef 100644 --- a/ios/chrome/browser/ui/authentication/account_switching/account_switcher_transition_delegate.mm +++ b/ios/chrome/browser/ui/authentication/account_switching/account_switcher_transition_delegate.mm
@@ -16,9 +16,12 @@ presentingViewController: (UIViewController*)presenting sourceViewController:(UIViewController*)source { - return [[AccountSwitcherPresentationController alloc] - initWithPresentedViewController:presented - presentingViewController:presenting]; + AccountSwitcherPresentationController* presentationController = + [[AccountSwitcherPresentationController alloc] + initWithPresentedViewController:presented + presentingViewController:presenting]; + presentationController.anchorPoint = self.anchorPoint; + return presentationController; } - (id<UIViewControllerAnimatedTransitioning>)
diff --git a/ios_internal b/ios_internal index 907f103..26b1927 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit 907f103a518c8e15bd3cbe6b8b31ec8bbdddb94e +Subproject commit 26b19279cd7cc0917d6b09746440c1411a0063eb
diff --git a/media/capture/BUILD.gn b/media/capture/BUILD.gn index 00ac744..c5814c5b 100644 --- a/media/capture/BUILD.gn +++ b/media/capture/BUILD.gn
@@ -464,6 +464,7 @@ ":test_support", "//base/test:test_support", "//build:chromeos_buildflags", + "//gpu:test_support", "//gpu/command_buffer/client", "//media:test_support", "//media/capture/mojom:image_capture",
diff --git a/media/capture/video/video_capture_effects_processor_unittest.cc b/media/capture/video/video_capture_effects_processor_unittest.cc index 8ebd6b6..7a3096be 100644 --- a/media/capture/video/video_capture_effects_processor_unittest.cc +++ b/media/capture/video/video_capture_effects_processor_unittest.cc
@@ -13,8 +13,8 @@ #include "base/test/test_future.h" #include "base/time/time.h" #include "components/viz/test/test_context_provider.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "gpu/command_buffer/client/shared_image_interface.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" #include "media/base/video_frame_metadata.h" #include "media/base/video_types.h" #include "media/capture/mojom/video_capture_buffer.mojom.h" @@ -127,7 +127,7 @@ base::test::TaskEnvironment task_environment_; scoped_refptr<viz::TestSharedImageInterface> test_sii_; - viz::TestGpuMemoryBufferManager test_gmb_manager_; + gpu::TestGpuMemoryBufferManager test_gmb_manager_; std::optional<VideoEffectsProcessor> video_effects_processor_;
diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn index 0bb5eda..32bf0447 100644 --- a/media/gpu/BUILD.gn +++ b/media/gpu/BUILD.gn
@@ -235,6 +235,8 @@ "windows/d3d11_vp9_accelerator.h", "windows/d3d11_vp9_picture.cc", "windows/d3d11_vp9_picture.h", + "windows/d3d12_fence.cc", + "windows/d3d12_fence.h", "windows/d3d12_helpers.cc", "windows/d3d12_helpers.h", "windows/d3d12_video_decoder_wrapper.cc",
diff --git a/media/gpu/vaapi/vaapi_unittest.cc b/media/gpu/vaapi/vaapi_unittest.cc index b982778a..217f02f 100644 --- a/media/gpu/vaapi/vaapi_unittest.cc +++ b/media/gpu/vaapi/vaapi_unittest.cc
@@ -574,6 +574,7 @@ VAConfigAttrib attrib{}; attrib.type = VAConfigAttribEncQualityRange; { + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(wrapper->sequence_checker_); base::AutoLockMaybe auto_lock(wrapper->va_lock_.get()); VAStatus va_res = vaGetConfigAttributes( wrapper->va_display_, va_profile, entrypoint, &attrib, 1); @@ -592,6 +593,7 @@ // |pending_va_buffers_| that, when mapped, looks correct. That buffer // should be created by CreateContext(). ASSERT_TRUE(wrapper->CreateContext(gfx::Size(640, 368))); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(wrapper->sequence_checker_); ASSERT_EQ(wrapper->pending_va_buffers_.size(), 1u); { base::AutoLockMaybe auto_lock(wrapper->va_lock_.get()); @@ -860,6 +862,7 @@ // Request the underlying DRM metadata for |scoped_va_surface|. VADRMPRIMESurfaceDescriptor va_descriptor{}; { + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(wrapper->sequence_checker_); base::AutoLockMaybe auto_lock(wrapper->va_lock_.get()); VAStatus va_res = vaSyncSurface(wrapper->va_display_, scoped_va_surface->id()); @@ -895,6 +898,7 @@ base::checked_cast<uint32_t>(2 * uv_width * uv_height)); } + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(wrapper->sequence_checker_); base::AutoLockMaybe auto_lock(wrapper->va_lock_.get()); const std::string va_vendor_string = vaQueryVendorString(wrapper->va_display_);
diff --git a/media/gpu/vaapi/vaapi_utils_unittest.cc b/media/gpu/vaapi/vaapi_utils_unittest.cc index 5a766568..1985e0f7e 100644 --- a/media/gpu/vaapi/vaapi_utils_unittest.cc +++ b/media/gpu/vaapi/vaapi_utils_unittest.cc
@@ -88,6 +88,7 @@ std::unique_ptr<ScopedVAImage> scoped_image; { + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(vaapi_wrapper_->sequence_checker_); // On Stoney-Ridge devices the output image format is dependent on the // surface format. However when context has not been executed the output // image format seems to default to I420. https://crbug.com/828119 @@ -116,6 +117,7 @@ std::unique_ptr<ScopedVAImage> scoped_image; { + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(vaapi_wrapper_->sequence_checker_); VAImageFormat va_image_format = kImageFormatI420; base::AutoLockMaybe auto_lock(vaapi_wrapper_->va_lock_.get()); EXPECT_DCHECK_DEATH(ScopedVAImage::Create( @@ -134,6 +136,7 @@ // This test exercises creation of a ScopedVABufferMapping with bad VABufferIDs. TEST_F(VaapiUtilsTest, BadScopedVABufferMapping) { GTEST_FLAG_SET(death_test_style, "threadsafe"); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(vaapi_wrapper_->sequence_checker_); base::AutoLockMaybe auto_lock(vaapi_wrapper_->va_lock_.get()); // A ScopedVABufferMapping with a VA_INVALID_ID VABufferID is DCHECK()ed.
diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc index a698358..db536a7 100644 --- a/media/gpu/vaapi/vaapi_wrapper.cc +++ b/media/gpu/vaapi/vaapi_wrapper.cc
@@ -2118,8 +2118,7 @@ const std::vector<SurfaceUsageHint>& surface_usage_hints, size_t num_surfaces, std::vector<VASurfaceID>* va_surfaces) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DVLOG(2) << "Creating " << num_surfaces << " surfaces"; DCHECK(va_surfaces->empty()); @@ -2147,8 +2146,7 @@ const std::vector<SurfaceUsageHint>& usage_hints, size_t num_surfaces, const std::optional<gfx::Size>& visible_size) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (va_context_id_ != VA_INVALID_ID) { LOG(ERROR) << "The current context should be destroyed before creating a " "new one"; @@ -2172,8 +2170,7 @@ EncryptionScheme encryption, const std::vector<uint8_t>& hw_config, std::vector<uint8_t>* hw_identifier_out) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); #if BUILDFLAG(IS_CHROMEOS_ASH) DCHECK_EQ(va_protected_config_id_, VA_INVALID_ID); DCHECK_EQ(va_protected_session_id_, VA_INVALID_ID); @@ -2276,8 +2273,7 @@ } bool VaapiWrapper::IsProtectedSessionDead() { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); #if BUILDFLAG(IS_CHROMEOS_ASH) return IsProtectedSessionDead(va_protected_session_id_); #else @@ -2288,8 +2284,7 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) bool VaapiWrapper::IsProtectedSessionDead( VAProtectedSessionID va_protected_session_id) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (va_protected_session_id == VA_INVALID_ID) return false; @@ -2322,15 +2317,13 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) VAProtectedSessionID VaapiWrapper::GetProtectedSessionID() const { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return va_protected_session_id_; } #endif void VaapiWrapper::DestroyProtectedSession() { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); #if BUILDFLAG(IS_CHROMEOS_ASH) if (va_protected_session_id_ == VA_INVALID_ID) return; @@ -2347,15 +2340,13 @@ void VaapiWrapper::DestroyContextAndSurfaces( std::vector<VASurfaceID> va_surfaces) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DestroyContext(); DestroySurfaces(va_surfaces); } bool VaapiWrapper::CreateContext(const gfx::Size& size) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DVLOG(2) << "Creating context"; base::AutoLockMaybe auto_lock(va_lock_.get()); @@ -2413,8 +2404,7 @@ scoped_refptr<VASurface> VaapiWrapper::CreateVASurfaceForFrameResource( const FrameResource& frame, bool protected_content) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto pixmap = frame.GetNativePixmapDmaBuf(); if (!pixmap) { LOG(ERROR) << "Failed to create NativePixmap from FrameResource"; @@ -2426,8 +2416,7 @@ scoped_refptr<VASurface> VaapiWrapper::CreateVASurfaceForPixmap( scoped_refptr<const gfx::NativePixmap> pixmap, bool protected_content) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const gfx::BufferFormat buffer_format = pixmap->GetBufferFormat(); if (!BufferFormatToVAFourCC(buffer_format)) { LOG(ERROR) << "Failed to get the VA fourcc from the buffer format"; @@ -2515,8 +2504,7 @@ const gfx::Size& size, uintptr_t* buffers, size_t buffer_size) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); VASurfaceAttribExternalBuffers va_attrib_extbuf{}; va_attrib_extbuf.num_planes = 3; va_attrib_extbuf.buffers = buffers; @@ -2563,8 +2551,7 @@ unsigned int va_rt_format, const gfx::Size& size, const std::vector<SurfaceUsageHint>& usage_hints) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); std::vector<VASurfaceID> surfaces; if (!CreateSurfaces(va_rt_format, size, usage_hints, 1, &surfaces)) return nullptr; @@ -2576,8 +2563,7 @@ VaapiWrapper::ExportVASurfaceAsNativePixmapDmaBufUnwrapped( VASurfaceID va_surface_id, const gfx::Size& va_surface_size) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_NE(va_surface_id, VA_INVALID_SURFACE); DCHECK(!va_surface_size.IsEmpty()); VADRMPRIMESurfaceDescriptor descriptor; @@ -2674,8 +2660,7 @@ std::unique_ptr<NativePixmapAndSizeInfo> VaapiWrapper::ExportVASurfaceAsNativePixmapDmaBuf(const VASurface& va_surface) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (va_surface.id() == VA_INVALID_SURFACE || va_surface.size().IsEmpty() || va_surface.format() == kInvalidVaRtFormat) { LOG(ERROR) << "Cannot export an invalid surface"; @@ -2688,8 +2673,7 @@ std::unique_ptr<NativePixmapAndSizeInfo> VaapiWrapper::ExportVASurfaceAsNativePixmapDmaBuf( const ScopedVASurface& scoped_va_surface) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!scoped_va_surface.IsValid()) { LOG(ERROR) << "Cannot export an invalid surface"; return nullptr; @@ -2699,8 +2683,7 @@ } bool VaapiWrapper::SyncSurface(VASurfaceID va_surface_id) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_NE(va_surface_id, VA_INVALID_ID); base::AutoLockMaybe auto_lock(va_lock_.get()); @@ -2713,8 +2696,7 @@ bool VaapiWrapper::SubmitBuffer(VABufferType va_buffer_type, size_t size, const void* data) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); TRACE_EVENT0("media,gpu", "VaapiWrapper::SubmitBuffer"); base::AutoLockMaybe auto_lock(va_lock_.get()); return SubmitBuffer_Locked({va_buffer_type, size, data}); @@ -2722,8 +2704,7 @@ bool VaapiWrapper::SubmitBuffers( const std::vector<VABufferDescriptor>& va_buffers) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); TRACE_EVENT0("media,gpu", "VaapiWrapper::SubmitBuffers"); base::AutoLockMaybe auto_lock(va_lock_.get()); for (const VABufferDescriptor& va_buffer : va_buffers) { @@ -2734,16 +2715,14 @@ } void VaapiWrapper::DestroyPendingBuffers() { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); TRACE_EVENT0("media,gpu", "VaapiWrapper::DestroyPendingBuffers"); base::AutoLockMaybe auto_lock(va_lock_.get()); DestroyPendingBuffers_Locked(); } void VaapiWrapper::DestroyPendingBuffers_Locked() { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); TRACE_EVENT0("media,gpu", "VaapiWrapper::DestroyPendingBuffers_Locked"); MAYBE_ASSERT_ACQUIRED(va_lock_); for (const auto& pending_va_buf : pending_va_buffers_) { @@ -2754,8 +2733,7 @@ } bool VaapiWrapper::ExecuteAndDestroyPendingBuffers(VASurfaceID va_surface_id) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); base::AutoLockMaybe auto_lock(va_lock_.get()); bool result = Execute_Locked(va_surface_id, pending_va_buffers_); DestroyPendingBuffers_Locked(); @@ -2765,8 +2743,7 @@ bool VaapiWrapper::MapAndCopyAndExecute( VASurfaceID va_surface_id, const std::vector<std::pair<VABufferID, VABufferDescriptor>>& va_buffers) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_NE(va_surface_id, VA_INVALID_SURFACE); TRACE_EVENT0("media,gpu", "VaapiWrapper::MapAndCopyAndExecute"); @@ -2791,8 +2768,7 @@ VASurfaceID va_surface_id, const VAImageFormat& format, const gfx::Size& size) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); std::unique_ptr<ScopedVAImage> scoped_image; { base::AutoLockMaybe auto_lock(va_lock_.get()); @@ -2810,8 +2786,7 @@ VASurfaceID va_surface_id, const gfx::Size& va_surface_size) NO_THREAD_SAFETY_ANALYSIS { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); TRACE_EVENT0("media,gpu", "VaapiWrapper::UploadVideoFrameToSurface"); std::optional<base::AutoLock> auto_lock = AutoLockOnlyIfNeeded(va_lock_.get()); @@ -2905,8 +2880,7 @@ std::unique_ptr<ScopedVABuffer> VaapiWrapper::CreateVABuffer(VABufferType type, size_t size) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); TRACE_EVENT0("media,gpu", "VaapiWrapper::CreateVABuffer"); base::AutoLockMaybe auto_lock(va_lock_.get()); TRACE_EVENT2("media,gpu", "VaapiWrapper::CreateVABufferLocked", "type", type, @@ -2927,8 +2901,7 @@ uint64_t VaapiWrapper::GetEncodedChunkSize(VABufferID buffer_id, VASurfaceID sync_surface_id) NO_THREAD_SAFETY_ANALYSIS { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); TRACE_EVENT0("media,gpu", "VaapiWrapper::GetEncodedChunkSize"); std::optional<base::AutoLock> auto_lock = AutoLockOnlyIfNeeded(va_lock_.get()); @@ -2966,8 +2939,7 @@ uint8_t* target_ptr, size_t target_size, size_t* coded_data_size) NO_THREAD_SAFETY_ANALYSIS { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(target_ptr); TRACE_EVENT0("media,gpu", "VaapiWrapper::DownloadFromVABuffer"); std::optional<base::AutoLock> auto_lock = @@ -3024,8 +2996,7 @@ bool VaapiWrapper::GetVAEncMaxNumOfRefFrames(VideoCodecProfile profile, size_t* max_ref_frames) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const VAProfile va_profile = ProfileToVAProfile(profile); VAConfigAttrib attrib; attrib.type = VAConfigAttribEncMaxRefFrames; @@ -3043,8 +3014,7 @@ bool& packed_sps, bool& packed_pps, bool& packed_slice) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const VAProfile va_profile = ProfileToVAProfile(profile); VAConfigAttrib attrib{}; attrib.type = VAConfigAttribEncPackedHeaders; @@ -3061,8 +3031,7 @@ bool VaapiWrapper::GetMinAV1SegmentSize(VideoCodecProfile profile, uint32_t& min_seg_size) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const VAProfile va_profile = ProfileToVAProfile(profile); VAConfigAttrib attrib{}; attrib.type = VAConfigAttribEncAV1Ext1; @@ -3086,8 +3055,7 @@ VAProtectedSessionID va_protected_session_id #endif ) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_EQ(mode_, kVideoProcess); base::AutoLockMaybe auto_lock(va_lock_.get()); @@ -3238,8 +3206,7 @@ va_entrypoint_(kVAEntrypointInvalid) {} VaapiWrapper::~VaapiWrapper() { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Destroy ScopedVABuffer before VaapiWrappers are destroyed to ensure // VADisplay is valid on ScopedVABuffer's destruction. va_buffer_for_vpp_.reset(); @@ -3253,8 +3220,7 @@ bool VaapiWrapper::Initialize(VAProfile va_profile, EncryptionScheme encryption_scheme) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); #if DCHECK_IS_ON() if (mode_ == kEncodeConstantQuantizationParameter) { DCHECK_NE(va_profile, VAProfileJPEGBaseline) @@ -3308,8 +3274,7 @@ } void VaapiWrapper::Deinitialize() { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); { base::AutoLockMaybe auto_lock(va_lock_.get()); #if BUILDFLAG(IS_CHROMEOS_ASH) @@ -3336,8 +3301,7 @@ void VaapiWrapper::VaInitialize( const ReportErrorToUMACB& report_error_to_uma_cb) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); report_error_to_uma_cb_ = report_error_to_uma_cb; DCHECK(va_lock_); @@ -3348,12 +3312,12 @@ } bool VaapiWrapper::HasContext() const { + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return va_context_id_ != VA_INVALID_ID; } void VaapiWrapper::DestroyContext() { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); base::AutoLockMaybe auto_lock(va_lock_.get()); DVLOG(2) << "Destroying context"; @@ -3378,8 +3342,7 @@ const std::vector<SurfaceUsageHint>& usage_hints, size_t num_surfaces, std::vector<VASurfaceID>* va_surfaces) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DVLOG(2) << "Creating " << num_surfaces << " " << size.ToString() << " surfaces"; DCHECK_NE(va_format, kInvalidVaRtFormat); @@ -3420,8 +3383,7 @@ size_t num_surfaces, const std::optional<gfx::Size>& visible_size, const std::optional<uint32_t>& va_fourcc) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (kInvalidVaRtFormat == va_rt_format) { LOG(ERROR) << "Invalid VA RT format to CreateScopedVASurface"; return {}; @@ -3476,8 +3438,7 @@ } void VaapiWrapper::DestroySurfaces(std::vector<VASurfaceID> va_surfaces) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DVLOG(2) << "Destroying " << va_surfaces.size() << " surfaces"; // vaDestroySurfaces() makes no guarantees about VA_INVALID_SURFACE. @@ -3492,8 +3453,7 @@ } void VaapiWrapper::DestroySurface(VASurfaceID va_surface_id) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (va_surface_id == VA_INVALID_SURFACE) return; DVLOG(3) << __func__ << " " << va_surface_id; @@ -3504,8 +3464,7 @@ bool VaapiWrapper::Execute_Locked(VASurfaceID va_surface_id, const std::vector<VABufferID>& va_buffers) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); TRACE_EVENT0("media,gpu", "VaapiWrapper::Execute_Locked"); MAYBE_ASSERT_ACQUIRED(va_lock_); @@ -3542,8 +3501,7 @@ } bool VaapiWrapper::SubmitBuffer_Locked(const VABufferDescriptor& va_buffer) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); TRACE_EVENT0("media,gpu", "VaapiWrapper::SubmitBuffer_Locked"); MAYBE_ASSERT_ACQUIRED(va_lock_); @@ -3579,8 +3537,7 @@ bool VaapiWrapper::MapAndCopy_Locked(VABufferID va_buffer_id, const VABufferDescriptor& va_buffer) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); MAYBE_ASSERT_ACQUIRED(va_lock_); DCHECK_NE(va_buffer_id, VA_INVALID_ID); @@ -3597,8 +3554,7 @@ } void VaapiWrapper::MaybeSetLowQualityEncoding_Locked() { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(IsModeEncoding(mode_)); MAYBE_ASSERT_ACQUIRED(va_lock_); @@ -3635,8 +3591,7 @@ } bool VaapiWrapper::MaybeAttachProtectedSession_Locked() { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); MAYBE_ASSERT_ACQUIRED(va_lock_); if (va_context_id_ == VA_INVALID_ID) return true;
diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h index 30bf555..49ecdea 100644 --- a/media/gpu/vaapi/vaapi_wrapper.h +++ b/media/gpu/vaapi/vaapi_wrapper.h
@@ -49,6 +49,14 @@ if (lock) \ lock->AssertAcquired() +#if DCHECK_IS_ON() +#define VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker) \ + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker) +#else +#define VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker) \ + CHECK(sequence_checker.CalledOnValidSequence()) +#endif + namespace media { constexpr unsigned int kInvalidVaRtFormat = 0u; @@ -148,15 +156,6 @@ // It is also responsible for managing and freeing VABuffers (not VASurfaces), // which are used to queue parameters and slice data to the HW codec, // as well as underlying memory for VASurfaces themselves. -// -// Historical note: the sequence affinity characteristic was introduced as a -// pre-requisite to remove the global *|va_lock_|. However, the legacy -// VaapiVideoDecodeAccelerator is known to use its VaapiWrapper from multiple -// threads. Therefore, to avoid doing a large refactoring of a legacy class, we -// allow it to call VaapiWrapper::Create() or -// VaapiWrapper::CreateForVideoCodec() with |enforce_sequence_affinity| == false -// so that sequence affinity is not enforced. This also indicates that the -// global lock will still be in effect for the VaapiVideoDecodeAccelerator. class MEDIA_GPU_EXPORT VaapiWrapper : public base::RefCountedThreadSafe<VaapiWrapper> { public: @@ -471,8 +470,7 @@ // be the size of the type of |*data|. template <typename T> [[nodiscard]] bool SubmitBuffer(VABufferType va_buffer_type, const T* data) { - CHECK(!enforce_sequence_affinity_ || - sequence_checker_.CalledOnValidSequence()); + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return SubmitBuffer(va_buffer_type, sizeof(T), data); } // Batch-version of SubmitBuffer(), where the lock for accessing libva is @@ -693,45 +691,53 @@ // This is declared before |va_display_| and |va_lock_| to guarantee their // validity for as long as the VaapiWrapper is alive. - VADisplayStateHandle va_display_state_handle_; + VADisplayStateHandle va_display_state_handle_ + GUARDED_BY_CONTEXT(sequence_checker_); // If using a global VA lock, this is a pointer to VADisplayStateSingleton's // member |va_lock_|. Guaranteed to be valid for the lifetime of the // VaapiWrapper due to the |va_display_state_handle_| above. - raw_ptr<base::Lock> va_lock_; + raw_ptr<base::Lock> va_lock_ GUARDED_BY_CONTEXT(sequence_checker_); // Guaranteed to be valid for the lifetime of the VaapiWrapper due to the // |va_display_state_handle_| above. - VADisplay va_display_ GUARDED_BY(va_lock_); + VADisplay va_display_ GUARDED_BY(va_lock_) + GUARDED_BY_CONTEXT(sequence_checker_); // VA handles. // All valid after successful Initialize() and until Deinitialize(). - VAConfigID va_config_id_{VA_INVALID_ID}; + VAConfigID va_config_id_ GUARDED_BY_CONTEXT(sequence_checker_){VA_INVALID_ID}; // Created in CreateContext() or CreateContextAndSurfaces() and valid until // DestroyContext() or DestroyContextAndSurfaces(). - VAContextID va_context_id_{VA_INVALID_ID}; + VAContextID va_context_id_ GUARDED_BY_CONTEXT(sequence_checker_){ + VA_INVALID_ID}; // Profile and entrypoint configured for the corresponding |va_context_id_|. - VAProfile va_profile_; - VAEntrypoint va_entrypoint_; + VAProfile va_profile_ GUARDED_BY_CONTEXT(sequence_checker_); + VAEntrypoint va_entrypoint_ GUARDED_BY_CONTEXT(sequence_checker_); // Data queued up for HW codec, to be committed on next execution. // TODO(b/166646505): let callers manage the lifetime of these buffers. - std::vector<VABufferID> pending_va_buffers_; + std::vector<VABufferID> pending_va_buffers_ + GUARDED_BY_CONTEXT(sequence_checker_); // VA buffer to be used for kVideoProcess. Allocated the first time around, // and reused afterwards. - std::unique_ptr<ScopedVABuffer> va_buffer_for_vpp_; + std::unique_ptr<ScopedVABuffer> va_buffer_for_vpp_ + GUARDED_BY_CONTEXT(sequence_checker_); #if BUILDFLAG(IS_CHROMEOS_ASH) // For protected decode mode. - VAConfigID va_protected_config_id_{VA_INVALID_ID}; - VAProtectedSessionID va_protected_session_id_{VA_INVALID_ID}; + VAConfigID va_protected_config_id_ GUARDED_BY_CONTEXT(sequence_checker_){ + VA_INVALID_ID}; + VAProtectedSessionID va_protected_session_id_ + GUARDED_BY_CONTEXT(sequence_checker_){VA_INVALID_ID}; #endif // Called to report codec errors to UMA. Errors to clients are reported via // return values from public methods. - ReportErrorToUMACB report_error_to_uma_cb_; + ReportErrorToUMACB report_error_to_uma_cb_ + GUARDED_BY_CONTEXT(sequence_checker_); }; } // namespace media
diff --git a/media/gpu/vaapi/vaapi_wrapper_unittest.cc b/media/gpu/vaapi/vaapi_wrapper_unittest.cc index 8c6639d..3d3b447 100644 --- a/media/gpu/vaapi/vaapi_wrapper_unittest.cc +++ b/media/gpu/vaapi/vaapi_wrapper_unittest.cc
@@ -48,6 +48,8 @@ this, &VaapiWrapperTest::DefaultDestroyPendingBuffers_Locked)); } void TearDown() override { + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE( + mock_vaapi_wrapper_->sequence_checker_); // The VaapiWrapper destructor calls DestroyPendingBuffers_Locked(). Since // MockVaapiWrapper is a derived class, // MockVaapiWrapper::DestroyPendingBuffers_Locked() won't get called during @@ -63,6 +65,8 @@ bool DefaultSubmitBuffer_Locked( const VaapiWrapper::VABufferDescriptor& va_buffer) EXCLUSIVE_LOCKS_REQUIRED(mock_vaapi_wrapper_->va_lock_) { + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE( + mock_vaapi_wrapper_->sequence_checker_); if (va_buffer.data) { constexpr VABufferID kFakeBufferId = 1234; mock_vaapi_wrapper_->pending_va_buffers_.push_back(kFakeBufferId); @@ -79,10 +83,14 @@ void DefaultDestroyPendingBuffers_Locked() EXCLUSIVE_LOCKS_REQUIRED(mock_vaapi_wrapper_->va_lock_) { + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE( + mock_vaapi_wrapper_->sequence_checker_); mock_vaapi_wrapper_->pending_va_buffers_.clear(); } size_t GetPendingBuffersSize() const { + VAAPI_CHECK_CALLED_ON_VALID_SEQUENCE( + mock_vaapi_wrapper_->sequence_checker_); return mock_vaapi_wrapper_->pending_va_buffers_.size(); }
diff --git a/media/gpu/windows/d3d11_status.h b/media/gpu/windows/d3d11_status.h index ac3c317..888c9b5a 100644 --- a/media/gpu/windows/d3d11_status.h +++ b/media/gpu/windows/d3d11_status.h
@@ -66,6 +66,9 @@ kGetCommandBufferHelperFailed = 48, kDecoderGetCreationParametersFailed = 49, kGetDeviceFailed = 50, + kCreateFenceFailed = 51, + kFenceSignalFailed = 52, + kWaitForFenceFailed = 53, }; struct D3D11StatusTraits {
diff --git a/media/gpu/windows/d3d12_fence.cc b/media/gpu/windows/d3d12_fence.cc new file mode 100644 index 0000000..746f07d --- /dev/null +++ b/media/gpu/windows/d3d12_fence.cc
@@ -0,0 +1,60 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "media/gpu/windows/d3d12_fence.h" + +#include "base/logging.h" +#include "base/threading/scoped_blocking_call.h" +#include "base/win/scoped_handle.h" + +namespace media { + +D3D12Fence::D3D12Fence(Microsoft::WRL::ComPtr<ID3D12Fence> fence) + : fence_(std::move(fence)) {} + +// static +scoped_refptr<D3D12Fence> D3D12Fence::Create(ID3D12Device* device, + D3D12_FENCE_FLAGS flags) { + Microsoft::WRL::ComPtr<ID3D12Fence> d3d12_fence; + HRESULT hr = device->CreateFence(0, flags, IID_PPV_ARGS(&d3d12_fence)); + if (FAILED(hr)) { + DLOG(ERROR) << "Failed to create D3D11Fence: " + << logging::SystemErrorCodeToString(hr); + return nullptr; + } + return base::MakeRefCounted<D3D12Fence>(std::move(d3d12_fence)); +} + +D3D11Status::Or<uint64_t> D3D12Fence::Signal( + ID3D12CommandQueue& command_queue) { + HRESULT hr = command_queue.Signal(fence_.Get(), ++fence_value_); + if (FAILED(hr)) { + DLOG(ERROR) << "ID3D12CommandQueue failed to signal fence: " + << logging::SystemErrorCodeToString(hr); + return D3D11StatusCode::kFenceSignalFailed; + } + return fence_value_; +} + +D3D11Status D3D12Fence::Wait(uint64_t fence_value) const { + if (fence_->GetCompletedValue() >= fence_value) { + return D3D11StatusCode::kOk; + } + base::win::ScopedHandle fence_event{::CreateEvent( + nullptr, /*bManualReset=*/TRUE, /*bInitialState=*/FALSE, nullptr)}; + HRESULT hr = fence_->SetEventOnCompletion(fence_value_, fence_event.get()); + if (FAILED(hr)) { + DLOG(ERROR) << "Failed to SetEventOnCompletion: " + << logging::SystemErrorCodeToString(hr); + return D3D11StatusCode::kWaitForFenceFailed; + } + + return WaitForSingleObject(fence_event.Get(), INFINITE) == WAIT_OBJECT_0 + ? D3D11StatusCode::kOk + : D3D11StatusCode::kWaitForFenceFailed; +} + +D3D12Fence::~D3D12Fence() = default; + +} // namespace media
diff --git a/media/gpu/windows/d3d12_fence.h b/media/gpu/windows/d3d12_fence.h new file mode 100644 index 0000000..2ed88a7 --- /dev/null +++ b/media/gpu/windows/d3d12_fence.h
@@ -0,0 +1,43 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MEDIA_GPU_WINDOWS_D3D12_FENCE_H_ +#define MEDIA_GPU_WINDOWS_D3D12_FENCE_H_ + +#include <d3d12.h> +#include <wrl.h> + +#include "base/memory/ref_counted.h" +#include "base/memory/scoped_refptr.h" +#include "media/gpu/windows/d3d11_status.h" + +namespace media { + +// D3D12Fence wraps a ID3D12Fence pointer and its last signaled fence value. +class D3D12Fence : public base::RefCountedThreadSafe<D3D12Fence> { + public: + explicit D3D12Fence(Microsoft::WRL::ComPtr<ID3D12Fence> fence); + + static scoped_refptr<D3D12Fence> Create( + ID3D12Device* device, + D3D12_FENCE_FLAGS flags = D3D12_FENCE_FLAG_NONE); + + // Let |command_queue| signal the fence and return the corresponding fence + // value to be waited for elsewhere. + D3D11Status::Or<uint64_t> Signal(ID3D12CommandQueue& command_queue); + + // Wait on CPU until the |fence_value| is signaled. + D3D11Status Wait(uint64_t fence_value) const; + + private: + friend class RefCountedThreadSafe; + ~D3D12Fence(); + + Microsoft::WRL::ComPtr<ID3D12Fence> fence_; + uint64_t fence_value_ = 0; +}; + +} // namespace media + +#endif // MEDIA_GPU_WINDOWS_D3D12_FENCE_H_
diff --git a/media/gpu/windows/d3d12_video_decoder_wrapper.cc b/media/gpu/windows/d3d12_video_decoder_wrapper.cc index 84786200..a8e57004 100644 --- a/media/gpu/windows/d3d12_video_decoder_wrapper.cc +++ b/media/gpu/windows/d3d12_video_decoder_wrapper.cc
@@ -5,12 +5,15 @@ #include "media/gpu/windows/d3d12_video_decoder_wrapper.h" #include <Windows.h> + #include <d3d12.h> #include "base/check_op.h" +#include "base/memory/scoped_refptr.h" #include "base/notreached.h" #include "base/win/scoped_handle.h" #include "media/gpu/windows/d3d11_picture_buffer.h" +#include "media/gpu/windows/d3d12_fence.h" #include "media/gpu/windows/d3d12_helpers.h" #include "media/gpu/windows/scoped_d3d_buffers.h" #include "media/gpu/windows/supported_profile_helpers.h" @@ -46,21 +49,21 @@ Microsoft::WRL::ComPtr<ID3D12Device> device, Microsoft::WRL::ComPtr<ID3D12CommandQueue> command_queue, Microsoft::WRL::ComPtr<ID3D12CommandAllocator> command_allocator, - Microsoft::WRL::ComPtr<ID3D12Fence> fence, Microsoft::WRL::ComPtr<ID3D12VideoDevice> video_device, Microsoft::WRL::ComPtr<ID3D12VideoDecoder> video_decoder, Microsoft::WRL::ComPtr<ID3D12VideoDecoderHeap> video_decoder_heap, - Microsoft::WRL::ComPtr<ID3D12VideoDecodeCommandList> command_list) + Microsoft::WRL::ComPtr<ID3D12VideoDecodeCommandList> command_list, + scoped_refptr<D3D12Fence> fence) : D3D12VideoDecoderWrapper(media_log), device_(std::move(device)), video_device_(std::move(video_device)), command_queue_(std::move(command_queue)), command_allocator_(std::move(command_allocator)), command_list_(std::move(command_list)), - fence_(std::move(fence)), video_decoder_(std::move(video_decoder)), video_decoder_heap_(std::move(video_decoder_heap)), - reference_frame_list_(std::move(video_decoder_heap)) { + reference_frame_list_(std::move(video_decoder_heap)), + fence_(std::move(fence)) { input_stream_arguments_.pHeap = video_decoder_heap_.Get(); } @@ -190,23 +193,22 @@ ID3D12CommandList* command_lists[] = {command_list_.Get()}; command_queue_->ExecuteCommandLists(std::size(command_lists), command_lists); - hr = command_queue_->Signal(fence_.Get(), ++fence_id_); - RETURN_IF_FAILED("D3D12CommandQueue Signal() failed", - D3D11StatusCode::kDecoderEndFrameFailed, hr); - // Just wait here like D3D11's behavior before render side supports D3D12 - if (fence_->GetCompletedValue() >= fence_id_) { - return true; + auto fence_value_or_error = fence_->Signal(*command_queue_.Get()); + if (!fence_value_or_error.has_value()) { + RecordFailure("Failed to signal fence", + std::move(fence_value_or_error).error().code()); + return false; } - base::win::ScopedHandle fence_event{::CreateEvent( - nullptr, /*bManualReset*/ TRUE, /*bInitialState*/ FALSE, nullptr)}; - hr = fence_->SetEventOnCompletion(fence_id_, fence_event.get()); - RETURN_IF_FAILED("D3D12Fence SetEventOnCompletion() failed", - D3D11StatusCode::kDecoderEndFrameFailed, hr); - + // Just wait here like D3D11's behavior before render side supports D3D12 // TODO(crbug.com/40233230): Let ID3D11DeviceContext4::Wait() for a // ID3D11Fence instead. - return WaitForSingleObject(fence_event.get(), INFINITE) == WAIT_OBJECT_0; + D3D11Status status = fence_->Wait(std::move(fence_value_or_error).value()); + if (!status.is_ok()) { + RecordFailure("Failed to wait for fence", status.code()); + return false; + } + return true; } private: @@ -221,8 +223,6 @@ Microsoft::WRL::ComPtr<ID3D12CommandQueue> command_queue_; Microsoft::WRL::ComPtr<ID3D12CommandAllocator> command_allocator_; Microsoft::WRL::ComPtr<ID3D12VideoDecodeCommandList> command_list_; - Microsoft::WRL::ComPtr<ID3D12Fence> fence_; - UINT64 fence_id_ = 0; Microsoft::WRL::ComPtr<ID3D12VideoDecoder> video_decoder_; Microsoft::WRL::ComPtr<ID3D12VideoDecoderHeap> video_decoder_heap_; @@ -233,6 +233,8 @@ std::vector<uint8_t> slice_control_buffer_; Microsoft::WRL::ComPtr<ID3D12Resource> compressed_bitstream_; D3D12ReferenceFrameList reference_frame_list_; + + scoped_refptr<D3D12Fence> fence_{}; }; class ScopedD3D12MemoryBuffer : public ScopedD3DBuffer { @@ -436,15 +438,16 @@ CHECK_EQ(command_list->Close(), S_OK); - Microsoft::WRL::ComPtr<ID3D12Fence> fence; - hr = device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&fence)); - RETURN_IF_FAILED2(hr, "D3D12Device CreateFence failed"); + scoped_refptr<D3D12Fence> fence = D3D12Fence::Create(device.Get()); + if (!fence) { + return nullptr; + } return std::make_unique<D3D12VideoDecoderWrapperImpl>( media_log, std::move(device), std::move(command_queue), - std::move(command_allocator), std::move(fence), std::move(video_device), + std::move(command_allocator), std::move(video_device), std::move(video_decoder), std::move(video_decoder_heap), - std::move(command_list)); + std::move(command_list), std::move(fence)); } D3D12VideoDecoderWrapper::D3D12VideoDecoderWrapper(MediaLog* media_log)
diff --git a/net/base/features.cc b/net/base/features.cc index e048190..ba20979 100644 --- a/net/base/features.cc +++ b/net/base/features.cc
@@ -258,7 +258,7 @@ "TpcdMetadataGrants", base::FEATURE_ENABLED_BY_DEFAULT); -BASE_FEATURE(kTpcdMetadataStagedRollback, +BASE_FEATURE(kTpcdMetadataStageControl, "TpcdMetadataStageControl", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/net/base/features.h b/net/base/features.h index b9aa7d291..ae62e63 100644 --- a/net/base/features.h +++ b/net/base/features.h
@@ -272,7 +272,7 @@ NET_EXPORT BASE_DECLARE_FEATURE(kTpcdMetadataGrants); // Whether to enable staged rollback of the TPCD Metadata Entries. -NET_EXPORT BASE_DECLARE_FEATURE(kTpcdMetadataStagedRollback); +NET_EXPORT BASE_DECLARE_FEATURE(kTpcdMetadataStageControl); // Whether ALPS parsing is on for any type of frame. NET_EXPORT BASE_DECLARE_FEATURE(kAlpsParsing);
diff --git a/net/third_party/quiche/src b/net/third_party/quiche/src index ee237e9..d3bc5ff 160000 --- a/net/third_party/quiche/src +++ b/net/third_party/quiche/src
@@ -1 +1 @@ -Subproject commit ee237e96f18ef123af9992f74645a8a0ce9ef6ef +Subproject commit d3bc5ffc929b0895ae9e16774069a04ae6fe3c58
diff --git a/services/tracing/public/cpp/trace_startup.cc b/services/tracing/public/cpp/trace_startup.cc index 0123efa..c407125 100644 --- a/services/tracing/public/cpp/trace_startup.cc +++ b/services/tracing/public/cpp/trace_startup.cc
@@ -8,6 +8,7 @@ #include "base/command_line.h" #include "base/task/thread_pool/thread_pool_instance.h" #include "base/trace_event/trace_log.h" +#include "build/build_config.h" #include "components/tracing/common/trace_startup_config.h" #include "components/tracing/common/trace_to_console.h" #include "components/tracing/common/tracing_switches.h" @@ -145,6 +146,9 @@ DCHECK(base::FeatureList::GetInstance()); PerfettoTracedProcess::Get()->OnThreadPoolAvailable(enable_consumer); +#if BUILDFLAG(IS_WIN) + tracing::EnableETWExport(); +#endif // BUILDFLAG(IS_WIN) } void PropagateTracingFlagsToChildProcessCmdLine(base::CommandLine* cmd_line) {
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 152019bf..1214be1 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -862,16 +862,16 @@ ], "experiments": [ { - "name": "EnabledAC", + "name": "EnabledAC_V2", "params": { - "delay_ms": "120000", + "delay_ms": "420000", "ignore_battery_for_test": "true", "pending_idle_reactivate": "false" }, "enable_features": [ "ArcIdleManager" ], - "min_os_version": "15591.0.0" + "min_os_version": "15795.0.0" } ] } @@ -3039,6 +3039,21 @@ ] } ], + "CPSS-V2-Android": [ + { + "platforms": [ + "android" + ], + "experiments": [ + { + "name": "Enabled_20240508", + "enable_features": [ + "PermissionDedicatedCpssSettingAndroid" + ] + } + ] + } + ], "CPUInterventionEvaluationLogging": [ { "platforms": [
diff --git a/third_party/angle b/third_party/angle index df2e7bd..a1665d2 160000 --- a/third_party/angle +++ b/third_party/angle
@@ -1 +1 @@ -Subproject commit df2e7bd7c99e27868947f887355ad11979f6d492 +Subproject commit a1665d2fc335ef1481c76d4066cb2e22bab83ba7
diff --git a/third_party/blink/public/common/metrics/document_update_reason.h b/third_party/blink/public/common/metrics/document_update_reason.h index b0dd040..0fc502d 100644 --- a/third_party/blink/public/common/metrics/document_update_reason.h +++ b/third_party/blink/public/common/metrics/document_update_reason.h
@@ -39,6 +39,7 @@ kPagePopup, kPlugin, kPopover, + kPrerender, kPrinting, kScroll, kSelection,
diff --git a/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom b/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom index 2526d4d..4e1d133 100644 --- a/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom +++ b/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom
@@ -846,6 +846,7 @@ kTypes = 790, kLineClamp = 791, kFontVariantEmoji = 792, + kScrollMarkers = 793, // 1. Add new features above this line (don't change the assigned numbers of // the existing items).
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5 index 4a2144d..13cd03b 100644 --- a/third_party/blink/renderer/core/css/css_properties.json5 +++ b/third_party/blink/renderer/core/css/css_properties.json5
@@ -4457,6 +4457,16 @@ supports_incremental_style: true, }, { + name: "scroll-markers", + property_methods: ["CSSValueFromComputedStyleInternal"], + field_group: "*", + field_template: "keyword", + keywords: ["none", "after", "before"], + typedom_types: ["Keyword"], + default_value: "none", + runtime_flag: "CSSPseudoScrollMarkers", + }, + { interpolable: true, name: "scrollbar-color", property_methods: ["ParseSingleValueFromRange", "CSSValueFromComputedStyleInternal"],
diff --git a/third_party/blink/renderer/core/css/css_property_equality.cc b/third_party/blink/renderer/core/css/css_property_equality.cc index 03dbceb..cea3473 100644 --- a/third_party/blink/renderer/core/css/css_property_equality.cc +++ b/third_party/blink/renderer/core/css/css_property_equality.cc
@@ -598,6 +598,8 @@ return a.Right() == b.Right(); case CSSPropertyID::kRubyPosition: return a.GetRubyPosition() == b.GetRubyPosition(); + case CSSPropertyID::kScrollMarkers: + return a.ScrollMarkers() == b.ScrollMarkers(); case CSSPropertyID::kScrollbarColor: return a.ScrollbarColor() == b.ScrollbarColor(); case CSSPropertyID::kScrollbarGutter:
diff --git a/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc b/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc index 20185056..e5a4e01 100644 --- a/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc +++ b/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc
@@ -1335,6 +1335,9 @@ value_id == CSSValueID::kInternalTextareaAuto || (RuntimeEnabledFeatures::CSSResizeAutoEnabled() && value_id == CSSValueID::kAuto); + case CSSPropertyID::kScrollMarkers: + return value_id == CSSValueID::kNone || value_id == CSSValueID::kAfter || + value_id == CSSValueID::kBefore; case CSSPropertyID::kScrollBehavior: return value_id == CSSValueID::kAuto || value_id == CSSValueID::kSmooth; case CSSPropertyID::kShapeRendering: @@ -1720,6 +1723,7 @@ CSSPropertyID::kPositionTryOrder, CSSPropertyID::kReadingOrderItems, CSSPropertyID::kResize, + CSSPropertyID::kScrollMarkers, CSSPropertyID::kScrollBehavior, CSSPropertyID::kOverscrollBehaviorInline, CSSPropertyID::kOverscrollBehaviorBlock,
diff --git a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc index 55c3b6e..b01ab88a 100644 --- a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc +++ b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
@@ -7395,6 +7395,14 @@ return list; } +const CSSValue* ScrollMarkers::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const LayoutObject*, + bool allow_visited_style, + CSSValuePhase value_phase) const { + return CSSIdentifierValue::Create(style.ScrollMarkers()); +} + // https://www.w3.org/TR/css-scrollbars/ // auto | <color>{2} const CSSValue* ScrollbarColor::ParseSingleValueFromRange(
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index 430bee3..b4c3f0e 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc
@@ -7435,12 +7435,17 @@ // of sync. Loader()->HasLoadedNonInitialEmptyDocument() is more correct. // Keeping both for now behind a flag so that it's finch-testable. if (GetFrame()->IsMainFrame() || - Loader()->HasLoadedNonInitialEmptyDocument() || !base::FeatureList::IsEnabled( blink::features:: kAvoidForcedLayoutOnInitialEmptyDocumentInSubframe)) { UpdateStyleAndLayoutTree(); + if (base::FeatureList::IsEnabled( + features::kPrerender2EarlyDocumentLifecycleUpdate) && + IsPrerendering()) { + View()->UpdateAllLifecyclePhasesExceptPaint( + DocumentUpdateReason::kPrerender); + } } }
diff --git a/third_party/blink/renderer/core/dom/space_split_string.h b/third_party/blink/renderer/core/dom/space_split_string.h index 53cc1b4..eda3fe2 100644 --- a/third_party/blink/renderer/core/dom/space_split_string.h +++ b/third_party/blink/renderer/core/dom/space_split_string.h
@@ -76,9 +76,11 @@ bool IsNull() const { return !data_; } const AtomicString& operator[](wtf_size_t i) const { return (*data_)[i]; } Vector<AtomicString, 4>::const_iterator begin() const { - return data_->begin(); + return data_ ? data_->begin() : nullptr; } - Vector<AtomicString, 4>::const_iterator end() const { return data_->end(); } + Vector<AtomicString, 4>::const_iterator end() const { + return data_ ? data_->end() : nullptr; + } void Trace(Visitor* visitor) const { visitor->Trace(data_); }
diff --git a/third_party/blink/renderer/core/frame/frame_test_helpers.cc b/third_party/blink/renderer/core/frame/frame_test_helpers.cc index aca71e2d..a2db17b8 100644 --- a/third_party/blink/renderer/core/frame/frame_test_helpers.cc +++ b/third_party/blink/renderer/core/frame/frame_test_helpers.cc
@@ -435,11 +435,12 @@ WebViewClient* web_view_client, void (*update_settings_func)(WebSettings*), std::optional<blink::FencedFrame::DeprecatedFencedFrameMode> - fenced_frame_mode) { + fenced_frame_mode, + bool is_prerendering) { Reset(); InitializeWebView(web_view_client, opener ? opener->View() : nullptr, - fenced_frame_mode); + fenced_frame_mode, is_prerendering); if (update_settings_func) update_settings_func(web_view_->GetSettings()); @@ -539,7 +540,9 @@ mojo::PendingAssociatedReceiver<mojom::blink::RemoteFrame> receiver) { Reset(); - InitializeWebView(web_view_client, nullptr, std::nullopt); + InitializeWebView(web_view_client, /*opener=*/nullptr, + /*fenced_frame_mode=*/std::nullopt, + /*is_prerendering=*/false); if (!security_origin) security_origin = SecurityOrigin::CreateUniqueOpaque(); @@ -714,7 +717,8 @@ WebViewClient* web_view_client, class WebView* opener, std::optional<blink::FencedFrame::DeprecatedFencedFrameMode> - fenced_frame_mode) { + fenced_frame_mode, + bool is_prerendering) { auto browsing_context_group_info = BrowsingContextGroupInfo::CreateUnique(); if (opener) { WebViewImpl* opener_impl = To<WebViewImpl>(opener); @@ -725,8 +729,8 @@ CreateDefaultClientIfNeeded(web_view_client, owned_web_view_client_); web_view_ = To<WebViewImpl>( WebView::Create(web_view_client, - /*is_hidden=*/false, - /*is_prerendering=*/false, + /*is_hidden=*/is_prerendering, + /*is_prerendering=*/is_prerendering, /*is_inside_portal=*/false, /*fenced_frame_mode=*/fenced_frame_mode, /*compositing_enabled=*/true,
diff --git a/third_party/blink/renderer/core/frame/frame_test_helpers.h b/third_party/blink/renderer/core/frame/frame_test_helpers.h index 7ba7e843..a653bd7 100644 --- a/third_party/blink/renderer/core/frame/frame_test_helpers.h +++ b/third_party/blink/renderer/core/frame/frame_test_helpers.h
@@ -342,7 +342,8 @@ WebViewClient* = nullptr, void (*update_settings_func)(WebSettings*) = nullptr, std::optional<blink::FencedFrame::DeprecatedFencedFrameMode> - fenced_frame_mode = std::nullopt); + fenced_frame_mode = std::nullopt, + bool is_prerendering = false); // Same as InitializeWithOpener(), but always sets the opener to null. WebViewImpl* Initialize(TestWebFrameClient* = nullptr, @@ -479,7 +480,8 @@ WebViewClient*, class WebView* opener, std::optional<blink::FencedFrame::DeprecatedFencedFrameMode> - fenced_frame_mode); + fenced_frame_mode, + bool is_prerendering); void CheckFrameIsAssociatedWithWebView(WebFrame* frame); bool viewport_enabled_ = false;
diff --git a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc b/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc index 277bc77..aea1b77 100644 --- a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc +++ b/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc
@@ -421,6 +421,8 @@ case DocumentUpdateReason::kTest: // Don't report if we don't know why. case DocumentUpdateReason::kUnknown: + // TODO(https://crbug.com/336963892): Give prerender a dedicated metric. + case DocumentUpdateReason::kPrerender: break; }
diff --git a/third_party/blink/renderer/core/frame/local_frame_view_test.cc b/third_party/blink/renderer/core/frame/local_frame_view_test.cc index 9ee532f..8cf8898 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view_test.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view_test.cc
@@ -7,12 +7,14 @@ #include <memory> #include "base/test/scoped_feature_list.h" +#include "base/test/with_feature_override.h" #include "content/test/test_blink_web_unit_test_support.h" #include "testing/gmock/include/gmock/gmock.h" #include "third_party/blink/public/common/features.h" #include "third_party/blink/public/mojom/scroll/scrollbar_mode.mojom-blink.h" #include "third_party/blink/renderer/core/css/css_style_declaration.h" #include "third_party/blink/renderer/core/frame/frame_test_helpers.h" +#include "third_party/blink/renderer/core/frame/visual_viewport.h" #include "third_party/blink/renderer/core/html/html_anchor_element.h" #include "third_party/blink/renderer/core/html/html_element.h" #include "third_party/blink/renderer/core/html/html_iframe_element.h" @@ -823,5 +825,38 @@ EXPECT_EQ(element, GetDocument().FocusedElement()); } +class PrerenderLocalFrameViewTest : public base::test::WithFeatureOverride, + public SimTest { + public: + PrerenderLocalFrameViewTest() + : base::test::WithFeatureOverride( + features::kPrerender2EarlyDocumentLifecycleUpdate) {} +}; + +INSTANTIATE_FEATURE_OVERRIDE_TEST_SUITE(PrerenderLocalFrameViewTest); + +TEST_P(PrerenderLocalFrameViewTest, RunPrePaintLifecyclePhaseBeforeActivation) { + InitializePrerenderPageRoot(); + ASSERT_TRUE(GetDocument().IsPrerendering()); + SimRequest resource("https://example.test", "text/html"); + LoadURL("https://example.test"); + resource.Complete(R"( + <body> + This is a prerendering page. + </body> + )"); + + if (base::FeatureList::IsEnabled( + features::kPrerender2EarlyDocumentLifecycleUpdate)) { + EXPECT_EQ(DocumentLifecycle::kPrePaintClean, + GetDocument().Lifecycle().GetState()); + EXPECT_FALSE(GetPage().GetVisualViewport().NeedsPaintPropertyUpdate()); + } else { + EXPECT_EQ(DocumentLifecycle::kLayoutClean, + GetDocument().Lifecycle().GetState()); + EXPECT_TRUE(GetPage().GetVisualViewport().NeedsPaintPropertyUpdate()); + } +} + } // namespace } // namespace blink
diff --git a/third_party/blink/renderer/core/page/page.cc b/third_party/blink/renderer/core/page/page.cc index adabf77..8f1b175a 100644 --- a/third_party/blink/renderer/core/page/page.cc +++ b/third_party/blink/renderer/core/page/page.cc
@@ -1285,16 +1285,6 @@ return is_ordinary_; } -void Page::ReportIntervention(const String& text) { - if (LocalFrame* local_frame = DeprecatedLocalMainFrame()) { - auto* message = MakeGarbageCollected<ConsoleMessage>( - mojom::ConsoleMessageSource::kOther, - mojom::ConsoleMessageLevel::kWarning, text, - std::make_unique<SourceLocation>(String(), String(), 0, 0, nullptr)); - local_frame->GetDocument()->AddConsoleMessage(message); - } -} - bool Page::RequestBeginMainFrameNotExpected(bool new_state) { if (!main_frame_ || !main_frame_->IsLocalFrame()) return false;
diff --git a/third_party/blink/renderer/core/page/page.h b/third_party/blink/renderer/core/page/page.h index 8b159ef0..8351f1e4 100644 --- a/third_party/blink/renderer/core/page/page.h +++ b/third_party/blink/renderer/core/page/page.h
@@ -364,7 +364,6 @@ // PageScheduler::Delegate implementation. bool IsOrdinary() const override; - void ReportIntervention(const String& message) override; bool RequestBeginMainFrameNotExpected(bool new_state) override; void OnSetPageFrozen(bool is_frozen) override;
diff --git a/third_party/blink/renderer/core/testing/sim/sim_page.cc b/third_party/blink/renderer/core/testing/sim/sim_page.cc index fa730a1..82672c1 100644 --- a/third_party/blink/renderer/core/testing/sim/sim_page.cc +++ b/third_party/blink/renderer/core/testing/sim/sim_page.cc
@@ -4,6 +4,7 @@ #include "third_party/blink/renderer/core/testing/sim/sim_page.h" +#include "third_party/blink/renderer/core/frame/visual_viewport.h" #include "third_party/blink/renderer/core/page/focus_controller.h" #include "third_party/blink/renderer/core/page/page.h" @@ -35,4 +36,8 @@ return page_->GetFocusController().IsActive(); } +const VisualViewport& SimPage::GetVisualViewport() const { + return page_->GetVisualViewport(); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/testing/sim/sim_page.h b/third_party/blink/renderer/core/testing/sim/sim_page.h index 29a452e5..b7d4497 100644 --- a/third_party/blink/renderer/core/testing/sim/sim_page.h +++ b/third_party/blink/renderer/core/testing/sim/sim_page.h
@@ -11,6 +11,7 @@ namespace blink { class Page; +class VisualViewport; class SimPage final { public: @@ -25,6 +26,8 @@ void SetActive(bool); bool IsActive() const; + const VisualViewport& GetVisualViewport() const; + private: Persistent<Page> page_; };
diff --git a/third_party/blink/renderer/core/testing/sim/sim_test.cc b/third_party/blink/renderer/core/testing/sim/sim_test.cc index ae1377f..0b550dc5 100644 --- a/third_party/blink/renderer/core/testing/sim/sim_test.cc +++ b/third_party/blink/renderer/core/testing/sim/sim_test.cc
@@ -123,6 +123,23 @@ local_frame_root_->FrameWidgetImpl()->LayerTreeHostForTesting()); } +void SimTest::InitializePrerenderPageRoot() { + web_view_helper_->InitializeWithOpener( + /*opener=*/nullptr, + /*frame_client=*/nullptr, + /*view_client=*/nullptr, + /*update_settings_func=*/nullptr, + /*fenced_frame_mode=*/std::nullopt, + /*is_prerendering=*/true); + compositor_->SetWebView(WebView()); + page_->SetPage(WebView().GetPage()); + web_frame_client_ = + std::make_unique<frame_test_helpers::TestWebFrameClient>(); + local_frame_root_ = WebView().MainFrameImpl(); + compositor_->SetLayerTreeHost( + local_frame_root_->FrameWidgetImpl()->LayerTreeHostForTesting()); +} + void SimTest::LoadURL(const String& url_string) { KURL url(url_string); frame_test_helpers::LoadFrameDontWait(local_frame_root_.Get(), url);
diff --git a/third_party/blink/renderer/core/testing/sim/sim_test.h b/third_party/blink/renderer/core/testing/sim/sim_test.h index b14b4b5..e997a3d 100644 --- a/third_party/blink/renderer/core/testing/sim/sim_test.h +++ b/third_party/blink/renderer/core/testing/sim/sim_test.h
@@ -39,6 +39,9 @@ void InitializeFencedFrameRoot( blink::FencedFrame::DeprecatedFencedFrameMode mode); + // Creates a WebView that is prerendered. + void InitializePrerenderPageRoot(); + // Load URL in the local frame root. void LoadURL(const String& url);
diff --git a/third_party/blink/renderer/platform/graphics/DEPS b/third_party/blink/renderer/platform/graphics/DEPS index 2f922ae..1a40396 100644 --- a/third_party/blink/renderer/platform/graphics/DEPS +++ b/third_party/blink/renderer/platform/graphics/DEPS
@@ -21,6 +21,7 @@ "+gpu/command_buffer/client/gpu_memory_buffer_manager.h", "+gpu/command_buffer/client/raster_interface.h", "+gpu/command_buffer/client/shared_image_interface.h", + "+gpu/command_buffer/client/test_gpu_memory_buffer_manager.h", "+gpu/command_buffer/client/webgpu_interface.h", "+gpu/command_buffer/common/gles2_cmd_copy_texture_chromium_utils.h", "+gpu/command_buffer/common/gpu_memory_buffer_support.h",
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_provider_test.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_provider_test.cc index bc617a5..509aef91 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_provider_test.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_provider_test.cc
@@ -10,7 +10,6 @@ #include "components/viz/common/resources/release_callback.h" #include "components/viz/test/test_context_provider.h" #include "components/viz/test/test_gles2_interface.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_test.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_test.cc index 85a907b..d9d71b0 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_test.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_test.cc
@@ -6,7 +6,6 @@ #include "base/run_loop.h" #include "components/viz/common/resources/transferable_resource.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "gpu/GLES2/gl2extchromium.h" #include "gpu/command_buffer/common/gpu_memory_buffer_support.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer_test.cc b/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer_test.cc index b1fab55..0d4e75cff4b 100644 --- a/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer_test.cc +++ b/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer_test.cc
@@ -36,7 +36,6 @@ #include "base/test/scoped_feature_list.h" #include "components/viz/common/resources/release_callback.h" #include "components/viz/common/resources/transferable_resource.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "gpu/command_buffer/client/gles2_interface_stub.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/sync_token.h"
diff --git a/third_party/blink/renderer/platform/graphics/gpu/webgpu_native_test_support.cc b/third_party/blink/renderer/platform/graphics/gpu/webgpu_native_test_support.cc index d1509e7..7545f37 100644 --- a/third_party/blink/renderer/platform/graphics/gpu/webgpu_native_test_support.cc +++ b/third_party/blink/renderer/platform/graphics/gpu/webgpu_native_test_support.cc
@@ -13,7 +13,7 @@ } WGPUInstance MakeNativeWGPUInstance() { auto instance = std::make_unique<dawn::native::Instance>(); - dawn::native::GetProcs().instanceReference(instance->Get()); + dawn::native::GetProcs().instanceAddRef(instance->Get()); return instance->Get(); }
diff --git a/third_party/blink/renderer/platform/graphics/test/gpu_memory_buffer_test_platform.h b/third_party/blink/renderer/platform/graphics/test/gpu_memory_buffer_test_platform.h index 797acdd..55812b8ef 100644 --- a/third_party/blink/renderer/platform/graphics/test/gpu_memory_buffer_test_platform.h +++ b/third_party/blink/renderer/platform/graphics/test/gpu_memory_buffer_test_platform.h
@@ -5,7 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_TEST_GPU_MEMORY_BUFFER_TEST_PLATFORM_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_TEST_GPU_MEMORY_BUFFER_TEST_PLATFORM_H_ -#include "components/viz/test/test_gpu_memory_buffer_manager.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" #include "third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.h" #include "third_party/blink/renderer/platform/testing/testing_platform_support.h" @@ -27,7 +27,7 @@ return &test_gpu_memory_buffer_manager_; } - viz::TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_; + gpu::TestGpuMemoryBufferManager test_gpu_memory_buffer_manager_; }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc index 9da336f..6a5f6ab2 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc +++ b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc
@@ -2286,12 +2286,6 @@ UpdatePolicy(); } -void MainThreadSchedulerImpl::BroadcastIntervention(const String& message) { - helper_.CheckOnValidThread(); - for (auto* page_scheduler : main_thread_only().page_schedulers) - page_scheduler->ReportIntervention(message); -} - void MainThreadSchedulerImpl::OnTaskStarted( MainThreadTaskQueue* queue, const base::sequence_manager::Task& task,
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h index 7d0d384..c6a70db 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h +++ b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h
@@ -557,9 +557,6 @@ // nagigation. This function does that. Must be called from the main thread. void ResetForNavigationLocked(); - // Report an intervention to all WebViews in this process. - void BroadcastIntervention(const String& message); - // Trigger an update to all task queues' priorities, throttling, and // enabled/disabled state based on current policy. When triggered from a // policy update, |previous_policy| should be populated with the pre-update
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.cc b/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.cc index 40e0f9fb..c089c19 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.cc +++ b/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.cc
@@ -369,10 +369,6 @@ frame_schedulers_.erase(frame_scheduler); } -void PageSchedulerImpl::ReportIntervention(const String& message) { - delegate_->ReportIntervention(message); -} - void PageSchedulerImpl::AudioStateChanged(bool is_audio_playing) { if (is_audio_playing) { PolicyUpdater policy_updater;
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.h b/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.h index 9d0a78c..d536a17 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.h +++ b/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.h
@@ -86,9 +86,6 @@ bool RequestBeginMainFrameNotExpected(bool new_state) override; scoped_refptr<scheduler::WidgetScheduler> CreateWidgetScheduler() override; - // Virtual for testing. - virtual void ReportIntervention(const String& message); - bool IsFrozen() const; bool OptedOutFromAggressiveThrottling() const; // Returns whether CPU time is throttled for the page. Note: This is
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl_unittest.cc b/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl_unittest.cc index 70e816d..0d176143e 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl_unittest.cc +++ b/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl_unittest.cc
@@ -86,7 +86,6 @@ MockPageSchedulerDelegate() {} private: - void ReportIntervention(const WTF::String&) override {} bool RequestBeginMainFrameNotExpected(bool) override { return false; } void OnSetPageFrozen(bool is_frozen) override {} bool IsOrdinary() const override { return true; }
diff --git a/third_party/blink/renderer/platform/scheduler/public/page_scheduler.h b/third_party/blink/renderer/platform/scheduler/public/page_scheduler.h index cc1ed98..4f252c8 100644 --- a/third_party/blink/renderer/platform/scheduler/public/page_scheduler.h +++ b/third_party/blink/renderer/platform/scheduler/public/page_scheduler.h
@@ -30,7 +30,6 @@ // An "ordinary" page is a fully-featured page owned by a web view. virtual bool IsOrdinary() const = 0; - virtual void ReportIntervention(const WTF::String& message) = 0; // Returns true if the request has been succcessfully relayed to the // compositor. virtual bool RequestBeginMainFrameNotExpected(bool new_state) = 0;
diff --git a/third_party/blink/renderer/platform/wtf/hash_table.h b/third_party/blink/renderer/platform/wtf/hash_table.h index 4241c64..5a8870f 100644 --- a/third_party/blink/renderer/platform/wtf/hash_table.h +++ b/third_party/blink/renderer/platform/wtf/hash_table.h
@@ -315,7 +315,7 @@ } public: - HashTableConstIterator() = default; + constexpr HashTableConstIterator() = default; GetType Get() const { CheckModifications(); @@ -334,7 +334,11 @@ return *this; } - // postfix ++ intentionally omitted + const_iterator operator++(int) { + auto copy = this; + ++(*this); + return copy; + } const_iterator& operator--() { #if DCHECK_IS_ON() @@ -346,7 +350,11 @@ return *this; } - // postfix -- intentionally omitted + const_iterator operator--(int) { + auto copy = *this; + --(*this); + return copy; + } // Comparison. bool operator==(const const_iterator& other) const { @@ -371,12 +379,12 @@ } private: - PointerType position_; - PointerType end_position_; + PointerType position_ = nullptr; + PointerType end_position_ = nullptr; #if DCHECK_IS_ON() - PointerType begin_position_; - const HashTableType* container_; - int64_t container_modifications_; + PointerType begin_position_ = nullptr; + const HashTableType* container_ = nullptr; + int64_t container_modifications_ = 0; #endif }; @@ -436,7 +444,7 @@ : iterator_(pos, begin, end, container, tag) {} public: - HashTableIterator() = default; + constexpr HashTableIterator() = default; // default copy, assignment and destructor are OK @@ -449,14 +457,22 @@ return *this; } - // postfix ++ intentionally omitted + iterator operator++(int) { + auto copy = *this; + ++(*this); + return copy; + } iterator& operator--() { --iterator_; return *this; } - // postfix -- intentionally omitted + iterator operator--(int) { + auto copy = *this; + --(*this); + return copy; + } // Comparison. bool operator==(const iterator& other) const { @@ -2127,7 +2143,7 @@ typedef typename Traits::IteratorGetType GetType; typedef typename HashTableType::ValueTraits::IteratorGetType SourceGetType; - HashTableIteratorAdapter() = default; + constexpr HashTableIteratorAdapter() = default; HashTableIteratorAdapter(const typename HashTableType::iterator& impl) : impl_(impl) {} @@ -2141,13 +2157,21 @@ ++impl_; return *this; } - // postfix ++ intentionally omitted + HashTableIteratorAdapter operator++(int) { + auto copy = *this; + ++(*this); + return copy; + } HashTableIteratorAdapter& operator--() { --impl_; return *this; } - // postfix -- intentionally omitted + HashTableIteratorAdapter operator--(int) { + auto copy = *this; + --(*this); + return copy; + } operator HashTableConstIteratorAdapter<HashTableType, Traits, Enable>() { typename HashTableType::const_iterator i = impl_; @@ -2175,7 +2199,7 @@ typedef typename Traits::IteratorGetType GetType; typedef typename HashTableType::ValueTraits::IteratorGetType SourceGetType; - HashTableIteratorAdapter() = default; + constexpr HashTableIteratorAdapter() = default; HashTableIteratorAdapter(const typename HashTableType::iterator& impl) : impl_(impl) {} @@ -2189,13 +2213,21 @@ ++impl_; return *this; } - // postfix ++ intentionally omitted + HashTableIteratorAdapter operator++(int) { + auto copy = *this; + ++(*this); + return copy; + } HashTableIteratorAdapter& operator--() { --impl_; return *this; } - // postfix -- intentionally omitted + HashTableIteratorAdapter operator--(int) { + auto copy = *this; + --(*this); + return copy; + } operator HashTableConstIteratorAdapter<HashTableType, Traits, void>() { typename HashTableType::const_iterator i = impl_;
diff --git a/third_party/blink/renderer/platform/wtf/key_value_pair.h b/third_party/blink/renderer/platform/wtf/key_value_pair.h index 25b0e780..c0b3aac 100644 --- a/third_party/blink/renderer/platform/wtf/key_value_pair.h +++ b/third_party/blink/renderer/platform/wtf/key_value_pair.h
@@ -380,6 +380,8 @@ using pointer = MappedType*; using reference = MappedType&; + constexpr HashTableValuesIterator() = default; + HashTableValuesIterator(const Iterator& impl) : impl_(impl) {} MappedType* Get() const { return &(impl_.Get()->value); }
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 1032fc8..2ea0afa 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -1254,7 +1254,6 @@ # css counters failures to be fixed with new implementation. crbug.com/990657 external/wpt/css/css-contain/contain-style-counters-005.html [ Failure ] -crbug.com/990657 fast/css/containment/style-contain-dialogue-element.html [ Failure ] # LayoutNG ref-tests that need to be updated (cannot be rebaselined). crbug.com/591099 [ Win ] virtual/text-antialias/ellipsis-with-self-painting-layer.html [ Failure ] @@ -2530,6 +2529,7 @@ crbug.com/626703 external/wpt/uievents/mouse/mouse_boundary_events_after_removing_last_over_element.html [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/340066066 [ Win11-arm64 ] external/wpt/html/canvas/element/text/2d.text.measure.advances-not-defined.html [ Failure Timeout ] crbug.com/339704186 [ Win11-arm64 ] virtual/fenced-frame-mparch/external/wpt/fenced-frame/notify-event-transient-user-activation.https.html [ Timeout ] crbug.com/339317629 external/wpt/html/canvas/element/manual/filters/svg-filter-lh-rlh.html [ Timeout ] crbug.com/339310103 [ Win11-arm64 ] external/wpt/focus/focus-restoration-in-different-site-iframes.html [ Timeout ]
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index d0b7f41..36d822a 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -2252,6 +2252,13 @@ ] ] }, + "min-height-min-content-crash.html": [ + "e611b8609a3d013c1a7dac6602918b3c17b17221", + [ + null, + {} + ] + ], "negative-available-size-crash.html": [ "837fdaeba9ef8baeb4f2bad281bb13551d6d8ff9", [ @@ -21141,6 +21148,32 @@ {} ] ], + "page-box-005-print.html": [ + "02811b38fea2836dd84bf48f06ff0e2ebf8dc2b6", + [ + null, + [ + [ + "/css/css-page/page-box-005-print-ref.html", + "==" + ] + ], + {} + ] + ], + "page-box-006-print.html": [ + "eb6c2098978d199cffd697c48979298e335621ad", + [ + null, + [ + [ + "/css/css-page/page-box-006-print-ref.html", + "==" + ] + ], + {} + ] + ], "page-left-right-001-print.html": [ "044696fcca27ec7ebe18edab3053dfbb65af6bbc", [ @@ -273999,7 +274032,7 @@ ], "stylable-select": { "native-popup-with-datalist.tentative.html": [ - "a968c6a164165b46266870c67258bdd4d9473787", + "3ec54fa6526f930b30e9e08b1553902d502b58cc", [ null, [ @@ -274024,6 +274057,19 @@ {} ] ], + "select-appearance-dark-mode.tentative.html": [ + "a121b0b864b7b0aed0426f15fda1f9e4de58fa64", + [ + null, + [ + [ + "/html/semantics/forms/the-select-element/stylable-select/select-appearance-dark-mode-ref.html", + "==" + ] + ], + {} + ] + ], "select-appearance-no-button-custom-datalist.tentative.html": [ "cc8a4c60bd76fa1e936a1788e5dec11d6d5b252b", [ @@ -274101,6 +274147,19 @@ ], {} ] + ], + "select-icon-color.tentative.html": [ + "13026cd5f8c4aea0cec65248a3684a4eed11fcec", + [ + null, + [ + [ + "/html/semantics/forms/the-select-element/stylable-select/select-icon-color-ref.html", + "==" + ] + ], + {} + ] ] } }, @@ -292890,6 +292949,10 @@ [] ], "resources": { + "2x3-svg-scaled-by-sec-ch-width.py": [ + "d53574c361213ddf0949f906a08ebe388f9aa2d0", + [] + ], "accept-ch-different.html": [ "05cc0b61b07c36fca5816e277df1dc98e70d9ba1", [] @@ -296775,6 +296838,10 @@ "47ca63edc4fc96f4d563beba7e872ae5d47461c1", [] ], + "manifest_check_disclosure_shown_true.json": [ + "7d7004c3cffee4fdbdf824b28456fd20b617de8b", + [] + ], "manifest_check_same_site_strict.json": [ "d7304159834804c417f498acebc45f59e588dcbb", [] @@ -296872,7 +296939,11 @@ [] ], "token_check_disclosure_shown_false.py": [ - "f4b732053ff0f2d5545c3602d701d92702e111af", + "a25a14af694848e65ed7c2943b3482910d20c355", + [] + ], + "token_check_disclosure_shown_true.py": [ + "00b755b920cd999b4bc91af63ed70071a71c634a", [] ], "token_check_same_site_strict.py": [ @@ -327478,6 +327549,14 @@ "ab2fda9afb6443e0b2da05813f41bfc0edc17f98", [] ], + "page-box-005-print-ref.html": [ + "69e0061271d76042128df8f03812e433b0d74036", + [] + ], + "page-box-006-print-ref.html": [ + "c5081a41c4803a204a30233850d7516f1851a79b", + [] + ], "page-left-right-001-print-ref.html": [ "1eb011bed8a0dde4a65494d54fc2e2bd9a042080", [] @@ -349548,6 +349627,16 @@ [] ] }, + "moveBefore": { + "tentative": { + "resources": { + "moveBefore-iframe.html": [ + "7d9c498e8da29f6d23df33d49a2aab5b85e9f1e2", + [] + ] + } + } + }, "mutationobservers.js": [ "a95529ab39cdcbc19c627d1b1dc998ac426c5e9b", [] @@ -362434,6 +362523,10 @@ "af9c736aea7f9b20f4fd09522a8aa2dd25a11ef1", [] ], + "2d.text.measure.advances-not-defined-expected.txt": [ + "1798957a77f539b091ea02d75147c4a798e27873", + [] + ], "WEB_FEATURES.yml": [ "1d9e4bab82191d72c374c7399e666bd6bfe42bc2", [] @@ -362976,6 +363069,14 @@ "af9c736aea7f9b20f4fd09522a8aa2dd25a11ef1", [] ], + "2d.text.measure.advances-not-defined-expected.txt": [ + "1798957a77f539b091ea02d75147c4a798e27873", + [] + ], + "2d.text.measure.advances-not-defined.worker-expected.txt": [ + "1798957a77f539b091ea02d75147c4a798e27873", + [] + ], "WEB_FEATURES.yml": [ "1d9e4bab82191d72c374c7399e666bd6bfe42bc2", [] @@ -363207,7 +363308,7 @@ [] ], "text.yaml": [ - "7f2047bc9c41c7e04b671c83fc50fe61e82b566b", + "8af162e87902ba8feb17bb36023af69b13f0c1ef", [] ], "the-canvas-state.yaml": [ @@ -371628,12 +371729,16 @@ ], "stylable-select": { "native-popup-with-datalist-ref.html": [ - "87918b6a92c497090f2ed5ab42d9e17927d69b54", + "6540e324b5d935a1f335b4e1d1b1cc36bb90a5fe", [] ], "resources": { "stylable-select-styles.css": [ - "5ee317d61a9fadeb46a28a51ad550e5b9877a2c3", + "7eed2ea351a6b286fc2f0d5259d2a4aedc938db6", + [] + ], + "stylable-select-utils.js": [ + "38e93459161422622e6e88ab39dbcbe55fb017e9", [] ] }, @@ -371641,21 +371746,29 @@ "10c966a107ba3f341cc45b43e3160a791abec6b1", [] ], + "select-appearance-dark-mode-ref.html": [ + "d4d4da5d48bd316c1747e05a5e17c4eeb44626f3", + [] + ], "select-appearance-no-button-no-datalist-ref.html": [ - "3c6e9416b06aeb9ecaa2a9dbf56c1c1e7c1ad2b5", + "79f1d662c57a94de57614d15b2aa28a59a7ea33c", [] ], "select-appearance-writing-mode-vertical-lr-ref.html": [ - "8b7e6402fb8d26872bb9bd6bf9869390638a64f0", + "9f1976ba04112d0ef6ac09b30cae899d1c43a6ae", [] ], "select-appearance-writing-mode-vertical-rl-ref.html": [ - "158807ba58fdf1268843baf56765f64e65e1b78c", + "3e67e99436f7ae0ded41e40489a5373dd775a764", [] ], "select-child-button-and-datalist-ref.html": [ "e99ca4d57a8b2e3ea5f7e208e90a2a710710faf8", [] + ], + "select-icon-color-ref.html": [ + "575b42a200e382ba4d278638e2e45d762d30e7c6", + [] ] } }, @@ -428083,6 +428196,13 @@ {} ] ], + "sec-ch-width.https.html": [ + "f44fa3bb5e1c6feaf638f0ca67eaff0655cbcbc3", + [ + null, + {} + ] + ], "service-workers": { "intercept-request-critical.https.window.js": [ "079b9fd9ba07819c3c670588d25197a1e7527390", @@ -440392,7 +440512,7 @@ ] ], "fedcm-disclosure-text-shown.https.html": [ - "e3f303ec4c9ff5b34960373bc90f4fb258b268c6", + "513ef258e18a685e33c7f976c8a16cd2cd594b74", [ null, { @@ -457398,13 +457518,6 @@ ] }, "text-box-trim": { - "inheritance.html": [ - "a37a40e976da17c1fb7f7326d91141db434bcf59", - [ - null, - {} - ] - ], "text-box-edge-computed.html": [ "50a963297ce430fd0b6c81db1f76e73a3c8aa36e", [ @@ -486500,6 +486613,20 @@ "testdriver": true } ] + ], + "iframe-document-preserve.window.js": [ + "4f9fa7540f69067549872615d92a05ed783f18f3", + [ + "dom/nodes/moveBefore/tentative/iframe-document-preserve.window.html", + { + "script_metadata": [ + [ + "script", + "/common/get-host-info.sub.js" + ] + ] + } + ] ] } }, @@ -551022,8 +551149,8 @@ {} ] ], - "2d.text.measure.advances.html": [ - "84f04dd677f836bc1b747497071248ac811c1005", + "2d.text.measure.advances-not-defined.html": [ + "55c0e228e0b0461a5da4cb31f7e622dbee664329", [ null, {} @@ -564368,17 +564495,17 @@ {} ] ], - "2d.text.measure.advances.html": [ - "2eec005cb84c42e2d9ccc7ada883a3aba0afb8f3", + "2d.text.measure.advances-not-defined.html": [ + "4bddaf0b2e00b9c84eefb151ae98ab1043e31b7a", [ null, {} ] ], - "2d.text.measure.advances.worker.js": [ - "3bf2d9f719c5fd8f8fb9b186ecb7cdb2c0bf6295", + "2d.text.measure.advances-not-defined.worker.js": [ + "f0b587dea27c717a9242f7f352cab300afc2b086", [ - "html/canvas/offscreen/text/2d.text.measure.advances.worker.html", + "html/canvas/offscreen/text/2d.text.measure.advances-not-defined.worker.html", {} ] ], @@ -676307,7 +676434,34 @@ ] ], "compute-arraybufferview-with-bigger-arraybuffer.https.any.js": [ - "62ce16c93e4f0bace1f438d01ad2ff8ba1da0116", + "96a20f1fe57d26a35f3214fbb2fba2035c8e38a3", + [ + "webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.html?cpu", + { + "script_metadata": [ + [ + "title", + "test WebNN MLContext.compute() for ArrayBufferView created from bigger ArrayBuffer" + ], + [ + "global", + "window,dedicatedworker" + ], + [ + "variant", + "?cpu" + ], + [ + "variant", + "?gpu" + ], + [ + "script", + "../resources/utils.js" + ] + ] + } + ], [ "webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.html?gpu", { @@ -676322,6 +676476,37 @@ ], [ "variant", + "?cpu" + ], + [ + "variant", + "?gpu" + ], + [ + "script", + "../resources/utils.js" + ] + ] + } + ], + [ + "webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.worker.html?cpu", + { + "script_metadata": [ + [ + "title", + "test WebNN MLContext.compute() for ArrayBufferView created from bigger ArrayBuffer" + ], + [ + "global", + "window,dedicatedworker" + ], + [ + "variant", + "?cpu" + ], + [ + "variant", "?gpu" ], [ @@ -676345,6 +676530,10 @@ ], [ "variant", + "?cpu" + ], + [ + "variant", "?gpu" ], [
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/parsing/scroll-markers-computed.tentative.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/parsing/scroll-markers-computed.tentative.html new file mode 100644 index 0000000..61067e71 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/parsing/scroll-markers-computed.tentative.html
@@ -0,0 +1,41 @@ +<!DOCTYPE html> +<html> + +<head> + <meta charset="utf-8"> + <title>CSS Overflow: scroll-markers computed values</title> + <link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10243"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/css/support/computed-testcommon.js"></script> +</head> + +<body> + <style> + #target { scroll-markers: before; } + </style> + <div id="target"></div> + <script> + test_computed_value('scroll-markers', 'initial', 'none'); + test_computed_value('scroll-markers', 'inherit', 'none'); + test_computed_value('scroll-markers', 'unset', 'none'); + test_computed_value('scroll-markers', 'revert', 'none'); + + test_computed_value('scroll-markers', 'none'); + test_computed_value('scroll-markers', 'before'); + test_computed_value('scroll-markers', 'after'); + + test(() => { + let style = getComputedStyle(document.getElementById('target')); + assert_not_equals(Array.from(style).indexOf('scroll-markers'), -1); + }, 'The scroll-markers property shows up in CSSStyleDeclaration enumeration'); + + test(() => { + let style = document.getElementById('target').style; + assert_not_equals(style.cssText.indexOf('scroll-markers'), -1); + }, 'The scroll-markers property shows up in CSSStyleDeclaration.cssText'); + + </script> +</body> + +</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/parsing/scroll-markers-invalid.tentative.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/parsing/scroll-markers-invalid.tentative.html new file mode 100644 index 0000000..8e08356 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/parsing/scroll-markers-invalid.tentative.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> + +<head> + <meta charset="utf-8"> + <title>CSS Overflow: parsing scroll-markers with invalid values</title> + <link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10243"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/css/support/parsing-testcommon.js"></script> +</head> + +<body> + <div id="target"></div> + <script> + test_invalid_value('scroll-markers', '10'); + test_invalid_value('scroll-markers', 'true'); + test_invalid_value('scroll-markers', 'default'); + test_invalid_value('scroll-markers', 'set'); + test_invalid_value('scroll-markers', 'before, after'); + </script> +</body> + +</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/parsing/scroll-markers-valid.tentative.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/parsing/scroll-markers-valid.tentative.html new file mode 100644 index 0000000..04de1bf --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/parsing/scroll-markers-valid.tentative.html
@@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html> + +<head> + <meta charset="utf-8"> + <title>CSS Overflow: parsing scroll-markers with valid values</title> + <link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10243"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/css/support/parsing-testcommon.js"></script> +</head> + +<body> + <div id="target"></div> + <script> + test_valid_value('scroll-markers', 'initial'); + test_valid_value('scroll-markers', 'inherit'); + test_valid_value('scroll-markers', 'unset'); + test_valid_value('scroll-markers', 'revert'); + + test_valid_value("scroll-markers", "none"); + test_valid_value("scroll-markers", "before"); + test_valid_value("scroll-markers", "after"); + </script> +</body> + +</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/element/text/2d.text.measure.advances-not-defined-expected.txt b/third_party/blink/web_tests/external/wpt/html/canvas/element/text/2d.text.measure.advances-not-defined-expected.txt new file mode 100644 index 0000000..1798957 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/text/2d.text.measure.advances-not-defined-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +[FAIL] Testing that TextMetrics.advances is not defined + assert_true: !("advances" in ctx.measureText('Hello')) expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/element/text/2d.text.measure.advances-not-defined.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/text/2d.text.measure.advances-not-defined.html new file mode 100644 index 0000000..55c0e22 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/text/2d.text.measure.advances-not-defined.html
@@ -0,0 +1,36 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>Canvas test: 2d.text.measure.advances-not-defined</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> +<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> +<style> +@font-face { + font-family: CanvasTest; + src: url("/fonts/CanvasTest.ttf"); +} +</style> +<body class="show_output"> + +<h1>2d.text.measure.advances-not-defined</h1> +<p class="desc">Testing that TextMetrics.advances is not defined</p> + + +<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +promise_test(async t => { + + var canvas = document.getElementById('c'); + var ctx = canvas.getContext('2d'); + + ctx.font = '50px CanvasTest'; + _assert(!("advances" in ctx.measureText('Hello')), "!(\"advances\" in ctx.measureText('Hello'))"); + +}, "Testing that TextMetrics.advances is not defined"); +</script> +
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/element/text/2d.text.measure.advances.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/text/2d.text.measure.advances.html deleted file mode 100644 index 84f04dd..0000000 --- a/third_party/blink/web_tests/external/wpt/html/canvas/element/text/2d.text.measure.advances.html +++ /dev/null
@@ -1,52 +0,0 @@ -<!DOCTYPE html> -<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.text.measure.advances</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/html/canvas/resources/canvas-tests.js"></script> -<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> -<style> -@font-face { - font-family: CanvasTest; - src: url("/fonts/CanvasTest.ttf"); -} -</style> -<body class="show_output"> - -<h1>2d.text.measure.advances</h1> -<p class="desc">Testing width advances</p> - - -<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span> -<p class="output">Actual output:</p> -<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> - -<ul id="d"></ul> -<script> -promise_test(async t => { - - var canvas = document.getElementById('c'); - var ctx = canvas.getContext('2d'); - - await document.fonts.ready; - ctx.font = '50px CanvasTest'; - ctx.direction = 'ltr'; - ctx.align = 'left' - // Some platforms may return '-0'. - _assertSame(Math.abs(ctx.measureText('Hello').advances[0]), 0, "Math.abs(ctx.measureText('Hello').advances[\""+(0)+"\"])", "0"); - // Different platforms may render text slightly different. - _assert(ctx.measureText('Hello').advances[1] >= 36, "ctx.measureText('Hello').advances[\""+(1)+"\"] >= 36"); - _assert(ctx.measureText('Hello').advances[2] >= 58, "ctx.measureText('Hello').advances[\""+(2)+"\"] >= 58"); - _assert(ctx.measureText('Hello').advances[3] >= 70, "ctx.measureText('Hello').advances[\""+(3)+"\"] >= 70"); - _assert(ctx.measureText('Hello').advances[4] >= 80, "ctx.measureText('Hello').advances[\""+(4)+"\"] >= 80"); - - var tm = ctx.measureText('Hello'); - _assertSame(ctx.measureText('Hello').advances[0], tm.advances[0], "ctx.measureText('Hello').advances[\""+(0)+"\"]", "tm.advances[\""+(0)+"\"]"); - _assertSame(ctx.measureText('Hello').advances[1], tm.advances[1], "ctx.measureText('Hello').advances[\""+(1)+"\"]", "tm.advances[\""+(1)+"\"]"); - _assertSame(ctx.measureText('Hello').advances[2], tm.advances[2], "ctx.measureText('Hello').advances[\""+(2)+"\"]", "tm.advances[\""+(2)+"\"]"); - _assertSame(ctx.measureText('Hello').advances[3], tm.advances[3], "ctx.measureText('Hello').advances[\""+(3)+"\"]", "tm.advances[\""+(3)+"\"]"); - _assertSame(ctx.measureText('Hello').advances[4], tm.advances[4], "ctx.measureText('Hello').advances[\""+(4)+"\"]", "tm.advances[\""+(4)+"\"]"); - -}, "Testing width advances"); -</script> -
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances-not-defined-expected.txt b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances-not-defined-expected.txt new file mode 100644 index 0000000..1798957 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances-not-defined-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +[FAIL] Testing that TextMetrics.advances is not defined + assert_true: !("advances" in ctx.measureText('Hello')) expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances-not-defined.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances-not-defined.html new file mode 100644 index 0000000..4bddaf0 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances-not-defined.html
@@ -0,0 +1,22 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.text.measure.advances-not-defined</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.text.measure.advances-not-defined</h1> +<p class="desc">Testing that TextMetrics.advances is not defined</p> + + +<script> +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.font = '50px CanvasTest'; + _assert(!("advances" in ctx.measureText('Hello')), "!(\"advances\" in ctx.measureText('Hello'))"); + +}, "Testing that TextMetrics.advances is not defined"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances-not-defined.worker-expected.txt b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances-not-defined.worker-expected.txt new file mode 100644 index 0000000..1798957 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances-not-defined.worker-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +[FAIL] Testing that TextMetrics.advances is not defined + assert_true: !("advances" in ctx.measureText('Hello')) expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances-not-defined.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances-not-defined.worker.js new file mode 100644 index 0000000..f0b587dea --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances-not-defined.worker.js
@@ -0,0 +1,16 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.advances-not-defined +// Description:Testing that TextMetrics.advances is not defined +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.font = '50px CanvasTest'; + _assert(!("advances" in ctx.measureText('Hello')), "!(\"advances\" in ctx.measureText('Hello'))"); +}, "Testing that TextMetrics.advances is not defined"); +done();
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances.html deleted file mode 100644 index 2eec005..0000000 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances.html +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html> -<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: 2d.text.measure.advances</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/html/canvas/resources/canvas-tests.js"></script> - -<h1>2d.text.measure.advances</h1> -<p class="desc">Testing width advances</p> - - -<script> -promise_test(async t => { - - var canvas = new OffscreenCanvas(100, 50); - var ctx = canvas.getContext('2d'); - - var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); - f.load(); - document.fonts.add(f); - await document.fonts.ready; - ctx.font = '50px CanvasTest'; - ctx.direction = 'ltr'; - ctx.align = 'left' - // Some platforms may return '-0'. - _assertSame(Math.abs(ctx.measureText('Hello').advances[0]), 0, "Math.abs(ctx.measureText('Hello').advances[\""+(0)+"\"])", "0"); - // Different platforms may render text slightly different. - _assert(ctx.measureText('Hello').advances[1] >= 36, "ctx.measureText('Hello').advances[\""+(1)+"\"] >= 36"); - _assert(ctx.measureText('Hello').advances[2] >= 58, "ctx.measureText('Hello').advances[\""+(2)+"\"] >= 58"); - _assert(ctx.measureText('Hello').advances[3] >= 70, "ctx.measureText('Hello').advances[\""+(3)+"\"] >= 70"); - _assert(ctx.measureText('Hello').advances[4] >= 80, "ctx.measureText('Hello').advances[\""+(4)+"\"] >= 80"); - - var tm = ctx.measureText('Hello'); - _assertSame(ctx.measureText('Hello').advances[0], tm.advances[0], "ctx.measureText('Hello').advances[\""+(0)+"\"]", "tm.advances[\""+(0)+"\"]"); - _assertSame(ctx.measureText('Hello').advances[1], tm.advances[1], "ctx.measureText('Hello').advances[\""+(1)+"\"]", "tm.advances[\""+(1)+"\"]"); - _assertSame(ctx.measureText('Hello').advances[2], tm.advances[2], "ctx.measureText('Hello').advances[\""+(2)+"\"]", "tm.advances[\""+(2)+"\"]"); - _assertSame(ctx.measureText('Hello').advances[3], tm.advances[3], "ctx.measureText('Hello').advances[\""+(3)+"\"]", "tm.advances[\""+(3)+"\"]"); - _assertSame(ctx.measureText('Hello').advances[4], tm.advances[4], "ctx.measureText('Hello').advances[\""+(4)+"\"]", "tm.advances[\""+(4)+"\"]"); - -}, "Testing width advances"); -</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances.worker.js deleted file mode 100644 index 3bf2d9f..0000000 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/text/2d.text.measure.advances.worker.js +++ /dev/null
@@ -1,35 +0,0 @@ -// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.text.measure.advances -// Description:Testing width advances -// Note: - -importScripts("/resources/testharness.js"); -importScripts("/html/canvas/resources/canvas-tests.js"); - -promise_test(async t => { - var canvas = new OffscreenCanvas(100, 50); - var ctx = canvas.getContext('2d'); - - var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); - f.load(); - self.fonts.add(f); - await self.fonts.ready; - ctx.font = '50px CanvasTest'; - ctx.direction = 'ltr'; - ctx.align = 'left' - // Some platforms may return '-0'. - _assertSame(Math.abs(ctx.measureText('Hello').advances[0]), 0, "Math.abs(ctx.measureText('Hello').advances[\""+(0)+"\"])", "0"); - // Different platforms may render text slightly different. - _assert(ctx.measureText('Hello').advances[1] >= 36, "ctx.measureText('Hello').advances[\""+(1)+"\"] >= 36"); - _assert(ctx.measureText('Hello').advances[2] >= 58, "ctx.measureText('Hello').advances[\""+(2)+"\"] >= 58"); - _assert(ctx.measureText('Hello').advances[3] >= 70, "ctx.measureText('Hello').advances[\""+(3)+"\"] >= 70"); - _assert(ctx.measureText('Hello').advances[4] >= 80, "ctx.measureText('Hello').advances[\""+(4)+"\"] >= 80"); - - var tm = ctx.measureText('Hello'); - _assertSame(ctx.measureText('Hello').advances[0], tm.advances[0], "ctx.measureText('Hello').advances[\""+(0)+"\"]", "tm.advances[\""+(0)+"\"]"); - _assertSame(ctx.measureText('Hello').advances[1], tm.advances[1], "ctx.measureText('Hello').advances[\""+(1)+"\"]", "tm.advances[\""+(1)+"\"]"); - _assertSame(ctx.measureText('Hello').advances[2], tm.advances[2], "ctx.measureText('Hello').advances[\""+(2)+"\"]", "tm.advances[\""+(2)+"\"]"); - _assertSame(ctx.measureText('Hello').advances[3], tm.advances[3], "ctx.measureText('Hello').advances[\""+(3)+"\"]", "tm.advances[\""+(3)+"\"]"); - _assertSame(ctx.measureText('Hello').advances[4], tm.advances[4], "ctx.measureText('Hello').advances[\""+(4)+"\"]", "tm.advances[\""+(4)+"\"]"); -}, "Testing width advances"); -done();
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml-new/text.yaml b/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml-new/text.yaml index 7f2047bc..8af162e 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml-new/text.yaml +++ b/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml-new/text.yaml
@@ -994,31 +994,15 @@ @assert ctx.measureText("").width === 0; variants: *load-font-variant-definition -- name: 2d.text.measure.advances - desc: Testing width advances +- name: 2d.text.measure.advances-not-defined + desc: Testing that TextMetrics.advances is not defined test_type: promise fonts: - CanvasTest code: | {{ load_font }} ctx.font = '50px CanvasTest'; - ctx.direction = 'ltr'; - ctx.align = 'left' - // Some platforms may return '-0'. - @assert Math.abs(ctx.measureText('Hello').advances[0]) === 0; - // Different platforms may render text slightly different. - @assert ctx.measureText('Hello').advances[1] >= 36; - @assert ctx.measureText('Hello').advances[2] >= 58; - @assert ctx.measureText('Hello').advances[3] >= 70; - @assert ctx.measureText('Hello').advances[4] >= 80; - - var tm = ctx.measureText('Hello'); - @assert ctx.measureText('Hello').advances[0] === tm.advances[0]; - @assert ctx.measureText('Hello').advances[1] === tm.advances[1]; - @assert ctx.measureText('Hello').advances[2] === tm.advances[2]; - @assert ctx.measureText('Hello').advances[3] === tm.advances[3]; - @assert ctx.measureText('Hello').advances[4] === tm.advances[4]; - variants: *load-font-variant-definition + @assert !("advances" in ctx.measureText('Hello')); - name: 2d.text.measure.actualBoundingBox desc: Testing actualBoundingBox
diff --git a/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-listing-expected.txt b/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-listing-expected.txt index 1e7b4de..12c80d2e 100644 --- a/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-listing-expected.txt +++ b/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-listing-expected.txt
@@ -311,6 +311,7 @@ scroll-margin-block-start: 0px scroll-margin-inline-end: 0px scroll-margin-inline-start: 0px +scroll-markers: none scroll-padding-block-end: auto scroll-padding-block-start: auto scroll-padding-inline-end: auto
diff --git a/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt b/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt index a58c0e2..9be0bef 100644 --- a/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt +++ b/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt
@@ -311,6 +311,7 @@ scroll-margin-block-start: 0px scroll-margin-inline-end: 0px scroll-margin-inline-start: 0px +scroll-markers: none scroll-padding-block-end: auto scroll-padding-block-start: auto scroll-padding-inline-end: auto
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/resources/inspector-protocol-test.js b/third_party/blink/web_tests/http/tests/inspector-protocol/resources/inspector-protocol-test.js index 0fbedd2..06a57b12 100644 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/resources/inspector-protocol-test.js +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/resources/inspector-protocol-test.js
@@ -39,6 +39,7 @@ 'documentURL', 'styleSheetId', 'executionContextId', + 'executionContextUniqueId', 'openerId', 'targetId', 'browserContextId',
diff --git a/third_party/blink/web_tests/svg/css/getComputedStyle-listing-expected.txt b/third_party/blink/web_tests/svg/css/getComputedStyle-listing-expected.txt index 9790cf3..7bbda4d 100644 --- a/third_party/blink/web_tests/svg/css/getComputedStyle-listing-expected.txt +++ b/third_party/blink/web_tests/svg/css/getComputedStyle-listing-expected.txt
@@ -311,6 +311,7 @@ scroll-margin-block-start: 0px scroll-margin-inline-end: 0px scroll-margin-inline-start: 0px +scroll-markers: none scroll-padding-block-end: auto scroll-padding-block-start: auto scroll-padding-inline-end: auto
diff --git a/third_party/blink/web_tests/webexposed/css-properties-as-js-properties-expected.txt b/third_party/blink/web_tests/webexposed/css-properties-as-js-properties-expected.txt index a477f29..20cf11a 100644 --- a/third_party/blink/web_tests/webexposed/css-properties-as-js-properties-expected.txt +++ b/third_party/blink/web_tests/webexposed/css-properties-as-js-properties-expected.txt
@@ -386,6 +386,7 @@ scrollMarginLeft scrollMarginRight scrollMarginTop +scrollMarkers scrollPadding scrollPaddingBlock scrollPaddingBlockEnd
diff --git a/third_party/blink/web_tests/webexposed/css-property-listing-expected.txt b/third_party/blink/web_tests/webexposed/css-property-listing-expected.txt index 5f328ce..b265910 100644 --- a/third_party/blink/web_tests/webexposed/css-property-listing-expected.txt +++ b/third_party/blink/web_tests/webexposed/css-property-listing-expected.txt
@@ -333,6 +333,7 @@ scroll-margin-left scroll-margin-right scroll-margin-top + scroll-markers scroll-padding-block-end scroll-padding-block-start scroll-padding-bottom
diff --git a/third_party/depot_tools b/third_party/depot_tools index af58dae..8479869 160000 --- a/third_party/depot_tools +++ b/third_party/depot_tools
@@ -1 +1 @@ -Subproject commit af58dae320bbe5b28ff312cca870ecbdb6751763 +Subproject commit 84798693112c7e241d8c560ea6090e5d91a12fa2
diff --git a/third_party/devtools-frontend-internal b/third_party/devtools-frontend-internal index e9acc8f..90c2de6d 160000 --- a/third_party/devtools-frontend-internal +++ b/third_party/devtools-frontend-internal
@@ -1 +1 @@ -Subproject commit e9acc8fd5e4c24452adb8085b0cefd7fdb1af097 +Subproject commit 90c2de6df6113049ac08d6e40546d81e700ae740
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index 6314cf8..dfbfe04 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit 6314cf83ab35394ed50877ac2db3b6d845cb46cf +Subproject commit dfbfe0429ad85c3d1323f6a597507c137f7106d6
diff --git a/third_party/openscreen/src b/third_party/openscreen/src index 97d0a7f..bb80e49 160000 --- a/third_party/openscreen/src +++ b/third_party/openscreen/src
@@ -1 +1 @@ -Subproject commit 97d0a7fd9e51669930f8376e069599acc1c2de2e +Subproject commit bb80e497bf91b9e38ff58072e2f4cd04b8f2e14b
diff --git a/third_party/skia b/third_party/skia index 93912d5..7045b90f 160000 --- a/third_party/skia +++ b/third_party/skia
@@ -1 +1 @@ -Subproject commit 93912d50850d3f783e2e4dc51bda5667e798dddb +Subproject commit 7045b90f1ef853dc95347501704eed6e5e39b8b5
diff --git a/third_party/tflite/BUILD.gn b/third_party/tflite/BUILD.gn index a80f824..1235235 100644 --- a/third_party/tflite/BUILD.gn +++ b/third_party/tflite/BUILD.gn
@@ -729,6 +729,8 @@ sources += [ "src/tensorflow/lite/delegates/xnnpack/quantization_util.cc", "src/tensorflow/lite/delegates/xnnpack/quantization_util.h", + "src/tensorflow/lite/delegates/xnnpack/weight_cache.cc", + "src/tensorflow/lite/delegates/xnnpack/weight_cache.h", "src/tensorflow/lite/delegates/xnnpack/xnnpack_delegate.cc", "src/tensorflow/lite/delegates/xnnpack/xnnpack_delegate.h", ]
diff --git a/third_party/tflite/README.chromium b/third_party/tflite/README.chromium index 15273aeb..c255a247 100644 --- a/third_party/tflite/README.chromium +++ b/third_party/tflite/README.chromium
@@ -1,8 +1,8 @@ Name: TensorFlow Lite Short Name: tflite URL: https://github.com/tensorflow/tensorflow -Version: 1187fe26a8a52029b23e0832356989ab44a540c3 -Date: 2024-05-09 +Version: 6b9a25f438944132acc54ecf2c59af53c10fd6a1 +Date: 2024-05-14 License: Apache 2.0 License File: LICENSE Security Critical: Yes
diff --git a/third_party/tflite/src b/third_party/tflite/src index 1187fe2..6b9a25f 160000 --- a/third_party/tflite/src +++ b/third_party/tflite/src
@@ -1 +1 @@ -Subproject commit 1187fe26a8a52029b23e0832356989ab44a540c3 +Subproject commit 6b9a25f438944132acc54ecf2c59af53c10fd6a1
diff --git a/third_party/vulkan-deps b/third_party/vulkan-deps index e2486aa9..a5193d4 160000 --- a/third_party/vulkan-deps +++ b/third_party/vulkan-deps
@@ -1 +1 @@ -Subproject commit e2486aa9a1f0cb28dfa714232dcd1d0d5ec5dca4 +Subproject commit a5193d466640077b4c0d42a9e9420fc32ccf8855
diff --git a/third_party/webrtc b/third_party/webrtc index 16fb790..95fc15b 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit 16fb7903e546051483720548168cd40cded7a040 +Subproject commit 95fc15b5a1c2285966854eceb68ea095a4538fd8
diff --git a/third_party/xnnpack/README.chromium b/third_party/xnnpack/README.chromium index c4a06e7a..8062029 100644 --- a/third_party/xnnpack/README.chromium +++ b/third_party/xnnpack/README.chromium
@@ -1,8 +1,8 @@ Name: XNNPACK Short Name: xnnpack URL: https://github.com/google/xnnpack -Version: e73fb4a03f658fd48cc10c8a7cf48fe7eeab9114 -Date: 2024-05-09 +Version: c9f0470750e7c3c71974cdb997aeb2990d2e2137 +Date: 2024-05-14 License: BSD License File: src/LICENSE Security Critical: Yes
diff --git a/third_party/xnnpack/src b/third_party/xnnpack/src index e73fb4a..c9f0470 160000 --- a/third_party/xnnpack/src +++ b/third_party/xnnpack/src
@@ -1 +1 @@ -Subproject commit e73fb4a03f658fd48cc10c8a7cf48fe7eeab9114 +Subproject commit c9f0470750e7c3c71974cdb997aeb2990d2e2137
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index df81c87..c7ed9306 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -22744,6 +22744,8 @@ <int value="659775785" label="(Obsolete) disable-simplified-fullscreen-ui"/> <int value="659871291" label="ClearCrossSiteCrossBrowsingContextGroupWindowName:enabled"/> + <int value="660018273" + label="Prerender2EarlyDocumentLifecycleUpdate:enabled"/> <int value="661020875" label="AutofillSaveCardShowNoThanks:disabled"/> <int value="661537613" label="WebNotesPublish:enabled"/> <int value="662001716" label="ToolbarIphAndroid:disabled"/> @@ -23847,6 +23849,8 @@ <int value="1147703885" label="SecondaryGoogleAccountUsage:enabled"/> <int value="1147924185" label="enable-navigation-predictor-renderer-warmup"/> <int value="1148284632" label="NewTabPageUIMd:disabled"/> + <int value="1148637402" + label="Prerender2EarlyDocumentLifecycleUpdate:disabled"/> <int value="1148731895" label="OmniboxMostVisitedTilesAddRecycledViewPool:enabled"/> <int value="1149417604" label="StreamlinedUsbPrinterSetup:disabled"/> @@ -27146,6 +27150,7 @@ <int value="790" label="types"/> <int value="791" label="line-clamp"/> <int value="792" label="font-variant-emoji"/> + <int value="793" label="scroll-markers"/> </enum> <enum name="MediaEncryptionType">
diff --git a/tools/metrics/histograms/metadata/accessibility/histograms.xml b/tools/metrics/histograms/metadata/accessibility/histograms.xml index 54a2c8c..3823ce7 100644 --- a/tools/metrics/histograms/metadata/accessibility/histograms.xml +++ b/tools/metrics/histograms/metadata/accessibility/histograms.xml
@@ -612,7 +612,7 @@ </histogram> <histogram name="Accessibility.CrosCaretBlinkInterval" units="ms" - expires_after="2024-08-18"> + expires_after="2024-11-10"> <owner>katie@chromium.org</owner> <owner>chrome-a11y-core@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/android/histograms.xml b/tools/metrics/histograms/metadata/android/histograms.xml index 76e50ac..81ca687 100644 --- a/tools/metrics/histograms/metadata/android/histograms.xml +++ b/tools/metrics/histograms/metadata/android/histograms.xml
@@ -3278,7 +3278,7 @@ </histogram> <histogram name="Android.PageSummary.Share.IsVisibleInShareSheet" - enum="PageSummaryShareSheetVisibility" expires_after="2024-06-30"> + enum="PageSummaryShareSheetVisibility" expires_after="2024-11-10"> <owner>salg@google.com</owner> <owner>ssid@google.com</owner> <summary> @@ -4616,7 +4616,7 @@ </histogram> <histogram name="Android.TabSwitcher.CreationTime" units="ms" - expires_after="2024-06-30"> + expires_after="2024-11-10"> <owner>skavuluru@chromium.org</owner> <owner>twellington@chromium.org</owner> <owner>clank-large-form-factors@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/arc/histograms.xml b/tools/metrics/histograms/metadata/arc/histograms.xml index 742f7380..2c4baaaf 100644 --- a/tools/metrics/histograms/metadata/arc/histograms.xml +++ b/tools/metrics/histograms/metadata/arc/histograms.xml
@@ -724,7 +724,7 @@ <token key="ArcUserTypes" variants="ArcUserTypes"/> </histogram> -<histogram name="Arc.Auth.NumAccounts" units="count" expires_after="2024-09-11"> +<histogram name="Arc.Auth.NumAccounts" units="count" expires_after="2024-11-10"> <owner>sinhak@google.com</owner> <owner>mhasank@google.com</owner> <owner>arc-core@google.com</owner> @@ -759,7 +759,7 @@ </histogram> <histogram name="Arc.Auth.RequestAccountInfoResult.Primary" - enum="ArcAuthCodeStatus" expires_after="2024-09-11"> + enum="ArcAuthCodeStatus" expires_after="2024-11-10"> <owner>mhasank@google.com</owner> <owner>arc-core@google.com</owner> <summary> @@ -1537,7 +1537,7 @@ </histogram> <histogram name="Arc.Net.DnsQuery.AndroidApi" enum="BooleanSuccess" - expires_after="2024-09-11"> + expires_after="2024-11-10"> <owner>mhasank@google.com</owner> <owner>arc-core@google.com</owner> <summary> @@ -1546,7 +1546,7 @@ </histogram> <histogram name="Arc.Net.DnsQuery.Other" enum="BooleanSuccess" - expires_after="2024-09-11"> + expires_after="2024-11-10"> <owner>mhasank@google.com</owner> <owner>arc-core@google.com</owner> <summary> @@ -1659,7 +1659,7 @@ </histogram> <histogram name="Arc.OptInResult" enum="ArcOptInResult" - expires_after="2024-09-11"> + expires_after="2024-11-10"> <owner>mhasank@google.com</owner> <owner>khmel@google.com</owner> <owner>arc-core@google.com</owner> @@ -1667,7 +1667,7 @@ </histogram> <histogram name="Arc.OptInSilentAuthCode" enum="ArcOptInSilentAuthCode" - expires_after="2024-09-11"> + expires_after="2024-11-10"> <owner>mhasank@google.com</owner> <owner>khmel@google.com</owner> <owner>arc-core@google.com</owner> @@ -1677,7 +1677,7 @@ </histogram> <histogram name="Arc.OptInSilentAuthCode.Reauthorization" - enum="ArcOptInSilentAuthCode" expires_after="2024-09-11"> + enum="ArcOptInSilentAuthCode" expires_after="2024-11-10"> <owner>mhasank@google.com</owner> <owner>khmel@google.com</owner> <owner>arc-core@google.com</owner> @@ -1825,7 +1825,7 @@ </histogram> <histogram name="Arc.Policy.InstallTypesOnDevice" enum="AppInstallType" - expires_after="2024-09-11"> + expires_after="2024-11-10"> <owner>batoon@google.com</owner> <owner>arc-commercial@google.com</owner> <summary> @@ -1838,7 +1838,7 @@ </histogram> <histogram name="Arc.Policy.Keys" enum="ArcPolicyKey" - expires_after="2024-09-11"> + expires_after="2024-11-10"> <owner>mhasank@google.com</owner> <owner>arc-commercial@google.com</owner> <summary> @@ -2049,6 +2049,22 @@ </histogram> <histogram + name="Arc.Runtime.Performance.JanksPercentage2{ArcPerformanceAppCategories}" + units="%" expires_after="2024-11-22"> + <owner>alanding@google.com</owner> + <owner>matvore@google.com</owner> + <summary> + Percentage of the number of present frames during the tracing period which + contain UI janks. A jank is defined as a displayed frame with duration + longer than the normal display rate by 190%. {ArcPerformanceAppCategories} + </summary> + <token key="ArcPerformanceAppCategories" + variants="ArcPerformanceAppCategories"> + <variant name=""/> + </token> +</histogram> + +<histogram name="Arc.Runtime.Performance.JanksPerMinute2{ArcPerformanceAppCategories}" units="count" expires_after="2024-09-22"> <owner>alanding@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/ash/histograms.xml b/tools/metrics/histograms/metadata/ash/histograms.xml index 8d7ba88..ee82aef 100644 --- a/tools/metrics/histograms/metadata/ash/histograms.xml +++ b/tools/metrics/histograms/metadata/ash/histograms.xml
@@ -627,7 +627,7 @@ </histogram> <histogram name="Ash.AmbientMode.VideoDlcInstall.{Label}.Error" - enum="AmbientDlcError" expires_after="2024-09-08"> + enum="AmbientDlcError" expires_after="2024-11-10"> <owner>esum@google.com</owner> <owner>xiaohuic@google.com</owner> <summary> @@ -1788,7 +1788,7 @@ </histogram> <histogram name="Ash.CalendarView.FadeInUpNextView.AnimationSmoothness" - units="%" expires_after="2024-09-04"> + units="%" expires_after="2024-11-10"> <owner>newcomer@google.com</owner> <owner>samcackett@google.com</owner> <owner>cros-status-area-eng@google.com</owner> @@ -2077,7 +2077,7 @@ <histogram name="Ash.CaptureModeController.Projector.CaptureRegionAdjusted.{TabletOrClamshell}" - units="adjustments" expires_after="2024-08-18"> + units="adjustments" expires_after="2024-11-10"> <owner>michelefan@chromium.org</owner> <owner>gzadina@google.com</owner> <summary> @@ -8295,7 +8295,7 @@ </histogram> <histogram base="true" name="Ash.UnlockAnimation.Smoothness" units="%" - expires_after="2024-07-12"> + expires_after="2024-11-10"> <owner>oshima@chromium.org</owner> <owner>chromeos-wmp@google.com</owner> <!-- Name completed by histogram_suffixes
diff --git a/tools/metrics/histograms/metadata/autofill/histograms.xml b/tools/metrics/histograms/metadata/autofill/histograms.xml index aac71da..91346c8 100644 --- a/tools/metrics/histograms/metadata/autofill/histograms.xml +++ b/tools/metrics/histograms/metadata/autofill/histograms.xml
@@ -5869,7 +5869,7 @@ <histogram name="Autofill.VirtualCardEnrollBubble.ConfirmationResult.{IsCardEnrolled}" - enum="AutofillVirtualCardEnrollBubbleResult" expires_after="2024-08-01"> + enum="AutofillVirtualCardEnrollBubbleResult" expires_after="2024-11-10"> <owner>darwinyang@google.com</owner> <owner>kavitasoni@google.com</owner> <owner>chrome-payments-team@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/blink/histograms.xml b/tools/metrics/histograms/metadata/blink/histograms.xml index 6185bdf..d3b9eca 100644 --- a/tools/metrics/histograms/metadata/blink/histograms.xml +++ b/tools/metrics/histograms/metadata/blink/histograms.xml
@@ -98,7 +98,7 @@ </histogram> <histogram name="Blink.Accessibility.ModeFlag" enum="AccessibilityModeFlagEnum" - expires_after="2024-09-01"> + expires_after="2024-11-10"> <owner>kevers@chromium.org</owner> <owner>chrome-a11y-core@chromium.org</owner> <summary> @@ -1641,7 +1641,7 @@ </histogram> <histogram name="Blink.FedCm.PreventSilentAccessFrameType" - enum="FedCmRequesterFrameType" expires_after="2024-08-21"> + enum="FedCmRequesterFrameType" expires_after="2024-11-10"> <owner>npm@chromium.org</owner> <owner>web-identity-eng@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/browser/histograms.xml b/tools/metrics/histograms/metadata/browser/histograms.xml index 5037e0f1..0f99fc5 100644 --- a/tools/metrics/histograms/metadata/browser/histograms.xml +++ b/tools/metrics/histograms/metadata/browser/histograms.xml
@@ -1295,7 +1295,7 @@ </histogram> <histogram name="BrowserSwitcher.ChromeLaunch.IsFromBrowserSwitcher" - enum="Boolean" expires_after="2024-09-05"> + enum="Boolean" expires_after="2024-11-10"> <owner>nicolaso@chromium.org</owner> <owner>pastarmovj@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/browsing_topics/histograms.xml b/tools/metrics/histograms/metadata/browsing_topics/histograms.xml index 2fe83ab..2624303c 100644 --- a/tools/metrics/histograms/metadata/browsing_topics/histograms.xml +++ b/tools/metrics/histograms/metadata/browsing_topics/histograms.xml
@@ -222,7 +222,7 @@ </histogram> <histogram name="BrowsingTopics.PageLoad.OnTopicsFirstInvoked.RedirectCount" - units="count" expires_after="2024-09-07"> + units="count" expires_after="2024-11-10"> <owner>yaoxia@chromium.org</owner> <owner>jkarlin@chromium.org</owner> <summary> @@ -234,7 +234,7 @@ <histogram name="BrowsingTopics.PageLoad.OnTopicsFirstInvoked.RedirectWithTopicsInvokedCount" - units="count" expires_after="2024-09-07"> + units="count" expires_after="2024-11-10"> <owner>yaoxia@chromium.org</owner> <owner>jkarlin@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/chromeos/histograms.xml b/tools/metrics/histograms/metadata/chromeos/histograms.xml index df9e766..dfe80a2 100644 --- a/tools/metrics/histograms/metadata/chromeos/histograms.xml +++ b/tools/metrics/histograms/metadata/chromeos/histograms.xml
@@ -3648,22 +3648,6 @@ </histogram> <histogram - name="ChromeOS.Settings.Device.{Peripheral}.External.NumConnectedLast28Days" - units="devices" expires_after="2025-03-22"> - <owner>dpad@google.com</owner> - <owner>cros-peripherals@google.com</owner> - <summary> - Records the number of {Peripheral} devices seen in the last 28 days. - Recorded everytime a user connects an external {Peripheral}. - </summary> - <token key="Peripheral"> - <variant name="Keyboard"/> - <variant name="Mouse"/> - <variant name="Touchpad"/> - </token> -</histogram> - -<histogram name="ChromeOS.Settings.Device.{Peripheral}.{PeripheralSetting}.Changed" enum="Boolean" expires_after="2025-03-22"> <owner>dpad@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/content/histograms.xml b/tools/metrics/histograms/metadata/content/histograms.xml index 7e526d3..3048651 100644 --- a/tools/metrics/histograms/metadata/content/histograms.xml +++ b/tools/metrics/histograms/metadata/content/histograms.xml
@@ -1790,7 +1790,7 @@ </histogram> <histogram name="ContentSuggestions.{FeedType}.Activity" - enum="FeedActivityBucket" expires_after="2024-05-24"> + enum="FeedActivityBucket" expires_after="2025-05-24"> <owner>guiperez@google.com</owner> <owner>feed@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/cras/histograms.xml b/tools/metrics/histograms/metadata/cras/histograms.xml index 719b09b..61aed529 100644 --- a/tools/metrics/histograms/metadata/cras/histograms.xml +++ b/tools/metrics/histograms/metadata/cras/histograms.xml
@@ -1032,7 +1032,7 @@ <histogram name="Cras.StreamRuntimeWithMinimum{Duration}{Direction}{ClientType}{StreamType}" - units="seconds" expires_after="2024-09-08"> + units="seconds" expires_after="2024-11-10"> <owner>pteerapong@chromium.org</owner> <owner>chromeos-audio@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/custom_tabs/histograms.xml b/tools/metrics/histograms/metadata/custom_tabs/histograms.xml index 198527ee..46707fd 100644 --- a/tools/metrics/histograms/metadata/custom_tabs/histograms.xml +++ b/tools/metrics/histograms/metadata/custom_tabs/histograms.xml
@@ -290,7 +290,7 @@ </histogram> <histogram name="CustomTabs.IncognitoCCTCallerId" enum="IncognitoCCTCallerId" - expires_after="2024-08-04"> + expires_after="2024-11-10"> <owner>arabm@google.com</owner> <owner>chrome-incognito@google.com</owner> <owner>cct-team@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/dev/histograms.xml b/tools/metrics/histograms/metadata/dev/histograms.xml index 25053ef..496b6bc6 100644 --- a/tools/metrics/histograms/metadata/dev/histograms.xml +++ b/tools/metrics/histograms/metadata/dev/histograms.xml
@@ -590,7 +590,7 @@ </histogram> <histogram name="DevTools.StyleTextCopied" enum="DevToolsStyleTextCopied" - expires_after="2024-07-07"> + expires_after="2024-11-10"> <owner>changhaohan@chromium.org</owner> <owner>bmeurer@google.com</owner> <owner>yangguo@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/ios/histograms.xml b/tools/metrics/histograms/metadata/ios/histograms.xml index 6e0e639a..e8acfa1 100644 --- a/tools/metrics/histograms/metadata/ios/histograms.xml +++ b/tools/metrics/histograms/metadata/ios/histograms.xml
@@ -235,7 +235,7 @@ </histogram> <histogram name="IOS.BringAndroidTabs.ActionOnPrompt" - enum="IOSBringAndroidTabsPromptActionType" expires_after="2024-09-01"> + enum="IOSBringAndroidTabsPromptActionType" expires_after="2024-11-10"> <owner>hiramahmood@google.com</owner> <owner>ginnyhuang@chromium.org</owner> <owner>bling-get-set-up@google.com</owner> @@ -980,7 +980,7 @@ </histogram> <histogram name="IOS.DockingPromo.Action" enum="IOSDockingPromoAction" - expires_after="2024-09-10"> + expires_after="2024-11-10"> <owner>bwwilliams@google.com</owner> <owner>hiramahmood@google.com</owner> <owner>bling-team@google.com</owner> @@ -990,7 +990,7 @@ </histogram> <histogram name="IOS.DockingPromo.LastForegroundTimeViaAppState" - units="minutes" expires_after="2024-09-10"> + units="minutes" expires_after="2024-11-10"> <owner>bwwilliams@google.com</owner> <owner>hiramahmood@google.com</owner> <owner>bling-team@google.com</owner> @@ -1002,7 +1002,7 @@ </histogram> <histogram name="IOS.DockingPromo.LostToCompetingPromo" - enum="IOSPromosManagerPromo" expires_after="2024-09-10"> + enum="IOSPromosManagerPromo" expires_after="2024-11-10"> <owner>bwwilliams@google.com</owner> <owner>hiramahmood@google.com</owner> <owner>bling-team@google.com</owner> @@ -1014,7 +1014,7 @@ </histogram> <histogram name="IOS.DockingPromoRemindMeLater.LostToCompetingPromo" - enum="IOSPromosManagerPromo" expires_after="2024-09-10"> + enum="IOSPromosManagerPromo" expires_after="2024-11-10"> <owner>bwwilliams@google.com</owner> <owner>hiramahmood@google.com</owner> <owner>bling-team@google.com</owner> @@ -2421,7 +2421,7 @@ </histogram> <histogram name="IOS.OverflowMenu.Customization.DestinationRemoved" - enum="IOSOverflowMenuDestination" expires_after="2024-09-01"> + enum="IOSOverflowMenuDestination" expires_after="2024-11-10"> <owner>rkgibson@google.com</owner> <owner>bling-mony-pod@google.com</owner> <summary> @@ -2430,7 +2430,7 @@ </histogram> <histogram name="IOS.OverflowMenu.Customization.DestinationsCustomized" - units="bitfield value" expires_after="2024-09-01"> + units="bitfield value" expires_after="2024-11-10"> <owner>rkgibson@google.com</owner> <owner>bling-mony-pod@google.com</owner> <summary> @@ -2442,7 +2442,7 @@ <histogram name="IOS.OverflowMenu.Customization.DestinationsReordered.FirstPosition" - enum="IOSOverflowMenuDestination" expires_after="2024-09-01"> + enum="IOSOverflowMenuDestination" expires_after="2024-11-10"> <owner>rkgibson@google.com</owner> <owner>bling-mony-pod@google.com</owner> <summary> @@ -2453,7 +2453,7 @@ <histogram name="IOS.OverflowMenu.Customization.DestinationsReordered.FourthPosition" - enum="IOSOverflowMenuDestination" expires_after="2024-09-01"> + enum="IOSOverflowMenuDestination" expires_after="2024-11-10"> <owner>rkgibson@google.com</owner> <owner>bling-mony-pod@google.com</owner> <summary> @@ -2464,7 +2464,7 @@ <histogram name="IOS.OverflowMenu.Customization.DestinationsReordered.SecondPosition" - enum="IOSOverflowMenuDestination" expires_after="2024-09-01"> + enum="IOSOverflowMenuDestination" expires_after="2024-11-10"> <owner>rkgibson@google.com</owner> <owner>bling-mony-pod@google.com</owner> <summary> @@ -2475,7 +2475,7 @@ <histogram name="IOS.OverflowMenu.Customization.DestinationsReordered.ThirdPosition" - enum="IOSOverflowMenuDestination" expires_after="2024-09-01"> + enum="IOSOverflowMenuDestination" expires_after="2024-11-10"> <owner>rkgibson@google.com</owner> <owner>bling-mony-pod@google.com</owner> <summary> @@ -2505,7 +2505,7 @@ </histogram> <histogram name="IOS.OverflowMenu.SmartSortingStateChange" - enum="IOSOverflowMenuSmartSortingChange" expires_after="2024-09-01"> + enum="IOSOverflowMenuSmartSortingChange" expires_after="2024-11-10"> <owner>rkgibson@google.com</owner> <owner>bling-mony-pod@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/media/histograms.xml b/tools/metrics/histograms/metadata/media/histograms.xml index 44ac4944..85c5e8e 100644 --- a/tools/metrics/histograms/metadata/media/histograms.xml +++ b/tools/metrics/histograms/metadata/media/histograms.xml
@@ -380,7 +380,7 @@ </histogram> <histogram name="Media.Android.MediaPlayerWatchTime" - enum="MediaPlayerWatchTimeType" expires_after="2024-09-01"> + enum="MediaPlayerWatchTimeType" expires_after="2024-11-10"> <owner>sandersd@chromium.org</owner> <owner>media-dev-uma@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/net/histograms.xml b/tools/metrics/histograms/metadata/net/histograms.xml index c9752697..1d8db92 100644 --- a/tools/metrics/histograms/metadata/net/histograms.xml +++ b/tools/metrics/histograms/metadata/net/histograms.xml
@@ -3722,7 +3722,7 @@ </histogram> <histogram name="Net.QuicSession.PacketLossRate" units="1/10th Percent" - expires_after="2024-09-06"> + expires_after="2024-11-10"> <owner>dschinazi@chromium.org</owner> <owner>src/net/quic/OWNERS</owner> <summary> @@ -3771,7 +3771,7 @@ </histogram> <histogram name="Net.QuicSession.PathValidationSuccess" enum="BooleanSuccess" - expires_after="2024-08-25"> + expires_after="2024-11-10"> <owner>renjietang@chromium.org</owner> <owner>src/net/quic/OWNERS</owner> <summary> @@ -5083,7 +5083,7 @@ </histogram> <histogram name="Net.SpdySession.AlpsDecoderStatus.Bypassed" - enum="AlpsDecoderError" expires_after="2024-09-11"> + enum="AlpsDecoderError" expires_after="2024-11-10"> <owner>arichiv@chromium.org</owner> <owner>src/net/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/offline/histograms.xml b/tools/metrics/histograms/metadata/offline/histograms.xml index dac589a..4ca39ae 100644 --- a/tools/metrics/histograms/metadata/offline/histograms.xml +++ b/tools/metrics/histograms/metadata/offline/histograms.xml
@@ -50,7 +50,7 @@ </histogram> <histogram name="OfflinePages.CachedOfflineStatusValid" enum="BooleanMatched" - expires_after="2024-07-28"> + expires_after="2024-11-10"> <owner>pnoland@chromium.org</owner> <owner>offline-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/optimization/enums.xml b/tools/metrics/histograms/metadata/optimization/enums.xml index 2ff7f040..6408f3f 100644 --- a/tools/metrics/histograms/metadata/optimization/enums.xml +++ b/tools/metrics/histograms/metadata/optimization/enums.xml
@@ -85,17 +85,18 @@ </enum> <enum name="OnDeviceModelAdaptationAvailability"> - <int value="0" label="Unknown"/> - <int value="1" label="Adaptation model was available"/> - <int value="2" label="Base model was not available"/> - <int value="3" + <int value="0" label="Adaptation model was available"/> + <int value="1" label="Base model was not available"/> + <int value="2" label="Base model spec was invalid, so adaptation model cannot be fetched"/> - <int value="4" label="Adaptation model was not available"/> - <int value="5" label="The recieved adaptation model was invalid"/> - <int value="6" + <int value="3" label="Adaptation model was not available"/> + <int value="4" label="The recieved adaptation model was invalid"/> + <int value="5" label="The received adaptation model was incompatible with the base model"/> + <int value="6" + label="The execution config in the adaptation model was invalid"/> </enum> <enum name="OnDeviceModelLoadResult">
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml index 4109b9d..eceb4f0f 100644 --- a/tools/metrics/histograms/metadata/others/histograms.xml +++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -4296,7 +4296,7 @@ </histogram> <histogram name="Conversions.TimeFromTriggerToReportSentSuccessfully" - units="hours" expires_after="2024-07-31"> + units="hours" expires_after="2024-11-10"> <owner>linnan@chromium.org</owner> <owner>johnidel@chromium.org</owner> <owner>measurement-api-dev+metrics@google.com</owner> @@ -6720,7 +6720,7 @@ </histogram> <histogram name="Import.ImporterType.AutoImport" enum="ImporterType" - expires_after="2024-08-30"> + expires_after="2024-11-10"> <owner>robliao@chromium.org</owner> <owner>gab@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/page/histograms.xml b/tools/metrics/histograms/metadata/page/histograms.xml index f308661..adf8914 100644 --- a/tools/metrics/histograms/metadata/page/histograms.xml +++ b/tools/metrics/histograms/metadata/page/histograms.xml
@@ -1059,7 +1059,7 @@ </histogram> <histogram name="PageLoad.Clients.LinkPreview.Usage" enum="LinkPreviewUsage" - expires_after="2024-07-15"> + expires_after="2024-11-10"> <owner>toyoshim@chromium.org</owner> <owner>src/chrome/browser/preloading/preview/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/password/histograms.xml b/tools/metrics/histograms/metadata/password/histograms.xml index 70d6f08..b35826a 100644 --- a/tools/metrics/histograms/metadata/password/histograms.xml +++ b/tools/metrics/histograms/metadata/password/histograms.xml
@@ -1646,7 +1646,7 @@ </histogram> <histogram name="PasswordManager.ImportResultsStatus2" - enum="PasswordManagerImportResultsStatus" expires_after="2024-09-01"> + enum="PasswordManagerImportResultsStatus" expires_after="2024-11-10"> <owner>eliaskh@chromium.org</owner> <owner>natiahlyi@google.com</owner> <summary> @@ -2209,7 +2209,7 @@ </histogram> <histogram name="PasswordManager.PasswordMigrationWarning.EmptySheetTrigger2" - enum="PasswordMigrationWarningTriggers" expires_after="2024-09-01"> + enum="PasswordMigrationWarningTriggers" expires_after="2024-11-10"> <owner>izuzic@google.com</owner> <owner>ioanap@chromium.org</owner> <summary> @@ -3222,7 +3222,7 @@ </histogram> <histogram name="PasswordManager.RequirementsSpecFetcher.Result" - enum="PasswordRequirementsFetcherResult" expires_after="2024-08-15"> + enum="PasswordRequirementsFetcherResult" expires_after="2024-11-10"> <owner>kazinova@google.com</owner> <owner>battre@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/platform/enums.xml b/tools/metrics/histograms/metadata/platform/enums.xml index beba05a..efb15b0 100644 --- a/tools/metrics/histograms/metadata/platform/enums.xml +++ b/tools/metrics/histograms/metadata/platform/enums.xml
@@ -2611,6 +2611,7 @@ <int value="1941011596" label="IFX 9655 rev 35 fw 4.34 build 03f2"/> <int value="1951490249" label="CROS Cr50 0.5.130"/> <int value="1953654937" label="IFX 9645 rev 45 fw 133.33 build 00e3"/> + <int value="1974285066" label="CROS Ti50 0.23.90"/> <int value="1994299966" label="CROS Cr50 0.4.27"/> <int value="1996708318" label="CROS Ti50 0.24.20"/> <int value="1999850232" label="CROS Cr50 0.6.240"/>
diff --git a/tools/metrics/histograms/metadata/platform/histograms.xml b/tools/metrics/histograms/metadata/platform/histograms.xml index 664630a..1f28fec 100644 --- a/tools/metrics/histograms/metadata/platform/histograms.xml +++ b/tools/metrics/histograms/metadata/platform/histograms.xml
@@ -1556,7 +1556,7 @@ </histogram> <histogram name="Platform.Resourced.VmmsReclaimMemoryDuration.{PressureLevel}" - units="ms" expires_after="2024-08-23"> + units="ms" expires_after="2024-11-10"> <owner>vovoy@chromium.org</owner> <owner>chromeos-memory@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/printing/histograms.xml b/tools/metrics/histograms/metadata/printing/histograms.xml index eb459c9..b35a136 100644 --- a/tools/metrics/histograms/metadata/printing/histograms.xml +++ b/tools/metrics/histograms/metadata/printing/histograms.xml
@@ -53,7 +53,7 @@ </histogram> <histogram name="Printing.ConversionSize.PostScript3" units="KB" - expires_after="2024-09-10"> + expires_after="2024-11-10"> <owner>thestig@chromium.org</owner> <owner>awscreen@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/quota/histograms.xml b/tools/metrics/histograms/metadata/quota/histograms.xml index 1e957861..c39cba0f 100644 --- a/tools/metrics/histograms/metadata/quota/histograms.xml +++ b/tools/metrics/histograms/metadata/quota/histograms.xml
@@ -78,7 +78,7 @@ </histogram> <histogram name="Quota.DatabaseSpecificError.{Statement}" - enum="SqliteLoggedResultCode" expires_after="2024-07-07"> + enum="SqliteLoggedResultCode" expires_after="2024-11-10"> <owner>estade@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary> @@ -279,7 +279,7 @@ </histogram> <histogram name="Quota.QuotaDatabaseReset" enum="QuotaDatabaseResetReason" - expires_after="2024-07-21"> + expires_after="2024-11-10"> <owner>ayui@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/safe_browsing/histograms.xml b/tools/metrics/histograms/metadata/safe_browsing/histograms.xml index 5330709..7bf8898 100644 --- a/tools/metrics/histograms/metadata/safe_browsing/histograms.xml +++ b/tools/metrics/histograms/metadata/safe_browsing/histograms.xml
@@ -2614,7 +2614,7 @@ <histogram name="SafeBrowsing.TailoredSecurity.ShouldRetryOutcome" enum="SafeBrowsingTailoredSecurityShouldRetryOutcome" - expires_after="2024-09-06"> + expires_after="2024-11-10"> <owner>jacastro@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary> @@ -2953,7 +2953,7 @@ <histogram name="SafeBrowsing.V4LocalDatabaseManager.TimeSinceLastUpdateResponse" - units="ms" expires_after="2024-09-10"> + units="ms" expires_after="2024-11-10"> <owner>ajuma@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/sb_client/histograms.xml b/tools/metrics/histograms/metadata/sb_client/histograms.xml index 57a84630..3f15ac67 100644 --- a/tools/metrics/histograms/metadata/sb_client/histograms.xml +++ b/tools/metrics/histograms/metadata/sb_client/histograms.xml
@@ -588,7 +588,7 @@ </histogram> <histogram name="SBClientPhishing.Classifier.ReadyAfterRetryTimeout" - units="bool" expires_after="2024-09-07"> + units="bool" expires_after="2024-11-10"> <owner>andysjlim@chromium.org</owner> <owner>chrome-counter-abuse-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/settings/histograms.xml b/tools/metrics/histograms/metadata/settings/histograms.xml index b55e3e5..1955d74 100644 --- a/tools/metrics/histograms/metadata/settings/histograms.xml +++ b/tools/metrics/histograms/metadata/settings/histograms.xml
@@ -94,7 +94,7 @@ </histogram> <histogram name="Settings.DefaultBrowserFromSource" - enum="IOSDefaultBrowserSettingsPageSource" expires_after="2024-09-01"> + enum="IOSDefaultBrowserSettingsPageSource" expires_after="2024-11-10"> <owner>gayane@google.com</owner> <owner>bling-mony-pod@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/structured_metrics/histograms.xml b/tools/metrics/histograms/metadata/structured_metrics/histograms.xml index 3e457b2..c2735ac 100644 --- a/tools/metrics/histograms/metadata/structured_metrics/histograms.xml +++ b/tools/metrics/histograms/metadata/structured_metrics/histograms.xml
@@ -162,7 +162,7 @@ </histogram> <histogram name="StructuredMetrics.Reporting.HTTPErrorCode" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2024-07-14"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2024-11-10"> <owner>andrewbregger@google.com</owner> <owner>jongahn@google.com</owner> <owner>chromeos-data-eng@google.com</owner> @@ -174,7 +174,7 @@ </histogram> <histogram name="StructuredMetrics.Reporting.HTTPResponseCode" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2024-07-14"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2024-11-10"> <owner>andrewbregger@google.com</owner> <owner>jongahn@google.com</owner> <owner>chromeos-data-eng@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/sync/histograms.xml b/tools/metrics/histograms/metadata/sync/histograms.xml index 6d7ab15..999602b 100644 --- a/tools/metrics/histograms/metadata/sync/histograms.xml +++ b/tools/metrics/histograms/metadata/sync/histograms.xml
@@ -619,7 +619,7 @@ </histogram> <histogram name="Sync.FCMInstanceIdTokenRetrievalStatus" - enum="InstanceIDResult" expires_after="2024-09-06"> + enum="InstanceIDResult" expires_after="2024-11-10"> <owner>rushans@google.com</owner> <owner>treib@chromium.org</owner> <summary> @@ -630,7 +630,7 @@ </histogram> <histogram name="Sync.FcmRegistrationTokenFetchTime" units="ms" - expires_after="2024-09-06"> + expires_after="2024-11-10"> <owner>rushans@google.com</owner> <owner>treib@chromium.org</owner> <summary> @@ -1347,7 +1347,7 @@ </histogram> <histogram name="Sync.RecordedUserEventType" enum="SyncUserEventType" - expires_after="2024-09-10"> + expires_after="2024-11-10"> <owner>mmoskvitin@google.com</owner> <owner>treib@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/tab/histograms.xml b/tools/metrics/histograms/metadata/tab/histograms.xml index b8a1bba1..5ad7ae2 100644 --- a/tools/metrics/histograms/metadata/tab/histograms.xml +++ b/tools/metrics/histograms/metadata/tab/histograms.xml
@@ -181,7 +181,7 @@ </histogram> <histogram name="Tab.CloseAllTabsDialog.ClosedAllTabs.{CloseType}" - enum="Boolean" expires_after="2024-09-11"> + enum="Boolean" expires_after="2024-11-10"> <owner>ckitagawa@chromium.org</owner> <owner>fredmello@chromium.org</owner> <summary> @@ -1511,7 +1511,7 @@ </histogram> <histogram name="Tabs.PotentialDoubleDirty.SaveQueueSize" units="tabs" - expires_after="2024-09-01"> + expires_after="2024-11-10"> <owner>skym@chromium.org</owner> <owner>ckitagawa@chroimum.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/uma/histograms.xml b/tools/metrics/histograms/metadata/uma/histograms.xml index 05372e5e..c154492 100644 --- a/tools/metrics/histograms/metadata/uma/histograms.xml +++ b/tools/metrics/histograms/metadata/uma/histograms.xml
@@ -957,7 +957,7 @@ </histogram> <histogram name="UMA.TruncatedEvents.UserAction" units="events" - expires_after="2024-11-03"> + expires_after="2024-11-10"> <owner>rkaplow@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/v8/histograms.xml b/tools/metrics/histograms/metadata/v8/histograms.xml index dd7dfdc..6d0061e 100644 --- a/tools/metrics/histograms/metadata/v8/histograms.xml +++ b/tools/metrics/histograms/metadata/v8/histograms.xml
@@ -2125,7 +2125,7 @@ </histogram> <histogram name="V8.WasmNumLazyCompilations120Sec" units="count" - expires_after="2024-08-01"> + expires_after="2024-11-10"> <owner>ahaas@chromium.org</owner> <owner>clemensb@chromium.org</owner> <owner>ecmziegler@chromium.org</owner> @@ -2236,7 +2236,7 @@ </histogram> <histogram name="V8.WasmSumLazyCompilationTime20SecMilliSeconds" units="ms" - expires_after="2024-08-01"> + expires_after="2024-11-10"> <owner>ahaas@chromium.org</owner> <owner>clemensb@chromium.org</owner> <owner>ecmziegler@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/web_core/histograms.xml b/tools/metrics/histograms/metadata/web_core/histograms.xml index f2ef144..a9088c9 100644 --- a/tools/metrics/histograms/metadata/web_core/histograms.xml +++ b/tools/metrics/histograms/metadata/web_core/histograms.xml
@@ -347,7 +347,7 @@ </histogram> <histogram name="WebCore.IndexedDB.LevelDBOpenErrors.EnvMethod" - enum="LevelDBIOErrorMethods" expires_after="2024-07-28"> + enum="LevelDBIOErrorMethods" expires_after="2024-11-10"> <owner>estade@chromium.org</owner> <owner>chrome-owp-storage@google.com</owner> <summary> @@ -814,7 +814,7 @@ </histogram> <histogram name="WebCore.Scripts.V8CrowdsourcedCompileHints.ModelQuality" - enum="V8CompileHintsModelQuality" expires_after="2024-09-11"> + enum="V8CompileHintsModelQuality" expires_after="2024-11-10"> <owner>marja@chromium.org</owner> <owner>v8-loading@google.com</owner> <owner>chrome-intelligence-core@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/webapps/histograms.xml b/tools/metrics/histograms/metadata/webapps/histograms.xml index 25e6ef84..40d0144 100644 --- a/tools/metrics/histograms/metadata/webapps/histograms.xml +++ b/tools/metrics/histograms/metadata/webapps/histograms.xml
@@ -852,7 +852,7 @@ </histogram> <histogram name="WebApp.InstalledCount.ByUser" units="count" - expires_after="2024-09-10"> + expires_after="2024-11-10"> <owner>dmurph@chromium.org</owner> <owner>pwa-team@google.com</owner> <summary> @@ -876,7 +876,7 @@ </histogram> <histogram name="WebApp.InstalledCount.ByUserNotLocallyInstalled" units="count" - expires_after="2024-09-10"> + expires_after="2024-11-10"> <owner>dmurph@chromium.org</owner> <owner>pwa-team@google.com</owner> <summary> @@ -1040,7 +1040,7 @@ </histogram> <histogram name="WebApp.MlInstall.DialogResponse" - enum="WebAppMlInstallResponse" expires_after="2024-09-10"> + enum="WebAppMlInstallResponse" expires_after="2024-11-10"> <owner>dmurph@chromium.org</owner> <owner>desktop-pwa-team@google.com</owner> <summary>
diff --git a/tools/metrics/structured/sync/structured.xml b/tools/metrics/structured/sync/structured.xml index a2a66ef..f2da7bc 100644 --- a/tools/metrics/structured/sync/structured.xml +++ b/tools/metrics/structured/sync/structured.xml
@@ -997,6 +997,18 @@ <summary> Project used to record a sequence of events that are related to each other. </summary> + <enum name="AppInstallSurface"> + <variant value="0">APP_PRELOAD_SERVICE_OEM</variant> + <variant value="1">APP_PRELOAD_SERVICE_DEFAULT</variant> + <variant value="2">OOBE_APP_RECOMMENDATIONS</variant> + <variant value="3">APP_INSTALL_URI_UNKNOWN</variant> + <variant value="4">APP_INSTALL_URI_SHOWOFF</variant> + <variant value="5">APP_INSTALL_URI_MALL</variant> + <variant value="6">APP_INSTALL_URI_GETIT</variant> + <variant value="7">APP_INSTALL_URI_LAUNCHER</variant> + <variant value="8">APP_INSTALL_URI_PERIPHERALS</variant> + </enum> + <enum name="CameraAppLaunchType"> <variant value="0">DEFAULT</variant> <variant value="1">ASSISTANT</variant> @@ -1170,6 +1182,76 @@ <variant value="20">QS_CREATING_ACCOUNT</variant> <variant value="21">QS_FALLBACK_URL</variant> </enum> + + <enum name="PickerInputFieldType"> + <variant value="0">NONE</variant> + <variant value="1">PLAIN_TEXT</variant> + <variant value="2">RICH_TEXT</variant> + <variant value="3">PASSWORD</variant> + <variant value="4">SEARCH</variant> + <variant value="5">EMAIL</variant> + <variant value="6">NUMBER</variant> + <variant value="7">TELEPHONE</variant> + <variant value="8">URL</variant> + <variant value="9">DATE_TIME</variant> + <variant value="10">OTHER</variant> + </enum> + + <enum name="PickerSessionOutcome"> + <variant value="0">UNKNOWN</variant> + <variant value="1">INSERTED_OR_COPIED</variant> + <variant value="2">ABANDONED</variant> + <variant value="3">REDIRECTED</variant> + <variant value="4">FORMAT</variant> + </enum> + + <enum name="PickerAction"> + <variant value="0">UNKNOWN</variant> + <variant value="1">OPEN_EDITOR_WRITE</variant> + <variant value="2">OPEN_EDITOR_REWRITE</variant> + <variant value="3">OPEN_LINKS</variant> + <variant value="4">OPEN_EXPRESSIONS</variant> + <variant value="5">OPEN_CLIPBOARD</variant> + <variant value="6">OPEN_DRIVE_FILES</variant> + <variant value="7">OPEN_LOCAL_FILES</variant> + <variant value="8">OPEN_DATES_TIMES</variant> + <variant value="9">OPEN_UNITS_MATHS</variant> + <variant value="10">TRANSFORM_UPPER_CASE</variant> + <variant value="11">TRANSFORM_LOWER_CASE</variant> + <variant value="12">TRANSFORM_SENTENCE_CASE</variant> + <variant value="13">TRANSFORM_TITLE_CASE</variant> + <variant value="14">CAPS_ON</variant> + <variant value="15">CAPS_OFF</variant> + </enum> + + <enum name="PickerResultSource"> + <variant value="0">UNKNOWN</variant> + <variant value="1">OMNIBOX</variant> + <variant value="2">EMOJI</variant> + <variant value="3">CLIPBOARD</variant> + <variant value="4">DRIVE_FILES</variant> + <variant value="5">LOCAL_FILES</variant> + <variant value="6">DATES_TIMES</variant> + <variant value="7">UNITS_MATHS</variant> + <variant value="8">CASE_TRANSFORM</variant> + <variant value="9">TENOR</variant> + </enum> + + <enum name="PickerResultType"> + <variant value="0">UNKNOWN</variant> + <variant value="1">TEXT</variant> + <variant value="2">EMOJI</variant> + <variant value="3">SYMBOL</variant> + <variant value="4">EMOTICON</variant> + <variant value="5">CLIPBOARD_FILE</variant> + <variant value="6">CLIPBOARD_TEXT</variant> + <variant value="7">CLIPBOARD_IMAGE</variant> + <variant value="8">CLIPBOARD_HTML</variant> + <variant value="9">GIF</variant> + <variant value="10">LINK</variant> + <variant value="11">LOCAL_FILE</variant> + <variant value="12">DRIVE_FILE</variant> + </enum> <event name="AppDiscovery.AppInstalled"> <summary> Recorded whenever a new app is installed on Chrome OS. @@ -1196,6 +1278,24 @@ </metric> </event> + <event name="AppDiscovery.AppInstallService.InstallRequested"> + <summary> + Recorded when an app discovery surface requests an app be installed through + App Install Service. This is called very early in the App Install Service + process, before any user confirmation/validity checks/network requests. + </summary> + <metric name="AppId" type="raw-string"> + <summary> + App ID of the app requested to be installed. + </summary> + </metric> + <metric name="Surface" type="AppInstallSurface"> + <summary> + UI surface from which this install was requested. + </summary> + </metric> + </event> + <event name="AppDiscovery.AppLaunched"> <summary> Recorded whenever a new app is launched on Chrome OS. @@ -1679,7 +1779,8 @@ <event name="CameraApp.MemoryUsage"> <summary> - Event recorded the memory usage summary of the camera session sent at the end of a camera session. + Event recorded the memory usage summary of the camera session sent at the + end of a camera session. </summary> <metric name="Behaviors" type="int"> <summary> @@ -2309,20 +2410,6 @@ </metric> </event> - <enum name="PickerInputFieldType"> - <variant value="0">NONE</variant> - <variant value="1">PLAIN_TEXT</variant> - <variant value="2">RICH_TEXT</variant> - <variant value="3">PASSWORD</variant> - <variant value="4">SEARCH</variant> - <variant value="5">EMAIL</variant> - <variant value="6">NUMBER</variant> - <variant value="7">TELEPHONE</variant> - <variant value="8">URL</variant> - <variant value="9">DATE_TIME</variant> - <variant value="10">OTHER</variant> - </enum> - <event name="Picker.StartSession"> <summary> Recorded when user opens the picker window and starts a session. @@ -2339,62 +2426,6 @@ </metric> </event> - <enum name="PickerSessionOutcome"> - <variant value="0">UNKNOWN</variant> - <variant value="1">INSERTED_OR_COPIED</variant> - <variant value="2">ABANDONED</variant> - <variant value="3">REDIRECTED</variant> - <variant value="4">FORMAT</variant> - </enum> - - <enum name="PickerAction"> - <variant value="0">UNKNOWN</variant> - <variant value="1">OPEN_EDITOR_WRITE</variant> - <variant value="2">OPEN_EDITOR_REWRITE</variant> - <variant value="3">OPEN_LINKS</variant> - <variant value="4">OPEN_EXPRESSIONS</variant> - <variant value="5">OPEN_CLIPBOARD</variant> - <variant value="6">OPEN_DRIVE_FILES</variant> - <variant value="7">OPEN_LOCAL_FILES</variant> - <variant value="8">OPEN_DATES_TIMES</variant> - <variant value="9">OPEN_UNITS_MATHS</variant> - <variant value="10">TRANSFORM_UPPER_CASE</variant> - <variant value="11">TRANSFORM_LOWER_CASE</variant> - <variant value="12">TRANSFORM_SENTENCE_CASE</variant> - <variant value="13">TRANSFORM_TITLE_CASE</variant> - <variant value="14">CAPS_ON</variant> - <variant value="15">CAPS_OFF</variant> - </enum> - - <enum name="PickerResultSource"> - <variant value="0">UNKNOWN</variant> - <variant value="1">OMNIBOX</variant> - <variant value="2">EMOJI</variant> - <variant value="3">CLIPBOARD</variant> - <variant value="4">DRIVE_FILES</variant> - <variant value="5">LOCAL_FILES</variant> - <variant value="6">DATES_TIMES</variant> - <variant value="7">UNITS_MATHS</variant> - <variant value="8">CASE_TRANSFORM</variant> - <variant value="9">TENOR</variant> - </enum> - - <enum name="PickerResultType"> - <variant value="0">UNKNOWN</variant> - <variant value="1">TEXT</variant> - <variant value="2">EMOJI</variant> - <variant value="3">SYMBOL</variant> - <variant value="4">EMOTICON</variant> - <variant value="5">CLIPBOARD_FILE</variant> - <variant value="6">CLIPBOARD_TEXT</variant> - <variant value="7">CLIPBOARD_IMAGE</variant> - <variant value="8">CLIPBOARD_HTML</variant> - <variant value="9">GIF</variant> - <variant value="10">LINK</variant> - <variant value="11">LOCAL_FILE</variant> - <variant value="12">DRIVE_FILE</variant> - </enum> - <event name="Picker.FinishSession"> <summary> Recorded when user closes the picker window and finishes a session. @@ -2437,7 +2468,7 @@ </summary> </metric> </event> - + <event name="QuickStart.ScreenOpened"> <summary> Recorded when a new UI view is shown to a Quick Start user. It can either be
diff --git a/ui/compositor/test/fake_context_factory.h b/ui/compositor/test/fake_context_factory.h index ede3e29..0d2a8da7 100644 --- a/ui/compositor/test/fake_context_factory.h +++ b/ui/compositor/test/fake_context_factory.h
@@ -8,7 +8,7 @@ #include "base/memory/raw_ptr.h" #include "cc/test/test_task_graph_runner.h" #include "components/viz/common/display/renderer_settings.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" #include "ui/compositor/compositor.h" namespace cc { @@ -51,7 +51,7 @@ private: raw_ptr<cc::FakeLayerTreeFrameSink> frame_sink_ = nullptr; cc::TestTaskGraphRunner task_graph_runner_; - viz::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; + gpu::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; viz::RendererSettings renderer_settings_; };
diff --git a/ui/compositor/test/in_process_context_factory.h b/ui/compositor/test/in_process_context_factory.h index 895b47e..dfa1272 100644 --- a/ui/compositor/test/in_process_context_factory.h +++ b/ui/compositor/test/in_process_context_factory.h
@@ -6,6 +6,7 @@ #define UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_FACTORY_H_ #include <stdint.h> + #include <memory> #include <unordered_map> @@ -15,8 +16,8 @@ #include "components/viz/common/surfaces/subtree_capture_id_allocator.h" #include "components/viz/service/display/display.h" #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h" -#include "components/viz/test/test_gpu_memory_buffer_manager.h" #include "components/viz/test/test_shared_bitmap_manager.h" +#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h" #include "gpu/command_buffer/service/shared_image/shared_image_manager.h" #include "gpu/command_buffer/service/sync_point_manager.h" #include "gpu/ipc/common/surface_handle.h" @@ -96,7 +97,7 @@ viz::TestSharedBitmapManager shared_bitmap_manager_; gpu::SharedImageManager shared_image_manager_; gpu::SyncPointManager sync_point_manager_; - viz::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; + gpu::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; cc::TestTaskGraphRunner task_graph_runner_; viz::FrameSinkIdAllocator frame_sink_id_allocator_; viz::SubtreeCaptureIdAllocator subtree_capture_id_allocator_;
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc index 265d1bc..ea7fc4c 100644 --- a/ui/views/controls/button/label_button.cc +++ b/ui/views/controls/button/label_button.cc
@@ -318,15 +318,14 @@ // Account for the label only when the button is not shrinking down to hide // the label entirely. if (!shrinking_down_label_) { - if (max_size_.width() > 0) { - if (label_->GetMultiLine()) - label_->SetMaximumWidth(max_size_.width() - size.width()); - else - label_->SetMaximumWidthSingleLine(max_size_.width() - size.width()); - } + SizeBound available_width = + max_size_.width() > 0 ? available_size.width().min_of(max_size_.width()) + : available_size.width(); + SizeBound label_available_width = + std::max<SizeBound>(0, available_width - size.width()); const gfx::Size preferred_label_size = - label_->GetPreferredSize(SizeBounds(label_->width(), {})); + label_->GetPreferredSize(SizeBounds(label_available_width, {})); size.Enlarge(preferred_label_size.width(), 0); size.SetToMax( gfx::Size(0, preferred_label_size.height() + GetInsets().height())); @@ -363,23 +362,7 @@ } int LabelButton::GetHeightForWidth(int width) const { - const gfx::Size size_without_label = GetUnclampedSizeWithoutLabel(); - // Get label height for the remaining width. - const int label_height_with_insets = - label_->GetHeightForWidth(width - size_without_label.width()) + - GetInsets().height(); - - // Height is the larger of size without label and label height with insets. - int height = std::max(size_without_label.height(), label_height_with_insets); - - height = std::max(height, GetMinSize().height()); - - // Clamp height to the maximum height (if valid). - const gfx::Size max_size = GetMaxSize(); - if (max_size.height() > 0) - return std::min(max_size.height(), height); - - return height; + return CalculatePreferredSize(SizeBounds(width, {})).height(); } ProposedLayout LabelButton::CalculateProposedLayout(
diff --git a/ui/views/controls/button/label_button_unittest.cc b/ui/views/controls/button/label_button_unittest.cc index e050dd3..7be6c5c 100644 --- a/ui/views/controls/button/label_button_unittest.cc +++ b/ui/views/controls/button/label_button_unittest.cc
@@ -549,22 +549,26 @@ const int image_size = font_list.GetHeight(); const gfx::ImageSkia image = gfx::test::CreateImageSkia(image_size); ASSERT_EQ(font_list.GetHeight(), image.width()); + gfx::Insets button_insets = button()->GetInsets(); + const int unclamped_size_without_label = + image.width() + image_spacing + button_insets.width(); button()->SetImageModel(Button::STATE_NORMAL, ui::ImageModel::FromImageSkia(image)); button()->SetImageCentered(false); button()->SetMaxSize( - gfx::Size(image.width() + image_spacing + text_wrap_width, 0)); + gfx::Size(unclamped_size_without_label + text_wrap_width, 0)); - gfx::Insets button_insets = button()->GetInsets(); gfx::Size preferred_size = button()->GetPreferredSize({}); preferred_size.set_height( button()->GetHeightForWidth(preferred_size.width())); button()->SetSize(preferred_size); views::test::RunScheduledLayout(button()); + gfx::Size label_width = button()->label()->GetPreferredSize( + views::SizeBounds(text_wrap_width, {})); EXPECT_EQ(preferred_size.width(), - image.width() + image_spacing + text_wrap_width); + unclamped_size_without_label + label_width.width()); EXPECT_EQ(preferred_size.height(), font_list.GetHeight() * 2 + button_insets.height());