diff --git a/DEPS b/DEPS index 6a5ec14..6582eec 100644 --- a/DEPS +++ b/DEPS
@@ -231,15 +231,15 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'ff733b3f39098600fd5461dd71778e249cd7d78c', + 'skia_revision': '496b89cb74b389b0a1047919275033ef0630416e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '8ce61b9d92e07ad3c63da3547bbbf0c8cbbbff3a', + 'v8_revision': '868556abbe8737b9dbf55273a4d03238ee66f3de', # 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': '9994110baeb4741382849c8a909bed00dedd3508', + 'angle_revision': '29c01d51866489160e894b12827048b9498096ce', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -306,7 +306,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': '10474d9f680fe879beb6bfcc21e9baade89d3845', + 'devtools_frontend_revision': 'fdb326ff691d3e871b03c6a598cb7f662ad051fe', # 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. @@ -776,7 +776,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': '3nbPFkI2v6vg5aJKxTomy2I4gV5g7AvfZDQpjRlwSroC', + 'version': '5ogjCeEw_SblgjIEGQ90Mr2ImySIcVxVCx6ve5lMk5YC', }, ], 'condition': 'checkout_android', @@ -1026,7 +1026,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'f35d3508ebd8c98d6c3b6ebfebe4895b374dbc07', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '4a17839cda871dbf1171126fc3fed3c569c7a249', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1490,7 +1490,7 @@ 'packages': [ { 'package': 'fuchsia/third_party/aemu/linux-amd64', - 'version': 'RcTpHQNhrkxG2Y4BJhRct_IdU43YwygAOkCuplrWcKQC' + 'version': '6Vr4alb5803W2n5PbA5ZLwCcJznKdmFX1pDoy_5hfOAC' }, ], 'condition': 'host_os == "linux" and checkout_fuchsia', @@ -1633,7 +1633,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'b0291fd966b55a5efc496772555b94842bde1085', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '9f0b3330764eb4d373d8e2c9775d250ed10cb9f4', + Var('webrtc_git') + '/src.git' + '@' + '96168abfb74cd800f2e18e7dcca5bed72ef36e2d', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1691,7 +1691,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@5d74f86711c757b493b11e623f3891828001cebf', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@484fedba9fd811ac5f78d5819f904f35a387f1a7', 'condition': 'checkout_src_internal', }, @@ -1710,7 +1710,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': 'l4kV1IJf98U03-NrGPDD9ayqWAzf_T7OO5WfdMbaQvUC', + 'version': 'YACky8ppLFM0FXPDau15wHt9xmw-BVM8HKnMLz5HQXgC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -1721,7 +1721,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'aeIZajCBkF0LhFw_tL-5Yp_nmR4K38tF7g5UBlHfQ18C', + 'version': 'VGbkbIQy4l5j2gmve_60OzV-VQA2ZqWVEJDnpLrE7IoC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -1732,7 +1732,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/projector_app/app', - 'version': 'OvuD_rtiyl-Jgd08zyM4PvrhLaBiaoquqq1Zkmv9zVkC', + 'version': 'fTUxaSWoNv-UNcZzhkVzQkety15q56CblJ2DE2oGKpMC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal',
diff --git a/ash/app_list/views/assistant/assistant_page_view.cc b/ash/app_list/views/assistant/assistant_page_view.cc index 4f33daa8..f83c152 100644 --- a/ash/app_list/views/assistant/assistant_page_view.cc +++ b/ash/app_list/views/assistant/assistant_page_view.cc
@@ -30,6 +30,8 @@ #include "base/bind.h" #include "base/metrics/histogram_functions.h" #include "base/strings/utf_string_conversions.h" +#include "third_party/skia/include/core/SkColor.h" +#include "third_party/skia/include/core/SkTypes.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" @@ -425,28 +427,29 @@ if (features::IsAppListBubbleEnabled()) { layer()->SetColor(ColorProvider::Get()->GetBaseLayerColor( ColorProvider::BaseLayerType::kTransparent80)); + } else if (features::IsDarkLightModeEnabled()) { + const float opacity = features::IsBackgroundBlurEnabled() + ? AppListView::kAppListOpacityWithBlur + : AppListView::kAppListOpacity; + // We pass kShield80 to ColorProvider::GetShieldLayerColor. But we overwrite + // it as kAppListOpacity is 0.95 and kShield doesn't have kShield95. + layer()->SetColor( + SkColorSetA(ColorProvider::Get()->GetShieldLayerColor( + ColorProvider::ShieldLayerType::kShield80), + static_cast<U8CPU>(opacity * 255))); } else { - background()->SetNativeControlColor(ash::assistant::ResolveAssistantColor( - assistant_colors::ColorName::kBgAssistantPlate)); - - // Changing color of a background object doesn't trigger a paint. - SchedulePaint(); + layer()->SetColor(SK_ColorWHITE); } } void AssistantPageView::InitLayout() { + // Use a solid color layer. The color is set in OnThemeChanged(). + SetPaintToLayer(ui::LAYER_SOLID_COLOR); + layer()->SetFillsBoundsOpaquely(false); + if (features::IsAppListBubbleEnabled()) { - // Use a solid color layer with blur. The color is set in OnThemeChanged(). - SetPaintToLayer(ui::LAYER_SOLID_COLOR); - layer()->SetFillsBoundsOpaquely(false); layer()->SetBackgroundBlur(ColorProvider::kBackgroundBlurSigma); layer()->SetBackdropFilterQuality(ColorProvider::kBackgroundBlurQuality); - } else { - SetPaintToLayer(); - layer()->SetFillsBoundsOpaquely(false); - SetBackground( - views::CreateSolidBackground(ash::assistant::ResolveAssistantColor( - assistant_colors::ColorName::kBgAssistantPlate))); } view_shadow_ = std::make_unique<ViewShadow>(this, kShadowElevation);
diff --git a/ash/app_list/views/assistant/assistant_page_view_unittest.cc b/ash/app_list/views/assistant/assistant_page_view_unittest.cc index bfd11f3b..c3b2f7a7 100644 --- a/ash/app_list/views/assistant/assistant_page_view_unittest.cc +++ b/ash/app_list/views/assistant/assistant_page_view_unittest.cc
@@ -22,6 +22,7 @@ #include "chromeos/services/assistant/public/cpp/assistant_service.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkColor.h" +#include "third_party/skia/include/core/SkTypes.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/events/event.h" @@ -919,28 +920,60 @@ ShowAssistantUi(); - EXPECT_EQ(page_view()->background()->get_color(), SK_ColorWHITE); + EXPECT_EQ(page_view()->layer()->GetTargetColor(), SK_ColorWHITE); } TEST_F(AssistantPageNonBubbleTest, ThemeDarkLightMode) { - base::test::ScopedFeatureList scoped_feature_list(features::kDarkLightMode); + base::test::ScopedFeatureList scoped_feature_list_enable_dark_light_mode( + features::kDarkLightMode); + base::test::ScopedFeatureList scoped_feature_list_disable_blur; + scoped_feature_list_disable_blur.InitAndDisableFeature( + features::kEnableBackgroundBlur); + AshColorProvider::Get()->OnActiveUserPrefServiceChanged( Shell::Get()->session_controller()->GetActivePrefService()); + ASSERT_FALSE(features::IsBackgroundBlurEnabled()); + ShowAssistantUi(); - EXPECT_EQ(page_view()->background()->get_color(), - assistant_colors::ResolveColor( - assistant_colors::ColorName::kBgAssistantPlate, - /*is_dark_mode=*/false, /*use_debug_colors=*/false)); + const U8CPU opacity = static_cast<U8CPU>(AppListView::kAppListOpacity * 255); + + // We pass kShield80 to ColorProvider::GetShieldLayerColor. But it will be + // overwritten by opacity. kAppListOpacity is 0.95. kShield doesn't have + // kShield95. + EXPECT_EQ(page_view()->layer()->GetTargetColor(), + SkColorSetA(ColorProvider::Get()->GetShieldLayerColor( + ColorProvider::ShieldLayerType::kShield80), + opacity)); Shell::Get()->session_controller()->GetActivePrefService()->SetBoolean( prefs::kDarkModeEnabled, true); - EXPECT_EQ(page_view()->background()->get_color(), - assistant_colors::ResolveColor( - assistant_colors::ColorName::kBgAssistantPlate, - /*is_dark_mode=*/true, /*use_debug_colors=*/false)); + EXPECT_EQ(page_view()->layer()->GetTargetColor(), + SkColorSetA(ColorProvider::Get()->GetShieldLayerColor( + ColorProvider::ShieldLayerType::kShield80), + opacity)); +} + +TEST_F(AssistantPageNonBubbleTest, ThemeDarkLightModeWithBlur) { + base::test::ScopedFeatureList scoped_feature_list(features::kDarkLightMode); + AshColorProvider::Get()->OnActiveUserPrefServiceChanged( + Shell::Get()->session_controller()->GetActivePrefService()); + ASSERT_TRUE(features::IsBackgroundBlurEnabled()); + + ShowAssistantUi(); + + EXPECT_EQ(page_view()->layer()->GetTargetColor(), + ColorProvider::Get()->GetShieldLayerColor( + ColorProvider::ShieldLayerType::kShield80)); + + Shell::Get()->session_controller()->GetActivePrefService()->SetBoolean( + prefs::kDarkModeEnabled, true); + + EXPECT_EQ(page_view()->layer()->GetTargetColor(), + ColorProvider::Get()->GetShieldLayerColor( + ColorProvider::ShieldLayerType::kShield80)); } // AppListBubble only uses AssistantPageView in tablet mode. Clamshell mode uses
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index a006c69b..2f911657 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -533,15 +533,12 @@ <message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_PAIR_NEW_DEVICE" desc="The sub-header label for the button to pair a new device."> Pair new device </message> - <message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_CURRENTLY_CONNECTED_DEVICES" desc="The sub-header label for currently connected devices in the Bluetooth device list."> + <message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_CURRENTLY_CONNECTED_DEVICES" desc="The sub-header label for currently connected devices in Bluetooth device list."> Currently connected </message> - <message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_PREVIOUSLY_CONNECTED_DEVICES" desc="The sub-header label for previously connected devices in the Bluetooth device list."> + <message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_PREVIOUSLY_CONNECTED_DEVICES" desc="The sub-header label for previously connected devices in Bluetooth device list."> Previously connected </message> - <message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_NO_DEVICE_CONNECTED" desc="The sub-header label for no devices connected in the Bluetooth device list."> - No device connected - </message> <message name="IDS_ASH_STATUS_TRAY_UPDATE" desc="The label used in the tray popup to notify that the user should restart to get system updates."> Restart to update
diff --git a/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_BLUETOOTH_NO_DEVICE_CONNECTED.png.sha1 b/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_BLUETOOTH_NO_DEVICE_CONNECTED.png.sha1 deleted file mode 100644 index 7f7df6d..0000000 --- a/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_BLUETOOTH_NO_DEVICE_CONNECTED.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -1087627139c0d0fa0010136ab561cc32462988fd \ No newline at end of file
diff --git a/ash/quick_pair/repository/fake_fast_pair_repository.cc b/ash/quick_pair/repository/fake_fast_pair_repository.cc index 94f0ccb..9096acb9 100644 --- a/ash/quick_pair/repository/fake_fast_pair_repository.cc +++ b/ash/quick_pair/repository/fake_fast_pair_repository.cc
@@ -25,6 +25,11 @@ data_.erase(base::ToUpperASCII(hex_model_id)); } +void FakeFastPairRepository::SetCheckAccountKeysResult( + absl::optional<PairingMetadata> result) { + check_account_key_result_ = result; +} + void FakeFastPairRepository::GetDeviceMetadata( const std::string& hex_model_id, DeviceMetadataCallback callback) { @@ -46,7 +51,7 @@ void FakeFastPairRepository::CheckAccountKeys( const AccountKeyFilter& account_key_filter, CheckAccountKeysCallback callback) { - std::move(callback).Run(absl::nullopt); + std::move(callback).Run(check_account_key_result_); } void FakeFastPairRepository::AssociateAccountKey(
diff --git a/ash/quick_pair/repository/fake_fast_pair_repository.h b/ash/quick_pair/repository/fake_fast_pair_repository.h index d89e943..a493395 100644 --- a/ash/quick_pair/repository/fake_fast_pair_repository.h +++ b/ash/quick_pair/repository/fake_fast_pair_repository.h
@@ -35,6 +35,8 @@ void ClearFakeMetadata(const std::string& hex_model_id); + void SetCheckAccountKeysResult(absl::optional<PairingMetadata> result); + // FastPairRepository:: void GetDeviceMetadata(const std::string& hex_model_id, DeviceMetadataCallback callback) override; @@ -50,6 +52,7 @@ static void SetInstance(FastPairRepository* instance); base::flat_map<std::string, std::unique_ptr<DeviceMetadata>> data_; + absl::optional<PairingMetadata> check_account_key_result_; base::WeakPtrFactory<FakeFastPairRepository> weak_ptr_factory_{this}; };
diff --git a/ash/quick_pair/repository/fast_pair/pairing_metadata.cc b/ash/quick_pair/repository/fast_pair/pairing_metadata.cc index b797b1a..e677a77 100644 --- a/ash/quick_pair/repository/fast_pair/pairing_metadata.cc +++ b/ash/quick_pair/repository/fast_pair/pairing_metadata.cc
@@ -7,10 +7,12 @@ namespace ash { namespace quick_pair { -PairingMetadata::PairingMetadata(const DeviceMetadata* device_metadata, - const std::vector<uint8_t> account_key) +PairingMetadata::PairingMetadata(DeviceMetadata* device_metadata, + std::vector<uint8_t> account_key) : device_metadata(device_metadata), account_key(std::move(account_key)) {} +PairingMetadata::PairingMetadata(const PairingMetadata&) = default; +PairingMetadata& PairingMetadata::operator=(const PairingMetadata&) = default; PairingMetadata::PairingMetadata(PairingMetadata&&) = default; PairingMetadata::~PairingMetadata() = default;
diff --git a/ash/quick_pair/repository/fast_pair/pairing_metadata.h b/ash/quick_pair/repository/fast_pair/pairing_metadata.h index 9049670..a7d50ee 100644 --- a/ash/quick_pair/repository/fast_pair/pairing_metadata.h +++ b/ash/quick_pair/repository/fast_pair/pairing_metadata.h
@@ -17,14 +17,15 @@ // Thin wrapper around Account Key + decoded metadata for a Fast Pair device // which has already been paired. struct COMPONENT_EXPORT(QUICK_PAIR_REPOSITORY) PairingMetadata { - explicit PairingMetadata(const DeviceMetadata* device_metadata, - const std::vector<uint8_t> account_key); - PairingMetadata(const PairingMetadata&) = delete; + explicit PairingMetadata(DeviceMetadata* device_metadata, + std::vector<uint8_t> account_key); + PairingMetadata(const PairingMetadata&); + PairingMetadata& operator=(const PairingMetadata&); PairingMetadata(PairingMetadata&&); ~PairingMetadata(); - const DeviceMetadata* device_metadata; - const std::vector<uint8_t> account_key; + DeviceMetadata* device_metadata; + std::vector<uint8_t> account_key; }; } // namespace quick_pair
diff --git a/ash/quick_pair/repository/fast_pair_repository_impl.cc b/ash/quick_pair/repository/fast_pair_repository_impl.cc index 164e1b86..94a2035 100644 --- a/ash/quick_pair/repository/fast_pair_repository_impl.cc +++ b/ash/quick_pair/repository/fast_pair_repository_impl.cc
@@ -157,6 +157,7 @@ DeviceMetadata* device_metadata) { if (!device_metadata) { std::move(callback).Run(absl::nullopt); + return; } std::move(callback).Run( PairingMetadata(device_metadata, std::move(account_key)));
diff --git a/ash/system/bluetooth/bluetooth_detailed_view_controller.cc b/ash/system/bluetooth/bluetooth_detailed_view_controller.cc index c86f4f9..9782dd99 100644 --- a/ash/system/bluetooth/bluetooth_detailed_view_controller.cc +++ b/ash/system/bluetooth/bluetooth_detailed_view_controller.cc
@@ -12,7 +12,6 @@ #include "ash/system/model/system_tray_model.h" #include "base/check.h" #include "chromeos/services/bluetooth_config/public/cpp/cros_bluetooth_config_util.h" -#include "mojo/public/cpp/bindings/clone_traits.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/l10n/l10n_util.h" #include "ui/views/view.h" @@ -20,7 +19,6 @@ namespace ash { namespace { using chromeos::bluetooth_config::IsBluetoothEnabledOrEnabling; -using chromeos::bluetooth_config::mojom::DeviceConnectionState; } // namespace BluetoothDetailedViewController::BluetoothDetailedViewController( @@ -47,11 +45,6 @@ bluetooth_detailed_view.get()); BluetoothEnabledStateChanged(); - if (IsBluetoothEnabledOrEnabling(system_state_)) { - device_list_controller_->UpdateDeviceList(connected_devices_, - previously_connected_devices_); - } - // We are expected to return an unowned pointer that the caller is responsible // for deleting. return bluetooth_detailed_view.release()->GetAsView(); @@ -71,22 +64,6 @@ if (has_bluetooth_enabled_state_changed) BluetoothEnabledStateChanged(); - - connected_devices_.clear(); - previously_connected_devices_.clear(); - - for (auto& paired_device : properties->paired_devices) { - if (paired_device->device_properties->connection_state == - DeviceConnectionState::kConnected) { - connected_devices_.push_back(std::move(paired_device)); - } else { - previously_connected_devices_.push_back(std::move(paired_device)); - } - } - if (device_list_controller_ && IsBluetoothEnabledOrEnabling(system_state_)) { - device_list_controller_->UpdateDeviceList(connected_devices_, - previously_connected_devices_); - } } void BluetoothDetailedViewController::OnToggleClicked(bool new_state) {
diff --git a/ash/system/bluetooth/bluetooth_detailed_view_controller.h b/ash/system/bluetooth/bluetooth_detailed_view_controller.h index b4ee723f..412d961d 100644 --- a/ash/system/bluetooth/bluetooth_detailed_view_controller.h +++ b/ash/system/bluetooth/bluetooth_detailed_view_controller.h
@@ -7,7 +7,6 @@ #include <memory> #include <string> -#include <vector> #include "ash/ash_export.h" #include "ash/system/bluetooth/bluetooth_detailed_view.h" @@ -42,10 +41,6 @@ const BluetoothDetailedViewController&) = delete; ~BluetoothDetailedViewController() override; - protected: - using PairedBluetoothDevicePropertiesPtrs = std::vector< - chromeos::bluetooth_config::mojom::PairedBluetoothDevicePropertiesPtr>; - private: // DetailedViewControllerBase: views::View* CreateView() override; @@ -78,8 +73,6 @@ chromeos::bluetooth_config::mojom::BluetoothSystemState::kUnavailable; tray::BluetoothDetailedView* view_ = nullptr; std::unique_ptr<BluetoothDeviceListController> device_list_controller_; - PairedBluetoothDevicePropertiesPtrs connected_devices_; - PairedBluetoothDevicePropertiesPtrs previously_connected_devices_; }; } // namespace ash
diff --git a/ash/system/bluetooth/bluetooth_detailed_view_controller_unittest.cc b/ash/system/bluetooth/bluetooth_detailed_view_controller_unittest.cc index dc06172c..5fa4c51 100644 --- a/ash/system/bluetooth/bluetooth_detailed_view_controller_unittest.cc +++ b/ash/system/bluetooth/bluetooth_detailed_view_controller_unittest.cc
@@ -5,7 +5,6 @@ #include "ash/system/bluetooth/bluetooth_detailed_view_controller.h" #include <memory> -#include <vector> #include "ash/constants/ash_features.h" #include "ash/public/cpp/test/test_system_tray_client.h" @@ -18,21 +17,15 @@ #include "base/run_loop.h" #include "base/test/scoped_feature_list.h" #include "chromeos/services/bluetooth_config/fake_adapter_state_controller.h" -#include "chromeos/services/bluetooth_config/fake_device_cache.h" #include "chromeos/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom.h" #include "chromeos/services/bluetooth_config/scoped_bluetooth_config_test_helper.h" -#include "mojo/public/cpp/bindings/clone_traits.h" namespace ash { namespace tray { namespace { using chromeos::bluetooth_config::AdapterStateController; -using chromeos::bluetooth_config::mojom::BluetoothDeviceProperties; using chromeos::bluetooth_config::mojom::BluetoothSystemState; -using chromeos::bluetooth_config::mojom::DeviceConnectionState; -using chromeos::bluetooth_config::mojom::PairedBluetoothDeviceProperties; -using chromeos::bluetooth_config::mojom::PairedBluetoothDevicePropertiesPtr; class FakeBluetoothDetailedViewFactory : public BluetoothDetailedView::Factory { public: @@ -128,22 +121,6 @@ ->GetAdapterState(); } - PairedBluetoothDevicePropertiesPtr CreatePairedDevice( - DeviceConnectionState connection_state) { - PairedBluetoothDevicePropertiesPtr paired_properties = - PairedBluetoothDeviceProperties::New(); - paired_properties->device_properties = BluetoothDeviceProperties::New(); - paired_properties->device_properties->connection_state = connection_state; - return paired_properties; - } - - void SetPairedDevices( - std::vector<PairedBluetoothDevicePropertiesPtr> paired_devices) { - scoped_bluetooth_config_test_helper_.fake_device_cache()->SetPairedDevices( - std::move(paired_devices)); - base::RunLoop().RunUntilIdle(); - } - void SetBluetoothAdapterState(BluetoothSystemState system_state) { scoped_bluetooth_config_test_helper_.fake_adapter_state_controller() ->SetSystemState(system_state); @@ -223,28 +200,5 @@ EXPECT_EQ(1, GetSystemTrayClient()->show_bluetooth_pairing_dialog_count()); } -TEST_F(BluetoothDetailedViewControllerTest, - CorrectlySplitsDevicesByConnectionState) { - std::vector<PairedBluetoothDevicePropertiesPtr> paired_devices; - paired_devices.push_back( - CreatePairedDevice(DeviceConnectionState::kNotConnected)); - paired_devices.push_back( - CreatePairedDevice(DeviceConnectionState::kConnecting)); - paired_devices.push_back( - CreatePairedDevice(DeviceConnectionState::kConnected)); - - EXPECT_EQ(0u, bluetooth_device_list_controller()->connected_devices_count()); - EXPECT_EQ( - 0u, - bluetooth_device_list_controller()->previously_connected_devices_count()); - - SetPairedDevices(std::move(paired_devices)); - - EXPECT_EQ(1u, bluetooth_device_list_controller()->connected_devices_count()); - EXPECT_EQ( - 2u, - bluetooth_device_list_controller()->previously_connected_devices_count()); -} - } // namespace tray } // namespace ash
diff --git a/ash/system/bluetooth/bluetooth_detailed_view_impl.cc b/ash/system/bluetooth/bluetooth_detailed_view_impl.cc index 5529751..9a4f6c1 100644 --- a/ash/system/bluetooth/bluetooth_detailed_view_impl.cc +++ b/ash/system/bluetooth/bluetooth_detailed_view_impl.cc
@@ -97,11 +97,6 @@ return scroll_content(); } -void BluetoothDetailedViewImpl::HandleViewClicked(views::View* view) { - delegate()->OnDeviceListItemSelected( - static_cast<BluetoothDeviceListItemView*>(view)->device_properties()); -} - const char* BluetoothDetailedViewImpl::GetClassName() const { return "BluetoothDetailedViewImpl"; }
diff --git a/ash/system/bluetooth/bluetooth_detailed_view_impl.h b/ash/system/bluetooth/bluetooth_detailed_view_impl.h index b12f8b7..ebd4e1bb 100644 --- a/ash/system/bluetooth/bluetooth_detailed_view_impl.h +++ b/ash/system/bluetooth/bluetooth_detailed_view_impl.h
@@ -58,9 +58,6 @@ void NotifyDeviceListChanged() override; views::View* device_list() override; - // TrayDetailedView: - void HandleViewClicked(views::View* view) override; - // views::View: const char* GetClassName() const override;
diff --git a/ash/system/bluetooth/bluetooth_detailed_view_unittest.cc b/ash/system/bluetooth/bluetooth_detailed_view_unittest.cc index 40f3640..6271baf50 100644 --- a/ash/system/bluetooth/bluetooth_detailed_view_unittest.cc +++ b/ash/system/bluetooth/bluetooth_detailed_view_unittest.cc
@@ -10,7 +10,6 @@ #include "ash/public/cpp/test/test_system_tray_client.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/bluetooth/bluetooth_detailed_view_impl.h" -#include "ash/system/bluetooth/bluetooth_device_list_item_view.h" #include "ash/system/bluetooth/bluetooth_disabled_detailed_view.h" #include "ash/system/tray/detailed_view_delegate.h" #include "ash/system/unified/top_shortcut_button.h" @@ -36,9 +35,6 @@ namespace tray { namespace { -const std::string kDeviceNickname = "mau5"; - -using chromeos::bluetooth_config::mojom::PairedBluetoothDeviceProperties; using chromeos::bluetooth_config::mojom::PairedBluetoothDevicePropertiesPtr; class FakeBluetoothDetailedViewDelegate @@ -298,28 +294,5 @@ EXPECT_EQ(view_center, button_center.y()); } -TEST_F(BluetoothDetailedViewTest, SelectingDeviceListItemNotifiesDelegate) { - bluetooth_detailed_view()->UpdateBluetoothEnabledState(true); - - PairedBluetoothDevicePropertiesPtr paired_properties = - PairedBluetoothDeviceProperties::New(); - paired_properties->nickname = kDeviceNickname; - - BluetoothDeviceListItemView* device_list_item = - bluetooth_detailed_view()->AddDeviceListItem(); - device_list_item->UpdateDeviceProperties(paired_properties); - - bluetooth_detailed_view()->NotifyDeviceListChanged(); - - EXPECT_FALSE( - bluetooth_detailed_view_delegate()->last_device_list_item_selected()); - ClickOnAndWait(device_list_item); - EXPECT_TRUE( - bluetooth_detailed_view_delegate()->last_device_list_item_selected()); - EXPECT_EQ(kDeviceNickname, bluetooth_detailed_view_delegate() - ->last_device_list_item_selected() - ->nickname); -} - } // namespace tray } // namespace ash
diff --git a/ash/system/bluetooth/bluetooth_device_list_controller_impl.cc b/ash/system/bluetooth/bluetooth_device_list_controller_impl.cc index c332887..695fef46 100644 --- a/ash/system/bluetooth/bluetooth_device_list_controller_impl.cc +++ b/ash/system/bluetooth/bluetooth_device_list_controller_impl.cc
@@ -7,32 +7,12 @@ #include "ash/constants/ash_features.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/bluetooth/bluetooth_detailed_view.h" -#include "ash/system/bluetooth/bluetooth_device_list_item_view.h" -#include "ash/system/tray/tray_popup_utils.h" #include "ash/system/tray/tri_view.h" #include "base/check.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/views/controls/separator.h" #include "ui/views/view.h" namespace ash { -namespace { - -// Helper function to remove |*view| from its view hierarchy, delete the view, -// and reset the value of |*view| to be |nullptr|. -template <class T> -void RemoveAndResetViewIfExists(T** view) { - DCHECK(view); - - views::View* parent = (*view)->parent(); - - if (*view && parent) { - parent->RemoveChildViewT(*view); - *view = nullptr; - } -} - -} // namespace BluetoothDeviceListControllerImpl::BluetoothDeviceListControllerImpl( tray::BluetoothDetailedView* bluetooth_detailed_view) @@ -40,19 +20,10 @@ DCHECK(ash::features::IsBluetoothRevampEnabled()); } -BluetoothDeviceListControllerImpl::~BluetoothDeviceListControllerImpl() = - default; - void BluetoothDeviceListControllerImpl::UpdateBluetoothEnabledState( bool enabled) { - if (is_bluetooth_enabled_ && !enabled) { - device_id_to_view_map_.clear(); - device_list_separator_ = nullptr; - connected_sub_header_ = nullptr; - no_device_connected_sub_header_ = nullptr; - previously_connected_sub_header_ = nullptr; + if (is_bluetooth_enabled_ && !enabled) bluetooth_detailed_view_->device_list()->RemoveAllChildViews(); - } is_bluetooth_enabled_ = enabled; } @@ -60,89 +31,16 @@ const PairedBluetoothDevicePropertiesPtrs& connected, const PairedBluetoothDevicePropertiesPtrs& previously_connected) { DCHECK(is_bluetooth_enabled_); - - // This function will create views for new devices, re-use views for existing - // devices, and remove views for devices that no longer exist. To do this, we - // keep track of all the preexisting views in |previous_views|, removing a - // view from this map when the corresponding device is found in |connected| or - // |previously_connected|. Before returning, any view remaining in - // |previous_views| is no longer needed and is deleted. - base::flat_map<std::string, BluetoothDeviceListItemView*> previous_views = - std::move(device_id_to_view_map_); - device_id_to_view_map_.clear(); - - // Since we re-use views when possible, we need to re-order them to match the - // order of the devices we are provided with. We use |index| to keep track of - // the next index within the device list where a view should be placed, i.e. - // all views before |index| are in their final position. - int index = 0; - - // The list of connected devices. - if (!connected.empty()) { - connected_sub_header_ = CreateSubHeaderIfMissingAndReorder( - connected_sub_header_, - IDS_ASH_STATUS_TRAY_BLUETOOTH_CURRENTLY_CONNECTED_DEVICES, index); - - // Increment |index| since this position was taken by - // |connected_sub_header_|. - index++; - - index = CreateViewsIfMissingAndReorder(connected, &previous_views, index); - } else { - RemoveAndResetViewIfExists(&connected_sub_header_); - } - - // The separator between the connected and previously connected devices. - if (!connected.empty() && !previously_connected.empty()) { - if (!device_list_separator_) { - device_list_separator_ = - bluetooth_detailed_view_->device_list()->AddChildView( - TrayPopupUtils::CreateListSubHeaderSeparator()); - } - bluetooth_detailed_view_->device_list()->ReorderChildView( - device_list_separator_, index); - - // Increment |index| since this position was taken by - // |device_list_separator_|. - index++; - } else { - RemoveAndResetViewIfExists(&device_list_separator_); - } - - // The previously connected devices. - if (!previously_connected.empty()) { - previously_connected_sub_header_ = CreateSubHeaderIfMissingAndReorder( - previously_connected_sub_header_, - IDS_ASH_STATUS_TRAY_BLUETOOTH_PREVIOUSLY_CONNECTED_DEVICES, index); - - // Increment |index| since this position was taken by - // |previously_connected_sub_header_|. - index++; - - // Ignore the returned index since we are now done re-ordering the list. - CreateViewsIfMissingAndReorder(previously_connected, &previous_views, - index); - } else { - RemoveAndResetViewIfExists(&previously_connected_sub_header_); - } - - // The header when there are no connected or previously connected devices. - if (device_id_to_view_map_.empty()) { - no_device_connected_sub_header_ = CreateSubHeaderIfMissingAndReorder( - no_device_connected_sub_header_, - IDS_ASH_STATUS_TRAY_BLUETOOTH_NO_DEVICE_CONNECTED, index); - } else { - RemoveAndResetViewIfExists(&no_device_connected_sub_header_); - } - - for (const auto& id_and_view : previous_views) { - bluetooth_detailed_view_->device_list()->RemoveChildViewT( - id_and_view.second); - } + currently_connected_devices_sub_header_ = AddOrReorderSubHeader( + currently_connected_devices_sub_header_, + IDS_ASH_STATUS_TRAY_BLUETOOTH_CURRENTLY_CONNECTED_DEVICES, 1); + previously_connected_devices_sub_header_ = AddOrReorderSubHeader( + previously_connected_devices_sub_header_, + IDS_ASH_STATUS_TRAY_BLUETOOTH_PREVIOUSLY_CONNECTED_DEVICES, 2); bluetooth_detailed_view_->NotifyDeviceListChanged(); } -TriView* BluetoothDeviceListControllerImpl::CreateSubHeaderIfMissingAndReorder( +TriView* BluetoothDeviceListControllerImpl::AddOrReorderSubHeader( TriView* sub_header, int text_id, int index) { @@ -154,34 +52,4 @@ return sub_header; } -int BluetoothDeviceListControllerImpl::CreateViewsIfMissingAndReorder( - const PairedBluetoothDevicePropertiesPtrs& device_property_list, - base::flat_map<std::string, BluetoothDeviceListItemView*>* previous_views, - int index) { - DCHECK(previous_views); - - BluetoothDeviceListItemView* device_view = nullptr; - - for (const auto& device_properties : device_property_list) { - const std::string& device_id = device_properties->device_properties->id; - auto it = previous_views->find(device_id); - - if (it == previous_views->end()) { - device_view = bluetooth_detailed_view_->AddDeviceListItem(); - } else { - device_view = it->second; - previous_views->erase(it); - } - device_id_to_view_map_.emplace(device_id, device_view); - - device_view->UpdateDeviceProperties(device_properties); - bluetooth_detailed_view_->device_list()->ReorderChildView(device_view, - index); - - // Increment |index| since this position was taken by |device_view|. - index++; - } - return index; -} - } // namespace ash
diff --git a/ash/system/bluetooth/bluetooth_device_list_controller_impl.h b/ash/system/bluetooth/bluetooth_device_list_controller_impl.h index 787747a..687a047 100644 --- a/ash/system/bluetooth/bluetooth_device_list_controller_impl.h +++ b/ash/system/bluetooth/bluetooth_device_list_controller_impl.h
@@ -5,24 +5,15 @@ #ifndef ASH_SYSTEM_BLUETOOTH_BLUETOOTH_DEVICE_LIST_CONTROLLER_IMPL_H_ #define ASH_SYSTEM_BLUETOOTH_BLUETOOTH_DEVICE_LIST_CONTROLLER_IMPL_H_ -#include <string> -#include <vector> - #include "ash/ash_export.h" #include "ash/system/bluetooth/bluetooth_device_list_controller.h" -#include "base/containers/flat_map.h" #include "chromeos/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom.h" -namespace views { -class Separator; -} // namespace views - namespace ash { namespace tray { class BluetoothDetailedView; } // namespace tray -class BluetoothDeviceListItemView; class TriView; // BluetoothDeviceListController implementation. @@ -35,44 +26,25 @@ delete; BluetoothDeviceListControllerImpl& operator=( const BluetoothDeviceListControllerImpl&) = delete; - ~BluetoothDeviceListControllerImpl() override; + ~BluetoothDeviceListControllerImpl() override = default; private: - friend class BluetoothDeviceListControllerTest; - // BluetoothDeviceListController: void UpdateBluetoothEnabledState(bool enabled) override; void UpdateDeviceList( const PairedBluetoothDevicePropertiesPtrs& connected, const PairedBluetoothDevicePropertiesPtrs& previously_connected) override; - // Creates a sub-header with text represented by the |text_id| message ID when - // |sub_header| is |nullptr|, otherwise uses the provided |sub_header|. The - // used sub-header is then moved to index |index| within the device list and - // returned. - TriView* CreateSubHeaderIfMissingAndReorder(TriView* sub_header, - int text_id, - int index); - - // Creates and initializes a view for each of the device properties within - // |device_property_list| if a view does not already exist, otherwise re-using - // the existing view to avoid disrupting a11y. Each view will be reordered to - // start at |index| and will be removed from |previous_views|. The index of - // the position after the final view that was added is returned. - int CreateViewsIfMissingAndReorder( - const PairedBluetoothDevicePropertiesPtrs& device_property_list, - base::flat_map<std::string, BluetoothDeviceListItemView*>* previous_views, - int index); + // Adds a new sub-header with |text_id| if |sub_header| is |nullptr|, + // otherwise reuses |sub_header|. Whichever sub-header used is then reordered + // to |index| and returned. + TriView* AddOrReorderSubHeader(TriView* sub_header, int text_id, int index); tray::BluetoothDetailedView* bluetooth_detailed_view_; bool is_bluetooth_enabled_ = false; - base::flat_map<std::string, BluetoothDeviceListItemView*> - device_id_to_view_map_; - views::Separator* device_list_separator_ = nullptr; - TriView* connected_sub_header_ = nullptr; - TriView* no_device_connected_sub_header_ = nullptr; - TriView* previously_connected_sub_header_ = nullptr; + TriView* currently_connected_devices_sub_header_ = nullptr; + TriView* previously_connected_devices_sub_header_ = nullptr; }; } // namespace ash
diff --git a/ash/system/bluetooth/bluetooth_device_list_controller_unittest.cc b/ash/system/bluetooth/bluetooth_device_list_controller_unittest.cc index f619098..43af681d 100644 --- a/ash/system/bluetooth/bluetooth_device_list_controller_unittest.cc +++ b/ash/system/bluetooth/bluetooth_device_list_controller_unittest.cc
@@ -5,35 +5,14 @@ #include "ash/system/bluetooth/bluetooth_device_list_controller_impl.h" #include <memory> -#include <string> -#include <vector> #include "ash/constants/ash_features.h" -#include "ash/strings/grit/ash_strings.h" #include "ash/system/bluetooth/bluetooth_detailed_view.h" -#include "ash/system/bluetooth/bluetooth_device_list_item_view.h" #include "ash/system/bluetooth/fake_bluetooth_detailed_view.h" -#include "ash/system/tray/tri_view.h" #include "ash/test/ash_test_base.h" #include "base/test/scoped_feature_list.h" -#include "chromeos/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/views/controls/label.h" -#include "ui/views/controls/separator.h" namespace ash { -namespace { - -using chromeos::bluetooth_config::mojom::BluetoothDeviceProperties; -using chromeos::bluetooth_config::mojom::DeviceConnectionState; -using chromeos::bluetooth_config::mojom::PairedBluetoothDeviceProperties; -using chromeos::bluetooth_config::mojom::PairedBluetoothDevicePropertiesPtr; - -const char kDeviceId1[] = "/device/id/1"; -const char kDeviceId2[] = "/device/id/2"; -const char kDeviceNickname[] = "mau5"; - -} // namespace class BluetoothDeviceListControllerTest : public AshTestBase { public: @@ -51,140 +30,15 @@ void TearDown() override { AshTestBase::TearDown(); } - const TriView* FindConnectedSubHeader() { - return FindSubHeaderWithText(l10n_util::GetStringUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_CURRENTLY_CONNECTED_DEVICES)); - } - - const TriView* FindPreviouslyConnectedSubHeader() { - return FindSubHeaderWithText(l10n_util::GetStringUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_PREVIOUSLY_CONNECTED_DEVICES)); - } - - const TriView* FindNoDeviceConnectedSubHeader() { - return FindSubHeaderWithText(l10n_util::GetStringUTF16( - IDS_ASH_STATUS_TRAY_BLUETOOTH_NO_DEVICE_CONNECTED)); - } - - const views::Separator* FindSeparator() { - for (const auto* view : device_list()->children()) { - if (!std::strcmp("Separator", view->GetClassName())) - return static_cast<const views::Separator*>(view); - } - return nullptr; - } - - PairedBluetoothDevicePropertiesPtr BuildDeviceProperties( - const std::string& id) { - PairedBluetoothDevicePropertiesPtr device_properties = - PairedBluetoothDeviceProperties::New(); - device_properties->device_properties = BluetoothDeviceProperties::New(); - device_properties->device_properties->id = id; - return device_properties; - } - - const std::u16string& GetSubHeaderText(const TriView* sub_header) { - EXPECT_TRUE(sub_header); - EXPECT_EQ(1u, sub_header->children().at(1)->children().size()); - return static_cast<views::Label*>( - sub_header->children().at(1)->children().at(0)) - ->GetText(); - } - - const char* GetDeviceId(const BluetoothDeviceListItemView* device_item_view) { - return device_item_view->device_properties()->device_properties->id.c_str(); - } - - const BluetoothDeviceListItemView* GetFirstDeviceView() { - EXPECT_LT(1u, device_list()->children().size()); - return static_cast<BluetoothDeviceListItemView*>( - device_list()->children().at(1)); - } - - void CheckDeviceListOrdering(size_t connected_device_count, - size_t previously_connected_device_count) { - if (connected_device_count && previously_connected_device_count) { - const TriView* connected_sub_header = FindConnectedSubHeader(); - const TriView* previously_connected_sub_header = - FindPreviouslyConnectedSubHeader(); - const views::Separator* device_list_separator = FindSeparator(); - - EXPECT_TRUE(connected_sub_header); - EXPECT_TRUE(previously_connected_sub_header); - EXPECT_TRUE(device_list_separator); - - const unsigned int connected_index = - device_list()->GetIndexOf(connected_sub_header); - const unsigned int previously_connected_index = - device_list()->GetIndexOf(previously_connected_sub_header); - const unsigned int separator_index = - device_list()->GetIndexOf(device_list_separator); - - EXPECT_EQ(0u, connected_index); - EXPECT_EQ(connected_device_count + 1, separator_index); - EXPECT_EQ(separator_index + 1, previously_connected_index); - return; - } - - if (connected_device_count) { - const TriView* connected_sub_header = FindConnectedSubHeader(); - EXPECT_TRUE(connected_sub_header); - EXPECT_EQ(0, device_list()->GetIndexOf(connected_sub_header)); - EXPECT_EQ(connected_device_count + 1, device_list()->children().size()); - return; - } - - if (previously_connected_device_count) { - const TriView* previously_connected_sub_header = - FindPreviouslyConnectedSubHeader(); - EXPECT_TRUE(previously_connected_sub_header); - EXPECT_EQ(0, device_list()->GetIndexOf(previously_connected_sub_header)); - EXPECT_EQ(previously_connected_device_count + 1, - device_list()->children().size()); - return; - } - - const TriView* no_device_connected_sub_header = - FindNoDeviceConnectedSubHeader(); - EXPECT_TRUE(no_device_connected_sub_header); - EXPECT_EQ(0, device_list()->GetIndexOf(no_device_connected_sub_header)); - EXPECT_EQ(1u, device_list()->children().size()); - } - - void CheckNotifyDeviceListChangedCount(size_t call_count) { - EXPECT_EQ(call_count, fake_bluetooth_detailed_view() - ->notify_device_list_changed_call_count()); - } - - views::View* device_list() { - return static_cast<tray::BluetoothDetailedView*>( - fake_bluetooth_detailed_view_.get()) - ->device_list(); + tray::BluetoothDetailedView* bluetooth_detailed_view() { + return fake_bluetooth_detailed_view_.get(); } BluetoothDeviceListController* bluetooth_device_list_controller() { return bluetooth_device_list_controller_impl_.get(); } - tray::FakeBluetoothDetailedView* fake_bluetooth_detailed_view() { - return fake_bluetooth_detailed_view_.get(); - } - - protected: - const std::vector<PairedBluetoothDevicePropertiesPtr> empty_list_; - private: - const TriView* FindSubHeaderWithText(const std::u16string text) { - for (const auto* view : device_list()->children()) { - if (std::strcmp("TriView", view->GetClassName())) - continue; - const TriView* sub_header = static_cast<const TriView*>(view); - if (GetSubHeaderText(sub_header) == text) - return sub_header; - } - return nullptr; - } - base::test::ScopedFeatureList feature_list_; std::unique_ptr<tray::FakeBluetoothDetailedView> fake_bluetooth_detailed_view_; @@ -192,135 +46,8 @@ bluetooth_device_list_controller_impl_; }; -TEST_F(BluetoothDeviceListControllerTest, - HasCorrectSubHeaderWithNoPairedDevices) { - CheckNotifyDeviceListChangedCount(/*call_count=*/0u); - - bluetooth_device_list_controller()->UpdateBluetoothEnabledState(true); - bluetooth_device_list_controller()->UpdateDeviceList( - /*connected=*/empty_list_, - /*previously_connected=*/empty_list_); - CheckNotifyDeviceListChangedCount(/*call_count=*/1u); - - EXPECT_EQ(1u, device_list()->children().size()); - - const TriView* no_device_connected_sub_header = - FindNoDeviceConnectedSubHeader(); - EXPECT_TRUE(no_device_connected_sub_header); -} - -TEST_F(BluetoothDeviceListControllerTest, - HasCorrectDeviceListOrderWithPairedDevices) { - CheckNotifyDeviceListChangedCount(/*call_count=*/0u); - - bluetooth_device_list_controller()->UpdateBluetoothEnabledState(true); - - std::vector<PairedBluetoothDevicePropertiesPtr> connected_list; - connected_list.push_back(BuildDeviceProperties(kDeviceId1)); - - bluetooth_device_list_controller()->UpdateDeviceList( - /*connected=*/connected_list, - /*previously_connected=*/empty_list_); - CheckNotifyDeviceListChangedCount(/*call_count=*/1u); - - const TriView* connected_devices_sub_header = FindConnectedSubHeader(); - - EXPECT_EQ(2u, device_list()->children().size()); - EXPECT_STREQ(kDeviceId1, GetDeviceId(GetFirstDeviceView())); - EXPECT_TRUE(connected_devices_sub_header); - - CheckDeviceListOrdering( - /*connected_device_count=*/connected_list.size(), - /*previously_connected_device_count=*/empty_list_.size()); - - std::vector<PairedBluetoothDevicePropertiesPtr> previously_connected_list; - previously_connected_list.push_back(BuildDeviceProperties(kDeviceId2)); - - bluetooth_device_list_controller()->UpdateDeviceList( - /*connected=*/empty_list_, - /*previously_connected=*/previously_connected_list); - CheckNotifyDeviceListChangedCount(/*call_count=*/2u); - - const TriView* previously_connected_devices_sub_header = - FindPreviouslyConnectedSubHeader(); - - EXPECT_EQ(2u, device_list()->children().size()); - EXPECT_STREQ(kDeviceId2, GetDeviceId(GetFirstDeviceView())); - EXPECT_TRUE(previously_connected_devices_sub_header); - - CheckDeviceListOrdering( - /*connected_device_count=*/0, - /*previously_connected_device_count=*/previously_connected_list.size()); - - // "Update" the device list multiple times to be sure that no children are - // duplicated and every child is re-ordered correctly. - for (int i = 0; i < 2; i++) { - bluetooth_device_list_controller()->UpdateDeviceList( - /*connected=*/connected_list, - /*previously_connected=*/previously_connected_list); - } - - CheckNotifyDeviceListChangedCount(/*call_count=*/4u); - - EXPECT_EQ(5u, device_list()->children().size()); - - CheckDeviceListOrdering( - /*connected_device_count=*/connected_list.size(), - /*previously_connected_device_count=*/previously_connected_list.size()); -} - -TEST_F(BluetoothDeviceListControllerTest, ExistingDeviceViewsAreUpdated) { - CheckNotifyDeviceListChangedCount(/*call_count=*/0u); - - bluetooth_device_list_controller()->UpdateBluetoothEnabledState(true); - - std::vector<PairedBluetoothDevicePropertiesPtr> connected_list; - connected_list.push_back(BuildDeviceProperties(kDeviceId1)); - - bluetooth_device_list_controller()->UpdateDeviceList( - /*connected=*/connected_list, - /*previously_connected=*/empty_list_); - CheckNotifyDeviceListChangedCount(/*call_count=*/1u); - - EXPECT_EQ(2u, device_list()->children().size()); - - const BluetoothDeviceListItemView* first_item = GetFirstDeviceView(); - - EXPECT_FALSE(first_item->device_properties()->nickname.has_value()); - - connected_list.at(0)->nickname = kDeviceNickname; - - bluetooth_device_list_controller()->UpdateDeviceList( - /*connected=*/connected_list, - /*previously_connected=*/empty_list_); - CheckNotifyDeviceListChangedCount(/*call_count=*/2u); - - EXPECT_EQ(2u, device_list()->children().size()); - EXPECT_EQ(1, device_list()->GetIndexOf(first_item)); - EXPECT_TRUE(first_item->device_properties()->nickname.has_value()); - EXPECT_STREQ(kDeviceNickname, - first_item->device_properties()->nickname.value().c_str()); -} - -TEST_F(BluetoothDeviceListControllerTest, - DeviceListIsClearedWhenBluetoothBecomesDisabled) { - CheckNotifyDeviceListChangedCount(/*call_count=*/0u); - - bluetooth_device_list_controller()->UpdateBluetoothEnabledState(true); - - std::vector<PairedBluetoothDevicePropertiesPtr> connected_list; - connected_list.push_back(BuildDeviceProperties(kDeviceId1)); - - bluetooth_device_list_controller()->UpdateDeviceList( - /*connected=*/connected_list, - /*previously_connected=*/empty_list_); - CheckNotifyDeviceListChangedCount(/*call_count=*/1u); - - EXPECT_EQ(2u, device_list()->children().size()); - - bluetooth_device_list_controller()->UpdateBluetoothEnabledState(false); - - EXPECT_EQ(0u, device_list()->children().size()); +TEST_F(BluetoothDeviceListControllerTest, CanConstruct) { + EXPECT_TRUE(true); } } // namespace ash
diff --git a/ash/system/bluetooth/bluetooth_device_list_item_view.cc b/ash/system/bluetooth/bluetooth_device_list_item_view.cc index f950a9d..b4abc9bd 100644 --- a/ash/system/bluetooth/bluetooth_device_list_item_view.cc +++ b/ash/system/bluetooth/bluetooth_device_list_item_view.cc
@@ -26,8 +26,4 @@ device_properties_ = mojo::Clone(device_properties); } -const char* BluetoothDeviceListItemView::GetClassName() const { - return "BluetoothDeviceListItemView"; -} - } // namespace ash
diff --git a/ash/system/bluetooth/bluetooth_device_list_item_view.h b/ash/system/bluetooth/bluetooth_device_list_item_view.h index f08d7739..e70b57c 100644 --- a/ash/system/bluetooth/bluetooth_device_list_item_view.h +++ b/ash/system/bluetooth/bluetooth_device_list_item_view.h
@@ -34,9 +34,6 @@ } private: - // views::View: - const char* GetClassName() const override; - chromeos::bluetooth_config::mojom::PairedBluetoothDevicePropertiesPtr device_properties_; };
diff --git a/ash/system/bluetooth/fake_bluetooth_detailed_view.cc b/ash/system/bluetooth/fake_bluetooth_detailed_view.cc index 059f2a3c..9f978157 100644 --- a/ash/system/bluetooth/fake_bluetooth_detailed_view.cc +++ b/ash/system/bluetooth/fake_bluetooth_detailed_view.cc
@@ -6,15 +6,13 @@ #include "ash/system/bluetooth/bluetooth_device_list_item_view.h" #include "ash/system/tray/tri_view.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/views/controls/label.h" namespace ash { namespace tray { FakeBluetoothDetailedView::FakeBluetoothDetailedView(Delegate* delegate) : BluetoothDetailedView(delegate), - device_list_(std::make_unique<views::View>()) {} + device_list_(std::make_unique<views::ScrollView>()) {} FakeBluetoothDetailedView::~FakeBluetoothDetailedView() = default; @@ -32,13 +30,9 @@ } ash::TriView* FakeBluetoothDetailedView::AddDeviceListSubHeader( - const gfx::VectorIcon& /*icon*/, - int text_id) { - std::unique_ptr<TriView> sub_header = std::make_unique<TriView>(); - sub_header->AddView(TriView::Container::CENTER, - new views::Label(l10n_util::GetStringUTF16(text_id))); - device_list_->AddChildView(sub_header.get()); - return sub_header.release(); + const gfx::VectorIcon&, + int) { + return device_list_->AddChildView(new ash::TriView()); } void FakeBluetoothDetailedView::NotifyDeviceListChanged() { @@ -46,7 +40,7 @@ } views::View* FakeBluetoothDetailedView::device_list() { - return device_list_.get(); + return device_list_->contents(); } } // namespace tray
diff --git a/ash/system/bluetooth/fake_bluetooth_detailed_view.h b/ash/system/bluetooth/fake_bluetooth_detailed_view.h index 59745f4..197bf4d 100644 --- a/ash/system/bluetooth/fake_bluetooth_detailed_view.h +++ b/ash/system/bluetooth/fake_bluetooth_detailed_view.h
@@ -11,6 +11,7 @@ #include "ash/system/bluetooth/bluetooth_detailed_view.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/gfx/vector_icon_types.h" +#include "ui/views/controls/scroll_view.h" namespace views { class View; @@ -46,13 +47,13 @@ void UpdateBluetoothEnabledState(bool enabled) override; BluetoothDeviceListItemView* AddDeviceListItem() override; ash::TriView* AddDeviceListSubHeader(const gfx::VectorIcon& /*icon*/, - int text_id) override; + int /*text_id*/) override; void NotifyDeviceListChanged() override; views::View* device_list() override; size_t notify_device_list_changed_call_count_ = 0; absl::optional<bool> last_bluetooth_enabled_state_; - std::unique_ptr<views::View> device_list_; + std::unique_ptr<views::ScrollView> device_list_; }; } // namespace tray
diff --git a/ash/webui/diagnostics_ui/resources/routine_group.js b/ash/webui/diagnostics_ui/resources/routine_group.js index 89016620..318c051 100644 --- a/ash/webui/diagnostics_ui/resources/routine_group.js +++ b/ash/webui/diagnostics_ui/resources/routine_group.js
@@ -105,7 +105,7 @@ * @return {boolean} */ testFailed_(result) { - return getSimpleResult(result) !== StandardRoutineResult.kTestPassed; + return getSimpleResult(result) === StandardRoutineResult.kTestFailed; } /**
diff --git a/ash/webui/diagnostics_ui/resources/routine_section.js b/ash/webui/diagnostics_ui/resources/routine_section.js index e670603..16277b79 100644 --- a/ash/webui/diagnostics_ui/resources/routine_section.js +++ b/ash/webui/diagnostics_ui/resources/routine_section.js
@@ -361,7 +361,7 @@ } if (status.result && - getSimpleResult(status.result) !== StandardRoutineResult.kTestPassed && + getSimpleResult(status.result) === StandardRoutineResult.kTestFailed && !this.failedTest_) { this.failedTest_ = status.routine; }
diff --git a/base/base64url.h b/base/base64url.h index 66a4824..dd4c5a2 100644 --- a/base/base64url.h +++ b/base/base64url.h
@@ -9,7 +9,6 @@ #include "base/base_export.h" #include "base/compiler_specific.h" -#include "base/macros.h" #include "base/strings/string_piece.h" namespace base {
diff --git a/base/containers/circular_deque.h b/base/containers/circular_deque.h index 89c0bdf5..2e7fc67 100644 --- a/base/containers/circular_deque.h +++ b/base/containers/circular_deque.h
@@ -14,7 +14,6 @@ #include "base/as_const.h" #include "base/check_op.h" #include "base/containers/vector_buffer.h" -#include "base/macros.h" #include "base/ranges/algorithm.h" #include "base/template_util.h"
diff --git a/base/containers/span.h b/base/containers/span.h index c0a6a46..7f2a94c 100644 --- a/base/containers/span.h +++ b/base/containers/span.h
@@ -19,7 +19,6 @@ #include "base/containers/contiguous_iterator.h" #include "base/cxx17_backports.h" #include "base/cxx20_to_address.h" -#include "base/macros.h" #include "base/template_util.h" namespace base {
diff --git a/base/debug/leak_annotations.h b/base/debug/leak_annotations.h index 6a5bb1ab..b551552 100644 --- a/base/debug/leak_annotations.h +++ b/base/debug/leak_annotations.h
@@ -5,7 +5,6 @@ #ifndef BASE_DEBUG_LEAK_ANNOTATIONS_H_ #define BASE_DEBUG_LEAK_ANNOTATIONS_H_ -#include "base/macros.h" #include "build/build_config.h" // This file defines macros which can be used to annotate intentional memory
diff --git a/base/debug/stack_trace.h b/base/debug/stack_trace.h index 8d857ba..8f5ec6e6 100644 --- a/base/debug/stack_trace.h +++ b/base/debug/stack_trace.h
@@ -12,7 +12,6 @@ #include "base/base_export.h" #include "base/debug/debugging_buildflags.h" -#include "base/macros.h" #include "build/build_config.h" #if defined(OS_POSIX)
diff --git a/base/i18n/break_iterator.h b/base/i18n/break_iterator.h index 887d4824..365c1b1 100644 --- a/base/i18n/break_iterator.h +++ b/base/i18n/break_iterator.h
@@ -10,7 +10,6 @@ #include <string> #include "base/i18n/base_i18n_export.h" -#include "base/macros.h" #include "base/strings/string_piece.h" // The BreakIterator class iterates through the words, word breaks, and
diff --git a/base/memory/madv_free_discardable_memory_allocator_posix.h b/base/memory/madv_free_discardable_memory_allocator_posix.h index 369e653..c7a39f7 100644 --- a/base/memory/madv_free_discardable_memory_allocator_posix.h +++ b/base/memory/madv_free_discardable_memory_allocator_posix.h
@@ -13,7 +13,6 @@ #include "base/base_export.h" #include "base/bind.h" #include "base/callback.h" -#include "base/macros.h" #include "base/memory/discardable_memory.h" #include "base/memory/discardable_memory_allocator.h" #include "base/memory/madv_free_discardable_memory_posix.h"
diff --git a/base/memory/madv_free_discardable_memory_posix.h b/base/memory/madv_free_discardable_memory_posix.h index 6f96883..c2b7df84 100644 --- a/base/memory/madv_free_discardable_memory_posix.h +++ b/base/memory/madv_free_discardable_memory_posix.h
@@ -14,7 +14,6 @@ #include "base/base_export.h" #include "base/callback.h" #include "base/check_op.h" -#include "base/macros.h" #include "base/memory/discardable_memory.h" #include "base/sequence_checker.h" #include "base/threading/thread_collision_warner.h"
diff --git a/base/memory/memory_pressure_listener.h b/base/memory/memory_pressure_listener.h index 0a4d3c3..017988d 100644 --- a/base/memory/memory_pressure_listener.h +++ b/base/memory/memory_pressure_listener.h
@@ -13,7 +13,6 @@ #include "base/base_export.h" #include "base/callback.h" #include "base/location.h" -#include "base/macros.h" #include "base/tracing_buildflags.h" namespace base {
diff --git a/base/memory/memory_pressure_monitor.h b/base/memory/memory_pressure_monitor.h index f65778b..08d7045 100644 --- a/base/memory/memory_pressure_monitor.h +++ b/base/memory/memory_pressure_monitor.h
@@ -7,7 +7,6 @@ #include "base/base_export.h" #include "base/callback.h" -#include "base/macros.h" #include "base/memory/memory_pressure_listener.h" #include "base/time/time.h"
diff --git a/base/memory/platform_shared_memory_region.h b/base/memory/platform_shared_memory_region.h index f533ca0..f6958c3 100644 --- a/base/memory/platform_shared_memory_region.h +++ b/base/memory/platform_shared_memory_region.h
@@ -7,7 +7,6 @@ #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" -#include "base/macros.h" #include "base/unguessable_token.h" #include "build/build_config.h" @@ -192,6 +191,9 @@ // Move operations are allowed. PlatformSharedMemoryRegion(PlatformSharedMemoryRegion&&); PlatformSharedMemoryRegion& operator=(PlatformSharedMemoryRegion&&); + PlatformSharedMemoryRegion(const PlatformSharedMemoryRegion&) = delete; + PlatformSharedMemoryRegion& operator=(const PlatformSharedMemoryRegion&) = + delete; // Destructor closes the platform handle. Does nothing if the handle is // invalid. @@ -287,8 +289,6 @@ Mode mode_ = Mode::kReadOnly; size_t size_ = 0; UnguessableToken guid_; - - DISALLOW_COPY_AND_ASSIGN(PlatformSharedMemoryRegion); }; } // namespace subtle
diff --git a/base/memory/read_only_shared_memory_region.h b/base/memory/read_only_shared_memory_region.h index 9a86bbe4..f198561 100644 --- a/base/memory/read_only_shared_memory_region.h +++ b/base/memory/read_only_shared_memory_region.h
@@ -5,7 +5,6 @@ #ifndef BASE_MEMORY_READ_ONLY_SHARED_MEMORY_REGION_H_ #define BASE_MEMORY_READ_ONLY_SHARED_MEMORY_REGION_H_ -#include "base/macros.h" #include "base/memory/platform_shared_memory_region.h" #include "base/memory/shared_memory_mapping.h"
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h index 8c4814b..0274dd95 100644 --- a/base/memory/ref_counted.h +++ b/base/memory/ref_counted.h
@@ -14,7 +14,6 @@ #include "base/check_op.h" #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" -#include "base/macros.h" #include "base/memory/scoped_refptr.h" #include "base/sequence_checker.h" #include "base/template_util.h"
diff --git a/base/memory/ref_counted_delete_on_sequence.h b/base/memory/ref_counted_delete_on_sequence.h index dcdef48..98c26f3 100644 --- a/base/memory/ref_counted_delete_on_sequence.h +++ b/base/memory/ref_counted_delete_on_sequence.h
@@ -9,7 +9,6 @@ #include "base/check.h" #include "base/location.h" -#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/sequenced_task_runner.h"
diff --git a/base/memory/ref_counted_memory.h b/base/memory/ref_counted_memory.h index c700175e..b2b19249 100644 --- a/base/memory/ref_counted_memory.h +++ b/base/memory/ref_counted_memory.h
@@ -13,7 +13,6 @@ #include "base/base_export.h" #include "base/containers/span.h" -#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/shared_memory_mapping.h"
diff --git a/base/memory/scoped_refptr.h b/base/memory/scoped_refptr.h index 0f5f07b..b443facb 100644 --- a/base/memory/scoped_refptr.h +++ b/base/memory/scoped_refptr.h
@@ -13,7 +13,6 @@ #include "base/check.h" #include "base/compiler_specific.h" -#include "base/macros.h" template <class T> class scoped_refptr;
diff --git a/base/memory/singleton.h b/base/memory/singleton.h index 27418e7c..6354e6f 100644 --- a/base/memory/singleton.h +++ b/base/memory/singleton.h
@@ -32,7 +32,6 @@ #include "base/base_export.h" #include "base/check_op.h" #include "base/lazy_instance_helpers.h" -#include "base/macros.h" #include "base/threading/thread_restrictions.h" namespace base {
diff --git a/base/memory/unsafe_shared_memory_region.h b/base/memory/unsafe_shared_memory_region.h index 57211f5..72f203b 100644 --- a/base/memory/unsafe_shared_memory_region.h +++ b/base/memory/unsafe_shared_memory_region.h
@@ -5,7 +5,6 @@ #ifndef BASE_MEMORY_UNSAFE_SHARED_MEMORY_REGION_H_ #define BASE_MEMORY_UNSAFE_SHARED_MEMORY_REGION_H_ -#include "base/macros.h" #include "base/memory/platform_shared_memory_region.h" #include "base/memory/shared_memory_mapping.h"
diff --git a/base/memory/writable_shared_memory_region.h b/base/memory/writable_shared_memory_region.h index 1eb921a..d16228c6 100644 --- a/base/memory/writable_shared_memory_region.h +++ b/base/memory/writable_shared_memory_region.h
@@ -5,7 +5,6 @@ #ifndef BASE_MEMORY_WRITABLE_SHARED_MEMORY_REGION_H_ #define BASE_MEMORY_WRITABLE_SHARED_MEMORY_REGION_H_ -#include "base/macros.h" #include "base/memory/platform_shared_memory_region.h" #include "base/memory/read_only_shared_memory_region.h" #include "base/memory/shared_memory_mapping.h"
diff --git a/base/timer/mock_timer_unittest.cc b/base/timer/mock_timer_unittest.cc index eeb4234..aa74f333 100644 --- a/base/timer/mock_timer_unittest.cc +++ b/base/timer/mock_timer_unittest.cc
@@ -5,7 +5,6 @@ #include "base/timer/mock_timer.h" #include "base/bind.h" -#include "base/callback_helpers.h" #include "base/macros.h" #include "testing/gtest/include/gtest/gtest.h" @@ -70,8 +69,7 @@ base::TimeDelta delay = base::TimeDelta::FromSeconds(2); ASSERT_TRUE(weak_ptr.get()); timer.Start(FROM_HERE, delay, - base::BindOnce(base::DoNothing::Once<HasWeakPtr*>(), - base::Owned(has_weak_ptr))); + base::BindOnce([](HasWeakPtr*) {}, base::Owned(has_weak_ptr))); ASSERT_TRUE(weak_ptr.get()); timer.Fire(); ASSERT_FALSE(weak_ptr.get());
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index 0a3283f..e1e1950 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -6.20210925.0.1 +6.20210926.0.1
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1 index 35260c5..e1e1950 100644 --- a/build/fuchsia/mac.sdk.sha1 +++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@ -6.20210924.3.1 +6.20210926.0.1
diff --git a/chrome/VERSION b/chrome/VERSION index 5ef82d45..53a97c1a 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=96 MINOR=0 -BUILD=4654 +BUILD=4656 PATCH=0
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 4c12149..d3e18d7 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -3780,7 +3780,7 @@ flag_descriptions::kMacSyscallSandboxDescription, kOsMac, FEATURE_VALUE_TYPE(features::kMacSyscallSandbox)}, #endif // OS_MAC -#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_WIN) || defined(OS_MAC) +#if defined(OS_CHROMEOS) || defined(OS_WIN) || defined(OS_MAC) {"web-share", flag_descriptions::kWebShareName, flag_descriptions::kWebShareDescription, kOsWin | kOsCrOS, FEATURE_VALUE_TYPE(features::kWebShare)},
diff --git a/chrome/browser/apps/app_service/browser_app_instance_registry.cc b/chrome/browser/apps/app_service/browser_app_instance_registry.cc index 6b12e15b..d8c7ece 100644 --- a/chrome/browser/apps/app_service/browser_app_instance_registry.cc +++ b/chrome/browser/apps/app_service/browser_app_instance_registry.cc
@@ -280,8 +280,9 @@ apps::BrowserAppInstanceUpdate update, aura::Window* window) { DCHECK(window); + auto id = update.id; auto& instance = AddInstance( - lacros_app_instances_, update.id, + lacros_app_instances_, id, std::make_unique<BrowserAppInstance>(std::move(update), window)); for (auto& observer : observers_) { observer.OnBrowserAppAdded(instance);
diff --git a/chrome/browser/ash/app_restore/full_restore_app_launch_handler_browsertest.cc b/chrome/browser/ash/app_restore/full_restore_app_launch_handler_browsertest.cc index 21d2c96..845ffd5 100644 --- a/chrome/browser/ash/app_restore/full_restore_app_launch_handler_browsertest.cc +++ b/chrome/browser/ash/app_restore/full_restore_app_launch_handler_browsertest.cc
@@ -126,6 +126,15 @@ } } +// Gets the ARC app launch information from the full restore file for `app_id` +// and `session_id`. +std::unique_ptr<::app_restore::AppLaunchInfo> GetArcAppLaunchInfo( + const std::string& app_id, + int32_t session_id) { + return ::full_restore::FullRestoreReadHandler::GetInstance() + ->GetArcAppLaunchInfo(app_id, session_id); +} + class TestFullRestoreInfoObserver : public ::full_restore::FullRestoreInfo::Observer { public: @@ -1279,8 +1288,7 @@ void VerifyGetArcAppLaunchInfo(const std::string& app_id, int32_t session_id, int32_t restore_window_id) { - auto app_launch_info = - ::full_restore::GetArcAppLaunchInfo(app_id, session_id); + auto app_launch_info = GetArcAppLaunchInfo(app_id, session_id); ASSERT_TRUE(app_launch_info); EXPECT_EQ(app_id, app_launch_info->app_id); @@ -1680,7 +1688,7 @@ VerifyWindowInfo(window, kActivationIndex); // Verify the ghost window session id has been removed from the restore data. - EXPECT_FALSE(::full_restore::GetArcAppLaunchInfo(app_id, session_id2)); + EXPECT_FALSE(GetArcAppLaunchInfo(app_id, session_id2)); // Destroy the task and close the window. app_host()->OnTaskDestroyed(kTaskId2); @@ -1786,7 +1794,7 @@ VerifyWindowInfo(window, kActivationIndex); // Verify the ghost window session id has been removed from the restore data. - EXPECT_FALSE(::full_restore::GetArcAppLaunchInfo(app_id, session_id3)); + EXPECT_FALSE(GetArcAppLaunchInfo(app_id, session_id3)); // Destroy the task and close the window. app_host()->OnTaskDestroyed(kTaskId2);
diff --git a/chrome/browser/ash/app_restore/full_restore_service_unittest.cc b/chrome/browser/ash/app_restore/full_restore_service_unittest.cc index 4bf5528..3b61967 100644 --- a/chrome/browser/ash/app_restore/full_restore_service_unittest.cc +++ b/chrome/browser/ash/app_restore/full_restore_service_unittest.cc
@@ -71,6 +71,22 @@ specifics, syncer::ClientTagHash::FromHashed("unused")); } +// Returns true if we should restore apps and pages based on the restore setting +// and the user's choice from the notification. Otherwise, returns false. +bool ShouldRestore(const AccountId& account_id) { + return ::full_restore::FullRestoreInfo::GetInstance()->ShouldRestore( + account_id); +} + +// Returns true if the restore pref is 'Always' or 'Ask every time', as we +// could restore apps and pages based on the user's choice from the +// notification for `account_id`. Otherwise, returns false, when the restore +// pref is 'Do not restore'. +bool CanPerformRestore(const AccountId& account_id) { + return ::full_restore::FullRestoreInfo::GetInstance()->CanPerformRestore( + account_id); +} + } // namespace class FullRestoreServiceTest : public testing::Test { @@ -212,7 +228,7 @@ VerifyNotification(false /* has_crash_notification */, false /* has_restore_notification */); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); EXPECT_EQ(RestoreOption::kAskEveryTime, GetRestoreOption()); } @@ -231,7 +247,7 @@ false /* has_restore_notification */); EXPECT_EQ(RestoreOption::kAskEveryTime, GetRestoreOption()); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); } class FullRestoreServiceTestHavingFullRestoreFile @@ -288,8 +304,8 @@ SimulateClick(kRestoreForCrashNotificationId, RestoreNotificationButtonIndex::kRestore); - EXPECT_TRUE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_TRUE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); EXPECT_TRUE(allow_save()); // Verify the set restore notification is not shown. @@ -309,8 +325,8 @@ SimulateClick(kRestoreForCrashNotificationId, RestoreNotificationButtonIndex::kCancel); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); EXPECT_TRUE(allow_save()); } @@ -327,8 +343,8 @@ VerifyNotification(false /* has_crash_notification */, false /* has_restore_notification */); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); EXPECT_TRUE(allow_save()); } @@ -368,8 +384,8 @@ VerifyNotification(false, false); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); } // For a new Chrome OS user, if the Chrome restore setting is 'Continue where @@ -383,8 +399,8 @@ VerifyNotification(false, false); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); // Set the Chrome restore setting to simulate sync for the first time. syncer::SyncDataList sync_data_list; @@ -398,8 +414,8 @@ VerifyNotification(false, false); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); // Update the global values to simulate sync from other device. syncer::SyncChangeList change_list; @@ -417,8 +433,8 @@ content::RunAllTasksUntilIdle(); EXPECT_EQ(RestoreOption::kDoNotRestore, GetRestoreOption()); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_FALSE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_FALSE(CanPerformRestore(account_id())); } // For a new Chrome OS user, if the Chrome restore setting is 'New tab', after @@ -432,8 +448,8 @@ VerifyNotification(false, false); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); // Set the Chrome restore setting to simulate sync for the first time. syncer::SyncDataList sync_data_list; @@ -447,8 +463,8 @@ VerifyNotification(false, false); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); // Update the global values to simulate sync from other device. syncer::SyncChangeList change_list; @@ -466,8 +482,8 @@ content::RunAllTasksUntilIdle(); EXPECT_EQ(RestoreOption::kDoNotRestore, GetRestoreOption()); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_FALSE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_FALSE(CanPerformRestore(account_id())); } // For a new Chrome OS user, keep the ChromeOS restore setting from sync, and @@ -480,8 +496,8 @@ VerifyNotification(false, false); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); // Set the restore pref setting to simulate sync for the first time. syncer::SyncDataList sync_data_list; @@ -498,8 +514,8 @@ VerifyNotification(false, false); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); // Update the global values to simulate sync from other device. syncer::SyncChangeList change_list; @@ -517,8 +533,8 @@ content::RunAllTasksUntilIdle(); EXPECT_EQ(RestoreOption::kAlways, GetRestoreOption()); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); } // For the current ChromeOS user, when first time upgrading to the full restore @@ -535,8 +551,8 @@ VerifyNotification(false, false); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_FALSE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_FALSE(CanPerformRestore(account_id())); // Simulate the Chrome restore setting is changed. profile()->GetPrefs()->SetInteger( @@ -545,8 +561,8 @@ // The OS restore setting should not change. EXPECT_EQ(RestoreOption::kDoNotRestore, GetRestoreOption()); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_FALSE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_FALSE(CanPerformRestore(account_id())); } // If the OS restore setting is 'Ask every time', after reboot, show the restore @@ -567,8 +583,8 @@ RestoreNotificationButtonIndex::kRestore); EXPECT_EQ(RestoreOption::kAskEveryTime, GetRestoreOption()); - EXPECT_TRUE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_TRUE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); EXPECT_TRUE(allow_save()); VerifyNotification(false, false); @@ -596,8 +612,8 @@ RestoreNotificationButtonIndex::kCancel); EXPECT_EQ(RestoreOption::kAskEveryTime, GetRestoreOption()); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); EXPECT_TRUE(allow_save()); // Click the setting button, the restore notification should not be closed. @@ -628,8 +644,8 @@ FullRestoreService::MaybeCloseNotification(profile()); EXPECT_EQ(RestoreOption::kAskEveryTime, GetRestoreOption()); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); EXPECT_TRUE(allow_save()); VerifyNotification(false, false); @@ -661,8 +677,8 @@ false /* has_restore_notification */); EXPECT_EQ(RestoreOption::kAskEveryTime, GetRestoreOption()); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); EXPECT_TRUE(allow_save()); } @@ -678,8 +694,8 @@ VerifyNotification(false, false); - EXPECT_TRUE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_TRUE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); } // If the OS restore setting is 'Do not restore', after reboot, don't show any @@ -695,8 +711,8 @@ VerifyNotification(false, false); - EXPECT_FALSE(::full_restore::ShouldRestore(account_id())); - EXPECT_FALSE(::full_restore::CanPerformRestore(account_id())); + EXPECT_FALSE(ShouldRestore(account_id())); + EXPECT_FALSE(CanPerformRestore(account_id())); } class FullRestoreServiceMultipleUsersTest @@ -833,8 +849,8 @@ RestoreNotificationButtonIndex::kRestore); EXPECT_EQ(RestoreOption::kAskEveryTime, GetRestoreOption()); - EXPECT_TRUE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_TRUE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); EXPECT_TRUE(allow_save()); VerifyNotification(false /* has_crash_notification */, @@ -855,8 +871,8 @@ RestoreNotificationButtonIndex::kRestore); EXPECT_EQ(RestoreOption::kAskEveryTime, GetRestoreOptionForProfile2()); - EXPECT_TRUE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_TRUE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); EXPECT_TRUE(allow_save()); VerifyNotificationForProfile2(false /* has_crash_notification */, @@ -879,8 +895,8 @@ RestoreNotificationButtonIndex::kRestore); EXPECT_EQ(RestoreOption::kAskEveryTime, GetRestoreOption()); - EXPECT_TRUE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_TRUE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); EXPECT_TRUE(allow_save()); VerifyNotification(false /* has_crash_notification */, @@ -908,8 +924,8 @@ RestoreNotificationButtonIndex::kRestore); EXPECT_EQ(RestoreOption::kAskEveryTime, GetRestoreOptionForProfile2()); - EXPECT_TRUE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_TRUE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); EXPECT_TRUE(allow_save()); VerifyNotificationForProfile2(false /* has_crash_notification */, @@ -950,8 +966,8 @@ SimulateClickForProfile2(kRestoreNotificationId, RestoreNotificationButtonIndex::kRestore); - EXPECT_TRUE(::full_restore::ShouldRestore(account_id2())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id2())); + EXPECT_TRUE(ShouldRestore(account_id2())); + EXPECT_TRUE(CanPerformRestore(account_id2())); // Simulate switch to the first user. auto* full_restore_service = FullRestoreService::GetForProfile(profile()); @@ -964,8 +980,8 @@ SimulateClick(kRestoreNotificationId, RestoreNotificationButtonIndex::kRestore); - EXPECT_TRUE(::full_restore::ShouldRestore(account_id())); - EXPECT_TRUE(::full_restore::CanPerformRestore(account_id())); + EXPECT_TRUE(ShouldRestore(account_id())); + EXPECT_TRUE(CanPerformRestore(account_id())); // Simulate switch to the second user, and verify no more init process. full_restore_service2->OnTransitionedToNewActiveUser(profile2());
diff --git a/chrome/browser/ash/policy/off_hours/off_hours_policy_applier_unittest.cc b/chrome/browser/ash/policy/off_hours/off_hours_policy_applier_unittest.cc index 6676424f..7621b3f 100644 --- a/chrome/browser/ash/policy/off_hours/off_hours_policy_applier_unittest.cc +++ b/chrome/browser/ash/policy/off_hours/off_hours_policy_applier_unittest.cc
@@ -83,11 +83,14 @@ } // namespace class ApplyOffHoursPolicyToProtoTest : public testing::Test { + public: + ApplyOffHoursPolicyToProtoTest(const ApplyOffHoursPolicyToProtoTest&) = + delete; + ApplyOffHoursPolicyToProtoTest& operator=( + const ApplyOffHoursPolicyToProtoTest&) = delete; + protected: ApplyOffHoursPolicyToProtoTest() = default; - - private: - DISALLOW_COPY_AND_ASSIGN(ApplyOffHoursPolicyToProtoTest); }; TEST_F(ApplyOffHoursPolicyToProtoTest, Test) {
diff --git a/chrome/browser/ash/policy/off_hours/off_hours_proto_parser_unittest.cc b/chrome/browser/ash/policy/off_hours/off_hours_proto_parser_unittest.cc index 6879a11e..42f26b6 100644 --- a/chrome/browser/ash/policy/off_hours/off_hours_proto_parser_unittest.cc +++ b/chrome/browser/ash/policy/off_hours/off_hours_proto_parser_unittest.cc
@@ -86,11 +86,14 @@ } // namespace class ConvertOffHoursProtoToValueTest : public testing::Test { - protected: - ConvertOffHoursProtoToValueTest() {} + public: + ConvertOffHoursProtoToValueTest(const ConvertOffHoursProtoToValueTest&) = + delete; + ConvertOffHoursProtoToValueTest& operator=( + const ConvertOffHoursProtoToValueTest&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(ConvertOffHoursProtoToValueTest); + protected: + ConvertOffHoursProtoToValueTest() = default; }; TEST_F(ConvertOffHoursProtoToValueTest, Test) {
diff --git a/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc b/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc index 726442b..ed3bc85 100644 --- a/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc +++ b/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc
@@ -3957,7 +3957,8 @@ } }; -TEST_F(DeviceStatusCollectorNetworkInterfacesTest, TestNoInterfaces) { +// TODO(crbug.com/1253206): Revive this test. +TEST_F(DeviceStatusCollectorNetworkInterfacesTest, DISABLED_TestNoInterfaces) { ClearNetworkData(); IsolateReportingSetting(chromeos::kReportDeviceNetworkConfiguration); @@ -4095,7 +4096,8 @@ VerifyReporting(); } -TEST_F(DeviceStatusCollectorNetworkStateTest, TestNoNetworks) { +// TODO(crbug.com/1253206): Revive this test. +TEST_F(DeviceStatusCollectorNetworkStateTest, DISABLED_TestNoNetworks) { ClearNetworkData(); IsolateReportingSetting(chromeos::kReportDeviceNetworkStatus);
diff --git a/chrome/browser/ash/usb/cros_usb_detector.cc b/chrome/browser/ash/usb/cros_usb_detector.cc index 3cb4ccc8..ccba4522 100644 --- a/chrome/browser/ash/usb/cros_usb_detector.cc +++ b/chrome/browser/ash/usb/cros_usb_detector.cc
@@ -575,9 +575,10 @@ } } - // Copy strings prior to moving |device_info| and |new_device|. + // Copy fields prior to moving |device_info| and |new_device|. std::string guid = device_info->guid; std::u16string label = new_device.label; + uint32_t allowed_interfaces_mask = new_device.allowed_interfaces_mask; new_device.info = std::move(device_info); auto result = usb_devices_.emplace(guid, std::move(new_device)); @@ -594,7 +595,7 @@ // is integrated in |ShowNotificationForDevice|. if (arc::IsArcVmEnabled() && base::FeatureList::IsEnabled(arc::kUsbDeviceDefaultAttachToArcVm)) { - if (has_supported_interface || new_device.allowed_interfaces_mask != 0) { + if (has_supported_interface || allowed_interfaces_mask != 0) { // USB devices not claimed by Chrome OS get automatically attached to the // ARCVM. Note that this relies on the underlying VM (ARCVM) having // its own permission model to restrict access to the device.
diff --git a/chrome/browser/chromeos/fileapi/file_change_service_unittest.cc b/chrome/browser/chromeos/fileapi/file_change_service_unittest.cc index fd5690e3..e9ad3df 100644 --- a/chrome/browser/chromeos/fileapi/file_change_service_unittest.cc +++ b/chrome/browser/chromeos/fileapi/file_change_service_unittest.cc
@@ -4,7 +4,6 @@ #include "chrome/browser/chromeos/fileapi/file_change_service.h" -#include "base/callback_helpers.h" #include "base/files/scoped_temp_dir.h" #include "base/scoped_observation.h" #include "base/test/bind.h" @@ -67,10 +66,8 @@ std::make_unique<mojo::StringDataSource>( contents, mojo::StringDataSource::AsyncWritingMode:: STRING_MAY_BE_INVALIDATED_BEFORE_COMPLETION), - base::BindOnce( - base::DoNothing::Once<std::unique_ptr<mojo::DataPipeProducer>, - MojoResult>(), - std::move(producer))); + base::BindOnce([](std::unique_ptr<mojo::DataPipeProducer>, MojoResult) {}, + std::move(producer))); return consumer_handle; }
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index bf8b3dc..29af3902 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -506,7 +506,7 @@ { "name": "back-forward-cache", "owners": [ "bfcache-dev@chromium.org" ], - "expiry_milestone": 95 + "expiry_milestone": 110 }, { "name": "bento-offline", @@ -1192,7 +1192,7 @@ { "name": "disable-virtual-keyboard", "owners": [ "myy", "essential-inputs-team@google.com" ], - "expiry_milestone": 95 + "expiry_milestone": 100 }, { "name": "disable-webrtc-hw-decoding", @@ -1646,7 +1646,7 @@ { "name": "enable-cros-multilingual-typing", "owners": [ "tranbaoduy", "essential-inputs-team@google.com" ], - "expiry_milestone": 95 + "expiry_milestone": 100 }, { "name": "enable-cros-on-device-grammar-check", @@ -3074,7 +3074,7 @@ { "name": "files-single-partition-format", "owners": [ "austinct", "petermarshall" ], - "expiry_milestone": 95 + "expiry_milestone": 98 }, { "name": "files-swa", @@ -5610,7 +5610,7 @@ { "name": "web-share", "owners": [ "mhochk@microsoft.com", "ericwilligers@google.com", "hatalat@microsoft.com" ], - "expiry_milestone": 95 + "expiry_milestone": 114 }, { "name": "web-view-native-context-menu",
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 54a9924..c507c14 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -5312,12 +5312,12 @@ "update and restoring them after a version rollback."; #endif // !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) -#if defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_MAC) +#if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MAC) const char kWebShareName[] = "Web Share"; const char kWebShareDescription[] = "Enables the Web Share (navigator.share) APIs on experimentally supported " "platforms."; -#endif // defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_MAC) +#endif // defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MAC) // Feature flags --------------------------------------------------------------
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 4940328..ecf3a33 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -3071,10 +3071,10 @@ extern const char kUserDataSnapshotDescription[]; #endif // !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) -#if defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_MAC) +#if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MAC) extern const char kWebShareName[]; extern const char kWebShareDescription[]; -#endif // defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_MAC) +#endif // defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MAC) // Feature flags --------------------------------------------------------------
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc index 8d4ad57a..bbe80c6 100644 --- a/chrome/browser/sessions/session_service.cc +++ b/chrome/browser/sessions/session_service.cc
@@ -441,6 +441,7 @@ if (is_first_session_service_) return; +#if BUILDFLAG(IS_CHROMEOS_ASH) // TODO(https://crbug.com/1245816): for debugging, remove once tracked down // source of problem. // A command has been scheduled for a SessionService other than the first. @@ -450,6 +451,7 @@ const bool shutdown_started = browser_shutdown::HasShutdownStarted(); base::debug::Alias(&shutdown_started); base::debug::DumpWithoutCrashing(); +#endif } bool SessionService::ShouldRestoreWindowOfType(
diff --git a/chrome/browser/signin/chrome_signin_helper.cc b/chrome/browser/signin/chrome_signin_helper.cc index 1fa42fc..11f6fe7 100644 --- a/chrome/browser/signin/chrome_signin_helper.cc +++ b/chrome/browser/signin/chrome_signin_helper.cc
@@ -118,10 +118,10 @@ } void DestroyAfterDelay() { + // TODO(dcheng): Should ReleaseSoon() support this use case? content::GetUIThreadTaskRunner({})->PostDelayedTask( FROM_HERE, - base::BindOnce(base::DoNothing::Once< - scoped_refptr<AccountReconcilorLockWrapper>>(), + base::BindOnce([](scoped_refptr<AccountReconcilorLockWrapper>) {}, base::RetainedRef(this)), base::TimeDelta::FromMilliseconds( g_dice_account_reconcilor_blocked_delay_ms));
diff --git a/chrome/browser/web_applications/extensions/web_app_extension_shortcut_mac.mm b/chrome/browser/web_applications/extensions/web_app_extension_shortcut_mac.mm index a81aa3d..2e8c85b 100644 --- a/chrome/browser/web_applications/extensions/web_app_extension_shortcut_mac.mm +++ b/chrome/browser/web_applications/extensions/web_app_extension_shortcut_mac.mm
@@ -47,8 +47,7 @@ // Closure does nothing. The Closure just serves to keep a reference alive // until |this| is ready to be destroyed; invoking the |callback|. base::RepeatingClosure NoOpClosure() { - return base::BindRepeating(base::DoNothing::Repeatedly<Latch*>(), - base::RetainedRef(this)); + return base::BindRepeating([](Latch*) {}, base::RetainedRef(this)); } private:
diff --git a/chrome/browser/webshare/BUILD.gn b/chrome/browser/webshare/BUILD.gn index aec3e1a..de7ec90 100644 --- a/chrome/browser/webshare/BUILD.gn +++ b/chrome/browser/webshare/BUILD.gn
@@ -4,7 +4,7 @@ import("//build/config/chromeos/ui_mode.gni") -if (is_chromeos_ash || is_mac) { +if (is_chromeos || is_mac) { static_library("storage") { sources = [ "prepare_directory_task.cc", @@ -15,7 +15,6 @@ "store_files_task.h", ] deps = [ - "//build:chromeos_buildflags", "//content/public/browser", "//mojo/public/cpp/bindings", ] @@ -38,7 +37,7 @@ sources = [ "share_service_unittest.cc" ] - if (is_chromeos_ash || is_mac) { + if (is_chromeos || is_mac) { sources += [ "prepare_directory_task_unittest.cc" ] } @@ -48,7 +47,6 @@ deps = [ "//base/test:test_support", - "//build:chromeos_buildflags", "//chrome/browser", "//chrome/common", "//chrome/test:test_support", @@ -58,11 +56,11 @@ "//testing/gtest", ] - if (is_chromeos_ash) { + if (is_chromeos) { deps += [ "//chrome/browser/webshare/chromeos:unit_tests" ] } - if (is_chromeos_ash || is_mac) { + if (is_chromeos || is_mac) { deps += [ "//chrome/browser/webshare:storage" ] } }
diff --git a/chrome/browser/webshare/chromeos/BUILD.gn b/chrome/browser/webshare/chromeos/BUILD.gn index d16fd28..b2064fd 100644 --- a/chrome/browser/webshare/chromeos/BUILD.gn +++ b/chrome/browser/webshare/chromeos/BUILD.gn
@@ -9,7 +9,6 @@ deps = [ "//base/test:test_support", - "//build:chromeos_buildflags", "//chrome/browser", "//chrome/browser/chromeos:chromeos", "//chrome/browser/webshare:storage",
diff --git a/chrome/browser/webshare/prepare_directory_task.cc b/chrome/browser/webshare/prepare_directory_task.cc index e7e4485..4742bada 100644 --- a/chrome/browser/webshare/prepare_directory_task.cc +++ b/chrome/browser/webshare/prepare_directory_task.cc
@@ -11,10 +11,9 @@ #include "base/task/thread_pool.h" #include "base/threading/scoped_blocking_call.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "content/public/browser/browser_thread.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) #include "third_party/cros_system_api/constants/cryptohome.h" #endif @@ -100,7 +99,7 @@ } } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) if (base::SysInfo::AmountOfFreeDiskSpace(directory) < static_cast<int64_t>(cryptohome::kMinFreeSpaceInBytes + required_space)) {
diff --git a/chrome/browser/webshare/share_service_browsertest.cc b/chrome/browser/webshare/share_service_browsertest.cc index 0b1365e..30acfcd 100644 --- a/chrome/browser/webshare/share_service_browsertest.cc +++ b/chrome/browser/webshare/share_service_browsertest.cc
@@ -5,7 +5,6 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/safe_browsing/test_safe_browsing_service.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" @@ -19,7 +18,7 @@ #include "content/public/test/browser_test_utils.h" #include "net/test/embedded_test_server/embedded_test_server.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) #include "chrome/browser/sharesheet/sharesheet_types.h" #include "chrome/browser/webshare/chromeos/sharesheet_client.h" #endif @@ -39,7 +38,7 @@ void SetUpOnMainThread() override { InProcessBrowserTest::SetUpOnMainThread(); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) webshare::SharesheetClient::SetSharesheetCallbackForTesting( base::BindRepeating(&ShareServiceBrowserTest::AcceptShareRequest)); #endif @@ -55,7 +54,7 @@ #endif } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) static void AcceptShareRequest( content::WebContents* web_contents, const std::vector<base::FilePath>& file_paths,
diff --git a/chrome/browser/webshare/share_service_impl.cc b/chrome/browser/webshare/share_service_impl.cc index 094a5873..5d44cf1 100644 --- a/chrome/browser/webshare/share_service_impl.cc +++ b/chrome/browser/webshare/share_service_impl.cc
@@ -11,7 +11,6 @@ #include "base/metrics/histogram_macros.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/common/chrome_features.h" @@ -35,7 +34,7 @@ ShareServiceImpl::ShareServiceImpl(content::RenderFrameHost& render_frame_host) : content::WebContentsObserver( content::WebContents::FromRenderFrameHost(&render_frame_host)), -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) sharesheet_client_(web_contents()), #endif render_frame_host_(&render_frame_host) { @@ -235,7 +234,7 @@ return; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) sharesheet_client_.Share(title, text, share_url, std::move(files), std::move(callback)); #elif defined(OS_MAC)
diff --git a/chrome/browser/webshare/share_service_impl.h b/chrome/browser/webshare/share_service_impl.h index 455f4bed..1e1606e3 100644 --- a/chrome/browser/webshare/share_service_impl.h +++ b/chrome/browser/webshare/share_service_impl.h
@@ -11,13 +11,12 @@ #include "base/memory/weak_ptr.h" #include "base/strings/string_piece.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/webshare/safe_browsing_request.h" #include "content/public/browser/web_contents_observer.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/mojom/webshare/webshare.mojom.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) #include "chrome/browser/webshare/chromeos/sharesheet_client.h" #endif @@ -71,7 +70,7 @@ private: absl::optional<SafeBrowsingRequest> safe_browsing_request_; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) webshare::SharesheetClient sharesheet_client_; #endif content::RenderFrameHost* render_frame_host_;
diff --git a/chrome/browser/webshare/share_service_unittest.cc b/chrome/browser/webshare/share_service_unittest.cc index 349c2b68..6d7f5de 100644 --- a/chrome/browser/webshare/share_service_unittest.cc +++ b/chrome/browser/webshare/share_service_unittest.cc
@@ -12,7 +12,6 @@ #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "build/build_config.h" -#include "build/chromeos_buildflags.h" #include "chrome/browser/webshare/share_service_impl.h" #include "chrome/common/chrome_features.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" @@ -27,7 +26,7 @@ using blink::mojom::ShareError; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) #include "chrome/browser/sharesheet/sharesheet_types.h" #include "chrome/browser/webshare/chromeos/sharesheet_client.h" #endif @@ -50,7 +49,7 @@ ChromeRenderViewHostTestHarness::SetUp(); share_service_ = std::make_unique<ShareServiceImpl>(*main_rfh()); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) webshare::SharesheetClient::SetSharesheetCallbackForTesting( base::BindRepeating(&ShareServiceUnitTest::AcceptShareRequest)); #endif @@ -139,7 +138,7 @@ return builder; } -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) static void AcceptShareRequest( content::WebContents* web_contents, const std::vector<base::FilePath>& file_paths, @@ -250,7 +249,7 @@ } #endif -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_CHROMEOS) // On Chrome OS, like Android, we prevent sharing of Android applications. TEST_F(ShareServiceUnitTest, AndroidPackage) { EXPECT_EQ(ShareError::PERMISSION_DENIED,
diff --git a/chrome/browser/webshare/win/share_operation.cc b/chrome/browser/webshare/win/share_operation.cc index daefc8c0..2f87497 100644 --- a/chrome/browser/webshare/win/share_operation.cc +++ b/chrome/browser/webshare/win/share_operation.cc
@@ -5,7 +5,6 @@ #include "chrome/browser/webshare/win/share_operation.h" #include "base/bind.h" -#include "base/callback_helpers.h" #include "base/strings/utf_string_conversions.h" #include "base/win/core_winrt_util.h" #include "base/win/post_async_results.h" @@ -547,8 +546,7 @@ operation->WriteStream( stream, base::BindOnce( - base::DoNothing::Once< - scoped_refptr<OutputStreamWriteOperation>>(), + [](scoped_refptr<OutputStreamWriteOperation>) {}, operation)); return S_OK; });
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 2afac7e..dd205d2 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1632548054-42d159d4e6ae5be86a2b7f9ab12a65b0c796632a.profdata +chrome-linux-main-1632698636-c3516a56f935f3ae726a994fdaad4f491adff7fb.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 39184a0..4b84bba 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1632548054-2383c30487282da9f24ad124189b84c254f5c156.profdata +chrome-mac-main-1632698636-51c2cd6230686b1459abef0abcaa8b802a658e64.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 6608e09d..9a54061 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1632548054-6f16a736e66e0c44e71f7c21b592130c479acc9d.profdata +chrome-win32-main-1632698636-26ed7605ab2dc8abc363c8c6fb92aca8c9412fac.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 34f910a1..1582cf5 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1632548054-de492a60f14cd25cedf09e8ac57ba676dd67f040.profdata +chrome-win64-main-1632698636-62df3ec3d383304eaafde294f9f1ad4d4f23d2fe.profdata
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 713a47d..43699b31 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -1060,7 +1060,7 @@ "WebRtcRemoteEventLogGzipped", base::FEATURE_ENABLED_BY_DEFAULT}; #endif -#if defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH) +#if defined(OS_WIN) || defined(OS_CHROMEOS) // Enables Web Share (navigator.share) const base::Feature kWebShare{"WebShare", base::FEATURE_ENABLED_BY_DEFAULT}; #endif
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index 7b3fb7c..5f5bd633 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -715,7 +715,7 @@ extern const base::Feature kWebRtcRemoteEventLogGzipped; #endif -#if defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_MAC) +#if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MAC) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kWebShare; #endif
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index f776bc7..fdeeaf8 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -14240.0.0 \ No newline at end of file +14243.0.0 \ No newline at end of file
diff --git a/chromeos/components/phonehub/cros_state_sender.cc b/chromeos/components/phonehub/cros_state_sender.cc index 01786746..361a070 100644 --- a/chromeos/components/phonehub/cros_state_sender.cc +++ b/chromeos/components/phonehub/cros_state_sender.cc
@@ -89,16 +89,10 @@ bool are_notifications_enabled = multidevice_setup_client_->GetFeatureState( Feature::kPhoneHubNotifications) == FeatureState::kEnabledByUser; - bool is_camera_roll_enabled = - multidevice_setup_client_->GetFeatureState( - Feature::kPhoneHubCameraRoll) == FeatureState::kEnabledByUser; PA_LOG(INFO) << "Attempting to send cros state with notifications enabled " - << "state as: " << are_notifications_enabled - << " and camera roll enabled state as: " - << is_camera_roll_enabled; - message_sender_->SendCrosState(are_notifications_enabled, - is_camera_roll_enabled); + << "state as: " << are_notifications_enabled; + message_sender_->SendCrosState(are_notifications_enabled); retry_timer_->Start(FROM_HERE, retry_delay_, base::BindOnce(&CrosStateSender::OnRetryTimerFired,
diff --git a/chromeos/components/phonehub/cros_state_sender_unittest.cc b/chromeos/components/phonehub/cros_state_sender_unittest.cc index 60dbdd7..58a32f5 100644 --- a/chromeos/components/phonehub/cros_state_sender_unittest.cc +++ b/chromeos/components/phonehub/cros_state_sender_unittest.cc
@@ -106,9 +106,6 @@ // Set notification feature to be enabled. fake_multidevice_setup_client_->SetFeatureState( Feature::kPhoneHubNotifications, FeatureState::kEnabledByUser); - // Set camera roll feature to be enabled. - fake_multidevice_setup_client_->SetFeatureState(Feature::kPhoneHubCameraRoll, - FeatureState::kEnabledByUser); // Expect no new messages since connection has not been established. EXPECT_EQ(0u, fake_message_sender_->GetCrosStateCallCount()); EXPECT_FALSE(mock_timer_->IsRunning()); @@ -123,8 +120,7 @@ // Simulate connected state. Expect a new message to be sent. fake_connection_manager_->SetStatus( secure_channel::ConnectionManager::Status::kConnected); - EXPECT_TRUE(fake_message_sender_->GetRecentCrosState().first); - EXPECT_TRUE(fake_message_sender_->GetRecentCrosState().second); + EXPECT_TRUE(fake_message_sender_->GetRecentCrosState()); EXPECT_EQ(1u, fake_message_sender_->GetCrosStateCallCount()); // Phone model is populated. @@ -135,8 +131,7 @@ // Simulate disconnected state, this should not trigger a new request. fake_connection_manager_->SetStatus( secure_channel::ConnectionManager::Status::kDisconnected); - EXPECT_TRUE(fake_message_sender_->GetRecentCrosState().first); - EXPECT_TRUE(fake_message_sender_->GetRecentCrosState().second); + EXPECT_TRUE(fake_message_sender_->GetRecentCrosState()); EXPECT_EQ(1u, fake_message_sender_->GetCrosStateCallCount()); EXPECT_FALSE(mock_timer_->IsRunning()); } @@ -151,8 +146,7 @@ EXPECT_TRUE(mock_timer_->IsRunning()); // Expect new messages to be sent when connection state is connected. - EXPECT_FALSE(fake_message_sender_->GetRecentCrosState().first); - EXPECT_FALSE(fake_message_sender_->GetRecentCrosState().second); + EXPECT_FALSE(fake_message_sender_->GetRecentCrosState()); EXPECT_EQ(1u, fake_message_sender_->GetCrosStateCallCount()); mock_timer_->Fire(); @@ -160,7 +154,7 @@ // enabled. fake_multidevice_setup_client_->SetFeatureState( Feature::kPhoneHubNotifications, FeatureState::kEnabledByUser); - EXPECT_TRUE(fake_message_sender_->GetRecentCrosState().first); + EXPECT_TRUE(fake_message_sender_->GetRecentCrosState()); EXPECT_EQ(2u, fake_message_sender_->GetCrosStateCallCount()); mock_timer_->Fire(); @@ -168,7 +162,7 @@ // cros state. fake_multidevice_setup_client_->SetFeatureState( Feature::kSmartLock, FeatureState::kDisabledByUser); - EXPECT_TRUE(fake_message_sender_->GetRecentCrosState().first); + EXPECT_TRUE(fake_message_sender_->GetRecentCrosState()); EXPECT_EQ(3u, fake_message_sender_->GetCrosStateCallCount()); mock_timer_->Fire(); @@ -176,19 +170,12 @@ // disabled. fake_multidevice_setup_client_->SetFeatureState( Feature::kPhoneHubNotifications, FeatureState::kDisabledByUser); - EXPECT_FALSE(fake_message_sender_->GetRecentCrosState().first); + EXPECT_FALSE(fake_message_sender_->GetRecentCrosState()); EXPECT_EQ(4u, fake_message_sender_->GetCrosStateCallCount()); - // Simulate enabling camera roll feature state and expect cros state to be - // updated. - fake_multidevice_setup_client_->SetFeatureState(Feature::kPhoneHubCameraRoll, - FeatureState::kEnabledByUser); - EXPECT_TRUE(fake_message_sender_->GetRecentCrosState().second); - EXPECT_EQ(5u, fake_message_sender_->GetCrosStateCallCount()); - // Firing the timer does not cause the cros state to be sent again. mock_timer_->Fire(); - EXPECT_EQ(5u, fake_message_sender_->GetCrosStateCallCount()); + EXPECT_EQ(4u, fake_message_sender_->GetCrosStateCallCount()); } } // namespace phonehub
diff --git a/chromeos/components/phonehub/fake_message_sender.cc b/chromeos/components/phonehub/fake_message_sender.cc index 506fcdd..180d57a8 100644 --- a/chromeos/components/phonehub/fake_message_sender.cc +++ b/chromeos/components/phonehub/fake_message_sender.cc
@@ -10,10 +10,8 @@ FakeMessageSender::FakeMessageSender() = default; FakeMessageSender::~FakeMessageSender() = default; -void FakeMessageSender::SendCrosState(bool notification_enabled, - bool camera_roll_enabled) { - cros_states_.push_back( - std::make_pair(notification_enabled, camera_roll_enabled)); +void FakeMessageSender::SendCrosState(bool notification_enabled) { + cros_states_.push_back(notification_enabled); } void FakeMessageSender::SendUpdateNotificationModeRequest( @@ -79,7 +77,7 @@ return fetch_camera_roll_items_requests_.size(); } -std::pair<bool, bool> FakeMessageSender::GetRecentCrosState() const { +bool FakeMessageSender::GetRecentCrosState() const { return cros_states_.back(); }
diff --git a/chromeos/components/phonehub/fake_message_sender.h b/chromeos/components/phonehub/fake_message_sender.h index aeb2b82d..8ac1cfaf 100644 --- a/chromeos/components/phonehub/fake_message_sender.h +++ b/chromeos/components/phonehub/fake_message_sender.h
@@ -22,8 +22,7 @@ ~FakeMessageSender() override; // MessageSender: - void SendCrosState(bool notification_enabled, - bool camera_roll_enabled) override; + void SendCrosState(bool notification_enabled) override; void SendUpdateNotificationModeRequest(bool do_not_disturb_enabled) override; void SendUpdateBatteryModeRequest(bool battery_saver_mode_enabled) override; void SendDismissNotificationRequest(int64_t notification_id) override; @@ -35,7 +34,7 @@ void SendFetchCameraRollItemsRequest( const proto::FetchCameraRollItemsRequest& request) override; - std::pair<bool, bool> GetRecentCrosState() const; + bool GetRecentCrosState() const; bool GetRecentUpdateNotificationModeRequest() const; bool GetRecentUpdateBatteryModeRequest() const; int64_t GetRecentDismissNotificationRequest() const; @@ -64,9 +63,7 @@ size_t GetFetchCameraRollItemsRequestCallCount() const; private: - std::vector<std::pair</*is_notifications_setting_enabled*/ bool, - /*is_camera_roll_setting_enabled*/ bool>> - cros_states_; + std::vector<bool> cros_states_; std::vector<bool> update_notification_mode_requests_; std::vector<bool> update_battery_mode_requests_; std::vector<int64_t> dismiss_notification_requests_;
diff --git a/chromeos/components/phonehub/message_sender.h b/chromeos/components/phonehub/message_sender.h index a9c52999..4cd09b9 100644 --- a/chromeos/components/phonehub/message_sender.h +++ b/chromeos/components/phonehub/message_sender.h
@@ -22,8 +22,7 @@ virtual ~MessageSender() = default; // Sends whether the notification setting is enabled in the Chrome OS device. - virtual void SendCrosState(bool notification_setting_enabled, - bool camera_roll_setting_enabled) = 0; + virtual void SendCrosState(bool notification_setting_enabled) = 0; // Requests that the phone enables or disables Do Not Disturb mode. virtual void SendUpdateNotificationModeRequest(
diff --git a/chromeos/components/phonehub/message_sender_impl.cc b/chromeos/components/phonehub/message_sender_impl.cc index d16e36d..d3d2cd312 100644 --- a/chromeos/components/phonehub/message_sender_impl.cc +++ b/chromeos/components/phonehub/message_sender_impl.cc
@@ -38,18 +38,13 @@ MessageSenderImpl::~MessageSenderImpl() = default; -void MessageSenderImpl::SendCrosState(bool notification_setting_enabled, - bool camera_roll_setting_enabled) { +void MessageSenderImpl::SendCrosState(bool notification_setting_enabled) { proto::NotificationSetting is_notification_enabled = notification_setting_enabled ? proto::NotificationSetting::NOTIFICATIONS_ON : proto::NotificationSetting::NOTIFICATIONS_OFF; - proto::CameraRollSetting is_camera_roll_enabled = - camera_roll_setting_enabled ? proto::CameraRollSetting::CAMERA_ROLL_ON - : proto::CameraRollSetting::CAMERA_ROLL_OFF; proto::CrosState request; request.set_notification_setting(is_notification_enabled); - request.set_camera_roll_setting(is_camera_roll_enabled); SendMessage(proto::MessageType::PROVIDE_CROS_STATE, &request); }
diff --git a/chromeos/components/phonehub/message_sender_impl.h b/chromeos/components/phonehub/message_sender_impl.h index cd689b70..0f19ec2 100644 --- a/chromeos/components/phonehub/message_sender_impl.h +++ b/chromeos/components/phonehub/message_sender_impl.h
@@ -27,8 +27,7 @@ ~MessageSenderImpl() override; // MessageSender: - void SendCrosState(bool notification_setting_enabled, - bool camera_roll_setting_enabled) override; + void SendCrosState(bool notification_setting_enabled) override; void SendUpdateNotificationModeRequest(bool do_not_disturb_enabled) override; void SendUpdateBatteryModeRequest(bool battery_saver_mode_enabled) override; void SendDismissNotificationRequest(int64_t notification_id) override;
diff --git a/chromeos/components/phonehub/message_sender_unittest.cc b/chromeos/components/phonehub/message_sender_unittest.cc index 9d1d053..5df0ddd 100644 --- a/chromeos/components/phonehub/message_sender_unittest.cc +++ b/chromeos/components/phonehub/message_sender_unittest.cc
@@ -64,10 +64,8 @@ proto::CrosState request; request.set_notification_setting( proto::NotificationSetting::NOTIFICATIONS_ON); - request.set_camera_roll_setting(proto::CameraRollSetting::CAMERA_ROLL_OFF); - message_sender_->SendCrosState(/*notification_enabled=*/true, - /*camera_roll_enabled=*/false); + message_sender_->SendCrosState(/*notification_enabled=*/true); VerifyMessage(proto::MessageType::PROVIDE_CROS_STATE, &request, fake_connection_manager_->sent_messages().back()); }
diff --git a/chromeos/components/phonehub/proto/phonehub_api.proto b/chromeos/components/phonehub/proto/phonehub_api.proto index 6ff53376..527dee8b 100644 --- a/chromeos/components/phonehub/proto/phonehub_api.proto +++ b/chromeos/components/phonehub/proto/phonehub_api.proto
@@ -40,11 +40,6 @@ NOTIFICATIONS_ON = 1; } -enum CameraRollSetting { - CAMERA_ROLL_OFF = 0; - CAMERA_ROLL_ON = 1; -} - enum ChargingState { NOT_CHARGING = 0; CHARGING_AC = 1; @@ -167,7 +162,6 @@ message CrosState { NotificationSetting notification_setting = 1; - CameraRollSetting camera_roll_setting = 2; } message Action {
diff --git a/chromeos/tast_control.gni b/chromeos/tast_control.gni index ed08b2d..ef9a354f 100644 --- a/chromeos/tast_control.gni +++ b/chromeos/tast_control.gni
@@ -44,6 +44,9 @@ "quicksettings.SignInScreen.battery", "quicksettings.SignInScreen.noaudio_nobattery", "quicksettings.SignInScreen.audio", + + # b/201197372 + "crostini.AppEmacs", ] # To disable a specific test in lacros_all_tast_tests, add it the following
diff --git a/components/app_restore/full_restore_utils.cc b/components/app_restore/full_restore_utils.cc index 9a55a81ad..c718b95 100644 --- a/components/app_restore/full_restore_utils.cc +++ b/components/app_restore/full_restore_utils.cc
@@ -5,7 +5,6 @@ #include "components/app_restore/full_restore_utils.h" #include "base/files/file_path.h" -#include "components/account_id/account_id.h" #include "components/app_restore/app_launch_info.h" #include "components/app_restore/desk_template_read_handler.h" #include "components/app_restore/features.h" @@ -33,16 +32,6 @@ FullRestoreSaveHandler::GetInstance()->SaveWindowInfo(window_info); } -std::unique_ptr<app_restore::AppLaunchInfo> GetArcAppLaunchInfo( - const std::string& app_id, - int32_t session_id) { - if (!full_restore::features::IsFullRestoreEnabled()) - return nullptr; - - return FullRestoreReadHandler::GetInstance()->GetArcAppLaunchInfo(app_id, - session_id); -} - std::unique_ptr<app_restore::WindowInfo> GetWindowInfo(aura::Window* window) { if (!full_restore::features::IsFullRestoreEnabled()) return nullptr; @@ -82,14 +71,6 @@ ->GetArcRestoreWindowIdForSessionId(session_id); } -bool ShouldRestore(const AccountId& account_id) { - return FullRestoreInfo::GetInstance()->ShouldRestore(account_id); -} - -bool CanPerformRestore(const AccountId& account_id) { - return FullRestoreInfo::GetInstance()->CanPerformRestore(account_id); -} - void SetActiveProfilePath(const base::FilePath& profile_path) { if (!full_restore::features::IsFullRestoreEnabled()) return;
diff --git a/components/app_restore/full_restore_utils.h b/components/app_restore/full_restore_utils.h index bc93386c..72ed5dd 100644 --- a/components/app_restore/full_restore_utils.h +++ b/components/app_restore/full_restore_utils.h
@@ -11,8 +11,6 @@ #include "ui/base/class_property.h" #include "ui/views/widget/widget.h" -class AccountId; - namespace app_restore { struct AppLaunchInfo; struct WindowInfo; @@ -51,13 +49,6 @@ COMPONENT_EXPORT(APP_RESTORE) void SaveWindowInfo(const app_restore::WindowInfo& window_info); -// Gets the ARC app launch information from the full restore file for `app_id` -// and `session_id`. -COMPONENT_EXPORT(APP_RESTORE) -std::unique_ptr<app_restore::AppLaunchInfo> GetArcAppLaunchInfo( - const std::string& app_id, - int32_t session_id); - // Gets the window information from the full restore file for |window|. COMPONENT_EXPORT(APP_RESTORE) std::unique_ptr<app_restore::WindowInfo> GetWindowInfo(aura::Window* window); @@ -75,17 +66,6 @@ COMPONENT_EXPORT(APP_RESTORE) int32_t GetArcRestoreWindowIdForSessionId(int32_t session_id); -// Returns true if we should restore apps and pages based on the restore setting -// and the user's choice from the notification. Otherwise, returns false. -COMPONENT_EXPORT(APP_RESTORE) bool ShouldRestore(const AccountId& account_id); - -// Returns true if the restore pref is 'Always' or 'Ask every time', as we -// could restore apps and pages based on the user's choice from the -// notification for |account_id|. Otherwise, returns false, when the restore -// pref is 'Do not restore'. -COMPONENT_EXPORT(APP_RESTORE) -bool CanPerformRestore(const AccountId& account_id); - // Sets the current active profile path. COMPONENT_EXPORT(APP_RESTORE) void SetActiveProfilePath(const base::FilePath& profile_path);
diff --git a/components/autofill_assistant/browser/devtools/devtools_api/domain_types_h.template b/components/autofill_assistant/browser/devtools/devtools_api/domain_types_h.template index 1ab94684..3a3a20b0 100644 --- a/components/autofill_assistant/browser/devtools/devtools_api/domain_types_h.template +++ b/components/autofill_assistant/browser/devtools/devtools_api/domain_types_h.template
@@ -29,6 +29,8 @@ class {{type.id}} { public: static {{resolve_type(type).pass_type}} Parse(const base::Value& value, ErrorReporter* errors); + {{type.id}}(const {{type.id}}&) = delete; + {{type.id}}& operator=(const {{type.id}}&) = delete; ~{{type.id}}() { } {% for property in type.properties %} @@ -107,8 +109,6 @@ {{resolve_type(property).type}} {{property.name | camelcase_to_hacker_style}}_; {% endif %} {% endfor %} - - DISALLOW_COPY_AND_ASSIGN({{type.id}}); }; {% endfor %}
diff --git a/components/certificate_transparency/data/log_list.json b/components/certificate_transparency/data/log_list.json index 06e803ee..14b9f197b 100644 --- a/components/certificate_transparency/data/log_list.json +++ b/components/certificate_transparency/data/log_list.json
@@ -1,6 +1,6 @@ { - "version": "3.40", - "log_list_timestamp": "2021-09-24T01:34:12Z", + "version": "3.42", + "log_list_timestamp": "2021-09-26T01:34:08Z", "operators": [ { "name": "Google",
diff --git a/components/exo/wayland/zcr_remote_shell_impl.cc b/components/exo/wayland/zcr_remote_shell_impl.cc index fc21b8f..b07b2ef 100644 --- a/components/exo/wayland/zcr_remote_shell_impl.cc +++ b/components/exo/wayland/zcr_remote_shell_impl.cc
@@ -753,10 +753,10 @@ if (wl_resource_get_version(resource) >= event_mapping_.send_bounds_changed_since_version) { if (needs_send_display_metrics_) { - pending_bounds_changes_.emplace( - std::make_pair<wl_resource*, BoundsChangeData>( - std::move(resource), - BoundsChangeData(display_id, bounds_in_display, reason))); + // We store only the latest bounds for each |resource|. + pending_bounds_changes_.insert_or_assign( + std::move(resource), + BoundsChangeData(display_id, bounds_in_display, reason)); return; } SendBoundsChanged(resource, display_id, bounds_in_display, reason);
diff --git a/components/messages/android/internal/java/src/org/chromium/components/messages/MessagesMetrics.java b/components/messages/android/internal/java/src/org/chromium/components/messages/MessagesMetrics.java index b8c393ec0..94b542a 100644 --- a/components/messages/android/internal/java/src/org/chromium/components/messages/MessagesMetrics.java +++ b/components/messages/android/internal/java/src/org/chromium/components/messages/MessagesMetrics.java
@@ -105,6 +105,8 @@ return "SharedHighlighting"; case MessageIdentifier.NEAR_OOM_REDUCTION: return "NearOomReduction"; + case MessageIdentifier.INSTALLABLE_AMBIENT_BADGE: + return "InstallableAmbientBadge"; default: return "Unknown"; }
diff --git a/components/messages/android/message_enums.h b/components/messages/android/message_enums.h index bf3f5f0b..118de04 100644 --- a/components/messages/android/message_enums.h +++ b/components/messages/android/message_enums.h
@@ -90,6 +90,7 @@ SYNC_ERROR = 17, SHARED_HIGHLIGHTING = 18, NEAR_OOM_REDUCTION = 19, + INSTALLABLE_AMBIENT_BADGE = 20, // Insert new values before this line. COUNT
diff --git a/components/nacl/browser/pnacl_host.cc b/components/nacl/browser/pnacl_host.cc index da9f08c..7a7061c 100644 --- a/components/nacl/browser/pnacl_host.cc +++ b/components/nacl/browser/pnacl_host.cc
@@ -8,7 +8,6 @@ #include <utility> #include "base/bind.h" -#include "base/callback_helpers.h" #include "base/debug/leak_annotations.h" #include "base/files/file_path.h" #include "base/files/file_util.h" @@ -35,7 +34,7 @@ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT, base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, - base::BindOnce(base::DoNothing::Once<base::File>(), std::move(file))); + base::BindOnce([](base::File) {}, std::move(file))); } } // namespace
diff --git a/components/policy/core/common/cloud/external_policy_data_fetcher.cc b/components/policy/core/common/cloud/external_policy_data_fetcher.cc index ea94142..3c66de5 100644 --- a/components/policy/core/common/cloud/external_policy_data_fetcher.cc +++ b/components/policy/core/common/cloud/external_policy_data_fetcher.cc
@@ -7,7 +7,6 @@ #include <utility> #include "base/bind.h" -#include "base/callback_helpers.h" #include "base/check_op.h" #include "base/location.h" #include "base/sequenced_task_runner.h" @@ -271,7 +270,7 @@ // OnJobFinished() callback may still be pending for the canceled |job|. job_task_runner_->PostTaskAndReply( FROM_HERE, base::BindOnce(&Job::Cancel, base::Unretained(job)), - base::BindOnce(base::DoNothing::Once<Job*>(), base::Owned(job))); + base::BindOnce([](Job*) {}, base::Owned(job))); } void ExternalPolicyDataFetcher::OnJobFinished(
diff --git a/components/policy/proto/device_management_backend.proto b/components/policy/proto/device_management_backend.proto index 7449de09..7a16b3f 100644 --- a/components/policy/proto/device_management_backend.proto +++ b/components/policy/proto/device_management_backend.proto
@@ -3013,7 +3013,8 @@ optional int32 dictionary_attack_threshold = 7; optional bool dictionary_attack_lockout_in_effect = 8; optional int32 dictionary_attack_lockout_seconds_remaining = 9; - optional bool boot_lockbox_finalized = 10; + // DEPRECATED: Not filled by the client anymore (since b/172748724). + optional bool boot_lockbox_finalized = 10 [deprecated = true]; optional bool owner_password_is_present = 11; }
diff --git a/components/qr_code_generator/qr_code_generator.cc b/components/qr_code_generator/qr_code_generator.cc index cb637ed..817674a 100644 --- a/components/qr_code_generator/qr_code_generator.cc +++ b/components/qr_code_generator/qr_code_generator.cc
@@ -61,6 +61,8 @@ __builtin_unreachable(); } } + QRVersionInfo(const QRVersionInfo&) = delete; + QRVersionInfo& operator=(const QRVersionInfo&) = delete; // The version of the QR code. const int version; @@ -136,8 +138,6 @@ return true; } - - DISALLOW_COPY_AND_ASSIGN(QRVersionInfo); }; namespace {
diff --git a/components/services/app_service/public/cpp/icon_coalescer.cc b/components/services/app_service/public/cpp/icon_coalescer.cc index 06497c44..ba9246c 100644 --- a/components/services/app_service/public/cpp/icon_coalescer.cc +++ b/components/services/app_service/public/cpp/icon_coalescer.cc
@@ -9,7 +9,6 @@ #include <vector> #include "base/callback.h" -#include "base/callback_helpers.h" namespace apps { @@ -139,10 +138,10 @@ return std::make_unique<IconLoader::Releaser>( nullptr, - // The DoNothing callback does nothiing explicitly, but after it runs, it - // implicitly decrements the scoped_refptr's shared reference count, and - // therefore possibly deletes the underlying IconLoader::Releaser. - base::BindOnce(base::DoNothing::Once<scoped_refptr<RefCountedReleaser>>(), + // The callback does nothing explicitly, but after it runs, it implicitly + // decrements the scoped_refptr's shared reference count, and therefore + // possibly deletes the underlying IconLoader::Releaser. + base::BindOnce([](scoped_refptr<RefCountedReleaser>) {}, std::move(shared_releaser))); }
diff --git a/components/services/app_service/public/cpp/intent_filter_util.cc b/components/services/app_service/public/cpp/intent_filter_util.cc index d9a76d4..1e43c0ea 100644 --- a/components/services/app_service/public/cpp/intent_filter_util.cc +++ b/components/services/app_service/public/cpp/intent_filter_util.cc
@@ -4,11 +4,43 @@ #include "components/services/app_service/public/cpp/intent_filter_util.h" +#include "base/strings/string_util.h" #include "components/services/app_service/public/cpp/intent_util.h" #include "url/url_constants.h" namespace { +bool ConditionValuesHaveOverlap(const apps::mojom::ConditionValuePtr& value1, + const apps::mojom::ConditionValuePtr& value2) { + if (value1 == value2) { + return true; + } + + if (value1->match_type == apps::mojom::PatternMatchType::kPrefix && + value2->match_type == apps::mojom::PatternMatchType::kLiteral) { + return base::StartsWith(/*str=*/value2->value, + /*search_for=*/value1->value); + } + + if (value1->match_type == apps::mojom::PatternMatchType::kLiteral && + value2->match_type == apps::mojom::PatternMatchType::kPrefix) { + return base::StartsWith(/*str=*/value1->value, + /*search_for=*/value2->value); + } + + if (value1->match_type == apps::mojom::PatternMatchType::kPrefix && + value2->match_type == apps::mojom::PatternMatchType::kPrefix) { + return base::StartsWith(/*str=*/value1->value, + /*search_for=*/value2->value) || + base::StartsWith(/*str=*/value2->value, + /*search_for=*/value1->value); + } + + // TODO(crbug.com/1251530): Handle more cases where values are overlapping. + + return false; +} + bool ConditionsHaveOverlap(const apps::mojom::ConditionPtr& condition1, const apps::mojom::ConditionPtr& condition2) { if (condition1->condition_type != condition2->condition_type) { @@ -18,7 +50,7 @@ // is an overlap. for (auto& value1 : condition1->condition_values) { for (auto& value2 : condition2->condition_values) { - if (value1 == value2) { + if (ConditionValuesHaveOverlap(value1, value2)) { return true; } }
diff --git a/components/services/app_service/public/cpp/intent_filter_util_unittest.cc b/components/services/app_service/public/cpp/intent_filter_util_unittest.cc index 801e75b..cc05c27 100644 --- a/components/services/app_service/public/cpp/intent_filter_util_unittest.cc +++ b/components/services/app_service/public/cpp/intent_filter_util_unittest.cc
@@ -259,3 +259,60 @@ apps::mojom::PatternMatchType::kNone, host_filter); ASSERT_FALSE(apps_util::IsSupportedLink(browser_filter)); } + +TEST_F(IntentFilterUtilTest, HostMatchOverlap) { + auto google_domain_filter = MakeFilter( + "https", "www.google.com", "/", apps::mojom::PatternMatchType::kLiteral); + + auto maps_domain_filter = MakeFilter("https", "maps.google.com", "/", + apps::mojom::PatternMatchType::kLiteral); + + ASSERT_FALSE( + apps_util::FiltersHaveOverlap(maps_domain_filter, google_domain_filter)); + + apps_util::AddConditionValue( + apps::mojom::ConditionType::kHost, "www.google.com", + apps::mojom::PatternMatchType::kNone, maps_domain_filter); + + ASSERT_TRUE( + apps_util::FiltersHaveOverlap(maps_domain_filter, google_domain_filter)); +} + +TEST_F(IntentFilterUtilTest, PatternMatchOverlap) { + auto literal_pattern_filter1 = MakeFilter( + "https", "www.example.com", "/", apps::mojom::PatternMatchType::kLiteral); + apps_util::AddConditionValue(apps::mojom::ConditionType::kPattern, "/foo", + apps::mojom::PatternMatchType::kLiteral, + literal_pattern_filter1); + + auto literal_pattern_filter2 = + MakeFilter("https", "www.example.com", "/foo/bar", + apps::mojom::PatternMatchType::kLiteral); + apps_util::AddConditionValue(apps::mojom::ConditionType::kPattern, "/bar", + apps::mojom::PatternMatchType::kLiteral, + literal_pattern_filter2); + + ASSERT_FALSE(apps_util::FiltersHaveOverlap(literal_pattern_filter1, + literal_pattern_filter2)); + + auto root_prefix_filter = MakeFilter("https", "www.example.com", "/", + apps::mojom::PatternMatchType::kPrefix); + ASSERT_TRUE(apps_util::FiltersHaveOverlap(root_prefix_filter, + literal_pattern_filter1)); + ASSERT_TRUE(apps_util::FiltersHaveOverlap(root_prefix_filter, + literal_pattern_filter2)); + + auto bar_prefix_filter = MakeFilter("https", "www.example.com", "/bar", + apps::mojom::PatternMatchType::kPrefix); + ASSERT_FALSE(apps_util::FiltersHaveOverlap(bar_prefix_filter, + literal_pattern_filter1)); + ASSERT_TRUE(apps_util::FiltersHaveOverlap(bar_prefix_filter, + literal_pattern_filter2)); + ASSERT_TRUE( + apps_util::FiltersHaveOverlap(bar_prefix_filter, root_prefix_filter)); + + auto foo_prefix_filter = MakeFilter("https", "www.example.com", "/foo", + apps::mojom::PatternMatchType::kPrefix); + ASSERT_FALSE( + apps_util::FiltersHaveOverlap(foo_prefix_filter, bar_prefix_filter)); +}
diff --git a/components/viz/common/surfaces/frame_sink_id_allocator.h b/components/viz/common/surfaces/frame_sink_id_allocator.h index 469c179..aca14de 100644 --- a/components/viz/common/surfaces/frame_sink_id_allocator.h +++ b/components/viz/common/surfaces/frame_sink_id_allocator.h
@@ -18,6 +18,9 @@ constexpr explicit FrameSinkIdAllocator(uint32_t client_id) : client_id_(client_id), next_sink_id_(1u) {} + FrameSinkIdAllocator(const FrameSinkIdAllocator&) = delete; + FrameSinkIdAllocator& operator=(const FrameSinkIdAllocator&) = delete; + FrameSinkId NextFrameSinkId() { return FrameSinkId(client_id_, next_sink_id_++); } @@ -27,8 +30,6 @@ private: const uint32_t client_id_; uint32_t next_sink_id_; - - DISALLOW_COPY_AND_ASSIGN(FrameSinkIdAllocator); }; } // namespace viz
diff --git a/components/webapps/browser/BUILD.gn b/components/webapps/browser/BUILD.gn index d96f6468..f71214f 100644 --- a/components/webapps/browser/BUILD.gn +++ b/components/webapps/browser/BUILD.gn
@@ -94,6 +94,7 @@ "//components/feature_engagement", "//components/infobars/android", "//components/infobars/content", + "//components/messages/android", "//components/messages/android:feature_flags", "//components/strings", "//components/url_formatter", @@ -150,4 +151,9 @@ "//testing/gtest", "//third_party/blink/public/mojom:mojom_platform_headers", ] + + if (is_android) { + sources += [ "android/installable/installable_ambient_badge_message_controller_unittest.cc" ] + deps += [ "//components/messages/android:test_support" ] + } }
diff --git a/components/webapps/browser/android/app_banner_manager_android.cc b/components/webapps/browser/android/app_banner_manager_android.cc index 1635330..5b0335bf 100644 --- a/components/webapps/browser/android/app_banner_manager_android.cc +++ b/components/webapps/browser/android/app_banner_manager_android.cc
@@ -556,7 +556,7 @@ if (base::FeatureList::IsEnabled(features::kInstallableAmbientBadgeMessage) && base::FeatureList::IsEnabled( messages::kMessagesForAndroidInfrastructure)) { - message_controller_.EnqueueMessage(); + message_controller_.EnqueueMessage(web_contents(), GetAppName()); } else { InstallableAmbientBadgeInfoBarDelegate::Create( web_contents(), weak_factory_.GetWeakPtr(), GetAppName(), primary_icon_,
diff --git a/components/webapps/browser/android/installable/installable_ambient_badge_message_controller.cc b/components/webapps/browser/android/installable/installable_ambient_badge_message_controller.cc index b9854fe..19b8ffc 100644 --- a/components/webapps/browser/android/installable/installable_ambient_badge_message_controller.cc +++ b/components/webapps/browser/android/installable/installable_ambient_badge_message_controller.cc
@@ -4,19 +4,66 @@ #include "components/webapps/browser/android/installable/installable_ambient_badge_message_controller.h" +#include "base/bind.h" +#include "components/messages/android/message_dispatcher_bridge.h" +#include "components/strings/grit/components_strings.h" +#include "ui/base/l10n/l10n_util.h" + namespace webapps { -bool InstallableAmbientBadgeMessageController::IsMessageEnqueued() { - // TODO(crbug.com/1247374): Implement. - return false; +InstallableAmbientBadgeMessageController:: + InstallableAmbientBadgeMessageController() = default; + +InstallableAmbientBadgeMessageController:: + ~InstallableAmbientBadgeMessageController() { + DismissMessage(); } -void InstallableAmbientBadgeMessageController::EnqueueMessage() { - // TODO(crbug.com/1247374): Implement. +bool InstallableAmbientBadgeMessageController::IsMessageEnqueued() { + return message_ != nullptr; +} + +void InstallableAmbientBadgeMessageController::EnqueueMessage( + content::WebContents* web_contents, + const std::u16string& app_name) { + DCHECK(!message_); + + message_ = std::make_unique<messages::MessageWrapper>( + messages::MessageIdentifier::INSTALLABLE_AMBIENT_BADGE, + base::BindOnce( + &InstallableAmbientBadgeMessageController::HandleInstallButtonClicked, + base::Unretained(this)), + base::BindOnce( + &InstallableAmbientBadgeMessageController::HandleMessageDismissed, + base::Unretained(this))); + + // TODO(crbug.com/1247374): Adjust title string, add description and icon. + message_->SetTitle(l10n_util::GetStringFUTF16( + IDS_AMBIENT_BADGE_INSTALL_ALTERNATIVE, app_name)); + message_->SetPrimaryButtonText(l10n_util::GetStringUTF16(IDS_INSTALL)); + messages::MessageDispatcherBridge::Get()->EnqueueMessage( + message_.get(), web_contents, messages::MessageScopeType::NAVIGATION, + messages::MessagePriority::kNormal); } void InstallableAmbientBadgeMessageController::DismissMessage() { + if (!message_) + return; + + messages::MessageDispatcherBridge::Get()->DismissMessage( + message_.get(), messages::DismissReason::UNKNOWN); +} + +void InstallableAmbientBadgeMessageController::HandleInstallButtonClicked() { // TODO(crbug.com/1247374): Implement. } +void InstallableAmbientBadgeMessageController::HandleMessageDismissed( + messages::DismissReason dismiss_reason) { + DCHECK(message_); + message_.reset(); + // TODO(crbug.com/1247374): Add a call to + // AppBannerManagerAndroid::BadgeDismissed to record metrics. +} + } // namespace webapps
diff --git a/components/webapps/browser/android/installable/installable_ambient_badge_message_controller.h b/components/webapps/browser/android/installable/installable_ambient_badge_message_controller.h index 0e661d2..72bc89d 100644 --- a/components/webapps/browser/android/installable/installable_ambient_badge_message_controller.h +++ b/components/webapps/browser/android/installable/installable_ambient_badge_message_controller.h
@@ -5,6 +5,16 @@ #ifndef COMPONENTS_WEBAPPS_BROWSER_ANDROID_INSTALLABLE_INSTALLABLE_AMBIENT_BADGE_MESSAGE_CONTROLLER_H_ #define COMPONENTS_WEBAPPS_BROWSER_ANDROID_INSTALLABLE_INSTALLABLE_AMBIENT_BADGE_MESSAGE_CONTROLLER_H_ +#include <memory> +#include <string> + +#include "components/messages/android/message_enums.h" +#include "components/messages/android/message_wrapper.h" + +namespace content { +class WebContents; +} // namespace content + namespace webapps { // Message controller for a message shown to users when they visit a @@ -12,6 +22,9 @@ // flow. class InstallableAmbientBadgeMessageController { public: + InstallableAmbientBadgeMessageController(); + ~InstallableAmbientBadgeMessageController(); + // Returns true if the message was enqueued with EnqueueMessage() method, but // wasn't dismissed yet. bool IsMessageEnqueued(); @@ -19,13 +32,18 @@ // Enqueues a message to be displayed on the screen. Typically there are no // other messages on the screen and enqueued message will get displayed // immediately. - void EnqueueMessage(); + void EnqueueMessage(content::WebContents* web_contents, + const std::u16string& app_name); // Dismisses displayed message. This method is safe to call when there is no // displayed message. void DismissMessage(); private: + void HandleInstallButtonClicked(); + void HandleMessageDismissed(messages::DismissReason dismiss_reason); + + std::unique_ptr<messages::MessageWrapper> message_; }; } // namespace webapps
diff --git a/components/webapps/browser/android/installable/installable_ambient_badge_message_controller_unittest.cc b/components/webapps/browser/android/installable/installable_ambient_badge_message_controller_unittest.cc new file mode 100644 index 0000000..736a5720 --- /dev/null +++ b/components/webapps/browser/android/installable/installable_ambient_badge_message_controller_unittest.cc
@@ -0,0 +1,92 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/webapps/browser/android/installable/installable_ambient_badge_message_controller.h" + +#include "components/messages/android/mock_message_dispatcher_bridge.h" +#include "content/public/test/test_renderer_host.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace webapps { + +namespace { +constexpr char16_t kAppName[] = u"App name"; +} // namespace + +class InstallableAmbientBadgeMessageControllerTest + : public content::RenderViewHostTestHarness { + public: + void SetUp() override; + void TearDown() override; + + void EnqueueMessage(); + void DismissMessage(bool expected); + + InstallableAmbientBadgeMessageController* message_controller() { + return &message_controller_; + } + + messages::MessageWrapper* message_wrapper() { return message_wrapper_; } + + private: + messages::MockMessageDispatcherBridge message_dispatcher_bridge_; + InstallableAmbientBadgeMessageController message_controller_; + messages::MessageWrapper* message_wrapper_ = nullptr; +}; + +void InstallableAmbientBadgeMessageControllerTest::SetUp() { + content::RenderViewHostTestHarness::SetUp(); + messages::MessageDispatcherBridge::SetInstanceForTesting( + &message_dispatcher_bridge_); +} + +void InstallableAmbientBadgeMessageControllerTest::TearDown() { + messages::MessageDispatcherBridge::SetInstanceForTesting(nullptr); + content::RenderViewHostTestHarness::TearDown(); +} + +void InstallableAmbientBadgeMessageControllerTest::EnqueueMessage() { + EXPECT_CALL(message_dispatcher_bridge_, EnqueueMessage) + .WillOnce(testing::DoAll(testing::SaveArg<0>(&message_wrapper_), + testing::Return(true))); + message_controller_.EnqueueMessage(web_contents(), kAppName); +} + +void InstallableAmbientBadgeMessageControllerTest::DismissMessage( + bool bridge_dismiss_call_expected) { + if (bridge_dismiss_call_expected) { + EXPECT_CALL(message_dispatcher_bridge_, DismissMessage) + .WillOnce([](messages::MessageWrapper* message, + messages::DismissReason dismiss_reason) { + message->HandleDismissCallback(base::android::AttachCurrentThread(), + static_cast<int>(dismiss_reason)); + }); + } + message_controller_.DismissMessage(); +} + +// Tests InstallableAmbientBadgeMessageController API: EnqueueMessage, +// IsMessageEnqueued, DismissMessage. +TEST_F(InstallableAmbientBadgeMessageControllerTest, APITest) { + ASSERT_FALSE(message_controller()->IsMessageEnqueued()); + EnqueueMessage(); + ASSERT_TRUE(message_controller()->IsMessageEnqueued()); + DismissMessage(true); + ASSERT_FALSE(message_controller()->IsMessageEnqueued()); + // Calling DismissMessage when there is no message enqueued should not fail or + // result in a call to MessageDispatcherBridge. + DismissMessage(false); +} + +// Tests that message properties are set correctly. +TEST_F(InstallableAmbientBadgeMessageControllerTest, MessagePropertyValues) { + EnqueueMessage(); + + EXPECT_NE(std::u16string::npos, message_wrapper()->GetTitle().find(kAppName)); + EXPECT_FALSE(message_wrapper()->GetPrimaryButtonText().empty()); + + DismissMessage(true); +} + +} // namespace webapps \ No newline at end of file
diff --git a/content/browser/file_system_access/file_system_access_file_delegate_host_impl.h b/content/browser/file_system_access/file_system_access_file_delegate_host_impl.h index 762f76bc..b7e7168 100644 --- a/content/browser/file_system_access/file_system_access_file_delegate_host_impl.h +++ b/content/browser/file_system_access/file_system_access_file_delegate_host_impl.h
@@ -65,15 +65,15 @@ // provided method with the provided arguments (and the wrapped callback). // // FileSystemOperationRunner assumes file_system_context() is kept alive, to - // make sure this happens it is bound to a DoNothing callback. + // make sure this happens it is bound to a callback that otherwise does + // nothing. manager() ->operation_runner() .AsyncCall(base::IgnoreResult(method)) .WithArgs(std::forward<ArgsMinusCallback>(args)..., std::move(wrapped_callback)) - .Then(base::BindOnce( - base::DoNothing::Once<scoped_refptr<storage::FileSystemContext>>(), - base::WrapRefCounted(file_system_context()))); + .Then(base::BindOnce([](scoped_refptr<storage::FileSystemContext>) {}, + base::WrapRefCounted(file_system_context()))); } // Same as the previous overload, but using RepeatingCallback and // BindRepeating instead. @@ -103,15 +103,15 @@ // provided method with the provided arguments (and the wrapped callback). // // FileSystemOperationRunner assumes file_system_context() is kept alive, to - // make sure this happens it is bound to a DoNothing callback. + // make sure this happens it is bound to a callback that otherwise does + // nothing. manager() ->operation_runner() .AsyncCall(base::IgnoreResult(method)) .WithArgs(std::forward<ArgsMinusCallback>(args)..., std::move(wrapped_callback)) - .Then(base::BindOnce( - base::DoNothing::Once<scoped_refptr<storage::FileSystemContext>>(), - base::WrapRefCounted(file_system_context()))); + .Then(base::BindOnce([](scoped_refptr<storage::FileSystemContext>) {}, + base::WrapRefCounted(file_system_context()))); } void OnDisconnect(); @@ -145,4 +145,4 @@ } // namespace content -#endif // CONTENT_BROWSER_FILE_SYSTEM_ACCESS_FILE_SYSTEM_ACCESS_FILE_DELEGATE_HOST_IMPL_H_ \ No newline at end of file +#endif // CONTENT_BROWSER_FILE_SYSTEM_ACCESS_FILE_SYSTEM_ACCESS_FILE_DELEGATE_HOST_IMPL_H_
diff --git a/content/browser/file_system_access/file_system_access_file_writer_impl_unittest.cc b/content/browser/file_system_access/file_system_access_file_writer_impl_unittest.cc index 57e9140..8744357a 100644 --- a/content/browser/file_system_access/file_system_access_file_writer_impl_unittest.cc +++ b/content/browser/file_system_access/file_system_access_file_writer_impl_unittest.cc
@@ -198,8 +198,7 @@ contents, mojo::StringDataSource::AsyncWritingMode:: STRING_MAY_BE_INVALIDATED_BEFORE_COMPLETION), base::BindOnce( - base::DoNothing::Once<std::unique_ptr<mojo::DataPipeProducer>, - MojoResult>(), + [](std::unique_ptr<mojo::DataPipeProducer>, MojoResult) {}, std::move(producer))); return consumer_handle; }
diff --git a/content/browser/file_system_access/file_system_access_handle_base.h b/content/browser/file_system_access/file_system_access_handle_base.h index 4cdd96b..0f37ddb 100644 --- a/content/browser/file_system_access/file_system_access_handle_base.h +++ b/content/browser/file_system_access/file_system_access_handle_base.h
@@ -6,7 +6,6 @@ #define CONTENT_BROWSER_FILE_SYSTEM_ACCESS_FILE_SYSTEM_ACCESS_HANDLE_BASE_H_ #include "base/bind_post_task.h" -#include "base/callback_helpers.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "base/threading/sequence_bound.h" @@ -137,15 +136,15 @@ // provided method with the provided arguments (and the wrapped callback). // // FileSystemOperationRunner assumes file_system_context() is kept alive, to - // make sure this happens it is bound to a DoNothing callback. + // make sure this happens it is bound to a callback that otherwise does + // nothing. manager() ->operation_runner() .AsyncCall(base::IgnoreResult(method)) .WithArgs(std::forward<ArgsMinusCallback>(args)..., std::move(wrapped_callback)) - .Then(base::BindOnce( - base::DoNothing::Once<scoped_refptr<storage::FileSystemContext>>(), - base::WrapRefCounted(file_system_context()))); + .Then(base::BindOnce([](scoped_refptr<storage::FileSystemContext>) {}, + base::WrapRefCounted(file_system_context()))); } // Same as the previous overload, but using RepeatingCallback and // BindRepeating instead. @@ -175,15 +174,15 @@ // provided method with the provided arguments (and the wrapped callback). // // FileSystemOperationRunner assumes file_system_context() is kept alive, to - // make sure this happens it is bound to a DoNothing callback. + // make sure this happens it is bound to a callback that otherwise does + // nothing. manager() ->operation_runner() .AsyncCall(base::IgnoreResult(method)) .WithArgs(std::forward<ArgsMinusCallback>(args)..., std::move(wrapped_callback)) - .Then(base::BindOnce( - base::DoNothing::Once<scoped_refptr<storage::FileSystemContext>>(), - base::WrapRefCounted(file_system_context()))); + .Then(base::BindOnce([](scoped_refptr<storage::FileSystemContext>) {}, + base::WrapRefCounted(file_system_context()))); } SEQUENCE_CHECKER(sequence_checker_);
diff --git a/content/browser/interest_group/ad_auction_service_impl.cc b/content/browser/interest_group/ad_auction_service_impl.cc index 00f1891..03e60fb 100644 --- a/content/browser/interest_group/ad_auction_service_impl.cc +++ b/content/browser/interest_group/ad_auction_service_impl.cc
@@ -87,10 +87,9 @@ // TODO(qingxin): time out these requests if they take too long. simple_url_loader_ptr->DownloadHeadersOnly( url_loader_factory, - base::BindOnce( - base::DoNothing::Once<std::unique_ptr<network::SimpleURLLoader>, - scoped_refptr<net::HttpResponseHeaders>>(), - std::move(simple_url_loader))); + base::BindOnce([](std::unique_ptr<network::SimpleURLLoader>, + scoped_refptr<net::HttpResponseHeaders>) {}, + std::move(simple_url_loader))); } bool IsAuctionValid(const blink::mojom::AuctionAdConfig& config) {
diff --git a/content/browser/media/capture/fake_video_capture_stack.cc b/content/browser/media/capture/fake_video_capture_stack.cc index 051df3a..572f65f 100644 --- a/content/browser/media/capture/fake_video_capture_stack.cc +++ b/content/browser/media/capture/fake_video_capture_stack.cc
@@ -9,7 +9,6 @@ #include <utility> #include "base/bind.h" -#include "base/callback_helpers.h" #include "content/browser/media/capture/frame_test_util.h" #include "media/base/video_frame.h" #include "media/capture/video/video_frame_receiver.h" @@ -76,8 +75,7 @@ // This destruction observer will unmap the shared memory when the // VideoFrame goes out-of-scope. video_frame->AddDestructionObserver(base::BindOnce( - base::DoNothing::Once<base::ReadOnlySharedMemoryMapping>(), - std::move(mapping))); + [](base::ReadOnlySharedMemoryMapping) {}, std::move(mapping))); // This destruction observer will notify the video capture device once all // downstream code is done using the VideoFrame. video_frame->AddDestructionObserver(base::BindOnce(
diff --git a/content/browser/network_service_instance_impl.cc b/content/browser/network_service_instance_impl.cc index c722f26..be5fbf2 100644 --- a/content/browser/network_service_instance_impl.cc +++ b/content/browser/network_service_instance_impl.cc
@@ -10,7 +10,6 @@ #include <utility> #include "base/bind.h" -#include "base/callback_helpers.h" #include "base/dcheck_is_on.h" #include "base/environment.h" #include "base/feature_list.h" @@ -181,9 +180,8 @@ mojo::PendingReceiver<network::mojom::NetworkService> receiver) { // The test interface doesn't need to be implemented in the in-process case. auto registry = std::make_unique<service_manager::BinderRegistry>(); - registry->AddInterface( - base::DoNothing::Repeatedly< - mojo::PendingReceiver<network::mojom::NetworkServiceTest>>()); + registry->AddInterface(base::BindRepeating( + [](mojo::PendingReceiver<network::mojom::NetworkServiceTest>) {})); g_in_process_instance = new network::NetworkService( std::move(registry), std::move(receiver), true /* delay_initialization_until_set_client */);
diff --git a/content/browser/renderer_host/media/in_process_launched_video_capture_device.cc b/content/browser/renderer_host/media/in_process_launched_video_capture_device.cc index a5dddb2..dbc962a 100644 --- a/content/browser/renderer_host/media/in_process_launched_video_capture_device.cc +++ b/content/browser/renderer_host/media/in_process_launched_video_capture_device.cc
@@ -7,7 +7,6 @@ #include <utility> #include "base/bind.h" -#include "base/callback_helpers.h" #include "base/metrics/histogram_macros.h" #include "build/build_config.h" #include "content/common/buildflags.h" @@ -47,8 +46,7 @@ FROM_HERE, base::BindOnce( &StopAndReleaseDeviceOnDeviceThread, device_ptr, - base::BindOnce(base::DoNothing::Once< - scoped_refptr<base::SingleThreadTaskRunner>>(), + base::BindOnce([](scoped_refptr<base::SingleThreadTaskRunner>) {}, device_task_runner_))); }
diff --git a/content/browser/renderer_host/policy_container_host.cc b/content/browser/renderer_host/policy_container_host.cc index b1c839c..d14244f 100644 --- a/content/browser/renderer_host/policy_container_host.cc +++ b/content/browser/renderer_host/policy_container_host.cc
@@ -4,7 +4,6 @@ #include "content/browser/renderer_host/policy_container_host.h" -#include "base/callback_helpers.h" #include "base/lazy_instance.h" #include "content/public/browser/browser_thread.h" #include "services/network/public/mojom/content_security_policy.mojom.h" @@ -196,8 +195,7 @@ // the mojo remote) in the renderer process alive. scoped_refptr<PolicyContainerHost> copy = this; policy_container_host_receiver_.set_disconnect_handler(base::BindOnce( - base::DoNothing::Once<scoped_refptr<PolicyContainerHost>>(), - std::move(copy))); + [](scoped_refptr<PolicyContainerHost>) {}, std::move(copy))); } void PolicyContainerHost::IssueKeepAliveHandle(
diff --git a/content/public/browser/background_fetch_description.h b/content/public/browser/background_fetch_description.h index e1bbf63d..472d40a 100644 --- a/content/public/browser/background_fetch_description.h +++ b/content/public/browser/background_fetch_description.h
@@ -28,6 +28,10 @@ uint64_t upload_total_bytes, std::vector<std::string> outstanding_guids, bool start_paused); + BackgroundFetchDescription(const BackgroundFetchDescription&) = delete; + BackgroundFetchDescription& operator=(const BackgroundFetchDescription&) = + delete; + ~BackgroundFetchDescription(); // Fetch identifiers. @@ -49,9 +53,6 @@ // Initialization params. std::vector<std::string> outstanding_guids; bool start_paused; - - private: - DISALLOW_COPY_AND_ASSIGN(BackgroundFetchDescription); }; } // namespace content
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc index ccf42ca..8bc74a5 100644 --- a/content/shell/browser/shell.cc +++ b/content/shell/browser/shell.cc
@@ -11,7 +11,6 @@ #include <string> #include <utility> -#include "base/callback_helpers.h" #include "base/command_line.h" #include "base/location.h" #include "base/macros.h" @@ -643,9 +642,8 @@ for (auto* shell_devtools_bindings : ShellDevToolsBindings::GetInstancesForWebContents(old_contents)) { shell_devtools_bindings->UpdateInspectedWebContents( - new_contents, - base::BindOnce(base::DoNothing::Once<scoped_refptr<PendingCallback>>(), - pending_callback)); + new_contents, base::BindOnce([](scoped_refptr<PendingCallback>) {}, + pending_callback)); } }
diff --git a/docs/gpu/gpu_testing.md b/docs/gpu/gpu_testing.md index b35a4745..ecdb0e0 100644 --- a/docs/gpu/gpu_testing.md +++ b/docs/gpu/gpu_testing.md
@@ -396,9 +396,9 @@ ``` Download inputs files into directory foo: -# (if needed, use "\${platform}" as-is) cipd install "infra/tools/luci/isolated/\${platform}" -root bar -# (if needed) ./bar/isolated login -./bar/isolated download -I https://isolateserver.appspot.com --namespace default-gzip -isolated 07f20bcb2b29b3d8f4ba73166313a37efd651746 -output-dir foo +# (if needed, use "\${platform}" as-is) cipd install "infra/tools/luci/cas/\${platform}" -root bar +# (if needed) ./bar/cas login +./bar/cas download -cas-instance projects/chromium-swarm/instances/default_instance -digest 68ae1d6b22673b0ab7b4427ca1fc2a4761c9ee53474105b9076a23a67e97a18a/647 -dir foo ``` Before attempting to download an isolate, you must ensure you have permission
diff --git a/docs/gpu/gpu_testing_bot_details.md b/docs/gpu/gpu_testing_bot_details.md index 41bf0c1..e7bdb17 100644 --- a/docs/gpu/gpu_testing_bot_details.md +++ b/docs/gpu/gpu_testing_bot_details.md
@@ -120,8 +120,8 @@ 1. `./tools/mb/mb.py isolate //out/Release [target name]` * For example: `./tools/mb/mb.py isolate //out/Release angle_end2end_tests` -1. `./tools/luci-go/isolate batcharchive -I https://isolateserver.appspot.com out/Release/[target name].isolated.gen.json` - * For example: `./tools/luci-go/isolate batcharchive -I https://isolateserver.appspot.com out/Release/angle_end2end_tests.isolated.gen.json` +1. `./tools/luci-go/isolate batcharchive -cas-instance chromium-swarm out/Release/[target name].isolated.gen.json` + * For example: `./tools/luci-go/isolate batcharchive -cas-instance chromium-swarm out/Release/angle_end2end_tests.isolated.gen.json` See the section below on [isolate server credentials](#Isolate-server-credentials). ### Adding your new isolate to the tests that are run on the bots
diff --git a/extensions/browser/content_verifier.cc b/extensions/browser/content_verifier.cc index a6cd3c0..3c0d65d 100644 --- a/extensions/browser/content_verifier.cc +++ b/extensions/browser/content_verifier.cc
@@ -504,8 +504,8 @@ // pointer to fix this. Also add unit test to exercise this code path // explicitly. content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(base::DoNothing::Once<ContentHashCallback>(), - std::move(callback))); + FROM_HERE, + base::BindOnce([](ContentHashCallback) {}, std::move(callback))); return; }
diff --git a/gpu/command_buffer/service/shared_image_backing_factory_gl_image.cc b/gpu/command_buffer/service/shared_image_backing_factory_gl_image.cc index 0f53c19..37b18c78 100644 --- a/gpu/command_buffer/service/shared_image_backing_factory_gl_image.cc +++ b/gpu/command_buffer/service/shared_image_backing_factory_gl_image.cc
@@ -265,12 +265,6 @@ *allow_legacy_mailbox = gr_context_type == GrContextType::kGL; return true; #else -#if BUILDFLAG(IS_CHROMEOS_ASH) - // On ChromeOS Ash, use only for SHARED_MEMORY gmb - if (gmb_type != gfx::SHARED_MEMORY_BUFFER) { - return false; - } -#endif // Doesn't support contexts other than GL for OOPR Canvas if (gr_context_type != GrContextType::kGL && ((usage & SHARED_IMAGE_USAGE_DISPLAY) || @@ -289,7 +283,6 @@ // return false if it needs interop factory return false; } - *allow_legacy_mailbox = gr_context_type == GrContextType::kGL; return true; #endif
diff --git a/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc b/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc index 33307bd..f13a6ba 100644 --- a/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc +++ b/gpu/command_buffer/service/shared_image_backing_factory_ozone.cc
@@ -15,7 +15,6 @@ #include "gpu/command_buffer/service/shared_image_backing_ozone.h" #include "gpu/command_buffer/service/shared_memory_region_wrapper.h" #include "gpu/vulkan/vulkan_device_queue.h" -#include "ui/gfx/buffer_types.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/native_pixmap.h" #include "ui/gl/buildflags.h" @@ -32,7 +31,8 @@ } else if (usage & SHARED_IMAGE_USAGE_SCANOUT) { return gfx::BufferUsage::SCANOUT; } else { - return gfx::BufferUsage::GPU_READ; + NOTREACHED() << "Unsupported usage flags."; + return gfx::BufferUsage::SCANOUT; } } @@ -71,12 +71,6 @@ ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone(); scoped_refptr<gfx::NativePixmap> pixmap = surface_factory->CreateNativePixmap( surface_handle, vk_device, size, buffer_format, GetBufferUsage(usage)); - // Fallback to GPU_READ if cannot create pixmap with SCANOUT - if (!pixmap) { - pixmap = surface_factory->CreateNativePixmap(surface_handle, vk_device, - size, buffer_format, - gfx::BufferUsage::GPU_READ); - } if (!pixmap) { return nullptr; } @@ -189,6 +183,21 @@ gmb_type != gfx::SHARED_MEMORY_BUFFER) { return false; } + // TODO(crbug.com/969114): Not all shared image factory implementations + // support concurrent read/write usage. + if (usage & SHARED_IMAGE_USAGE_CONCURRENT_READ_WRITE) { + return false; + } + + // TODO(hitawala): Until SharedImageBackingOzone supports all use cases prefer + // using SharedImageBackingGLImage instead + bool needs_interop_factory = (gr_context_type == GrContextType::kVulkan && + (usage & SHARED_IMAGE_USAGE_DISPLAY)) || + (usage & SHARED_IMAGE_USAGE_WEBGPU) || + (usage & SHARED_IMAGE_USAGE_VIDEO_DECODE); + if (!needs_interop_factory) { + return false; + } *allow_legacy_mailbox = false; return true;
diff --git a/gpu/command_buffer/service/shared_image_backing_ozone.cc b/gpu/command_buffer/service/shared_image_backing_ozone.cc index 1f85356..39b42ae 100644 --- a/gpu/command_buffer/service/shared_image_backing_ozone.cc +++ b/gpu/command_buffer/service/shared_image_backing_ozone.cc
@@ -199,7 +199,6 @@ gfx::BufferFormat buffer_format = viz::BufferFormat(format()); auto image = base::MakeRefCounted<gl::GLImageNativePixmap>( pixmap_->GetBufferSize(), buffer_format); - image->Initialize(std::move(pixmap_)); return std::make_unique<SharedImageRepresentationOverlayOzone>( manager, this, tracker, image); }
diff --git a/gpu/command_buffer/service/shared_image_factory.cc b/gpu/command_buffer/service/shared_image_factory.cc index e21e257..b41b0952 100644 --- a/gpu/command_buffer/service/shared_image_factory.cc +++ b/gpu/command_buffer/service/shared_image_factory.cc
@@ -244,9 +244,12 @@ } #if BUILDFLAG(IS_CHROMEOS_ASH) - auto ozone_factory = - std::make_unique<SharedImageBackingFactoryOzone>(context_state); - factories_.push_back(std::move(ozone_factory)); + if (gpu_preferences.enable_webgpu || + gr_context_type_ == GrContextType::kVulkan) { + auto ozone_factory = + std::make_unique<SharedImageBackingFactoryOzone>(context_state); + factories_.push_back(std::move(ozone_factory)); + } #endif // IS_CHROMEOS_ASH #if defined(OS_FUCHSIA)
diff --git a/infra/config/generated/luci/cr-buildbucket.cfg b/infra/config/generated/luci/cr-buildbucket.cfg index be5dca0..8681f001 100644 --- a/infra/config/generated/luci/cr-buildbucket.cfg +++ b/infra/config/generated/luci/cr-buildbucket.cfg
@@ -2713,10 +2713,6 @@ value: 100 } experiments { - key: "chromium.chromium_tests.use_isolate" - value: 50 - } - experiments { key: "chromium.chromium_tests.use_rdb_results" value: 100 } @@ -53979,10 +53975,6 @@ value: 5 } experiments { - key: "chromium.chromium_tests.use_isolate" - value: 50 - } - experiments { key: "chromium.chromium_tests.use_rdb_results" value: 100 } @@ -54086,10 +54078,6 @@ value: 5 } experiments { - key: "chromium.chromium_tests.use_isolate" - value: 50 - } - experiments { key: "chromium.chromium_tests.use_rdb_results" value: 100 } @@ -54193,10 +54181,6 @@ value: 5 } experiments { - key: "chromium.chromium_tests.use_isolate" - value: 50 - } - experiments { key: "chromium.chromium_tests.use_rdb_results" value: 100 } @@ -58612,10 +58596,6 @@ value: 5 } experiments { - key: "chromium.chromium_tests.use_isolate" - value: 50 - } - experiments { key: "chromium.chromium_tests.use_rdb_results" value: 100 } @@ -74738,10 +74718,6 @@ value: 5 } experiments { - key: "chromium.chromium_tests.use_isolate" - value: 50 - } - experiments { key: "chromium.chromium_tests.use_rdb_results" value: 100 } @@ -74838,10 +74814,6 @@ value: 5 } experiments { - key: "chromium.chromium_tests.use_isolate" - value: 50 - } - experiments { key: "chromium.chromium_tests.use_rdb_results" value: 100 } @@ -75898,10 +75870,6 @@ value: 5 } experiments { - key: "chromium.chromium_tests.use_isolate" - value: 50 - } - experiments { key: "chromium.chromium_tests.use_rdb_results" value: 100 } @@ -75997,10 +75965,6 @@ value: 5 } experiments { - key: "chromium.chromium_tests.use_isolate" - value: 50 - } - experiments { key: "chromium.chromium_tests.use_rdb_results" value: 100 }
diff --git a/infra/config/subprojects/chromium/ci.star b/infra/config/subprojects/chromium/ci.star index 84b8f0c..a6acd4c 100644 --- a/infra/config/subprojects/chromium/ci.star +++ b/infra/config/subprojects/chromium/ci.star
@@ -580,10 +580,6 @@ execution_timeout = 7 * time.hour, main_console_view = main_console_if_on_branch(), tree_closing = True, - # TODO(crbug.com/1143122): remove this after migration. - experiments = { - "chromium.chromium_tests.use_isolate": 50, - }, ) ci.android_builder(
diff --git a/infra/config/subprojects/chromium/try.star b/infra/config/subprojects/chromium/try.star index 942761fb..6255b3c 100644 --- a/infra/config/subprojects/chromium/try.star +++ b/infra/config/subprojects/chromium/try.star
@@ -391,10 +391,6 @@ tryjob = try_.job(), # TODO(crbug/1202741) os = os.LINUX_XENIAL_OR_BIONIC_REMOVE, - # TODO(crbug.com/1143122): remove this after migration. - experiments = { - "chromium.chromium_tests.use_isolate": 50, - }, ) try_.chromium_android_builder( @@ -411,9 +407,6 @@ ), # TODO(crbug/1202741) os = os.LINUX_XENIAL_OR_BIONIC_REMOVE, - experiments = { - "chromium.chromium_tests.use_isolate": 50, - }, ) try_.chromium_android_builder( @@ -428,10 +421,6 @@ tryjob = try_.job(), # TODO(crbug/1202741) os = os.LINUX_XENIAL_OR_BIONIC_REMOVE, - # TODO(crbug.com/1143122): remove this after migration. - experiments = { - "chromium.chromium_tests.use_isolate": 50, - }, ) try_.chromium_android_builder( @@ -1066,10 +1055,6 @@ builderless = not settings.is_main, main_list_view = "try", tryjob = try_.job(), - # TODO(crbug.com/1143122): remove this after migration. - experiments = { - "chromium.chromium_tests.use_isolate": 50, - }, ) try_.chromium_linux_builder( @@ -1432,10 +1417,6 @@ ssd = True, main_list_view = "try", tryjob = try_.job(), - # TODO(crbug.com/1143122): remove this after migration. - experiments = { - "chromium.chromium_tests.use_isolate": 50, - }, ) try_.chromium_linux_builder( @@ -1446,10 +1427,6 @@ tryjob = try_.job( experiment_percentage = 5, ), - # TODO(crbug.com/1143122): remove this after migration. - experiments = { - "chromium.chromium_tests.use_isolate": 50, - }, ) try_.chromium_linux_builder( @@ -1534,10 +1511,6 @@ goma_jobs = goma.jobs.J150, main_list_view = "try", tryjob = try_.job(), - # TODO(crbug.com/1143122): remove this after migration. - experiments = { - "chromium.chromium_tests.use_isolate": 50, - }, ) try_.chromium_linux_builder( @@ -1548,10 +1521,6 @@ tryjob = try_.job( experiment_percentage = 5, ), - # TODO(crbug.com/1143122): remove this after migration. - experiments = { - "chromium.chromium_tests.use_isolate": 50, - }, ) try_.chromium_linux_builder(
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 index 824b610e..dcff6dc9 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -21f3b0fc61895a2d6633ffb8f433ae54fd622a2e \ No newline at end of file +f557829398b13a521864133870ebc1002aa07aac \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 index 12bce17..00a5a636 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -821c52f56c62f19e2335510e7fd1e0023750c389 \ No newline at end of file +223ec94e216a33da1200791037bf5ff8de57f76d \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 index c09acdb..fbffbc5 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -25d38ea705b6018d6e16f50d49e31b1fea12439a \ No newline at end of file +998c5281cc3dc2c6ace696b2084b845817399e01 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 index 75a5ff5..81074e6 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -558c9557211debb25c0a7bca2f46b075c87fa8f6 \ No newline at end of file +1bd443a00daeda794da3878ee9941090edd3b670 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 index 46d855a3..9f90cc0 100644 --- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -cc3261714b58e88b96c0a474d119a1bf11d2eb6f \ No newline at end of file +1010b0fae6decf3141eec33b833c800778a3c08a \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 index 2b6e4cb..63d61df 100644 --- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -4c695b9ff8bb0b8a97c225945995358730b6c51e \ No newline at end of file +343aaf20da235fc0293a0d567f4da70c454fdfe8 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 index 81cb7ca..06659bd 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -ca91d9a136985387dfbff8be623271744f155f5e \ No newline at end of file +3fa2f16ca598785ec3aef452ff89f6410b047cb0 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 index a3438b0..6d6329c4 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -61610936ac0a2e0816d1594eea6ca05bd50fa7fc \ No newline at end of file +3f32bde0a12a7f906956da9b10b2fc5e5ea40315 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 index 7853209..a3e1380 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -b1895ea885d05284b156c723951d841a9c4726c4 \ No newline at end of file +13d17f4a8c877f2c4f28f7239117f2c6fba45ec5 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 index c7a5690..a9adea7a 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -245a2d4b7b0061a5f6223ddb9e1aa2be970a8cbc \ No newline at end of file +42799392161914a46739e29e3952a8661cb3c0be \ No newline at end of file
diff --git a/media/audio/android/aaudio_output.cc b/media/audio/android/aaudio_output.cc index cf0715a..13742484 100644 --- a/media/audio/android/aaudio_output.cc +++ b/media/audio/android/aaudio_output.cc
@@ -5,7 +5,6 @@ #include "media/audio/android/aaudio_output.h" #include "base/android/build_info.h" -#include "base/callback_helpers.h" #include "base/logging.h" #include "base/thread_annotations.h" #include "base/threading/sequenced_task_runner_handle.h" @@ -137,9 +136,8 @@ // bound to the callback stays valid, until the callbacks stop. base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::BindOnce( - base::DoNothing::Once<std::unique_ptr<AAudioDestructionHelper>>(), - std::move(destruction_helper_)), + base::BindOnce([](std::unique_ptr<AAudioDestructionHelper>) {}, + std::move(destruction_helper_)), base::TimeDelta::FromSeconds(1)); }
diff --git a/media/base/audio_buffer.cc b/media/base/audio_buffer.cc index b153acd..436c6164 100644 --- a/media/base/audio_buffer.cc +++ b/media/base/audio_buffer.cc
@@ -6,7 +6,6 @@ #include <cmath> -#include "base/callback_helpers.h" #include "base/logging.h" #include "base/notreached.h" #include "media/base/audio_bus.h" @@ -301,8 +300,7 @@ // Keep |buffer| alive as long as |audio_bus|. audio_bus->SetWrappedDataDeleter( - base::BindOnce(base::DoNothing::Once<scoped_refptr<AudioBuffer>>(), - std::move(buffer))); + base::BindOnce([](scoped_refptr<AudioBuffer>) {}, std::move(buffer))); return audio_bus; }
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc index b632571..8e59b5f 100644 --- a/media/base/video_frame.cc +++ b/media/base/video_frame.cc
@@ -12,7 +12,6 @@ #include "base/atomic_sequence_num.h" #include "base/bind.h" #include "base/bits.h" -#include "base/callback_helpers.h" #include "base/cxx17_backports.h" #include "base/logging.h" #include "base/process/memory.h" @@ -906,8 +905,8 @@ // observers which signal that the underlying resource is okay to reuse. E.g., // VideoFramePool. if (frame->wrapped_frame_) { - wrapping_frame->AddDestructionObserver(base::BindOnce( - base::DoNothing::Once<scoped_refptr<VideoFrame>>(), frame)); + wrapping_frame->AddDestructionObserver( + base::BindOnce([](scoped_refptr<VideoFrame>) {}, frame)); frame = frame->wrapped_frame_; }
diff --git a/media/base/video_util.cc b/media/base/video_util.cc index fcee67b..aa1623d 100644 --- a/media/base/video_util.cc +++ b/media/base/video_util.cc
@@ -981,8 +981,8 @@ if (!frame) return nullptr; - frame->AddDestructionObserver(base::BindOnce( - base::DoNothing::Once<sk_sp<SkImage>>(), std::move(sk_image))); + frame->AddDestructionObserver( + base::BindOnce([](sk_sp<SkImage>) {}, std::move(sk_image))); return frame; }
diff --git a/media/filters/dav1d_video_decoder.cc b/media/filters/dav1d_video_decoder.cc index 7cdd048..d08c8393 100644 --- a/media/filters/dav1d_video_decoder.cc +++ b/media/filters/dav1d_video_decoder.cc
@@ -11,7 +11,6 @@ #include "base/bind.h" #include "base/bits.h" #include "base/callback.h" -#include "base/callback_helpers.h" #include "base/logging.h" #include "base/strings/stringprintf.h" #include "base/threading/sequenced_task_runner_handle.h" @@ -388,8 +387,8 @@ // When we use bind mode, our image data is dependent on the Dav1dPicture, // so we must ensure it stays alive along enough. - frame->AddDestructionObserver(base::BindOnce( - base::DoNothing::Once<ScopedPtrDav1dPicture>(), std::move(p))); + frame->AddDestructionObserver( + base::BindOnce([](ScopedPtrDav1dPicture) {}, std::move(p))); output_cb_.Run(std::move(frame)); } @@ -452,8 +451,7 @@ // Each frame needs a ref on the fake UV data to keep it alive until done. if (needs_fake_uv_planes) { frame->AddDestructionObserver(base::BindOnce( - base::DoNothing::Once<scoped_refptr<base::RefCountedBytes>>(), - fake_uv_data_)); + [](scoped_refptr<base::RefCountedBytes>) {}, fake_uv_data_)); } return frame;
diff --git a/media/gpu/chromeos/mailbox_video_frame_converter.cc b/media/gpu/chromeos/mailbox_video_frame_converter.cc index 9660e6a6..0b755c2 100644 --- a/media/gpu/chromeos/mailbox_video_frame_converter.cc +++ b/media/gpu/chromeos/mailbox_video_frame_converter.cc
@@ -5,7 +5,6 @@ #include "media/gpu/chromeos/mailbox_video_frame_converter.h" #include "base/bind.h" -#include "base/callback_helpers.h" #include "base/containers/contains.h" #include "base/location.h" #include "base/memory/ptr_util.h" @@ -432,8 +431,8 @@ gpu::SharedImageStub* shared_image_stub = gpu_channel_->shared_image_stub(); DCHECK(shared_image_stub); - auto keep_video_frame_alive = base::BindOnce( - base::DoNothing::Once<scoped_refptr<VideoFrame>>(), std::move(frame)); + auto keep_video_frame_alive = + base::BindOnce([](scoped_refptr<VideoFrame>) {}, std::move(frame)); auto* scheduler = gpu_channel_->scheduler(); DCHECK(scheduler); scheduler->ScheduleTask(gpu::Scheduler::Task(
diff --git a/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.cc b/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.cc index b3abc08..0fbdbdc 100644 --- a/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.cc +++ b/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.cc
@@ -133,8 +133,7 @@ DeallocateBuffers, std::move(va_image), std::move(src_video_frame))); for (auto&& buffer : p016le_buffers) { video_frame->AddDestructionObserver( - base::BindOnce(base::DoNothing::Once<std::unique_ptr<uint16_t[]>>(), - std::move(buffer))); + base::BindOnce([](std::unique_ptr<uint16_t[]>) {}, std::move(buffer))); } return video_frame; }
diff --git a/media/mojo/clients/mojo_video_encode_accelerator.cc b/media/mojo/clients/mojo_video_encode_accelerator.cc index cd46a6db..c70c7da0 100644 --- a/media/mojo/clients/mojo_video_encode_accelerator.cc +++ b/media/mojo/clients/mojo_video_encode_accelerator.cc
@@ -7,7 +7,6 @@ #include <utility> #include "base/bind.h" -#include "base/callback_helpers.h" #include "base/logging.h" #include "build/build_config.h" #include "gpu/ipc/client/gpu_channel_host.h" @@ -139,10 +138,8 @@ // GPU memory path: Pass-through. if (frame->storage_type() == VideoFrame::STORAGE_GPU_MEMORY_BUFFER) { - vea_->Encode( - frame, force_keyframe, - base::BindOnce(base::DoNothing::Once<scoped_refptr<VideoFrame>>(), - frame)); + vea_->Encode(frame, force_keyframe, + base::BindOnce([](scoped_refptr<VideoFrame>) {}, frame)); return; } @@ -168,8 +165,7 @@ } vea_->Encode( std::move(mojo_frame), force_keyframe, - base::BindOnce(base::DoNothing::Once<scoped_refptr<VideoFrame>>(), - std::move(frame))); + base::BindOnce([](scoped_refptr<VideoFrame>) {}, std::move(frame))); } void MojoVideoEncodeAccelerator::UseOutputBitstreamBuffer(
diff --git a/media/video/video_encode_accelerator_adapter.cc b/media/video/video_encode_accelerator_adapter.cc index 2f0081a..e567569 100644 --- a/media/video/video_encode_accelerator_adapter.cc +++ b/media/video/video_encode_accelerator_adapter.cc
@@ -660,8 +660,7 @@ // Keep the SharedMemoryHolder until the frame is destroyed so that the // memory is not freed prematurely. shared_frame->AddDestructionObserver(BindToCurrentLoop(base::BindOnce( - base::DoNothing::Once< - std::unique_ptr<base::UnsafeSharedMemoryPool::Handle>>(), + [](std::unique_ptr<base::UnsafeSharedMemoryPool::Handle>) {}, std::move(handle)))); auto status = ConvertAndScaleFrame(*mapped_src_frame, *shared_frame, resize_buf_);
diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc index 574b231a..9ca0046 100644 --- a/net/disk_cache/simple/simple_index.cc +++ b/net/disk_cache/simple/simple_index.cc
@@ -10,7 +10,6 @@ #include <utility> #include "base/bind.h" -#include "base/callback_helpers.h" #include "base/check_op.h" #include "base/files/file_util.h" #include "base/numerics/safe_conversions.h" @@ -623,9 +622,8 @@ if (cleanup_tracker_) { // Make anyone synchronizing with our cleanup wait for the index to be // written back. - after_write = base::BindOnce( - base::DoNothing::Once<scoped_refptr<BackendCleanupTracker>>(), - cleanup_tracker_); + after_write = base::BindOnce([](scoped_refptr<BackendCleanupTracker>) {}, + cleanup_tracker_); } index_file_->WriteToDisk(cache_type_, reason, entries_set_, cache_size_,
diff --git a/net/http/structured_headers.cc b/net/http/structured_headers.cc index da3ddd01..21bf1786 100644 --- a/net/http/structured_headers.cc +++ b/net/http/structured_headers.cc
@@ -68,6 +68,8 @@ // Discard any leading OWS from input_string. SkipWhitespaces(); } + StructuredHeaderParser(const StructuredHeaderParser&) = delete; + StructuredHeaderParser& operator=(const StructuredHeaderParser&) = delete; // Callers should call this after ReadSomething(), to check if parser has // consumed all the input successfully. @@ -541,8 +543,6 @@ base::StringPiece input_; DraftVersion version_; - - DISALLOW_COPY_AND_ASSIGN(StructuredHeaderParser); }; // Serializer for (a subset of) Structured Headers for HTTP defined in [SH15].
diff --git a/services/device/usb/usb_device_handle_impl.cc b/services/device/usb/usb_device_handle_impl.cc index 10e0d5b1..cd42f20a 100644 --- a/services/device/usb/usb_device_handle_impl.cc +++ b/services/device/usb/usb_device_handle_impl.cc
@@ -12,7 +12,6 @@ #include <vector> #include "base/bind.h" -#include "base/callback_helpers.h" #include "base/containers/contains.h" #include "base/location.h" #include "base/macros.h" @@ -864,8 +863,7 @@ } else { blocking_task_runner_->PostTask( FROM_HERE, - base::BindOnce(base::DoNothing::Once<ScopedLibusbDeviceHandle>(), - std::move(handle_))); + base::BindOnce([](ScopedLibusbDeviceHandle) {}, std::move(handle_))); } }
diff --git a/services/device/usb/usb_device_handle_win.cc b/services/device/usb/usb_device_handle_win.cc index 74f851d7..cfaf8c8 100644 --- a/services/device/usb/usb_device_handle_win.cc +++ b/services/device/usb/usb_device_handle_win.cc
@@ -221,8 +221,7 @@ // after any queued operations have completed. blocking_task_runner_->PostTask( FROM_HERE, - base::BindOnce(base::DoNothing::Once<base::win::ScopedHandle>(), - std::move(hub_handle_))); + base::BindOnce([](base::win::ScopedHandle) {}, std::move(hub_handle_))); } for (auto& map_entry : interfaces_) {
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc index c73973f7..12302ad 100644 --- a/services/network/url_loader.cc +++ b/services/network/url_loader.cc
@@ -11,7 +11,6 @@ #include <vector> #include "base/bind.h" -#include "base/callback_helpers.h" #include "base/command_line.h" #include "base/debug/alias.h" #include "base/debug/dump_without_crashing.h" @@ -728,7 +727,7 @@ static void PostCloseFiles(std::vector<base::File> opened_files) { base::ThreadPool::PostTask( FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING}, - base::BindOnce(base::DoNothing::Once<std::vector<base::File>>(), + base::BindOnce([](std::vector<base::File>) {}, std::move(opened_files))); }
diff --git a/storage/browser/blob/blob_builder_from_stream_unittest.cc b/storage/browser/blob/blob_builder_from_stream_unittest.cc index 3db6bbb..050db95 100644 --- a/storage/browser/blob/blob_builder_from_stream_unittest.cc +++ b/storage/browser/blob/blob_builder_from_stream_unittest.cc
@@ -494,10 +494,8 @@ std::make_unique<mojo::StringDataSource>( kData, mojo::StringDataSource::AsyncWritingMode:: STRING_STAYS_VALID_UNTIL_COMPLETION), - base::BindOnce( - base::DoNothing::Once<std::unique_ptr<mojo::DataPipeProducer>, - MojoResult>(), - std::move(data_producer))); + base::BindOnce([](std::unique_ptr<mojo::DataPipeProducer>, MojoResult) {}, + std::move(data_producer))); loop.Run(); ASSERT_TRUE(result);
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index 097c053..4d97c38 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -5693,7 +5693,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M94", - "revision": "version:94.0.4606.64" + "revision": "version:94.0.4606.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -5780,7 +5780,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M95", - "revision": "version:95.0.4638.25" + "revision": "version:95.0.4638.27" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -5954,7 +5954,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M94", - "revision": "version:94.0.4606.64" + "revision": "version:94.0.4606.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -6041,7 +6041,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M95", - "revision": "version:95.0.4638.25" + "revision": "version:95.0.4638.27" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 7fb1ee0..56bea08 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -56581,7 +56581,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M94", - "revision": "version:94.0.4606.64" + "revision": "version:94.0.4606.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -56669,7 +56669,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M95", - "revision": "version:95.0.4638.25" + "revision": "version:95.0.4638.27" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -56845,7 +56845,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M94", - "revision": "version:94.0.4606.64" + "revision": "version:94.0.4606.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -56933,7 +56933,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M95", - "revision": "version:95.0.4638.25" + "revision": "version:95.0.4638.27" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -57182,7 +57182,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M94", - "revision": "version:94.0.4606.64" + "revision": "version:94.0.4606.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -57269,7 +57269,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M95", - "revision": "version:95.0.4638.25" + "revision": "version:95.0.4638.27" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -57443,7 +57443,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M94", - "revision": "version:94.0.4606.64" + "revision": "version:94.0.4606.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -57530,7 +57530,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M95", - "revision": "version:95.0.4638.25" + "revision": "version:95.0.4638.27" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -57779,7 +57779,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M94", - "revision": "version:94.0.4606.64" + "revision": "version:94.0.4606.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -57866,7 +57866,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M95", - "revision": "version:95.0.4638.25" + "revision": "version:95.0.4638.27" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -58040,7 +58040,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M94", - "revision": "version:94.0.4606.64" + "revision": "version:94.0.4606.66" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -58127,7 +58127,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M95", - "revision": "version:95.0.4638.25" + "revision": "version:95.0.4638.27" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index dd257c73..8e18b35 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -5898,21 +5898,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4653.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4654.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4653.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4654.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v96.0.4653.0", - "revision": "version:96.0.4653.0" + "location": "lacros_version_skew_tests_v96.0.4654.0", + "revision": "version:96.0.4654.0" } ], "dimension_sets": [ @@ -6006,21 +6006,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4653.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4654.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4653.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4654.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v96.0.4653.0", - "revision": "version:96.0.4653.0" + "location": "lacros_version_skew_tests_v96.0.4654.0", + "revision": "version:96.0.4654.0" } ], "dimension_sets": [
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 1493f84..075bc8cc 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -83471,7 +83471,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4653.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4654.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -83479,14 +83479,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4653.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4654.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v96.0.4653.0", - "revision": "version:96.0.4653.0" + "location": "lacros_version_skew_tests_v96.0.4654.0", + "revision": "version:96.0.4654.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -83563,7 +83563,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4653.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4654.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -83571,14 +83571,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4653.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4654.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v96.0.4653.0", - "revision": "version:96.0.4653.0" + "location": "lacros_version_skew_tests_v96.0.4654.0", + "revision": "version:96.0.4654.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -84947,21 +84947,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4653.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4654.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4653.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4654.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v96.0.4653.0", - "revision": "version:96.0.4653.0" + "location": "lacros_version_skew_tests_v96.0.4654.0", + "revision": "version:96.0.4654.0" } ], "dimension_sets": [ @@ -85059,21 +85059,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4653.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4654.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4653.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4654.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v96.0.4653.0", - "revision": "version:96.0.4653.0" + "location": "lacros_version_skew_tests_v96.0.4654.0", + "revision": "version:96.0.4654.0" } ], "dimension_sets": [ @@ -86614,21 +86614,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4653.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4654.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4653.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4654.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v96.0.4653.0", - "revision": "version:96.0.4653.0" + "location": "lacros_version_skew_tests_v96.0.4654.0", + "revision": "version:96.0.4654.0" } ], "dimension_sets": [ @@ -86726,21 +86726,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4653.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4654.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4653.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4654.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v96.0.4653.0", - "revision": "version:96.0.4653.0" + "location": "lacros_version_skew_tests_v96.0.4654.0", + "revision": "version:96.0.4654.0" } ], "dimension_sets": [ @@ -87483,21 +87483,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4653.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4654.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4653.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4654.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v96.0.4653.0", - "revision": "version:96.0.4653.0" + "location": "lacros_version_skew_tests_v96.0.4654.0", + "revision": "version:96.0.4654.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -87579,21 +87579,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4653.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4654.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4653.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4654.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v96.0.4653.0", - "revision": "version:96.0.4653.0" + "location": "lacros_version_skew_tests_v96.0.4654.0", + "revision": "version:96.0.4654.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com"
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 28adaea..c1e92b18 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -52,16 +52,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4653.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4654.0/test_ash_chrome', '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter', ], - 'identifier': 'Lacros version skew testing ash 96.0.4653.0', + 'identifier': 'Lacros version skew testing ash 96.0.4654.0', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v96.0.4653.0', - 'revision': 'version:96.0.4653.0', + 'location': 'lacros_version_skew_tests_v96.0.4654.0', + 'revision': 'version:96.0.4654.0', }, ], }, @@ -387,7 +387,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M95', - 'revision': 'version:95.0.4638.25', + 'revision': 'version:95.0.4638.27', } ], }, @@ -411,7 +411,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M94', - 'revision': 'version:94.0.4606.64', + 'revision': 'version:94.0.4606.66', } ], }, @@ -459,7 +459,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M95', - 'revision': 'version:95.0.4638.25', + 'revision': 'version:95.0.4638.27', } ], }, @@ -483,7 +483,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M94', - 'revision': 'version:94.0.4606.64', + 'revision': 'version:94.0.4606.66', } ], }, @@ -531,7 +531,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M95', - 'revision': 'version:95.0.4638.25', + 'revision': 'version:95.0.4638.27', } ], }, @@ -555,7 +555,7 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M94', - 'revision': 'version:94.0.4606.64', + 'revision': 'version:94.0.4606.66', } ], },
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index be5da9b..77c590f4 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -3196,21 +3196,6 @@ ] } ], - "DownloadWithServicificationM77": [ - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "Enabled_20191111", - "enable_features": [ - "ServiceManagerForDownload" - ] - } - ] - } - ], "DriveFsBidirectionalNativeMessaging": [ { "platforms": [ @@ -5023,6 +5008,23 @@ ] } ], + "NetworkRequestUsesOnlyPerProcessBufferLimit": [ + { + "platforms": [ + "android", + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled" + } + ] + } + ], "NtpRealboxAnswersInSuggest": [ { "platforms": [ @@ -7469,21 +7471,6 @@ ] } ], - "SmartSuggestionForLargeDownloads": [ - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "SmartSuggestionForLargeDownloads" - ] - } - ] - } - ], "SmoothnessModeForAnimatedScrolls": [ { "platforms": [ @@ -8123,21 +8110,6 @@ ] } ], - "UseInProgressDownloadManagerForDownloadService": [ - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "UseInProgressDownloadManagerForDownloadService" - ] - } - ] - } - ], "UsePageViewportInLCP": [ { "platforms": [
diff --git a/third_party/blink/public/mojom/web_feature/web_feature.mojom b/third_party/blink/public/mojom/web_feature/web_feature.mojom index aef6bee..b2e3f365 100644 --- a/third_party/blink/public/mojom/web_feature/web_feature.mojom +++ b/third_party/blink/public/mojom/web_feature/web_feature.mojom
@@ -3357,6 +3357,8 @@ kClientHintsDPR = 4047, kClientHintsResourceWidth = 4048, kClientHintsViewportWidth = 4049, + kInlineBoxIgnoringContinuation = 4050, + kOffsetWidthOrHeightIgnoringContinuation = 4051, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/blink/renderer/core/layout/layout_inline.cc b/third_party/blink/renderer/core/layout/layout_inline.cc index ce326b6..bfee434 100644 --- a/third_party/blink/renderer/core/layout/layout_inline.cc +++ b/third_party/blink/renderer/core/layout/layout_inline.cc
@@ -1107,6 +1107,24 @@ return AdjustedPositionRelativeTo(FirstLineBoxTopLeft(), parent).top; } +LayoutUnit LayoutInline::OffsetWidth() const { + NOT_DESTROYED(); + if (UNLIKELY(Continuation())) { + UseCounter::Count(GetDocument(), + WebFeature::kOffsetWidthOrHeightIgnoringContinuation); + } + return PhysicalLinesBoundingBox().Width(); +} + +LayoutUnit LayoutInline::OffsetHeight() const { + NOT_DESTROYED(); + if (UNLIKELY(Continuation())) { + UseCounter::Count(GetDocument(), + WebFeature::kOffsetWidthOrHeightIgnoringContinuation); + } + return PhysicalLinesBoundingBox().Height(); +} + static LayoutUnit ComputeMargin(const LayoutInline* layout_object, const Length& margin) { if (margin.IsFixed()) @@ -1276,6 +1294,13 @@ PhysicalRect LayoutInline::PhysicalLinesBoundingBox() const { NOT_DESTROYED(); + // |LayoutBoxModelObject::QuadsInternal| includes continuations, but this + // function does not. + if (UNLIKELY(Continuation())) { + UseCounter::Count(GetDocument(), + WebFeature::kInlineBoxIgnoringContinuation); + } + if (IsInLayoutNGInlineFormattingContext()) { NGInlineCursor cursor; cursor.MoveToIncludingCulledInline(*this);
diff --git a/third_party/blink/renderer/core/layout/layout_inline.h b/third_party/blink/renderer/core/layout/layout_inline.h index b2c07cd..c2a32ea 100644 --- a/third_party/blink/renderer/core/layout/layout_inline.h +++ b/third_party/blink/renderer/core/layout/layout_inline.h
@@ -386,14 +386,8 @@ LayoutUnit OffsetLeft(const Element*) const final; LayoutUnit OffsetTop(const Element*) const final; - LayoutUnit OffsetWidth() const final { - NOT_DESTROYED(); - return PhysicalLinesBoundingBox().Width(); - } - LayoutUnit OffsetHeight() const final { - NOT_DESTROYED(); - return PhysicalLinesBoundingBox().Height(); - } + LayoutUnit OffsetWidth() const final; + LayoutUnit OffsetHeight() const final; // This method differs from VisualOverflowRect() in that // 1. it doesn't include the rects for culled inline boxes, which aren't
diff --git a/third_party/blink/renderer/modules/file_system_access/file_system_access_incognito_file_delegate.cc b/third_party/blink/renderer/modules/file_system_access/file_system_access_incognito_file_delegate.cc index ca6869bc..e4d71d1 100644 --- a/third_party/blink/renderer/modules/file_system_access/file_system_access_incognito_file_delegate.cc +++ b/third_party/blink/renderer/modules/file_system_access/file_system_access_incognito_file_delegate.cc
@@ -4,7 +4,6 @@ #include "third_party/blink/renderer/modules/file_system_access/file_system_access_incognito_file_delegate.h" -#include "base/callback_helpers.h" #include "base/files/file.h" #include "base/files/file_error_or.h" #include "base/memory/scoped_refptr.h" @@ -63,10 +62,9 @@ // the duration of the write. producer_raw->Write( std::move(data_source), - WTF::Bind(base::DoNothing::Once< - std::unique_ptr<mojo::DataPipeProducer>, - scoped_refptr<base::RefCountedData<Vector<uint8_t>>>, - MojoResult>(), + WTF::Bind([](std::unique_ptr<mojo::DataPipeProducer>, + scoped_refptr<base::RefCountedData<Vector<uint8_t>>>, + MojoResult) {}, std::move(producer), std::move(data))); }
diff --git a/third_party/blink/renderer/platform/webrtc/convert_to_webrtc_video_frame_buffer.cc b/third_party/blink/renderer/platform/webrtc/convert_to_webrtc_video_frame_buffer.cc index 85c8c80..41362a8 100644 --- a/third_party/blink/renderer/platform/webrtc/convert_to_webrtc_video_frame_buffer.cc +++ b/third_party/blink/renderer/platform/webrtc/convert_to_webrtc_video_frame_buffer.cc
@@ -4,7 +4,6 @@ #include "third_party/blink/renderer/platform/webrtc/convert_to_webrtc_video_frame_buffer.h" -#include "base/callback_helpers.h" #include "base/containers/contains.h" #include "base/containers/span.h" #include "base/logging.h" @@ -504,10 +503,9 @@ return nullptr; } // The bind ensures that we keep a reference to the underlying buffer. - video_frame->AddDestructionObserver( - ConvertToBaseOnceCallback(CrossThreadBindOnce( - base::DoNothing::Once<const scoped_refptr<rtc::RefCountInterface>&>(), - scoped_refptr<webrtc::VideoFrameBuffer>(buffer)))); + video_frame->AddDestructionObserver(ConvertToBaseOnceCallback( + CrossThreadBindOnce([](const scoped_refptr<rtc::RefCountInterface>&) {}, + scoped_refptr<webrtc::VideoFrameBuffer>(buffer)))); return video_frame; }
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 78b1230..876f897 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -2849,8 +2849,8 @@ crbug.com/626703 virtual/plz-dedicated-worker/external/wpt/service-workers/service-worker/worker-interception.https.html [ Pass ] # ====== New tests from wpt-importer added here ====== -crbug.com/626703 [ Linux ] virtual/threaded/external/wpt/animation-worklet/worklet-animation-start-delay.https.html [ Failure ] -crbug.com/626703 [ Mac10.15 ] virtual/threaded/external/wpt/animation-worklet/worklet-animation-start-delay.https.html [ Failure ] +crbug.com/626703 [ Linux ] virtual/threaded/external/wpt/animation-worklet/worklet-animation-start-delay.https.html [ Crash ] +crbug.com/626703 [ Mac10.15 ] virtual/threaded/external/wpt/animation-worklet/worklet-animation-start-delay.https.html [ Crash ] crbug.com/626703 [ Linux ] external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-parts-structure.tentative.html [ Timeout ] crbug.com/626703 [ Mac ] external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-parts-structure.tentative.html [ Timeout ] crbug.com/626703 [ Linux ] virtual/synchronous_html_parser/external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-parts-structure.tentative.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 4c355a0..8073eb547 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
@@ -162567,7 +162567,7 @@ ] ], "css-transforms-transformlist.html": [ - "1551554545b8697d7baf49dde0ea61825c641918", + "a4620f59e6e69764113a8f2dd3af80f6b8486916", [ null, [
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/css-transforms-transformlist.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/css-transforms-transformlist.html index 1551554..a4620f59 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/css-transforms-transformlist.html +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/css-transforms-transformlist.html
@@ -26,7 +26,7 @@ var r = document.getElementById("rect"); var result = document.getElementById("result"); if (r.transform.baseVal.length == 0) - result.style.backgroundColor = "rgb(0, 255, 0)"; + result.style.backgroundColor = "green"; document.getElementById("svgelement").style.display="none"; }, false);
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py index 872e1b2..abe6f82b 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py
@@ -39,8 +39,8 @@ # https://chromium.googlesource.com/chromium/src/+/main/docs/updating_clang.md # Reverting problematic clang rolls is safe, though. # This is the output of `git describe` and is usable as a commit-ish. -CLANG_REVISION = 'llvmorg-14-init-3940-gafc45ff0' -CLANG_SUB_REVISION = 3 +CLANG_REVISION = 'llvmorg-14-init-4855-ged687c02' +CLANG_SUB_REVISION = 1 PACKAGE_VERSION = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION) RELEASE_VERSION = '14.0.0'
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 1a9cd2ab..b22c206 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -34664,6 +34664,8 @@ <int value="4047" label="ClientHintsDPR"/> <int value="4048" label="ClientHintsResourceWidth"/> <int value="4049" label="ClientHintsViewportWidth"/> + <int value="4050" label="InlineBoxIgnoringContinuation"/> + <int value="4051" label="OffsetWidthOrHeightIgnoringContinuation"/> </enum> <enum name="FeaturePolicyAllowlistType"> @@ -55899,6 +55901,7 @@ <int value="17" label="SyncError"/> <int value="18" label="SharedHighlighting"/> <int value="19" label="NearOomReduction"/> + <int value="20" label="InstallableAmbientBadge"/> </enum> <enum name="MessageLoopProblems">
diff --git a/tools/metrics/histograms/metadata/android/histograms.xml b/tools/metrics/histograms/metadata/android/histograms.xml index a9be8cf..aa56804 100644 --- a/tools/metrics/histograms/metadata/android/histograms.xml +++ b/tools/metrics/histograms/metadata/android/histograms.xml
@@ -84,6 +84,7 @@ <variant name=".ChromeSurvey"/> <variant name=".DownloadProgress"/> <variant name=".GeneratedPasswordSaved"/> + <variant name=".InstallableAmbientBadge"/> <variant name=".MerchantTrust"/> <variant name=".NearOomReduction"/> <variant name=".NotificationBlocked"/>
diff --git a/tools/metrics/histograms/metadata/service/histograms.xml b/tools/metrics/histograms/metadata/service/histograms.xml index 1a1581c..3bb28fa4 100644 --- a/tools/metrics/histograms/metadata/service/histograms.xml +++ b/tools/metrics/histograms/metadata/service/histograms.xml
@@ -892,6 +892,9 @@ <histogram name="ServiceWorker.SendStopWorker.Status" enum="ServiceWorkerStatusCode" expires_after="M85"> + <obsolete> + Removed from the code in April 2017. + </obsolete> <owner>falken@chromium.org</owner> <owner>chrome-worker@google.com</owner> <summary> @@ -1203,6 +1206,9 @@ <histogram name="ServiceWorker.WorkerForMessageFound" enum="Boolean" expires_after="M85"> + <obsolete> + Removed from the code in March 2018. + </obsolete> <owner>falken@chromium.org</owner> <owner>chrome-worker@google.com</owner> <summary>
diff --git a/tools/metrics/ukm/ukm.xml b/tools/metrics/ukm/ukm.xml index 3b7ce30..1b61ae47 100644 --- a/tools/metrics/ukm/ukm.xml +++ b/tools/metrics/ukm/ukm.xml
@@ -4014,11 +4014,25 @@ <summary> An enum that records how the app was installed. </summary> + <aggregation> + <history> + <statistics> + <enumeration/> + </statistics> + </history> + </aggregation> </metric> <metric name="InstallTime" enum="InstallTime"> <summary> An enum that records when the app was installed. </summary> + <aggregation> + <history> + <statistics> + <enumeration/> + </statistics> + </history> + </aggregation> </metric> <metric name="UserDeviceMatrix" enum="UserDeviceMatrix"> <summary> @@ -4059,6 +4073,13 @@ <summary> An enum that records where the app was launched. </summary> + <aggregation> + <history> + <statistics> + <enumeration/> + </statistics> + </history> + </aggregation> </metric> <metric name="UserDeviceMatrix" enum="UserDeviceMatrix"> <summary> @@ -4099,6 +4120,13 @@ <summary> An enum that records how the app was uninstalled. </summary> + <aggregation> + <history> + <statistics> + <enumeration/> + </statistics> + </history> + </aggregation> </metric> <metric name="UserDeviceMatrix" enum="UserDeviceMatrix"> <summary> @@ -4140,6 +4168,13 @@ <summary> The milliseconds that the app was used. </summary> + <aggregation> + <history> + <statistics> + <quantiles type="std-percentiles"/> + </statistics> + </history> + </aggregation> </metric> <metric name="UserDeviceMatrix" enum="UserDeviceMatrix"> <summary>
diff --git a/ui/gfx/linux/gpu_memory_buffer_support_x11.cc b/ui/gfx/linux/gpu_memory_buffer_support_x11.cc index aa5641c..5b89bfd 100644 --- a/ui/gfx/linux/gpu_memory_buffer_support_x11.cc +++ b/ui/gfx/linux/gpu_memory_buffer_support_x11.cc
@@ -11,7 +11,6 @@ #include "base/containers/contains.h" #include "base/debug/crash_logging.h" -#include "base/logging.h" #include "base/posix/eintr_wrapper.h" #include "ui/gfx/buffer_format_util.h" #include "ui/gfx/buffer_types.h" @@ -119,10 +118,7 @@ gfx::BufferFormat format, const gfx::Size& size, gfx::BufferUsage usage) { - if (!device_) { - LOG(ERROR) << "Device could not be created."; - return nullptr; - } + DCHECK(device_); DCHECK(base::Contains(supported_configs_, gfx::BufferUsageAndFormat(usage, format)));
diff --git a/ui/gfx/win/rendering_window_manager.h b/ui/gfx/win/rendering_window_manager.h index 53b2c93..720820f 100644 --- a/ui/gfx/win/rendering_window_manager.h +++ b/ui/gfx/win/rendering_window_manager.h
@@ -43,14 +43,14 @@ friend class base::NoDestructor<RenderingWindowManager>; RenderingWindowManager(); + RenderingWindowManager(const RenderingWindowManager&) = delete; + RenderingWindowManager& operator=(const RenderingWindowManager&) = delete; ~RenderingWindowManager(); // UI thread task runner. scoped_refptr<base::SingleThreadTaskRunner> task_runner_; // Map from registered parent HWND to child HWND. base::flat_map<HWND, HWND> registered_hwnds_; - - DISALLOW_COPY_AND_ASSIGN(RenderingWindowManager); }; } // namespace gfx
diff --git a/ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc b/ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc index 8bb847d..24d9ac2 100644 --- a/ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc +++ b/ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc
@@ -19,6 +19,8 @@ #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/dragdrop/os_exchange_data_provider_non_backed.h" #include "ui/events/event_constants.h" +#include "ui/events/platform/platform_event_source.h" +#include "ui/events/platform/scoped_event_dispatcher.h" #include "ui/ozone/platform/wayland/common/wayland_util.h" #include "ui/ozone/platform/wayland/host/wayland_connection.h" #include "ui/ozone/platform/wayland/host/wayland_data_device_manager.h" @@ -151,6 +153,10 @@ origin_window_ = origin_window; window_manager_->AddObserver(this); + + // Monitor mouse events so that the session can be aborted if needed. + nested_dispatcher_ = + PlatformEventSource::GetInstance()->OverrideDispatcher(this); return true; } @@ -285,6 +291,7 @@ data_offer_.reset(); offered_exchange_data_provider_.reset(); data_device_->ResetDragDelegate(); + nested_dispatcher_.reset(); state_ = State::kIdle; } @@ -429,4 +436,25 @@ offered_exchange_data_provider_.get()); } +bool WaylandDataDragController::CanDispatchEvent(const PlatformEvent& event) { + return state_ != State::kIdle; +} + +uint32_t WaylandDataDragController::DispatchEvent(const PlatformEvent& event) { + DCHECK_NE(state_, State::kIdle); + + // Drag session start may be triggered asynchronously, eg: dragging web + // contents, which might lead to race conditions where mouse button release is + // processed at compositor-side, sent to the client and processed just after + // the start_drag request is issued. In such cases, the compositor may ignore + // the request, and protocol-wise there is no explicit mechanism for clients + // to be notified about it (eg: an error event), and the only way of detecting + // that, for now, is to monitor wl_pointer events here and abort the session + // if it comes in. + if (event->type() == ET_MOUSE_RELEASED) + OnDataSourceFinish(/*completed=*/false); + + return POST_DISPATCH_PERFORM_DEFAULT; +} + } // namespace ui
diff --git a/ui/ozone/platform/wayland/host/wayland_data_drag_controller.h b/ui/ozone/platform/wayland/host/wayland_data_drag_controller.h index 8ffb84784..30e1ce9 100644 --- a/ui/ozone/platform/wayland/host/wayland_data_drag_controller.h +++ b/ui/ozone/platform/wayland/host/wayland_data_drag_controller.h
@@ -14,6 +14,7 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/dragdrop/mojom/drag_drop_types.mojom-forward.h" #include "ui/base/dragdrop/os_exchange_data_provider.h" +#include "ui/events/platform/platform_event_dispatcher.h" #include "ui/gfx/geometry/point_f.h" #include "ui/ozone/platform/wayland/common/wayland_object.h" #include "ui/ozone/platform/wayland/host/wayland_data_device.h" @@ -33,6 +34,7 @@ namespace ui { class OSExchangeData; +class ScopedEventDispatcher; class WaylandConnection; class WaylandDataDeviceManager; class WaylandDataOffer; @@ -69,7 +71,8 @@ // receive anything at all. class WaylandDataDragController : public WaylandDataDevice::DragDelegate, public WaylandDataSource::Delegate, - public WaylandWindowObserver { + public WaylandWindowObserver, + public PlatformEventDispatcher { public: enum class State { kIdle, // Doing nothing special @@ -143,6 +146,10 @@ void SetOfferedExchangeDataProvider(const OSExchangeData& data); const WaylandExchangeDataProvider* GetOfferedExchangeDataProvider() const; + // PlatformEventDispatcher: + bool CanDispatchEvent(const PlatformEvent& event) override; + uint32_t DispatchEvent(const PlatformEvent& event) override; + WaylandConnection* const connection_; WaylandDataDeviceManager* const data_device_manager_; WaylandDataDevice* const data_device_; @@ -191,6 +198,8 @@ std::unique_ptr<WaylandShmBuffer> shm_buffer_; const SkBitmap* icon_bitmap_ = nullptr; + std::unique_ptr<ScopedEventDispatcher> nested_dispatcher_; + base::WeakPtrFactory<WaylandDataDragController> weak_factory_{this}; };
diff --git a/ui/ozone/platform/wayland/host/wayland_data_drag_controller_unittest.cc b/ui/ozone/platform/wayland/host/wayland_data_drag_controller_unittest.cc index dfb2b53d..9d784dd 100644 --- a/ui/ozone/platform/wayland/host/wayland_data_drag_controller_unittest.cc +++ b/ui/ozone/platform/wayland/host/wayland_data_drag_controller_unittest.cc
@@ -859,32 +859,65 @@ } // Regression test for https://crbug.com/1209269. +// +// Emulates "quick" wl_pointer.button release events being sent by the +// compositor, and processed by the ozone/wayland either (1) before or (2) just +// after WaylandWindow::StartDrag is called. The drag start happens in +// reposponse to sequence of input events. Such event processing may take some +// time, for example, when they happen in web contents, which involves async +// browser <=> renderer IPC, etc. In both cases, drag controller is expected to +// gracefully reset state and quit drag loop as if the drag session was +// cancelled as usual. TEST_P(WaylandDataDragControllerTest, AsyncNoopStartDrag) { const bool restored_focus = window_->has_pointer_focus(); OSExchangeData os_exchange_data; os_exchange_data.SetString(sample_text_for_dnd()); + // 1. Send wl_pointer.button release before drag start. FocusAndPressLeftPointerButton(window_.get(), &delegate_); - - // Emulate a "quick" wl_pointer.button release event being processed by the - // compositor, which leads to a no-op subsequent WaylandWindow::StartDrag. In - // this case, the client is expected to gracefully reset state and quit drag - // loop as if the drag session was cancelled as usual. SendPointerButton(window_.get(), &delegate_, BTN_LEFT, /*pressed=*/false); Sync(); EXPECT_CALL(*this, MockStartDrag(_, _, _)).Times(0); // Attempt to start drag session and ensure it fails. - bool result = window_->StartDrag(os_exchange_data, DragDropTypes::DRAG_COPY, - DragEventSource::kMouse, /*cursor=*/{}, - /*can_grab_pointer=*/true, - drag_handler_delegate_.get()); - EXPECT_FALSE(result); + bool result_1 = window_->StartDrag(os_exchange_data, DragDropTypes::DRAG_COPY, + DragEventSource::kMouse, /*cursor=*/{}, + /*can_grab_pointer=*/true, + drag_handler_delegate_.get()); + EXPECT_FALSE(result_1); Mock::VerifyAndClearExpectations(drop_handler_.get()); Mock::VerifyAndClearExpectations(this); - EXPECT_FALSE(drag_controller()->origin_window_); + EXPECT_FALSE(drag_controller()->nested_dispatcher_); + + // 2. Send wl_pointer.button release just after drag start. + FocusAndPressLeftPointerButton(window_.get(), &delegate_); + Sync(); + + // Schedule a wl_pointer.button up, attempt to start drag session and ensure + // it exits with cancellation status. + ScheduleTestTask(base::BindLambdaForTesting([&]() { + SendPointerButton(window_.get(), &delegate_, BTN_LEFT, /*pressed=*/false); + + EXPECT_CALL(*drop_handler_, OnDragLeave).Times(1); + EXPECT_CALL(*drag_handler_delegate_, + OnDragFinished(Eq(DragOperation::kNone))) + .Times(1); + Sync(); + })); + EXPECT_CALL(*this, MockStartDrag(_, _, _)).Times(1); + bool result_2 = window_->StartDrag(os_exchange_data, DragDropTypes::DRAG_COPY, + DragEventSource::kMouse, /*cursor=*/{}, + /*can_grab_pointer=*/true, + drag_handler_delegate_.get()); + // TODO(crbug.com/1022722): Double-check if this should return false instead. + EXPECT_TRUE(result_2); + Mock::VerifyAndClearExpectations(drop_handler_.get()); + Mock::VerifyAndClearExpectations(drag_handler_delegate_.get()); + Mock::VerifyAndClearExpectations(this); + EXPECT_FALSE(drag_controller()->origin_window_); + EXPECT_FALSE(drag_controller()->nested_dispatcher_); window_->SetPointerFocus(restored_focus); }