diff --git a/DEPS b/DEPS index fdc7e0e..05306e8 100644 --- a/DEPS +++ b/DEPS
@@ -196,7 +196,7 @@ # luci-go CIPD package version. # Make sure the revision is uploaded by infra-packagers builder. # https://ci.chromium.org/p/infra-internal/g/infra-packagers/console - 'luci_go': 'git_revision:028cd41e0f4b2bec99d94c780caf2f978e09b182', + 'luci_go': 'git_revision:e9585787c808e21d6eaa2c7d7a928dbc19999172', # This can be overridden, e.g. with custom_vars, to build clang from HEAD # instead of downloading the prebuilt pinned revision. @@ -228,19 +228,19 @@ # 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': '47f76853c6266d02bfc914fe4e8160b60a1f903a', + 'skia_revision': '71cb9725180a28eeec13aafbf17f901166b191b8', # 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': '52090340d5cba199f8bdf35054b9c4ab36748f78', + 'v8_revision': '853a0bd84a0f6963fb38ddb566bc8a033232b1f2', # 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': '1ae7981088c22832b5812082aaad1d04f3f03721', + 'angle_revision': 'afe0dd9edf76dd798af7615e347725afd284924c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. - 'swiftshader_revision': 'c710de9749367f4aad88d3b030172322919c85f8', + 'swiftshader_revision': '054ff0cd5b7ecaab630dfcf8814ec9e5c88e6a6b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. @@ -259,7 +259,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling googletest # and whatever else without interference from each other. - 'googletest_revision': '159c9ad23e8b276e8c975bb8621c81d4df5fd863', + 'googletest_revision': 'e4717df71a4f45bf9f0ac88c6cd9846a0bc248dd', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling lighttpd # and whatever else without interference from each other. @@ -295,7 +295,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '3d49e1ccfd129f8c8426b9d97185f84a636880cd', + 'catapult_revision': '444aba89e1c30edf348c611a9df79e2376178ba8', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -303,7 +303,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': '3a286afd3b34af74c622cc762ae46008d5a887f9', + 'devtools_frontend_revision': 'db4c9684f0c5d9f59def0da90f80372cba6f2195', # 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. @@ -367,7 +367,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libavif # and whatever else without interference from each other. - 'libavif_revision': '2c1f62768f309144fa71e5a698de8a026a6b71dd', + 'libavif_revision': 'f131b785938e96995e4ef8d8baaefca8f974afb9', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling nearby # and whatever else without interference from each other. @@ -992,7 +992,7 @@ # Tools used when building Chrome for Chrome OS. This affects both the Simple # Chrome workflow, as well as the chromeos-chrome ebuild. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'b0b76b29bed267b56f7729f60db118865d124952', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'a49cb4dc98f176f64d0e39d8aebb87c6b5bc3c1b', 'condition': 'checkout_chromeos', }, @@ -1012,7 +1012,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'a6baf70a45b04731ed99f47a0fbfcb5f28a1f03e', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'f35d3508ebd8c98d6c3b6ebfebe4895b374dbc07', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1476,7 +1476,7 @@ 'packages': [ { 'package': 'fuchsia/third_party/aemu/linux-amd64', - 'version': 'DJruGwXsn7A79ZGy_9mpp5-OHYZqoyeiKRuVvgu_TiQC' + 'version': 'y7X4kitLsRPSZc6ksrVllZRbH7mvEXlq9-4wOg7zR5cC' }, ], 'condition': 'host_os == "linux" and checkout_fuchsia', @@ -1619,7 +1619,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'b0291fd966b55a5efc496772555b94842bde1085', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'b3c9d3da8f3466a1969c2bbee308cb57105720f6', + Var('webrtc_git') + '/src.git' + '@' + '889ffa4d26fa0059542c7cf5ae2ec43a687b749c', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1646,7 +1646,7 @@ 'packages': [ { 'package': 'skia/tools/goldctl/linux-amd64', - 'version': 'NzB8fnDNSFKL_tbRaBl6gO6f7Ljdwcdt9VbE3hQfjaoC', + 'version': 'qxkaCck3N7NNLCHvQM2gksDboY80QAXbM9dfnJD0-y8C', }, ], 'dep_type': 'cipd', @@ -1656,7 +1656,7 @@ 'packages': [ { 'package': 'skia/tools/goldctl/windows-amd64', - 'version': 'FqoNmLPfLGQu3lutK7aebZdmo2pHBMK9hZoKUkC9njkC', + 'version': 'mXlfDemOBUbOngfIwncHzw56bAtEBcVh15WyA9ikp2cC', }, ], 'dep_type': 'cipd', @@ -1666,7 +1666,7 @@ 'packages': [ { 'package': 'skia/tools/goldctl/mac-amd64', - 'version': 'AjcIwArqfleDRrG1XpbN5DU5ZILcha99HMwrLEidm7kC', + 'version': 'U5z-9pZVF7_n6d_eDRqkGGExXzWAwaI9weKVJ0UNCWIC', }, ], 'dep_type': 'cipd', @@ -1677,7 +1677,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@d1fe1bc5bf7cb458c42a09f3de19a7a5709679eb', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@7066c1b6405040f6890630c0de83c2b237cd77c8', 'condition': 'checkout_src_internal', }, @@ -1685,7 +1685,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/eche_app/app', - 'version': 'vfSvt4_rJR0SPZGxGk0lSP-uaypLPoA6EeKstKVfZicC', + 'version': 'vYdpaWIxUzRyiSS-wpZmGmxnu79kgN9q_kb2w2YlFOoC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -1696,7 +1696,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': 'dXc8hOpK6y_gH_ZYGitODtLF0rTb0_i6-pxxoI6uEtAC', + 'version': 'l4kV1IJf98U03-NrGPDD9ayqWAzf_T7OO5WfdMbaQvUC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -1707,7 +1707,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'Vy-EFf7mHgxZf6ZZSJslvL7igDT69IqOdlX4ak0S7HEC', + 'version': 'aeIZajCBkF0LhFw_tL-5Yp_nmR4K38tF7g5UBlHfQ18C', }, ], 'condition': 'checkout_chromeos and checkout_src_internal',
diff --git a/ash/accelerators/accelerator_commands.cc b/ash/accelerators/accelerator_commands.cc index 696a24b..ae24104 100644 --- a/ash/accelerators/accelerator_commands.cc +++ b/ash/accelerators/accelerator_commands.cc
@@ -4,6 +4,7 @@ #include "ash/accelerators/accelerator_commands.h" +#include "ash/components/audio/cras_audio_handler.h" #include "ash/constants/ash_features.h" #include "ash/display/display_configuration_controller.h" #include "ash/focus_cycler.h" @@ -108,6 +109,18 @@ Shell::Get()->media_controller()->HandleMediaStop(); } +void MicrophoneMuteToggle() { + auto* const audio_handler = CrasAudioHandler::Get(); + const bool mute = !audio_handler->IsInputMuted(); + + if (mute) + base::RecordAction(base::UserMetricsAction("Keyboard_Microphone_Muted")); + else + base::RecordAction(base::UserMetricsAction("Keyboard_Microphone_Unmuted")); + + audio_handler->SetInputMute(mute); +} + void NewIncognitoWindow() { NewWindowDelegate::GetPrimary()->NewWindow( /*is_incognito=*/true,
diff --git a/ash/accelerators/accelerator_commands.h b/ash/accelerators/accelerator_commands.h index 491b93ac..a5aa594 100644 --- a/ash/accelerators/accelerator_commands.h +++ b/ash/accelerators/accelerator_commands.h
@@ -59,6 +59,9 @@ // Stop playing media. ASH_EXPORT void MediaStop(); +// Toggle microphone mute. +ASH_EXPORT void MicrophoneMuteToggle(); + // Open a new incognito browser window. ASH_EXPORT void NewIncognitoWindow();
diff --git a/ash/accelerators/accelerator_controller_impl.cc b/ash/accelerators/accelerator_controller_impl.cc index 184cc28..27dd6c33 100644 --- a/ash/accelerators/accelerator_controller_impl.cc +++ b/ash/accelerators/accelerator_controller_impl.cc
@@ -1780,6 +1780,7 @@ case DESKS_NEW_DESK: case DESKS_REMOVE_CURRENT_DESK: return true; + case DEBUG_MICROPHONE_MUTE_TOGGLE: case DEBUG_PRINT_LAYER_HIERARCHY: case DEBUG_PRINT_VIEW_HIERARCHY: case DEBUG_PRINT_WINDOW_HIERARCHY: @@ -1999,6 +2000,10 @@ case DESKS_REMOVE_CURRENT_DESK: HandleRemoveCurrentDesk(); break; + case DEBUG_MICROPHONE_MUTE_TOGGLE: + base::RecordAction(base::UserMetricsAction("Accel_Microphone_Mute")); + accelerators::MicrophoneMuteToggle(); + break; case DEBUG_PRINT_LAYER_HIERARCHY: case DEBUG_PRINT_VIEW_HIERARCHY: case DEBUG_PRINT_WINDOW_HIERARCHY:
diff --git a/ash/accelerators/accelerator_table.cc b/ash/accelerators/accelerator_table.cc index 5571797..86e24d5 100644 --- a/ash/accelerators/accelerator_table.cc +++ b/ash/accelerators/accelerator_table.cc
@@ -4,8 +4,10 @@ #include "ash/accelerators/accelerator_table.h" +#include "ash/public/cpp/accelerators.h" #include "ash/strings/grit/ash_strings.h" #include "base/cxx17_backports.h" +#include "ui/events/keycodes/keyboard_codes_posix.h" namespace ash { @@ -62,6 +64,7 @@ const AcceleratorData kDebugAcceleratorData[] = { {true, ui::VKEY_N, kDebugModifier, TOGGLE_WIFI}, + {true, ui::VKEY_M, kDebugModifier, DEBUG_MICROPHONE_MUTE_TOGGLE}, {true, ui::VKEY_O, kDebugModifier, DEBUG_SHOW_TOAST}, {true, ui::VKEY_P, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN, DEBUG_TOGGLE_TOUCH_PAD}, @@ -208,6 +211,7 @@ const AcceleratorAction kActionsAllowedAtModalWindow[] = { BRIGHTNESS_DOWN, BRIGHTNESS_UP, + DEBUG_MICROPHONE_MUTE_TOGGLE, DEBUG_TOGGLE_TOUCH_PAD, DEBUG_TOGGLE_TOUCH_SCREEN, DEV_ADD_REMOVE_DISPLAY, @@ -284,6 +288,7 @@ const AcceleratorAction kActionsAllowedInAppModeOrPinnedMode[] = { BRIGHTNESS_DOWN, BRIGHTNESS_UP, + DEBUG_MICROPHONE_MUTE_TOGGLE, DEBUG_PRINT_LAYER_HIERARCHY, DEBUG_PRINT_VIEW_HIERARCHY, DEBUG_PRINT_WINDOW_HIERARCHY, @@ -371,6 +376,7 @@ const AcceleratorAction kActionsKeepingMenuOpen[] = { BRIGHTNESS_DOWN, BRIGHTNESS_UP, + DEBUG_MICROPHONE_MUTE_TOGGLE, DEBUG_TOGGLE_TOUCH_PAD, DEBUG_TOGGLE_TOUCH_SCREEN, // Keep the menu open when switching desks. The desk activation code will
diff --git a/ash/accelerators/debug_commands.cc b/ash/accelerators/debug_commands.cc index 37d4132..cfd92a6a 100644 --- a/ash/accelerators/debug_commands.cc +++ b/ash/accelerators/debug_commands.cc
@@ -10,6 +10,7 @@ #include "ash/accelerators/accelerator_commands.h" #include "ash/constants/ash_switches.h" #include "ash/hud_display/hud_display.h" +#include "ash/public/cpp/accelerators.h" #include "ash/public/cpp/debug_utils.h" #include "ash/public/cpp/toast_data.h" #include "ash/shell.h" @@ -151,6 +152,9 @@ return; switch (action) { + case DEBUG_MICROPHONE_MUTE_TOGGLE: + accelerators::MicrophoneMuteToggle(); + break; case DEBUG_PRINT_LAYER_HIERARCHY: HandlePrintLayerHierarchy(); break;
diff --git a/ash/capture_mode/capture_mode_notification_view.cc b/ash/capture_mode/capture_mode_notification_view.cc index a3cd6fa9..b5a2e34f 100644 --- a/ash/capture_mode/capture_mode_notification_view.cc +++ b/ash/capture_mode/capture_mode_notification_view.cc
@@ -143,10 +143,8 @@ if (!notification.image().IsEmpty()) CreateExtraView(); - // We need to observe this view as |this| view will be re-used for - // notifications for with/without image scenarios if |this| is not destroyed - // by the user or by the timeout before the next notification shows up. - views::View::AddObserver(this); + // Observes image container to make changes to the extra view if necessary. + image_container_view()->AddObserver(this); } CaptureModeNotificationView::~CaptureModeNotificationView() = default; @@ -188,20 +186,20 @@ extra_view_->SetBoundsRect(extra_view_bounds); } -void CaptureModeNotificationView::OnChildViewAdded(views::View* observed_view, - views::View* child) { - if (observed_view == this && child == image_container_view()) - CreateExtraView(); -} - -void CaptureModeNotificationView::OnChildViewRemoved(views::View* observed_view, - views::View* child) { - if (observed_view == this && child == image_container_view()) - extra_view_ = nullptr; +void CaptureModeNotificationView::OnViewVisibilityChanged( + views::View* observed_view, + views::View* starting_view) { + if (observed_view == image_container_view() && + starting_view == image_container_view()) { + if (!image_container_view()->GetVisible()) + extra_view_ = nullptr; + else if (image_container_view()->children().empty()) + CreateExtraView(); + } } void CaptureModeNotificationView::OnViewIsDeleting(View* observed_view) { - DCHECK_EQ(observed_view, this); + DCHECK_EQ(observed_view, image_container_view()); views::View::RemoveObserver(this); }
diff --git a/ash/capture_mode/capture_mode_notification_view.h b/ash/capture_mode/capture_mode_notification_view.h index 50cae1a..e041daa 100644 --- a/ash/capture_mode/capture_mode_notification_view.h +++ b/ash/capture_mode/capture_mode_notification_view.h
@@ -42,10 +42,8 @@ void Layout() override; // views::ViewObserver: - void OnChildViewAdded(views::View* observed_view, - views::View* child) override; - void OnChildViewRemoved(views::View* observed_view, - views::View* child) override; + void OnViewVisibilityChanged(View* observed_view, + View* starting_view) override; void OnViewIsDeleting(View* observed_view) override; private:
diff --git a/ash/capture_mode/capture_mode_unittests.cc b/ash/capture_mode/capture_mode_unittests.cc index 93b888d..a27a71c 100644 --- a/ash/capture_mode/capture_mode_unittests.cc +++ b/ash/capture_mode/capture_mode_unittests.cc
@@ -3029,8 +3029,7 @@ histogram_tester.ExpectBucketCount(kTabletHistogram, 0, 1); } -// Disabled due to excessive flakiness. https://crbug.com/1245273 -TEST_F(CaptureModeTest, DISABLED_FullscreenCapture) { +TEST_F(CaptureModeTest, FullscreenCapture) { ui::ScopedAnimationDurationScaleMode animation_scale( ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); CaptureModeController* controller = StartCaptureSession(
diff --git a/ash/public/cpp/BUILD.gn b/ash/public/cpp/BUILD.gn index d07aa87..259e886 100644 --- a/ash/public/cpp/BUILD.gn +++ b/ash/public/cpp/BUILD.gn
@@ -311,8 +311,6 @@ "views_text_services_context_menu_impl.h", "vm_camera_mic_constants.cc", "vm_camera_mic_constants.h", - "wallpaper/local_image_info.cc", - "wallpaper/local_image_info.h", "wallpaper/online_wallpaper_params.cc", "wallpaper/online_wallpaper_params.h", "wallpaper/wallpaper_controller.cc",
diff --git a/ash/public/cpp/accelerators.h b/ash/public/cpp/accelerators.h index fd36bdb1..d49ff42 100644 --- a/ash/public/cpp/accelerators.h +++ b/ash/public/cpp/accelerators.h
@@ -131,6 +131,7 @@ // Debug accelerators are intentionally at the end, so that if you remove one // you don't need to update tests which check hashes of the ids. + DEBUG_MICROPHONE_MUTE_TOGGLE, DEBUG_PRINT_LAYER_HIERARCHY, DEBUG_PRINT_VIEW_HIERARCHY, DEBUG_PRINT_WINDOW_HIERARCHY,
diff --git a/ash/public/cpp/wallpaper/local_image_info.cc b/ash/public/cpp/wallpaper/local_image_info.cc deleted file mode 100644 index f851f76..0000000 --- a/ash/public/cpp/wallpaper/local_image_info.cc +++ /dev/null
@@ -1,18 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/public/cpp/wallpaper/local_image_info.h" - -#include "base/files/file_path.h" -#include "base/unguessable_token.h" - -namespace ash { - -LocalImageInfo::LocalImageInfo() = default; -LocalImageInfo::LocalImageInfo(base::UnguessableToken id, - const base::FilePath& path) - : id(id), path(path) {} -LocalImageInfo::~LocalImageInfo() = default; - -} // namespace ash
diff --git a/ash/public/cpp/wallpaper/local_image_info.h b/ash/public/cpp/wallpaper/local_image_info.h deleted file mode 100644 index a96e861d..0000000 --- a/ash/public/cpp/wallpaper/local_image_info.h +++ /dev/null
@@ -1,27 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef ASH_PUBLIC_CPP_WALLPAPER_LOCAL_IMAGE_INFO_H_ -#define ASH_PUBLIC_CPP_WALLPAPER_LOCAL_IMAGE_INFO_H_ - -#include "ash/public/cpp/ash_public_export.h" -#include "base/files/file_path.h" -#include "base/unguessable_token.h" - -namespace ash { - -struct ASH_PUBLIC_EXPORT LocalImageInfo { - LocalImageInfo(); - LocalImageInfo(base::UnguessableToken id, const base::FilePath& path); - ~LocalImageInfo(); - - // The unique identifier for the local image. - base::UnguessableToken id; - // The file path of the local image. - base::FilePath path; -}; - -} // namespace ash - -#endif // ASH_PUBLIC_CPP_WALLPAPER_LOCAL_IMAGE_INFO_H_
diff --git a/ash/system/message_center/ash_notification_view.cc b/ash/system/message_center/ash_notification_view.cc index f342c5d4..14cf14b 100644 --- a/ash/system/message_center/ash_notification_view.cc +++ b/ash/system/message_center/ash_notification_view.cc
@@ -20,6 +20,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" +#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/rounded_corners_f.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/scoped_canvas.h" @@ -40,15 +41,54 @@ namespace { +constexpr gfx::Insets kNotificationViewPadding(6, 16, 22, 6); +constexpr gfx::Insets kMainRightViewPadding(0, 0, 0, 10); +constexpr int kMainRightViewVerticalSpacing = 16; +constexpr gfx::Insets kContentRowPadding(0, 14, 0, 0); +constexpr int kContentRowHorizontalSpacing = 16; +constexpr int kLeftContentVerticalSpacing = 4; constexpr int kTitleRowSpacing = 6; // Bullet character. The divider symbol between the title and the timestamp. constexpr char16_t kTitleRowDivider[] = u"\u2022"; +constexpr char kGoogleSansFont[] = "Google Sans"; + +constexpr int kAppIconViewSize = 24; constexpr int kExpandButtonSize = 24; constexpr int kTitleCharacterLimit = message_center::kNotificationWidth * message_center::kMaxTitleLines / message_center::kMinPixelsPerTitleCharacter; +constexpr int kExpandedTitleLabelSize = 16; +constexpr int kCollapsedTitleLabelSize = 14; +constexpr int kTimestampInCollapsedViewSize = 12; +constexpr int kMessageLabelSize = 13; +// The size for `icon_view_`, which is the icon within right content (between +// title/message view and expand button). +constexpr int kIconViewSize = 48; + +constexpr int kContentRowWidth = + message_center::kNotificationWidth - kNotificationViewPadding.width() - + kAppIconViewSize - kMainRightViewPadding.width() - + kContentRowPadding.width(); + +constexpr int kLeftContentWidth = kContentRowWidth - kExpandButtonSize - + kAppIconViewSize - + kContentRowHorizontalSpacing * 2; + +// Configure the style for labels in notification view. `is_color_primary` +// indicates if the color of the text is primary or secondary text color. +void ConfigureLabelStyle(views::Label* label, int size, bool is_color_primary) { + label->SetAutoColorReadabilityEnabled(false); + label->SetFontList(gfx::FontList({kGoogleSansFont}, gfx::Font::NORMAL, size, + gfx::Font::Weight::MEDIUM)); + auto layer_type = + is_color_primary + ? ash::AshColorProvider::ContentLayerType::kTextColorPrimary + : ash::AshColorProvider::ContentLayerType::kTextColorSecondary; + label->SetEnabledColor( + ash::AshColorProvider::Get()->GetContentLayerColor(layer_type)); +} } // namespace @@ -71,12 +111,31 @@ AddChildView(std::make_unique<views::Label>())) { SetLayoutManager(std::make_unique<views::BoxLayout>( Orientation::kHorizontal, gfx::Insets(), kTitleRowSpacing)); + ConfigureLabelStyle(title_row_divider_, kTimestampInCollapsedViewSize, + /*is_color_primary=*/false); + ConfigureLabelStyle(timestamp_in_collapsed_view_, + kTimestampInCollapsedViewSize, + /*is_color_primary=*/false); + ConfigureLabelStyle(title_view_, kExpandedTitleLabelSize, + /*is_color_primary=*/true); } AshNotificationView::NotificationTitleRow::~NotificationTitleRow() { timestamp_update_timer_.Stop(); } +void AshNotificationView::NotificationTitleRow::SetExpanded(bool expanded) { + ConfigureLabelStyle( + title_view_, + expanded ? kExpandedTitleLabelSize : kCollapsedTitleLabelSize, + /*is_color_primary=*/true); + + // In expanded state, we need to resize the title view since it becomes + // bigger. We also need to reset the fixed width in this label to zero in + // collapsed state for the timestamp alongside it can be shown. + title_view_->SizeToFit(expanded ? kContentRowWidth : 0); +} + void AshNotificationView::NotificationTitleRow::UpdateTitle( const std::u16string& title) { title_view_->SetText(title); @@ -163,7 +222,7 @@ // TODO(crbug/1232197): fix views and layout to match spec. // Instantiate view instances and define layout and view hierarchy. auto* layout_manager = SetLayoutManager(std::make_unique<views::BoxLayout>( - Orientation::kVertical, gfx::Insets(), 0)); + Orientation::kVertical, kNotificationViewPadding, 0)); layout_manager->set_cross_axis_alignment( views::BoxLayout::CrossAxisAlignment::kEnd); @@ -173,14 +232,24 @@ auto header_left_content = std::make_unique<views::View>(); header_left_content->SetLayoutManager(std::make_unique<views::BoxLayout>( Orientation::kVertical, gfx::Insets(), 0)); + header_left_content->AddChildView(CreateHeaderRow()); - left_content_ = header_left_content->AddChildView(CreateLeftContentView()); + + auto left_content = CreateLeftContentView(); + auto* left_content_layout = + static_cast<views::BoxLayout*>(left_content->GetLayoutManager()); + left_content_layout->set_between_child_spacing(kLeftContentVerticalSpacing); + left_content_ = header_left_content->AddChildView(std::move(left_content)); auto content_row = CreateContentRow(); + auto* content_row_layout = + static_cast<views::BoxLayout*>(content_row->GetLayoutManager()); + content_row_layout->set_inside_border_insets(kContentRowPadding); + content_row_layout->set_between_child_spacing(kContentRowHorizontalSpacing); + auto* header_left_content_ptr = content_row->AddChildView(std::move(header_left_content)); - static_cast<views::BoxLayout*>(content_row->GetLayoutManager()) - ->SetFlexForView(header_left_content_ptr, 1); + content_row_layout->SetFlexForView(header_left_content_ptr, 1); content_row->AddChildView(CreateRightContentView()); expand_button_ = content_row->AddChildView( @@ -193,7 +262,8 @@ // Main right view contains all the views besides control buttons and icon. auto main_right_view = std::make_unique<views::View>(); main_right_view->SetLayoutManager(std::make_unique<views::BoxLayout>( - Orientation::kVertical, gfx::Insets(), 0)); + Orientation::kVertical, kMainRightViewPadding, + kMainRightViewVerticalSpacing)); main_right_view->AddChildView(std::move(content_row)); main_right_view->AddChildView(CreateInlineSettingsView()); main_right_view->AddChildView(CreateImageContainerView()); @@ -383,9 +453,23 @@ // TODO(crbug/1243889): call SizeToFit() `title_view_` to fit the space after // the padding and spacing are done. - if (title_row_) + if (title_row_) { title_row_->UpdateVisibility(is_grouped_child_view_ || (IsExpandable() && !expanded)); + title_row_->SetExpanded(expanded); + } + + if (message_view()) { + ConfigureLabelStyle(message_view(), kMessageLabelSize, false); + + // TODO(crbug/682266): This is a workaround to that bug by explicitly + // setting the width. Ideally, we should fix the original bug, but it seems + // there's no obvious solution for the bug according to + // https://crbug.com/678337#c7. We will consider making changes to this code + // when the bug is fixed. + message_view()->SizeToFit(IsIconViewShown() ? kLeftContentWidth + : kContentRowWidth); + } expand_button_->SetVisible(IsExpandable()); expand_button_->SetExpanded(expanded); @@ -439,6 +523,10 @@ return std::make_unique<AshNotificationInputContainer>(this); } +gfx::Size AshNotificationView::GetIconViewSize() const { + return gfx::Size(kIconViewSize, kIconViewSize); +} + void AshNotificationView::UpdateBackground(int top_radius, int bottom_radius) { SkColor background_color; if (shown_in_popup_) {
diff --git a/ash/system/message_center/ash_notification_view.h b/ash/system/message_center/ash_notification_view.h index 01d7728..e2f6a642 100644 --- a/ash/system/message_center/ash_notification_view.h +++ b/ash/system/message_center/ash_notification_view.h
@@ -67,6 +67,7 @@ void OnThemeChanged() override; std::unique_ptr<message_center::NotificationInputContainer> GenerateNotificationInputContainer() override; + gfx::Size GetIconViewSize() const override; private: friend class AshNotificationViewTest; @@ -81,7 +82,7 @@ NotificationTitleRow& operator=(const NotificationTitleRow&) = delete; ~NotificationTitleRow() override; - // Changed the expand state. Hide divider and timestamp in collapse mode. + // Changed the expand state. Title view size will change based on the state. void SetExpanded(bool expanded); // Update title view's text.
diff --git a/ash/wallpaper/wallpaper_controller_impl.cc b/ash/wallpaper/wallpaper_controller_impl.cc index 1522e20..df373df 100644 --- a/ash/wallpaper/wallpaper_controller_impl.cc +++ b/ash/wallpaper/wallpaper_controller_impl.cc
@@ -1100,7 +1100,7 @@ return; RemoveUserWallpaper(account_id); - if (!InitializeUserWallpaperInfo(account_id)) { + if (!SetDefaultWallpaperInfo(account_id, base::Time::Now())) { LOG(ERROR) << "Initializing user wallpaper info fails. This should never " "happen except in tests."; } @@ -1244,7 +1244,7 @@ WallpaperInfo info; if (!GetUserWallpaperInfo(account_id, &info)) { - if (!InitializeUserWallpaperInfo(account_id)) + if (!SetDefaultWallpaperInfo(account_id, base::Time::Min())) return; GetUserWallpaperInfo(account_id, &info); } @@ -1449,7 +1449,6 @@ info.location = std::string(); info.layout = NUM_WALLPAPER_LAYOUT; } - return info; } @@ -1858,14 +1857,15 @@ DecodeImageFile(std::move(callback), file_path); } -bool WallpaperControllerImpl::InitializeUserWallpaperInfo( - const AccountId& account_id) { +bool WallpaperControllerImpl::SetDefaultWallpaperInfo( + const AccountId& account_id, + const base::Time& date) { const WallpaperInfo info = {/*in_location=*/std::string(), /*in_asset_id=*/absl::nullopt, /*in_collection_id=*/std::string(), WALLPAPER_LAYOUT_CENTER_CROPPED, WallpaperType::kDefault, - base::Time::Now()}; + date}; return SetUserWallpaperInfo(account_id, info); } @@ -2436,9 +2436,6 @@ case WallpaperType::kCustomized: HandleCustomWallpaperInfoSyncedIn(account_id, info); break; - case WallpaperType::kDefault: - SetDefaultWallpaper(account_id, /*show_wallpaper=*/true); - break; case WallpaperType::kDaily: HandleDailyWallpaperInfoSyncedIn(account_id, info); break; @@ -2451,6 +2448,7 @@ /*daily_refresh_enabled=*/false}, base::DoNothing()); break; + case WallpaperType::kDefault: case WallpaperType::kPolicy: case WallpaperType::kThirdParty: case WallpaperType::kDevice: @@ -2482,9 +2480,9 @@ switch (type) { case WallpaperType::kDaily: case WallpaperType::kCustomized: - case WallpaperType::kDefault: case WallpaperType::kOnline: return true; + case WallpaperType::kDefault: case WallpaperType::kPolicy: case WallpaperType::kThirdParty: case WallpaperType::kDevice:
diff --git a/ash/wallpaper/wallpaper_controller_impl.h b/ash/wallpaper/wallpaper_controller_impl.h index 80fd9ed..f73f410 100644 --- a/ash/wallpaper/wallpaper_controller_impl.h +++ b/ash/wallpaper/wallpaper_controller_impl.h
@@ -427,9 +427,10 @@ scoped_refptr<base::SequencedTaskRunner> task_runner, const base::FilePath& file_path); - // Initializes wallpaper info for the user to default and saves it to local - // state the user is not ephemeral. Returns false if initialization fails. - bool InitializeUserWallpaperInfo(const AccountId& account_id); + // Sets wallpaper info for the user to default and saves it to local + // state the user is not ephemeral. Returns false if this fails. + bool SetDefaultWallpaperInfo(const AccountId& account_id, + const base::Time& date); // Used as the callback of checking `WallpaperType::kOnline` wallpaper // existence in `SetOnlineWallpaperIfExists`. Initiates reading and decoding
diff --git a/ash/wallpaper/wallpaper_controller_unittest.cc b/ash/wallpaper/wallpaper_controller_unittest.cc index 1be802c..6ece24a 100644 --- a/ash/wallpaper/wallpaper_controller_unittest.cc +++ b/ash/wallpaper/wallpaper_controller_unittest.cc
@@ -646,6 +646,32 @@ return histogram_tester_; } + void CacheOnlineWallpaper(std::string path) { + // Set an Online Wallpaper from Data, so syncing in doesn't need to download + // an Online Wallpaper. + SetBypassDecode(); + SimulateUserLogin(account_id_1); + ClearWallpaperCount(); + controller_->SetOnlineWallpaperFromData( + OnlineWallpaperParams( + account_id_1, /*asset_id=*/absl::nullopt, GURL(path), + /*collection_id=*/std::string(), WALLPAPER_LAYOUT_CENTER_CROPPED, + /*preview_mode=*/false, /*from_user=*/false, + /*daily_refresh_enabled=*/false), + /*image_data=*/std::string(), + WallpaperControllerImpl::SetOnlineWallpaperCallback()); + RunAllTasksUntilIdle(); + + // Change the on-screen wallpaper to a different one. (Otherwise the + // subsequent calls will be no-op since we intentionally prevent reloading + // the same wallpaper.) + ClearWallpaperCount(); + controller_->SetCustomWallpaper( + account_id_1, file_name_1, WALLPAPER_LAYOUT_CENTER_CROPPED, + CreateImage(640, 480, kWallpaperColor), false /*preview_mode=*/); + RunAllTasksUntilIdle(); + } + WallpaperControllerImpl* controller_ = nullptr; // Not owned. base::ScopedTempDir user_data_dir_; @@ -3220,8 +3246,11 @@ TEST_F(WallpaperControllerWallpaperWebUiTest, ActiveUserPrefServiceChangedSyncedInfoHandledLocally) { - SimulateUserLogin(account_id_1); - PutWallpaperInfoInPrefs(account_id_1, InfoWithType(WallpaperType::kDefault), + CacheOnlineWallpaper(kDummyUrl); + + WallpaperInfo synced_info = {kDummyUrl, WALLPAPER_LAYOUT_CENTER_CROPPED, + WallpaperType::kOnline, base::Time::Now()}; + PutWallpaperInfoInPrefs(account_id_1, synced_info, GetProfilePrefService(account_id_1), prefs::kSyncableWallpaperInfo); @@ -3234,15 +3263,18 @@ controller_->OnActiveUserPrefServiceChanged( GetProfilePrefService(account_id_1)); + RunAllTasksUntilIdle(); WallpaperInfo actual_info; EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &actual_info)); - EXPECT_EQ(WallpaperType::kDefault, actual_info.type); + EXPECT_EQ(WallpaperType::kOnline, actual_info.type); } TEST_F(WallpaperControllerWallpaperWebUiTest, ActiveUserPrefServiceChanged_SyncDisabled) { - SimulateUserLogin(account_id_1); - PutWallpaperInfoInPrefs(account_id_1, InfoWithType(WallpaperType::kDefault), + CacheOnlineWallpaper(kDummyUrl); + WallpaperInfo synced_info = {kDummyUrl, WALLPAPER_LAYOUT_CENTER_CROPPED, + WallpaperType::kOnline, base::Time::Now()}; + PutWallpaperInfoInPrefs(account_id_1, synced_info, GetProfilePrefService(account_id_1), prefs::kSyncableWallpaperInfo); @@ -3263,88 +3295,71 @@ } TEST_F(WallpaperControllerWallpaperWebUiTest, - HandleWallpaperInfoSyncedDefault) { - SimulateUserLogin(account_id_1); - PutWallpaperInfoInPrefs(account_id_1, InfoWithType(WallpaperType::kDefault), - GetProfilePrefService(account_id_1), - prefs::kSyncableWallpaperInfo); - WallpaperInfo actual_info; - EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &actual_info)); - EXPECT_EQ(WallpaperType::kDefault, actual_info.type); -} - -TEST_F(WallpaperControllerWallpaperWebUiTest, HandleWallpaperInfoSyncedLocalIsPolicy) { + CacheOnlineWallpaper(kDummyUrl); PutWallpaperInfoInPrefs(account_id_1, InfoWithType(WallpaperType::kPolicy), GetLocalPrefService(), prefs::kUserWallpaperInfo); SimulateUserLogin(account_id_1); - PutWallpaperInfoInPrefs(account_id_1, InfoWithType(WallpaperType::kDefault), + WallpaperInfo synced_info = {kDummyUrl, WALLPAPER_LAYOUT_CENTER_CROPPED, + WallpaperType::kOnline, base::Time::Now()}; + PutWallpaperInfoInPrefs(account_id_1, synced_info, GetProfilePrefService(account_id_1), prefs::kSyncableWallpaperInfo); + RunAllTasksUntilIdle(); + WallpaperInfo actual_info; EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &actual_info)); - EXPECT_NE(WallpaperType::kDefault, actual_info.type); + EXPECT_NE(WallpaperType::kOnline, actual_info.type); } TEST_F(WallpaperControllerWallpaperWebUiTest, HandleWallpaperInfoSyncedLocalIsThirdPartyAndOlder) { + CacheOnlineWallpaper(kDummyUrl); + WallpaperInfo local_info = InfoWithType(WallpaperType::kThirdParty); local_info.date = DayBeforeYesterdayish(); PutWallpaperInfoInPrefs(account_id_1, local_info, GetLocalPrefService(), prefs::kUserWallpaperInfo); SimulateUserLogin(account_id_1); - PutWallpaperInfoInPrefs(account_id_1, InfoWithType(WallpaperType::kDefault), + WallpaperInfo synced_info = {kDummyUrl, WALLPAPER_LAYOUT_CENTER_CROPPED, + WallpaperType::kOnline, base::Time::Now()}; + PutWallpaperInfoInPrefs(account_id_1, synced_info, GetProfilePrefService(account_id_1), prefs::kSyncableWallpaperInfo); + RunAllTasksUntilIdle(); + WallpaperInfo actual_info; EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &actual_info)); - EXPECT_EQ(WallpaperType::kDefault, actual_info.type); + EXPECT_EQ(WallpaperType::kOnline, actual_info.type); } TEST_F(WallpaperControllerWallpaperWebUiTest, HandleWallpaperInfoSyncedLocalIsThirdPartyAndNewer) { + CacheOnlineWallpaper(kDummyUrl); PutWallpaperInfoInPrefs(account_id_1, InfoWithType(WallpaperType::kThirdParty), GetLocalPrefService(), prefs::kUserWallpaperInfo); - WallpaperInfo synced_info = InfoWithType(WallpaperType::kDefault); - synced_info.date = DayBeforeYesterdayish(); + WallpaperInfo synced_info = {kDummyUrl, WALLPAPER_LAYOUT_CENTER_CROPPED, + WallpaperType::kOnline, DayBeforeYesterdayish()}; + PutWallpaperInfoInPrefs(account_id_1, synced_info, + GetProfilePrefService(account_id_1), + prefs::kSyncableWallpaperInfo); SimulateUserLogin(account_id_1); PutWallpaperInfoInPrefs(account_id_1, synced_info, GetProfilePrefService(account_id_1), prefs::kSyncableWallpaperInfo); + RunAllTasksUntilIdle(); + WallpaperInfo actual_info; EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &actual_info)); EXPECT_EQ(WallpaperType::kThirdParty, actual_info.type); } TEST_F(WallpaperControllerWallpaperWebUiTest, HandleWallpaperInfoSyncedOnline) { - SetBypassDecode(); - SimulateUserLogin(account_id_1); - - // Set an online wallpaper with image data. Verify that the wallpaper is set - // successfully. - ClearWallpaperCount(); - controller_->SetOnlineWallpaperFromData( - OnlineWallpaperParams( - account_id_1, /*asset_id=*/absl::nullopt, GURL(kDummyUrl), - /*collection_id=*/std::string(), WALLPAPER_LAYOUT_CENTER_CROPPED, - /*preview_mode=*/false, /*from_user=*/false, - /*daily_refresh_enabled=*/false), - /*image_data=*/std::string(), - WallpaperControllerImpl::SetOnlineWallpaperCallback()); - RunAllTasksUntilIdle(); - - // Change the on-screen wallpaper to a different one. (Otherwise the - // subsequent calls will be no-op since we intentionally prevent reloading the - // same wallpaper.) - ClearWallpaperCount(); - controller_->SetCustomWallpaper( - account_id_1, file_name_1, WALLPAPER_LAYOUT_CENTER_CROPPED, - CreateImage(640, 480, kWallpaperColor), false /*preview_mode=*/); - RunAllTasksUntilIdle(); + CacheOnlineWallpaper(kDummyUrl); // Attempt to set an online wallpaper without providing the image data. Verify // it succeeds this time because |SetOnlineWallpaperFromData| has saved the
diff --git a/ash/webui/diagnostics_ui/resources/diagnostics_app.html b/ash/webui/diagnostics_ui/resources/diagnostics_app.html index a9534c42..5352cc4e 100644 --- a/ash/webui/diagnostics_ui/resources/diagnostics_app.html +++ b/ash/webui/diagnostics_ui/resources/diagnostics_app.html
@@ -24,7 +24,14 @@ <diagnostics-sticky-banner slot="banner" banner-message="{{bannerMessage_}}"> </diagnostics-sticky-banner> - <div slot="bottom-nav-content" class="session-log-container"> + <div slot="bottom-nav-content-panel" class="session-log-container"> + <cr-button on-click="onSessionLogClick_" class="session-log-button" + hidden="[[!isLoggedIn_]]"> + <iron-icon icon="diagnostics:download" id="download-icon"></iron-icon> + <span>[[i18n('sessionLog')]]</span> + </cr-button> + </div> + <div slot="bottom-nav-content-drawer" class="session-log-container"> <cr-button on-click="onSessionLogClick_" class="session-log-button" hidden="[[!isLoggedIn_]]"> <iron-icon icon="diagnostics:download" id="download-icon"></iron-icon>
diff --git a/base/BUILD.gn b/base/BUILD.gn index c1d9d815..75fd4ec 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -1607,10 +1607,10 @@ sources += [ "profiler/chrome_unwind_info_android.cc", "profiler/chrome_unwind_info_android.h", - "profiler/chrome_unwind_table_android.cc", - "profiler/chrome_unwind_table_android.h", "profiler/chrome_unwinder_android.cc", "profiler/chrome_unwinder_android.h", + "profiler/chrome_unwinder_android_v2.cc", + "profiler/chrome_unwinder_android_v2.h", ] } @@ -3418,8 +3418,8 @@ if (current_cpu == "arm") { sources += [ "profiler/chrome_unwind_info_android_unittest.cc", - "profiler/chrome_unwind_table_android_unittest.cc", "profiler/chrome_unwinder_android_unittest.cc", + "profiler/chrome_unwinder_android_v2_unittest.cc", ] } if (!exclude_unwind_tables &&
diff --git a/base/profiler/chrome_unwind_table_android.cc b/base/profiler/chrome_unwinder_android_v2.cc similarity index 99% rename from base/profiler/chrome_unwind_table_android.cc rename to base/profiler/chrome_unwinder_android_v2.cc index 20ea112..d1d42c0 100644 --- a/base/profiler/chrome_unwind_table_android.cc +++ b/base/profiler/chrome_unwinder_android_v2.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/profiler/chrome_unwind_table_android.h" +#include "base/profiler/chrome_unwinder_android_v2.h" #include <algorithm>
diff --git a/base/profiler/chrome_unwind_table_android.h b/base/profiler/chrome_unwinder_android_v2.h similarity index 94% rename from base/profiler/chrome_unwind_table_android.h rename to base/profiler/chrome_unwinder_android_v2.h index 41e7e13..d8f63f0 100644 --- a/base/profiler/chrome_unwind_table_android.h +++ b/base/profiler/chrome_unwinder_android_v2.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_PROFILER_CHROME_UNWIND_TABLE_ANDROID_H_ -#define BASE_PROFILER_CHROME_UNWIND_TABLE_ANDROID_H_ +#ifndef BASE_PROFILER_CHROME_UNWINDER_ANDROID_V2_H_ +#define BASE_PROFILER_CHROME_UNWINDER_ANDROID_V2_H_ #include <stdint.h> @@ -83,4 +83,4 @@ } // namespace base -#endif // BASE_PROFILER_CHROME_UNWIND_TABLE_ANDROID_H_ +#endif // BASE_PROFILER_CHROME_UNWINDER_ANDROID_V2_H_
diff --git a/base/profiler/chrome_unwind_table_android_unittest.cc b/base/profiler/chrome_unwinder_android_v2_unittest.cc similarity index 98% rename from base/profiler/chrome_unwind_table_android_unittest.cc rename to base/profiler/chrome_unwinder_android_v2_unittest.cc index 9b6f30c..ba39d7e7 100644 --- a/base/profiler/chrome_unwind_table_android_unittest.cc +++ b/base/profiler/chrome_unwinder_android_v2_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/profiler/chrome_unwind_table_android.h" +#include "base/profiler/chrome_unwinder_android_v2.h" #include "base/profiler/chrome_unwind_info_android.h" #include "base/test/gtest_util.h" @@ -656,7 +656,7 @@ EXPECT_EQ(0xfffffffful, thread_context.arm_sp); } -TEST(ChromeUnwindTableAndroidTest, +TEST(ChromeUnwinderAndroidV2Test, TestFunctionOffsetTableLookupExactMatchingOffset) { const uint8_t unwind_instruction_table[] = {0, 1, 2, 3, 4, 5, 6}; const uint8_t function_offset_table[] = { @@ -684,7 +684,7 @@ /* function_offset_table_byte_index */ 0x0})); } -TEST(ChromeUnwindTableAndroidTest, +TEST(ChromeUnwinderAndroidV2Test, TestFunctionOffsetTableLookupNonExactMatchingOffset) { const uint8_t unwind_instruction_table[] = {0, 1, 2, 3, 4, 5, 6}; const uint8_t function_offset_table[] = { @@ -712,7 +712,7 @@ /* function_offset_table_byte_index */ 0x0})); } -TEST(ChromeUnwindTableAndroidTest, TestFunctionOffsetTableLookupZeroOffset) { +TEST(ChromeUnwinderAndroidV2Test, TestFunctionOffsetTableLookupZeroOffset) { const uint8_t unwind_instruction_table[] = {0, 1, 2, 3, 4, 5, 6}; const uint8_t function_offset_table[] = { // Function 1: [(130, 2), (128, 3), (0, 4)] @@ -739,7 +739,7 @@ /* function_offset_table_byte_index */ 0x0})); } -TEST(ChromeUnwindTableAndroidTest, TestAddressTableLookupEntryInPage) { +TEST(ChromeUnwinderAndroidV2Test, TestAddressTableLookupEntryInPage) { const uint32_t page_start_instructions[] = {0, 2}; const FunctionTableEntry function_offset_table_indices[] = { // Page 0 @@ -797,7 +797,7 @@ } } -TEST(ChromeUnwindTableAndroidTest, TestAddressTableLookupEmptyPage) { +TEST(ChromeUnwinderAndroidV2Test, TestAddressTableLookupEmptyPage) { const uint32_t page_start_instructions[] = {0, 1, 1}; const FunctionTableEntry function_offset_table_indices[] = { // Page 0 @@ -824,7 +824,7 @@ EXPECT_EQ(20ul, entry_found->function_offset_table_byte_index); } -TEST(ChromeUnwindTableAndroidTest, +TEST(ChromeUnwinderAndroidV2Test, TestAddressTableLookupInvalidIntructionOffset) { const uint32_t page_start_instructions[] = {0, 1}; const FunctionTableEntry function_offset_table_indices[] = { @@ -862,7 +862,7 @@ } } -TEST(ChromeUnwindTableAndroidTest, +TEST(ChromeUnwinderAndroidV2Test, TestAddressTableLookupOnSecondPageOfFunctionSpanningPageBoundary) { const uint32_t page_start_instructions[] = {0, 1, 2}; const FunctionTableEntry function_offset_table_indices[] = { @@ -893,7 +893,7 @@ EXPECT_EQ(20ul, entry_found->function_offset_table_byte_index); } -TEST(ChromeUnwindTableAndroidTest, +TEST(ChromeUnwinderAndroidV2Test, TestAddressTableLookupWithinFunctionSpanningMultiplePages) { const uint32_t page_start_instructions[] = {0, 1, 1, 1}; const FunctionTableEntry function_offset_table_indices[] = {
diff --git a/build/android/resource_sizes.py b/build/android/resource_sizes.py index 0ffe235..2866437 100755 --- a/build/android/resource_sizes.py +++ b/build/android/resource_sizes.py
@@ -33,8 +33,9 @@ from pylib.constants import host_paths _AAPT_PATH = lazy.WeakConstant(lambda: build_tools.GetPath('aapt')) -_BUILD_UTILS_PATH = os.path.join( - host_paths.DIR_SOURCE_ROOT, 'build', 'android', 'gyp') +_ANDROID_UTILS_PATH = os.path.join(host_paths.DIR_SOURCE_ROOT, 'build', + 'android', 'gyp') +_BUILD_UTILS_PATH = os.path.join(host_paths.BUILD_PATH, 'util') with host_paths.SysPath(os.path.join(host_paths.DIR_SOURCE_ROOT, 'build')): import gn_helpers # pylint: disable=import-error @@ -45,10 +46,13 @@ with host_paths.SysPath(host_paths.TRACING_PATH): from tracing.value import convert_chart_json # pylint: disable=import-error -with host_paths.SysPath(_BUILD_UTILS_PATH, 0): +with host_paths.SysPath(_ANDROID_UTILS_PATH, 0): from util import build_utils # pylint: disable=import-error from util import zipalign # pylint: disable=import-error +with host_paths.SysPath(_BUILD_UTILS_PATH, 0): + from lib.results import result_sink + from lib.results import result_types zipalign.ApplyZipFileZipAlignFix() @@ -883,6 +887,7 @@ if args.chartjson: args.output_format = 'chartjson' + result_sink_client = result_sink.TryInitClient() isolated_script_output = {'valid': False, 'failures': []} test_name = 'resource_sizes (%s)' % os.path.basename(args.input) @@ -906,6 +911,13 @@ json.dump(isolated_script_output, output_file) with open(args.isolated_script_test_output, 'w') as output_file: json.dump(isolated_script_output, output_file) + if result_sink_client: + status = result_types.PASS + if not isolated_script_output['valid']: + status = result_types.UNKNOWN + elif isolated_script_output['failures']: + status = result_types.FAIL + result_sink_client.Post(test_name, status, None, None, None) if __name__ == '__main__':
diff --git a/build/android/resource_sizes.pydeps b/build/android/resource_sizes.pydeps index d956f5b..8298d160 100644 --- a/build/android/resource_sizes.pydeps +++ b/build/android/resource_sizes.pydeps
@@ -43,8 +43,12 @@ ../../third_party/catapult/tracing/tracing/value/convert_chart_json.py ../../third_party/catapult/tracing/tracing_project.py ../gn_helpers.py +../util/lib/__init__.py ../util/lib/common/perf_result_data_type.py ../util/lib/common/perf_tests_results_helper.py +../util/lib/results/__init__.py +../util/lib/results/result_sink.py +../util/lib/results/result_types.py devil_chromium.py gyp/util/__init__.py gyp/util/build_utils.py
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 219a2be..51266299 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn
@@ -222,7 +222,7 @@ assert(!(llvm_force_head_revision && use_goma), "can't use goma with trunk clang") -assert(!(llvm_force_head_revision && use_rbe), "can't use rbe with trunk clang") +assert(!(llvm_force_head_revision && use_remoteexec), "can't use rbe with trunk clang") # default_include_dirs --------------------------------------------------------- #
diff --git a/build/fuchsia/fvdl_target.py b/build/fuchsia/fvdl_target.py index 34cab1b0..e024617 100644 --- a/build/fuchsia/fvdl_target.py +++ b/build/fuchsia/fvdl_target.py
@@ -93,7 +93,6 @@ self._FVDL_PATH, '--sdk', 'start', - '--nopackageserver', '--nointeractive', # Host port mapping for user-networking mode. @@ -136,6 +135,26 @@ return emu_command + def _ConfigureEmulatorLog(self, emu_command): + if self._log_manager.IsLoggingEnabled(): + emu_command.extend([ + '--emulator-log', + os.path.join(self._log_manager.GetLogDirectory(), 'emulator_log') + ]) + + env_flags = [ + 'ANDROID_EMUGL_LOG_PRINT=1', + 'ANDROID_EMUGL_VERBOSE=1', + 'VK_LOADER_DEBUG=info,error', + ] + if self._hardware_gpu: + vulkan_icd_file = os.path.join( + common.GetEmuRootForPlatform(self.EMULATOR_NAME), 'lib64', 'vulkan', + 'vk_swiftshader_icd.json') + env_flags.append('VK_ICD_FILENAMES=%s' % vulkan_icd_file) + for flag in env_flags: + emu_command.extend(['--envs', flag]) + def _WaitUntilReady(self): # Indicates the FVDL command finished running. self._emu_process.communicate()
diff --git a/build/fuchsia/fvdl_target_test.py b/build/fuchsia/fvdl_target_test.py index b2f3b23..0409f93 100755 --- a/build/fuchsia/fvdl_target_test.py +++ b/build/fuchsia/fvdl_target_test.py
@@ -8,6 +8,7 @@ import boot_data import common import os +import tempfile import unittest import unittest.mock as mock @@ -26,77 +27,70 @@ with_network=False, ram_size_mb=8192, logs_dir=None) + common.EnsurePathExists = mock.MagicMock(return_value='image') + boot_data.ProvisionSSH = mock.MagicMock() + FvdlTarget.Shutdown = mock.MagicMock() def testBasicEmuCommand(self): with FvdlTarget.CreateFromArgs(self.args) as target: - target.Shutdown = mock.MagicMock() - common.EnsurePathExists = mock.MagicMock(return_value='image') - with mock.patch.object(boot_data, 'ProvisionSSH') as provision_mock: - build_command = target._BuildCommand() - self.assertIn(target._FVDL_PATH, build_command) - self.assertIn('--sdk', build_command) - self.assertIn('start', build_command) - self.assertNotIn('--noacceleration', target._BuildCommand()) - self.assertIn('--headless', target._BuildCommand()) - self.assertNotIn('--host-gpu', target._BuildCommand()) - self.assertNotIn('-N', target._BuildCommand()) - self.assertIn('--device-proto', target._BuildCommand()) - self.assertTrue(os.path.exists(target._device_proto_file.name)) - correct_ram_amount = False - with open(target._device_proto_file.name) as file: - for line in file: - if line.strip() == 'ram: 8192': - correct_ram_amount = True - break - self.assertTrue(correct_ram_amount) + build_command = target._BuildCommand() + self.assertIn(target._FVDL_PATH, build_command) + self.assertIn('--sdk', build_command) + self.assertIn('start', build_command) + self.assertNotIn('--noacceleration', build_command) + self.assertIn('--headless', build_command) + self.assertNotIn('--host-gpu', build_command) + self.assertNotIn('-N', build_command) + self.assertIn('--device-proto', build_command) + self.assertNotIn('--emulator-log', build_command) + self.assertNotIn('--envs', build_command) + self.assertTrue(os.path.exists(target._device_proto_file.name)) + correct_ram_amount = False + with open(target._device_proto_file.name) as file: + for line in file: + if line.strip() == 'ram: 8192': + correct_ram_amount = True + break + self.assertTrue(correct_ram_amount) def testBuildCommandCheckIfNotRequireKVMSetNoAcceleration(self): self.args.require_kvm = False with FvdlTarget.CreateFromArgs(self.args) as target: - target.Shutdown = mock.MagicMock() - common.EnsurePathExists = mock.MagicMock(return_value='image') - with mock.patch.object(boot_data, 'ProvisionSSH') as provision_mock: - self.assertIn('--noacceleration', target._BuildCommand()) + self.assertIn('--noacceleration', target._BuildCommand()) def testBuildCommandCheckIfNotEnableGraphicsSetHeadless(self): self.args.enable_graphics = True with FvdlTarget.CreateFromArgs(self.args) as target: - target.Shutdown = mock.MagicMock() - common.EnsurePathExists = mock.MagicMock(return_value='image') - with mock.patch.object(boot_data, 'ProvisionSSH') as provision_mock: - self.assertNotIn('--headless', target._BuildCommand()) + self.assertNotIn('--headless', target._BuildCommand()) def testBuildCommandCheckIfHardwareGpuSetHostGPU(self): self.args.hardware_gpu = True with FvdlTarget.CreateFromArgs(self.args) as target: - target.Shutdown = mock.MagicMock() - common.EnsurePathExists = mock.MagicMock(return_value='image') - with mock.patch.object(boot_data, 'ProvisionSSH') as provision_mock: - self.assertIn('--host-gpu', target._BuildCommand()) + self.assertIn('--host-gpu', target._BuildCommand()) def testBuildCommandCheckIfWithNetworkSetTunTap(self): self.args.with_network = True with FvdlTarget.CreateFromArgs(self.args) as target: - target.Shutdown = mock.MagicMock() - common.EnsurePathExists = mock.MagicMock(return_value='image') - with mock.patch.object(boot_data, 'ProvisionSSH') as provision_mock: - self.assertIn('-N', target._BuildCommand()) + self.assertIn('-N', target._BuildCommand()) def testBuildCommandCheckRamSizeNot8192SetRamSize(self): - self.args.ram_size_mb = 4096 + custom_ram_size = 4096 + self.args.ram_size_mb = custom_ram_size with FvdlTarget.CreateFromArgs(self.args) as target: - target.Shutdown = mock.MagicMock() - common.EnsurePathExists = mock.MagicMock(return_value='image') - with mock.patch.object(boot_data, 'ProvisionSSH') as provision_mock: - self.assertIn('--device-proto', target._BuildCommand()) - self.assertTrue(os.path.exists(target._device_proto_file.name)) - correct_ram_amount = False - with open(target._device_proto_file.name) as file: - for line in file: - if line.strip() == 'ram: 4096': - correct_ram_amount = True - break - self.assertTrue(correct_ram_amount) + self.assertIn('--device-proto', target._BuildCommand()) + self.assertTrue(os.path.exists(target._device_proto_file.name)) + correct_ram_amount = False + with open(target._device_proto_file.name, 'r') as f: + self.assertTrue(' ram: {}\n'.format(custom_ram_size) in f.readlines()) + + def testBuildCommandCheckEmulatorLogSetup(self): + with tempfile.TemporaryDirectory() as logs_dir: + self.args.logs_dir = logs_dir + with FvdlTarget.CreateFromArgs(self.args) as target: + emu_command = [] + target._ConfigureEmulatorLog(emu_command) + self.assertIn('--emulator-log', emu_command) + self.assertIn('--envs', emu_command) if __name__ == '__main__':
diff --git a/build/toolchain/BUILD.gn b/build/toolchain/BUILD.gn index 6cf8f1b4..ab51780 100644 --- a/build/toolchain/BUILD.gn +++ b/build/toolchain/BUILD.gn
@@ -12,7 +12,7 @@ } if (current_toolchain == default_toolchain) { - if (action_pool_depth == -1 || (use_goma || use_rbe)) { + if (action_pool_depth == -1 || (use_goma || use_remoteexec)) { action_pool_depth = exec_script("get_cpu_count.py", [], "value") }
diff --git a/build/toolchain/aix/BUILD.gn b/build/toolchain/aix/BUILD.gn index 523b54e..cdcfbdb 100644 --- a/build/toolchain/aix/BUILD.gn +++ b/build/toolchain/aix/BUILD.gn
@@ -18,7 +18,7 @@ current_os = "aix" # reclient does not support gcc. - use_rbe = false + use_remoteexec = false is_clang = false } }
diff --git a/build/toolchain/cros/BUILD.gn b/build/toolchain/cros/BUILD.gn index c1e8c21..cd1825cb 100644 --- a/build/toolchain/cros/BUILD.gn +++ b/build/toolchain/cros/BUILD.gn
@@ -22,7 +22,7 @@ if (use_goma && toolchain_args.needs_gomacc_path_arg) { extra_cppflags += " --gomacc-path $goma_dir/gomacc" } - if (use_rbe && toolchain_args.needs_gomacc_path_arg) { + if (use_remoteexec && toolchain_args.needs_gomacc_path_arg) { extra_cppflags += " --gomacc-path $rbe_cros_cc_wrapper" }
diff --git a/build/toolchain/linux/BUILD.gn b/build/toolchain/linux/BUILD.gn index 6e11d5e..2f99002 100644 --- a/build/toolchain/linux/BUILD.gn +++ b/build/toolchain/linux/BUILD.gn
@@ -46,7 +46,7 @@ current_os = "linux" # reclient does not support gcc. - use_rbe = false + use_remoteexec = false is_clang = false } } @@ -67,7 +67,7 @@ current_os = "linux" # reclient does not support gcc. - use_rbe = false + use_remoteexec = false is_clang = false } } @@ -123,7 +123,7 @@ current_os = "linux" # reclient does not support gcc. - use_rbe = false + use_remoteexec = false is_clang = false } } @@ -227,7 +227,7 @@ current_os = "linux" # reclient does not support gcc. - use_rbe = false + use_remoteexec = false is_clang = false } } @@ -262,7 +262,7 @@ current_os = "linux" # reclient does not support gcc. - use_rbe = false + use_remoteexec = false is_clang = false use_goma = false } @@ -284,7 +284,7 @@ current_os = "linux" # reclient does not support gcc. - use_rbe = false + use_remoteexec = false is_clang = false use_goma = false } @@ -330,7 +330,7 @@ current_os = "linux" # reclient does not support gcc. - use_rbe = false + use_remoteexec = false is_clang = false } } @@ -349,7 +349,7 @@ current_os = "linux" # reclient does not support gcc. - use_rbe = false + use_remoteexec = false is_clang = false } } @@ -370,7 +370,7 @@ current_os = "linux" # reclient does not support gcc. - use_rbe = false + use_remoteexec = false is_clang = false } } @@ -391,7 +391,7 @@ current_os = "linux" # reclient does not support gcc. - use_rbe = false + use_remoteexec = false is_clang = false } }
diff --git a/build/toolchain/nacl/BUILD.gn b/build/toolchain/nacl/BUILD.gn index 8cd5550..383d2b54 100644 --- a/build/toolchain/nacl/BUILD.gn +++ b/build/toolchain/nacl/BUILD.gn
@@ -53,7 +53,7 @@ # When the compilers are run via goma, rbe or ccache rather than directly by # GN/Ninja, the rbe/goma/ccache wrapper handles .bat files but gets confused # by being given the scriptprefix. -if (host_os == "win" && !use_goma && !use_rbe && cc_wrapper == "") { +if (host_os == "win" && !use_goma && !use_remoteexec && cc_wrapper == "") { compiler_scriptprefix = scriptprefix } else { compiler_scriptprefix = "" @@ -159,7 +159,7 @@ current_cpu = toolchain_cpu # reclient does not support gcc. - use_rbe = false + use_remoteexec = false is_clang = false is_nacl_glibc = true use_lld = false
diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn index 03c10be..28923e66 100644 --- a/build/toolchain/win/BUILD.gn +++ b/build/toolchain/win/BUILD.gn
@@ -24,7 +24,7 @@ # This tool will is used as a wrapper for various commands below. tool_wrapper_path = rebase_path("tool_wrapper.py", root_build_dir) -if (use_rbe) { +if (use_remoteexec) { goma_prefix = "" rbe_prefix = "${rbe_bin_dir}/rewrapper -cfg=${rbe_cc_cfg_file} -exec_root=${rbe_exec_root} " clang_prefix = rbe_prefix
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/quickactionsearchwidget/QuickActionSearchWidgetProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/quickactionsearchwidget/QuickActionSearchWidgetProvider.java index 9af4a5f..a55b0526 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/quickactionsearchwidget/QuickActionSearchWidgetProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/quickactionsearchwidget/QuickActionSearchWidgetProvider.java
@@ -11,6 +11,7 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; +import android.os.Bundle; import androidx.annotation.LayoutRes; import androidx.annotation.NonNull; @@ -40,37 +41,67 @@ public abstract class QuickActionSearchWidgetProvider extends AppWidgetProvider { /** * A sub class of {@link QuickActionSearchWidgetProvider} that provides the widget that - * initially has the small layout. + * can resize. */ - public static class QuickActionSearchWidgetProviderSmall + public static class QuickActionSearchWidgetResizableProvider extends QuickActionSearchWidgetProvider { - private static QuickActionSearchWidgetProviderDelegate sDelegate; + protected static @Nullable QuickActionSearchWidgetProviderDelegate sSmallWidgetDelegate; + protected static @Nullable QuickActionSearchWidgetProviderDelegate sMediumWidgetDelegate; @Override - protected QuickActionSearchWidgetProviderDelegate getDelegate() { - if (sDelegate == null) { - sDelegate = createDelegate(R.layout.quick_action_search_widget_small_layout); + public void onAppWidgetOptionsChanged( + Context context, AppWidgetManager manager, int widgetId, Bundle newOptions) { + onUpdate(context, manager, new int[] {widgetId}); + super.onAppWidgetOptionsChanged(context, manager, widgetId, newOptions); + } + + @Override + protected @NonNull QuickActionSearchWidgetProviderDelegate getDelegate( + Context context, AppWidgetManager manager, int widgetId) { + Bundle options = manager.getAppWidgetOptions(widgetId); + int minHeight = options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT); + + if (minHeight >= context.getResources().getDimension( + R.dimen.quick_action_search_widget_medium_height)) { + return getMediumWidgetDelegate(); } - return sDelegate; + + return getSmallWidgetDelegate(); + } + + private @NonNull QuickActionSearchWidgetProviderDelegate getSmallWidgetDelegate() { + if (sSmallWidgetDelegate == null) { + sSmallWidgetDelegate = + createDelegate(R.layout.quick_action_search_widget_small_layout); + } + return sSmallWidgetDelegate; + } + + private @NonNull QuickActionSearchWidgetProviderDelegate getMediumWidgetDelegate() { + if (sMediumWidgetDelegate == null) { + sMediumWidgetDelegate = + createDelegate(R.layout.quick_action_search_widget_medium_layout); + } + return sMediumWidgetDelegate; } } + /** + * A sub class of {@link QuickActionSearchWidgetProvider} that provides the widget that + * initially has the small layout. + * Layout constraints are defined in the widget info xml file. + * Dedicated provider required by manifest declaration. + */ + public static class QuickActionSearchWidgetProviderSmall + extends QuickActionSearchWidgetResizableProvider {} /** * A sub class of {@link QuickActionSearchWidgetProvider} that provides the widget that * initially has the medium layout. + * Layout constraints are defined in the widget info xml file. + * Dedicated provider required by manifest declaration. */ public static class QuickActionSearchWidgetProviderMedium - extends QuickActionSearchWidgetProvider { - private static QuickActionSearchWidgetProviderDelegate sDelegate; - - @Override - protected QuickActionSearchWidgetProviderDelegate getDelegate() { - if (sDelegate == null) { - sDelegate = createDelegate(R.layout.quick_action_search_widget_medium_layout); - } - return sDelegate; - } - } + extends QuickActionSearchWidgetResizableProvider {} /** * A sub class of {@link QuickActionSearchWidgetProvider} that provides the widget that @@ -81,7 +112,8 @@ private static QuickActionSearchWidgetProviderDelegate sDelegate; @Override - protected QuickActionSearchWidgetProviderDelegate getDelegate() { + protected QuickActionSearchWidgetProviderDelegate getDelegate( + Context context, AppWidgetManager manager, int widgetId) { if (sDelegate == null) { sDelegate = createDelegate(R.layout.quick_action_search_widget_dino_layout); } @@ -110,8 +142,14 @@ // Query all widgets associated with this component. widgetIds = manager.getAppWidgetIds(new ComponentName(context, getClass().getName())); } - manager.updateAppWidget( - widgetIds, getDelegate().createWidgetRemoteViews(context, preferences)); + + for (int index = 0; index < widgetIds.length; index++) { + int widgetId = widgetIds[index]; + + manager.updateAppWidget(widgetId, + getDelegate(context, manager, widgetId) + .createWidgetRemoteViews(context, preferences)); + } } /** @@ -167,8 +205,13 @@ * <p> * We don't initialize the delegate in the constructor because creation of the * QuickActionSearchWidgetProvider is done by the system. + * + * @param context Current context. + * @param manager The AppWidgetManager instance to query widget info. + * @param widgetId The widget to get the delegate for. */ - protected abstract QuickActionSearchWidgetProviderDelegate getDelegate(); + protected abstract QuickActionSearchWidgetProviderDelegate getDelegate( + Context context, AppWidgetManager manager, int widgetId); /** * This function initializes the QuickActionSearchWidgetProvider component. Namely, this
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/quickactionsearchwidget/QuickActionSearchWidgetProviderTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/quickactionsearchwidget/QuickActionSearchWidgetProviderTest.java index 16b13b9..4dc6986 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/quickactionsearchwidget/QuickActionSearchWidgetProviderTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/quickactionsearchwidget/QuickActionSearchWidgetProviderTest.java
@@ -43,7 +43,8 @@ */ private class TestProvider extends QuickActionSearchWidgetProvider { @Override - protected QuickActionSearchWidgetProviderDelegate getDelegate() { + protected QuickActionSearchWidgetProviderDelegate getDelegate( + Context context, AppWidgetManager manager, int widgetId) { return mDelegateMock; } } @@ -79,6 +80,7 @@ verify(mWidgetProvider, times(1)).onUpdate(mContextMock, mAppWidgetManagerMock, WIDGET_IDS); verify(mWidgetProvider, times(1)).onUpdate(any(), any(), any()); - verify(mDelegateMock, times(1)).createWidgetRemoteViews(any(), any()); + // We create dedicated view based on widget size for every widget instance. + verify(mDelegateMock, times(2)).createWidgetRemoteViews(any(), any()); } }
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index ea33294..4e7aa95a 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -3760,6 +3760,7 @@ "enterprise/signals/context_info_fetcher.h", "enterprise/signals/device_info_fetcher.cc", "enterprise/signals/device_info_fetcher.h", + "enterprise/signals/signals_common.cc", "enterprise/signals/signals_common.h", "feedback/feedback_dialog_utils.cc", "feedback/feedback_dialog_utils.h",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 1003d16f..b0de3e10 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -82,6 +82,8 @@ #include "components/browser_sync/browser_sync_switches.h" #include "components/browsing_data/core/features.h" #include "components/cloud_devices/common/cloud_devices_switches.h" +#include "components/component_updater/component_updater_command_line_config_policy.h" +#include "components/component_updater/component_updater_switches.h" #include "components/contextual_search/core/browser/public.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_features.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h" @@ -3471,9 +3473,6 @@ {"chrome-share-screenshot", flag_descriptions::kChromeShareScreenshotName, flag_descriptions::kChromeShareScreenshotDescription, kOsAndroid, FEATURE_VALUE_TYPE(chrome::android::kChromeShareScreenshot)}, - {"chrome-sharing-hub", flag_descriptions::kChromeSharingHubName, - flag_descriptions::kChromeSharingHubDescription, kOsAndroid, - FEATURE_VALUE_TYPE(chrome::android::kChromeSharingHub)}, {"chrome-sharing-hub-launch-adjacent", flag_descriptions::kChromeSharingHubLaunchAdjacentName, flag_descriptions::kChromeSharingHubLaunchAdjacentDescription, kOsAndroid, @@ -5005,10 +5004,11 @@ flag_descriptions::kEnableNetworkLoggingToFileDescription, kOsAll, SINGLE_VALUE_TYPE(network::switches::kLogNetLog)}, - {"enable-web-authentication-assertion-transport", - flag_descriptions::kEnableWebAuthenticationAssertionTransportName, - flag_descriptions::kEnableWebAuthenticationAssertionTransportDescription, - kOsAll, FEATURE_VALUE_TYPE(features::kWebAuthAssertionTransport)}, + {"enable-web-authentication-authenticator-attachment", + flag_descriptions::kEnableWebAuthenticationAuthenticatorAttachmentName, + flag_descriptions:: + kEnableWebAuthenticationAuthenticatorAttachmentDescription, + kOsAll, FEATURE_VALUE_TYPE(features::kWebAuthAuthenticatorAttachment)}, {"enable-web-authentication-cable-v2-support", flag_descriptions::kEnableWebAuthenticationCableV2SupportName, @@ -7696,6 +7696,14 @@ FEATURE_VALUE_TYPE(features::kSideSearchStatePerTab)}, #endif // BUILDFLAG(ENABLE_SIDE_SEARCH) +#if BUILDFLAG(IS_CHROMEOS_ASH) + {"enable-component-updater-test-request", + flag_descriptions::kComponentUpdaterTestRequestName, + flag_descriptions::kComponentUpdaterTestRequestDescription, kOsCrOS, + SINGLE_VALUE_TYPE_AND_VALUE(switches::kComponentUpdater, + component_updater::kSwitchTestRequestParam)}, +#endif + // NOTE: Adding a new flag requires adding a corresponding entry to enum // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag // Histograms" in tools/metrics/histograms/README.md (run the
diff --git a/chrome/browser/ash/arc/arc_support_host.cc b/chrome/browser/ash/arc/arc_support_host.cc index 88fee34..7f9b959 100644 --- a/chrome/browser/ash/arc/arc_support_host.cc +++ b/chrome/browser/ash/arc/arc_support_host.cc
@@ -37,10 +37,13 @@ #include "components/signin/public/identity_manager/identity_manager.h" #include "components/user_manager/known_user.h" #include "components/user_manager/user_manager.h" +#include "extensions/browser/app_window/app_window.h" +#include "extensions/browser/app_window/app_window_registry.h" #include "extensions/browser/extension_registry.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/webui/web_ui_util.h" #include "ui/chromeos/devicetype_utils.h" +#include "ui/gfx/native_widget_types.h" using sync_pb::UserConsentTypes; @@ -239,6 +242,16 @@ error_delegate_ = delegate; } +gfx::NativeWindow ArcSupportHost::GetNativeWindow() const { + extensions::AppWindowRegistry* registry = + extensions::AppWindowRegistry::Get(profile_); + if (!registry) return gfx::kNullNativeWindow; + + extensions::AppWindow* window = + registry->GetCurrentAppWindowForApp(arc::kPlayStoreAppId); + return window ? window->GetNativeWindow() : gfx::kNullNativeWindow; +} + bool ArcSupportHost::GetShouldShowRunNetworkTests() { return should_show_run_network_tests_; }
diff --git a/chrome/browser/ash/arc/arc_support_host.h b/chrome/browser/ash/arc/arc_support_host.h index b3de603..f8152775 100644 --- a/chrome/browser/ash/arc/arc_support_host.h +++ b/chrome/browser/ash/arc/arc_support_host.h
@@ -14,6 +14,7 @@ #include "chrome/browser/ash/arc/extensions/arc_support_message_host.h" #include "extensions/browser/api/messaging/native_message_host.h" #include "ui/display/display_observer.h" +#include "ui/gfx/native_widget_types.h" #include "url/gurl.h" class Profile; @@ -153,6 +154,10 @@ // Returns the should_show_run_network_tests_ field. bool GetShouldShowRunNetworkTests(); + // Returns the outermost native view. This will be used as the parent for + // dialog boxes. + gfx::NativeWindow GetNativeWindow() const; + bool HasAuthDelegate() const { return auth_delegate_ != nullptr; } // Called when the communication to arc_support Chrome App is ready.
diff --git a/chrome/browser/ash/arc/intent_helper/arc_settings_service_browsertest.cc b/chrome/browser/ash/arc/intent_helper/arc_settings_service_browsertest.cc index 6d050df..683ea84 100644 --- a/chrome/browser/ash/arc/intent_helper/arc_settings_service_browsertest.cc +++ b/chrome/browser/ash/arc/intent_helper/arc_settings_service_browsertest.cc
@@ -712,7 +712,7 @@ base::Value default_proxy_config(base::Value::Type::DICTIONARY); default_proxy_config.SetKey( "mode", base::Value(ProxyPrefs::kFixedServersProxyModeName)); - default_proxy_config.SetKey("server", base::Value("default/proxy:8080")); + default_proxy_config.SetKey("server", base::Value("default.proxy.test:8080")); SetProxyConfigForNetworkService(kDefaultServicePath, std::move(default_proxy_config)); RunUntilIdle(); @@ -721,7 +721,7 @@ base::Value wifi_proxy_config(base::Value::Type::DICTIONARY); wifi_proxy_config.SetKey("mode", base::Value(ProxyPrefs::kFixedServersProxyModeName)); - wifi_proxy_config.SetKey("server", base::Value("wifi/proxy:8080")); + wifi_proxy_config.SetKey("server", base::Value("wifi.proxy.test:8080")); SetProxyConfigForNetworkService(kWifi0ServicePath, std::move(wifi_proxy_config)); RunUntilIdle(); @@ -730,7 +730,8 @@ base::Value expected_default_proxy_config(base::Value::Type::DICTIONARY); expected_default_proxy_config.SetKey( "mode", base::Value(ProxyPrefs::kFixedServersProxyModeName)); - expected_default_proxy_config.SetKey("host", base::Value("default/proxy")); + expected_default_proxy_config.SetKey("host", + base::Value("default.proxy.test")); expected_default_proxy_config.SetKey("port", base::Value(8080)); EXPECT_EQ(CountProxyBroadcasts(fake_intent_helper_instance_->broadcasts(), {&expected_default_proxy_config}), @@ -744,7 +745,7 @@ base::Value expected_wifi_proxy_config(base::Value::Type::DICTIONARY); expected_wifi_proxy_config.SetKey( "mode", base::Value(ProxyPrefs::kFixedServersProxyModeName)); - expected_wifi_proxy_config.SetKey("host", base::Value("wifi/proxy")); + expected_wifi_proxy_config.SetKey("host", base::Value("wifi.proxy.test")); expected_wifi_proxy_config.SetKey("port", base::Value(8080)); EXPECT_EQ(CountProxyBroadcasts(fake_intent_helper_instance_->broadcasts(),
diff --git a/chrome/browser/ash/arc/session/arc_session_manager.cc b/chrome/browser/ash/arc/session/arc_session_manager.cc index 6401f1e..2136255 100644 --- a/chrome/browser/ash/arc/session/arc_session_manager.cc +++ b/chrome/browser/ash/arc/session/arc_session_manager.cc
@@ -1689,7 +1689,8 @@ void ArcSessionManager::OnRunNetworkTestsClicked() { DCHECK(support_host_); chromeos::DiagnosticsDialog::ShowDialog( - chromeos::DiagnosticsDialog::DiagnosticsPage::kConnectivity); + chromeos::DiagnosticsDialog::DiagnosticsPage::kConnectivity, + support_host_->GetNativeWindow()); // Network-related error occured so collect UMA stats on user action. UpdateOptInNetworkErrorActionUMA(
diff --git a/chrome/browser/ash/input_method/input_method_manager_impl.cc b/chrome/browser/ash/input_method/input_method_manager_impl.cc index 47a89662..8507b14 100644 --- a/chrome/browser/ash/input_method/input_method_manager_impl.cc +++ b/chrome/browser/ash/input_method/input_method_manager_impl.cc
@@ -140,7 +140,7 @@ : profile(profile), manager_(manager) { if (initial_input_method) { enabled_input_method_ids_.push_back(initial_input_method->id()); - current_input_method_ = *initial_input_method; + current_input_method = *initial_input_method; } } @@ -155,7 +155,7 @@ scoped_refptr<StateImpl> new_state(new StateImpl(this->manager_, profile)); new_state->last_used_input_method_id_ = last_used_input_method_id_; - new_state->current_input_method_ = current_input_method_; + new_state->current_input_method = current_input_method; new_state->enabled_input_method_ids_ = enabled_input_method_ids_; new_state->allowed_keyboard_layout_input_method_ids_ = @@ -326,8 +326,8 @@ enabled_input_method_ids_.swap(new_enabled_input_method_ids); - // Re-check current_input_method_. - ChangeInputMethod(current_input_method_.id(), false); + // Re-check current_input_method. + ChangeInputMethod(current_input_method.id(), false); } // Adds new input method to given list. @@ -388,9 +388,9 @@ manager_->ReconfigureIMFramework(this); - // If |current_input_method_| is no longer in |enabled_input_method_ids_|, + // If |current_input_method| is no longer in |enabled_input_method_ids_|, // ChangeInputMethod() picks the first one in |enabled_input_method_ids_|. - ChangeInputMethod(current_input_method_.id(), false); + ChangeInputMethod(current_input_method.id(), false); // Record histogram for enabled input method count; "active" in the metric // name is a legacy misnomer; "active" should refer to just the single current @@ -479,7 +479,7 @@ bool notify_menu = false; // Always lookup input method, even if it is the same as - // |current_input_method_| because If it is no longer in + // |current_input_method| because If it is no longer in // |enabled_input_method_ids_|, pick the first one in // |enabled_input_method_ids_|. const InputMethodDescriptor* descriptor = @@ -501,9 +501,9 @@ if (MethodAwaitsExtensionLoad(input_method_id)) pending_input_method_id_ = input_method_id; - if (descriptor->id() != current_input_method_.id()) { - last_used_input_method_id_ = current_input_method_.id(); - current_input_method_ = *descriptor; + if (descriptor->id() != current_input_method.id()) { + last_used_input_method_id_ = current_input_method.id(); + current_input_method = *descriptor; notify_menu = true; } @@ -514,7 +514,7 @@ notify_menu); } - manager_->RecordInputMethodUsage(current_input_method_.id()); + manager_->RecordInputMethodUsage(current_input_method.id()); } void InputMethodManagerImpl::StateImpl::ChangeInputMethodToJpKeyboard() { @@ -576,10 +576,10 @@ if (IsActive()) { if (extension_id == extension_ime_util::GetExtensionIDFromInputMethodID( - current_input_method_.id())) { + current_input_method.id())) { ui::IMEBridge::Get()->SetCurrentEngineHandler(engine); engine->Enable(extension_ime_util::GetComponentIDByInputMethodID( - current_input_method_.id())); + current_input_method.id())); } // Ensure that the input method daemon is running. @@ -619,9 +619,9 @@ manager_->engine_map_[profile].erase(extension_id); } - // If |current_input_method_| is no longer in |enabled_input_method_ids_|, + // If |current_input_method| is no longer in |enabled_input_method_ids_|, // switch to the first one in |enabled_input_method_ids_|. - ChangeInputMethod(current_input_method_.id(), false); + ChangeInputMethod(current_input_method.id(), false); manager_->NotifyInputMethodExtensionRemoved(extension_id); } @@ -677,9 +677,9 @@ ChangeInputMethod(pending_input_method_id_, false); pending_input_method_id_.clear(); } else { - // If |current_input_method_| is no longer in |enabled_input_method_ids_|, + // If |current_input_method| is no longer in |enabled_input_method_ids_|, // switch to the first one in |enabled_input_method_ids_|. - ChangeInputMethod(current_input_method_.id(), false); + ChangeInputMethod(current_input_method.id(), false); } } } @@ -762,8 +762,8 @@ return false; } - if (current_input_method_.id().empty()) { - DVLOG(1) << "current_input_method_ is unknown"; + if (current_input_method.id().empty()) { + DVLOG(1) << "current_input_method is unknown"; return false; } @@ -776,7 +776,7 @@ auto iter = std::find(enabled_input_method_ids_.begin(), - enabled_input_method_ids_.end(), current_input_method_.id()); + enabled_input_method_ids_.end(), current_input_method.id()); if (iter != enabled_input_method_ids_.end()) ++iter; if (iter == enabled_input_method_ids_.end()) @@ -789,7 +789,7 @@ return; if (last_used_input_method_id_.empty() || - last_used_input_method_id_ == current_input_method_.id()) { + last_used_input_method_id_ == current_input_method.id()) { SwitchToNextInputMethod(); return; } @@ -807,10 +807,10 @@ InputMethodDescriptor InputMethodManagerImpl::StateImpl::GetCurrentInputMethod() const { - if (current_input_method_.id().empty()) + if (current_input_method.id().empty()) return InputMethodUtil::GetFallbackInputMethodDescriptor(); - return current_input_method_; + return current_input_method; } bool InputMethodManagerImpl::StateImpl::InputMethodIsEnabled( @@ -820,7 +820,7 @@ void InputMethodManagerImpl::StateImpl::EnableInputView() { if (!input_view_url_overridden_) { - input_view_url_ = current_input_method_.input_view_url(); + input_view_url_ = current_input_method.input_view_url(); } } @@ -848,7 +848,7 @@ } void InputMethodManagerImpl::StateImpl::ResetInputViewUrl() { - input_view_url_ = current_input_method_.input_view_url(); + input_view_url_ = current_input_method.input_view_url(); input_view_url_overridden_ = false; } @@ -1088,14 +1088,14 @@ engine->Disable(); // Configure the next engine handler. - // This must be after |current_input_method_| has been set to new input + // This must be after |current_input_method| has been set to new input // method, because engine's Enable() method needs to access it. const std::string& extension_id = extension_ime_util::GetExtensionIDFromInputMethodID( - state_->GetCurrentInputMethod().id()); + state_->current_input_method.id()); const std::string& component_id = extension_ime_util::GetComponentIDByInputMethodID( - state_->GetCurrentInputMethod().id()); + state_->current_input_method.id()); if (!engine_map_.count(state_->profile) || !engine_map_[state_->profile].count(extension_id)) { LOG_IF(ERROR, base::SysInfo::IsRunningOnChromeOS()) @@ -1116,9 +1116,9 @@ // Change the keyboard layout to a preferred layout for the input method. if (!keyboard_->SetCurrentKeyboardLayoutByName( - state_->GetCurrentInputMethod().keyboard_layout())) { + state_->current_input_method.keyboard_layout())) { LOG(ERROR) << "Failed to change keyboard layout to " - << state_->GetCurrentInputMethod().keyboard_layout(); + << state_->current_input_method.keyboard_layout(); } // Update input method indicators (e.g. "US", "DV") in Chrome windows.
diff --git a/chrome/browser/ash/input_method/input_method_manager_impl.h b/chrome/browser/ash/input_method/input_method_manager_impl.h index ce62fb87..3a17650 100644 --- a/chrome/browser/ash/input_method/input_method_manager_impl.h +++ b/chrome/browser/ash/input_method/input_method_manager_impl.h
@@ -111,6 +111,8 @@ // ------------------------- Data members. Profile* const profile; + InputMethodDescriptor current_input_method; + // All input methods that have been registered by InputMethodEngines. // The key is the input method ID. std::map<std::string, InputMethodDescriptor> available_input_methods; @@ -153,8 +155,6 @@ std::string last_used_input_method_id_; - InputMethodDescriptor current_input_method_; - std::vector<std::string> enabled_input_method_ids_; // The allowed keyboard layout input methods (e.g. by policy).
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.cc b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.cc index e699226..0e3dc020 100644 --- a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.cc +++ b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.cc
@@ -34,15 +34,12 @@ #include "chrome/browser/ash/policy/rsu/lookup_key_uploader.h" #include "chrome/browser/ash/policy/server_backed_state/server_backed_state_keys_broker.h" #include "chrome/browser/ash/policy/status_collector/device_status_collector.h" -#include "chrome/browser/ash/policy/status_collector/legacy_device_status_collector.h" #include "chrome/browser/ash/policy/status_collector/managed_session_service.h" #include "chrome/browser/ash/policy/uploading/heartbeat_scheduler.h" #include "chrome/browser/ash/policy/uploading/status_uploader.h" #include "chrome/browser/ash/policy/uploading/system_log_uploader.h" #include "chrome/browser/browser_process.h" #include "chrome/common/pref_names.h" -#include "chromeos/settings/cros_settings_names.h" -#include "chromeos/settings/cros_settings_provider.h" #include "chromeos/system/statistics_provider.h" #include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/cloud_external_data_manager.h" @@ -302,26 +299,11 @@ } void DeviceCloudPolicyManagerAsh::CreateStatusUploader() { - std::unique_ptr<StatusCollector> collector; - bool granular_reporting_enabled; - ash::CrosSettings* settings = ash::CrosSettings::Get(); - - if (!settings->GetBoolean(chromeos::kEnableDeviceGranularReporting, - &granular_reporting_enabled)) { - granular_reporting_enabled = true; - } - - if (granular_reporting_enabled) { - collector = std::make_unique<DeviceStatusCollector>( - local_state_, chromeos::system::StatisticsProvider::GetInstance()); - } else { - collector = std::make_unique<LegacyDeviceStatusCollector>( - local_state_, chromeos::system::StatisticsProvider::GetInstance()); - } - status_uploader_ = std::make_unique<StatusUploader>( - client(), std::move(collector), task_runner_, - kDeviceStatusUploadFrequency); + client(), + std::make_unique<DeviceStatusCollector>( + local_state_, chromeos::system::StatisticsProvider::GetInstance()), + task_runner_, kDeviceStatusUploadFrequency); } } // namespace policy
diff --git a/chrome/browser/ash/policy/status_collector/device_status_collector.cc b/chrome/browser/ash/policy/status_collector/device_status_collector.cc index d7241a0c..4cba2ed 100644 --- a/chrome/browser/ash/policy/status_collector/device_status_collector.cc +++ b/chrome/browser/ash/policy/status_collector/device_status_collector.cc
@@ -739,8 +739,7 @@ cros_healthd_data_fetcher.Run( CrosHealthdCollectionMode::kFull, base::BindOnce(&DeviceStatusCollectorState::OnCrosHealthdDataReceived, - this, report_system_info, report_vpd_info, - report_storage_status)); + this, report_system_info, report_vpd_info, report_storage_status)); } void FetchEMMCLifeTime( @@ -821,31 +820,14 @@ android_status->set_droid_guard_info(droid_guard_info); } - void OnTpmStatusReceived(const TpmStatusInfo& tpm_status_struct) { + void OnTpmStatusReceived( + const enterprise_management::TpmStatusInfo& tpm_status_info) { // Make sure we edit the state on the right thread. DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - em::TpmStatusInfo* const tpm_status_proto = - response_params_.device_status->mutable_tpm_status_info(); - - LOG(WARNING) << "tpm_status_struct.attestation_prepared: " - << tpm_status_struct.attestation_prepared; - tpm_status_proto->set_enabled(tpm_status_struct.enabled); - tpm_status_proto->set_owned(tpm_status_struct.owned); - tpm_status_proto->set_tpm_initialized(tpm_status_struct.initialized); - tpm_status_proto->set_attestation_prepared( - tpm_status_struct.attestation_prepared); - tpm_status_proto->set_attestation_enrolled( - tpm_status_struct.attestation_enrolled); - tpm_status_proto->set_dictionary_attack_counter( - tpm_status_struct.dictionary_attack_counter); - tpm_status_proto->set_dictionary_attack_threshold( - tpm_status_struct.dictionary_attack_threshold); - tpm_status_proto->set_dictionary_attack_lockout_in_effect( - tpm_status_struct.dictionary_attack_lockout_in_effect); - tpm_status_proto->set_dictionary_attack_lockout_seconds_remaining( - tpm_status_struct.dictionary_attack_lockout_seconds_remaining); - tpm_status_proto->set_boot_lockbox_finalized( - tpm_status_struct.boot_lockbox_finalized); + response_params_.device_status->mutable_tpm_status_info()->MergeFrom( + tpm_status_info); + LOG(WARNING) << "tpm_status_info.attestation_prepared: " + << tpm_status_info.attestation_prepared(); SetDeviceStatusReported(); } @@ -1442,34 +1424,6 @@ bool device_status_reported_ = false; }; -TpmStatusInfo::TpmStatusInfo() = default; -TpmStatusInfo::TpmStatusInfo(const TpmStatusInfo&) = default; -TpmStatusInfo::TpmStatusInfo( - bool enabled, - bool owned, - bool initialized, - bool attestation_prepared, - bool attestation_enrolled, - int32_t dictionary_attack_counter, - int32_t dictionary_attack_threshold, - bool dictionary_attack_lockout_in_effect, - int32_t dictionary_attack_lockout_seconds_remaining, - bool boot_lockbox_finalized, - bool owner_password_is_present) - : enabled(enabled), - owned(owned), - initialized(initialized), - attestation_prepared(attestation_prepared), - attestation_enrolled(attestation_enrolled), - dictionary_attack_counter(dictionary_attack_counter), - dictionary_attack_threshold(dictionary_attack_threshold), - dictionary_attack_lockout_in_effect(dictionary_attack_lockout_in_effect), - dictionary_attack_lockout_seconds_remaining( - dictionary_attack_lockout_seconds_remaining), - boot_lockbox_finalized(boot_lockbox_finalized), - owner_password_is_present(owner_password_is_present) {} -TpmStatusInfo::~TpmStatusInfo() = default; - SampledData::SampledData() = default; SampledData::~SampledData() = default;
diff --git a/chrome/browser/ash/policy/status_collector/device_status_collector.h b/chrome/browser/ash/policy/status_collector/device_status_collector.h index bcf19fa..84b60f6 100644 --- a/chrome/browser/ash/policy/status_collector/device_status_collector.h +++ b/chrome/browser/ash/policy/status_collector/device_status_collector.h
@@ -40,10 +40,6 @@ } } // namespace chromeos -namespace cryptohome { -struct TpmStatusInfo; -} - namespace power_manager { class PowerSupplyProperties; } @@ -65,36 +61,6 @@ // Enum used to define which data the CrosHealthdDataFetcher should collect. enum class CrosHealthdCollectionMode { kFull, kBattery }; -// Holds TPM status info. Cf. TpmStatusInfo in device_management_backend.proto. -struct TpmStatusInfo { - TpmStatusInfo(); - TpmStatusInfo(const TpmStatusInfo&); - TpmStatusInfo(bool enabled, - bool owned, - bool initialized, - bool attestation_prepared, - bool attestation_enrolled, - int32_t dictionary_attack_counter, - int32_t dictionary_attack_threshold, - bool dictionary_attack_lockout_in_effect, - int32_t dictionary_attack_lockout_seconds_remaining, - bool boot_lockbox_finalized, - bool owner_password_is_present); - ~TpmStatusInfo(); - - bool enabled = false; - bool owned = false; - bool initialized = false; - bool attestation_prepared = false; - bool attestation_enrolled = false; - int32_t dictionary_attack_counter = 0; - int32_t dictionary_attack_threshold = 0; - bool dictionary_attack_lockout_in_effect = false; - int32_t dictionary_attack_lockout_seconds_remaining = 0; - bool boot_lockbox_finalized = false; - bool owner_password_is_present = false; -}; - // Sampled hardware measurement data for single time point. class SampledData { public: @@ -137,7 +103,8 @@ std::vector<enterprise_management::CPUTempInfo>()>; // Format of the function that asynchronously receives TpmStatusInfo. - using TpmStatusReceiver = base::OnceCallback<void(const TpmStatusInfo&)>; + using TpmStatusReceiver = + base::OnceCallback<void(const enterprise_management::TpmStatusInfo&)>; // Gets the TpmStatusInfo and passes it to TpmStatusReceiver. using TpmStatusFetcher = base::RepeatingCallback<void(TpmStatusReceiver)>;
diff --git a/chrome/browser/ash/policy/status_collector/legacy_device_status_collector.cc b/chrome/browser/ash/policy/status_collector/legacy_device_status_collector.cc index bbb7322..711ad46 100644 --- a/chrome/browser/ash/policy/status_collector/legacy_device_status_collector.cc +++ b/chrome/browser/ash/policy/status_collector/legacy_device_status_collector.cc
@@ -819,29 +819,12 @@ android_status->set_droid_guard_info(droid_guard_info); } - void OnTpmStatusReceived(const policy::TpmStatusInfo& tpm_status_struct) { + void OnTpmStatusReceived( + const enterprise_management::TpmStatusInfo& tpm_status_info) { // Make sure we edit the state on the right thread. DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - em::TpmStatusInfo* const tpm_status_proto = - response_params_.device_status->mutable_tpm_status_info(); - - tpm_status_proto->set_enabled(tpm_status_struct.enabled); - tpm_status_proto->set_owned(tpm_status_struct.owned); - tpm_status_proto->set_tpm_initialized(tpm_status_struct.initialized); - tpm_status_proto->set_attestation_prepared( - tpm_status_struct.attestation_prepared); - tpm_status_proto->set_attestation_enrolled( - tpm_status_struct.attestation_enrolled); - tpm_status_proto->set_dictionary_attack_counter( - tpm_status_struct.dictionary_attack_counter); - tpm_status_proto->set_dictionary_attack_threshold( - tpm_status_struct.dictionary_attack_threshold); - tpm_status_proto->set_dictionary_attack_lockout_in_effect( - tpm_status_struct.dictionary_attack_lockout_in_effect); - tpm_status_proto->set_dictionary_attack_lockout_seconds_remaining( - tpm_status_struct.dictionary_attack_lockout_seconds_remaining); - tpm_status_proto->set_boot_lockbox_finalized( - tpm_status_struct.boot_lockbox_finalized); + response_params_.device_status->mutable_tpm_status_info()->MergeFrom( + tpm_status_info); } // Stores the contents of |probe_result| and |samples| to |response_params_|.
diff --git a/chrome/browser/ash/policy/status_collector/legacy_device_status_collector.h b/chrome/browser/ash/policy/status_collector/legacy_device_status_collector.h index 7f63a517..2776c9b 100644 --- a/chrome/browser/ash/policy/status_collector/legacy_device_status_collector.h +++ b/chrome/browser/ash/policy/status_collector/legacy_device_status_collector.h
@@ -88,7 +88,7 @@ // Format of the function that asynchronously receives // ::cryptohome::TpmStatusInfo. using TpmStatusReceiver = - base::OnceCallback<void(const policy::TpmStatusInfo&)>; + base::OnceCallback<void(const enterprise_management::TpmStatusInfo&)>; // Gets the ::crypthome::TpmStatusInfo and passes it to TpmStatusReceiver. using TpmStatusFetcher = base::RepeatingCallback<void(TpmStatusReceiver)>; @@ -452,4 +452,4 @@ } // namespace policy -#endif // CHROME_BROWSER_ASH_POLICY_STATUS_LEGACY_COLLECTOR_DEVICE_STATUS_COLLECTOR_H_ +#endif // CHROME_BROWSER_ASH_POLICY_STATUS_COLLECTOR_LEGACY_DEVICE_STATUS_COLLECTOR_H_
diff --git a/chrome/browser/ash/policy/status_collector/tpm_status_combiner.cc b/chrome/browser/ash/policy/status_collector/tpm_status_combiner.cc index 738a775..e598190 100644 --- a/chrome/browser/ash/policy/status_collector/tpm_status_combiner.cc +++ b/chrome/browser/ash/policy/status_collector/tpm_status_combiner.cc
@@ -22,14 +22,14 @@ const ::tpm_manager::GetTpmNonsensitiveStatusReply& reply) { has_tpm_status_ = true; if (reply.status() == ::tpm_manager::STATUS_SUCCESS) { - tpm_status_info_.enabled = reply.is_enabled(); - tpm_status_info_.owned = reply.is_owned(); + tpm_status_info_.set_enabled(reply.is_enabled()); + tpm_status_info_.set_owned(reply.is_owned()); // Wiped owner password means the TPm initialization is done and no any // further operations needed. - tpm_status_info_.initialized = - reply.is_owned() && !reply.is_owner_password_present(); - tpm_status_info_.owner_password_is_present = - reply.is_owner_password_present(); + tpm_status_info_.set_tpm_initialized(reply.is_owned() && + !reply.is_owner_password_present()); + tpm_status_info_.set_owner_password_is_present( + reply.is_owner_password_present()); } else { LOG(WARNING) << "Failed to get tpm status."; } @@ -40,8 +40,8 @@ const ::attestation::GetStatusReply& reply) { has_enrollment_status_ = true; if (reply.status() == ::attestation::STATUS_SUCCESS) { - tpm_status_info_.attestation_prepared = reply.prepared_for_enrollment(); - tpm_status_info_.attestation_enrolled = reply.enrolled(); + tpm_status_info_.set_attestation_prepared(reply.prepared_for_enrollment()); + tpm_status_info_.set_attestation_enrolled(reply.enrolled()); } else { LOG(WARNING) << "Failed to get enrollment info."; } @@ -53,14 +53,14 @@ const ::tpm_manager::GetDictionaryAttackInfoReply& reply) { has_dictionary_attack_info_ = true; if (reply.status() == ::tpm_manager::STATUS_SUCCESS) { - tpm_status_info_.dictionary_attack_counter = - reply.dictionary_attack_counter(); - tpm_status_info_.dictionary_attack_threshold = - reply.dictionary_attack_threshold(); - tpm_status_info_.dictionary_attack_lockout_in_effect = - reply.dictionary_attack_lockout_in_effect(); - tpm_status_info_.dictionary_attack_lockout_seconds_remaining = - reply.dictionary_attack_lockout_seconds_remaining(); + tpm_status_info_.set_dictionary_attack_counter( + reply.dictionary_attack_counter()); + tpm_status_info_.set_dictionary_attack_threshold( + reply.dictionary_attack_threshold()); + tpm_status_info_.set_dictionary_attack_lockout_in_effect( + reply.dictionary_attack_lockout_in_effect()); + tpm_status_info_.set_dictionary_attack_lockout_seconds_remaining( + reply.dictionary_attack_lockout_seconds_remaining()); } else { LOG(WARNING) << "Failed to get dictionary attack info."; }
diff --git a/chrome/browser/ash/policy/status_collector/tpm_status_combiner.h b/chrome/browser/ash/policy/status_collector/tpm_status_combiner.h index 0d70082..ed3ff15 100644 --- a/chrome/browser/ash/policy/status_collector/tpm_status_combiner.h +++ b/chrome/browser/ash/policy/status_collector/tpm_status_combiner.h
@@ -10,16 +10,18 @@ #include "chrome/browser/ash/policy/status_collector/device_status_collector.h" #include "chromeos/dbus/attestation/interface.pb.h" #include "chromeos/dbus/tpm_manager/tpm_manager.pb.h" +#include "components/policy/proto/device_management_backend.pb.h" namespace policy { // This class is meant to combine multiple statuses around TPM and enrollment. -// Because the result `policy::TpmStatusInfo` comes from different sources of -// D-Bus calls, this class is designed to be used as a shared pointer that -// resides in multiple callbacks. When all the replies of the D-Bus calls, which -// are sent by the user of this class, are finished, this class combines the -// results into a single `policy::TpmStatusInfo` and get destroyed naturally -// when all the callbacks of the D-Bus calls are done. +// Because the result `enterprise_management::TpmStatusInfo` comes from +// different sources of D-Bus calls, this class is designed to be used as a +// shared pointer that resides in multiple callbacks. When all the replies of +// the D-Bus calls, which are sent by the user of this class, are finished, this +// class combines the results into a single `enterprise_policy::TpmStatusInfo` +// and get destroyed naturally when all the callbacks of the D-Bus calls are +// done. // // Note that in order to increase test coverage of `DeviceStatusCollector`, this // class doesn't have its own unittest; instead, it is tested along with @@ -60,7 +62,7 @@ DeviceStatusCollector::TpmStatusReceiver callback_; // The combined result passed into `callback_`. - policy::TpmStatusInfo tpm_status_info_; + enterprise_management::TpmStatusInfo tpm_status_info_; // Indicates each D-Bus response being received or not. bool has_tpm_status_ = false;
diff --git a/chrome/browser/ash/policy/uploading/status_uploader.cc b/chrome/browser/ash/policy/uploading/status_uploader.cc index b2ff49e0..57a8be488b 100644 --- a/chrome/browser/ash/policy/uploading/status_uploader.cc +++ b/chrome/browser/ash/policy/uploading/status_uploader.cc
@@ -15,13 +15,9 @@ #include "base/syslog_logging.h" #include "base/system/sys_info.h" #include "chrome/browser/ash/policy/core/device_local_account.h" -#include "chrome/browser/ash/policy/status_collector/device_status_collector.h" -#include "chrome/browser/ash/policy/status_collector/legacy_device_status_collector.h" #include "chrome/browser/ash/policy/status_collector/status_collector.h" -#include "chrome/browser/browser_process.h" #include "chromeos/settings/cros_settings_names.h" #include "chromeos/settings/cros_settings_provider.h" -#include "chromeos/system/statistics_provider.h" #include "components/policy/core/common/cloud/cloud_policy_client.h" #include "components/policy/core/common/cloud/device_management_service.h" #include "content/public/browser/browser_thread.h" @@ -63,11 +59,6 @@ chromeos::kReportUploadFrequency, base::BindRepeating(&StatusUploader::RefreshUploadFrequency, base::Unretained(this))); - granular_reporting_subscription_ = - ash::CrosSettings::Get()->AddSettingsObserver( - chromeos::kEnableDeviceGranularReporting, - base::BindRepeating(&StatusUploader::UpdateStatusCollector, - base::Unretained(this))); // Update the upload frequency from settings. RefreshUploadFrequency(); @@ -111,37 +102,6 @@ return true; } -void StatusUploader::UpdateStatusCollector() { - if (user_manager::UserManager::Get()->GetActiveUser()->IsChild()) { - return; - } - - ash::CrosSettings* settings = ash::CrosSettings::Get(); - if (chromeos::CrosSettingsProvider::TRUSTED != - settings->PrepareTrustedValues( - base::BindOnce(&StatusUploader::UpdateStatusCollector, - weak_factory_.GetWeakPtr()))) { - return; - } - - bool granular_reporting_enabled; - if (!settings->GetBoolean(chromeos::kEnableDeviceGranularReporting, - &granular_reporting_enabled)) { - granular_reporting_enabled = true; - } - PrefService* local_state = g_browser_process->local_state(); - - if (granular_reporting_enabled) { - SYSLOG(INFO) << "Enabling granular reporting controls"; - collector_ = std::make_unique<DeviceStatusCollector>( - local_state, chromeos::system::StatisticsProvider::GetInstance()); - } else { - SYSLOG(INFO) << "Disabling granular reporting controls"; - collector_ = std::make_unique<LegacyDeviceStatusCollector>( - local_state, chromeos::system::StatisticsProvider::GetInstance()); - } -} - void StatusUploader::RefreshUploadFrequency() { // Attempt to fetch the current value of the reporting settings. // If trusted values are not available, register this function to be called
diff --git a/chrome/browser/ash/policy/uploading/status_uploader.h b/chrome/browser/ash/policy/uploading/status_uploader.h index 718a3e5..b5c92839 100644 --- a/chrome/browser/ash/policy/uploading/status_uploader.h +++ b/chrome/browser/ash/policy/uploading/status_uploader.h
@@ -85,9 +85,6 @@ // if appropriate. void RefreshUploadFrequency(); - // Updates the status collector being used. - void UpdateStatusCollector(); - // CloudPolicyClient used to issue requests to the server. CloudPolicyClient* client_; @@ -103,9 +100,6 @@ // Subscription for the callback about changes in the upload frequency. base::CallbackListSubscription upload_frequency_subscription_; - // Subscription for whether or not to user granular reporting. - base::CallbackListSubscription granular_reporting_subscription_; - // The time the last upload was performed. base::Time last_upload_;
diff --git a/chrome/browser/ash/system_logs/reven_log_source.cc b/chrome/browser/ash/system_logs/reven_log_source.cc index 4b76024..4e20900 100644 --- a/chrome/browser/ash/system_logs/reven_log_source.cc +++ b/chrome/browser/ash/system_logs/reven_log_source.cc
@@ -112,7 +112,7 @@ AddLogEntry(log, "product_version", dmi_info->product_version.value_or("")); } - base::StrAppend(log, {"biosinfo:"}); + base::StrAppend(log, {"bios_info:"}); if (!dmi_info.is_null()) { AddIndentedLogEntry(log, "bios_version", dmi_info->bios_version.value_or("")); @@ -121,8 +121,12 @@ info->system_result_v2->get_system_info_v2()->os_info; if (!os_info.is_null()) { AddIndentedLogEntry( + log, "secureboot", + FormatBool(os_info->boot_mode == healthd::BootMode::kCrosEfiSecure)); + AddIndentedLogEntry( log, "uefi", - FormatBool(os_info->boot_mode == healthd::BootMode::kCrosEfi)); + FormatBool(os_info->boot_mode == healthd::BootMode::kCrosEfi || + os_info->boot_mode == healthd::BootMode::kCrosEfiSecure)); } base::StrAppend(log, {"\n"}); }
diff --git a/chrome/browser/ash/system_logs/reven_log_source_unittest.cc b/chrome/browser/ash/system_logs/reven_log_source_unittest.cc index 2e92cdf..593044a 100644 --- a/chrome/browser/ash/system_logs/reven_log_source_unittest.cc +++ b/chrome/browser/ash/system_logs/reven_log_source_unittest.cc
@@ -321,18 +321,12 @@ const std::string& expected) { auto info = healthd::TelemetryInfo::New(); auto os_info = CreateOsInfo(boot_mode); - auto dmi_info = healthd::DmiInfo::New(); + auto dmi_info = CreateDmiInfo(); SetSystemInfoV2(info, std::move(os_info), std::move(dmi_info)); ash::cros_healthd::FakeCrosHealthdClient::Get() ->SetProbeTelemetryInfoResponseForTesting(info); - std::unique_ptr<SystemLogsResponse> response = Fetch(); - ASSERT_NE(response, nullptr); - const auto revenlog_iter = response->find(kRevenLogKey); - ASSERT_NE(revenlog_iter, response->end()); - - EXPECT_THAT(revenlog_iter->second, HasSubstr("biosinfo:\n")); - EXPECT_THAT(revenlog_iter->second, HasSubstr(expected)); + VerifyOutputContains(Fetch(), expected); } void VerifyTpmInfo(uint32_t version, @@ -448,7 +442,7 @@ EXPECT_THAT(revenlog_iter->second, HasSubstr("product_version: ThinkPad X1 Carbon Gen 8")); - EXPECT_THAT(revenlog_iter->second, HasSubstr("biosinfo:\n")); + EXPECT_THAT(revenlog_iter->second, HasSubstr("bios_info:\n")); EXPECT_THAT(revenlog_iter->second, HasSubstr("\n bios_version: N2WET26W (1.16 )")); } @@ -470,24 +464,40 @@ EXPECT_THAT(revenlog_iter->second, HasSubstr("product_name: \n")); EXPECT_THAT(revenlog_iter->second, HasSubstr("product_version: \n")); - EXPECT_THAT(revenlog_iter->second, HasSubstr("biosinfo:\n")); + EXPECT_THAT(revenlog_iter->second, HasSubstr("bios_info:\n")); EXPECT_THAT(revenlog_iter->second, HasSubstr("\n bios_version: \n")); } -TEST_F(RevenLogSourceTest, BiosBootMode_kCrosEfi) { - VerifyBiosBootMode(healthd::BootMode::kCrosEfi, "\n uefi: true"); +// BootMode::kCrosEfi: boot with EFI but not with secure boot +// secureboot = false +// uefi = true +TEST_F(RevenLogSourceTest, BiosBootMode_Uefi_True_SecureBoot_False) { + std::string expected_output = R"(bios_info: + bios_version: N2WET26W (1.16 ) + secureboot: false + uefi: true)"; + VerifyBiosBootMode(healthd::BootMode::kCrosEfi, expected_output); } -TEST_F(RevenLogSourceTest, BiosBootMode_kUnknown) { - VerifyBiosBootMode(healthd::BootMode::kUnknown, "\n uefi: false"); +// BootMode::kCrosEfiSecure: boot with EFI security boot +// secureboot = true +// uefi = true +TEST_F(RevenLogSourceTest, BiosBootMode_Uefi_True_SecureBoot_True) { + std::string expected_output = R"(bios_info: + bios_version: N2WET26W (1.16 ) + secureboot: true + uefi: true)"; + VerifyBiosBootMode(healthd::BootMode::kCrosEfiSecure, expected_output); } -TEST_F(RevenLogSourceTest, BiosBootMode_kCrosSecure) { - VerifyBiosBootMode(healthd::BootMode::kCrosSecure, "\n uefi: false"); -} - -TEST_F(RevenLogSourceTest, BiosBootMode_kCrosLegacy) { - VerifyBiosBootMode(healthd::BootMode::kCrosLegacy, "\n uefi: false"); +TEST_F(RevenLogSourceTest, BiosBootMode_SecureBoot_False_Uefi_False) { + std::string expected_output = R"(bios_info: + bios_version: N2WET26W (1.16 ) + secureboot: false + uefi: false)"; + VerifyBiosBootMode(healthd::BootMode::kCrosSecure, expected_output); + VerifyBiosBootMode(healthd::BootMode::kCrosLegacy, expected_output); + VerifyBiosBootMode(healthd::BootMode::kUnknown, expected_output); } TEST_F(RevenLogSourceTest, PciEthernetDevices) {
diff --git a/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate.cc b/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate.cc index 0b290f6..3e9bf0b7 100644 --- a/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate.cc +++ b/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate.cc
@@ -11,7 +11,6 @@ #include <string> #include <vector> -#include "ash/public/cpp/wallpaper/local_image_info.h" #include "ash/public/cpp/wallpaper/online_wallpaper_params.h" #include "ash/public/cpp/wallpaper/wallpaper_controller.h" #include "ash/public/cpp/wallpaper/wallpaper_info.h" @@ -140,20 +139,17 @@ } void ChromePersonalizationAppUiDelegate::GetLocalImageThumbnail( - const base::UnguessableToken& id, + const base::FilePath& path, GetLocalImageThumbnailCallback callback) { - const auto& entry = local_image_info_map_.find(id); - if (entry == local_image_info_map_.end()) { - mojo::ReportBadMessage("Invalid local image id received"); + if (local_images_.count(path) == 0) { + mojo::ReportBadMessage("Invalid local image path received"); return; } - const base::FilePath& file_path = entry->second.path; - if (!thumbnail_loader_) thumbnail_loader_ = std::make_unique<ash::ThumbnailLoader>(profile_); ash::ThumbnailLoader::ThumbnailRequest request( - file_path, + path, gfx::Size(kLocalImageThumbnailSizeDip, kLocalImageThumbnailSizeDip)); thumbnail_loader_->Load( @@ -272,12 +268,10 @@ } void ChromePersonalizationAppUiDelegate::SelectLocalImage( - const base::UnguessableToken& id, + const base::FilePath& path, SelectLocalImageCallback callback) { - const auto& it = local_image_info_map_.find(id); - - if (it == local_image_info_map_.end()) { - mojo::ReportBadMessage("Invalid local image id selected"); + if (local_images_.count(path) == 0) { + mojo::ReportBadMessage("Invalid local image path selected"); return; } if (pending_select_local_image_callback_) @@ -285,7 +279,7 @@ pending_select_local_image_callback_ = std::move(callback); WallpaperController::Get()->SetCustomWallpaper( - GetAccountId(), it->second.path, + GetAccountId(), path, ash::WallpaperLayout::WALLPAPER_LAYOUT_CENTER_CROPPED, /*preview_mode=*/false, base::BindOnce(&ChromePersonalizationAppUiDelegate::OnLocalImageSelected, @@ -368,15 +362,8 @@ void ChromePersonalizationAppUiDelegate::OnGetLocalImages( GetLocalImagesCallback callback, const std::vector<base::FilePath>& images) { - local_image_info_map_.clear(); - std::vector<ash::LocalImageInfo> result; - for (const auto& image_path : images) { - ash::LocalImageInfo local_image_info = {base::UnguessableToken::Create(), - image_path}; - local_image_info_map_.insert({local_image_info.id, local_image_info}); - result.push_back(local_image_info); - } - std::move(callback).Run(std::move(result)); + local_images_ = std::set<base::FilePath>(images.begin(), images.end()); + std::move(callback).Run(images); } void ChromePersonalizationAppUiDelegate::OnGetLocalImageThumbnail(
diff --git a/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate.h b/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate.h index 0093fe9..acf3a9d 100644 --- a/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate.h +++ b/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate.h
@@ -10,16 +10,16 @@ #include <stdint.h> #include <memory> +#include <set> #include <string> +#include <vector> -#include "ash/public/cpp/wallpaper/local_image_info.h" #include "ash/public/cpp/wallpaper/wallpaper_controller.h" #include "ash/public/cpp/wallpaper/wallpaper_controller_observer.h" #include "ash/public/cpp/wallpaper/wallpaper_info.h" #include "base/files/file.h" #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" -#include "base/unguessable_token.h" #include "chromeos/components/personalization_app/mojom/personalization_app.mojom.h" #include "components/account_id/account_id.h" #include "mojo/public/cpp/bindings/pending_receiver.h" @@ -80,7 +80,7 @@ void GetLocalImages(GetLocalImagesCallback callback) override; - void GetLocalImageThumbnail(const base::UnguessableToken& file_path, + void GetLocalImageThumbnail(const base::FilePath& file_path, GetLocalImageThumbnailCallback callback) override; void SetWallpaperObserver( @@ -95,7 +95,7 @@ void SelectWallpaper(uint64_t image_asset_id, SelectWallpaperCallback callback) override; - void SelectLocalImage(const base::UnguessableToken& id, + void SelectLocalImage(const base::FilePath& path, SelectLocalImageCallback callback) override; void SetCustomWallpaperLayout(ash::WallpaperLayout layout) override; @@ -186,10 +186,10 @@ // user wallpaper selections. std::map<uint64_t, ImageInfo> image_asset_id_map_; - // When local images are fetched, assign each one a random |UnguessableToken| - // id. Store a mapping from these tokens to |ash::LocalImageInfo|. The SWA - // passes a token id to get an image thumbnail preview. - std::map<base::UnguessableToken, ash::LocalImageInfo> local_image_info_map_; + // When local images are fetched, store the valid file paths in the set. This + // is checked when the SWA requests thumbnail data or sets an image as the + // user's background. + std::set<base::FilePath> local_images_; // Pointer to profile of user that opened personalization SWA. Not owned. Profile* const profile_ = nullptr;
diff --git a/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate_unittest.cc b/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate_unittest.cc index 3e8ef6c13..2e80d7d 100644 --- a/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate_unittest.cc +++ b/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate_unittest.cc
@@ -7,7 +7,6 @@ #include <memory> #include "ash/constants/ash_features.h" -#include "ash/public/cpp/wallpaper/local_image_info.h" #include "ash/public/cpp/wallpaper/online_wallpaper_params.h" #include "ash/public/cpp/wallpaper/wallpaper_controller_client.h" #include "ash/public/cpp/wallpaper/wallpaper_info.h"
diff --git a/chrome/browser/browsing_data/browsing_data_media_license_helper.cc b/chrome/browser/browsing_data/browsing_data_media_license_helper.cc index 5b40f74..57b5306 100644 --- a/chrome/browser/browsing_data/browsing_data_media_license_helper.cc +++ b/chrome/browser/browsing_data/browsing_data_media_license_helper.cc
@@ -98,20 +98,21 @@ static_cast<storage::PluginPrivateFileSystemBackend*>( filesystem_context_->GetFileSystemBackend(kType)); - // Determine the set of origins used. - std::vector<url::Origin> origins = - backend->GetOriginsForTypeOnFileTaskRunner(kType); + // Determine the set of StorageKeys used. + std::vector<blink::StorageKey> storage_keys = + backend->GetStorageKeysForTypeOnFileTaskRunner(kType); std::list<MediaLicenseInfo> result; - for (const auto& origin : origins) { - if (!browsing_data::HasWebScheme(origin.GetURL())) + for (const auto& storage_key : storage_keys) { + if (!browsing_data::HasWebScheme(storage_key.origin().GetURL())) continue; // Non-websafe state is not considered browsing data. int64_t size; base::Time last_modified_time; - backend->GetOriginDetailsOnFileTaskRunner(filesystem_context_.get(), origin, - &size, &last_modified_time); - result.push_back( - MediaLicenseInfo(origin.GetURL(), size, last_modified_time)); + backend->GetOriginDetailsOnFileTaskRunner(filesystem_context_.get(), + storage_key.origin(), &size, + &last_modified_time); + result.emplace_back(storage_key.origin().GetURL(), size, + last_modified_time); } content::GetUIThreadTaskRunner({})->PostTask(
diff --git a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_api.cc b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_api.cc index 67df230..1f80660c6 100644 --- a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_api.cc +++ b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_api.cc
@@ -8,6 +8,7 @@ #include "chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.h" #include "chrome/common/extensions/api/speech_recognition_private.h" +#include "content/public/browser/browser_context.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace extensions { @@ -34,10 +35,9 @@ if (options->interim_results) interim_results = *options->interim_results; - // Get the unique key for this API client and ask the manager to handle this - // API call. - SpeechRecogntionPrivateManager* manager = - SpeechRecogntionPrivateManager::GetInstance(); + // Get the manager for this context and ask it to handle this API call. + SpeechRecognitionPrivateManager* manager = + SpeechRecognitionPrivateManager::Get(browser_context()); const std::string key = manager->CreateKey(extension_id(), client_id); manager->HandleStart( key, locale, interim_results, @@ -50,4 +50,36 @@ Respond(NoArguments()); } +ExtensionFunction::ResponseAction SpeechRecognitionPrivateStopFunction::Run() { + // Extract arguments. + std::unique_ptr<api::speech_recognition_private::Stop::Params> params( + api::speech_recognition_private::Stop::Params::Create(args())); + EXTENSION_FUNCTION_VALIDATE(params); + const api::speech_recognition_private::StopOptions* options = + ¶ms->options; + DCHECK(options); + absl::optional<int> client_id; + if (options->client_id) + client_id = *options->client_id; + + // Get the manager for this context and ask it to handle this API call. + SpeechRecognitionPrivateManager* manager = + SpeechRecognitionPrivateManager::Get(browser_context()); + const std::string key = manager->CreateKey(extension_id(), client_id); + manager->HandleStop( + key, base::BindOnce(&SpeechRecognitionPrivateStopFunction::OnStop, + base::RetainedRef(this))); + return RespondLater(); +} + +void SpeechRecognitionPrivateStopFunction::OnStop( + absl::optional<std::string> error) { + if (error.has_value()) { + Respond(Error(error.value())); + return; + } + + Respond(NoArguments()); +} + } // namespace extensions
diff --git a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_api.h b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_api.h index 9fa2286..c0980af 100644 --- a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_api.h +++ b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_api.h
@@ -15,12 +15,29 @@ public: DECLARE_EXTENSION_FUNCTION("speechRecognitionPrivate.start", SPEECHRECOGNITIONPRIVATE_START) - // A callback that is run when the speech recognition service starts. - void OnStart(); protected: ~SpeechRecognitionPrivateStartFunction() override {} ResponseAction Run() override; + + private: + // A callback that is run when the speech recognition service starts. + void OnStart(); +}; + +// An API function that stops speech recognition. +class SpeechRecognitionPrivateStopFunction : public ExtensionFunction { + public: + DECLARE_EXTENSION_FUNCTION("speechRecognitionPrivate.stop", + SPEECHRECOGNITIONPRIVATE_STOP) + + protected: + ~SpeechRecognitionPrivateStopFunction() override {} + ResponseAction Run() override; + + private: + // A callback that is run when the speech recognition service stops. + void OnStop(absl::optional<std::string> error); }; } // namespace extensions
diff --git a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_apitest.cc b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_apitest.cc index 956fe3cd..699dc74 100644 --- a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_apitest.cc +++ b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_apitest.cc
@@ -21,7 +21,7 @@ const SpeechRecognitionPrivateApiTest&) = delete; void TearDownOnMainThread() override { - SpeechRecogntionPrivateManager::GetInstance()->recognition_data_.clear(); + SpeechRecognitionPrivateManager::Get(profile())->recognition_data_.clear(); SpeechRecognitionPrivateBaseTest::TearDownOnMainThread(); } }; @@ -34,8 +34,8 @@ SpeechRecognitionPrivateApiTest, ::testing::Values(kOnDeviceRecognition)); -IN_PROC_BROWSER_TEST_P(SpeechRecognitionPrivateApiTest, Start) { - ASSERT_TRUE(RunExtensionTest("speech/speech_recognition_private/start")) +IN_PROC_BROWSER_TEST_P(SpeechRecognitionPrivateApiTest, Simple) { + ASSERT_TRUE(RunExtensionTest("speech/speech_recognition_private/simple")) << message_; }
diff --git a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_base_test.cc b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_base_test.cc index 4ae961f..232a6497 100644 --- a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_base_test.cc +++ b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_base_test.cc
@@ -87,4 +87,10 @@ base::RunLoop().RunUntilIdle(); } +void SpeechRecognitionPrivateBaseTest::WaitForRecognitionStopped() { + if (GetParam() == kNetworkRecognition) + fake_speech_recognition_manager_->WaitForRecognitionEnded(); + base::RunLoop().RunUntilIdle(); +} + } // namespace extensions
diff --git a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_base_test.h b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_base_test.h index f4028705..5d17ae3 100644 --- a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_base_test.h +++ b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_base_test.h
@@ -64,6 +64,8 @@ // Waits for the speech recognition service to start. void WaitForRecognitionStarted(); + // Waits for the speech recognition service to stop. + void WaitForRecognitionStopped(); private: // Methods for additional setup.
diff --git a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.cc b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.cc index b2f7865..87ad3d2 100644 --- a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.cc +++ b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.cc
@@ -4,26 +4,130 @@ #include "chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.h" +#include "base/no_destructor.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer.h" -#include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/extensions/api/speech_recognition_private.h" +#include "components/keyed_service/content/browser_context_dependency_manager.h" +#include "components/keyed_service/content/browser_context_keyed_service_factory.h" +#include "content/public/browser/browser_context.h" #include "extensions/browser/event_router.h" +#include "extensions/browser/event_router_factory.h" #include "extensions/browser/extension_event_histogram_value.h" #include "extensions/browser/extension_registry.h" +#include "extensions/browser/extensions_browser_client.h" namespace extensions { -SpeechRecogntionPrivateManager::SpeechRecogntionPrivateManager() = default; -SpeechRecogntionPrivateManager::~SpeechRecogntionPrivateManager() = default; +namespace { -SpeechRecogntionPrivateManager* SpeechRecogntionPrivateManager::GetInstance() { - static base::NoDestructor<SpeechRecogntionPrivateManager> instance; +std::string GetExtensionIdFromKey(const std::string& key) { + std::size_t pos = key.find('.'); + if (pos != std::string::npos) + return key.substr(0, pos); + + // If we couldn't find a ".", then the key is the extension ID. + return key; +} + +absl::optional<int> GetClientIdFromKey(const std::string& key) { + int client_id = -1; + absl::optional<int> result; + std::size_t pos = key.find('.'); + if (pos != std::string::npos) { + // Extract the number to the right of the "." + base::StringToInt(key.substr(pos + 1), &client_id); + result = client_id; + } + + return result; +} + +// Factory to get or create an instance of SpeechRecognitionPrivateManager from +// a browser context. +class SpeechRecognitionPrivateManagerFactory + : public BrowserContextKeyedServiceFactory { + public: + SpeechRecognitionPrivateManagerFactory( + const SpeechRecognitionPrivateManagerFactory&) = delete; + SpeechRecognitionPrivateManagerFactory& operator=( + const SpeechRecognitionPrivateManagerFactory&) = delete; + + static SpeechRecognitionPrivateManager* GetForBrowserContext( + content::BrowserContext* context); + + private: + friend class base::NoDestructor<SpeechRecognitionPrivateManagerFactory>; + static SpeechRecognitionPrivateManagerFactory* GetInstance(); + + SpeechRecognitionPrivateManagerFactory(); + ~SpeechRecognitionPrivateManagerFactory() override = default; + + // BrowserContextKeyedServiceFactory: + KeyedService* BuildServiceInstanceFor( + content::BrowserContext* context) const override; + content::BrowserContext* GetBrowserContextToUse( + content::BrowserContext* context) const override; +}; + +// static +SpeechRecognitionPrivateManager* +SpeechRecognitionPrivateManagerFactory::GetForBrowserContext( + content::BrowserContext* context) { + return static_cast<SpeechRecognitionPrivateManager*>( + GetInstance()->GetServiceForBrowserContext(context, true)); +} + +// static +SpeechRecognitionPrivateManagerFactory* +SpeechRecognitionPrivateManagerFactory::GetInstance() { + static base::NoDestructor<SpeechRecognitionPrivateManagerFactory> instance; return instance.get(); } -void SpeechRecogntionPrivateManager::HandleStart( +SpeechRecognitionPrivateManagerFactory::SpeechRecognitionPrivateManagerFactory() + : BrowserContextKeyedServiceFactory( + "SpeechRecognitionApiManager", + BrowserContextDependencyManager::GetInstance()) { + DependsOn(EventRouterFactory::GetInstance()); +} + +KeyedService* SpeechRecognitionPrivateManagerFactory::BuildServiceInstanceFor( + content::BrowserContext* context) const { + return new SpeechRecognitionPrivateManager(context); +} + +content::BrowserContext* +SpeechRecognitionPrivateManagerFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { + // Redirected in incognito. + return ExtensionsBrowserClient::Get()->GetOriginalContext(context); +} + +} // namespace + +SpeechRecognitionPrivateManager::SpeechRecognitionPrivateManager( + content::BrowserContext* context) + : context_(context) {} + +SpeechRecognitionPrivateManager::~SpeechRecognitionPrivateManager() = default; + +// static +SpeechRecognitionPrivateManager* SpeechRecognitionPrivateManager::Get( + content::BrowserContext* context) { + return static_cast<SpeechRecognitionPrivateManagerFactory*>(GetFactory()) + ->GetForBrowserContext(context); +} + +// static +BrowserContextKeyedServiceFactory* +SpeechRecognitionPrivateManager::GetFactory() { + static base::NoDestructor<SpeechRecognitionPrivateManagerFactory> g_factory; + return g_factory.get(); +} + +void SpeechRecognitionPrivateManager::HandleStart( const std::string& key, absl::optional<std::string> locale, absl::optional<bool> interim_results, @@ -32,7 +136,33 @@ std::move(on_start_callback)); } -std::string SpeechRecogntionPrivateManager::CreateKey( +void SpeechRecognitionPrivateManager::HandleStop( + const std::string& key, + base::OnceCallback<void(absl::optional<std::string>)> callback) { + GetSpeechRecognizer(key)->HandleStop(std::move(callback)); +} + +void SpeechRecognitionPrivateManager::DispatchOnStopEvent( + const std::string& key) { + std::string extension_id = GetExtensionIdFromKey(key); + absl::optional<int> client_id = GetClientIdFromKey(key); + EventRouter* event_router = EventRouter::Get(context_); + + base::Value return_dict(base::Value::Type::DICTIONARY); + if (client_id.has_value()) + return_dict.SetIntKey("clientId", client_id.value()); + + auto event_args = std::vector<base::Value>(); + event_args.push_back(std::move(return_dict)); + std::unique_ptr<Event> event = std::make_unique<Event>( + events::SPEECH_RECOGNITION_PRIVATE_ON_STOP, + api::speech_recognition_private::OnStop::kEventName, + std::move(event_args)); + + event_router->DispatchEventToExtension(extension_id, std::move(event)); +} + +std::string SpeechRecognitionPrivateManager::CreateKey( const std::string& extension_id, absl::optional<int> client_id) { if (!client_id.has_value()) @@ -42,10 +172,13 @@ } SpeechRecognitionPrivateRecognizer* -SpeechRecogntionPrivateManager::GetSpeechRecognizer(const std::string& key) { +SpeechRecognitionPrivateManager::GetSpeechRecognizer(const std::string& key) { auto& recognizer = recognition_data_[key]; if (!recognizer) - recognizer = std::make_unique<SpeechRecognitionPrivateRecognizer>(); + recognizer = std::make_unique<SpeechRecognitionPrivateRecognizer>( + base::BindRepeating( + &SpeechRecognitionPrivateManager::DispatchOnStopEvent, GetWeakPtr(), + key)); return recognizer.get(); }
diff --git a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.h b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.h index 5dc6e11..3f34a721 100644 --- a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.h +++ b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager.h
@@ -10,25 +10,35 @@ #include <string> #include "base/callback_forward.h" +#include "base/memory/weak_ptr.h" +#include "components/keyed_service/core/keyed_service.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace extensions { +class BrowserContextKeyedServiceFactory; +namespace content { +class BrowserContext; +} // namespace content + +namespace extensions { class SpeechRecognitionPrivateRecognizer; // This class implements core bookkeeping logic for the SpeechRecognitionPrivate // API. It is responsible for routing API function calls to the correct speech // recognizer and routing events back to the correct extension. -class SpeechRecogntionPrivateManager { +class SpeechRecognitionPrivateManager : public KeyedService { public: - SpeechRecogntionPrivateManager(); - ~SpeechRecogntionPrivateManager(); - SpeechRecogntionPrivateManager(const SpeechRecogntionPrivateManager&) = + explicit SpeechRecognitionPrivateManager(content::BrowserContext* context); + ~SpeechRecognitionPrivateManager() override; + SpeechRecognitionPrivateManager(const SpeechRecognitionPrivateManager&) = delete; - SpeechRecogntionPrivateManager& operator=( - const SpeechRecogntionPrivateManager&) = delete; + SpeechRecognitionPrivateManager& operator=( + const SpeechRecognitionPrivateManager&) = delete; - static SpeechRecogntionPrivateManager* GetInstance(); + // Gets or creates an instance of SpeechRecognitionPrivateManager from a + // browser context. + static SpeechRecognitionPrivateManager* Get(content::BrowserContext* context); + // Creates a unique ID for an API client given an extension ID and an optional // ID, which is provided by the client. std::string CreateKey(const std::string& extension_id, @@ -38,19 +48,40 @@ absl::optional<std::string> locale, absl::optional<bool> interim_results, base::OnceClosure on_start_callback); + // Handles a call to stop speech recognition. + void HandleStop( + const std::string& key, + base::OnceCallback<void(absl::optional<std::string>)> on_stop_callback); private: friend class SpeechRecognitionPrivateManagerTest; friend class SpeechRecognitionPrivateApiTest; + // Dispatches an event when speech recognition stops in the background without + // an explicit call to HandleStop() e.g. when speech recognition encounters + // a fatal error. + void DispatchOnStopEvent(const std::string& key); + + // Retrieves the factory instance for SpeechRecognitionPrivateManager. + static BrowserContextKeyedServiceFactory* GetFactory(); + // Returns the speech recognizer associated with the key. Creates one if // none exists. SpeechRecognitionPrivateRecognizer* GetSpeechRecognizer( const std::string& key); + base::WeakPtr<SpeechRecognitionPrivateManager> GetWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); + } + // Maps API client IDs to their speech recognizers. std::map<std::string, std::unique_ptr<SpeechRecognitionPrivateRecognizer>> recognition_data_; + + // The browser context associated with the keyed service. + content::BrowserContext* context_; + + base::WeakPtrFactory<SpeechRecognitionPrivateManager> weak_ptr_factory_{this}; }; } // namespace extensions
diff --git a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager_browsertest.cc b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager_browsertest.cc index e09bbf61..c57ef48 100644 --- a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager_browsertest.cc +++ b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_manager_browsertest.cc
@@ -6,6 +6,7 @@ #include "chrome/browser/chromeos/extensions/speech/speech_recognition_private_base_test.h" #include "chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer.h" +#include "extensions/test/extension_test_message_listener.h" namespace { const char kEnglishLocale[] = "en-US"; @@ -23,31 +24,48 @@ SpeechRecognitionPrivateManagerTest& operator=( const SpeechRecognitionPrivateManagerTest&) = delete; + void SetUpOnMainThread() override { + SpeechRecognitionPrivateBaseTest::SetUpOnMainThread(); + manager_ = SpeechRecognitionPrivateManager::Get(profile()); + } + void TearDownOnMainThread() override { - SpeechRecogntionPrivateManager::GetInstance()->recognition_data_.clear(); + manager_->recognition_data_.clear(); SpeechRecognitionPrivateBaseTest::TearDownOnMainThread(); } std::string CreateKey(const std::string& extension_id, absl::optional<int> client_id) { - return SpeechRecogntionPrivateManager::GetInstance()->CreateKey( - extension_id, client_id); + return manager_->CreateKey(extension_id, client_id); } void HandleStartAndWait(const std::string& key, absl::optional<std::string> locale, absl::optional<bool> interim_results, base::OnceClosure on_start_callback) { - SpeechRecogntionPrivateManager::GetInstance()->HandleStart( - key, locale, interim_results, std::move(on_start_callback)); + manager_->HandleStart(key, locale, interim_results, + std::move(on_start_callback)); SpeechRecognitionPrivateBaseTest::WaitForRecognitionStarted(); } + void HandleStopAndWait( + const std::string& key, + base::OnceCallback<void(absl::optional<std::string>)> callback) { + manager_->HandleStop(key, std::move(callback)); + SpeechRecognitionPrivateBaseTest::WaitForRecognitionStopped(); + } + SpeechRecognitionPrivateRecognizer* GetSpeechRecognizer( const std::string& key) { - return SpeechRecogntionPrivateManager::GetInstance()->GetSpeechRecognizer( - key); + return manager_->GetSpeechRecognizer(key); } + + void DispatchOnStopEvent(const std::string& key) { + manager_->DispatchOnStopEvent(key); + } + + private: + SpeechRecognitionPrivateManager* manager_; }; INSTANTIATE_TEST_SUITE_P(Network, @@ -103,4 +121,53 @@ ASSERT_EQ(SPEECH_RECOGNIZER_RECOGNIZING, second_recognizer->current_state()); } +IN_PROC_BROWSER_TEST_P(SpeechRecognitionPrivateManagerTest, + HandleStartAndStop) { + const std::string key = "Testing"; + absl::optional<std::string> locale; + absl::optional<bool> interim_results(true); + + HandleStartAndWait(key, locale, interim_results, base::DoNothing()); + SpeechRecognitionPrivateRecognizer* recognizer = GetSpeechRecognizer(key); + ASSERT_NE(nullptr, recognizer); + ASSERT_EQ(SPEECH_RECOGNIZER_RECOGNIZING, recognizer->current_state()); + + HandleStopAndWait(key, base::DoNothing()); + recognizer = GetSpeechRecognizer(key); + ASSERT_NE(nullptr, recognizer); + ASSERT_EQ(SPEECH_RECOGNIZER_OFF, recognizer->current_state()); +} + +// Tests that events can be dispatched from the SpeechRecognitionPrivateManager +// and received and processed in an extension. +IN_PROC_BROWSER_TEST_P(SpeechRecognitionPrivateManagerTest, + DispatchOnStopEvent) { + ASSERT_TRUE( + RunExtensionTest("speech/speech_recognition_private/onstop_event")) + << message_; + + const char* kExtensionId = "egfdjlfmgnehecnclamagfafdccgfndp"; + const char* kExtensionIdAndIncorrectClientId = + "egfdjlfmgnehecnclamagfafdccgfndp.0"; + const char* kCorrectExtensionIdAndClientId = + "egfdjlfmgnehecnclamagfafdccgfndp.4"; + const char* kSkippingEvent = "Skipping event"; + const char* kProcessingEvent = "Processing event"; + + // Send onStop events and ensure that we only process the event whose client + // ID matches the extension's client ID. + const struct { + const char* key; + const char* expected; + } kTestCases[] = {{kExtensionId, kSkippingEvent}, + {kExtensionIdAndIncorrectClientId, kSkippingEvent}, + {kCorrectExtensionIdAndClientId, kProcessingEvent}}; + + for (const auto& test : kTestCases) { + ExtensionTestMessageListener listener(test.expected, false); + DispatchOnStopEvent(test.key); + ASSERT_TRUE(listener.WaitUntilSatisfied()); + } +} + } // namespace extensions
diff --git a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer.cc b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer.cc index d2e7921..5d785fdb 100644 --- a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer.cc +++ b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer.cc
@@ -12,27 +12,44 @@ #include "components/prefs/pref_service.h" #include "content/public/browser/storage_partition.h" +namespace { +const char kSpeechRecognitionOffError[] = "Speech recognition already stopped"; +} // namespace + namespace extensions { -SpeechRecognitionPrivateRecognizer::SpeechRecognitionPrivateRecognizer() {} +SpeechRecognitionPrivateRecognizer::SpeechRecognitionPrivateRecognizer( + base::RepeatingClosure on_stop_callback) + : on_stop_callback_(std::move(on_stop_callback)) {} SpeechRecognitionPrivateRecognizer::~SpeechRecognitionPrivateRecognizer() {} void SpeechRecognitionPrivateRecognizer::OnSpeechRecognitionStateChanged( SpeechRecognizerStatus new_state) { + SpeechRecognizerStatus next_state = new_state; if (new_state == SPEECH_RECOGNIZER_READY) { if (current_state_ == SPEECH_RECOGNIZER_OFF && speech_recognizer_) { // The SpeechRecognizer is ready to start recognizing speech. speech_recognizer_->Start(); } else { - // TODO(crbug.com/1246044): Turn the speech recognizer off. Implement this - // when working on stop() and onStop(). + // Turn the recognizer off and run on_stop_callback_ to notify + // listeners of the API that speech recognition has stopped. + next_state = SPEECH_RECOGNIZER_OFF; + RecognizerOff(); + DCHECK(!on_stop_callback_.is_null()); + on_stop_callback_.Run(); } } else if (new_state == SPEECH_RECOGNIZER_RECOGNIZING) { DCHECK(!on_start_callback_.is_null()); std::move(on_start_callback_).Run(); + } else if (new_state == SPEECH_RECOGNIZER_ERROR) { + // TODO(crbug.com/1246048): Fire an error event when this state is reached. + next_state = SPEECH_RECOGNIZER_OFF; + RecognizerOff(); + DCHECK(!on_stop_callback_.is_null()); + on_stop_callback_.Run(); } - current_state_ = new_state; + current_state_ = next_state; } void SpeechRecognitionPrivateRecognizer::HandleStart( @@ -44,8 +61,7 @@ if (speech_recognizer_) { // Create a new speech recognizer, since some properties, e.g. locale, could // have changed. - current_state_ = SPEECH_RECOGNIZER_OFF; - speech_recognizer_.reset(); + RecognizerOff(); } // Choose which type of speech recognition, either on-device or network. @@ -64,6 +80,31 @@ } } +void SpeechRecognitionPrivateRecognizer::HandleStop( + base::OnceCallback<void(absl::optional<std::string>)> callback) { + if (current_state_ == SPEECH_RECOGNIZER_OFF) { + // If speech recognition is already off, trigger the callback with an error + // message. + std::move(callback).Run( + /*error=*/absl::optional<std::string>(kSpeechRecognitionOffError)); + return; + } + + RecognizerOff(); + + DCHECK(!on_stop_callback_.is_null()); + on_stop_callback_.Run(); + + DCHECK(!callback.is_null()); + std::move(callback).Run(/*error=*/absl::optional<std::string>()); +} + +void SpeechRecognitionPrivateRecognizer::RecognizerOff() { + current_state_ = SPEECH_RECOGNIZER_OFF; + if (speech_recognizer_) + speech_recognizer_.reset(); +} + void SpeechRecognitionPrivateRecognizer::MaybeUpdateProperties( absl::optional<std::string> locale, absl::optional<bool> interim_results,
diff --git a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer.h b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer.h index ea5b33a..7731f9a6 100644 --- a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer.h +++ b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer.h
@@ -22,7 +22,8 @@ // use the on-device or network speech recognition. class SpeechRecognitionPrivateRecognizer : public SpeechRecognizerDelegate { public: - SpeechRecognitionPrivateRecognizer(); + explicit SpeechRecognitionPrivateRecognizer( + base::RepeatingClosure on_stop_callback); ~SpeechRecognitionPrivateRecognizer() override; // SpeechRecognizerDelegate: @@ -38,6 +39,10 @@ void HandleStart(absl::optional<std::string> locale, absl::optional<bool> interim_results, base::OnceClosure callback); + // Handles a call to stop speech recognition. The callback accepts an + // optional string specifying an error message, if any. + void HandleStop( + base::OnceCallback<void(absl::optional<std::string>)> callback); std::string locale() { return locale_; } bool interim_results() { return interim_results_; } @@ -46,6 +51,9 @@ private: friend class SpeechRecognitionPrivateRecognizerTest; + // Turns the speech recognizer off. + void RecognizerOff(); + // Updates properties used for speech recognition. void MaybeUpdateProperties(absl::optional<std::string> locale, absl::optional<bool> interim_results, @@ -59,6 +67,8 @@ std::string locale_ = speech::kUsEnglishLocale; bool interim_results_ = false; base::OnceClosure on_start_callback_; + // A callback that is run whenever speech recognition stops. + base::RepeatingClosure on_stop_callback_; std::unique_ptr<SpeechRecognizer> speech_recognizer_; base::WeakPtrFactory<SpeechRecognitionPrivateRecognizer> weak_ptr_factory_{
diff --git a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer_browsertest.cc b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer_browsertest.cc index f028ba2..40ff4de52 100644 --- a/chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer_browsertest.cc +++ b/chrome/browser/chromeos/extensions/speech/speech_recognition_private_recognizer_browsertest.cc
@@ -24,7 +24,10 @@ const SpeechRecognitionPrivateRecognizerTest&) = delete; void SetUpOnMainThread() override { - recognizer_ = std::make_unique<SpeechRecognitionPrivateRecognizer>(); + recognizer_ = std::make_unique<SpeechRecognitionPrivateRecognizer>( + base::BindRepeating( + &SpeechRecognitionPrivateRecognizerTest::OnStopRepeatingCallback, + base::Unretained(this))); SpeechRecognitionPrivateBaseTest::SetUpOnMainThread(); } @@ -42,6 +45,13 @@ SpeechRecognitionPrivateBaseTest::WaitForRecognitionStarted(); } + void HandleStopAndWait() { + recognizer_->HandleStop(base::BindOnce( + &SpeechRecognitionPrivateRecognizerTest::OnStopOnceCallback, + base::Unretained(this))); + SpeechRecognitionPrivateBaseTest::WaitForRecognitionStopped(); + } + void MaybeUpdateProperties(absl::optional<std::string> locale, absl::optional<bool> interim_results) { recognizer_->MaybeUpdateProperties( @@ -50,12 +60,45 @@ base::Unretained(this))); } + void FakeSpeechRecognitionStateChanged(SpeechRecognizerStatus new_state) { + recognizer_->OnSpeechRecognitionStateChanged(new_state); + } + void OnStartCallback() { ran_on_start_callback_ = true; } + void OnStopOnceCallback(absl::optional<std::string> error) { + if (error.has_value()) + on_stop_once_callback_error_ = error.value(); + else + on_stop_once_callback_error_ = ""; + + ran_on_stop_once_callback_ = true; + } + void OnStopRepeatingCallback() { ran_on_stop_repeating_callback_ = true; } + bool ran_on_start_callback() { return ran_on_start_callback_; } void set_ran_on_start_callback(bool value) { ran_on_start_callback_ = value; } + + bool ran_on_stop_once_callback() { return ran_on_stop_once_callback_; } + void set_ran_on_stop_once_callback(bool value) { + ran_on_stop_once_callback_ = value; + } + + bool ran_on_stop_repeating_callback() { + return ran_on_stop_repeating_callback_; + } + void set_ran_on_stop_repeating_callback(bool value) { + ran_on_stop_repeating_callback_ = value; + } + SpeechRecognitionPrivateRecognizer* recognizer() { return recognizer_.get(); } + std::string on_stop_once_callback_error() { + return on_stop_once_callback_error_; + } bool ran_on_start_callback_ = false; + bool ran_on_stop_once_callback_ = false; + std::string on_stop_once_callback_error_; + bool ran_on_stop_repeating_callback_ = false; std::unique_ptr<SpeechRecognitionPrivateRecognizer> recognizer_; }; @@ -101,6 +144,23 @@ } IN_PROC_BROWSER_TEST_P(SpeechRecognitionPrivateRecognizerTest, + RecognitionStartsAndStops) { + absl::optional<std::string> locale; + absl::optional<bool> interim_results; + + // Start speech recognition. + HandleStartAndWait(locale, interim_results); + ASSERT_EQ(SPEECH_RECOGNIZER_RECOGNIZING, recognizer()->current_state()); + ASSERT_TRUE(ran_on_start_callback()); + + // Stop speech recognition. + HandleStopAndWait(); + ASSERT_EQ(SPEECH_RECOGNIZER_OFF, recognizer()->current_state()); + ASSERT_TRUE(ran_on_stop_once_callback()); + ASSERT_TRUE(ran_on_stop_repeating_callback()); +} + +IN_PROC_BROWSER_TEST_P(SpeechRecognitionPrivateRecognizerTest, RecognitionStartsTwice) { absl::optional<std::string> locale; absl::optional<bool> interim_results; @@ -123,4 +183,80 @@ ASSERT_TRUE(recognizer()->interim_results()); } +IN_PROC_BROWSER_TEST_P(SpeechRecognitionPrivateRecognizerTest, + RecognitionStartsAndStopsTwice) { + absl::optional<std::string> locale; + absl::optional<bool> interim_results; + HandleStartAndWait(locale, interim_results); + ASSERT_TRUE(ran_on_start_callback()); + ASSERT_EQ(SPEECH_RECOGNIZER_RECOGNIZING, recognizer()->current_state()); + ASSERT_EQ(kEnglishLocale, recognizer()->locale()); + ASSERT_EQ(false, recognizer()->interim_results()); + + HandleStopAndWait(); + ASSERT_TRUE(ran_on_stop_once_callback()); + ASSERT_TRUE(ran_on_stop_repeating_callback()); + ASSERT_EQ(SPEECH_RECOGNIZER_OFF, recognizer()->current_state()); + ASSERT_EQ(kEnglishLocale, recognizer()->locale()); + ASSERT_EQ(false, recognizer()->interim_results()); + + // Update properties and start the recognizer again. + // Keep the locale as en-US, otherwise the the on-device variant of this + // test will fail because on-device speech recognition is only supported in + // en-US. + interim_results = true; + set_ran_on_start_callback(false); + set_ran_on_stop_once_callback(false); + set_ran_on_stop_repeating_callback(false); + HandleStartAndWait(locale, interim_results); + ASSERT_TRUE(ran_on_start_callback()); + ASSERT_EQ(SPEECH_RECOGNIZER_RECOGNIZING, recognizer()->current_state()); + ASSERT_EQ(kEnglishLocale, recognizer()->locale()); + ASSERT_EQ(true, recognizer()->interim_results()); + + HandleStopAndWait(); + ASSERT_TRUE(ran_on_stop_once_callback()); + ASSERT_TRUE(ran_on_stop_repeating_callback()); + ASSERT_EQ(SPEECH_RECOGNIZER_OFF, recognizer()->current_state()); + ASSERT_EQ(kEnglishLocale, recognizer()->locale()); + ASSERT_EQ(true, recognizer()->interim_results()); +} + +// Tests how HandleStop() behaves if speech recognition is already off. It +// should run the OnceCallback with an error, but should not run the +// RepeatingCallback. +IN_PROC_BROWSER_TEST_P(SpeechRecognitionPrivateRecognizerTest, + HandleStopNeverStarted) { + HandleStopAndWait(); + ASSERT_TRUE(ran_on_stop_once_callback()); + ASSERT_EQ("Speech recognition already stopped", + on_stop_once_callback_error()); + ASSERT_FALSE(ran_on_stop_repeating_callback()); + ASSERT_EQ(SPEECH_RECOGNIZER_OFF, recognizer()->current_state()); + ASSERT_EQ(kEnglishLocale, recognizer()->locale()); + ASSERT_EQ(false, recognizer()->interim_results()); +} + +// Tests that we run the correct callback when speech recognition is stopped in +// the background. +IN_PROC_BROWSER_TEST_P(SpeechRecognitionPrivateRecognizerTest, + StoppedInBackground) { + HandleStartAndWait(absl::optional<std::string>(), absl::optional<bool>()); + FakeSpeechRecognitionStateChanged(SPEECH_RECOGNIZER_READY); + ASSERT_TRUE(ran_on_stop_repeating_callback()); + ASSERT_FALSE(ran_on_stop_once_callback()); + ASSERT_EQ("", on_stop_once_callback_error()); + ASSERT_EQ(SPEECH_RECOGNIZER_OFF, recognizer()->current_state()); +} + +// Tests that we run the correct callback when speech recognition encounters +// an error. +IN_PROC_BROWSER_TEST_P(SpeechRecognitionPrivateRecognizerTest, Error) { + HandleStartAndWait(absl::optional<std::string>(), absl::optional<bool>()); + FakeSpeechRecognitionStateChanged(SPEECH_RECOGNIZER_ERROR); + ASSERT_TRUE(ran_on_stop_repeating_callback()); + ASSERT_FALSE(ran_on_stop_once_callback()); + ASSERT_EQ(SPEECH_RECOGNIZER_OFF, recognizer()->current_state()); +} + } // namespace extensions
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index 577d0cd..8c9ccb4 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc
@@ -290,12 +290,15 @@ ::prefs::kLanguageRemapAssistantKeyTo, static_cast<int>(ui::chromeos::ModifierKey::kAssistantKey), user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PRIORITY_PREF); - // We don't sync the CapsLock remapping pref, since the UI hides this pref - // on certain devices, so syncing a non-default value to a device that - // doesn't allow changing the pref would be odd. http://crbug.com/167237 + + // Even though most of the Chrome OS devices don't have the CapsLock key - the + // user always could plug in an external keyboard with the CapsLock. So we're + // syncing the pref to support this case. registry->RegisterIntegerPref( ::prefs::kLanguageRemapCapsLockKeyTo, - static_cast<int>(ui::chromeos::ModifierKey::kCapsLockKey)); + static_cast<int>(ui::chromeos::ModifierKey::kCapsLockKey), + user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PRIORITY_PREF); + registry->RegisterIntegerPref( ::prefs::kLanguageRemapEscapeKeyTo, static_cast<int>(ui::chromeos::ModifierKey::kEscapeKey),
diff --git a/chrome/browser/download/download_request_limiter_unittest.cc b/chrome/browser/download/download_request_limiter_unittest.cc index bd1e584..3bc3a08 100644 --- a/chrome/browser/download/download_request_limiter_unittest.cc +++ b/chrome/browser/download/download_request_limiter_unittest.cc
@@ -514,8 +514,8 @@ // History back shouldn't reset the state, either. auto backward_navigation = - content::NavigationSimulator::CreateHistoryNavigation(-1 /* Offset */, - web_contents()); + content::NavigationSimulator::CreateHistoryNavigation( + -1 /* Offset */, web_contents(), false /* is_renderer_initiated */); backward_navigation->Start(); backward_navigation->Commit(); EXPECT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, @@ -541,7 +541,7 @@ // History back should use the old download state, as one of the origin // is in a restricted state. backward_navigation = content::NavigationSimulator::CreateHistoryNavigation( - -1 /* Offset */, web_contents()); + -1 /* Offset */, web_contents(), false /* is_renderer_initiated */); backward_navigation->Start(); backward_navigation->Commit(); EXPECT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, @@ -576,8 +576,8 @@ // History back shouldn't reset the state, either. auto backward_navigation = - content::NavigationSimulator::CreateHistoryNavigation(-1 /* Offset */, - web_contents()); + content::NavigationSimulator::CreateHistoryNavigation( + -1 /* Offset */, web_contents(), false /* is_renderer_initiated */); backward_navigation->Start(); backward_navigation->Commit(); EXPECT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, @@ -588,8 +588,8 @@ // History forward shouldn't reset the state, as the host is encountered // before. auto forward_navigation = - content::NavigationSimulator::CreateHistoryNavigation(1 /* Offset */, - web_contents()); + content::NavigationSimulator::CreateHistoryNavigation( + 1 /* Offset */, web_contents(), false /* is_renderer_initiated */); forward_navigation->Start(); forward_navigation->Commit(); EXPECT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, @@ -599,7 +599,7 @@ // History backward again, nothing should change. backward_navigation = content::NavigationSimulator::CreateHistoryNavigation( - -1 /* Offset */, web_contents()); + -1 /* Offset */, web_contents(), false /* is_renderer_initiated */); backward_navigation->Start(); backward_navigation->Commit(); EXPECT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD,
diff --git a/chrome/browser/enterprise/connectors/device_trust/device_trust_browsertest.cc b/chrome/browser/enterprise/connectors/device_trust/device_trust_browsertest.cc index 42127e8..57baddc 100644 --- a/chrome/browser/enterprise/connectors/device_trust/device_trust_browsertest.cc +++ b/chrome/browser/enterprise/connectors/device_trust/device_trust_browsertest.cc
@@ -15,6 +15,7 @@ #include "chrome/browser/enterprise/connectors/connectors_prefs.h" #include "chrome/browser/enterprise/connectors/connectors_service.h" #include "chrome/browser/enterprise/connectors/device_trust/attestation/desktop/scoped_tpm_signing_key_pair.h" +#include "chrome/browser/enterprise/signals/device_info_fetcher.h" #include "chrome/browser/policy/chrome_browser_policy_connector.h" #include "chrome/browser/policy/dm_token_utils.h" #include "chrome/browser/profiles/profile.h" @@ -94,6 +95,7 @@ InProcessBrowserTest::SetUpOnMainThread(); scoped_tpm_signing_key_pair_.emplace(); + enterprise_signals::DeviceInfoFetcher::SetForceStubForTesting(true); auto* browser_policy_manager = g_browser_process->browser_policy_connector()
diff --git a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/BUILD.gn b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/BUILD.gn index 4bf0d57..2955c38 100644 --- a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/BUILD.gn +++ b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/BUILD.gn
@@ -2,27 +2,12 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -source_set("browser") { - sources = [ "browser_signals_decorator.cc" ] - - public = [ "browser_signals_decorator.h" ] - - deps = [ - "//chrome/browser/enterprise/connectors/device_trust/attestation/common/proto:attestation_ca_proto", - "//components/enterprise", - "//components/policy/core/common", - "//components/policy/proto", - ] - - public_deps = [ "//chrome/browser/enterprise/connectors/device_trust/signals/decorators/common" ] -} - source_set("unit_tests") { testonly = true sources = [ "browser_signals_decorator_unittest.cc" ] deps = [ - ":browser", + "//chrome/browser", "//chrome/browser/enterprise/connectors/device_trust/attestation/common/proto:attestation_ca_proto", "//components/enterprise:test_support", "//components/policy/core/common:test_support",
diff --git a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.cc b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.cc index 0c1a225..a26dbd7 100644 --- a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.cc +++ b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.cc
@@ -5,6 +5,8 @@ #include "chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.h" #include "base/check.h" +#include "chrome/browser/enterprise/signals/device_info_fetcher.h" +#include "chrome/browser/enterprise/signals/signals_common.h" #include "components/enterprise/browser/controller/browser_dm_token_storage.h" #include "components/policy/core/common/cloud/cloud_policy_store.h" #include "components/policy/proto/device_management_backend.pb.h" @@ -18,11 +20,14 @@ BrowserSignalsDecorator::BrowserSignalsDecorator( BrowserDMTokenStorage* dm_token_storage, - CloudPolicyStore* cloud_policy_store) + CloudPolicyStore* cloud_policy_store, + std::unique_ptr<enterprise_signals::DeviceInfoFetcher> device_info_fetcher) : dm_token_storage_(dm_token_storage), - cloud_policy_store_(cloud_policy_store) { + cloud_policy_store_(cloud_policy_store), + device_info_fetcher_(std::move(device_info_fetcher)) { DCHECK(dm_token_storage_); DCHECK(cloud_policy_store_); + DCHECK(device_info_fetcher_); } BrowserSignalsDecorator::~BrowserSignalsDecorator() = default; @@ -30,11 +35,20 @@ void BrowserSignalsDecorator::Decorate(DeviceTrustSignals& signals) { signals.set_device_id(dm_token_storage_->RetrieveClientId()); - if (!cloud_policy_store_->has_policy()) { - return; + if (cloud_policy_store_->has_policy()) { + signals.set_obfuscated_customer_id( + cloud_policy_store_->policy()->obfuscated_customer_id()); } - signals.set_obfuscated_customer_id( - cloud_policy_store_->policy()->obfuscated_customer_id()); + + enterprise_signals::DeviceInfo device_info = device_info_fetcher_->Fetch(); + + signals.set_serial_number(device_info.serial_number); + + absl::optional<bool> is_disk_encrypted = + enterprise_signals::SettingValueToBool(device_info.disk_encrypted); + if (is_disk_encrypted.has_value()) { + signals.set_is_disk_encrypted(is_disk_encrypted.value()); + } } } // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.h b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.h index 05871f3e..b82b5a0 100644 --- a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.h +++ b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.h
@@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_SIGNALS_DECORATORS_BROWSER_BROWSER_SIGNALS_DECORATOR_H_ #define CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_SIGNALS_DECORATORS_BROWSER_BROWSER_SIGNALS_DECORATOR_H_ +#include <memory> + #include "chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/signals_decorator.h" namespace policy { @@ -12,13 +14,19 @@ class CloudPolicyStore; } // namespace policy +namespace enterprise_signals { +class DeviceInfoFetcher; +} // namespace enterprise_signals + namespace enterprise_connectors { // Definition of the SignalsDecorator common to all Chrome browser platforms. class BrowserSignalsDecorator : public SignalsDecorator { public: BrowserSignalsDecorator(policy::BrowserDMTokenStorage* dm_token_storage, - policy::CloudPolicyStore* cloud_policy_store); + policy::CloudPolicyStore* cloud_policy_store, + std::unique_ptr<enterprise_signals::DeviceInfoFetcher> + device_info_fetcher); ~BrowserSignalsDecorator() override; // SignalsDecorator: @@ -27,6 +35,7 @@ private: policy::BrowserDMTokenStorage* const dm_token_storage_; policy::CloudPolicyStore* const cloud_policy_store_; + std::unique_ptr<enterprise_signals::DeviceInfoFetcher> device_info_fetcher_; }; } // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator_unittest.cc b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator_unittest.cc index 1e06cf6..2e10ee8c 100644 --- a/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator_unittest.cc +++ b/chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.h" +#include "chrome/browser/enterprise/signals/device_info_fetcher.h" #include "components/enterprise/browser/controller/fake_browser_dm_token_storage.h" #include "components/policy/core/common/cloud/mock_cloud_policy_store.h" #include "components/policy/proto/device_management_backend.pb.h" @@ -20,10 +21,14 @@ } // namespace class BrowserSignalsDecoratorTest : public testing::Test { - public: + protected: void SetUp() override { fake_dm_token_storage_.SetClientId(kFakeDeviceId); - decorator_.emplace(&fake_dm_token_storage_, &mock_cloud_policy_store_); + auto stub_device_info_fetcher = + enterprise_signals::DeviceInfoFetcher::CreateStubInstanceForTesting(); + stub_device_info_fetcher_ = stub_device_info_fetcher.get(); + decorator_.emplace(&fake_dm_token_storage_, &mock_cloud_policy_store_, + std::move(stub_device_info_fetcher)); } void SetFakeCustomerId() { @@ -32,9 +37,15 @@ kFakeCustomerId); } - protected: + void ValidateStaticSignals(const DeviceTrustSignals& signals) { + EXPECT_EQ(signals.device_id(), kFakeDeviceId); + EXPECT_EQ(signals.serial_number(), "twirlchange"); + EXPECT_EQ(signals.is_disk_encrypted(), false); + } + policy::FakeBrowserDMTokenStorage fake_dm_token_storage_; policy::MockCloudPolicyStore mock_cloud_policy_store_; + enterprise_signals::DeviceInfoFetcher* stub_device_info_fetcher_; absl::optional<BrowserSignalsDecorator> decorator_; }; @@ -44,7 +55,7 @@ DeviceTrustSignals signals; decorator_->Decorate(signals); - EXPECT_EQ(kFakeDeviceId, signals.device_id()); + ValidateStaticSignals(signals); EXPECT_EQ(kFakeCustomerId, signals.obfuscated_customer_id()); } @@ -52,7 +63,7 @@ DeviceTrustSignals signals; decorator_->Decorate(signals); - EXPECT_EQ(kFakeDeviceId, signals.device_id()); + ValidateStaticSignals(signals); EXPECT_FALSE(signals.has_obfuscated_customer_id()); }
diff --git a/chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc b/chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc index 4948acd..b0163b3 100644 --- a/chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc +++ b/chrome/browser/enterprise/connectors/device_trust/signals/signals_service_factory.cc
@@ -14,6 +14,7 @@ #include "base/check.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/device_trust/signals/decorators/browser/browser_signals_decorator.h" +#include "chrome/browser/enterprise/signals/device_info_fetcher.h" #include "chrome/browser/policy/chrome_browser_policy_connector.h" #include "components/enterprise/browser/controller/browser_dm_token_storage.h" #include "components/policy/core/common/cloud/machine_level_user_cloud_policy_manager.h" @@ -35,7 +36,8 @@ decorators.push_back(std::make_unique<BrowserSignalsDecorator>( policy::BrowserDMTokenStorage::Get(), browser_policy_connector->machine_level_user_cloud_policy_manager() - ->store())); + ->store(), + enterprise_signals::DeviceInfoFetcher::CreateInstance())); #endif // defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) return std::make_unique<SignalsServiceImpl>(std::move(decorators));
diff --git a/chrome/browser/enterprise/signals/device_info_fetcher.cc b/chrome/browser/enterprise/signals/device_info_fetcher.cc index cdeeb11..4d8f3cd 100644 --- a/chrome/browser/enterprise/signals/device_info_fetcher.cc +++ b/chrome/browser/enterprise/signals/device_info_fetcher.cc
@@ -18,6 +18,10 @@ namespace { +// When true, will force DeviceInfoFetcher::CreateInstance to return a stubbed +// instance. Used for testing. +bool force_stub_for_testing = false; + // Stub implementation of DeviceInfoFetcher. class StubDeviceFetcher : public DeviceInfoFetcher { public: @@ -55,6 +59,10 @@ // static std::unique_ptr<DeviceInfoFetcher> DeviceInfoFetcher::CreateInstance() { + if (force_stub_for_testing) { + return std::make_unique<StubDeviceFetcher>(); + } + // TODO(pastarmovj): Instead of the if-defs implement the CreateInstance // function in the platform specific classes. #if defined(OS_MAC) @@ -74,4 +82,9 @@ return std::make_unique<StubDeviceFetcher>(); } +// static +void DeviceInfoFetcher::SetForceStubForTesting(bool should_force) { + force_stub_for_testing = should_force; +} + } // namespace enterprise_signals
diff --git a/chrome/browser/enterprise/signals/device_info_fetcher.h b/chrome/browser/enterprise/signals/device_info_fetcher.h index 0ff5c9ca..7359bac 100644 --- a/chrome/browser/enterprise/signals/device_info_fetcher.h +++ b/chrome/browser/enterprise/signals/device_info_fetcher.h
@@ -51,6 +51,10 @@ // the platform. static std::unique_ptr<DeviceInfoFetcher> CreateStubInstanceForTesting(); + // Sets a value controlling whether DeviceInfoFetcher::CreateInstance should + // return a stubbed instance. Used for testing. + static void SetForceStubForTesting(bool should_force); + // Fetches the device information for the current platform. virtual DeviceInfo Fetch() = 0; };
diff --git a/chrome/browser/enterprise/signals/signals_common.cc b/chrome/browser/enterprise/signals/signals_common.cc new file mode 100644 index 0000000..24edb11 --- /dev/null +++ b/chrome/browser/enterprise/signals/signals_common.cc
@@ -0,0 +1,21 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/enterprise/signals/signals_common.h" + +namespace enterprise_signals { + +absl::optional<bool> SettingValueToBool(SettingValue setting_value) { + switch (setting_value) { + case SettingValue::ENABLED: + return true; + case SettingValue::DISABLED: + return false; + case SettingValue::NONE: + case SettingValue::UNKNOWN: + return absl::nullopt; + } +} + +} // namespace enterprise_signals
diff --git a/chrome/browser/enterprise/signals/signals_common.h b/chrome/browser/enterprise/signals/signals_common.h index adc2cf8..c866698 100644 --- a/chrome/browser/enterprise/signals/signals_common.h +++ b/chrome/browser/enterprise/signals/signals_common.h
@@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_ENTERPRISE_SIGNALS_SIGNALS_COMMON_H_ #define CHROME_BROWSER_ENTERPRISE_SIGNALS_SIGNALS_COMMON_H_ +#include "third_party/abseil-cpp/absl/types/optional.h" + namespace enterprise_signals { enum class SettingValue { @@ -14,6 +16,11 @@ ENABLED, }; +// Converts |setting_value| to an optional boolean value. ENABLED and DISABLED +// will be converted to true and false respectively. Other values will be +// treated as missing, and nullopt will be returned instead. +absl::optional<bool> SettingValueToBool(SettingValue setting_value); + } // namespace enterprise_signals #endif // CHROME_BROWSER_ENTERPRISE_SIGNALS_SIGNALS_COMMON_H_
diff --git a/chrome/browser/extensions/active_tab_apitest.cc b/chrome/browser/extensions/active_tab_apitest.cc index 6f0eeb7..eaaf50d 100644 --- a/chrome/browser/extensions/active_tab_apitest.cc +++ b/chrome/browser/extensions/active_tab_apitest.cc
@@ -43,6 +43,9 @@ public: ExtensionActiveTabTest() = default; + ExtensionActiveTabTest(const ExtensionActiveTabTest&) = delete; + ExtensionActiveTabTest& operator=(const ExtensionActiveTabTest&) = delete; + // ExtensionApiTest override: void SetUpOnMainThread() override { ExtensionApiTest::SetUpOnMainThread(); @@ -50,9 +53,6 @@ // Map all hosts to localhost. host_resolver()->AddRule("*", "127.0.0.1"); } - - private: - DISALLOW_COPY_AND_ASSIGN(ExtensionActiveTabTest); }; IN_PROC_BROWSER_TEST_F(ExtensionActiveTabTest, ActiveTab) {
diff --git a/chrome/browser/extensions/active_tab_unittest.cc b/chrome/browser/extensions/active_tab_unittest.cc index 0220049..27de685 100644 --- a/chrome/browser/extensions/active_tab_unittest.cc +++ b/chrome/browser/extensions/active_tab_unittest.cc
@@ -660,10 +660,10 @@ public: ActiveTabWithServiceTest() {} - void SetUp() override; + ActiveTabWithServiceTest(const ActiveTabWithServiceTest&) = delete; + ActiveTabWithServiceTest& operator=(const ActiveTabWithServiceTest&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(ActiveTabWithServiceTest); + void SetUp() override; }; void ActiveTabWithServiceTest::SetUp() {
diff --git a/chrome/browser/extensions/activity_log/activity_actions.h b/chrome/browser/extensions/activity_log/activity_actions.h index 900b19b..72efd30 100644 --- a/chrome/browser/extensions/activity_log/activity_actions.h +++ b/chrome/browser/extensions/activity_log/activity_actions.h
@@ -54,6 +54,9 @@ const std::string& api_name, int64_t action_id = -1); + Action(const Action&) = delete; + Action& operator=(const Action&) = delete; + // Creates and returns a mutable copy of an Action. scoped_refptr<Action> Clone() const; @@ -147,8 +150,6 @@ std::unique_ptr<base::DictionaryValue> other_; int count_; int64_t action_id_; - - DISALLOW_COPY_AND_ASSIGN(Action); }; // A comparator for Action class objects; this performs a lexicographic
diff --git a/chrome/browser/extensions/activity_log/activity_database.h b/chrome/browser/extensions/activity_log/activity_database.h index 046e31c..e0c7be7 100644 --- a/chrome/browser/extensions/activity_log/activity_database.h +++ b/chrome/browser/extensions/activity_log/activity_database.h
@@ -99,6 +99,9 @@ // reads/writes. explicit ActivityDatabase(Delegate* delegate); + ActivityDatabase(const ActivityDatabase&) = delete; + ActivityDatabase& operator=(const ActivityDatabase&) = delete; + // Opens the DB. This invokes OnDatabaseInit in the delegate to create or // update the database schema if needed. void Init(const base::FilePath& db_name); @@ -190,7 +193,6 @@ FRIEND_TEST_ALL_PREFIXES(ActivityDatabaseTest, BatchModeOff); FRIEND_TEST_ALL_PREFIXES(ActivityDatabaseTest, BatchModeOn); FRIEND_TEST_ALL_PREFIXES(ActivityDatabaseTest, BatchModeFlush); - DISALLOW_COPY_AND_ASSIGN(ActivityDatabase); }; } // namespace extensions
diff --git a/chrome/browser/extensions/activity_log/activity_log.cc b/chrome/browser/extensions/activity_log/activity_log.cc index 4accc05..4a69a43 100644 --- a/chrome/browser/extensions/activity_log/activity_log.cc +++ b/chrome/browser/extensions/activity_log/activity_log.cc
@@ -168,6 +168,9 @@ // structure. It inserts all data into a map on first lookup. class ApiInfoDatabase { public: + ApiInfoDatabase(const ApiInfoDatabase&) = delete; + ApiInfoDatabase& operator=(const ApiInfoDatabase&) = delete; + static ApiInfoDatabase* GetInstance() { return base::Singleton<ApiInfoDatabase>::get(); } @@ -199,7 +202,6 @@ std::map<std::string, const ApiInfo*> api_database_; friend struct base::DefaultSingletonTraits<ApiInfoDatabase>; - DISALLOW_COPY_AND_ASSIGN(ApiInfoDatabase); }; // Gets the URL for a given tab ID. Helper method for ExtractUrls. Returns
diff --git a/chrome/browser/extensions/activity_log/activity_log.h b/chrome/browser/extensions/activity_log/activity_log.h index fb514d7..1cc0892 100644 --- a/chrome/browser/extensions/activity_log/activity_log.h +++ b/chrome/browser/extensions/activity_log/activity_log.h
@@ -54,6 +54,9 @@ virtual void OnExtensionActivity(scoped_refptr<Action> activity) = 0; }; + ActivityLog(const ActivityLog&) = delete; + ActivityLog& operator=(const ActivityLog&) = delete; + static BrowserContextKeyedAPIFactory<ActivityLog>* GetFactoryInstance(); // ActivityLog is a KeyedService, so don't instantiate it with @@ -240,7 +243,6 @@ FRIEND_TEST_ALL_PREFIXES(ActivityLogEnabledTest, NoSwitch); FRIEND_TEST_ALL_PREFIXES(ActivityLogEnabledTest, PrefSwitch); FRIEND_TEST_ALL_PREFIXES(ActivityLogEnabledTest, WatchdogSwitch); - DISALLOW_COPY_AND_ASSIGN(ActivityLog); }; template <>
diff --git a/chrome/browser/extensions/activity_log/activity_log_policy.h b/chrome/browser/extensions/activity_log/activity_log_policy.h index de18673..47696a8 100644 --- a/chrome/browser/extensions/activity_log/activity_log_policy.h +++ b/chrome/browser/extensions/activity_log/activity_log_policy.h
@@ -70,6 +70,9 @@ // cleaner to pass thread_id as a param of ReadData directly. explicit ActivityLogPolicy(Profile* profile); + ActivityLogPolicy(const ActivityLogPolicy&) = delete; + ActivityLogPolicy& operator=(const ActivityLogPolicy&) = delete; + // Instead of a public destructor, ActivityLogPolicy objects have a Close() // method which will cause the object to be deleted (but may do so on another // thread or in a deferred fashion). @@ -89,6 +92,10 @@ // these methods more convenient from within a policy, but they are public. class Util { public: + Util() = delete; + Util(const Util&) = delete; + Util& operator=(const Util&) = delete; + // A collection of API calls, used to specify allowlists for argument // filtering. typedef std::set<std::pair<Action::ActionType, std::string> > ApiSet; @@ -120,9 +127,6 @@ int days_ago, int64_t* early_bound, int64_t* late_bound); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(Util); }; protected: @@ -140,8 +144,6 @@ // to determine the date for "today" when when interpreting date ranges to // fetch. This has no effect on batching of writes to the database. base::Clock* testing_clock_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(ActivityLogPolicy); }; // A subclass of ActivityLogPolicy which is designed for policies that use
diff --git a/chrome/browser/extensions/all_urls_apitest.cc b/chrome/browser/extensions/all_urls_apitest.cc index 31ccc5d5..1ff33f4 100644 --- a/chrome/browser/extensions/all_urls_apitest.cc +++ b/chrome/browser/extensions/all_urls_apitest.cc
@@ -29,6 +29,10 @@ } // namespace class AllUrlsApiTest : public ExtensionApiTest { + public: + AllUrlsApiTest(const AllUrlsApiTest&) = delete; + AllUrlsApiTest& operator=(const AllUrlsApiTest&) = delete; + protected: AllUrlsApiTest() {} ~AllUrlsApiTest() override {} @@ -76,8 +80,6 @@ scoped_refptr<const Extension> content_script_; scoped_refptr<const Extension> execute_script_; - - DISALLOW_COPY_AND_ASSIGN(AllUrlsApiTest); }; IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, AllowlistedExtension) {
diff --git a/chrome/browser/extensions/api/chrome_extensions_api_client_unittest.cc b/chrome/browser/extensions/api/chrome_extensions_api_client_unittest.cc index 3e089409..e5b923b2 100644 --- a/chrome/browser/extensions/api/chrome_extensions_api_client_unittest.cc +++ b/chrome/browser/extensions/api/chrome_extensions_api_client_unittest.cc
@@ -19,9 +19,12 @@ public: ChromeExtensionsAPIClientTest() = default; + ChromeExtensionsAPIClientTest(const ChromeExtensionsAPIClientTest&) = delete; + ChromeExtensionsAPIClientTest& operator=( + const ChromeExtensionsAPIClientTest&) = delete; + private: content::BrowserTaskEnvironment task_environment_; - DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsAPIClientTest); }; TEST_F(ChromeExtensionsAPIClientTest, ShouldHideResponseHeader) {
diff --git a/chrome/browser/extensions/api/commands/command_service.h b/chrome/browser/extensions/api/commands/command_service.h index 161b2e30..620234b 100644 --- a/chrome/browser/extensions/api/commands/command_service.h +++ b/chrome/browser/extensions/api/commands/command_service.h
@@ -91,6 +91,10 @@ // Constructs a CommandService object for the given profile. explicit CommandService(content::BrowserContext* context); + + CommandService(const CommandService&) = delete; + CommandService& operator=(const CommandService&) = delete; + ~CommandService() override; // BrowserContextKeyedAPI implementation. @@ -225,8 +229,6 @@ extension_registry_observation_{this}; base::ObserverList<Observer>::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(CommandService); }; template <>
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_store.h b/chrome/browser/extensions/api/content_settings/content_settings_store.h index d55cf77c..714eb5d 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_store.h +++ b/chrome/browser/extensions/api/content_settings/content_settings_store.h
@@ -52,6 +52,9 @@ ContentSettingsStore(); + ContentSettingsStore(const ContentSettingsStore&) = delete; + ContentSettingsStore& operator=(const ContentSettingsStore&) = delete; + // ////////////////////////////////////////////////////////////////////////// std::unique_ptr<content_settings::RuleIterator> GetRuleIterator( @@ -148,8 +151,6 @@ base::ObserverList<Observer, false>::Unchecked observers_; mutable base::Lock lock_; - - DISALLOW_COPY_AND_ASSIGN(ContentSettingsStore); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc b/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc index 7368656..0d209fe 100644 --- a/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc +++ b/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc
@@ -125,6 +125,11 @@ ExtensionContextMenuVisibilityApiTest() : top_level_model_(nullptr), menu_(nullptr), top_level_index_(-1) {} + ExtensionContextMenuVisibilityApiTest( + const ExtensionContextMenuVisibilityApiTest&) = delete; + ExtensionContextMenuVisibilityApiTest& operator=( + const ExtensionContextMenuVisibilityApiTest&) = delete; + void SetUpTestExtension() { extension_ = LoadExtension( test_data_dir_.AppendASCII("context_menus/item_visibility/")); @@ -216,8 +221,6 @@ const Extension* extension_; std::unique_ptr<TestRenderViewContextMenu> menu_; int top_level_index_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuVisibilityApiTest); }; // Tests showing a single visible menu item in the top-level menu model, which
diff --git a/chrome/browser/extensions/api/crash_report_private/crash_report_private_api.h b/chrome/browser/extensions/api/crash_report_private/crash_report_private_api.h index 4e52219..6b237288 100644 --- a/chrome/browser/extensions/api/crash_report_private/crash_report_private_api.h +++ b/chrome/browser/extensions/api/crash_report_private/crash_report_private_api.h
@@ -15,6 +15,12 @@ class CrashReportPrivateReportErrorFunction : public ExtensionFunction { public: CrashReportPrivateReportErrorFunction(); + + CrashReportPrivateReportErrorFunction( + const CrashReportPrivateReportErrorFunction&) = delete; + CrashReportPrivateReportErrorFunction& operator=( + const CrashReportPrivateReportErrorFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("crashReportPrivate.reportError", CRASHREPORTPRIVATE_REPORTERROR) @@ -24,8 +30,6 @@ private: void OnReportComplete(); - - DISALLOW_COPY_AND_ASSIGN(CrashReportPrivateReportErrorFunction); }; } // namespace api
diff --git a/chrome/browser/extensions/api/dashboard_private/dashboard_private_api.h b/chrome/browser/extensions/api/dashboard_private/dashboard_private_api.h index a41579a..9afbd7e 100644 --- a/chrome/browser/extensions/api/dashboard_private/dashboard_private_api.h +++ b/chrome/browser/extensions/api/dashboard_private/dashboard_private_api.h
@@ -32,6 +32,13 @@ DashboardPrivateShowPermissionPromptForDelegatedInstallFunction(); + DashboardPrivateShowPermissionPromptForDelegatedInstallFunction( + const DashboardPrivateShowPermissionPromptForDelegatedInstallFunction&) = + delete; + DashboardPrivateShowPermissionPromptForDelegatedInstallFunction& operator=( + const DashboardPrivateShowPermissionPromptForDelegatedInstallFunction&) = + delete; + private: using Params = api::dashboard_private::ShowPermissionPromptForDelegatedInstall::Params; @@ -65,9 +72,6 @@ scoped_refptr<Extension> dummy_extension_; std::unique_ptr<ExtensionInstallPrompt> install_prompt_; - - DISALLOW_COPY_AND_ASSIGN( - DashboardPrivateShowPermissionPromptForDelegatedInstallFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h index 22d9e6e..a510286 100644 --- a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h +++ b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h
@@ -59,6 +59,10 @@ RulesCacheDelegate* cache_delegate, PredicateEvaluatorsFactory evaluators_factory); + ChromeContentRulesRegistry(const ChromeContentRulesRegistry&) = delete; + ChromeContentRulesRegistry& operator=(const ChromeContentRulesRegistry&) = + delete; + // ContentRulesRegistry: void MonitorWebContentsForRuleEvaluation( content::WebContents* contents) override; @@ -174,8 +178,6 @@ // Contains WebContents which require rule evaluation. Only used while // |evaluation_disposition_| is DEFER. std::set<content::WebContents*> evaluation_pending_; - - DISALLOW_COPY_AND_ASSIGN(ChromeContentRulesRegistry); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry_unittest.cc b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry_unittest.cc index 67ad5d8..4c7b848 100644 --- a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry_unittest.cc +++ b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry_unittest.cc
@@ -29,14 +29,15 @@ : evaluator_(evaluator) { } + TestPredicate(const TestPredicate&) = delete; + TestPredicate& operator=(const TestPredicate&) = delete; + ContentPredicateEvaluator* GetEvaluator() const override { return evaluator_; } private: ContentPredicateEvaluator* evaluator_; - - DISALLOW_COPY_AND_ASSIGN(TestPredicate); }; class TestPredicateEvaluator : public ContentPredicateEvaluator { @@ -47,6 +48,9 @@ next_evaluation_result_(false) { } + TestPredicateEvaluator(const TestPredicateEvaluator&) = delete; + TestPredicateEvaluator& operator=(const TestPredicateEvaluator&) = delete; + std::string GetPredicateApiAttributeName() const override { return "test_predicate"; } @@ -115,8 +119,6 @@ ContentPredicateEvaluator::Delegate* delegate_; content::WebContents* contents_for_next_operation_evaluation_; mutable bool next_evaluation_result_; - - DISALLOW_COPY_AND_ASSIGN(TestPredicateEvaluator); }; // Create the test evaluator and set |evaluator| to its pointer. @@ -135,6 +137,11 @@ public: DeclarativeChromeContentRulesRegistryTest() {} + DeclarativeChromeContentRulesRegistryTest( + const DeclarativeChromeContentRulesRegistryTest&) = delete; + DeclarativeChromeContentRulesRegistryTest& operator=( + const DeclarativeChromeContentRulesRegistryTest&) = delete; + protected: TestExtensionEnvironment* env() { return &env_; } @@ -143,8 +150,6 @@ // Must come after |env_| so only one UI MessageLoop is created. content::RenderViewHostTestEnabler rvh_enabler_; - - DISALLOW_COPY_AND_ASSIGN(DeclarativeChromeContentRulesRegistryTest); }; TEST_F(DeclarativeChromeContentRulesRegistryTest, ActiveRulesDoesntGrow) {
diff --git a/chrome/browser/extensions/api/declarative_content/content_condition_unittest.cc b/chrome/browser/extensions/api/declarative_content/content_condition_unittest.cc index 62aa4c6..22f9d87 100644 --- a/chrome/browser/extensions/api/declarative_content/content_condition_unittest.cc +++ b/chrome/browser/extensions/api/declarative_content/content_condition_unittest.cc
@@ -21,12 +21,12 @@ public: TestPredicate() {} + TestPredicate(const TestPredicate&) = delete; + TestPredicate& operator=(const TestPredicate&) = delete; + ContentPredicateEvaluator* GetEvaluator() const override { return nullptr; } - - private: - DISALLOW_COPY_AND_ASSIGN(TestPredicate); }; class TestPredicateFactoryGeneratingError : public ContentPredicateFactory { @@ -35,6 +35,11 @@ : error_(error) { } + TestPredicateFactoryGeneratingError( + const TestPredicateFactoryGeneratingError&) = delete; + TestPredicateFactoryGeneratingError& operator=( + const TestPredicateFactoryGeneratingError&) = delete; + std::unique_ptr<const ContentPredicate> CreatePredicate( const Extension* extension, const base::Value& value, @@ -45,14 +50,17 @@ private: const std::string error_; - - DISALLOW_COPY_AND_ASSIGN(TestPredicateFactoryGeneratingError); }; class TestPredicateFactoryGeneratingPredicate : public ContentPredicateFactory { public: TestPredicateFactoryGeneratingPredicate() {} + TestPredicateFactoryGeneratingPredicate( + const TestPredicateFactoryGeneratingPredicate&) = delete; + TestPredicateFactoryGeneratingPredicate& operator=( + const TestPredicateFactoryGeneratingPredicate&) = delete; + std::unique_ptr<const ContentPredicate> CreatePredicate( const Extension* extension, const base::Value& value, @@ -68,8 +76,6 @@ private: std::vector<const ContentPredicate*> created_predicates_; - - DISALLOW_COPY_AND_ASSIGN(TestPredicateFactoryGeneratingPredicate); }; } // namespace
diff --git a/chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h b/chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h index 4921610..493cfea 100644 --- a/chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h +++ b/chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h
@@ -119,6 +119,9 @@ // updated, and determine whether it should manage predicates for a context. class ContentPredicateEvaluator::Delegate { public: + Delegate(const Delegate&) = delete; + Delegate& operator=(const Delegate&) = delete; + // Notifies that predicate evaluation state has been updated for // |contents|. This must be called whenever the URL or page state changes, // even if the value of the predicate evaluation itself doesn't change. @@ -134,9 +137,6 @@ protected: Delegate(); virtual ~Delegate(); - - private: - DISALLOW_COPY_AND_ASSIGN(Delegate); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc index 2e15c2a5..ff30307 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
@@ -121,6 +121,10 @@ public: DeclarativeContentApiTest() {} + DeclarativeContentApiTest(const DeclarativeContentApiTest&) = delete; + DeclarativeContentApiTest& operator=(const DeclarativeContentApiTest&) = + delete; + protected: enum IncognitoMode { SPANNING, SPLIT }; @@ -134,9 +138,6 @@ void CheckBookmarkEvents(bool is_bookmarked); TestExtensionDir ext_dir_; - - private: - DISALLOW_COPY_AND_ASSIGN(DeclarativeContentApiTest); }; void DeclarativeContentApiTest::CheckIncognito(IncognitoMode mode,
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc index 0158fb6..60391d36 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc
@@ -119,6 +119,12 @@ class DeclarativeContentCssConditionTrackerTest : public DeclarativeContentConditionTrackerTest { + public: + DeclarativeContentCssConditionTrackerTest( + const DeclarativeContentCssConditionTrackerTest&) = delete; + DeclarativeContentCssConditionTrackerTest& operator=( + const DeclarativeContentCssConditionTrackerTest&) = delete; + protected: DeclarativeContentCssConditionTrackerTest() : tracker_(&delegate_) {} @@ -141,6 +147,9 @@ public: Delegate() : evaluation_requests_(0) {} + Delegate(const Delegate&) = delete; + Delegate& operator=(const Delegate&) = delete; + int evaluation_requests() { return evaluation_requests_; } // ContentPredicateEvaluator::Delegate: @@ -155,8 +164,6 @@ private: int evaluation_requests_; - - DISALLOW_COPY_AND_ASSIGN(Delegate); }; // Creates a predicate with appropriate expectations of success. @@ -221,8 +228,6 @@ EXPECT_EQ("", error); ASSERT_TRUE(*predicate); } - - DISALLOW_COPY_AND_ASSIGN(DeclarativeContentCssConditionTrackerTest); }; TEST(DeclarativeContentCssPredicateTest, WrongCssDatatype) {
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc index 8c62bcf..6940286 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc
@@ -68,11 +68,20 @@ class DeclarativeContentIsBookmarkedConditionTrackerTest : public DeclarativeContentConditionTrackerTest { + public: + DeclarativeContentIsBookmarkedConditionTrackerTest( + const DeclarativeContentIsBookmarkedConditionTrackerTest&) = delete; + DeclarativeContentIsBookmarkedConditionTrackerTest& operator=( + const DeclarativeContentIsBookmarkedConditionTrackerTest&) = delete; + protected: class Delegate : public ContentPredicateEvaluator::Delegate { public: Delegate() {} + Delegate(const Delegate&) = delete; + Delegate& operator=(const Delegate&) = delete; + std::set<content::WebContents*>& evaluation_requests() { return evaluation_requests_; } @@ -90,8 +99,6 @@ private: std::set<content::WebContents*> evaluation_requests_; - - DISALLOW_COPY_AND_ASSIGN(Delegate); }; DeclarativeContentIsBookmarkedConditionTrackerTest() { @@ -153,9 +160,6 @@ is_bookmarked_predicate_; std::unique_ptr<DeclarativeContentIsBookmarkedPredicate> is_not_bookmarked_predicate_; - - private: - DISALLOW_COPY_AND_ASSIGN(DeclarativeContentIsBookmarkedConditionTrackerTest); };
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker_unittest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker_unittest.cc index 84fab1a..9d44a87 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker_unittest.cc +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker_unittest.cc
@@ -27,11 +27,20 @@ class DeclarativeContentPageUrlConditionTrackerTest : public DeclarativeContentConditionTrackerTest { + public: + DeclarativeContentPageUrlConditionTrackerTest( + const DeclarativeContentPageUrlConditionTrackerTest&) = delete; + DeclarativeContentPageUrlConditionTrackerTest& operator=( + const DeclarativeContentPageUrlConditionTrackerTest&) = delete; + protected: class Delegate : public ContentPredicateEvaluator::Delegate { public: Delegate() {} + Delegate(const Delegate&) = delete; + Delegate& operator=(const Delegate&) = delete; + std::set<content::WebContents*>& evaluation_requests() { return evaluation_requests_; } @@ -49,8 +58,6 @@ private: std::set<content::WebContents*> evaluation_requests_; - - DISALLOW_COPY_AND_ASSIGN(Delegate); }; DeclarativeContentPageUrlConditionTrackerTest() @@ -84,8 +91,6 @@ EXPECT_EQ("", error); ASSERT_TRUE(*predicate); } - - DISALLOW_COPY_AND_ASSIGN(DeclarativeContentPageUrlConditionTrackerTest); }; TEST(DeclarativeContentPageUrlPredicateTest, WrongPageUrlDatatype) {
diff --git a/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc b/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc index 3acdc4ca..9296d983 100644 --- a/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc +++ b/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc
@@ -186,6 +186,11 @@ net::test_server::RegisterDefaultHandlers(embedded_test_server()); } + DeclarativeNetRequestBrowserTest(const DeclarativeNetRequestBrowserTest&) = + delete; + DeclarativeNetRequestBrowserTest& operator=( + const DeclarativeNetRequestBrowserTest&) = delete; + // Returns the path of the files served by the EmbeddedTestServer. static base::FilePath GetHttpServerPath() { base::FilePath test_root_path; @@ -813,8 +818,6 @@ // Path to the PEM file for the last installed packed extension. base::FilePath last_pem_path_; - - DISALLOW_COPY_AND_ASSIGN(DeclarativeNetRequestBrowserTest); }; using DeclarativeNetRequestBrowserTest_Packed = @@ -5042,6 +5045,11 @@ public: DeclarativeNetRequestHostPermissionsBrowserTest() {} + DeclarativeNetRequestHostPermissionsBrowserTest( + const DeclarativeNetRequestHostPermissionsBrowserTest&) = delete; + DeclarativeNetRequestHostPermissionsBrowserTest& operator=( + const DeclarativeNetRequestHostPermissionsBrowserTest&) = delete; + protected: struct FrameRedirectResult { std::string child_frame_name; @@ -5085,9 +5093,6 @@ std::string GetMatchPatternForDomain(const std::string& domain) const { return "*://*." + domain + ".com/*"; } - - private: - DISALLOW_COPY_AND_ASSIGN(DeclarativeNetRequestHostPermissionsBrowserTest); }; IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestHostPermissionsBrowserTest, @@ -5132,6 +5137,11 @@ public: DeclarativeNetRequestResourceTypeBrowserTest() {} + DeclarativeNetRequestResourceTypeBrowserTest( + const DeclarativeNetRequestResourceTypeBrowserTest&) = delete; + DeclarativeNetRequestResourceTypeBrowserTest& operator=( + const DeclarativeNetRequestResourceTypeBrowserTest&) = delete; + protected: // TODO(crbug.com/696822): Add tests for "object", "ping", "other", "font", // "csp_report". @@ -5259,9 +5269,6 @@ } LoadExtensionWithRules(rules); } - - private: - DISALLOW_COPY_AND_ASSIGN(DeclarativeNetRequestResourceTypeBrowserTest); }; // These are split into two tests to prevent a timeout. See crbug.com/787957.
diff --git a/chrome/browser/extensions/api/declarative_net_request/dnr_test_base.h b/chrome/browser/extensions/api/declarative_net_request/dnr_test_base.h index 78e4a89..39af0b7 100644 --- a/chrome/browser/extensions/api/declarative_net_request/dnr_test_base.h +++ b/chrome/browser/extensions/api/declarative_net_request/dnr_test_base.h
@@ -23,15 +23,15 @@ public: DNRTestBase(); + DNRTestBase(const DNRTestBase&) = delete; + DNRTestBase& operator=(const DNRTestBase&) = delete; + // ExtensionServiceTestBase override. void SetUp() override; protected: // Returns an extension loader for the current ExtensionLoadType. std::unique_ptr<ChromeTestExtensionLoader> CreateExtensionLoader(); - - private: - DISALLOW_COPY_AND_ASSIGN(DNRTestBase); }; } // namespace declarative_net_request
diff --git a/chrome/browser/extensions/api/declarative_net_request/ruleset_manager_unittest.cc b/chrome/browser/extensions/api/declarative_net_request/ruleset_manager_unittest.cc index 912119e..440b6a4 100644 --- a/chrome/browser/extensions/api/declarative_net_request/ruleset_manager_unittest.cc +++ b/chrome/browser/extensions/api/declarative_net_request/ruleset_manager_unittest.cc
@@ -47,6 +47,9 @@ public: RulesetManagerTest() {} + RulesetManagerTest(const RulesetManagerTest&) = delete; + RulesetManagerTest& operator=(const RulesetManagerTest&) = delete; + void SetUp() override { DNRTestBase::SetUp(); manager_ = std::make_unique<RulesetManager>(browser_context()); @@ -151,8 +154,6 @@ private: scoped_refptr<const Extension> last_loaded_extension_; std::unique_ptr<RulesetManager> manager_; - - DISALLOW_COPY_AND_ASSIGN(RulesetManagerTest); }; // Tests that the RulesetManager handles multiple rulesets correctly.
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index 2ff54a4..f35f7e9d 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
@@ -277,6 +277,9 @@ content::WebContents* web_contents) : content::WebContentsObserver(web_contents), api_(api) {} + WebContentsTracker(const WebContentsTracker&) = delete; + WebContentsTracker& operator=(const WebContentsTracker&) = delete; + private: ~WebContentsTracker() override = default; @@ -287,8 +290,6 @@ } base::WeakPtr<DeveloperPrivateAPI> api_; - - DISALLOW_COPY_AND_ASSIGN(WebContentsTracker); }; DeveloperPrivateAPI::WebContentsData::WebContentsData() = default;
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.h b/chrome/browser/extensions/api/developer_private/developer_private_api.h index c2d0900..9b6ca4d 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.h +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.h
@@ -257,6 +257,10 @@ // Data specific to a given WebContents. struct WebContentsData { WebContentsData(); + + WebContentsData(const WebContentsData&) = delete; + WebContentsData& operator=(const WebContentsData&) = delete; + ~WebContentsData(); WebContentsData(WebContentsData&& other); @@ -273,8 +277,6 @@ // The last dragged path for the WebContents. base::FilePath dragged_path; - - DISALLOW_COPY_AND_ASSIGN(WebContentsData); }; friend class BrowserContextKeyedAPIFactory<DeveloperPrivateAPI>; @@ -344,6 +346,11 @@ DEVELOPERPRIVATE_GETITEMSINFO) DeveloperPrivateGetItemsInfoFunction(); + DeveloperPrivateGetItemsInfoFunction( + const DeveloperPrivateGetItemsInfoFunction&) = delete; + DeveloperPrivateGetItemsInfoFunction& operator=( + const DeveloperPrivateGetItemsInfoFunction&) = delete; + private: ~DeveloperPrivateGetItemsInfoFunction() override; ResponseAction Run() override; @@ -352,14 +359,18 @@ std::vector<api::developer_private::ExtensionInfo> infos); std::unique_ptr<ExtensionInfoGenerator> info_generator_; - - DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateGetItemsInfoFunction); }; class DeveloperPrivateGetExtensionsInfoFunction : public DeveloperPrivateAPIFunction { public: DeveloperPrivateGetExtensionsInfoFunction(); + + DeveloperPrivateGetExtensionsInfoFunction( + const DeveloperPrivateGetExtensionsInfoFunction&) = delete; + DeveloperPrivateGetExtensionsInfoFunction& operator=( + const DeveloperPrivateGetExtensionsInfoFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("developerPrivate.getExtensionsInfo", DEVELOPERPRIVATE_GETEXTENSIONSINFO) @@ -371,14 +382,18 @@ std::vector<api::developer_private::ExtensionInfo> infos); std::unique_ptr<ExtensionInfoGenerator> info_generator_; - - DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateGetExtensionsInfoFunction); }; class DeveloperPrivateGetExtensionInfoFunction : public DeveloperPrivateAPIFunction { public: DeveloperPrivateGetExtensionInfoFunction(); + + DeveloperPrivateGetExtensionInfoFunction( + const DeveloperPrivateGetExtensionInfoFunction&) = delete; + DeveloperPrivateGetExtensionInfoFunction& operator=( + const DeveloperPrivateGetExtensionInfoFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("developerPrivate.getExtensionInfo", DEVELOPERPRIVATE_GETEXTENSIONINFO) @@ -390,14 +405,18 @@ std::vector<api::developer_private::ExtensionInfo> infos); std::unique_ptr<ExtensionInfoGenerator> info_generator_; - - DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateGetExtensionInfoFunction); }; class DeveloperPrivateGetExtensionSizeFunction : public DeveloperPrivateAPIFunction { public: DeveloperPrivateGetExtensionSizeFunction(); + + DeveloperPrivateGetExtensionSizeFunction( + const DeveloperPrivateGetExtensionSizeFunction&) = delete; + DeveloperPrivateGetExtensionSizeFunction& operator=( + const DeveloperPrivateGetExtensionSizeFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("developerPrivate.getExtensionSize", DEVELOPERPRIVATE_GETEXTENSIONSIZE) @@ -406,8 +425,6 @@ ResponseAction Run() override; void OnSizeCalculated(const std::u16string& size); - - DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateGetExtensionSizeFunction); }; class DeveloperPrivateGetProfileConfigurationFunction @@ -451,6 +468,11 @@ DeveloperPrivateReloadFunction(); + DeveloperPrivateReloadFunction(const DeveloperPrivateReloadFunction&) = + delete; + DeveloperPrivateReloadFunction& operator=( + const DeveloperPrivateReloadFunction&) = delete; + // ExtensionRegistryObserver: void OnExtensionLoaded(content::BrowserContext* browser_context, const Extension* extension) override; @@ -484,8 +506,6 @@ registry_observation_{this}; base::ScopedObservation<LoadErrorReporter, LoadErrorReporter::Observer> error_reporter_observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateReloadFunction); }; class DeveloperPrivateShowPermissionsDialogFunction @@ -495,14 +515,17 @@ DEVELOPERPRIVATE_PERMISSIONS) DeveloperPrivateShowPermissionsDialogFunction(); + DeveloperPrivateShowPermissionsDialogFunction( + const DeveloperPrivateShowPermissionsDialogFunction&) = delete; + DeveloperPrivateShowPermissionsDialogFunction& operator=( + const DeveloperPrivateShowPermissionsDialogFunction&) = delete; + protected: // DeveloperPrivateAPIFunction: ~DeveloperPrivateShowPermissionsDialogFunction() override; ResponseAction Run() override; void Finish(); - - DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateShowPermissionsDialogFunction); }; class DeveloperPrivateChooseEntryFunction : public ExtensionFunction, @@ -559,13 +582,16 @@ DEVELOPERPRIVATE_INSTALLDROPPEDFILE) DeveloperPrivateInstallDroppedFileFunction(); + DeveloperPrivateInstallDroppedFileFunction( + const DeveloperPrivateInstallDroppedFileFunction&) = delete; + DeveloperPrivateInstallDroppedFileFunction& operator=( + const DeveloperPrivateInstallDroppedFileFunction&) = delete; + private: ~DeveloperPrivateInstallDroppedFileFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateInstallDroppedFileFunction); }; class DeveloperPrivateNotifyDragInstallInProgressFunction @@ -576,14 +602,17 @@ DeveloperPrivateNotifyDragInstallInProgressFunction(); + DeveloperPrivateNotifyDragInstallInProgressFunction( + const DeveloperPrivateNotifyDragInstallInProgressFunction&) = delete; + DeveloperPrivateNotifyDragInstallInProgressFunction& operator=( + const DeveloperPrivateNotifyDragInstallInProgressFunction&) = delete; + ResponseAction Run() override; static void SetDropPathForTesting(base::FilePath* file_path); private: ~DeveloperPrivateNotifyDragInstallInProgressFunction() override; - - DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateNotifyDragInstallInProgressFunction); }; class DeveloperPrivateChoosePathFunction @@ -802,14 +831,17 @@ DEVELOPERPRIVATE_ADDHOSTPERMISSION) DeveloperPrivateAddHostPermissionFunction(); + DeveloperPrivateAddHostPermissionFunction( + const DeveloperPrivateAddHostPermissionFunction&) = delete; + DeveloperPrivateAddHostPermissionFunction& operator=( + const DeveloperPrivateAddHostPermissionFunction&) = delete; + private: ~DeveloperPrivateAddHostPermissionFunction() override; ResponseAction Run() override; void OnRuntimePermissionsGranted(); - - DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateAddHostPermissionFunction); }; class DeveloperPrivateRemoveHostPermissionFunction @@ -819,14 +851,17 @@ DEVELOPERPRIVATE_REMOVEHOSTPERMISSION) DeveloperPrivateRemoveHostPermissionFunction(); + DeveloperPrivateRemoveHostPermissionFunction( + const DeveloperPrivateRemoveHostPermissionFunction&) = delete; + DeveloperPrivateRemoveHostPermissionFunction& operator=( + const DeveloperPrivateRemoveHostPermissionFunction&) = delete; + private: ~DeveloperPrivateRemoveHostPermissionFunction() override; ResponseAction Run() override; void OnRuntimePermissionsRevoked(); - - DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateRemoveHostPermissionFunction); }; } // namespace api
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc b/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc index 84edcae..482f466 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc
@@ -116,6 +116,11 @@ } // namespace class DeveloperPrivateApiUnitTest : public ExtensionServiceTestWithInstall { + public: + DeveloperPrivateApiUnitTest(const DeveloperPrivateApiUnitTest&) = delete; + DeveloperPrivateApiUnitTest& operator=(const DeveloperPrivateApiUnitTest&) = + delete; + protected: DeveloperPrivateApiUnitTest() {} ~DeveloperPrivateApiUnitTest() override {} @@ -179,8 +184,6 @@ std::unique_ptr<Browser> browser_; std::vector<std::unique_ptr<TestExtensionDir>> test_extension_dirs_; - - DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateApiUnitTest); }; bool DeveloperPrivateApiUnitTest::RunFunction( @@ -838,6 +841,10 @@ observation_.Observe(registry); } + UnloadedRegistryObserver(const UnloadedRegistryObserver&) = delete; + UnloadedRegistryObserver& operator=(const UnloadedRegistryObserver&) = + delete; + void OnExtensionUnloaded(content::BrowserContext* browser_context, const Extension* extension, UnloadedExtensionReason reason) override { @@ -852,8 +859,6 @@ base::FilePath expected_path_; base::ScopedObservation<ExtensionRegistry, ExtensionRegistryObserver> observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(UnloadedRegistryObserver); }; UnloadedRegistryObserver unload_observer(path, registry());
diff --git a/chrome/browser/extensions/api/developer_private/entry_picker.h b/chrome/browser/extensions/api/developer_private/entry_picker.h index d9eaa55..f2faecb0 100644 --- a/chrome/browser/extensions/api/developer_private/entry_picker.h +++ b/chrome/browser/extensions/api/developer_private/entry_picker.h
@@ -34,6 +34,9 @@ const ui::SelectFileDialog::FileTypeInfo& info, int file_type_index); + EntryPicker(const EntryPicker&) = delete; + EntryPicker& operator=(const EntryPicker&) = delete; + // Allow picker UI to be skipped in testing. static void SkipPickerAndAlwaysSelectPathForTest(base::FilePath* path); static void SkipPickerAndAlwaysCancelForTest(); @@ -53,8 +56,6 @@ scoped_refptr<ui::SelectFileDialog> select_file_dialog_; EntryPickerClient* client_; - - DISALLOW_COPY_AND_ASSIGN(EntryPicker); }; } // namespace api
diff --git a/chrome/browser/extensions/api/developer_private/show_permissions_dialog_helper.h b/chrome/browser/extensions/api/developer_private/show_permissions_dialog_helper.h index 3fea6b6..2349404 100644 --- a/chrome/browser/extensions/api/developer_private/show_permissions_dialog_helper.h +++ b/chrome/browser/extensions/api/developer_private/show_permissions_dialog_helper.h
@@ -26,6 +26,10 @@ // install-prompt style dialog. class ShowPermissionsDialogHelper { public: + ShowPermissionsDialogHelper(const ShowPermissionsDialogHelper&) = delete; + ShowPermissionsDialogHelper& operator=(const ShowPermissionsDialogHelper&) = + delete; + static void Show(content::BrowserContext* browser_context, content::WebContents* web_contents, const Extension* extension, @@ -48,8 +52,6 @@ base::OnceClosure on_complete_; std::string extension_id_; - - DISALLOW_COPY_AND_ASSIGN(ShowPermissionsDialogHelper); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/downloads/downloads_api.h b/chrome/browser/extensions/api/downloads/downloads_api.h index 85aeeaa..1fb7d5ea 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api.h +++ b/chrome/browser/extensions/api/downloads/downloads_api.h
@@ -74,6 +74,9 @@ const std::string& id, const std::string& name); + DownloadedByExtension(const DownloadedByExtension&) = delete; + DownloadedByExtension& operator=(const DownloadedByExtension&) = delete; + const std::string& id() const { return id_; } const std::string& name() const { return name_; } @@ -82,14 +85,17 @@ std::string id_; std::string name_; - - DISALLOW_COPY_AND_ASSIGN(DownloadedByExtension); }; class DownloadsDownloadFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.download", DOWNLOADS_DOWNLOAD) DownloadsDownloadFunction(); + + DownloadsDownloadFunction(const DownloadsDownloadFunction&) = delete; + DownloadsDownloadFunction& operator=(const DownloadsDownloadFunction&) = + delete; + ResponseAction Run() override; protected: @@ -101,79 +107,87 @@ creator_conflict_action, download::DownloadItem* item, download::DownloadInterruptReason interrupt_reason); - - DISALLOW_COPY_AND_ASSIGN(DownloadsDownloadFunction); }; class DownloadsSearchFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.search", DOWNLOADS_SEARCH) DownloadsSearchFunction(); + + DownloadsSearchFunction(const DownloadsSearchFunction&) = delete; + DownloadsSearchFunction& operator=(const DownloadsSearchFunction&) = delete; + ResponseAction Run() override; protected: ~DownloadsSearchFunction() override; - - private: - DISALLOW_COPY_AND_ASSIGN(DownloadsSearchFunction); }; class DownloadsPauseFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.pause", DOWNLOADS_PAUSE) DownloadsPauseFunction(); + + DownloadsPauseFunction(const DownloadsPauseFunction&) = delete; + DownloadsPauseFunction& operator=(const DownloadsPauseFunction&) = delete; + ResponseAction Run() override; protected: ~DownloadsPauseFunction() override; - - private: - DISALLOW_COPY_AND_ASSIGN(DownloadsPauseFunction); }; class DownloadsResumeFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.resume", DOWNLOADS_RESUME) DownloadsResumeFunction(); + + DownloadsResumeFunction(const DownloadsResumeFunction&) = delete; + DownloadsResumeFunction& operator=(const DownloadsResumeFunction&) = delete; + ResponseAction Run() override; protected: ~DownloadsResumeFunction() override; - - private: - DISALLOW_COPY_AND_ASSIGN(DownloadsResumeFunction); }; class DownloadsCancelFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.cancel", DOWNLOADS_CANCEL) DownloadsCancelFunction(); + + DownloadsCancelFunction(const DownloadsCancelFunction&) = delete; + DownloadsCancelFunction& operator=(const DownloadsCancelFunction&) = delete; + ResponseAction Run() override; protected: ~DownloadsCancelFunction() override; - - private: - DISALLOW_COPY_AND_ASSIGN(DownloadsCancelFunction); }; class DownloadsEraseFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.erase", DOWNLOADS_ERASE) DownloadsEraseFunction(); + + DownloadsEraseFunction(const DownloadsEraseFunction&) = delete; + DownloadsEraseFunction& operator=(const DownloadsEraseFunction&) = delete; + ResponseAction Run() override; protected: ~DownloadsEraseFunction() override; - - private: - DISALLOW_COPY_AND_ASSIGN(DownloadsEraseFunction); }; class DownloadsRemoveFileFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.removeFile", DOWNLOADS_REMOVEFILE) DownloadsRemoveFileFunction(); + + DownloadsRemoveFileFunction(const DownloadsRemoveFileFunction&) = delete; + DownloadsRemoveFileFunction& operator=(const DownloadsRemoveFileFunction&) = + delete; + ResponseAction Run() override; protected: @@ -181,8 +195,6 @@ private: void Done(bool success); - - DISALLOW_COPY_AND_ASSIGN(DownloadsRemoveFileFunction); }; class DownloadsAcceptDangerFunction : public ExtensionFunction { @@ -196,6 +208,11 @@ DECLARE_EXTENSION_FUNCTION("downloads.acceptDanger", DOWNLOADS_ACCEPTDANGER) DownloadsAcceptDangerFunction(); + + DownloadsAcceptDangerFunction(const DownloadsAcceptDangerFunction&) = delete; + DownloadsAcceptDangerFunction& operator=( + const DownloadsAcceptDangerFunction&) = delete; + ResponseAction Run() override; protected: @@ -207,20 +224,20 @@ void PromptOrWait(int download_id, int retries); static OnPromptCreatedCallback* on_prompt_created_; - DISALLOW_COPY_AND_ASSIGN(DownloadsAcceptDangerFunction); }; class DownloadsShowFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.show", DOWNLOADS_SHOW) DownloadsShowFunction(); + + DownloadsShowFunction(const DownloadsShowFunction&) = delete; + DownloadsShowFunction& operator=(const DownloadsShowFunction&) = delete; + ResponseAction Run() override; protected: ~DownloadsShowFunction() override; - - private: - DISALLOW_COPY_AND_ASSIGN(DownloadsShowFunction); }; class DownloadsShowDefaultFolderFunction : public ExtensionFunction { @@ -228,19 +245,26 @@ DECLARE_EXTENSION_FUNCTION( "downloads.showDefaultFolder", DOWNLOADS_SHOWDEFAULTFOLDER) DownloadsShowDefaultFolderFunction(); + + DownloadsShowDefaultFolderFunction( + const DownloadsShowDefaultFolderFunction&) = delete; + DownloadsShowDefaultFolderFunction& operator=( + const DownloadsShowDefaultFolderFunction&) = delete; + ResponseAction Run() override; protected: ~DownloadsShowDefaultFolderFunction() override; - - private: - DISALLOW_COPY_AND_ASSIGN(DownloadsShowDefaultFolderFunction); }; class DownloadsOpenFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.open", DOWNLOADS_OPEN) DownloadsOpenFunction(); + + DownloadsOpenFunction(const DownloadsOpenFunction&) = delete; + DownloadsOpenFunction& operator=(const DownloadsOpenFunction&) = delete; + ResponseAction Run() override; typedef base::OnceCallback<void(DownloadOpenPrompt*)> OnPromptCreatedCallback; @@ -256,8 +280,6 @@ void OpenPromptDone(int download_id, bool accept); static OnPromptCreatedCallback* on_prompt_created_cb_; - - DISALLOW_COPY_AND_ASSIGN(DownloadsOpenFunction); }; class DownloadsSetShelfEnabledFunction : public ExtensionFunction { @@ -265,19 +287,27 @@ DECLARE_EXTENSION_FUNCTION("downloads.setShelfEnabled", DOWNLOADS_SETSHELFENABLED) DownloadsSetShelfEnabledFunction(); + + DownloadsSetShelfEnabledFunction(const DownloadsSetShelfEnabledFunction&) = + delete; + DownloadsSetShelfEnabledFunction& operator=( + const DownloadsSetShelfEnabledFunction&) = delete; + ResponseAction Run() override; protected: ~DownloadsSetShelfEnabledFunction() override; - - private: - DISALLOW_COPY_AND_ASSIGN(DownloadsSetShelfEnabledFunction); }; class DownloadsGetFileIconFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("downloads.getFileIcon", DOWNLOADS_GETFILEICON) DownloadsGetFileIconFunction(); + + DownloadsGetFileIconFunction(const DownloadsGetFileIconFunction&) = delete; + DownloadsGetFileIconFunction& operator=(const DownloadsGetFileIconFunction&) = + delete; + ResponseAction Run() override; void SetIconExtractorForTesting(DownloadFileIconExtractor* extractor); @@ -288,7 +318,6 @@ void OnIconURLExtracted(const std::string& url); base::FilePath path_; std::unique_ptr<DownloadFileIconExtractor> icon_extractor_; - DISALLOW_COPY_AND_ASSIGN(DownloadsGetFileIconFunction); }; // Observes a single DownloadManager and many DownloadItems and dispatches
diff --git a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc index b65dd2b5..48d6e04 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
@@ -67,6 +67,7 @@ #include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/controllable_http_response.h" #include "net/test/embedded_test_server/embedded_test_server.h" +#include "net/test/embedded_test_server/http_response.h" #include "services/network/public/cpp/features.h" #include "storage/browser/file_system/file_system_context.h" #include "storage/browser/file_system/file_system_operation_runner.h" @@ -138,6 +139,9 @@ args_(args.Clone()), caught_(caught) {} + Event(const Event&) = delete; + Event& operator=(const Event&) = delete; + const base::Time& caught() { return caught_; } bool Satisfies(const Event& other) const { @@ -189,8 +193,6 @@ std::string json_args_; base::Value args_; base::Time caught_; - - DISALLOW_COPY_AND_ASSIGN(Event); }; // extensions::EventRouter::TestObserver: @@ -306,6 +308,9 @@ incognito_browser_(nullptr), current_browser_(nullptr) {} + DownloadExtensionTest(const DownloadExtensionTest&) = delete; + DownloadExtensionTest& operator=(const DownloadExtensionTest&) = delete; + protected: // Used with CreateHistoryDownloads struct HistoryDownloadInfo { @@ -691,8 +696,6 @@ std::unique_ptr<net::test_server::ControllableHttpResponse> first_download_; std::unique_ptr<net::test_server::ControllableHttpResponse> second_download_; - - DISALLOW_COPY_AND_ASSIGN(DownloadExtensionTest); }; namespace { @@ -1785,7 +1788,7 @@ class CustomResponse : public net::test_server::HttpResponse { public: - CustomResponse(net::test_server::SendCompleteCallback* callback, + CustomResponse(base::OnceClosure* callback, base::TaskRunner** task_runner, bool first_request) : callback_(callback), @@ -1797,26 +1800,29 @@ ~CustomResponse() override {} - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) override { - std::string response( - "HTTP/1.1 200 OK\r\n" - "Content-type: application/octet-stream\r\n" - "Cache-Control: max-age=0\r\n" - "\r\n"); - response += std::string(kDownloadSize, '*'); + void SendResponse( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) override { + base::StringPairs headers = { + //"HTTP/1.1 200 OK\r\n" + {"Content-type", "application/octet-stream"}, + {"Cache-Control", "max-age=0"}, + }; + std::string contents = std::string(kDownloadSize, '*'); if (first_request_) { - *callback_ = std::move(done); + *callback_ = base::BindOnce( + &net::test_server::HttpResponseDelegate::FinishResponse, delegate); *task_runner_ = base::ThreadTaskRunnerHandle::Get().get(); - send.Run(response, base::DoNothing()); + delegate->SendResponseHeaders(net::HTTP_OK, "OK", headers); + delegate->SendContents(contents); } else { - send.Run(response, std::move(done)); + delegate->SendHeadersContentAndFinish(net::HTTP_OK, "OK", headers, + contents); } } private: - net::test_server::SendCompleteCallback* callback_; + base::OnceClosure* callback_; base::TaskRunner** task_runner_; bool first_request_; }; @@ -1829,7 +1835,7 @@ DownloadItem* item = nullptr; - net::test_server::SendCompleteCallback complete_callback; + base::OnceClosure complete_callback; base::TaskRunner* embedded_test_server_io_runner = nullptr; const char kThirdDownloadUrl[] = "/download3"; bool first_request = true;
diff --git a/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.h b/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.h index 490c94e..ab24f00 100644 --- a/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.h +++ b/chrome/browser/extensions/api/downloads_internal/downloads_internal_api.h
@@ -15,13 +15,16 @@ DECLARE_EXTENSION_FUNCTION("downloadsInternal.determineFilename", DOWNLOADSINTERNAL_DETERMINEFILENAME) DownloadsInternalDetermineFilenameFunction(); + + DownloadsInternalDetermineFilenameFunction( + const DownloadsInternalDetermineFilenameFunction&) = delete; + DownloadsInternalDetermineFilenameFunction& operator=( + const DownloadsInternalDetermineFilenameFunction&) = delete; + ResponseAction Run() override; protected: ~DownloadsInternalDetermineFilenameFunction() override; - - private: - DISALLOW_COPY_AND_ASSIGN(DownloadsInternalDetermineFilenameFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.h b/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.h index 0d69118..00e6c53 100644 --- a/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.h +++ b/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.h
@@ -16,6 +16,13 @@ public: EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction(); + EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction( + const EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction&) = + delete; + EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction& operator=( + const EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction&) = + delete; + protected: ~EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction() override; @@ -27,9 +34,6 @@ ENTERPRISE_HARDWAREPLATFORM_GETHARDWAREPLATFORMINFO) void OnHardwarePlatformInfo(base::SysInfo::HardwareInfo info); - - DISALLOW_COPY_AND_ASSIGN( - EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc index 7e4df2d..fd5cb66 100644 --- a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc +++ b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc
@@ -208,6 +208,10 @@ GetParam().enrollment_status_, GetParam().user_status_) {} + EnterprisePlatformKeysTest(const EnterprisePlatformKeysTest&) = delete; + EnterprisePlatformKeysTest& operator=(const EnterprisePlatformKeysTest&) = + delete; + void SetUpCommandLine(base::CommandLine* command_line) override { PlatformKeysTestBase::SetUpCommandLine(command_line); @@ -251,8 +255,6 @@ base::size(privateKeyPkcs8System), system_slot->slot()); } - - DISALLOW_COPY_AND_ASSIGN(EnterprisePlatformKeysTest); }; } // namespace
diff --git a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h index 46624ed..d06f508a 100644 --- a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h +++ b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h
@@ -30,15 +30,19 @@ public: DECLARE_EXTENSION_FUNCTION("enterprise.reportingPrivate.getDeviceId", ENTERPRISEREPORTINGPRIVATE_GETDEVICEID) + EnterpriseReportingPrivateGetDeviceIdFunction(); + EnterpriseReportingPrivateGetDeviceIdFunction( + const EnterpriseReportingPrivateGetDeviceIdFunction&) = delete; + EnterpriseReportingPrivateGetDeviceIdFunction& operator=( + const EnterpriseReportingPrivateGetDeviceIdFunction&) = delete; + // ExtensionFunction ExtensionFunction::ResponseAction Run() override; private: ~EnterpriseReportingPrivateGetDeviceIdFunction() override; - - DISALLOW_COPY_AND_ASSIGN(EnterpriseReportingPrivateGetDeviceIdFunction); }; #if !defined(OS_LINUX)
diff --git a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc index 0f17bb9..71423ea 100644 --- a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc +++ b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc
@@ -60,14 +60,17 @@ public: EnterpriseReportingPrivateGetDeviceIdTest() = default; + EnterpriseReportingPrivateGetDeviceIdTest( + const EnterpriseReportingPrivateGetDeviceIdTest&) = delete; + EnterpriseReportingPrivateGetDeviceIdTest& operator=( + const EnterpriseReportingPrivateGetDeviceIdTest&) = delete; + void SetClientId(const std::string& client_id) { storage_.SetClientId(client_id); } private: policy::FakeBrowserDMTokenStorage storage_; - - DISALLOW_COPY_AND_ASSIGN(EnterpriseReportingPrivateGetDeviceIdTest); }; TEST_F(EnterpriseReportingPrivateGetDeviceIdTest, GetDeviceId) { @@ -95,6 +98,11 @@ public: EnterpriseReportingPrivateDeviceDataFunctionsTest() = default; + EnterpriseReportingPrivateDeviceDataFunctionsTest( + const EnterpriseReportingPrivateDeviceDataFunctionsTest&) = delete; + EnterpriseReportingPrivateDeviceDataFunctionsTest& operator=( + const EnterpriseReportingPrivateDeviceDataFunctionsTest&) = delete; + void SetUp() override { ExtensionApiUnittest::SetUp(); ASSERT_TRUE(fake_appdata_dir_.CreateUniqueTempDir()); @@ -103,8 +111,6 @@ private: base::ScopedTempDir fake_appdata_dir_; - - DISALLOW_COPY_AND_ASSIGN(EnterpriseReportingPrivateDeviceDataFunctionsTest); }; TEST_F(EnterpriseReportingPrivateDeviceDataFunctionsTest, StoreDeviceData) { @@ -233,6 +239,13 @@ public: EnterpriseReportingPrivateGetPersistentSecretFunctionTest() = default; + EnterpriseReportingPrivateGetPersistentSecretFunctionTest( + const EnterpriseReportingPrivateGetPersistentSecretFunctionTest&) = + delete; + EnterpriseReportingPrivateGetPersistentSecretFunctionTest& operator=( + const EnterpriseReportingPrivateGetPersistentSecretFunctionTest&) = + delete; + void SetUp() override { ExtensionApiUnittest::SetUp(); #if defined(OS_WIN) @@ -245,9 +258,6 @@ #if defined(OS_WIN) registry_util::RegistryOverrideManager registry_override_manager_; #endif - - DISALLOW_COPY_AND_ASSIGN( - EnterpriseReportingPrivateGetPersistentSecretFunctionTest); }; TEST_F(EnterpriseReportingPrivateGetPersistentSecretFunctionTest, GetSecret) {
diff --git a/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc b/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc index 8e65ee4..327d253 100644 --- a/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc +++ b/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
@@ -72,6 +72,9 @@ ExtensionHostRegistry::Get(browser_context)); } + PopupHostWatcher(const PopupHostWatcher&) = delete; + PopupHostWatcher& operator=(const PopupHostWatcher&) = delete; + void Wait() { if (created_ == destroyed_) return; @@ -119,8 +122,6 @@ base::ScopedObservation<ExtensionHostRegistry, ExtensionHostRegistry::Observer> host_registry_observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(PopupHostWatcher); }; // chrome.browserAction API tests that interact with the UI in such a way that
diff --git a/chrome/browser/extensions/api/extension_action/extension_action_api.h b/chrome/browser/extensions/api/extension_action/extension_action_api.h index 5320ff09..501ed87 100644 --- a/chrome/browser/extensions/api/extension_action/extension_action_api.h +++ b/chrome/browser/extensions/api/extension_action/extension_action_api.h
@@ -56,6 +56,10 @@ }; explicit ExtensionActionAPI(content::BrowserContext* context); + + ExtensionActionAPI(const ExtensionActionAPI&) = delete; + ExtensionActionAPI& operator=(const ExtensionActionAPI&) = delete; + ~ExtensionActionAPI() override; // Convenience method to get the instance for a profile. @@ -113,8 +117,6 @@ content::BrowserContext* browser_context_; ExtensionPrefs* extension_prefs_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionActionAPI); }; // Implementation of the browserAction and pageAction APIs. @@ -461,6 +463,11 @@ BROWSERACTION_OPEN_POPUP) BrowserActionOpenPopupFunction(); + BrowserActionOpenPopupFunction(const BrowserActionOpenPopupFunction&) = + delete; + BrowserActionOpenPopupFunction& operator=( + const BrowserActionOpenPopupFunction&) = delete; + private: ~BrowserActionOpenPopupFunction() override; @@ -478,8 +485,6 @@ base::ScopedObservation<ExtensionHostRegistry, ExtensionHostRegistry::Observer> host_registry_observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(BrowserActionOpenPopupFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/file_system/file_entry_picker.h b/chrome/browser/extensions/api/file_system/file_entry_picker.h index 53a7dbf..57bd1f7 100644 --- a/chrome/browser/extensions/api/file_system/file_entry_picker.h +++ b/chrome/browser/extensions/api/file_system/file_entry_picker.h
@@ -38,6 +38,9 @@ FileSystemDelegate::FilesSelectedCallback files_selected_callback, base::OnceClosure file_selection_canceled_callback); + FileEntryPicker(const FileEntryPicker&) = delete; + FileEntryPicker& operator=(const FileEntryPicker&) = delete; + private: ~FileEntryPicker() override; // FileEntryPicker deletes itself. @@ -58,8 +61,6 @@ FileSystemDelegate::FilesSelectedCallback files_selected_callback_; base::OnceClosure file_selection_canceled_callback_; scoped_refptr<ui::SelectFileDialog> select_file_dialog_; - - DISALLOW_COPY_AND_ASSIGN(FileEntryPicker); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/file_system/file_system_apitest.cc b/chrome/browser/extensions/api/file_system/file_system_apitest.cc index ad8898b..a7ee388 100644 --- a/chrome/browser/extensions/api/file_system/file_system_apitest.cc +++ b/chrome/browser/extensions/api/file_system/file_system_apitest.cc
@@ -41,6 +41,9 @@ ExtensionRegistry::Get(browser_context)); } + AppLoadObserver(const AppLoadObserver&) = delete; + AppLoadObserver& operator=(const AppLoadObserver&) = delete; + void OnExtensionLoaded(content::BrowserContext* browser_context, const Extension* extension) override { callback_.Run(extension); @@ -50,7 +53,6 @@ base::RepeatingCallback<void(const Extension*)> callback_; base::ScopedObservation<ExtensionRegistry, ExtensionRegistryObserver> extension_registry_observation_{this}; - DISALLOW_COPY_AND_ASSIGN(AppLoadObserver); }; void SetLastChooseEntryDirectory(const base::FilePath& choose_entry_directory,
diff --git a/chrome/browser/extensions/api/file_system/request_file_system_notification.cc b/chrome/browser/extensions/api/file_system/request_file_system_notification.cc index 6772b7b..2d2164e 100644 --- a/chrome/browser/extensions/api/file_system/request_file_system_notification.cc +++ b/chrome/browser/extensions/api/file_system/request_file_system_notification.cc
@@ -40,6 +40,9 @@ // This class owns and deletes itself after showing the notification. AppNotificationLauncher() = default; + AppNotificationLauncher(const AppNotificationLauncher&) = delete; + AppNotificationLauncher& operator=(const AppNotificationLauncher&) = delete; + void InitAndShow(Profile* profile, const Extension& extension, std::unique_ptr<message_center::Notification> notification) { @@ -72,8 +75,6 @@ std::unique_ptr<AppIconLoader> icon_loader_; gfx::Image extension_icon_; std::unique_ptr<message_center::Notification> pending_notification_; - - DISALLOW_COPY_AND_ASSIGN(AppNotificationLauncher); }; } // namespace
diff --git a/chrome/browser/extensions/api/identity/web_auth_flow.h b/chrome/browser/extensions/api/identity/web_auth_flow.h index bef7a9b..deb6360 100644 --- a/chrome/browser/extensions/api/identity/web_auth_flow.h +++ b/chrome/browser/extensions/api/identity/web_auth_flow.h
@@ -82,6 +82,9 @@ Mode mode, Partition partition); + WebAuthFlow(const WebAuthFlow&) = delete; + WebAuthFlow& operator=(const WebAuthFlow&) = delete; + ~WebAuthFlow() override; // Starts the flow. @@ -135,8 +138,6 @@ AppWindow* app_window_; std::string app_window_key_; bool embedded_window_created_; - - DISALLOW_COPY_AND_ASSIGN(WebAuthFlow); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.h b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.h index 4d78b0f..cfa345b 100644 --- a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.h +++ b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.h
@@ -19,6 +19,11 @@ public: ImageWriterPrivateBaseFunction(); + ImageWriterPrivateBaseFunction(const ImageWriterPrivateBaseFunction&) = + delete; + ImageWriterPrivateBaseFunction& operator=( + const ImageWriterPrivateBaseFunction&) = delete; + #if BUILDFLAG(IS_CHROMEOS_LACROS) virtual void OnComplete(const absl::optional<std::string>& error); #else @@ -27,9 +32,6 @@ protected: ~ImageWriterPrivateBaseFunction() override; - - private: - DISALLOW_COPY_AND_ASSIGN(ImageWriterPrivateBaseFunction); }; class ImageWriterPrivateWriteFromUrlFunction
diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.h b/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.h index 731404e..4ff865c 100644 --- a/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.h +++ b/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.h
@@ -33,6 +33,9 @@ using ImageWriterUtilityClientFactory = base::RepeatingCallback<scoped_refptr<ImageWriterUtilityClient>()>; + ImageWriterUtilityClient(const ImageWriterUtilityClient&) = delete; + ImageWriterUtilityClient& operator=(const ImageWriterUtilityClient&) = delete; + static scoped_refptr<ImageWriterUtilityClient> Create( const scoped_refptr<base::SequencedTaskRunner>& task_runner); @@ -102,8 +105,6 @@ removable_storage_writer_client_; SEQUENCE_CHECKER(sequence_checker_); - - DISALLOW_COPY_AND_ASSIGN(ImageWriterUtilityClient); }; } // namespace image_writer
diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client_browsertest.cc b/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client_browsertest.cc index df2e622..61ae8006 100644 --- a/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client_browsertest.cc +++ b/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client_browsertest.cc
@@ -37,6 +37,10 @@ EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); } + ImageWriterUtilityClientTest(const ImageWriterUtilityClientTest&) = delete; + ImageWriterUtilityClientTest& operator=(const ImageWriterUtilityClientTest&) = + delete; + void FillImageFileWithPattern(char pattern) { base::ScopedAllowBlockingForTesting allow_blocking; EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.GetPath(), &image_)); @@ -250,8 +254,6 @@ bool cancel_ = false; std::string error_; scoped_refptr<base::SequencedTaskRunner> task_runner_; - - DISALLOW_COPY_AND_ASSIGN(ImageWriterUtilityClientTest); }; IN_PROC_BROWSER_TEST_F(ImageWriterUtilityClientTest, WriteNoImage) {
diff --git a/chrome/browser/extensions/api/image_writer_private/operation.h b/chrome/browser/extensions/api/image_writer_private/operation.h index e97f90e..3ce36b7 100644 --- a/chrome/browser/extensions/api/image_writer_private/operation.h +++ b/chrome/browser/extensions/api/image_writer_private/operation.h
@@ -68,6 +68,9 @@ const std::string& device_path, const base::FilePath& download_folder); + Operation(const Operation&) = delete; + Operation& operator=(const Operation&) = delete; + // Starts the operation. void Start(); @@ -245,8 +248,6 @@ // Sequenced task runner where all I/O operation will be performed. // Most of the methods of this class run in this task runner. scoped_refptr<base::SequencedTaskRunner> task_runner_; - - DISALLOW_COPY_AND_ASSIGN(Operation); }; } // namespace image_writer
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.h b/chrome/browser/extensions/api/input_ime/input_ime_api.h index 72e5b86..a469329 100644 --- a/chrome/browser/extensions/api/input_ime/input_ime_api.h +++ b/chrome/browser/extensions/api/input_ime/input_ime_api.h
@@ -117,6 +117,10 @@ class InputImeEventRouterFactory { public: + InputImeEventRouterFactory(const InputImeEventRouterFactory&) = delete; + InputImeEventRouterFactory& operator=(const InputImeEventRouterFactory&) = + delete; + static InputImeEventRouterFactory* GetInstance(); InputImeEventRouter* GetRouter(Profile* profile); void RemoveProfile(Profile* profile); @@ -127,8 +131,6 @@ ~InputImeEventRouterFactory(); std::map<Profile*, InputImeEventRouter*, ProfileCompare> router_map_; - - DISALLOW_COPY_AND_ASSIGN(InputImeEventRouterFactory); }; class InputImeKeyEventHandledFunction : public ExtensionFunction {
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h b/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h index 3d2006a..b26a64dfd 100644 --- a/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h +++ b/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h
@@ -163,6 +163,11 @@ public: InputMethodPrivateNotifyImeMenuItemActivatedFunction() = default; + InputMethodPrivateNotifyImeMenuItemActivatedFunction( + const InputMethodPrivateNotifyImeMenuItemActivatedFunction&) = delete; + InputMethodPrivateNotifyImeMenuItemActivatedFunction& operator=( + const InputMethodPrivateNotifyImeMenuItemActivatedFunction&) = delete; + protected: ~InputMethodPrivateNotifyImeMenuItemActivatedFunction() override = default; @@ -172,8 +177,6 @@ private: DECLARE_EXTENSION_FUNCTION("inputMethodPrivate.notifyImeMenuItemActivated", INPUTMETHODPRIVATE_NOTIFYIMEMENUITEMACTIVATED) - DISALLOW_COPY_AND_ASSIGN( - InputMethodPrivateNotifyImeMenuItemActivatedFunction); }; class InputMethodPrivateGetCompositionBoundsFunction
diff --git a/chrome/browser/extensions/api/instance_id/instance_id_api.h b/chrome/browser/extensions/api/instance_id/instance_id_api.h index 33a0bb0..5daa4cc 100644 --- a/chrome/browser/extensions/api/instance_id/instance_id_api.h +++ b/chrome/browser/extensions/api/instance_id/instance_id_api.h
@@ -15,6 +15,9 @@ public: InstanceIDApiFunction(); + InstanceIDApiFunction(const InstanceIDApiFunction&) = delete; + InstanceIDApiFunction& operator=(const InstanceIDApiFunction&) = delete; + protected: ~InstanceIDApiFunction() override; @@ -28,8 +31,6 @@ bool IsEnabled() const; instance_id::InstanceID* GetInstanceID() const; - - DISALLOW_COPY_AND_ASSIGN(InstanceIDApiFunction); }; class InstanceIDGetIDFunction : public InstanceIDApiFunction { @@ -38,6 +39,9 @@ InstanceIDGetIDFunction(); + InstanceIDGetIDFunction(const InstanceIDGetIDFunction&) = delete; + InstanceIDGetIDFunction& operator=(const InstanceIDGetIDFunction&) = delete; + protected: ~InstanceIDGetIDFunction() override; @@ -46,8 +50,6 @@ private: void GetIDCompleted(const std::string& id); - - DISALLOW_COPY_AND_ASSIGN(InstanceIDGetIDFunction); }; class InstanceIDGetCreationTimeFunction : public InstanceIDApiFunction { @@ -57,6 +59,11 @@ InstanceIDGetCreationTimeFunction(); + InstanceIDGetCreationTimeFunction(const InstanceIDGetCreationTimeFunction&) = + delete; + InstanceIDGetCreationTimeFunction& operator=( + const InstanceIDGetCreationTimeFunction&) = delete; + protected: ~InstanceIDGetCreationTimeFunction() override; @@ -65,8 +72,6 @@ private: void GetCreationTimeCompleted(const base::Time& creation_time); - - DISALLOW_COPY_AND_ASSIGN(InstanceIDGetCreationTimeFunction); }; class InstanceIDGetTokenFunction : public InstanceIDApiFunction { @@ -75,6 +80,10 @@ InstanceIDGetTokenFunction(); + InstanceIDGetTokenFunction(const InstanceIDGetTokenFunction&) = delete; + InstanceIDGetTokenFunction& operator=(const InstanceIDGetTokenFunction&) = + delete; + protected: ~InstanceIDGetTokenFunction() override; @@ -84,8 +93,6 @@ private: void GetTokenCompleted(const std::string& token, instance_id::InstanceID::Result result); - - DISALLOW_COPY_AND_ASSIGN(InstanceIDGetTokenFunction); }; class InstanceIDDeleteTokenFunction : public InstanceIDApiFunction { @@ -94,6 +101,10 @@ InstanceIDDeleteTokenFunction(); + InstanceIDDeleteTokenFunction(const InstanceIDDeleteTokenFunction&) = delete; + InstanceIDDeleteTokenFunction& operator=( + const InstanceIDDeleteTokenFunction&) = delete; + protected: ~InstanceIDDeleteTokenFunction() override; @@ -102,8 +113,6 @@ private: void DeleteTokenCompleted(instance_id::InstanceID::Result result); - - DISALLOW_COPY_AND_ASSIGN(InstanceIDDeleteTokenFunction); }; class InstanceIDDeleteIDFunction : public InstanceIDApiFunction { @@ -112,6 +121,10 @@ InstanceIDDeleteIDFunction(); + InstanceIDDeleteIDFunction(const InstanceIDDeleteIDFunction&) = delete; + InstanceIDDeleteIDFunction& operator=(const InstanceIDDeleteIDFunction&) = + delete; + protected: ~InstanceIDDeleteIDFunction() override; @@ -120,8 +133,6 @@ private: void DeleteIDCompleted(instance_id::InstanceID::Result result); - - DISALLOW_COPY_AND_ASSIGN(InstanceIDDeleteIDFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/instance_id/instance_id_apitest.cc b/chrome/browser/extensions/api/instance_id/instance_id_apitest.cc index 6edf1f9..35200ea 100644 --- a/chrome/browser/extensions/api/instance_id/instance_id_apitest.cc +++ b/chrome/browser/extensions/api/instance_id/instance_id_apitest.cc
@@ -29,11 +29,12 @@ public: InstanceIDApiTest(); + InstanceIDApiTest(const InstanceIDApiTest&) = delete; + InstanceIDApiTest& operator=(const InstanceIDApiTest&) = delete; + private: gcm::GCMProfileServiceFactory::ScopedTestingFactoryInstaller scoped_testing_factory_installer_; - - DISALLOW_COPY_AND_ASSIGN(InstanceIDApiTest); }; InstanceIDApiTest::InstanceIDApiTest()
diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.h b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.h index 7cbc552c..8c9b43a 100644 --- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.h +++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.h
@@ -17,6 +17,12 @@ : public ExtensionFunction { public: LanguageSettingsPrivateGetLanguageListFunction(); + + LanguageSettingsPrivateGetLanguageListFunction( + const LanguageSettingsPrivateGetLanguageListFunction&) = delete; + LanguageSettingsPrivateGetLanguageListFunction& operator=( + const LanguageSettingsPrivateGetLanguageListFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.getLanguageList", LANGUAGESETTINGSPRIVATE_GETLANGUAGELIST) @@ -33,14 +39,18 @@ private: std::unique_ptr<base::ListValue> language_list_; - - DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateGetLanguageListFunction); }; // Implements the languageSettingsPrivate.enableLanguage method. class LanguageSettingsPrivateEnableLanguageFunction : public ExtensionFunction { public: LanguageSettingsPrivateEnableLanguageFunction(); + + LanguageSettingsPrivateEnableLanguageFunction( + const LanguageSettingsPrivateEnableLanguageFunction&) = delete; + LanguageSettingsPrivateEnableLanguageFunction& operator=( + const LanguageSettingsPrivateEnableLanguageFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.enableLanguage", LANGUAGESETTINGSPRIVATE_ENABLELANGUAGE) @@ -49,9 +59,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateEnableLanguageFunction); }; // Implements the languageSettingsPrivate.disableLanguage method. @@ -59,6 +66,12 @@ : public ExtensionFunction { public: LanguageSettingsPrivateDisableLanguageFunction(); + + LanguageSettingsPrivateDisableLanguageFunction( + const LanguageSettingsPrivateDisableLanguageFunction&) = delete; + LanguageSettingsPrivateDisableLanguageFunction& operator=( + const LanguageSettingsPrivateDisableLanguageFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.disableLanguage", LANGUAGESETTINGSPRIVATE_DISABLELANGUAGE) @@ -67,9 +80,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateDisableLanguageFunction); }; // Implements the languageSettingsPrivate.setEnableTranslationForLanguage @@ -78,6 +88,14 @@ : public ExtensionFunction { public: LanguageSettingsPrivateSetEnableTranslationForLanguageFunction(); + + LanguageSettingsPrivateSetEnableTranslationForLanguageFunction( + const LanguageSettingsPrivateSetEnableTranslationForLanguageFunction&) = + delete; + LanguageSettingsPrivateSetEnableTranslationForLanguageFunction& operator=( + const LanguageSettingsPrivateSetEnableTranslationForLanguageFunction&) = + delete; + DECLARE_EXTENSION_FUNCTION( "languageSettingsPrivate.setEnableTranslationForLanguage", LANGUAGESETTINGSPRIVATE_SETENABLETRANSLATIONFORLANGUAGE) @@ -87,16 +105,18 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN( - LanguageSettingsPrivateSetEnableTranslationForLanguageFunction); }; // Implements the languageSettingsPrivate.moveLanguage method. class LanguageSettingsPrivateMoveLanguageFunction : public ExtensionFunction { public: LanguageSettingsPrivateMoveLanguageFunction(); + + LanguageSettingsPrivateMoveLanguageFunction( + const LanguageSettingsPrivateMoveLanguageFunction&) = delete; + LanguageSettingsPrivateMoveLanguageFunction& operator=( + const LanguageSettingsPrivateMoveLanguageFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.moveLanguage", LANGUAGESETTINGSPRIVATE_MOVELANGUAGE) @@ -105,9 +125,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateMoveLanguageFunction); }; // Implements the languageSettingsPrivate.getAlwaysTranslateLanguages method. @@ -115,6 +132,14 @@ : public ExtensionFunction { public: LanguageSettingsPrivateGetAlwaysTranslateLanguagesFunction(); + + LanguageSettingsPrivateGetAlwaysTranslateLanguagesFunction( + const LanguageSettingsPrivateGetAlwaysTranslateLanguagesFunction&) = + delete; + LanguageSettingsPrivateGetAlwaysTranslateLanguagesFunction& operator=( + const LanguageSettingsPrivateGetAlwaysTranslateLanguagesFunction&) = + delete; + DECLARE_EXTENSION_FUNCTION( "languageSettingsPrivate.getAlwaysTranslateLanguages", LANGUAGESETTINGSPRIVATE_GETALWAYSTRANSLATELANGUAGES) @@ -124,10 +149,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN( - LanguageSettingsPrivateGetAlwaysTranslateLanguagesFunction); }; // Implements the languageSettingsPrivate.setLanguageAlwaysTranslateState @@ -136,6 +157,14 @@ : public ExtensionFunction { public: LanguageSettingsPrivateSetLanguageAlwaysTranslateStateFunction(); + + LanguageSettingsPrivateSetLanguageAlwaysTranslateStateFunction( + const LanguageSettingsPrivateSetLanguageAlwaysTranslateStateFunction&) = + delete; + LanguageSettingsPrivateSetLanguageAlwaysTranslateStateFunction& operator=( + const LanguageSettingsPrivateSetLanguageAlwaysTranslateStateFunction&) = + delete; + DECLARE_EXTENSION_FUNCTION( "languageSettingsPrivate.setLanguageAlwaysTranslateState", LANGUAGESETTINGSPRIVATE_SETLANGUAGEALWAYSTRANSLATESTATE) @@ -145,10 +174,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN( - LanguageSettingsPrivateSetLanguageAlwaysTranslateStateFunction); }; // Implements the languageSettingsPrivate.getNeverTranslateLanguages method. @@ -156,6 +181,14 @@ : public ExtensionFunction { public: LanguageSettingsPrivateGetNeverTranslateLanguagesFunction(); + + LanguageSettingsPrivateGetNeverTranslateLanguagesFunction( + const LanguageSettingsPrivateGetNeverTranslateLanguagesFunction&) = + delete; + LanguageSettingsPrivateGetNeverTranslateLanguagesFunction& operator=( + const LanguageSettingsPrivateGetNeverTranslateLanguagesFunction&) = + delete; + DECLARE_EXTENSION_FUNCTION( "languageSettingsPrivate.getNeverTranslateLanguages", LANGUAGESETTINGSPRIVATE_GETNEVERTRANSLATELANGUAGES) @@ -165,10 +198,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN( - LanguageSettingsPrivateGetNeverTranslateLanguagesFunction); }; // Implements the languageSettingsPrivate.getSpellcheckDictionaryStatuses @@ -177,6 +206,14 @@ : public ExtensionFunction { public: LanguageSettingsPrivateGetSpellcheckDictionaryStatusesFunction(); + + LanguageSettingsPrivateGetSpellcheckDictionaryStatusesFunction( + const LanguageSettingsPrivateGetSpellcheckDictionaryStatusesFunction&) = + delete; + LanguageSettingsPrivateGetSpellcheckDictionaryStatusesFunction& operator=( + const LanguageSettingsPrivateGetSpellcheckDictionaryStatusesFunction&) = + delete; + DECLARE_EXTENSION_FUNCTION( "languageSettingsPrivate.getSpellcheckDictionaryStatuses", LANGUAGESETTINGSPRIVATE_GETSPELLCHECKDICTIONARYSTATUS) @@ -186,10 +223,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN( - LanguageSettingsPrivateGetSpellcheckDictionaryStatusesFunction); }; // Implements the languageSettingsPrivate.getSpellcheckWords method. @@ -198,6 +231,12 @@ public SpellcheckCustomDictionary::Observer { public: LanguageSettingsPrivateGetSpellcheckWordsFunction(); + + LanguageSettingsPrivateGetSpellcheckWordsFunction( + const LanguageSettingsPrivateGetSpellcheckWordsFunction&) = delete; + LanguageSettingsPrivateGetSpellcheckWordsFunction& operator=( + const LanguageSettingsPrivateGetSpellcheckWordsFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.getSpellcheckWords", LANGUAGESETTINGSPRIVATE_GETSPELLCHECKWORDS) @@ -214,9 +253,6 @@ // Returns the list of words from the loaded custom dictionary. std::unique_ptr<base::ListValue> GetSpellcheckWords() const; - - private: - DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateGetSpellcheckWordsFunction); }; // Implements the languageSettingsPrivate.addSpellcheckWord method. @@ -224,6 +260,12 @@ : public ExtensionFunction { public: LanguageSettingsPrivateAddSpellcheckWordFunction(); + + LanguageSettingsPrivateAddSpellcheckWordFunction( + const LanguageSettingsPrivateAddSpellcheckWordFunction&) = delete; + LanguageSettingsPrivateAddSpellcheckWordFunction& operator=( + const LanguageSettingsPrivateAddSpellcheckWordFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.addSpellcheckWord", LANGUAGESETTINGSPRIVATE_ADDSPELLCHECKWORD) @@ -232,9 +274,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateAddSpellcheckWordFunction); }; // Implements the languageSettingsPrivate.removeSpellcheckWord method. @@ -242,6 +281,12 @@ : public ExtensionFunction { public: LanguageSettingsPrivateRemoveSpellcheckWordFunction(); + + LanguageSettingsPrivateRemoveSpellcheckWordFunction( + const LanguageSettingsPrivateRemoveSpellcheckWordFunction&) = delete; + LanguageSettingsPrivateRemoveSpellcheckWordFunction& operator=( + const LanguageSettingsPrivateRemoveSpellcheckWordFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.removeSpellcheckWord", LANGUAGESETTINGSPRIVATE_REMOVESPELLCHECKWORD) @@ -250,9 +295,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateRemoveSpellcheckWordFunction); }; // Implements the languageSettingsPrivate.getTranslateTargetLanguage method. @@ -260,6 +302,14 @@ : public ExtensionFunction { public: LanguageSettingsPrivateGetTranslateTargetLanguageFunction(); + + LanguageSettingsPrivateGetTranslateTargetLanguageFunction( + const LanguageSettingsPrivateGetTranslateTargetLanguageFunction&) = + delete; + LanguageSettingsPrivateGetTranslateTargetLanguageFunction& operator=( + const LanguageSettingsPrivateGetTranslateTargetLanguageFunction&) = + delete; + DECLARE_EXTENSION_FUNCTION( "languageSettingsPrivate.getTranslateTargetLanguage", LANGUAGESETTINGSPRIVATE_GETTRANSLATETARGETLANGUAGE) @@ -269,10 +319,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN( - LanguageSettingsPrivateGetTranslateTargetLanguageFunction); }; // Implements the languageSettingsPrivate.setTranslateTargetLanguage method. @@ -280,6 +326,14 @@ : public ExtensionFunction { public: LanguageSettingsPrivateSetTranslateTargetLanguageFunction(); + + LanguageSettingsPrivateSetTranslateTargetLanguageFunction( + const LanguageSettingsPrivateSetTranslateTargetLanguageFunction&) = + delete; + LanguageSettingsPrivateSetTranslateTargetLanguageFunction& operator=( + const LanguageSettingsPrivateSetTranslateTargetLanguageFunction&) = + delete; + DECLARE_EXTENSION_FUNCTION( "languageSettingsPrivate.setTranslateTargetLanguage", LANGUAGESETTINGSPRIVATE_SETTRANSLATETARGETLANGUAGE) @@ -289,10 +343,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN( - LanguageSettingsPrivateSetTranslateTargetLanguageFunction); }; // Implements the languageSettingsPrivate.getInputMethodLists method. @@ -300,6 +350,12 @@ : public ExtensionFunction { public: LanguageSettingsPrivateGetInputMethodListsFunction(); + + LanguageSettingsPrivateGetInputMethodListsFunction( + const LanguageSettingsPrivateGetInputMethodListsFunction&) = delete; + LanguageSettingsPrivateGetInputMethodListsFunction& operator=( + const LanguageSettingsPrivateGetInputMethodListsFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.getInputMethodLists", LANGUAGESETTINGSPRIVATE_GETINPUTMETHODLISTS) @@ -308,15 +364,18 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateGetInputMethodListsFunction); }; // Implements the languageSettingsPrivate.addInputMethod method. class LanguageSettingsPrivateAddInputMethodFunction : public ExtensionFunction { public: LanguageSettingsPrivateAddInputMethodFunction(); + + LanguageSettingsPrivateAddInputMethodFunction( + const LanguageSettingsPrivateAddInputMethodFunction&) = delete; + LanguageSettingsPrivateAddInputMethodFunction& operator=( + const LanguageSettingsPrivateAddInputMethodFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.addInputMethod", LANGUAGESETTINGSPRIVATE_ADDINPUTMETHOD) @@ -325,9 +384,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateAddInputMethodFunction); }; // Implements the languageSettingsPrivate.removeInputMethod method. @@ -335,6 +391,12 @@ : public ExtensionFunction { public: LanguageSettingsPrivateRemoveInputMethodFunction(); + + LanguageSettingsPrivateRemoveInputMethodFunction( + const LanguageSettingsPrivateRemoveInputMethodFunction&) = delete; + LanguageSettingsPrivateRemoveInputMethodFunction& operator=( + const LanguageSettingsPrivateRemoveInputMethodFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.removeInputMethod", LANGUAGESETTINGSPRIVATE_REMOVEINPUTMETHOD) @@ -343,9 +405,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateRemoveInputMethodFunction); }; // Implements the languageSettingsPrivate.retryDownloadDictionary method. @@ -353,6 +412,12 @@ : public ExtensionFunction { public: LanguageSettingsPrivateRetryDownloadDictionaryFunction(); + + LanguageSettingsPrivateRetryDownloadDictionaryFunction( + const LanguageSettingsPrivateRetryDownloadDictionaryFunction&) = delete; + LanguageSettingsPrivateRetryDownloadDictionaryFunction& operator=( + const LanguageSettingsPrivateRetryDownloadDictionaryFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.retryDownloadDictionary", LANGUAGESETTINGSPRIVATE_RETRYDOWNLOADDICTIONARY) @@ -361,10 +426,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN( - LanguageSettingsPrivateRetryDownloadDictionaryFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api_unittest.cc b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api_unittest.cc index 90305bd9..a233c13 100644 --- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api_unittest.cc +++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api_unittest.cc
@@ -475,6 +475,9 @@ input_methods_ = {extension_ime, component_extension_ime, arc_ime}; } + TestState(const TestState&) = delete; + TestState& operator=(const TestState&) = delete; + void GetInputMethodExtensions( input_method::InputMethodDescriptors* descriptors) override { for (const auto& descriptor : input_methods_) @@ -486,8 +489,6 @@ protected: friend base::RefCounted<InputMethodManager::State>; ~TestState() override = default; - - DISALLOW_COPY_AND_ASSIGN(TestState); }; TestInputMethodManager() : state_(new TestState), util_(&delegate_) { @@ -496,6 +497,9 @@ std::make_unique<MockComponentExtensionIMEManagerDelegate>()); } + TestInputMethodManager(const TestInputMethodManager&) = delete; + TestInputMethodManager& operator=(const TestInputMethodManager&) = delete; + scoped_refptr<InputMethodManager::State> GetActiveIMEState() override { return state_; } @@ -514,8 +518,6 @@ input_method::FakeInputMethodDelegate delegate_; input_method::InputMethodUtil util_; std::unique_ptr<ash::ComponentExtensionIMEManager> component_ext_mgr_; - - DISALLOW_COPY_AND_ASSIGN(TestInputMethodManager); }; } // namespace
diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate_factory.h b/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate_factory.h index f72ab5c..2b63d09 100644 --- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate_factory.h +++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate_factory.h
@@ -20,6 +20,11 @@ class LanguageSettingsPrivateDelegateFactory : public BrowserContextKeyedServiceFactory { public: + LanguageSettingsPrivateDelegateFactory( + const LanguageSettingsPrivateDelegateFactory&) = delete; + LanguageSettingsPrivateDelegateFactory& operator=( + const LanguageSettingsPrivateDelegateFactory&) = delete; + // Returns the LanguageSettingsPrivateDelegate for |context|, creating it // if it is not yet created. static LanguageSettingsPrivateDelegate* GetForBrowserContext( @@ -44,8 +49,6 @@ // BrowserContextKeyedServiceFactory: KeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const override; - - DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateDelegateFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/management/management_api_unittest.cc b/chrome/browser/extensions/api/management/management_api_unittest.cc index 5d1e54f8..6d8303e 100644 --- a/chrome/browser/extensions/api/management/management_api_unittest.cc +++ b/chrome/browser/extensions/api/management/management_api_unittest.cc
@@ -73,6 +73,10 @@ // TODO(devlin): Unittests are awesome. Test more with unittests and less with // heavy api/browser tests. class ManagementApiUnitTest : public ExtensionServiceTestWithInstall { + public: + ManagementApiUnitTest(const ManagementApiUnitTest&) = delete; + ManagementApiUnitTest& operator=(const ManagementApiUnitTest&) = delete; + protected: ManagementApiUnitTest() {} ~ManagementApiUnitTest() override {} @@ -118,8 +122,6 @@ // The browser (and accompanying window). std::unique_ptr<TestBrowserWindow> browser_window_; std::unique_ptr<Browser> browser_; - - DISALLOW_COPY_AND_ASSIGN(ManagementApiUnitTest); }; bool ManagementApiUnitTest::RunFunction(
diff --git a/chrome/browser/extensions/api/management/management_browsertest.cc b/chrome/browser/extensions/api/management/management_browsertest.cc index 5fcf448..283795d 100644 --- a/chrome/browser/extensions/api/management/management_browsertest.cc +++ b/chrome/browser/extensions/api/management/management_browsertest.cc
@@ -81,6 +81,11 @@ extension_host_observation_.Observe(host_); } + ExtensionHostDestructionObserver(const ExtensionHostDestructionObserver&) = + delete; + ExtensionHostDestructionObserver& operator=( + const ExtensionHostDestructionObserver&) = delete; + void WaitForDestructionThenWaitForFirstLoad() { run_loop_.Run(); @@ -106,8 +111,6 @@ base::ScopedObservation<extensions::ExtensionHost, extensions::ExtensionHostObserver> extension_host_observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(ExtensionHostDestructionObserver); }; } // namespace
diff --git a/chrome/browser/extensions/api/mdns/mdns_api.h b/chrome/browser/extensions/api/mdns/mdns_api.h index e2dc71fd..ce06e9b 100644 --- a/chrome/browser/extensions/api/mdns/mdns_api.h +++ b/chrome/browser/extensions/api/mdns/mdns_api.h
@@ -123,6 +123,9 @@ class MdnsForceDiscoveryFunction : public ExtensionFunction { public: MdnsForceDiscoveryFunction(); + MdnsForceDiscoveryFunction(const MdnsForceDiscoveryFunction&) = delete; + MdnsForceDiscoveryFunction& operator=(const MdnsForceDiscoveryFunction&) = + delete; protected: ~MdnsForceDiscoveryFunction() override; @@ -132,7 +135,6 @@ ResponseAction Run() override; DECLARE_EXTENSION_FUNCTION("mdns.forceDiscovery", MDNS_FORCEDISCOVERY) - DISALLOW_COPY_AND_ASSIGN(MdnsForceDiscoveryFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/messaging/native_messaging_apitest.cc b/chrome/browser/extensions/api/messaging/native_messaging_apitest.cc index 7556f57..14ae75b 100644 --- a/chrome/browser/extensions/api/messaging/native_messaging_apitest.cc +++ b/chrome/browser/extensions/api/messaging/native_messaging_apitest.cc
@@ -243,6 +243,10 @@ public: TestKeepAliveStateObserver() = default; + TestKeepAliveStateObserver(const TestKeepAliveStateObserver&) = delete; + TestKeepAliveStateObserver& operator=(const TestKeepAliveStateObserver&) = + delete; + void WaitForNoKeepAlive() { ASSERT_TRUE(KeepAliveRegistry::GetInstance()->IsKeepingAlive()); base::ScopedObservation<KeepAliveRegistry, KeepAliveStateObserver> observer( @@ -284,8 +288,6 @@ #endif base::OnceClosure quit_; - - DISALLOW_COPY_AND_ASSIGN(TestKeepAliveStateObserver); }; IN_PROC_BROWSER_TEST_F(NativeMessagingLaunchApiTest, Error) {
diff --git a/chrome/browser/extensions/api/messaging/native_messaging_launch_from_native.cc b/chrome/browser/extensions/api/messaging/native_messaging_launch_from_native.cc index f735f58..8eee6fad 100644 --- a/chrome/browser/extensions/api/messaging/native_messaging_launch_from_native.cc +++ b/chrome/browser/extensions/api/messaging/native_messaging_launch_from_native.cc
@@ -56,6 +56,11 @@ std::unique_ptr<ScopedKeepAlive, content::BrowserThread::DeleteOnUIThread>; + NativeMessagingHostErrorReporter(const NativeMessagingHostErrorReporter&) = + delete; + NativeMessagingHostErrorReporter& operator=( + const NativeMessagingHostErrorReporter&) = delete; + static void Report(const std::string& extension_id, const std::string& host_id, const std::string& connection_id, @@ -116,8 +121,6 @@ MovableScopedKeepAlive keep_alive_; std::unique_ptr<NativeMessageHost> process_; base::OneShotTimer timeout_; - - DISALLOW_COPY_AND_ASSIGN(NativeMessagingHostErrorReporter); }; } // namespace
diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher.cc b/chrome/browser/extensions/api/messaging/native_process_launcher.cc index 1e2dc81..d7973e72 100644 --- a/chrome/browser/extensions/api/messaging/native_process_launcher.cc +++ b/chrome/browser/extensions/api/messaging/native_process_launcher.cc
@@ -72,6 +72,10 @@ bool require_native_initiated_connections, const std::string& connect_id, const std::string& error_arg); + + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + void Launch(const GURL& origin, const std::string& native_host_name, LaunchedCallback callback); @@ -110,8 +114,6 @@ // Handle of the native window corresponding to the extension. intptr_t window_handle_; #endif // OS_WIN - - DISALLOW_COPY_AND_ASSIGN(Core); }; scoped_refptr<Core> core_;
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc b/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc index 7ed47e6..4852d101 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc
@@ -117,6 +117,11 @@ public: NetworkingPrivateChromeOSApiTest() {} + NetworkingPrivateChromeOSApiTest(const NetworkingPrivateChromeOSApiTest&) = + delete; + NetworkingPrivateChromeOSApiTest& operator=( + const NetworkingPrivateChromeOSApiTest&) = delete; + bool RunNetworkingSubtest(const std::string& test) { const std::string arg = base::StringPrintf("{\"test\": \"%s\"}", test.c_str()); @@ -425,9 +430,6 @@ sync_preferences::TestingPrefServiceSyncable user_prefs_; TestingPrefServiceSimple local_state_; std::string userhash_; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateChromeOSApiTest); }; // Place each subtest into a separate browser test so that the stub networking
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc b/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc index e0320df6..e8e482d 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc
@@ -46,6 +46,11 @@ public: NetworkingPrivateServiceClientApiTest() {} + NetworkingPrivateServiceClientApiTest( + const NetworkingPrivateServiceClientApiTest&) = delete; + NetworkingPrivateServiceClientApiTest& operator=( + const NetworkingPrivateServiceClientApiTest&) = delete; + bool RunNetworkingSubtest(const std::string& subtest) { const std::string page_url = "main.html?" + subtest; return RunExtensionTest("networking_private/service_client", @@ -80,9 +85,6 @@ content::RunAllPendingInMessageLoop(); extensions::ExtensionApiTest::TearDownOnMainThread(); } - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateServiceClientApiTest); }; // Place each subtest into a separate browser test so that the stub networking
diff --git a/chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.h b/chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.h index 8591158..cf63316 100644 --- a/chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.h +++ b/chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.h
@@ -18,6 +18,11 @@ class ExtensionNotificationDisplayHelperFactory : public BrowserContextKeyedServiceFactory { public: + ExtensionNotificationDisplayHelperFactory( + const ExtensionNotificationDisplayHelperFactory&) = delete; + ExtensionNotificationDisplayHelperFactory& operator=( + const ExtensionNotificationDisplayHelperFactory&) = delete; + // Get the singleton instance of the factory. static ExtensionNotificationDisplayHelperFactory* GetInstance(); @@ -37,8 +42,6 @@ ExtensionNotificationDisplayHelperFactory(); ~ExtensionNotificationDisplayHelperFactory() override; - - DISALLOW_COPY_AND_ASSIGN(ExtensionNotificationDisplayHelperFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.h b/chrome/browser/extensions/api/omnibox/omnibox_api.h index 5a1462e6..6b7ec9e 100644 --- a/chrome/browser/extensions/api/omnibox/omnibox_api.h +++ b/chrome/browser/extensions/api/omnibox/omnibox_api.h
@@ -39,6 +39,10 @@ // Event router class for events related to the omnibox API. class ExtensionOmniboxEventRouter { public: + ExtensionOmniboxEventRouter(const ExtensionOmniboxEventRouter&) = delete; + ExtensionOmniboxEventRouter& operator=(const ExtensionOmniboxEventRouter&) = + delete; + // The user has just typed the omnibox keyword. This is sent exactly once in // a given input session, before any OnInputChanged events. static void OnInputStarted( @@ -68,9 +72,6 @@ static void OnDeleteSuggestion(Profile* profile, const std::string& extension_id, const std::string& suggestion_text); - - private: - DISALLOW_COPY_AND_ASSIGN(ExtensionOmniboxEventRouter); }; class OmniboxSendSuggestionsFunction : public ExtensionFunction {
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_event_router_factory.h b/chrome/browser/extensions/api/passwords_private/passwords_private_event_router_factory.h index 3e1c70a..87ec635 100644 --- a/chrome/browser/extensions/api/passwords_private/passwords_private_event_router_factory.h +++ b/chrome/browser/extensions/api/passwords_private/passwords_private_event_router_factory.h
@@ -19,6 +19,11 @@ class PasswordsPrivateEventRouterFactory : public BrowserContextKeyedServiceFactory { public: + PasswordsPrivateEventRouterFactory( + const PasswordsPrivateEventRouterFactory&) = delete; + PasswordsPrivateEventRouterFactory& operator=( + const PasswordsPrivateEventRouterFactory&) = delete; + // Returns the PasswordsPrivateEventRouter for |profile|, creating it if // it is not yet created. static PasswordsPrivateEventRouter* GetForProfile( @@ -44,8 +49,6 @@ // BrowserContextKeyedServiceFactory: KeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const override; - - DISALLOW_COPY_AND_ASSIGN(PasswordsPrivateEventRouterFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/permissions/permissions_api.h b/chrome/browser/extensions/api/permissions/permissions_api.h index 551c20ad..6a1bda6 100644 --- a/chrome/browser/extensions/api/permissions/permissions_api.h +++ b/chrome/browser/extensions/api/permissions/permissions_api.h
@@ -56,6 +56,10 @@ PermissionsRequestFunction(); + PermissionsRequestFunction(const PermissionsRequestFunction&) = delete; + PermissionsRequestFunction& operator=(const PermissionsRequestFunction&) = + delete; + // FOR TESTS ONLY to bypass the confirmation UI. static void SetAutoConfirmForTests(bool should_proceed); static void ResetAutoConfirmForTests(); @@ -90,8 +94,6 @@ // be recorded if and only if the prompt is being bypassed for a test (see // also SetAutoConfirmForTests()). std::unique_ptr<const PermissionSet> prompted_permissions_for_testing_; - - DISALLOW_COPY_AND_ASSIGN(PermissionsRequestFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc b/chrome/browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc index 296a1da..dc2fbec 100644 --- a/chrome/browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc +++ b/chrome/browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc
@@ -51,6 +51,9 @@ key_permission_policy_(key_permission_policy), user_client_cert_slot_(user_client_cert_slot) {} + PlatformKeysTest(const PlatformKeysTest&) = delete; + PlatformKeysTest& operator=(const PlatformKeysTest&) = delete; + void SetUpOnMainThread() override { if (!IsPreTest()) { // Set up the private slot before @@ -234,8 +237,6 @@ const bool key_permission_policy_; const UserClientCertSlot user_client_cert_slot_; crypto::ScopedTestNSSDB user_private_slot_db_; - - DISALLOW_COPY_AND_ASSIGN(PlatformKeysTest); }; class TestSelectDelegate
diff --git a/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc b/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc index 7e36409..e58a291 100644 --- a/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc +++ b/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc
@@ -60,10 +60,10 @@ struct RequestState { RequestState() {} - std::unique_ptr<net::CertVerifier::Request> request; + RequestState(const RequestState&) = delete; + RequestState& operator=(const RequestState&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(RequestState); + std::unique_ptr<net::CertVerifier::Request> request; }; // Calls back |callback| with the result and no error.
diff --git a/chrome/browser/extensions/api/preference/preference_api.cc b/chrome/browser/extensions/api/preference/preference_api.cc index ea42343..99dcf92 100644 --- a/chrome/browser/extensions/api/preference/preference_api.cc +++ b/chrome/browser/extensions/api/preference/preference_api.cc
@@ -282,6 +282,9 @@ class PrefMapping { public: + PrefMapping(const PrefMapping&) = delete; + PrefMapping& operator=(const PrefMapping&) = delete; + static PrefMapping* GetInstance() { return base::Singleton<PrefMapping>::get(); } @@ -392,8 +395,6 @@ transformers_; std::unique_ptr<PrefTransformerInterface> identity_transformer_; - - DISALLOW_COPY_AND_ASSIGN(PrefMapping); }; } // namespace
diff --git a/chrome/browser/extensions/api/proxy/proxy_api.h b/chrome/browser/extensions/api/proxy/proxy_api.h index d014e5b..53d735e 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api.h +++ b/chrome/browser/extensions/api/proxy/proxy_api.h
@@ -49,6 +49,9 @@ // thread unless otherwise specified. class ProxyEventRouter { public: + ProxyEventRouter(const ProxyEventRouter&) = delete; + ProxyEventRouter& operator=(const ProxyEventRouter&) = delete; + static ProxyEventRouter* GetInstance(); void OnProxyError(EventRouterForwarder* event_router, @@ -65,8 +68,6 @@ ProxyEventRouter(); ~ProxyEventRouter(); - - DISALLOW_COPY_AND_ASSIGN(ProxyEventRouter); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/proxy/proxy_apitest.cc b/chrome/browser/extensions/api/proxy/proxy_apitest.cc index 96e48ce..419d674 100644 --- a/chrome/browser/extensions/api/proxy/proxy_apitest.cc +++ b/chrome/browser/extensions/api/proxy/proxy_apitest.cc
@@ -32,6 +32,9 @@ public: ProxySettingsApiTest() {} + ProxySettingsApiTest(const ProxySettingsApiTest&) = delete; + ProxySettingsApiTest& operator=(const ProxySettingsApiTest&) = delete; + protected: void ValidateSettings(int expected_mode, const std::string& expected_server, @@ -94,9 +97,6 @@ extensions::ManagementPolicy* GetManagementPolicy() { return ExtensionSystem::Get(profile())->management_policy(); } - - private: - DISALLOW_COPY_AND_ASSIGN(ProxySettingsApiTest); }; // Tests direct connection settings.
diff --git a/chrome/browser/extensions/api/resources_private/resources_private_api.h b/chrome/browser/extensions/api/resources_private/resources_private_api.h index 4440d65..1f7c8c8 100644 --- a/chrome/browser/extensions/api/resources_private/resources_private_api.h +++ b/chrome/browser/extensions/api/resources_private/resources_private_api.h
@@ -16,14 +16,16 @@ RESOURCESPRIVATE_GETSTRINGS) ResourcesPrivateGetStringsFunction(); + ResourcesPrivateGetStringsFunction( + const ResourcesPrivateGetStringsFunction&) = delete; + ResourcesPrivateGetStringsFunction& operator=( + const ResourcesPrivateGetStringsFunction&) = delete; + protected: ~ResourcesPrivateGetStringsFunction() override; // Override from ExtensionFunction: ExtensionFunction::ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(ResourcesPrivateGetStringsFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate_unittest.cc b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate_unittest.cc index 5fab62d..22cf08e 100644 --- a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate_unittest.cc +++ b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate_unittest.cc
@@ -79,6 +79,9 @@ public: DownloaderTestDelegate() {} + DownloaderTestDelegate(const DownloaderTestDelegate&) = delete; + DownloaderTestDelegate& operator=(const DownloaderTestDelegate&) = delete; + // On the next update check for extension |id|, we'll respond that no update // is available. void AddNoUpdateResponse(const std::string& id) { @@ -157,8 +160,6 @@ // other. std::set<std::string> no_updates_; std::map<std::string, DownloadFinishedArgs> updates_; - - DISALLOW_COPY_AND_ASSIGN(DownloaderTestDelegate); }; // Helper to let test code wait for and return an update check result. @@ -166,6 +167,9 @@ public: UpdateCheckResultCatcher() {} + UpdateCheckResultCatcher(const UpdateCheckResultCatcher&) = delete; + UpdateCheckResultCatcher& operator=(const UpdateCheckResultCatcher&) = delete; + void OnResult(const RuntimeAPIDelegate::UpdateCheckResult& result) { EXPECT_EQ(nullptr, result_.get()); result_ = std::make_unique<RuntimeAPIDelegate::UpdateCheckResult>( @@ -185,14 +189,16 @@ private: std::unique_ptr<RuntimeAPIDelegate::UpdateCheckResult> result_; std::unique_ptr<base::RunLoop> run_loop_; - - DISALLOW_COPY_AND_ASSIGN(UpdateCheckResultCatcher); }; class ChromeRuntimeAPIDelegateTest : public ExtensionServiceTestWithInstall { public: ChromeRuntimeAPIDelegateTest() {} + ChromeRuntimeAPIDelegateTest(const ChromeRuntimeAPIDelegateTest&) = delete; + ChromeRuntimeAPIDelegateTest& operator=(const ChromeRuntimeAPIDelegateTest&) = + delete; + void SetUp() override { ExtensionServiceTestWithInstall::SetUp(); ExtensionDownloader::set_test_delegate(&downloader_test_delegate_); @@ -255,9 +261,6 @@ // For preventing extensions from being updated immediately. std::unique_ptr<UpdateInstallGate> update_install_gate_; - - private: - DISALLOW_COPY_AND_ASSIGN(ChromeRuntimeAPIDelegateTest); }; TEST_F(ChromeRuntimeAPIDelegateTest, RequestUpdateCheck) { @@ -342,6 +345,9 @@ extension_registry_observation_.Observe(ExtensionRegistry::Get(context_)); } + ExtensionLoadWaiter(const ExtensionLoadWaiter&) = delete; + ExtensionLoadWaiter& operator=(const ExtensionLoadWaiter&) = delete; + void WaitForReload() { run_loop_.Run(); } protected: @@ -371,14 +377,17 @@ content::BrowserContext* context_; base::ScopedObservation<ExtensionRegistry, ExtensionRegistryObserver> extension_registry_observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(ExtensionLoadWaiter); }; class ChromeRuntimeAPIDelegateReloadTest : public ChromeRuntimeAPIDelegateTest { public: ChromeRuntimeAPIDelegateReloadTest() {} + ChromeRuntimeAPIDelegateReloadTest( + const ChromeRuntimeAPIDelegateReloadTest&) = delete; + ChromeRuntimeAPIDelegateReloadTest& operator=( + const ChromeRuntimeAPIDelegateReloadTest&) = delete; + void SetUp() override { ChromeRuntimeAPIDelegateTest::SetUp(); @@ -400,8 +409,6 @@ private: ExtensionId extension_id_; - - DISALLOW_COPY_AND_ASSIGN(ChromeRuntimeAPIDelegateReloadTest); }; TEST_F(ChromeRuntimeAPIDelegateReloadTest,
diff --git a/chrome/browser/extensions/api/runtime/runtime_apitest.cc b/chrome/browser/extensions/api/runtime/runtime_apitest.cc index fa521ea..4586cd8 100644 --- a/chrome/browser/extensions/api/runtime/runtime_apitest.cc +++ b/chrome/browser/extensions/api/runtime/runtime_apitest.cc
@@ -104,6 +104,9 @@ public: RuntimeAPIUpdateTest() {} + RuntimeAPIUpdateTest(const RuntimeAPIUpdateTest&) = delete; + RuntimeAPIUpdateTest& operator=(const RuntimeAPIUpdateTest&) = delete; + protected: void SetUpOnMainThread() override { ExtensionApiTest::SetUpOnMainThread(); @@ -143,8 +146,6 @@ private: base::ScopedTempDir scoped_temp_dir_; - - DISALLOW_COPY_AND_ASSIGN(RuntimeAPIUpdateTest); }; } // namespace
diff --git a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.h b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.h index 13980a7..25f688e 100644 --- a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.h +++ b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.h
@@ -16,13 +16,16 @@ SafeBrowsingPrivateGetReferrerChainFunction(); + SafeBrowsingPrivateGetReferrerChainFunction( + const SafeBrowsingPrivateGetReferrerChainFunction&) = delete; + SafeBrowsingPrivateGetReferrerChainFunction& operator=( + const SafeBrowsingPrivateGetReferrerChainFunction&) = delete; + protected: ~SafeBrowsingPrivateGetReferrerChainFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPrivateGetReferrerChainFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_factory.h b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_factory.h index b5e98c4..a5a4c980 100644 --- a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_factory.h +++ b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_factory.h
@@ -19,6 +19,11 @@ class SafeBrowsingPrivateEventRouterFactory : public BrowserContextKeyedServiceFactory { public: + SafeBrowsingPrivateEventRouterFactory( + const SafeBrowsingPrivateEventRouterFactory&) = delete; + SafeBrowsingPrivateEventRouterFactory& operator=( + const SafeBrowsingPrivateEventRouterFactory&) = delete; + // Returns the SafeBrowsingPrivateEventRouter for |profile|, creating it if // it is not yet created. static SafeBrowsingPrivateEventRouter* GetForProfile( @@ -44,8 +49,6 @@ // BrowserContextKeyedServiceFactory: KeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const override; - - DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPrivateEventRouterFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/scripting/scripting_apitest.cc b/chrome/browser/extensions/api/scripting/scripting_apitest.cc index b567877..e6d0aa8 100644 --- a/chrome/browser/extensions/api/scripting/scripting_apitest.cc +++ b/chrome/browser/extensions/api/scripting/scripting_apitest.cc
@@ -57,9 +57,6 @@ ->GetActiveWebContents() ->GetLastCommittedURL()); } - - private: - ScopedCurrentChannel current_channel_{version_info::Channel::UNKNOWN}; }; IN_PROC_BROWSER_TEST_F(ScriptingAPITest, MainFrameTests) {
diff --git a/chrome/browser/extensions/api/sessions/session_id.h b/chrome/browser/extensions/api/sessions/session_id.h index 627542c..11908cd0 100644 --- a/chrome/browser/extensions/api/sessions/session_id.h +++ b/chrome/browser/extensions/api/sessions/session_id.h
@@ -27,6 +27,9 @@ // |session_tag| session. SessionId(const std::string& session_tag, int id); + SessionId(const SessionId&) = delete; + SessionId& operator=(const SessionId&) = delete; + // Returns true if the SessionId represents a foreign session. bool IsForeign() const; @@ -44,8 +47,6 @@ // ID corresponding to a window or tab object. int id_; - - DISALLOW_COPY_AND_ASSIGN(SessionId); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/settings_private/generated_prefs_factory.h b/chrome/browser/extensions/api/settings_private/generated_prefs_factory.h index 10fc892..92d70b7 100644 --- a/chrome/browser/extensions/api/settings_private/generated_prefs_factory.h +++ b/chrome/browser/extensions/api/settings_private/generated_prefs_factory.h
@@ -17,6 +17,9 @@ // BrowserContextKeyedServiceFactory for GeneratedPrefs. class GeneratedPrefsFactory : public BrowserContextKeyedServiceFactory { public: + GeneratedPrefsFactory(const GeneratedPrefsFactory&) = delete; + GeneratedPrefsFactory& operator=(const GeneratedPrefsFactory&) = delete; + static GeneratedPrefs* GetForBrowserContext( content::BrowserContext* browser_context); @@ -34,8 +37,6 @@ bool ServiceIsNULLWhileTesting() const override; KeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const override; - - DISALLOW_COPY_AND_ASSIGN(GeneratedPrefsFactory); }; } // namespace settings_private
diff --git a/chrome/browser/extensions/api/settings_private/settings_private_api.h b/chrome/browser/extensions/api/settings_private/settings_private_api.h index e5d283a..33723de 100644 --- a/chrome/browser/extensions/api/settings_private/settings_private_api.h +++ b/chrome/browser/extensions/api/settings_private/settings_private_api.h
@@ -14,6 +14,12 @@ class SettingsPrivateSetPrefFunction : public ExtensionFunction { public: SettingsPrivateSetPrefFunction() {} + + SettingsPrivateSetPrefFunction(const SettingsPrivateSetPrefFunction&) = + delete; + SettingsPrivateSetPrefFunction& operator=( + const SettingsPrivateSetPrefFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("settingsPrivate.setPref", SETTINGSPRIVATE_SETPREF) protected: @@ -21,14 +27,18 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetPrefFunction); }; // Implements the chrome.settingsPrivate.getAllPrefs method. class SettingsPrivateGetAllPrefsFunction : public ExtensionFunction { public: SettingsPrivateGetAllPrefsFunction() {} + + SettingsPrivateGetAllPrefsFunction( + const SettingsPrivateGetAllPrefsFunction&) = delete; + SettingsPrivateGetAllPrefsFunction& operator=( + const SettingsPrivateGetAllPrefsFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("settingsPrivate.getAllPrefs", SETTINGSPRIVATE_GETALLPREFS) @@ -37,14 +47,18 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(SettingsPrivateGetAllPrefsFunction); }; // Implements the chrome.settingsPrivate.getPref method. class SettingsPrivateGetPrefFunction : public ExtensionFunction { public: SettingsPrivateGetPrefFunction() {} + + SettingsPrivateGetPrefFunction(const SettingsPrivateGetPrefFunction&) = + delete; + SettingsPrivateGetPrefFunction& operator=( + const SettingsPrivateGetPrefFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("settingsPrivate.getPref", SETTINGSPRIVATE_GETPREF) protected: @@ -52,14 +66,18 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(SettingsPrivateGetPrefFunction); }; // Implements the chrome.settingsPrivate.getDefaultZoom method. class SettingsPrivateGetDefaultZoomFunction : public ExtensionFunction { public: SettingsPrivateGetDefaultZoomFunction() {} + + SettingsPrivateGetDefaultZoomFunction( + const SettingsPrivateGetDefaultZoomFunction&) = delete; + SettingsPrivateGetDefaultZoomFunction& operator=( + const SettingsPrivateGetDefaultZoomFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("settingsPrivate.getDefaultZoom", SETTINGSPRIVATE_GETDEFAULTZOOMFUNCTION) @@ -68,14 +86,18 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(SettingsPrivateGetDefaultZoomFunction); }; // Implements the chrome.settingsPrivate.setDefaultZoom method. class SettingsPrivateSetDefaultZoomFunction : public ExtensionFunction { public: SettingsPrivateSetDefaultZoomFunction() {} + + SettingsPrivateSetDefaultZoomFunction( + const SettingsPrivateSetDefaultZoomFunction&) = delete; + SettingsPrivateSetDefaultZoomFunction& operator=( + const SettingsPrivateSetDefaultZoomFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("settingsPrivate.setDefaultZoom", SETTINGSPRIVATE_SETDEFAULTZOOMFUNCTION) @@ -84,8 +106,6 @@ // ExtensionFunction overrides. ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetDefaultZoomFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/settings_private/settings_private_delegate_factory.h b/chrome/browser/extensions/api/settings_private/settings_private_delegate_factory.h index 65a19ab..25b1d84 100644 --- a/chrome/browser/extensions/api/settings_private/settings_private_delegate_factory.h +++ b/chrome/browser/extensions/api/settings_private/settings_private_delegate_factory.h
@@ -20,6 +20,11 @@ class SettingsPrivateDelegateFactory : public BrowserContextKeyedServiceFactory { public: + SettingsPrivateDelegateFactory(const SettingsPrivateDelegateFactory&) = + delete; + SettingsPrivateDelegateFactory& operator=( + const SettingsPrivateDelegateFactory&) = delete; + static SettingsPrivateDelegate* GetForBrowserContext( content::BrowserContext* browser_context); @@ -36,8 +41,6 @@ content::BrowserContext* profile) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(SettingsPrivateDelegateFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/settings_private/settings_private_event_router_factory.h b/chrome/browser/extensions/api/settings_private/settings_private_event_router_factory.h index fe47560..cf6859d 100644 --- a/chrome/browser/extensions/api/settings_private/settings_private_event_router_factory.h +++ b/chrome/browser/extensions/api/settings_private/settings_private_event_router_factory.h
@@ -19,6 +19,11 @@ class SettingsPrivateEventRouterFactory : public BrowserContextKeyedServiceFactory { public: + SettingsPrivateEventRouterFactory(const SettingsPrivateEventRouterFactory&) = + delete; + SettingsPrivateEventRouterFactory& operator=( + const SettingsPrivateEventRouterFactory&) = delete; + // Returns the SettingsPrivateEventRouter for |profile|, creating it if // it is not yet created. static SettingsPrivateEventRouter* GetForProfile( @@ -43,8 +48,6 @@ // BrowserContextKeyedServiceFactory: KeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const override; - - DISALLOW_COPY_AND_ASSIGN(SettingsPrivateEventRouterFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/storage/settings_apitest.cc b/chrome/browser/extensions/api/storage/settings_apitest.cc index 3314e73..33f5b030 100644 --- a/chrome/browser/extensions/api/storage/settings_apitest.cc +++ b/chrome/browser/extensions/api/storage/settings_apitest.cc
@@ -249,65 +249,30 @@ testing::NiceMock<policy::MockConfigurationPolicyProvider> policy_provider_; }; -// A specialization of ExtensionSettingsApiTest that pretends it's running -// on version_info::Channel::UNKNOWN. -class ExtensionSettingsTrunkApiTest : public ExtensionSettingsApiTest { - public: - ExtensionSettingsTrunkApiTest() = default; - ~ExtensionSettingsTrunkApiTest() override = default; - ExtensionSettingsTrunkApiTest(const ExtensionSettingsTrunkApiTest& other) = - delete; - ExtensionSettingsTrunkApiTest& operator=( - const ExtensionSettingsTrunkApiTest& other) = delete; - - private: - // TODO(crbug.com/1185226): Remove unknown channel when chrome.storage.session - // is released in stable. - ScopedCurrentChannel current_channel_{version_info::Channel::UNKNOWN}; -}; - -// A specialization of ExtensionSettingsApiTest that pretends it's running -// on version_info::Channel::DEV. -class ExtensionSettingsDevApiTest : public ExtensionSettingsApiTest { - public: - ExtensionSettingsDevApiTest() = default; - ~ExtensionSettingsDevApiTest() override = default; - ExtensionSettingsDevApiTest(const ExtensionSettingsDevApiTest& other) = - delete; - ExtensionSettingsDevApiTest& operator=( - const ExtensionSettingsDevApiTest& other) = delete; - - private: - // TODO(crbug.com/1185226): Remove dev channel when chrome.storage.session - // is released in stable. - ScopedCurrentChannel current_channel_{version_info::Channel::DEV}; -}; - -// TODO(crbug.com/1185226): Remove test when chrome.storage.session -// is released in stable. -IN_PROC_BROWSER_TEST_F(ExtensionSettingsDevApiTest, - SessionInUnsupportedChannel) { +IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, + SessionInUnsupportedExtension) { constexpr char kManifest[] = R"({ - "name": "Unsupported channel for session", - "manifest_version": 3, - "version": "0.1", - "background": { "service_worker": "worker.js" }, - "permissions": ["storage"] - })"; - - constexpr char kWorker[] = - R"(chrome.test.runTests([ - function unsupported() { - chrome.test.assertEq(undefined, chrome.storage.session); - chrome.test.assertTrue(!!chrome.storage.local); - chrome.test.succeed(); - }, - ]);)"; + "name": "Unsupported manifest version for Storage API", + "manifest_version": 2, + "version": "0.1", + "background": {"scripts": ["script.js"]}, + "permissions": ["storage"] + })"; + constexpr char kScript[] = + R"({ + chrome.test.runTests([ + function unsupported() { + chrome.test.assertEq(undefined, chrome.storage.session), + chrome.test.assertTrue(!!chrome.storage.local); + chrome.test.succeed(); + } + ]) + })"; TestExtensionDir test_dir; test_dir.WriteManifest(kManifest); - test_dir.WriteFile(FILE_PATH_LITERAL("worker.js"), kWorker); + test_dir.WriteFile(FILE_PATH_LITERAL("script.js"), kScript); ResultCatcher catcher; const Extension* extension = LoadExtension(test_dir.UnpackedPath()); @@ -315,9 +280,7 @@ ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); } -// TODO(crbug.com/1185226): Change parent class to `ExtensionSettingsApiTest` -// when chrome.storage.session is released in stable. -IN_PROC_BROWSER_TEST_F(ExtensionSettingsTrunkApiTest, SimpleTest) { +IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, SimpleTest) { ASSERT_TRUE(RunExtensionTest("settings/simple_test")) << message_; } @@ -325,9 +288,7 @@ // Note that only split-mode incognito is tested, because spanning mode // incognito looks the same as normal mode when the only API activity comes // from background pages. -// TODO(crbug.com/1185226): Change parent class to `ExtensionSettingsApiTest` -// when chrome.storage.session is released in stable. -IN_PROC_BROWSER_TEST_F(ExtensionSettingsTrunkApiTest, SplitModeIncognito) { +IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, SplitModeIncognito) { // We need 2 ResultCatchers because we'll be running the same test in both // regular and incognito mode. ResultCatcher catcher; @@ -361,14 +322,12 @@ EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); } -// TODO(crbug.com/1185226): Change parent class to `ExtensionSettingsApiTest` -// when chrome.storage.session is released in stable. // TODO(crbug.com/1229351): Service worker extension listener should receive an // event before the callback is made. Current workaround: wait for the event to // be received by the extension before checking for it. Potential solution: once // browser-side observation of SW lifetime work is finished, check if it fixes // this test. -IN_PROC_BROWSER_TEST_F(ExtensionSettingsTrunkApiTest, +IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, OnChangedNotificationsBetweenBackgroundPages) { // We need 2 ResultCatchers because we'll be running the same test in both // regular and incognito mode. @@ -416,9 +375,7 @@ EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); } -// TODO(crbug.com/1185226): Change parent class to `ExtensionSettingsApiTest` -// when chrome.storage.session is released in stable. -IN_PROC_BROWSER_TEST_F(ExtensionSettingsTrunkApiTest, +IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, SyncLocalAndSessionAreasAreSeparate) { // We need 2 ResultCatchers because we'll be running the same test in both // regular and incognito mode.
diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h b/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h index 1e0c307..1e2f514 100644 --- a/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h +++ b/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h
@@ -57,6 +57,10 @@ // A structure representing the system indicator for an extension. struct SystemIndicator { SystemIndicator(); + + SystemIndicator(const SystemIndicator&) = delete; + SystemIndicator& operator=(const SystemIndicator&) = delete; + ~SystemIndicator(); // A dynamically-set icon (through systemIndicator.setIcon()). Takes @@ -67,8 +71,6 @@ // The system tray indicator. This is only non-null if the system indicator // is enabled. std::unique_ptr<ExtensionIndicatorIcon> system_tray_indicator; - - DISALLOW_COPY_AND_ASSIGN(SystemIndicator); }; // ExtensionRegistryObserver:
diff --git a/chrome/browser/extensions/api/system_private/system_private_apitest.cc b/chrome/browser/extensions/api/system_private/system_private_apitest.cc index 950b8ce..6e14d2cb 100644 --- a/chrome/browser/extensions/api/system_private/system_private_apitest.cc +++ b/chrome/browser/extensions/api/system_private/system_private_apitest.cc
@@ -36,6 +36,9 @@ public: GetUpdateStatusApiTest() : fake_update_engine_client_(NULL) {} + GetUpdateStatusApiTest(const GetUpdateStatusApiTest&) = delete; + GetUpdateStatusApiTest& operator=(const GetUpdateStatusApiTest&) = delete; + void SetUpInProcessBrowserTestFixture() override { ExtensionApiTest::SetUpInProcessBrowserTestFixture(); fake_update_engine_client_ = new chromeos::FakeUpdateEngineClient; @@ -49,9 +52,6 @@ protected: chromeos::FakeUpdateEngineClient* fake_update_engine_client_; - - private: - DISALLOW_COPY_AND_ASSIGN(GetUpdateStatusApiTest); }; IN_PROC_BROWSER_TEST_F(GetUpdateStatusApiTest, Progress) {
diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h index 4129f5c..0119df8 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h
@@ -36,6 +36,9 @@ public ExtensionRegistryObserver, public MediaCaptureDevicesDispatcher::Observer { public: + TabCaptureRegistry(const TabCaptureRegistry&) = delete; + TabCaptureRegistry& operator=(const TabCaptureRegistry&) = delete; + static TabCaptureRegistry* Get(content::BrowserContext* context); // Used by BrowserContextKeyedAPI. @@ -118,8 +121,6 @@ base::ScopedObservation<ExtensionRegistry, ExtensionRegistryObserver> extension_registry_observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(TabCaptureRegistry); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.h b/chrome/browser/extensions/api/tabs/tabs_api.h index 2000882..dc057c6 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.h +++ b/chrome/browser/extensions/api/tabs/tabs_api.h
@@ -238,6 +238,11 @@ public ExtensionFunction { public: TabsCaptureVisibleTabFunction(); + + TabsCaptureVisibleTabFunction(const TabsCaptureVisibleTabFunction&) = delete; + TabsCaptureVisibleTabFunction& operator=( + const TabsCaptureVisibleTabFunction&) = delete; + static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); static void set_disable_throttling_for_tests( @@ -276,8 +281,6 @@ static std::string CaptureResultToErrorMessage(CaptureResult result); static bool disable_throttling_for_test_; - - DISALLOW_COPY_AND_ASSIGN(TabsCaptureVisibleTabFunction); }; // Implement API calls tabs.executeScript, tabs.insertCSS, and tabs.removeCSS. @@ -379,13 +382,14 @@ TabsDiscardFunction(); + TabsDiscardFunction(const TabsDiscardFunction&) = delete; + TabsDiscardFunction& operator=(const TabsDiscardFunction&) = delete; + private: ~TabsDiscardFunction() override; // ExtensionFunction: ExtensionFunction::ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(TabsDiscardFunction); }; class TabsGoForwardFunction : public ExtensionFunction { @@ -394,13 +398,14 @@ TabsGoForwardFunction() {} + TabsGoForwardFunction(const TabsGoForwardFunction&) = delete; + TabsGoForwardFunction& operator=(const TabsGoForwardFunction&) = delete; + private: ~TabsGoForwardFunction() override {} // ExtensionFunction: ExtensionFunction::ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(TabsGoForwardFunction); }; class TabsGoBackFunction : public ExtensionFunction { @@ -409,13 +414,14 @@ TabsGoBackFunction() {} + TabsGoBackFunction(const TabsGoBackFunction&) = delete; + TabsGoBackFunction& operator=(const TabsGoBackFunction&) = delete; + private: ~TabsGoBackFunction() override {} // ExtensionFunction: ExtensionFunction::ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(TabsGoBackFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc b/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc index 42c5312..d1a7dac 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc
@@ -92,6 +92,10 @@ } // namespace class TabsApiUnitTest : public ExtensionServiceTestBase { + public: + TabsApiUnitTest(const TabsApiUnitTest&) = delete; + TabsApiUnitTest& operator=(const TabsApiUnitTest&) = delete; + protected: TabsApiUnitTest() {} ~TabsApiUnitTest() override {} @@ -113,8 +117,6 @@ display::test::TestScreen test_screen_; std::unique_ptr<ScopedScreenOverride> scoped_screen_override_; - - DISALLOW_COPY_AND_ASSIGN(TabsApiUnitTest); }; void TabsApiUnitTest::SetUp() {
diff --git a/chrome/browser/extensions/api/tabs/tabs_event_router.h b/chrome/browser/extensions/api/tabs/tabs_event_router.h index e2bad16..1b8bd032e 100644 --- a/chrome/browser/extensions/api/tabs/tabs_event_router.h +++ b/chrome/browser/extensions/api/tabs/tabs_event_router.h
@@ -162,6 +162,9 @@ // |contents|. TabEntry(TabsEventRouter* router, content::WebContents* contents); + TabEntry(const TabEntry&) = delete; + TabEntry& operator=(const TabEntry&) = delete; + // Indicate via a list of property names if a tab is loading based on its // WebContents. Whether the state has changed or not is used to determine if // events need to be sent to extensions during processing of TabChangedAt() @@ -195,8 +198,6 @@ // Event router that the WebContents's noficiations are forwarded to. TabsEventRouter* router_; - - DISALLOW_COPY_AND_ASSIGN(TabEntry); }; // Gets the TabEntry for the given |contents|. Returns TabEntry* if found,
diff --git a/chrome/browser/extensions/api/tabs/tabs_test.cc b/chrome/browser/extensions/api/tabs/tabs_test.cc index 5a376b6f..1f4d23a 100644 --- a/chrome/browser/extensions/api/tabs/tabs_test.cc +++ b/chrome/browser/extensions/api/tabs/tabs_test.cc
@@ -86,6 +86,9 @@ public: ExtensionTabsTest() {} + ExtensionTabsTest(const ExtensionTabsTest&) = delete; + ExtensionTabsTest& operator=(const ExtensionTabsTest&) = delete; + std::string GetWindowType(Browser* test_browser, scoped_refptr<const Extension> extension) { scoped_refptr<WindowsGetFunction> function = new WindowsGetFunction(); @@ -98,9 +101,6 @@ function.get(), args, browser()))); return api_test_utils::GetString(result.get(), "type"); } - - private: - DISALLOW_COPY_AND_ASSIGN(ExtensionTabsTest); }; class ExtensionWindowCreateTest : public InProcessBrowserTest {
diff --git a/chrome/browser/extensions/api/terminal/terminal_private_browsertest.cc b/chrome/browser/extensions/api/terminal/terminal_private_browsertest.cc index c1c94fd7..011d957 100644 --- a/chrome/browser/extensions/api/terminal/terminal_private_browsertest.cc +++ b/chrome/browser/extensions/api/terminal/terminal_private_browsertest.cc
@@ -17,6 +17,11 @@ namespace extensions { class TerminalPrivateBrowserTest : public InProcessBrowserTest { + public: + TerminalPrivateBrowserTest(const TerminalPrivateBrowserTest&) = delete; + TerminalPrivateBrowserTest& operator=(const TerminalPrivateBrowserTest&) = + delete; + protected: TerminalPrivateBrowserTest() = default; @@ -28,9 +33,6 @@ /*world_id=*/1); EXPECT_EQ(eval_result.value.GetString(), expected); } - - private: - DISALLOW_COPY_AND_ASSIGN(TerminalPrivateBrowserTest); }; IN_PROC_BROWSER_TEST_F(TerminalPrivateBrowserTest, OpenTerminalProcessChecks) {
diff --git a/chrome/browser/extensions/api/web_request/web_request_apitest.cc b/chrome/browser/extensions/api/web_request/web_request_apitest.cc index adf9c9e..0411646 100644 --- a/chrome/browser/extensions/api/web_request/web_request_apitest.cc +++ b/chrome/browser/extensions/api/web_request/web_request_apitest.cc
@@ -1939,6 +1939,11 @@ NTPInterceptionWebRequestAPITest() : https_test_server_(net::EmbeddedTestServer::TYPE_HTTPS) {} + NTPInterceptionWebRequestAPITest(const NTPInterceptionWebRequestAPITest&) = + delete; + NTPInterceptionWebRequestAPITest& operator=( + const NTPInterceptionWebRequestAPITest&) = delete; + // ExtensionApiTest override: void SetUpOnMainThread() override { ExtensionApiTest::SetUpOnMainThread(); @@ -1958,7 +1963,6 @@ private: net::EmbeddedTestServer https_test_server_; - DISALLOW_COPY_AND_ASSIGN(NTPInterceptionWebRequestAPITest); }; // Ensures that requests made by the NTP Instant renderer are hidden from the @@ -2029,6 +2033,11 @@ WebUiNtpInterceptionWebRequestAPITest() : https_test_server_(net::EmbeddedTestServer::TYPE_HTTPS) {} + WebUiNtpInterceptionWebRequestAPITest( + const WebUiNtpInterceptionWebRequestAPITest&) = delete; + WebUiNtpInterceptionWebRequestAPITest& operator=( + const WebUiNtpInterceptionWebRequestAPITest&) = delete; + // ExtensionApiTest override: void SetUp() override { https_test_server_.RegisterRequestMonitor(base::BindRepeating( @@ -2098,8 +2107,6 @@ bool one_google_bar_request_seen_ = false; base::Lock lock_; - - DISALLOW_COPY_AND_ASSIGN(WebUiNtpInterceptionWebRequestAPITest); }; IN_PROC_BROWSER_TEST_F(WebUiNtpInterceptionWebRequestAPITest, @@ -2364,6 +2371,11 @@ nullptr, nullptr) {} + ExtensionWebRequestMockedClockTest( + const ExtensionWebRequestMockedClockTest&) = delete; + ExtensionWebRequestMockedClockTest& operator=( + const ExtensionWebRequestMockedClockTest&) = delete; + private: static base::Time Now() { static base::Time now_time = base::Time::UnixEpoch(); @@ -2372,7 +2384,6 @@ } base::subtle::ScopedTimeClockOverrides scoped_time_clock_override_; - DISALLOW_COPY_AND_ASSIGN(ExtensionWebRequestMockedClockTest); }; // Tests that we correctly dispatch the OnActionIgnored event on an extension
diff --git a/chrome/browser/extensions/api/web_view/chrome_web_view_internal_api.h b/chrome/browser/extensions/api/web_view/chrome_web_view_internal_api.h index b9f6354..f9a4f9f 100644 --- a/chrome/browser/extensions/api/web_view/chrome_web_view_internal_api.h +++ b/chrome/browser/extensions/api/web_view/chrome_web_view_internal_api.h
@@ -23,14 +23,16 @@ WEBVIEWINTERNAL_CONTEXTMENUSCREATE) ChromeWebViewInternalContextMenusCreateFunction() {} + ChromeWebViewInternalContextMenusCreateFunction( + const ChromeWebViewInternalContextMenusCreateFunction&) = delete; + ChromeWebViewInternalContextMenusCreateFunction& operator=( + const ChromeWebViewInternalContextMenusCreateFunction&) = delete; + protected: ~ChromeWebViewInternalContextMenusCreateFunction() override {} // ExtensionFunction implementation. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusCreateFunction); }; class ChromeWebViewInternalContextMenusUpdateFunction @@ -40,14 +42,16 @@ WEBVIEWINTERNAL_CONTEXTMENUSUPDATE) ChromeWebViewInternalContextMenusUpdateFunction() {} + ChromeWebViewInternalContextMenusUpdateFunction( + const ChromeWebViewInternalContextMenusUpdateFunction&) = delete; + ChromeWebViewInternalContextMenusUpdateFunction& operator=( + const ChromeWebViewInternalContextMenusUpdateFunction&) = delete; + protected: ~ChromeWebViewInternalContextMenusUpdateFunction() override {} // ExtensionFunction implementation. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusUpdateFunction); }; class ChromeWebViewInternalContextMenusRemoveFunction @@ -57,14 +61,16 @@ WEBVIEWINTERNAL_CONTEXTMENUSREMOVE) ChromeWebViewInternalContextMenusRemoveFunction() {} + ChromeWebViewInternalContextMenusRemoveFunction( + const ChromeWebViewInternalContextMenusRemoveFunction&) = delete; + ChromeWebViewInternalContextMenusRemoveFunction& operator=( + const ChromeWebViewInternalContextMenusRemoveFunction&) = delete; + protected: ~ChromeWebViewInternalContextMenusRemoveFunction() override {} // ExtensionFunction implementation. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusRemoveFunction); }; class ChromeWebViewInternalContextMenusRemoveAllFunction @@ -74,14 +80,16 @@ WEBVIEWINTERNAL_CONTEXTMENUSREMOVEALL) ChromeWebViewInternalContextMenusRemoveAllFunction() {} + ChromeWebViewInternalContextMenusRemoveAllFunction( + const ChromeWebViewInternalContextMenusRemoveAllFunction&) = delete; + ChromeWebViewInternalContextMenusRemoveAllFunction& operator=( + const ChromeWebViewInternalContextMenusRemoveAllFunction&) = delete; + protected: ~ChromeWebViewInternalContextMenusRemoveAllFunction() override {} // ExtensionFunction implementation. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalContextMenusRemoveAllFunction); }; class ChromeWebViewInternalShowContextMenuFunction @@ -92,11 +100,14 @@ ChromeWebViewInternalShowContextMenuFunction(); + ChromeWebViewInternalShowContextMenuFunction( + const ChromeWebViewInternalShowContextMenuFunction&) = delete; + ChromeWebViewInternalShowContextMenuFunction& operator=( + const ChromeWebViewInternalShowContextMenuFunction&) = delete; + protected: ~ChromeWebViewInternalShowContextMenuFunction() override; ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(ChromeWebViewInternalShowContextMenuFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.h b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.h index a994de2..dbb944e 100644 --- a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.h +++ b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.h
@@ -55,6 +55,11 @@ class WebrtcAudioPrivateFunction : public ExtensionFunction { protected: WebrtcAudioPrivateFunction(); + + WebrtcAudioPrivateFunction(const WebrtcAudioPrivateFunction&) = delete; + WebrtcAudioPrivateFunction& operator=(const WebrtcAudioPrivateFunction&) = + delete; + ~WebrtcAudioPrivateFunction() override; protected: @@ -74,8 +79,6 @@ private: std::string device_id_salt_; std::unique_ptr<media::AudioSystem> audio_system_; - - DISALLOW_COPY_AND_ASSIGN(WebrtcAudioPrivateFunction); }; class WebrtcAudioPrivateGetSinksFunction : public WebrtcAudioPrivateFunction {
diff --git a/chrome/browser/extensions/api/webstore_private/extension_install_status_unittest.cc b/chrome/browser/extensions/api/webstore_private/extension_install_status_unittest.cc index 28c4449..44fb1f59 100644 --- a/chrome/browser/extensions/api/webstore_private/extension_install_status_unittest.cc +++ b/chrome/browser/extensions/api/webstore_private/extension_install_status_unittest.cc
@@ -52,6 +52,10 @@ public: ExtensionInstallStatusTest() = default; + ExtensionInstallStatusTest(const ExtensionInstallStatusTest&) = delete; + ExtensionInstallStatusTest& operator=(const ExtensionInstallStatusTest&) = + delete; + std::string GenerateArgs(const char* id) { return base::StringPrintf(R"(["%s"])", id); } @@ -86,9 +90,6 @@ profile()->GetTestingPrefService()->SetUserPref( prefs::kCloudExtensionRequestIds, std::move(id_values)); } - - private: - DISALLOW_COPY_AND_ASSIGN(ExtensionInstallStatusTest); }; TEST_F(ExtensionInstallStatusTest, ExtensionEnabled) {
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h index f80ba9fb..90a31a6 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h
@@ -351,13 +351,16 @@ WebstorePrivateGetReferrerChainFunction(); + WebstorePrivateGetReferrerChainFunction( + const WebstorePrivateGetReferrerChainFunction&) = delete; + WebstorePrivateGetReferrerChainFunction& operator=( + const WebstorePrivateGetReferrerChainFunction&) = delete; + private: ~WebstorePrivateGetReferrerChainFunction() override; // ExtensionFunction: ExtensionFunction::ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebstorePrivateGetReferrerChainFunction); }; class WebstorePrivateGetExtensionStatusFunction : public ExtensionFunction { @@ -367,6 +370,11 @@ WebstorePrivateGetExtensionStatusFunction(); + WebstorePrivateGetExtensionStatusFunction( + const WebstorePrivateGetExtensionStatusFunction&) = delete; + WebstorePrivateGetExtensionStatusFunction& operator=( + const WebstorePrivateGetExtensionStatusFunction&) = delete; + private: ~WebstorePrivateGetExtensionStatusFunction() override; @@ -377,8 +385,6 @@ // ExtensionFunction: ExtensionFunction::ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebstorePrivateGetExtensionStatusFunction); }; class WebstorePrivateRequestExtensionFunction : public ExtensionFunction { @@ -387,13 +393,16 @@ WEBSTOREPRIVATE_REQUESTEXTENSION) WebstorePrivateRequestExtensionFunction(); + WebstorePrivateRequestExtensionFunction( + const WebstorePrivateRequestExtensionFunction&) = delete; + WebstorePrivateRequestExtensionFunction& operator=( + const WebstorePrivateRequestExtensionFunction&) = delete; + private: ~WebstorePrivateRequestExtensionFunction() override; // Extensionfunction: ExtensionFunction::ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebstorePrivateRequestExtensionFunction); }; } // namespace extensions
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_unittest.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_unittest.cc index 5eb4215..5270d01 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_unittest.cc +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_unittest.cc
@@ -154,6 +154,11 @@ : ExtensionApiUnittest( base::test::TaskEnvironment::TimeSource::MOCK_TIME) {} + WebstorePrivateExtensionInstallRequestBase( + const WebstorePrivateExtensionInstallRequestBase&) = delete; + WebstorePrivateExtensionInstallRequestBase& operator=( + const WebstorePrivateExtensionInstallRequestBase&) = delete; + std::string GenerateArgs(const char* id) { return base::StringPrintf(R"(["%s"])", id); } @@ -171,9 +176,6 @@ ASSERT_TRUE(actual_response->is_string()); EXPECT_EQ(ToString(expected_response), actual_response->GetString()); } - - private: - DISALLOW_COPY_AND_ASSIGN(WebstorePrivateExtensionInstallRequestBase); }; class WebstorePrivateGetExtensionStatusTest
diff --git a/chrome/browser/extensions/api_binding_perf_browsertest.cc b/chrome/browser/extensions/api_binding_perf_browsertest.cc index 110eb54..b8b7275 100644 --- a/chrome/browser/extensions/api_binding_perf_browsertest.cc +++ b/chrome/browser/extensions/api_binding_perf_browsertest.cc
@@ -25,6 +25,11 @@ #define LOCAL_TEST(TestName) DISABLED_ ## TestName class APIBindingPerfBrowserTest : public ExtensionBrowserTest { + public: + APIBindingPerfBrowserTest(const APIBindingPerfBrowserTest&) = delete; + APIBindingPerfBrowserTest& operator=(const APIBindingPerfBrowserTest&) = + delete; + protected: APIBindingPerfBrowserTest() {} ~APIBindingPerfBrowserTest() override {} @@ -42,9 +47,6 @@ &time_elapsed_ms)); return base::TimeDelta::FromMillisecondsD(time_elapsed_ms); } - - private: - DISALLOW_COPY_AND_ASSIGN(APIBindingPerfBrowserTest); }; constexpr char kSimpleContentScriptManifest[] =
diff --git a/chrome/browser/extensions/blocklist.cc b/chrome/browser/extensions/blocklist.cc index fbd9e89..4e6b674 100644 --- a/chrome/browser/extensions/blocklist.cc +++ b/chrome/browser/extensions/blocklist.cc
@@ -79,6 +79,9 @@ using OnResultCallback = base::OnceCallback<void(const std::set<std::string>&)>; + SafeBrowsingClientImpl(const SafeBrowsingClientImpl&) = delete; + SafeBrowsingClientImpl& operator=(const SafeBrowsingClientImpl&) = delete; + // Constructs a client to query the database manager for |extension_ids| and // run |callback| with the IDs of those which have been blocklisted. static void Start(const std::set<std::string>& extension_ids, @@ -128,8 +131,6 @@ scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner_; OnResultCallback callback_; - - DISALLOW_COPY_AND_ASSIGN(SafeBrowsingClientImpl); }; void CheckOneExtensionState(Blocklist::IsBlocklistedCallback callback,
diff --git a/chrome/browser/extensions/blocklist.h b/chrome/browser/extensions/blocklist.h index c33b72b1..3c937dd 100644 --- a/chrome/browser/extensions/blocklist.h +++ b/chrome/browser/extensions/blocklist.h
@@ -75,6 +75,9 @@ explicit Blocklist(ExtensionPrefs* prefs); + Blocklist(const Blocklist&) = delete; + Blocklist& operator=(const Blocklist&) = delete; + ~Blocklist() override; static Blocklist* Get(content::BrowserContext* context); @@ -162,8 +165,6 @@ // is a pair of [vector of string ids to check, response closure]. std::list<std::pair<std::vector<std::string>, base::OnceClosure>> state_requests_; - - DISALLOW_COPY_AND_ASSIGN(Blocklist); }; } // namespace extensions
diff --git a/chrome/browser/extensions/blocklist_factory.h b/chrome/browser/extensions/blocklist_factory.h index d632fe9c..c4134a5 100644 --- a/chrome/browser/extensions/blocklist_factory.h +++ b/chrome/browser/extensions/blocklist_factory.h
@@ -16,6 +16,10 @@ class BlocklistFactory : public BrowserContextKeyedServiceFactory { public: static Blocklist* GetForBrowserContext(content::BrowserContext* context); + + BlocklistFactory(const BlocklistFactory&) = delete; + BlocklistFactory& operator=(const BlocklistFactory&) = delete; + static BlocklistFactory* GetInstance(); private: @@ -29,8 +33,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(BlocklistFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/chrome_app_icon_service_factory.h b/chrome/browser/extensions/chrome_app_icon_service_factory.h index 7cb1fcd..3a86ad2 100644 --- a/chrome/browser/extensions/chrome_app_icon_service_factory.h +++ b/chrome/browser/extensions/chrome_app_icon_service_factory.h
@@ -17,6 +17,10 @@ // ChromeAppIconService::Get(context) to access the service. class ChromeAppIconServiceFactory : public BrowserContextKeyedServiceFactory { public: + ChromeAppIconServiceFactory(const ChromeAppIconServiceFactory&) = delete; + ChromeAppIconServiceFactory& operator=(const ChromeAppIconServiceFactory&) = + delete; + static ChromeAppIconService* GetForBrowserContext( content::BrowserContext* context); @@ -32,8 +36,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(ChromeAppIconServiceFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/chrome_extension_cookies.h b/chrome/browser/extensions/chrome_extension_cookies.h index c6ff6b7..f77fabc 100644 --- a/chrome/browser/extensions/chrome_extension_cookies.h +++ b/chrome/browser/extensions/chrome_extension_cookies.h
@@ -45,6 +45,9 @@ public content_settings::Observer, public content_settings::CookieSettings::Observer { public: + ChromeExtensionCookies(const ChromeExtensionCookies&) = delete; + ChromeExtensionCookies& operator=(const ChromeExtensionCookies&) = delete; + // Gets (or creates) an appropriate instance for given |context| from // ChromeExtensionCookiesFactory. static ChromeExtensionCookies* Get(content::BrowserContext* context); @@ -139,8 +142,6 @@ base::ScopedObservation<content_settings::CookieSettings, content_settings::CookieSettings::Observer> cookie_settings_observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(ChromeExtensionCookies); }; } // namespace extensions
diff --git a/chrome/browser/extensions/chrome_extension_cookies_factory.h b/chrome/browser/extensions/chrome_extension_cookies_factory.h index ce30d6a..ba40058 100644 --- a/chrome/browser/extensions/chrome_extension_cookies_factory.h +++ b/chrome/browser/extensions/chrome_extension_cookies_factory.h
@@ -15,6 +15,10 @@ class ChromeExtensionCookiesFactory : public BrowserContextKeyedServiceFactory { public: + ChromeExtensionCookiesFactory(const ChromeExtensionCookiesFactory&) = delete; + ChromeExtensionCookiesFactory& operator=( + const ChromeExtensionCookiesFactory&) = delete; + static ChromeExtensionCookies* GetForBrowserContext( content::BrowserContext* context); static ChromeExtensionCookiesFactory* GetInstance(); @@ -30,8 +34,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(ChromeExtensionCookiesFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/chrome_url_request_util.cc b/chrome/browser/extensions/chrome_url_request_util.cc index 0ce1c7f..1d9fa85 100644 --- a/chrome/browser/extensions/chrome_url_request_util.cc +++ b/chrome/browser/extensions/chrome_url_request_util.cc
@@ -81,6 +81,9 @@ // component extensions. class ResourceBundleFileLoader : public network::mojom::URLLoader { public: + ResourceBundleFileLoader(const ResourceBundleFileLoader&) = delete; + ResourceBundleFileLoader& operator=(const ResourceBundleFileLoader&) = delete; + static void CreateAndStart( const network::ResourceRequest& request, mojo::PendingReceiver<network::mojom::URLLoader> loader, @@ -213,8 +216,6 @@ mojo::Remote<network::mojom::URLLoaderClient> client_; scoped_refptr<net::HttpResponseHeaders> response_headers_; base::WeakPtrFactory<ResourceBundleFileLoader> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ResourceBundleFileLoader); }; } // namespace
diff --git a/chrome/browser/extensions/component_loader.h b/chrome/browser/extensions/component_loader.h index 8501173..0a196e8 100644 --- a/chrome/browser/extensions/component_loader.h +++ b/chrome/browser/extensions/component_loader.h
@@ -138,6 +138,10 @@ ComponentExtensionInfo( std::unique_ptr<base::DictionaryValue> manifest_param, const base::FilePath& root_directory); + + ComponentExtensionInfo(const ComponentExtensionInfo&) = delete; + ComponentExtensionInfo& operator=(const ComponentExtensionInfo&) = delete; + ~ComponentExtensionInfo(); ComponentExtensionInfo(ComponentExtensionInfo&& other); @@ -151,9 +155,6 @@ // The component extension's ID. std::string extension_id; - - private: - DISALLOW_COPY_AND_ASSIGN(ComponentExtensionInfo); }; // Parses the given JSON manifest. Returns nullptr if it cannot be parsed or
diff --git a/chrome/browser/extensions/component_loader_unittest.cc b/chrome/browser/extensions/component_loader_unittest.cc index df447034..05a9f7b 100644 --- a/chrome/browser/extensions/component_loader_unittest.cc +++ b/chrome/browser/extensions/component_loader_unittest.cc
@@ -34,6 +34,10 @@ observation_.Observe(registry); } + ExtensionUnloadedObserver(const ExtensionUnloadedObserver&) = delete; + ExtensionUnloadedObserver& operator=(const ExtensionUnloadedObserver&) = + delete; + size_t unloaded_count() const { return unloaded_count_; } protected: @@ -48,8 +52,6 @@ size_t unloaded_count_; base::ScopedObservation<ExtensionRegistry, ExtensionRegistryObserver> observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(ExtensionUnloadedObserver); }; class ComponentLoaderTest : public testing::Test {
diff --git a/chrome/browser/extensions/content_script_apitest.cc b/chrome/browser/extensions/content_script_apitest.cc index b4167bd..199cdaa 100644 --- a/chrome/browser/extensions/content_script_apitest.cc +++ b/chrome/browser/extensions/content_script_apitest.cc
@@ -1730,6 +1730,9 @@ NTPInterceptionTest() : https_test_server_(net::EmbeddedTestServer::TYPE_HTTPS) {} + NTPInterceptionTest(const NTPInterceptionTest&) = delete; + NTPInterceptionTest& operator=(const NTPInterceptionTest&) = delete; + // ExtensionApiTest override: void SetUpOnMainThread() override { ExtensionApiTest::SetUpOnMainThread(); @@ -1748,7 +1751,6 @@ private: net::EmbeddedTestServer https_test_server_; - DISALLOW_COPY_AND_ASSIGN(NTPInterceptionTest); }; // Ensure extensions can't inject a content script into the New Tab page.
diff --git a/chrome/browser/extensions/context_menu_matcher.h b/chrome/browser/extensions/context_menu_matcher.h index 544c212..1509c6b 100644 --- a/chrome/browser/extensions/context_menu_matcher.h +++ b/chrome/browser/extensions/context_menu_matcher.h
@@ -46,6 +46,9 @@ ui::SimpleMenuModel* menu_model, base::RepeatingCallback<bool(const MenuItem*)> filter); + ContextMenuMatcher(const ContextMenuMatcher&) = delete; + ContextMenuMatcher& operator=(const ContextMenuMatcher&) = delete; + // This is a helper function to append items for one particular extension. // The |index| parameter is used for assigning id's, and is incremented for // each item actually added. |is_action_menu| is used for browser and page @@ -122,8 +125,6 @@ // Keep track of and clean up menu models for submenus. std::vector<std::unique_ptr<ui::SimpleMenuModel>> extension_menu_models_; - - DISALLOW_COPY_AND_ASSIGN(ContextMenuMatcher); }; } // namespace extensions
diff --git a/chrome/browser/extensions/context_menu_matcher_unittest.cc b/chrome/browser/extensions/context_menu_matcher_unittest.cc index 9790b260..6a5c83b 100644 --- a/chrome/browser/extensions/context_menu_matcher_unittest.cc +++ b/chrome/browser/extensions/context_menu_matcher_unittest.cc
@@ -28,6 +28,9 @@ manager_(CreateMenuManager()), prefs_(base::ThreadTaskRunnerHandle::Get()) {} + ContextMenuMatcherTest(const ContextMenuMatcherTest&) = delete; + ContextMenuMatcherTest& operator=(const ContextMenuMatcherTest&) = delete; + // Returns a test item with the given string ID. std::unique_ptr<MenuItem> CreateTestItem(Extension* extension, const std::string& string_id, @@ -64,9 +67,6 @@ MenuManager* manager_; ExtensionList extensions_; TestExtensionPrefs prefs_; - - private: - DISALLOW_COPY_AND_ASSIGN(ContextMenuMatcherTest); }; // Tests appending an extension item with an invisible submenu.
diff --git a/chrome/browser/extensions/corb_and_cors_extension_browsertest.cc b/chrome/browser/extensions/corb_and_cors_extension_browsertest.cc index aeb6b95..92b29a2 100644 --- a/chrome/browser/extensions/corb_and_cors_extension_browsertest.cc +++ b/chrome/browser/extensions/corb_and_cors_extension_browsertest.cc
@@ -174,6 +174,11 @@ public: CorbAndCorsExtensionBrowserTest() = default; + CorbAndCorsExtensionBrowserTest(const CorbAndCorsExtensionBrowserTest&) = + delete; + CorbAndCorsExtensionBrowserTest& operator=( + const CorbAndCorsExtensionBrowserTest&) = delete; + void SetUpInProcessBrowserTestFixture() override { policy_provider_.SetDefaultReturns( /*is_initialization_complete_return=*/true, @@ -535,8 +540,6 @@ } const Extension* extension_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(CorbAndCorsExtensionBrowserTest); }; IN_PROC_BROWSER_TEST_F(CorbAndCorsExtensionBrowserTest,
diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h index 0eecbe3..63ec5259 100644 --- a/chrome/browser/extensions/crx_installer.h +++ b/chrome/browser/extensions/crx_installer.h
@@ -92,6 +92,9 @@ // installation. enum WithholdingBehavior { kWithholdPermissions, kDontWithholdPermissions }; + CrxInstaller(const CrxInstaller&) = delete; + CrxInstaller& operator=(const CrxInstaller&) = delete; + // Extensions will be installed into service->install_directory(), then // registered with |service|. This does a silent install - see below for // other options. @@ -538,8 +541,6 @@ // Invoked when the expectations from CRXFileInfo match with the crx file // after unpack success. ExpectationsVerifiedCallback expectations_verified_callback_; - - DISALLOW_COPY_AND_ASSIGN(CrxInstaller); }; } // namespace extensions
diff --git a/chrome/browser/extensions/crx_installer_browsertest.cc b/chrome/browser/extensions/crx_installer_browsertest.cc index d38bc6e4..391d278 100644 --- a/chrome/browser/extensions/crx_installer_browsertest.cc +++ b/chrome/browser/extensions/crx_installer_browsertest.cc
@@ -128,6 +128,9 @@ ExtensionInstallPrompt(web_contents), proxy_(proxy) {} + MockInstallPrompt(const MockInstallPrompt&) = delete; + MockInstallPrompt& operator=(const MockInstallPrompt&) = delete; + // Overriding some of the ExtensionInstallUI API. void OnInstallSuccess(scoped_refptr<const Extension> extension, SkBitmap* icon) override { @@ -141,8 +144,6 @@ private: MockPromptProxy* proxy_; - - DISALLOW_COPY_AND_ASSIGN(MockInstallPrompt); }; MockPromptProxy::MockPromptProxy(
diff --git a/chrome/browser/extensions/data_deleter.h b/chrome/browser/extensions/data_deleter.h index 90febd8..efadd2a2 100644 --- a/chrome/browser/extensions/data_deleter.h +++ b/chrome/browser/extensions/data_deleter.h
@@ -16,6 +16,9 @@ class DataDeleter { public: + DataDeleter(const DataDeleter&) = delete; + DataDeleter& operator=(const DataDeleter&) = delete; + // Starts removing data. The extension should not be running when this is // called. Cookies are deleted on the current thread, local storage and // databases/settings are deleted asynchronously on the webkit and file @@ -25,9 +28,6 @@ static void StartDeleting(Profile* profile, const Extension* extension, base::OnceClosure done_callback); - - private: - DISALLOW_COPY_AND_ASSIGN(DataDeleter); }; } // namespace extensions
diff --git a/chrome/browser/extensions/error_console/error_console_factory.h b/chrome/browser/extensions/error_console/error_console_factory.h index c394ef5a..fa6daf2 100644 --- a/chrome/browser/extensions/error_console/error_console_factory.h +++ b/chrome/browser/extensions/error_console/error_console_factory.h
@@ -15,6 +15,9 @@ class ErrorConsoleFactory : public BrowserContextKeyedServiceFactory { public: + ErrorConsoleFactory(const ErrorConsoleFactory&) = delete; + ErrorConsoleFactory& operator=(const ErrorConsoleFactory&) = delete; + static ErrorConsole* GetForBrowserContext(content::BrowserContext* context); static ErrorConsoleFactory* GetInstance(); @@ -29,8 +32,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(ErrorConsoleFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/event_router_forwarder.h b/chrome/browser/extensions/event_router_forwarder.h index 639f5e8..db6cb261 100644 --- a/chrome/browser/extensions/event_router_forwarder.h +++ b/chrome/browser/extensions/event_router_forwarder.h
@@ -31,6 +31,9 @@ public: EventRouterForwarder(); + EventRouterForwarder(const EventRouterForwarder&) = delete; + EventRouterForwarder& operator=(const EventRouterForwarder&) = delete; + // Calls // DispatchEventToRenderers(event_name, event_args, profile, event_url) // on all (original) profiles' EventRouters. @@ -82,8 +85,6 @@ private: friend class base::RefCountedThreadSafe<EventRouterForwarder>; - - DISALLOW_COPY_AND_ASSIGN(EventRouterForwarder); }; } // namespace extensions
diff --git a/chrome/browser/extensions/events_apitest.cc b/chrome/browser/extensions/events_apitest.cc index 5cfdece..a67b784 100644 --- a/chrome/browser/extensions/events_apitest.cc +++ b/chrome/browser/extensions/events_apitest.cc
@@ -110,6 +110,9 @@ public: EventsApiTest() {} + EventsApiTest(const EventsApiTest&) = delete; + EventsApiTest& operator=(const EventsApiTest&) = delete; + protected: void SetUpOnMainThread() override { ExtensionApiTest::SetUpOnMainThread(); @@ -139,8 +142,6 @@ private: base::ScopedTempDir scoped_temp_dir_; - - DISALLOW_COPY_AND_ASSIGN(EventsApiTest); }; // Tests that updating an extension sends runtime.onInstalled event to the @@ -263,6 +264,10 @@ ChromeExtensionsBrowserClient::set_did_chrome_update_for_testing(true); } + ChromeUpdatesEventsApiTest(const ChromeUpdatesEventsApiTest&) = delete; + ChromeUpdatesEventsApiTest& operator=(const ChromeUpdatesEventsApiTest&) = + delete; + void SetUpOnMainThread() override { EventsApiTest::SetUpOnMainThread(); ProcessManager* process_manager = ProcessManager::Get(profile()); @@ -293,8 +298,6 @@ private: std::set<std::string> observed_extension_names_; - - DISALLOW_COPY_AND_ASSIGN(ChromeUpdatesEventsApiTest); }; IN_PROC_BROWSER_TEST_F(ChromeUpdatesEventsApiTest, PRE_ChromeUpdates) {
diff --git a/chrome/browser/extensions/extension_action_runner_unittest.cc b/chrome/browser/extensions/extension_action_runner_unittest.cc index a67b91a..34d75d0 100644 --- a/chrome/browser/extensions/extension_action_runner_unittest.cc +++ b/chrome/browser/extensions/extension_action_runner_unittest.cc
@@ -46,6 +46,11 @@ // ExtensionActionRunner correctly interfaces in the system) is done in the // ExtensionActionRunnerBrowserTests. class ExtensionActionRunnerUnitTest : public ChromeRenderViewHostTestHarness { + public: + ExtensionActionRunnerUnitTest(const ExtensionActionRunnerUnitTest&) = delete; + ExtensionActionRunnerUnitTest& operator=( + const ExtensionActionRunnerUnitTest&) = delete; + protected: ExtensionActionRunnerUnitTest(); ~ExtensionActionRunnerUnitTest() override; @@ -87,8 +92,6 @@ std::map<std::string, int> extension_executions_; scoped_refptr<const Extension> extension_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionActionRunnerUnitTest); }; ExtensionActionRunnerUnitTest::ExtensionActionRunnerUnitTest() = default;
diff --git a/chrome/browser/extensions/extension_assets_manager.cc b/chrome/browser/extensions/extension_assets_manager.cc index 458f1e7f..fb521ea 100644 --- a/chrome/browser/extensions/extension_assets_manager.cc +++ b/chrome/browser/extensions/extension_assets_manager.cc
@@ -20,6 +20,10 @@ class ExtensionAssetsManagerImpl : public ExtensionAssetsManager { public: + ExtensionAssetsManagerImpl(const ExtensionAssetsManagerImpl&) = delete; + ExtensionAssetsManagerImpl& operator=(const ExtensionAssetsManagerImpl&) = + delete; + static ExtensionAssetsManagerImpl* GetInstance() { return base::Singleton<ExtensionAssetsManagerImpl>::get(); } @@ -49,8 +53,6 @@ ExtensionAssetsManagerImpl() {} ~ExtensionAssetsManagerImpl() override {} - - DISALLOW_COPY_AND_ASSIGN(ExtensionAssetsManagerImpl); }; } // namespace
diff --git a/chrome/browser/extensions/extension_assets_manager_chromeos.cc b/chrome/browser/extensions/extension_assets_manager_chromeos.cc index c5470a84..e2206c1 100644 --- a/chrome/browser/extensions/extension_assets_manager_chromeos.cc +++ b/chrome/browser/extensions/extension_assets_manager_chromeos.cc
@@ -61,6 +61,10 @@ }; typedef std::vector<PendingInstallInfo> PendingInstallList; + ExtensionAssetsManagerHelper(const ExtensionAssetsManagerHelper&) = delete; + ExtensionAssetsManagerHelper& operator=(const ExtensionAssetsManagerHelper&) = + delete; + static ExtensionAssetsManagerHelper* GetInstance() { DCHECK_CURRENTLY_ON(BrowserThread::UI); return base::Singleton<ExtensionAssetsManagerHelper>::get(); @@ -113,8 +117,6 @@ typedef std::map<InstallItem, std::vector<PendingInstallInfo> > InstallQueue; InstallQueue install_queue_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionAssetsManagerHelper); }; } // namespace
diff --git a/chrome/browser/extensions/extension_assets_manager_chromeos.h b/chrome/browser/extensions/extension_assets_manager_chromeos.h index 38b9f024..52598b1 100644 --- a/chrome/browser/extensions/extension_assets_manager_chromeos.h +++ b/chrome/browser/extensions/extension_assets_manager_chromeos.h
@@ -26,6 +26,11 @@ // between all users on the machine. class ExtensionAssetsManagerChromeOS : public ExtensionAssetsManager { public: + ExtensionAssetsManagerChromeOS(const ExtensionAssetsManagerChromeOS&) = + delete; + ExtensionAssetsManagerChromeOS& operator=( + const ExtensionAssetsManagerChromeOS&) = delete; + static ExtensionAssetsManagerChromeOS* GetInstance(); // A dictionary that maps shared extension IDs to version/paths/users. @@ -123,8 +128,6 @@ const std::string& id, base::DictionaryValue* extension_info, std::multimap<std::string, base::FilePath>* live_extension_paths); - - DISALLOW_COPY_AND_ASSIGN(ExtensionAssetsManagerChromeOS); }; } // namespace extensions
diff --git a/chrome/browser/extensions/extension_browsertest.h b/chrome/browser/extensions/extension_browsertest.h index a2f4008..098483e 100644 --- a/chrome/browser/extensions/extension_browsertest.h +++ b/chrome/browser/extensions/extension_browsertest.h
@@ -67,6 +67,9 @@ kFromManifest, }; + ExtensionBrowserTest(const ExtensionBrowserTest&) = delete; + ExtensionBrowserTest& operator=(const ExtensionBrowserTest&) = delete; + protected: struct LoadOptions { // Allows the extension to run in incognito mode. @@ -443,8 +446,6 @@ verifier_format_override_; ExtensionUpdater::ScopedSkipScheduledCheckForTest skip_scheduled_check_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionBrowserTest); }; } // namespace extensions
diff --git a/chrome/browser/extensions/extension_context_menu_model.cc b/chrome/browser/extensions/extension_context_menu_model.cc index 2cc0cf3..9e2cc8b3 100644 --- a/chrome/browser/extensions/extension_context_menu_model.cc +++ b/chrome/browser/extensions/extension_context_menu_model.cc
@@ -156,6 +156,9 @@ // base::OnceCallback, but that's a bunch of churn. class UninstallDialogHelper : public ExtensionUninstallDialog::Delegate { public: + UninstallDialogHelper(const UninstallDialogHelper&) = delete; + UninstallDialogHelper& operator=(const UninstallDialogHelper&) = delete; + // Kicks off the asynchronous process to confirm and uninstall the given // |extension|. static void UninstallExtension(Browser* browser, const Extension* extension) { @@ -183,8 +186,6 @@ } std::unique_ptr<ExtensionUninstallDialog> uninstall_dialog_; - - DISALLOW_COPY_AND_ASSIGN(UninstallDialogHelper); }; } // namespace
diff --git a/chrome/browser/extensions/extension_context_menu_model.h b/chrome/browser/extensions/extension_context_menu_model.h index 7a74892..ec5f4cb 100644 --- a/chrome/browser/extensions/extension_context_menu_model.h +++ b/chrome/browser/extensions/extension_context_menu_model.h
@@ -104,6 +104,11 @@ ButtonVisibility visibility, PopupDelegate* delegate, bool can_show_icon_in_toolbar); + + ExtensionContextMenuModel(const ExtensionContextMenuModel&) = delete; + ExtensionContextMenuModel& operator=(const ExtensionContextMenuModel&) = + delete; + ~ExtensionContextMenuModel() override; // SimpleMenuModel::Delegate: @@ -178,8 +183,6 @@ // The action taken by the menu. Has a valid value when the menu is being // shown. absl::optional<ContextMenuAction> action_taken_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModel); }; } // namespace extensions
diff --git a/chrome/browser/extensions/extension_context_menu_model_unittest.cc b/chrome/browser/extensions/extension_context_menu_model_unittest.cc index 3c0b526..2aa650d8 100644 --- a/chrome/browser/extensions/extension_context_menu_model_unittest.cc +++ b/chrome/browser/extensions/extension_context_menu_model_unittest.cc
@@ -242,6 +242,10 @@ ExtensionContextMenuModelTest(); + ExtensionContextMenuModelTest(const ExtensionContextMenuModelTest&) = delete; + ExtensionContextMenuModelTest& operator=( + const ExtensionContextMenuModelTest&) = delete; + // Build an extension to pass to the menu constructor, with the action // specified by |action_key|. const Extension* AddExtension(const std::string& name, @@ -282,8 +286,6 @@ std::unique_ptr<Browser> browser_; display::test::TestScreen test_screen_; std::unique_ptr<ScopedScreenOverride> scoped_screen_override_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModelTest); }; ExtensionContextMenuModelTest::ExtensionContextMenuModelTest() {}
diff --git a/chrome/browser/extensions/extension_csp_bypass_browsertest.cc b/chrome/browser/extensions/extension_csp_bypass_browsertest.cc index 38bb0d23..1cf83df 100644 --- a/chrome/browser/extensions/extension_csp_bypass_browsertest.cc +++ b/chrome/browser/extensions/extension_csp_bypass_browsertest.cc
@@ -34,6 +34,9 @@ public: ExtensionCSPBypassTest() {} + ExtensionCSPBypassTest(const ExtensionCSPBypassTest&) = delete; + ExtensionCSPBypassTest& operator=(const ExtensionCSPBypassTest&) = delete; + void SetUpOnMainThread() override { host_resolver()->AddRule("same-origin.com", "127.0.0.1"); host_resolver()->AddRule("cross-origin.com", "127.0.0.1"); @@ -110,8 +113,6 @@ private: std::vector<std::unique_ptr<TestExtensionDir>> temp_dirs_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionCSPBypassTest); }; } // namespace
diff --git a/chrome/browser/extensions/extension_garbage_collector_factory.h b/chrome/browser/extensions/extension_garbage_collector_factory.h index b55218c2..c3eeb50 100644 --- a/chrome/browser/extensions/extension_garbage_collector_factory.h +++ b/chrome/browser/extensions/extension_garbage_collector_factory.h
@@ -20,6 +20,11 @@ class ExtensionGarbageCollectorFactory : public BrowserContextKeyedServiceFactory { public: + ExtensionGarbageCollectorFactory(const ExtensionGarbageCollectorFactory&) = + delete; + ExtensionGarbageCollectorFactory& operator=( + const ExtensionGarbageCollectorFactory&) = delete; + static ExtensionGarbageCollector* GetForBrowserContext( content::BrowserContext* context); @@ -40,8 +45,6 @@ bool ServiceIsCreatedWithBrowserContext() const override; bool ServiceIsNULLWhileTesting() const override; - - DISALLOW_COPY_AND_ASSIGN(ExtensionGarbageCollectorFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/extension_install_prompt.h b/chrome/browser/extensions/extension_install_prompt.h index b7c9ce3..703e0dc 100644 --- a/chrome/browser/extensions/extension_install_prompt.h +++ b/chrome/browser/extensions/extension_install_prompt.h
@@ -300,6 +300,9 @@ // windows) is used if a new tab needs to be opened. ExtensionInstallPrompt(Profile* profile, gfx::NativeWindow native_window); + ExtensionInstallPrompt(const ExtensionInstallPrompt&) = delete; + ExtensionInstallPrompt& operator=(const ExtensionInstallPrompt&) = delete; + virtual ~ExtensionInstallPrompt(); extensions::ExtensionInstallUI* install_ui() const { @@ -403,8 +406,6 @@ bool did_call_show_dialog_; base::WeakPtrFactory<ExtensionInstallPrompt> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ExtensionInstallPrompt); }; #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_
diff --git a/chrome/browser/extensions/extension_management.h b/chrome/browser/extensions/extension_management.h index a6ac384..8bf1f10 100644 --- a/chrome/browser/extensions/extension_management.h +++ b/chrome/browser/extensions/extension_management.h
@@ -310,6 +310,10 @@ class ExtensionManagementFactory : public BrowserContextKeyedServiceFactory { public: + ExtensionManagementFactory(const ExtensionManagementFactory&) = delete; + ExtensionManagementFactory& operator=(const ExtensionManagementFactory&) = + delete; + static ExtensionManagement* GetForBrowserContext( content::BrowserContext* context); static ExtensionManagementFactory* GetInstance(); @@ -327,8 +331,6 @@ content::BrowserContext* context) const override; void RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) override; - - DISALLOW_COPY_AND_ASSIGN(ExtensionManagementFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/extension_management_internal.h b/chrome/browser/extensions/extension_management_internal.h index 106c933..90d1e0e 100644 --- a/chrome/browser/extensions/extension_management_internal.h +++ b/chrome/browser/extensions/extension_management_internal.h
@@ -50,6 +50,10 @@ IndividualSettings(); explicit IndividualSettings(const IndividualSettings* default_settings); + + IndividualSettings(const IndividualSettings&) = delete; + IndividualSettings& operator=(const IndividualSettings&) = delete; + ~IndividualSettings(); void Reset(); @@ -144,14 +148,15 @@ // all times. ExtensionManagement::ToolbarPinMode toolbar_pin = ExtensionManagement::ToolbarPinMode::kDefaultUnpinned; - - private: - DISALLOW_COPY_AND_ASSIGN(IndividualSettings); }; // Global extension management settings, applicable to all extensions. struct GlobalSettings { GlobalSettings(); + + GlobalSettings(const GlobalSettings&) = delete; + GlobalSettings& operator=(const GlobalSettings&) = delete; + ~GlobalSettings(); void Reset(); @@ -165,9 +170,6 @@ // only of |has_restricted_allowed_types| is set to true. std::vector<Manifest::Type> allowed_types; bool has_restricted_allowed_types; - - private: - DISALLOW_COPY_AND_ASSIGN(GlobalSettings); }; } // namespace internal
diff --git a/chrome/browser/extensions/extension_message_bubble_controller.h b/chrome/browser/extensions/extension_message_bubble_controller.h index 7efab5b..1b9a585 100644 --- a/chrome/browser/extensions/extension_message_bubble_controller.h +++ b/chrome/browser/extensions/extension_message_bubble_controller.h
@@ -132,6 +132,12 @@ }; ExtensionMessageBubbleController(Delegate* delegate, Browser* browser); + + ExtensionMessageBubbleController(const ExtensionMessageBubbleController&) = + delete; + ExtensionMessageBubbleController& operator=( + const ExtensionMessageBubbleController&) = delete; + ~ExtensionMessageBubbleController() override; Delegate* delegate() const { return delegate_.get(); } @@ -224,8 +230,6 @@ base::ScopedObservation<ExtensionRegistry, ExtensionRegistryObserver> extension_registry_observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleController); }; } // namespace extensions
diff --git a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc index 6e8c3bf..db3fbe0 100644 --- a/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc +++ b/chrome/browser/extensions/extension_message_bubble_controller_unittest.cc
@@ -139,6 +139,10 @@ action_(BUBBLE_ACTION_CLICK_ACTION_BUTTON), controller_(nullptr) {} + FakeExtensionMessageBubble(const FakeExtensionMessageBubble&) = delete; + FakeExtensionMessageBubble& operator=(const FakeExtensionMessageBubble&) = + delete; + void set_action_on_show(ExtensionBubbleAction action) { action_ = action; } @@ -185,8 +189,6 @@ bool is_closed_; ExtensionBubbleAction action_; ExtensionMessageBubbleController* controller_; - - DISALLOW_COPY_AND_ASSIGN(FakeExtensionMessageBubble); }; class ExtensionMessageBubbleTest : public BrowserWithTestWindowTest {
diff --git a/chrome/browser/extensions/extension_migrator.h b/chrome/browser/extensions/extension_migrator.h index 5b9de2cf..4517268 100644 --- a/chrome/browser/extensions/extension_migrator.h +++ b/chrome/browser/extensions/extension_migrator.h
@@ -25,6 +25,9 @@ const std::string& old_id, const std::string& new_id); + ExtensionMigrator(const ExtensionMigrator&) = delete; + ExtensionMigrator& operator=(const ExtensionMigrator&) = delete; + protected: ~ExtensionMigrator() override; @@ -37,8 +40,6 @@ Profile* profile_; const std::string old_id_; const std::string new_id_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionMigrator); }; } // namespace extensions
diff --git a/chrome/browser/extensions/extension_modules_apitest.cc b/chrome/browser/extensions/extension_modules_apitest.cc index 47e4c962..57debdb 100644 --- a/chrome/browser/extensions/extension_modules_apitest.cc +++ b/chrome/browser/extensions/extension_modules_apitest.cc
@@ -32,6 +32,9 @@ public: ExtensionModuleTest() = default; + ExtensionModuleTest(const ExtensionModuleTest&) = delete; + ExtensionModuleTest& operator=(const ExtensionModuleTest&) = delete; + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kIgnoreCertificateErrors); ExtensionApiTest::SetUpCommandLine(command_line); @@ -41,8 +44,6 @@ host_resolver()->AddRule(kExampleURL, "127.0.0.1"); ExtensionApiTest::SetUpOnMainThread(); } - - DISALLOW_COPY_AND_ASSIGN(ExtensionModuleTest); }; IN_PROC_BROWSER_TEST_F(ExtensionModuleTest, TestModulesAvailable) {
diff --git a/chrome/browser/extensions/extension_navigation_throttle_unittest.cc b/chrome/browser/extensions/extension_navigation_throttle_unittest.cc index 7edb7d9d..3bc69895 100644 --- a/chrome/browser/extensions/extension_navigation_throttle_unittest.cc +++ b/chrome/browser/extensions/extension_navigation_throttle_unittest.cc
@@ -59,6 +59,12 @@ : public ChromeRenderViewHostTestHarness { public: ExtensionNavigationThrottleUnitTest() {} + + ExtensionNavigationThrottleUnitTest( + const ExtensionNavigationThrottleUnitTest&) = delete; + ExtensionNavigationThrottleUnitTest& operator=( + const ExtensionNavigationThrottleUnitTest&) = delete; + void SetUp() override { ChromeRenderViewHostTestHarness::SetUp(); original_client_ = content::SetBrowserClientForTesting(&client_); @@ -187,8 +193,6 @@ scoped_refptr<const Extension> extension_; MockBrowserClient client_; content::ContentBrowserClient* original_client_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionNavigationThrottleUnitTest); }; // Tests the basic case of an external web page embedding an extension resource.
diff --git a/chrome/browser/extensions/extension_service_sync_unittest.cc b/chrome/browser/extensions/extension_service_sync_unittest.cc index 250c820..58971b1 100644 --- a/chrome/browser/extensions/extension_service_sync_unittest.cc +++ b/chrome/browser/extensions/extension_service_sync_unittest.cc
@@ -1847,6 +1847,11 @@ public: BlocklistedExtensionSyncServiceTest() {} + BlocklistedExtensionSyncServiceTest( + const BlocklistedExtensionSyncServiceTest&) = delete; + BlocklistedExtensionSyncServiceTest& operator=( + const BlocklistedExtensionSyncServiceTest&) = delete; + void SetUp() override { ExtensionServiceSyncTest::SetUp(); @@ -1897,8 +1902,6 @@ scoped_refptr<const Extension> extension_; std::string extension_id_; extensions::TestBlocklist test_blocklist_; - - DISALLOW_COPY_AND_ASSIGN(BlocklistedExtensionSyncServiceTest); }; // Test that sync cannot enable blocklisted extensions.
diff --git a/chrome/browser/extensions/extension_service_test_base.h b/chrome/browser/extensions/extension_service_test_base.h index 798dae7..72499b62 100644 --- a/chrome/browser/extensions/extension_service_test_base.h +++ b/chrome/browser/extensions/extension_service_test_base.h
@@ -79,6 +79,9 @@ ExtensionServiceInitParams(const ExtensionServiceInitParams& other); }; + ExtensionServiceTestBase(const ExtensionServiceTestBase&) = delete; + ExtensionServiceTestBase& operator=(const ExtensionServiceTestBase&) = delete; + // Public because parameterized test cases need it to be, or else the compiler // barfs. static void SetUpTestCase(); // faux-verride (static override). @@ -226,8 +229,6 @@ // An override that ignores CRX3 publisher signatures. SandboxedUnpacker::ScopedVerifierFormatOverrideForTest verifier_format_override_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionServiceTestBase); }; } // namespace extensions
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 75beb39..7573569f 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -338,6 +338,9 @@ profile_ = std::make_unique<TestingProfile>(); } + MockProviderVisitor(const MockProviderVisitor&) = delete; + MockProviderVisitor& operator=(const MockProviderVisitor&) = delete; + int Visit(const std::string& json_data) { return Visit(json_data, ManifestLocation::kExternalPref, ManifestLocation::kExternalPrefDownload); @@ -485,8 +488,6 @@ ManifestLocation crx_location_; std::unique_ptr<base::DictionaryValue> prefs_; std::unique_ptr<TestingProfile> profile_; - - DISALLOW_COPY_AND_ASSIGN(MockProviderVisitor); }; // Mock provider that can simulate incremental update like @@ -499,6 +500,10 @@ explicit MockUpdateProviderVisitor(base::FilePath fake_base_path) : MockProviderVisitor(fake_base_path) {} + MockUpdateProviderVisitor(const MockUpdateProviderVisitor&) = delete; + MockUpdateProviderVisitor& operator=(const MockUpdateProviderVisitor&) = + delete; + void VisitDueToUpdate(const std::string& json_data) { update_url_extension_ids_.clear(); file_extension_ids_.clear(); @@ -548,12 +553,15 @@ std::set<std::string> update_url_extension_ids_; std::set<std::string> file_extension_ids_; std::set<std::string> removed_extension_ids_; - - DISALLOW_COPY_AND_ASSIGN(MockUpdateProviderVisitor); }; struct MockExtensionRegistryObserver : public ExtensionRegistryObserver { MockExtensionRegistryObserver() = default; + + MockExtensionRegistryObserver(const MockExtensionRegistryObserver&) = delete; + MockExtensionRegistryObserver& operator=( + const MockExtensionRegistryObserver&) = delete; + ~MockExtensionRegistryObserver() override = default; // ExtensionRegistryObserver: @@ -582,9 +590,6 @@ std::string last_extension_unloaded; std::string last_extension_installed; std::string last_extension_uninstalled; - - private: - DISALLOW_COPY_AND_ASSIGN(MockExtensionRegistryObserver); }; class ExtensionServiceTest : public ExtensionServiceTestWithInstall { @@ -799,6 +804,10 @@ public: PackExtensionTestClient(const base::FilePath& expected_crx_path, const base::FilePath& expected_private_key_path); + + PackExtensionTestClient(const PackExtensionTestClient&) = delete; + PackExtensionTestClient& operator=(const PackExtensionTestClient&) = delete; + void OnPackSuccess(const base::FilePath& crx_path, const base::FilePath& private_key_path) override; void OnPackFailure(const std::string& error_message, @@ -807,7 +816,6 @@ private: const base::FilePath expected_crx_path_; const base::FilePath expected_private_key_path_; - DISALLOW_COPY_AND_ASSIGN(PackExtensionTestClient); }; PackExtensionTestClient::PackExtensionTestClient(
diff --git a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc index baa7c51..36b697d8 100644 --- a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc +++ b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
@@ -45,6 +45,9 @@ expected_change_flags_(0) { } + PolicyChangeObserver(const PolicyChangeObserver&) = delete; + PolicyChangeObserver& operator=(const PolicyChangeObserver&) = delete; + void OnGranted(const url::Origin& origin, int change_flags) override { EXPECT_EQ(expected_type_, NOTIFICATION_TYPE_GRANT); EXPECT_EQ(expected_origin_, origin.GetURL()); @@ -96,8 +99,6 @@ GURL expected_origin_; int expected_change_flags_; - - DISALLOW_COPY_AND_ASSIGN(PolicyChangeObserver); }; void SetUp() override {
diff --git a/chrome/browser/extensions/extension_system_factory.h b/chrome/browser/extensions/extension_system_factory.h index eeba13d..ee73c38 100644 --- a/chrome/browser/extensions/extension_system_factory.h +++ b/chrome/browser/extensions/extension_system_factory.h
@@ -18,6 +18,10 @@ // Should not be used except by ExtensionSystem(Factory). class ExtensionSystemSharedFactory : public BrowserContextKeyedServiceFactory { public: + ExtensionSystemSharedFactory(const ExtensionSystemSharedFactory&) = delete; + ExtensionSystemSharedFactory& operator=(const ExtensionSystemSharedFactory&) = + delete; + static ExtensionSystemImpl::Shared* GetForBrowserContext( content::BrowserContext* context); @@ -34,14 +38,15 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(ExtensionSystemSharedFactory); }; // BrowserContextKeyedServiceFactory for ExtensionSystemImpl. // TODO(yoz): Rename to ExtensionSystemImplFactory. class ExtensionSystemFactory : public ExtensionSystemProvider { public: + ExtensionSystemFactory(const ExtensionSystemFactory&) = delete; + ExtensionSystemFactory& operator=(const ExtensionSystemFactory&) = delete; + // ExtensionSystem provider implementation: ExtensionSystem* GetForBrowserContext( content::BrowserContext* context) override; @@ -60,8 +65,6 @@ content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; bool ServiceIsCreatedWithBrowserContext() const override; - - DISALLOW_COPY_AND_ASSIGN(ExtensionSystemFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/extension_tabs_apitest.cc b/chrome/browser/extensions/extension_tabs_apitest.cc index 9a30aab..0fb70a73 100644 --- a/chrome/browser/extensions/extension_tabs_apitest.cc +++ b/chrome/browser/extensions/extension_tabs_apitest.cc
@@ -71,13 +71,7 @@ } }; -// Flaky on chromeos: http://crbug.com/870322 -#if BUILDFLAG(IS_CHROMEOS_ASH) -#define MAYBE_Tabs DISABLED_Tabs -#else -#define MAYBE_Tabs Tabs -#endif -IN_PROC_BROWSER_TEST_F(ExtensionApiNewTabTest, MAYBE_Tabs) { +IN_PROC_BROWSER_TEST_F(ExtensionApiNewTabTest, Tabs) { // The test creates a tab and checks that the URL of the new tab // is that of the new tab page. Make sure the pref that controls // this is set.
diff --git a/chrome/browser/extensions/extension_uninstall_dialog.h b/chrome/browser/extensions/extension_uninstall_dialog.h index d92bd90..2ee3af00 100644 --- a/chrome/browser/extensions/extension_uninstall_dialog.h +++ b/chrome/browser/extensions/extension_uninstall_dialog.h
@@ -73,6 +73,9 @@ static std::unique_ptr<ExtensionUninstallDialog> CreateViews(Profile* profile, gfx::NativeWindow parent, Delegate* delegate); + ExtensionUninstallDialog(const ExtensionUninstallDialog&) = delete; + ExtensionUninstallDialog& operator=(const ExtensionUninstallDialog&) = delete; + ~ExtensionUninstallDialog() override; // This is called to verify whether the uninstallation should proceed. @@ -191,8 +194,6 @@ base::ScopedObservation<Profile, ProfileObserver> profile_observation_{this}; base::ThreadChecker thread_checker_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialog); }; } // namespace extensions
diff --git a/chrome/browser/extensions/extension_user_script_loader_unittest.cc b/chrome/browser/extensions/extension_user_script_loader_unittest.cc index 5361da5..922e14d 100644 --- a/chrome/browser/extensions/extension_user_script_loader_unittest.cc +++ b/chrome/browser/extensions/extension_user_script_loader_unittest.cc
@@ -48,6 +48,10 @@ public: ExtensionUserScriptLoaderTest() = default; + ExtensionUserScriptLoaderTest(const ExtensionUserScriptLoaderTest&) = delete; + ExtensionUserScriptLoaderTest& operator=( + const ExtensionUserScriptLoaderTest&) = delete; + void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); } @@ -57,8 +61,6 @@ private: content::BrowserTaskEnvironment task_environment_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionUserScriptLoaderTest); }; // Test that a callback passed in will get called once scripts are loaded.
diff --git a/chrome/browser/extensions/extension_view_host.cc b/chrome/browser/extensions/extension_view_host.cc index bc44eb1..62c3704d 100644 --- a/chrome/browser/extensions/extension_view_host.cc +++ b/chrome/browser/extensions/extension_view_host.cc
@@ -6,7 +6,6 @@ #include "base/strings/string_piece.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/extensions/browser_extension_window_controller.h" #include "chrome/browser/extensions/extension_view.h" #include "chrome/browser/extensions/window_controller.h" @@ -20,7 +19,6 @@ #include "content/public/browser/color_chooser.h" #include "content/public/browser/file_select_listener.h" #include "content/public/browser/keyboard_event_processing_result.h" -#include "content/public/browser/notification_source.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host.h" @@ -136,9 +134,8 @@ if (!ExtensionSystem::Get(browser_context())-> runtime_data()->IsBackgroundPageReady(extension())) { // Make sure the background page loads before any others. - registrar_.Add(this, - extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, - content::Source<Extension>(extension())); + host_registry_observation_.Observe( + ExtensionHostRegistry::Get(browser_context())); return; } @@ -292,13 +289,22 @@ : nullptr; } -void ExtensionViewHost::Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) { - DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY); +void ExtensionViewHost::OnExtensionHostDocumentElementAvailable( + content::BrowserContext* host_browser_context, + ExtensionHost* extension_host) { + DCHECK(extension_host->extension()); + if (host_browser_context != browser_context() || + extension_host->extension() != extension() || + extension_host->extension_host_type() != + mojom::ViewType::kExtensionBackgroundPage) { + return; + } + DCHECK(ExtensionSystem::Get(browser_context()) ->runtime_data() ->IsBackgroundPageReady(extension())); + // We only needed to wait for the background page to load, so stop observing. + host_registry_observation_.Reset(); LoadInitialURL(); }
diff --git a/chrome/browser/extensions/extension_view_host.h b/chrome/browser/extensions/extension_view_host.h index b25dbf4..c47c8f52a 100644 --- a/chrome/browser/extensions/extension_view_host.h +++ b/chrome/browser/extensions/extension_view_host.h
@@ -8,12 +8,12 @@ #include <memory> #include "base/macros.h" +#include "base/scoped_observation.h" #include "build/build_config.h" #include "components/web_modal/web_contents_modal_dialog_host.h" #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" -#include "content/public/browser/notification_observer.h" -#include "content/public/browser/notification_registrar.h" #include "extensions/browser/extension_host.h" +#include "extensions/browser/extension_host_registry.h" #include "extensions/common/mojom/view_type.mojom.h" class Browser; @@ -34,7 +34,7 @@ : public ExtensionHost, public web_modal::WebContentsModalDialogManagerDelegate, public web_modal::WebContentsModalDialogHost, - public content::NotificationObserver { + public ExtensionHostRegistry::Observer { public: // |browser| may be null, since extension views may be bound to TabContents // hosted in ExternalTabContainer objects, which do not instantiate Browsers. @@ -111,10 +111,10 @@ content::WebContents* GetAssociatedWebContents() const override; content::WebContents* GetVisibleWebContents() const override; - // content::NotificationObserver - void Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) override; + // ExtensionHostRegistry::Observer: + void OnExtensionHostDocumentElementAvailable( + content::BrowserContext* browser_context, + ExtensionHost* extension_host) override; private: // Returns whether the provided event is a raw escape keypress in a @@ -125,7 +125,7 @@ Browser* browser_; // View that shows the rendered content in the UI. - ExtensionView* view_; + ExtensionView* view_ = nullptr; // The relevant WebContents associated with this ExtensionViewHost, if any. content::WebContents* associated_web_contents_ = nullptr; @@ -135,7 +135,9 @@ std::unique_ptr<AssociatedWebContentsObserver> associated_web_contents_observer_; - content::NotificationRegistrar registrar_; + base::ScopedObservation<ExtensionHostRegistry, + ExtensionHostRegistry::Observer> + host_registry_observation_{this}; }; } // namespace extensions
diff --git a/chrome/browser/extensions/extension_view_host_factory.h b/chrome/browser/extensions/extension_view_host_factory.h index 4a864dc..b1fbc2f 100644 --- a/chrome/browser/extensions/extension_view_host_factory.h +++ b/chrome/browser/extensions/extension_view_host_factory.h
@@ -21,6 +21,9 @@ // by extensions. class ExtensionViewHostFactory { public: + ExtensionViewHostFactory(const ExtensionViewHostFactory&) = delete; + ExtensionViewHostFactory& operator=(const ExtensionViewHostFactory&) = delete; + // Creates a new ExtensionHost with its associated view, grouping it in the // appropriate SiteInstance (and therefore process) based on the URL and // profile. @@ -31,9 +34,6 @@ // hence only require a |profile|. static std::unique_ptr<ExtensionViewHost> CreateDialogHost(const GURL& url, Profile* profile); - - private: - DISALLOW_COPY_AND_ASSIGN(ExtensionViewHostFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/external_component_loader.h b/chrome/browser/extensions/external_component_loader.h index c2497ed..c8f631d 100644 --- a/chrome/browser/extensions/external_component_loader.h +++ b/chrome/browser/extensions/external_component_loader.h
@@ -28,6 +28,9 @@ public: explicit ExternalComponentLoader(Profile* profile); + ExternalComponentLoader(const ExternalComponentLoader&) = delete; + ExternalComponentLoader& operator=(const ExternalComponentLoader&) = delete; + protected: void StartLoading() override; @@ -41,7 +44,6 @@ // The profile that this loader is associated with. It listens for // preference changes for that profile. Profile* profile_; - DISALLOW_COPY_AND_ASSIGN(ExternalComponentLoader); }; } // namespace extensions
diff --git a/chrome/browser/extensions/external_policy_loader.h b/chrome/browser/extensions/external_policy_loader.h index a34fc31..9342543 100644 --- a/chrome/browser/extensions/external_policy_loader.h +++ b/chrome/browser/extensions/external_policy_loader.h
@@ -38,6 +38,9 @@ ExtensionManagement* settings, InstallationType type); + ExternalPolicyLoader(const ExternalPolicyLoader&) = delete; + ExternalPolicyLoader& operator=(const ExternalPolicyLoader&) = delete; + // ExtensionManagement::Observer implementation void OnExtensionManagementSettingsChanged() override; @@ -57,8 +60,6 @@ Profile* profile_; ExtensionManagement* settings_; InstallationType type_; - - DISALLOW_COPY_AND_ASSIGN(ExternalPolicyLoader); }; } // namespace extensions
diff --git a/chrome/browser/extensions/external_policy_loader_unittest.cc b/chrome/browser/extensions/external_policy_loader_unittest.cc index 4db1e184..6e9b7e80 100644 --- a/chrome/browser/extensions/external_policy_loader_unittest.cc +++ b/chrome/browser/extensions/external_policy_loader_unittest.cc
@@ -46,6 +46,11 @@ MockExternalPolicyProviderVisitor() { } + MockExternalPolicyProviderVisitor(const MockExternalPolicyProviderVisitor&) = + delete; + MockExternalPolicyProviderVisitor& operator=( + const MockExternalPolicyProviderVisitor&) = delete; + // Initialize a provider with |policy_forcelist|, and check that it installs // exactly the extensions specified in |expected_extensions|. void Visit(const base::DictionaryValue& policy_forcelist, @@ -114,8 +119,6 @@ std::unique_ptr<TestingProfile> profile_; std::unique_ptr<ExternalProviderImpl> provider_; - - DISALLOW_COPY_AND_ASSIGN(MockExternalPolicyProviderVisitor); }; TEST_F(ExternalPolicyLoaderTest, PolicyIsParsed) {
diff --git a/chrome/browser/extensions/external_pref_loader.h b/chrome/browser/extensions/external_pref_loader.h index 17d5463..564baf8 100644 --- a/chrome/browser/extensions/external_pref_loader.h +++ b/chrome/browser/extensions/external_pref_loader.h
@@ -49,6 +49,9 @@ // |options| is combination of |Options|. ExternalPrefLoader(int base_path_id, int options, Profile* profile); + ExternalPrefLoader(const ExternalPrefLoader&) = delete; + ExternalPrefLoader& operator=(const ExternalPrefLoader&) = delete; + const base::FilePath GetBaseCrxFilePath() override; protected: @@ -129,8 +132,6 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) std::vector<std::unique_ptr<PrioritySyncReadyWaiter>> pending_waiter_list_; #endif - - DISALLOW_COPY_AND_ASSIGN(ExternalPrefLoader); }; } // namespace extensions
diff --git a/chrome/browser/extensions/external_pref_loader_unittest.cc b/chrome/browser/extensions/external_pref_loader_unittest.cc index e76fff2..389d5fa7 100644 --- a/chrome/browser/extensions/external_pref_loader_unittest.cc +++ b/chrome/browser/extensions/external_pref_loader_unittest.cc
@@ -81,6 +81,9 @@ profile), load_callback_(std::move(load_callback)) {} + TestExternalPrefLoader(const TestExternalPrefLoader&) = delete; + TestExternalPrefLoader& operator=(const TestExternalPrefLoader&) = delete; + void LoadOnFileThread() override { content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, std::move(load_callback_)); @@ -89,8 +92,6 @@ private: ~TestExternalPrefLoader() override {} base::OnceClosure load_callback_; - - DISALLOW_COPY_AND_ASSIGN(TestExternalPrefLoader); }; class ExternalPrefLoaderTestBase : public ::testing::Test {
diff --git a/chrome/browser/extensions/external_registry_loader_win.h b/chrome/browser/extensions/external_registry_loader_win.h index 7a49ac3..2ea20f34 100644 --- a/chrome/browser/extensions/external_registry_loader_win.h +++ b/chrome/browser/extensions/external_registry_loader_win.h
@@ -16,6 +16,9 @@ public: ExternalRegistryLoader(); + ExternalRegistryLoader(const ExternalRegistryLoader&) = delete; + ExternalRegistryLoader& operator=(const ExternalRegistryLoader&) = delete; + protected: ~ExternalRegistryLoader() override; // protected for unit test. @@ -43,8 +46,6 @@ // Task runner where registry keys are read. scoped_refptr<base::SequencedTaskRunner> task_runner_; - - DISALLOW_COPY_AND_ASSIGN(ExternalRegistryLoader); }; } // namespace extensions
diff --git a/chrome/browser/extensions/external_registry_loader_win_unittest.cc b/chrome/browser/extensions/external_registry_loader_win_unittest.cc index 9f7c69b..28fe78c 100644 --- a/chrome/browser/extensions/external_registry_loader_win_unittest.cc +++ b/chrome/browser/extensions/external_registry_loader_win_unittest.cc
@@ -24,6 +24,10 @@ public: TestExternalRegistryLoader() {} + TestExternalRegistryLoader(const TestExternalRegistryLoader&) = delete; + TestExternalRegistryLoader& operator=(const TestExternalRegistryLoader&) = + delete; + using ExternalRegistryLoader::StartLoading; void WaitForTwoLoadsToFinished() { @@ -58,8 +62,6 @@ int load_finished_count_ = 0; int id_ = 0; std::vector<int> prefs_test_ids_; - - DISALLOW_COPY_AND_ASSIGN(TestExternalRegistryLoader); }; } // namespace
diff --git a/chrome/browser/extensions/file_iframe_apitest.cc b/chrome/browser/extensions/file_iframe_apitest.cc index fbc953c..73b72166 100644 --- a/chrome/browser/extensions/file_iframe_apitest.cc +++ b/chrome/browser/extensions/file_iframe_apitest.cc
@@ -19,6 +19,10 @@ class FileIFrameAPITest : public extensions::ExtensionBrowserTest { public: FileIFrameAPITest() {} + + FileIFrameAPITest(const FileIFrameAPITest&) = delete; + FileIFrameAPITest& operator=(const FileIFrameAPITest&) = delete; + void set_has_all_urls(bool val) { has_all_urls_ = val; } void set_has_file_access(bool val) { has_file_access_ = val; } @@ -80,8 +84,6 @@ bool has_all_urls_ = false; bool has_file_access_ = false; extensions::TestExtensionDir extension_dir_; - - DISALLOW_COPY_AND_ASSIGN(FileIFrameAPITest); }; // Tests that an extension frame can embed a file iframe if it has file access
diff --git a/chrome/browser/extensions/install_tracker_factory.h b/chrome/browser/extensions/install_tracker_factory.h index 214e9509..58a1468 100644 --- a/chrome/browser/extensions/install_tracker_factory.h +++ b/chrome/browser/extensions/install_tracker_factory.h
@@ -18,6 +18,9 @@ class InstallTrackerFactory : public BrowserContextKeyedServiceFactory { public: + InstallTrackerFactory(const InstallTrackerFactory&) = delete; + InstallTrackerFactory& operator=(const InstallTrackerFactory&) = delete; + static InstallTracker* GetForBrowserContext(content::BrowserContext* context); static InstallTrackerFactory* GetInstance(); @@ -32,8 +35,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(InstallTrackerFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/install_verifier_factory.h b/chrome/browser/extensions/install_verifier_factory.h index e10bedec..b95ef3f3 100644 --- a/chrome/browser/extensions/install_verifier_factory.h +++ b/chrome/browser/extensions/install_verifier_factory.h
@@ -15,6 +15,9 @@ class InstallVerifierFactory : public BrowserContextKeyedServiceFactory { public: + InstallVerifierFactory(const InstallVerifierFactory&) = delete; + InstallVerifierFactory& operator=(const InstallVerifierFactory&) = delete; + static InstallVerifier* GetForBrowserContext( content::BrowserContext* context); static InstallVerifierFactory* GetInstance(); @@ -30,8 +33,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(InstallVerifierFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/load_error_reporter.h b/chrome/browser/extensions/load_error_reporter.h index 98479f9..60d2222 100644 --- a/chrome/browser/extensions/load_error_reporter.h +++ b/chrome/browser/extensions/load_error_reporter.h
@@ -39,6 +39,9 @@ const std::string& error) = 0; }; + LoadErrorReporter(const LoadErrorReporter&) = delete; + LoadErrorReporter& operator=(const LoadErrorReporter&) = delete; + // Initializes the error reporter. Must be called before any other methods // and on the UI thread. static void Init(bool enable_noisy_errors); @@ -81,8 +84,6 @@ bool enable_noisy_errors_; base::ObserverList<Observer>::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(LoadErrorReporter); }; } // namespace extensions
diff --git a/chrome/browser/extensions/menu_manager.h b/chrome/browser/extensions/menu_manager.h index 6e44a6d..b190632 100644 --- a/chrome/browser/extensions/menu_manager.h +++ b/chrome/browser/extensions/menu_manager.h
@@ -169,6 +169,10 @@ bool enabled, Type type, const ContextList& contexts); + + MenuItem(const MenuItem&) = delete; + MenuItem& operator=(const MenuItem&) = delete; + virtual ~MenuItem(); // Simple accessor methods. @@ -279,8 +283,6 @@ // Any children this item may have. OwnedList children_; - - DISALLOW_COPY_AND_ASSIGN(MenuItem); }; // This class keeps track of menu items added by extensions.
diff --git a/chrome/browser/extensions/menu_manager_unittest.cc b/chrome/browser/extensions/menu_manager_unittest.cc index c433ff2..00bbf20 100644 --- a/chrome/browser/extensions/menu_manager_unittest.cc +++ b/chrome/browser/extensions/menu_manager_unittest.cc
@@ -62,6 +62,9 @@ prefs_(base::ThreadTaskRunnerHandle::Get()), next_id_(1) {} + MenuManagerTest(const MenuManagerTest&) = delete; + MenuManagerTest& operator=(const MenuManagerTest&) = delete; + void TearDown() override { prefs_.pref_service()->CommitPendingWrite(); base::RunLoop().RunUntilIdle(); @@ -107,9 +110,6 @@ ExtensionList extensions_; TestExtensionPrefs prefs_; int next_id_; - - private: - DISALLOW_COPY_AND_ASSIGN(MenuManagerTest); }; // Tests adding, getting, and removing items. @@ -489,6 +489,9 @@ public: explicit MockEventRouter(Profile* profile) : EventRouter(profile, NULL) {} + MockEventRouter(const MockEventRouter&) = delete; + MockEventRouter& operator=(const MockEventRouter&) = delete; + MOCK_METHOD6(DispatchEventToExtensionMock, void(const std::string& extension_id, const std::string& event_name, @@ -506,9 +509,6 @@ event->event_url, event->user_gesture); } - - private: - DISALLOW_COPY_AND_ASSIGN(MockEventRouter); }; // MockEventRouter factory function
diff --git a/chrome/browser/extensions/mock_extension_special_storage_policy.h b/chrome/browser/extensions/mock_extension_special_storage_policy.h index e06a4d9..b42e793 100644 --- a/chrome/browser/extensions/mock_extension_special_storage_policy.h +++ b/chrome/browser/extensions/mock_extension_special_storage_policy.h
@@ -19,6 +19,11 @@ public: MockExtensionSpecialStoragePolicy(); + MockExtensionSpecialStoragePolicy(const MockExtensionSpecialStoragePolicy&) = + delete; + MockExtensionSpecialStoragePolicy& operator=( + const MockExtensionSpecialStoragePolicy&) = delete; + // storage::SpecialStoragePolicy: bool IsStorageProtected(const GURL& origin) override; bool IsStorageUnlimited(const GURL& origin) override; @@ -34,8 +39,6 @@ ~MockExtensionSpecialStoragePolicy() override; std::set<GURL> protected_; - - DISALLOW_COPY_AND_ASSIGN(MockExtensionSpecialStoragePolicy); }; #endif // CHROME_BROWSER_EXTENSIONS_MOCK_EXTENSION_SPECIAL_STORAGE_POLICY_H_
diff --git a/chrome/browser/extensions/navigation_observer_browsertest.cc b/chrome/browser/extensions/navigation_observer_browsertest.cc index fe0bec7..d12ac3d 100644 --- a/chrome/browser/extensions/navigation_observer_browsertest.cc +++ b/chrome/browser/extensions/navigation_observer_browsertest.cc
@@ -183,6 +183,11 @@ browser()->tab_strip_model()->GetActiveWebContents(); EXPECT_EQ(web_contents->GetMainFrame()->GetLastCommittedURL(), main_url); + // Emulate a user gesture so that the current entry won't be skipped due to + // the history manipulation intervention when we try to navigate back to it. + web_contents->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests( + std::u16string()); + // Navigate subframe to an enabled extension URL. scoped_refptr<const Extension> extension = ChromeTestExtensionLoader(profile()).LoadExtension( @@ -194,6 +199,7 @@ content::RenderFrameHost* subframe = ChildFrameAt(web_contents->GetMainFrame(), 0); EXPECT_EQ(subframe->GetLastCommittedURL(), extension_url); + EXPECT_EQ(web_contents->GetController().GetEntryCount(), 3); scoped_refptr<content::SiteInstance> extension_site_instance = subframe->GetSiteInstance(); @@ -214,8 +220,10 @@ // which is important for reproducing https://crbug.com/1197360. web_contents->GetController().GoBack(); EXPECT_TRUE(content::WaitForLoadStop(web_contents)); + EXPECT_EQ(web_contents->GetController().GetLastCommittedEntryIndex(), 1); web_contents->GetController().GoForward(); EXPECT_TRUE(content::WaitForLoadStop(web_contents)); + EXPECT_EQ(web_contents->GetController().GetLastCommittedEntryIndex(), 2); subframe = ChildFrameAt(web_contents->GetMainFrame(), 0); EXPECT_EQ(subframe->GetLastCommittedURL(), extension_url);
diff --git a/chrome/browser/extensions/pack_extension_job.h b/chrome/browser/extensions/pack_extension_job.h index 8d7fc8f..2741af9 100644 --- a/chrome/browser/extensions/pack_extension_job.h +++ b/chrome/browser/extensions/pack_extension_job.h
@@ -38,6 +38,10 @@ const base::FilePath& root_directory, const base::FilePath& key_file, int run_flags); + + PackExtensionJob(const PackExtensionJob&) = delete; + PackExtensionJob& operator=(const PackExtensionJob&) = delete; + ~PackExtensionJob(); // Starts the packing job. @@ -69,8 +73,6 @@ // Used to check methods that run on |client_|'s sequence. SEQUENCE_CHECKER(sequence_checker_); - - DISALLOW_COPY_AND_ASSIGN(PackExtensionJob); }; } // namespace extensions
diff --git a/chrome/browser/extensions/permissions_updater.cc b/chrome/browser/extensions/permissions_updater.cc index 1c85fe6..cd353bb 100644 --- a/chrome/browser/extensions/permissions_updater.cc +++ b/chrome/browser/extensions/permissions_updater.cc
@@ -105,6 +105,11 @@ class PermissionsUpdaterShutdownNotifierFactory : public BrowserContextKeyedServiceShutdownNotifierFactory { public: + PermissionsUpdaterShutdownNotifierFactory( + const PermissionsUpdaterShutdownNotifierFactory&) = delete; + PermissionsUpdaterShutdownNotifierFactory& operator=( + const PermissionsUpdaterShutdownNotifierFactory&) = delete; + static PermissionsUpdaterShutdownNotifierFactory* GetInstance() { static base::NoDestructor<PermissionsUpdaterShutdownNotifierFactory> factory; @@ -121,8 +126,6 @@ DependsOn(ExtensionSystemFactory::GetInstance()); } ~PermissionsUpdaterShutdownNotifierFactory() override {} - - DISALLOW_COPY_AND_ASSIGN(PermissionsUpdaterShutdownNotifierFactory); }; void SetCorsOriginAccessListForAllRelatedProfiles( @@ -148,6 +151,11 @@ // (whichever happens first). class PermissionsUpdater::NetworkPermissionsUpdateHelper { public: + NetworkPermissionsUpdateHelper(const NetworkPermissionsUpdateHelper&) = + delete; + NetworkPermissionsUpdateHelper& operator=( + const NetworkPermissionsUpdateHelper&) = delete; + static void UpdatePermissions(content::BrowserContext* browser_context, EventType event_type, scoped_refptr<const Extension> extension, @@ -171,8 +179,6 @@ base::OnceClosure dispatch_event_; base::CallbackListSubscription shutdown_subscription_; base::WeakPtrFactory<NetworkPermissionsUpdateHelper> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(NetworkPermissionsUpdateHelper); }; // static
diff --git a/chrome/browser/extensions/preinstalled_apps.h b/chrome/browser/extensions/preinstalled_apps.h index af68e01..a60c3ac0 100644 --- a/chrome/browser/extensions/preinstalled_apps.h +++ b/chrome/browser/extensions/preinstalled_apps.h
@@ -50,6 +50,9 @@ extensions::mojom::ManifestLocation download_location, int creation_flags); + Provider(const Provider&) = delete; + Provider& operator=(const Provider&) = delete; + // ExternalProviderImpl overrides: void VisitRegisteredExtension() override; void SetPrefs(std::unique_ptr<base::DictionaryValue> prefs) override; @@ -74,8 +77,6 @@ // Whether this class should perform a new installation, such as for a // new profile. bool perform_new_installation_ = false; - - DISALLOW_COPY_AND_ASSIGN(Provider); }; } // namespace preinstalled_apps
diff --git a/chrome/browser/extensions/process_management_browsertest.cc b/chrome/browser/extensions/process_management_browsertest.cc index 63c3926..addd7b7b 100644 --- a/chrome/browser/extensions/process_management_browsertest.cc +++ b/chrome/browser/extensions/process_management_browsertest.cc
@@ -104,6 +104,11 @@ public: ChromeWebStoreInIsolatedOriginTest() {} + ChromeWebStoreInIsolatedOriginTest( + const ChromeWebStoreInIsolatedOriginTest&) = delete; + ChromeWebStoreInIsolatedOriginTest& operator=( + const ChromeWebStoreInIsolatedOriginTest&) = delete; + void SetUpCommandLine(base::CommandLine* command_line) override { ChromeWebStoreProcessTest::SetUpCommandLine(command_line); @@ -111,9 +116,6 @@ command_line->AppendSwitchASCII(::switches::kIsolateOrigins, gallery_url().spec()); } - - private: - DISALLOW_COPY_AND_ASSIGN(ChromeWebStoreInIsolatedOriginTest); }; } // namespace
diff --git a/chrome/browser/extensions/process_manager_browsertest.cc b/chrome/browser/extensions/process_manager_browsertest.cc index 99beada..0bcb745 100644 --- a/chrome/browser/extensions/process_manager_browsertest.cc +++ b/chrome/browser/extensions/process_manager_browsertest.cc
@@ -162,6 +162,10 @@ base::BindRepeating(&AddFrameToSet, base::Unretained(&frames_))); } + NavigationCompletedObserver(const NavigationCompletedObserver&) = delete; + NavigationCompletedObserver& operator=(const NavigationCompletedObserver&) = + delete; + void Wait() { if (!AreAllFramesInTab()) message_loop_runner_->Run(); @@ -190,8 +194,6 @@ std::set<content::RenderFrameHost*> frames_; scoped_refptr<content::MessageLoopRunner> message_loop_runner_; - - DISALLOW_COPY_AND_ASSIGN(NavigationCompletedObserver); }; // Exists as a browser test because ExtensionHosts are hard to create without
diff --git a/chrome/browser/extensions/service_worker_apitest.cc b/chrome/browser/extensions/service_worker_apitest.cc index d09f65c..45b1513 100644 --- a/chrome/browser/extensions/service_worker_apitest.cc +++ b/chrome/browser/extensions/service_worker_apitest.cc
@@ -101,6 +101,10 @@ : content::WebContentsObserver(web_contents), load_stop_observed_(false) {} + WebContentsLoadStopObserver(const WebContentsLoadStopObserver&) = delete; + WebContentsLoadStopObserver& operator=(const WebContentsLoadStopObserver&) = + delete; + void WaitForLoadStop() { if (load_stop_observed_) return; @@ -117,8 +121,6 @@ bool load_stop_observed_; scoped_refptr<content::MessageLoopRunner> message_loop_runner_; - - DISALLOW_COPY_AND_ASSIGN(WebContentsLoadStopObserver); }; // Extension ID for tests that use @@ -161,6 +163,10 @@ }; class ServiceWorkerTest : public ExtensionApiTest { + public: + ServiceWorkerTest(const ServiceWorkerTest&) = delete; + ServiceWorkerTest& operator=(const ServiceWorkerTest&) = delete; + protected: ServiceWorkerTest() = default; ~ServiceWorkerTest() override = default; @@ -245,9 +251,6 @@ ->GetServiceWorkerContext(); return sw_context->CountExternalRequestsForTest(key); } - - private: - DISALLOW_COPY_AND_ASSIGN(ServiceWorkerTest); }; class ServiceWorkerBasedBackgroundTest : public ServiceWorkerTest { @@ -300,23 +303,6 @@ } }; -// A specialization of ExtensionSettingsApiTest that pretends it's running -// on version_info::Channel::UNKNOWN. -class ServiceWorkerBasedBackgroundTrunkTest - : public ServiceWorkerBasedBackgroundTest { - public: - ServiceWorkerBasedBackgroundTrunkTest() = default; - ~ServiceWorkerBasedBackgroundTrunkTest() override = default; - ServiceWorkerBasedBackgroundTrunkTest( - const ServiceWorkerBasedBackgroundTrunkTest& other) = delete; - ServiceWorkerBasedBackgroundTrunkTest& operator=( - const ServiceWorkerBasedBackgroundTrunkTest& other) = delete; - - private: - // TODO(crbug.com/1185226): Remove unknown channel when chrome.storage.session - // is released in stable. - ScopedCurrentChannel current_channel_{version_info::Channel::UNKNOWN}; -}; class ServiceWorkerBasedBackgroundTestWithNotification : public ServiceWorkerBasedBackgroundTest { @@ -549,22 +535,14 @@ } // Tests chrome.storage APIs. -// TODO(crbug.com/1185226): Change parent class to -// `ServiceWorkerBasedBackgroundTest` when chrome.storage.session is released in -// stable. -IN_PROC_BROWSER_TEST_F(ServiceWorkerBasedBackgroundTrunkTest, - StorageSetAndGet) { +IN_PROC_BROWSER_TEST_F(ServiceWorkerBasedBackgroundTest, StorageSetAndGet) { ASSERT_TRUE( RunExtensionTest("service_worker/worker_based_background/storage")) << message_; } // Tests chrome.storage APIs are only enabled with permission. -// TODO(crbug.com/1185226): Change parent class to -// `ServiceWorkerBasedBackgroundTest` when chrome.storage.session is released in -// stable. -IN_PROC_BROWSER_TEST_F(ServiceWorkerBasedBackgroundTrunkTest, - StorageNoPermissions) { +IN_PROC_BROWSER_TEST_F(ServiceWorkerBasedBackgroundTest, StorageNoPermissions) { ASSERT_TRUE(RunExtensionTest( "service_worker/worker_based_background/storage_no_permissions")) << message_;
diff --git a/chrome/browser/extensions/startup_helper.cc b/chrome/browser/extensions/startup_helper.cc index 0a8cc806..b91d3d88 100644 --- a/chrome/browser/extensions/startup_helper.cc +++ b/chrome/browser/extensions/startup_helper.cc
@@ -87,6 +87,9 @@ quit_closure_(std::move(quit_closure)), success_(false) {} + ValidateCrxHelper(const ValidateCrxHelper&) = delete; + ValidateCrxHelper& operator=(const ValidateCrxHelper&) = delete; + bool success() const { return success_; } const std::u16string& error() const { return error_; } @@ -147,9 +150,6 @@ // If the unpacking wasn't successful, this contains an error message. std::u16string error_; - - private: - DISALLOW_COPY_AND_ASSIGN(ValidateCrxHelper); }; } // namespace
diff --git a/chrome/browser/extensions/subscribe_page_action_browsertest.cc b/chrome/browser/extensions/subscribe_page_action_browsertest.cc index 778cd0c..d6551e0 100644 --- a/chrome/browser/extensions/subscribe_page_action_browsertest.cc +++ b/chrome/browser/extensions/subscribe_page_action_browsertest.cc
@@ -88,6 +88,10 @@ const std::string& frame_name) : WebContentsObserver(web_contents), frame_name_(frame_name) {} + NamedFrameCreatedObserver(const NamedFrameCreatedObserver&) = delete; + NamedFrameCreatedObserver& operator=(const NamedFrameCreatedObserver&) = + delete; + content::RenderFrameHost* Wait() { if (!frame_) { run_loop_.Run(); @@ -109,8 +113,6 @@ base::RunLoop run_loop_; content::RenderFrameHost* frame_ = nullptr; std::string frame_name_; - - DISALLOW_COPY_AND_ASSIGN(NamedFrameCreatedObserver); }; bool ValidatePageElement(content::RenderFrameHost* frame,
diff --git a/chrome/browser/extensions/system_display/display_info_provider_aura.h b/chrome/browser/extensions/system_display/display_info_provider_aura.h index f641bf4..7a48035 100644 --- a/chrome/browser/extensions/system_display/display_info_provider_aura.h +++ b/chrome/browser/extensions/system_display/display_info_provider_aura.h
@@ -14,8 +14,8 @@ public: DisplayInfoProviderAura(); - private: - DISALLOW_COPY_AND_ASSIGN(DisplayInfoProviderAura); + DisplayInfoProviderAura(const DisplayInfoProviderAura&) = delete; + DisplayInfoProviderAura& operator=(const DisplayInfoProviderAura&) = delete; }; } // namespace extensions
diff --git a/chrome/browser/extensions/system_display/display_info_provider_mac.h b/chrome/browser/extensions/system_display/display_info_provider_mac.h index f020d3f..f2a72dc 100644 --- a/chrome/browser/extensions/system_display/display_info_provider_mac.h +++ b/chrome/browser/extensions/system_display/display_info_provider_mac.h
@@ -14,13 +14,13 @@ public: DisplayInfoProviderMac(); + DisplayInfoProviderMac(const DisplayInfoProviderMac&) = delete; + DisplayInfoProviderMac& operator=(const DisplayInfoProviderMac&) = delete; + // DisplayInfoProvider implementation. void UpdateDisplayUnitInfoForPlatform( const display::Display& display, api::system_display::DisplayUnitInfo* unit) override; - - private: - DISALLOW_COPY_AND_ASSIGN(DisplayInfoProviderMac); }; } // namespace extensions
diff --git a/chrome/browser/extensions/system_display/display_info_provider_win.h b/chrome/browser/extensions/system_display/display_info_provider_win.h index 26b8eaca..5f10ccd 100644 --- a/chrome/browser/extensions/system_display/display_info_provider_win.h +++ b/chrome/browser/extensions/system_display/display_info_provider_win.h
@@ -14,13 +14,13 @@ public: DisplayInfoProviderWin(); + DisplayInfoProviderWin(const DisplayInfoProviderWin&) = delete; + DisplayInfoProviderWin& operator=(const DisplayInfoProviderWin&) = delete; + // DisplayInfoProvider implementation. void UpdateDisplayUnitInfoForPlatform( const display::Display& display, api::system_display::DisplayUnitInfo* unit) override; - - private: - DISALLOW_COPY_AND_ASSIGN(DisplayInfoProviderWin); }; } // namespace extensions
diff --git a/chrome/browser/extensions/test_extension_environment.cc b/chrome/browser/extensions/test_extension_environment.cc index d8a6a21..42ac091 100644 --- a/chrome/browser/extensions/test_extension_environment.cc +++ b/chrome/browser/extensions/test_extension_environment.cc
@@ -78,11 +78,12 @@ public: ChromeOSEnv() {} + ChromeOSEnv(const ChromeOSEnv&) = delete; + ChromeOSEnv& operator=(const ChromeOSEnv&) = delete; + private: ash::ScopedCrosSettingsTestHelper cros_settings_test_helper_; ash::ScopedTestUserManager test_user_manager_; - - DISALLOW_COPY_AND_ASSIGN(ChromeOSEnv); }; #endif // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/extensions/unpacked_installer.h b/chrome/browser/extensions/unpacked_installer.h index 69ecea2..aad84af 100644 --- a/chrome/browser/extensions/unpacked_installer.h +++ b/chrome/browser/extensions/unpacked_installer.h
@@ -40,6 +40,9 @@ const base::FilePath&, const std::string&)>; + UnpackedInstaller(const UnpackedInstaller&) = delete; + UnpackedInstaller& operator=(const UnpackedInstaller&) = delete; + static scoped_refptr<UnpackedInstaller> Create( ExtensionService* extension_service); @@ -181,8 +184,6 @@ // Specify an install param. absl::optional<std::string> install_param_; - - DISALLOW_COPY_AND_ASSIGN(UnpackedInstaller); }; } // namespace extensions
diff --git a/chrome/browser/extensions/update_install_gate.h b/chrome/browser/extensions/update_install_gate.h index b14e197..0923ee59 100644 --- a/chrome/browser/extensions/update_install_gate.h +++ b/chrome/browser/extensions/update_install_gate.h
@@ -16,6 +16,9 @@ public: explicit UpdateInstallGate(Profile* profile); + UpdateInstallGate(const UpdateInstallGate&) = delete; + UpdateInstallGate& operator=(const UpdateInstallGate&) = delete; + // InstallGate: Action ShouldDelay(const Extension* extension, bool install_immediately) override; @@ -23,8 +26,6 @@ private: // Not owned. Profile* const profile_; - - DISALLOW_COPY_AND_ASSIGN(UpdateInstallGate); }; } // namespace extensions
diff --git a/chrome/browser/extensions/update_install_gate_unittest.cc b/chrome/browser/extensions/update_install_gate_unittest.cc index be91245..00c7866 100644 --- a/chrome/browser/extensions/update_install_gate_unittest.cc +++ b/chrome/browser/extensions/update_install_gate_unittest.cc
@@ -107,6 +107,9 @@ TestingBrowserProcess::GetGlobal()); } + UpdateInstallGateTest(const UpdateInstallGateTest&) = delete; + UpdateInstallGateTest& operator=(const UpdateInstallGateTest&) = delete; + // testing::Test void SetUp() override { // Must be called from ::testing::Test::SetUp. @@ -226,8 +229,6 @@ scoped_refptr<const Extension> new_app_; scoped_refptr<const Extension> new_persistent_; scoped_refptr<const Extension> new_none_persistent_; - - DISALLOW_COPY_AND_ASSIGN(UpdateInstallGateTest); }; TEST_F(UpdateInstallGateTest, InstallOnServiceNotReady) {
diff --git a/chrome/browser/extensions/updater/chrome_update_client_config.h b/chrome/browser/extensions/updater/chrome_update_client_config.h index 9702d41..a840aee2 100644 --- a/chrome/browser/extensions/updater/chrome_update_client_config.h +++ b/chrome/browser/extensions/updater/chrome_update_client_config.h
@@ -47,6 +47,9 @@ ChromeUpdateClientConfig(content::BrowserContext* context, absl::optional<GURL> url_override); + ChromeUpdateClientConfig(const ChromeUpdateClientConfig&) = delete; + ChromeUpdateClientConfig& operator=(const ChromeUpdateClientConfig&) = delete; + double InitialDelay() const override; int NextCheckDelay() const override; int OnDemandDelay() const override; @@ -98,8 +101,6 @@ scoped_refptr<update_client::UnzipperFactory> unzip_factory_; scoped_refptr<update_client::PatcherFactory> patch_factory_; absl::optional<GURL> url_override_; - - DISALLOW_COPY_AND_ASSIGN(ChromeUpdateClientConfig); }; } // namespace extensions
diff --git a/chrome/browser/extensions/updater/chromeos_extension_cache_delegate.h b/chrome/browser/extensions/updater/chromeos_extension_cache_delegate.h index 43f1316c..f068be8 100644 --- a/chrome/browser/extensions/updater/chromeos_extension_cache_delegate.h +++ b/chrome/browser/extensions/updater/chromeos_extension_cache_delegate.h
@@ -20,6 +20,11 @@ ChromeOSExtensionCacheDelegate(); explicit ChromeOSExtensionCacheDelegate(const base::FilePath& cache_dir); + ChromeOSExtensionCacheDelegate(const ChromeOSExtensionCacheDelegate&) = + delete; + ChromeOSExtensionCacheDelegate& operator=( + const ChromeOSExtensionCacheDelegate&) = delete; + const base::FilePath& GetCacheDir() const; size_t GetMinimumCacheSize() const; size_t GetMaximumCacheSize() const; @@ -27,8 +32,6 @@ private: const base::FilePath cache_dir_; - - DISALLOW_COPY_AND_ASSIGN(ChromeOSExtensionCacheDelegate); }; } // namespace extensions
diff --git a/chrome/browser/extensions/updater/extension_update_client_base_browsertest.cc b/chrome/browser/extensions/updater/extension_update_client_base_browsertest.cc index d471f4d..d252d55 100644 --- a/chrome/browser/extensions/updater/extension_update_client_base_browsertest.cc +++ b/chrome/browser/extensions/updater/extension_update_client_base_browsertest.cc
@@ -38,6 +38,10 @@ update_url_(update_url), ping_url_(ping_url) {} + TestChromeUpdateClientConfig(const TestChromeUpdateClientConfig&) = delete; + TestChromeUpdateClientConfig& operator=(const TestChromeUpdateClientConfig&) = + delete; + // Overrides for update_client::Configurator. std::vector<GURL> UpdateUrl() const final { return update_url_; } @@ -56,8 +60,6 @@ private: std::vector<GURL> update_url_; std::vector<GURL> ping_url_; - - DISALLOW_COPY_AND_ASSIGN(TestChromeUpdateClientConfig); }; // This class implements a simple Chrome extra part that is used to
diff --git a/chrome/browser/extensions/updater/extension_update_client_command_line_config_policy.h b/chrome/browser/extensions/updater/extension_update_client_command_line_config_policy.h index 7cd9883..c1cdc424 100644 --- a/chrome/browser/extensions/updater/extension_update_client_command_line_config_policy.h +++ b/chrome/browser/extensions/updater/extension_update_client_command_line_config_policy.h
@@ -22,13 +22,16 @@ explicit ExtensionUpdateClientCommandLineConfigPolicy( const base::CommandLine* cmdline); + ExtensionUpdateClientCommandLineConfigPolicy( + const ExtensionUpdateClientCommandLineConfigPolicy&) = delete; + ExtensionUpdateClientCommandLineConfigPolicy& operator=( + const ExtensionUpdateClientCommandLineConfigPolicy&) = delete; + // update_client::CommandLineConfigPolicy overrides. bool TestRequest() const override; private: bool test_request_ = false; - - DISALLOW_COPY_AND_ASSIGN(ExtensionUpdateClientCommandLineConfigPolicy); }; } // namespace extensions
diff --git a/chrome/browser/extensions/user_script_listener.cc b/chrome/browser/extensions/user_script_listener.cc index 44acff7..80259446 100644 --- a/chrome/browser/extensions/user_script_listener.cc +++ b/chrome/browser/extensions/user_script_listener.cc
@@ -34,6 +34,9 @@ explicit Throttle(content::NavigationHandle* navigation_handle) : NavigationThrottle(navigation_handle) {} + Throttle(const Throttle&) = delete; + Throttle& operator=(const Throttle&) = delete; + void ResumeIfDeferred() { DCHECK(should_defer_); should_defer_ = false; @@ -64,8 +67,6 @@ bool should_defer_ = true; bool did_defer_ = false; std::unique_ptr<base::ElapsedTimer> timer_; - - DISALLOW_COPY_AND_ASSIGN(Throttle); }; struct UserScriptListener::ProfileData {
diff --git a/chrome/browser/extensions/wake_event_page_apitest.cc b/chrome/browser/extensions/wake_event_page_apitest.cc index bdaa837..29cee6e 100644 --- a/chrome/browser/extensions/wake_event_page_apitest.cc +++ b/chrome/browser/extensions/wake_event_page_apitest.cc
@@ -64,6 +64,9 @@ public: WakeEventPageTest() {} + WakeEventPageTest(const WakeEventPageTest&) = delete; + WakeEventPageTest& operator=(const WakeEventPageTest&) = delete; + void SetUpOnMainThread() override { ExtensionBrowserTest::SetUpOnMainThread(); host_resolver()->AddRule("*", "127.0.0.1"); @@ -155,8 +158,6 @@ } ProcessManager* process_manager() { return ProcessManager::Get(profile()); } - - DISALLOW_COPY_AND_ASSIGN(WakeEventPageTest); }; IN_PROC_BROWSER_TEST_F(WakeEventPageTest, ClosedEventPage) {
diff --git a/chrome/browser/extensions/warning_badge_service_factory.h b/chrome/browser/extensions/warning_badge_service_factory.h index a89f168..6782e95b 100644 --- a/chrome/browser/extensions/warning_badge_service_factory.h +++ b/chrome/browser/extensions/warning_badge_service_factory.h
@@ -15,6 +15,10 @@ class WarningBadgeServiceFactory : public BrowserContextKeyedServiceFactory { public: + WarningBadgeServiceFactory(const WarningBadgeServiceFactory&) = delete; + WarningBadgeServiceFactory& operator=(const WarningBadgeServiceFactory&) = + delete; + static WarningBadgeService* GetForBrowserContext( content::BrowserContext* context); static WarningBadgeServiceFactory* GetInstance(); @@ -31,8 +35,6 @@ content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; bool ServiceIsCreatedWithBrowserContext() const override; - - DISALLOW_COPY_AND_ASSIGN(WarningBadgeServiceFactory); }; } // namespace extensions
diff --git a/chrome/browser/extensions/web_contents_browsertest.cc b/chrome/browser/extensions/web_contents_browsertest.cc index 04c523d..8c58cee4 100644 --- a/chrome/browser/extensions/web_contents_browsertest.cc +++ b/chrome/browser/extensions/web_contents_browsertest.cc
@@ -42,6 +42,11 @@ explicit ExtensionNavigationUIDataObserver(content::WebContents* web_contents) : WebContentsObserver(web_contents) {} + ExtensionNavigationUIDataObserver(const ExtensionNavigationUIDataObserver&) = + delete; + ExtensionNavigationUIDataObserver& operator=( + const ExtensionNavigationUIDataObserver&) = delete; + const ExtensionNavigationUIData* GetExtensionNavigationUIData( content::RenderFrameHost* rfh) const { auto iter = navigation_ui_data_map_.find(rfh); @@ -66,8 +71,6 @@ std::map<content::RenderFrameHost*, std::unique_ptr<ExtensionNavigationUIData>> navigation_ui_data_map_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionNavigationUIDataObserver); }; } // namespace
diff --git a/chrome/browser/extensions/webstore_install_with_prompt.h b/chrome/browser/extensions/webstore_install_with_prompt.h index 3995e07..dfbc936 100644 --- a/chrome/browser/extensions/webstore_install_with_prompt.h +++ b/chrome/browser/extensions/webstore_install_with_prompt.h
@@ -44,6 +44,10 @@ gfx::NativeWindow parent_window, Callback callback); + WebstoreInstallWithPrompt(const WebstoreInstallWithPrompt&) = delete; + WebstoreInstallWithPrompt& operator=(const WebstoreInstallWithPrompt&) = + delete; + protected: friend class base::RefCountedThreadSafe<WebstoreInstallWithPrompt>; ~WebstoreInstallWithPrompt() override; @@ -67,8 +71,6 @@ gfx::NativeWindow parent_window_; std::unique_ptr<NativeWindowTracker> parent_window_tracker_; - - DISALLOW_COPY_AND_ASSIGN(WebstoreInstallWithPrompt); }; } // namespace extensions
diff --git a/chrome/browser/extensions/webstore_standalone_installer.h b/chrome/browser/extensions/webstore_standalone_installer.h index 96b9afd..99af330 100644 --- a/chrome/browser/extensions/webstore_standalone_installer.h +++ b/chrome/browser/extensions/webstore_standalone_installer.h
@@ -53,6 +53,11 @@ WebstoreStandaloneInstaller(const std::string& webstore_item_id, Profile* profile, Callback callback); + + WebstoreStandaloneInstaller(const WebstoreStandaloneInstaller&) = delete; + WebstoreStandaloneInstaller& operator=(const WebstoreStandaloneInstaller&) = + delete; + void BeginInstall(); protected: @@ -223,8 +228,6 @@ // Created by ShowInstallUI() when a prompt is shown (if // the implementor returns a non-NULL in CreateInstallPrompt()). scoped_refptr<Extension> localized_extension_for_display_; - - DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStandaloneInstaller); }; } // namespace extensions
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index bcd3541..8e7e4902 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -51,12 +51,12 @@ { "name": "adaptive-button-in-top-toolbar", "owners": [ "bttk", "chrome-segmentation-platform@google.com" ], - "expiry_milestone": 95 + "expiry_milestone": 99 }, { "name": "adaptive-button-in-top-toolbar-customization", "owners": [ "bttk", "chrome-segmentation-platform@google.com" ], - "expiry_milestone": 96 + "expiry_milestone": 99 }, { "name": "add-passwords-in-settings", @@ -169,11 +169,6 @@ "expiry_milestone": 96 }, { - "name": "app-service-adaptive-icon", - "owners": [ "//components/services/app_service/OWNERS" ], - "expiry_milestone": 93 - }, - { "name": "app-service-external-protocol", "owners": [ "chromeos-apps-foundation-team@google.com" ], "expiry_milestone": 96 @@ -679,11 +674,6 @@ "expiry_milestone": 92 }, { - "name": "chrome-sharing-hub", - "owners": [ "kmilka", "chrome-sharing-eng@google.com" ], - "expiry_milestone": 95 - }, - { "name": "chrome-sharing-hub-launch-adjacent", "owners": [ "skare", "chrome-sharing-eng@google.com" ], "expiry_milestone": 97 @@ -980,7 +970,7 @@ { "name": "debug-chime-notification", "owners": [ "xingliu" ], - "expiry_milestone": 95 + "expiry_milestone": 100 }, { "name": "debug-history-intervention-no-user-activation", @@ -1548,6 +1538,11 @@ "expiry_milestone": 97 }, { + "name": "enable-component-updater-test-request", + "owners": [ "romanarora@google.com", "lacros-team@google.com" ], + "expiry_milestone": 110 + }, + { "name": "enable-compositing-based-throttling", "owners": [ "yjliu", "chromeos-perf@google.com"], "expiry_milestone": 98 @@ -2760,7 +2755,7 @@ "expiry_milestone": 100 }, { - "name": "enable-web-authentication-assertion-transport", + "name": "enable-web-authentication-authenticator-attachment", "owners": [ "ridouh@google.com", "//device/fido/OWNERS"] , "expiry_milestone" : 100 }, @@ -3212,7 +3207,7 @@ { "name": "full-restore", "owners": [ "dominickn", "nancylingwang", "sammiequon", "xdai" ], - "expiry_milestone": 95 + "expiry_milestone": 99 }, { "name": "fullscreen-viewport-adjustment-experiment", @@ -3485,12 +3480,12 @@ { "name": "ios-crashpad", "owners": [ "justincohen", "bling-flags@google.com" ], - "expiry_milestone": 95 + "expiry_milestone": 99 }, { "name": "ios-persist-crash-restore-infobar", "owners": [ "thegreenfrog", "bling-flags@google.com" ], - "expiry_milestone": 91 + "expiry_milestone": 98 }, { "name": "ios-shared-highlighting-color-change", @@ -3929,12 +3924,12 @@ { "name": "notification-scheduler", "owners": [ "//chrome/browser/notifications/scheduler/OWNERS" ], - "expiry_milestone": 94 + "expiry_milestone": 100 }, { "name": "notification-scheduler-debug-options", "owners": [ "//chrome/browser/notifications/scheduler/OWNERS" ], - "expiry_milestone": 94 + "expiry_milestone": 100 }, { "name": "ntp-cache-one-google-bar", @@ -4067,8 +4062,8 @@ }, { "name": "omnibox-dynamic-max-autocomplete", - "owners": [ "manukh", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 95 + "owners": [ "manukh", "ender", "chrome-omnibox-team@google.com" ], + "expiry_milestone": 100 }, { "name": "omnibox-experimental-keyword-mode", @@ -4093,17 +4088,17 @@ { "name": "omnibox-local-history-zero-suggest", "owners": ["rkgibson@google.com", "stkhapugin", "chrome-omnibox-team@google.com"], - "expiry_milestone": 97 + "expiry_milestone": 100 }, { "name": "omnibox-max-url-matches", "owners": [ "orinj", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 95 + "expiry_milestone": 100 }, { "name": "omnibox-max-zero-suggest-matches", "owners": [ "manukh", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 95 + "expiry_milestone": 100 }, { "name": "omnibox-most-visited-tiles", @@ -4127,13 +4122,13 @@ }, { "name": "omnibox-on-focus-suggestions-contextual-web", - "owners": [ "tommycli", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 95 + "owners": [ "tommycli", "ender", "chrome-omnibox-team@google.com" ], + "expiry_milestone": 100 }, { "name": "omnibox-on-focus-suggestions-contextual-web-allow-srp", "owners": [ "ender", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 97 + "expiry_milestone": 100 }, { "name": "omnibox-pedals-batch2-nonenglish", @@ -4585,7 +4580,7 @@ { "name": "reading-list-messages", "owners": [ "thegreenfrog@google.com", "bling-flags@google.com" ], - "expiry_milestone": 95 + "expiry_milestone": 99 }, { "name": "record-snapshot-size", @@ -4625,11 +4620,6 @@ "expiry_milestone": 90 }, { - "name": "refactored-ntp", - "owners": [ "adamta@google.com", "sczs" ], - "expiry_milestone": 93 - }, - { "name": "related-searches", "owners": [ "donnd", "related-searches-vteam@google.com" ], "expiry_milestone": 97 @@ -5391,11 +5381,6 @@ "expiry_milestone": -1 }, { - "name": "updated_cellular_activation_ui", - "owners": [ "azeemarshad", "khorimoto", "cros-connectivity@google.com" ], - "expiry_milestone": 95 - }, - { "name": "url-blocklist-ios", "owners": [ "michaeldo", "rohitrao", "bling-flags@google.com" ], "expiry_milestone": 90
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 85e875c..9cd7de5 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -1214,11 +1214,11 @@ const char kEnableSubresourceRedirectDescription[] = "Allow subresource compression for data savings"; -const char kEnableWebAuthenticationAssertionTransportName[] = - "Web Authentication Assertion Transport support"; -const char kEnableWebAuthenticationAssertionTransportDescription[] = - "Enable Web Authentication to provide the Assertion Transport value on " - "authentication success."; +const char kEnableWebAuthenticationAuthenticatorAttachmentName[] = + "Web Authentication Authenticator Attachment support"; +const char kEnableWebAuthenticationAuthenticatorAttachmentDescription[] = + "Enable Web Authentication to provide the Authenticator Attachment type " + "used on both authentication and registration success."; const char kEnableWebAuthenticationCableV2SupportName[] = "Web Authentication caBLE v2 support"; @@ -3018,10 +3018,6 @@ const char kChromeShareScreenshotDescription[] = "Enables UI to edit and share screenshots"; -const char kChromeSharingHubName[] = "Chrome Sharing Hub"; -const char kChromeSharingHubDescription[] = - "Enables the Chrome Sharing Hub/custom share sheet for Android."; - const char kChromeSharingHubLaunchAdjacentName[] = "Launch new share hub actions in adjacent window"; const char kChromeSharingHubLaunchAdjacentDescription[] = @@ -4211,6 +4207,13 @@ "When enabled Cellular Setup and Settings UI will use the first available " "external Euicc."; +const char kComponentUpdaterTestRequestName[] = + "Enable the component updater check 'test-request' parameter"; +const char kComponentUpdaterTestRequestDescription[] = + "Enables the 'test-request' parameter for component updater check requests." + " Overrides any other component updater check request parameters that may " + "have been specified."; + const char kContextualNudgesName[] = "Contextual nudges for user gesture education"; const char kContextualNudgesDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index f0d7f4f7..05b5cea 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -694,8 +694,8 @@ extern const char kEnableUseZoomForDsfChoiceEnabled[]; extern const char kEnableUseZoomForDsfChoiceDisabled[]; -extern const char kEnableWebAuthenticationAssertionTransportName[]; -extern const char kEnableWebAuthenticationAssertionTransportDescription[]; +extern const char kEnableWebAuthenticationAuthenticatorAttachmentName[]; +extern const char kEnableWebAuthenticationAuthenticatorAttachmentDescription[]; extern const char kEnableWebAuthenticationCableV2SupportName[]; extern const char kEnableWebAuthenticationCableV2SupportDescription[]; @@ -1715,9 +1715,6 @@ extern const char kChromeShareScreenshotName[]; extern const char kChromeShareScreenshotDescription[]; -extern const char kChromeSharingHubName[]; -extern const char kChromeSharingHubDescription[]; - extern const char kChromeSharingHubLaunchAdjacentName[]; extern const char kChromeSharingHubLaunchAdjacentDescription[]; @@ -2400,6 +2397,9 @@ extern const char kCellularUseExternalEuiccName[]; extern const char kCellularUseExternalEuiccDescription[]; +extern const char kComponentUpdaterTestRequestName[]; +extern const char kComponentUpdaterTestRequestDescription[]; + extern const char kContextualNudgesName[]; extern const char kContextualNudgesDescription[];
diff --git a/chrome/browser/media/webrtc/permission_bubble_media_access_handler.cc b/chrome/browser/media/webrtc/permission_bubble_media_access_handler.cc index f245a6f..79f00dc 100644 --- a/chrome/browser/media/webrtc/permission_bubble_media_access_handler.cc +++ b/chrome/browser/media/webrtc/permission_bubble_media_access_handler.cc
@@ -22,6 +22,7 @@ #include "components/permissions/permission_manager.h" #include "components/permissions/permission_result.h" #include "components/permissions/permission_util.h" +#include "components/permissions/permissions_client.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h" #include "components/webrtc/media_stream_devices_controller.h" @@ -110,11 +111,22 @@ : content_settings::PageSpecificContentSettings::CAMERA_BLOCKED); } + // TODO(crbug.com/698985): Use `GetLastCommittedURL` if web_contents represent + // NTP. + GURL embedding_origin; + if (permissions::PermissionsClient::Get()->DoOriginsMatchNewTabPage( + request.security_origin, + web_contents->GetLastCommittedURL().GetOrigin())) { + embedding_origin = web_contents->GetLastCommittedURL().GetOrigin(); + } else { + embedding_origin = + permissions::PermissionUtil::GetLastCommittedOriginAsURL(web_contents); + } + content_settings->OnMediaStreamPermissionSet( PermissionManagerFactory::GetForProfile(profile)->GetCanonicalOrigin( ContentSettingsType::MEDIASTREAM_CAMERA, request.security_origin, - permissions::PermissionUtil::GetLastCommittedOriginAsURL( - web_contents)), + embedding_origin), microphone_camera_state, selected_audio_device, selected_video_device, requested_audio_device, requested_video_device); }
diff --git a/chrome/browser/performance_monitor/process_monitor.cc b/chrome/browser/performance_monitor/process_monitor.cc index 2a802aaa5..a79de09 100644 --- a/chrome/browser/performance_monitor/process_monitor.cc +++ b/chrome/browser/performance_monitor/process_monitor.cc
@@ -19,7 +19,6 @@ #include "content/public/browser/child_process_data.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/content_constants.h" -#include "content/public/common/content_features.h" #include "extensions/buildflags/buildflags.h" #include "services/network/public/mojom/network_service.mojom.h" @@ -156,12 +155,11 @@ } // static -std::vector<ProcessMetadata> ProcessMonitor::GatherProcessesOnUIThread() { +std::vector<ProcessMetadata> ProcessMonitor::GatherRendererProcesses() { DCHECK_CURRENTLY_ON(BrowserThread::UI); std::vector<ProcessMetadata> processes; - // Find all render child processes; has to be done on the UI thread. for (content::RenderProcessHost::iterator rph_iter = content::RenderProcessHost::AllHostsIterator(); !rph_iter.IsAtEnd(); rph_iter.Advance()) { @@ -179,10 +177,8 @@ } // static -std::vector<ProcessMetadata> ProcessMonitor::GatherProcessesOnProcessThread() { - DCHECK_CURRENTLY_ON(base::FeatureList::IsEnabled(features::kProcessHostOnUI) - ? BrowserThread::UI - : BrowserThread::IO); +std::vector<ProcessMetadata> ProcessMonitor::GatherNonRendererProcesses() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); std::vector<ProcessMetadata> processes; @@ -220,33 +216,11 @@ // it doesn't matter. We just check it for inequality. current_update_sequence++; - // This function is already running on the UI thread, so gather all ui thread - // processes. - std::vector<ProcessMetadata> ui_thread_processes = - GatherProcessesOnUIThread(); + std::vector<ProcessMetadata> processes = GatherRendererProcesses(); + auto non_renderers = GatherNonRendererProcesses(); + processes.insert(processes.end(), non_renderers.begin(), non_renderers.end()); - auto task_runner = base::FeatureList::IsEnabled(features::kProcessHostOnUI) - ? content::GetUIThreadTaskRunner({}) - : content::GetIOThreadTaskRunner({}); - // Then retrieve process thread processes and invoke GatherMetrics() with both - // set of processes. - task_runner->PostTaskAndReplyWithResult( - FROM_HERE, - base::BindOnce(&ProcessMonitor::GatherProcessesOnProcessThread), - base::BindOnce(&ProcessMonitor::GatherMetrics, - weak_ptr_factory_.GetWeakPtr(), current_update_sequence, - std::move(ui_thread_processes))); -} - -void ProcessMonitor::GatherMetrics( - int current_update_sequence, - std::vector<ProcessMetadata> ui_thread_processes, - std::vector<ProcessMetadata> io_thread_processes) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - for (const auto& process : ui_thread_processes) - MarkProcessAsAlive(process, current_update_sequence); - for (const auto& process : io_thread_processes) + for (const auto& process : processes) MarkProcessAsAlive(process, current_update_sequence); // Update metrics for all watched processes; remove dead entries from the map. @@ -254,7 +228,8 @@ auto iter = metrics_map_.begin(); while (iter != metrics_map_.end()) { ProcessMetricsHistory* process_metrics = iter->second.get(); - if (process_metrics->last_update_sequence() != current_update_sequence) { + if (process_metrics->last_update_sequence() != + static_cast<int>(current_update_sequence)) { // Not touched this iteration; let's get rid of it. metrics_map_.erase(iter++); } else {
diff --git a/chrome/browser/performance_monitor/process_monitor.h b/chrome/browser/performance_monitor/process_monitor.h index 009f079..392bd6a 100644 --- a/chrome/browser/performance_monitor/process_monitor.h +++ b/chrome/browser/performance_monitor/process_monitor.h
@@ -130,24 +130,16 @@ void MarkProcessAsAlive(const ProcessMetadata& process_data, int current_update_sequence); - // Returns the ProcessMetadata for every Chrome processes accessible from the - // UI thread. - static std::vector<ProcessMetadata> GatherProcessesOnUIThread(); + // Returns the ProcessMetadata for renderer processes. + static std::vector<ProcessMetadata> GatherRendererProcesses(); - // Returns the ProcessMetadata for every Chrome processes accessible from the - // process thread. - static std::vector<ProcessMetadata> GatherProcessesOnProcessThread(); + // Returns the ProcessMetadata for non renderers. + static std::vector<ProcessMetadata> GatherNonRendererProcesses(); - // Gather all the processes from both threads and then invokes GatherMetrics() - // back on the calling thread. + // Gather all the processes and updates the ProcessMetrics map with the + // current list of processes and gathers metrics from each entry. void GatherProcesses(); - // Updates the ProcessMetrics map with the current list of processes and - // gathers metrics from each entry. - void GatherMetrics(int current_update_sequence, - std::vector<ProcessMetadata> ui_thread_processes, - std::vector<ProcessMetadata> io_thread_processes); - // A map of currently running ProcessHandles to ProcessMetrics. std::map<base::ProcessHandle, std::unique_ptr<ProcessMetricsHistory>> metrics_map_;
diff --git a/chrome/browser/permissions/permissions_security_model_interactive_uitest.cc b/chrome/browser/permissions/permissions_security_model_interactive_uitest.cc index 9ca623a..f528d67 100644 --- a/chrome/browser/permissions/permissions_security_model_interactive_uitest.cc +++ b/chrome/browser/permissions/permissions_security_model_interactive_uitest.cc
@@ -12,6 +12,7 @@ #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "chrome/test/permissions/permission_request_manager_test_api.h" +#include "components/content_settings/browser/page_specific_content_settings.h" #include "components/embedder_support/switches.h" #include "components/permissions/features.h" #include "components/permissions/test/mock_permission_prompt_factory.h" @@ -770,4 +771,67 @@ content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, 1) .value.GetBool()); } + +IN_PROC_BROWSER_TEST_P(PermissionsSecurityModelInteractiveUITest, + MicActivityIndicatorOnNtpUseDseOrigin) { + content::WebContents* embedder_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + ASSERT_TRUE(embedder_contents); + + content::RenderFrameHost* main_rfh = + ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( + browser(), GURL(chrome::kChromeUINewTabURL), 1); + content::WebContents::FromRenderFrameHost(main_rfh)->Focus(); + + ASSERT_TRUE(main_rfh); + EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), + embedder_contents->GetLastCommittedURL().GetOrigin()); + EXPECT_EQ(GURL(chrome::kChromeUINewTabPageURL), + main_rfh->GetLastCommittedOrigin().GetURL()); + + constexpr char kCheckMic[] = R"((async () => { + const PermissionStatus = + await navigator.permissions.query({name: 'microphone'}); + return PermissionStatus.state === 'granted'; + })();)"; + + EXPECT_FALSE(content::EvalJs(main_rfh, kCheckMic, + content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, 1) + .value.GetBool()); + + permissions::PermissionRequestManager* permission_request_manager = + permissions::PermissionRequestManager::FromWebContents(embedder_contents); + + constexpr char kRequestMic[] = + "navigator.mediaDevices.getUserMedia({ audio: true });"; + + std::unique_ptr<permissions::MockPermissionPromptFactory> bubble_factory = + std::make_unique<permissions::MockPermissionPromptFactory>( + permission_request_manager); + + bubble_factory->set_response_type( + permissions::PermissionRequestManager::AutoResponseType::ACCEPT_ALL); + + content::EvalJsResult result = content::EvalJs( + main_rfh, kRequestMic, content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, 1); + EXPECT_EQ("", result.error); + + // Mic request from an NTP will be changed to DSE origin. + EXPECT_TRUE( + bubble_factory->RequestOriginSeen(GURL("https://www.google.com"))); + bubble_factory->set_response_type( + permissions::PermissionRequestManager::AutoResponseType::NONE); + + EXPECT_TRUE(content::EvalJs(main_rfh, kCheckMic, + content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, 1) + .value.GetBool()); + + content_settings::PageSpecificContentSettings* page_content_settings = + content_settings::PageSpecificContentSettings::GetForFrame(main_rfh); + + // Media stream origin on NTP should equal to DSE. + EXPECT_EQ(page_content_settings->media_stream_access_origin(), + GURL("https://www.google.com")); + +} // namespace } // anonymous namespace
diff --git a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_test_utils.cc b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_test_utils.cc index 8cec84bd..a61fe9a 100644 --- a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_test_utils.cc +++ b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_test_utils.cc
@@ -164,7 +164,7 @@ void TestProxyTunnelConnection::OnDone() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); client_socket_.reset(); - incoming_socket_.reset(); + incoming_socket_ = nullptr; if (on_done_callback_) { std::move(on_done_callback_).Run();
diff --git a/chrome/browser/prefetch/search_prefetch/search_prefetch_service_browsertest.cc b/chrome/browser/prefetch/search_prefetch/search_prefetch_service_browsertest.cc index 96c8e147..2844156 100644 --- a/chrome/browser/prefetch/search_prefetch/search_prefetch_service_browsertest.cc +++ b/chrome/browser/prefetch/search_prefetch/search_prefetch_service_browsertest.cc
@@ -5,6 +5,7 @@ #include "base/callback_helpers.h" #include "base/containers/contains.h" #include "base/run_loop.h" +#include "base/strings/string_split.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_feature_list.h" #include "base/time/time.h" @@ -86,18 +87,6 @@ constexpr char kServiceWorkerUrl[] = "/navigation_preload.js"; } // namespace -// A response that hangs after serving the start of the response. -class HangRequestAfterStart : public net::test_server::BasicHttpResponse { - public: - HangRequestAfterStart() = default; - - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) override { - send.Run("HTTP/1.1 200 OK\r\nContent-Length:100\r\n\r\n", - base::DoNothing()); - } -}; - // A delegate to cancel prefetch requests by setting |defer| to true. class DeferringThrottle : public blink::URLLoaderThrottle { public: @@ -456,7 +445,9 @@ return nullptr; if (hang_requests_after_start_) { - return std::make_unique<HangRequestAfterStart>(); + base::StringPairs headers = {{"Content-Length", "100"}}; + return std::make_unique<net::test_server::HungAfterHeadersHttpResponse>( + headers); } if (should_hang_requests_)
diff --git a/chrome/browser/printing/print_preview_dialog_controller_unittest.cc b/chrome/browser/printing/print_preview_dialog_controller_unittest.cc index 283b0d95..1dffe5b 100644 --- a/chrome/browser/printing/print_preview_dialog_controller_unittest.cc +++ b/chrome/browser/printing/print_preview_dialog_controller_unittest.cc
@@ -276,7 +276,8 @@ // Forward) but modify the navigation type while pending to look like an // address bar + typed transition (like Gmail auto navigation) std::unique_ptr<content::NavigationSimulator> forward_nav = - content::NavigationSimulator::CreateHistoryNavigation(1, web_contents); + content::NavigationSimulator::CreateHistoryNavigation( + 1, web_contents, false /* is_renderer_initiated */); forward_nav->Start(); web_contents->GetController().GetPendingEntry()->SetTransitionType( ui::PageTransitionFromInt(ui::PAGE_TRANSITION_TYPED | @@ -317,8 +318,8 @@ // Try to simulate renderer reloading a PWA page: Navigate to an existing page // (via Forward) but modify the navigation type while pending to look like a // PAGE_TRANSITION_AUTO_BOOKMARK. - forward_nav = - content::NavigationSimulator::CreateHistoryNavigation(1, web_contents); + forward_nav = content::NavigationSimulator::CreateHistoryNavigation( + 1, web_contents, false /* is_renderer_initiated */); forward_nav->Start(); web_contents->GetController().GetPendingEntry()->SetTransitionType( ui::PageTransitionFromInt(ui::PAGE_TRANSITION_AUTO_BOOKMARK));
diff --git a/chrome/browser/resources/history/BUILD.gn b/chrome/browser/resources/history/BUILD.gn index ea62ad5d3..56a5ce4 100644 --- a/chrome/browser/resources/history/BUILD.gn +++ b/chrome/browser/resources/history/BUILD.gn
@@ -71,6 +71,7 @@ "constants.ts", "externs.ts", "history_clusters/browser_proxy.ts", + "history_clusters/metrics_proxy.ts", "history_clusters/open_window_proxy.ts", "history.ts", "lazy_load.ts", @@ -157,6 +158,7 @@ "history_clusters/cluster.ts", "history_clusters/clusters.ts", "history_clusters/history_clusters.mojom-webui.js", + "history_clusters/metrics_proxy.ts", "history_clusters/open_window_proxy.ts", "history_clusters/page_favicon.ts", "history_clusters/search_query.ts", @@ -183,7 +185,10 @@ "//ui/webui/resources:library", "//ui/webui/resources/mojo:library", ] - definitions = [ "//tools/typescript/definitions/chrome_send.d.ts" ] + definitions = [ + "//tools/typescript/definitions/chrome_send.d.ts", + "//tools/typescript/definitions/metrics_private.d.ts", + ] extra_deps = [ ":copy_history_clusters_mojom", ":preprocess",
diff --git a/chrome/browser/resources/history/history_clusters/cluster.html b/chrome/browser/resources/history/history_clusters/cluster.html index 3bd786de..d1d2683 100644 --- a/chrome/browser/resources/history/history_clusters/cluster.html +++ b/chrome/browser/resources/history/history_clusters/cluster.html
@@ -8,5 +8,9 @@ } </style> <template is="dom-repeat" items="[[cluster.visits]]"> - <top-visit visit="[[item]]"></top-visit> + <top-visit visit="[[item]]" + on-related-search-clicked="onRelatedSearchClicked_" + on-related-visits-visibility-toggled="onRelatedVisitsVisibilityToggled_" + on-visit-clicked="onVisitClicked_"> + </top-visit> </template>
diff --git a/chrome/browser/resources/history/history_clusters/cluster.ts b/chrome/browser/resources/history/history_clusters/cluster.ts index 683c50e..afbe1815 100644 --- a/chrome/browser/resources/history/history_clusters/cluster.ts +++ b/chrome/browser/resources/history/history_clusters/cluster.ts
@@ -11,6 +11,7 @@ import {BrowserProxy} from './browser_proxy.js'; import {Cluster, PageCallbackRouter, URLVisit} from './history_clusters.mojom-webui.js'; +import {ClusterAction, MetricsProxy} from './metrics_proxy.js'; /** * @fileoverview This file provides a custom element displaying a Cluster. @@ -34,6 +35,14 @@ static get properties() { return { /** + * The index of the cluster. + */ + index: { + type: Number, + value: -1, // Initialized to an invalid value. + }, + + /** * The Cluster displayed by this element. */ cluster: Object, @@ -44,7 +53,8 @@ // Properties //============================================================================ - cluster: Cluster = new Cluster(); + cluster: Cluster; + index: number; private callbackRouter_: PageCallbackRouter; private onVisitsRemovedListenerId_: number|null = null; @@ -72,6 +82,25 @@ } //============================================================================ + // Event handlers + //============================================================================ + + private onRelatedSearchClicked_() { + MetricsProxy.getInstance().recordClusterAction( + ClusterAction.RELATED_SEARCH_CLICKED, this.index); + } + + private onRelatedVisitsVisibilityToggled_() { + MetricsProxy.getInstance().recordClusterAction( + ClusterAction.RELATED_VISITS_VISIBILITY_TOGGLED, this.index); + } + + private onVisitClicked_() { + MetricsProxy.getInstance().recordClusterAction( + ClusterAction.VISIT_CLICKED, this.index); + } + + //============================================================================ // Helper methods //============================================================================ @@ -123,12 +152,12 @@ })); // Now if all top visits for this cluster have been removed, send an event - // to also remove this cluster from the list. + // with the cluster index to also remove this cluster from the list. if (!this.cluster.visits.length) { - this.dispatchEvent(new CustomEvent('cluster-emptied', { + this.dispatchEvent(new CustomEvent('remove-cluster', { bubbles: true, composed: true, - detail: this.cluster, + detail: this.index, })); } }
diff --git a/chrome/browser/resources/history/history_clusters/clusters.html b/chrome/browser/resources/history/history_clusters/clusters.html index 974ac49..ff401a6 100644 --- a/chrome/browser/resources/history/history_clusters/clusters.html +++ b/chrome/browser/resources/history/history_clusters/clusters.html
@@ -22,8 +22,8 @@ items="[[result_.clusters]]" on-remove-visits="onRemoveVisits_"> <template> - <history-cluster cluster="[[item]]" - on-cluster-emptied="onClusterEmptied_"> + <history-cluster cluster="[[item]]" index="[[index]]" + on-remove-cluster="onRemoveCluster_"> </history-cluster> </template> </iron-list>
diff --git a/chrome/browser/resources/history/history_clusters/clusters.ts b/chrome/browser/resources/history/history_clusters/clusters.ts index d7ac5dc..027c7b4 100644 --- a/chrome/browser/resources/history/history_clusters/clusters.ts +++ b/chrome/browser/resources/history/history_clusters/clusters.ts
@@ -20,7 +20,8 @@ import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {BrowserProxy} from './browser_proxy.js'; -import {Cluster, PageCallbackRouter, PageHandlerRemote, QueryParams, QueryResult, URLVisit} from './history_clusters.mojom-webui.js'; +import {PageCallbackRouter, PageHandlerRemote, QueryParams, QueryResult, URLVisit} from './history_clusters.mojom-webui.js'; +import {ClusterAction, MetricsProxy} from './metrics_proxy.js'; /** * @fileoverview This file provides a custom element that requests and shows @@ -69,6 +70,15 @@ query: { type: String, observer: 'onQueryChanged_', + value: '', + }, + + /** + * The header text to show when the query is non-empty. + */ + headerText_: { + type: String, + computed: `computeHeaderText_(result_)`, }, /** @@ -81,20 +91,12 @@ result_: Object, /** - * The header text to show when the query is non-empty. - */ - headerText_: { - type: String, - computed: `computeHeaderText_(result_)`, - }, - - /** * The list of visits to be removed. A non-empty array indicates a pending * remove request to the browser. */ visitsToBeRemoved_: { type: Object, - value: [], + value: () => [], }, }; } @@ -103,13 +105,13 @@ // Properties //============================================================================ - query: string = ''; + query: string; private callbackRouter_: PageCallbackRouter; private onClustersQueryResultListenerId_: number|null = null; private onVisitsRemovedListenerId_: number|null = null; private pageHandler_: PageHandlerRemote; - private result_: QueryResult = new QueryResult(); - private visitsToBeRemoved_: Array<URLVisit> = []; + private result_: QueryResult; + private visitsToBeRemoved_: Array<URLVisit>; //============================================================================ // Overridden methods @@ -155,17 +157,6 @@ this.$.confirmationDialog.get().close(); } - private onClusterEmptied_(event: CustomEvent<Cluster>) { - // Find and remove the emptied cluster from the list. We don't pass an - // index, as then that's one more piece of state to keep consistent. - if (this.result_ && this.result_.clusters) { - const index = this.result_.clusters.indexOf(event.detail); - if (index !== -1) { - this.splice('result_.clusters', index, 1); - } - } - } - private onConfirmationDialogCancel_() { this.visitsToBeRemoved_ = []; } @@ -181,6 +172,17 @@ } /** + * Called with `event` received from a cluster requesting to be removed from + * the list when all its visits have been removed. Contains the cluster index. + */ + private onRemoveCluster_(event: CustomEvent<number>) { + const index = event.detail; + this.splice('result_.clusters', index, 1); + MetricsProxy.getInstance().recordClusterAction( + ClusterAction.DELETED, index); + } + + /** * Called with `event` received from a visit requesting to be removed. `event` * may contain the related visits of the said visit, if applicable. */
diff --git a/chrome/browser/resources/history/history_clusters/metrics_proxy.ts b/chrome/browser/resources/history/history_clusters/metrics_proxy.ts new file mode 100644 index 0000000..2c81f31 --- /dev/null +++ b/chrome/browser/resources/history/history_clusters/metrics_proxy.ts
@@ -0,0 +1,62 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview This file provides an abstraction layer for logging metrics for + * mocking in tests. + */ + +/** + * The following enums must be kept in sync with their respective variants in + * //tools/metrics/histograms/metadata/history/histograms.xml + */ +export enum ClusterAction { + DELETED = 'Deleted', + RELATED_SEARCH_CLICKED = 'RelatedSearchClicked', + RELATED_VISITS_VISIBILITY_TOGGLED = 'RelatedVisitsVisibilityToggled', + VISIT_CLICKED = 'RelatedSearchClicked', +} + +export enum RelatedSearchAction { + CLICKED = 'Clicked', +} + +export enum VisitAction { + CLICKED = 'Clicked', + DELETED = 'Deleted', +} + +export enum VisitType { + NON_SRP = 'nonSRP', + SRP = 'SRP', +} + +export class MetricsProxy { + recordClusterAction(action: ClusterAction, index: number) { + chrome.metricsPrivate.recordMediumCount( + `History.Clusters.UIActions.Cluster.${action}`, index); + } + + recordRelatedSearchAction(action: RelatedSearchAction, index: number) { + chrome.metricsPrivate.recordMediumCount( + `History.Clusters.UIActions.RelatedSearch.${action}`, index); + } + + recordVisitAction(action: VisitAction, index: number, type: VisitType) { + chrome.metricsPrivate.recordMediumCount( + `History.Clusters.UIActions.Visit.${action}`, index); + chrome.metricsPrivate.recordMediumCount( + `History.Clusters.UIActions.${type}Visit.${action}`, index); + } + + static getInstance(): MetricsProxy { + return instance || (instance = new MetricsProxy()); + } + + static setInstance(obj: MetricsProxy) { + instance = obj; + } +} + +let instance: MetricsProxy|null = null;
diff --git a/chrome/browser/resources/history/history_clusters/page_favicon.ts b/chrome/browser/resources/history/history_clusters/page_favicon.ts index b833c3f..406ee39 100644 --- a/chrome/browser/resources/history/history_clusters/page_favicon.ts +++ b/chrome/browser/resources/history/history_clusters/page_favicon.ts
@@ -32,8 +32,8 @@ */ isTopVisitFavicon: { type: Boolean, - value: false, reflectToAttribute: true, + value: false, }, /** @@ -41,8 +41,8 @@ */ style: { type: String, - reflectToAttribute: true, computed: `computeStyle_(url)`, + reflectToAttribute: true, }, /** @@ -56,8 +56,8 @@ // Properties //============================================================================ - isTopVisitFavicon: boolean = false; - url: Url = new Url(); + isTopVisitFavicon: boolean; + url: Url; //============================================================================ // Helper methods
diff --git a/chrome/browser/resources/history/history_clusters/search_query.html b/chrome/browser/resources/history/history_clusters/search_query.html index 8e4e7a0..1cf85c6 100644 --- a/chrome/browser/resources/history/history_clusters/search_query.html +++ b/chrome/browser/resources/history/history_clusters/search_query.html
@@ -32,7 +32,7 @@ } </style> <a class="pill pill-icon-start" href$="[[searchQuery.url.url]]" - on-click="onClick_"> + on-click="onClick_" on-auxclick="onAuxClick_"> <div id="icon"></div> <div id="text" class="truncate">[[searchQuery.query]]</div> </a>
diff --git a/chrome/browser/resources/history/history_clusters/search_query.ts b/chrome/browser/resources/history/history_clusters/search_query.ts index 885018d..c207e9f 100644 --- a/chrome/browser/resources/history/history_clusters/search_query.ts +++ b/chrome/browser/resources/history/history_clusters/search_query.ts
@@ -7,6 +7,7 @@ import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {SearchQuery} from './history_clusters.mojom-webui.js'; +import {MetricsProxy, RelatedSearchAction} from './metrics_proxy.js'; import {OpenWindowProxy} from './open_window_proxy.js'; /** @@ -31,6 +32,14 @@ static get properties() { return { /** + * The index of the search query pill. + */ + index: { + type: Number, + value: -1, // Initialized to an invalid value. + }, + + /** * The search query to display. */ searchQuery: Object, @@ -41,14 +50,29 @@ // Properties //============================================================================ - searchQuery: SearchQuery = new SearchQuery(); + index: number; + searchQuery: SearchQuery; //============================================================================ // Event handlers //============================================================================ + private onAuxClick_() { + MetricsProxy.getInstance().recordRelatedSearchAction( + RelatedSearchAction.CLICKED, this.index); + + // Notify the parent <history-cluster> element of this event. + this.dispatchEvent(new CustomEvent('related-search-clicked', { + bubbles: true, + composed: true, + })); + } + private onClick_(event: MouseEvent) { event.preventDefault(); // Prevent default browser action (navigation). + + this.onAuxClick_(); + OpenWindowProxy.getInstance().open(this.searchQuery.url.url); } }
diff --git a/chrome/browser/resources/history/history_clusters/top_visit.html b/chrome/browser/resources/history/history_clusters/top_visit.html index dc2a599..d5549bbe 100644 --- a/chrome/browser/resources/history/history_clusters/top_visit.html +++ b/chrome/browser/resources/history/history_clusters/top_visit.html
@@ -92,17 +92,23 @@ transform: rotate(180deg); } </style> -<url-visit is-top-visit visit="[[visit]]"></url-visit> +<url-visit visit="[[visit]]" index="0" is-top-visit + has-related-visits="[[hasRelatedVisits_]]"> +</url-visit> <div id="related-content"> <div id="related-visits"> <template is="dom-repeat" items="[[visibleRelatedVisits_]]"> - <url-visit visit="[[item]]"></url-visit> + <url-visit visit="[[item]]" + index="[[getVisitIndex_(relatedVisits_, item)]]"> + </url-visit> </template> <!-- Disable animation on iron-collapse, as the parent iron-list can't easily handle it. --> <iron-collapse opened="[[expanded_]]" no-animation> <template is="dom-repeat" items="[[hiddenRelatedVisits_]]"> - <url-visit visit="[[item]]"></url-visit> + <url-visit visit="[[item]]" + index="[[getVisitIndex_(relatedVisits_, item)]]"> + </url-visit> </template> </iron-collapse> </div> @@ -110,7 +116,7 @@ <div id="related-searches-label">$i18n{relatedSearchesHeader}</div> <div id="search-queries"> <template is="dom-repeat" items="[[visit.relatedSearches]]"> - <search-query class="pill" search-query="[[item]]"> + <search-query class="pill" search-query="[[item]]" index="[[index]]"> </search-query> </template> </div> @@ -120,7 +126,7 @@ <div id="toggle-button-white-background" class="pill"></div> <div id="toggle-button" class="pill pill-icon-end" tabindex="0" on-click="onToggleButtonClick_" on-keydown="onToggleButtonKeyDown_"> - <span>[[toggleButtonLabel_]]</span> + <span>[[getToggleButtonLabel_(expanded_)]]</span> <span id="toggle-icon" class="cr-icon icon-expand-more"></span> </div> </div>
diff --git a/chrome/browser/resources/history/history_clusters/top_visit.ts b/chrome/browser/resources/history/history_clusters/top_visit.ts index b44cbab..fff52cc5 100644 --- a/chrome/browser/resources/history/history_clusters/top_visit.ts +++ b/chrome/browser/resources/history/history_clusters/top_visit.ts
@@ -42,7 +42,7 @@ visit: Object, /** - * Whether the related visits of the top visit are expanded/visible. + * Whether the default-hidden related visits are visible. */ expanded_: { type: Boolean, @@ -51,24 +51,35 @@ }, /** - * Related visits that are initially hidden. + * Whether there are related visits that can be shown. */ - hiddenRelatedVisits_: { - type: Object, - computed: `computeHiddenRelatedVisits_(visit.*)`, - }, - - toggleButtonLabel_: { - type: String, - computed: `computeToggleButtonLabel_(expanded_)`, + hasRelatedVisits_: { + type: Boolean, + computed: 'computeHasRelatedVisits_(relatedVisits_)', }, /** - * Related visits that are always visible. + * The default-hidden related visits. + */ + hiddenRelatedVisits_: { + type: Object, + computed: `computeHiddenRelatedVisits_(relatedVisits_)`, + }, + + /** + * The related visits that can be shown. + */ + relatedVisits_: { + type: Object, + computed: `computeRelatedVisits_(visit.*)`, + }, + + /** + * The always-visible related visits. */ visibleRelatedVisits_: { type: Object, - computed: `computeVisibleRelatedVisits_(visit.*)`, + computed: `computeVisibleRelatedVisits_(relatedVisits_)`, }, }; } @@ -77,11 +88,9 @@ // Properties //============================================================================ - visit: URLVisit = new URLVisit(); - private expanded_: boolean = false; - private hiddenRelatedVisits_: Array<URLVisit> = []; - private toggleButtonLabel_: string = ''; - private visibleRelatedVisits_: Array<URLVisit> = []; + visit: URLVisit; + private expanded_: boolean; + private relatedVisits_: Array<URLVisit>; //============================================================================ // Event handlers @@ -101,6 +110,12 @@ private onToggleButtonClick_() { this.expanded_ = !this.expanded_; + // Notify the parent <history-cluster> element of this event. + this.dispatchEvent(new CustomEvent('related-visits-visibility-toggled', { + bubbles: true, + composed: true, + })); + // Dispatch an event to notify the parent elements of a resize. Note that // this simple solution only works because the child iron-collapse has // animations disabled. Otherwise, it gets an incorrect mid-animation size. @@ -114,37 +129,48 @@ // Helper methods //============================================================================ + private computeHasRelatedVisits_(): boolean { + return this.relatedVisits_.length > 0; + } + private computeHiddenRelatedVisits_(): Array<URLVisit> { - return this.visit && this.visit.relatedVisits ? + return this.relatedVisits_.filter((visit: URLVisit) => { + return visit.belowTheFold; + }); + } + + private computeRelatedVisits_(): Array<URLVisit> { + return this.visit.relatedVisits ? this.visit.relatedVisits.filter((visit: URLVisit) => { // 'Ghost' visits with scores of 0 (or below) are never to be shown, // unless the debug flag is switched on. - if (visit.score <= 0 && - !loadTimeData.getBoolean('isHistoryClustersDebug')) { - return false; - } - return visit.belowTheFold; + return visit.score > 0 || + loadTimeData.getBoolean('isHistoryClustersDebug'); }) : []; } - private computeToggleButtonLabel_(): string { - return loadTimeData.getString( - this.expanded_ ? 'toggleButtonLabelLess' : 'toggleButtonLabelMore'); - } - private computeVisibleRelatedVisits_(): Array<URLVisit> { - return this.visit && this.visit.relatedVisits ? - this.visit.relatedVisits.filter((visit: URLVisit) => { - // 'Ghost' visits with scores of 0 (or below) are never to be shown, - // unless the debug flag is switched on. - if (visit.score <= 0 && - !loadTimeData.getBoolean('isHistoryClustersDebug')) { - return false; - } - return !visit.belowTheFold; - }) : - []; + return this.relatedVisits_.filter((visit: URLVisit) => { + return !visit.belowTheFold; + }); + } + + /** + * Returns the label of the toggle button based on whether the default-hidden + * related visits are visible. + */ + private getToggleButtonLabel_(expanded: boolean): string { + return loadTimeData.getString( + expanded ? 'toggleButtonLabelLess' : 'toggleButtonLabelMore'); + } + + /** + * Returns the index of `visit` among the visits in the cluster. + */ + private getVisitIndex_(relatedVisits: Array<URLVisit>, visit: URLVisit): + number { + return relatedVisits.indexOf(visit) + 1; // Index 0 is the top visit. } }
diff --git a/chrome/browser/resources/history/history_clusters/url_visit.html b/chrome/browser/resources/history/history_clusters/url_visit.html index 2b809eb..d980bb79 100644 --- a/chrome/browser/resources/history/history_clusters/url_visit.html +++ b/chrome/browser/resources/history/history_clusters/url_visit.html
@@ -100,8 +100,13 @@ #actionMenuButton { --cr-icon-button-margin-end: 1px; } + + :host(:not([has-related-visits])) #removeAllButton { + display: none; + } </style> -<a id="header" href="[[visit.normalizedUrl.url]]" on-click="onClick_"> +<a id="header" href="[[visit.normalizedUrl.url]]" on-click="onClick_" + on-auxclick="onAuxClick_"> <div id="start-justified"> <page-favicon is-top-visit-favicon="[[isTopVisit]]" url="[[visit.normalizedUrl]]"> @@ -114,7 +119,7 @@ </template> </div> <span id="hostname" class="truncate" hidden="[[isSearchResultsPage_]]"> - [[hostnameFromUrl_(visit.normalizedUrl)]] + [[getHostnameFromUrl_(visit.normalizedUrl)]] <!-- Print the debug next to the hostname to keep layout the same. --> <span id="debug-info" hidden="[[!debugInfo_]]">[[debugInfo_]]</span> </span> @@ -134,8 +139,8 @@ <button class="dropdown-item" on-click="onRemoveSelfButtonClick_"> $i18n{removeFromHistory} </button> - <button class="dropdown-item" on-click="onRemoveAllButtonClick_" - hidden="[[!hasRelatedVisits_]]"> + <button id="removeAllButton" class="dropdown-item" + on-click="onRemoveAllButtonClick_"> $i18n{removeAllFromHistory} </button> </cr-action-menu>
diff --git a/chrome/browser/resources/history/history_clusters/url_visit.ts b/chrome/browser/resources/history/history_clusters/url_visit.ts index 46f5e9e1..82e5726 100644 --- a/chrome/browser/resources/history/history_clusters/url_visit.ts +++ b/chrome/browser/resources/history/history_clusters/url_visit.ts
@@ -14,6 +14,7 @@ import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {Annotation, URLVisit} from './history_clusters.mojom-webui.js'; +import {MetricsProxy, VisitAction, VisitType} from './metrics_proxy.js'; import {OpenWindowProxy} from './open_window_proxy.js'; /** @@ -55,20 +56,28 @@ static get properties() { return { /** + * Whether there are related visits that can be shown. + */ + hasRelatedVisits: { + type: Boolean, + reflectToAttribute: true, + value: false, + }, + + /** + * The index of the visit in the cluster. + */ + index: { + type: Number, + value: -1, // Initialized to an invalid value. + }, + + /** * The visit to display. */ visit: Object, /** - * Whether the visit is a top visit. - */ - isTopVisit: { - type: Boolean, - value: false, - reflectToAttribute: true, - }, - - /** * Annotations to show for the visit (e.g., whether page was bookmarked). */ annotations_: { @@ -77,15 +86,6 @@ }, /** - * Whether the visit has related visits, regardless of initial visibility. - */ - hasRelatedVisits_: { - type: Boolean, - value: false, - computed: 'computeHasRelatedVisits_(visit.*)', - }, - - /** * Debug info for the visit. */ debugInfo_: { @@ -99,10 +99,8 @@ // Properties //============================================================================ - isTopVisit: boolean = false; - visit: URLVisit = new URLVisit(); - private annotations_: Array<string> = []; - private hasRelatedVisits_: boolean = false; + index: number; + visit: URLVisit; //============================================================================ // Event handlers @@ -113,6 +111,17 @@ event.preventDefault(); // Prevent default browser action (navigation). } + private onAuxClick_() { + MetricsProxy.getInstance().recordVisitAction( + VisitAction.CLICKED, this.index, this.getVisitType_()); + + // Notify the parent <history-cluster> element of this event. + this.dispatchEvent(new CustomEvent('visit-clicked', { + bubbles: true, + composed: true, + })); + } + private onClick_(event: MouseEvent) { // Ignore previousely handled events. if (event.defaultPrevented) { @@ -121,6 +130,8 @@ event.preventDefault(); // Prevent default browser action (navigation). + this.onAuxClick_(); + OpenWindowProxy.getInstance().open(this.visit.normalizedUrl.url); } @@ -142,6 +153,9 @@ })); this.$.actionMenu.get().close(); + + MetricsProxy.getInstance().recordVisitAction( + VisitAction.DELETED, this.index, this.getVisitType_()); } //============================================================================ @@ -159,19 +173,6 @@ .map((id: string) => loadTimeData.getString(id)); } - private computeHasRelatedVisits_(): boolean { - return this.visit.relatedVisits - .filter(visit => { - // "Ghost" visits with scores of 0 (or below) are never shown. - // TODO(tommycli): If there are only ghost visits within the - // related visits, and the user deletes the top visit, the - // ghost visits don't get deleted and get attached to a nearby - // cluster next time. We should fix this semantics issue. - return visit.score > 0; - }) - .length > 0; - } - private computeDebugInfo_(): string { if (!loadTimeData.getBoolean('isHistoryClustersDebug')) { return ''; @@ -183,13 +184,23 @@ /** * Returns the domain name of `url` without the leading 'www.', if applicable. */ - private hostnameFromUrl_(url: Url): string { + private getHostnameFromUrl_(url: Url): string { try { return new URL(url.url).hostname.replace(/^(www\.)/, '').trim(); } catch (err) { return ''; } } + + /** + * Returns the VisitType based on whether this is a visit to the default + * search provider's results page. + */ + private getVisitType_(): VisitType { + return this.visit.annotations.includes(Annotation.kSearchResultsPage) ? + VisitType.SRP : + VisitType.NON_SRP; + } } customElements.define(VisitRowElement.is, VisitRowElement);
diff --git a/chrome/browser/resources/new_tab_page/app.js b/chrome/browser/resources/new_tab_page/app.js index 6616011..636c805 100644 --- a/chrome/browser/resources/new_tab_page/app.js +++ b/chrome/browser/resources/new_tab_page/app.js
@@ -291,6 +291,16 @@ this.backgroundImageLoadStartEpoch_ = performance.timeOrigin; /** @private {number} */ this.backgroundImageLoadStart_ = 0; + + chrome.metricsPrivate.recordValue( + { + metricName: 'NewTabPage.Height', + type: chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LINEAR, + min: 1, + max: 1000, + buckets: 200, + }, + Math.floor(document.documentElement.clientHeight)); } /** @override */
diff --git a/chrome/browser/resources/settings/BUILD.gn b/chrome/browser/resources/settings/BUILD.gn index d319764..9f3ccfe 100644 --- a/chrome/browser/resources/settings/BUILD.gn +++ b/chrome/browser/resources/settings/BUILD.gn
@@ -192,8 +192,8 @@ "languages_page/languages_browser_proxy.ts", "languages_page/languages_settings_metrics_proxy.ts", "languages_page/languages_types.ts", - "people_page/import_data_browser_proxy.js", - "people_page/manage_profile_browser_proxy.js", + "people_page/import_data_browser_proxy.ts", + "people_page/manage_profile_browser_proxy.ts", ] } } @@ -259,7 +259,7 @@ "on_startup_page/startup_urls_page.ts", "people_page/sync_account_control.js", "people_page/sync_encryption_options.js", - "people_page/people_page.js", + "people_page/people_page.ts", "people_page/signout_dialog.js", "people_page/sync_controls.js", "people_page/sync_page.js", @@ -365,8 +365,8 @@ "languages_page/add_languages_dialog.ts", "languages_page/languages_page.ts", "languages_page/languages_subpage.ts", - "people_page/import_data_dialog.js", - "people_page/manage_profile.js", + "people_page/import_data_dialog.ts", + "people_page/manage_profile.ts", ] } } @@ -662,7 +662,7 @@ "on_startup_page/startup_urls_page.ts", "open_window_proxy.js", "page_visibility.js", - "people_page/people_page.js", + "people_page/people_page.ts", "people_page/profile_info_browser_proxy.js", "people_page/signout_dialog.js", "people_page/sync_account_control.js", @@ -805,10 +805,10 @@ "languages_page/languages_settings_metrics_proxy.ts", "languages_page/languages_subpage.ts", "languages_page/languages_types.ts", - "people_page/import_data_browser_proxy.js", - "people_page/import_data_dialog.js", - "people_page/manage_profile_browser_proxy.js", - "people_page/manage_profile.js", + "people_page/import_data_browser_proxy.ts", + "people_page/import_data_dialog.ts", + "people_page/manage_profile_browser_proxy.ts", + "people_page/manage_profile.ts", ] }
diff --git a/chrome/browser/resources/settings/chromeos/internet_page/esim_remove_profile_dialog.html b/chrome/browser/resources/settings/chromeos/internet_page/esim_remove_profile_dialog.html index 27371a2..4f9e79b 100644 --- a/chrome/browser/resources/settings/chromeos/internet_page/esim_remove_profile_dialog.html +++ b/chrome/browser/resources/settings/chromeos/internet_page/esim_remove_profile_dialog.html
@@ -8,7 +8,7 @@ } #warningMessage { - --iron-icon-fill-color: var(--google-grey-600); + --iron-icon-fill-color: var(--cros-icon-color-disabled); --iron-icon-height: 16px; --iron-icon-width: 16px; font-size: smaller;
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.ts b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.ts index d02fbd4c..a0dacaaf 100644 --- a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.ts +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.ts
@@ -425,8 +425,8 @@ * @return A list of selected data types. */ private getSelectedDataTypes_(tab: HTMLElement): Array<string> { - const checkboxes = tab.querySelectorAll('settings-checkbox') as - NodeListOf<SettingsCheckboxElement>; + const checkboxes = + tab.querySelectorAll<SettingsCheckboxElement>('settings-checkbox'); const dataTypes: Array<string> = []; checkboxes.forEach((checkbox) => { if (checkbox.checked && !checkbox.hidden) { @@ -493,8 +493,9 @@ chrome.metricsPrivate.recordUserAction('ClearBrowsingData_AdvancedTab'); } - (this.shadowRoot!.querySelectorAll('settings-checkbox[no-set-pref]') as - NodeListOf<SettingsCheckboxElement>) + this.shadowRoot! + .querySelectorAll<SettingsCheckboxElement>( + 'settings-checkbox[no-set-pref]') .forEach(checkbox => checkbox.sendPrefChange()); const {showHistoryNotice, showPasswordsNotice} =
diff --git a/chrome/browser/resources/settings/people_page/BUILD.gn b/chrome/browser/resources/settings/people_page/BUILD.gn index b5e834d..9f4456d 100644 --- a/chrome/browser/resources/settings/people_page/BUILD.gn +++ b/chrome/browser/resources/settings/people_page/BUILD.gn
@@ -12,7 +12,6 @@ closure_flags = settings_closure_flags + mojom_js_args deps = [ ":account_manager_browser_proxy", - ":people_page", ":profile_info_browser_proxy", ":signout_dialog", ":sync_account_control", @@ -21,76 +20,12 @@ ":sync_encryption_options", ":sync_page", ] - - if (!is_chromeos_ash) { - deps += [ - ":import_data_browser_proxy", - ":import_data_dialog", - ":manage_profile", - ":manage_profile_browser_proxy", - ] - } } js_library("account_manager_browser_proxy") { deps = [ "//ui/webui/resources/js:cr.m" ] } -if (!is_chromeos_ash) { - js_library("import_data_browser_proxy") { - deps = [ "//ui/webui/resources/js:cr.m" ] - externs_list = [ "$externs_path/metrics_private.js" ] - } - - js_library("import_data_dialog") { - deps = [ - ":import_data_browser_proxy", - "../controls:settings_checkbox", - "../prefs:prefs_behavior", - "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", - "//ui/webui/resources/js:i18n_behavior.m", - "//ui/webui/resources/js:web_ui_listener_behavior.m", - ] - } - - js_library("manage_profile") { - deps = [ - ":manage_profile_browser_proxy", - ":sync_browser_proxy", - "..:i18n_setup", - "..:route", - "..:router", - "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", - ] - } - - js_library("manage_profile_browser_proxy") { - deps = [ - "//ui/webui/resources/cr_elements/cr_profile_avatar_selector:cr_profile_avatar_selector", - "//ui/webui/resources/js:cr.m", - ] - } -} - -js_library("people_page") { - deps = [ - ":account_manager_browser_proxy", - ":profile_info_browser_proxy", - ":sync_browser_proxy", - "..:i18n_setup", - "..:open_window_proxy", - "..:page_visibility", - "..:route", - "..:router", - "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", - "//ui/webui/resources/cr_elements/chromeos/cr_picture:png.m", - "//ui/webui/resources/cr_elements/cr_toast:cr_toast", - "//ui/webui/resources/js:cr.m", - "//ui/webui/resources/js:icon", - "//ui/webui/resources/js:web_ui_listener_behavior.m", - ] -} - js_library("profile_info_browser_proxy") { deps = [ "//ui/webui/resources/js:cr.m" ] } @@ -158,7 +93,7 @@ html_to_js("web_components") { js_files = [ - "people_page.js", + "people_page.ts", "signout_dialog.js", "sync_account_control.js", "sync_controls.js", @@ -168,8 +103,8 @@ if (!is_chromeos_ash) { js_files += [ - "import_data_dialog.js", - "manage_profile.js", + "import_data_dialog.ts", + "manage_profile.ts", ] } }
diff --git a/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js b/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js index 980d7a2..2c991ef0 100644 --- a/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js +++ b/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. // clang-format off -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; // clang-format on /** @@ -94,7 +94,17 @@ showWelcomeDialogIfRequired() { chrome.send('showWelcomeDialogIfRequired'); } + + /** @return {!AccountManagerBrowserProxy} */ + static getInstance() { + return instance || (instance = new AccountManagerBrowserProxyImpl()); + } + + /** @param {!AccountManagerBrowserProxy} obj */ + static setInstance(obj) { + instance = obj; + } } - addSingletonGetter(AccountManagerBrowserProxyImpl); - + /** @type {?AccountManagerBrowserProxy} */ + let instance = null;
diff --git a/chrome/browser/resources/settings/people_page/import_data_browser_proxy.js b/chrome/browser/resources/settings/people_page/import_data_browser_proxy.js deleted file mode 100644 index b8d01da..0000000 --- a/chrome/browser/resources/settings/people_page/import_data_browser_proxy.js +++ /dev/null
@@ -1,78 +0,0 @@ -// Copyright 2016 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. - -// clang-format off -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; -// clang-format on - -/** - * An object describing a source browser profile that may be imported. - * The structure of this data must be kept in sync with C++ ImportDataHandler. - * @typedef {{ - * name: string, - * index: number, - * profileName: string, - * history: boolean, - * favorites: boolean, - * passwords: boolean, - * search: boolean, - * autofillFormData: boolean, - * }} - */ -export let BrowserProfile; - -/** - * @enum {string} - * These string values must be kept in sync with the C++ ImportDataHandler. - */ -export const ImportDataStatus = { - INITIAL: 'initial', - IN_PROGRESS: 'inProgress', - SUCCEEDED: 'succeeded', - FAILED: 'failed', -}; - -/** @interface */ -export class ImportDataBrowserProxy { - /** - * Returns the source profiles available for importing from other browsers. - * @return {!Promise<!Array<!BrowserProfile>>} - */ - initializeImportDialog() {} - - /** - * Starts importing data for the specified source browser profile. The C++ - * responds with the 'import-data-status-changed' WebUIListener event. - * @param {number} sourceBrowserProfileIndex - * @param {!Object<boolean>} types Which types of data to import. - */ - importData(sourceBrowserProfileIndex, types) {} - - /** - * Prompts the user to choose a bookmarks file to import bookmarks from. - */ - importFromBookmarksFile() {} -} - -/** @implements {ImportDataBrowserProxy} */ -export class ImportDataBrowserProxyImpl { - /** @override */ - initializeImportDialog() { - return sendWithPromise('initializeImportDialog'); - } - - /** @override */ - importData(sourceBrowserProfileIndex, types) { - chrome.send('importData', [sourceBrowserProfileIndex, types]); - } - - /** @override */ - importFromBookmarksFile() { - chrome.send('importFromBookmarksFile'); - } -} - -// The singleton instance_ is replaced with a test version of this wrapper -// during testing. -addSingletonGetter(ImportDataBrowserProxyImpl);
diff --git a/chrome/browser/resources/settings/people_page/import_data_browser_proxy.ts b/chrome/browser/resources/settings/people_page/import_data_browser_proxy.ts new file mode 100644 index 0000000..635a008 --- /dev/null +++ b/chrome/browser/resources/settings/people_page/import_data_browser_proxy.ts
@@ -0,0 +1,78 @@ +// Copyright 2016 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. + +// clang-format off +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +// clang-format on + +/** + * An object describing a source browser profile that may be imported. + * The structure of this data must be kept in sync with C++ ImportDataHandler. + */ +export type BrowserProfile = { + name: string, + index: number, + profileName: string, + history: boolean, + favorites: boolean, + passwords: boolean, + search: boolean, + autofillFormData: boolean, +}; + +/** + * These string values must be kept in sync with the C++ ImportDataHandler. + */ +export enum ImportDataStatus { + INITIAL = 'initial', + IN_PROGRESS = 'inProgress', + SUCCEEDED = 'succeeded', + FAILED = 'failed', +} + +export interface ImportDataBrowserProxy { + /** + * Returns the source profiles available for importing from other browsers. + */ + initializeImportDialog(): Promise<Array<BrowserProfile>>; + + /** + * Starts importing data for the specified source browser profile. The C++ + * responds with the 'import-data-status-changed' WebUIListener event. + * @param types Which types of data to import. + */ + importData( + sourceBrowserProfileIndex: number, + types: {[type: string]: boolean}): void; + + /** + * Prompts the user to choose a bookmarks file to import bookmarks from. + */ + importFromBookmarksFile(): void; +} + +export class ImportDataBrowserProxyImpl implements ImportDataBrowserProxy { + initializeImportDialog() { + return sendWithPromise('initializeImportDialog'); + } + + importData( + sourceBrowserProfileIndex: number, types: {[type: string]: boolean}) { + chrome.send('importData', [sourceBrowserProfileIndex, types]); + } + + importFromBookmarksFile() { + chrome.send('importFromBookmarksFile'); + } + + static getInstance(): ImportDataBrowserProxy { + return instance || (instance = new ImportDataBrowserProxyImpl()); + } + + static setInstance(obj: ImportDataBrowserProxy) { + instance = obj; + } +} + +let instance: ImportDataBrowserProxy|null = null;
diff --git a/chrome/browser/resources/settings/people_page/import_data_dialog.js b/chrome/browser/resources/settings/people_page/import_data_dialog.ts similarity index 63% rename from chrome/browser/resources/settings/people_page/import_data_dialog.js rename to chrome/browser/resources/settings/people_page/import_data_dialog.ts index e7cdf51..12a86200 100644 --- a/chrome/browser/resources/settings/people_page/import_data_dialog.js +++ b/chrome/browser/resources/settings/people_page/import_data_dialog.ts
@@ -16,26 +16,29 @@ import '../icons.js'; import '../settings_vars_css.js'; -import {I18nBehavior, I18nBehaviorInterface} from 'chrome://resources/js/i18n_behavior.m.js'; -import {WebUIListenerBehavior, WebUIListenerBehaviorInterface} from 'chrome://resources/js/web_ui_listener_behavior.m.js'; +import {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.m.js'; +import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js'; +import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.m.js'; import {html, mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {SettingsCheckboxElement} from '../controls/settings_checkbox.js'; +import {SettingsCheckboxElement} from '../controls/settings_checkbox_ts.js'; import {loadTimeData} from '../i18n_setup.js'; import {PrefsBehavior} from '../prefs/prefs_behavior.js'; import {BrowserProfile, ImportDataBrowserProxy, ImportDataBrowserProxyImpl, ImportDataStatus} from './import_data_browser_proxy.js'; -/** - * @constructor - * @extends {PolymerElement} - * @implements {I18nBehaviorInterface} - * @implements {WebUIListenerBehaviorInterface} - */ -const SettingsImportDataDialogElementBase = mixinBehaviors( - [I18nBehavior, WebUIListenerBehavior, PrefsBehavior], PolymerElement); +interface SettingsImportDataDialogElement { + $: { + dialog: CrDialogElement, + browserSelect: HTMLSelectElement, + }; +} -/** @polymer */ +const SettingsImportDataDialogElementBase = + mixinBehaviors( + [I18nBehavior, WebUIListenerBehavior, PrefsBehavior], PolymerElement) as + {new (): PolymerElement & I18nBehavior & WebUIListenerBehavior}; + class SettingsImportDataDialogElement extends SettingsImportDataDialogElementBase { static get is() { @@ -48,10 +51,8 @@ static get properties() { return { - /** @private {!Array<!BrowserProfile>} */ browserProfiles_: Array, - /** @private {!BrowserProfile} */ selected_: { type: Object, observer: 'updateImportDataTypesSelected_', @@ -59,14 +60,12 @@ /** * Whether none of the import data categories is selected. - * @private */ noImportDataTypeSelected_: { type: Boolean, value: false, }, - /** @private */ importStatus_: { type: String, value: ImportDataStatus.INITIAL, @@ -74,7 +73,6 @@ /** * Mirroring the enum so that it can be used from HTML bindings. - * @private */ importStatusEnum_: { type: Object, @@ -84,21 +82,19 @@ }; } - constructor() { - super(); + private browserProfiles_: Array<BrowserProfile>; + private selected_: BrowserProfile; + private noImportDataTypeSelected_: boolean; + private importStatus_: ImportDataStatus; + private browserProxy_: ImportDataBrowserProxy = + ImportDataBrowserProxyImpl.getInstance(); - /** @private {!ImportDataBrowserProxy} */ - this.browserProxy_ = ImportDataBrowserProxyImpl.getInstance(); - } - - /** @override */ ready() { super.ready(); this.addEventListener( 'settings-boolean-control-change', this.updateImportDataTypesSelected_); } - /** @override */ connectedCallback() { super.connectedCallback(); @@ -111,87 +107,72 @@ this.$.dialog.showModal(); }); - this.addWebUIListener('import-data-status-changed', importStatus => { - this.importStatus_ = importStatus; - if (this.hasImportStatus_(ImportDataStatus.FAILED)) { - this.closeDialog_(); - } - }); + this.addWebUIListener( + 'import-data-status-changed', (importStatus: ImportDataStatus) => { + this.importStatus_ = importStatus; + if (this.hasImportStatus_(ImportDataStatus.FAILED)) { + this.closeDialog_(); + } + }); } - /** - * @param {string} name - * @param {string} profileName - * @return {string} - * @private - */ - getProfileDisplayName_(name, profileName) { + private getProfileDisplayName_(name: string, profileName: string): string { return profileName ? `${name} - ${profileName}` : name; } - /** @private */ - updateImportDataTypesSelected_() { - const checkboxes = this.shadowRoot.querySelectorAll( - 'settings-checkbox[checked]:not([hidden])'); + private updateImportDataTypesSelected_() { + const checkboxes = + this.shadowRoot!.querySelectorAll<SettingsCheckboxElement>( + 'settings-checkbox[checked]:not([hidden])'); this.noImportDataTypeSelected_ = checkboxes.length === 0; } /** - * @param {!ImportDataStatus} status - * @return {boolean} Whether |status| is the current status. - * @private + * @return Whether |status| is the current status. */ - hasImportStatus_(status) { + private hasImportStatus_(status: ImportDataStatus): boolean { return this.importStatus_ === status; } - /** @private */ - isImportFromFileSelected_() { + private isImportFromFileSelected_() { // The last entry in |browserProfiles_| always refers to dummy profile for // importing from a bookmarks file. return this.selected_.index === this.browserProfiles_.length - 1; } - /** - * @return {string} - * @private - */ - getActionButtonText_() { + private getActionButtonText_(): string { return this.i18n( this.isImportFromFileSelected_() ? 'importChooseFile' : 'importCommit'); } - /** @private */ - onBrowserProfileSelectionChange_() { + private onBrowserProfileSelectionChange_() { this.selected_ = this.browserProfiles_[this.$.browserSelect.selectedIndex]; } - /** @private */ - onActionButtonTap_() { - const checkboxes = /** @type {!NodeList<!SettingsCheckboxElement>} */ ( - this.shadowRoot.querySelectorAll('settings-checkbox')); + private onActionButtonTap_() { + const checkboxes = + this.shadowRoot!.querySelectorAll<SettingsCheckboxElement>( + 'settings-checkbox'); if (this.isImportFromFileSelected_()) { this.browserProxy_.importFromBookmarksFile(); } else { - const types = {}; + const types: {[type: string]: boolean} = {}; checkboxes.forEach(checkbox => { - types[checkbox.pref.key] = checkbox.checked && !checkbox.hidden; + types[checkbox.pref!.key] = checkbox.checked && !checkbox.hidden; }); this.browserProxy_.importData(this.$.browserSelect.selectedIndex, types); } checkboxes.forEach(checkbox => checkbox.sendPrefChange()); } - /** @private */ - closeDialog_() { + private closeDialog_() { this.$.dialog.close(); } /** - * @return {boolean} Whether the import button should be disabled. - * @private + * @return Whether the import button should be disabled. */ - shouldDisableImport_() { + private shouldDisableImport_(): boolean { return this.hasImportStatus_(ImportDataStatus.IN_PROGRESS) || this.noImportDataTypeSelected_; }
diff --git a/chrome/browser/resources/settings/people_page/manage_profile.js b/chrome/browser/resources/settings/people_page/manage_profile.ts similarity index 78% rename from chrome/browser/resources/settings/people_page/manage_profile.js rename to chrome/browser/resources/settings/people_page/manage_profile.ts index 0a5a0ea..3733a59 100644 --- a/chrome/browser/resources/settings/people_page/manage_profile.js +++ b/chrome/browser/resources/settings/people_page/manage_profile.ts
@@ -16,8 +16,9 @@ import '../settings_shared_css.js'; import 'chrome://resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.js'; +import {CrInputElement} from 'chrome://resources/cr_elements/cr_input/cr_input.m.js'; import {AvatarIcon} from 'chrome://resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.js'; -import {WebUIListenerBehavior, WebUIListenerBehaviorInterface} from 'chrome://resources/js/web_ui_listener_behavior.m.js'; +import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.m.js'; import {html, mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {loadTimeData} from '../i18n_setup.js'; @@ -27,14 +28,12 @@ import {ManageProfileBrowserProxy, ManageProfileBrowserProxyImpl, ProfileShortcutStatus} from './manage_profile_browser_proxy.js'; import {SyncStatus} from './sync_browser_proxy.js'; -/** - * @constructor - * @extends {PolymerElement} - * @implements {RouteObserverMixinInterface} - * @implements {WebUIListenerBehaviorInterface} - */ const SettingsManageProfileElementBase = - mixinBehaviors([WebUIListenerBehavior], RouteObserverMixin(PolymerElement)); + mixinBehaviors( + [WebUIListenerBehavior], RouteObserverMixin(PolymerElement)) as { + new (): + PolymerElement & WebUIListenerBehavior & RouteObserverMixinInterface + }; /** @polymer */ class SettingsManageProfileElement extends SettingsManageProfileElementBase { @@ -105,19 +104,21 @@ }; } - /** @override */ - constructor() { - super(); - - /** @private {!ManageProfileBrowserProxy} */ - this.browserProxy_ = ManageProfileBrowserProxyImpl.getInstance(); - } + private profileAvatar_: AvatarIcon; + profileName: string; + private hasProfileShortcut_: boolean; + availableIcons: Array<AvatarIcon>; + syncStatus: SyncStatus|null; + private isProfileShortcutSettingVisible_: boolean; + pattern_: string; + private browserProxy_: ManageProfileBrowserProxy = + ManageProfileBrowserProxyImpl.getInstance(); /** @override */ connectedCallback() { super.connectedCallback(); - const setIcons = icons => { + const setIcons = (icons: Array<AvatarIcon>) => { this.availableIcons = icons; }; @@ -130,8 +131,7 @@ if (Router.getInstance().getCurrentRoute() === routes.MANAGE_PROFILE) { if (this.profileName) { const profileNameInput = - /** @type {CrInputElement} */ ( - this.shadowRoot.querySelector('#name')); + this.shadowRoot!.querySelector<CrInputElement>('#name'); if (profileNameInput) { profileNameInput.value = this.profileName; } @@ -154,34 +154,31 @@ /** * Handler for when the profile name field is changed, then blurred. - * @param {!Event} event - * @private */ - onProfileNameChanged_(event) { - if (event.target.invalid) { + private onProfileNameChanged_(event: Event) { + const target = event.target as CrInputElement; + if (target.invalid) { return; } - this.browserProxy_.setProfileName(event.target.value); + this.browserProxy_.setProfileName(target.value); } /** * Handler for profile name keydowns. - * @param {!Event} event - * @private */ - onProfileNameKeydown_(event) { + private onProfileNameKeydown_(event: KeyboardEvent) { if (event.key === 'Escape') { - event.target.value = this.profileName; - event.target.blur(); + const target = event.target as CrInputElement; + target.value = this.profileName; + target.blur(); } } /** * Handler for when the profile avatar is changed by the user. - * @private */ - profileAvatarChanged_() { + private profileAvatarChanged_() { if (this.profileAvatar_.isGaiaAvatar) { this.browserProxy_.setProfileIconToGaiaAvatar(); } else { @@ -191,20 +188,16 @@ } /** - * @param {?SyncStatus} syncStatus - * @return {boolean} Whether the profile name field is disabled. - * @private + * @return Whether the profile name field is disabled. */ - isProfileNameDisabled_(syncStatus) { + private isProfileNameDisabled_(syncStatus: SyncStatus): boolean { return !!syncStatus.supervisedUser && !syncStatus.childUser; } /** * Handler for when the profile shortcut toggle is changed. - * @param {!Event} event - * @private */ - onHasProfileShortcutChange_(event) { + private onHasProfileShortcutChange_() { if (this.hasProfileShortcut_) { this.browserProxy_.addProfileShortcut(); } else {
diff --git a/chrome/browser/resources/settings/people_page/manage_profile_browser_proxy.js b/chrome/browser/resources/settings/people_page/manage_profile_browser_proxy.js deleted file mode 100644 index 0faee1104..0000000 --- a/chrome/browser/resources/settings/people_page/manage_profile_browser_proxy.js +++ /dev/null
@@ -1,110 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview A helper object used from the "Manage Profile" subpage of - * the People section to interact with the browser. Chrome Browser only. - */ - -// clang-format off -import {AvatarIcon} from 'chrome://resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.js'; -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; -// clang-format on - -/** - * Contains the possible profile shortcut statuses. These strings must be kept - * in sync with the C++ Manage Profile handler. - * @enum {string} - */ -export const ProfileShortcutStatus = { - PROFILE_SHORTCUT_SETTING_HIDDEN: 'profileShortcutSettingHidden', - PROFILE_SHORTCUT_NOT_FOUND: 'profileShortcutNotFound', - PROFILE_SHORTCUT_FOUND: 'profileShortcutFound', -}; - -/** @interface */ -export class ManageProfileBrowserProxy { - /** - * Gets the available profile icons to choose from. - * @return {!Promise<!Array<!AvatarIcon>>} - */ - getAvailableIcons() {} - - /** - * Sets the profile's icon to the GAIA avatar. - */ - setProfileIconToGaiaAvatar() {} - - /** - * Sets the profile's icon to one of the default avatars. - * @param {number} index The new profile avatar index. - */ - setProfileIconToDefaultAvatar(index) {} - - /** - * Sets the profile's name. - * @param {string} name The new profile name. - */ - setProfileName(name) {} - - /** - * Returns whether the current profile has a shortcut. - * @return {!Promise<!ProfileShortcutStatus>} - */ - getProfileShortcutStatus() {} - - /** - * Adds a shortcut for the current profile. - */ - addProfileShortcut() {} - - /** - * Removes the shortcut of the current profile. - */ - removeProfileShortcut() {} -} - -/** - * @implements {ManageProfileBrowserProxy} - */ -export class ManageProfileBrowserProxyImpl { - /** @override */ - getAvailableIcons() { - return sendWithPromise('getAvailableIcons'); - } - - /** @override */ - setProfileIconToGaiaAvatar() { - chrome.send('setProfileIconToGaiaAvatar'); - } - - /** @override */ - setProfileIconToDefaultAvatar(index) { - chrome.send('setProfileIconToDefaultAvatar', [index]); - } - - /** @override */ - setProfileName(name) { - chrome.send('setProfileName', [name]); - } - - /** @override */ - getProfileShortcutStatus() { - return sendWithPromise('requestProfileShortcutStatus'); - } - - /** @override */ - addProfileShortcut() { - chrome.send('addProfileShortcut'); - } - - /** @override */ - removeProfileShortcut() { - chrome.send('removeProfileShortcut'); - } -} - -// The singleton instance_ is replaced with a test version of this wrapper -// during testing. -addSingletonGetter(ManageProfileBrowserProxyImpl);
diff --git a/chrome/browser/resources/settings/people_page/manage_profile_browser_proxy.ts b/chrome/browser/resources/settings/people_page/manage_profile_browser_proxy.ts new file mode 100644 index 0000000..b25110e --- /dev/null +++ b/chrome/browser/resources/settings/people_page/manage_profile_browser_proxy.ts
@@ -0,0 +1,102 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview A helper object used from the "Manage Profile" subpage of + * the People section to interact with the browser. Chrome Browser only. + */ + +// clang-format off +import {AvatarIcon} from 'chrome://resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; +// clang-format on + +/** + * Contains the possible profile shortcut statuses. These strings must be kept + * in sync with the C++ Manage Profile handler. + */ +export enum ProfileShortcutStatus { + PROFILE_SHORTCUT_SETTING_HIDDEN = 'profileShortcutSettingHidden', + PROFILE_SHORTCUT_NOT_FOUND = 'profileShortcutNotFound', + PROFILE_SHORTCUT_FOUND = 'profileShortcutFound', +} + +export interface ManageProfileBrowserProxy { + /** + * Gets the available profile icons to choose from. + */ + getAvailableIcons(): Promise<Array<AvatarIcon>>; + + /** + * Sets the profile's icon to the GAIA avatar. + */ + setProfileIconToGaiaAvatar(): void; + + /** + * Sets the profile's icon to one of the default avatars. + * @param index The new profile avatar index. + */ + setProfileIconToDefaultAvatar(index: number): void; + + /** + * Sets the profile's name. + */ + setProfileName(name: string): void; + + /** + * Returns whether the current profile has a shortcut. + */ + getProfileShortcutStatus(): Promise<ProfileShortcutStatus>; + + /** + * Adds a shortcut for the current profile. + */ + addProfileShortcut(): void; + + /** + * Removes the shortcut of the current profile. + */ + removeProfileShortcut(): void; +} + +export class ManageProfileBrowserProxyImpl implements + ManageProfileBrowserProxy { + getAvailableIcons() { + return sendWithPromise('getAvailableIcons'); + } + + setProfileIconToGaiaAvatar() { + chrome.send('setProfileIconToGaiaAvatar'); + } + + setProfileIconToDefaultAvatar(index: number) { + chrome.send('setProfileIconToDefaultAvatar', [index]); + } + + setProfileName(name: string) { + chrome.send('setProfileName', [name]); + } + + getProfileShortcutStatus() { + return sendWithPromise('requestProfileShortcutStatus'); + } + + addProfileShortcut() { + chrome.send('addProfileShortcut'); + } + + removeProfileShortcut() { + chrome.send('removeProfileShortcut'); + } + + static getInstance(): ManageProfileBrowserProxy { + return instance || (instance = new ManageProfileBrowserProxyImpl()); + } + + static setInstance(obj: ManageProfileBrowserProxy) { + instance = obj; + } +} + +let instance: ManageProfileBrowserProxy|null = null;
diff --git a/chrome/browser/resources/settings/people_page/people_page.js b/chrome/browser/resources/settings/people_page/people_page.ts similarity index 79% rename from chrome/browser/resources/settings/people_page/people_page.js rename to chrome/browser/resources/settings/people_page/people_page.ts index 00666f6..77396fc 100644 --- a/chrome/browser/resources/settings/people_page/people_page.js +++ b/chrome/browser/resources/settings/people_page/people_page.ts
@@ -30,7 +30,7 @@ import {isChromeOS} from 'chrome://resources/js/cr.m.js'; import {focusWithoutInk} from 'chrome://resources/js/cr/ui/focus_without_ink.m.js'; import {getImage} from 'chrome://resources/js/icon.js'; -import {WebUIListenerBehavior, WebUIListenerBehaviorInterface} from 'chrome://resources/js/web_ui_listener_behavior.m.js'; +import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.m.js'; import {html, mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {loadTimeData} from '../i18n_setup.js'; @@ -45,17 +45,22 @@ import {ProfileInfo, ProfileInfoBrowserProxy, ProfileInfoBrowserProxyImpl} from './profile_info_browser_proxy.js'; import {StoredAccount, SyncBrowserProxy, SyncBrowserProxyImpl, SyncStatus} from './sync_browser_proxy.js'; +type FocusConfig = Map<string, (string|(() => void))>; -/** - * @constructor - * @extends {PolymerElement} - * @implements {RouteObserverMixinInterface} - * @implements {WebUIListenerBehaviorInterface} - */ +interface SettingsPeoplePageElement { + $: { + importDataDialogTrigger: HTMLElement, + toast: CrToastElement, + }; +} + const SettingsPeoplePageElementBase = - mixinBehaviors([WebUIListenerBehavior], RouteObserverMixin(PolymerElement)); + mixinBehaviors( + [WebUIListenerBehavior], RouteObserverMixin(PolymerElement)) as { + new (): + PolymerElement & WebUIListenerBehavior & RouteObserverMixinInterface + }; -/** @polymer */ class SettingsPeoplePageElement extends SettingsPeoplePageElementBase { static get is() { return 'settings-people-page'; @@ -82,7 +87,6 @@ * TODO(tangltom): In the future when all profiles are completely * migrated, this should be removed, and UIs hidden behind it should * become default. - * @private */ signinAllowed_: { type: Boolean, @@ -94,26 +98,22 @@ // <if expr="not chromeos"> /** * Stored accounts to the system, supplied by SyncBrowserProxy. - * @type {?Array<!StoredAccount>} */ storedAccounts: Object, // </if> /** * The current sync status, supplied by SyncBrowserProxy. - * @type {?SyncStatus} */ syncStatus: Object, /** * Dictionary defining page visibility. - * @type {!PageVisibility} */ pageVisibility: Object, /** * Authentication token provided by settings-lock-screen. - * @private */ authToken_: { type: String, @@ -122,14 +122,12 @@ /** * The currently selected profile icon URL. May be a data URL. - * @private */ profileIconUrl_: String, /** * Whether the profile row is clickable. The behavior depends on the * platform. - * @private */ isProfileActionable_: { type: Boolean, @@ -146,12 +144,10 @@ /** * The current profile name. - * @private */ profileName_: String, // <if expr="not chromeos"> - /** @private {boolean} */ shouldShowGoogleAccount_: { type: Boolean, value: false, @@ -160,17 +156,14 @@ 'storedAccounts.length, syncStatus.signedIn, syncStatus.hasError)', }, - /** @private */ showImportDataDialog_: { type: Boolean, value: false, }, // </if> - /** @private */ showSignoutDialog_: Boolean, - /** @private {!Map<string, string>} */ focusConfig_: { type: Object, value() { @@ -182,8 +175,9 @@ if (routes.MANAGE_PROFILE) { map.set( routes.MANAGE_PROFILE.path, - this.signinAllowed_ ? '#edit-profile' : - '#profile-row .subpage-arrow'); + loadTimeData.getBoolean('signinAllowed') ? + '#edit-profile' : + '#profile-row .subpage-arrow'); } // </if> return map; @@ -192,14 +186,26 @@ }; } - constructor() { - super(); + private signinAllowed_: boolean; + syncStatus: SyncStatus|null; + pageVisibility: PageVisibility; + private authToken_: string; + private profileIconUrl_: string; + private isProfileActionable_: boolean; + private profileName_: String; - /** @private {!SyncBrowserProxy} */ - this.syncBrowserProxy_ = SyncBrowserProxyImpl.getInstance(); - } + // <if expr="not chromeos"> + storedAccounts: Array<StoredAccount>|null; + private shouldShowGoogleAccount_: boolean; + private showImportDataDialog_: boolean; + // </if> - /** @override */ + private showSignoutDialog_: boolean; + private focusConfig_: FocusConfig; + + private syncBrowserProxy_: SyncBrowserProxy = + SyncBrowserProxyImpl.getInstance(); + connectedCallback() { super.connectedCallback(); @@ -215,10 +221,8 @@ } // </if> if (useProfileNameAndIcon) { - /** @type {!ProfileInfoBrowserProxy} */ ( - ProfileInfoBrowserProxyImpl.getInstance()) - .getProfileInfo() - .then(this.handleProfileInfo_.bind(this)); + ProfileInfoBrowserProxyImpl.getInstance().getProfileInfo().then( + this.handleProfileInfo_.bind(this)); this.addWebUIListener( 'profile-info-changed', this.handleProfileInfo_.bind(this)); } @@ -229,22 +233,23 @@ 'sync-status-changed', this.handleSyncStatus_.bind(this)); // <if expr="not chromeos"> - const handleStoredAccounts = accounts => { + const handleStoredAccounts = (accounts: Array<StoredAccount>) => { this.storedAccounts = accounts; }; this.syncBrowserProxy_.getStoredAccounts().then(handleStoredAccounts); this.addWebUIListener('stored-accounts-updated', handleStoredAccounts); this.addWebUIListener('sync-settings-saved', () => { - /** @type {!CrToastElement} */ (this.$.toast).show(); + this.$.toast.show(); }); // </if> } - /** @protected */ currentRouteChanged() { + // <if expr="not chromeos"> this.showImportDataDialog_ = Router.getInstance().getCurrentRoute() === routes.IMPORT_DATA; + // </if> if (Router.getInstance().getCurrentRoute() === routes.SIGN_OUT) { // If the sync status has not been fetched yet, optimistically display @@ -258,21 +263,13 @@ } } - /** - * @return {!Element} - * @private - */ - getEditPersonAssocControl_() { + private getEditPersonAssocControl_(): Element { return this.signinAllowed_ ? - assert(this.shadowRoot.querySelector('#edit-profile')) : - assert(this.shadowRoot.querySelector('#profile-row')); + assert(this.shadowRoot!.querySelector('#edit-profile')!) : + assert(this.shadowRoot!.querySelector('#profile-row')!); } - /** - * @return {string} - * @private - */ - getSyncAndGoogleServicesSubtext_() { + private getSyncAndGoogleServicesSubtext_(): string { if (this.syncStatus && this.syncStatus.hasError && this.syncStatus.statusText) { return this.syncStatus.statusText; @@ -282,10 +279,8 @@ /** * Handler for when the profile's icon and name is updated. - * @private - * @param {!ProfileInfo} info */ - handleProfileInfo_(info) { + private handleProfileInfo_(info: ProfileInfo) { this.profileName_ = info.name; /** * Extract first frame from image by creating a single frame PNG using @@ -302,13 +297,8 @@ } // <if expr="chromeos"> - /** - * @private - * @suppress {checkTypes} The types only exists in Chrome OS builds, but - * Closure doesn't understand the <if> above. - */ - async updateAccounts_() { - const /** @type {!Array<{Account}>} */ accounts = + private async updateAccounts_() { + const accounts = await AccountManagerBrowserProxyImpl.getInstance().getAccounts(); // The user might not have any GAIA accounts (e.g. guest mode or Active // Directory). In these cases the profile row is hidden, so there's nothing @@ -323,10 +313,8 @@ /** * Handler for when the sync state is pushed from the browser. - * @param {?SyncStatus} syncStatus - * @private */ - handleSyncStatus_(syncStatus) { + private handleSyncStatus_(syncStatus: SyncStatus|null) { // Sign-in impressions should be recorded only if the sign-in promo is // shown. They should be recorder only once, the first time // |this.syncStatus| is set. @@ -342,22 +330,17 @@ } // <if expr="not chromeos"> - /** - * @return {boolean} - * @private - */ - computeShouldShowGoogleAccount_() { + private computeShouldShowGoogleAccount_(): boolean { if (this.storedAccounts === undefined || this.syncStatus === undefined) { return false; } - return (this.storedAccounts.length > 0 || !!this.syncStatus.signedIn) && - !this.syncStatus.hasError; + return (this.storedAccounts!.length > 0 || !!this.syncStatus!.signedIn) && + !this.syncStatus!.hasError; } // </if> - /** @private */ - onProfileTap_() { + private onProfileTap_() { // <if expr="chromeos"> if (loadTimeData.getBoolean('isAccountManagerEnabled')) { // Post-SplitSettings. The browser C++ code loads OS settings in a window. @@ -370,8 +353,7 @@ // </if> } - /** @private */ - onDisconnectDialogClosed_(e) { + private onDisconnectDialogClosed_() { this.showSignoutDialog_ = false; if (Router.getInstance().getCurrentRoute() === routes.SIGN_OUT) { @@ -379,20 +361,17 @@ } } - /** @private */ - onSyncTap_() { + private onSyncTap_() { // Users can go to sync subpage regardless of sync status. Router.getInstance().navigateTo(routes.SYNC); } // <if expr="not chromeos"> - /** @private */ - onImportDataTap_() { + private onImportDataTap_() { Router.getInstance().navigateTo(routes.IMPORT_DATA); } - /** @private */ - onImportDataDialogClosed_() { + private onImportDataDialogClosed_() { Router.getInstance().navigateToPreviousRoute(); focusWithoutInk(assert(this.$.importDataDialogTrigger)); } @@ -400,19 +379,14 @@ /** * Open URL for managing your Google Account. - * @private */ - openGoogleAccount_() { + private openGoogleAccount_() { OpenWindowProxyImpl.getInstance().openURL( loadTimeData.getString('googleAccountUrl')); chrome.metricsPrivate.recordUserAction('ManageGoogleAccount_Clicked'); } - /** - * @return {boolean} - * @private - */ - shouldShowSyncAccountControl_() { + private shouldShowSyncAccountControl_(): boolean { if (this.syncStatus === undefined) { return false; } @@ -421,15 +395,13 @@ return false; } // </if> - return !!this.syncStatus.syncSystemEnabled && this.signinAllowed_; + return !!this.syncStatus!.syncSystemEnabled && this.signinAllowed_; } /** - * @param {string} iconUrl - * @return {string} A CSS image-set for multiple scale factors. - * @private + * @return A CSS image-set for multiple scale factors. */ - getIconImageSet_(iconUrl) { + private getIconImageSet_(iconUrl: string): string { return getImage(iconUrl); } }
diff --git a/chrome/browser/resources/settings/people_page/profile_info_browser_proxy.js b/chrome/browser/resources/settings/people_page/profile_info_browser_proxy.js index 1feeee7..7380dd10c 100644 --- a/chrome/browser/resources/settings/people_page/profile_info_browser_proxy.js +++ b/chrome/browser/resources/settings/people_page/profile_info_browser_proxy.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. // clang-format off -import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js'; +import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; // clang-format on /** @@ -43,7 +43,17 @@ getProfileStatsCount() { chrome.send('getProfileStatsCount'); } + + /** @return {!ProfileInfoBrowserProxy} */ + static getInstance() { + return instance || (instance = new ProfileInfoBrowserProxyImpl()); + } + + /** @param {!ProfileInfoBrowserProxy} obj */ + static setInstance(obj) { + instance = obj; + } } - addSingletonGetter(ProfileInfoBrowserProxyImpl); - + /** @type {?ProfileInfoBrowserProxy} */ + let instance = null;
diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc index 02ab5da..833d876c 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
@@ -162,17 +162,17 @@ } ~QuasiWebSocketHttpResponse() override {} - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) override { - const auto response_headers = base::StringPrintf( - "HTTP/1.1 101 WebSocket Protocol Handshake\r\n" - "Upgrade: WebSocket\r\n" - "Connection: Upgrade\r\n" - "Sec-WebSocket-Accept: %s\r\n" - "\r\n", - accept_hash_.c_str()); - send.Run(response_headers, base::DoNothing()); - // Never call done(). The connection should stay open. + void SendResponse( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) override { + base::StringPairs response_headers = { + {"Upgrade", "WebSocket"}, + {"Connection", "Upgrade"}, + {"Sec-WebSocket-Accept", accept_hash_}}; + + delegate->SendResponseHeaders(net::HTTP_SWITCHING_PROTOCOLS, + "WebSocket Protocol Handshake", + response_headers); + // Never call FinishResponse(). The connection should stay open. } private:
diff --git a/chrome/browser/signin/dice_browsertest.cc b/chrome/browser/signin/dice_browsertest.cc index f6471ba..8c75244 100644 --- a/chrome/browser/signin/dice_browsertest.cc +++ b/chrome/browser/signin/dice_browsertest.cc
@@ -124,11 +124,12 @@ base::OnceCallback<void(base::OnceClosure)> callback) : callback_(std::move(callback)) {} - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) override { + void SendResponse( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) override { // Called on the IO thread to unblock the response. base::OnceClosure unblock_io_thread = - base::BindOnce(send, ToResponseString(), std::move(done)); + base::BindOnce(&BlockedHttpResponse::SendResponseInternal, + weak_factory_.GetWeakPtr(), delegate); // Unblock the response from any thread by posting a task to the IO thread. base::OnceClosure unblock_any_thread = base::BindOnce(base::IgnoreResult(&base::TaskRunner::PostTask), @@ -141,7 +142,14 @@ } private: + void SendResponseInternal( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) { + if (delegate) + BasicHttpResponse::SendResponse(delegate); + } base::OnceCallback<void(base::OnceClosure)> callback_; + + base::WeakPtrFactory<BlockedHttpResponse> weak_factory_{this}; }; } // namespace
diff --git a/chrome/browser/supervised_user/supervised_user_service_browsertest.cc b/chrome/browser/supervised_user/supervised_user_service_browsertest.cc index 846b2d9..47d39af 100644 --- a/chrome/browser/supervised_user/supervised_user_service_browsertest.cc +++ b/chrome/browser/supervised_user/supervised_user_service_browsertest.cc
@@ -128,7 +128,9 @@ EXPECT_EQ(original_name, base::UTF16ToUTF8(entry->GetName())); } -IN_PROC_BROWSER_TEST_F(SupervisedUserServiceTestSupervised, DenylistLoaded) { +// Disabled due to excessive flakiness (crbug/1251785). +IN_PROC_BROWSER_TEST_F(SupervisedUserServiceTestSupervised, + DISABLED_DenylistLoaded) { base::HistogramTester histogram_tester; histogram_tester.ExpectTotalCount( SupervisedUserService::GetDenylistSourceHistogramForTesting(), 0); @@ -161,8 +163,9 @@ SupervisedUserService::DenylistSource::kDenylist, 1); } +// Disabled due to excessive flakiness (crbug/1251785). IN_PROC_BROWSER_TEST_F(SupervisedUserServiceTestSupervised, - ExistingDenylistLoaded) { + DISABLED_ExistingDenylistLoaded) { base::HistogramTester histogram_tester; histogram_tester.ExpectTotalCount( SupervisedUserService::GetDenylistSourceHistogramForTesting(), 0); @@ -183,7 +186,9 @@ SupervisedUserService::DenylistSource::kDenylist, 1); } -IN_PROC_BROWSER_TEST_F(SupervisedUserServiceTestSupervised, OldDenylistLoaded) { +// Disabled due to excessive flakiness (crbug/1251785). +IN_PROC_BROWSER_TEST_F(SupervisedUserServiceTestSupervised, + DISABLED_OldDenylistLoaded) { base::HistogramTester histogram_tester; histogram_tester.ExpectTotalCount( SupervisedUserService::GetDenylistSourceHistogramForTesting(), 0); @@ -219,7 +224,9 @@ SupervisedUserService::DenylistSource::kOldDenylist, 1); } -IN_PROC_BROWSER_TEST_F(SupervisedUserServiceTestSupervised, NoDenylistLoaded) { +// Disabled due to excessive flakiness (crbug/1251785). +IN_PROC_BROWSER_TEST_F(SupervisedUserServiceTestSupervised, + DISABLED_NoDenylistLoaded) { base::HistogramTester histogram_tester; histogram_tester.ExpectTotalCount( SupervisedUserService::GetDenylistSourceHistogramForTesting(), 0);
diff --git a/chrome/browser/ui/android/autofill/autofill_logger_android.h b/chrome/browser/ui/android/autofill/autofill_logger_android.h index 486a476..11a2fcd 100644 --- a/chrome/browser/ui/android/autofill/autofill_logger_android.h +++ b/chrome/browser/ui/android/autofill/autofill_logger_android.h
@@ -17,13 +17,13 @@ // by the embedder to inject its logging mechanisms. class AutofillLoggerAndroid { public: + AutofillLoggerAndroid(const AutofillLoggerAndroid&) = delete; + AutofillLoggerAndroid& operator=(const AutofillLoggerAndroid&) = delete; + // Called when a field containing |autofilled_value| has been filled // with data from |profile_full_name|. static void DidFillOrPreviewField(const std::u16string& autofilled_value, const std::u16string& profile_full_name); - - private: - DISALLOW_COPY_AND_ASSIGN(AutofillLoggerAndroid); }; } // namespace autofill
diff --git a/chrome/browser/ui/android/autofill/card_expiration_date_fix_flow_view_android.h b/chrome/browser/ui/android/autofill/card_expiration_date_fix_flow_view_android.h index 0fe895f2..6d7bcdfa 100644 --- a/chrome/browser/ui/android/autofill/card_expiration_date_fix_flow_view_android.h +++ b/chrome/browser/ui/android/autofill/card_expiration_date_fix_flow_view_android.h
@@ -27,6 +27,11 @@ CardExpirationDateFixFlowController* controller, content::WebContents* web_contents); + CardExpirationDateFixFlowViewAndroid( + const CardExpirationDateFixFlowViewAndroid&) = delete; + CardExpirationDateFixFlowViewAndroid& operator=( + const CardExpirationDateFixFlowViewAndroid&) = delete; + void OnUserAccept(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, const base::android::JavaParamRef<jstring>& month, @@ -49,8 +54,6 @@ CardExpirationDateFixFlowController* controller_; content::WebContents* web_contents_; - - DISALLOW_COPY_AND_ASSIGN(CardExpirationDateFixFlowViewAndroid); }; } // namespace autofill
diff --git a/chrome/browser/ui/android/autofill/card_name_fix_flow_view_android.h b/chrome/browser/ui/android/autofill/card_name_fix_flow_view_android.h index c5f3411..b851d36f 100644 --- a/chrome/browser/ui/android/autofill/card_name_fix_flow_view_android.h +++ b/chrome/browser/ui/android/autofill/card_name_fix_flow_view_android.h
@@ -26,6 +26,10 @@ CardNameFixFlowViewAndroid(CardNameFixFlowController* controller, content::WebContents* web_contents); + CardNameFixFlowViewAndroid(const CardNameFixFlowViewAndroid&) = delete; + CardNameFixFlowViewAndroid& operator=(const CardNameFixFlowViewAndroid&) = + delete; + void OnUserAccept(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, const base::android::JavaParamRef<jstring>& name); @@ -51,8 +55,6 @@ CardNameFixFlowController* controller_; content::WebContents* web_contents_; - - DISALLOW_COPY_AND_ASSIGN(CardNameFixFlowViewAndroid); }; } // namespace autofill
diff --git a/chrome/browser/ui/android/autofill/card_unmask_prompt_view_android.h b/chrome/browser/ui/android/autofill/card_unmask_prompt_view_android.h index 6f24fc91..bf9ad80 100644 --- a/chrome/browser/ui/android/autofill/card_unmask_prompt_view_android.h +++ b/chrome/browser/ui/android/autofill/card_unmask_prompt_view_android.h
@@ -27,6 +27,10 @@ explicit CardUnmaskPromptViewAndroid(CardUnmaskPromptController* controller, content::WebContents* web_contents); + CardUnmaskPromptViewAndroid(const CardUnmaskPromptViewAndroid&) = delete; + CardUnmaskPromptViewAndroid& operator=(const CardUnmaskPromptViewAndroid&) = + delete; + bool CheckUserInputValidity( JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, @@ -66,8 +70,6 @@ CardUnmaskPromptController* controller_; content::WebContents* web_contents_; - - DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViewAndroid); }; } // namespace autofill
diff --git a/chrome/browser/ui/android/autofill/save_card_message_controller_android.cc b/chrome/browser/ui/android/autofill/save_card_message_controller_android.cc index 8421ca0..c87104b 100644 --- a/chrome/browser/ui/android/autofill/save_card_message_controller_android.cc +++ b/chrome/browser/ui/android/autofill/save_card_message_controller_android.cc
@@ -76,7 +76,10 @@ : IDS_AUTOFILL_SAVE_CARD_PROMPT_TITLE_LOCAL)); card_label_ = card.CardIdentifierStringForAutofillDisplay(); - message_->SetDescription(card_label_); + std::u16string expiry_date = + card.AbbreviatedExpirationDateForDisplay(/*with_prefix=*/false); + message_->SetDescription( + expiry_date.empty() ? card_label_ : card_label_ + u" " + expiry_date); bool use_gpay_icon = IsGooglePayBrandingEnabled() && messages::UseGPayIconForSaveCardMessage();
diff --git a/chrome/browser/ui/android/infobars/infobar_container_android.h b/chrome/browser/ui/android/infobars/infobar_container_android.h index cf94c7a..257c6d7e 100644 --- a/chrome/browser/ui/android/infobars/infobar_container_android.h +++ b/chrome/browser/ui/android/infobars/infobar_container_android.h
@@ -17,6 +17,10 @@ public: InfoBarContainerAndroid(JNIEnv* env, jobject infobar_container); + + InfoBarContainerAndroid(const InfoBarContainerAndroid&) = delete; + InfoBarContainerAndroid& operator=(const InfoBarContainerAndroid&) = delete; + void SetWebContents(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, const base::android::JavaParamRef<jobject>& web_contents); @@ -39,8 +43,6 @@ // We're owned by the java infobar, need to use a weak ref so it can destroy // us. JavaObjectWeakGlobalRef weak_java_infobar_container_; - - DISALLOW_COPY_AND_ASSIGN(InfoBarContainerAndroid); }; #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_CONTAINER_ANDROID_H_
diff --git a/chrome/browser/ui/android/night_mode/OWNERS b/chrome/browser/ui/android/night_mode/OWNERS index 0fa757c..e6f3bb4 100644 --- a/chrome/browser/ui/android/night_mode/OWNERS +++ b/chrome/browser/ui/android/night_mode/OWNERS
@@ -1 +1,2 @@ twellington@chromium.org +wenyufu@chromium.org
diff --git a/chrome/browser/ui/android/omnibox/omnibox_url_emphasizer.h b/chrome/browser/ui/android/omnibox/omnibox_url_emphasizer.h index a76a0ca..b947f212 100644 --- a/chrome/browser/ui/android/omnibox/omnibox_url_emphasizer.h +++ b/chrome/browser/ui/android/omnibox/omnibox_url_emphasizer.h
@@ -11,8 +11,10 @@ // Helper functions for the Omnibox URL emphasizer on Android. class OmniboxUrlEmphasizer { - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxUrlEmphasizer); + public: + OmniboxUrlEmphasizer() = delete; + OmniboxUrlEmphasizer(const OmniboxUrlEmphasizer&) = delete; + OmniboxUrlEmphasizer& operator=(const OmniboxUrlEmphasizer&) = delete; }; #endif // CHROME_BROWSER_UI_ANDROID_OMNIBOX_OMNIBOX_URL_EMPHASIZER_H_
diff --git a/chrome/browser/ui/android/omnibox/omnibox_view_util.h b/chrome/browser/ui/android/omnibox/omnibox_view_util.h index 98895b94..4283ce85 100644 --- a/chrome/browser/ui/android/omnibox/omnibox_view_util.h +++ b/chrome/browser/ui/android/omnibox/omnibox_view_util.h
@@ -11,8 +11,10 @@ // Helper functions for the Omnibox view on Android. class OmniboxViewUtil { - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxViewUtil); + public: + OmniboxViewUtil() = delete; + OmniboxViewUtil(const OmniboxViewUtil&) = delete; + OmniboxViewUtil& operator=(const OmniboxViewUtil&) = delete; }; #endif // CHROME_BROWSER_UI_ANDROID_OMNIBOX_OMNIBOX_VIEW_UTIL_H_
diff --git a/chrome/browser/ui/android/passwords/password_generation_editing_popup_view_android.h b/chrome/browser/ui/android/passwords/password_generation_editing_popup_view_android.h index 0aac196..6ba3a52 100644 --- a/chrome/browser/ui/android/passwords/password_generation_editing_popup_view_android.h +++ b/chrome/browser/ui/android/passwords/password_generation_editing_popup_view_android.h
@@ -26,6 +26,11 @@ explicit PasswordGenerationEditingPopupViewAndroid( PasswordGenerationPopupController* controller); + PasswordGenerationEditingPopupViewAndroid( + const PasswordGenerationEditingPopupViewAndroid&) = delete; + PasswordGenerationEditingPopupViewAndroid& operator=( + const PasswordGenerationEditingPopupViewAndroid&) = delete; + // Called from JNI when the popup was dismissed. void Dismissed(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); @@ -48,8 +53,6 @@ // Popup view to be anchored to the container. ui::ViewAndroid::ScopedAnchorView popup_; - - DISALLOW_COPY_AND_ASSIGN(PasswordGenerationEditingPopupViewAndroid); }; #endif // CHROME_BROWSER_UI_ANDROID_PASSWORDS_PASSWORD_GENERATION_EDITING_POPUP_VIEW_ANDROID_H_
diff --git a/chrome/browser/ui/android/quickactionsearchwidget/java/res/xml/quick_action_search_widget_medium_info.xml b/chrome/browser/ui/android/quickactionsearchwidget/java/res/xml/quick_action_search_widget_medium_info.xml index f152b9e..b61d531 100644 --- a/chrome/browser/ui/android/quickactionsearchwidget/java/res/xml/quick_action_search_widget_medium_info.xml +++ b/chrome/browser/ui/android/quickactionsearchwidget/java/res/xml/quick_action_search_widget_medium_info.xml
@@ -6,7 +6,8 @@ <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:initialLayout="@layout/quick_action_search_widget_medium_layout" android:minWidth="@dimen/quick_action_search_widget_width" + android:minResizeHeight="@dimen/quick_action_search_widget_small_height" android:minHeight="@dimen/quick_action_search_widget_medium_height" android:previewImage="@drawable/quick_action_search_widget_medium_preview" - android:resizeMode="horizontal" + android:resizeMode="vertical|horizontal" android:widgetCategory="home_screen|searchbox" />
diff --git a/chrome/browser/ui/android/quickactionsearchwidget/java/res/xml/quick_action_search_widget_small_info.xml b/chrome/browser/ui/android/quickactionsearchwidget/java/res/xml/quick_action_search_widget_small_info.xml index 1005f7e..fd82041 100644 --- a/chrome/browser/ui/android/quickactionsearchwidget/java/res/xml/quick_action_search_widget_small_info.xml +++ b/chrome/browser/ui/android/quickactionsearchwidget/java/res/xml/quick_action_search_widget_small_info.xml
@@ -7,6 +7,6 @@ android:initialLayout="@layout/quick_action_search_widget_small_layout" android:minWidth="@dimen/quick_action_search_widget_width" android:minHeight="@dimen/quick_action_search_widget_small_height" - android:resizeMode="horizontal" + android:resizeMode="vertical|horizontal" android:previewImage="@drawable/quick_action_search_widget_small_preview" android:widgetCategory="home_screen|searchbox" />
diff --git a/chrome/browser/ui/android/tab_model/tab_model.h b/chrome/browser/ui/android/tab_model/tab_model.h index baf7b29..cce7ed8 100644 --- a/chrome/browser/ui/android/tab_model/tab_model.h +++ b/chrome/browser/ui/android/tab_model/tab_model.h
@@ -120,6 +120,9 @@ SIZE }; + TabModel(const TabModel&) = delete; + TabModel& operator=(const TabModel&) = delete; + virtual Profile* GetProfile() const; virtual bool IsOffTheRecord() const; virtual sync_sessions::SyncedWindowDelegate* GetSyncedWindowDelegate() const; @@ -190,8 +193,6 @@ // unique within the current session, and is not guaranteed to be unique // across sessions. SessionID session_id_; - - DISALLOW_COPY_AND_ASSIGN(TabModel); }; #endif // CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_
diff --git a/chrome/browser/ui/android/toolbar/location_bar_model_android.h b/chrome/browser/ui/android/toolbar/location_bar_model_android.h index 8d8ea23..0badeba 100644 --- a/chrome/browser/ui/android/toolbar/location_bar_model_android.h +++ b/chrome/browser/ui/android/toolbar/location_bar_model_android.h
@@ -20,8 +20,14 @@ // Owns a LocationBarModel and provides a way for Java to interact with it. class LocationBarModelAndroid : public ChromeLocationBarModelDelegate { public: + LocationBarModelAndroid() = delete; + LocationBarModelAndroid(JNIEnv* env, const base::android::JavaRef<jobject>& obj); + + LocationBarModelAndroid(const LocationBarModelAndroid&) = delete; + LocationBarModelAndroid& operator=(const LocationBarModelAndroid&) = delete; + ~LocationBarModelAndroid() override; void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); @@ -42,8 +48,6 @@ private: std::unique_ptr<LocationBarModel> location_bar_model_; base::android::ScopedJavaGlobalRef<jobject> java_object_; - - DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarModelAndroid); }; #endif // CHROME_BROWSER_UI_ANDROID_TOOLBAR_LOCATION_BAR_MODEL_ANDROID_H_
diff --git a/chrome/browser/ui/app_list/app_sync_ui_state_factory.h b/chrome/browser/ui/app_list/app_sync_ui_state_factory.h index e4b5759..870457f 100644 --- a/chrome/browser/ui/app_list/app_sync_ui_state_factory.h +++ b/chrome/browser/ui/app_list/app_sync_ui_state_factory.h
@@ -16,6 +16,9 @@ // Singleton that owns all AppSyncUIStates and associates them with profiles. class AppSyncUIStateFactory : public BrowserContextKeyedServiceFactory { public: + AppSyncUIStateFactory(const AppSyncUIStateFactory&) = delete; + AppSyncUIStateFactory& operator=(const AppSyncUIStateFactory&) = delete; + static AppSyncUIState* GetForProfile(Profile* profile); static AppSyncUIStateFactory* GetInstance(); @@ -29,8 +32,6 @@ // BrowserContextKeyedServiceFactory overrides: KeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(AppSyncUIStateFactory); }; #endif // CHROME_BROWSER_UI_APP_LIST_APP_SYNC_UI_STATE_FACTORY_H_
diff --git a/chrome/browser/ui/app_list/arc/arc_app_icon.h b/chrome/browser/ui/app_list/arc/arc_app_icon.h index 5927d98..633e1f4 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_icon.h +++ b/chrome/browser/ui/app_list/arc/arc_app_icon.h
@@ -65,6 +65,10 @@ int resource_size_in_dip, Observer* observer, IconType icon_type = IconType::kUncompressed); + + ArcAppIcon(const ArcAppIcon&) = delete; + ArcAppIcon& operator=(const ArcAppIcon&) = delete; + virtual ~ArcAppIcon(); // Starts loading the icon at every supported scale factor. The |observer_| @@ -273,8 +277,6 @@ std::vector<std::unique_ptr<DecodeRequest>> decode_requests_; base::WeakPtrFactory<ArcAppIcon> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ArcAppIcon); }; #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_H_
diff --git a/chrome/browser/ui/app_list/arc/arc_package_syncable_service_factory.h b/chrome/browser/ui/app_list/arc/arc_package_syncable_service_factory.h index 05e1a025..5bf08ed3 100644 --- a/chrome/browser/ui/app_list/arc/arc_package_syncable_service_factory.h +++ b/chrome/browser/ui/app_list/arc/arc_package_syncable_service_factory.h
@@ -16,6 +16,11 @@ class ArcPackageSyncableServiceFactory : public BrowserContextKeyedServiceFactory { public: + ArcPackageSyncableServiceFactory(const ArcPackageSyncableServiceFactory&) = + delete; + ArcPackageSyncableServiceFactory& operator=( + const ArcPackageSyncableServiceFactory&) = delete; + static ArcPackageSyncableService* GetForBrowserContext( content::BrowserContext* context); @@ -31,8 +36,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(ArcPackageSyncableServiceFactory); }; } // namespace arc
diff --git a/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager.h b/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager.h index 1e136d9..4b83fec 100644 --- a/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager.h +++ b/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager.h
@@ -98,7 +98,12 @@ absl::optional<RequestPermissionCallback> callback_; }; + ArcUsbHostPermissionManager(const ArcUsbHostPermissionManager&) = delete; + ArcUsbHostPermissionManager& operator=(const ArcUsbHostPermissionManager&) = + delete; + ~ArcUsbHostPermissionManager() override; + static ArcUsbHostPermissionManager* GetForBrowserContext( content::BrowserContext* context); @@ -211,8 +216,6 @@ ArcAppListPrefs* const arc_app_list_prefs_; base::WeakPtrFactory<ArcUsbHostPermissionManager> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ArcUsbHostPermissionManager); }; } // namespace arc
diff --git a/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager_factory.h b/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager_factory.h index 1f314a5..a51034ba 100644 --- a/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager_factory.h +++ b/chrome/browser/ui/app_list/arc/arc_usb_host_permission_manager_factory.h
@@ -16,6 +16,11 @@ class ArcUsbHostPermissionManagerFactory : public BrowserContextKeyedServiceFactory { public: + ArcUsbHostPermissionManagerFactory( + const ArcUsbHostPermissionManagerFactory&) = delete; + ArcUsbHostPermissionManagerFactory& operator=( + const ArcUsbHostPermissionManagerFactory&) = delete; + static ArcUsbHostPermissionManager* GetForBrowserContext( content::BrowserContext* context); @@ -32,8 +37,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(ArcUsbHostPermissionManagerFactory); }; } // namespace arc
diff --git a/chrome/browser/ui/app_list/arc/arc_vpn_provider_manager.h b/chrome/browser/ui/app_list/arc/arc_vpn_provider_manager.h index f9abaa4..db456ae3e 100644 --- a/chrome/browser/ui/app_list/arc/arc_vpn_provider_manager.h +++ b/chrome/browser/ui/app_list/arc/arc_vpn_provider_manager.h
@@ -53,6 +53,9 @@ static ArcVpnProviderManager* Create(content::BrowserContext* context); + ArcVpnProviderManager(const ArcVpnProviderManager&) = delete; + ArcVpnProviderManager& operator=(const ArcVpnProviderManager&) = delete; + ~ArcVpnProviderManager() override; // ArcAppListPrefs Observer: @@ -79,8 +82,6 @@ // List of observers. base::ObserverList<Observer> observer_list_; - - DISALLOW_COPY_AND_ASSIGN(ArcVpnProviderManager); }; } // namespace app_list
diff --git a/chrome/browser/ui/app_list/arc/arc_vpn_provider_manager_factory.h b/chrome/browser/ui/app_list/arc/arc_vpn_provider_manager_factory.h index fce69d0..254b0cc 100644 --- a/chrome/browser/ui/app_list/arc/arc_vpn_provider_manager_factory.h +++ b/chrome/browser/ui/app_list/arc/arc_vpn_provider_manager_factory.h
@@ -15,6 +15,10 @@ class ArcVpnProviderManagerFactory : public BrowserContextKeyedServiceFactory { public: + ArcVpnProviderManagerFactory(const ArcVpnProviderManagerFactory&) = delete; + ArcVpnProviderManagerFactory& operator=(const ArcVpnProviderManagerFactory&) = + delete; + static ArcVpnProviderManager* GetForBrowserContext( content::BrowserContext* context); @@ -30,8 +34,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(ArcVpnProviderManagerFactory); }; } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/arc/arc_app_reinstall_app_result.h b/chrome/browser/ui/app_list/search/arc/arc_app_reinstall_app_result.h index 31b97115..fa3c6f6 100644 --- a/chrome/browser/ui/app_list/search/arc/arc_app_reinstall_app_result.h +++ b/chrome/browser/ui/app_list/search/arc/arc_app_reinstall_app_result.h
@@ -34,6 +34,10 @@ const arc::mojom::AppReinstallCandidatePtr& mojom_data, const gfx::ImageSkia& skia_icon, ArcAppReinstallAppResult::Observer* observer); + + ArcAppReinstallAppResult(const ArcAppReinstallAppResult&) = delete; + ArcAppReinstallAppResult& operator=(const ArcAppReinstallAppResult&) = delete; + ~ArcAppReinstallAppResult() override; // ChromeSearchResult: @@ -44,7 +48,6 @@ // Observer passed in constructor. not owned. Observer* const observer_; const std::string package_name_; - DISALLOW_COPY_AND_ASSIGN(ArcAppReinstallAppResult); }; } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/arc/arc_app_shortcuts_search_provider_unittest.cc b/chrome/browser/ui/app_list/search/arc/arc_app_shortcuts_search_provider_unittest.cc index 8e363de..e83370b 100644 --- a/chrome/browser/ui/app_list/search/arc/arc_app_shortcuts_search_provider_unittest.cc +++ b/chrome/browser/ui/app_list/search/arc/arc_app_shortcuts_search_provider_unittest.cc
@@ -35,6 +35,12 @@ class ArcAppShortcutsSearchProviderTest : public AppListTestBase, public ::testing::WithParamInterface<bool> { + public: + ArcAppShortcutsSearchProviderTest(const ArcAppShortcutsSearchProviderTest&) = + delete; + ArcAppShortcutsSearchProviderTest& operator=( + const ArcAppShortcutsSearchProviderTest&) = delete; + protected: ArcAppShortcutsSearchProviderTest() = default; ~ArcAppShortcutsSearchProviderTest() override = default; @@ -82,9 +88,6 @@ base::test::ScopedFeatureList scoped_feature_list_; std::unique_ptr<::test::TestAppListControllerDelegate> controller_; ArcAppTest arc_test_; - - private: - DISALLOW_COPY_AND_ASSIGN(ArcAppShortcutsSearchProviderTest); }; TEST_P(ArcAppShortcutsSearchProviderTest, Basic) {
diff --git a/chrome/browser/ui/ash/assistant/assistant_context_browsertest.cc b/chrome/browser/ui/ash/assistant/assistant_context_browsertest.cc index 68db2a3b..89f42f7 100644 --- a/chrome/browser/ui/ash/assistant/assistant_context_browsertest.cc +++ b/chrome/browser/ui/ash/assistant/assistant_context_browsertest.cc
@@ -31,6 +31,9 @@ public: AssistantStructureWaiter() = default; + AssistantStructureWaiter(const AssistantStructureWaiter&) = delete; + AssistantStructureWaiter& operator=(const AssistantStructureWaiter&) = delete; + void Wait() { loop_.Run(); } std::unique_ptr<ui::AssistantTree> take_structure() { @@ -46,8 +49,6 @@ private: std::unique_ptr<ui::AssistantTree> structure_; base::RunLoop loop_; - - DISALLOW_COPY_AND_ASSIGN(AssistantStructureWaiter); }; } // namespace
diff --git a/chrome/browser/ui/ash/ime_controller_client_impl_unittest.cc b/chrome/browser/ui/ash/ime_controller_client_impl_unittest.cc index 0eecd729..d6cadae 100644 --- a/chrome/browser/ui/ash/ime_controller_client_impl_unittest.cc +++ b/chrome/browser/ui/ash/ime_controller_client_impl_unittest.cc
@@ -58,6 +58,9 @@ input_methods_ = {ime1, ime2}; } + TestState(const TestState&) = delete; + TestState& operator=(const TestState&) = delete; + // MockInputMethodManager::State: void ChangeInputMethod(const std::string& input_method_id, bool show_message) override { @@ -100,11 +103,13 @@ protected: friend base::RefCounted<InputMethodManager::State>; ~TestState() override {} - - DISALLOW_COPY_AND_ASSIGN(TestState); }; TestInputMethodManager() : state_(new TestState), util_(&delegate_) {} + + TestInputMethodManager(const TestInputMethodManager&) = delete; + TestInputMethodManager& operator=(const TestInputMethodManager&) = delete; + ~TestInputMethodManager() override = default; // MockInputMethodManager: @@ -141,9 +146,6 @@ ash::input_method::ImeKeyset keyboard_keyset_; FakeInputMethodDelegate delegate_; InputMethodUtil util_; - - private: - DISALLOW_COPY_AND_ASSIGN(TestInputMethodManager); }; class ImeControllerClientImplTest : public testing::Test {
diff --git a/chrome/browser/ui/ash/keyboard/keyboard_end_to_end_browsertest.cc b/chrome/browser/ui/ash/keyboard/keyboard_end_to_end_browsertest.cc index 9b36925..207f1574 100644 --- a/chrome/browser/ui/ash/keyboard/keyboard_end_to_end_browsertest.cc +++ b/chrome/browser/ui/ash/keyboard/keyboard_end_to_end_browsertest.cc
@@ -75,6 +75,9 @@ class KeyboardEndToEndTest : public InProcessBrowserTest { public: + KeyboardEndToEndTest(const KeyboardEndToEndTest&) = delete; + KeyboardEndToEndTest& operator=(const KeyboardEndToEndTest&) = delete; + // Ensure that the virtual keyboard is enabled. void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(keyboard::switches::kEnableVirtualKeyboard); @@ -144,8 +147,6 @@ private: base::FilePath test_file_; - - DISALLOW_COPY_AND_ASSIGN(KeyboardEndToEndTest); }; class KeyboardEndToEndFormTest : public KeyboardEndToEndTest {
diff --git a/chrome/browser/ui/ash/multi_user/multi_profile_support_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_profile_support_unittest.cc index 8a0dfc4..142755f4 100644 --- a/chrome/browser/ui/ash/multi_user/multi_profile_support_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_profile_support_unittest.cc
@@ -92,13 +92,14 @@ public: TestShellDelegateChromeOS() {} + TestShellDelegateChromeOS(const TestShellDelegateChromeOS&) = delete; + TestShellDelegateChromeOS& operator=(const TestShellDelegateChromeOS&) = + delete; + bool CanShowWindowForUser(const aura::Window* window) const override { return ::CanShowWindowForUser(window, base::BindRepeating(&GetActiveContext)); } - - private: - DISALLOW_COPY_AND_ASSIGN(TestShellDelegateChromeOS); }; std::unique_ptr<Browser> CreateTestBrowser(aura::Window* window, @@ -124,6 +125,9 @@ : fake_user_manager_(new FakeChromeUserManager), user_manager_enabler_(base::WrapUnique(fake_user_manager_)) {} + MultiProfileSupportTest(const MultiProfileSupportTest&) = delete; + MultiProfileSupportTest& operator=(const MultiProfileSupportTest&) = delete; + // ChromeAshTestBase: void SetUp() override; void TearDown() override; @@ -284,8 +288,6 @@ // The maximized window manager (if enabled). std::unique_ptr<TabletModeWindowManager> tablet_mode_window_manager_; - - DISALLOW_COPY_AND_ASSIGN(MultiProfileSupportTest); }; void MultiProfileSupportTest::SetUp() {
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos_unittest.cc index d922156..33bfec9c 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos_unittest.cc
@@ -31,6 +31,11 @@ : fake_user_manager_(new FakeChromeUserManager), user_manager_enabler_(base::WrapUnique(fake_user_manager_)) {} + MultiUserContextMenuChromeOSTest(const MultiUserContextMenuChromeOSTest&) = + delete; + MultiUserContextMenuChromeOSTest& operator=( + const MultiUserContextMenuChromeOSTest&) = delete; + void SetUp() override; void TearDown() override; @@ -59,8 +64,6 @@ // Owned by |user_manager_enabler_|. FakeChromeUserManager* fake_user_manager_ = nullptr; user_manager::ScopedUserManager user_manager_enabler_; - - DISALLOW_COPY_AND_ASSIGN(MultiUserContextMenuChromeOSTest); }; void MultiUserContextMenuChromeOSTest::SetUp() {
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_helper.h b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_helper.h index 3f7a0b0..bbe0629 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_helper.h +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_helper.h
@@ -32,6 +32,10 @@ // which internally owns the real ash::MultiUserWindowManager implementation. class MultiUserWindowManagerHelper { public: + MultiUserWindowManagerHelper(const MultiUserWindowManagerHelper&) = delete; + MultiUserWindowManagerHelper& operator=(const MultiUserWindowManagerHelper&) = + delete; + // Creates an instance of the MultiUserWindowManagerHelper. static MultiUserWindowManagerHelper* CreateInstance(); @@ -94,8 +98,6 @@ // The MultiUserWindowManager implementation to use. If null, the // MultiUserWindowManager comes from |multi_profile_support_|. std::unique_ptr<ash::MultiUserWindowManager> multi_user_window_manager_; - - DISALLOW_COPY_AND_ASSIGN(MultiUserWindowManagerHelper); }; #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_HELPER_H_
diff --git a/chrome/browser/ui/ash/network/network_portal_notification_controller.cc b/chrome/browser/ui/ash/network/network_portal_notification_controller.cc index 3df25af..17c017872 100644 --- a/chrome/browser/ui/ash/network/network_portal_notification_controller.cc +++ b/chrome/browser/ui/ash/network/network_portal_notification_controller.cc
@@ -61,6 +61,11 @@ base::WeakPtr<NetworkPortalNotificationController> controller) : guid_(guid), clicked_(false), controller_(controller) {} + NetworkPortalNotificationControllerDelegate( + const NetworkPortalNotificationControllerDelegate&) = delete; + NetworkPortalNotificationControllerDelegate& operator=( + const NetworkPortalNotificationControllerDelegate&) = delete; + // Overridden from message_center::NotificationDelegate: void Click(const absl::optional<int>& button_index, const absl::optional<std::u16string>& reply) override; @@ -74,8 +79,6 @@ bool clicked_; base::WeakPtr<NetworkPortalNotificationController> controller_; - - DISALLOW_COPY_AND_ASSIGN(NetworkPortalNotificationControllerDelegate); }; void NetworkPortalNotificationControllerDelegate::Click(
diff --git a/chrome/browser/ui/ash/network/tether_notification_presenter.cc b/chrome/browser/ui/ash/network/tether_notification_presenter.cc index c59dc68..0f26818 100644 --- a/chrome/browser/ui/ash/network/tether_notification_presenter.cc +++ b/chrome/browser/ui/ash/network/tether_notification_presenter.cc
@@ -52,6 +52,10 @@ base::RepeatingClosure close) : HandleNotificationClickDelegate(click), close_callback_(close) {} + TetherNotificationDelegate(const TetherNotificationDelegate&) = delete; + TetherNotificationDelegate& operator=(const TetherNotificationDelegate&) = + delete; + // NotificationDelegate: void Close(bool by_user) override { if (!close_callback_.is_null()) @@ -62,8 +66,6 @@ ~TetherNotificationDelegate() override = default; base::RepeatingClosure close_callback_; - - DISALLOW_COPY_AND_ASSIGN(TetherNotificationDelegate); }; class SettingsUiDelegateImpl
diff --git a/chrome/browser/ui/ash/network/tether_notification_presenter_unittest.cc b/chrome/browser/ui/ash/network/tether_notification_presenter_unittest.cc index f9b40e2..1d0a53c 100644 --- a/chrome/browser/ui/ash/network/tether_notification_presenter_unittest.cc +++ b/chrome/browser/ui/ash/network/tether_notification_presenter_unittest.cc
@@ -83,6 +83,11 @@ std::string last_settings_subpage_; }; + TetherNotificationPresenterTest(const TetherNotificationPresenterTest&) = + delete; + TetherNotificationPresenterTest& operator=( + const TetherNotificationPresenterTest&) = delete; + protected: TetherNotificationPresenterTest() : test_device_(multidevice::CreateRemoteDeviceRefListForTest(1)[0]) {} @@ -194,9 +199,6 @@ TestSettingsUiDelegate* test_settings_ui_delegate_; std::unique_ptr<TetherNotificationPresenter> notification_presenter_; std::unique_ptr<NotificationDisplayServiceTester> display_service_; - - private: - DISALLOW_COPY_AND_ASSIGN(TetherNotificationPresenterTest); }; TEST_F(TetherNotificationPresenterTest,
diff --git a/chrome/browser/ui/ash/session_controller_client_impl_unittest.cc b/chrome/browser/ui/ash/session_controller_client_impl_unittest.cc index bf542f1..ca98665 100644 --- a/chrome/browser/ui/ash/session_controller_client_impl_unittest.cc +++ b/chrome/browser/ui/ash/session_controller_client_impl_unittest.cc
@@ -99,6 +99,12 @@ } // namespace class SessionControllerClientImplTest : public testing::Test { + public: + SessionControllerClientImplTest(const SessionControllerClientImplTest&) = + delete; + SessionControllerClientImplTest& operator=( + const SessionControllerClientImplTest&) = delete; + protected: SessionControllerClientImplTest() : browser_manager_(std::make_unique<crosapi::FakeBrowserManager>()) {} @@ -208,8 +214,6 @@ std::unique_ptr<chromeos::ScopedCrosSettingsTestHelper> cros_settings_test_helper_; - - DISALLOW_COPY_AND_ASSIGN(SessionControllerClientImplTest); }; // Make sure that cycling one user does not cause any harm.
diff --git a/chrome/browser/ui/ash/shelf/shelf_app_updater.h b/chrome/browser/ui/ash/shelf/shelf_app_updater.h index a077f53..da1b574 100644 --- a/chrome/browser/ui/ash/shelf/shelf_app_updater.h +++ b/chrome/browser/ui/ash/shelf/shelf_app_updater.h
@@ -34,6 +34,9 @@ virtual ~Delegate() {} }; + ShelfAppUpdater(const ShelfAppUpdater&) = delete; + ShelfAppUpdater& operator=(const ShelfAppUpdater&) = delete; + virtual ~ShelfAppUpdater(); Delegate* delegate() { return delegate_; } @@ -47,8 +50,6 @@ // Unowned pointers Delegate* delegate_; content::BrowserContext* browser_context_; - - DISALLOW_COPY_AND_ASSIGN(ShelfAppUpdater); }; #endif // CHROME_BROWSER_UI_ASH_SHELF_SHELF_APP_UPDATER_H_
diff --git a/chrome/browser/ui/ash/shelf/shelf_context_menu_unittest.cc b/chrome/browser/ui/ash/shelf/shelf_context_menu_unittest.cc index 3f6ca74..67417b0 100644 --- a/chrome/browser/ui/ash/shelf/shelf_context_menu_unittest.cc +++ b/chrome/browser/ui/ash/shelf/shelf_context_menu_unittest.cc
@@ -94,6 +94,10 @@ } class ShelfContextMenuTest : public ChromeAshTestBase { + public: + ShelfContextMenuTest(const ShelfContextMenuTest&) = delete; + ShelfContextMenuTest& operator=(const ShelfContextMenuTest&) = delete; + protected: ShelfContextMenuTest() = default; ~ShelfContextMenuTest() override = default; @@ -247,8 +251,6 @@ std::unique_ptr<ChromeShelfItemFactory> shelf_item_factory_; std::unique_ptr<ChromeShelfController> shelf_controller_; extensions::ExtensionService* extension_service_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(ShelfContextMenuTest); }; // Verifies that "New Incognito window" menu item in the launcher context
diff --git a/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc b/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc index 0e2535f..1d54d2c 100644 --- a/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc +++ b/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc
@@ -38,6 +38,12 @@ } class SystemTrayTrayCastMediaRouterChromeOSTest : public InProcessBrowserTest { + public: + SystemTrayTrayCastMediaRouterChromeOSTest( + const SystemTrayTrayCastMediaRouterChromeOSTest&) = delete; + SystemTrayTrayCastMediaRouterChromeOSTest& operator=( + const SystemTrayTrayCastMediaRouterChromeOSTest&) = delete; + protected: SystemTrayTrayCastMediaRouterChromeOSTest() : InProcessBrowserTest() {} ~SystemTrayTrayCastMediaRouterChromeOSTest() override {} @@ -118,8 +124,6 @@ media_router::MediaSinksObserver* media_sinks_observer_ = nullptr; media_router::MediaRoutesObserver* media_routes_observer_ = nullptr; std::unique_ptr<ash::SystemTrayTestApi> tray_test_api_; - - DISALLOW_COPY_AND_ASSIGN(SystemTrayTrayCastMediaRouterChromeOSTest); }; } // namespace
diff --git a/chrome/browser/ui/ash/tab_scrubber.h b/chrome/browser/ui/ash/tab_scrubber.h index 9dac4a52..b7cd6c6 100644 --- a/chrome/browser/ui/ash/tab_scrubber.h +++ b/chrome/browser/ui/ash/tab_scrubber.h
@@ -31,6 +31,9 @@ public: enum Direction { LEFT, RIGHT }; + TabScrubber(const TabScrubber&) = delete; + TabScrubber& operator=(const TabScrubber&) = delete; + // Returns a the single instance of a TabScrubber. static TabScrubber* GetInstance(); @@ -110,8 +113,6 @@ // when clashing interactions can occur, like window cycle list scrolling // gesture. bool enabled_ = true; - - DISALLOW_COPY_AND_ASSIGN(TabScrubber); }; #endif // CHROME_BROWSER_UI_ASH_TAB_SCRUBBER_H_
diff --git a/chrome/browser/ui/ash/tab_scrubber_browsertest.cc b/chrome/browser/ui/ash/tab_scrubber_browsertest.cc index 14c5cfa..7c2bdfc 100644 --- a/chrome/browser/ui/ash/tab_scrubber_browsertest.cc +++ b/chrome/browser/ui/ash/tab_scrubber_browsertest.cc
@@ -88,6 +88,9 @@ public: TabScrubberTest() = default; + TabScrubberTest(const TabScrubberTest&) = delete; + TabScrubberTest& operator=(const TabScrubberTest&) = delete; + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(chromeos::switches::kNaturalScrollDefault); } @@ -315,8 +318,6 @@ aura::Window* root = window->GetRootWindow(); return std::make_unique<ui::test::EventGenerator>(root, window); } - - DISALLOW_COPY_AND_ASSIGN(TabScrubberTest); }; // Swipe a single tab in each direction.
diff --git a/chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc b/chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc index 1d89f13..4974a071 100644 --- a/chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc +++ b/chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc
@@ -16,6 +16,11 @@ public: AskGoogleForSuggestionsDialogTest() {} + AskGoogleForSuggestionsDialogTest(const AskGoogleForSuggestionsDialogTest&) = + delete; + AskGoogleForSuggestionsDialogTest& operator=( + const AskGoogleForSuggestionsDialogTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { std::unique_ptr<SpellingBubbleModel> model = @@ -28,9 +33,6 @@ chrome::ShowConfirmBubble(browser()->window()->GetNativeWindow(), nullptr, gfx::Point(), std::move(model)); } - - private: - DISALLOW_COPY_AND_ASSIGN(AskGoogleForSuggestionsDialogTest); }; // Test that calls ShowUi("default").
diff --git a/chrome/browser/ui/aura/accessibility/automation_manager_aura.h b/chrome/browser/ui/aura/accessibility/automation_manager_aura.h index a212353..99e6273 100644 --- a/chrome/browser/ui/aura/accessibility/automation_manager_aura.h +++ b/chrome/browser/ui/aura/accessibility/automation_manager_aura.h
@@ -41,6 +41,9 @@ public views::AXEventObserver, public extensions::AutomationEventRouterObserver { public: + AutomationManagerAura(const AutomationManagerAura&) = delete; + AutomationManagerAura& operator=(const AutomationManagerAura&) = delete; + // Get the single instance of this class. static AutomationManagerAura* GetInstance(); @@ -153,8 +156,6 @@ automation_event_router_observer_{this}; bool send_window_state_on_enable_ = true; - - DISALLOW_COPY_AND_ASSIGN(AutomationManagerAura); }; #endif // CHROME_BROWSER_UI_AURA_ACCESSIBILITY_AUTOMATION_MANAGER_AURA_H_
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.h b/chrome/browser/ui/autofill/autofill_popup_controller_impl.h index 81f93b5..7782cc44 100644 --- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.h +++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.h
@@ -47,6 +47,10 @@ // other, public functions are available to its instantiator. class AutofillPopupControllerImpl : public AutofillPopupController { public: + AutofillPopupControllerImpl(const AutofillPopupControllerImpl&) = delete; + AutofillPopupControllerImpl& operator=(const AutofillPopupControllerImpl&) = + delete; + // Creates a new |AutofillPopupControllerImpl|, or reuses |previous| if the // construction arguments are the same. |previous| may be invalidated by this // call. The controller will listen for keyboard input routed to @@ -197,8 +201,6 @@ absl::optional<int> selected_line_; base::WeakPtrFactory<AutofillPopupControllerImpl> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(AutofillPopupControllerImpl); }; } // namespace autofill
diff --git a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc index a09b8d1..ce78447 100644 --- a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc +++ b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
@@ -94,6 +94,9 @@ explicit CloseObserver(WebContents* contents) : content::WebContentsObserver(contents) {} + CloseObserver(const CloseObserver&) = delete; + CloseObserver& operator=(const CloseObserver&) = delete; + void Wait() { close_loop_.Run(); } // content::WebContentsObserver: @@ -101,8 +104,6 @@ private: base::RunLoop close_loop_; - - DISALLOW_COPY_AND_ASSIGN(CloseObserver); }; class PopupBlockerBrowserTest : public InProcessBrowserTest {
diff --git a/chrome/browser/ui/bookmarks/bookmark_bar.h b/chrome/browser/ui/bookmarks/bookmark_bar.h index b056175..4c4a3d3 100644 --- a/chrome/browser/ui/bookmarks/bookmark_bar.h +++ b/chrome/browser/ui/bookmarks/bookmark_bar.h
@@ -29,8 +29,9 @@ DONT_ANIMATE_STATE_CHANGE }; - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(BookmarkBar); + BookmarkBar() = delete; + BookmarkBar(const BookmarkBar&) = delete; + BookmarkBar& operator=(const BookmarkBar&) = delete; }; #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_BAR_H_
diff --git a/chrome/browser/ui/bookmarks/bookmark_browsertest.cc b/chrome/browser/ui/bookmarks/bookmark_browsertest.cc index 93310ab5..4eefd6e 100644 --- a/chrome/browser/ui/bookmarks/bookmark_browsertest.cc +++ b/chrome/browser/ui/bookmarks/bookmark_browsertest.cc
@@ -92,6 +92,9 @@ #endif } + BookmarkBrowsertest(const BookmarkBrowsertest&) = delete; + BookmarkBrowsertest& operator=(const BookmarkBrowsertest&) = delete; + bool IsVisible() { return browser()->bookmark_bar_state() == BookmarkBar::SHOW; } @@ -130,8 +133,6 @@ // We make the histogram tester a member field to make sure it starts // recording as early as possible. base::HistogramTester histogram_tester_; - - DISALLOW_COPY_AND_ASSIGN(BookmarkBrowsertest); }; // Test of bookmark bar toggling, visibility, and animation.
diff --git a/chrome/browser/ui/bookmarks/bookmark_tab_helper.h b/chrome/browser/ui/bookmarks/bookmark_tab_helper.h index 0b57296..88a3104 100644 --- a/chrome/browser/ui/bookmarks/bookmark_tab_helper.h +++ b/chrome/browser/ui/bookmarks/bookmark_tab_helper.h
@@ -39,6 +39,9 @@ virtual ~BookmarkDrag() {} }; + BookmarkTabHelper(const BookmarkTabHelper&) = delete; + BookmarkTabHelper& operator=(const BookmarkTabHelper&) = delete; + ~BookmarkTabHelper() override; // It is up to callers to call set_bookmark_drag_delegate(NULL) when @@ -102,8 +105,6 @@ BookmarkDrag* bookmark_drag_; WEB_CONTENTS_USER_DATA_KEY_DECL(); - - DISALLOW_COPY_AND_ASSIGN(BookmarkTabHelper); }; #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_TAB_HELPER_H_
diff --git a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model_unittest.cc b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model_unittest.cc index f7a4147..6d7c6dd 100644 --- a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model_unittest.cc +++ b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model_unittest.cc
@@ -50,10 +50,13 @@ public: RecentlyUsedFoldersComboModelTest() = default; + RecentlyUsedFoldersComboModelTest(const RecentlyUsedFoldersComboModelTest&) = + delete; + RecentlyUsedFoldersComboModelTest& operator=( + const RecentlyUsedFoldersComboModelTest&) = delete; + private: content::BrowserTaskEnvironment task_environment_; - - DISALLOW_COPY_AND_ASSIGN(RecentlyUsedFoldersComboModelTest); }; // Verifies there are no duplicate nodes in the model.
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index 599a8223..69911da 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h
@@ -333,6 +333,9 @@ // Returns whether a browser window can be created for the specified profile. static CreationStatus GetCreationStatusForProfile(Profile* profile); + Browser(const Browser&) = delete; + Browser& operator=(const Browser&) = delete; + ~Browser() override; // Set overrides for the initial window bounds and maximized state. @@ -1250,8 +1253,6 @@ // The following factory is used to close the frame at a later time. base::WeakPtrFactory<Browser> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(Browser); }; #endif // CHROME_BROWSER_UI_BROWSER_H_
diff --git a/chrome/browser/ui/browser_finder_chromeos_unittest.cc b/chrome/browser/ui/browser_finder_chromeos_unittest.cc index 56b2417..5724c0b6 100644 --- a/chrome/browser/ui/browser_finder_chromeos_unittest.cc +++ b/chrome/browser/ui/browser_finder_chromeos_unittest.cc
@@ -34,6 +34,10 @@ : fake_user_manager_(new ash::FakeChromeUserManager), user_manager_enabler_(base::WrapUnique(fake_user_manager_)) {} + BrowserFinderChromeOSTest(const BrowserFinderChromeOSTest&) = delete; + BrowserFinderChromeOSTest& operator=(const BrowserFinderChromeOSTest&) = + delete; + TestingProfile* CreateMultiUserProfile(const AccountId& account_id) { TestingProfile* profile = profile_manager()->CreateTestingProfile(account_id.GetUserEmail()); @@ -79,8 +83,6 @@ // |fake_user_manager_| is owned by |user_manager_enabler_| ash::FakeChromeUserManager* fake_user_manager_; user_manager::ScopedUserManager user_manager_enabler_; - - DISALLOW_COPY_AND_ASSIGN(BrowserFinderChromeOSTest); }; TEST_F(BrowserFinderChromeOSTest, IncognitoBrowserMatchTest) {
diff --git a/chrome/browser/ui/browser_list.h b/chrome/browser/ui/browser_list.h index 53d7e1e..dc5d5ae 100644 --- a/chrome/browser/ui/browser_list.h +++ b/chrome/browser/ui/browser_list.h
@@ -38,6 +38,9 @@ using const_iterator = BrowserVector::const_iterator; using const_reverse_iterator = BrowserVector::const_reverse_iterator; + BrowserList(const BrowserList&) = delete; + BrowserList& operator=(const BrowserList&) = delete; + // Returns the last active browser for this list. Browser* GetLastActive() const; @@ -197,8 +200,6 @@ base::ObserverList<BrowserListObserver>::Unchecked>::Leaky observers_; static BrowserList* instance_; - - DISALLOW_COPY_AND_ASSIGN(BrowserList); }; #endif // CHROME_BROWSER_UI_BROWSER_LIST_H_
diff --git a/chrome/browser/ui/browser_navigator_params.h b/chrome/browser/ui/browser_navigator_params.h index e4465750..f0c8f26 100644 --- a/chrome/browser/ui/browser_navigator_params.h +++ b/chrome/browser/ui/browser_navigator_params.h
@@ -79,7 +79,12 @@ NavigateParams(Profile* profile, const GURL& a_url, ui::PageTransition a_transition); + + NavigateParams(const NavigateParams&) = delete; + NavigateParams& operator=(const NavigateParams&) = delete; + NavigateParams(NavigateParams&& params); + ~NavigateParams(); // Copies fields from |params| struct to |nav_params| struct. @@ -319,7 +324,6 @@ private: NavigateParams(); - DISALLOW_COPY_AND_ASSIGN(NavigateParams); }; #endif // CHROME_BROWSER_UI_BROWSER_NAVIGATOR_PARAMS_H_
diff --git a/chrome/browser/ui/certificate_dialogs.cc b/chrome/browser/ui/certificate_dialogs.cc index 89786e6..5be06e4c 100644 --- a/chrome/browser/ui/certificate_dialogs.cc +++ b/chrome/browser/ui/certificate_dialogs.cc
@@ -76,6 +76,9 @@ gfx::NativeWindow parent, net::ScopedCERTCertificateList cert_chain); + Exporter(const Exporter&) = delete; + Exporter& operator=(const Exporter&) = delete; + // SelectFileDialog::Listener implemenation. void FileSelected(const base::FilePath& path, int index, @@ -89,8 +92,6 @@ // The certificate hierarchy (leaf cert first). net::ScopedCERTCertificateList cert_chain_list_; - - DISALLOW_COPY_AND_ASSIGN(Exporter); }; Exporter::Exporter(content::WebContents* web_contents,
diff --git a/chrome/browser/ui/cocoa/accelerators_cocoa.h b/chrome/browser/ui/cocoa/accelerators_cocoa.h index e770ee1..f6ce34bf 100644 --- a/chrome/browser/ui/cocoa/accelerators_cocoa.h +++ b/chrome/browser/ui/cocoa/accelerators_cocoa.h
@@ -37,6 +37,9 @@ typedef std::vector<ui::Accelerator> AcceleratorVector; typedef AcceleratorMap::const_iterator const_iterator; + AcceleratorsCocoa(const AcceleratorsCocoa&) = delete; + AcceleratorsCocoa& operator=(const AcceleratorsCocoa&) = delete; + const_iterator const begin() { return accelerators_.begin(); } const_iterator const end() { return accelerators_.end(); } @@ -56,8 +59,6 @@ // Contains accelerators from both the app menu and the main menu. AcceleratorMap accelerators_; - - DISALLOW_COPY_AND_ASSIGN(AcceleratorsCocoa); }; #endif // CHROME_BROWSER_UI_COCOA_ACCELERATORS_COCOA_H_
diff --git a/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm index 33ce5a0..512fd713 100644 --- a/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm +++ b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm
@@ -42,6 +42,11 @@ hosted_app_(nullptr), initial_menu_item_count_(0) {} + AppShimMenuControllerBrowserTest(const AppShimMenuControllerBrowserTest&) = + delete; + AppShimMenuControllerBrowserTest& operator=( + const AppShimMenuControllerBrowserTest&) = delete; + // Start testing apps and wait for them to launch. |flags| is a bitmask of // AvailableApps. void SetUpApps(int flags) { @@ -126,9 +131,6 @@ const extensions::Extension* app_2_; const extensions::Extension* hosted_app_; NSUInteger initial_menu_item_count_; - - private: - DISALLOW_COPY_AND_ASSIGN(AppShimMenuControllerBrowserTest); }; // Test that focusing an app window changes the menu bar.
diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm index 6c11960..4e63127 100644 --- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm +++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
@@ -55,6 +55,11 @@ protected: NativeAppWindowCocoaBrowserTest() {} + NativeAppWindowCocoaBrowserTest(const NativeAppWindowCocoaBrowserTest&) = + delete; + NativeAppWindowCocoaBrowserTest& operator=( + const NativeAppWindowCocoaBrowserTest&) = delete; + void SetUpAppWithWindows(int num_windows) { app_ = InstallExtension( test_data_dir_.AppendASCII("platform_apps").AppendASCII("minimal"), 1); @@ -75,9 +80,6 @@ } const extensions::Extension* app_; - - private: - DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoaBrowserTest); }; } // namespace
diff --git a/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h b/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h index 0487333..7977571 100644 --- a/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h +++ b/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h
@@ -25,6 +25,9 @@ QuitWithAppsController(); + QuitWithAppsController(const QuitWithAppsController&) = delete; + QuitWithAppsController& operator=(const QuitWithAppsController&) = delete; + // NotificationDelegate interface. void Close(bool by_user) override; void Click(const absl::optional<int>& button_index, @@ -49,8 +52,6 @@ // Whether to suppress showing the notification for the rest of the session. bool suppress_for_session_ = false; - - DISALLOW_COPY_AND_ASSIGN(QuitWithAppsController); }; #endif // CHROME_BROWSER_UI_COCOA_APPS_QUIT_WITH_APPS_CONTROLLER_MAC_H_
diff --git a/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac_interactive_uitest.mm b/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac_interactive_uitest.mm index 8d00162..035467f4 100644 --- a/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac_interactive_uitest.mm +++ b/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac_interactive_uitest.mm
@@ -36,6 +36,12 @@ // will use NativeAppWindowCocoa. class QuitWithAppsControllerInteractiveTest : public extensions::PlatformAppBrowserTest { + public: + QuitWithAppsControllerInteractiveTest( + const QuitWithAppsControllerInteractiveTest&) = delete; + QuitWithAppsControllerInteractiveTest& operator=( + const QuitWithAppsControllerInteractiveTest&) = delete; + protected: QuitWithAppsControllerInteractiveTest() : app_(NULL) {} @@ -45,9 +51,6 @@ } const extensions::Extension* app_; - - private: - DISALLOW_COPY_AND_ASSIGN(QuitWithAppsControllerInteractiveTest); }; } // namespace
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm index 8536195e..fe2360b 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm
@@ -31,6 +31,9 @@ public: BookmarkMenuBridgeTest() {} + BookmarkMenuBridgeTest(const BookmarkMenuBridgeTest&) = delete; + BookmarkMenuBridgeTest& operator=(const BookmarkMenuBridgeTest&) = delete; + void SetUp() override { BrowserWithTestWindowTest::SetUp(); @@ -91,8 +94,6 @@ private: CocoaTestHelper cocoa_test_helper_; - - DISALLOW_COPY_AND_ASSIGN(BookmarkMenuBridgeTest); }; TEST_F(BookmarkMenuBridgeTest, TestBookmarkMenuAutoSeparator) {
diff --git a/chrome/browser/ui/cocoa/browser_window_mac_browsertest.mm b/chrome/browser/ui/cocoa/browser_window_mac_browsertest.mm index 022c069..9bd69244 100644 --- a/chrome/browser/ui/cocoa/browser_window_mac_browsertest.mm +++ b/chrome/browser/ui/cocoa/browser_window_mac_browsertest.mm
@@ -23,8 +23,8 @@ public: BrowserWindowMacTest() {} - private: - DISALLOW_COPY_AND_ASSIGN(BrowserWindowMacTest); + BrowserWindowMacTest(const BrowserWindowMacTest&) = delete; + BrowserWindowMacTest& operator=(const BrowserWindowMacTest&) = delete; }; // Test that mainMenu commands do not attempt to validate against a Browser*
diff --git a/chrome/browser/ui/cocoa/history_menu_bridge.h b/chrome/browser/ui/cocoa/history_menu_bridge.h index 9276d95..7bf91b1d 100644 --- a/chrome/browser/ui/cocoa/history_menu_bridge.h +++ b/chrome/browser/ui/cocoa/history_menu_bridge.h
@@ -124,6 +124,10 @@ }; explicit HistoryMenuBridge(Profile* profile); + + HistoryMenuBridge(const HistoryMenuBridge&) = delete; + HistoryMenuBridge& operator=(const HistoryMenuBridge&) = delete; + ~HistoryMenuBridge() override; // TabRestoreServiceObserver: @@ -280,8 +284,6 @@ base::ScopedObservation<sessions::TabRestoreService, sessions::TabRestoreServiceObserver> tab_restore_service_observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(HistoryMenuBridge); }; #endif // CHROME_BROWSER_UI_COCOA_HISTORY_MENU_BRIDGE_H_
diff --git a/chrome/browser/ui/cocoa/keystone_infobar_delegate.h b/chrome/browser/ui/cocoa/keystone_infobar_delegate.h index 572559c..f0c8ce7 100644 --- a/chrome/browser/ui/cocoa/keystone_infobar_delegate.h +++ b/chrome/browser/ui/cocoa/keystone_infobar_delegate.h
@@ -17,6 +17,11 @@ class KeystonePromotionInfoBarDelegate : public ConfirmInfoBarDelegate { public: + KeystonePromotionInfoBarDelegate(const KeystonePromotionInfoBarDelegate&) = + delete; + KeystonePromotionInfoBarDelegate& operator=( + const KeystonePromotionInfoBarDelegate&) = delete; + // Creates a keystone promotion delegate and adds it to the // infobars::ContentInfoBarManager associated with |webContents|. static void Create(content::WebContents* webContents); @@ -46,8 +51,6 @@ // Used to delay the expiration of the info bar. base::WeakPtrFactory<KeystonePromotionInfoBarDelegate> weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(KeystonePromotionInfoBarDelegate); }; class KeystoneInfoBar {
diff --git a/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa_browsertest.mm b/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa_browsertest.mm index e9ad4625..6623892 100644 --- a/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa_browsertest.mm +++ b/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac_cocoa_browsertest.mm
@@ -17,6 +17,11 @@ public: RenderViewContextMenuMacCocoaBrowserTest() {} + RenderViewContextMenuMacCocoaBrowserTest( + const RenderViewContextMenuMacCocoaBrowserTest&) = delete; + RenderViewContextMenuMacCocoaBrowserTest& operator=( + const RenderViewContextMenuMacCocoaBrowserTest&) = delete; + protected: void SetUpOnMainThread() override { filteredItems_.reset([[NSMutableArray alloc] init]); @@ -42,9 +47,6 @@ base::scoped_nsobject<NSMutableArray> filteredItems_; base::scoped_nsobject<NSTextField> textField_; - - private: - DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuMacCocoaBrowserTest); }; // Confirm that the private classes used to filter Safari's redundant Services
diff --git a/chrome/browser/ui/cocoa/status_icons/status_tray_mac.h b/chrome/browser/ui/cocoa/status_icons/status_tray_mac.h index 800d9c85..2c7223db 100644 --- a/chrome/browser/ui/cocoa/status_icons/status_tray_mac.h +++ b/chrome/browser/ui/cocoa/status_icons/status_tray_mac.h
@@ -13,15 +13,15 @@ public: StatusTrayMac(); + StatusTrayMac(const StatusTrayMac&) = delete; + StatusTrayMac& operator=(const StatusTrayMac&) = delete; + protected: // Factory method for creating a status icon. std::unique_ptr<StatusIcon> CreatePlatformStatusIcon( StatusIconType type, const gfx::ImageSkia& image, const std::u16string& tool_tip) override; - - private: - DISALLOW_COPY_AND_ASSIGN(StatusTrayMac); }; #endif // CHROME_BROWSER_UI_COCOA_STATUS_ICONS_STATUS_TRAY_MAC_H_
diff --git a/chrome/browser/ui/cocoa/task_manager_mac.h b/chrome/browser/ui/cocoa/task_manager_mac.h index f6d918a..347ce963 100644 --- a/chrome/browser/ui/cocoa/task_manager_mac.h +++ b/chrome/browser/ui/cocoa/task_manager_mac.h
@@ -89,6 +89,9 @@ public content::NotificationObserver, public TableViewDelegate { public: + TaskManagerMac(const TaskManagerMac&) = delete; + TaskManagerMac& operator=(const TaskManagerMac&) = delete; + // Called by the TaskManagerWindowController: void WindowWasClosed(); NSImage* GetImageForRow(int row); @@ -141,8 +144,6 @@ // An open task manager window. There can only be one open at a time. This // is reset to be null when the window is closed. static TaskManagerMac* instance_; - - DISALLOW_COPY_AND_ASSIGN(TaskManagerMac); }; } // namespace task_manager
diff --git a/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller_browsertest.mm b/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller_browsertest.mm index 1a51875..dbd220d 100644 --- a/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller_browsertest.mm +++ b/chrome/browser/ui/cocoa/touchbar/browser_window_touch_bar_controller_browsertest.mm
@@ -31,6 +31,11 @@ public: BrowserWindowTouchBarControllerTest() : InProcessBrowserTest() {} + BrowserWindowTouchBarControllerTest( + const BrowserWindowTouchBarControllerTest&) = delete; + BrowserWindowTouchBarControllerTest& operator=( + const BrowserWindowTouchBarControllerTest&) = delete; + API_AVAILABLE(macos(10.12.2)) NSTouchBar* MakeTouchBar() { auto* delegate = @@ -54,9 +59,6 @@ browser_view->frame()->native_browser_frame()); return browser_frame->GetTouchBarController(); } - - private: - DISALLOW_COPY_AND_ASSIGN(BrowserWindowTouchBarControllerTest); }; // Test if the touch bar gets invalidated when the active tab is changed.
diff --git a/chrome/browser/ui/collected_cookies_browsertest.cc b/chrome/browser/ui/collected_cookies_browsertest.cc index b4a4438..078f49f 100644 --- a/chrome/browser/ui/collected_cookies_browsertest.cc +++ b/chrome/browser/ui/collected_cookies_browsertest.cc
@@ -22,6 +22,9 @@ public: CollectedCookiesTest() {} + CollectedCookiesTest(const CollectedCookiesTest&) = delete; + CollectedCookiesTest& operator=(const CollectedCookiesTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { // Web modal dialogs' bounds may exceed the display's work area. @@ -42,9 +45,6 @@ browser()->tab_strip_model()->GetActiveWebContents(); TabDialogs::FromWebContents(web_contents)->ShowCollectedCookies(); } - - private: - DISALLOW_COPY_AND_ASSIGN(CollectedCookiesTest); }; // Test that calls ShowUi("default").
diff --git a/chrome/browser/ui/collected_cookies_infobar_delegate.h b/chrome/browser/ui/collected_cookies_infobar_delegate.h index 72fd9ee..21cc760e 100644 --- a/chrome/browser/ui/collected_cookies_infobar_delegate.h +++ b/chrome/browser/ui/collected_cookies_infobar_delegate.h
@@ -19,6 +19,11 @@ // the reload right from the infobar. class CollectedCookiesInfoBarDelegate : public ConfirmInfoBarDelegate { public: + CollectedCookiesInfoBarDelegate(const CollectedCookiesInfoBarDelegate&) = + delete; + CollectedCookiesInfoBarDelegate& operator=( + const CollectedCookiesInfoBarDelegate&) = delete; + // Creates a collected cookies infobar and delegate and adds the infobar to // |infobar_manager|. static void Create(infobars::ContentInfoBarManager* infobar_manager); @@ -34,8 +39,6 @@ int GetButtons() const override; std::u16string GetButtonLabel(InfoBarButton button) const override; bool Accept() override; - - DISALLOW_COPY_AND_ASSIGN(CollectedCookiesInfoBarDelegate); }; #endif // CHROME_BROWSER_UI_COLLECTED_COOKIES_INFOBAR_DELEGATE_H_
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.h b/chrome/browser/ui/content_settings/content_setting_bubble_model.h index e31c0717..67abc9f 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.h +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.h
@@ -147,6 +147,10 @@ struct BubbleContent { BubbleContent(); + + BubbleContent(const BubbleContent&) = delete; + BubbleContent& operator=(const BubbleContent&) = delete; + ~BubbleContent(); std::u16string title; @@ -162,9 +166,6 @@ bool show_learn_more = false; std::u16string done_button_text; std::u16string cancel_button_text; - - private: - DISALLOW_COPY_AND_ASSIGN(BubbleContent); }; static const int kAllowButtonIndex; @@ -178,6 +179,10 @@ content::WebContents* web_contents, ContentSettingsType content_type); + ContentSettingBubbleModel(const ContentSettingBubbleModel&) = delete; + ContentSettingBubbleModel& operator=(const ContentSettingBubbleModel&) = + delete; + virtual ~ContentSettingBubbleModel(); const BubbleContent& bubble_content() const { return bubble_content_; } @@ -279,8 +284,6 @@ Owner* owner_; Delegate* delegate_; BubbleContent bubble_content_; - - DISALLOW_COPY_AND_ASSIGN(ContentSettingBubbleModel); }; // A generic bubble used for a single content setting. @@ -290,6 +293,11 @@ content::WebContents* web_contents, ContentSettingsType content_type); + ContentSettingSimpleBubbleModel(const ContentSettingSimpleBubbleModel&) = + delete; + ContentSettingSimpleBubbleModel& operator=( + const ContentSettingSimpleBubbleModel&) = delete; + ContentSettingsType content_type() { return content_type_; } // ContentSettingBubbleModel implementation. @@ -307,8 +315,6 @@ void OnCustomLinkClicked() override; ContentSettingsType content_type_; - - DISALLOW_COPY_AND_ASSIGN(ContentSettingSimpleBubbleModel); }; // RPH stands for Register Protocol Handler.
diff --git a/chrome/browser/ui/content_settings/content_setting_image_model.cc b/chrome/browser/ui/content_settings/content_setting_image_model.cc index e449337..3f4704a 100644 --- a/chrome/browser/ui/content_settings/content_setting_image_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_image_model.cc
@@ -84,16 +84,23 @@ ContentSettingBlockedImageModel(ImageType image_type, ContentSettingsType content_type); - bool UpdateAndGetVisibility(WebContents* web_contents) override; + ContentSettingBlockedImageModel(const ContentSettingBlockedImageModel&) = + delete; + ContentSettingBlockedImageModel& operator=( + const ContentSettingBlockedImageModel&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(ContentSettingBlockedImageModel); + bool UpdateAndGetVisibility(WebContents* web_contents) override; }; class ContentSettingGeolocationImageModel : public ContentSettingImageModel { public: ContentSettingGeolocationImageModel(); + ContentSettingGeolocationImageModel( + const ContentSettingGeolocationImageModel&) = delete; + ContentSettingGeolocationImageModel& operator=( + const ContentSettingGeolocationImageModel&) = delete; + bool UpdateAndGetVisibility(WebContents* web_contents) override; bool IsGeolocationAccessed(); @@ -105,19 +112,17 @@ std::unique_ptr<ContentSettingBubbleModel> CreateBubbleModelImpl( ContentSettingBubbleModel::Delegate* delegate, WebContents* web_contents) override; - - private: - DISALLOW_COPY_AND_ASSIGN(ContentSettingGeolocationImageModel); }; class ContentSettingRPHImageModel : public ContentSettingSimpleImageModel { public: ContentSettingRPHImageModel(); - bool UpdateAndGetVisibility(WebContents* web_contents) override; + ContentSettingRPHImageModel(const ContentSettingRPHImageModel&) = delete; + ContentSettingRPHImageModel& operator=(const ContentSettingRPHImageModel&) = + delete; - private: - DISALLOW_COPY_AND_ASSIGN(ContentSettingRPHImageModel); + bool UpdateAndGetVisibility(WebContents* web_contents) override; }; class ContentSettingMIDISysExImageModel @@ -125,10 +130,12 @@ public: ContentSettingMIDISysExImageModel(); - bool UpdateAndGetVisibility(WebContents* web_contents) override; + ContentSettingMIDISysExImageModel(const ContentSettingMIDISysExImageModel&) = + delete; + ContentSettingMIDISysExImageModel& operator=( + const ContentSettingMIDISysExImageModel&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(ContentSettingMIDISysExImageModel); + bool UpdateAndGetVisibility(WebContents* web_contents) override; }; class ContentSettingDownloadsImageModel @@ -136,10 +143,12 @@ public: ContentSettingDownloadsImageModel(); - bool UpdateAndGetVisibility(WebContents* web_contents) override; + ContentSettingDownloadsImageModel(const ContentSettingDownloadsImageModel&) = + delete; + ContentSettingDownloadsImageModel& operator=( + const ContentSettingDownloadsImageModel&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(ContentSettingDownloadsImageModel); + bool UpdateAndGetVisibility(WebContents* web_contents) override; }; class ContentSettingClipboardReadWriteImageModel @@ -147,10 +156,12 @@ public: ContentSettingClipboardReadWriteImageModel(); - bool UpdateAndGetVisibility(WebContents* web_contents) override; + ContentSettingClipboardReadWriteImageModel( + const ContentSettingClipboardReadWriteImageModel&) = delete; + ContentSettingClipboardReadWriteImageModel& operator=( + const ContentSettingClipboardReadWriteImageModel&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(ContentSettingClipboardReadWriteImageModel); + bool UpdateAndGetVisibility(WebContents* web_contents) override; }; // Image model for displaying media icons in the location bar. @@ -158,6 +169,10 @@ public: ContentSettingMediaImageModel(); + ContentSettingMediaImageModel(const ContentSettingMediaImageModel&) = delete; + ContentSettingMediaImageModel& operator=( + const ContentSettingMediaImageModel&) = delete; + bool UpdateAndGetVisibility(WebContents* web_contents) override; bool IsMicAccessed(); bool IsCamAccessed(); @@ -176,18 +191,18 @@ private: PageSpecificContentSettings::MicrophoneCameraState state_; - - DISALLOW_COPY_AND_ASSIGN(ContentSettingMediaImageModel); }; class ContentSettingSensorsImageModel : public ContentSettingSimpleImageModel { public: ContentSettingSensorsImageModel(); - bool UpdateAndGetVisibility(WebContents* web_contents) override; + ContentSettingSensorsImageModel(const ContentSettingSensorsImageModel&) = + delete; + ContentSettingSensorsImageModel& operator=( + const ContentSettingSensorsImageModel&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(ContentSettingSensorsImageModel); + bool UpdateAndGetVisibility(WebContents* web_contents) override; }; // The image model for an icon that acts as a quiet permission request prompt @@ -200,25 +215,28 @@ public: ContentSettingNotificationsImageModel(); + ContentSettingNotificationsImageModel( + const ContentSettingNotificationsImageModel&) = delete; + ContentSettingNotificationsImageModel& operator=( + const ContentSettingNotificationsImageModel&) = delete; + // ContentSettingSimpleImageModel: bool UpdateAndGetVisibility(WebContents* web_contents) override; void SetPromoWasShown(content::WebContents* contents) override; std::unique_ptr<ContentSettingBubbleModel> CreateBubbleModelImpl( ContentSettingBubbleModel::Delegate* delegate, WebContents* web_contents) override; - - private: - DISALLOW_COPY_AND_ASSIGN(ContentSettingNotificationsImageModel); }; class ContentSettingPopupImageModel : public ContentSettingSimpleImageModel { public: ContentSettingPopupImageModel(); - bool UpdateAndGetVisibility(WebContents* web_contents) override; + ContentSettingPopupImageModel(const ContentSettingPopupImageModel&) = delete; + ContentSettingPopupImageModel& operator=( + const ContentSettingPopupImageModel&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(ContentSettingPopupImageModel); + bool UpdateAndGetVisibility(WebContents* web_contents) override; }; namespace {
diff --git a/chrome/browser/ui/content_settings/content_setting_image_model.h b/chrome/browser/ui/content_settings/content_setting_image_model.h index 0ed31dd..d591d0e 100644 --- a/chrome/browser/ui/content_settings/content_setting_image_model.h +++ b/chrome/browser/ui/content_settings/content_setting_image_model.h
@@ -168,6 +168,11 @@ ContentSettingsType content_type, bool image_type_should_notify_accessibility = false); + ContentSettingSimpleImageModel(const ContentSettingSimpleImageModel&) = + delete; + ContentSettingSimpleImageModel& operator=( + const ContentSettingSimpleImageModel&) = delete; + // ContentSettingImageModel implementation. std::unique_ptr<ContentSettingBubbleModel> CreateBubbleModelImpl( ContentSettingBubbleModel::Delegate* delegate, @@ -177,22 +182,22 @@ private: ContentSettingsType content_type_; - - DISALLOW_COPY_AND_ASSIGN(ContentSettingSimpleImageModel); }; class ContentSettingFramebustBlockImageModel : public ContentSettingImageModel { public: ContentSettingFramebustBlockImageModel(); + ContentSettingFramebustBlockImageModel( + const ContentSettingFramebustBlockImageModel&) = delete; + ContentSettingFramebustBlockImageModel& operator=( + const ContentSettingFramebustBlockImageModel&) = delete; + bool UpdateAndGetVisibility(content::WebContents* web_contents) override; std::unique_ptr<ContentSettingBubbleModel> CreateBubbleModelImpl( ContentSettingBubbleModel::Delegate* delegate, content::WebContents* web_contents) override; - - private: - DISALLOW_COPY_AND_ASSIGN(ContentSettingFramebustBlockImageModel); }; #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_IMAGE_MODEL_H_
diff --git a/chrome/browser/ui/crypto_module_delegate_nss.h b/chrome/browser/ui/crypto_module_delegate_nss.h index 077a15f..ff3089ff 100644 --- a/chrome/browser/ui/crypto_module_delegate_nss.h +++ b/chrome/browser/ui/crypto_module_delegate_nss.h
@@ -25,6 +25,10 @@ ChromeNSSCryptoModuleDelegate(CryptoModulePasswordReason reason, const net::HostPortPair& server); + ChromeNSSCryptoModuleDelegate(const ChromeNSSCryptoModuleDelegate&) = delete; + ChromeNSSCryptoModuleDelegate& operator=( + const ChromeNSSCryptoModuleDelegate&) = delete; + // crypto::CryptoModuleBlockingPasswordDelegate implementation. std::string RequestPassword(const std::string& slot_name, bool retry, @@ -49,8 +53,6 @@ // Stores the results from the dialog for access on worker thread. std::string password_; bool cancelled_; - - DISALLOW_COPY_AND_ASSIGN(ChromeNSSCryptoModuleDelegate); }; // Create a delegate which only handles unlocking slots.
diff --git a/chrome/browser/ui/exclusive_access/exclusive_access_test.h b/chrome/browser/ui/exclusive_access/exclusive_access_test.h index 85b8056..b06a6fb 100644 --- a/chrome/browser/ui/exclusive_access/exclusive_access_test.h +++ b/chrome/browser/ui/exclusive_access/exclusive_access_test.h
@@ -60,6 +60,10 @@ // Test fixture with convenience functions for fullscreen, keyboard lock, and // mouse lock. class ExclusiveAccessTest : public InProcessBrowserTest { + public: + ExclusiveAccessTest(const ExclusiveAccessTest&) = delete; + ExclusiveAccessTest& operator=(const ExclusiveAccessTest&) = delete; + protected: ExclusiveAccessTest(); ~ExclusiveAccessTest() override; @@ -122,8 +126,6 @@ base::test::ScopedFeatureList scoped_feature_list_; base::WeakPtrFactory<ExclusiveAccessTest> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessTest); }; #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_TEST_H_
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc index b3ac587..d4e53e8 100644 --- a/chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc +++ b/chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc
@@ -209,6 +209,11 @@ public: FullscreenControllerStateUnitTest(); + FullscreenControllerStateUnitTest(const FullscreenControllerStateUnitTest&) = + delete; + FullscreenControllerStateUnitTest& operator=( + const FullscreenControllerStateUnitTest&) = delete; + // FullscreenControllerStateTest: void SetUp() override; void TearDown() override; @@ -222,8 +227,6 @@ bool ShouldSkipStateAndEventPair(State state, Event event) override; Browser* GetBrowser() override; FullscreenControllerTestWindow* window_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FullscreenControllerStateUnitTest); }; FullscreenControllerStateUnitTest::FullscreenControllerStateUnitTest() = @@ -752,10 +755,10 @@ : WebContentsObserver(web_contents) { } - MOCK_METHOD2(DidToggleFullscreenModeForTab, void(bool, bool)); + FullscreenChangeObserver(const FullscreenChangeObserver&) = delete; + FullscreenChangeObserver& operator=(const FullscreenChangeObserver&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(FullscreenChangeObserver); + MOCK_METHOD2(DidToggleFullscreenModeForTab, void(bool, bool)); }; // Tests that going from tab fullscreen -> browser fullscreen causes an explicit
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_interactive_browsertest.cc b/chrome/browser/ui/exclusive_access/fullscreen_interactive_browsertest.cc index 5605958e..ea94616 100644 --- a/chrome/browser/ui/exclusive_access/fullscreen_interactive_browsertest.cc +++ b/chrome/browser/ui/exclusive_access/fullscreen_interactive_browsertest.cc
@@ -24,6 +24,10 @@ content::RenderFrameHost* wanted_rfh) : content::WebContentsObserver(web_contents), wanted_rfh_(wanted_rfh) {} + FullscreenWebContentsObserver(const FullscreenWebContentsObserver&) = delete; + FullscreenWebContentsObserver& operator=( + const FullscreenWebContentsObserver&) = delete; + // WebContentsObserver override. void DidAcquireFullscreen(content::RenderFrameHost* rfh) override { EXPECT_EQ(wanted_rfh_, rfh); @@ -44,8 +48,6 @@ base::RunLoop run_loop_; bool found_value_ = false; content::RenderFrameHost* wanted_rfh_; - - DISALLOW_COPY_AND_ASSIGN(FullscreenWebContentsObserver); }; } // namespace
diff --git a/chrome/browser/ui/extensions/extension_installed_notification.h b/chrome/browser/ui/extensions/extension_installed_notification.h index f73f5c8..2e3225ee 100644 --- a/chrome/browser/ui/extensions/extension_installed_notification.h +++ b/chrome/browser/ui/extensions/extension_installed_notification.h
@@ -19,6 +19,11 @@ ExtensionInstalledNotification(const extensions::Extension* extension, Profile* profile); + ExtensionInstalledNotification(const ExtensionInstalledNotification&) = + delete; + ExtensionInstalledNotification& operator=( + const ExtensionInstalledNotification&) = delete; + // NotificationDelegate override: void Click(const absl::optional<int>& button_index, const absl::optional<std::u16string>& reply) override; @@ -30,8 +35,6 @@ private: const std::string extension_id_; Profile* const profile_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionInstalledNotification); }; #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_INSTALLED_NOTIFICATION_H_
diff --git a/chrome/browser/ui/extensions/installation_error_infobar_delegate.h b/chrome/browser/ui/extensions/installation_error_infobar_delegate.h index 3a99adb..0c4845a 100644 --- a/chrome/browser/ui/extensions/installation_error_infobar_delegate.h +++ b/chrome/browser/ui/extensions/installation_error_infobar_delegate.h
@@ -16,6 +16,11 @@ // Helper class to put up an infobar when installation fails. class InstallationErrorInfoBarDelegate : public ConfirmInfoBarDelegate { public: + InstallationErrorInfoBarDelegate(const InstallationErrorInfoBarDelegate&) = + delete; + InstallationErrorInfoBarDelegate& operator=( + const InstallationErrorInfoBarDelegate&) = delete; + // Creates an error infobar and delegate and adds the infobar to // |infobar_manager|. static void Create(infobars::ContentInfoBarManager* infobar_manager, @@ -34,8 +39,6 @@ int GetButtons() const override; extensions::CrxInstallError error_; - - DISALLOW_COPY_AND_ASSIGN(InstallationErrorInfoBarDelegate); }; #endif // CHROME_BROWSER_UI_EXTENSIONS_INSTALLATION_ERROR_INFOBAR_DELEGATE_H_
diff --git a/chrome/browser/ui/find_bar/find_bar_state_factory.h b/chrome/browser/ui/find_bar/find_bar_state_factory.h index adda35b..cee390f 100644 --- a/chrome/browser/ui/find_bar/find_bar_state_factory.h +++ b/chrome/browser/ui/find_bar/find_bar_state_factory.h
@@ -13,6 +13,9 @@ class FindBarStateFactory : public BrowserContextKeyedServiceFactory { public: + FindBarStateFactory(const FindBarStateFactory&) = delete; + FindBarStateFactory& operator=(const FindBarStateFactory&) = delete; + static FindBarState* GetForBrowserContext(content::BrowserContext* context); static FindBarStateFactory* GetInstance(); @@ -28,8 +31,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(FindBarStateFactory); }; #endif // CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_STATE_FACTORY_H_
diff --git a/chrome/browser/ui/frame/window_frame_util.h b/chrome/browser/ui/frame/window_frame_util.h index 954e7394..e10a7a6 100644 --- a/chrome/browser/ui/frame/window_frame_util.h +++ b/chrome/browser/ui/frame/window_frame_util.h
@@ -20,6 +20,9 @@ static constexpr int kWindows10GlassCaptionButtonHeightRestored = 29; static constexpr int kWindows10GlassCaptionButtonVisualSpacing = 1; + WindowFrameUtil(const WindowFrameUtil&) = delete; + WindowFrameUtil& operator=(const WindowFrameUtil&) = delete; + // Returns the alpha that the Windows10CaptionButton should use to blend the // color provided by the theme in determining the button's 'base color'. static SkAlpha CalculateWindows10GlassCaptionButtonBackgroundAlpha( @@ -31,8 +34,6 @@ private: WindowFrameUtil() {} - - DISALLOW_COPY_AND_ASSIGN(WindowFrameUtil); }; #endif // CHROME_BROWSER_UI_FRAME_WINDOW_FRAME_UTIL_H_
diff --git a/chrome/browser/ui/global_error/global_error_browsertest.cc b/chrome/browser/ui/global_error/global_error_browsertest.cc index e8d27c3..40c97c96 100644 --- a/chrome/browser/ui/global_error/global_error_browsertest.cc +++ b/chrome/browser/ui/global_error/global_error_browsertest.cc
@@ -117,11 +117,11 @@ extensions::ExtensionPrefs::SetRunAlertsInFirstRunForTest(); } + GlobalErrorBubbleTest(const GlobalErrorBubbleTest&) = delete; + GlobalErrorBubbleTest& operator=(const GlobalErrorBubbleTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override; - - private: - DISALLOW_COPY_AND_ASSIGN(GlobalErrorBubbleTest); }; void GlobalErrorBubbleTest::ShowUi(const std::string& name) {
diff --git a/chrome/browser/ui/global_error/global_error_service_browsertest.cc b/chrome/browser/ui/global_error/global_error_service_browsertest.cc index 66b59f8..82649f486 100644 --- a/chrome/browser/ui/global_error/global_error_service_browsertest.cc +++ b/chrome/browser/ui/global_error/global_error_service_browsertest.cc
@@ -25,6 +25,9 @@ public: BubbleViewError() : bubble_view_close_count_(0) { } + BubbleViewError(const BubbleViewError&) = delete; + BubbleViewError& operator=(const BubbleViewError&) = delete; + int bubble_view_close_count() { return bubble_view_close_count_; } bool HasMenuItem() override { return false; } @@ -54,8 +57,6 @@ private: int bubble_view_close_count_; - - DISALLOW_COPY_AND_ASSIGN(BubbleViewError); }; } // namespace
diff --git a/chrome/browser/ui/global_error/global_error_service_factory.h b/chrome/browser/ui/global_error/global_error_service_factory.h index 377f76f..2dd9394 100644 --- a/chrome/browser/ui/global_error/global_error_service_factory.h +++ b/chrome/browser/ui/global_error/global_error_service_factory.h
@@ -18,6 +18,10 @@ // the associated GlobalErrorService. class GlobalErrorServiceFactory : public BrowserContextKeyedServiceFactory { public: + GlobalErrorServiceFactory(const GlobalErrorServiceFactory&) = delete; + GlobalErrorServiceFactory& operator=(const GlobalErrorServiceFactory&) = + delete; + static GlobalErrorService* GetForProfile(Profile* profile); static GlobalErrorServiceFactory* GetInstance(); @@ -33,8 +37,6 @@ content::BrowserContext* profile) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(GlobalErrorServiceFactory); }; #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_SERVICE_FACTORY_H_
diff --git a/chrome/browser/ui/global_error/global_error_service_unittest.cc b/chrome/browser/ui/global_error/global_error_service_unittest.cc index aa1d6c2..e093c3a4 100644 --- a/chrome/browser/ui/global_error/global_error_service_unittest.cc +++ b/chrome/browser/ui/global_error/global_error_service_unittest.cc
@@ -56,6 +56,9 @@ severity_(severity) { } + MenuError(const MenuError&) = delete; + MenuError& operator=(const MenuError&) = delete; + Severity GetSeverity() override { return severity_; } bool HasMenuItem() override { return true; } @@ -66,8 +69,6 @@ private: int command_id_; Severity severity_; - - DISALLOW_COPY_AND_ASSIGN(MenuError); }; } // namespace
diff --git a/chrome/browser/ui/hats/hats_service.h b/chrome/browser/ui/hats/hats_service.h index 3887615..31692ed 100644 --- a/chrome/browser/ui/hats/hats_service.h +++ b/chrome/browser/ui/hats/hats_service.h
@@ -194,10 +194,13 @@ kMaxValue = kNoRejectedByHatsService, }; - ~HatsService() override; - explicit HatsService(Profile* profile); + HatsService(const HatsService&) = delete; + HatsService& operator=(const HatsService&) = delete; + + ~HatsService() override; + static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); // Launches survey with identifier |trigger| if appropriate. @@ -320,8 +323,6 @@ bool hats_next_dialog_exists_ = false; base::WeakPtrFactory<HatsService> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(HatsService); }; #endif // CHROME_BROWSER_UI_HATS_HATS_SERVICE_H_
diff --git a/chrome/browser/ui/hats/hats_service_browsertest.cc b/chrome/browser/ui/hats/hats_service_browsertest.cc index 9e3a99bb..f3d238c7 100644 --- a/chrome/browser/ui/hats/hats_service_browsertest.cc +++ b/chrome/browser/ui/hats/hats_service_browsertest.cc
@@ -80,6 +80,10 @@ HatsServiceBrowserTestBase() = default; + HatsServiceBrowserTestBase(const HatsServiceBrowserTestBase&) = delete; + HatsServiceBrowserTestBase& operator=(const HatsServiceBrowserTestBase&) = + delete; + ~HatsServiceBrowserTestBase() override = default; HatsService* GetHatsService() { @@ -103,21 +107,27 @@ std::vector<base::test::ScopedFeatureList::FeatureAndParams> enabled_features_; - - DISALLOW_COPY_AND_ASSIGN(HatsServiceBrowserTestBase); }; class HatsServiceProbabilityZero : public HatsServiceBrowserTestBase { + public: + HatsServiceProbabilityZero(const HatsServiceProbabilityZero&) = delete; + HatsServiceProbabilityZero& operator=(const HatsServiceProbabilityZero&) = + delete; + protected: HatsServiceProbabilityZero() : HatsServiceBrowserTestBase({probability_zero}) {} ~HatsServiceProbabilityZero() override = default; - - DISALLOW_COPY_AND_ASSIGN(HatsServiceProbabilityZero); }; class HatsServiceProbabilityOne : public HatsServiceBrowserTestBase { + public: + HatsServiceProbabilityOne(const HatsServiceProbabilityOne&) = delete; + HatsServiceProbabilityOne& operator=(const HatsServiceProbabilityOne&) = + delete; + protected: HatsServiceProbabilityOne() : HatsServiceBrowserTestBase( @@ -136,8 +146,6 @@ void TearDownOnMainThread() override { GetHatsService()->SetSurveyMetadataForTesting({}); } - - DISALLOW_COPY_AND_ASSIGN(HatsServiceProbabilityOne); }; } // namespace
diff --git a/chrome/browser/ui/hats/hats_service_factory.h b/chrome/browser/ui/hats/hats_service_factory.h index ca5cedb9..91f98ef 100644 --- a/chrome/browser/ui/hats/hats_service_factory.h +++ b/chrome/browser/ui/hats/hats_service_factory.h
@@ -14,6 +14,9 @@ class HatsServiceFactory : public BrowserContextKeyedServiceFactory { public: + HatsServiceFactory(const HatsServiceFactory&) = delete; + HatsServiceFactory& operator=(const HatsServiceFactory&) = delete; + static HatsService* GetForProfile(Profile* profile, bool create_if_necessary); static HatsServiceFactory* GetInstance(); @@ -26,8 +29,6 @@ // BrowserContextKeyedServiceFactory: KeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(HatsServiceFactory); }; #endif // CHROME_BROWSER_UI_HATS_HATS_SERVICE_FACTORY_H_
diff --git a/chrome/browser/ui/login/login_handler.h b/chrome/browser/ui/login/login_handler.h index 0f37005..194ee32 100644 --- a/chrome/browser/ui/login/login_handler.h +++ b/chrome/browser/ui/login/login_handler.h
@@ -225,14 +225,16 @@ public: explicit LoginNotificationDetails(LoginHandler* handler) : handler_(handler) {} + + LoginNotificationDetails(const LoginNotificationDetails&) = delete; + LoginNotificationDetails& operator=(const LoginNotificationDetails&) = delete; + LoginHandler* handler() const { return handler_; } private: LoginNotificationDetails() = default; LoginHandler* handler_; // Where to send the response. - - DISALLOW_COPY_AND_ASSIGN(LoginNotificationDetails); }; // Details to provide the NotificationObserver. Used by the automation proxy @@ -246,6 +248,12 @@ : LoginNotificationDetails(handler), username_(username), password_(password) {} + + AuthSuppliedLoginNotificationDetails( + const AuthSuppliedLoginNotificationDetails&) = delete; + AuthSuppliedLoginNotificationDetails& operator=( + const AuthSuppliedLoginNotificationDetails&) = delete; + const std::u16string& username() const { return username_; } const std::u16string& password() const { return password_; } @@ -255,8 +263,6 @@ // The password that was used for the authentication. const std::u16string password_; - - DISALLOW_COPY_AND_ASSIGN(AuthSuppliedLoginNotificationDetails); }; #endif // CHROME_BROWSER_UI_LOGIN_LOGIN_HANDLER_H_
diff --git a/chrome/browser/ui/login/login_handler_browsertest.cc b/chrome/browser/ui/login/login_handler_browsertest.cc index 5c206f4..2114211 100644 --- a/chrome/browser/ui/login/login_handler_browsertest.cc +++ b/chrome/browser/ui/login/login_handler_browsertest.cc
@@ -74,22 +74,24 @@ SlowAuthResponse operator=(const SlowAuthResponse& other) = delete; // content::SlowHttpResponse: - void AddResponseHeaders(std::string* response) override { - response->append("WWW-Authenticate: Basic realm=\"test\"\r\n"); - response->append("Cache-Control: max-age=0\r\n"); + base::StringPairs ResponseHeaders() override { + base::StringPairs response; + response.emplace_back("WWW-Authenticate", "Basic realm=\"test\""); + response.emplace_back("Cache-Control", "max-age=0"); // Content-length and Content-type are both necessary to trigger the bug // that this class is used to test. Specifically, there must be a delay // between the OnAuthRequired notification from the net stack and when the // response body is ready, and the OnAuthRequired notification requires // headers to be complete (which requires a known content type and length). - response->append("Content-type: text/html"); - response->append( - base::StringPrintf("Content-Length: %d\r\n", - kFirstResponsePartSize + kSecondResponsePartSize)); + response.emplace_back("Content-type", "text/html"); + response.emplace_back( + "Content-Length", + base::NumberToString(kFirstResponsePartSize + kSecondResponsePartSize)); + return response; } - void SetStatusLine(std::string* response) override { - response->append("HTTP/1.1 401 Unauthorized\r\n"); + std::pair<net::HttpStatusCode, std::string> StatusLine() override { + return {net::HTTP_UNAUTHORIZED, "Unauthorized"}; } };
diff --git a/chrome/browser/ui/login/login_handler_test_utils.h b/chrome/browser/ui/login/login_handler_test_utils.h index 4a23ee9a..edc75de 100644 --- a/chrome/browser/ui/login/login_handler_test_utils.h +++ b/chrome/browser/ui/login/login_handler_test_utils.h
@@ -67,8 +67,9 @@ explicit WindowedNavigationObserver( content::NavigationController* controller); - private: - DISALLOW_COPY_AND_ASSIGN(WindowedNavigationObserver); + WindowedNavigationObserver(const WindowedNavigationObserver&) = delete; + WindowedNavigationObserver& operator=(const WindowedNavigationObserver&) = + delete; }; template <int T> @@ -95,6 +96,9 @@ WindowedLoadStopObserver(content::NavigationController* controller, int notification_count); + WindowedLoadStopObserver(const WindowedLoadStopObserver&) = delete; + WindowedLoadStopObserver& operator=(const WindowedLoadStopObserver&) = delete; + protected: void Observe(int type, const content::NotificationSource& source, @@ -102,8 +106,6 @@ private: int remaining_notification_count_; // Number of notifications remaining. - - DISALLOW_COPY_AND_ASSIGN(WindowedLoadStopObserver); }; #endif // CHROME_BROWSER_UI_LOGIN_LOGIN_HANDLER_TEST_UTILS_H_
diff --git a/chrome/browser/ui/media_router/media_router_file_dialog.h b/chrome/browser/ui/media_router/media_router_file_dialog.h index 020c3dc..14bee25 100644 --- a/chrome/browser/ui/media_router/media_router_file_dialog.h +++ b/chrome/browser/ui/media_router/media_router_file_dialog.h
@@ -100,6 +100,9 @@ base::WeakPtr<MediaRouterFileDialogDelegate> delegate, std::unique_ptr<FileSystemDelegate> file_system_delegate); + MediaRouterFileDialog(const MediaRouterFileDialog&) = delete; + MediaRouterFileDialog& operator=(const MediaRouterFileDialog&) = delete; + ~MediaRouterFileDialog() override; virtual GURL GetLastSelectedFileUrl(); @@ -155,8 +158,6 @@ // Object which the media router file dialog callbacks get sent to. base::WeakPtr<MediaRouterFileDialogDelegate> const delegate_; - - DISALLOW_COPY_AND_ASSIGN(MediaRouterFileDialog); }; } // namespace media_router
diff --git a/chrome/browser/ui/media_router/media_router_ui_service_factory.h b/chrome/browser/ui/media_router/media_router_ui_service_factory.h index 78a791e..ff6ea2c 100644 --- a/chrome/browser/ui/media_router/media_router_ui_service_factory.h +++ b/chrome/browser/ui/media_router/media_router_ui_service_factory.h
@@ -20,6 +20,10 @@ class MediaRouterUIServiceFactory : public BrowserContextKeyedServiceFactory { public: + MediaRouterUIServiceFactory(const MediaRouterUIServiceFactory&) = delete; + MediaRouterUIServiceFactory& operator=(const MediaRouterUIServiceFactory&) = + delete; + static MediaRouterUIService* GetForBrowserContext( content::BrowserContext* context); @@ -45,8 +49,6 @@ bool ServiceIsCreatedWithBrowserContext() const override; #endif bool ServiceIsNULLWhileTesting() const override; - - DISALLOW_COPY_AND_ASSIGN(MediaRouterUIServiceFactory); }; } // namespace media_router
diff --git a/chrome/browser/ui/media_router/presentation_receiver_window_controller_browsertest.cc b/chrome/browser/ui/media_router/presentation_receiver_window_controller_browsertest.cc index 761c851..4db46ef 100644 --- a/chrome/browser/ui/media_router/presentation_receiver_window_controller_browsertest.cc +++ b/chrome/browser/ui/media_router/presentation_receiver_window_controller_browsertest.cc
@@ -78,6 +78,9 @@ public: FakeControllerConnection() {} + FakeControllerConnection(const FakeControllerConnection&) = delete; + FakeControllerConnection& operator=(const FakeControllerConnection&) = delete; + void SendTextMessage(const std::string& message) { ASSERT_TRUE(receiver_connection_remote_.is_bound()); receiver_connection_remote_->OnMessage( @@ -108,8 +111,6 @@ receiver_connection_receiver_{this}; mojo::Remote<blink::mojom::PresentationConnection> receiver_connection_remote_; - - DISALLOW_COPY_AND_ASSIGN(FakeControllerConnection); }; // This class is used to wait for Terminate to finish before destroying a
diff --git a/chrome/browser/ui/media_router/query_result_manager_unittest.cc b/chrome/browser/ui/media_router/query_result_manager_unittest.cc index b2848ae..edc0108 100644 --- a/chrome/browser/ui/media_router/query_result_manager_unittest.cc +++ b/chrome/browser/ui/media_router/query_result_manager_unittest.cc
@@ -45,6 +45,9 @@ QueryResultManagerTest() : mock_router_(), query_result_manager_(&mock_router_) {} + QueryResultManagerTest(const QueryResultManagerTest&) = delete; + QueryResultManagerTest& operator=(const QueryResultManagerTest&) = delete; + void DiscoverSinks(MediaCastMode cast_mode, const MediaSource& source) { EXPECT_CALL(mock_router_, RegisterMediaSinksObserver(_)) .WillOnce(Return(true)); @@ -75,9 +78,6 @@ NiceMock<MockMediaRouter> mock_router_; QueryResultManager query_result_manager_; MockObserver mock_observer_; - - private: - DISALLOW_COPY_AND_ASSIGN(QueryResultManagerTest); }; // Requires that the elements of |expected| are unique.
diff --git a/chrome/browser/ui/network_profile_bubble.h b/chrome/browser/ui/network_profile_bubble.h index fac6a906..d1027ff 100644 --- a/chrome/browser/ui/network_profile_bubble.h +++ b/chrome/browser/ui/network_profile_bubble.h
@@ -46,6 +46,10 @@ METRIC_NETWORKED_PROFILE_CHECK_SIZE // Must be the last. }; + NetworkProfileBubble() = delete; + NetworkProfileBubble(const NetworkProfileBubble&) = delete; + NetworkProfileBubble& operator=(const NetworkProfileBubble&) = delete; + // Returns true if the check for network located profile should be done. This // test is only performed up to |kMaxWarnings| times in a row and then // repeated after a period of silence that lasts |kSilenceDurationDays| days. @@ -75,8 +79,6 @@ // the notification more than once per browser run. // This flag is not thread-safe and should only be accessed on the UI thread! static bool notification_shown_; - - DISALLOW_IMPLICIT_CONSTRUCTORS(NetworkProfileBubble); }; #endif // CHROME_BROWSER_UI_NETWORK_PROFILE_BUBBLE_H_
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h b/chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h index 199a7cf7..4061bbb 100644 --- a/chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h +++ b/chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h
@@ -19,6 +19,10 @@ // Chrome-specific extension of the OmniboxEditController base class. class ChromeOmniboxEditController : public OmniboxEditController { public: + ChromeOmniboxEditController(const ChromeOmniboxEditController&) = delete; + ChromeOmniboxEditController& operator=(const ChromeOmniboxEditController&) = + delete; + // OmniboxEditController: void OnAutocompleteAccept( const GURL& destination_url, @@ -53,8 +57,6 @@ Browser* const browser_; Profile* const profile_; CommandUpdater* const command_updater_; - - DISALLOW_COPY_AND_ASSIGN(ChromeOmniboxEditController); }; #endif // CHROME_BROWSER_UI_OMNIBOX_CHROME_OMNIBOX_EDIT_CONTROLLER_H_
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer_unittest.cc b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer_unittest.cc index 24936aef..b1ab095 100644 --- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer_unittest.cc +++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer_unittest.cc
@@ -39,6 +39,12 @@ class ChromeOmniboxNavigationObserverTest : public ChromeRenderViewHostTestHarness { + public: + ChromeOmniboxNavigationObserverTest( + const ChromeOmniboxNavigationObserverTest&) = delete; + ChromeOmniboxNavigationObserverTest& operator=( + const ChromeOmniboxNavigationObserverTest&) = delete; + protected: ChromeOmniboxNavigationObserverTest() {} ~ChromeOmniboxNavigationObserverTest() override {} @@ -72,8 +78,6 @@ private: // ChromeRenderViewHostTestHarness: void SetUp() override; - - DISALLOW_COPY_AND_ASSIGN(ChromeOmniboxNavigationObserverTest); }; void ChromeOmniboxNavigationObserverTest::SetUp() {
diff --git a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc index 2cb0b07..a8b41c5 100644 --- a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc +++ b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
@@ -149,6 +149,9 @@ public: OmniboxViewTest() {} + OmniboxViewTest(const OmniboxViewTest&) = delete; + OmniboxViewTest& operator=(const OmniboxViewTest&) = delete; + protected: void SetUpOnMainThread() override { ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); @@ -371,8 +374,6 @@ // Non-owning pointer. TestLocationBarModel* test_location_bar_model_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(OmniboxViewTest); }; // Test if ctrl-* accelerators are workable in omnibox.
diff --git a/chrome/browser/ui/page_info/page_info_infobar_delegate.h b/chrome/browser/ui/page_info/page_info_infobar_delegate.h index b811188..f795dc32 100644 --- a/chrome/browser/ui/page_info/page_info_infobar_delegate.h +++ b/chrome/browser/ui/page_info/page_info_infobar_delegate.h
@@ -19,6 +19,9 @@ // the reload right from the infobar. class PageInfoInfoBarDelegate : public ConfirmInfoBarDelegate { public: + PageInfoInfoBarDelegate(const PageInfoInfoBarDelegate&) = delete; + PageInfoInfoBarDelegate& operator=(const PageInfoInfoBarDelegate&) = delete; + // Creates a page info infobar and delegate and adds the infobar to // |infobar_manager|. static void Create(infobars::ContentInfoBarManager* infobar_manager); @@ -34,8 +37,6 @@ int GetButtons() const override; std::u16string GetButtonLabel(InfoBarButton button) const override; bool Accept() override; - - DISALLOW_COPY_AND_ASSIGN(PageInfoInfoBarDelegate); }; #endif // CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_INFOBAR_DELEGATE_H_
diff --git a/chrome/browser/ui/passwords/credential_leak_dialog_controller_impl_unittest.cc b/chrome/browser/ui/passwords/credential_leak_dialog_controller_impl_unittest.cc index c024411..aa9c9ac 100644 --- a/chrome/browser/ui/passwords/credential_leak_dialog_controller_impl_unittest.cc +++ b/chrome/browser/ui/passwords/credential_leak_dialog_controller_impl_unittest.cc
@@ -26,11 +26,11 @@ public: MockCredentialLeakPrompt() = default; + MockCredentialLeakPrompt(const MockCredentialLeakPrompt&) = delete; + MockCredentialLeakPrompt& operator=(const MockCredentialLeakPrompt&) = delete; + MOCK_METHOD0(ShowCredentialLeakPrompt, void()); MOCK_METHOD0(ControllerGone, void()); - - private: - DISALLOW_COPY_AND_ASSIGN(MockCredentialLeakPrompt); }; class CredentialLeakDialogControllerTest : public testing::Test {
diff --git a/chrome/browser/ui/passwords/credential_manager_dialog_controller_impl_unittest.cc b/chrome/browser/ui/passwords/credential_manager_dialog_controller_impl_unittest.cc index aee4b0e..bd097895 100644 --- a/chrome/browser/ui/passwords/credential_manager_dialog_controller_impl_unittest.cc +++ b/chrome/browser/ui/passwords/credential_manager_dialog_controller_impl_unittest.cc
@@ -37,12 +37,12 @@ public: MockPasswordPrompt() = default; + MockPasswordPrompt(const MockPasswordPrompt&) = delete; + MockPasswordPrompt& operator=(const MockPasswordPrompt&) = delete; + MOCK_METHOD0(ShowAccountChooser, void()); MOCK_METHOD0(ShowAutoSigninPrompt, void()); MOCK_METHOD0(ControllerGone, void()); - - private: - DISALLOW_COPY_AND_ASSIGN(MockPasswordPrompt); }; password_manager::PasswordForm GetLocalForm() {
diff --git a/chrome/browser/ui/passwords/manage_passwords_icon_view.h b/chrome/browser/ui/passwords/manage_passwords_icon_view.h index 36bc484..0de2153 100644 --- a/chrome/browser/ui/passwords/manage_passwords_icon_view.h +++ b/chrome/browser/ui/passwords/manage_passwords_icon_view.h
@@ -13,10 +13,10 @@ public: ManagePasswordsIconView() {} - virtual void SetState(password_manager::ui::State state) = 0; + ManagePasswordsIconView(const ManagePasswordsIconView&) = delete; + ManagePasswordsIconView& operator=(const ManagePasswordsIconView&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(ManagePasswordsIconView); + virtual void SetState(password_manager::ui::State state) = 0; }; #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_ICON_VIEW_H_
diff --git a/chrome/browser/ui/passwords/password_dialog_prompts.h b/chrome/browser/ui/passwords/password_dialog_prompts.h index 8578bf9..31f1a38c 100644 --- a/chrome/browser/ui/passwords/password_dialog_prompts.h +++ b/chrome/browser/ui/passwords/password_dialog_prompts.h
@@ -18,6 +18,9 @@ // A platform-independent interface for the account chooser dialog. class AccountChooserPrompt { public: + AccountChooserPrompt(const AccountChooserPrompt&) = delete; + AccountChooserPrompt& operator=(const AccountChooserPrompt&) = delete; + // Shows the account chooser dialog. virtual void ShowAccountChooser() = 0; @@ -27,13 +30,14 @@ protected: AccountChooserPrompt() = default; virtual ~AccountChooserPrompt() = default; - - DISALLOW_COPY_AND_ASSIGN(AccountChooserPrompt); }; // A platform-independent interface for the autosignin promo. class AutoSigninFirstRunPrompt { public: + AutoSigninFirstRunPrompt(const AutoSigninFirstRunPrompt&) = delete; + AutoSigninFirstRunPrompt& operator=(const AutoSigninFirstRunPrompt&) = delete; + // Shows the dialog. virtual void ShowAutoSigninPrompt() = 0; @@ -43,13 +47,14 @@ protected: AutoSigninFirstRunPrompt() = default; virtual ~AutoSigninFirstRunPrompt() = default; - - DISALLOW_COPY_AND_ASSIGN(AutoSigninFirstRunPrompt); }; // A platform-independent interface for the credentials leaked prompt. class CredentialLeakPrompt { public: + CredentialLeakPrompt(const CredentialLeakPrompt&) = delete; + CredentialLeakPrompt& operator=(const CredentialLeakPrompt&) = delete; + // Shows the dialog. virtual void ShowCredentialLeakPrompt() = 0; @@ -60,8 +65,6 @@ protected: CredentialLeakPrompt() = default; virtual ~CredentialLeakPrompt() = default; - - DISALLOW_COPY_AND_ASSIGN(CredentialLeakPrompt); }; // Factory function for AccountChooserPrompt on desktop platforms.
diff --git a/chrome/browser/ui/passwords/settings/password_manager_porter.cc b/chrome/browser/ui/passwords/settings/password_manager_porter.cc index a741fc8d..ba444a3 100644 --- a/chrome/browser/ui/passwords/settings/password_manager_porter.cc +++ b/chrome/browser/ui/passwords/settings/password_manager_porter.cc
@@ -70,14 +70,15 @@ public: explicit PasswordImportConsumer(Profile* profile); + PasswordImportConsumer(const PasswordImportConsumer&) = delete; + PasswordImportConsumer& operator=(const PasswordImportConsumer&) = delete; + void ConsumePassword(password_manager::PasswordImporter::Result result, password_manager::CSVPasswordSequence seq); private: Profile* profile_; SEQUENCE_CHECKER(sequence_checker_); - - DISALLOW_COPY_AND_ASSIGN(PasswordImportConsumer); }; PasswordImportConsumer::PasswordImportConsumer(Profile* profile)
diff --git a/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc b/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc index be00026..c548487 100644 --- a/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc +++ b/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc
@@ -56,6 +56,9 @@ : ui::SelectFileDialog(listener, std::move(policy)), forced_path_(forced_path) {} + TestSelectFileDialog(const TestSelectFileDialog&) = delete; + TestSelectFileDialog& operator=(const TestSelectFileDialog&) = delete; + protected: ~TestSelectFileDialog() override = default; @@ -78,17 +81,14 @@ private: // The path that will be selected by this dialog. base::FilePath forced_path_; - - DISALLOW_COPY_AND_ASSIGN(TestSelectFileDialog); }; class TestSelectFilePolicy : public ui::SelectFilePolicy { public: + TestSelectFilePolicy& operator=(const TestSelectFilePolicy&) = delete; + bool CanOpenSelectFileDialog() override { return true; } void SelectFileDenied() override {} - - private: - DISALLOW_ASSIGN(TestSelectFilePolicy); }; class TestSelectFileDialogFactory : public ui::SelectFileDialogFactory { @@ -96,6 +96,9 @@ explicit TestSelectFileDialogFactory(const base::FilePath& forced_path) : forced_path_(forced_path) {} + TestSelectFileDialogFactory& operator=(const TestSelectFileDialogFactory&) = + delete; + ui::SelectFileDialog* Create( ui::SelectFileDialog::Listener* listener, std::unique_ptr<ui::SelectFilePolicy> policy) override { @@ -106,8 +109,6 @@ private: // The path that will be selected by created dialogs. base::FilePath forced_path_; - - DISALLOW_ASSIGN(TestSelectFileDialogFactory); }; // A fake ui::SelectFileDialog, which will cancel the file selection instead of @@ -118,6 +119,11 @@ std::unique_ptr<ui::SelectFilePolicy> policy) : ui::SelectFileDialog(listener, std::move(policy)) {} + FakeCancellingSelectFileDialog(const FakeCancellingSelectFileDialog&) = + delete; + FakeCancellingSelectFileDialog& operator=( + const FakeCancellingSelectFileDialog&) = delete; + protected: void SelectFileImpl(Type type, const std::u16string& title, @@ -138,8 +144,6 @@ private: ~FakeCancellingSelectFileDialog() override = default; - - DISALLOW_COPY_AND_ASSIGN(FakeCancellingSelectFileDialog); }; class FakeCancellingSelectFileDialogFactory @@ -147,15 +151,15 @@ public: FakeCancellingSelectFileDialogFactory() {} + TestSelectFileDialogFactory& operator=(const TestSelectFileDialogFactory&) = + delete; + ui::SelectFileDialog* Create( ui::SelectFileDialog::Listener* listener, std::unique_ptr<ui::SelectFilePolicy> policy) override { return new FakeCancellingSelectFileDialog( listener, std::make_unique<TestSelectFilePolicy>()); } - - private: - DISALLOW_ASSIGN(TestSelectFileDialogFactory); }; class TestPasswordManagerPorter : public PasswordManagerPorter { @@ -163,12 +167,13 @@ TestPasswordManagerPorter() : PasswordManagerPorter(nullptr, ProgressCallback()) {} + TestPasswordManagerPorter(const TestPasswordManagerPorter&) = delete; + TestPasswordManagerPorter& operator=(const TestPasswordManagerPorter&) = + delete; + MOCK_METHOD1(ImportPasswordsFromPath, void(const base::FilePath& path)); MOCK_METHOD1(ExportPasswordsToPath, void(const base::FilePath& path)); - - private: - DISALLOW_COPY_AND_ASSIGN(TestPasswordManagerPorter); }; class MockPasswordManagerExporter @@ -194,8 +199,14 @@ }; class PasswordManagerPorterTest : public ChromeRenderViewHostTestHarness { + public: + PasswordManagerPorterTest(const PasswordManagerPorterTest&) = delete; + PasswordManagerPorterTest& operator=(const PasswordManagerPorterTest&) = + delete; + protected: PasswordManagerPorterTest() = default; + ~PasswordManagerPorterTest() override = default; void SetUp() override { @@ -218,8 +229,6 @@ private: std::unique_ptr<TestPasswordManagerPorter> password_manager_porter_; - - DISALLOW_COPY_AND_ASSIGN(PasswordManagerPorterTest); }; // Password importing and exporting using a |SelectFileDialog| is not yet
diff --git a/chrome/browser/ui/popup_browsertest.cc b/chrome/browser/ui/popup_browsertest.cc index d2c4fe1..da48e82 100644 --- a/chrome/browser/ui/popup_browsertest.cc +++ b/chrome/browser/ui/popup_browsertest.cc
@@ -36,6 +36,10 @@ // with and without the experimental WindowPlacement blink feature. class PopupBrowserTest : public InProcessBrowserTest, public ::testing::WithParamInterface<bool> { + public: + PopupBrowserTest(const PopupBrowserTest&) = delete; + PopupBrowserTest& operator=(const PopupBrowserTest&) = delete; + protected: PopupBrowserTest() = default; ~PopupBrowserTest() override = default; @@ -64,9 +68,6 @@ EXPECT_TRUE(WaitForRenderFrameReady(popup_contents->GetMainFrame())); return popup; } - - private: - DISALLOW_COPY_AND_ASSIGN(PopupBrowserTest); }; INSTANTIATE_TEST_SUITE_P(All, PopupBrowserTest, ::testing::Bool());
diff --git a/chrome/browser/ui/profile_picker.h b/chrome/browser/ui/profile_picker.h index 5d561a9..e3dfb0c 100644 --- a/chrome/browser/ui/profile_picker.h +++ b/chrome/browser/ui/profile_picker.h
@@ -62,6 +62,9 @@ kMax = kForced }; + ProfilePicker(const ProfilePicker&) = delete; + ProfilePicker& operator=(const ProfilePicker&) = delete; + // Shows the Profile picker for the given `entry_point` or re-activates an // existing one. In the latter case, the displayed page and the target url // on profile selection is not updated. @@ -143,9 +146,6 @@ // MacOS when there are no windows, or from Windows tray icon. // This returns true if the user has multiple profiles and has not opted-out. static bool ShouldShowAtLaunch(); - - private: - DISALLOW_COPY_AND_ASSIGN(ProfilePicker); }; // Dialog that will be displayed when a locked profile is selected in the
diff --git a/chrome/browser/ui/search/search_ipc_router.cc b/chrome/browser/ui/search/search_ipc_router.cc index d52c367..63abcbd 100644 --- a/chrome/browser/ui/search/search_ipc_router.cc +++ b/chrome/browser/ui/search/search_ipc_router.cc
@@ -51,6 +51,11 @@ embedded_search_client_.reset(); } + EmbeddedSearchClientFactoryImpl(const EmbeddedSearchClientFactoryImpl&) = + delete; + EmbeddedSearchClientFactoryImpl& operator=( + const EmbeddedSearchClientFactoryImpl&) = delete; + search::mojom::EmbeddedSearchClient* GetEmbeddedSearchClient() override { return embedded_search_client_.is_bound() ? embedded_search_client_.get() : nullptr; @@ -81,8 +86,6 @@ // Receivers used to listen to connection requests. content::RenderFrameHostReceiverSet<search::mojom::EmbeddedSearchConnector> factory_receivers_; - - DISALLOW_COPY_AND_ASSIGN(EmbeddedSearchClientFactoryImpl); }; void EmbeddedSearchClientFactoryImpl::Connect(
diff --git a/chrome/browser/ui/search/third_party_ntp_browsertest.cc b/chrome/browser/ui/search/third_party_ntp_browsertest.cc index f370c307..ea2ba78 100644 --- a/chrome/browser/ui/search/third_party_ntp_browsertest.cc +++ b/chrome/browser/ui/search/third_party_ntp_browsertest.cc
@@ -28,6 +28,9 @@ public: ThirdPartyNTPBrowserTest() = default; + ThirdPartyNTPBrowserTest(const ThirdPartyNTPBrowserTest&) = delete; + ThirdPartyNTPBrowserTest& operator=(const ThirdPartyNTPBrowserTest&) = delete; + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kIgnoreCertificateErrors); } @@ -37,9 +40,6 @@ host_resolver()->AddRule("*", "127.0.0.1"); ASSERT_TRUE(https_test_server().Start()); } - - private: - DISALLOW_COPY_AND_ASSIGN(ThirdPartyNTPBrowserTest); }; // Verifies that a third party NTP can successfully embed the most visited
diff --git a/chrome/browser/ui/search/third_party_ntp_uitest.cc b/chrome/browser/ui/search/third_party_ntp_uitest.cc index 8b4709e8..a19a2fa2 100644 --- a/chrome/browser/ui/search/third_party_ntp_uitest.cc +++ b/chrome/browser/ui/search/third_party_ntp_uitest.cc
@@ -30,6 +30,9 @@ public: ThirdPartyNTPUiTest() = default; + ThirdPartyNTPUiTest(const ThirdPartyNTPUiTest&) = delete; + ThirdPartyNTPUiTest& operator=(const ThirdPartyNTPUiTest&) = delete; + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kIgnoreCertificateErrors); } @@ -39,9 +42,6 @@ host_resolver()->AddRule("*", "127.0.0.1"); ASSERT_TRUE(https_test_server().Start()); } - - private: - DISALLOW_COPY_AND_ASSIGN(ThirdPartyNTPUiTest); }; // Verifies that Chrome won't steal focus from the Omnibox and focus the tab
diff --git a/chrome/browser/ui/send_mouse_move_uitest_win.cc b/chrome/browser/ui/send_mouse_move_uitest_win.cc index f13a875..a7175d5 100644 --- a/chrome/browser/ui/send_mouse_move_uitest_win.cc +++ b/chrome/browser/ui/send_mouse_move_uitest_win.cc
@@ -16,11 +16,12 @@ #include "ui/gfx/geometry/rect.h" class SendMouseMoveUITest : public InProcessBrowserTest { + public: + SendMouseMoveUITest(const SendMouseMoveUITest&) = delete; + SendMouseMoveUITest& operator=(const SendMouseMoveUITest&) = delete; + protected: SendMouseMoveUITest() = default; - - private: - DISALLOW_COPY_AND_ASSIGN(SendMouseMoveUITest); }; // This test positions the mouse at every point on the screen. It is not meant
diff --git a/chrome/browser/ui/settings_window_manager_chromeos.h b/chrome/browser/ui/settings_window_manager_chromeos.h index 876392c..5ed9638 100644 --- a/chrome/browser/ui/settings_window_manager_chromeos.h +++ b/chrome/browser/ui/settings_window_manager_chromeos.h
@@ -28,6 +28,9 @@ class SettingsWindowManager { public: + SettingsWindowManager(const SettingsWindowManager&) = delete; + SettingsWindowManager& operator=(const SettingsWindowManager&) = delete; + static SettingsWindowManager* GetInstance(); // Caller is responsible for |manager|'s life time. @@ -75,8 +78,6 @@ // TODO(calamity): Remove when SystemWebApps are enabled by default. ProfileSessionMap settings_session_map_; - - DISALLOW_COPY_AND_ASSIGN(SettingsWindowManager); }; } // namespace chrome
diff --git a/chrome/browser/ui/sync/profile_signin_confirmation_helper_browsertest.cc b/chrome/browser/ui/sync/profile_signin_confirmation_helper_browsertest.cc index 0041eb457..3196b3e 100644 --- a/chrome/browser/ui/sync/profile_signin_confirmation_helper_browsertest.cc +++ b/chrome/browser/ui/sync/profile_signin_confirmation_helper_browsertest.cc
@@ -23,13 +23,15 @@ public: ProfileSigninConfirmationHelperBrowserTest() {} + ProfileSigninConfirmationHelperBrowserTest( + const ProfileSigninConfirmationHelperBrowserTest&) = delete; + ProfileSigninConfirmationHelperBrowserTest& operator=( + const ProfileSigninConfirmationHelperBrowserTest&) = delete; + void SetUpCommandLine(base::CommandLine* command_line) override { // Force the first-run flow to trigger autoimport. command_line->AppendSwitch(switches::kForceFirstRun); } - - private: - DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationHelperBrowserTest); }; // http://crbug.com/321302
diff --git a/chrome/browser/ui/sync/sync_promo_ui_unittest.cc b/chrome/browser/ui/sync/sync_promo_ui_unittest.cc index d027d10f..3f1ad4b4 100644 --- a/chrome/browser/ui/sync/sync_promo_ui_unittest.cc +++ b/chrome/browser/ui/sync/sync_promo_ui_unittest.cc
@@ -22,6 +22,9 @@ public: SyncPromoUITest() {} + SyncPromoUITest(const SyncPromoUITest&) = delete; + SyncPromoUITest& operator=(const SyncPromoUITest&) = delete; + // testing::Test: void SetUp() override { testing::Test::SetUp(); @@ -37,9 +40,6 @@ content::BrowserTaskEnvironment task_environment_; std::unique_ptr<TestingProfile> profile_; - - private: - DISALLOW_COPY_AND_ASSIGN(SyncPromoUITest); }; // Verifies that ShouldShowSyncPromo returns false if sync is disabled by
diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h b/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h index 2771650..f6f6258 100644 --- a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h +++ b/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h
@@ -25,6 +25,12 @@ MockTabModalConfirmDialogDelegate(content::WebContents* web_contents, Delegate* delegate); + + MockTabModalConfirmDialogDelegate(const MockTabModalConfirmDialogDelegate&) = + delete; + MockTabModalConfirmDialogDelegate& operator=( + const MockTabModalConfirmDialogDelegate&) = delete; + ~MockTabModalConfirmDialogDelegate() override; std::u16string GetTitle() override; @@ -36,8 +42,6 @@ private: Delegate* delegate_; - - DISALLOW_COPY_AND_ASSIGN(MockTabModalConfirmDialogDelegate); }; class TabModalConfirmDialogTest @@ -46,6 +50,10 @@ public: TabModalConfirmDialogTest(); + TabModalConfirmDialogTest(const TabModalConfirmDialogTest&) = delete; + TabModalConfirmDialogTest& operator=(const TabModalConfirmDialogTest&) = + delete; + void SetUpOnMainThread() override; void TearDownOnMainThread() override; @@ -64,9 +72,6 @@ int accepted_count_; int canceled_count_; int closed_count_; - - private: - DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogTest); }; #endif // CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_
diff --git a/chrome/browser/ui/tabs/pinned_tab_codec.h b/chrome/browser/ui/tabs/pinned_tab_codec.h index 9c8df4cd..20311c1 100644 --- a/chrome/browser/ui/tabs/pinned_tab_codec.h +++ b/chrome/browser/ui/tabs/pinned_tab_codec.h
@@ -28,6 +28,9 @@ // dictionary describing the entry. class PinnedTabCodec { public: + PinnedTabCodec(const PinnedTabCodec&) = delete; + PinnedTabCodec& operator=(const PinnedTabCodec&) = delete; + // Registers the preference used by this class. static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); @@ -44,8 +47,6 @@ private: PinnedTabCodec(); ~PinnedTabCodec(); - - DISALLOW_COPY_AND_ASSIGN(PinnedTabCodec); }; #endif // CHROME_BROWSER_UI_TABS_PINNED_TAB_CODEC_H_
diff --git a/chrome/browser/ui/tabs/pinned_tab_test_utils.h b/chrome/browser/ui/tabs/pinned_tab_test_utils.h index 1274fc3..5edf4f4d 100644 --- a/chrome/browser/ui/tabs/pinned_tab_test_utils.h +++ b/chrome/browser/ui/tabs/pinned_tab_test_utils.h
@@ -13,13 +13,14 @@ class PinnedTabTestUtils { public: + PinnedTabTestUtils() = delete; + PinnedTabTestUtils(const PinnedTabTestUtils&) = delete; + PinnedTabTestUtils& operator=(const PinnedTabTestUtils&) = delete; + // Converts a set of Tabs into a string. The format is a space separated list // of urls. If the tab is an app, ':app' is appended, and if the tab is // pinned, ':pinned' is appended. static std::string TabsToString(const std::vector<StartupTab>& values); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(PinnedTabTestUtils); }; #endif // CHROME_BROWSER_UI_TABS_PINNED_TAB_TEST_UTILS_H_
diff --git a/chrome/browser/ui/tabs/tab_strip_model.h b/chrome/browser/ui/tabs/tab_strip_model.h index 6437c07..db9370f 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.h +++ b/chrome/browser/ui/tabs/tab_strip_model.h
@@ -199,9 +199,15 @@ static constexpr int kNoTab = -1; + TabStripModel() = delete; + // Construct a TabStripModel with a delegate to help it do certain things // (see the TabStripModelDelegate documentation). |delegate| cannot be NULL. explicit TabStripModel(TabStripModelDelegate* delegate, Profile* profile); + + TabStripModel(const TabStripModel&) = delete; + TabStripModel& operator=(const TabStripModel&) = delete; + ~TabStripModel() override; // Retrieves the TabStripModelDelegate associated with this TabStripModel. @@ -891,8 +897,6 @@ size_t tabs_scrubbed_by_key_press_count_ = 0; base::WeakPtrFactory<TabStripModel> weak_factory_{this}; - - DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel); }; // Forbid construction of ScopedObservation and ScopedMultiSourceObservation
diff --git a/chrome/browser/ui/test/test_browser_dialog.cc b/chrome/browser/ui/test/test_browser_dialog.cc index b22f66a..da52bf8 100644 --- a/chrome/browser/ui/test/test_browser_dialog.cc +++ b/chrome/browser/ui/test/test_browser_dialog.cc
@@ -43,6 +43,9 @@ weak_ptr_factory_.GetWeakPtr(), async)); } + WidgetCloser(const WidgetCloser&) = delete; + WidgetCloser& operator=(const WidgetCloser&) = delete; + private: void CloseWidget(bool async) { if (async) @@ -54,8 +57,6 @@ views::Widget* widget_; base::WeakPtrFactory<WidgetCloser> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(WidgetCloser); }; #endif // defined(TOOLKIT_VIEWS)
diff --git a/chrome/browser/ui/test/test_browser_dialog.h b/chrome/browser/ui/test/test_browser_dialog.h index bd23ac4..80ebffa 100644 --- a/chrome/browser/ui/test/test_browser_dialog.h +++ b/chrome/browser/ui/test/test_browser_dialog.h
@@ -17,6 +17,10 @@ // A dialog-specific subclass of TestBrowserUi, which will verify that a test // showed a single dialog. class TestBrowserDialog : public TestBrowserUi { + public: + TestBrowserDialog(const TestBrowserDialog&) = delete; + TestBrowserDialog& operator=(const TestBrowserDialog&) = delete; + protected: TestBrowserDialog(); ~TestBrowserDialog() override; @@ -75,8 +79,6 @@ // This should always be true, but some dialogs don't yet size themselves // properly. https://crbug.com/893292. bool should_verify_dialog_bounds_ = true; - - DISALLOW_COPY_AND_ASSIGN(TestBrowserDialog); }; template <class Base>
diff --git a/chrome/browser/ui/test/test_browser_ui.h b/chrome/browser/ui/test/test_browser_ui.h index da5cbc7..0b2e833 100644 --- a/chrome/browser/ui/test/test_browser_ui.h +++ b/chrome/browser/ui/test/test_browser_ui.h
@@ -78,6 +78,10 @@ // browser_tests --gtest_filter=BrowserUiTest.Invoke // --test-launcher-interactive --ui=FooUiTest.InvokeUi_name class TestBrowserUi { + public: + TestBrowserUi(const TestBrowserUi&) = delete; + TestBrowserUi& operator=(const TestBrowserUi&) = delete; + protected: TestBrowserUi(); virtual ~TestBrowserUi(); @@ -136,20 +140,19 @@ (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) std::unique_ptr<ui::test::SkiaGoldMatchingAlgorithm> algorithm_; #endif - - DISALLOW_COPY_AND_ASSIGN(TestBrowserUi); }; // Helper to mix in a TestBrowserUi to an existing test harness. |Base| must be // a descendant of InProcessBrowserTest. template <class Base, class TestUi> class SupportsTestUi : public Base, public TestUi { + public: + SupportsTestUi(const SupportsTestUi&) = delete; + SupportsTestUi& operator=(const SupportsTestUi&) = delete; + protected: template <class... Args> explicit SupportsTestUi(Args&&... args) : Base(std::forward<Args>(args)...) {} - - private: - DISALLOW_COPY_AND_ASSIGN(SupportsTestUi); }; using UiBrowserTest = SupportsTestUi<InProcessBrowserTest, TestBrowserUi>;
diff --git a/chrome/browser/ui/thumbnails/thumbnail_image.h b/chrome/browser/ui/thumbnails/thumbnail_image.h index dfd37678..5c18bdc 100644 --- a/chrome/browser/ui/thumbnails/thumbnail_image.h +++ b/chrome/browser/ui/thumbnails/thumbnail_image.h
@@ -119,6 +119,9 @@ explicit ThumbnailImage(Delegate* delegate); + ThumbnailImage(const ThumbnailImage&) = delete; + ThumbnailImage& operator=(const ThumbnailImage&) = delete; + bool has_data() const { return data_.get(); } // Gets the capture readiness of the backing tab. @@ -217,8 +220,6 @@ SEQUENCE_CHECKER(sequence_checker_); base::WeakPtrFactory<ThumbnailImage> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ThumbnailImage); }; #endif // CHROME_BROWSER_UI_THUMBNAILS_THUMBNAIL_IMAGE_H_
diff --git a/chrome/browser/ui/thumbnails/thumbnail_image_unittest.cc b/chrome/browser/ui/thumbnails/thumbnail_image_unittest.cc index d4a24cd..b525ad2 100644 --- a/chrome/browser/ui/thumbnails/thumbnail_image_unittest.cc +++ b/chrome/browser/ui/thumbnails/thumbnail_image_unittest.cc
@@ -80,6 +80,9 @@ public: ThumbnailImageTest() = default; + ThumbnailImageTest(const ThumbnailImageTest&) = delete; + ThumbnailImageTest& operator=(const ThumbnailImageTest&) = delete; + protected: static SkBitmap CreateBitmap(int width, int height) { SkBitmap bitmap; @@ -101,7 +104,6 @@ bool is_being_observed_ = false; base::test::TaskEnvironment task_environment_; - DISALLOW_COPY_AND_ASSIGN(ThumbnailImageTest); }; using Subscription = ThumbnailImage::Subscription;
diff --git a/chrome/browser/ui/thumbnails/thumbnail_tab_helper_browsertest.cc b/chrome/browser/ui/thumbnails/thumbnail_tab_helper_browsertest.cc index 5420198..1e7785f 100644 --- a/chrome/browser/ui/thumbnails/thumbnail_tab_helper_browsertest.cc +++ b/chrome/browser/ui/thumbnails/thumbnail_tab_helper_browsertest.cc
@@ -70,6 +70,10 @@ base::FilePath().AppendASCII("bot2.html")); } + ThumbnailTabHelperBrowserTest(const ThumbnailTabHelperBrowserTest&) = delete; + ThumbnailTabHelperBrowserTest& operator=( + const ThumbnailTabHelperBrowserTest&) = delete; + #if BUILDFLAG(ENABLE_SESSION_SERVICE) void ConfigureTabLoader(TabLoader* tab_loader) { TabLoaderTester tester(tab_loader); @@ -149,8 +153,6 @@ private: base::test::ScopedFeatureList scoped_feature_list_; - - DISALLOW_COPY_AND_ASSIGN(ThumbnailTabHelperBrowserTest); }; IN_PROC_BROWSER_TEST_F(ThumbnailTabHelperBrowserTest,
diff --git a/chrome/browser/ui/toolbar/app_menu_icon_controller.h b/chrome/browser/ui/toolbar/app_menu_icon_controller.h index cda6611..d02ed1f 100644 --- a/chrome/browser/ui/toolbar/app_menu_icon_controller.h +++ b/chrome/browser/ui/toolbar/app_menu_icon_controller.h
@@ -63,6 +63,10 @@ AppMenuIconController(UpgradeDetector* upgrade_detector, Profile* profile, Delegate* delegate); + + AppMenuIconController(const AppMenuIconController&) = delete; + AppMenuIconController& operator=(const AppMenuIconController&) = delete; + ~AppMenuIconController() override; // Forces an update of the UI based on the current state of the world. This @@ -94,8 +98,6 @@ Delegate* const delegate_; base::ScopedObservation<GlobalErrorService, GlobalErrorObserver> global_error_observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(AppMenuIconController); }; #endif // CHROME_BROWSER_UI_TOOLBAR_APP_MENU_ICON_CONTROLLER_H_
diff --git a/chrome/browser/ui/toolbar/app_menu_icon_controller_unittest.cc b/chrome/browser/ui/toolbar/app_menu_icon_controller_unittest.cc index c76adf6..3a95189 100644 --- a/chrome/browser/ui/toolbar/app_menu_icon_controller_unittest.cc +++ b/chrome/browser/ui/toolbar/app_menu_icon_controller_unittest.cc
@@ -41,6 +41,9 @@ : UpgradeDetector(base::DefaultClock::GetInstance(), base::DefaultTickClock::GetInstance()) {} + FakeUpgradeDetector(const FakeUpgradeDetector&) = delete; + FakeUpgradeDetector& operator=(const FakeUpgradeDetector&) = delete; + void BroadcastLevel(UpgradeNotificationAnnoyanceLevel level) { set_upgrade_notification_stage(level); NotifyUpgrade(); @@ -49,10 +52,6 @@ // UpgradeDetector: base::Time GetAnnoyanceLevelDeadline( UpgradeNotificationAnnoyanceLevel level) override; - - private: - - DISALLOW_COPY_AND_ASSIGN(FakeUpgradeDetector); }; base::Time FakeUpgradeDetector::GetAnnoyanceLevelDeadline( @@ -81,6 +80,11 @@ #endif { } + + AppMenuIconControllerTest(const AppMenuIconControllerTest&) = delete; + AppMenuIconControllerTest& operator=(const AppMenuIconControllerTest&) = + delete; + UpgradeDetector* upgrade_detector() { return &upgrade_detector_; } Profile* profile() { return &profile_; } @@ -112,8 +116,6 @@ FakeUpgradeDetector upgrade_detector_; content::BrowserTaskEnvironment task_environment_; TestingProfile profile_; - - DISALLOW_COPY_AND_ASSIGN(AppMenuIconControllerTest); }; // Tests that the controller's delegate is notified with the proper icon type
diff --git a/chrome/browser/ui/toolbar/app_menu_model.cc b/chrome/browser/ui/toolbar/app_menu_model.cc index a6b1af80..fd72ac2 100644 --- a/chrome/browser/ui/toolbar/app_menu_model.cc +++ b/chrome/browser/ui/toolbar/app_menu_model.cc
@@ -182,6 +182,9 @@ Build(browser); } + HelpMenuModel(const HelpMenuModel&) = delete; + HelpMenuModel& operator=(const HelpMenuModel&) = delete; + private: void Build(Browser* browser) { #if BUILDFLAG(IS_CHROMEOS_ASH) && defined(OFFICIAL_BUILD) @@ -218,8 +221,6 @@ if (browser->profile()->GetPrefs()->GetBoolean(prefs::kUserFeedbackAllowed)) AddItemWithStringId(IDC_FEEDBACK, IDS_FEEDBACK); } - - DISALLOW_COPY_AND_ASSIGN(HelpMenuModel); }; ////////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/ui/toolbar/app_menu_model_unittest.cc b/chrome/browser/ui/toolbar/app_menu_model_unittest.cc index ed8e57c..0a1815d 100644 --- a/chrome/browser/ui/toolbar/app_menu_model_unittest.cc +++ b/chrome/browser/ui/toolbar/app_menu_model_unittest.cc
@@ -41,6 +41,9 @@ execute_count_(0) { } + MenuError(const MenuError&) = delete; + MenuError& operator=(const MenuError&) = delete; + int execute_count() { return execute_count_; } bool HasMenuItem() override { return true; } @@ -56,8 +59,6 @@ private: int command_id_; int execute_count_; - - DISALLOW_COPY_AND_ASSIGN(MenuError); }; class FakeIconDelegate : public AppMenuIconController::Delegate {
diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc b/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc index 66d24ee..60c8e37 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc
@@ -53,6 +53,9 @@ public: FaviconDelegate() : was_called_(false) {} + FaviconDelegate(const FaviconDelegate&) = delete; + FaviconDelegate& operator=(const FaviconDelegate&) = delete; + void OnIconChanged(int command_id) override { was_called_ = true; base::RunLoop::QuitCurrentWhenIdleDeprecated(); @@ -62,8 +65,6 @@ private: bool was_called_; - - DISALLOW_COPY_AND_ASSIGN(FaviconDelegate); }; } // namespace
diff --git a/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.h b/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.h index a5f68db..33f2e683 100644 --- a/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.h +++ b/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.h
@@ -24,6 +24,11 @@ // out how to fetch the active WebContents to its subclasses. class ChromeLocationBarModelDelegate : public LocationBarModelDelegate { public: + ChromeLocationBarModelDelegate(const ChromeLocationBarModelDelegate&) = + delete; + ChromeLocationBarModelDelegate& operator=( + const ChromeLocationBarModelDelegate&) = delete; + // Returns active WebContents. virtual content::WebContents* GetActiveWebContents() const = 0; @@ -87,8 +92,6 @@ // Helper method that returns the state of URL elision in the omnibox. ElisionConfig GetElisionConfig() const; - - DISALLOW_COPY_AND_ASSIGN(ChromeLocationBarModelDelegate); }; #endif // CHROME_BROWSER_UI_TOOLBAR_CHROME_LOCATION_BAR_MODEL_DELEGATE_H_
diff --git a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc index f86c986a..4067e745 100644 --- a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc +++ b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc
@@ -60,6 +60,10 @@ execute_count_(0), enable_count_(0) {} + TestRecentTabsSubMenuModel(const TestRecentTabsSubMenuModel&) = delete; + TestRecentTabsSubMenuModel& operator=(const TestRecentTabsSubMenuModel&) = + delete; + // Testing overrides to ui::SimpleMenuModel::Delegate: bool IsCommandIdEnabled(int command_id) const override { bool val = RecentTabsSubMenuModel::IsCommandIdEnabled(command_id); @@ -78,8 +82,6 @@ private: int execute_count_; int mutable enable_count_; // Mutable because IsCommandIdEnabledAt is const. - - DISALLOW_COPY_AND_ASSIGN(TestRecentTabsSubMenuModel); }; class TestRecentTabsMenuModelDelegate : public ui::MenuModelDelegate { @@ -119,6 +121,10 @@ public: RecentTabsSubMenuModelTest() {} + RecentTabsSubMenuModelTest(const RecentTabsSubMenuModelTest&) = delete; + RecentTabsSubMenuModelTest& operator=(const RecentTabsSubMenuModelTest&) = + delete; + void WaitForLoadFromLastSession() { content::RunAllTasksUntilIdle(); } void SetUp() override { @@ -174,8 +180,6 @@ private: sync_sessions::SessionSyncService* session_sync_service_; std::unique_ptr<syncer::ModelTypeProcessor> sync_processor_; - - DISALLOW_COPY_AND_ASSIGN(RecentTabsSubMenuModelTest); }; // Test disabled "Recently closed" header with no foreign tabs.
diff --git a/chrome/browser/ui/translate/translate_bubble_view_state_transition.h b/chrome/browser/ui/translate/translate_bubble_view_state_transition.h index 3d1fb6a..7363920c 100644 --- a/chrome/browser/ui/translate/translate_bubble_view_state_transition.h +++ b/chrome/browser/ui/translate/translate_bubble_view_state_transition.h
@@ -101,6 +101,11 @@ explicit TranslateBubbleViewStateTransition( TranslateBubbleModel::ViewState view_state); + TranslateBubbleViewStateTransition( + const TranslateBubbleViewStateTransition&) = delete; + TranslateBubbleViewStateTransition& operator=( + const TranslateBubbleViewStateTransition&) = delete; + TranslateBubbleModel::ViewState view_state() const { return view_state_; } // Transitions the view state. @@ -118,8 +123,6 @@ // before the user opens the 'Advanced' view. This is used to navigate when // pressing 'Cancel' button on the 'Advanced' view. TranslateBubbleModel::ViewState view_state_before_advanced_view_; - - DISALLOW_COPY_AND_ASSIGN(TranslateBubbleViewStateTransition); }; #endif // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_BUBBLE_VIEW_STATE_TRANSITION_H_
diff --git a/chrome/browser/ui/uma_browsing_activity_observer.h b/chrome/browser/ui/uma_browsing_activity_observer.h index 8390eca..048af11 100644 --- a/chrome/browser/ui/uma_browsing_activity_observer.h +++ b/chrome/browser/ui/uma_browsing_activity_observer.h
@@ -17,6 +17,10 @@ // creates histograms of some global object counts. class UMABrowsingActivityObserver : public content::NotificationObserver { public: + UMABrowsingActivityObserver(const UMABrowsingActivityObserver&) = delete; + UMABrowsingActivityObserver& operator=(const UMABrowsingActivityObserver&) = + delete; + static void Init(); private: @@ -47,8 +51,6 @@ content::NotificationRegistrar registrar_; TabStripModelStatsRecorder tab_recorder_; - - DISALLOW_COPY_AND_ASSIGN(UMABrowsingActivityObserver); }; } // namespace chrome
diff --git a/chrome/browser/ui/update_chrome_dialog_browsertest.cc b/chrome/browser/ui/update_chrome_dialog_browsertest.cc index fee6d60..74227807 100644 --- a/chrome/browser/ui/update_chrome_dialog_browsertest.cc +++ b/chrome/browser/ui/update_chrome_dialog_browsertest.cc
@@ -11,12 +11,13 @@ public: UpdateRecommendedDialogTest() {} + UpdateRecommendedDialogTest(const UpdateRecommendedDialogTest&) = delete; + UpdateRecommendedDialogTest& operator=(const UpdateRecommendedDialogTest&) = + delete; + void ShowUi(const std::string& name) override { InProcessBrowserTest::browser()->window()->ShowUpdateChromeDialog(); } - - private: - DISALLOW_COPY_AND_ASSIGN(UpdateRecommendedDialogTest); }; // Test that calls ShowUi("default").
diff --git a/chrome/browser/ui/user_education/reopen_tab_in_product_help_factory.h b/chrome/browser/ui/user_education/reopen_tab_in_product_help_factory.h index 1581abb..f5f13a6 100644 --- a/chrome/browser/ui/user_education/reopen_tab_in_product_help_factory.h +++ b/chrome/browser/ui/user_education/reopen_tab_in_product_help_factory.h
@@ -23,6 +23,10 @@ class ReopenTabInProductHelpFactory : public BrowserContextKeyedServiceFactory { public: + ReopenTabInProductHelpFactory(const ReopenTabInProductHelpFactory&) = delete; + ReopenTabInProductHelpFactory& operator=( + const ReopenTabInProductHelpFactory&) = delete; + static ReopenTabInProductHelpFactory* GetInstance(); static ReopenTabInProductHelp* GetForProfile(Profile* profile); @@ -38,8 +42,6 @@ content::BrowserContext* context) const override; friend struct base::DefaultSingletonTraits<ReopenTabInProductHelpFactory>; - - DISALLOW_COPY_AND_ASSIGN(ReopenTabInProductHelpFactory); }; #endif // CHROME_BROWSER_UI_USER_EDUCATION_REOPEN_TAB_IN_PRODUCT_HELP_FACTORY_H_
diff --git a/chrome/browser/ui/views/accessibility/browser_accessibility_uitest_auralinux.cc b/chrome/browser/ui/views/accessibility/browser_accessibility_uitest_auralinux.cc index 70b24d46..286dbb7 100644 --- a/chrome/browser/ui/views/accessibility/browser_accessibility_uitest_auralinux.cc +++ b/chrome/browser/ui/views/accessibility/browser_accessibility_uitest_auralinux.cc
@@ -25,12 +25,15 @@ AuraLinuxAccessibilityInProcessBrowserTest() : ax_mode_setter_(ui::kAXModeComplete) {} + AuraLinuxAccessibilityInProcessBrowserTest( + const AuraLinuxAccessibilityInProcessBrowserTest&) = delete; + AuraLinuxAccessibilityInProcessBrowserTest& operator=( + const AuraLinuxAccessibilityInProcessBrowserTest&) = delete; + void VerifyEmbedRelationships(); private: ui::testing::ScopedAxModeSetter ax_mode_setter_; - - DISALLOW_COPY_AND_ASSIGN(AuraLinuxAccessibilityInProcessBrowserTest); }; IN_PROC_BROWSER_TEST_F(AuraLinuxAccessibilityInProcessBrowserTest, @@ -56,10 +59,14 @@ public: explicit TestTabModalConfirmDialogDelegate(content::WebContents* contents) : TabModalConfirmDialogDelegate(contents) {} + + TestTabModalConfirmDialogDelegate(const TestTabModalConfirmDialogDelegate&) = + delete; + TestTabModalConfirmDialogDelegate& operator=( + const TestTabModalConfirmDialogDelegate&) = delete; + std::u16string GetTitle() override { return u"Dialog Title"; } std::u16string GetDialogMessage() override { return std::u16string(); } - - DISALLOW_COPY_AND_ASSIGN(TestTabModalConfirmDialogDelegate); }; // Open a tab-modal dialog and test IndexInParent with the modal dialog.
diff --git a/chrome/browser/ui/views/accessibility/navigation_accessibility_uitest_win.cc b/chrome/browser/ui/views/accessibility/navigation_accessibility_uitest_win.cc index cc570ea..ead81a0 100644 --- a/chrome/browser/ui/views/accessibility/navigation_accessibility_uitest_win.cc +++ b/chrome/browser/ui/views/accessibility/navigation_accessibility_uitest_win.cc
@@ -183,6 +183,11 @@ } class NavigationAccessibilityTest : public InProcessBrowserTest { + public: + NavigationAccessibilityTest(const NavigationAccessibilityTest&) = delete; + NavigationAccessibilityTest& operator=(const NavigationAccessibilityTest&) = + delete; + protected: NavigationAccessibilityTest() {} ~NavigationAccessibilityTest() override {} @@ -201,8 +206,6 @@ private: base::win::ScopedCOMInitializer com_initializer_; - - DISALLOW_COPY_AND_ASSIGN(NavigationAccessibilityTest); }; // Tests that when focus is in the omnibox and the user types a url and
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_browsertest.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_browsertest.cc index 5892e97..acab25f 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_browsertest.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_browsertest.cc
@@ -20,6 +20,9 @@ public: AppInfoDialogBrowserTest() {} + AppInfoDialogBrowserTest(const AppInfoDialogBrowserTest&) = delete; + AppInfoDialogBrowserTest& operator=(const AppInfoDialogBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { extension_environment_ = @@ -39,8 +42,6 @@ private: std::unique_ptr<extensions::TestExtensionEnvironment> extension_environment_; scoped_refptr<const extensions::Extension> extension_; - - DISALLOW_COPY_AND_ASSIGN(AppInfoDialogBrowserTest); }; // Invokes a dialog that shows details of an installed extension.
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc index 4ae275f..daf133f 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc
@@ -62,6 +62,9 @@ public: explicit AppInfoDialogTestApi(AppInfoDialog* dialog) : dialog_(dialog) {} + AppInfoDialogTestApi(const AppInfoDialogTestApi&) = delete; + AppInfoDialogTestApi& operator=(const AppInfoDialogTestApi&) = delete; + void ShowAppInWebStore() { auto* header_panel = static_cast<AppInfoHeaderPanel*>(dialog_->children().front()); @@ -70,8 +73,6 @@ private: AppInfoDialog* dialog_; - - DISALLOW_COPY_AND_ASSIGN(AppInfoDialogTestApi); }; } // namespace test @@ -88,6 +89,9 @@ public: AppInfoDialogViewsTest() = default; + AppInfoDialogViewsTest(const AppInfoDialogViewsTest&) = delete; + AppInfoDialogViewsTest& operator=(const AppInfoDialogViewsTest&) = delete; + // Overridden from testing::Test: void SetUp() override { BrowserWithTestWindowTest::SetUp(); @@ -196,9 +200,6 @@ std::unique_ptr<ChromeShelfController> chrome_shelf_controller_; ArcAppTest arc_test_; #endif - - private: - DISALLOW_COPY_AND_ASSIGN(AppInfoDialogViewsTest); }; // Tests that the dialog closes when the current app is uninstalled.
diff --git a/chrome/browser/ui/views/apps/app_window_desktop_native_widget_aura_win.h b/chrome/browser/ui/views/apps/app_window_desktop_native_widget_aura_win.h index 1c0b9f3..a5ad255f 100644 --- a/chrome/browser/ui/views/apps/app_window_desktop_native_widget_aura_win.h +++ b/chrome/browser/ui/views/apps/app_window_desktop_native_widget_aura_win.h
@@ -22,6 +22,11 @@ explicit AppWindowDesktopNativeWidgetAuraWin( ChromeNativeAppWindowViewsWin* app_window); + AppWindowDesktopNativeWidgetAuraWin( + const AppWindowDesktopNativeWidgetAuraWin&) = delete; + AppWindowDesktopNativeWidgetAuraWin& operator=( + const AppWindowDesktopNativeWidgetAuraWin&) = delete; + protected: ~AppWindowDesktopNativeWidgetAuraWin() override; @@ -36,8 +41,6 @@ // Owned by superclass DesktopNativeWidgetAura. views::DesktopWindowTreeHost* tree_host_; - - DISALLOW_COPY_AND_ASSIGN(AppWindowDesktopNativeWidgetAuraWin); }; #endif // CHROME_BROWSER_UI_VIEWS_APPS_APP_WINDOW_DESKTOP_NATIVE_WIDGET_AURA_WIN_H_
diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash_browsertest.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash_browsertest.cc index 11559d5..8bf12c5d 100644 --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash_browsertest.cc +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash_browsertest.cc
@@ -34,6 +34,9 @@ class ViewBoundsChangeWaiter : public views::ViewObserver { public: + ViewBoundsChangeWaiter(const ViewBoundsChangeWaiter&) = delete; + ViewBoundsChangeWaiter& operator=(const ViewBoundsChangeWaiter&) = delete; + static void VerifyY(views::View* view, int y) { if (y != view->bounds().y()) ViewBoundsChangeWaiter(view).run_loop_.Run(); @@ -53,8 +56,6 @@ base::RunLoop run_loop_; base::ScopedObservation<views::View, views::ViewObserver> observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(ViewBoundsChangeWaiter); }; } // namespace
diff --git a/chrome/browser/ui/views/autofill/autofill_accessibility_win_browsertest.cc b/chrome/browser/ui/views/autofill/autofill_accessibility_win_browsertest.cc index 45993ce..7f7009b 100644 --- a/chrome/browser/ui/views/autofill/autofill_accessibility_win_browsertest.cc +++ b/chrome/browser/ui/views/autofill/autofill_accessibility_win_browsertest.cc
@@ -36,6 +36,11 @@ public: AutofillAccessibilityWinBrowserTest() = default; + AutofillAccessibilityWinBrowserTest( + const AutofillAccessibilityWinBrowserTest&) = delete; + AutofillAccessibilityWinBrowserTest& operator=( + const AutofillAccessibilityWinBrowserTest&) = delete; + protected: void SetUpOnMainThread() override { InProcessBrowserTest::SetUpOnMainThread(); @@ -74,9 +79,6 @@ SimulateKeyPress(web_contents, key, code, key_code, false, false, false, false); } - - private: - DISALLOW_COPY_AND_ASSIGN(AutofillAccessibilityWinBrowserTest); }; // The test is flaky on Windows. See https://crbug.com/1221273
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc b/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc index dbddf75..2873008 100644 --- a/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc +++ b/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc
@@ -24,9 +24,10 @@ #include "ui/accessibility/platform/ax_platform_node.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/skia_util.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/border.h" #include "ui/views/bubble/bubble_border.h" @@ -41,38 +42,31 @@ } SkColor AutofillPopupBaseView::GetBackgroundColor() const { - return GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DropdownBackgroundColor); + return GetColorProvider()->GetColor(ui::kColorDropdownBackground); } SkColor AutofillPopupBaseView::GetForegroundColor() const { - return GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DropdownForegroundColor); + return GetColorProvider()->GetColor(ui::kColorDropdownForeground); } SkColor AutofillPopupBaseView::GetSelectedBackgroundColor() const { - return GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DropdownSelectedBackgroundColor); + return GetColorProvider()->GetColor(ui::kColorDropdownBackgroundSelected); } SkColor AutofillPopupBaseView::GetSelectedForegroundColor() const { - return GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DropdownSelectedForegroundColor); + return GetColorProvider()->GetColor(ui::kColorDropdownForegroundSelected); } SkColor AutofillPopupBaseView::GetFooterBackgroundColor() const { - return GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_BubbleFooterBackground); + return GetColorProvider()->GetColor(ui::kColorBubbleFooterBackground); } SkColor AutofillPopupBaseView::GetSeparatorColor() const { - return GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_MenuSeparatorColor); + return GetColorProvider()->GetColor(ui::kColorMenuSeparator); } SkColor AutofillPopupBaseView::GetWarningColor() const { - return GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityHigh); + return GetColorProvider()->GetColor(ui::kColorAlertHighSeverity); } AutofillPopupBaseView::AutofillPopupBaseView(
diff --git a/chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.cc b/chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.cc index 0881de9..d575d66 100644 --- a/chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.cc +++ b/chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.cc
@@ -28,10 +28,10 @@ #include "ui/base/models/image_model.h" #include "ui/base/resource/resource_bundle.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/vector_icon_utils.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/bubble/bubble_frame_view.h" @@ -221,13 +221,13 @@ void CardUnmaskPromptViews::OnThemeChanged() { views::BubbleDialogDelegateView::OnThemeChanged(); - SkColor bg_color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DialogBackground); + const auto* color_provider = GetColorProvider(); + SkColor bg_color = color_provider->GetColor(ui::kColorDialogBackground); overlay_->SetBackground(views::CreateSolidBackground(bg_color)); if (overlay_label_) { overlay_label_->SetBackgroundColor(bg_color); - overlay_label_->SetEnabledColor(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_ThrobberSpinningColor)); + overlay_label_->SetEnabledColor( + color_provider->GetColor(ui::kColorThrobber)); } }
diff --git a/chrome/browser/ui/views/autofill/payments/local_card_migration_browsertest.cc b/chrome/browser/ui/views/autofill/payments/local_card_migration_browsertest.cc index 8045b4f..64e38bd 100644 --- a/chrome/browser/ui/views/autofill/payments/local_card_migration_browsertest.cc +++ b/chrome/browser/ui/views/autofill/payments/local_card_migration_browsertest.cc
@@ -146,6 +146,11 @@ class LocalCardMigrationBrowserTest : public SyncTest, public LocalCardMigrationManager::ObserverForTest { + public: + LocalCardMigrationBrowserTest(const LocalCardMigrationBrowserTest&) = delete; + LocalCardMigrationBrowserTest& operator=( + const LocalCardMigrationBrowserTest&) = delete; + protected: // Various events that can be waited on by the DialogEventWaiter. enum class DialogEvent : int { @@ -536,8 +541,6 @@ network::TestURLLoaderFactory test_url_loader_factory_; scoped_refptr<network::SharedURLLoaderFactory> test_shared_loader_factory_; std::unique_ptr<device::ScopedGeolocationOverrider> geolocation_overrider_; - - DISALLOW_COPY_AND_ASSIGN(LocalCardMigrationBrowserTest); }; // TODO(crbug.com/932818): Remove this class after experiment flag is cleaned
diff --git a/chrome/browser/ui/views/autofill/payments/local_card_migration_bubble_views.cc b/chrome/browser/ui/views/autofill/payments/local_card_migration_bubble_views.cc index fa70b034..53d928a 100644 --- a/chrome/browser/ui/views/autofill/payments/local_card_migration_bubble_views.cc +++ b/chrome/browser/ui/views/autofill/payments/local_card_migration_bubble_views.cc
@@ -22,6 +22,8 @@ #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/image/image_skia_operations.h" @@ -114,8 +116,7 @@ #else gfx::ImageSkia image = gfx::CreateVectorIcon( kCreditCardIcon, kMigrationBubbleGooglePayLogoHeight, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DefaultIconColor)); + GetColorProvider()->GetColor(ui::kColorIcon)); #endif views::ImageView* icon_view = new views::ImageView(); icon_view->SetImage(image);
diff --git a/chrome/browser/ui/views/autofill/payments/local_card_migration_bubble_views.h b/chrome/browser/ui/views/autofill/payments/local_card_migration_bubble_views.h index cda09d2..248ce79 100644 --- a/chrome/browser/ui/views/autofill/payments/local_card_migration_bubble_views.h +++ b/chrome/browser/ui/views/autofill/payments/local_card_migration_bubble_views.h
@@ -29,6 +29,10 @@ content::WebContents* web_contents, LocalCardMigrationBubbleController* controller); + LocalCardMigrationBubbleViews(const LocalCardMigrationBubbleViews&) = delete; + LocalCardMigrationBubbleViews& operator=( + const LocalCardMigrationBubbleViews&) = delete; + void Show(DisplayReason reason); // AutofillBubbleBase: @@ -55,8 +59,6 @@ PaymentsBubbleClosedReason::kUnknown; LocalCardMigrationBubbleController* controller_; - - DISALLOW_COPY_AND_ASSIGN(LocalCardMigrationBubbleViews); }; } // namespace autofill
diff --git a/chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.cc b/chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.cc index b666a23..0433227 100644 --- a/chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.cc +++ b/chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.cc
@@ -37,6 +37,7 @@ #include "ui/base/models/image_model.h" #include "ui/base/resource/resource_bundle.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" @@ -143,8 +144,7 @@ tip_->SetEnabledColor( should_use_dark_colors ? gfx::kGoogleGrey200 - : GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_LabelSecondaryColor)); + : GetColorProvider()->GetColor(ui::kColorLabelForegroundSecondary)); } private:
diff --git a/chrome/browser/ui/views/autofill/payments/local_card_migration_error_dialog_view.cc b/chrome/browser/ui/views/autofill/payments/local_card_migration_error_dialog_view.cc index 4547cd7..6161f9f 100644 --- a/chrome/browser/ui/views/autofill/payments/local_card_migration_error_dialog_view.cc +++ b/chrome/browser/ui/views/autofill/payments/local_card_migration_error_dialog_view.cc
@@ -21,6 +21,8 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/native_theme/native_theme.h" @@ -106,10 +108,9 @@ views::BoxLayout::MainAxisAlignment::kCenter); error_view->SetBorder(views::CreateEmptyBorder(kMigrationDialogInsets)); auto* error_image = new views::ImageView(); - error_image->SetImage( - gfx::CreateVectorIcon(kBrowserToolsErrorIcon, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityHigh))); + error_image->SetImage(gfx::CreateVectorIcon( + kBrowserToolsErrorIcon, + GetColorProvider()->GetColor(ui::kColorAlertHighSeverity))); error_view->AddChildView(error_image); auto* error_message = new views::Label(
diff --git a/chrome/browser/ui/views/autofill/payments/migratable_card_view.cc b/chrome/browser/ui/views/autofill/payments/migratable_card_view.cc index 32bc6ecd..340b583 100644 --- a/chrome/browser/ui/views/autofill/payments/migratable_card_view.cc +++ b/chrome/browser/ui/views/autofill/payments/migratable_card_view.cc
@@ -18,8 +18,8 @@ #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/button/checkbox.h" @@ -84,9 +84,8 @@ void MigratableCardView::OnThemeChanged() { View::OnThemeChanged(); - checkbox_uncheck_text_container_->SetBackground( - views::CreateSolidBackground(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_BubbleFooterBackground))); + checkbox_uncheck_text_container_->SetBackground(views::CreateSolidBackground( + GetColorProvider()->GetColor(ui::kColorBubbleFooterBackground))); } std::unique_ptr<views::View>
diff --git a/chrome/browser/ui/views/autofill/payments/payments_view_util.cc b/chrome/browser/ui/views/autofill/payments/payments_view_util.cc index 613ebb0..768bf80 100644 --- a/chrome/browser/ui/views/autofill/payments/payments_view_util.cc +++ b/chrome/browser/ui/views/autofill/payments/payments_view_util.cc
@@ -14,6 +14,8 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/image/image_skia.h" @@ -64,8 +66,7 @@ #else gfx::ImageSkia image = gfx::CreateVectorIcon(kCreditCardIcon, kGooglePayLogoHeight, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DefaultIconColor)); + GetColorProvider()->GetColor(ui::kColorIcon)); #endif SetImage(image); }
diff --git a/chrome/browser/ui/views/autofill/payments/save_card_bubble_views.h b/chrome/browser/ui/views/autofill/payments/save_card_bubble_views.h index 5baa471..60c3284 100644 --- a/chrome/browser/ui/views/autofill/payments/save_card_bubble_views.h +++ b/chrome/browser/ui/views/autofill/payments/save_card_bubble_views.h
@@ -33,6 +33,9 @@ content::WebContents* web_contents, SaveCardBubbleController* controller); + SaveCardBubbleViews(const SaveCardBubbleViews&) = delete; + SaveCardBubbleViews& operator=(const SaveCardBubbleViews&) = delete; + void Show(DisplayReason reason); // AutofillBubbleBase: @@ -80,8 +83,6 @@ PaymentsBubbleClosedReason closed_reason_ = PaymentsBubbleClosedReason::kUnknown; - - DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleViews); }; } // namespace autofill
diff --git a/chrome/browser/ui/views/autofill/payments/save_card_failure_bubble_views.h b/chrome/browser/ui/views/autofill/payments/save_card_failure_bubble_views.h index c28c5db7..27af194 100644 --- a/chrome/browser/ui/views/autofill/payments/save_card_failure_bubble_views.h +++ b/chrome/browser/ui/views/autofill/payments/save_card_failure_bubble_views.h
@@ -16,14 +16,16 @@ content::WebContents* web_contents, SaveCardBubbleController* controller); + SaveCardFailureBubbleViews(const SaveCardFailureBubbleViews&) = delete; + SaveCardFailureBubbleViews& operator=(const SaveCardFailureBubbleViews&) = + delete; + protected: ~SaveCardFailureBubbleViews() override = default; private: // SaveCardBubbleViews: std::unique_ptr<views::View> CreateMainContentView() override; - - DISALLOW_COPY_AND_ASSIGN(SaveCardFailureBubbleViews); }; } // namespace autofill
diff --git a/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.h b/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.h index 6ec0768..2422e58 100644 --- a/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.h +++ b/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.h
@@ -22,12 +22,15 @@ content::WebContents* web_contents, SaveCardBubbleController* controller); + SaveCardManageCardsBubbleViews(const SaveCardManageCardsBubbleViews&) = + delete; + SaveCardManageCardsBubbleViews& operator=( + const SaveCardManageCardsBubbleViews&) = delete; + private: std::unique_ptr<views::View> CreateMainContentView() override; ~SaveCardManageCardsBubbleViews() override; - - DISALLOW_COPY_AND_ASSIGN(SaveCardManageCardsBubbleViews); }; } // namespace autofill
diff --git a/chrome/browser/ui/views/autofill/payments/save_card_offer_bubble_views.h b/chrome/browser/ui/views/autofill/payments/save_card_offer_bubble_views.h index ebb186f..5841367 100644 --- a/chrome/browser/ui/views/autofill/payments/save_card_offer_bubble_views.h +++ b/chrome/browser/ui/views/autofill/payments/save_card_offer_bubble_views.h
@@ -32,6 +32,9 @@ content::WebContents* web_contents, SaveCardBubbleController* controller); + SaveCardOfferBubbleViews(const SaveCardOfferBubbleViews&) = delete; + SaveCardOfferBubbleViews& operator=(const SaveCardOfferBubbleViews&) = delete; + // SaveCardBubbleViews: void Init() override; bool Accept() override; @@ -61,8 +64,6 @@ views::Combobox* year_input_dropdown_ = nullptr; MonthComboboxModel month_combobox_model_; YearComboboxModel year_combobox_model_; - - DISALLOW_COPY_AND_ASSIGN(SaveCardOfferBubbleViews); }; } // namespace autofill
diff --git a/chrome/browser/ui/views/autofill/payments/virtual_card_selection_dialog_browsertest.cc b/chrome/browser/ui/views/autofill/payments/virtual_card_selection_dialog_browsertest.cc index b4cb37fb8..6e4611b3 100644 --- a/chrome/browser/ui/views/autofill/payments/virtual_card_selection_dialog_browsertest.cc +++ b/chrome/browser/ui/views/autofill/payments/virtual_card_selection_dialog_browsertest.cc
@@ -25,6 +25,11 @@ public: VirtualCardSelectionDialogBrowserTest() = default; + VirtualCardSelectionDialogBrowserTest( + const VirtualCardSelectionDialogBrowserTest&) = delete; + VirtualCardSelectionDialogBrowserTest& operator=( + const VirtualCardSelectionDialogBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { content::WebContents* web_contents = @@ -62,9 +67,6 @@ return VirtualCardSelectionDialogControllerImpl::FromWebContents( browser()->tab_strip_model()->GetActiveWebContents()); } - - private: - DISALLOW_COPY_AND_ASSIGN(VirtualCardSelectionDialogBrowserTest); }; IN_PROC_BROWSER_TEST_F(VirtualCardSelectionDialogBrowserTest,
diff --git a/chrome/browser/ui/views/autofill/payments/webauthn_dialog_browsertest.cc b/chrome/browser/ui/views/autofill/payments/webauthn_dialog_browsertest.cc index 3edc67d..2a0ba76 100644 --- a/chrome/browser/ui/views/autofill/payments/webauthn_dialog_browsertest.cc +++ b/chrome/browser/ui/views/autofill/payments/webauthn_dialog_browsertest.cc
@@ -25,6 +25,10 @@ public: WebauthnDialogBrowserTest() = default; + WebauthnDialogBrowserTest(const WebauthnDialogBrowserTest&) = delete; + WebauthnDialogBrowserTest& operator=(const WebauthnDialogBrowserTest&) = + delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { content::WebContents* web_contents = @@ -59,9 +63,6 @@ return WebauthnDialogControllerImpl::FromWebContents( browser()->tab_strip_model()->GetActiveWebContents()); } - - private: - DISALLOW_COPY_AND_ASSIGN(WebauthnDialogBrowserTest); }; IN_PROC_BROWSER_TEST_F(WebauthnDialogBrowserTest, InvokeUi_Offer) {
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc index 8e92cbf..2c9695d 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -747,6 +747,11 @@ base::Unretained(this))); } + BookmarkContextMenuNotificationObserver( + const BookmarkContextMenuNotificationObserver&) = delete; + BookmarkContextMenuNotificationObserver& operator=( + const BookmarkContextMenuNotificationObserver&) = delete; + void ScheduleCallback() { DCHECK(!task_.is_null()); base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, std::move(task_)); @@ -754,8 +759,6 @@ private: base::OnceClosure task_; - - DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenuNotificationObserver); }; // Tests context menus by way of opening a context menu for a bookmark,
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_sign_in_delegate_browsertest.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_sign_in_delegate_browsertest.cc index 26055cbc..93d2b9e 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_sign_in_delegate_browsertest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_sign_in_delegate_browsertest.cc
@@ -40,14 +40,16 @@ public: BookmarkBubbleSignInDelegateTest() {} + BookmarkBubbleSignInDelegateTest(const BookmarkBubbleSignInDelegateTest&) = + delete; + BookmarkBubbleSignInDelegateTest& operator=( + const BookmarkBubbleSignInDelegateTest&) = delete; + Profile* profile() { return browser()->profile(); } void ReplaceBlank(Browser* browser); void SignInBrowser(Browser* browser); - - private: - DISALLOW_COPY_AND_ASSIGN(BookmarkBubbleSignInDelegateTest); }; // The default browser created for tests start with one tab open on
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h index c87ba78..c0a1993 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
@@ -27,6 +27,9 @@ // it is created with. The dialog is created using the static ShowBubble method. class BookmarkBubbleView { public: + BookmarkBubbleView(const BookmarkBubbleView&) = delete; + BookmarkBubbleView& operator=(const BookmarkBubbleView&) = delete; + static void ShowBubble(views::View* anchor_view, views::Button* highlighted_button, bookmarks::BookmarkBubbleObserver* observer, @@ -45,8 +48,6 @@ class BookmarkBubbleDelegate; // The bookmark bubble, if we're showing one. static views::BubbleDialogDelegate* bookmark_bubble_; - - DISALLOW_COPY_AND_ASSIGN(BookmarkBubbleView); }; #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BUBBLE_VIEW_H_
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view_browsertest.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view_browsertest.cc index e7018d1..c5ef471 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view_browsertest.cc
@@ -25,6 +25,10 @@ public: BookmarkBubbleViewBrowserTest() {} + BookmarkBubbleViewBrowserTest(const BookmarkBubbleViewBrowserTest&) = delete; + BookmarkBubbleViewBrowserTest& operator=( + const BookmarkBubbleViewBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { #if !defined(OS_CHROMEOS) @@ -50,9 +54,6 @@ if (name == "ios_promotion") BookmarkBubbleView::bookmark_bubble()->AcceptDialog(); } - - private: - DISALLOW_COPY_AND_ASSIGN(BookmarkBubbleViewBrowserTest); }; // ChromeOS is always signed in.
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view_unittest.cc index 234ddad..0e6a202 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view_unittest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view_unittest.cc
@@ -40,6 +40,9 @@ : BrowserWithTestWindowTest( content::BrowserTaskEnvironment::REAL_IO_THREAD) {} + BookmarkBubbleViewTest(const BookmarkBubbleViewTest&) = delete; + BookmarkBubbleViewTest& operator=(const BookmarkBubbleViewTest&) = delete; + // testing::Test: void SetUp() override { BrowserWithTestWindowTest::SetUp(); @@ -86,8 +89,6 @@ private: views::UniqueWidgetPtr anchor_widget_; - - DISALLOW_COPY_AND_ASSIGN(BookmarkBubbleViewTest); }; // Verifies that the sync promo is not displayed for a signed in user.
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_drag_drop_views.cc b/chrome/browser/ui/views/bookmarks/bookmark_drag_drop_views.cc index 716df4b..06ed900 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_drag_drop_views.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_drag_drop_views.cc
@@ -162,6 +162,9 @@ // Owns itself. class BookmarkDragHelper : public bookmarks::BaseBookmarkModelObserver { public: + BookmarkDragHelper(const BookmarkDragHelper&) = delete; + BookmarkDragHelper& operator=(const BookmarkDragHelper&) = delete; + static base::WeakPtr<BookmarkDragHelper> Create( Profile* profile, const BookmarkDragParams& params, @@ -288,8 +291,6 @@ observation_{this}; base::WeakPtrFactory<BookmarkDragHelper> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(BookmarkDragHelper); }; void DoDragImpl(std::unique_ptr<ui::OSExchangeData> drag_data,
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h index a0963e6..42d6b13 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h
@@ -65,11 +65,11 @@ explicit EditorTreeModel(std::unique_ptr<EditorNode> root) : ui::TreeNodeModel<EditorNode>(std::move(root)) {} + EditorTreeModel(const EditorTreeModel&) = delete; + EditorTreeModel& operator=(const EditorTreeModel&) = delete; + void SetTitle(ui::TreeModelNode* node, const std::u16string& title) override; - - private: - DISALLOW_COPY_AND_ASSIGN(EditorTreeModel); }; BookmarkEditorView(Profile* profile,
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view_browsertest.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view_browsertest.cc index 39cdb3f..b227266 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view_browsertest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view_browsertest.cc
@@ -13,14 +13,15 @@ public: BookmarkEditorViewBrowserTest() {} + BookmarkEditorViewBrowserTest(const BookmarkEditorViewBrowserTest&) = delete; + BookmarkEditorViewBrowserTest& operator=( + const BookmarkEditorViewBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { DCHECK_EQ("all_tabs", name); chrome::ShowBookmarkAllTabsDialog(browser()); } - - private: - DISALLOW_COPY_AND_ASSIGN(BookmarkEditorViewBrowserTest); }; // Shows the dialog for bookmarking all tabs. This shows a BookmarkEditorView
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h index 51c7ece..20bbc018 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h +++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h
@@ -55,6 +55,9 @@ size_t start_child_index, bool for_drop); + BookmarkMenuController(const BookmarkMenuController&) = delete; + BookmarkMenuController& operator=(const BookmarkMenuController&) = delete; + void RunMenuAt(BookmarkBarView* bookmark_bar); void clear_bookmark_bar() { bookmark_bar_ = nullptr; } @@ -144,8 +147,6 @@ // folder on the bookmark bar and not for drop, or if the BookmarkBarView has // been destroyed before the menu. BookmarkBarView* bookmark_bar_; - - DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); }; #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate_unittest.cc index 8a1ccab..347b8f8 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate_unittest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate_unittest.cc
@@ -35,6 +35,9 @@ public: BookmarkMenuDelegateTest() : model_(nullptr) {} + BookmarkMenuDelegateTest(const BookmarkMenuDelegateTest&) = delete; + BookmarkMenuDelegateTest& operator=(const BookmarkMenuDelegateTest&) = delete; + void SetUp() override { BrowserWithTestWindowTest::SetUp(); @@ -150,8 +153,6 @@ } views::MenuDelegate test_delegate_; - - DISALLOW_COPY_AND_ASSIGN(BookmarkMenuDelegateTest); }; TEST_F(BookmarkMenuDelegateTest, VerifyLazyLoad) {
diff --git a/chrome/browser/ui/views/certificate_selector.cc b/chrome/browser/ui/views/certificate_selector.cc index f7a9164..8bec2741 100644 --- a/chrome/browser/ui/views/certificate_selector.cc +++ b/chrome/browser/ui/views/certificate_selector.cc
@@ -51,6 +51,9 @@ CertificateTableModel(const net::ClientCertIdentityList& identities, const std::vector<std::string>& provider_names); + CertificateTableModel(const CertificateTableModel&) = delete; + CertificateTableModel& operator=(const CertificateTableModel&) = delete; + // ui::TableModel: int RowCount() override; std::u16string GetText(int index, int column_id) override; @@ -64,8 +67,6 @@ std::u16string serial; }; std::vector<Row> rows_; - - DISALLOW_COPY_AND_ASSIGN(CertificateTableModel); }; CertificateSelector::CertificateTableModel::CertificateTableModel(
diff --git a/chrome/browser/ui/views/certificate_selector_dialog_browsertest.cc b/chrome/browser/ui/views/certificate_selector_dialog_browsertest.cc index 365d2557..7f45ce7 100644 --- a/chrome/browser/ui/views/certificate_selector_dialog_browsertest.cc +++ b/chrome/browser/ui/views/certificate_selector_dialog_browsertest.cc
@@ -34,18 +34,22 @@ InitWithText(std::move(label)); } + TestCertificateSelector(const TestCertificateSelector&) = delete; + TestCertificateSelector& operator=(const TestCertificateSelector&) = delete; + // chrome::CertificateSelector: void AcceptCertificate( std::unique_ptr<net::ClientCertIdentity> identity) override {} - - private: - DISALLOW_COPY_AND_ASSIGN(TestCertificateSelector); }; class CertificateSelectorDialogTest : public DialogBrowserTest { public: CertificateSelectorDialogTest() {} + CertificateSelectorDialogTest(const CertificateSelectorDialogTest&) = delete; + CertificateSelectorDialogTest& operator=( + const CertificateSelectorDialogTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { cert_1_ = @@ -63,8 +67,6 @@ private: scoped_refptr<net::X509Certificate> cert_1_; scoped_refptr<net::X509Certificate> cert_2_; - - DISALLOW_COPY_AND_ASSIGN(CertificateSelectorDialogTest); }; // Invokes a dialog that allows the user select a certificate.
diff --git a/chrome/browser/ui/views/certificate_viewer_win.cc b/chrome/browser/ui/views/certificate_viewer_win.cc index 1e5fbcc3..f8390624 100644 --- a/chrome/browser/ui/views/certificate_viewer_win.cc +++ b/chrome/browser/ui/views/certificate_viewer_win.cc
@@ -30,6 +30,9 @@ public: CertificateViewerDialog() {} + CertificateViewerDialog(const CertificateViewerDialog&) = delete; + CertificateViewerDialog& operator=(const CertificateViewerDialog&) = delete; + // Shows the dialog and calls |callback| when the dialog closes. The caller // must ensure the CertificateViewerDialog remains valid until then. void Show(HWND parent, @@ -86,8 +89,6 @@ // May delete |this|. std::move(callback).Run(); } - - DISALLOW_COPY_AND_ASSIGN(CertificateViewerDialog); }; } // namespace
diff --git a/chrome/browser/ui/views/chrome_cleaner_dialog_browsertest_win.cc b/chrome/browser/ui/views/chrome_cleaner_dialog_browsertest_win.cc index 6ac59be..3ef1332 100644 --- a/chrome/browser/ui/views/chrome_cleaner_dialog_browsertest_win.cc +++ b/chrome/browser/ui/views/chrome_cleaner_dialog_browsertest_win.cc
@@ -51,6 +51,9 @@ Return(safe_browsing::ChromeCleanerController::State::kInfected)); } + ChromeCleanerDialogTest(const ChromeCleanerDialogTest&) = delete; + ChromeCleanerDialogTest& operator=(const ChromeCleanerDialogTest&) = delete; + void ShowUi(const std::string& name) override { chrome::ShowChromeCleanerPrompt(browser(), mock_dialog_controller_.get(), mock_cleaner_controller_.get()); @@ -63,9 +66,6 @@ mock_dialog_controller_; std::unique_ptr<NiceMock<safe_browsing::MockChromeCleanerController>> mock_cleaner_controller_; - - private: - DISALLOW_COPY_AND_ASSIGN(ChromeCleanerDialogTest); }; IN_PROC_BROWSER_TEST_F(ChromeCleanerDialogTest, InvokeUi_default) {
diff --git a/chrome/browser/ui/views/chrome_typography_provider.cc b/chrome/browser/ui/views/chrome_typography_provider.cc index b1e1be3..1e07f94 100644 --- a/chrome/browser/ui/views/chrome_typography_provider.cc +++ b/chrome/browser/ui/views/chrome_typography_provider.cc
@@ -9,10 +9,11 @@ #include "chrome/browser/ui/views/chrome_typography.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/theme_provider.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/platform_font.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/style/typography.h" #include "ui/views/view.h" @@ -151,18 +152,18 @@ style = views::style::STYLE_SECONDARY; } - ui::NativeTheme::ColorId color_id; + ui::ColorId color_id; switch (style) { case STYLE_RED: - color_id = ui::NativeTheme::kColorId_AlertSeverityHigh; + color_id = ui::kColorAlertHighSeverity; break; case STYLE_GREEN: - color_id = ui::NativeTheme::kColorId_AlertSeverityLow; + color_id = ui::kColorAlertLowSeverity; break; default: return TypographyProvider::GetColor(view, context, style); } - return view.GetNativeTheme()->GetSystemColor(color_id); + return view.GetColorProvider()->GetColor(color_id); } int ChromeTypographyProvider::GetLineHeight(int context, int style) const {
diff --git a/chrome/browser/ui/views/chrome_typography_provider.h b/chrome/browser/ui/views/chrome_typography_provider.h index 18bde70..46e8a6b 100644 --- a/chrome/browser/ui/views/chrome_typography_provider.h +++ b/chrome/browser/ui/views/chrome_typography_provider.h
@@ -14,6 +14,9 @@ public: ChromeTypographyProvider() = default; + ChromeTypographyProvider(const ChromeTypographyProvider&) = delete; + ChromeTypographyProvider& operator=(const ChromeTypographyProvider&) = delete; + // TypographyProvider: ui::ResourceBundle::FontDetails GetFontDetails(int context, int style) const override; @@ -21,9 +24,6 @@ int context, int style) const override; int GetLineHeight(int context, int style) const override; - - private: - DISALLOW_COPY_AND_ASSIGN(ChromeTypographyProvider); }; #endif // CHROME_BROWSER_UI_VIEWS_CHROME_TYPOGRAPHY_PROVIDER_H_
diff --git a/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc b/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc index 662dd67..495339c 100644 --- a/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc +++ b/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc
@@ -39,8 +39,9 @@ explicit InitiatorWebContentsObserver(content::WebContents* web_contents) : content::WebContentsObserver(web_contents) {} - private: - DISALLOW_COPY_AND_ASSIGN(InitiatorWebContentsObserver); + InitiatorWebContentsObserver(const InitiatorWebContentsObserver&) = delete; + InitiatorWebContentsObserver& operator=(const InitiatorWebContentsObserver&) = + delete; }; gfx::Size RestrictToPlatformMinimumSize(const gfx::Size& min_size) {
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc index d4ce399..95553492 100644 --- a/chrome/browser/ui/views/content_setting_bubble_contents.cc +++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc
@@ -31,12 +31,12 @@ #include "ui/base/models/image_model.h" #include "ui/base/resource/resource_bundle.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/vector_icon_types.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/border.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/button/image_button_factory.h" @@ -586,8 +586,7 @@ void ContentSettingBubbleContents::StyleLearnMoreButton() { DCHECK(learn_more_button_); - SkColor text_color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_LabelEnabledColor); + SkColor text_color = GetColorProvider()->GetColor(ui::kColorLabelForeground); views::SetImageFromVectorIcon(learn_more_button_, vector_icons::kHelpOutlineIcon, text_color); }
diff --git a/chrome/browser/ui/views/cookie_info_view.cc b/chrome/browser/ui/views/cookie_info_view.cc index 79e81788..13d9b19 100644 --- a/chrome/browser/ui/views/cookie_info_view.cc +++ b/chrome/browser/ui/views/cookie_info_view.cc
@@ -20,8 +20,9 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/canvas.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" @@ -166,12 +167,12 @@ } void CookieInfoView::SetTextfieldColors() { - auto* theme = GetNativeTheme(); + const auto* color_provider = GetColorProvider(); for (const auto textfield_pair : property_textfields_) { textfield_pair.second->SetBackgroundColor( - theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground)); + color_provider->GetColor(ui::kColorDialogBackground)); textfield_pair.second->SetTextColor( - theme->GetSystemColor(ui::NativeTheme::kColorId_DialogForeground)); + color_provider->GetColor(ui::kColorDialogForeground)); } }
diff --git a/chrome/browser/ui/views/crostini/crostini_ansible_software_config_view.h b/chrome/browser/ui/views/crostini/crostini_ansible_software_config_view.h index 073f9132..afbd0c8 100644 --- a/chrome/browser/ui/views/crostini/crostini_ansible_software_config_view.h +++ b/chrome/browser/ui/views/crostini/crostini_ansible_software_config_view.h
@@ -21,6 +21,11 @@ : public views::BubbleDialogDelegateView, public crostini::AnsibleManagementService::Observer { public: + CrostiniAnsibleSoftwareConfigView(const CrostiniAnsibleSoftwareConfigView&) = + delete; + CrostiniAnsibleSoftwareConfigView& operator=( + const CrostiniAnsibleSoftwareConfigView&) = delete; + METADATA_HEADER(CrostiniAnsibleSoftwareConfigView); // views::DialogDelegateView: @@ -55,8 +60,6 @@ views::ProgressBar* progress_bar_ = nullptr; ~CrostiniAnsibleSoftwareConfigView() override; - - DISALLOW_COPY_AND_ASSIGN(CrostiniAnsibleSoftwareConfigView); }; #endif // CHROME_BROWSER_UI_VIEWS_CROSTINI_CROSTINI_ANSIBLE_SOFTWARE_CONFIG_VIEW_H_
diff --git a/chrome/browser/ui/views/crostini/crostini_dialogue_browser_test_util.h b/chrome/browser/ui/views/crostini/crostini_dialogue_browser_test_util.h index 8215326..f1e160cf 100644 --- a/chrome/browser/ui/views/crostini/crostini_dialogue_browser_test_util.h +++ b/chrome/browser/ui/views/crostini/crostini_dialogue_browser_test_util.h
@@ -20,10 +20,11 @@ explicit CrostiniDialogBrowserTest(bool register_termina) : SupportsTestDialog<CrostiniBrowserTestBase>(register_termina) {} - void WaitForLoadFinished(content::WebContents* contents); + CrostiniDialogBrowserTest(const CrostiniDialogBrowserTest&) = delete; + CrostiniDialogBrowserTest& operator=(const CrostiniDialogBrowserTest&) = + delete; - private: - DISALLOW_COPY_AND_ASSIGN(CrostiniDialogBrowserTest); + void WaitForLoadFinished(content::WebContents* contents); }; #endif // CHROME_BROWSER_UI_VIEWS_CROSTINI_CROSTINI_DIALOGUE_BROWSER_TEST_UTIL_H_
diff --git a/chrome/browser/ui/views/crostini/crostini_force_close_view.h b/chrome/browser/ui/views/crostini/crostini_force_close_view.h index 67853547..a08a7b8 100644 --- a/chrome/browser/ui/views/crostini/crostini_force_close_view.h +++ b/chrome/browser/ui/views/crostini/crostini_force_close_view.h
@@ -24,6 +24,9 @@ public: METADATA_HEADER(CrostiniForceCloseView); + CrostiniForceCloseView(const CrostiniForceCloseView&) = delete; + CrostiniForceCloseView& operator=(const CrostiniForceCloseView&) = delete; + // Show the "would you like to force-close |app_name|?" dialog, which invokes // the |force_close_callback_| if the user chooses to force close. Returns the // widget for the force-close dialog. The |closable_widget| will be used as @@ -44,8 +47,6 @@ base::OnceClosure force_close_callback); ~CrostiniForceCloseView() override; - - DISALLOW_COPY_AND_ASSIGN(CrostiniForceCloseView); }; #endif // CHROME_BROWSER_UI_VIEWS_CROSTINI_CROSTINI_FORCE_CLOSE_VIEW_H_
diff --git a/chrome/browser/ui/views/crostini/crostini_force_close_view_browsertest.cc b/chrome/browser/ui/views/crostini/crostini_force_close_view_browsertest.cc index f954f832..53f73bb 100644 --- a/chrome/browser/ui/views/crostini/crostini_force_close_view_browsertest.cc +++ b/chrome/browser/ui/views/crostini/crostini_force_close_view_browsertest.cc
@@ -24,6 +24,10 @@ public: CrostiniForceCloseViewTest() : weak_ptr_factory_(this) {} + CrostiniForceCloseViewTest(const CrostiniForceCloseViewTest&) = delete; + CrostiniForceCloseViewTest& operator=(const CrostiniForceCloseViewTest&) = + delete; + void ShowUi(const std::string& name) override { wm_helper_ = std::make_unique<exo::WMHelperChromeOS>(); closable_surface_ = @@ -59,8 +63,6 @@ int force_close_invocations_ = 0; base::WeakPtrFactory<CrostiniForceCloseViewTest> weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(CrostiniForceCloseViewTest); }; IN_PROC_BROWSER_TEST_F(CrostiniForceCloseViewTest, FocusesForceQuit) {
diff --git a/chrome/browser/ui/views/crostini/crostini_package_install_failure_view_browsertest.cc b/chrome/browser/ui/views/crostini/crostini_package_install_failure_view_browsertest.cc index 06a5b90..91b0283 100644 --- a/chrome/browser/ui/views/crostini/crostini_package_install_failure_view_browsertest.cc +++ b/chrome/browser/ui/views/crostini/crostini_package_install_failure_view_browsertest.cc
@@ -15,12 +15,14 @@ public: CrostiniPackageInstallFailureViewTest() {} + CrostiniPackageInstallFailureViewTest( + const CrostiniPackageInstallFailureViewTest&) = delete; + CrostiniPackageInstallFailureViewTest& operator=( + const CrostiniPackageInstallFailureViewTest&) = delete; + void ShowUi(const std::string& name) override { CrostiniPackageInstallFailureView::Show("Generic Error Message"); } - - private: - DISALLOW_COPY_AND_ASSIGN(CrostiniPackageInstallFailureViewTest); }; IN_PROC_BROWSER_TEST_F(CrostiniPackageInstallFailureViewTest,
diff --git a/chrome/browser/ui/views/crostini/crostini_recovery_view_browsertest.cc b/chrome/browser/ui/views/crostini/crostini_recovery_view_browsertest.cc index 07976fb5..ab1df2a 100644 --- a/chrome/browser/ui/views/crostini/crostini_recovery_view_browsertest.cc +++ b/chrome/browser/ui/views/crostini/crostini_recovery_view_browsertest.cc
@@ -46,6 +46,11 @@ : CrostiniDialogBrowserTest(true /*register_termina*/), app_id_(crostini::CrostiniTestHelper::GenerateAppId(kDesktopFileId)) {} + CrostiniRecoveryViewBrowserTest(const CrostiniRecoveryViewBrowserTest&) = + delete; + CrostiniRecoveryViewBrowserTest& operator=( + const CrostiniRecoveryViewBrowserTest&) = delete; + void SetUpOnMainThread() override { CrostiniDialogBrowserTest::SetUpOnMainThread(); } @@ -109,8 +114,6 @@ private: std::string app_id_; - - DISALLOW_COPY_AND_ASSIGN(CrostiniRecoveryViewBrowserTest); }; // Test the dialog is actually launched.
diff --git a/chrome/browser/ui/views/crostini/crostini_uninstaller_view_browsertest.cc b/chrome/browser/ui/views/crostini/crostini_uninstaller_view_browsertest.cc index 88e6210..28b8681 100644 --- a/chrome/browser/ui/views/crostini/crostini_uninstaller_view_browsertest.cc +++ b/chrome/browser/ui/views/crostini/crostini_uninstaller_view_browsertest.cc
@@ -64,6 +64,11 @@ waiting_fake_concierge_client_ = new WaitingFakeConciergeClient(nullptr); } + CrostiniUninstallerViewBrowserTest( + const CrostiniUninstallerViewBrowserTest&) = delete; + CrostiniUninstallerViewBrowserTest& operator=( + const CrostiniUninstallerViewBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { ShowCrostiniUninstallerView(browser()->profile(), @@ -87,9 +92,6 @@ protected: WaitingFakeConciergeClient* waiting_fake_concierge_client_; - - private: - DISALLOW_COPY_AND_ASSIGN(CrostiniUninstallerViewBrowserTest); }; class CrostiniUninstalledUninstallerViewBrowserTest @@ -98,8 +100,10 @@ CrostiniUninstalledUninstallerViewBrowserTest() : CrostiniUninstallerViewBrowserTest(false /*register_termina*/) {} - private: - DISALLOW_COPY_AND_ASSIGN(CrostiniUninstalledUninstallerViewBrowserTest); + CrostiniUninstalledUninstallerViewBrowserTest( + const CrostiniUninstalledUninstallerViewBrowserTest&) = delete; + CrostiniUninstalledUninstallerViewBrowserTest& operator=( + const CrostiniUninstalledUninstallerViewBrowserTest&) = delete; }; // Test the dialog is actually launched from the app launcher.
diff --git a/chrome/browser/ui/views/crostini/crostini_update_filesystem_view_browsertest.cc b/chrome/browser/ui/views/crostini/crostini_update_filesystem_view_browsertest.cc index 03fc411..7e05754 100644 --- a/chrome/browser/ui/views/crostini/crostini_update_filesystem_view_browsertest.cc +++ b/chrome/browser/ui/views/crostini/crostini_update_filesystem_view_browsertest.cc
@@ -30,6 +30,11 @@ CrostiniUpdateFilesystemViewBrowserTest() : CrostiniDialogBrowserTest(true /*register_termina*/) {} + CrostiniUpdateFilesystemViewBrowserTest( + const CrostiniUpdateFilesystemViewBrowserTest&) = delete; + CrostiniUpdateFilesystemViewBrowserTest& operator=( + const CrostiniUpdateFilesystemViewBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { PrepareShowCrostiniUpdateFilesystemView( @@ -63,9 +68,6 @@ const crostini::ContainerId kContainerId = crostini::ContainerId("vm_name", "container_name"); - - private: - DISALLOW_COPY_AND_ASSIGN(CrostiniUpdateFilesystemViewBrowserTest); }; // Test the dialog is actually launched.
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_browsertest.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_browsertest.cc index 98d6a18..55d01b06 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_browsertest.cc +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_browsertest.cc
@@ -29,6 +29,11 @@ public: DesktopMediaPickerViewsBrowserTest() {} + DesktopMediaPickerViewsBrowserTest( + const DesktopMediaPickerViewsBrowserTest&) = delete; + DesktopMediaPickerViewsBrowserTest& operator=( + const DesktopMediaPickerViewsBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { picker_ = std::make_unique<DesktopMediaPickerViews>(); @@ -84,8 +89,6 @@ // tests to update the UI state after showing it. base::OnceCallback<void(const std::vector<FakeDesktopMediaList*>&)> after_show_callback_; - - DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerViewsBrowserTest); }; // Invokes a dialog that allows the user to select what view of their desktop
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.cc index ec4b496..2d1801a 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.cc +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.cc
@@ -10,8 +10,9 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/canvas.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/background.h" #include "ui/views/controls/focus_ring.h" #include "ui/views/controls/image_view.h" @@ -88,9 +89,8 @@ } } - image_view_->SetBackground( - views::CreateSolidBackground(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor))); + image_view_->SetBackground(views::CreateSolidBackground( + GetColorProvider()->GetColor(ui::kColorMenuItemBackgroundSelected))); label_->SetFontList(label_->font_list().Derive(0, gfx::Font::NORMAL, gfx::Font::Weight::BOLD)); parent_->OnSelectionChanged();
diff --git a/chrome/browser/ui/views/device_chooser_browsertest.cc b/chrome/browser/ui/views/device_chooser_browsertest.cc index b48cc23..cddce71 100644 --- a/chrome/browser/ui/views/device_chooser_browsertest.cc +++ b/chrome/browser/ui/views/device_chooser_browsertest.cc
@@ -52,6 +52,9 @@ public: UsbChooserBrowserTest() {} + UsbChooserBrowserTest(const UsbChooserBrowserTest&) = delete; + UsbChooserBrowserTest& operator=(const UsbChooserBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { ShowChooser(name, browser(), @@ -61,9 +64,6 @@ protected: // Number of devices to show in the chooser. int device_count_ = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(UsbChooserBrowserTest); }; IN_PROC_BROWSER_TEST_F(UsbChooserBrowserTest, InvokeUi_NoDevicesBubble) { @@ -92,6 +92,10 @@ : status_(permissions::FakeBluetoothChooserController::BluetoothStatus:: UNAVAILABLE) {} + BluetoothChooserBrowserTest(const BluetoothChooserBrowserTest&) = delete; + BluetoothChooserBrowserTest& operator=(const BluetoothChooserBrowserTest&) = + delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { auto controller = @@ -154,8 +158,6 @@ private: permissions::FakeBluetoothChooserController::BluetoothStatus status_; std::vector<permissions::FakeBluetoothChooserController::FakeDevice> devices_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothChooserBrowserTest); }; IN_PROC_BROWSER_TEST_F(BluetoothChooserBrowserTest,
diff --git a/chrome/browser/ui/views/device_chooser_content_view_unittest.cc b/chrome/browser/ui/views/device_chooser_content_view_unittest.cc index bffedf5..f14b0a6 100644 --- a/chrome/browser/ui/views/device_chooser_content_view_unittest.cc +++ b/chrome/browser/ui/views/device_chooser_content_view_unittest.cc
@@ -41,6 +41,10 @@ public: DeviceChooserContentViewTest() {} + DeviceChooserContentViewTest(const DeviceChooserContentViewTest&) = delete; + DeviceChooserContentViewTest& operator=(const DeviceChooserContentViewTest&) = + delete; + void SetUp() override { ChromeViewsTestBase::SetUp(); table_observer_ = std::make_unique<MockTableViewObserver>(); @@ -146,8 +150,6 @@ FakeBluetoothChooserController* controller_ = nullptr; DeviceChooserContentView* content_view_ = nullptr; std::unique_ptr<views::Widget> widget_; - - DISALLOW_COPY_AND_ASSIGN(DeviceChooserContentViewTest); }; TEST_F(DeviceChooserContentViewTest, InitialState) {
diff --git a/chrome/browser/ui/views/download/download_in_progress_dialog_view.h b/chrome/browser/ui/views/download/download_in_progress_dialog_view.h index e87e5aa..3e43ce93 100644 --- a/chrome/browser/ui/views/download/download_in_progress_dialog_view.h +++ b/chrome/browser/ui/views/download/download_in_progress_dialog_view.h
@@ -16,6 +16,10 @@ public: METADATA_HEADER(DownloadInProgressDialogView); + DownloadInProgressDialogView(const DownloadInProgressDialogView&) = delete; + DownloadInProgressDialogView& operator=(const DownloadInProgressDialogView&) = + delete; + // |dialog_type| should be either DOWNLOAD_CLOSE_BROWSER_SHUTDOWN to indicate // the user is closing the browser or // DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE to indicate the user is @@ -33,8 +37,6 @@ ~DownloadInProgressDialogView() override; base::OnceCallback<void(bool)> callback_; - - DISALLOW_COPY_AND_ASSIGN(DownloadInProgressDialogView); }; #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_IN_PROGRESS_DIALOG_VIEW_H_
diff --git a/chrome/browser/ui/views/exclusive_access_bubble_views_interactive_uitest.cc b/chrome/browser/ui/views/exclusive_access_bubble_views_interactive_uitest.cc index 55d01fb..cf28e24 100644 --- a/chrome/browser/ui/views/exclusive_access_bubble_views_interactive_uitest.cc +++ b/chrome/browser/ui/views/exclusive_access_bubble_views_interactive_uitest.cc
@@ -15,6 +15,11 @@ public: ExclusiveAccessBubbleViewsTest() {} + ExclusiveAccessBubbleViewsTest(const ExclusiveAccessBubbleViewsTest&) = + delete; + ExclusiveAccessBubbleViewsTest& operator=( + const ExclusiveAccessBubbleViewsTest&) = delete; + ExclusiveAccessBubbleViews* bubble() { BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser()); @@ -31,9 +36,6 @@ protected: bool was_destroying_ = false; bool was_observing_in_destroying_ = false; - - private: - DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessBubbleViewsTest); }; // Simulate obscure codepaths resulting in the bubble Widget being closed before
diff --git a/chrome/browser/ui/views/extensions/browser_action_drag_data.h b/chrome/browser/ui/views/extensions/browser_action_drag_data.h index 1bf6ad2..6efd815 100644 --- a/chrome/browser/ui/views/extensions/browser_action_drag_data.h +++ b/chrome/browser/ui/views/extensions/browser_action_drag_data.h
@@ -23,6 +23,9 @@ BrowserActionDragData(); BrowserActionDragData(const std::string& id, int index); + BrowserActionDragData(const BrowserActionDragData&) = delete; + BrowserActionDragData& operator=(const BrowserActionDragData&) = delete; + // These mirror the views::View and views::MenuDelegate methods for dropping, // and return the appropriate results for being able to drop an extension's // BrowserAction view. @@ -58,8 +61,6 @@ // The index of the view being dragged. size_t index_; - - DISALLOW_COPY_AND_ASSIGN(BrowserActionDragData); }; #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_BROWSER_ACTION_DRAG_DATA_H_
diff --git a/chrome/browser/ui/views/extensions/chooser_dialog_view_unittest.cc b/chrome/browser/ui/views/extensions/chooser_dialog_view_unittest.cc index 8d806ed..efe4a04 100644 --- a/chrome/browser/ui/views/extensions/chooser_dialog_view_unittest.cc +++ b/chrome/browser/ui/views/extensions/chooser_dialog_view_unittest.cc
@@ -22,6 +22,9 @@ public: ChooserDialogViewTest() {} + ChooserDialogViewTest(const ChooserDialogViewTest&) = delete; + ChooserDialogViewTest& operator=(const ChooserDialogViewTest&) = delete; + void SetUp() override { ChromeViewsTestBase::SetUp(); @@ -84,8 +87,6 @@ private: std::unique_ptr<views::Widget> parent_widget_; views::Widget* widget_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(ChooserDialogViewTest); }; TEST_F(ChooserDialogViewTest, ButtonState) {
diff --git a/chrome/browser/ui/views/extensions/extension_dialog.h b/chrome/browser/ui/views/extensions/extension_dialog.h index a8ac874..bb838c0 100644 --- a/chrome/browser/ui/views/extensions/extension_dialog.h +++ b/chrome/browser/ui/views/extensions/extension_dialog.h
@@ -69,6 +69,10 @@ absl::optional<SkColor> title_inactive_color; #endif }; + + ExtensionDialog(const ExtensionDialog&) = delete; + ExtensionDialog& operator=(const ExtensionDialog&) = delete; + // Create and show a dialog with |url| centered over the provided window. // |parent_window| is the parent window to which the pop-up will be attached. // |profile| is the profile that the extension is registered with. @@ -134,8 +138,6 @@ // The observer of this popup. ExtensionDialogObserver* observer_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionDialog); }; #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_DIALOG_H_
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc index d114615b..116a5cea 100644 --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc
@@ -70,6 +70,12 @@ class ExtensionInstallDialogViewTestBase : public extensions::ExtensionBrowserTest { + public: + ExtensionInstallDialogViewTestBase( + const ExtensionInstallDialogViewTestBase&) = delete; + ExtensionInstallDialogViewTestBase& operator=( + const ExtensionInstallDialogViewTestBase&) = delete; + protected: ExtensionInstallDialogViewTestBase(); @@ -87,8 +93,6 @@ private: const extensions::Extension* extension_; content::WebContents* web_contents_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionInstallDialogViewTestBase); }; ExtensionInstallDialogViewTestBase::ExtensionInstallDialogViewTestBase() @@ -125,14 +129,15 @@ } class ScrollbarTest : public ExtensionInstallDialogViewTestBase { + public: + ScrollbarTest(const ScrollbarTest&) = delete; + ScrollbarTest& operator=(const ScrollbarTest&) = delete; + protected: ScrollbarTest() {} bool IsScrollbarVisible( std::unique_ptr<ExtensionInstallPrompt::Prompt> prompt); - - private: - DISALLOW_COPY_AND_ASSIGN(ScrollbarTest); }; bool ScrollbarTest::IsScrollbarVisible( @@ -362,6 +367,11 @@ extensions_features::kAllowWithholdingExtensionPermissionsOnInstall); } + ExtensionInstallDialogViewInteractiveBrowserTest( + const ExtensionInstallDialogViewInteractiveBrowserTest&) = delete; + ExtensionInstallDialogViewInteractiveBrowserTest& operator=( + const ExtensionInstallDialogViewInteractiveBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { extensions::ChromeTestExtensionLoader loader(browser()->profile()); @@ -438,8 +448,6 @@ std::vector<std::u16string> retained_devices_; base::test::ScopedFeatureList feature_list_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionInstallDialogViewInteractiveBrowserTest); }; IN_PROC_BROWSER_TEST_F(ExtensionInstallDialogViewInteractiveBrowserTest, @@ -654,12 +662,14 @@ public: ExtensionInstallDialogRatingsSectionTest() {} + ExtensionInstallDialogRatingsSectionTest( + const ExtensionInstallDialogRatingsSectionTest&) = delete; + ExtensionInstallDialogRatingsSectionTest& operator=( + const ExtensionInstallDialogRatingsSectionTest&) = delete; + void TestRatingsSectionA11y(int num_ratings, double average_rating, const std::string& expected_text); - - private: - DISALLOW_COPY_AND_ASSIGN(ExtensionInstallDialogRatingsSectionTest); }; void ExtensionInstallDialogRatingsSectionTest::TestRatingsSectionA11y( @@ -717,9 +727,13 @@ extensions_features::kAllowWithholdingExtensionPermissionsOnInstall); } + ExtensionInstallDialogWithWithholdPermissionsUI( + const ExtensionInstallDialogWithWithholdPermissionsUI&) = delete; + ExtensionInstallDialogWithWithholdPermissionsUI& operator=( + const ExtensionInstallDialogWithWithholdPermissionsUI&) = delete; + private: base::test::ScopedFeatureList scoped_feature_list_; - DISALLOW_COPY_AND_ASSIGN(ExtensionInstallDialogWithWithholdPermissionsUI); }; // Verifies that some UI is displayed in the extra view for withholding
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_item_view.cc b/chrome/browser/ui/views/extensions/extensions_menu_item_view.cc index cb06e87..6104002 100644 --- a/chrome/browser/ui/views/extensions/extensions_menu_item_view.cc +++ b/chrome/browser/ui/views/extensions/extensions_menu_item_view.cc
@@ -21,6 +21,8 @@ #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/ink_drop.h" @@ -122,8 +124,7 @@ void ExtensionsMenuItemView::OnThemeChanged() { views::View::OnThemeChanged(); const SkColor icon_color = - GetAdjustedIconColor(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_MenuIconColor)); + GetAdjustedIconColor(GetColorProvider()->GetColor(ui::kColorMenuIcon)); if (pin_button_) views::InkDrop::Get(pin_button_)->SetBaseColor(icon_color); @@ -154,12 +155,11 @@ if (!GetWidget()) return; SkColor unpinned_icon_color = - GetAdjustedIconColor(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_MenuIconColor)); - SkColor icon_color = - IsPinned() ? GetAdjustedIconColor(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_ProminentButtonColor)) - : unpinned_icon_color; + GetAdjustedIconColor(GetColorProvider()->GetColor(ui::kColorMenuIcon)); + SkColor icon_color = IsPinned() + ? GetAdjustedIconColor(GetColorProvider()->GetColor( + ui::kColorButtonBackgroundProminent)) + : unpinned_icon_color; SetButtonIconWithColor(pin_button_, IsPinned() ? views::kUnpinIcon : views::kPinIcon, icon_color); @@ -195,8 +195,8 @@ } SkColor ExtensionsMenuItemView::GetAdjustedIconColor(SkColor icon_color) const { - const SkColor background_color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_BubbleBackground); + const SkColor background_color = + GetColorProvider()->GetColor(ui::kColorBubbleBackground); if (background_color != SK_ColorTRANSPARENT) { return color_utils::BlendForMinContrast(icon_color, background_color).color; }
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_view.cc b/chrome/browser/ui/views/extensions/extensions_menu_view.cc index 496eac0..ede9690e 100644 --- a/chrome/browser/ui/views/extensions/extensions_menu_view.cc +++ b/chrome/browser/ui/views/extensions/extensions_menu_view.cc
@@ -24,6 +24,8 @@ #include "third_party/skia/include/core/SkPath.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/animation/ink_drop_host_view.h" @@ -408,9 +410,9 @@ if (manage_extensions_button_) { manage_extensions_button_->SetImage( views::Button::STATE_NORMAL, - gfx::CreateVectorIcon(vector_icons::kSettingsIcon, kSettingsIconSize, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_MenuIconColor))); + gfx::CreateVectorIcon( + vector_icons::kSettingsIcon, kSettingsIconSize, + GetColorProvider()->GetColor(ui::kColorMenuIcon))); } }
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_view_interactive_uitest.cc b/chrome/browser/ui/views/extensions/extensions_menu_view_interactive_uitest.cc index 49b88df..212c7af7 100644 --- a/chrome/browser/ui/views/extensions/extensions_menu_view_interactive_uitest.cc +++ b/chrome/browser/ui/views/extensions/extensions_menu_view_interactive_uitest.cc
@@ -55,13 +55,6 @@ class ExtensionsMenuViewInteractiveUITest : public ExtensionsToolbarBrowserTest { public: - enum class ExtensionRemovalMethod { - kDisable, - kUninstall, - kBlocklist, - kTerminate, - }; - static base::flat_set<ExtensionsMenuItemView*> GetExtensionsMenuItemViews() { return ExtensionsMenuView::GetExtensionsMenuViewForTesting() ->extensions_menu_items_for_testing(); @@ -258,60 +251,6 @@ void ClickExtensionsMenuButton() { ClickExtensionsMenuButton(browser()); } - void RemoveExtension(ExtensionRemovalMethod method, - const std::string& extension_id) { - extensions::ExtensionService* const extension_service = - extensions::ExtensionSystem::Get(browser()->profile()) - ->extension_service(); - switch (method) { - case ExtensionRemovalMethod::kDisable: - extension_service->DisableExtension( - extension_id, extensions::disable_reason::DISABLE_USER_ACTION); - break; - case ExtensionRemovalMethod::kUninstall: - extension_service->UninstallExtension( - extension_id, extensions::UNINSTALL_REASON_FOR_TESTING, nullptr); - break; - case ExtensionRemovalMethod::kBlocklist: - extension_service->BlocklistExtensionForTest(extension_id); - break; - case ExtensionRemovalMethod::kTerminate: - extension_service->TerminateExtension(extension_id); - break; - } - - // Removing an extension can result in the container changing visibility. - // Allow it to finish laying out appropriately. - auto* container = GetExtensionsToolbarContainer(); - container->GetWidget()->LayoutRootViewIfNecessary(); - } - - void VerifyContainerVisibility(ExtensionRemovalMethod method, - bool expected_visibility) { - // An empty container should not be shown. - EXPECT_FALSE(GetExtensionsToolbarContainer()->GetVisible()); - - // Loading the first extension should show the button (and container). - LoadTestExtension("extensions/uitest/long_name"); - EXPECT_TRUE(GetExtensionsToolbarContainer()->IsDrawn()); - - // Add another extension so we can make sure that removing some don't change - // the visibility. - LoadTestExtension("extensions/uitest/window_open"); - - // Remove 1/2 extensions, should still be drawn. - RemoveExtension(method, extensions()[0]->id()); - EXPECT_TRUE(GetExtensionsToolbarContainer()->IsDrawn()); - - // Removing the last extension. All actions now have the same state. - RemoveExtension(method, extensions()[1]->id()); - - // Container should remain visible during the removal animation. - EXPECT_TRUE(GetExtensionsToolbarContainer()->IsDrawn()); - views::test::WaitForAnimatingLayoutManager(GetExtensionsToolbarContainer()); - EXPECT_EQ(expected_visibility, GetExtensionsToolbarContainer()->IsDrawn()); - } - std::string ui_test_name_; }; @@ -322,31 +261,6 @@ ShowAndVerifyUi(); } -IN_PROC_BROWSER_TEST_F(ExtensionsMenuViewInteractiveUITest, - InvisibleWithoutExtension_Disable) { - VerifyContainerVisibility(ExtensionRemovalMethod::kDisable, false); -} - -IN_PROC_BROWSER_TEST_F(ExtensionsMenuViewInteractiveUITest, - InvisibleWithoutExtension_Uninstall) { - VerifyContainerVisibility(ExtensionRemovalMethod::kUninstall, false); -} - -IN_PROC_BROWSER_TEST_F(ExtensionsMenuViewInteractiveUITest, - InvisibleWithoutExtension_Blocklist) { - VerifyContainerVisibility(ExtensionRemovalMethod::kBlocklist, false); -} - -IN_PROC_BROWSER_TEST_F(ExtensionsMenuViewInteractiveUITest, - InvisibleWithoutExtension_Terminate) { - // TODO(pbos): Keep the container visible when extensions are terminated - // (crash). This lets users find and restart them. Then update this test - // expectation to be kept visible by terminated extensions. Also update the - // test name to reflect that the container should be visible with only - // terminated extensions. - VerifyContainerVisibility(ExtensionRemovalMethod::kTerminate, false); -} - // Invokes the UI shown when a user has to reload a page in order to run an // extension. // TODO(https://crbug.com/1184437): Very flaky on Linux and Windows.
diff --git a/chrome/browser/ui/views/extensions/extensions_side_panel_controller.cc b/chrome/browser/ui/views/extensions/extensions_side_panel_controller.cc index 2001070..2e74e8c 100644 --- a/chrome/browser/ui/views/extensions/extensions_side_panel_controller.cc +++ b/chrome/browser/ui/views/extensions/extensions_side_panel_controller.cc
@@ -24,7 +24,8 @@ #include "net/base/url_util.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" -#include "ui/native_theme/native_theme.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/views/controls/webview/webview.h" namespace { @@ -44,16 +45,14 @@ protected: SkColor GetForegroundColor(ButtonState state) const override { - const ui::NativeTheme* native_theme = GetNativeTheme(); - DCHECK(native_theme); // Highlight the activatable state of extension button to increase // visibility. switch (state) { case ButtonState::STATE_HOVERED: case ButtonState::STATE_PRESSED: case ButtonState::STATE_NORMAL: - return native_theme->GetSystemColor( - ui::NativeTheme::kColorId_ProminentButtonColor); + return GetColorProvider()->GetColor( + ui::kColorButtonBackgroundProminent); default: return ToolbarButton::GetForegroundColor(state); }
diff --git a/chrome/browser/ui/views/extensions/extensions_toolbar_container_browsertest.cc b/chrome/browser/ui/views/extensions/extensions_toolbar_container_browsertest.cc index 28ffe29..f3c492a 100644 --- a/chrome/browser/ui/views/extensions/extensions_toolbar_container_browsertest.cc +++ b/chrome/browser/ui/views/extensions/extensions_toolbar_container_browsertest.cc
@@ -74,6 +74,13 @@ class ExtensionsToolbarContainerBrowserTest : public ExtensionsToolbarBrowserTest { public: + enum class ExtensionRemovalMethod { + kDisable, + kUninstall, + kBlocklist, + kTerminate, + }; + ExtensionsToolbarContainerBrowserTest() = default; ExtensionsToolbarContainerBrowserTest( const ExtensionsToolbarContainerBrowserTest&) = delete; @@ -93,6 +100,60 @@ } void ShowUi(const std::string& name) override { NOTREACHED(); } + + void RemoveExtension(ExtensionRemovalMethod method, + const std::string& extension_id) { + extensions::ExtensionService* const extension_service = + extensions::ExtensionSystem::Get(browser()->profile()) + ->extension_service(); + switch (method) { + case ExtensionRemovalMethod::kDisable: + extension_service->DisableExtension( + extension_id, extensions::disable_reason::DISABLE_USER_ACTION); + break; + case ExtensionRemovalMethod::kUninstall: + extension_service->UninstallExtension( + extension_id, extensions::UNINSTALL_REASON_FOR_TESTING, nullptr); + break; + case ExtensionRemovalMethod::kBlocklist: + extension_service->BlocklistExtensionForTest(extension_id); + break; + case ExtensionRemovalMethod::kTerminate: + extension_service->TerminateExtension(extension_id); + break; + } + + // Removing an extension can result in the container changing visibility. + // Allow it to finish laying out appropriately. + auto* container = GetExtensionsToolbarContainer(); + container->GetWidget()->LayoutRootViewIfNecessary(); + } + + void VerifyContainerVisibility(ExtensionRemovalMethod method, + bool expected_visibility) { + // An empty container should not be shown. + EXPECT_FALSE(GetExtensionsToolbarContainer()->GetVisible()); + + // Loading the first extension should show the button (and container). + LoadTestExtension("extensions/uitest/long_name"); + EXPECT_TRUE(GetExtensionsToolbarContainer()->IsDrawn()); + + // Add another extension so we can make sure that removing some don't change + // the visibility. + LoadTestExtension("extensions/uitest/window_open"); + + // Remove 1/2 extensions, should still be drawn. + RemoveExtension(method, extensions()[0]->id()); + EXPECT_TRUE(GetExtensionsToolbarContainer()->IsDrawn()); + + // Removing the last extension. All actions now have the same state. + RemoveExtension(method, extensions()[1]->id()); + + // Container should remain visible during the removal animation. + EXPECT_TRUE(GetExtensionsToolbarContainer()->IsDrawn()); + views::test::WaitForAnimatingLayoutManager(GetExtensionsToolbarContainer()); + EXPECT_EQ(expected_visibility, GetExtensionsToolbarContainer()->IsDrawn()); + } }; // TODO(devlin): There are probably some tests from @@ -131,6 +192,31 @@ ToolbarActionViewController::InvocationSource::kToolbarButton, 1); } +IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerBrowserTest, + InvisibleWithoutExtension_Disable) { + VerifyContainerVisibility(ExtensionRemovalMethod::kDisable, false); +} + +IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerBrowserTest, + InvisibleWithoutExtension_Uninstall) { + VerifyContainerVisibility(ExtensionRemovalMethod::kUninstall, false); +} + +IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerBrowserTest, + InvisibleWithoutExtension_Blocklist) { + VerifyContainerVisibility(ExtensionRemovalMethod::kBlocklist, false); +} + +IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerBrowserTest, + InvisibleWithoutExtension_Terminate) { + // TODO(pbos): Keep the container visible when extensions are terminated + // (crash). This lets users find and restart them. Then update this test + // expectation to be kept visible by terminated extensions. Also update the + // test name to reflect that the container should be visible with only + // terminated extensions. + VerifyContainerVisibility(ExtensionRemovalMethod::kTerminate, false); +} + // Tests that clicking on a second extension action will close a first if its // popup was open. IN_PROC_BROWSER_TEST_F(ExtensionsToolbarContainerBrowserTest,
diff --git a/chrome/browser/ui/views/extensions/request_file_system_dialog_browsertest.cc b/chrome/browser/ui/views/extensions/request_file_system_dialog_browsertest.cc index aeebf484..111661f0 100644 --- a/chrome/browser/ui/views/extensions/request_file_system_dialog_browsertest.cc +++ b/chrome/browser/ui/views/extensions/request_file_system_dialog_browsertest.cc
@@ -21,6 +21,10 @@ public: RequestFileSystemDialogTest() {} + RequestFileSystemDialogTest(const RequestFileSystemDialogTest&) = delete; + RequestFileSystemDialogTest& operator=(const RequestFileSystemDialogTest&) = + delete; + void ShowUi(const std::string& name) override { RequestFileSystemDialogView::ShowDialog( browser()->tab_strip_model()->GetActiveWebContents(), @@ -30,8 +34,6 @@ private: static void DialogCallback(ui::DialogButton button) {} - - DISALLOW_COPY_AND_ASSIGN(RequestFileSystemDialogTest); }; IN_PROC_BROWSER_TEST_F(RequestFileSystemDialogTest, InvokeUi_default) {
diff --git a/chrome/browser/ui/views/external_protocol_dialog_browsertest.cc b/chrome/browser/ui/views/external_protocol_dialog_browsertest.cc index 38d1c31..2427e61f 100644 --- a/chrome/browser/ui/views/external_protocol_dialog_browsertest.cc +++ b/chrome/browser/ui/views/external_protocol_dialog_browsertest.cc
@@ -34,14 +34,16 @@ explicit ExternalProtocolDialogTestApi(ExternalProtocolDialog* dialog) : dialog_(dialog) {} + ExternalProtocolDialogTestApi(const ExternalProtocolDialogTestApi&) = delete; + ExternalProtocolDialogTestApi& operator=( + const ExternalProtocolDialogTestApi&) = delete; + void SetCheckBoxSelected(bool checked) { dialog_->SetRememberSelectionCheckboxCheckedForTesting(checked); } private: ExternalProtocolDialog* dialog_; - - DISALLOW_COPY_AND_ASSIGN(ExternalProtocolDialogTestApi); }; } // namespace test
diff --git a/chrome/browser/ui/views/file_system_access/file_system_access_usage_bubble_view.cc b/chrome/browser/ui/views/file_system_access/file_system_access_usage_bubble_view.cc index 094e3a25..2c814dc 100644 --- a/chrome/browser/ui/views/file_system_access/file_system_access_usage_bubble_view.cc +++ b/chrome/browser/ui/views/file_system_access/file_system_access_usage_bubble_view.cc
@@ -34,6 +34,7 @@ #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/button/image_button_factory.h" @@ -203,11 +204,10 @@ // views::View void OnThemeChanged() override { views::View::OnThemeChanged(); - auto* theme = GetNativeTheme(); - const SkColor icon_color = - theme->GetSystemColor(ui::NativeTheme::kColorId_DefaultIconColor); + const auto* color_provider = GetColorProvider(); + const SkColor icon_color = color_provider->GetColor(ui::kColorIcon); const SkColor disabled_icon_color = - theme->GetSystemColor(ui::NativeTheme::kColorId_DisabledIconColor); + color_provider->GetColor(ui::kColorIconDisabled); views::SetImageFromVectorIconWithColor( expand_collapse_button_, vector_icons::kCaretDownIcon, ui::TableModel::kIconSize, icon_color);
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc index 49e6df89..b7eb20f 100644 --- a/chrome/browser/ui/views/find_bar_view.cc +++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -34,11 +34,12 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/events/event.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/bubble/bubble_border.h" @@ -441,11 +442,9 @@ void FindBarView::OnThemeChanged() { views::View::OnThemeChanged(); - ui::NativeTheme* theme = GetNativeTheme(); - SkColor bg_color = - SkColorSetA(theme->GetSystemColor( - ui::NativeTheme::kColorId_TextfieldDefaultBackground), - 0xFF); + const ui::ColorProvider* color_provider = GetColorProvider(); + SkColor bg_color = SkColorSetA( + color_provider->GetColor(ui::kColorTextfieldBackground), 0xFF); auto border = std::make_unique<views::BubbleBorder>( views::BubbleBorder::NONE, views::BubbleBorder::STANDARD_SHADOW, bg_color); @@ -457,7 +456,7 @@ SetBorder(std::move(border)); const SkColor base_foreground_color = - theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); + color_provider->GetColor(ui::kColorTextfieldForeground); match_count_text_->SetBackgroundColor(bg_color); match_count_text_->SetEnabledColor(
diff --git a/chrome/browser/ui/views/find_bar_views_interactive_uitest.cc b/chrome/browser/ui/views/find_bar_views_interactive_uitest.cc index 40f245f..6a487da7 100644 --- a/chrome/browser/ui/views/find_bar_views_interactive_uitest.cc +++ b/chrome/browser/ui/views/find_bar_views_interactive_uitest.cc
@@ -50,6 +50,9 @@ FindBarHost::disable_animations_during_testing_ = true; } + FindInPageTest(const FindInPageTest&) = delete; + FindInPageTest& operator=(const FindInPageTest&) = delete; + void SetUpCommandLine(base::CommandLine* command_line) override { // Some bots are flaky due to slower loading interacting with // deferred commits. @@ -105,9 +108,6 @@ return details; } } - - private: - DISALLOW_COPY_AND_ASSIGN(FindInPageTest); }; // Flaky because the test server fails to start? See: http://crbug.com/96594.
diff --git a/chrome/browser/ui/views/folder_upload_confirmation_view_browsertest.cc b/chrome/browser/ui/views/folder_upload_confirmation_view_browsertest.cc index 3184f81c..9aeac6e 100644 --- a/chrome/browser/ui/views/folder_upload_confirmation_view_browsertest.cc +++ b/chrome/browser/ui/views/folder_upload_confirmation_view_browsertest.cc
@@ -28,6 +28,11 @@ } } + FolderUploadConfirmationViewTest(const FolderUploadConfirmationViewTest&) = + delete; + FolderUploadConfirmationViewTest& operator=( + const FolderUploadConfirmationViewTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { widget_ = FolderUploadConfirmationView::ShowDialog( @@ -51,8 +56,6 @@ bool callback_called_ = false; std::vector<ui::SelectedFileInfo> callback_files_; - - DISALLOW_COPY_AND_ASSIGN(FolderUploadConfirmationViewTest); }; IN_PROC_BROWSER_TEST_F(FolderUploadConfirmationViewTest,
diff --git a/chrome/browser/ui/views/frame/browser_frame_ash.h b/chrome/browser/ui/views/frame/browser_frame_ash.h index 06d0781..4d44f834 100644 --- a/chrome/browser/ui/views/frame/browser_frame_ash.h +++ b/chrome/browser/ui/views/frame/browser_frame_ash.h
@@ -19,6 +19,9 @@ public: BrowserFrameAsh(BrowserFrame* browser_frame, BrowserView* browser_view); + BrowserFrameAsh(const BrowserFrameAsh&) = delete; + BrowserFrameAsh& operator=(const BrowserFrameAsh&) = delete; + protected: ~BrowserFrameAsh() override; @@ -46,8 +49,6 @@ // The BrowserView is our ClientView. This is a pointer to it. BrowserView* browser_view_; - - DISALLOW_COPY_AND_ASSIGN(BrowserFrameAsh); }; #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_ASH_H_
diff --git a/chrome/browser/ui/views/frame/browser_frame_mac.h b/chrome/browser/ui/views/frame/browser_frame_mac.h index 52234ab..d42bc777 100644 --- a/chrome/browser/ui/views/frame/browser_frame_mac.h +++ b/chrome/browser/ui/views/frame/browser_frame_mac.h
@@ -25,6 +25,9 @@ public: BrowserFrameMac(BrowserFrame* browser_frame, BrowserView* browser_view); + BrowserFrameMac(const BrowserFrameMac&) = delete; + BrowserFrameMac& operator=(const BrowserFrameMac&) = delete; + API_AVAILABLE(macos(10.12.2)) BrowserWindowTouchBarController* GetTouchBarController() const; @@ -74,8 +77,6 @@ private: BrowserView* browser_view_; // Weak. Our ClientView. base::scoped_nsobject<BrowserWindowTouchBarViewsDelegate> touch_bar_delegate_; - - DISALLOW_COPY_AND_ASSIGN(BrowserFrameMac); }; #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_MAC_H_
diff --git a/chrome/browser/ui/views/frame/browser_frame_view_linux.cc b/chrome/browser/ui/views/frame/browser_frame_view_linux.cc index 5271547..c42cf2fa 100644 --- a/chrome/browser/ui/views/frame/browser_frame_view_linux.cc +++ b/chrome/browser/ui/views/frame/browser_frame_view_linux.cc
@@ -6,6 +6,8 @@ #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/browser/ui/views/frame/desktop_browser_frame_aura_linux.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/scoped_canvas.h" #include "ui/gfx/skia_paint_util.h" #include "ui/gfx/skia_util.h" @@ -92,9 +94,9 @@ clip.inset(one_pixel, one_pixel); cc::PaintFlags flags; - flags.setColor(GetNativeTheme()->GetSystemColor( - showing_shadow ? ui::NativeTheme::kColorId_BubbleBorderWhenShadowPresent - : ui::NativeTheme::kColorId_BubbleBorder)); + flags.setColor(GetColorProvider()->GetColor( + showing_shadow ? ui::kColorBubbleBorderWhenShadowPresent + : ui::kColorBubbleBorder)); flags.setAntiAlias(true); if (showing_shadow) flags.setLooper(gfx::CreateShadowDrawLooper(GetShadowValues()));
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_unittest.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_unittest.cc index f623223..3851767c 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_unittest.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_unittest.cc
@@ -25,6 +25,10 @@ explicit BrowserNonClientFrameViewTest(Browser::Type type) : TestWithBrowserView(type), frame_view_(nullptr) {} + BrowserNonClientFrameViewTest(const BrowserNonClientFrameViewTest&) = delete; + BrowserNonClientFrameViewTest& operator=( + const BrowserNonClientFrameViewTest&) = delete; + // TestWithBrowserView override: void SetUp() override { #if defined(OS_WIN) @@ -41,9 +45,6 @@ protected: // Owned by the browser view. BrowserNonClientFrameView* frame_view_; - - private: - DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewTest); }; class BrowserNonClientFrameViewPopupTest
diff --git a/chrome/browser/ui/views/frame/browser_root_view_browsertest.cc b/chrome/browser/ui/views/frame/browser_root_view_browsertest.cc index 2970337..2636cd3 100644 --- a/chrome/browser/ui/views/frame/browser_root_view_browsertest.cc +++ b/chrome/browser/ui/views/frame/browser_root_view_browsertest.cc
@@ -18,14 +18,15 @@ public: BrowserRootViewBrowserTest() = default; + BrowserRootViewBrowserTest(const BrowserRootViewBrowserTest&) = delete; + BrowserRootViewBrowserTest& operator=(const BrowserRootViewBrowserTest&) = + delete; + BrowserRootView* browser_root_view() { BrowserView* browser_view = static_cast<BrowserView*>(browser()->window()); return static_cast<BrowserRootView*>( browser_view->GetWidget()->GetRootView()); } - - private: - DISALLOW_COPY_AND_ASSIGN(BrowserRootViewBrowserTest); }; // Clear drop info after performing drop. http://crbug.com/838791
diff --git a/chrome/browser/ui/views/frame/browser_view_browsertest.cc b/chrome/browser/ui/views/frame/browser_view_browsertest.cc index d021952..834e14b 100644 --- a/chrome/browser/ui/views/frame/browser_view_browsertest.cc +++ b/chrome/browser/ui/views/frame/browser_view_browsertest.cc
@@ -44,6 +44,9 @@ public: BrowserViewTest() : devtools_(nullptr) {} + BrowserViewTest(const BrowserViewTest&) = delete; + BrowserViewTest& operator=(const BrowserViewTest&) = delete; + protected: BrowserView* browser_view() { return BrowserView::GetBrowserViewForBrowser(browser()); @@ -74,8 +77,6 @@ private: base::test::ScopedFeatureList scoped_feature_list_; - - DISALLOW_COPY_AND_ASSIGN(BrowserViewTest); }; namespace { @@ -107,10 +108,14 @@ public: explicit TestTabModalConfirmDialogDelegate(content::WebContents* contents) : TabModalConfirmDialogDelegate(contents) {} + + TestTabModalConfirmDialogDelegate(const TestTabModalConfirmDialogDelegate&) = + delete; + TestTabModalConfirmDialogDelegate& operator=( + const TestTabModalConfirmDialogDelegate&) = delete; + std::u16string GetTitle() override { return std::u16string(u"Dialog Title"); } std::u16string GetDialogMessage() override { return std::u16string(); } - - DISALLOW_COPY_AND_ASSIGN(TestTabModalConfirmDialogDelegate); }; } // namespace @@ -211,6 +216,10 @@ BookmarkBarViewObserverImpl() : change_count_(0) { } + BookmarkBarViewObserverImpl(const BookmarkBarViewObserverImpl&) = delete; + BookmarkBarViewObserverImpl& operator=(const BookmarkBarViewObserverImpl&) = + delete; + int change_count() const { return change_count_; } void clear_change_count() { change_count_ = 0; } @@ -219,8 +228,6 @@ private: int change_count_ = 0; - - DISALLOW_COPY_AND_ASSIGN(BookmarkBarViewObserverImpl); }; // Verifies we don't unnecessarily change the visibility of the BookmarkBarView.
diff --git a/chrome/browser/ui/views/frame/browser_window_property_manager_browsertest_win.cc b/chrome/browser/ui/views/frame/browser_window_property_manager_browsertest_win.cc index 48b4505..9ceec37 100644 --- a/chrome/browser/ui/views/frame/browser_window_property_manager_browsertest_win.cc +++ b/chrome/browser/ui/views/frame/browser_window_property_manager_browsertest_win.cc
@@ -155,12 +155,14 @@ public: BrowserTestWithProfileShortcutManager() {} + BrowserTestWithProfileShortcutManager( + const BrowserTestWithProfileShortcutManager&) = delete; + BrowserTestWithProfileShortcutManager& operator=( + const BrowserTestWithProfileShortcutManager&) = delete; + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(switches::kEnableProfileShortcutManager); } - - private: - DISALLOW_COPY_AND_ASSIGN(BrowserTestWithProfileShortcutManager); }; // Check that the window properties on Windows are properly set.
diff --git a/chrome/browser/ui/views/frame/dbus_appmenu.cc b/chrome/browser/ui/views/frame/dbus_appmenu.cc index cb3bb11..24aac8a 100644 --- a/chrome/browser/ui/views/frame/dbus_appmenu.cc +++ b/chrome/browser/ui/views/frame/dbus_appmenu.cc
@@ -185,6 +185,9 @@ struct DbusAppmenu::HistoryItem { HistoryItem() : session_id(SessionID::InvalidValue()) {} + HistoryItem(const HistoryItem&) = delete; + HistoryItem& operator=(const HistoryItem&) = delete; + // The title for the menu item. std::u16string title; // The URL that will be navigated to if the user selects this item. @@ -202,9 +205,6 @@ // is the owner of all items. If it is not a window, then the entry is a // single page and the vector will be empty. std::vector<HistoryItem*> tabs; - - private: - DISALLOW_COPY_AND_ASSIGN(HistoryItem); }; DbusAppmenu::DbusAppmenu(BrowserView* browser_view, uint32_t browser_frame_id)
diff --git a/chrome/browser/ui/views/frame/dbus_appmenu_registrar.h b/chrome/browser/ui/views/frame/dbus_appmenu_registrar.h index d129d72f..4472fb8c8 100644 --- a/chrome/browser/ui/views/frame/dbus_appmenu_registrar.h +++ b/chrome/browser/ui/views/frame/dbus_appmenu_registrar.h
@@ -28,6 +28,9 @@ // instance we are offering. class DbusAppmenuRegistrar { public: + DbusAppmenuRegistrar(const DbusAppmenuRegistrar&) = delete; + DbusAppmenuRegistrar& operator=(const DbusAppmenuRegistrar&) = delete; + static DbusAppmenuRegistrar* GetInstance(); void OnMenuBarCreated(DbusAppmenu* menu); @@ -77,8 +80,6 @@ std::map<DbusAppmenu*, MenuState> menus_; base::WeakPtrFactory<DbusAppmenuRegistrar> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(DbusAppmenuRegistrar); }; #endif // CHROME_BROWSER_UI_VIEWS_FRAME_DBUS_APPMENU_REGISTRAR_H_
diff --git a/chrome/browser/ui/views/frame/desktop_browser_frame_aura.h b/chrome/browser/ui/views/frame/desktop_browser_frame_aura.h index f27d412..bb4df2db 100644 --- a/chrome/browser/ui/views/frame/desktop_browser_frame_aura.h +++ b/chrome/browser/ui/views/frame/desktop_browser_frame_aura.h
@@ -32,6 +32,9 @@ DesktopBrowserFrameAura(BrowserFrame* browser_frame, BrowserView* browser_view); + DesktopBrowserFrameAura(const DesktopBrowserFrameAura&) = delete; + DesktopBrowserFrameAura& operator=(const DesktopBrowserFrameAura&) = delete; + BrowserView* browser_view() const { return browser_view_; } BrowserFrame* browser_frame() const { return browser_frame_; } @@ -65,8 +68,6 @@ BrowserDesktopWindowTreeHost* browser_desktop_window_tree_host_; std::unique_ptr<wm::VisibilityController> visibility_controller_; - - DISALLOW_COPY_AND_ASSIGN(DesktopBrowserFrameAura); }; #endif // CHROME_BROWSER_UI_VIEWS_FRAME_DESKTOP_BROWSER_FRAME_AURA_H_
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller.h b/chrome/browser/ui/views/frame/immersive_mode_controller.h index 9d013d4..2b8f218 100644 --- a/chrome/browser/ui/views/frame/immersive_mode_controller.h +++ b/chrome/browser/ui/views/frame/immersive_mode_controller.h
@@ -64,6 +64,10 @@ }; ImmersiveModeController(); + + ImmersiveModeController(const ImmersiveModeController&) = delete; + ImmersiveModeController& operator=(const ImmersiveModeController&) = delete; + virtual ~ImmersiveModeController(); // Must initialize after browser view has a Widget and native window. @@ -125,9 +129,6 @@ protected: base::ObserverList<Observer>::Unchecked observers_; - - private: - DISALLOW_COPY_AND_ASSIGN(ImmersiveModeController); }; namespace chrome {
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_chromeos.cc b/chrome/browser/ui/views/frame/immersive_mode_controller_chromeos.cc index ed05157..de2a126 100644 --- a/chrome/browser/ui/views/frame/immersive_mode_controller_chromeos.cc +++ b/chrome/browser/ui/views/frame/immersive_mode_controller_chromeos.cc
@@ -48,10 +48,11 @@ explicit ImmersiveRevealedLockAsh(chromeos::ImmersiveRevealedLock* lock) : lock_(lock) {} + ImmersiveRevealedLockAsh(const ImmersiveRevealedLockAsh&) = delete; + ImmersiveRevealedLockAsh& operator=(const ImmersiveRevealedLockAsh&) = delete; + private: std::unique_ptr<chromeos::ImmersiveRevealedLock> lock_; - - DISALLOW_COPY_AND_ASSIGN(ImmersiveRevealedLockAsh); }; } // namespace
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_mac.mm b/chrome/browser/ui/views/frame/immersive_mode_controller_mac.mm index f89661a..5db8db44 100644 --- a/chrome/browser/ui/views/frame/immersive_mode_controller_mac.mm +++ b/chrome/browser/ui/views/frame/immersive_mode_controller_mac.mm
@@ -164,6 +164,11 @@ }; ImmersiveModeControllerMac(); + + ImmersiveModeControllerMac(const ImmersiveModeControllerMac&) = delete; + ImmersiveModeControllerMac& operator=(const ImmersiveModeControllerMac&) = + delete; + ~ImmersiveModeControllerMac() override; // ImmersiveModeController overrides: @@ -209,8 +214,6 @@ base::scoped_nsobject<NSObject> menu_reveal_monitor_; base::WeakPtrFactory<ImmersiveModeControllerMac> weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(ImmersiveModeControllerMac); }; } // namespace
diff --git a/chrome/browser/ui/views/frame/native_browser_frame_factory.h b/chrome/browser/ui/views/frame/native_browser_frame_factory.h index 31fa983..3d77a5a 100644 --- a/chrome/browser/ui/views/frame/native_browser_frame_factory.h +++ b/chrome/browser/ui/views/frame/native_browser_frame_factory.h
@@ -14,6 +14,10 @@ // Factory for creating a NativeBrowserFrame. class NativeBrowserFrameFactory { public: + NativeBrowserFrameFactory(const NativeBrowserFrameFactory&) = delete; + NativeBrowserFrameFactory& operator=(const NativeBrowserFrameFactory&) = + delete; + // Construct a platform-specific implementation of this interface. static NativeBrowserFrame* CreateNativeBrowserFrame( BrowserFrame* browser_frame, @@ -29,9 +33,6 @@ protected: NativeBrowserFrameFactory() {} virtual ~NativeBrowserFrameFactory() {} - - private: - DISALLOW_COPY_AND_ASSIGN(NativeBrowserFrameFactory); }; #endif // CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_FACTORY_H_
diff --git a/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc b/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc index ca946ca..ac540bc7 100644 --- a/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc +++ b/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc
@@ -69,6 +69,8 @@ #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/events/event_handler.h" #include "ui/events/event_target.h" #include "ui/gfx/animation/tween.h" @@ -864,9 +866,9 @@ return GetThemeProvider()->GetColor(id); } -SkColor WebUITabStripContainerView::GetSystemColor( - ui::NativeTheme::ColorId id) const { - return GetNativeTheme()->GetSystemColor(id); +SkColor WebUITabStripContainerView::GetColorProviderColor( + ui::ColorId id) const { + return GetColorProvider()->GetColor(id); } int WebUITabStripContainerView::GetHeightForWidth(int w) const {
diff --git a/chrome/browser/ui/views/frame/webui_tab_strip_container_view.h b/chrome/browser/ui/views/frame/webui_tab_strip_container_view.h index ff765408..3934d8b 100644 --- a/chrome/browser/ui/views/frame/webui_tab_strip_container_view.h +++ b/chrome/browser/ui/views/frame/webui_tab_strip_container_view.h
@@ -131,7 +131,7 @@ void HideEditDialogForGroup() override; TabStripUILayout GetLayout() override; SkColor GetColor(int id) const override; - SkColor GetSystemColor(ui::NativeTheme::ColorId id) const override; + SkColor GetColorProviderColor(ui::ColorId id) const override; // views::View: int GetHeightForWidth(int w) const override;
diff --git a/chrome/browser/ui/views/fullscreen_control/fullscreen_control_view_interactive_uitest.cc b/chrome/browser/ui/views/fullscreen_control/fullscreen_control_view_interactive_uitest.cc index 1460a67..1ca733cb 100644 --- a/chrome/browser/ui/views/fullscreen_control/fullscreen_control_view_interactive_uitest.cc +++ b/chrome/browser/ui/views/fullscreen_control/fullscreen_control_view_interactive_uitest.cc
@@ -53,6 +53,10 @@ public: FullscreenControlViewTest() = default; + FullscreenControlViewTest(const FullscreenControlViewTest&) = delete; + FullscreenControlViewTest& operator=(const FullscreenControlViewTest&) = + delete; + void SetUp() override { // It is important to disable system keyboard lock as low-level test // utilities may install a keyboard hook to listen for keyboard events and @@ -166,8 +170,6 @@ #if defined(USE_AURA) std::unique_ptr<aura::test::TestCursorClient> cursor_client_; #endif - - DISALLOW_COPY_AND_ASSIGN(FullscreenControlViewTest); }; // Creating the popup on Mac increases the memory use by ~2MB so it should be
diff --git a/chrome/browser/ui/views/global_media_controls/media_notification_list_view.cc b/chrome/browser/ui/views/global_media_controls/media_notification_list_view.cc index 2fc0d98..86cd1ad9 100644 --- a/chrome/browser/ui/views/global_media_controls/media_notification_list_view.cc +++ b/chrome/browser/ui/views/global_media_controls/media_notification_list_view.cc
@@ -7,7 +7,8 @@ #include "base/containers/contains.h" #include "chrome/browser/ui/views/global_media_controls/media_notification_container_impl_view.h" #include "ui/base/metadata/metadata_impl_macros.h" -#include "ui/native_theme/native_theme.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/views/border.h" #include "ui/views/controls/scrollbar/overlay_scroll_bar.h" #include "ui/views/layout/box_layout.h" @@ -70,8 +71,7 @@ separator_style_->separator_thickness)); } else { notification->SetBorder(CreateMediaListSeparatorBorder( - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_MenuSeparatorColor), + GetColorProvider()->GetColor(ui::kColorMenuSeparator), kMediaListSeparatorThickness)); } }
diff --git a/chrome/browser/ui/views/hover_button_unittest.cc b/chrome/browser/ui/views/hover_button_unittest.cc index c6d6c3a..a680766 100644 --- a/chrome/browser/ui/views/hover_button_unittest.cc +++ b/chrome/browser/ui/views/hover_button_unittest.cc
@@ -49,6 +49,9 @@ public: HoverButtonTest() {} + HoverButtonTest(const HoverButtonTest&) = delete; + HoverButtonTest& operator=(const HoverButtonTest&) = delete; + void SetUp() override { ChromeViewsTestBase::SetUp(); widget_ = CreateTestWidget(); @@ -74,7 +77,6 @@ private: std::unique_ptr<views::Widget> widget_; std::unique_ptr<ui::test::EventGenerator> generator_; - DISALLOW_COPY_AND_ASSIGN(HoverButtonTest); }; // Double check the length of the strings used for testing are either over or
diff --git a/chrome/browser/ui/views/hung_renderer_view_browsertest.cc b/chrome/browser/ui/views/hung_renderer_view_browsertest.cc index e196e09..6007f48 100644 --- a/chrome/browser/ui/views/hung_renderer_view_browsertest.cc +++ b/chrome/browser/ui/views/hung_renderer_view_browsertest.cc
@@ -31,6 +31,11 @@ HungRendererDialogView::BypassActiveBrowserRequirementForTests(); } + HungRendererDialogViewBrowserTest(const HungRendererDialogViewBrowserTest&) = + delete; + HungRendererDialogViewBrowserTest& operator=( + const HungRendererDialogViewBrowserTest&) = delete; + // Normally the dialog only shows multiple WebContents when they're all part // of the same process, but that's hard to achieve in a test. void AddWebContents(HungRendererDialogView* dialog, @@ -73,9 +78,6 @@ dialog->EndDialog( contents->GetMainFrame()->GetRenderViewHost()->GetWidget()); } - - private: - DISALLOW_COPY_AND_ASSIGN(HungRendererDialogViewBrowserTest); }; // TODO(tapted): The framework sometimes doesn't pick up the spawned dialog and
diff --git a/chrome/browser/ui/views/importer/import_lock_dialog_view_browsertest.cc b/chrome/browser/ui/views/importer/import_lock_dialog_view_browsertest.cc index c88a3b8..9142ffd 100644 --- a/chrome/browser/ui/views/importer/import_lock_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/importer/import_lock_dialog_view_browsertest.cc
@@ -15,14 +15,16 @@ public: ImportLockDialogViewBrowserTest() {} + ImportLockDialogViewBrowserTest(const ImportLockDialogViewBrowserTest&) = + delete; + ImportLockDialogViewBrowserTest& operator=( + const ImportLockDialogViewBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { gfx::NativeWindow native_window = browser()->window()->GetNativeWindow(); ImportLockDialogView::Show(native_window, base::OnceCallback<void(bool)>()); } - - private: - DISALLOW_COPY_AND_ASSIGN(ImportLockDialogViewBrowserTest); }; // Invokes a dialog that implores the user to close Firefox before trying to
diff --git a/chrome/browser/ui/views/intent_picker_bubble_view_unittest.cc b/chrome/browser/ui/views/intent_picker_bubble_view_unittest.cc index 78e0cb5..001b0871 100644 --- a/chrome/browser/ui/views/intent_picker_bubble_view_unittest.cc +++ b/chrome/browser/ui/views/intent_picker_bubble_view_unittest.cc
@@ -62,6 +62,10 @@ public: IntentPickerBubbleViewTest() = default; + IntentPickerBubbleViewTest(const IntentPickerBubbleViewTest&) = delete; + IntentPickerBubbleViewTest& operator=(const IntentPickerBubbleViewTest&) = + delete; + void TearDown() override { // Make sure the bubble is destroyed before the profile to avoid a crash. bubble_->GetWidget()->CloseNow(); @@ -137,9 +141,6 @@ IntentPickerBubbleView* bubble_; views::View* anchor_view_; std::vector<AppInfo> app_info_; - - private: - DISALLOW_COPY_AND_ASSIGN(IntentPickerBubbleViewTest); }; // Verifies that we didn't set up an image for any LabelButton.
diff --git a/chrome/browser/ui/views/keyboard_access_browsertest.cc b/chrome/browser/ui/views/keyboard_access_browsertest.cc index 7a13497..fca947e 100644 --- a/chrome/browser/ui/views/keyboard_access_browsertest.cc +++ b/chrome/browser/ui/views/keyboard_access_browsertest.cc
@@ -134,6 +134,9 @@ public: KeyboardAccessTest() {} + KeyboardAccessTest(const KeyboardAccessTest&) = delete; + KeyboardAccessTest& operator=(const KeyboardAccessTest&) = delete; + // Use the keyboard to select "New Tab" from the app menu. // This test depends on the fact that there is one menu and that // New Tab is the first item in the menu. If the menus change, @@ -176,9 +179,6 @@ // It verifies that the menu when dismissed by sending the ESC key it does // not display twice. void TestMenuKeyboardAccessAndDismiss(); - - private: - DISALLOW_COPY_AND_ASSIGN(KeyboardAccessTest); }; void KeyboardAccessTest::TestMenuKeyboardAccess(bool alternate_key_sequence,
diff --git a/chrome/browser/ui/views/layout_provider_unittest.cc b/chrome/browser/ui/views/layout_provider_unittest.cc index 2eeb98d..ffcc7be 100644 --- a/chrome/browser/ui/views/layout_provider_unittest.cc +++ b/chrome/browser/ui/views/layout_provider_unittest.cc
@@ -49,6 +49,9 @@ public: LayoutProviderTest() {} + LayoutProviderTest(const LayoutProviderTest&) = delete; + LayoutProviderTest& operator=(const LayoutProviderTest&) = delete; + protected: static void SetUpTestSuite() { #if defined(OS_WIN) @@ -59,9 +62,6 @@ // unexpected state. gfx::FontList::SetDefaultFontDescription(std::string()); } - - private: - DISALLOW_COPY_AND_ASSIGN(LayoutProviderTest); }; // Check whether the system is in the default configuration. This test will fail
diff --git a/chrome/browser/ui/views/lens/lens_side_panel_controller.cc b/chrome/browser/ui/views/lens/lens_side_panel_controller.cc index 5f864a32..a230339 100644 --- a/chrome/browser/ui/views/lens/lens_side_panel_controller.cc +++ b/chrome/browser/ui/views/lens/lens_side_panel_controller.cc
@@ -53,6 +53,7 @@ base::Unretained(this))))) { side_panel_->SetVisible(false); Observe(side_panel_view_->GetWebContents()); + side_panel_view_->GetWebContents()->SetDelegate(this); } LensSidePanelController::~LensSidePanelController() = default; @@ -104,6 +105,13 @@ Close(); } +bool LensSidePanelController::HandleContextMenu( + content::RenderFrameHost* render_frame_host, + const content::ContextMenuParams& params) { + // Disable context menu. + return true; +} + void LensSidePanelController::DidOpenRequestedURL( content::WebContents* new_contents, content::RenderFrameHost* source_render_frame_host,
diff --git a/chrome/browser/ui/views/lens/lens_side_panel_controller.h b/chrome/browser/ui/views/lens/lens_side_panel_controller.h index e14997df..52dffbe 100644 --- a/chrome/browser/ui/views/lens/lens_side_panel_controller.h +++ b/chrome/browser/ui/views/lens/lens_side_panel_controller.h
@@ -7,6 +7,7 @@ #include "chrome/browser/ui/views/lens/lens_side_panel_view.h" #include "content/public/browser/navigation_handle.h" +#include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" namespace content { @@ -19,7 +20,8 @@ namespace lens { // Controller for the Lens side panel. -class LensSidePanelController : public content::WebContentsObserver { +class LensSidePanelController : public content::WebContentsObserver, + public content::WebContentsDelegate { public: LensSidePanelController(SidePanel* side_panel, BrowserView* browser_view); LensSidePanelController(const LensSidePanelController&) = delete; @@ -35,6 +37,10 @@ // Launches the Lens URL in a new tab and closes the side panel. void LoadResultsInNewTab(); + // content::WebContentsDelegate: + bool HandleContextMenu(content::RenderFrameHost* render_frame_host, + const content::ContextMenuParams& params) override; + private: // content::WebContentsObserver: void DidOpenRequestedURL(content::WebContents* new_contents,
diff --git a/chrome/browser/ui/views/lens/lens_side_panel_view.cc b/chrome/browser/ui/views/lens/lens_side_panel_view.cc index ee5004d..19c1860 100644 --- a/chrome/browser/ui/views/lens/lens_side_panel_view.cc +++ b/chrome/browser/ui/views/lens/lens_side_panel_view.cc
@@ -14,11 +14,11 @@ #include "content/public/browser/web_contents.h" #include "ui/base/theme_provider.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/vector_icon_utils.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/controls/button/image_button.h" @@ -35,6 +35,7 @@ namespace { std::unique_ptr<views::WebView> CreateWebView( + views::View* host, content::BrowserContext* browser_context) { auto webview = std::make_unique<views::WebView>(browser_context); // Set a flex behavior for the WebView to always fill out the extra space in @@ -43,6 +44,11 @@ views::kFlexBehaviorKey, views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToZero, views::MaximumFlexSizeRule::kUnbounded)); + // Set background of webview to the same background as the header. This is to + // prevent personal color themes from showing in the side panel when + // navigating to a new Lens results panel. + webview->SetBackground( + views::CreateThemedSolidBackground(host, ui::kColorWindowBackground)); return webview; } @@ -79,7 +85,7 @@ SetCrossAxisAlignment(views::LayoutAlignment::kStretch); CreateAndInstallHeader(close_callback, launch_callback); separator_ = AddChildView(std::make_unique<views::Separator>()); - web_view_ = AddChildView(CreateWebView(browser_context)); + web_view_ = AddChildView(CreateWebView(this, browser_context)); } content::WebContents* LensSidePanelView::GetWebContents() { @@ -88,17 +94,10 @@ void LensSidePanelView::OnThemeChanged() { views::FlexLayoutView::OnThemeChanged(); - separator_->SetColor(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_MenuSeparatorColor)); + const auto* color_provider = GetColorProvider(); + separator_->SetColor(color_provider->GetColor(ui::kColorMenuSeparator)); - // Set background of webview to the same background as the header. This is to - // prevent personal color themes from showing in the side panel when - // navigating to a new Lens results panel. - web_view_->SetBackground(views::CreateThemedSolidBackground( - this, ui::NativeTheme::kColorId_WindowBackground)); - - const SkColor color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DefaultIconColor); + const SkColor color = color_provider->GetColor(ui::kColorIcon); // kGoogleLensFullLogoIcon is rectangular. We should create a tiled image so // that the coordinates and scale are correct. The vector icon should have its // own fill color.
diff --git a/chrome/browser/ui/views/location_bar/content_setting_bubble_dialog_browsertest.cc b/chrome/browser/ui/views/location_bar/content_setting_bubble_dialog_browsertest.cc index 8d0f895..633c432 100644 --- a/chrome/browser/ui/views/location_bar/content_setting_bubble_dialog_browsertest.cc +++ b/chrome/browser/ui/views/location_bar/content_setting_bubble_dialog_browsertest.cc
@@ -88,6 +88,11 @@ {permissions::features::kPermissionQuietChip}); } + ContentSettingBubbleDialogTest(const ContentSettingBubbleDialogTest&) = + delete; + ContentSettingBubbleDialogTest& operator=( + const ContentSettingBubbleDialogTest&) = delete; + void ApplyMediastreamSettings(bool mic_accessed, bool camera_accessed); void ApplyContentSettingsForType(ContentSettingsType content_type); void TriggerQuietNotificationPermissionRequest( @@ -101,8 +106,6 @@ base::test::ScopedFeatureList scoped_feature_list_; absl::optional<permissions::MockPermissionRequest> notification_permission_request_; - - DISALLOW_COPY_AND_ASSIGN(ContentSettingBubbleDialogTest); }; void ContentSettingBubbleDialogTest::ApplyMediastreamSettings(
diff --git a/chrome/browser/ui/views/location_bar/cookie_controls_bubble_view.h b/chrome/browser/ui/views/location_bar/cookie_controls_bubble_view.h index fc476f8..e5c9211 100644 --- a/chrome/browser/ui/views/location_bar/cookie_controls_bubble_view.h +++ b/chrome/browser/ui/views/location_bar/cookie_controls_bubble_view.h
@@ -36,6 +36,9 @@ VIEW_ID_COOKIE_CONTROLS_NOT_WORKING_LINK, }; + CookieControlsBubbleView(const CookieControlsBubbleView&) = delete; + CookieControlsBubbleView& operator=(const CookieControlsBubbleView&) = delete; + static void ShowBubble(views::View* anchor_view, views::Button* highlighted_button, content::WebContents* web_contents, @@ -103,8 +106,6 @@ controller_observation_{this}; base::ScopedObservation<views::TooltipIcon, views::TooltipIcon::Observer> tooltip_observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(CookieControlsBubbleView); }; #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_COOKIE_CONTROLS_BUBBLE_VIEW_H_
diff --git a/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc b/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc index ce6ac40..ba0af87 100644 --- a/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc
@@ -30,6 +30,8 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" @@ -81,17 +83,17 @@ // TODO(tluk): The color id selection logic for security levels should be shared // with that in GetOmniboxSecurityChipColor() once transition to Color Pipeline // is complete. -ui::NativeTheme::ColorId GetSecurityChipColorId( +ui::ColorId GetSecurityChipColorId( security_state::SecurityLevel security_level) { switch (security_level) { case security_state::SECURE_WITH_POLICY_INSTALLED_CERT: - return ui::NativeTheme::kColorId_CustomTabBarSecurityChipWithCertColor; + return ui::kColorPwaSecurityChipForegroundPolicyCert; case security_state::SECURE: - return ui::NativeTheme::kColorId_CustomTabBarSecurityChipSecureColor; + return ui::kColorPwaSecurityChipForegroundSecure; case security_state::DANGEROUS: - return ui::NativeTheme::kColorId_CustomTabBarSecurityChipDangerousColor; + return ui::kColorPwaSecurityChipForegroundDangerous; default: - return ui::NativeTheme::kColorId_CustomTabBarSecurityChipDefaultColor; + return ui::kColorPwaSecurityChipForeground; } } @@ -327,14 +329,14 @@ title_bar_color_ = optional_theme_color.value_or(GetDefaultFrameColor()); - const SkColor foreground_color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_CustomTabBarForegroundColor); + const auto* color_provider = GetColorProvider(); + const SkColor foreground_color = + color_provider->GetColor(ui::kColorPwaToolbarForeground); SetImageFromVectorIconWithColor( close_button_, vector_icons::kCloseRoundedIcon, GetLayoutConstant(LOCATION_BAR_ICON_SIZE), foreground_color); - background_color_ = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_CustomTabBarBackgroundColor); + background_color_ = color_provider->GetColor(ui::kColorPwaToolbarBackground); SetBackground(views::CreateSolidBackground(background_color_)); title_origin_view_->SetColors(background_color_); @@ -400,8 +402,7 @@ } SkColor CustomTabBarView::GetIconLabelBubbleBackgroundColor() const { - return GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_CustomTabBarBackgroundColor); + return GetColorProvider()->GetColor(ui::kColorPwaToolbarBackground); } content::WebContents* CustomTabBarView::GetWebContents() { @@ -418,8 +419,7 @@ SkColor CustomTabBarView::GetSecurityChipColor( security_state::SecurityLevel security_level) const { - return GetNativeTheme()->GetSystemColor( - GetSecurityChipColorId(security_level)); + return GetColorProvider()->GetColor(GetSecurityChipColorId(security_level)); } bool CustomTabBarView::ShowPageInfoDialog() {
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc index 06a0967..c144cdd 100644 --- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc +++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
@@ -127,13 +127,13 @@ public: HighlightPathGenerator() = default; + HighlightPathGenerator(const HighlightPathGenerator&) = delete; + HighlightPathGenerator& operator=(const HighlightPathGenerator&) = delete; + // views::HighlightPathGenerator: SkPath GetHighlightPath(const views::View* view) override { return static_cast<const IconLabelBubbleView*>(view)->GetHighlightPath(); } - - private: - DISALLOW_COPY_AND_ASSIGN(HighlightPathGenerator); }; IconLabelBubbleView::IconLabelBubbleView(const gfx::FontList& font_list,
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h index 24273e57..ba6f40a 100644 --- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h +++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h
@@ -81,6 +81,10 @@ }; IconLabelBubbleView(const gfx::FontList& font_list, Delegate* delegate); + + IconLabelBubbleView(const IconLabelBubbleView&) = delete; + IconLabelBubbleView& operator=(const IconLabelBubbleView&) = delete; + ~IconLabelBubbleView() override; // views::InkDropObserver: @@ -262,8 +266,6 @@ ui::TouchUiController::Get()->RegisterCallback( base::BindRepeating(&IconLabelBubbleView::OnTouchUiChanged, base::Unretained(this))); - - DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); }; #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view_unittest.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view_unittest.cc index 42c7747..93eeada 100644 --- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view_unittest.cc +++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view_unittest.cc
@@ -60,6 +60,9 @@ SetLabel(u"Label"); } + TestIconLabelBubbleView(const TestIconLabelBubbleView&) = delete; + TestIconLabelBubbleView& operator=(const TestIconLabelBubbleView&) = delete; + void SetCurrentAnimationValue(int value) { value_ = value; SizeToPreferredSize(); @@ -129,7 +132,6 @@ ui::ScopedAnimationDurationScaleMode::ZERO_DURATION); int value_ = 0; bool is_bubble_showing_ = false; - DISALLOW_COPY_AND_ASSIGN(TestIconLabelBubbleView); }; } // namespace
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view_browsertest.cc b/chrome/browser/ui/views/location_bar/location_bar_view_browsertest.cc index 17612df..65c6343 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view_browsertest.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view_browsertest.cc
@@ -58,6 +58,10 @@ public: LocationBarViewBrowserTest() = default; + LocationBarViewBrowserTest(const LocationBarViewBrowserTest&) = delete; + LocationBarViewBrowserTest& operator=(const LocationBarViewBrowserTest&) = + delete; + LocationBarView* GetLocationBarView() { BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser()); @@ -69,9 +73,6 @@ ->toolbar_button_provider() ->GetPageActionIconView(PageActionIconType::kZoom); } - - private: - DISALLOW_COPY_AND_ASSIGN(LocationBarViewBrowserTest); }; // Ensure the location bar decoration is added when zooming, and is removed when @@ -207,14 +208,14 @@ SecurityIndicatorTest() = default; + SecurityIndicatorTest(const SecurityIndicatorTest&) = delete; + SecurityIndicatorTest& operator=(const SecurityIndicatorTest&) = delete; + LocationBarView* GetLocationBarView() { BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser()); return browser_view->GetLocationBarView(); } - - private: - DISALLOW_COPY_AND_ASSIGN(SecurityIndicatorTest); }; // Check that the security indicator text is not shown for HTTPS and "Not
diff --git a/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc b/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc index 385cd3f..91f6c35 100644 --- a/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc +++ b/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc
@@ -9,8 +9,9 @@ #include "components/vector_icons/vector_icons.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/controls/highlight_path_generator.h" namespace { @@ -127,11 +128,9 @@ SkColor OmniboxChipButton::GetMainColor() { switch (theme_) { case Theme::kBlue: - // TODO(crbug.com/1003612): ui::NativeTheme::kColorId_ProminentButtonColor - // does not always represent the blue color we need, but it is OK to use - // for now. - return GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_ProminentButtonColor); + // TODO(crbug.com/1003612): ui::kColorButtonBackgroundProminent does not + // always represent the blue color we need, but it is OK to use for now. + return GetColorProvider()->GetColor(ui::kColorButtonBackgroundProminent); case Theme::kGray: return GetThemeProvider()->GetColor( ThemeProperties::COLOR_OMNIBOX_TEXT_DIMMED);
diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view.h b/chrome/browser/ui/views/location_bar/zoom_bubble_view.h index 0e61643..2fabfc56 100644 --- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.h +++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.h
@@ -32,6 +32,9 @@ public ImmersiveModeController::Observer, public extensions::IconImage::Observer { public: + ZoomBubbleView(const ZoomBubbleView&) = delete; + ZoomBubbleView& operator=(const ZoomBubbleView&) = delete; + // Shows the bubble and automatically closes it after a short time period if // |reason| is AUTOMATIC. static void ShowBubble(content::WebContents* web_contents, @@ -178,8 +181,6 @@ // The session of the Browser that triggered the bubble. This allows the zoom // icon to be updated even if the WebContents is destroyed. const SessionID session_id_; - - DISALLOW_COPY_AND_ASSIGN(ZoomBubbleView); }; #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_
diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc b/chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc index 08af43e..bc93d8d 100644 --- a/chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc
@@ -408,11 +408,11 @@ public: ZoomBubbleDialogTest() {} + ZoomBubbleDialogTest(const ZoomBubbleDialogTest&) = delete; + ZoomBubbleDialogTest& operator=(const ZoomBubbleDialogTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { ShowInActiveTab(browser()); } - - private: - DISALLOW_COPY_AND_ASSIGN(ZoomBubbleDialogTest); }; // Test that calls ShowUi("default").
diff --git a/chrome/browser/ui/views/login_handler_views.cc b/chrome/browser/ui/views/login_handler_views.cc index 2c00543..fd2b02a 100644 --- a/chrome/browser/ui/views/login_handler_views.cc +++ b/chrome/browser/ui/views/login_handler_views.cc
@@ -120,6 +120,9 @@ widget_ = constrained_window::ShowWebModalDialogViews(this, web_contents); } + Dialog(const Dialog&) = delete; + Dialog& operator=(const Dialog&) = delete; + void CloseDialog() { handler_ = nullptr; // The hosting widget may have been freed. @@ -163,8 +166,6 @@ // The LoginView that contains the user's login information. LoginView* login_view_; views::Widget* widget_; - - DISALLOW_COPY_AND_ASSIGN(Dialog); }; Dialog* dialog_ = nullptr;
diff --git a/chrome/browser/ui/views/media_router/cast_dialog_sink_button.cc b/chrome/browser/ui/views/media_router/cast_dialog_sink_button.cc index db5617f..ed17463 100644 --- a/chrome/browser/ui/views/media_router/cast_dialog_sink_button.cc +++ b/chrome/browser/ui/views/media_router/cast_dialog_sink_button.cc
@@ -34,9 +34,9 @@ #include "ui/base/models/image_model.h" #include "ui/base/ui_base_types.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/animation/ink_drop_impl.h" #include "ui/views/border.h" @@ -191,8 +191,8 @@ } void CastDialogSinkButton::UpdateTitleTextStyle() { - SkColor background_color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DialogBackground); + SkColor background_color = + GetColorProvider()->GetColor(ui::kColorDialogBackground); SetTitleTextStyle( GetEnabled() ? views::style::STYLE_PRIMARY : views::style::STYLE_DISABLED, background_color);
diff --git a/chrome/browser/ui/views/media_router/cast_toolbar_button.cc b/chrome/browser/ui/views/media_router/cast_toolbar_button.cc index 7f3d732..d3751477 100644 --- a/chrome/browser/ui/views/media_router/cast_toolbar_button.cc +++ b/chrome/browser/ui/views/media_router/cast_toolbar_button.cc
@@ -20,10 +20,11 @@ #include "ui/base/models/menu_model.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/base/theme_provider.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/vector_icon_types.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/controls/button/button_controller.h" @@ -171,12 +172,10 @@ icon_color = gfx::kPlaceholderColor; } else if (severity == Severity::FATAL) { new_icon = &vector_icons::kMediaRouterErrorIcon; - icon_color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityHigh); + icon_color = GetColorProvider()->GetColor(ui::kColorAlertHighSeverity); } else if (severity == Severity::WARNING) { new_icon = &vector_icons::kMediaRouterWarningIcon; - icon_color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityMedium); + icon_color = GetColorProvider()->GetColor(ui::kColorAlertMediumSeverity); } else { new_icon = &vector_icons::kMediaRouterActiveIcon; icon_color = gfx::kGoogleBlue500;
diff --git a/chrome/browser/ui/views/media_router/cast_toolbar_button_unittest.cc b/chrome/browser/ui/views/media_router/cast_toolbar_button_unittest.cc index b0c5d222..935184f 100644 --- a/chrome/browser/ui/views/media_router/cast_toolbar_button_unittest.cc +++ b/chrome/browser/ui/views/media_router/cast_toolbar_button_unittest.cc
@@ -23,6 +23,8 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/theme_provider.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/events/base_event_utils.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/image/image_unittest_util.h" @@ -103,19 +105,17 @@ button_ = widget_->SetContentsView(std::make_unique<CastToolbarButton>( browser_.get(), media_router, std::move(context_menu))); - ui::NativeTheme* native_theme = button_->GetNativeTheme(); + const ui::ColorProvider* color_provider = button_->GetColorProvider(); idle_icon_ = gfx::Image( gfx::CreateVectorIcon(vector_icons::kMediaRouterIdleIcon, button_->GetThemeProvider()->GetColor( ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON))); warning_icon_ = gfx::Image(gfx::CreateVectorIcon( vector_icons::kMediaRouterWarningIcon, - native_theme->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityMedium))); + color_provider->GetColor(ui::kColorAlertMediumSeverity))); error_icon_ = gfx::Image(gfx::CreateVectorIcon( vector_icons::kMediaRouterErrorIcon, - native_theme->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityHigh))); + color_provider->GetColor(ui::kColorAlertHighSeverity))); active_icon_ = gfx::Image(gfx::CreateVectorIcon( vector_icons::kMediaRouterActiveIcon, gfx::kGoogleBlue500)); }
diff --git a/chrome/browser/ui/views/media_router/presentation_receiver_window_view_browsertest.cc b/chrome/browser/ui/views/media_router/presentation_receiver_window_view_browsertest.cc index 4da7077..dee72f2 100644 --- a/chrome/browser/ui/views/media_router/presentation_receiver_window_view_browsertest.cc +++ b/chrome/browser/ui/views/media_router/presentation_receiver_window_view_browsertest.cc
@@ -46,6 +46,9 @@ : web_contents_(WebContents::Create(WebContents::CreateParams(profile))) { } + FakeReceiverDelegate(const FakeReceiverDelegate&) = delete; + FakeReceiverDelegate& operator=(const FakeReceiverDelegate&) = delete; + void set_window_closed_callback(base::OnceClosure callback) { closed_callback_ = std::move(callback); } @@ -62,14 +65,17 @@ private: std::unique_ptr<content::WebContents> web_contents_; base::OnceClosure closed_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakeReceiverDelegate); }; class PresentationReceiverWindowViewBrowserTest : public InProcessBrowserTest { protected: PresentationReceiverWindowViewBrowserTest() = default; + PresentationReceiverWindowViewBrowserTest( + const PresentationReceiverWindowViewBrowserTest&) = delete; + PresentationReceiverWindowViewBrowserTest& operator=( + const PresentationReceiverWindowViewBrowserTest&) = delete; + PresentationReceiverWindowView* CreateReceiverWindowView( PresentationReceiverWindowDelegate* delegate, const gfx::Rect& bounds) { @@ -105,8 +111,6 @@ const gfx::Rect bounds_{100, 100}; std::unique_ptr<FakeReceiverDelegate> fake_delegate_; PresentationReceiverWindowView* receiver_view_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(PresentationReceiverWindowViewBrowserTest); }; #if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/ui/views/menu_interactive_uitest.cc b/chrome/browser/ui/views/menu_interactive_uitest.cc index c83599f..a9b27c7 100644 --- a/chrome/browser/ui/views/menu_interactive_uitest.cc +++ b/chrome/browser/ui/views/menu_interactive_uitest.cc
@@ -50,6 +50,9 @@ public: MenuControllerUITest() {} + MenuControllerUITest(const MenuControllerUITest&) = delete; + MenuControllerUITest& operator=(const MenuControllerUITest&) = delete; + // This method creates a MenuRunner, MenuItemView, etc, adds two menu // items, shows the menu so that it can calculate the position of the first // menu item and move the mouse there, and closes the menu. @@ -102,9 +105,6 @@ std::unique_ptr<MenuDelegate> menu_delegate_; // Middle of first menu item. gfx::Point mouse_pos_; - - private: - DISALLOW_COPY_AND_ASSIGN(MenuControllerUITest); }; IN_PROC_BROWSER_TEST_F(MenuControllerUITest, TestMouseOverShownMenu) {
diff --git a/chrome/browser/ui/views/message_box_dialog.h b/chrome/browser/ui/views/message_box_dialog.h index e0735fa..8737228 100644 --- a/chrome/browser/ui/views/message_box_dialog.h +++ b/chrome/browser/ui/views/message_box_dialog.h
@@ -20,6 +20,9 @@ using MessageBoxResultCallback = base::OnceCallback<void(chrome::MessageBoxResult result)>; + MessageBoxDialog(const MessageBoxDialog&) = delete; + MessageBoxDialog& operator=(const MessageBoxDialog&) = delete; + static chrome::MessageBoxResult Show( gfx::NativeWindow parent, const std::u16string& title, @@ -61,8 +64,6 @@ const chrome::MessageBoxType type_; views::MessageBoxView* message_box_view_; MessageBoxResultCallback result_callback_; - - DISALLOW_COPY_AND_ASSIGN(MessageBoxDialog); }; #endif // CHROME_BROWSER_UI_VIEWS_MESSAGE_BOX_DIALOG_H_
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view_browsertest.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view_browsertest.cc index 3da655a..a7669fdc 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view_browsertest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view_browsertest.cc
@@ -162,6 +162,10 @@ public: OmniboxPopupContentsViewTest() {} + OmniboxPopupContentsViewTest(const OmniboxPopupContentsViewTest&) = delete; + OmniboxPopupContentsViewTest& operator=(const OmniboxPopupContentsViewTest&) = + delete; + views::Widget* CreatePopupForTestQuery(); views::Widget* GetPopupWidget() { return popup_view()->GetWidget(); } OmniboxResultView* GetResultViewAt(int index) { @@ -210,8 +214,6 @@ } ASSERT_TRUE(theme_service->UsingDefaultTheme()); } - - DISALLOW_COPY_AND_ASSIGN(OmniboxPopupContentsViewTest); }; views::Widget* OmniboxPopupContentsViewTest::CreatePopupForTestQuery() {
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view_unittest.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view_unittest.cc index 6e31d526..5e80712 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view_unittest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view_unittest.cc
@@ -39,14 +39,16 @@ /*location_bar_view=*/nullptr), selected_index_(0) {} + TestOmniboxPopupContentsView(const TestOmniboxPopupContentsView&) = delete; + TestOmniboxPopupContentsView& operator=(const TestOmniboxPopupContentsView&) = + delete; + void SetSelectedIndex(size_t index) override { selected_index_ = index; } size_t GetSelectedIndex() const override { return selected_index_; } private: size_t selected_index_; - - DISALLOW_COPY_AND_ASSIGN(TestOmniboxPopupContentsView); }; } // namespace
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc index e0f0c3e37..ab05147 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc
@@ -74,6 +74,10 @@ } // namespace class OmniboxViewViewsTest : public InProcessBrowserTest { + public: + OmniboxViewViewsTest(const OmniboxViewViewsTest&) = delete; + OmniboxViewViewsTest& operator=(const OmniboxViewViewsTest&) = delete; + protected: OmniboxViewViewsTest() = default; ~OmniboxViewViewsTest() override = default; @@ -143,8 +147,6 @@ #endif return native_window; } - - DISALLOW_COPY_AND_ASSIGN(OmniboxViewViewsTest); }; IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, PasteAndGoDoesNotLeavePopupOpen) {
diff --git a/chrome/browser/ui/views/page_action/pwa_install_view_browsertest.cc b/chrome/browser/ui/views/page_action/pwa_install_view_browsertest.cc index a1234ec..1ef77ff 100644 --- a/chrome/browser/ui/views/page_action/pwa_install_view_browsertest.cc +++ b/chrome/browser/ui/views/page_action/pwa_install_view_browsertest.cc
@@ -61,6 +61,10 @@ class PwaInstallIconChangeWaiter : public views::ViewObserver { public: + PwaInstallIconChangeWaiter(const PwaInstallIconChangeWaiter&) = delete; + PwaInstallIconChangeWaiter& operator=(const PwaInstallIconChangeWaiter&) = + delete; + static void VerifyIconVisibility(views::View* iconView, bool visible); private: @@ -78,8 +82,6 @@ base::RunLoop run_loop_; base::ScopedObservation<views::View, views::ViewObserver> observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(PwaInstallIconChangeWaiter); }; // static
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view_base.h b/chrome/browser/ui/views/page_info/page_info_bubble_view_base.h index fed4698..7373bf3 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view_base.h +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view_base.h
@@ -43,6 +43,9 @@ BUBBLE_ACCURACY_TIP, }; + PageInfoBubbleViewBase(const PageInfoBubbleViewBase&) = delete; + PageInfoBubbleViewBase& operator=(const PageInfoBubbleViewBase&) = delete; + // Returns the type of the bubble being shown. For testing only. static BubbleType GetShownBubbleType(); @@ -68,8 +71,6 @@ void DidStartNavigation(content::NavigationHandle* handle) override; void DidChangeVisibleSecurityState() override; void WebContentsDestroyed() override; - - DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleViewBase); }; #endif // CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_BUBBLE_VIEW_BASE_H_
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view_browsertest.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view_browsertest.cc index 904026c..9e8f441 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view_browsertest.cc
@@ -748,6 +748,9 @@ // Tracks focus of an arbitrary UI element. class FocusTracker { public: + FocusTracker(const FocusTracker&) = delete; + FocusTracker& operator=(const FocusTracker&) = delete; + bool focused() const { return focused_; } // Wait for focused() to be in state |target_state_is_focused|. If focused() @@ -784,8 +787,6 @@ bool target_state_is_focused_; base::RunLoop run_loop_; - - DISALLOW_COPY_AND_ASSIGN(FocusTracker); }; // Watches a WebContents for focus changes.
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view_unittest.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view_unittest.cc index 0ec6c64..8e9926b 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view_unittest.cc +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view_unittest.cc
@@ -97,6 +97,10 @@ CreateView(); } + PageInfoBubbleViewTestApi(const PageInfoBubbleViewTestApi&) = delete; + PageInfoBubbleViewTestApi& operator=(const PageInfoBubbleViewTestApi&) = + delete; + void CreateView() { if (bubble_delegate_) { bubble_delegate_->GetWidget()->CloseNow(); @@ -309,8 +313,6 @@ absl::optional<bool> reload_prompt_; absl::optional<views::Widget::ClosedReason> closed_reason_; bool is_version_two_; - - DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleViewTestApi); }; } // namespace test @@ -351,6 +353,10 @@ web_contents_ = factory_.CreateWebContents(profile_); } + ScopedWebContentsTestHelper(const ScopedWebContentsTestHelper&) = delete; + ScopedWebContentsTestHelper& operator=(const ScopedWebContentsTestHelper&) = + delete; + content::WebContents* web_contents() { return web_contents_; } Profile* profile() { return profile_; } TestingPrefServiceSimple* local_state() { @@ -368,8 +374,6 @@ Profile* profile_ = nullptr; content::TestWebContentsFactory factory_; content::WebContents* web_contents_; // Weak. Owned by factory_. - - DISALLOW_COPY_AND_ASSIGN(ScopedWebContentsTestHelper); }; class PageInfoBubbleViewTest : public testing::Test,
diff --git a/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view_unittest.cc b/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view_unittest.cc index bbb1b69..230c55f 100644 --- a/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view_unittest.cc +++ b/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view_unittest.cc
@@ -26,6 +26,10 @@ web_contents_ = factory_.CreateWebContents(&profile_); } + ScopedWebContentsTestHelper(const ScopedWebContentsTestHelper&) = delete; + ScopedWebContentsTestHelper& operator=(const ScopedWebContentsTestHelper&) = + delete; + Profile* profile() { return &profile_; } content::WebContents* web_contents() { return web_contents_; } @@ -34,14 +38,17 @@ TestingProfile profile_; content::TestWebContentsFactory factory_; content::WebContents* web_contents_; // Weak. Owned by factory_. - - DISALLOW_COPY_AND_ASSIGN(ScopedWebContentsTestHelper); }; class SafetyTipPageInfoBubbleViewTest : public testing::Test { public: SafetyTipPageInfoBubbleViewTest() {} + SafetyTipPageInfoBubbleViewTest(const SafetyTipPageInfoBubbleViewTest&) = + delete; + SafetyTipPageInfoBubbleViewTest& operator=( + const SafetyTipPageInfoBubbleViewTest&) = delete; + // testing::Test: void SetUp() override { views::Widget::InitParams parent_params; @@ -70,9 +77,6 @@ PageInfoBubbleViewBase* bubble_ = nullptr; views::Widget* parent_window_ = nullptr; // Weak. Owned by the NativeWidget. - - private: - DISALLOW_COPY_AND_ASSIGN(SafetyTipPageInfoBubbleViewTest); }; } // namespace
diff --git a/chrome/browser/ui/views/passwords/credentials_item_view.cc b/chrome/browser/ui/views/passwords/credentials_item_view.cc index dc3a879..f924f58 100644 --- a/chrome/browser/ui/views/passwords/credentials_item_view.cc +++ b/chrome/browser/ui/views/passwords/credentials_item_view.cc
@@ -21,6 +21,8 @@ #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" @@ -176,8 +178,8 @@ void CredentialsItemView::OnPaintBackground(gfx::Canvas* canvas) { if (GetState() == STATE_PRESSED || GetState() == STATE_HOVERED) { - canvas->DrawColor(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor)); + canvas->DrawColor( + GetColorProvider()->GetColor(ui::kColorMenuItemBackgroundSelected)); } }
diff --git a/chrome/browser/ui/views/passwords/move_to_account_store_bubble_view.cc b/chrome/browser/ui/views/passwords/move_to_account_store_bubble_view.cc index 4ae3386e..d712bd4b 100644 --- a/chrome/browser/ui/views/passwords/move_to_account_store_bubble_view.cc +++ b/chrome/browser/ui/views/passwords/move_to_account_store_bubble_view.cc
@@ -22,6 +22,7 @@ #include "ui/base/models/image_model.h" #include "ui/base/resource/resource_bundle.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/favicon_size.h" @@ -141,8 +142,7 @@ if (main_image_skia_) return main_image_skia_.value(); DCHECK(main_vector_icon_); - const SkColor color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DefaultIconColor); + const SkColor color = GetColorProvider()->GetColor(ui::kColorIcon); return gfx::CreateVectorIcon(*main_vector_icon_, kImageSize, color); } @@ -150,20 +150,18 @@ if (badge_image_skia_) return badge_image_skia_.value(); // If there is no badge set, fallback to the default globe icon. - const SkColor color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DefaultIconColor); + const SkColor color = GetColorProvider()->GetColor(ui::kColorIcon); return gfx::CreateVectorIcon(kGlobeIcon, gfx::kFaviconSize, color); } void ImageWithBadge::Render() { constexpr int kBadgePadding = 6; - const SkColor kBackgroundColor = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_BubbleBackground); + const auto* color_provider = GetColorProvider(); + const SkColor kBackgroundColor = + color_provider->GetColor(ui::kColorBubbleBackground); // Make the border color a softer version of the icon color. const SkColor kBorderColor = - SkColorSetA(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DefaultIconColor), - 96); + SkColorSetA(color_provider->GetColor(ui::kColorIcon), 96); gfx::Image rounded_badge = profiles::GetSizedAvatarIcon( gfx::Image(GetBadge()),
diff --git a/chrome/browser/ui/views/passwords/password_auto_sign_in_view.h b/chrome/browser/ui/views/passwords/password_auto_sign_in_view.h index 30064717..9d7580d 100644 --- a/chrome/browser/ui/views/passwords/password_auto_sign_in_view.h +++ b/chrome/browser/ui/views/passwords/password_auto_sign_in_view.h
@@ -18,6 +18,9 @@ PasswordAutoSignInView(content::WebContents* web_contents, views::View* anchor_view); + PasswordAutoSignInView(const PasswordAutoSignInView&) = delete; + PasswordAutoSignInView& operator=(const PasswordAutoSignInView&) = delete; + #if defined(UNIT_TEST) static void set_auto_signin_toast_timeout(int seconds) { auto_signin_toast_timeout_ = seconds; @@ -43,8 +46,6 @@ // The timeout in seconds for the auto sign-in toast. static int auto_signin_toast_timeout_; - - DISALLOW_COPY_AND_ASSIGN(PasswordAutoSignInView); }; #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_PASSWORD_AUTO_SIGN_IN_VIEW_H_
diff --git a/chrome/browser/ui/views/passwords/password_bubble_view_base.h b/chrome/browser/ui/views/passwords/password_bubble_view_base.h index 6b983e6..7917d21 100644 --- a/chrome/browser/ui/views/passwords/password_bubble_view_base.h +++ b/chrome/browser/ui/views/passwords/password_bubble_view_base.h
@@ -37,6 +37,9 @@ // make this base class significantly smaller. class PasswordBubbleViewBase : public LocationBarBubbleDelegateView { public: + PasswordBubbleViewBase(const PasswordBubbleViewBase&) = delete; + PasswordBubbleViewBase& operator=(const PasswordBubbleViewBase&) = delete; + // Returns a pointer to the bubble. static PasswordBubbleViewBase* manage_password_bubble() { return g_manage_passwords_bubble_; @@ -96,8 +99,6 @@ // Singleton instance of the Password bubble.The instance is owned by the // Bubble and will be deleted when the bubble closes. static PasswordBubbleViewBase* g_manage_passwords_bubble_; - - DISALLOW_COPY_AND_ASSIGN(PasswordBubbleViewBase); }; #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_PASSWORD_BUBBLE_VIEW_BASE_H_
diff --git a/chrome/browser/ui/views/passwords/password_dialog_view_browsertest.cc b/chrome/browser/ui/views/passwords/password_dialog_view_browsertest.cc index 5c369b96..9064607 100644 --- a/chrome/browser/ui/views/passwords/password_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/passwords/password_dialog_view_browsertest.cc
@@ -51,6 +51,11 @@ public: explicit TestManagePasswordsUIController(content::WebContents* web_contents); + TestManagePasswordsUIController(const TestManagePasswordsUIController&) = + delete; + TestManagePasswordsUIController& operator=( + const TestManagePasswordsUIController&) = delete; + void OnDialogHidden() override; AccountChooserPrompt* CreateAccountChooser( CredentialManagerDialogController* controller) override; @@ -79,8 +84,6 @@ AccountChooserPrompt* current_account_chooser_; AutoSigninFirstRunPrompt* current_autosignin_prompt_; CredentialLeakPrompt* current_credential_leak_prompt_; - - DISALLOW_COPY_AND_ASSIGN(TestManagePasswordsUIController); }; TestManagePasswordsUIController::TestManagePasswordsUIController(
diff --git a/chrome/browser/ui/views/passwords/password_generation_popup_view_views.h b/chrome/browser/ui/views/passwords/password_generation_popup_view_views.h index 523299c..6261efea 100644 --- a/chrome/browser/ui/views/passwords/password_generation_popup_view_views.h +++ b/chrome/browser/ui/views/passwords/password_generation_popup_view_views.h
@@ -22,6 +22,11 @@ PasswordGenerationPopupController* controller, views::Widget* parent_widget); + PasswordGenerationPopupViewViews(const PasswordGenerationPopupViewViews&) = + delete; + PasswordGenerationPopupViewViews& operator=( + const PasswordGenerationPopupViewViews&) = delete; + // PasswordGenerationPopupView implementation bool Show() override WARN_UNUSED_RESULT; void Hide() override; @@ -51,8 +56,6 @@ // Controller for this view. Weak reference. PasswordGenerationPopupController* controller_; - - DISALLOW_COPY_AND_ASSIGN(PasswordGenerationPopupViewViews); }; #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_PASSWORD_GENERATION_POPUP_VIEW_VIEWS_H_
diff --git a/chrome/browser/ui/views/passwords/password_items_view.cc b/chrome/browser/ui/views/passwords/password_items_view.cc index 19640c5..5759169 100644 --- a/chrome/browser/ui/views/passwords/password_items_view.cc +++ b/chrome/browser/ui/views/passwords/password_items_view.cc
@@ -142,6 +142,9 @@ PasswordRow(PasswordItemsView* parent, const password_manager::PasswordForm* password_form); + PasswordRow(const PasswordRow&) = delete; + PasswordRow& operator=(const PasswordRow&) = delete; + void AddToLayout(views::GridLayout* layout, PasswordItemsViewColumnSetType type_id); @@ -156,8 +159,6 @@ PasswordItemsView* const parent_; const password_manager::PasswordForm* const password_form_; bool deleted_ = false; - - DISALLOW_COPY_AND_ASSIGN(PasswordRow); }; PasswordItemsView::PasswordRow::PasswordRow(
diff --git a/chrome/browser/ui/views/passwords/password_save_update_view.cc b/chrome/browser/ui/views/passwords/password_save_update_view.cc index 0a85589a..c6f6dbd 100644 --- a/chrome/browser/ui/views/passwords/password_save_update_view.cc +++ b/chrome/browser/ui/views/passwords/password_save_update_view.cc
@@ -43,6 +43,7 @@ #include "ui/base/models/simple_combobox_model.h" #include "ui/base/resource/resource_bundle.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/vector_icon_utils.h" @@ -539,11 +540,10 @@ void PasswordSaveUpdateView::OnThemeChanged() { PasswordBubbleViewBase::OnThemeChanged(); if (password_view_button_) { - auto* theme = GetNativeTheme(); - const SkColor icon_color = - theme->GetSystemColor(ui::NativeTheme::kColorId_DefaultIconColor); + const auto* color_provider = GetColorProvider(); + const SkColor icon_color = color_provider->GetColor(ui::kColorIcon); const SkColor disabled_icon_color = - theme->GetSystemColor(ui::NativeTheme::kColorId_DisabledIconColor); + color_provider->GetColor(ui::kColorIconDisabled); views::SetImageFromVectorIconWithColor(password_view_button_, kEyeIcon, GetDefaultSizeOfVectorIcon(kEyeIcon), icon_color);
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc index 9d65443..e5b5d4a5 100644 --- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc +++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
@@ -84,6 +84,11 @@ app_locale_(app_locale), initially_valid_(initially_valid) {} + ExpirationDateValidationDelegate(const ExpirationDateValidationDelegate&) = + delete; + ExpirationDateValidationDelegate& operator=( + const ExpirationDateValidationDelegate&) = delete; + bool IsValidTextfield(views::Textfield* textfield, std::u16string* error_message) override { NOTREACHED(); @@ -148,8 +153,6 @@ EditorViewController* controller_; const std::string app_locale_; bool initially_valid_; - - DISALLOW_COPY_AND_ASSIGN(ExpirationDateValidationDelegate); }; } // namespace
diff --git a/chrome/browser/ui/views/payments/cvc_unmask_view_controller.cc b/chrome/browser/ui/views/payments/cvc_unmask_view_controller.cc index 6e67d2b..ece4e8e 100644 --- a/chrome/browser/ui/views/payments/cvc_unmask_view_controller.cc +++ b/chrome/browser/ui/views/payments/cvc_unmask_view_controller.cc
@@ -36,6 +36,7 @@ #include "ui/base/models/image_model.h" #include "ui/base/resource/resource_bundle.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/border.h" #include "ui/views/controls/button/md_text_button.h" @@ -60,8 +61,7 @@ // views::View: void OnThemeChanged() override { Label::OnThemeChanged(); - SetEnabledColor(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityHigh)); + SetEnabledColor(GetColorProvider()->GetColor(ui::kColorAlertHighSeverity)); } };
diff --git a/chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc index a65d36c..24e05f7 100644 --- a/chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc +++ b/chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc
@@ -14,11 +14,14 @@ class PaymentRequestCvcUnmaskViewControllerTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestCvcUnmaskViewControllerTest( + const PaymentRequestCvcUnmaskViewControllerTest&) = delete; + PaymentRequestCvcUnmaskViewControllerTest& operator=( + const PaymentRequestCvcUnmaskViewControllerTest&) = delete; + protected: PaymentRequestCvcUnmaskViewControllerTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestCvcUnmaskViewControllerTest); }; IN_PROC_BROWSER_TEST_F(PaymentRequestCvcUnmaskViewControllerTest,
diff --git a/chrome/browser/ui/views/payments/editor_view_controller.cc b/chrome/browser/ui/views/payments/editor_view_controller.cc index c6f1d19..7726712 100644 --- a/chrome/browser/ui/views/payments/editor_view_controller.cc +++ b/chrome/browser/ui/views/payments/editor_view_controller.cc
@@ -21,8 +21,9 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/combobox_model.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/geometry/insets.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/border.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/button/md_text_button.h" @@ -67,8 +68,8 @@ // views::View: void OnThemeChanged() override { View::OnThemeChanged(); - error_label_->SetEnabledColor(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityHigh)); + error_label_->SetEnabledColor( + GetColorProvider()->GetColor(ui::kColorAlertHighSeverity)); } private:
diff --git a/chrome/browser/ui/views/payments/empty_update_browsertest.cc b/chrome/browser/ui/views/payments/empty_update_browsertest.cc index f2a284c9..f3b7831 100644 --- a/chrome/browser/ui/views/payments/empty_update_browsertest.cc +++ b/chrome/browser/ui/views/payments/empty_update_browsertest.cc
@@ -13,11 +13,13 @@ namespace payments { class PaymentRequestEmptyUpdateTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestEmptyUpdateTest(const PaymentRequestEmptyUpdateTest&) = delete; + PaymentRequestEmptyUpdateTest& operator=( + const PaymentRequestEmptyUpdateTest&) = delete; + protected: PaymentRequestEmptyUpdateTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestEmptyUpdateTest); }; IN_PROC_BROWSER_TEST_F(PaymentRequestEmptyUpdateTest, NoCrash) {
diff --git a/chrome/browser/ui/views/payments/error_message_view_controller.cc b/chrome/browser/ui/views/payments/error_message_view_controller.cc index a02a952..5eb7f1d 100644 --- a/chrome/browser/ui/views/payments/error_message_view_controller.cc +++ b/chrome/browser/ui/views/payments/error_message_view_controller.cc
@@ -11,8 +11,9 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/geometry/insets.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" @@ -32,8 +33,7 @@ // views::Label: void OnThemeChanged() override { Label::OnThemeChanged(); - SetEnabledColor(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityHigh)); + SetEnabledColor(GetColorProvider()->GetColor(ui::kColorAlertHighSeverity)); } };
diff --git a/chrome/browser/ui/views/payments/error_message_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/error_message_view_controller_browsertest.cc index 7c12211..544dd94 100644 --- a/chrome/browser/ui/views/payments/error_message_view_controller_browsertest.cc +++ b/chrome/browser/ui/views/payments/error_message_view_controller_browsertest.cc
@@ -17,11 +17,14 @@ namespace payments { class PaymentRequestErrorMessageTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestErrorMessageTest(const PaymentRequestErrorMessageTest&) = + delete; + PaymentRequestErrorMessageTest& operator=( + const PaymentRequestErrorMessageTest&) = delete; + protected: PaymentRequestErrorMessageTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestErrorMessageTest); }; // Testing the use of the complete('fail') JS API and the error message.
diff --git a/chrome/browser/ui/views/payments/modifiers_browsertest.cc b/chrome/browser/ui/views/payments/modifiers_browsertest.cc index fe264ff..2fcf286 100644 --- a/chrome/browser/ui/views/payments/modifiers_browsertest.cc +++ b/chrome/browser/ui/views/payments/modifiers_browsertest.cc
@@ -19,6 +19,11 @@ namespace payments { class PaymentRequestModifiersTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestModifiersTest(const PaymentRequestModifiersTest&) = delete; + PaymentRequestModifiersTest& operator=(const PaymentRequestModifiersTest&) = + delete; + protected: PaymentRequestModifiersTest() {} @@ -43,8 +48,6 @@ private: base::test::ScopedFeatureList feature_list_; - - DISALLOW_COPY_AND_ASSIGN(PaymentRequestModifiersTest); }; IN_PROC_BROWSER_TEST_F(PaymentRequestModifiersTest,
diff --git a/chrome/browser/ui/views/payments/order_summary_view_controller.cc b/chrome/browser/ui/views/payments/order_summary_view_controller.cc index 953fa23e..097d67e 100644 --- a/chrome/browser/ui/views/payments/order_summary_view_controller.cc +++ b/chrome/browser/ui/views/payments/order_summary_view_controller.cc
@@ -17,6 +17,8 @@ #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/font.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/border.h" @@ -46,9 +48,7 @@ kRowVerticalInset, payments::kPaymentRequestRowHorizontalInsets, kRowVerticalInset, payments::kPaymentRequestRowHorizontalInsets); SetBorder(payments::CreatePaymentRequestRowBorder( - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_SeparatorColor), - row_insets)); + GetColorProvider()->GetColor(ui::kColorSeparator), row_insets)); } };
diff --git a/chrome/browser/ui/views/payments/order_summary_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/order_summary_view_controller_browsertest.cc index 06b76b15..af2759b 100644 --- a/chrome/browser/ui/views/payments/order_summary_view_controller_browsertest.cc +++ b/chrome/browser/ui/views/payments/order_summary_view_controller_browsertest.cc
@@ -16,11 +16,14 @@ class PaymentRequestOrderSummaryViewControllerTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestOrderSummaryViewControllerTest( + const PaymentRequestOrderSummaryViewControllerTest&) = delete; + PaymentRequestOrderSummaryViewControllerTest& operator=( + const PaymentRequestOrderSummaryViewControllerTest&) = delete; + protected: PaymentRequestOrderSummaryViewControllerTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestOrderSummaryViewControllerTest); }; IN_PROC_BROWSER_TEST_F(PaymentRequestOrderSummaryViewControllerTest,
diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc index fa57b9b..44b9b9fc 100644 --- a/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc
@@ -22,6 +22,12 @@ namespace payments { class PaymentMethodViewControllerTest : public PaymentRequestBrowserTestBase { + public: + PaymentMethodViewControllerTest(const PaymentMethodViewControllerTest&) = + delete; + PaymentMethodViewControllerTest& operator=( + const PaymentMethodViewControllerTest&) = delete; + protected: PaymentMethodViewControllerTest() : gpay_server_(net::EmbeddedTestServer::TYPE_HTTPS), @@ -58,8 +64,6 @@ private: net::EmbeddedTestServer gpay_server_; net::EmbeddedTestServer kylepay_server_; - - DISALLOW_COPY_AND_ASSIGN(PaymentMethodViewControllerTest); }; IN_PROC_BROWSER_TEST_F(PaymentMethodViewControllerTest, OneCardSelected) {
diff --git a/chrome/browser/ui/views/payments/payment_request_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_browsertest.cc index d17f51d..01ac092 100644 --- a/chrome/browser/ui/views/payments/payment_request_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_browsertest.cc
@@ -38,11 +38,14 @@ class PaymentRequestWebContentsManagerTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestWebContentsManagerTest( + const PaymentRequestWebContentsManagerTest&) = delete; + PaymentRequestWebContentsManagerTest& operator=( + const PaymentRequestWebContentsManagerTest&) = delete; + protected: PaymentRequestWebContentsManagerTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestWebContentsManagerTest); }; // If the page creates multiple PaymentRequest objects, it should not crash. @@ -54,11 +57,13 @@ } class PaymentRequestNoShippingTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestNoShippingTest(const PaymentRequestNoShippingTest&) = delete; + PaymentRequestNoShippingTest& operator=(const PaymentRequestNoShippingTest&) = + delete; + protected: PaymentRequestNoShippingTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestNoShippingTest); }; IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, InactiveBrowserWindow) { @@ -179,11 +184,12 @@ } class PaymentRequestAbortTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestAbortTest(const PaymentRequestAbortTest&) = delete; + PaymentRequestAbortTest& operator=(const PaymentRequestAbortTest&) = delete; + protected: PaymentRequestAbortTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestAbortTest); }; // Testing the use of the abort() JS API. @@ -235,6 +241,12 @@ class PaymentRequestPaymentMethodIdentifierTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestPaymentMethodIdentifierTest( + const PaymentRequestPaymentMethodIdentifierTest&) = delete; + PaymentRequestPaymentMethodIdentifierTest& operator=( + const PaymentRequestPaymentMethodIdentifierTest&) = delete; + protected: PaymentRequestPaymentMethodIdentifierTest() {} @@ -245,9 +257,6 @@ WaitForObservedEvent(); } - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestPaymentMethodIdentifierTest); }; // One network is specified in 'basic-card' data, one in supportedMethods. @@ -316,6 +325,11 @@ // interactive manner for visual testing. class PaymentsRequestVisualTest : public SupportsTestDialog<PaymentRequestNoShippingTest> { + public: + PaymentsRequestVisualTest(const PaymentsRequestVisualTest&) = delete; + PaymentsRequestVisualTest& operator=(const PaymentsRequestVisualTest&) = + delete; + protected: PaymentsRequestVisualTest() {} @@ -327,9 +341,6 @@ // show, but not the close, resulting in a DCHECK in its destructor. return true; } - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentsRequestVisualTest); }; IN_PROC_BROWSER_TEST_F(PaymentsRequestVisualTest, InvokeUi_NoShipping) { @@ -338,11 +349,14 @@ } class PaymentRequestSettingsLinkTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestSettingsLinkTest(const PaymentRequestSettingsLinkTest&) = + delete; + PaymentRequestSettingsLinkTest& operator=( + const PaymentRequestSettingsLinkTest&) = delete; + protected: PaymentRequestSettingsLinkTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestSettingsLinkTest); }; // Tests that clicking the settings link brings the user to settings.
diff --git a/chrome/browser/ui/views/payments/payment_request_browsertest_base.h b/chrome/browser/ui/views/payments/payment_request_browsertest_base.h index fd6605bb..917415c 100644 --- a/chrome/browser/ui/views/payments/payment_request_browsertest_base.h +++ b/chrome/browser/ui/views/payments/payment_request_browsertest_base.h
@@ -94,6 +94,10 @@ PAYMENT_HANDLER_WINDOW_OPENED, }; + PaymentRequestBrowserTestBase(const PaymentRequestBrowserTestBase&) = delete; + PaymentRequestBrowserTestBase& operator=( + const PaymentRequestBrowserTestBase&) = delete; + base::WeakPtr<PaymentRequestBrowserTestBase> GetWeakPtr(); protected: @@ -285,7 +289,6 @@ bool skip_ui_for_basic_card_ = false; base::WeakPtrFactory<PaymentRequestBrowserTestBase> weak_ptr_factory_{this}; - DISALLOW_COPY_AND_ASSIGN(PaymentRequestBrowserTestBase); }; } // namespace payments
diff --git a/chrome/browser/ui/views/payments/payment_request_can_make_payment_metrics_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_can_make_payment_metrics_browsertest.cc index 571e93e..fb799c0 100644 --- a/chrome/browser/ui/views/payments/payment_request_can_make_payment_metrics_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_can_make_payment_metrics_browsertest.cc
@@ -23,6 +23,12 @@ class PaymentRequestCanMakePaymentMetricsTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestCanMakePaymentMetricsTest( + const PaymentRequestCanMakePaymentMetricsTest&) = delete; + PaymentRequestCanMakePaymentMetricsTest& operator=( + const PaymentRequestCanMakePaymentMetricsTest&) = delete; + protected: PaymentRequestCanMakePaymentMetricsTest() = default; @@ -50,9 +56,6 @@ // Wait for all callbacks to run. base::RunLoop().RunUntilIdle(); } - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestCanMakePaymentMetricsTest); }; IN_PROC_BROWSER_TEST_F(PaymentRequestCanMakePaymentMetricsTest,
diff --git a/chrome/browser/ui/views/payments/payment_request_item_list.h b/chrome/browser/ui/views/payments/payment_request_item_list.h index 22e77fe..7a8c5cc 100644 --- a/chrome/browser/ui/views/payments/payment_request_item_list.h +++ b/chrome/browser/ui/views/payments/payment_request_item_list.h
@@ -122,6 +122,10 @@ explicit PaymentRequestItemList( base::WeakPtr<PaymentRequestDialogView> dialog); + + PaymentRequestItemList(const PaymentRequestItemList&) = delete; + PaymentRequestItemList& operator=(const PaymentRequestItemList&) = delete; + virtual ~PaymentRequestItemList(); // Adds an item to this list. |item->list()| should return this object. @@ -149,8 +153,6 @@ std::vector<std::unique_ptr<Item>> items_; Item* selected_item_; base::WeakPtr<PaymentRequestDialogView> dialog_; - - DISALLOW_COPY_AND_ASSIGN(PaymentRequestItemList); }; } // namespace payments
diff --git a/chrome/browser/ui/views/payments/payment_request_item_list_unittest.cc b/chrome/browser/ui/views/payments/payment_request_item_list_unittest.cc index b0311dfb..f68397f 100644 --- a/chrome/browser/ui/views/payments/payment_request_item_list_unittest.cc +++ b/chrome/browser/ui/views/payments/payment_request_item_list_unittest.cc
@@ -38,6 +38,9 @@ Init(); } + TestListItem(const TestListItem&) = delete; + TestListItem& operator=(const TestListItem&) = delete; + int selected_state_changed_calls_count() { return selected_state_changed_calls_count_; } @@ -61,8 +64,6 @@ } int selected_state_changed_calls_count_; - - DISALLOW_COPY_AND_ASSIGN(TestListItem); }; } // namespace
diff --git a/chrome/browser/ui/views/payments/payment_request_journey_logger_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_journey_logger_browsertest.cc index 66d5e45..6d2d4df 100644 --- a/chrome/browser/ui/views/payments/payment_request_journey_logger_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_journey_logger_browsertest.cc
@@ -1016,6 +1016,10 @@ } class PaymentRequestIframeTest : public PaymentRequestJourneyLoggerTestBase { + public: + PaymentRequestIframeTest(const PaymentRequestIframeTest&) = delete; + PaymentRequestIframeTest& operator=(const PaymentRequestIframeTest&) = delete; + protected: PaymentRequestIframeTest() {} @@ -1026,9 +1030,6 @@ } std::unique_ptr<ukm::TestAutoSetUkmRecorder> test_ukm_recorder_; - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestIframeTest); }; IN_PROC_BROWSER_TEST_F(PaymentRequestIframeTest, CrossOriginIframe) {
diff --git a/chrome/browser/ui/views/payments/payment_request_no_update_with_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_no_update_with_browsertest.cc index a1c3325..71e2b91 100644 --- a/chrome/browser/ui/views/payments/payment_request_no_update_with_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_no_update_with_browsertest.cc
@@ -14,6 +14,12 @@ namespace payments { class PaymentRequestNoUpdateWithTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestNoUpdateWithTest(const PaymentRequestNoUpdateWithTest&) = + delete; + PaymentRequestNoUpdateWithTest& operator=( + const PaymentRequestNoUpdateWithTest&) = delete; + protected: PaymentRequestNoUpdateWithTest() {} @@ -26,9 +32,6 @@ WaitForObservedEvent(); } - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestNoUpdateWithTest); }; // A merchant that does not listen to shipping address update events will not
diff --git a/chrome/browser/ui/views/payments/payment_request_payment_app_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_payment_app_browsertest.cc index 3e02f7f..9b91e60 100644 --- a/chrome/browser/ui/views/payments/payment_request_payment_app_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_payment_app_browsertest.cc
@@ -31,6 +31,11 @@ namespace payments { class PaymentRequestPaymentAppTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestPaymentAppTest(const PaymentRequestPaymentAppTest&) = delete; + PaymentRequestPaymentAppTest& operator=(const PaymentRequestPaymentAppTest&) = + delete; + protected: PaymentRequestPaymentAppTest() : alicepay_(net::EmbeddedTestServer::TYPE_HTTPS), @@ -171,8 +176,6 @@ net::EmbeddedTestServer kylepay_; base::test::ScopedFeatureList scoped_feature_list_; - - DISALLOW_COPY_AND_ASSIGN(PaymentRequestPaymentAppTest); }; // Test payment request methods are not supported by the payment app.
diff --git a/chrome/browser/ui/views/payments/payment_request_payment_response_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_payment_response_browsertest.cc index 7781f79..2d0d0d8c 100644 --- a/chrome/browser/ui/views/payments/payment_request_payment_response_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_payment_response_browsertest.cc
@@ -22,11 +22,14 @@ class PaymentRequestPaymentResponseAutofillPaymentAppTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestPaymentResponseAutofillPaymentAppTest( + const PaymentRequestPaymentResponseAutofillPaymentAppTest&) = delete; + PaymentRequestPaymentResponseAutofillPaymentAppTest& operator=( + const PaymentRequestPaymentResponseAutofillPaymentAppTest&) = delete; + protected: PaymentRequestPaymentResponseAutofillPaymentAppTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestPaymentResponseAutofillPaymentAppTest); }; // Tests that the PaymentResponse contains all the required fields for an @@ -69,11 +72,14 @@ class PaymentRequestPaymentResponseShippingAddressTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestPaymentResponseShippingAddressTest( + const PaymentRequestPaymentResponseShippingAddressTest&) = delete; + PaymentRequestPaymentResponseShippingAddressTest& operator=( + const PaymentRequestPaymentResponseShippingAddressTest&) = delete; + protected: PaymentRequestPaymentResponseShippingAddressTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestPaymentResponseShippingAddressTest); }; // Tests that the PaymentResponse contains all the required fields for a @@ -114,11 +120,14 @@ class PaymentRequestPaymentResponseAllContactDetailsTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestPaymentResponseAllContactDetailsTest( + const PaymentRequestPaymentResponseAllContactDetailsTest&) = delete; + PaymentRequestPaymentResponseAllContactDetailsTest& operator=( + const PaymentRequestPaymentResponseAllContactDetailsTest&) = delete; + protected: PaymentRequestPaymentResponseAllContactDetailsTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestPaymentResponseAllContactDetailsTest); }; // Tests that the PaymentResponse contains all the required fields for contact @@ -184,11 +193,14 @@ class PaymentRequestPaymentResponseOneContactDetailTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestPaymentResponseOneContactDetailTest( + const PaymentRequestPaymentResponseOneContactDetailTest&) = delete; + PaymentRequestPaymentResponseOneContactDetailTest& operator=( + const PaymentRequestPaymentResponseOneContactDetailTest&) = delete; + protected: PaymentRequestPaymentResponseOneContactDetailTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestPaymentResponseOneContactDetailTest); }; // Tests that the PaymentResponse contains all the required fields for contact
diff --git a/chrome/browser/ui/views/payments/payment_request_row_view.cc b/chrome/browser/ui/views/payments/payment_request_row_view.cc index 1ce5199..73883e4a 100644 --- a/chrome/browser/ui/views/payments/payment_request_row_view.cc +++ b/chrome/browser/ui/views/payments/payment_request_row_view.cc
@@ -10,7 +10,8 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/metadata/metadata_impl_macros.h" -#include "ui/native_theme/native_theme.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" @@ -69,8 +70,8 @@ } void PaymentRequestRowView::SetActiveBackground() { - // TODO(crbug/976890): Check whether we can GetSystemColor from a NativeTheme - // ColorId instead of hard code here. + // TODO(crbug/976890): Check whether we can GetColor from a ColorId instead of + // hard code here. SetBackground(views::CreateSolidBackground(SkColorSetA(SK_ColorBLACK, 0x0D))); } @@ -93,12 +94,11 @@ // Widget. // TODO(crbug.com/1213247): Update PaymentRequestSheetController to recompute // the bounds of its ScrollView in response to changes in preferred size. - SetBorder(bottom_separator_visible_ && GetWidget() - ? payments::CreatePaymentRequestRowBorder( - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_SeparatorColor), - insets_) - : views::CreateEmptyBorder(insets_)); + SetBorder( + bottom_separator_visible_ && GetWidget() + ? payments::CreatePaymentRequestRowBorder( + GetColorProvider()->GetColor(ui::kColorSeparator), insets_) + : views::CreateEmptyBorder(insets_)); } void PaymentRequestRowView::SetIsHighlighted(bool highlighted) {
diff --git a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc index ae47571..07e31aa 100644 --- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc +++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
@@ -16,6 +16,7 @@ #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/insets.h" @@ -193,9 +194,7 @@ ScrollView::OnThemeChanged(); SetBorder(views::CreateBorderPainter( std::make_unique<BorderedScrollViewBorderPainter>( - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_SeparatorColor), - this), + GetColorProvider()->GetColor(ui::kColorSeparator), this), gfx::Insets(1, 0))); } };
diff --git a/chrome/browser/ui/views/payments/payment_request_shipping_address_instance_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_shipping_address_instance_browsertest.cc index 79dd1c0..50d95cb 100644 --- a/chrome/browser/ui/views/payments/payment_request_shipping_address_instance_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_shipping_address_instance_browsertest.cc
@@ -16,11 +16,14 @@ class PaymentRequestShippingAddressInstanceTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestShippingAddressInstanceTest( + const PaymentRequestShippingAddressInstanceTest&) = delete; + PaymentRequestShippingAddressInstanceTest& operator=( + const PaymentRequestShippingAddressInstanceTest&) = delete; + protected: PaymentRequestShippingAddressInstanceTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestShippingAddressInstanceTest); }; // If the page creates multiple PaymentRequest objects, it should not crash.
diff --git a/chrome/browser/ui/views/payments/payment_request_show_promise_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_show_promise_browsertest.cc index 4e1c762..01adee07 100644 --- a/chrome/browser/ui/views/payments/payment_request_show_promise_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_show_promise_browsertest.cc
@@ -19,6 +19,11 @@ namespace { class PaymentRequestShowPromiseTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestShowPromiseTest(const PaymentRequestShowPromiseTest&) = delete; + PaymentRequestShowPromiseTest& operator=( + const PaymentRequestShowPromiseTest&) = delete; + protected: PaymentRequestShowPromiseTest() {} ~PaymentRequestShowPromiseTest() override {} @@ -116,9 +121,6 @@ {DialogEvent::PROCESSING_SPINNER_SHOWN, DialogEvent::DIALOG_CLOSED}); ClickOnDialogViewAndWait(DialogViewID::PAY_BUTTON, dialog_view()); } - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestShowPromiseTest); }; IN_PROC_BROWSER_TEST_F(PaymentRequestShowPromiseTest, SingleOptionShipping) {
diff --git a/chrome/browser/ui/views/payments/payment_request_update_with_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_update_with_browsertest.cc index 48eb1ffa..da24f405 100644 --- a/chrome/browser/ui/views/payments/payment_request_update_with_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_update_with_browsertest.cc
@@ -14,6 +14,11 @@ namespace payments { class PaymentRequestUpdateWithTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestUpdateWithTest(const PaymentRequestUpdateWithTest&) = delete; + PaymentRequestUpdateWithTest& operator=(const PaymentRequestUpdateWithTest&) = + delete; + protected: PaymentRequestUpdateWithTest() {} @@ -26,9 +31,6 @@ WaitForObservedEvent(); } - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestUpdateWithTest); }; IN_PROC_BROWSER_TEST_F(PaymentRequestUpdateWithTest, UpdateWithEmpty) {
diff --git a/chrome/browser/ui/views/payments/payment_request_use_stats_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_use_stats_browsertest.cc index 24982c6..c3e24f1f 100644 --- a/chrome/browser/ui/views/payments/payment_request_use_stats_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_use_stats_browsertest.cc
@@ -30,11 +30,14 @@ class PaymentRequestAutofillInstrumentUseStatsTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestAutofillInstrumentUseStatsTest( + const PaymentRequestAutofillInstrumentUseStatsTest&) = delete; + PaymentRequestAutofillInstrumentUseStatsTest& operator=( + const PaymentRequestAutofillInstrumentUseStatsTest&) = delete; + protected: PaymentRequestAutofillInstrumentUseStatsTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestAutofillInstrumentUseStatsTest); }; // Tests that use stats for the autofill payment instrument used in a Payment @@ -75,11 +78,14 @@ class PaymentRequestShippingAddressUseStatsTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestShippingAddressUseStatsTest( + const PaymentRequestShippingAddressUseStatsTest&) = delete; + PaymentRequestShippingAddressUseStatsTest& operator=( + const PaymentRequestShippingAddressUseStatsTest&) = delete; + protected: PaymentRequestShippingAddressUseStatsTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestShippingAddressUseStatsTest); }; // Tests that use stats for the shipping address used in a Payment Request are @@ -125,11 +131,14 @@ class PaymentRequestContactAddressUseStatsTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestContactAddressUseStatsTest( + const PaymentRequestContactAddressUseStatsTest&) = delete; + PaymentRequestContactAddressUseStatsTest& operator=( + const PaymentRequestContactAddressUseStatsTest&) = delete; + protected: PaymentRequestContactAddressUseStatsTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestContactAddressUseStatsTest); }; // Tests that use stats for the contact address used in a Payment Request are @@ -174,12 +183,14 @@ class PaymentRequestSameShippingAndContactAddressUseStatsTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestSameShippingAndContactAddressUseStatsTest( + const PaymentRequestSameShippingAndContactAddressUseStatsTest&) = delete; + PaymentRequestSameShippingAndContactAddressUseStatsTest& operator=( + const PaymentRequestSameShippingAndContactAddressUseStatsTest&) = delete; + protected: PaymentRequestSameShippingAndContactAddressUseStatsTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN( - PaymentRequestSameShippingAndContactAddressUseStatsTest); }; // Tests that use stats for an address that was used both as a shipping and
diff --git a/chrome/browser/ui/views/payments/payment_request_views_util.cc b/chrome/browser/ui/views/payments/payment_request_views_util.cc index 5886874d..c1e87b83f 100644 --- a/chrome/browser/ui/views/payments/payment_request_views_util.cc +++ b/chrome/browser/ui/views/payments/payment_request_views_util.cc
@@ -34,6 +34,7 @@ #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" @@ -66,7 +67,7 @@ explicit ThemeTrackingLabel(const std::u16string& text) : Label(text) {} ~ThemeTrackingLabel() override = default; - void set_enabled_color_id(ui::NativeTheme::ColorId enabled_color_id) { + void set_enabled_color_id(ui::ColorId enabled_color_id) { enabled_color_id_ = enabled_color_id; } @@ -74,11 +75,11 @@ void OnThemeChanged() override { Label::OnThemeChanged(); if (enabled_color_id_.has_value()) - SetEnabledColor(GetNativeTheme()->GetSystemColor(*enabled_color_id_)); + SetEnabledColor(GetColorProvider()->GetColor(*enabled_color_id_)); } private: - absl::optional<ui::NativeTheme::ColorId> enabled_color_id_; + absl::optional<ui::ColorId> enabled_color_id_; }; BEGIN_METADATA(ThemeTrackingLabel, views::Label) @@ -136,7 +137,7 @@ label->SetID(static_cast<int>(DialogViewID::PROFILE_LABEL_LINE_1)); label->SetHorizontalAlignment(gfx::ALIGN_LEFT); if (!enabled) - label->set_enabled_color_id(ui::NativeTheme::kColorId_LabelDisabledColor); + label->set_enabled_color_id(ui::kColorLabelForegroundDisabled); container->AddChildView(std::move(label)); } @@ -145,7 +146,7 @@ label->SetID(static_cast<int>(DialogViewID::PROFILE_LABEL_LINE_2)); label->SetHorizontalAlignment(gfx::ALIGN_LEFT); if (!enabled) - label->set_enabled_color_id(ui::NativeTheme::kColorId_LabelDisabledColor); + label->set_enabled_color_id(ui::kColorLabelForegroundDisabled); container->AddChildView(std::move(label)); } @@ -154,7 +155,7 @@ label->SetID(static_cast<int>(DialogViewID::PROFILE_LABEL_LINE_3)); label->SetHorizontalAlignment(gfx::ALIGN_LEFT); if (!enabled) - label->set_enabled_color_id(ui::NativeTheme::kColorId_LabelDisabledColor); + label->set_enabled_color_id(ui::kColorLabelForegroundDisabled); container->AddChildView(std::move(label)); } @@ -191,7 +192,7 @@ label->SetTextContext(CONTEXT_DIALOG_BODY_TEXT_SMALL); label->SetID(static_cast<int>(DialogViewID::PROFILE_LABEL_ERROR)); // Missing information typically has a nice shade of blue. - label->set_enabled_color_id(ui::NativeTheme::kColorId_LinkEnabled); + label->set_enabled_color_id(ui::kColorLinkForeground); return label; } @@ -494,7 +495,7 @@ warning_icon->SetImage(ui::ImageModel::FromVectorIcon( vector_icons::kWarningIcon, ui::kColorAlertHighSeverity, 16)); header_view->AddChildView(std::move(warning_icon)); - label->set_enabled_color_id(ui::NativeTheme::kColorId_AlertSeverityHigh); + label->set_enabled_color_id(ui::kColorAlertHighSeverity); } header_view->AddChildView(std::move(label));
diff --git a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc index e02ee22..7fd7da2 100644 --- a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc +++ b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
@@ -251,6 +251,9 @@ const std::u16string& section_name) : controller_(controller), section_name_(section_name) {} + PaymentSheetRowBuilder(const PaymentSheetRowBuilder&) = delete; + PaymentSheetRowBuilder& operator=(const PaymentSheetRowBuilder&) = delete; + PaymentSheetRowBuilder& Closure(base::RepeatingClosure closure) { closure_ = std::move(closure); return *this; @@ -360,7 +363,6 @@ std::u16string accessible_content_; base::RepeatingClosure closure_; int id_; - DISALLOW_COPY_AND_ASSIGN(PaymentSheetRowBuilder); }; } // namespace
diff --git a/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.cc b/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.cc index 6fed68e..fedcf20 100644 --- a/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.cc +++ b/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.cc
@@ -14,6 +14,8 @@ #include "components/payments/content/secure_payment_confirmation_model.h" #include "components/payments/core/sizes.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/views/border.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" @@ -41,9 +43,7 @@ void OnThemeChanged() override { View::OnThemeChanged(); SetBorder(views::CreateSolidSidedBorder( - 0, 0, 1, 0, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_SeparatorColor))); + 0, 0, 1, 0, GetColorProvider()->GetColor(ui::kColorSeparator))); } };
diff --git a/chrome/browser/ui/views/payments/shipping_option_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/shipping_option_view_controller_browsertest.cc index c1ef3c924..f0a0801b 100644 --- a/chrome/browser/ui/views/payments/shipping_option_view_controller_browsertest.cc +++ b/chrome/browser/ui/views/payments/shipping_option_view_controller_browsertest.cc
@@ -17,11 +17,14 @@ class PaymentRequestShippingOptionViewControllerTest : public PaymentRequestBrowserTestBase { + public: + PaymentRequestShippingOptionViewControllerTest( + const PaymentRequestShippingOptionViewControllerTest&) = delete; + PaymentRequestShippingOptionViewControllerTest& operator=( + const PaymentRequestShippingOptionViewControllerTest&) = delete; + protected: PaymentRequestShippingOptionViewControllerTest() {} - - private: - DISALLOW_COPY_AND_ASSIGN(PaymentRequestShippingOptionViewControllerTest); }; IN_PROC_BROWSER_TEST_F(PaymentRequestShippingOptionViewControllerTest,
diff --git a/chrome/browser/ui/views/payments/view_stack_unittest.cc b/chrome/browser/ui/views/payments/view_stack_unittest.cc index e6b6884..0de1ae8 100644 --- a/chrome/browser/ui/views/payments/view_stack_unittest.cc +++ b/chrome/browser/ui/views/payments/view_stack_unittest.cc
@@ -27,6 +27,10 @@ }; TestStackView() {} + + TestStackView(const TestStackView&) = delete; + TestStackView& operator=(const TestStackView&) = delete; + ~TestStackView() override { for (auto& observer: observers_) { observer.OnViewBeingDeleted(); @@ -39,8 +43,6 @@ private: base::ObserverList<Observer>::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(TestStackView); }; class ViewStackTest : public ChromeViewsTestBase { @@ -54,6 +56,9 @@ base::TimeDelta::FromMilliseconds(1)); } + ViewStackTest(const ViewStackTest&) = delete; + ViewStackTest& operator=(const ViewStackTest&) = delete; + void AssertViewOnTopOfStack(views::View* view) { gfx::Rect target = view_stack_->bounds(); target.set_origin(gfx::Point(0, 0)); @@ -98,8 +103,6 @@ } std::unique_ptr<ViewStack> view_stack_; - - DISALLOW_COPY_AND_ASSIGN(ViewStackTest); }; TEST_F(ViewStackTest, TestInitialStateAddedAsChildView) {
diff --git a/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.h b/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.h index 25af4b9..06e4ba9 100644 --- a/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.h +++ b/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.h
@@ -26,8 +26,12 @@ public plugin_vm::PluginVmInstaller::Observer { public: METADATA_HEADER(PluginVmInstallerView); + explicit PluginVmInstallerView(Profile* profile); + PluginVmInstallerView(const PluginVmInstallerView&) = delete; + PluginVmInstallerView& operator=(const PluginVmInstallerView&) = delete; + static PluginVmInstallerView* GetActiveViewForTesting(); // views::BubbleDialogDelegateView implementation. @@ -101,8 +105,6 @@ absl::optional<plugin_vm::PluginVmInstaller::FailureReason> reason_; base::OnceCallback<void(bool success)> finished_callback_for_testing_; - - DISALLOW_COPY_AND_ASSIGN(PluginVmInstallerView); }; #endif // CHROME_BROWSER_UI_VIEWS_PLUGIN_VM_PLUGIN_VM_INSTALLER_VIEW_H_
diff --git a/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view_browsertest.cc b/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view_browsertest.cc index 9c01593b..a29de73f 100644 --- a/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view_browsertest.cc +++ b/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view_browsertest.cc
@@ -61,6 +61,11 @@ public: PluginVmInstallerViewBrowserTest() = default; + PluginVmInstallerViewBrowserTest(const PluginVmInstallerViewBrowserTest&) = + delete; + PluginVmInstallerViewBrowserTest& operator=( + const PluginVmInstallerViewBrowserTest&) = delete; + void SetUpOnMainThread() override { ASSERT_TRUE(embedded_test_server()->Start()); fake_concierge_client_ = chromeos::FakeConciergeClient::Get(); @@ -183,8 +188,6 @@ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, std::move(quit_closure)); } - - DISALLOW_COPY_AND_ASSIGN(PluginVmInstallerViewBrowserTest); }; class PluginVmInstallerViewBrowserTestWithFeatureEnabled
diff --git a/chrome/browser/ui/views/profiles/badged_profile_photo.cc b/chrome/browser/ui/views/profiles/badged_profile_photo.cc index 27f0fa9..5b036ab6 100644 --- a/chrome/browser/ui/views/profiles/badged_profile_photo.cc +++ b/chrome/browser/ui/views/profiles/badged_profile_photo.cc
@@ -8,11 +8,12 @@ #include "chrome/browser/profiles/profile_avatar_icon_util.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/image/image.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/controls/image_view.h" namespace { @@ -72,32 +73,27 @@ case BadgedProfilePhoto::BADGE_TYPE_SUPERVISOR: SetImage(gfx::CreateVectorIcon( kSupervisorAccountCircleIcon, kBadgeIconSize, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DefaultIconColor))); + GetColorProvider()->GetColor(ui::kColorIcon))); break; case BadgedProfilePhoto::BADGE_TYPE_CHILD: SetImage(gfx::CreateVectorIcon( kAccountChildCircleIcon, kBadgeIconSize, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DefaultIconColor))); + GetColorProvider()->GetColor(ui::kColorIcon))); break; case BadgedProfilePhoto::BADGE_TYPE_SYNC_COMPLETE: SetImage(gfx::CreateVectorIcon( kSyncCircleIcon, kBadgeIconSize, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityLow))); + GetColorProvider()->GetColor(ui::kColorAlertLowSeverity))); break; case BadgedProfilePhoto::BADGE_TYPE_SYNC_ERROR: SetImage(gfx::CreateVectorIcon( kSyncErrorCircleIcon, kBadgeIconSize, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityHigh))); + GetColorProvider()->GetColor(ui::kColorAlertHighSeverity))); break; case BadgedProfilePhoto::BADGE_TYPE_SYNC_PAUSED: SetImage(gfx::CreateVectorIcon( kSyncPausedCircleIcon, kBadgeIconSize, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_ProminentButtonColor))); + GetColorProvider()->GetColor(ui::kColorButtonBackgroundProminent))); break; case BadgedProfilePhoto::BADGE_TYPE_SYNC_DISABLED: SetImage(gfx::CreateVectorIcon(kSyncCircleIcon, kBadgeIconSize,
diff --git a/chrome/browser/ui/views/profiles/profile_menu_view.cc b/chrome/browser/ui/views/profiles/profile_menu_view.cc index a2da5902..97bce15 100644 --- a/chrome/browser/ui/views/profiles/profile_menu_view.cc +++ b/chrome/browser/ui/views/profiles/profile_menu_view.cc
@@ -63,9 +63,9 @@ #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/image/canvas_image_source.h" #include "ui/gfx/image/image_skia_operations.h" -#include "ui/native_theme/native_theme.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/accessibility/view_accessibility.h" @@ -192,18 +192,17 @@ } absl::optional<AvatarSyncErrorType> error = GetAvatarSyncErrorType(profile); + const auto* color_provider = GetColorProvider(); if (!error) { - return ColoredImageForMenu( - kSyncCircleIcon, GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityLow)); + return ColoredImageForMenu( + kSyncCircleIcon, color_provider->GetColor(ui::kColorAlertLowSeverity)); } - ui::NativeTheme::ColorId color_id = - error == AvatarSyncErrorType::kAuthError - ? ui::NativeTheme::kColorId_ProminentButtonColor - : ui::NativeTheme::kColorId_AlertSeverityHigh; + ui::ColorId color_id = error == AvatarSyncErrorType::kAuthError + ? ui::kColorButtonBackgroundProminent + : ui::kColorAlertHighSeverity; return ColoredImageForMenu(kSyncPausedCircleIcon, - GetNativeTheme()->GetSystemColor(color_id)); + color_provider->GetColor(color_id)); } std::u16string ProfileMenuView::GetAccessibleWindowTitle() const { @@ -518,8 +517,8 @@ GetAvatarSyncErrorDescription(*error, is_sync_feature_enabled), GetSyncErrorButtonText(*error), error == AvatarSyncErrorType::kAuthError - ? ui::NativeTheme::kColorId_SyncInfoContainerPaused - : ui::NativeTheme::kColorId_SyncInfoContainerError, + ? ui::kColorSyncInfoBackgroundPaused + : ui::kColorSyncInfoBackgroundError, base::BindRepeating(&ProfileMenuView::OnSyncErrorButtonClicked, base::Unretained(this), *error), /*show_sync_badge=*/is_sync_feature_enabled); @@ -545,7 +544,7 @@ BuildSyncInfoWithCallToAction( l10n_util::GetStringUTF16(IDS_PROFILES_DICE_NOT_SYNCING_TITLE), l10n_util::GetStringUTF16(IDS_PROFILES_DICE_SIGNIN_BUTTON), - ui::NativeTheme::kColorId_SyncInfoContainerNoPrimaryAccount, + ui::kColorSyncInfoBackground, base::BindRepeating(&ProfileMenuView::OnSigninAccountButtonClicked, base::Unretained(this), account_info), /*show_sync_badge=*/true); @@ -557,7 +556,7 @@ BuildSyncInfoWithCallToAction( l10n_util::GetStringUTF16(IDS_PROFILES_DICE_SYNC_PROMO), l10n_util::GetStringUTF16(IDS_PROFILES_DICE_SIGNIN_BUTTON), - ui::NativeTheme::kColorId_SyncInfoContainerNoPrimaryAccount, + ui::kColorSyncInfoBackground, base::BindRepeating(&ProfileMenuView::OnSigninButtonClicked, base::Unretained(this)), /*show_sync_badge=*/false);
diff --git a/chrome/browser/ui/views/profiles/profile_menu_view_base.cc b/chrome/browser/ui/views/profiles/profile_menu_view_base.cc index 272923c..7f8f15b 100644 --- a/chrome/browser/ui/views/profiles/profile_menu_view_base.cc +++ b/chrome/browser/ui/views/profiles/profile_menu_view_base.cc
@@ -36,6 +36,7 @@ #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/gfx/canvas.h" @@ -210,8 +211,8 @@ const SkScalar kButtonRadius = (kCircularImageButtonSize + 2 * kBorderThickness) / 2.0f; - SkColor icon_color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DefaultIconColor); + const auto* color_provider = GetColorProvider(); + SkColor icon_color = color_provider->GetColor(ui::kColorIcon); if (background_profile_color_ != SK_ColorTRANSPARENT) icon_color = GetProfileForegroundIconColor(background_profile_color_); gfx::ImageSkia image = @@ -221,8 +222,8 @@ views::InkDrop::Get(this)->SetBaseColor(icon_color); if (show_border_) { - const SkColor separator_color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_MenuSeparatorColor); + const SkColor separator_color = + color_provider->GetColor(ui::kColorMenuSeparator); SetBorder(views::CreateRoundedRectBorder(kBorderThickness, kButtonRadius, separator_color)); } @@ -247,8 +248,7 @@ void OnThemeChanged() override { views::ImageView::OnThemeChanged(); constexpr int kIconSize = 16; - const SkColor icon_color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DefaultIconColor); + const SkColor icon_color = GetColorProvider()->GetColor(ui::kColorIcon); gfx::ImageSkia image = ImageForMenu(icon_, icon_to_image_ratio_, icon_color); SetImage(SizeImage(ColorImage(image, icon_color), kIconSize)); @@ -270,8 +270,7 @@ views::ImageView::OnThemeChanged(); constexpr float kIconToImageRatio = 0.75f; constexpr int kIconSize = 20; - const SkColor icon_color = GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DefaultIconColor); + const SkColor icon_color = GetColorProvider()->GetColor(ui::kColorIcon); gfx::ImageSkia image = ImageForMenu(icon_, kIconToImageRatio, icon_color); SetImage(SizeImage(image, kIconSize)); } @@ -321,8 +320,7 @@ private: SkColor GetBackgroundColor() const { - return GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_BubbleBackground); + return GetColorProvider()->GetColor(ui::kColorBubbleBackground); } ui::ImageModel avatar_image_; @@ -662,7 +660,7 @@ void ProfileMenuViewBase::BuildSyncInfoWithCallToAction( const std::u16string& description, const std::u16string& button_text, - ui::NativeTheme::ColorId background_color_id, + ui::ColorId background_color_id, const base::RepeatingClosure& action, bool show_sync_badge) { const int kDescriptionIconSpacing = @@ -748,7 +746,7 @@ base::Unretained(this), std::move(action)), this, text)); - // No background required, so ui::NativeTheme isn't needed and + // No background required, so ui::ColorProvider isn't needed and // |sync_info_background_callback_| can be set to base::DoNothing(). sync_info_container_->SetBackground(nullptr); sync_info_background_callback_ = base::DoNothing(); @@ -1001,17 +999,15 @@ } void ProfileMenuViewBase::BuildSyncInfoCallToActionBackground( - ui::NativeTheme::ColorId background_color_id, - ui::NativeTheme* native_theme) { + ui::ColorId background_color_id, + const ui::ColorProvider* color_provider) { const int radius = views::LayoutProvider::Get()->GetCornerRadiusMetric( views::Emphasis::kHigh); sync_info_container_->SetBackground(views::CreateRoundedRectBackground( - native_theme->GetSystemColor(background_color_id), radius)); + color_provider->GetColor(background_color_id), radius)); sync_info_container_->SetBorder(views::CreatePaddedBorder( views::CreateRoundedRectBorder( - 1, radius, - native_theme->GetSystemColor( - ui::NativeTheme::kColorId_MenuSeparatorColor)), + 1, radius, color_provider->GetColor(ui::kColorMenuSeparator)), gfx::Insets(kSyncInfoInsidePadding))); } @@ -1022,9 +1018,10 @@ void ProfileMenuViewBase::OnThemeChanged() { views::BubbleDialogDelegateView::OnThemeChanged(); - SetBackground(views::CreateSolidBackground(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DialogBackground))); - sync_info_background_callback_.Run(GetNativeTheme()); + const auto* color_provider = GetColorProvider(); + SetBackground(views::CreateSolidBackground( + color_provider->GetColor(ui::kColorDialogBackground))); + sync_info_background_callback_.Run(color_provider); } void ProfileMenuViewBase::OnWindowClosing() {
diff --git a/chrome/browser/ui/views/profiles/profile_menu_view_base.h b/chrome/browser/ui/views/profiles/profile_menu_view_base.h index 9c0c0209..00c3df0 100644 --- a/chrome/browser/ui/views/profiles/profile_menu_view_base.h +++ b/chrome/browser/ui/views/profiles/profile_menu_view_base.h
@@ -19,6 +19,7 @@ #include "chrome/browser/ui/views/close_bubble_on_tab_activation_helper.h" #include "content/public/browser/web_contents_delegate.h" #include "ui/base/metadata/metadata_header_macros.h" +#include "ui/color/color_id.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/layout/box_layout.h" @@ -31,6 +32,7 @@ } // namespace views namespace ui { +class ColorProvider; class ImageModel; } // namespace ui @@ -121,12 +123,11 @@ const ui::ThemedVectorIcon& avatar_header_art = ui::ThemedVectorIcon()); // Displays the sync info section as a rounded rectangle with text on top and // a button on the bottom. Clicking the button triggers |action|. - void BuildSyncInfoWithCallToAction( - const std::u16string& description, - const std::u16string& button_text, - ui::NativeTheme::ColorId background_color_id, - const base::RepeatingClosure& action, - bool show_sync_badge); + void BuildSyncInfoWithCallToAction(const std::u16string& description, + const std::u16string& button_text, + ui::ColorId background_color_id, + const base::RepeatingClosure& action, + bool show_sync_badge); // Displays the sync info section as a rectangle with text. Clicking the // rectangle triggers |action|. void BuildSyncInfoWithoutCallToAction(const std::u16string& text, @@ -181,8 +182,8 @@ void FocusFirstProfileButton(); void BuildSyncInfoCallToActionBackground( - ui::NativeTheme::ColorId background_color_id, - ui::NativeTheme* native_theme); + ui::ColorId background_color_id, + const ui::ColorProvider* color_provider); // views::BubbleDialogDelegateView: void Init() final; @@ -221,9 +222,9 @@ CloseBubbleOnTabActivationHelper close_bubble_helper_; // Builds the background for |sync_info_container_|. This requires - // ui::NativeTheme, which is only available once OnThemeChanged() is called, + // ui::ColorProvider, which is only available once OnThemeChanged() is called, // so the class caches this callback and calls it afterwards. - base::RepeatingCallback<void(ui::NativeTheme*)> + base::RepeatingCallback<void(const ui::ColorProvider*)> sync_info_background_callback_ = base::DoNothing(); // Actual heading string would be set by children classes.
diff --git a/chrome/browser/ui/views/profiles/profile_menu_view_browsertest.cc b/chrome/browser/ui/views/profiles/profile_menu_view_browsertest.cc index a7c27ab6..966d1db 100644 --- a/chrome/browser/ui/views/profiles/profile_menu_view_browsertest.cc +++ b/chrome/browser/ui/views/profiles/profile_menu_view_browsertest.cc
@@ -615,13 +615,13 @@ class test_case_name : public ProfileMenuClickTest { \ public: \ test_case_name() = default; \ + test_case_name(const test_case_name&) = delete; \ + test_case_name& operator=(const test_case_name&) = delete; \ \ ProfileMenuViewBase::ActionableItem GetExpectedActionableItemAtIndex( \ size_t index) override { \ return actionable_item_list[index]; \ } \ - \ - DISALLOW_COPY_AND_ASSIGN(test_case_name); \ }; \ \ INSTANTIATE_TEST_SUITE_P( \
diff --git a/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble_browsertest.cc b/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble_browsertest.cc index f88759eb..8a00910 100644 --- a/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble_browsertest.cc +++ b/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble_browsertest.cc
@@ -18,6 +18,11 @@ public: QRCodeGeneratorBubbleBrowserTest() = default; + QRCodeGeneratorBubbleBrowserTest(const QRCodeGeneratorBubbleBrowserTest&) = + delete; + QRCodeGeneratorBubbleBrowserTest& operator=( + const QRCodeGeneratorBubbleBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { const GURL url("https://www.chromium.org"); @@ -26,9 +31,6 @@ qrcode_generator::QRCodeGeneratorBubbleController::Get(web_contents); bubble_controller->ShowBubble(url); } - - private: - DISALLOW_COPY_AND_ASSIGN(QRCodeGeneratorBubbleBrowserTest); }; IN_PROC_BROWSER_TEST_F(QRCodeGeneratorBubbleBrowserTest,
diff --git a/chrome/browser/ui/views/read_later/read_later_button.cc b/chrome/browser/ui/views/read_later/read_later_button.cc index 6c0cf302..4c109c6 100644 --- a/chrome/browser/ui/views/read_later/read_later_button.cc +++ b/chrome/browser/ui/views/read_later/read_later_button.cc
@@ -32,6 +32,8 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/pointer/touch_ui_controller.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/accessibility/view_accessibility.h" @@ -156,8 +158,7 @@ gfx::kGoogleBlue050, gfx::kGoogleBlue900)); dot_indicator_->SetColor( - /*dot_color=*/GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityHigh), + /*dot_color=*/GetColorProvider()->GetColor(ui::kColorAlertHighSeverity), /*border_color=*/theme_provider->GetColor( ThemeProperties::COLOR_TOOLBAR)); }
diff --git a/chrome/browser/ui/views/read_later/read_later_button_browsertest.cc b/chrome/browser/ui/views/read_later/read_later_button_browsertest.cc index bcdfcb1..80eb842 100644 --- a/chrome/browser/ui/views/read_later/read_later_button_browsertest.cc +++ b/chrome/browser/ui/views/read_later/read_later_button_browsertest.cc
@@ -30,6 +30,10 @@ feature_list_.InitAndEnableFeature(reading_list::switches::kReadLater); } + ReadLaterButtonBrowserTest(const ReadLaterButtonBrowserTest&) = delete; + ReadLaterButtonBrowserTest& operator=(const ReadLaterButtonBrowserTest&) = + delete; + void SetUpOnMainThread() override { DialogBrowserTest::SetUpOnMainThread(); browser()->profile()->GetPrefs()->SetBoolean( @@ -59,7 +63,6 @@ private: base::test::ScopedFeatureList feature_list_; - DISALLOW_COPY_AND_ASSIGN(ReadLaterButtonBrowserTest); }; // TODO(1115950): Flaky on Windows.
diff --git a/chrome/browser/ui/views/reader_mode/reader_mode_icon_view_browsertest.cc b/chrome/browser/ui/views/reader_mode/reader_mode_icon_view_browsertest.cc index dcec1a6..ff5bb80 100644 --- a/chrome/browser/ui/views/reader_mode/reader_mode_icon_view_browsertest.cc +++ b/chrome/browser/ui/views/reader_mode/reader_mode_icon_view_browsertest.cc
@@ -38,6 +38,11 @@ const char* kArticleTitle = "Test Page Title"; class ReaderModeIconViewBrowserTest : public InProcessBrowserTest { + public: + ReaderModeIconViewBrowserTest(const ReaderModeIconViewBrowserTest&) = delete; + ReaderModeIconViewBrowserTest& operator=( + const ReaderModeIconViewBrowserTest&) = delete; + protected: ReaderModeIconViewBrowserTest() { feature_list_.InitAndEnableFeature(dom_distiller::kReaderMode); @@ -64,8 +69,6 @@ private: base::test::ScopedFeatureList feature_list_; - - DISALLOW_COPY_AND_ASSIGN(ReaderModeIconViewBrowserTest); }; // TODO(gilmanmh): Add tests for the following cases: @@ -171,6 +174,12 @@ class ReaderModeIconViewBrowserTestWithSettings : public ReaderModeIconViewBrowserTest { + public: + ReaderModeIconViewBrowserTestWithSettings( + const ReaderModeIconViewBrowserTestWithSettings&) = delete; + ReaderModeIconViewBrowserTestWithSettings& operator=( + const ReaderModeIconViewBrowserTestWithSettings&) = delete; + protected: ReaderModeIconViewBrowserTestWithSettings() { feature_list_.InitAndEnableFeatureWithParameters( @@ -186,8 +195,6 @@ private: base::test::ScopedFeatureList feature_list_; - - DISALLOW_COPY_AND_ASSIGN(ReaderModeIconViewBrowserTestWithSettings); }; // Flaky on Linux Win ChromeOS: crbug.com/1054641
diff --git a/chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller_unittest.cc b/chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller_unittest.cc index ec4c96a..a883a09 100644 --- a/chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller_unittest.cc +++ b/chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller_unittest.cc
@@ -74,6 +74,11 @@ : RelaunchNotificationController(upgrade_detector, clock, tick_clock), delegate_(delegate) {} + FakeRelaunchNotificationController( + const FakeRelaunchNotificationController&) = delete; + FakeRelaunchNotificationController& operator=( + const FakeRelaunchNotificationController&) = delete; + using RelaunchNotificationController::kRelaunchGracePeriod; base::Time IncreaseRelaunchDeadlineOnShow() { @@ -102,8 +107,6 @@ } ControllerDelegate* delegate_; - - DISALLOW_COPY_AND_ASSIGN(FakeRelaunchNotificationController); }; // A mock delegate for testing. @@ -125,6 +128,9 @@ set_upgrade_detected_time(this->clock()->Now()); } + FakeUpgradeDetector(const FakeUpgradeDetector&) = delete; + FakeUpgradeDetector& operator=(const FakeUpgradeDetector&) = delete; + base::TimeDelta GetHighAnnoyanceLevelDelta() { return GetAnnoyanceLevelDeadline(UpgradeDetector::UPGRADE_ANNOYANCE_HIGH) - GetAnnoyanceLevelDeadline( @@ -170,8 +176,6 @@ private: base::TimeDelta high_threshold_ = base::TimeDelta::FromDays(7); - - DISALLOW_COPY_AND_ASSIGN(FakeUpgradeDetector); }; } // namespace @@ -179,6 +183,12 @@ // A test harness that provides facilities for manipulating the relaunch // notification policy setting and for broadcasting upgrade notifications. class RelaunchNotificationControllerTest : public ::testing::Test { + public: + RelaunchNotificationControllerTest( + const RelaunchNotificationControllerTest&) = delete; + RelaunchNotificationControllerTest& operator=( + const RelaunchNotificationControllerTest&) = delete; + protected: RelaunchNotificationControllerTest() : task_environment_( @@ -226,8 +236,6 @@ base::test::TaskEnvironment task_environment_; ScopedTestingLocalState scoped_local_state_; FakeUpgradeDetector upgrade_detector_; - - DISALLOW_COPY_AND_ASSIGN(RelaunchNotificationControllerTest); }; TEST_F(RelaunchNotificationControllerTest, CreateDestroy) {
diff --git a/chrome/browser/ui/views/relaunch_notification/relaunch_recommended_bubble_view_browsertest.cc b/chrome/browser/ui/views/relaunch_notification/relaunch_recommended_bubble_view_browsertest.cc index 55ac667..dcb3a91 100644 --- a/chrome/browser/ui/views/relaunch_notification/relaunch_recommended_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/relaunch_notification/relaunch_recommended_bubble_view_browsertest.cc
@@ -11,6 +11,12 @@ #include "content/public/test/browser_test.h" class RelaunchRecommendedBubbleViewDialogTest : public DialogBrowserTest { + public: + RelaunchRecommendedBubbleViewDialogTest( + const RelaunchRecommendedBubbleViewDialogTest&) = delete; + RelaunchRecommendedBubbleViewDialogTest& operator=( + const RelaunchRecommendedBubbleViewDialogTest&) = delete; + protected: RelaunchRecommendedBubbleViewDialogTest() = default; @@ -21,9 +27,6 @@ RelaunchRecommendedBubbleView::ShowBubble(browser(), detection_time, base::DoNothing()); } - - private: - DISALLOW_COPY_AND_ASSIGN(RelaunchRecommendedBubbleViewDialogTest); }; IN_PROC_BROWSER_TEST_F(RelaunchRecommendedBubbleViewDialogTest,
diff --git a/chrome/browser/ui/views/relaunch_notification/relaunch_required_dialog_view_browsertest.cc b/chrome/browser/ui/views/relaunch_notification/relaunch_required_dialog_view_browsertest.cc index af0f24b1..0ce8cc3 100644 --- a/chrome/browser/ui/views/relaunch_notification/relaunch_required_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/relaunch_notification/relaunch_required_dialog_view_browsertest.cc
@@ -11,6 +11,12 @@ #include "content/public/test/browser_test.h" class RelaunchRequiredDialogViewDialogTest : public DialogBrowserTest { + public: + RelaunchRequiredDialogViewDialogTest( + const RelaunchRequiredDialogViewDialogTest&) = delete; + RelaunchRequiredDialogViewDialogTest& operator=( + const RelaunchRequiredDialogViewDialogTest&) = delete; + protected: RelaunchRequiredDialogViewDialogTest() = default; @@ -19,9 +25,6 @@ base::Time deadline = base::Time::Now() + base::TimeDelta::FromDays(3); RelaunchRequiredDialogView::Show(browser(), deadline, base::DoNothing()); } - - private: - DISALLOW_COPY_AND_ASSIGN(RelaunchRequiredDialogViewDialogTest); }; IN_PROC_BROWSER_TEST_F(RelaunchRequiredDialogViewDialogTest, InvokeUi_default) {
diff --git a/chrome/browser/ui/views/sad_tab_view_interactive_uitest.cc b/chrome/browser/ui/views/sad_tab_view_interactive_uitest.cc index f7c10b0..09025c1 100644 --- a/chrome/browser/ui/views/sad_tab_view_interactive_uitest.cc +++ b/chrome/browser/ui/views/sad_tab_view_interactive_uitest.cc
@@ -27,15 +27,15 @@ // A friend of SadTabView that's able to call RecordFirstPaint. class SadTabViewTestApi { public: + SadTabViewTestApi(const SadTabViewTestApi&) = delete; + SadTabViewTestApi& operator=(const SadTabViewTestApi&) = delete; + static void RecordFirstPaintForTesting(SadTabView* sad_tab_view) { if (!sad_tab_view->painted_) { sad_tab_view->RecordFirstPaint(); sad_tab_view->painted_ = true; } } - - private: - DISALLOW_COPY_AND_ASSIGN(SadTabViewTestApi); }; } // namespace test @@ -44,6 +44,10 @@ public: SadTabViewInteractiveUITest() {} + SadTabViewInteractiveUITest(const SadTabViewInteractiveUITest&) = delete; + SadTabViewInteractiveUITest& operator=(const SadTabViewInteractiveUITest&) = + delete; + protected: void KillRendererForActiveWebContentsSync() { content::WebContents* web_contents = @@ -124,9 +128,6 @@ test::SadTabViewTestApi::RecordFirstPaintForTesting(sad_tab_view); PressSpacebar(); } - - private: - DISALLOW_COPY_AND_ASSIGN(SadTabViewInteractiveUITest); }; #if defined(OS_MAC)
diff --git a/chrome/browser/ui/views/screen_capture_notification_ui_views.cc b/chrome/browser/ui/views/screen_capture_notification_ui_views.cc index ee451db..09b055b 100644 --- a/chrome/browser/ui/views/screen_capture_notification_ui_views.cc +++ b/chrome/browser/ui/views/screen_capture_notification_ui_views.cc
@@ -19,6 +19,8 @@ #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/views/bubble/bubble_border.h" @@ -228,8 +230,8 @@ widget->set_frame_type(views::Widget::FrameType::kForceCustom); widget->Init(std::move(params)); - SetBackground(views::CreateSolidBackground(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DialogBackground))); + SetBackground(views::CreateSolidBackground( + GetColorProvider()->GetColor(ui::kColorDialogBackground))); display::Screen* screen = display::Screen::GetScreen(); // TODO(sergeyu): Move the notification to the display being captured when @@ -271,8 +273,8 @@ constexpr auto kPadding = gfx::Insets(5, 10); auto frame = std::make_unique<views::BubbleFrameView>(gfx::Insets(), kPadding); - SkColor color = widget->GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_DialogBackground); + SkColor color = + widget->GetColorProvider()->GetColor(ui::kColorDialogBackground); frame->SetBubbleBorder(std::make_unique<views::BubbleBorder>( views::BubbleBorder::NONE, views::BubbleBorder::STANDARD_SHADOW, color)); return frame;
diff --git a/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc b/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc index 8085b89..654f59a 100644 --- a/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc +++ b/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc
@@ -82,6 +82,10 @@ MockSelectFileDialogListener() : file_selected_(false), canceled_(false), params_(nullptr) {} + MockSelectFileDialogListener(const MockSelectFileDialogListener&) = delete; + MockSelectFileDialogListener& operator=(const MockSelectFileDialogListener&) = + delete; + bool file_selected() const { return file_selected_; } bool canceled() const { return canceled_; } base::FilePath path() const { return path_; } @@ -127,8 +131,6 @@ base::FilePath path_; void* params_; scoped_refptr<content::MessageLoopRunner> message_loop_runner_; - - DISALLOW_COPY_AND_ASSIGN(MockSelectFileDialogListener); }; // Enumerates possible app modes. We support extension mode (Chrome App)
diff --git a/chrome/browser/ui/views/select_file_dialog_extension_unittest.cc b/chrome/browser/ui/views/select_file_dialog_extension_unittest.cc index 629bfe0..14b9dd0 100644 --- a/chrome/browser/ui/views/select_file_dialog_extension_unittest.cc +++ b/chrome/browser/ui/views/select_file_dialog_extension_unittest.cc
@@ -39,6 +39,10 @@ } } + SelectFileDialogExtensionTest(const SelectFileDialogExtensionTest&) = delete; + SelectFileDialogExtensionTest& operator=( + const SelectFileDialogExtensionTest&) = delete; + static SelectFileDialogExtension* CreateDialog( ui::SelectFileDialog::Listener* listener) { SelectFileDialogExtension* dialog = new SelectFileDialogExtension(listener, @@ -52,8 +56,6 @@ private: base::test::ScopedFeatureList feature_list_; - - DISALLOW_COPY_AND_ASSIGN(SelectFileDialogExtensionTest); }; // Test listener for a SelectFileDialog.
diff --git a/chrome/browser/ui/views/sharing/remote_copy_browsertest.cc b/chrome/browser/ui/views/sharing/remote_copy_browsertest.cc index 112615c..71a678f 100644 --- a/chrome/browser/ui/views/sharing/remote_copy_browsertest.cc +++ b/chrome/browser/ui/views/sharing/remote_copy_browsertest.cc
@@ -55,12 +55,13 @@ explicit ClipboardObserver(base::RepeatingClosure callback) : callback_(callback) {} + ClipboardObserver(const ClipboardObserver&) = delete; + ClipboardObserver& operator=(const ClipboardObserver&) = delete; + void OnClipboardDataChanged() override { callback_.Run(); } private: base::RepeatingClosure callback_; - - DISALLOW_COPY_AND_ASSIGN(ClipboardObserver); }; } // namespace
diff --git a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_action_button.cc b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_action_button.cc index 5f17a8c8..ada73d7d8 100644 --- a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_action_button.cc +++ b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_action_button.cc
@@ -14,6 +14,7 @@ #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" #include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/border.h" #include "ui/views/controls/image_view.h" @@ -64,18 +65,17 @@ SetEnabled(true); title()->SetTextContext(views::style::CONTEXT_MENU); - SetBackground(views::CreateThemedSolidBackground( - this, ui::NativeTheme::kColorId_MenuBackgroundColor)); + SetBackground( + views::CreateThemedSolidBackground(this, ui::kColorMenuBackground)); } SharingHubBubbleActionButton::~SharingHubBubbleActionButton() = default; void SharingHubBubbleActionButton::UpdateBackgroundColor() { // Pretend to be a menu item: - SkColor bg_color = GetNativeTheme()->GetSystemColor( - GetVisualState() == STATE_HOVERED - ? ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor - : ui::NativeTheme::kColorId_MenuBackgroundColor); + SkColor bg_color = GetColorProvider()->GetColor( + GetVisualState() == STATE_HOVERED ? ui::kColorMenuItemBackgroundSelected + : ui::kColorMenuBackground); SetBackground(views::CreateSolidBackground(bg_color)); SetTitleTextStyle(
diff --git a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.cc b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.cc index 40f765998..fc2c0c4 100644 --- a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.cc +++ b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.cc
@@ -11,6 +11,8 @@ #include "chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_action_button.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/views/border.h" #include "ui/views/controls/scroll_view.h" #include "ui/views/controls/separator.h" @@ -90,9 +92,8 @@ void SharingHubBubbleViewImpl::OnThemeChanged() { LocationBarBubbleDelegateView::OnThemeChanged(); - if (GetWidget() && GetNativeTheme()) { - set_color(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_MenuBackgroundColor)); + if (GetWidget()) { + set_color(GetColorProvider()->GetColor(ui::kColorMenuBackground)); } }
diff --git a/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.h b/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.h index e2eac4b..2e3540c 100644 --- a/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.h +++ b/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.h
@@ -37,6 +37,9 @@ public: StatusIconLinuxDbus(); + StatusIconLinuxDbus(const StatusIconLinuxDbus&) = delete; + StatusIconLinuxDbus& operator=(const StatusIconLinuxDbus&) = delete; + // StatusIcon: void SetIcon(const gfx::ImageSkia& image) override; void SetToolTip(const std::u16string& tool_tip) override; @@ -130,8 +133,6 @@ base::FilePath icon_file_; base::WeakPtrFactory<StatusIconLinuxDbus> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(StatusIconLinuxDbus); }; #endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_LINUX_DBUS_H_
diff --git a/chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc b/chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc index 13f941a..71af0e7 100644 --- a/chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc +++ b/chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc
@@ -22,6 +22,10 @@ public: StatusTrayStateChangerWinTest() {} + StatusTrayStateChangerWinTest(const StatusTrayStateChangerWinTest&) = delete; + StatusTrayStateChangerWinTest& operator=( + const StatusTrayStateChangerWinTest&) = delete; + void SetUp() override { testing::Test::SetUp(); com_ = std::make_unique<base::win::ScopedCOMInitializer>(); @@ -82,8 +86,6 @@ Microsoft::WRL::ComPtr<StatusTrayStateChangerWin> tray_watcher_; StatusIconWin* status_icon_win_; - - DISALLOW_COPY_AND_ASSIGN(StatusTrayStateChangerWinTest); }; // Test is disabled due to multiple COM initialization errors. See
diff --git a/chrome/browser/ui/views/status_icons/status_tray_state_changer_win.h b/chrome/browser/ui/views/status_icons/status_tray_state_changer_win.h index 6c0dfc2..79635b8 100644 --- a/chrome/browser/ui/views/status_icons/status_tray_state_changer_win.h +++ b/chrome/browser/ui/views/status_icons/status_tray_state_changer_win.h
@@ -60,6 +60,10 @@ public: StatusTrayStateChangerWin(UINT icon_id, HWND window); + StatusTrayStateChangerWin(const StatusTrayStateChangerWin&) = delete; + StatusTrayStateChangerWin& operator=(const StatusTrayStateChangerWin&) = + delete; + // Call this method to move the icon matching |icon_id| and |window| to the // taskbar from the overflow area. This will not make any changes if the // icon has been set to |PREFERENCE_SHOW_NEVER|, in order to comply with @@ -127,8 +131,6 @@ std::unique_ptr<NOTIFYITEM> notify_item_; THREAD_CHECKER(thread_checker_); - - DISALLOW_COPY_AND_ASSIGN(StatusTrayStateChangerWin); }; #endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_TRAY_STATE_CHANGER_WIN_H_
diff --git a/chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc b/chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc index ac95b184..528264e 100644 --- a/chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc +++ b/chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc
@@ -24,6 +24,11 @@ FakeStatusTrayStateChangerProxy() : enqueue_called_(false), icon_id_(0), window_(NULL) {} + FakeStatusTrayStateChangerProxy(const FakeStatusTrayStateChangerProxy&) = + delete; + FakeStatusTrayStateChangerProxy& operator=( + const FakeStatusTrayStateChangerProxy&) = delete; + void EnqueueChange(UINT icon_id, HWND window) override { enqueue_called_ = true; icon_id_ = icon_id; @@ -38,8 +43,6 @@ bool enqueue_called_; UINT icon_id_; HWND window_; - - DISALLOW_COPY_AND_ASSIGN(FakeStatusTrayStateChangerProxy); }; class FakeStatusIconObserver : public StatusIconObserver {
diff --git a/chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc b/chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc index 1114968..b076fa7 100644 --- a/chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc +++ b/chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc
@@ -167,14 +167,14 @@ const std::string& signin_scoped_device_id, bool confirm_untrusted_signin); + MockInlineSigninHelper(const MockInlineSigninHelper&) = delete; + MockInlineSigninHelper& operator=(const MockInlineSigninHelper&) = delete; + MOCK_METHOD1(OnClientOAuthSuccess, void(const ClientOAuthResult& result)); MOCK_METHOD1(OnClientOAuthFailure, void(const GoogleServiceAuthError& error)); MOCK_METHOD1(CreateSyncStarter, void(const std::string&)); GaiaAuthFetcher* GetGaiaAuthFetcher() { return GetGaiaAuthFetcherForTest(); } - - private: - DISALLOW_COPY_AND_ASSIGN(MockInlineSigninHelper); }; MockInlineSigninHelper::MockInlineSigninHelper( @@ -218,10 +218,12 @@ bool confirm_untrusted_signin, bool is_force_sign_in_with_usermanager); - MOCK_METHOD1(CreateSyncStarter, void(const std::string&)); + MockSyncStarterInlineSigninHelper(const MockSyncStarterInlineSigninHelper&) = + delete; + MockSyncStarterInlineSigninHelper& operator=( + const MockSyncStarterInlineSigninHelper&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(MockSyncStarterInlineSigninHelper); + MOCK_METHOD1(CreateSyncStarter, void(const std::string&)); }; MockSyncStarterInlineSigninHelper::MockSyncStarterInlineSigninHelper(
diff --git a/chrome/browser/ui/views/sync/one_click_signin_dialog_view_unittest.cc b/chrome/browser/ui/views/sync/one_click_signin_dialog_view_unittest.cc index 57a1515..9c94fab 100644 --- a/chrome/browser/ui/views/sync/one_click_signin_dialog_view_unittest.cc +++ b/chrome/browser/ui/views/sync/one_click_signin_dialog_view_unittest.cc
@@ -24,6 +24,10 @@ public: OneClickSigninDialogViewTest() {} + OneClickSigninDialogViewTest(const OneClickSigninDialogViewTest&) = delete; + OneClickSigninDialogViewTest& operator=(const OneClickSigninDialogViewTest&) = + delete; + void SetUp() override { ChromeViewsTestBase::SetUp(); SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); @@ -84,8 +88,6 @@ // Widget to host the anchor view of the dialog. Destroys itself when closed. std::unique_ptr<views::Widget> anchor_widget_; base::RunLoop* run_loop_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(OneClickSigninDialogViewTest); }; TEST_F(OneClickSigninDialogViewTest, ShowDialog) {
diff --git a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views_browsertest.cc b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views_browsertest.cc index d57f933c..19b9c756 100644 --- a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views_browsertest.cc +++ b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views_browsertest.cc
@@ -24,12 +24,12 @@ public: TestSigninDialogDelegate() {} + TestSigninDialogDelegate(const TestSigninDialogDelegate&) = delete; + TestSigninDialogDelegate& operator=(const TestSigninDialogDelegate&) = delete; + void OnCancelSignin() override {} void OnContinueSignin() override {} void OnSigninWithNewProfile() override {} - - private: - DISALLOW_COPY_AND_ASSIGN(TestSigninDialogDelegate); }; } // namespace @@ -38,6 +38,11 @@ public: ProfileSigninConfirmationDialogTest() {} + ProfileSigninConfirmationDialogTest( + const ProfileSigninConfirmationDialogTest&) = delete; + ProfileSigninConfirmationDialogTest& operator=( + const ProfileSigninConfirmationDialogTest&) = delete; + void ShowUi(const std::string& name) override { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); @@ -47,9 +52,6 @@ /*prompt_for_new_profile=*/true, std::make_unique<TestSigninDialogDelegate>()); } - - private: - DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialogTest); }; // Test that calls ShowUi("true").
diff --git a/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_focus_helper.h b/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_focus_helper.h index f629fea..1fba201 100644 --- a/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_focus_helper.h +++ b/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_focus_helper.h
@@ -24,6 +24,11 @@ class ChromeWebContentsViewFocusHelper : public content::WebContentsUserData<ChromeWebContentsViewFocusHelper> { public: + ChromeWebContentsViewFocusHelper(const ChromeWebContentsViewFocusHelper&) = + delete; + ChromeWebContentsViewFocusHelper& operator=( + const ChromeWebContentsViewFocusHelper&) = delete; + void StoreFocus(); bool RestoreFocus(); void ResetStoredFocus(); @@ -45,8 +50,6 @@ content::WebContents* web_contents_; WEB_CONTENTS_USER_DATA_KEY_DECL(); - - DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsViewFocusHelper); }; #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_FOCUS_HELPER_H_
diff --git a/chrome/browser/ui/views/tab_icon_view.cc b/chrome/browser/ui/views/tab_icon_view.cc index 2a95bcb..d31b0680 100644 --- a/chrome/browser/ui/views/tab_icon_view.cc +++ b/chrome/browser/ui/views/tab_icon_view.cc
@@ -15,10 +15,11 @@ #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/theme_provider.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/favicon_size.h" #include "ui/gfx/paint_throbber.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/image_model_utils.h" #if defined(OS_WIN) @@ -50,6 +51,9 @@ class DefaultFavicon { public: + DefaultFavicon(const DefaultFavicon&) = delete; + DefaultFavicon& operator=(const DefaultFavicon&) = delete; + static const DefaultFavicon& GetInstance() { static base::NoDestructor<DefaultFavicon> default_favicon; return *default_favicon; @@ -63,8 +67,6 @@ DefaultFavicon() : icon_(CreateDefaultFavicon()) {} const gfx::ImageSkia icon_; - - DISALLOW_COPY_AND_ASSIGN(DefaultFavicon); }; } // namespace @@ -94,11 +96,9 @@ if (throbber_start_time_ == base::TimeTicks()) throbber_start_time_ = base::TimeTicks::Now(); - gfx::PaintThrobberSpinning( - canvas, GetLocalBounds(), - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_ThrobberSpinningColor), - base::TimeTicks::Now() - throbber_start_time_); + gfx::PaintThrobberSpinning(canvas, GetLocalBounds(), + GetColorProvider()->GetColor(ui::kColorThrobber), + base::TimeTicks::Now() - throbber_start_time_); } void TabIconView::PaintFavicon(gfx::Canvas* canvas,
diff --git a/chrome/browser/ui/views/tab_modal_confirm_dialog_views.h b/chrome/browser/ui/views/tab_modal_confirm_dialog_views.h index ca5a02c..b0e62e6 100644 --- a/chrome/browser/ui/views/tab_modal_confirm_dialog_views.h +++ b/chrome/browser/ui/views/tab_modal_confirm_dialog_views.h
@@ -34,6 +34,10 @@ std::unique_ptr<TabModalConfirmDialogDelegate> delegate, content::WebContents* web_contents); + TabModalConfirmDialogViews(const TabModalConfirmDialogViews&) = delete; + TabModalConfirmDialogViews& operator=(const TabModalConfirmDialogViews&) = + delete; + // views::DialogDelegate: std::u16string GetWindowTitle() const override; bool ShouldShowCloseButton() const override; @@ -57,8 +61,6 @@ // The message box view whose commands we handle. views::MessageBoxView* message_box_view_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogViews); }; #endif // CHROME_BROWSER_UI_VIEWS_TAB_MODAL_CONFIRM_DIALOG_VIEWS_H_
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc index f42efe2..51f6812 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc +++ b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc
@@ -36,6 +36,8 @@ #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/compositor/layer.h" #include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/animation/slide_animation.h" @@ -48,7 +50,6 @@ #include "ui/gfx/text_constants.h" #include "ui/gfx/text_elider.h" #include "ui/gfx/text_utils.h" -#include "ui/native_theme/native_theme.h" #include "ui/resources/grit/ui_resources.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/background.h" @@ -921,14 +922,13 @@ // Simulate the same look as the footnote view. // TODO(dfried): should we add this as a variation of // FootnoteContainerView? Currently it's only used here. - alert_label->SetBackground( - views::CreateSolidBackground(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_BubbleFooterBackground))); + const auto* color_provider = GetColorProvider(); + alert_label->SetBackground(views::CreateSolidBackground( + color_provider->GetColor(ui::kColorBubbleFooterBackground))); alert_label->SetBorder(views::CreatePaddedBorder( views::CreateSolidSidedBorder( 0, 0, 1, 0, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_FootnoteContainerBorder)), + color_provider->GetColor(ui::kColorBubbleFooterBorder)), kAlertMargins)); } GetBubbleFrameView()->SetHeaderView(std::move(alert_label));
diff --git a/chrome/browser/ui/views/toolbar/app_menu.cc b/chrome/browser/ui/views/toolbar/app_menu.cc index ba95449..6684cc7 100644 --- a/chrome/browser/ui/views/toolbar/app_menu.cc +++ b/chrome/browser/ui/views/toolbar/app_menu.cc
@@ -56,6 +56,8 @@ #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font_list.h" #include "ui/gfx/image/image.h" @@ -241,25 +243,18 @@ // views::LabelButton void OnThemeChanged() override { LabelButton::OnThemeChanged(); - ui::NativeTheme* theme = GetNativeTheme(); - if (theme) { - SetTextColor( - views::Button::STATE_DISABLED, - theme->GetSystemColor( - ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor)); - SetTextColor( - views::Button::STATE_HOVERED, - theme->GetSystemColor( - ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor)); - SetTextColor( - views::Button::STATE_PRESSED, - theme->GetSystemColor( - ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor)); - SetTextColor( - views::Button::STATE_NORMAL, - theme->GetSystemColor( - ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor)); - } + const ui::ColorProvider* color_provider = GetColorProvider(); + SetTextColor( + views::Button::STATE_DISABLED, + color_provider->GetColor(ui::kColorMenuItemForegroundDisabled)); + SetTextColor( + views::Button::STATE_HOVERED, + color_provider->GetColor(ui::kColorMenuItemForegroundSelected)); + SetTextColor( + views::Button::STATE_PRESSED, + color_provider->GetColor(ui::kColorMenuItemForegroundSelected)); + SetTextColor(views::Button::STATE_NORMAL, + color_provider->GetColor(ui::kColorMenuItemForeground)); } }; @@ -580,20 +575,18 @@ void OnThemeChanged() override { AppMenuView::OnThemeChanged(); - ui::NativeTheme* theme = GetNativeTheme(); - zoom_label_->SetEnabledColor(theme->GetSystemColor( - ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor)); + const ui::ColorProvider* color_provider = GetColorProvider(); + zoom_label_->SetEnabledColor( + color_provider->GetColor(ui::kColorMenuItemForeground)); fullscreen_button_->SetImage( ImageButton::STATE_NORMAL, gfx::CreateVectorIcon( kFullscreenIcon, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor))); + color_provider->GetColor(ui::kColorMenuItemForeground))); gfx::ImageSkia hovered_fullscreen_image = gfx::CreateVectorIcon( kFullscreenIcon, - theme->GetSystemColor( - ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor)); + color_provider->GetColor(ui::kColorMenuItemForegroundSelected)); fullscreen_button_->SetImage(ImageButton::STATE_HOVERED, hovered_fullscreen_image); fullscreen_button_->SetImage(ImageButton::STATE_PRESSED,
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc index a1588dcc..df8ab65 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -85,12 +85,13 @@ #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/base/window_open_disposition.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" #include "ui/gfx/image/canvas_image_source.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/scoped_canvas.h" -#include "ui/native_theme/native_theme_aura.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/cascading_property.h" #include "ui/views/layout/fill_layout.h" @@ -784,22 +785,22 @@ SkColor ToolbarView::GetDefaultColorForSeverity( AppMenuIconController::Severity severity) const { - ui::NativeTheme::ColorId color_id; + ui::ColorId color_id; switch (severity) { case AppMenuIconController::Severity::NONE: return GetThemeProvider()->GetColor( ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); case AppMenuIconController::Severity::LOW: - color_id = ui::NativeTheme::kColorId_AlertSeverityLow; + color_id = ui::kColorAlertLowSeverity; break; case AppMenuIconController::Severity::MEDIUM: - color_id = ui::NativeTheme::kColorId_AlertSeverityMedium; + color_id = ui::kColorAlertMediumSeverity; break; case AppMenuIconController::Severity::HIGH: - color_id = ui::NativeTheme::kColorId_AlertSeverityHigh; + color_id = ui::kColorAlertHighSeverity; break; } - return GetNativeTheme()->GetSystemColor(color_id); + return GetColorProvider()->GetColor(color_id); } ExtensionsToolbarContainer* ToolbarView::GetExtensionsToolbarContainer() {
diff --git a/chrome/browser/ui/views/touch_events_interactive_uitest_win.cc b/chrome/browser/ui/views/touch_events_interactive_uitest_win.cc index 22c187b..68d2529 100644 --- a/chrome/browser/ui/views/touch_events_interactive_uitest_win.cc +++ b/chrome/browser/ui/views/touch_events_interactive_uitest_win.cc
@@ -137,6 +137,9 @@ public: TouchEventsViewTest() = default; + TouchEventsViewTest(const TouchEventsViewTest&) = delete; + TouchEventsViewTest& operator=(const TouchEventsViewTest&) = delete; + // ViewEventTestBase: void SetUp() override { ViewEventTestBase::SetUp(); @@ -194,8 +197,6 @@ views::View* touch_view_ = nullptr; TestingGestureRecognizer* gesture_recognizer_ = nullptr; ui::GestureRecognizer* initial_gr_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(TouchEventsViewTest); }; #if defined(OS_WIN) // Fails on latest versions of Windows. @@ -212,6 +213,10 @@ public: TouchEventsRecursiveViewTest() {} + TouchEventsRecursiveViewTest(const TouchEventsRecursiveViewTest&) = delete; + TouchEventsRecursiveViewTest& operator=(const TouchEventsRecursiveViewTest&) = + delete; + void DoTestOnMessageLoop() override { // ui_controls::SendTouchEvents which uses InjectTouchInput API only works // on Windows 8 and up. @@ -240,9 +245,6 @@ &touch_event_handler); Done(); } - - private: - DISALLOW_COPY_AND_ASSIGN(TouchEventsRecursiveViewTest); }; #if defined(OS_WIN) // Fails on latest versions of Windows.
diff --git a/chrome/browser/ui/views/touch_selection_menu_chromeos.h b/chrome/browser/ui/views/touch_selection_menu_chromeos.h index 8d3c77e..ad3dff45 100644 --- a/chrome/browser/ui/views/touch_selection_menu_chromeos.h +++ b/chrome/browser/ui/views/touch_selection_menu_chromeos.h
@@ -24,6 +24,10 @@ aura::Window* context, arc::mojom::TextSelectionActionPtr action); + TouchSelectionMenuChromeOS(const TouchSelectionMenuChromeOS&) = delete; + TouchSelectionMenuChromeOS& operator=(const TouchSelectionMenuChromeOS&) = + delete; + void SetActionsForTesting( std::vector<arc::mojom::TextSelectionActionPtr> actions); @@ -40,8 +44,6 @@ arc::mojom::TextSelectionActionPtr action_; int64_t display_id_; - - DISALLOW_COPY_AND_ASSIGN(TouchSelectionMenuChromeOS); }; #endif // CHROME_BROWSER_UI_VIEWS_TOUCH_SELECTION_MENU_CHROMEOS_H_
diff --git a/chrome/browser/ui/views/touch_uma/touch_uma.h b/chrome/browser/ui/views/touch_uma/touch_uma.h index 3f7fdb7..6c4b912 100644 --- a/chrome/browser/ui/views/touch_uma/touch_uma.h +++ b/chrome/browser/ui/views/touch_uma/touch_uma.h
@@ -18,10 +18,11 @@ kMaxValue = kGestureRootViewTopTap, }; - static void RecordGestureAction(GestureActionType action); + TouchUMA() = delete; + TouchUMA(const TouchUMA&) = delete; + TouchUMA& operator=(const TouchUMA&) = delete; - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(TouchUMA); + static void RecordGestureAction(GestureActionType action); }; #endif // CHROME_BROWSER_UI_VIEWS_TOUCH_UMA_TOUCH_UMA_H_
diff --git a/chrome/browser/ui/views/translate/translate_language_browsertest.cc b/chrome/browser/ui/views/translate/translate_language_browsertest.cc index 02c0e61f..44b07bbb 100644 --- a/chrome/browser/ui/views/translate/translate_language_browsertest.cc +++ b/chrome/browser/ui/views/translate/translate_language_browsertest.cc
@@ -82,6 +82,10 @@ public: TranslateLanguageBrowserTest() : browser_(nullptr) {} + TranslateLanguageBrowserTest(const TranslateLanguageBrowserTest&) = delete; + TranslateLanguageBrowserTest& operator=(const TranslateLanguageBrowserTest&) = + delete; + void SetUp() override { set_open_about_blank_on_browser_launch(true); TranslateManager::SetIgnoreMissingKeyForTesting(true); @@ -211,8 +215,6 @@ std::unique_ptr<net::test_server::ControllableHttpResponse> controllable_http_response_; - - DISALLOW_COPY_AND_ASSIGN(TranslateLanguageBrowserTest); }; // Flaky failures & timeouts: https://crbug.com/1131622
diff --git a/chrome/browser/ui/views/try_chrome_dialog_win/arrow_border.h b/chrome/browser/ui/views/try_chrome_dialog_win/arrow_border.h index fddd4a02..b201af8e 100644 --- a/chrome/browser/ui/views/try_chrome_dialog_win/arrow_border.h +++ b/chrome/browser/ui/views/try_chrome_dialog_win/arrow_border.h
@@ -56,6 +56,9 @@ const gfx::VectorIcon& arrow_icon, const Properties* properties); + ArrowBorder(const ArrowBorder&) = delete; + ArrowBorder& operator=(const ArrowBorder&) = delete; + // Sets the bounds of the arrow in pixels relative to the containing widget. void set_arrow_bounds(const gfx::Rect& arrow_bounds) { arrow_bounds_ = arrow_bounds; @@ -81,8 +84,6 @@ // client area. This rectangle may extend into the contents of the popup // (including its border). gfx::Rect arrow_bounds_; - - DISALLOW_COPY_AND_ASSIGN(ArrowBorder); }; #endif // CHROME_BROWSER_UI_VIEWS_TRY_CHROME_DIALOG_WIN_ARROW_BORDER_H_
diff --git a/chrome/browser/ui/views/try_chrome_dialog_win/button_layout_unittest.cc b/chrome/browser/ui/views/try_chrome_dialog_win/button_layout_unittest.cc index 2f3dcbb5..b4b6b1a 100644 --- a/chrome/browser/ui/views/try_chrome_dialog_win/button_layout_unittest.cc +++ b/chrome/browser/ui/views/try_chrome_dialog_win/button_layout_unittest.cc
@@ -50,6 +50,9 @@ kSuperSizedButton = kWideButtonMax + 1, }; + ButtonLayoutTest(const ButtonLayoutTest&) = delete; + ButtonLayoutTest& operator=(const ButtonLayoutTest&) = delete; + protected: ButtonLayoutTest() : layout_(host_.SetLayoutManager( @@ -157,8 +160,6 @@ ButtonLayout* const layout_; // Owned by |host_|. const int button_1_width_; const int button_2_width_; - - DISALLOW_COPY_AND_ASSIGN(ButtonLayoutTest); }; TEST_P(ButtonLayoutTest, GetPreferredSize) {
diff --git a/chrome/browser/ui/views/try_chrome_dialog_win/try_chrome_dialog_browsertest.cc b/chrome/browser/ui/views/try_chrome_dialog_win/try_chrome_dialog_browsertest.cc index 3f8c2fcc..3b4717e 100644 --- a/chrome/browser/ui/views/try_chrome_dialog_win/try_chrome_dialog_browsertest.cc +++ b/chrome/browser/ui/views/try_chrome_dialog_win/try_chrome_dialog_browsertest.cc
@@ -80,6 +80,11 @@ // functionality. class TryChromeDialogBrowserTestBase : public InProcessBrowserTest { public: + TryChromeDialogBrowserTestBase(const TryChromeDialogBrowserTestBase&) = + delete; + TryChromeDialogBrowserTestBase& operator=( + const TryChromeDialogBrowserTestBase&) = delete; + // Breaks ShowDialogSync() out of its modal run loop. void QuitModalLoop() { if (quit_closure_) @@ -157,8 +162,6 @@ ::testing::NiceMock<MockDelegate> delegate_; std::unique_ptr<TryChromeDialog> dialog_; base::RepeatingClosure quit_closure_; - - DISALLOW_COPY_AND_ASSIGN(TryChromeDialogBrowserTestBase); }; // Showing the dialog then closing it via WM_CLOSE should not launch the @@ -287,6 +290,10 @@ class TryChromeDialogTest : public SupportsTestDialog<TryChromeDialogBrowserTestBase>, public ::testing::WithParamInterface<int> { + public: + TryChromeDialogTest(const TryChromeDialogTest&) = delete; + TryChromeDialogTest& operator=(const TryChromeDialogTest&) = delete; + protected: TryChromeDialogTest() : SupportsTestDialog<TryChromeDialogBrowserTestBase>(GetParam()) {} @@ -297,9 +304,6 @@ // This class tests a non-dialog widget with the following name. return "TryChromeDialog"; } - - private: - DISALLOW_COPY_AND_ASSIGN(TryChromeDialogTest); }; IN_PROC_BROWSER_TEST_P(TryChromeDialogTest, InvokeUi_default) {
diff --git a/chrome/browser/ui/views/uninstall_view_browsertest.cc b/chrome/browser/ui/views/uninstall_view_browsertest.cc index 17fd833a..30a5c56b 100644 --- a/chrome/browser/ui/views/uninstall_view_browsertest.cc +++ b/chrome/browser/ui/views/uninstall_view_browsertest.cc
@@ -14,6 +14,9 @@ public: UninstallViewBrowserTest() {} + UninstallViewBrowserTest(const UninstallViewBrowserTest&) = delete; + UninstallViewBrowserTest& operator=(const UninstallViewBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { // UninstallView may need to know whether Chrome is the default browser, @@ -27,9 +30,6 @@ // See ShowUninstallBrowserPrompt in uninstall_view.cc. exit(0); } - - private: - DISALLOW_COPY_AND_ASSIGN(UninstallViewBrowserTest); }; // Invokes a dialog confirming that the user wants to uninstall Chrome.
diff --git a/chrome/browser/ui/views/update_recommended_message_box.h b/chrome/browser/ui/views/update_recommended_message_box.h index adcef96..8997d71 100644 --- a/chrome/browser/ui/views/update_recommended_message_box.h +++ b/chrome/browser/ui/views/update_recommended_message_box.h
@@ -19,6 +19,10 @@ public: static void Show(gfx::NativeWindow parent_window); + UpdateRecommendedMessageBox(const UpdateRecommendedMessageBox&) = delete; + UpdateRecommendedMessageBox& operator=(const UpdateRecommendedMessageBox&) = + delete; + private: UpdateRecommendedMessageBox(); ~UpdateRecommendedMessageBox() override; @@ -32,8 +36,6 @@ const views::Widget* GetWidget() const override; views::MessageBoxView* message_box_view_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(UpdateRecommendedMessageBox); }; #endif // CHROME_BROWSER_UI_VIEWS_UPDATE_RECOMMENDED_MESSAGE_BOX_H_
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_minimal_ui_test.cc b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_minimal_ui_test.cc index 076fe62..c2c5132 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_minimal_ui_test.cc +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_minimal_ui_test.cc
@@ -17,6 +17,9 @@ public: WebAppMinimalUITest() = default; + WebAppMinimalUITest(const WebAppMinimalUITest&) = delete; + WebAppMinimalUITest& operator=(const WebAppMinimalUITest&) = delete; + BrowserView* CreateBrowserView(blink::mojom::DisplayMode display_mode) { auto web_app_info = std::make_unique<WebApplicationInfo>(); web_app_info->start_url = GURL("https://example.org"); @@ -26,9 +29,6 @@ Browser* browser = LaunchWebAppBrowser(app_id); return BrowserView::GetBrowserViewForBrowser(browser); } - - private: - DISALLOW_COPY_AND_ASSIGN(WebAppMinimalUITest); }; IN_PROC_BROWSER_TEST_F(WebAppMinimalUITest, Standalone) {
diff --git a/chrome/browser/ui/views/web_dialog_view_browsertest.cc b/chrome/browser/ui/views/web_dialog_view_browsertest.cc index 829232f..92f4ec2 100644 --- a/chrome/browser/ui/views/web_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/web_dialog_view_browsertest.cc
@@ -69,6 +69,9 @@ public: WebDialogBrowserTest() {} + WebDialogBrowserTest(const WebDialogBrowserTest&) = delete; + WebDialogBrowserTest& operator=(const WebDialogBrowserTest&) = delete; + // content::BrowserTestBase: void SetUpOnMainThread() override; @@ -83,8 +86,6 @@ private: views::ViewTracker view_tracker_; - - DISALLOW_COPY_AND_ASSIGN(WebDialogBrowserTest); }; void WebDialogBrowserTest::SetUpOnMainThread() {
diff --git a/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc b/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc index 6d5030ec..afbe5ffd 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc
@@ -108,6 +108,10 @@ public: AuthenticatorDialogViewTest() = default; + AuthenticatorDialogViewTest(const AuthenticatorDialogViewTest&) = delete; + AuthenticatorDialogViewTest& operator=(const AuthenticatorDialogViewTest&) = + delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { content::WebContents* const web_contents = @@ -124,9 +128,6 @@ dialog, std::make_unique<TestSheetView>(std::make_unique<TestSheetModel>())); } - - private: - DISALLOW_COPY_AND_ASSIGN(AuthenticatorDialogViewTest); }; // Test the dialog with a custom delegate.
diff --git a/chrome/browser/ui/views/webauthn/hover_list_view.cc b/chrome/browser/ui/views/webauthn/hover_list_view.cc index dc39665f..abf60e1 100644 --- a/chrome/browser/ui/views/webauthn/hover_list_view.cc +++ b/chrome/browser/ui/views/webauthn/hover_list_view.cc
@@ -14,11 +14,12 @@ #include "chrome/browser/ui/views/webauthn/webauthn_hover_button.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_id.h" +#include "ui/color/color_provider.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/native_theme/native_theme.h" #include "ui/views/border.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/label.h" @@ -89,8 +90,7 @@ if (item_type_ != ItemType::kPlaceholder) return; SetTitleTextStyle(views::style::STYLE_DISABLED, - GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_BubbleBackground)); + GetColorProvider()->GetColor(ui::kColorBubbleBackground)); } private:
diff --git a/chrome/browser/ui/views/webview_accessibility_browsertest.cc b/chrome/browser/ui/views/webview_accessibility_browsertest.cc index ef2826a..dc1b780 100644 --- a/chrome/browser/ui/views/webview_accessibility_browsertest.cc +++ b/chrome/browser/ui/views/webview_accessibility_browsertest.cc
@@ -54,6 +54,9 @@ https_server_.AddDefaultHandlers(base::FilePath(kDocRoot)); } + WebViewBrowserTest(const WebViewBrowserTest&) = delete; + WebViewBrowserTest& operator=(const WebViewBrowserTest&) = delete; + protected: void SetUpOnMainThread() override { InProcessBrowserTest::SetUpOnMainThread(); @@ -70,9 +73,6 @@ protected: net::EmbeddedTestServer https_server_; - - private: - DISALLOW_COPY_AND_ASSIGN(WebViewBrowserTest); }; // Flaky. https://crbug.com/1013805
diff --git a/chrome/browser/ui/webauthn/authenticator_dialog_browsertest.cc b/chrome/browser/ui/webauthn/authenticator_dialog_browsertest.cc index e81e4f9..ca0677f 100644 --- a/chrome/browser/ui/webauthn/authenticator_dialog_browsertest.cc +++ b/chrome/browser/ui/webauthn/authenticator_dialog_browsertest.cc
@@ -28,6 +28,9 @@ public: AuthenticatorDialogTest() = default; + AuthenticatorDialogTest(const AuthenticatorDialogTest&) = delete; + AuthenticatorDialogTest& operator=(const AuthenticatorDialogTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { // Web modal dialogs' bounds may exceed the display's work area. @@ -243,8 +246,6 @@ private: base::RepeatingTimer timer_; int bio_samples_remaining_ = 5; - - DISALLOW_COPY_AND_ASSIGN(AuthenticatorDialogTest); }; // Run with:
diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc index 4eafca406..7a0c68c 100644 --- a/chrome/browser/ui/webui/about_ui.cc +++ b/chrome/browser/ui/webui/about_ui.cc
@@ -188,6 +188,9 @@ class ChromeOSTermsHandler : public base::RefCountedThreadSafe<ChromeOSTermsHandler> { public: + ChromeOSTermsHandler(const ChromeOSTermsHandler&) = delete; + ChromeOSTermsHandler& operator=(const ChromeOSTermsHandler&) = delete; + static void Start(const std::string& path, content::URLDataSource::GotDataCallback callback) { scoped_refptr<ChromeOSTermsHandler> handler( @@ -340,13 +343,14 @@ // EULA contents that was loaded from file. std::string contents_; - - DISALLOW_COPY_AND_ASSIGN(ChromeOSTermsHandler); }; class ChromeOSCreditsHandler : public base::RefCountedThreadSafe<ChromeOSCreditsHandler> { public: + ChromeOSCreditsHandler(const ChromeOSCreditsHandler&) = delete; + ChromeOSCreditsHandler& operator=(const ChromeOSCreditsHandler&) = delete; + static void Start(const std::string& path, content::URLDataSource::GotDataCallback callback) { scoped_refptr<ChromeOSCreditsHandler> handler( @@ -407,13 +411,14 @@ // Chrome OS credits contents that was loaded from file. std::string contents_; - - DISALLOW_COPY_AND_ASSIGN(ChromeOSCreditsHandler); }; class CrostiniCreditsHandler : public base::RefCountedThreadSafe<CrostiniCreditsHandler> { public: + CrostiniCreditsHandler(const CrostiniCreditsHandler&) = delete; + CrostiniCreditsHandler& operator=(const CrostiniCreditsHandler&) = delete; + static void Start(Profile* profile, const std::string& path, content::URLDataSource::GotDataCallback callback) { @@ -491,8 +496,6 @@ std::string contents_; Profile* profile_; - - DISALLOW_COPY_AND_ASSIGN(CrostiniCreditsHandler); }; #endif
diff --git a/chrome/browser/ui/webui/about_ui_unittest.cc b/chrome/browser/ui/webui/about_ui_unittest.cc index 8d63b3a..71d9b07 100644 --- a/chrome/browser/ui/webui/about_ui_unittest.cc +++ b/chrome/browser/ui/webui/about_ui_unittest.cc
@@ -70,6 +70,10 @@ // Base class for ChromeOS offline terms tests. class ChromeOSTermsTest : public testing::Test { + public: + ChromeOSTermsTest(const ChromeOSTermsTest&) = delete; + ChromeOSTermsTest& operator=(const ChromeOSTermsTest&) = delete; + protected: ChromeOSTermsTest() {} ~ChromeOSTermsTest() override = default; @@ -139,8 +143,6 @@ chromeos::system::ScopedFakeStatisticsProvider statistics_provider_; std::unique_ptr<AboutUIHTMLSource> tested_html_source_; - - DISALLOW_COPY_AND_ASSIGN(ChromeOSTermsTest); }; TEST_F(ChromeOSTermsTest, NoData) { @@ -162,6 +164,11 @@ // Demo mode ARC++ ToS and privacy policy test. class DemoModeChromeOSTermsTest : public ChromeOSTermsTest { + public: + DemoModeChromeOSTermsTest(const DemoModeChromeOSTermsTest&) = delete; + DemoModeChromeOSTermsTest& operator=(const DemoModeChromeOSTermsTest&) = + delete; + protected: DemoModeChromeOSTermsTest() = default; ~DemoModeChromeOSTermsTest() override = default; @@ -226,8 +233,6 @@ private: std::unique_ptr<ash::FakeLoginDisplayHost> fake_login_display_host_; - - DISALLOW_COPY_AND_ASSIGN(DemoModeChromeOSTermsTest); }; TEST_F(DemoModeChromeOSTermsTest, TermsSimpleRegion) {
diff --git a/chrome/browser/ui/webui/bookmarks/bookmarks_ui.h b/chrome/browser/ui/webui/bookmarks/bookmarks_ui.h index 0f4166e..aaf3a725 100644 --- a/chrome/browser/ui/webui/bookmarks/bookmarks_ui.h +++ b/chrome/browser/ui/webui/bookmarks/bookmarks_ui.h
@@ -17,11 +17,11 @@ public: explicit BookmarksUI(content::WebUI* web_ui); + BookmarksUI(const BookmarksUI&) = delete; + BookmarksUI& operator=(const BookmarksUI&) = delete; + static base::RefCountedMemory* GetFaviconResourceBytes( ui::ResourceScaleFactor scale_factor); - - private: - DISALLOW_COPY_AND_ASSIGN(BookmarksUI); }; #endif // CHROME_BROWSER_UI_WEBUI_BOOKMARKS_BOOKMARKS_UI_H_
diff --git a/chrome/browser/ui/webui/browser_switch/browser_switch_ui.h b/chrome/browser/ui/webui/browser_switch/browser_switch_ui.h index b2e43b62..8674a7d 100644 --- a/chrome/browser/ui/webui/browser_switch/browser_switch_ui.h +++ b/chrome/browser/ui/webui/browser_switch/browser_switch_ui.h
@@ -13,8 +13,8 @@ public: explicit BrowserSwitchUI(content::WebUI* web_ui); - private: - DISALLOW_COPY_AND_ASSIGN(BrowserSwitchUI); + BrowserSwitchUI(const BrowserSwitchUI&) = delete; + BrowserSwitchUI& operator=(const BrowserSwitchUI&) = delete; }; #endif // CHROME_BROWSER_UI_WEBUI_BROWSER_SWITCH_BROWSER_SWITCH_UI_H_
diff --git a/chrome/browser/ui/webui/certificate_viewer_webui.cc b/chrome/browser/ui/webui/certificate_viewer_webui.cc index 89ea312..8e5b57f5 100644 --- a/chrome/browser/ui/webui/certificate_viewer_webui.cc +++ b/chrome/browser/ui/webui/certificate_viewer_webui.cc
@@ -50,6 +50,9 @@ // string, then delegates to the other constructor. explicit CertNodeBuilder(int label_id); + CertNodeBuilder(const CertNodeBuilder&) = delete; + CertNodeBuilder& operator=(const CertNodeBuilder&) = delete; + // Builder methods all return |*this| so that they can be chained in single // expressions. @@ -73,8 +76,6 @@ // |built_| is false until Build() is called. Once it is |true|, |node_| and // |children_| are no longer valid for use. bool built_ = false; - - DISALLOW_COPY_AND_ASSIGN(CertNodeBuilder); }; CertNodeBuilder::CertNodeBuilder(base::StringPiece label) {
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.h b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.h index 35ac723..8990801 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.h +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.h
@@ -27,6 +27,10 @@ class ChromeWebUIControllerFactory : public content::WebUIControllerFactory { public: + ChromeWebUIControllerFactory(const ChromeWebUIControllerFactory&) = delete; + ChromeWebUIControllerFactory& operator=(const ChromeWebUIControllerFactory&) = + delete; + static ChromeWebUIControllerFactory* GetInstance(); // http://crbug.com/829412 @@ -67,8 +71,6 @@ base::RefCountedMemory* GetFaviconResourceBytes( const GURL& page_url, ui::ResourceScaleFactor scale_factor) const; - - DISALLOW_COPY_AND_ASSIGN(ChromeWebUIControllerFactory); }; #endif // CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_CONTROLLER_FACTORY_H_
diff --git a/chrome/browser/ui/webui/chromeos/account_manager/account_manager_welcome_dialog.h b/chrome/browser/ui/webui/chromeos/account_manager/account_manager_welcome_dialog.h index 04c65aa..727d6f36 100644 --- a/chrome/browser/ui/webui/chromeos/account_manager/account_manager_welcome_dialog.h +++ b/chrome/browser/ui/webui/chromeos/account_manager/account_manager_welcome_dialog.h
@@ -14,6 +14,10 @@ class AccountManagerWelcomeDialog : public SystemWebDialogDelegate { public: + AccountManagerWelcomeDialog(const AccountManagerWelcomeDialog&) = delete; + AccountManagerWelcomeDialog& operator=(const AccountManagerWelcomeDialog&) = + delete; + // Displays the Chrome OS Account Manager welcome screen, if it has not been // shown "too many times" before. Returns true if the screen was displayed, // false otherwise. @@ -38,8 +42,6 @@ private: static bool ShowIfRequiredInternal(); - - DISALLOW_COPY_AND_ASSIGN(AccountManagerWelcomeDialog); }; } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/account_manager/account_migration_welcome_dialog.h b/chrome/browser/ui/webui/chromeos/account_manager/account_migration_welcome_dialog.h index 6622d96..c808278d 100644 --- a/chrome/browser/ui/webui/chromeos/account_manager/account_migration_welcome_dialog.h +++ b/chrome/browser/ui/webui/chromeos/account_manager/account_migration_welcome_dialog.h
@@ -15,6 +15,10 @@ class AccountMigrationWelcomeDialog : public SystemWebDialogDelegate { public: + AccountMigrationWelcomeDialog(const AccountMigrationWelcomeDialog&) = delete; + AccountMigrationWelcomeDialog& operator=( + const AccountMigrationWelcomeDialog&) = delete; + // Displays the migration dialog for the |email|. static AccountMigrationWelcomeDialog* Show(const std::string& email); @@ -36,8 +40,6 @@ private: const std::string email_; const std::string id_; - - DISALLOW_COPY_AND_ASSIGN(AccountMigrationWelcomeDialog); }; } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/add_supervision/add_supervision_metrics_recorder.h b/chrome/browser/ui/webui/chromeos/add_supervision/add_supervision_metrics_recorder.h index 1e20c1e..0c4daaa7 100644 --- a/chrome/browser/ui/webui/chromeos/add_supervision/add_supervision_metrics_recorder.h +++ b/chrome/browser/ui/webui/chromeos/add_supervision/add_supervision_metrics_recorder.h
@@ -36,6 +36,10 @@ kMaxValue = kSwitchedAccounts }; + AddSupervisionMetricsRecorder(const AddSupervisionMetricsRecorder&) = delete; + AddSupervisionMetricsRecorder& operator=( + const AddSupervisionMetricsRecorder&) = delete; + static AddSupervisionMetricsRecorder* GetInstance(); // Records UMA metrics for users going through the Add Supervision process. @@ -57,8 +61,6 @@ // Records when the user initiates the Add Supervision process. base::TimeTicks start_time_; - - DISALLOW_COPY_AND_ASSIGN(AddSupervisionMetricsRecorder); }; #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_ADD_SUPERVISION_ADD_SUPERVISION_METRICS_RECORDER_H_
diff --git a/chrome/browser/ui/webui/chromeos/add_supervision/add_supervision_ui.h b/chrome/browser/ui/webui/chromeos/add_supervision/add_supervision_ui.h index c7d977f..c06c5ec 100644 --- a/chrome/browser/ui/webui/chromeos/add_supervision/add_supervision_ui.h +++ b/chrome/browser/ui/webui/chromeos/add_supervision/add_supervision_ui.h
@@ -24,6 +24,9 @@ // convert a regular Google account into a Family-Link managed account. class AddSupervisionDialog : public SystemWebDialogDelegate { public: + AddSupervisionDialog(const AddSupervisionDialog&) = delete; + AddSupervisionDialog& operator=(const AddSupervisionDialog&) = delete; + // Shows the dialog; if the dialog is already displayed, this function is a // no-op. static void Show(gfx::NativeView parent); @@ -58,8 +61,6 @@ private: bool should_close_on_escape_ = true; - - DISALLOW_COPY_AND_ASSIGN(AddSupervisionDialog); }; // Controller for chrome://add-supervision
diff --git a/chrome/browser/ui/webui/chromeos/arc_graphics_tracing/arc_graphics_tracing_ui.h b/chrome/browser/ui/webui/chromeos/arc_graphics_tracing/arc_graphics_tracing_ui.h index 82713f2..fb4adb1 100644 --- a/chrome/browser/ui/webui/chromeos/arc_graphics_tracing/arc_graphics_tracing_ui.h +++ b/chrome/browser/ui/webui/chromeos/arc_graphics_tracing/arc_graphics_tracing_ui.h
@@ -21,8 +21,8 @@ public: explicit ArcGraphicsTracingUI(content::WebUI* web_ui); - private: - DISALLOW_COPY_AND_ASSIGN(ArcGraphicsTracingUI); + ArcGraphicsTracingUI(const ArcGraphicsTracingUI&) = delete; + ArcGraphicsTracingUI& operator=(const ArcGraphicsTracingUI&) = delete; }; } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h b/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h index de30f6c..4cd936d6 100644 --- a/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h +++ b/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h
@@ -45,6 +45,9 @@ // Dialog delegate for the assistant optin page. class AssistantOptInDialog : public SystemWebDialogDelegate { public: + AssistantOptInDialog(const AssistantOptInDialog&) = delete; + AssistantOptInDialog& operator=(const AssistantOptInDialog&) = delete; + // Shows the assistant optin dialog. static void Show(ash::FlowType type = ash::FlowType::kConsentFlow, ash::AssistantSetup::StartAssistantOptInFlowCallback @@ -73,8 +76,6 @@ // Callback to run if the flow is completed. ash::AssistantSetup::StartAssistantOptInFlowCallback callback_; - - DISALLOW_COPY_AND_ASSIGN(AssistantOptInDialog); }; } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.h b/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.h index 4ca0a028..a4006424 100644 --- a/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.h +++ b/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.h
@@ -19,6 +19,9 @@ class BluetoothPairingDialog : public SystemWebDialogDelegate { public: + BluetoothPairingDialog(const BluetoothPairingDialog&) = delete; + BluetoothPairingDialog& operator=(const BluetoothPairingDialog&) = delete; + // Show the Bluetooth pairing dialog. When provided, |device_address| is the // unique device address that the dialog should attempt to pair with and // should be in the form "XX:XX:XX:XX:XX:XX". When |device_address| is not @@ -49,8 +52,6 @@ std::string dialog_id_; base::DictionaryValue device_data_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothPairingDialog); }; // A WebUI to host the Bluetooth device pairing web UI.
diff --git a/chrome/browser/ui/webui/chromeos/cellular_setup/mobile_setup_dialog.h b/chrome/browser/ui/webui/chromeos/cellular_setup/mobile_setup_dialog.h index d94953c..be3856d 100644 --- a/chrome/browser/ui/webui/chromeos/cellular_setup/mobile_setup_dialog.h +++ b/chrome/browser/ui/webui/chromeos/cellular_setup/mobile_setup_dialog.h
@@ -17,6 +17,10 @@ // DEPRECATED: Being replaced by new UI; see https://crbug.com/778021. class MobileSetupDialog : public SystemWebDialogDelegate { + public: + MobileSetupDialog(const MobileSetupDialog&) = delete; + MobileSetupDialog& operator=(const MobileSetupDialog&) = delete; + protected: explicit MobileSetupDialog(const NetworkState& network); ~MobileSetupDialog() override; @@ -31,8 +35,6 @@ friend void NetworkConnectDelegateChromeOS::ShowCarrierAccountDetail( const std::string& network_id); static void ShowByNetworkId(const std::string& network_id); - - DISALLOW_COPY_AND_ASSIGN(MobileSetupDialog); }; } // namespace cellular_setup
diff --git a/chrome/browser/ui/webui/chromeos/crostini_upgrader/crostini_upgrader_dialog_browsertest.cc b/chrome/browser/ui/webui/chromeos/crostini_upgrader/crostini_upgrader_dialog_browsertest.cc index 4c5b0b9..42c5852 100644 --- a/chrome/browser/ui/webui/chromeos/crostini_upgrader/crostini_upgrader_dialog_browsertest.cc +++ b/chrome/browser/ui/webui/chromeos/crostini_upgrader/crostini_upgrader_dialog_browsertest.cc
@@ -33,6 +33,11 @@ : CrostiniDialogBrowserTest(true /*register_termina*/), app_id_(crostini::CrostiniTestHelper::GenerateAppId(kDesktopFileId)) {} + CrostiniUpgraderDialogBrowserTest(const CrostiniUpgraderDialogBrowserTest&) = + delete; + CrostiniUpgraderDialogBrowserTest& operator=( + const CrostiniUpgraderDialogBrowserTest&) = delete; + // DialogBrowserTest: void ShowUi(const std::string& name) override { chromeos::CrostiniUpgraderDialog::Show(browser()->profile(), @@ -100,8 +105,6 @@ private: std::string app_id_; - - DISALLOW_COPY_AND_ASSIGN(CrostiniUpgraderDialogBrowserTest); }; IN_PROC_BROWSER_TEST_F(CrostiniUpgraderDialogBrowserTest,
diff --git a/chrome/browser/ui/webui/chromeos/diagnostics_dialog.cc b/chrome/browser/ui/webui/chromeos/diagnostics_dialog.cc index e1a5909..538b9d4ae 100644 --- a/chrome/browser/ui/webui/chromeos/diagnostics_dialog.cc +++ b/chrome/browser/ui/webui/chromeos/diagnostics_dialog.cc
@@ -33,9 +33,10 @@ const float kDiagnosticsDialogScale = .8; // static -void DiagnosticsDialog::ShowDialog(DiagnosticsDialog::DiagnosticsPage page) { +void DiagnosticsDialog::ShowDialog(DiagnosticsDialog::DiagnosticsPage page, + gfx::NativeWindow parent) { DiagnosticsDialog* dialog = new DiagnosticsDialog(page); - dialog->ShowSystemDialog(); + dialog->ShowSystemDialog(parent); } DiagnosticsDialog::DiagnosticsDialog(DiagnosticsDialog::DiagnosticsPage page)
diff --git a/chrome/browser/ui/webui/chromeos/diagnostics_dialog.h b/chrome/browser/ui/webui/chromeos/diagnostics_dialog.h index f16cd824..cbb0c9d 100644 --- a/chrome/browser/ui/webui/chromeos/diagnostics_dialog.h +++ b/chrome/browser/ui/webui/chromeos/diagnostics_dialog.h
@@ -7,6 +7,7 @@ #include "base/macros.h" #include "chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h" +#include "ui/gfx/native_widget_types.h" namespace chromeos { @@ -25,7 +26,8 @@ }; // |page| is the initial page shown when the app is opened. - static void ShowDialog(DiagnosticsPage page = DiagnosticsPage::kDefault); + static void ShowDialog(DiagnosticsPage page = DiagnosticsPage::kDefault, + gfx::NativeWindow parent = gfx::kNullNativeWindow); protected: explicit DiagnosticsDialog(DiagnosticsPage page);
diff --git a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc index 63d4f01..8bcef77 100644 --- a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc +++ b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
@@ -831,6 +831,9 @@ zip_path_(logs_directory_.AppendASCII(kLogsZipName)), drive_internals_(std::move(drive_internals)) {} + LogsZipper(const LogsZipper&) = delete; + LogsZipper& operator=(const LogsZipper&) = delete; + void Start() { base::ThreadPool::PostTaskAndReplyWithResult( FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE}, @@ -908,8 +911,6 @@ const base::WeakPtr<DriveInternalsWebUIHandler> drive_internals_; std::unique_ptr<download::AllDownloadItemNotifier> download_notifier_; - - DISALLOW_COPY_AND_ASSIGN(LogsZipper); }; constexpr char LogsZipper::kLogsZipName[];
diff --git a/chrome/browser/ui/webui/chromeos/drive_internals_ui.h b/chrome/browser/ui/webui/chromeos/drive_internals_ui.h index de0009e..0ed56a9 100644 --- a/chrome/browser/ui/webui/chromeos/drive_internals_ui.h +++ b/chrome/browser/ui/webui/chromeos/drive_internals_ui.h
@@ -16,8 +16,8 @@ public: explicit DriveInternalsUI(content::WebUI* web_ui); - private: - DISALLOW_COPY_AND_ASSIGN(DriveInternalsUI); + DriveInternalsUI(const DriveInternalsUI&) = delete; + DriveInternalsUI& operator=(const DriveInternalsUI&) = delete; }; } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_dialogs.h b/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_dialogs.h index f6f32a2..6e67bb1 100644 --- a/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_dialogs.h +++ b/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_dialogs.h
@@ -15,6 +15,10 @@ // A modal system dialog without any frame decorating it. class BasePasswordDialog : public SystemWebDialogDelegate { + public: + BasePasswordDialog(const BasePasswordDialog&) = delete; + BasePasswordDialog& operator=(const BasePasswordDialog&) = delete; + protected: BasePasswordDialog(GURL url, gfx::Size desired_size); ~BasePasswordDialog() override; @@ -26,27 +30,29 @@ private: gfx::Size desired_size_; - - DISALLOW_COPY_AND_ASSIGN(BasePasswordDialog); }; // System dialog wrapping chrome:://password-change class PasswordChangeDialog : public BasePasswordDialog { public: + PasswordChangeDialog(const PasswordChangeDialog&) = delete; + PasswordChangeDialog& operator=(const PasswordChangeDialog&) = delete; + static void Show(); static void Dismiss(); protected: PasswordChangeDialog(); ~PasswordChangeDialog() override; - - private: - DISALLOW_COPY_AND_ASSIGN(PasswordChangeDialog); }; // System dialog wrapping chrome://confirm-password-change class ConfirmPasswordChangeDialog : public BasePasswordDialog { public: + ConfirmPasswordChangeDialog(const ConfirmPasswordChangeDialog&) = delete; + ConfirmPasswordChangeDialog& operator=(const ConfirmPasswordChangeDialog&) = + delete; + static void Show(const std::string& scraped_old_password, const std::string& scraped_new_password, bool show_spinner_initially); @@ -70,22 +76,22 @@ std::string scraped_old_password_; std::string scraped_new_password_; bool show_spinner_initially_ = false; - - DISALLOW_COPY_AND_ASSIGN(ConfirmPasswordChangeDialog); }; // System dialog wrapping chrome://urgent-password-expiry-notification class UrgentPasswordExpiryNotificationDialog : public BasePasswordDialog { public: + UrgentPasswordExpiryNotificationDialog( + const UrgentPasswordExpiryNotificationDialog&) = delete; + UrgentPasswordExpiryNotificationDialog& operator=( + const UrgentPasswordExpiryNotificationDialog&) = delete; + static void Show(); static void Dismiss(); protected: UrgentPasswordExpiryNotificationDialog(); ~UrgentPasswordExpiryNotificationDialog() override; - - private: - DISALLOW_COPY_AND_ASSIGN(UrgentPasswordExpiryNotificationDialog); }; } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/internet_config_dialog.h b/chrome/browser/ui/webui/chromeos/internet_config_dialog.h index f89f8b2..40d7845e 100644 --- a/chrome/browser/ui/webui/chromeos/internet_config_dialog.h +++ b/chrome/browser/ui/webui/chromeos/internet_config_dialog.h
@@ -19,6 +19,9 @@ class InternetConfigDialog : public SystemWebDialogDelegate { public: + InternetConfigDialog(const InternetConfigDialog&) = delete; + InternetConfigDialog& operator=(const InternetConfigDialog&) = delete; + // Shows a network configuration dialog for |network_id|. Does nothing if // there is no NetworkState matching |network_id|. static void ShowDialogForNetworkId(const std::string& network_id, @@ -49,8 +52,6 @@ std::string dialog_id_; std::string network_type_; std::string network_id_; - - DISALLOW_COPY_AND_ASSIGN(InternetConfigDialog); }; // A WebUI to host the network configuration UI in a dialog, used in the
diff --git a/chrome/browser/ui/webui/chromeos/internet_detail_dialog.h b/chrome/browser/ui/webui/chromeos/internet_detail_dialog.h index c3c37c3..5050655 100644 --- a/chrome/browser/ui/webui/chromeos/internet_detail_dialog.h +++ b/chrome/browser/ui/webui/chromeos/internet_detail_dialog.h
@@ -18,6 +18,9 @@ class InternetDetailDialog : public SystemWebDialogDelegate { public: + InternetDetailDialog(const InternetDetailDialog&) = delete; + InternetDetailDialog& operator=(const InternetDetailDialog&) = delete; + // Returns whether the dialog is being shown. static bool IsShown(); @@ -41,8 +44,6 @@ std::string network_id_; std::string network_type_; std::string network_name_; - - DISALLOW_COPY_AND_ASSIGN(InternetDetailDialog); }; // A WebUI to host a subset of the network details page to allow setting of
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser_unittest.cc b/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser_unittest.cc index 2d3b9f29..1ae02bc 100644 --- a/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser_unittest.cc +++ b/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser_unittest.cc
@@ -34,6 +34,9 @@ public: TestCrosDisplayConfig() = default; + TestCrosDisplayConfig(const TestCrosDisplayConfig&) = delete; + TestCrosDisplayConfig& operator=(const TestCrosDisplayConfig&) = delete; + mojo::PendingRemote<ash::mojom::CrosDisplayConfigController> CreateRemoteAndBind() { return receiver_.BindNewPipeAndPassRemote(); @@ -77,14 +80,15 @@ private: mojo::Receiver<ash::mojom::CrosDisplayConfigController> receiver_{this}; - - DISALLOW_COPY_AND_ASSIGN(TestCrosDisplayConfig); }; class OobeDisplayChooserTest : public ChromeAshTestBase { public: OobeDisplayChooserTest() : ChromeAshTestBase() {} + OobeDisplayChooserTest(const OobeDisplayChooserTest&) = delete; + OobeDisplayChooserTest& operator=(const OobeDisplayChooserTest&) = delete; + int64_t GetPrimaryDisplay() { return display::Screen::GetScreen()->GetPrimaryDisplay().id(); } @@ -106,8 +110,6 @@ private: std::unique_ptr<TestCrosDisplayConfig> cros_display_config_; std::unique_ptr<OobeDisplayChooser> display_chooser_; - - DISALLOW_COPY_AND_ASSIGN(OobeDisplayChooserTest); }; const uint16_t kAllowlistedId = 0x266e;
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.h b/chrome/browser/ui/webui/chromeos/login/oobe_ui.h index 23e172bc..ca887bc 100644 --- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.h +++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.h
@@ -56,6 +56,9 @@ class Observer { public: Observer() {} + + Observer(const Observer&) = delete; + virtual void OnCurrentScreenChanged(OobeScreenId current_screen, OobeScreenId new_screen) = 0; @@ -63,10 +66,13 @@ protected: virtual ~Observer() {} - DISALLOW_COPY(Observer); }; OobeUI(content::WebUI* web_ui, const GURL& url); + + OobeUI(const OobeUI&) = delete; + OobeUI& operator=(const OobeUI&) = delete; + ~OobeUI() override; CoreOobeView* GetCoreOobeView(); @@ -225,8 +231,6 @@ std::unique_ptr<JSCallsContainer> js_calls_container_; WEB_UI_CONTROLLER_TYPE_DECL(); - - DISALLOW_COPY_AND_ASSIGN(OobeUI); }; } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.h b/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.h index 3341a75..054dc5cd 100644 --- a/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.h +++ b/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.h
@@ -24,6 +24,9 @@ // Chromebook and a phone). class MultiDeviceSetupDialog : public SystemWebDialogDelegate { public: + MultiDeviceSetupDialog(const MultiDeviceSetupDialog&) = delete; + MultiDeviceSetupDialog& operator=(const MultiDeviceSetupDialog&) = delete; + // Shows the dialog; if the dialog is already displayed, this function is a // no-op. static void Show(); @@ -52,8 +55,6 @@ // List of callbacks that have registered themselves to be invoked once this // dialog is closed. std::vector<base::OnceClosure> on_close_callbacks_; - - DISALLOW_COPY_AND_ASSIGN(MultiDeviceSetupDialog); }; class MultiDeviceSetupDialogUI : public ui::MojoWebDialogUI {
diff --git a/chrome/browser/ui/webui/chromeos/slow_trace_ui.h b/chrome/browser/ui/webui/chromeos/slow_trace_ui.h index b05b483..0abb5c9 100644 --- a/chrome/browser/ui/webui/chromeos/slow_trace_ui.h +++ b/chrome/browser/ui/webui/chromeos/slow_trace_ui.h
@@ -50,8 +50,8 @@ public: explicit SlowTraceController(content::WebUI* web_ui); - private: - DISALLOW_COPY_AND_ASSIGN(SlowTraceController); + SlowTraceController(const SlowTraceController&) = delete; + SlowTraceController& operator=(const SlowTraceController&) = delete; }; } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/slow_ui.h b/chrome/browser/ui/webui/chromeos/slow_ui.h index 3ba37aec..f5fadd5 100644 --- a/chrome/browser/ui/webui/chromeos/slow_ui.h +++ b/chrome/browser/ui/webui/chromeos/slow_ui.h
@@ -16,8 +16,8 @@ public: explicit SlowUI(content::WebUI* web_ui); - private: - DISALLOW_COPY_AND_ASSIGN(SlowUI); + SlowUI(const SlowUI&) = delete; + SlowUI& operator=(const SlowUI&) = delete; }; } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/smb_shares/smb_credentials_dialog.h b/chrome/browser/ui/webui/chromeos/smb_shares/smb_credentials_dialog.h index 01ef285..56aa822 100644 --- a/chrome/browser/ui/webui/chromeos/smb_shares/smb_credentials_dialog.h +++ b/chrome/browser/ui/webui/chromeos/smb_shares/smb_credentials_dialog.h
@@ -21,6 +21,9 @@ const std::string& username, const std::string& password)>; + SmbCredentialsDialog(const SmbCredentialsDialog&) = delete; + SmbCredentialsDialog& operator=(const SmbCredentialsDialog&) = delete; + // Shows the dialog, and runs |callback| when the user responds with a // username/password, or the dialog is closed. If a dialog is currently being // shown for |mount_id|, the existing dialog will be focused and its callback @@ -47,8 +50,6 @@ const std::string mount_id_; const std::string share_path_; RequestCallback callback_; - - DISALLOW_COPY_AND_ASSIGN(SmbCredentialsDialog); }; class SmbCredentialsDialogUI : public ui::WebDialogUI {
diff --git a/chrome/browser/ui/webui/chromeos/smb_shares/smb_share_dialog.h b/chrome/browser/ui/webui/chromeos/smb_shares/smb_share_dialog.h index b1c40ec..27ea435 100644 --- a/chrome/browser/ui/webui/chromeos/smb_shares/smb_share_dialog.h +++ b/chrome/browser/ui/webui/chromeos/smb_shares/smb_share_dialog.h
@@ -14,6 +14,9 @@ class SmbShareDialog : public SystemWebDialogDelegate { public: + SmbShareDialog(const SmbShareDialog&) = delete; + SmbShareDialog& operator=(const SmbShareDialog&) = delete; + // Shows the dialog. static void Show(); @@ -24,8 +27,6 @@ // ui::WebDialogDelegate void GetDialogSize(gfx::Size* size) const override; bool ShouldShowCloseButton() const override; - - DISALLOW_COPY_AND_ASSIGN(SmbShareDialog); }; class SmbShareDialogUI : public ui::WebDialogUI {
diff --git a/chrome/browser/ui/webui/conflicts/conflicts_ui.h b/chrome/browser/ui/webui/conflicts/conflicts_ui.h index 580b5ca..dc3348d 100644 --- a/chrome/browser/ui/webui/conflicts/conflicts_ui.h +++ b/chrome/browser/ui/webui/conflicts/conflicts_ui.h
@@ -18,11 +18,11 @@ public: explicit ConflictsUI(content::WebUI* web_ui); + ConflictsUI(const ConflictsUI&) = delete; + ConflictsUI& operator=(const ConflictsUI&) = delete; + static base::RefCountedMemory* GetFaviconResourceBytes( ui::ResourceScaleFactor scale_factor); - - private: - DISALLOW_COPY_AND_ASSIGN(ConflictsUI); }; #endif // CHROME_BROWSER_UI_WEBUI_CONFLICTS_CONFLICTS_UI_H_
diff --git a/chrome/browser/ui/webui/crashes_ui.h b/chrome/browser/ui/webui/crashes_ui.h index 44ddd2a..85413ca 100644 --- a/chrome/browser/ui/webui/crashes_ui.h +++ b/chrome/browser/ui/webui/crashes_ui.h
@@ -17,11 +17,11 @@ public: explicit CrashesUI(content::WebUI* web_ui); + CrashesUI(const CrashesUI&) = delete; + CrashesUI& operator=(const CrashesUI&) = delete; + static base::RefCountedMemory* GetFaviconResourceBytes( ui::ResourceScaleFactor scale_factor); - - private: - DISALLOW_COPY_AND_ASSIGN(CrashesUI); }; #endif // CHROME_BROWSER_UI_WEBUI_CRASHES_UI_H_
diff --git a/chrome/browser/ui/webui/devtools_ui_data_source.h b/chrome/browser/ui/webui/devtools_ui_data_source.h index c43a6f7..4ebcb96 100644 --- a/chrome/browser/ui/webui/devtools_ui_data_source.h +++ b/chrome/browser/ui/webui/devtools_ui_data_source.h
@@ -83,14 +83,14 @@ struct PendingRequest { PendingRequest(); + PendingRequest(const PendingRequest&) = delete; + PendingRequest& operator=(const PendingRequest&) = delete; PendingRequest(PendingRequest&& other); PendingRequest& operator=(PendingRequest&& other) = default; ~PendingRequest(); GotDataCallback callback; std::unique_ptr<network::SimpleURLLoader> loader; - - DISALLOW_COPY_AND_ASSIGN(PendingRequest); }; scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
diff --git a/chrome/browser/ui/webui/devtools_ui_data_source_unittest.cc b/chrome/browser/ui/webui/devtools_ui_data_source_unittest.cc index 9c7d3b4f..653b8df 100644 --- a/chrome/browser/ui/webui/devtools_ui_data_source_unittest.cc +++ b/chrome/browser/ui/webui/devtools_ui_data_source_unittest.cc
@@ -65,6 +65,10 @@ }; class DevToolsUIDataSourceTest : public testing::Test { + public: + DevToolsUIDataSourceTest(const DevToolsUIDataSourceTest&) = delete; + DevToolsUIDataSourceTest& operator=(const DevToolsUIDataSourceTest&) = delete; + protected: DevToolsUIDataSourceTest() {} ~DevToolsUIDataSourceTest() override = default; @@ -107,8 +111,6 @@ std::unique_ptr<TestDevToolsDataSource> devtools_data_source_; bool data_received_ = false; std::string data_; - - DISALLOW_COPY_AND_ASSIGN(DevToolsUIDataSourceTest); }; // devtools/bundled path.
diff --git a/chrome/browser/ui/webui/discards/graph_dump_impl.cc b/chrome/browser/ui/webui/discards/graph_dump_impl.cc index 33b3596..8f86b99b 100644 --- a/chrome/browser/ui/webui/discards/graph_dump_impl.cc +++ b/chrome/browser/ui/webui/discards/graph_dump_impl.cc
@@ -50,6 +50,9 @@ FaviconRequestHelper(base::WeakPtr<DiscardsGraphDumpImpl> graph_dump, scoped_refptr<base::SequencedTaskRunner> task_runner); + FaviconRequestHelper(const FaviconRequestHelper&) = delete; + FaviconRequestHelper& operator=(const FaviconRequestHelper&) = delete; + void RequestFavicon(GURL page_url, performance_manager::WebContentsProxy contents_proxy, int64_t serialization_id); @@ -63,8 +66,6 @@ scoped_refptr<base::SequencedTaskRunner> task_runner_; SEQUENCE_CHECKER(sequence_checker_); - - DISALLOW_COPY_AND_ASSIGN(FaviconRequestHelper); }; DiscardsGraphDumpImpl::FaviconRequestHelper::FaviconRequestHelper(
diff --git a/chrome/browser/ui/webui/help/version_updater_basic.h b/chrome/browser/ui/webui/help/version_updater_basic.h index 4c28e47..a21d42e 100644 --- a/chrome/browser/ui/webui/help/version_updater_basic.h +++ b/chrome/browser/ui/webui/help/version_updater_basic.h
@@ -12,6 +12,9 @@ // Bare bones implementation just checks if a new version is ready. class VersionUpdaterBasic : public VersionUpdater { public: + VersionUpdaterBasic(const VersionUpdaterBasic&) = delete; + VersionUpdaterBasic& operator=(const VersionUpdaterBasic&) = delete; + // VersionUpdater implementation. void CheckForUpdate(StatusCallback callback, PromoteCallback) override; @@ -21,9 +24,6 @@ // Clients must use VersionUpdater::Create(). VersionUpdaterBasic() {} ~VersionUpdaterBasic() override {} - - private: - DISALLOW_COPY_AND_ASSIGN(VersionUpdaterBasic); }; #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_BASIC_H_
diff --git a/chrome/browser/ui/webui/help/version_updater_chromeos.h b/chrome/browser/ui/webui/help/version_updater_chromeos.h index 6c4b051..0993b03 100644 --- a/chrome/browser/ui/webui/help/version_updater_chromeos.h +++ b/chrome/browser/ui/webui/help/version_updater_chromeos.h
@@ -18,6 +18,9 @@ class VersionUpdaterCros : public VersionUpdater, public chromeos::UpdateEngineClient::Observer { public: + VersionUpdaterCros(const VersionUpdaterCros&) = delete; + VersionUpdaterCros& operator=(const VersionUpdaterCros&) = delete; + // VersionUpdater implementation. void CheckForUpdate(StatusCallback callback, PromoteCallback) override; void SetChannel(const std::string& channel, @@ -68,8 +71,6 @@ bool check_for_update_when_idle_; base::WeakPtrFactory<VersionUpdaterCros> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(VersionUpdaterCros); }; #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_CHROMEOS_H_
diff --git a/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc b/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc index 8e8bfe99..2b61849 100644 --- a/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc +++ b/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc
@@ -44,6 +44,10 @@ } // namespace class VersionUpdaterCrosTest : public ::testing::Test { + public: + VersionUpdaterCrosTest(const VersionUpdaterCrosTest&) = delete; + VersionUpdaterCrosTest& operator=(const VersionUpdaterCrosTest&) = delete; + protected: VersionUpdaterCrosTest() : version_updater_(VersionUpdater::Create(nullptr)), @@ -106,8 +110,6 @@ MockUserManager* mock_user_manager_; // Not owned. user_manager::ScopedUserManager user_manager_enabler_; ScopedCrosSettingsTestHelper cros_settings_test_helper_; - - DISALLOW_COPY_AND_ASSIGN(VersionUpdaterCrosTest); }; // The test checks following behaviour:
diff --git a/chrome/browser/ui/webui/help/version_updater_mac.h b/chrome/browser/ui/webui/help/version_updater_mac.h index 7faab835..5b97edf 100644 --- a/chrome/browser/ui/webui/help/version_updater_mac.h +++ b/chrome/browser/ui/webui/help/version_updater_mac.h
@@ -29,6 +29,9 @@ // About/Help page. class VersionUpdaterMac : public VersionUpdater { public: + VersionUpdaterMac(const VersionUpdaterMac&) = delete; + VersionUpdaterMac& operator=(const VersionUpdaterMac&) = delete; + // VersionUpdater implementation. void CheckForUpdate(StatusCallback status_callback, PromoteCallback promote_callback) override; @@ -82,8 +85,6 @@ scoped_refptr<BrowserUpdaterClient> update_client_; base::WeakPtrFactory<VersionUpdaterMac> weak_factory_{this}; #endif // BUILDFLAG(ENABLE_CHROMIUM_UPDATER) - - DISALLOW_COPY_AND_ASSIGN(VersionUpdaterMac); }; #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_MAC_H_
diff --git a/chrome/browser/ui/webui/history/browsing_history_handler_unittest.cc b/chrome/browser/ui/webui/history/browsing_history_handler_unittest.cc index 786c083..100f8301 100644 --- a/chrome/browser/ui/webui/history/browsing_history_handler_unittest.cc +++ b/chrome/browser/ui/webui/history/browsing_history_handler_unittest.cc
@@ -60,6 +60,11 @@ test_clock_.SetNow(PretendNow()); } + BrowsingHistoryHandlerWithWebUIForTesting( + const BrowsingHistoryHandlerWithWebUIForTesting&) = delete; + BrowsingHistoryHandlerWithWebUIForTesting& operator=( + const BrowsingHistoryHandlerWithWebUIForTesting&) = delete; + void SendHistoryQuery(int count, const std::u16string& query) override { if (postpone_query_results_) { return; @@ -74,8 +79,6 @@ private: base::SimpleTestClock test_clock_; bool postpone_query_results_ = false; - - DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandlerWithWebUIForTesting); }; } // namespace
diff --git a/chrome/browser/ui/webui/inspect_ui_browsertest.cc b/chrome/browser/ui/webui/inspect_ui_browsertest.cc index 1c2312e..d8b09d9 100644 --- a/chrome/browser/ui/webui/inspect_ui_browsertest.cc +++ b/chrome/browser/ui/webui/inspect_ui_browsertest.cc
@@ -28,13 +28,13 @@ public: InspectUITest() {} + InspectUITest(const InspectUITest&) = delete; + InspectUITest& operator=(const InspectUITest&) = delete; + void SetUpOnMainThread() override { WebUIBrowserTest::SetUpOnMainThread(); AddLibrary(base::FilePath(FILE_PATH_LITERAL("inspect_ui_test.js"))); } - - private: - DISALLOW_COPY_AND_ASSIGN(InspectUITest); }; IN_PROC_BROWSER_TEST_F(InspectUITest, InspectUIPage) {
diff --git a/chrome/browser/ui/webui/media/webrtc_logs_ui.h b/chrome/browser/ui/webui/media/webrtc_logs_ui.h index a7e5599..7f5282ab 100644 --- a/chrome/browser/ui/webui/media/webrtc_logs_ui.h +++ b/chrome/browser/ui/webui/media/webrtc_logs_ui.h
@@ -14,8 +14,8 @@ public: explicit WebRtcLogsUI(content::WebUI* web_ui); - private: - DISALLOW_COPY_AND_ASSIGN(WebRtcLogsUI); + WebRtcLogsUI(const WebRtcLogsUI&) = delete; + WebRtcLogsUI& operator=(const WebRtcLogsUI&) = delete; }; #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_WEBRTC_LOGS_UI_H_
diff --git a/chrome/browser/ui/webui/nacl_ui.h b/chrome/browser/ui/webui/nacl_ui.h index 472b68c..4bb34600 100644 --- a/chrome/browser/ui/webui/nacl_ui.h +++ b/chrome/browser/ui/webui/nacl_ui.h
@@ -13,8 +13,8 @@ public: explicit NaClUI(content::WebUI* web_ui); - private: - DISALLOW_COPY_AND_ASSIGN(NaClUI); + NaClUI(const NaClUI&) = delete; + NaClUI& operator=(const NaClUI&) = delete; }; #endif // CHROME_BROWSER_UI_WEBUI_NACL_UI_H_
diff --git a/chrome/browser/ui/webui/net_export_ui.h b/chrome/browser/ui/webui/net_export_ui.h index cb58382..c3a376e 100644 --- a/chrome/browser/ui/webui/net_export_ui.h +++ b/chrome/browser/ui/webui/net_export_ui.h
@@ -13,8 +13,8 @@ public: explicit NetExportUI(content::WebUI* web_ui); - private: - DISALLOW_COPY_AND_ASSIGN(NetExportUI); + NetExportUI(const NetExportUI&) = delete; + NetExportUI& operator=(const NetExportUI&) = delete; }; #endif // CHROME_BROWSER_UI_WEBUI_NET_EXPORT_UI_H_
diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.h b/chrome/browser/ui/webui/net_internals/net_internals_ui.h index 9349ef0c..fae7bcb 100644 --- a/chrome/browser/ui/webui/net_internals/net_internals_ui.h +++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.h
@@ -12,8 +12,8 @@ public: explicit NetInternalsUI(content::WebUI* web_ui); - private: - DISALLOW_COPY_AND_ASSIGN(NetInternalsUI); + NetInternalsUI(const NetInternalsUI&) = delete; + NetInternalsUI& operator=(const NetInternalsUI&) = delete; }; #endif // CHROME_BROWSER_UI_WEBUI_NET_INTERNALS_NET_INTERNALS_UI_H_
diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc index a31d5a04..5e4e982 100644 --- a/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc +++ b/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc
@@ -118,6 +118,9 @@ public: explicit MessageHandler(NetInternalsTest* net_internals_test); + MessageHandler(const MessageHandler&) = delete; + MessageHandler& operator=(const MessageHandler&) = delete; + private: void RegisterMessages() override; @@ -153,8 +156,6 @@ net::NetworkIsolationKey::CreateTransient()}; base::WeakPtrFactory<MessageHandler> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MessageHandler); }; NetInternalsTest::MessageHandler::MessageHandler(
diff --git a/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc b/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc index f360b72..fbab061 100644 --- a/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc +++ b/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
@@ -42,6 +42,11 @@ favicon::FaviconService* favicon_service) : handler_(favicon_service) {} + ChromeNTPTilesInternalsMessageHandlerClient( + const ChromeNTPTilesInternalsMessageHandlerClient&) = delete; + ChromeNTPTilesInternalsMessageHandlerClient& operator=( + const ChromeNTPTilesInternalsMessageHandlerClient&) = delete; + private: // content::WebUIMessageHandler: void RegisterMessages() override; @@ -64,8 +69,6 @@ const std::vector<const base::Value*>& values) override; ntp_tiles::NTPTilesInternalsMessageHandler handler_; - - DISALLOW_COPY_AND_ASSIGN(ChromeNTPTilesInternalsMessageHandlerClient); }; void ChromeNTPTilesInternalsMessageHandlerClient::RegisterMessages() {
diff --git a/chrome/browser/ui/webui/omnibox/omnibox_popup_handler.h b/chrome/browser/ui/webui/omnibox/omnibox_popup_handler.h index ef7fdde..6650116 100644 --- a/chrome/browser/ui/webui/omnibox/omnibox_popup_handler.h +++ b/chrome/browser/ui/webui/omnibox/omnibox_popup_handler.h
@@ -13,14 +13,15 @@ public: OmniboxPopupHandler(); + OmniboxPopupHandler(const OmniboxPopupHandler&) = delete; + OmniboxPopupHandler& operator=(const OmniboxPopupHandler&) = delete; + // These are roughly speaking analogues of the OmniboxPopupView API. // TODO(tommycli): Update the OmniboxPopupView API to better suit WebUI, // then this class could potentially be an implementor of OmniboxPopupView. void InvalidateLine(size_t line) {} void OnSelectedLineChanged(size_t old_selected_line, size_t new_selected_line) {} - - DISALLOW_COPY_AND_ASSIGN(OmniboxPopupHandler); }; #endif // CHROME_BROWSER_UI_WEBUI_OMNIBOX_OMNIBOX_POPUP_HANDLER_H_
diff --git a/chrome/browser/ui/webui/page_not_available_for_guest/page_not_available_for_guest_ui.h b/chrome/browser/ui/webui/page_not_available_for_guest/page_not_available_for_guest_ui.h index 148ada2..6082e0c3 100644 --- a/chrome/browser/ui/webui/page_not_available_for_guest/page_not_available_for_guest_ui.h +++ b/chrome/browser/ui/webui/page_not_available_for_guest/page_not_available_for_guest_ui.h
@@ -13,8 +13,9 @@ explicit PageNotAvailableForGuestUI(content::WebUI* web_ui, const std::string& host_name); - private: - DISALLOW_COPY_AND_ASSIGN(PageNotAvailableForGuestUI); + PageNotAvailableForGuestUI(const PageNotAvailableForGuestUI&) = delete; + PageNotAvailableForGuestUI& operator=(const PageNotAvailableForGuestUI&) = + delete; }; #endif // CHROME_BROWSER_UI_WEBUI_PAGE_NOT_AVAILABLE_FOR_GUEST_PAGE_NOT_AVAILABLE_FOR_GUEST_UI_H_
diff --git a/chrome/browser/ui/webui/predictors/predictors_ui.h b/chrome/browser/ui/webui/predictors/predictors_ui.h index 0f37e349..2b57d95 100644 --- a/chrome/browser/ui/webui/predictors/predictors_ui.h +++ b/chrome/browser/ui/webui/predictors/predictors_ui.h
@@ -12,8 +12,8 @@ public: explicit PredictorsUI(content::WebUI* web_ui); - private: - DISALLOW_COPY_AND_ASSIGN(PredictorsUI); + PredictorsUI(const PredictorsUI&) = delete; + PredictorsUI& operator=(const PredictorsUI&) = delete; }; #endif // CHROME_BROWSER_UI_WEBUI_PREDICTORS_PREDICTORS_UI_H_
diff --git a/chrome/browser/ui/webui/print_preview/cloud_print_signin.cc b/chrome/browser/ui/webui/print_preview/cloud_print_signin.cc index 115d0fb..28add4b 100644 --- a/chrome/browser/ui/webui/print_preview/cloud_print_signin.cc +++ b/chrome/browser/ui/webui/print_preview/cloud_print_signin.cc
@@ -26,6 +26,9 @@ SignInObserver(content::WebContents* web_contents, base::OnceClosure callback) : WebContentsObserver(web_contents), callback_(std::move(callback)) {} + SignInObserver(const SignInObserver&) = delete; + SignInObserver& operator=(const SignInObserver&) = delete; + private: // Overridden from content::WebContentsObserver: void DidFinishNavigation( @@ -55,8 +58,6 @@ base::OnceClosure callback_; base::WeakPtrFactory<SignInObserver> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(SignInObserver); }; } // namespace
diff --git a/chrome/browser/ui/webui/print_preview/policy_settings.h b/chrome/browser/ui/webui/print_preview/policy_settings.h index a77d0782..4fc8e97 100644 --- a/chrome/browser/ui/webui/print_preview/policy_settings.h +++ b/chrome/browser/ui/webui/print_preview/policy_settings.h
@@ -18,9 +18,11 @@ // the user. class PolicySettings { public: - static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); + PolicySettings() = delete; + PolicySettings(const PolicySettings&) = delete; + PolicySettings& operator=(const PolicySettings&) = delete; - DISALLOW_IMPLICIT_CONSTRUCTORS(PolicySettings); + static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); }; } // namespace printing
diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h index 7dc259d..03e0fc2 100644 --- a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h +++ b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h
@@ -38,6 +38,9 @@ public: explicit QuotaInternalsProxy(QuotaInternalsHandler* handler); + QuotaInternalsProxy(const QuotaInternalsProxy&) = delete; + QuotaInternalsProxy& operator=(const QuotaInternalsProxy&) = delete; + void RequestInfo(scoped_refptr<storage::QuotaManager> quota_manager); void TriggerStoragePressure( url::Origin origin, @@ -87,8 +90,6 @@ hosts_pending_; std::vector<PerHostStorageInfo> report_pending_; base::WeakPtrFactory<QuotaInternalsProxy> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(QuotaInternalsProxy); }; } // namespace quota_internals
diff --git a/chrome/browser/ui/webui/settings/chromeos/account_manager_handler_browsertest.cc b/chrome/browser/ui/webui/settings/chromeos/account_manager_handler_browsertest.cc index b1d7fd1..915e7227 100644 --- a/chrome/browser/ui/webui/settings/chromeos/account_manager_handler_browsertest.cc +++ b/chrome/browser/ui/webui/settings/chromeos/account_manager_handler_browsertest.cc
@@ -118,8 +118,10 @@ set_web_ui(web_ui); } - private: - DISALLOW_COPY_AND_ASSIGN(TestingAccountManagerUIHandler); + TestingAccountManagerUIHandler(const TestingAccountManagerUIHandler&) = + delete; + TestingAccountManagerUIHandler& operator=( + const TestingAccountManagerUIHandler&) = delete; }; class AccountManagerUIHandlerTest
diff --git a/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.h b/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.h index 403303c8..8b6d9cc 100644 --- a/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.h +++ b/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.h
@@ -32,15 +32,21 @@ public: explicit TestAPI(KeyboardHandler* handler) { handler_ = handler; } + TestAPI(const TestAPI&) = delete; + TestAPI& operator=(const TestAPI&) = delete; + // Simulates a request from WebUI to initialize the page. void Initialize(); private: KeyboardHandler* handler_; // Not owned. - DISALLOW_COPY_AND_ASSIGN(TestAPI); }; KeyboardHandler(); + + KeyboardHandler(const KeyboardHandler&) = delete; + KeyboardHandler& operator=(const KeyboardHandler&) = delete; + ~KeyboardHandler() override; // SettingsPageUIHandler implementation. @@ -70,8 +76,6 @@ base::ScopedObservation<ui::DeviceDataManager, ui::InputDeviceEventObserver> observation_{this}; - - DISALLOW_COPY_AND_ASSIGN(KeyboardHandler); }; } // namespace settings
diff --git a/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler_unittest.cc b/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler_unittest.cc index fd51b02..c43d050 100644 --- a/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler_unittest.cc
@@ -43,6 +43,9 @@ device_data_manager_test_api_.SetKeyboardDevices({}); } + KeyboardHandlerTest(const KeyboardHandlerTest&) = delete; + KeyboardHandlerTest& operator=(const KeyboardHandlerTest&) = delete; + protected: // Updates out-params from the last message sent to WebUI about a change to // which keys should be shown. False is returned if the message was invalid or @@ -163,9 +166,6 @@ content::TestWebUI web_ui_; TestKeyboardHandler handler_; KeyboardHandler::TestAPI handler_test_api_; - - private: - DISALLOW_COPY_AND_ASSIGN(KeyboardHandlerTest); }; TEST_F(KeyboardHandlerTest, DefaultKeys) {
diff --git a/chrome/browser/ui/webui/settings/chromeos/device_power_handler.h b/chrome/browser/ui/webui/settings/chromeos/device_power_handler.h index c4a5f81b..350e9c6 100644 --- a/chrome/browser/ui/webui/settings/chromeos/device_power_handler.h +++ b/chrome/browser/ui/webui/settings/chromeos/device_power_handler.h
@@ -75,6 +75,10 @@ }; explicit PowerHandler(PrefService* prefs); + + PowerHandler(const PowerHandler&) = delete; + PowerHandler& operator=(const PowerHandler&) = delete; + ~PowerHandler() override; // SettingsPageUIHandler implementation. @@ -176,8 +180,6 @@ bool last_has_lid_ = true; base::WeakPtrFactory<PowerHandler> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(PowerHandler); }; } // namespace settings
diff --git a/chrome/browser/ui/webui/settings/chromeos/device_power_handler_browsertest.cc b/chrome/browser/ui/webui/settings/chromeos/device_power_handler_browsertest.cc index aba54d7..411921a 100644 --- a/chrome/browser/ui/webui/settings/chromeos/device_power_handler_browsertest.cc +++ b/chrome/browser/ui/webui/settings/chromeos/device_power_handler_browsertest.cc
@@ -78,6 +78,10 @@ }; PowerHandlerTest() = default; + + PowerHandlerTest(const PowerHandlerTest&) = delete; + PowerHandlerTest& operator=(const PowerHandlerTest&) = delete; + ~PowerHandlerTest() override = default; // InProcessBrowserTest: @@ -189,9 +193,6 @@ content::TestWebUI web_ui_; testing::NiceMock<policy::MockConfigurationPolicyProvider> provider_; - - private: - DISALLOW_COPY_AND_ASSIGN(PowerHandlerTest); }; // Verifies that settings are sent to WebUI when requested.
diff --git a/chrome/browser/ui/webui/settings/chromeos/internet_handler_unittest.cc b/chrome/browser/ui/webui/settings/chromeos/internet_handler_unittest.cc index 75a86bf..e28e5e7 100644 --- a/chrome/browser/ui/webui/settings/chromeos/internet_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/chromeos/internet_handler_unittest.cc
@@ -34,6 +34,10 @@ } // namespace class InternetHandlerTest : public BrowserWithTestWindowTest { + public: + InternetHandlerTest(const InternetHandlerTest&) = delete; + InternetHandlerTest& operator=(const InternetHandlerTest&) = delete; + protected: InternetHandlerTest() = default; @@ -81,9 +85,6 @@ std::unique_ptr<chromeos::tether::FakeGmsCoreNotificationsStateTracker> fake_tracker_; std::unique_ptr<TestInternetHandler> handler_; - - private: - DISALLOW_COPY_AND_ASSIGN(InternetHandlerTest); }; TEST_F(InternetHandlerTest, TestSendsDeviceNames) {
diff --git a/chrome/browser/ui/webui/settings/chromeos/multidevice_handler_unittest.cc b/chrome/browser/ui/webui/settings/chromeos/multidevice_handler_unittest.cc index 3219611..699ee394 100644 --- a/chrome/browser/ui/webui/settings/chromeos/multidevice_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/chromeos/multidevice_handler_unittest.cc
@@ -171,6 +171,10 @@ } // namespace class MultideviceHandlerTest : public testing::Test { + public: + MultideviceHandlerTest(const MultideviceHandlerTest&) = delete; + MultideviceHandlerTest& operator=(const MultideviceHandlerTest&) = delete; + protected: MultideviceHandlerTest() : test_device_(multidevice::CreateRemoteDeviceRefForTest()) {} @@ -502,8 +506,6 @@ std::unique_ptr<TestMultideviceHandler> handler_; base::test::ScopedFeatureList scoped_feature_list_; - - DISALLOW_COPY_AND_ASSIGN(MultideviceHandlerTest); }; TEST_F(MultideviceHandlerTest, NotificationSetupFlow) {
diff --git a/chrome/browser/ui/webui/settings/people_handler_unittest.cc b/chrome/browser/ui/webui/settings/people_handler_unittest.cc index 8b595f0..e04286f4 100644 --- a/chrome/browser/ui/webui/settings/people_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/people_handler_unittest.cc
@@ -179,6 +179,9 @@ set_web_ui(web_ui); } + TestingPeopleHandler(const TestingPeopleHandler&) = delete; + TestingPeopleHandler& operator=(const TestingPeopleHandler&) = delete; + using PeopleHandler::is_configuring_sync; private: @@ -186,8 +189,6 @@ void DisplayGaiaLoginInNewTabOrWindow( signin_metrics::AccessPoint access_point) override {} #endif - - DISALLOW_COPY_AND_ASSIGN(TestingPeopleHandler); }; class TestWebUIProvider
diff --git a/chrome/browser/ui/webui/settings/reset_settings_handler_unittest.cc b/chrome/browser/ui/webui/settings/reset_settings_handler_unittest.cc index 1a42450..f2c7346 100644 --- a/chrome/browser/ui/webui/settings/reset_settings_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/reset_settings_handler_unittest.cc
@@ -54,6 +54,10 @@ set_web_ui(web_ui); } + TestingResetSettingsHandler(const TestingResetSettingsHandler&) = delete; + TestingResetSettingsHandler& operator=(const TestingResetSettingsHandler&) = + delete; + size_t resets() const { return resetter_.resets(); } using settings::ResetSettingsHandler::HandleResetProfileSettings; @@ -65,8 +69,6 @@ private: MockProfileResetter resetter_; - - DISALLOW_COPY_AND_ASSIGN(TestingResetSettingsHandler); }; class ResetSettingsHandlerTest : public testing::Test {
diff --git a/chrome/browser/ui/webui/settings/settings_secure_dns_handler_browsertest.cc b/chrome/browser/ui/webui/settings/settings_secure_dns_handler_browsertest.cc index 056257c..15d20f1 100644 --- a/chrome/browser/ui/webui/settings/settings_secure_dns_handler_browsertest.cc +++ b/chrome/browser/ui/webui/settings/settings_secure_dns_handler_browsertest.cc
@@ -97,6 +97,10 @@ }; class SecureDnsHandlerTest : public InProcessBrowserTest { + public: + SecureDnsHandlerTest(const SecureDnsHandlerTest&) = delete; + SecureDnsHandlerTest& operator=(const SecureDnsHandlerTest&) = delete; + protected: #if defined(OS_WIN) SecureDnsHandlerTest() @@ -190,8 +194,6 @@ #if defined(OS_WIN) base::win::ScopedDomainStateForTesting scoped_domain_; #endif - - DISALLOW_COPY_AND_ASSIGN(SecureDnsHandlerTest); }; IN_PROC_BROWSER_TEST_F(SecureDnsHandlerTest, SecureDnsModes) {
diff --git a/chrome/browser/ui/webui/settings/settings_utils_win.cc b/chrome/browser/ui/webui/settings/settings_utils_win.cc index 30d6362..02cd1b20 100644 --- a/chrome/browser/ui/webui/settings/settings_utils_win.cc +++ b/chrome/browser/ui/webui/settings/settings_utils_win.cc
@@ -36,6 +36,9 @@ public: ManageCertificatesDialog() {} + ManageCertificatesDialog(const ManageCertificatesDialog&) = delete; + ManageCertificatesDialog& operator=(const ManageCertificatesDialog&) = delete; + // Shows the dialog and calls |callback| when the dialog closes. The caller // must ensure the ManageCertificatesDialog remains valid until then. void Show(HWND parent, base::OnceClosure callback) { @@ -72,8 +75,6 @@ // May delete |this|. std::move(callback).Run(); } - - DISALLOW_COPY_AND_ASSIGN(ManageCertificatesDialog); }; } // namespace
diff --git a/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc b/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc index 8aa6ada..9540a94 100644 --- a/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc +++ b/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc
@@ -66,6 +66,11 @@ class DiceTurnSyncOnHelperShutdownNotifierFactory : public BrowserContextKeyedServiceShutdownNotifierFactory { public: + DiceTurnSyncOnHelperShutdownNotifierFactory( + const DiceTurnSyncOnHelperShutdownNotifierFactory&) = delete; + DiceTurnSyncOnHelperShutdownNotifierFactory& operator=( + const DiceTurnSyncOnHelperShutdownNotifierFactory&) = delete; + static DiceTurnSyncOnHelperShutdownNotifierFactory* GetInstance() { static base::NoDestructor<DiceTurnSyncOnHelperShutdownNotifierFactory> factory; @@ -84,8 +89,6 @@ DependsOn(policy::UserPolicySigninServiceFactory::GetInstance()); } ~DiceTurnSyncOnHelperShutdownNotifierFactory() override {} - - DISALLOW_COPY_AND_ASSIGN(DiceTurnSyncOnHelperShutdownNotifierFactory); }; // User input handler for the signin confirmation dialog.
diff --git a/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.h b/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.h index 2c4006b..aecbf5e 100644 --- a/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.h +++ b/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.h
@@ -162,6 +162,9 @@ const CoreAccountId& account_id, SigninAbortedMode signin_aborted_mode); + DiceTurnSyncOnHelper(const DiceTurnSyncOnHelper&) = delete; + DiceTurnSyncOnHelper& operator=(const DiceTurnSyncOnHelper&) = delete; + // SyncStartupTracker::Observer: void SyncStartupCompleted() override; void SyncStartupFailed() override; @@ -281,7 +284,6 @@ bool enterprise_account_confirmed_ = false; base::WeakPtrFactory<DiceTurnSyncOnHelper> weak_pointer_factory_{this}; - DISALLOW_COPY_AND_ASSIGN(DiceTurnSyncOnHelper); }; #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_DICE_TURN_SYNC_ON_HELPER_H_
diff --git a/chrome/browser/ui/webui/signin/inline_login_dialog_chromeos.h b/chrome/browser/ui/webui/signin/inline_login_dialog_chromeos.h index 30eaee3..5ebbf8b 100644 --- a/chrome/browser/ui/webui/signin/inline_login_dialog_chromeos.h +++ b/chrome/browser/ui/webui/signin/inline_login_dialog_chromeos.h
@@ -31,6 +31,10 @@ class InlineLoginDialogChromeOS : public SystemWebDialogDelegate, public web_modal::WebContentsModalDialogHost { public: + InlineLoginDialogChromeOS(const InlineLoginDialogChromeOS&) = delete; + InlineLoginDialogChromeOS& operator=(const InlineLoginDialogChromeOS&) = + delete; + static bool IsShown(); // ui::SystemWebDialogDelegate overrides. @@ -82,8 +86,6 @@ base::OnceClosure close_dialog_closure_; base::ObserverList<web_modal::ModalDialogHostObserver>::Unchecked modal_dialog_host_observer_list_; - - DISALLOW_COPY_AND_ASSIGN(InlineLoginDialogChromeOS); }; } // namespace chromeos
diff --git a/chrome/browser/ui/webui/signin/login_ui_service.h b/chrome/browser/ui/webui/signin/login_ui_service.h index 9d08f6b5..b54b3a0 100644 --- a/chrome/browser/ui/webui/signin/login_ui_service.h +++ b/chrome/browser/ui/webui/signin/login_ui_service.h
@@ -62,6 +62,10 @@ }; explicit LoginUIService(Profile* profile); + + LoginUIService(const LoginUIService&) = delete; + LoginUIService& operator=(const LoginUIService&) = delete; + ~LoginUIService() override; // |observer| The observer to add or remove; cannot be NULL. @@ -110,8 +114,6 @@ // List of observers. base::ObserverList<Observer>::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(LoginUIService); }; #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_LOGIN_UI_SERVICE_H_
diff --git a/chrome/browser/ui/webui/signin/login_ui_service_factory.h b/chrome/browser/ui/webui/signin/login_ui_service_factory.h index 69c79ef..1299051 100644 --- a/chrome/browser/ui/webui/signin/login_ui_service_factory.h +++ b/chrome/browser/ui/webui/signin/login_ui_service_factory.h
@@ -17,6 +17,9 @@ // the associated LoginUIService. class LoginUIServiceFactory : public BrowserContextKeyedServiceFactory { public: + LoginUIServiceFactory(const LoginUIServiceFactory&) = delete; + LoginUIServiceFactory& operator=(const LoginUIServiceFactory&) = delete; + // Returns the instance of LoginUIService associated with this profile // (creating one if none exists). Returns NULL if this profile cannot have a // LoginUIService (for example, if |profile| is incognito). @@ -35,8 +38,6 @@ KeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const override; bool ServiceIsCreatedWithBrowserContext() const override; - - DISALLOW_COPY_AND_ASSIGN(LoginUIServiceFactory); }; #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_LOGIN_UI_SERVICE_FACTORY_H_
diff --git a/chrome/browser/ui/webui/signin/signin_error_handler_unittest.cc b/chrome/browser/ui/webui/signin/signin_error_handler_unittest.cc index e7ec53c..7c02424 100644 --- a/chrome/browser/ui/webui/signin/signin_error_handler_unittest.cc +++ b/chrome/browser/ui/webui/signin/signin_error_handler_unittest.cc
@@ -31,6 +31,10 @@ set_web_ui(web_ui); } + TestingSigninErrorHandler(const TestingSigninErrorHandler&) = delete; + TestingSigninErrorHandler& operator=(const TestingSigninErrorHandler&) = + delete; + void CloseBrowserModalSigninDialog() override { browser_modal_dialog_did_close_ = true; SigninErrorHandler::CloseBrowserModalSigninDialog(); @@ -57,8 +61,6 @@ private: bool browser_modal_dialog_did_close_; bool profile_picker_force_signin_dialog_did_close_; - - DISALLOW_COPY_AND_ASSIGN(TestingSigninErrorHandler); }; class SigninErrorHandlerTest : public BrowserWithTestWindowTest { @@ -66,6 +68,9 @@ SigninErrorHandlerTest() : web_ui_(new content::TestWebUI), handler_(nullptr) {} + SigninErrorHandlerTest(const SigninErrorHandlerTest&) = delete; + SigninErrorHandlerTest& operator=(const SigninErrorHandlerTest&) = delete; + void SetUp() override { BrowserWithTestWindowTest::SetUp(); chrome::NewTab(browser()); @@ -110,8 +115,6 @@ std::unique_ptr<content::TestWebUI> web_ui_; std::unique_ptr<SigninErrorUI> signin_error_ui_; TestingSigninErrorHandler* handler_; // Not owned. - - DISALLOW_COPY_AND_ASSIGN(SigninErrorHandlerTest); }; TEST_F(SigninErrorHandlerTest, InBrowserHandleLearnMore) {
diff --git a/chrome/browser/ui/webui/signin/sync_confirmation_handler_unittest.cc b/chrome/browser/ui/webui/signin/sync_confirmation_handler_unittest.cc index c4eba8a..99ed08ab 100644 --- a/chrome/browser/ui/webui/signin/sync_confirmation_handler_unittest.cc +++ b/chrome/browser/ui/webui/signin/sync_confirmation_handler_unittest.cc
@@ -51,14 +51,16 @@ set_web_ui(web_ui); } + TestingSyncConfirmationHandler(const TestingSyncConfirmationHandler&) = + delete; + TestingSyncConfirmationHandler& operator=( + const TestingSyncConfirmationHandler&) = delete; + using SyncConfirmationHandler::HandleConfirm; using SyncConfirmationHandler::HandleUndo; using SyncConfirmationHandler::HandleInitializedWithSize; using SyncConfirmationHandler::HandleGoToSettings; using SyncConfirmationHandler::RecordConsent; - - private: - DISALLOW_COPY_AND_ASSIGN(TestingSyncConfirmationHandler); }; class SyncConfirmationHandlerTest : public BrowserWithTestWindowTest, @@ -76,6 +78,10 @@ sync_confirmation_ui_closed_result_(LoginUIService::ABORT_SYNC), web_ui_(new content::TestWebUI) {} + SyncConfirmationHandlerTest(const SyncConfirmationHandlerTest&) = delete; + SyncConfirmationHandlerTest& operator=(const SyncConfirmationHandlerTest&) = + delete; + void SetUp() override { BrowserWithTestWindowTest::SetUp(); chrome::NewTab(browser()); @@ -204,8 +210,6 @@ base::HistogramTester histogram_tester_; std::unique_ptr<IdentityTestEnvironmentProfileAdaptor> identity_test_env_adaptor_; - - DISALLOW_COPY_AND_ASSIGN(SyncConfirmationHandlerTest); }; const char SyncConfirmationHandlerTest::kConsentText1[] = "consentText1";
diff --git a/chrome/browser/ui/webui/sync_internals/sync_internals_message_handler_unittest.cc b/chrome/browser/ui/webui/sync_internals/sync_internals_message_handler_unittest.cc index 9426b77..995e7bd 100644 --- a/chrome/browser/ui/webui/sync_internals/sync_internals_message_handler_unittest.cc +++ b/chrome/browser/ui/webui/sync_internals/sync_internals_message_handler_unittest.cc
@@ -91,6 +91,12 @@ } class SyncInternalsMessageHandlerTest : public ChromeRenderViewHostTestHarness { + public: + SyncInternalsMessageHandlerTest(const SyncInternalsMessageHandlerTest&) = + delete; + SyncInternalsMessageHandlerTest& operator=( + const SyncInternalsMessageHandlerTest&) = delete; + protected: SyncInternalsMessageHandlerTest() = default; ~SyncInternalsMessageHandlerTest() override = default; @@ -196,8 +202,6 @@ SyncService* last_delegate_sync_service_ = nullptr; // Fake return value for sync_ui_util::ConstructAboutInformation(). base::DictionaryValue about_information_; - - DISALLOW_COPY_AND_ASSIGN(SyncInternalsMessageHandlerTest); }; TEST_F(SyncInternalsMessageHandlerTest, AddRemoveObservers) {
diff --git a/chrome/browser/ui/webui/system_info_ui.h b/chrome/browser/ui/webui/system_info_ui.h index 5671021..b53f6c7 100644 --- a/chrome/browser/ui/webui/system_info_ui.h +++ b/chrome/browser/ui/webui/system_info_ui.h
@@ -12,8 +12,8 @@ public: explicit SystemInfoUI(content::WebUI* web_ui); - private: - DISALLOW_COPY_AND_ASSIGN(SystemInfoUI); + SystemInfoUI(const SystemInfoUI&) = delete; + SystemInfoUI& operator=(const SystemInfoUI&) = delete; }; #endif // CHROME_BROWSER_UI_WEBUI_SYSTEM_INFO_UI_H_
diff --git a/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc b/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc index c082002..eef40d4 100644 --- a/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc +++ b/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc
@@ -46,6 +46,7 @@ #include "ui/base/models/list_selection_model.h" #include "ui/base/models/simple_menu_model.h" #include "ui/base/theme_provider.h" +#include "ui/color/color_id.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" #include "ui/events/gesture_event_details.h" @@ -580,15 +581,14 @@ color_utils::SkColorToRgbaString( embedder_->GetColor(ThemeProperties::COLOR_TAB_THROBBER_WAITING)); colors["--tabstrip-indicator-recording-color"] = - color_utils::SkColorToRgbaString(embedder_->GetSystemColor( - ui::NativeTheme::kColorId_AlertSeverityHigh)); + color_utils::SkColorToRgbaString( + embedder_->GetColorProviderColor(ui::kColorAlertHighSeverity)); colors["--tabstrip-indicator-pip-color"] = throbber_color; colors["--tabstrip-indicator-capturing-color"] = throbber_color; - colors["--tabstrip-tab-blocked-color"] = - color_utils::SkColorToRgbaString(embedder_->GetSystemColor( - ui::NativeTheme::kColorId_ProminentButtonColor)); + colors["--tabstrip-tab-blocked-color"] = color_utils::SkColorToRgbaString( + embedder_->GetColorProviderColor(ui::kColorButtonBackgroundProminent)); colors["--tabstrip-focus-outline-color"] = color_utils::SkColorToRgbaString( - embedder_->GetSystemColor(ui::NativeTheme::kColorId_FocusedBorderColor)); + embedder_->GetColorProviderColor(ui::kColorFocusableBorderFocused)); #if !BUILDFLAG(IS_CHROMEOS_ASH) colors["--tabstrip-scrollbar-thumb-color-rgb"] =
diff --git a/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler_unittest.cc b/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler_unittest.cc index ec97577..4712e1b 100644 --- a/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler_unittest.cc +++ b/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler_unittest.cc
@@ -69,7 +69,7 @@ void HideEditDialogForGroup() override {} TabStripUILayout GetLayout() override { return TabStripUILayout(); } SkColor GetColor(int id) const override { return SK_ColorWHITE; } - SkColor GetSystemColor(ui::NativeTheme::ColorId id) const override { + SkColor GetColorProviderColor(ui::ColorId id) const override { return SK_ColorWHITE; } };
diff --git a/chrome/browser/ui/webui/tab_strip/tab_strip_ui_browsertest.cc b/chrome/browser/ui/webui/tab_strip/tab_strip_ui_browsertest.cc index dd56cf9..7e143a2b4 100644 --- a/chrome/browser/ui/webui/tab_strip/tab_strip_ui_browsertest.cc +++ b/chrome/browser/ui/webui/tab_strip/tab_strip_ui_browsertest.cc
@@ -52,7 +52,7 @@ MOCK_METHOD0(HideEditDialogForGroup, void()); MOCK_METHOD0(GetLayout, TabStripUILayout()); MOCK_CONST_METHOD1(GetColor, SkColor(int)); - MOCK_CONST_METHOD1(GetSystemColor, SkColor(ui::NativeTheme::ColorId)); + MOCK_CONST_METHOD1(GetColorProviderColor, SkColor(ui::ColorId)); }; } // namespace
diff --git a/chrome/browser/ui/webui/tab_strip/tab_strip_ui_embedder.h b/chrome/browser/ui/webui/tab_strip/tab_strip_ui_embedder.h index ab0f4c9..3071e5b 100644 --- a/chrome/browser/ui/webui/tab_strip/tab_strip_ui_embedder.h +++ b/chrome/browser/ui/webui/tab_strip/tab_strip_ui_embedder.h
@@ -10,8 +10,8 @@ #include "components/tab_groups/tab_group_id.h" #include "ui/base/accelerators/accelerator.h" #include "ui/base/models/menu_model.h" +#include "ui/color/color_id.h" #include "ui/gfx/geometry/point.h" -#include "ui/native_theme/native_theme.h" // Interface to be implemented by the embedder. Provides native UI // functionality such as showing context menus. @@ -39,7 +39,7 @@ virtual TabStripUILayout GetLayout() = 0; virtual SkColor GetColor(int id) const = 0; - virtual SkColor GetSystemColor(ui::NativeTheme::ColorId id) const = 0; + virtual SkColor GetColorProviderColor(ui::ColorId id) const = 0; }; #endif // CHROME_BROWSER_UI_WEBUI_TAB_STRIP_TAB_STRIP_UI_EMBEDDER_H_
diff --git a/chrome/browser/ui/webui/tab_strip/thumbnail_tracker.cc b/chrome/browser/ui/webui/tab_strip/thumbnail_tracker.cc index ab1b9ea..78ee434 100644 --- a/chrome/browser/ui/webui/tab_strip/thumbnail_tracker.cc +++ b/chrome/browser/ui/webui/tab_strip/thumbnail_tracker.cc
@@ -28,6 +28,9 @@ &ContentsData::ThumbnailImageCallback, base::Unretained(this))); } + ContentsData(const ContentsData&) = delete; + ContentsData& operator=(const ContentsData&) = delete; + void RequestThumbnail() { if (thumbnail_) thumbnail_->RequestCompressedThumbnailData(); @@ -54,8 +57,6 @@ ThumbnailTracker* parent_; scoped_refptr<ThumbnailImage> thumbnail_; std::unique_ptr<ThumbnailImage::Subscription> subscription_; - - DISALLOW_COPY_AND_ASSIGN(ContentsData); }; ThumbnailTracker::ThumbnailTracker(ThumbnailUpdatedCallback callback)
diff --git a/chrome/browser/ui/webui/webui_webview_browsertest.cc b/chrome/browser/ui/webui/webui_webview_browsertest.cc index cc05910c..e894054 100644 --- a/chrome/browser/ui/webui/webui_webview_browsertest.cc +++ b/chrome/browser/ui/webui/webui_webview_browsertest.cc
@@ -45,6 +45,10 @@ message, base::BindRepeating(&WebUIMessageListener::HandleMessage, AsWeakPtr())); } + + WebUIMessageListener(const WebUIMessageListener&) = delete; + WebUIMessageListener& operator=(const WebUIMessageListener&) = delete; + bool Wait() { message_loop_->Run(); return true; @@ -56,8 +60,6 @@ } scoped_refptr<content::MessageLoopRunner> message_loop_; - - DISALLOW_COPY_AND_ASSIGN(WebUIMessageListener); }; class DNDToInputNavigationObserver : public content::WebContentsObserver { @@ -65,6 +67,11 @@ explicit DNDToInputNavigationObserver(content::WebContents* web_contents) { Observe(web_contents); } + + DNDToInputNavigationObserver(const DNDToInputNavigationObserver&) = delete; + DNDToInputNavigationObserver& operator=(const DNDToInputNavigationObserver&) = + delete; + void DidFinishNavigation( content::NavigationHandle* navigation_handle) override { navigated = true; @@ -73,8 +80,6 @@ private: bool navigated = false; - - DISALLOW_COPY_AND_ASSIGN(DNDToInputNavigationObserver); }; int ExecuteHostScriptAndExtractInt(content::WebContents* web_contents, @@ -105,6 +110,9 @@ public: WebUIWebViewBrowserTest() {} + WebUIWebViewBrowserTest(const WebUIWebViewBrowserTest&) = delete; + WebUIWebViewBrowserTest& operator=(const WebUIWebViewBrowserTest&) = delete; + void SetUpOnMainThread() override { WebUIBrowserTest::SetUpOnMainThread(); AddLibrary( @@ -131,9 +139,6 @@ signin_metrics::Reason::kForcedSigninPrimaryAccount, false)); #endif } - - private: - DISALLOW_COPY_AND_ASSIGN(WebUIWebViewBrowserTest); }; // Checks that hiding and showing the WebUI host page doesn't break guests in
diff --git a/chrome/browser/ui/window_sizer/window_sizer.cc b/chrome/browser/ui/window_sizer/window_sizer.cc index 17262e7..979380e 100644 --- a/chrome/browser/ui/window_sizer/window_sizer.cc +++ b/chrome/browser/ui/window_sizer/window_sizer.cc
@@ -41,6 +41,9 @@ public: explicit DefaultStateProvider(const Browser* browser) : browser_(browser) {} + DefaultStateProvider(const DefaultStateProvider&) = delete; + DefaultStateProvider& operator=(const DefaultStateProvider&) = delete; + // Overridden from WindowSizer::StateProvider: bool GetPersistentState(gfx::Rect* bounds, gfx::Rect* work_area, @@ -142,7 +145,6 @@ // If set, is used as the reference browser for GetLastActiveWindowState. const Browser* browser_; - DISALLOW_COPY_AND_ASSIGN(DefaultStateProvider); }; } // namespace
diff --git a/chrome/browser/ui/window_sizer/window_sizer.h b/chrome/browser/ui/window_sizer/window_sizer.h index 1a7e3000..c7a9334 100644 --- a/chrome/browser/ui/window_sizer/window_sizer.h +++ b/chrome/browser/ui/window_sizer/window_sizer.h
@@ -59,6 +59,9 @@ ui::WindowShowState* show_state) const = 0; }; + WindowSizer(const WindowSizer&) = delete; + WindowSizer& operator=(const WindowSizer&) = delete; + // Determines the position and size for a window as it is created as well // as the initial state. This function uses several strategies to figure out // optimal size and placement, first looking for an existing active window, @@ -159,8 +162,6 @@ // Note that this browser handle might be NULL. const Browser* const browser_; - - DISALLOW_COPY_AND_ASSIGN(WindowSizer); }; #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_
diff --git a/chrome/browser/ui/window_sizer/window_sizer_common_unittest.h b/chrome/browser/ui/window_sizer/window_sizer_common_unittest.h index f5478c9..b4c33bf 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_common_unittest.h +++ b/chrome/browser/ui/window_sizer/window_sizer_common_unittest.h
@@ -85,6 +85,10 @@ class WindowSizerTestUtil { public: + WindowSizerTestUtil() = delete; + WindowSizerTestUtil(const WindowSizerTestUtil&) = delete; + WindowSizerTestUtil& operator=(const WindowSizerTestUtil&) = delete; + // Sets up the window bounds, monitor bounds, and work area to get the // resulting |out_bounds| from the WindowSizer. // |source| specifies which type of data gets set for the test: Either the @@ -101,9 +105,6 @@ const Browser* browser, const gfx::Rect& passed_in, gfx::Rect* out_bounds); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(WindowSizerTestUtil); }; #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 352cef8d..2b59e649 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1632484244-b596124b24723501d208c93eae2bd86fceb5db6b.profdata +chrome-linux-main-1632505958-ddbb37bcdfa7dbd7b10cf3a9b6a5bc45e7a958a6.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 04869957..24b7016c 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1632484244-7b936c615165e58a3acdb61a4d274e36657917d2.profdata +chrome-mac-main-1632505958-ecc19202c484df17292092b0300480b0359444be.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index e33aa02..a5a174b 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1632484244-927ce715b3082525ce9c6a042c2b5628ef50ef1f.profdata +chrome-win32-main-1632505958-14b6d621069ddb732268efb1d0bc37f7b09da8dd.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 6897be6..6d37d23 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1632484244-4af798eca3c92ac32465eedd990f94b44353fb7b.profdata +chrome-win64-main-1632505958-83c3e60c48b4982e54d0488757ed9325a0b41134.profdata
diff --git a/chrome/common/extensions/api/_api_features.json b/chrome/common/extensions/api/_api_features.json index 7d3a177..6fe964e 100644 --- a/chrome/common/extensions/api/_api_features.json +++ b/chrome/common/extensions/api/_api_features.json
@@ -747,22 +747,6 @@ "dependencies": ["permission:scripting"], "contexts": ["blessed_extension"] }, - "scripting.registerContentScripts": { - "channel": "trunk", - "min_manifest_version": 3 - }, - "scripting.getRegisteredContentScripts": { - "channel": "trunk", - "min_manifest_version": 3 - }, - "scripting.unregisterContentScripts": { - "channel": "trunk", - "min_manifest_version": 3 - }, - "scripting.updateContentScripts": { - "channel": "trunk", - "min_manifest_version": 3 - }, "search": { "dependencies": ["permission:search"], "contexts": ["blessed_extension"]
diff --git a/chrome/common/extensions/api/scripting.idl b/chrome/common/extensions/api/scripting.idl index e246b23..975d78a 100644 --- a/chrome/common/extensions/api/scripting.idl +++ b/chrome/common/extensions/api/scripting.idl
@@ -102,7 +102,6 @@ // Describes a content script to be injected into a web page registered // through this API. - [nodoc] dictionary RegisteredContentScript { // The id of the content script, specified in the API call. Must not start // with a '_' as it's reserved as a prefix for generated script IDs. @@ -143,7 +142,6 @@ // An object used to filter content scripts for // ${ref:getRegisteredContentScripts}. - [nodoc] dictionary ContentScriptFilter { // If specified, $(ref:getRegisteredContentScripts) will only return scripts // with an id specified in this list. @@ -199,7 +197,7 @@ // already exist, then no scripts are registered. // |callback|: A callback to be invoked once scripts have been fully // registered or if an error has occurred. - [nodoc, supportsPromises] static void registerContentScripts( + [supportsPromises] static void registerContentScripts( RegisteredContentScript[] scripts, optional RegisterContentScriptsCallback callback); @@ -207,7 +205,7 @@ // that match the given filter. // |filter|: An object to filter the extension's dynamically registered // scripts. - [nodoc, supportsPromises] static void getRegisteredContentScripts( + [supportsPromises] static void getRegisteredContentScripts( optional ContentScriptFilter filter, GetRegisteredContentScriptsCallback callback); @@ -217,7 +215,7 @@ // scripts are unregistered. // |callback|: A callback to be invoked once scripts have been unregistered // or if an error has occurred. - [nodoc, supportsPromises] static void unregisterContentScripts( + [supportsPromises] static void unregisterContentScripts( optional ContentScriptFilter filter, optional UnregisterContentScriptsCallback callback); @@ -229,7 +227,7 @@ // are updated. // |callback|: A callback to be invoked once scripts have been updated or // if an error has occurred. - [nodoc, supportsPromises] static void updateContentScripts( + [supportsPromises] static void updateContentScripts( RegisteredContentScript[] scripts, optional RegisterContentScriptsCallback callback); };
diff --git a/chrome/common/extensions/api/speech_recognition_private.idl b/chrome/common/extensions/api/speech_recognition_private.idl index ed5c477..cebd6e8c 100644 --- a/chrome/common/extensions/api/speech_recognition_private.idl +++ b/chrome/common/extensions/api/speech_recognition_private.idl
@@ -7,6 +7,12 @@ [platforms=("chromeos"), implemented_in="chrome/browser/chromeos/extensions/speech/speech_recognition_private_api.h"] namespace speechRecognitionPrivate { + // Interface for an onStop event. + dictionary SpeechRecognitionStopEvent { + // Optional client ID. + long? clientId; + }; + // Interface for options used when starting speech recognition. dictionary StartOptions { // An optional ID to specify the client. @@ -17,13 +23,33 @@ boolean? interimResults; }; + // Interface for options used when stopping speech recognition. + dictionary StopOptions { + // An optional ID to specify the client. This must match the clientId + // used when starting speech recognition to work as intended. + long? clientId; + }; + // Called when speech recognition has begun listening to the user's audio. callback OnStartCallback = void(); + // Called when speech recogntion has stopped listening to the user's audio. + callback OnStopCallback = void(); interface Functions { // Starts listening to audio from the user. The callback is invoked when // speech recognition has started. [supportsPromises] static void start(StartOptions options, OnStartCallback callback); + + // Stops listening to audio from the user. The callback is invoked when + // speech recognition has stopped. If speech recognition has already stopped + // when calling stop(), the callback is run with an error. + [supportsPromises] static void stop(StopOptions options, + OnStopCallback callback); + }; + + interface Events { + // Fired when speech recognition stops. + static void onStop(SpeechRecognitionStopEvent event); }; };
diff --git a/chrome/renderer/resources/cart/cart-product-extraction.js b/chrome/renderer/resources/cart/cart-product-extraction.js index 9f89f13..75f6bd9 100644 --- a/chrome/renderer/resources/cart/cart-product-extraction.js +++ b/chrome/renderer/resources/cart/cart-product-extraction.js
@@ -24,7 +24,7 @@ var cartItemQtyRegex = new RegExp('qty', 'i'); var moveToCartTextRegex = new RegExp('move to (cart|bag)', 'i'); var addToCartTextRegex = new RegExp('add to cart', 'i'); -var cartPriceTextRegex = new RegExp('estimated (sales )?tax', 'i'); +var cartPriceTextRegex = new RegExp('((estimated (sales )?)|(sales ))tax', 'i'); var minicartHTMLRegex = new RegExp('mini-cart-product', 'i'); var productIdHTMLRegex = new RegExp('<a href="#modal-(\\w+)', 'i'); var productIdURLRegex = new RegExp( @@ -191,7 +191,8 @@ // triggers JS to initiate navigation instead of <a>, and ae.com shows side // panel after clicking on each item instead of directing to product page. if (document.URL.includes("samsclub.com") - || document.URL.includes("ae.com")) { + || document.URL.includes("ae.com") + || document.URL.includes("kiehls.com")) { return ""; } let anchors; @@ -497,7 +498,10 @@ let captured_prices = []; for (const price of item.querySelectorAll( 'span, b, p, div, h3, td, li, em')) { - const candidate = price.innerText.trim(); + let candidate = price.innerText.trim(); + if (document.URL.includes("thecompanystore.com")) { + candidate = candidate.split("\n")[0]; + } if (!candidate.match(priceRegexFull)) continue; if (verbose > 1) @@ -596,7 +600,7 @@ console.warn('no title found', item); return null; } - price = extractPrice(item); + let price = extractPrice(item); // eBay "You may also like" and "Guides" are not product items. // Not having price is one hint. // FIXME: "Also viewed" items in Gap doesn't have prices. @@ -709,6 +713,13 @@ console.log('overlap', item); return; } + if (item.getBoundingClientRect().top <= 10 && + (document.URL.includes("partycity.com") + || document.URL.includes("chewy.com"))) { + if (verbose > 0) + console.log('likely cart page header', item); + return; + } if (processed.has(item)) return; if (isInSavedForLater(item, savedForLaterSection)) @@ -781,6 +792,21 @@ } } +// Remove duplicate products with identical product URLs. +function deduplicateResults(output) { + if (!document.URL.includes("sourcebmx.com")) return output; + const productUrls = new Set(); + let filteredOutput = []; + for (let i = 0; i < output.length; i++) { + const productUrl = output[i]["url"]; + if (!productUrls.has(productUrl)) { + filteredOutput.push(output[i]); + productUrls.add(productUrl) + } + } + return filteredOutput; +} + function extractAllItems(root) { let items = []; // Root element being null could be due to the @@ -801,6 +827,9 @@ // has two images in cart item. Remove this when we support cart // with multiple images for one product. items = root.getElementsByClassName("CartItem CartLineItem"); + } else if (document.URL.includes("kiehls.com") + || document.URL.includes("laroche-posay.us")) { + items = root.querySelectorAll(".c-product-table__row"); } else { // Generic pattern const candidates = new Set(); @@ -859,7 +888,7 @@ for (const key of keysInDocOrder) { output.push(outputMap.get(key)); } - return output; + return deduplicateResults(output); } extracted_results = extractAllItems(document);
diff --git a/chrome/test/data/extensions/api_test/speech/speech_recognition_private/onstop_event/manifest.json b/chrome/test/data/extensions/api_test/speech/speech_recognition_private/onstop_event/manifest.json new file mode 100644 index 0000000..bf119c9 --- /dev/null +++ b/chrome/test/data/extensions/api_test/speech/speech_recognition_private/onstop_event/manifest.json
@@ -0,0 +1,15 @@ +{ + "name": "OnStop", + // Use the manifest key for AccessibilityCommon, which is one of the extensions + // in the speechRecognitionPrivate allowlist. + "key": "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC6SX/t6kDEi9UiG4fULwjbEW1uJmQoiJPtxvSZ/SDH14OjSzmfP6xfE97Hus3EY8uSIMxTHkGaZliGbFbIQXQn6/XwBpQRu2gPlrfz7TWR1Hw6SboBBMOpltM9A2nx+d3jLtz+YtKNYVcHyNil9hXfFeyFe6g5kLHapKb1UO0jo3q3kovo1a1z7ujzGwogfLmb58w1hkdFBnnqumRlT55dKLN8AQ6cSdB1sjDVoMgPYeWgkzXr9cR3A8UVJookSO0sDAmD+W8BtBijapt3UVkHiIL1NTPuXvGGUHL7TPFo5WcBXFMkTz74gJqqFdO5hQ2YWXAaCxQJwgJrQPrvPMSJAgMBAAECggEADDhEDww9wWbWzUz3BQEs2In1HrOgAFStN3zEkNFc9B78AJsvpXWczgPUqk9jrg1JzkUeghlK/mDWT8MNkkdQ4kmFMYCM9/jOI6+kU3js+arxlzU84VI5r4c4RhlSOtBEMOHjF0DORP3sopMXOxPAbYjXog3xhA0szYXdedwcIik7Xu3lt1Hl5FfVZbvVLdf4vw0jTfHcp8SmHy/BDVnSCrhC3pnPGi6o+lUaSK0ca3uvcJDZGLXJ/6LyFb6uLlS2XUoBMYsombioRKrerJJSOmMTLHvfu1cM6+iQ+J0wdBnJQpgmDoSVGjnksPU2SMpWgG2OzwuZYIUGI745s19wLQKBgQDvdHsMZ4ttBr9bjydzeZVATWTICHZgXdAYgfgrbGwppYDUjfKoAuJ6bHTvff4nj8aZrY+Y1SwuvqxgHHfiggUgqg+JyeaAdQG+CLdfl1M8An+6H0x/hx0nk0oOJQhu0y1R/SbtnDJ6JASszg/VrTwHIYbzUl6xKHbZ6X41apyLYwKBgQDHKJOeZdxuYj7AsAqFGreuPoAEh0S+2VHHi4rjNz5dC1z7o/8siixfkHg7ONM2hqCKo55XYj4UWtprEFZJ9ohbizHELNzpnTxjdS0cG/VfItml6CDJaUtrkShIx17yGjNi0u/7ywHQ3slJsUXu7CbEcESwEzdoSrsC048dyxBSIwKBgF0141wtxklXcg/LBtldf6q7NbrkCGh0vDd+CEOm/eesRBz5cHbUQKLVKyO60L9HqVBTDm24tW0wzdrP2h7y69oOOOQzEqX4Zgg6Tl9IgZ7/fgbOfjG6P7ATFqWw5rp1O9QJjii6P6/p62P1Bpbvy0kfVO/MpY2iqbkjufxDFtLvAoGBAMC5p4CVGedH82oL8WI1JKLdoIzBSelV7CmqA9E1WIg5wtVRMlIrtB0WdQL6ToppZVpEU6pES8bu1Ibe3GHezL2pyZMJxw3bNuEYN3sIIz7ZPr2qEHBYEMAbTFyBcoPejvOHJO0I2s0BitBhWEeJB0r5Sb8KGYg3KRnnGIvAQh75AoGBANEC/k1umGrnMO3rwHJF7R+aTHzeMnO6oi11pmSnT7eJcF+oi7OwHS3ickU6sGrIb5QmnwCY9ES1qY6mP7N++KQGsdQM2l13MpCn8cBZgrfpQg2slP1dz8LCDW/PB+6MF7qwEHN2afVA2muQaez+q0eXZjMXmGJ3VZIXz/cxBLD6", + "version": "0.1", + "manifest_version": 3, + "description": "Browser test for the chrome.speechRecognitionPrivate.onStop event", + "background": { + "service_worker": "test.js" + }, + "permissions": [ + "speechRecognitionPrivate" + ] +}
diff --git a/chrome/test/data/extensions/api_test/speech/speech_recognition_private/onstop_event/test.js b/chrome/test/data/extensions/api_test/speech/speech_recognition_private/onstop_event/test.js new file mode 100644 index 0000000..79c93b0 --- /dev/null +++ b/chrome/test/data/extensions/api_test/speech/speech_recognition_private/onstop_event/test.js
@@ -0,0 +1,18 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +chrome.test.runTests([function testOnStop() { + // The extension's client ID. + const clientId = 4; + chrome.speechRecognitionPrivate.onStop.addListener((event) => { + if (event.clientId !== clientId) { + chrome.test.sendMessage('Skipping event'); + return; + } + + chrome.test.assertNoLastError(); + chrome.test.sendMessage('Processing event'); + }); + chrome.test.succeed(); +}]);
diff --git a/chrome/test/data/extensions/api_test/speech/speech_recognition_private/start/manifest.json b/chrome/test/data/extensions/api_test/speech/speech_recognition_private/simple/manifest.json similarity index 100% rename from chrome/test/data/extensions/api_test/speech/speech_recognition_private/start/manifest.json rename to chrome/test/data/extensions/api_test/speech/speech_recognition_private/simple/manifest.json
diff --git a/chrome/test/data/extensions/api_test/speech/speech_recognition_private/simple/test.js b/chrome/test/data/extensions/api_test/speech/speech_recognition_private/simple/test.js new file mode 100644 index 0000000..df642f77 --- /dev/null +++ b/chrome/test/data/extensions/api_test/speech/speech_recognition_private/simple/test.js
@@ -0,0 +1,31 @@ +// 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. + +chrome.test.runTests([ + // For these tests, ensure that the API is called with a locale of 'en-US'. + // Otherwise, the the on-device variant of this test will fail because + // on-device speech recognition is only supported in en-US. + async function startTest() { + await chrome.speechRecognitionPrivate.start( + {locale: 'en-US', interimResults: true}); + // Call the API again with different properties. + await chrome.speechRecognitionPrivate.start( + {locale: 'en-US', interimResults: false}); + chrome.test.succeed(); + }, + + async function startAndStopTest() { + await chrome.speechRecognitionPrivate.start( + {locale: 'en-US', interimResults: true}); + await chrome.speechRecognitionPrivate.stop({}); + chrome.test.succeed(); + }, + + async function stopWithoutStart() { + await chrome.test.assertPromiseRejects( + chrome.speechRecognitionPrivate.stop({}), + 'Error: Speech recognition already stopped'); + chrome.test.succeed(); + }, +]);
diff --git a/chrome/test/data/extensions/api_test/speech/speech_recognition_private/start/test.js b/chrome/test/data/extensions/api_test/speech/speech_recognition_private/start/test.js deleted file mode 100644 index 1ef13f5..0000000 --- a/chrome/test/data/extensions/api_test/speech/speech_recognition_private/start/test.js +++ /dev/null
@@ -1,14 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -chrome.test.runTests([async function startTest() { - await chrome.speechRecognitionPrivate.start( - {locale: 'en-US', interimResults: true}); - // Call the API again with different properties. - // Keep the locale as en-US, otherwise the the on-device variant of this - // test will fail because on-device speech recognition is only supported - // in en-US. - await chrome.speechRecognitionPrivate.start({interimResults: false}); - chrome.test.succeed(); -}]);
diff --git a/chrome/test/data/webui/BUILD.gn b/chrome/test/data/webui/BUILD.gn index 923d7776..5e5309f1 100644 --- a/chrome/test/data/webui/BUILD.gn +++ b/chrome/test/data/webui/BUILD.gn
@@ -453,6 +453,7 @@ "chromeos/diagnostics/diagnostics_browsertest.js", "chromeos/os_feedback_ui/os_feedback_browsertest.js", "chromeos/personalization_app/personalization_app_component_browsertest.js", + "chromeos/personalization_app/personalization_app_controller_browsertest.js", "chromeos/print_management/print_management_browsertest.js", "chromeos/scanning/scanning_app_browsertest.js", "chromeos/shimless_rma/shimless_rma_browsertest.js",
diff --git a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_app_test.js b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_app_test.js index af21af8..1d7f2563b 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_app_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_app_test.js
@@ -80,6 +80,35 @@ } /** + * @return {!HTMLElement} + */ + function getSessionLogButton() { + assertTrue(!!page); + + return /** @type {!HTMLElement} */ (page.$$('.session-log-button')); + } + + /** + * @return {!HTMLElement} + */ + function getBottomNavContentDrawer() { + assertTrue(!!page); + + return /** @type {!HTMLElement} */ ( + page.$$('[slot=bottom-nav-content-drawer]')); + } + + /** + * @return {!HTMLElement} + */ + function getBottomNavContentPanel() { + assertTrue(!!page); + + return /** @type {!HTMLElement} */ ( + page.$$('[slot=bottom-nav-content-panel]')); + } + + /** * Triggers 'dismiss-caution-banner' custom event. * @return {!Promise} */ @@ -154,6 +183,9 @@ assertTrue(!!systemPage); assertTrue(isVisible(systemPage)); assertFalse(isVisible(getCautionBanner())); + assertFalse(isVisible(getBottomNavContentDrawer())); + assertTrue(isVisible(getBottomNavContentPanel())); + assertTrue(isVisible(getSessionLogButton())); }); });
diff --git a/chrome/test/data/webui/chromeos/personalization_app/BUILD.gn b/chrome/test/data/webui/chromeos/personalization_app/BUILD.gn index 173b5785..3034b98 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/BUILD.gn +++ b/chrome/test/data/webui/chromeos/personalization_app/BUILD.gn
@@ -14,8 +14,9 @@ ] deps = [ ":local_images_element_test", + ":personalization_app_component_test", + ":personalization_app_controller_test", ":personalization_app_test_utils", - ":personalization_app_unified_test", ":personalization_toast_element_test", ":test_mojo_interface_provider", ":test_personalization_store", @@ -56,7 +57,7 @@ ] } -js_library("personalization_app_unified_test") { +js_library("personalization_app_component_test") { deps = [ ":local_images_element_test", ":wallpaper_collections_element_test", @@ -66,6 +67,14 @@ externs_list = [ "$externs_path/mocha-2.5.js" ] } +js_library("personalization_app_controller_test") { + deps = [ + ":test_mojo_interface_provider", + "//chromeos/components/personalization_app/resources/trusted:personalization_store", + ] + externs_list = [ "$externs_path/mocha-2.5.js" ] +} + js_library("test_personalization_store") { deps = [ "//chromeos/components/personalization_app/resources/trusted:personalization_reducers",
diff --git a/chrome/test/data/webui/chromeos/personalization_app/local_images_element_test.js b/chrome/test/data/webui/chromeos/personalization_app/local_images_element_test.js index f50583a9..d99ed13c 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/local_images_element_test.js +++ b/chrome/test/data/webui/chromeos/personalization_app/local_images_element_test.js
@@ -66,7 +66,7 @@ personalizationStore.data.loading.local = { images: false, - data: {'100,10': true, '200,20': true} + data: {'LocalImage0.png': true, 'LocalImage1.png': true}, }; personalizationStore.notifyObservers(); await waitAfterNextRender(localImagesElement); @@ -78,7 +78,7 @@ personalizationStore.data.loading.local = { images: false, - data: {'100,10': false, '200,20': true}, + data: {'LocalImage0.png': false, 'LocalImage1.png': true}, }; personalizationStore.notifyObservers(); await waitAfterNextRender(localImagesElement); @@ -108,7 +108,9 @@ assertEquals(0, ironList.shadowRoot.querySelectorAll('img').length); // Set loading finished for first thumbnail. - personalizationStore.data.loading.local.data = {'100,10': false}; + personalizationStore.data.loading.local.data = { + 'LocalImage0.png': false + }; personalizationStore.notifyObservers(); await waitAfterNextRender(localImagesElement); assertEquals(2, ironList.items.length); @@ -118,12 +120,12 @@ // Set loading failed for second thumbnail. personalizationStore.data.loading.local.data = { - '100,10': false, - '200,20': false + 'LocalImage0.png': false, + 'LocalImage1.png': false }; personalizationStore.data.local.data = { - '100,10': 'data://localimage0data', - '200,20': null + 'LocalImage0.png': 'data://localimage0data', + 'LocalImage1.png': null }; personalizationStore.notifyObservers(); await waitAfterNextRender(localImagesElement); @@ -143,7 +145,7 @@ // Done loading. personalizationStore.data.loading.local = { images: false, - data: {'100,10': false, '200,20': false}, + data: {'LocalImage0.png': false, 'LocalImage1.png': false}, }; localImagesElement = initElement(LocalImages.is, {hidden: false}); @@ -159,7 +161,7 @@ assertTrue(Array.from(images).every( image => image.getAttribute('aria-selected') === 'false')); - personalizationStore.data.currentSelected = {key: 'LocalImage1'}; + personalizationStore.data.currentSelected = {key: 'LocalImage1.png'}; personalizationStore.notifyObservers(); assertEquals(2, images.length);
diff --git a/chrome/test/data/webui/chromeos/personalization_app/personalization_app_component_browsertest.js b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_component_browsertest.js index 8db05d8..b143461a 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/personalization_app_component_browsertest.js +++ b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_component_browsertest.js
@@ -4,7 +4,7 @@ /** * @fileoverview Test suite for chrome://personalization. Tests individual - * components in isolation. + * polymer components in isolation. */ GEN_INCLUDE(['//chrome/test/data/webui/polymer_browser_test_base.js']); @@ -16,7 +16,7 @@ get browsePreload() { return 'chrome://personalization/test_loader.html?' + 'module=chromeos/personalization_app/' + - 'personalization_app_unified_test.js'; + 'personalization_app_component_test.js'; } get featureList() {
diff --git a/chrome/test/data/webui/chromeos/personalization_app/personalization_app_unified_test.js b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_component_test.js similarity index 100% rename from chrome/test/data/webui/chromeos/personalization_app/personalization_app_unified_test.js rename to chrome/test/data/webui/chromeos/personalization_app/personalization_app_component_test.js
diff --git a/chrome/test/data/webui/chromeos/personalization_app/personalization_app_controller_browsertest.js b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_controller_browsertest.js new file mode 100644 index 0000000..f74d7f0 --- /dev/null +++ b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_controller_browsertest.js
@@ -0,0 +1,27 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview Test suite for chrome://personalization. Tests individual + * polymer components in isolation. + */ + +GEN_INCLUDE(['//chrome/test/data/webui/polymer_browser_test_base.js']); + +GEN('#include "ash/constants/ash_features.h"'); +GEN('#include "content/public/test/browser_test.h"'); + +var PersonalizationAppControllerBrowserTest = class extends PolymerTest { + get browsePreload() { + return 'chrome://personalization/test_loader.html?' + + 'module=chromeos/personalization_app/' + + 'personalization_app_controller_test.js'; + } + + get featureList() { + return {enabled: ['chromeos::features::kWallpaperWebUI']}; + } +}; + +TEST_F('PersonalizationAppControllerBrowserTest', 'All', () => mocha.run());
diff --git a/chrome/test/data/webui/chromeos/personalization_app/personalization_app_controller_test.js b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_controller_test.js new file mode 100644 index 0000000..dbab461 --- /dev/null +++ b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_controller_test.js
@@ -0,0 +1,324 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js'; +import 'chrome://resources/mojo/url/mojom/url.mojom-lite.js'; +import 'chrome://personalization/trusted/file_path.mojom-lite.js'; +import 'chrome://personalization/trusted/personalization_app.mojom-lite.js'; +import {fetchLocalData} from 'chrome://personalization/trusted/personalization_controller.js'; +import {assertDeepEquals, assertEquals} from '../../chai_assert.js'; +import {TestWallpaperProvider} from './test_mojo_interface_provider.js'; +import {TestPersonalizationStore} from './test_personalization_store.js'; + +/** + * Get a sub-property in obj. Splits on '.' + * @param {!Object} obj + * @param {string} key + */ +function getProperty(obj, key) { + let ref = obj; + for (const part of key.split('.')) { + ref = ref[part]; + } + return ref; +} + +/** + * Returns a function that returns only nested subproperties in state. + * @param {!Array<string>} keys + * @return {!Function} + */ +function filterAndFlattenState(keys) { + return (state) => { + const result = {}; + for (const key of keys) { + result[key] = getProperty(state, key); + } + return result; + }; +} + +suite('Updating local images', () => { + let wallpaperProvider; + let personalizationStore; + + setup(() => { + wallpaperProvider = new TestWallpaperProvider(); + personalizationStore = new TestPersonalizationStore({}); + personalizationStore.setReducersEnabled(true); + }); + + test('sets local images in store', async () => { + await fetchLocalData(wallpaperProvider, personalizationStore); + assertDeepEquals( + [ + {name: 'begin_load_local_images'}, + { + name: 'set_local_images', + images: [ + {path: 'LocalImage0.png'}, + {path: 'LocalImage1.png'}, + ], + }, + {name: 'begin_load_local_image_data', id: 'LocalImage0.png'}, + {name: 'begin_load_local_image_data', id: 'LocalImage1.png'}, + { + name: 'set_local_image_data', + id: 'LocalImage0.png', + data: 'data://localimage0data', + }, + { + name: 'set_local_image_data', + id: 'LocalImage1.png', + data: 'data://localimage1data', + }, + ], + personalizationStore.actions); + + assertDeepEquals( + [ + // Begin loading local image list. + { + 'loading.local': {images: true, data: {}}, + local: {images: null, data: {}} + }, + // Done loading local image data. + { + 'loading.local': {data: {}, images: false}, + local: { + images: [ + {path: 'LocalImage0.png'}, + {path: 'LocalImage1.png'}, + ], + data: {} + } + }, + // Mark image 0 as loading. + { + 'loading.local': { + data: {'LocalImage0.png': true}, + images: false, + }, + local: { + images: [{path: 'LocalImage0.png'}, {path: 'LocalImage1.png'}], + data: {}, + }, + }, + // Mark image 1 as loading. + { + 'loading.local': { + data: {'LocalImage0.png': true, 'LocalImage1.png': true}, + images: false, + }, + local: { + images: [ + {path: 'LocalImage0.png'}, + {path: 'LocalImage1.png'}, + ], + data: {}, + } + }, + // Finish loading image 0. + { + 'loading.local': { + data: {'LocalImage0.png': false, 'LocalImage1.png': true}, + images: false, + }, + local: { + images: [ + {path: 'LocalImage0.png'}, + {path: 'LocalImage1.png'}, + ], + data: {'LocalImage0.png': 'data://localimage0data'}, + } + }, + // Finish loading image 1. + { + 'loading.local': { + data: {'LocalImage0.png': false, 'LocalImage1.png': false}, + images: false, + }, + local: { + images: [ + {path: 'LocalImage0.png'}, + {path: 'LocalImage1.png'}, + ], + data: { + 'LocalImage0.png': 'data://localimage0data', + 'LocalImage1.png': 'data://localimage1data', + }, + } + } + ], + personalizationStore.states.map( + filterAndFlattenState(['local', 'loading.local']))); + }); + + test('subtracts an image from state when it disappears', async () => { + await fetchLocalData(wallpaperProvider, personalizationStore); + // Keep the current state but reset the history of actions and states. + personalizationStore.reset(personalizationStore.data); + + // Only keep the first image. + wallpaperProvider.localImages = [wallpaperProvider.localImages[0]]; + await fetchLocalData(wallpaperProvider, personalizationStore); + + assertDeepEquals( + [ + {name: 'begin_load_local_images'}, + { + name: 'set_local_images', + images: [{path: 'LocalImage0.png'}], + }, + ], + personalizationStore.actions, + ); + + assertDeepEquals( + [ + // Begin loading new image list. + { + 'loading.local': { + data: {'LocalImage0.png': false, 'LocalImage1.png': false}, + images: true, + }, + local: { + images: [{path: 'LocalImage0.png'}, {path: 'LocalImage1.png'}], + data: { + 'LocalImage0.png': 'data://localimage0data', + 'LocalImage1.png': 'data://localimage1data', + }, + }, + }, + // Load new image list with only image 0. Deletes image 1 information + // from loading state and thumbnail state. + { + 'loading.local': {data: {'LocalImage0.png': false}, images: false}, + local: { + images: [{path: 'LocalImage0.png'}], + data: {'LocalImage0.png': 'data://localimage0data'}, + }, + }, + ], + personalizationStore.states.map( + filterAndFlattenState(['local', 'loading.local']))); + }); + + test('fetches new images that are added', async () => { + await fetchLocalData(wallpaperProvider, personalizationStore); + // Reset the history of actions and prior states, but keep the current + // state. + personalizationStore.reset(personalizationStore.data); + + // Subtract image 1 and add NewPath.png. + wallpaperProvider.localImages = [ + wallpaperProvider.localImages[0], + {path: 'NewPath.png'}, + ]; + + wallpaperProvider.localImageData = { + ...wallpaperProvider.localImageData, + 'NewPath.png': 'data://newpath', + }; + + await fetchLocalData(wallpaperProvider, personalizationStore); + + assertDeepEquals( + [ + { + name: 'begin_load_local_images', + }, + { + name: 'set_local_images', + images: [{path: 'LocalImage0.png'}, {path: 'NewPath.png'}], + }, + // Only loads data for new image. + { + name: 'begin_load_local_image_data', + id: 'NewPath.png', + }, + // Sets data for new image. + { + name: 'set_local_image_data', + id: 'NewPath.png', + data: 'data://newpath', + } + ], + personalizationStore.actions, + ); + + assertDeepEquals( + [ + // Begin loading image list. + { + 'loading.local': { + 'data': {'LocalImage0.png': false, 'LocalImage1.png': false}, + 'images': true, + }, + 'local': { + 'images': [ + {'path': 'LocalImage0.png'}, + {'path': 'LocalImage1.png'}, + ], + 'data': { + 'LocalImage0.png': 'data://localimage0data', + 'LocalImage1.png': 'data://localimage1data', + }, + }, + }, + // Done loading image list. + { + 'loading.local': { + 'data': {'LocalImage0.png': false}, + 'images': false, + }, + 'local': { + 'images': [{'path': 'LocalImage0.png'}, {'path': 'NewPath.png'}], + 'data': {'LocalImage0.png': 'data://localimage0data'}, + }, + }, + // Begin loading NewPath.png data. + { + 'loading.local': { + 'data': {'LocalImage0.png': false, 'NewPath.png': true}, + 'images': false, + }, + 'local': { + 'images': [{'path': 'LocalImage0.png'}, {'path': 'NewPath.png'}], + 'data': {'LocalImage0.png': 'data://localimage0data'}, + }, + }, + // Done loading NewPath.png data. + { + 'loading.local': { + 'data': {'LocalImage0.png': false, 'NewPath.png': false}, + 'images': false, + }, + 'local': { + 'images': [{'path': 'LocalImage0.png'}, {'path': 'NewPath.png'}], + 'data': { + 'LocalImage0.png': 'data://localimage0data', + 'NewPath.png': 'data://newpath', + }, + }, + } + ], + personalizationStore.states.map( + filterAndFlattenState(['local', 'loading.local']))); + }); + + test('clears local images when fetching new image list fails', async () => { + await fetchLocalData(wallpaperProvider, personalizationStore); + // Reset the history of actions and prior states, but keep the current + // state. + personalizationStore.reset(personalizationStore.data); + + wallpaperProvider.localImages = null; + await fetchLocalData(wallpaperProvider, personalizationStore); + + assertEquals(null, personalizationStore.data.local.images); + assertDeepEquals({}, personalizationStore.data.local.data); + assertDeepEquals({}, personalizationStore.data.loading.local.data); + }); +});
diff --git a/chrome/test/data/webui/chromeos/personalization_app/test_mojo_interface_provider.js b/chrome/test/data/webui/chromeos/personalization_app/test_mojo_interface_provider.js index 3c17ac5..809e947c 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/test_mojo_interface_provider.js +++ b/chrome/test/data/webui/chromeos/personalization_app/test_mojo_interface_provider.js
@@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {unguessableTokenToString} from 'chrome://personalization/common/utils.js'; import {assertTrue} from '../../chai_assert.js'; import {TestBrowserProxy} from '../../test_browser_proxy.js'; @@ -60,22 +59,13 @@ }, ]; - /** @type {?Array<!chromeos.personalizationApp.mojom.LocalImage>} */ - this.localImages = [ - { - id: {high: BigInt(100), low: BigInt(10)}, - name: 'LocalImage0', - }, - { - id: {high: BigInt(200), low: BigInt(20)}, - name: 'LocalImage1', - } - ]; + /** @type {?Array<!mojoBase.mojom.FilePath>} */ + this.localImages = [{path: 'LocalImage0.png'}, {path: 'LocalImage1.png'}]; /** @type {!Object<string, string>} */ this.localImageData = { - '100,10': 'data://localimage0data', - '200,20': 'data://localimage1data', + 'LocalImage0.png': 'data://localimage0data', + 'LocalImage1.png': 'data://localimage1data', }; /** @@ -143,10 +133,9 @@ } /** @override */ - getLocalImageThumbnail(id) { - this.methodCalled('getLocalImageThumbnail', id); - return Promise.resolve( - {data: this.localImageData[unguessableTokenToString(id)]}); + getLocalImageThumbnail(filePath) { + this.methodCalled('getLocalImageThumbnail', filePath); + return Promise.resolve({data: this.localImageData[filePath.path]}); } /** @override */
diff --git a/chrome/test/data/webui/chromeos/personalization_app/test_personalization_store.js b/chrome/test/data/webui/chromeos/personalization_app/test_personalization_store.js index b6bba9a..c2907af 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/test_personalization_store.js +++ b/chrome/test/data/webui/chromeos/personalization_app/test_personalization_store.js
@@ -18,10 +18,34 @@ export class TestPersonalizationStore extends TestStore { constructor(data) { super(data, PersonalizationStore, emptyState(), reduce); + this.actions_ = []; + this.states_ = []; + } + + get actions() { + return this.actions_; + } + + get states() { + return this.states_; } /** @override */ replaceSingleton() { PersonalizationStore.setInstance(this); } + + /** @override */ + reduce_(action) { + super.reduce_(action); + this.actions_.push(action); + this.states_.push(this.data); + } + + reset(data = {}) { + this.data = Object.assign(emptyState(), data); + this.resetLastAction(); + this.actions_ = []; + this.states_ = []; + } }
diff --git a/chrome/test/data/webui/chromeos/personalization_app/wallpaper_collections_element_test.js b/chrome/test/data/webui/chromeos/personalization_app/wallpaper_collections_element_test.js index a8bb4e8..b578c48 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/wallpaper_collections_element_test.js +++ b/chrome/test/data/webui/chromeos/personalization_app/wallpaper_collections_element_test.js
@@ -158,25 +158,20 @@ wallpaperCollectionsElement.shadowRoot.querySelector('iframe').hidden); }); - test('loads backdrop and local data and saves to store', async () => { + test('loads backdrop data and saves to store', async () => { // Make sure state starts at expected value. assertDeepEquals(emptyState(), personalizationStore.data); // Actually run the reducers. personalizationStore.setReducersEnabled(true); - const { - sendCollections: sendCollectionsPromise, - sendLocalImages: sendLocalImagesPromise - } = promisifyIframeFunctionsForTesting(); + const {sendCollections: sendCollectionsPromise} = + promisifyIframeFunctionsForTesting(); wallpaperCollectionsElement = initElement(WallpaperCollections.is); const [_, collections] = await sendCollectionsPromise; assertDeepEquals(wallpaperProvider.collections, collections); - const [__, localImages] = await sendLocalImagesPromise; - assertDeepEquals(wallpaperProvider.localImages, localImages); - assertDeepEquals( { collections: wallpaperProvider.collections, @@ -189,26 +184,12 @@ ); assertDeepEquals( { - images: wallpaperProvider.localImages, - data: wallpaperProvider.localImageData, - }, - personalizationStore.data.local, - ); - assertDeepEquals( - { ...emptyState().loading, collections: false, images: { 'id_0': false, 'id_1': false, }, - local: { - images: false, - data: { - '100,10': false, - '200,20': false, - }, - }, }, personalizationStore.data.loading, ); @@ -222,9 +203,9 @@ personalizationStore.data.loading.local.images = false; personalizationStore.data.local.images = []; for (let i = 0; i < kMaximumLocalImagePreviews; i++) { - personalizationStore.data.local.images.push( - {id: {high: BigInt(i * 2), low: BigInt(i)}, name: `local-${i}`}); - personalizationStore.data.loading.local.data[`${i * 2},${i}`] = true; + const path = `LocalImage${i}.png`; + personalizationStore.data.local.images.push({path}); + personalizationStore.data.loading.local.data[path] = true; } // Collections are finished loading. personalizationStore.data.backdrop.collections = @@ -242,8 +223,12 @@ assertFalse(wallpaperCollectionsElement.didSendLocalImageData_); // First thumbnail loads in. - personalizationStore.data.loading.local.data = {'0,0': false}; - personalizationStore.data.local.data = {'0,0': 'local_data_0'}; + personalizationStore.data.loading.local.data = { + 'LocalImage0.png': false + }; + personalizationStore.data.local.data = { + 'LocalImage0.png': 'local_data_0' + }; personalizationStore.notifyObservers(); await wallpaperCollectionsElement.iframePromise_; @@ -256,13 +241,13 @@ // Second thumbnail fails loading. Third succeeds. personalizationStore.data.loading.local.data = { ...personalizationStore.data.loading.local.data, - '2,1': false, - '4,2': false, + 'LocalImage1.png': false, + 'LocalImage2.png': false, }; personalizationStore.data.local.data = { ...personalizationStore.data.local.data, - '2,1': null, - '4,2': 'local_data_2', + 'LocalImage1.png': '', + 'LocalImage2.png': 'local_data_2', }; personalizationStore.notifyObservers(); @@ -272,6 +257,11 @@ assertTrue(wallpaperCollectionsElement.didSendLocalImageData_); assertDeepEquals( - {'0,0': 'local_data_0', '4,2': 'local_data_2'}, sentData); + { + 'LocalImage0.png': 'local_data_0', + 'LocalImage1.png': '', + 'LocalImage2.png': 'local_data_2', + }, + sentData); }); }
diff --git a/chrome/test/data/webui/new_tab_page/app_test.js b/chrome/test/data/webui/new_tab_page/app_test.js index a7349da..30edeab 100644 --- a/chrome/test/data/webui/new_tab_page/app_test.js +++ b/chrome/test/data/webui/new_tab_page/app_test.js
@@ -459,6 +459,16 @@ assertTrue(commandExecuted); }); + test('logs height', async () => { + // Assert. + assertEquals(1, metrics.count('NewTabPage.Height')); + assertEquals( + 1, + metrics.count( + 'NewTabPage.Height', + Math.floor(document.documentElement.clientHeight))); + }); + suite('click recording', () => { suiteSetup(() => { loadTimeData.overrideValues({
diff --git a/chrome/test/data/webui/settings/chromeos/os_people_page_test.js b/chrome/test/data/webui/settings/chromeos/os_people_page_test.js index 65ae314..20db543 100644 --- a/chrome/test/data/webui/settings/chromeos/os_people_page_test.js +++ b/chrome/test/data/webui/settings/chromeos/os_people_page_test.js
@@ -105,14 +105,14 @@ setup(function() { browserProxy = new TestProfileInfoBrowserProxy(); - settings.ProfileInfoBrowserProxyImpl.instance_ = browserProxy; + settings.ProfileInfoBrowserProxyImpl.setInstance(browserProxy); syncBrowserProxy = new TestSyncBrowserProxy(); settings.SyncBrowserProxyImpl.setInstance(syncBrowserProxy); accountManagerBrowserProxy = new TestAccountManagerBrowserProxy(); - settings.AccountManagerBrowserProxyImpl.instance_ = - accountManagerBrowserProxy; + settings.AccountManagerBrowserProxyImpl.setInstance( + accountManagerBrowserProxy); PolymerTest.clearBody(); });
diff --git a/chrome/test/data/webui/settings/chromeos/people_page_account_manager_test.js b/chrome/test/data/webui/settings/chromeos/people_page_account_manager_test.js index da02a67..7228efcc 100644 --- a/chrome/test/data/webui/settings/chromeos/people_page_account_manager_test.js +++ b/chrome/test/data/webui/settings/chromeos/people_page_account_manager_test.js
@@ -161,7 +161,7 @@ setup(function() { browserProxy = new TestAccountManagerBrowserProxy(); - settings.AccountManagerBrowserProxyImpl.instance_ = browserProxy; + settings.AccountManagerBrowserProxyImpl.setInstance(browserProxy); PolymerTest.clearBody(); accountManager = document.createElement('settings-account-manager'); @@ -307,7 +307,7 @@ setup(function() { browserProxy = new TestAccountManagerBrowserProxyForUnmanagedAccounts(); - settings.AccountManagerBrowserProxyImpl.instance_ = browserProxy; + settings.AccountManagerBrowserProxyImpl.setInstance(browserProxy); PolymerTest.clearBody(); accountManager = document.createElement('settings-account-manager'); @@ -352,7 +352,7 @@ setup(function() { browserProxy = new TestAccountManagerBrowserProxy(); - settings.AccountManagerBrowserProxyImpl.instance_ = browserProxy; + settings.AccountManagerBrowserProxyImpl.setInstance(browserProxy); PolymerTest.clearBody(); accountManager = document.createElement('settings-account-manager'); @@ -406,7 +406,7 @@ setup(function() { browserProxy = new TestAccountManagerBrowserProxy(); - settings.AccountManagerBrowserProxyImpl.instance_ = browserProxy; + settings.AccountManagerBrowserProxyImpl.setInstance(browserProxy); PolymerTest.clearBody(); accountManager = document.createElement('settings-account-manager');
diff --git a/chrome/test/data/webui/settings/import_data_dialog_test.js b/chrome/test/data/webui/settings/import_data_dialog_test.js index 8fb64ca1..9ff3037 100644 --- a/chrome/test/data/webui/settings/import_data_dialog_test.js +++ b/chrome/test/data/webui/settings/import_data_dialog_test.js
@@ -102,7 +102,7 @@ setup(function() { browserProxy = new TestImportDataBrowserProxy(); browserProxy.setBrowserProfiles(browserProfiles); - ImportDataBrowserProxyImpl.instance_ = browserProxy; + ImportDataBrowserProxyImpl.setInstance(browserProxy); PolymerTest.clearBody(); dialog = document.createElement('settings-import-data-dialog'); dialog.set('prefs', prefs);
diff --git a/chrome/test/data/webui/settings/people_page_manage_profile_test.js b/chrome/test/data/webui/settings/people_page_manage_profile_test.js index 8caf93f9..d360bb2 100644 --- a/chrome/test/data/webui/settings/people_page_manage_profile_test.js +++ b/chrome/test/data/webui/settings/people_page_manage_profile_test.js
@@ -79,7 +79,7 @@ setup(function() { browserProxy = new TestManageProfileBrowserProxy(); - ManageProfileBrowserProxyImpl.instance_ = browserProxy; + ManageProfileBrowserProxyImpl.setInstance(browserProxy); PolymerTest.clearBody(); loadTimeData.overrideValues({profileShortcutsEnabled: false}); manageProfile = createManageProfileElement();
diff --git a/chrome/test/data/webui/settings/people_page_test.js b/chrome/test/data/webui/settings/people_page_test.js index e9c5e6c..2b769de3 100644 --- a/chrome/test/data/webui/settings/people_page_test.js +++ b/chrome/test/data/webui/settings/people_page_test.js
@@ -50,7 +50,7 @@ setup(async function() { profileInfoBrowserProxy = new TestProfileInfoBrowserProxy(); - ProfileInfoBrowserProxyImpl.instance_ = profileInfoBrowserProxy; + ProfileInfoBrowserProxyImpl.setInstance(profileInfoBrowserProxy); syncBrowserProxy = new TestSyncBrowserProxy(); SyncBrowserProxyImpl.setInstance(syncBrowserProxy); @@ -103,7 +103,7 @@ SyncBrowserProxyImpl.setInstance(syncBrowserProxy); profileInfoBrowserProxy = new TestProfileInfoBrowserProxy(); - ProfileInfoBrowserProxyImpl.instance_ = profileInfoBrowserProxy; + ProfileInfoBrowserProxyImpl.setInstance(profileInfoBrowserProxy); PolymerTest.clearBody(); peoplePage = document.createElement('settings-people-page'); @@ -140,7 +140,7 @@ SyncBrowserProxyImpl.setInstance(syncBrowserProxy); profileInfoBrowserProxy = new TestProfileInfoBrowserProxy(); - ProfileInfoBrowserProxyImpl.instance_ = profileInfoBrowserProxy; + ProfileInfoBrowserProxyImpl.setInstance(profileInfoBrowserProxy); PolymerTest.clearBody(); peoplePage = document.createElement('settings-people-page'); @@ -415,7 +415,7 @@ SyncBrowserProxyImpl.setInstance(syncBrowserProxy); profileInfoBrowserProxy = new TestProfileInfoBrowserProxy(); - ProfileInfoBrowserProxyImpl.instance_ = profileInfoBrowserProxy; + ProfileInfoBrowserProxyImpl.setInstance(profileInfoBrowserProxy); PolymerTest.clearBody(); peoplePage = document.createElement('settings-people-page');
diff --git a/chrome/test/data/webui/settings/people_page_test_cros.js b/chrome/test/data/webui/settings/people_page_test_cros.js index 7cbf564..d195b08 100644 --- a/chrome/test/data/webui/settings/people_page_test_cros.js +++ b/chrome/test/data/webui/settings/people_page_test_cros.js
@@ -98,10 +98,10 @@ SyncBrowserProxyImpl.setInstance(syncBrowserProxy); profileInfoBrowserProxy = new TestProfileInfoBrowserProxy(); - ProfileInfoBrowserProxyImpl.instance_ = profileInfoBrowserProxy; + ProfileInfoBrowserProxyImpl.setInstance(profileInfoBrowserProxy); accountManagerBrowserProxy = new TestAccountManagerBrowserProxy(); - AccountManagerBrowserProxyImpl.instance_ = accountManagerBrowserProxy; + AccountManagerBrowserProxyImpl.setInstance(accountManagerBrowserProxy); PolymerTest.clearBody(); peoplePage = document.createElement('settings-people-page'); @@ -159,7 +159,7 @@ SyncBrowserProxyImpl.setInstance(syncBrowserProxy); profileInfoBrowserProxy = new TestProfileInfoBrowserProxy(); - ProfileInfoBrowserProxyImpl.instance_ = profileInfoBrowserProxy; + ProfileInfoBrowserProxyImpl.setInstance(profileInfoBrowserProxy); PolymerTest.clearBody(); peoplePage = document.createElement('settings-people-page'); @@ -213,7 +213,7 @@ SyncBrowserProxyImpl.setInstance(syncBrowserProxy); profileInfoBrowserProxy = new TestProfileInfoBrowserProxy(); - ProfileInfoBrowserProxyImpl.instance_ = profileInfoBrowserProxy; + ProfileInfoBrowserProxyImpl.setInstance(profileInfoBrowserProxy); PolymerTest.clearBody(); peoplePage = document.createElement('settings-people-page');
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc index 3a1ecbe..39749cf4 100644 --- a/chromecast/browser/cast_browser_main_parts.cc +++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -412,10 +412,7 @@ AddDefaultCommandLineSwitches(command_line); service_manager_context_ = std::make_unique<ServiceManagerContext>( - cast_content_browser_client_, - base::FeatureList::IsEnabled(features::kProcessHostOnUI) - ? content::GetUIThreadTaskRunner({}) - : content::GetIOThreadTaskRunner({})); + cast_content_browser_client_, content::GetUIThreadTaskRunner({})); ServiceManagerConnection::GetForProcess()->Start(); }
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index 6c34cb0..f776bc7 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -14238.0.0 \ No newline at end of file +14240.0.0 \ No newline at end of file
diff --git a/chromeos/components/personalization_app/mojom/BUILD.gn b/chromeos/components/personalization_app/mojom/BUILD.gn index 5a6ffb29..192dc3b 100644 --- a/chromeos/components/personalization_app/mojom/BUILD.gn +++ b/chromeos/components/personalization_app/mojom/BUILD.gn
@@ -31,10 +31,6 @@ mojom = "chromeos.personalization_app.mojom.WallpaperImage" cpp = "backdrop::Image" }, - { - mojom = "chromeos.personalization_app.mojom.LocalImage" - cpp = "ash::LocalImageInfo" - }, ] traits_headers = [ "personalization_app_mojom_traits.h" ] traits_sources = [ "personalization_app_mojom_traits.cc" ]
diff --git a/chromeos/components/personalization_app/mojom/personalization_app.mojom b/chromeos/components/personalization_app/mojom/personalization_app.mojom index 13f1efdf..6820688 100644 --- a/chromeos/components/personalization_app/mojom/personalization_app.mojom +++ b/chromeos/components/personalization_app/mojom/personalization_app.mojom
@@ -4,7 +4,7 @@ module chromeos.personalization_app.mojom; -import "mojo/public/mojom/base/unguessable_token.mojom"; +import "mojo/public/mojom/base/file_path.mojom"; import "url/mojom/url.mojom"; // This should be kept in sync with |ash::WallpaperLayout| @@ -65,16 +65,6 @@ uint64 asset_id; }; -struct LocalImage { - // Unique ID for this image for fetching thumbnail data and setting as user - // background. - mojo_base.mojom.UnguessableToken id; - - // Name of this local asset including extension. Matched against - // |CurrentWallpaper.key| to check if this image is set as user wallpaper. - string name; -}; - // Represents the currently selected wallpaper image. struct CurrentWallpaper { // URL of the currently selected wallpaper image in data scheme. @@ -91,7 +81,7 @@ WallpaperType type; // A unique identifier for the image. This is used to identify which - // |WallpaperImage| or |LocalImage| the user has selected. + // |WallpaperImage| or local image the user has selected. string key; }; @@ -118,13 +108,13 @@ FetchImagesForCollection(string collection_id) => ( array<WallpaperImage>? images); - // Fetch a list of LocalImage objects from the local file system. |images| + // Fetch a list of FilePath objects from the local file system. |images| // will be null on failure. - GetLocalImages() => (array<LocalImage>? images); + GetLocalImages() => (array<mojo_base.mojom.FilePath>? images); - // Fetch a thumbnail data url for the given LocalImage |id|. |data| will be + // Fetch a thumbnail data url for the given local image path. |data| will be // empty string on failure. - GetLocalImageThumbnail(mojo_base.mojom.UnguessableToken id) => + GetLocalImageThumbnail(mojo_base.mojom.FilePath file_path) => (string data); // Binds a listener to start receiving updates on wallpaper changes. @@ -133,8 +123,9 @@ // Sets the given backdrop wallpaper as the user's background. SelectWallpaper(uint64 image_asset_id) => (bool success); - // Sets the given local wallpaper as the user's background. - SelectLocalImage(mojo_base.mojom.UnguessableToken id) => (bool success); + // Sets the given local wallpaper as the user's background. Validated + // against list of file paths returned by |GetLocalImages|. + SelectLocalImage(mojo_base.mojom.FilePath path) => (bool success); // Sets the custom layout for current wallpaper SetCustomWallpaperLayout(WallpaperLayout layout);
diff --git a/chromeos/components/personalization_app/mojom/personalization_app_mojom_traits.cc b/chromeos/components/personalization_app/mojom/personalization_app_mojom_traits.cc index 269819e..092a6548 100644 --- a/chromeos/components/personalization_app/mojom/personalization_app_mojom_traits.cc +++ b/chromeos/components/personalization_app/mojom/personalization_app_mojom_traits.cc
@@ -192,25 +192,4 @@ return false; } -base::UnguessableToken StructTraits< - chromeos::personalization_app::mojom::LocalImageDataView, - ash::LocalImageInfo>::id(const ash::LocalImageInfo& local_image_info) { - return local_image_info.id; -} - -std::string StructTraits< - chromeos::personalization_app::mojom::LocalImageDataView, - ash::LocalImageInfo>::name(const ash::LocalImageInfo& local_image_info) { - return local_image_info.path.BaseName().value(); -} - -// Default to false as we don't ever need to convert back to -// |ash::LocalImageInfo| -bool StructTraits<chromeos::personalization_app::mojom::LocalImageDataView, - ash::LocalImageInfo>:: - Read(chromeos::personalization_app::mojom::LocalImageDataView data, - ash::LocalImageInfo* out) { - return false; -} - } // namespace mojo
diff --git a/chromeos/components/personalization_app/mojom/personalization_app_mojom_traits.h b/chromeos/components/personalization_app/mojom/personalization_app_mojom_traits.h index 2964782..5183d9fc 100644 --- a/chromeos/components/personalization_app/mojom/personalization_app_mojom_traits.h +++ b/chromeos/components/personalization_app/mojom/personalization_app_mojom_traits.h
@@ -5,7 +5,6 @@ #ifndef CHROMEOS_COMPONENTS_PERSONALIZATION_APP_MOJOM_PERSONALIZATION_APP_MOJOM_TRAITS_H_ #define CHROMEOS_COMPONENTS_PERSONALIZATION_APP_MOJOM_PERSONALIZATION_APP_MOJOM_TRAITS_H_ -#include "ash/public/cpp/wallpaper/local_image_info.h" #include "ash/public/cpp/wallpaper/wallpaper_types.h" #include "base/unguessable_token.h" #include "chromeos/components/personalization_app/mojom/personalization_app.mojom-shared.h" @@ -64,17 +63,6 @@ static bool isNull(const backdrop::Image& image); }; -template <> -struct StructTraits<chromeos::personalization_app::mojom::LocalImageDataView, - ash::LocalImageInfo> { - static base::UnguessableToken id(const ash::LocalImageInfo& local_image_info); - static std::string name(const ash::LocalImageInfo& local_image_info); - - static bool Read( - chromeos::personalization_app::mojom::LocalImageDataView data, - ash::LocalImageInfo* out); -}; - } // namespace mojo #endif // CHROMEOS_COMPONENTS_PERSONALIZATION_APP_MOJOM_PERSONALIZATION_APP_MOJOM_TRAITS_H_
diff --git a/chromeos/components/personalization_app/resources/common/constants.js b/chromeos/components/personalization_app/resources/common/constants.js index 5000c14..8c48b33 100644 --- a/chromeos/components/personalization_app/resources/common/constants.js +++ b/chromeos/components/personalization_app/resources/common/constants.js
@@ -63,13 +63,13 @@ /** * @typedef {{ * type: EventType, - * images: !Array<!chromeos.personalizationApp.mojom.LocalImage>, + * images: !Array<!mojoBase.mojom.FilePath>, * }} */ export let SendLocalImagesEvent; /** - * Sends local image data keyed by stringified local image id. + * Sends local image data keyed by stringified local image path. * @typedef {{ * type: EventType, * data: !Object<string, string>,
diff --git a/chromeos/components/personalization_app/resources/common/iframe_api.js b/chromeos/components/personalization_app/resources/common/iframe_api.js index 986ffb2..1d8c98f 100644 --- a/chromeos/components/personalization_app/resources/common/iframe_api.js +++ b/chromeos/components/personalization_app/resources/common/iframe_api.js
@@ -67,7 +67,7 @@ /** * Send an array of local images to chrome-untrusted://. * @param {!Window} target the iframe window to send the message to. - * @param {!Array<!chromeos.personalizationApp.mojom.LocalImage>} images + * @param {!Array<!mojoBase.mojom.FilePath>} images */ export function sendLocalImages(target, images) { /** @type {!SendLocalImagesEvent} */
diff --git a/chromeos/components/personalization_app/resources/common/utils.js b/chromeos/components/personalization_app/resources/common/utils.js index 6a0adb1..52b927d 100644 --- a/chromeos/components/personalization_app/resources/common/utils.js +++ b/chromeos/components/personalization_app/resources/common/utils.js
@@ -37,34 +37,6 @@ } /** - * Convert an UnguessableToken to string to use as a key. - * @param {!mojoBase.mojom.UnguessableToken} param0 - * @return {string} - */ -export function unguessableTokenToString({high, low}) { - return `${high},${low}`; -} - -/** - * @param {!string} str - * @return {!mojoBase.mojom.UnguessableToken} - */ -export function stringToUnguessableToken(str) { - const [high, low] = str.split(',').map(BigInt); - return {high, low}; -} - -/** - * @param {!mojoBase.mojom.UnguessableToken} a - * @param {!mojoBase.mojom.UnguessableToken} b - * @return {boolean} - */ -export function unguessableTokensEqual(a, b) { - return a.hasOwnProperty('high') && a.high === b.high && - a.hasOwnProperty('low') && a.low === b.low; -} - -/** * Returns true if this event is a user action to select an item. * @param {!Event} event * @return {boolean}
diff --git a/chromeos/components/personalization_app/resources/trusted/BUILD.gn b/chromeos/components/personalization_app/resources/trusted/BUILD.gn index 2fdc3a33..bbc10e6 100644 --- a/chromeos/components/personalization_app/resources/trusted/BUILD.gn +++ b/chromeos/components/personalization_app/resources/trusted/BUILD.gn
@@ -34,6 +34,7 @@ ":personalization_controller", ":personalization_reducers", ":styles", + "../../mojom:mojom_js_library_for_compile", "../common:constants", "../common:icons", "../common:styles", @@ -216,9 +217,15 @@ } copy("copy_mojo_to_trusted") { - deps = [ "../../mojom:mojom_js" ] - sources = [ "$target_gen_dir/../../mojom/personalization_app.mojom-lite.js" ] - outputs = [ "$target_gen_dir/personalization_app.mojom-lite.js" ] + deps = [ + "../../mojom:mojom_js", + "//mojo/public/mojom/base", + ] + sources = [ + "$root_gen_dir/mojo/public/mojom/base/file_path.mojom-lite.js", + "$target_gen_dir/../../mojom/personalization_app.mojom-lite.js", + ] + outputs = [ "$target_gen_dir/{{source_file_part}}" ] } preprocess_if_expr("preprocess") { @@ -237,5 +244,8 @@ foreach(file, static_files) { in_files += [ "trusted/$file" ] } - in_files += [ "trusted/personalization_app.mojom-lite.js" ] + in_files += [ + "trusted/personalization_app.mojom-lite.js", + "trusted/file_path.mojom-lite.js", + ] }
diff --git a/chromeos/components/personalization_app/resources/trusted/local_images_element.js b/chromeos/components/personalization_app/resources/trusted/local_images_element.js index 92779c3..25cc7fd 100644 --- a/chromeos/components/personalization_app/resources/trusted/local_images_element.js +++ b/chromeos/components/personalization_app/resources/trusted/local_images_element.js
@@ -18,9 +18,9 @@ import {assert} from '/assert.m.js'; import {afterNextRender, html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {getLoadingPlaceholderAnimationDelay} from '../common/utils.js'; -import {isSelectionEvent, stringToUnguessableToken, unguessableTokensEqual, unguessableTokenToString} from '../common/utils.js'; +import {isSelectionEvent} from '../common/utils.js'; import {getWallpaperProvider} from './mojo_interface_provider.js'; -import {selectWallpaper} from './personalization_controller.js'; +import {fetchLocalData, selectWallpaper} from './personalization_controller.js'; import {DisplayableImage} from './personalization_reducers.js'; import {WithPersonalizationStore} from './personalization_store.js'; @@ -44,7 +44,7 @@ }, /** - * @type {!Array<!chromeos.personalizationApp.mojom.LocalImage>} + * @type {!Array<!mojoBase.mojom.FilePath>} * @private */ images_: { @@ -88,7 +88,7 @@ }, /** - * @type {!Array<!chromeos.personalizationApp.mojom.LocalImage>} + * @type {!Array<!mojoBase.mojom.FilePath>} * @private */ imagesToDisplay_: { @@ -103,6 +103,13 @@ } /** @override */ + constructor() { + super(); + /** @private */ + this.wallpaperProvider_ = getWallpaperProvider(); + } + + /** @override */ connectedCallback() { super.connectedCallback(); this.watch('images_', state => state.local.images); @@ -111,6 +118,10 @@ this.watch('currentSelected_', state => state.currentSelected); this.watch('pendingSelected_', state => state.pendingSelected); this.updateFromStore(); + fetchLocalData(this.wallpaperProvider_, this.getStore()); + window.addEventListener('focus', () => { + fetchLocalData(this.wallpaperProvider_, this.getStore()); + }); } /** @@ -132,12 +143,12 @@ /** * Sets |imagesToDisplay| when a new set of local images loads. - * @param {Array<!chromeos.personalizationApp.mojom.LocalImage>} images + * @param {Array<!mojoBase.mojom.FilePath>} images * @private */ onImagesChanged_(images) { this.imagesToDisplay_ = (images || []).filter(image => { - const key = unguessableTokenToString(image); + const key = image.path; if (this.imageDataLoading_[key] === false) { return !!this.imageData_[key]; } @@ -160,7 +171,7 @@ // |imagesToDisplay| while iterating. for (let i = this.imagesToDisplay_.length - 1; i >= 0; i--) { const image = this.imagesToDisplay_[i]; - const key = unguessableTokenToString(image.id); + const key = image.path; const failed = imageDataLoading[key] === false && !imageData[key]; if (failed) { this.splice('imagesToDisplay_', i, 1); @@ -168,9 +179,8 @@ } } - /** - * @param {!chromeos.personalizationApp.mojom.LocalImage} image + * @param {!mojoBase.mojom.FilePath} image * @param {?chromeos.personalizationApp.mojom.CurrentWallpaper} * currentSelected * @param {?DisplayableImage} pendingSelected @@ -181,14 +191,14 @@ if (!image || (!currentSelected && !pendingSelected)) { return 'false'; } - return (!!pendingSelected && image.id === pendingSelected.id || - !!currentSelected && currentSelected.key === image.name && + return (!!pendingSelected && image.path === pendingSelected.path || + !!currentSelected && image.path.endsWith(currentSelected.key) && !pendingSelected) .toString(); } /** - * @param {chromeos.personalizationApp.mojom.LocalImage} image + * @param {mojoBase.mojom.FilePath} image * @param {Object<string, boolean>} imageDataLoading * @return {boolean} * @private @@ -197,7 +207,7 @@ if (!image || !imageDataLoading) { return true; } - const key = unguessableTokenToString(image.id); + const key = image.path; // If key is not present, then loading has not yet started. Still show a // loading tile in this case. return !imageDataLoading.hasOwnProperty(key) || @@ -214,7 +224,7 @@ } /** - * @param {chromeos.personalizationApp.mojom.LocalImage} image + * @param {mojoBase.mojom.FilePath} image * @param {Object<string, string>} imageData * @param {Object<string, boolean>} imageDataLoading * @return {boolean} @@ -224,28 +234,27 @@ if (!image || !imageData || !imageDataLoading) { return false; } - const key = unguessableTokenToString(image.id); + const key = image.path; return !!imageData[key] && imageDataLoading[key] === false; } /** - * @param {chromeos.personalizationApp.mojom.LocalImage} image + * @param {mojoBase.mojom.FilePath} image * @param {Object<string, string>} imageData * @return {string} * @private */ getImageData_(image, imageData) { - const key = unguessableTokenToString(image.id); - return imageData[key]; + return imageData[image.path]; } /** - * @param {!chromeos.personalizationApp.mojom.LocalImage} image + * @param {!mojoBase.mojom.FilePath} image * @return {string} * @private */ getImageKey_(image) { - return unguessableTokenToString(image.id); + return image.path; } /** @@ -256,13 +265,12 @@ if (!isSelectionEvent(event)) { return; } - const id = stringToUnguessableToken(event.currentTarget.dataset.id); - const image = - this.images_.find(image => unguessableTokensEqual(id, image.id)); - assert(!!image, 'Image with that id not found'); + const path = event.currentTarget.dataset.id; + const image = this.images_.find(image => path === image.path); + assert(!!image, 'Image with that path not found'); selectWallpaper( - /** @type {!chromeos.personalizationApp.mojom.LocalImage} */ (image), - getWallpaperProvider(), this.getStore()); + /** @type {!mojoBase.mojom.FilePath} */ (image), + this.wallpaperProvider_, this.getStore()); } /**
diff --git a/chromeos/components/personalization_app/resources/trusted/mojo_interface_provider.js b/chromeos/components/personalization_app/resources/trusted/mojo_interface_provider.js index 509fcb3..5b8db316 100644 --- a/chromeos/components/personalization_app/resources/trusted/mojo_interface_provider.js +++ b/chromeos/components/personalization_app/resources/trusted/mojo_interface_provider.js
@@ -9,8 +9,9 @@ */ import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js'; -import 'chrome://resources/mojo/mojo/public/mojom/base/unguessable_token.mojom-lite.js'; import 'chrome://resources/mojo/url/mojom/url.mojom-lite.js'; +// file_path is not available at chrome://resources and is copied here for use. +import './file_path.mojom-lite.js'; import './personalization_app.mojom-lite.js'; /** @type {?chromeos.personalizationApp.mojom.WallpaperProviderInterface} */
diff --git a/chromeos/components/personalization_app/resources/trusted/personalization_actions.js b/chromeos/components/personalization_app/resources/trusted/personalization_actions.js index 2f7fe8a..86429d12 100644 --- a/chromeos/components/personalization_app/resources/trusted/personalization_actions.js +++ b/chromeos/components/personalization_app/resources/trusted/personalization_actions.js
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {Action} from 'chrome://resources/js/cr/ui/store.m.js'; -import {unguessableTokenToString} from '../common/utils.js'; import {DisplayableImage} from './personalization_reducers.js'; /** @@ -13,6 +12,7 @@ /** @enum {string} */ export const ActionName = { BEGIN_LOAD_IMAGES_FOR_COLLECTIONS: 'begin_load_images_for_collections', + BEGIN_LOAD_LOCAL_IMAGES: 'begin_load_local_images', BEGIN_LOAD_LOCAL_IMAGE_DATA: 'begin_load_local_image_data', BEGIN_LOAD_SELECTED_IMAGE: 'begin_load_selected_image', BEGIN_SELECT_IMAGE: 'begin_select_image', @@ -43,13 +43,21 @@ } /** + * Notify that app is loading local image list. + * @return {!Action} + */ +export function beginLoadLocalImagesAction() { + return {name: ActionName.BEGIN_LOAD_LOCAL_IMAGES}; +} + +/** * Notify that app is loading thumbnail for the given local image. - * @param {!chromeos.personalizationApp.mojom.LocalImage} image + * @param {!mojoBase.mojom.FilePath} image * @return {!Action} */ export function beginLoadLocalImageDataAction(image) { return { - id: unguessableTokenToString(image.id), + id: image.path, name: ActionName.BEGIN_LOAD_LOCAL_IMAGE_DATA, }; } @@ -132,13 +140,13 @@ /** * Set the thumbnail data for a local image. - * @param {!chromeos.personalizationApp.mojom.LocalImage} image + * @param {!mojoBase.mojom.FilePath} filePath * @param {string} data * @return {!Action} */ -export function setLocalImageDataAction(image, data) { +export function setLocalImageDataAction(filePath, data) { return { - id: unguessableTokenToString(image.id), + id: filePath.path, data, name: ActionName.SET_LOCAL_IMAGE_DATA, }; @@ -146,7 +154,7 @@ /** * Set the list of local images. - * @param {?Array<!chromeos.personalizationApp.mojom.LocalImage>} images + * @param {?Array<!mojoBase.mojom.FilePath>} images * @return {!Action} */ export function setLocalImagesAction(images) {
diff --git a/chromeos/components/personalization_app/resources/trusted/personalization_controller.js b/chromeos/components/personalization_app/resources/trusted/personalization_controller.js index 752dc42..b7484af 100644 --- a/chromeos/components/personalization_app/resources/trusted/personalization_controller.js +++ b/chromeos/components/personalization_app/resources/trusted/personalization_controller.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import {isNonEmptyArray} from '../common/utils.js'; -import {beginLoadImagesForCollectionsAction, beginLoadLocalImageDataAction, beginLoadSelectedImageAction, beginSelectImageAction, beginUpdateDailyRefreshImageAction, endSelectImageAction, setCollectionsAction, setDailyRefreshCollectionIdAction, setImagesForCollectionAction, setLocalImageDataAction, setLocalImagesAction, setSelectedImageAction, setUpdatedDailyRefreshImageAction} from './personalization_actions.js'; +import {beginLoadImagesForCollectionsAction, beginLoadLocalImageDataAction, beginLoadLocalImagesAction, beginLoadSelectedImageAction, beginSelectImageAction, beginUpdateDailyRefreshImageAction, endSelectImageAction, setCollectionsAction, setDailyRefreshCollectionIdAction, setImagesForCollectionAction, setLocalImageDataAction, setLocalImagesAction, setSelectedImageAction, setUpdatedDailyRefreshImageAction} from './personalization_actions.js'; import {PersonalizationStore} from './personalization_store.js'; /** @@ -59,6 +59,7 @@ * @param {!PersonalizationStore} store */ async function getLocalImages(provider, store) { + store.dispatch(beginLoadLocalImagesAction()); const {images} = await provider.getLocalImages(); if (images == null) { console.warn('Failed to fetch local images'); @@ -67,32 +68,56 @@ } /** - * Get an image thumbnail for every local image one at a time. + * Because thumbnail loading can happen asynchronously and is triggered + * on page load and on window focus, multiple "threads" can be fetching + * thumbnails simultaneously. Synchronize them with a task queue. + * @type {Set<string>} + */ +const imageThumbnailsToFetch = new Set(); + +/** + * Get an image thumbnail one at a time for every local image that does not have + * a thumbnail yet. * @param {!chromeos.personalizationApp.mojom.WallpaperProviderInterface} * provider * @param {!PersonalizationStore} store */ -async function getAllLocalImageThumbnails(provider, store) { - const images = store.data.local.images; - if (!Array.isArray(images)) { - console.warn('Cannot fetch thumbnails of null image list'); +async function getMissingLocalImageThumbnails(provider, store) { + if (!Array.isArray(store.data.local.images)) { + console.warn('Cannot fetch thumbnails with invalid image list'); return; } - for (const image of images) { - store.dispatch(beginLoadLocalImageDataAction(image)); - } - for (const image of images) { - const {data} = await provider.getLocalImageThumbnail(image.id); - if (!data) { - console.warn('Failed to fetch image data', image.name); + + // Set correct loading state for each image thumbnail. Do in a batch update to + // reduce number of times that polymer must re-render. + store.beginBatchUpdate(); + for (const filePath of store.data.local.images) { + if (store.data.local.data[filePath.path] || + store.data.loading.local.data[filePath.path] || + imageThumbnailsToFetch.has(filePath.path)) { + // Do not re-load thumbnail if already present, or already loading. + continue; } - store.dispatch(setLocalImageDataAction(image, data)); + imageThumbnailsToFetch.add(filePath.path); + store.dispatch(beginLoadLocalImageDataAction(filePath)); + } + store.endBatchUpdate(); + + // There may be multiple async tasks triggered that pull off this queue. + while (imageThumbnailsToFetch.size) { + const path = imageThumbnailsToFetch.values().next().value; + imageThumbnailsToFetch.delete(path); + const {data} = await provider.getLocalImageThumbnail({path}); + if (!data) { + console.warn('Failed to fetch local image data', path); + } + store.dispatch(setLocalImageDataAction({path}, data)); } } /** * @param {!chromeos.personalizationApp.mojom.WallpaperImage | - * !chromeos.personalizationApp.mojom.LocalImage} image + * !mojoBase.mojom.FilePath} image * @param {!chromeos.personalizationApp.mojom.WallpaperProviderInterface} * provider * @param {!PersonalizationStore} store @@ -107,10 +132,11 @@ const {success} = await (() => { if (image.assetId) { return provider.selectWallpaper(image.assetId); - } else if (image.id) { - return provider.selectLocalImage(image.id); + } else if (image.path) { + return provider.selectLocalImage( + /** @type {!mojoBase.mojom.FilePath} */ (image)); } else { - console.warn('Image must be a LocalImage or a WallpaperImage'); + console.warn('Image must be a local image or a WallpaperImage'); return {success: false}; } })(); @@ -195,7 +221,10 @@ * provider * @param {!PersonalizationStore} store */ -export async function initializeLocalData(provider, store) { - await getLocalImages(provider, store); - await getAllLocalImageThumbnails(provider, store); +export async function fetchLocalData(provider, store) { + // Do not restart loading local image list if a load is already in progress. + if (!store.data.loading.local.images) { + await getLocalImages(provider, store); + } + await getMissingLocalImageThumbnails(provider, store); }
diff --git a/chromeos/components/personalization_app/resources/trusted/personalization_reducers.js b/chromeos/components/personalization_app/resources/trusted/personalization_reducers.js index 1c963a18..678ae1c 100644 --- a/chromeos/components/personalization_app/resources/trusted/personalization_reducers.js +++ b/chromeos/components/personalization_app/resources/trusted/personalization_reducers.js
@@ -22,8 +22,8 @@ export let WallpaperType = chromeos.personalizationApp.mojom.WallpaperType; /** - * @typedef {chromeos.personalizationApp.mojom.LocalImage| - * chromeos.personalizationApp.mojom.WallpaperImage} + * @typedef {mojoBase.mojom.FilePath | + * chromeos.personalizationApp.mojom.WallpaperImage} */ export let DisplayableImage; @@ -74,7 +74,7 @@ * |data| stores a mapping of image.id (converted to string) to a thumbnail data * url. * @typedef {{ - * images: ?Array<!chromeos.personalizationApp.mojom.LocalImage>, + * images: ?Array<!mojoBase.mojom.FilePath>, * data: !Object<string, string>, * }} */ @@ -112,7 +112,7 @@ loading: { collections: true, images: {}, - local: {images: true, data: {}}, + local: {images: false, data: {}}, refreshWallpaper: false, selected: false, setImage: 0, @@ -216,11 +216,28 @@ ...state, images: {...state.images, [action.collectionId]: false}, }); - case ActionName.SET_LOCAL_IMAGES: + case ActionName.BEGIN_LOAD_LOCAL_IMAGES: return /** @type {!LoadingState} */ ({ ...state, local: { ...state.local, + images: true, + }, + }); + case ActionName.SET_LOCAL_IMAGES: + return /** @type {!LoadingState} */ ({ + ...state, + local: { + // Only keep loading state for most recent local images. + data: (action.images || []).reduce( + (result, {path}) => { + if (state.local.data.hasOwnProperty(path)) { + result[path] = state.local.data[path]; + } + return result; + }, + {}), + // Image list is done loading. images: false, }, }); @@ -260,6 +277,15 @@ return /** @type {!LocalState} */ ({ ...state, images: action.images, + // Only keep image thumbnails if the image is still in |images|. + data: (action.images || []).reduce( + (result, {path}) => { + if (state.data.hasOwnProperty(path)) { + result[path] = state.data[path]; + } + return result; + }, + {}), }); case ActionName.SET_LOCAL_IMAGE_DATA: return /** @type {!LocalState} */ ({
diff --git a/chromeos/components/personalization_app/resources/trusted/wallpaper_collections_element.js b/chromeos/components/personalization_app/resources/trusted/wallpaper_collections_element.js index 5e82a57..51ad852 100644 --- a/chromeos/components/personalization_app/resources/trusted/wallpaper_collections_element.js +++ b/chromeos/components/personalization_app/resources/trusted/wallpaper_collections_element.js
@@ -12,9 +12,9 @@ import {afterNextRender, html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {kMaximumLocalImagePreviews} from '../common/constants.js'; import {sendCollections, sendImageCounts, sendLocalImageData, sendLocalImages, sendVisible} from '../common/iframe_api.js'; -import {isNonEmptyArray, promisifyOnload, unguessableTokenToString} from '../common/utils.js'; +import {isNonEmptyArray, promisifyOnload} from '../common/utils.js'; import {getWallpaperProvider} from './mojo_interface_provider.js'; -import {initializeBackdropData, initializeLocalData} from './personalization_controller.js'; +import {initializeBackdropData} from './personalization_controller.js'; import {WithPersonalizationStore} from './personalization_store.js'; let sendCollectionsFunction = sendCollections; @@ -104,7 +104,7 @@ }, /** - * @type {Array<!chromeos.personalizationApp.mojom.LocalImage>} + * @type {Array<!mojoBase.mojom.FilePath>} * @private */ localImages_: { @@ -172,9 +172,7 @@ this.watch('localImageData_', state => state.local.data); this.watch('localImageDataLoading_', state => state.loading.local.data); this.updateFromStore(); - const store = this.getStore(); - initializeBackdropData(this.wallpaperProvider_, store); - initializeLocalData(this.wallpaperProvider_, store); + initializeBackdropData(this.wallpaperProvider_, this.getStore()); } /** @@ -247,10 +245,11 @@ /** * Send updated local images list to the iframe. - * @param {?Array<!chromeos.personalizationApp.mojom.LocalImage>} value + * @param {?Array<!mojoBase.mojom.FilePath>} value * @private */ async onLocalImagesChanged_(value) { + this.didSendLocalImageData_ = false; if (Array.isArray(value)) { const iframe = await this.iframePromise_; sendLocalImagesFunction( @@ -260,7 +259,7 @@ /** * Send up to |maximumImageThumbnailsCount| image thumbnails to untrusted. - * @param {?Array<!chromeos.personalizationApp.mojom.LocalImage>} images + * @param {?Array<!mojoBase.mojom.FilePath>} images * @param {?Object<string, string>} imageData * @param {?Object<string, boolean>} imageDataLoading * @private @@ -272,12 +271,11 @@ } /** @type !Array<string> */ - const successfullyLoaded = - images.map(image => unguessableTokenToString(image.id)).filter(key => { - const doneLoading = imageDataLoading[key] === false; - const success = !!imageData[key]; - return success && doneLoading; - }); + const successfullyLoaded = images.map(image => image.path).filter(key => { + const doneLoading = imageDataLoading[key] === false; + const success = !!imageData[key]; + return success && doneLoading; + }); /** * @return {boolean} @@ -289,23 +287,40 @@ return didLoadMaximum || // No more images to load so send now even if some failed. - images.every( - image => imageDataLoading[unguessableTokenToString(image.id)] === - false); + images.every(image => imageDataLoading[image.path] === false); }; if (shouldSendImageData()) { + // Also send information about which images failed to load. This is + // necessary to decide whether to show loading animation or failure svg + // while updating local images. + const failures = images.map(image => image.path) + .filter(key => { + const doneLoading = + imageDataLoading[key] === false; + const failure = imageData[key] === ''; + return failure && doneLoading; + }) + .reduce((result, key) => { + // Empty string means that this image failed to + // load. + result[key] = ''; + return result; + }, {}); + const data = successfullyLoaded.filter((_, i) => i < kMaximumLocalImagePreviews) .reduce((result, key) => { result[key] = imageData[key]; return result; - }, {}); + }, failures); + + this.didSendLocalImageData_ = true; + const iframe = await this.iframePromise_; sendLocalImageDataFunction( /** @type {!Window} */ (iframe.contentWindow), data); - this.didSendLocalImageData_ = true; } } }
diff --git a/chromeos/components/personalization_app/resources/untrusted/collections_grid.js b/chromeos/components/personalization_app/resources/untrusted/collections_grid.js index ebbc91a7..4b0ef87 100644 --- a/chromeos/components/personalization_app/resources/untrusted/collections_grid.js +++ b/chromeos/components/personalization_app/resources/untrusted/collections_grid.js
@@ -8,7 +8,7 @@ import {afterNextRender, html, PolymerElement} from 'chrome-untrusted://personalization/polymer/v3_0/polymer/polymer_bundled.min.js'; import {EventType, kMaximumLocalImagePreviews} from '../common/constants.js'; import {selectCollection, selectLocalCollection, validateReceivedData} from '../common/iframe_api.js'; -import {getLoadingPlaceholderAnimationDelay, isSelectionEvent, unguessableTokenToString} from '../common/utils.js'; +import {getLoadingPlaceholderAnimationDelay, isSelectionEvent} from '../common/utils.js'; /** * @fileoverview Responds to |SendCollectionsEvent| from trusted. Handles user @@ -88,7 +88,7 @@ /** * - * @param {?Array<!chromeos.personalizationApp.mojom.LocalImage>} localImages + * @param {?Array<!mojoBase.mojom.FilePath>} localImages * @param {Object<string, string>} localImageData * @return {!Array<!url.mojom.Url>} */ @@ -96,30 +96,50 @@ if (!localImageData || !Array.isArray(localImages)) { return []; } - return localImages - .map(({id}) => ({url: localImageData[unguessableTokenToString(id)]})) - .filter((data, index) => { - // |data.url| may be undefined or empty if this local image thumbnail - // has not loaded yet. - return !!data.url && data.url.length > 0 && - index < kMaximumLocalImagePreviews; - }); + const result = []; + for (const {path} of localImages) { + const data = {url: localImageData[path]}; + if (!!data.url && data.url.length > 0) { + result.push(data); + } + // Add at most |kMaximumLocalImagePreviews| thumbnail urls. + if (result.length >= kMaximumLocalImagePreviews) { + break; + } + } + return result; } /** * A common display format between local images and WallpaperCollection. * Get the first displayable image with data from the list of possible images. - * @param {Array<!chromeos.personalizationApp.mojom.LocalImage>} localImages - * @param {Object<string, string>} localImageData - * @return {!ImageTile} + * @param {!Array<!mojoBase.mojom.FilePath>} localImages + * @param {!Object<string, string>} localImageData + * @return {!ImageTile|!LoadingTile} */ function getLocalTile(localImages, localImageData) { - const name = loadTimeData.getString('myImagesLabel'); + const isMoreToLoad = + localImages.some(({path}) => !localImageData.hasOwnProperty(path)); + const imagesToDisplay = getImages(localImages, localImageData); + + if (imagesToDisplay.length < kMaximumLocalImagePreviews && isMoreToLoad) { + // If there are more images to attempt loading thumbnails for, wait until + // those are done. + return {type: TileType.loading}; + } + + // Count all images that failed to load and subtract them from "My Images" + // count. + const failureCount = Object.values(localImageData).reduce((result, next) => { + return next === '' ? result + 1 : result; + }, 0); + return { - name, + name: loadTimeData.getString('myImagesLabel'), id: kLocalCollectionId, - count: getCountText(Array.isArray(localImages) ? localImages.length : 0), + count: getCountText( + Array.isArray(localImages) ? localImages.length - failureCount : 0), preview: imagesToDisplay, type: TileType.image, }; @@ -155,7 +175,7 @@ }, /** - * @type {Array<!chromeos.personalizationApp.mojom.LocalImage>} + * @type {Array<!mojoBase.mojom.FilePath>} * @private */ localImages_: { @@ -266,7 +286,7 @@ /** * Called with updated local image list or local image thumbnail data when * either of those properties changes. - * @param {?Array<!chromeos.personalizationApp.mojom.LocalImage>} localImages + * @param {?Array<!mojoBase.mojom.FilePath>} localImages * @param {Object<string, string>} localImageData * @private */ @@ -305,6 +325,7 @@ } catch (e) { console.warn('Invalid local images received', e); this.localImages_ = []; + this.localImageData_ = {}; } break; case EventType.SEND_LOCAL_IMAGE_DATA: @@ -313,6 +334,7 @@ validateReceivedData(message, EventType.SEND_LOCAL_IMAGE_DATA); } catch (e) { console.warn('Invalid local image data received', e); + this.localImages_ = []; this.localImageData_ = {}; } break;
diff --git a/chromeos/components/personalization_app/test/fake_personalization_app_ui_delegate.cc b/chromeos/components/personalization_app/test/fake_personalization_app_ui_delegate.cc index afdeeb9..dd1dde3 100644 --- a/chromeos/components/personalization_app/test/fake_personalization_app_ui_delegate.cc +++ b/chromeos/components/personalization_app/test/fake_personalization_app_ui_delegate.cc
@@ -64,7 +64,7 @@ } void FakePersonalizationAppUiDelegate::GetLocalImageThumbnail( - const base::UnguessableToken& id, + const base::FilePath& path, GetLocalImageThumbnailCallback callback) { std::move(callback).Run(std::string()); } @@ -80,7 +80,7 @@ } void FakePersonalizationAppUiDelegate::SelectLocalImage( - const base::UnguessableToken& token, + const base::FilePath& path, SelectLocalImageCallback callback) { std::move(callback).Run(/*success=*/true); }
diff --git a/chromeos/components/personalization_app/test/fake_personalization_app_ui_delegate.h b/chromeos/components/personalization_app/test/fake_personalization_app_ui_delegate.h index fdf0e5a..fcaadc7 100644 --- a/chromeos/components/personalization_app/test/fake_personalization_app_ui_delegate.h +++ b/chromeos/components/personalization_app/test/fake_personalization_app_ui_delegate.h
@@ -42,7 +42,7 @@ void GetLocalImages(GetLocalImagesCallback callback) override; - void GetLocalImageThumbnail(const base::UnguessableToken& id, + void GetLocalImageThumbnail(const base::FilePath& path, GetLocalImageThumbnailCallback callback) override; void SetWallpaperObserver( @@ -53,7 +53,7 @@ void SelectWallpaper(uint64_t image_asset_id, SelectWallpaperCallback callback) override; - void SelectLocalImage(const base::UnguessableToken& token, + void SelectLocalImage(const base::FilePath& path, SelectLocalImageCallback callback) override; void SetCustomWallpaperLayout(ash::WallpaperLayout layout) override;
diff --git a/chromeos/components/projector_app/resources/BUILD.gn b/chromeos/components/projector_app/resources/BUILD.gn index f68e7bd..1e80131 100644 --- a/chromeos/components/projector_app/resources/BUILD.gn +++ b/chromeos/components/projector_app/resources/BUILD.gn
@@ -101,6 +101,7 @@ input_files = [ "annotator/annotator.html", "annotator/untrusted/untrusted_annotator_comm_factory.js", + "app/index.html", "app/untrusted/untrusted_app_comm_factory.js", ]
diff --git a/chromeos/components/projector_app/resources/app/embedder.js b/chromeos/components/projector_app/resources/app/embedder.js index 50d8764..ec3cc94 100644 --- a/chromeos/components/projector_app/resources/app/embedder.js +++ b/chromeos/components/projector_app/resources/app/embedder.js
@@ -37,8 +37,13 @@ let client = AppTrustedCommFactory.getPostMessageAPIClient(); - this.addWebUIListener('onCanStartNewSession', (canStart) => { - client.onCanStartNewSession(canStart); + this.addWebUIListener('onNewScreencastPreconditionChanged', (canStart) => { + if (typeof canStart !== "boolean") { + console.error( + 'Invalid argument to onNewScreencastPreconditionChanged', canStart); + return; + } + client.onNewScreencastPreconditionChanged(canStart); }); }, });
diff --git a/chromeos/components/projector_app/resources/app/index.html b/chromeos/components/projector_app/resources/app/index.html new file mode 100644 index 0000000..854f176 --- /dev/null +++ b/chromeos/components/projector_app/resources/app/index.html
@@ -0,0 +1,15 @@ +<!-- +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. +--> + +<!DOCTYPE html> +<html> + <head> + <script type="module" src="./untrusted/untrusted_app_comm_factory.js"></script> + <script type="module" src="../app_bin.js"></script> + </head> + <body> + </body> +</html>
diff --git a/chromeos/components/projector_app/resources/app/trusted/trusted_app_comm_factory.js b/chromeos/components/projector_app/resources/app/trusted/trusted_app_comm_factory.js index bbf38b5..c335747 100644 --- a/chromeos/components/projector_app/resources/app/trusted/trusted_app_comm_factory.js +++ b/chromeos/components/projector_app/resources/app/trusted/trusted_app_comm_factory.js
@@ -24,8 +24,8 @@ * @param {!boolean} canStart * @return {Promise<boolean>} */ - onCanStartNewSession(canStart) { - return this.callApiFn('onCanStartNewSession', [canStart]); + onNewScreencastPreconditionChanged(canStart) { + return this.callApiFn('onNewScreencastPreconditionChanged', [canStart]); } }
diff --git a/chromeos/components/projector_app/resources/app/untrusted/untrusted_app_comm_factory.js b/chromeos/components/projector_app/resources/app/untrusted/untrusted_app_comm_factory.js index 8090c32..da031a5 100644 --- a/chromeos/components/projector_app/resources/app/untrusted/untrusted_app_comm_factory.js +++ b/chromeos/components/projector_app/resources/app/untrusted/untrusted_app_comm_factory.js
@@ -7,6 +7,15 @@ const TARGET_URL = 'chrome://projector/' +/** + * Returns the projector app element inside this current DOM. + * @return {projectorApp.AppApi} + */ +function getAppElement() { + return /** @type {projectorApp.AppApi} */ ( + document.querySelector('projector-app')); +} + // A client that sends notification to the chrome://projector embedder. export class TrustedAppClient extends PostMessageAPIClient { /** @@ -78,10 +87,14 @@ super(null, TARGET_URL, TARGET_URL); this.targetWindow_ = parentWindow; - this.registerMethod('onCanStartNewSession', (canStart) => { - // TODO(b/196245932) Call into the projector app externs to notify it on - // whether it can start a new session. - return true; + this.registerMethod('onNewScreencastPreconditionChanged', (canStart) => { + if (canStart.length !== 1 || typeof canStart[0] !== "boolean") { + console.error( + 'Invalid argument to onNewScreencastPreconditionChanged', canStart); + return; + } + + getAppElement().onNewScreencastPreconditionChanged(canStart[0]); }); } @@ -110,7 +123,9 @@ AppUntrustedCommFactory.requestHandler_ = new UntrustedAppRequestHandler(window.parent); - } + + getAppElement().setClientDelegate(AppUntrustedCommFactory.client_); +} /** * In order to use this class, please do the following (e.g. to check if it is
diff --git a/chromeos/components/projector_app/untrusted_projector_ui_config.cc b/chromeos/components/projector_app/untrusted_projector_ui_config.cc index d9e8a56..0849763 100644 --- a/chromeos/components/projector_app/untrusted_projector_ui_config.cc +++ b/chromeos/components/projector_app/untrusted_projector_ui_config.cc
@@ -31,7 +31,8 @@ source->AddResourcePaths( base::make_span(kChromeosProjectorAppBundleResources, kChromeosProjectorAppBundleResourcesSize)); - source->AddResourcePath("", IDR_PROJECTOR_APP_INDEX_HTML); + source->AddResourcePath("", + IDR_CHROMEOS_PROJECTOR_APP_UNTRUSTED_APP_INDEX_HTML); // Allows WebUI resources like Polymer and PostMessageAPI to be accessible // inside the untrusted iframe.
diff --git a/chromeos/dbus/shill/shill_client_helper.cc b/chromeos/dbus/shill/shill_client_helper.cc index 5dfaf2c0..ab8f8f4 100644 --- a/chromeos/dbus/shill/shill_client_helper.cc +++ b/chromeos/dbus/shill/shill_client_helper.cc
@@ -415,7 +415,7 @@ // expects a string -> string dictionary. dbus::MessageWriter variant_writer(nullptr); writer->OpenVariant("a{ss}", &variant_writer); - AppendStringDictionary(value, writer); + AppendStringDictionary(value, &variant_writer); writer->CloseContainer(&variant_writer); } else { dbus::MessageWriter variant_writer(nullptr);
diff --git a/chromeos/network/managed_network_configuration_handler_impl.cc b/chromeos/network/managed_network_configuration_handler_impl.cc index 6c0b6e4..5765fc0 100644 --- a/chromeos/network/managed_network_configuration_handler_impl.cc +++ b/chromeos/network/managed_network_configuration_handler_impl.cc
@@ -695,6 +695,12 @@ else user_policy_applied_ = true; + // Call UpdateBlockedCellularNetworks when either device policy applied or + // user policy applied so that so that unmanaged cellular networks are + // blocked correctly if the policy appears in either. + network_state_handler_->UpdateBlockedCellularNetworks( + AllowOnlyPolicyCellularNetworks()); + if (device_policy_applied_ && user_policy_applied_) { network_state_handler_->UpdateBlockedWifiNetworks( AllowOnlyPolicyWiFiToConnect(),
diff --git a/chromeos/network/managed_network_configuration_handler_unittest.cc b/chromeos/network/managed_network_configuration_handler_unittest.cc index bb880d61..b09cb5cb 100644 --- a/chromeos/network/managed_network_configuration_handler_unittest.cc +++ b/chromeos/network/managed_network_configuration_handler_unittest.cc
@@ -986,20 +986,20 @@ } TEST_F(ManagedNetworkConfigurationHandlerTest, - AllowOnlyPolicyCellularNetworks) { + AllowOnlyPolicyCellularNetworksToConnect) { InitializeStandardProfiles(); + InitializeEuicc(); // Check transfer to NetworkStateHandler - EXPECT_CALL( - *network_state_handler_, - UpdateBlockedWifiNetworks(false, false, std::vector<std::string>())) + EXPECT_CALL(*network_state_handler_, UpdateBlockedCellularNetworks(true)) .Times(1); - // Set 'AllowOnlyPolicyCellularNetworks' policy and another arbitrary user + // Set 'AllowOnlyPolicyCellularNetworks' policy and another arbitrary cellular // policy. SetPolicy(::onc::ONC_SOURCE_DEVICE_POLICY, std::string(), "policy/policy_allow_only_policy_cellular_networks.onc"); - SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc"); + SetPolicy(::onc::ONC_SOURCE_DEVICE_POLICY, std::string(), + "policy/policy_cellular.onc"); base::RunLoop().RunUntilIdle(); // Check ManagedNetworkConfigurationHandler policy accessors.
diff --git a/chromeos/network/mock_network_state_handler.h b/chromeos/network/mock_network_state_handler.h index 4dd07290..445507e2 100644 --- a/chromeos/network/mock_network_state_handler.h +++ b/chromeos/network/mock_network_state_handler.h
@@ -26,6 +26,8 @@ // NetworkStateHandler overrides MOCK_METHOD3(UpdateBlockedWifiNetworks, void(bool, bool, const std::vector<std::string>&)); + + MOCK_METHOD1(UpdateBlockedCellularNetworks, void(bool)); }; } // namespace chromeos
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc index 3c4518d..6b65464 100644 --- a/chromeos/network/network_state_handler.cc +++ b/chromeos/network/network_state_handler.cc
@@ -173,6 +173,15 @@ shill_property_handler_->Init(); } +void NetworkStateHandler::UpdateBlockedCellularNetworks(bool only_managed) { + if (allow_only_policy_cellular_networks_to_connect_ == only_managed) { + return; + } + allow_only_policy_cellular_networks_to_connect_ = only_managed; + + UpdateBlockedNetworksInternal(NetworkTypePattern::Cellular()); +} + void NetworkStateHandler::UpdateBlockedWifiNetworks( bool only_managed, bool available_only, @@ -187,7 +196,7 @@ allow_only_policy_wifi_networks_to_connect_if_available_ = available_only; blocked_hex_ssids_ = blocked_hex_ssids; - UpdateBlockedWifiNetworksInternal(); + UpdateBlockedNetworksInternal(NetworkTypePattern::WiFi()); } const NetworkState* NetworkStateHandler::GetAvailableManagedWifiNetwork() @@ -1020,14 +1029,22 @@ } bool NetworkStateHandler::UpdateBlockedByPolicy(NetworkState* network) const { - if (!TypeMatches(network, NetworkTypePattern::WiFi())) + bool is_wifi_type = TypeMatches(network, NetworkTypePattern::WiFi()); + bool is_cellular_type = TypeMatches(network, NetworkTypePattern::Cellular()); + if (!is_wifi_type && !is_cellular_type) return false; bool prev_blocked_by_policy = network->blocked_by_policy(); - bool blocked_by_policy = - !network->IsManagedByPolicy() && - (OnlyManagedWifiNetworksAllowed() || - base::Contains(blocked_hex_ssids_, network->GetHexSsid())); + bool blocked_by_policy = false; + if (is_wifi_type) { + blocked_by_policy = + !network->IsManagedByPolicy() && + (OnlyManagedWifiNetworksAllowed() || + base::Contains(blocked_hex_ssids_, network->GetHexSsid())); + } else { + blocked_by_policy = !network->IsManagedByPolicy() && + allow_only_policy_cellular_networks_to_connect_; + } network->set_blocked_by_policy(blocked_by_policy); return prev_blocked_by_policy != blocked_by_policy; } @@ -1053,15 +1070,16 @@ if (prev_available_managed_network_path != available_managed_network_path) { device->set_available_managed_network_path(available_managed_network_path); - UpdateBlockedWifiNetworksInternal(); + UpdateBlockedNetworksInternal(NetworkTypePattern::WiFi()); NotifyDevicePropertiesUpdated(device); } } -void NetworkStateHandler::UpdateBlockedWifiNetworksInternal() { +void NetworkStateHandler::UpdateBlockedNetworksInternal( + const NetworkTypePattern& network_type) { for (auto iter = network_list_.begin(); iter != network_list_.end(); ++iter) { NetworkState* network = (*iter)->AsNetworkState(); - if (!network->Matches(NetworkTypePattern::WiFi())) + if (!network->Matches(network_type)) continue; if (UpdateBlockedByPolicy(network)) NotifyNetworkPropertiesUpdated(network); @@ -1395,7 +1413,8 @@ if (network->path() == default_network_path_) default_network_is_metered_ = metered && network->IsConnectedState(); - if (network->Matches(NetworkTypePattern::WiFi())) + if (network->Matches(NetworkTypePattern::WiFi() | + NetworkTypePattern::Cellular())) network_property_updated |= UpdateBlockedByPolicy(network); network_property_updated |= network->InitialPropertiesReceived(properties);
diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h index a257018..25c9c5af 100644 --- a/chromeos/network/network_state_handler.h +++ b/chromeos/network/network_state_handler.h
@@ -423,14 +423,19 @@ void SetDeviceStateUpdatedForTest(const std::string& device_path); - // Sets |allow_only_policy_networks_to_connect_|, - // |allow_only_policy_networks_to_connect_if_available_| and - // |blocked_hex_ssids_| and calls |UpdateBlockedWifiNetworksInternal()|. + // Sets |allow_only_policy_wifi_networks_to_connect_|, + // |allow_only_policy_wifi_networks_to_connect_if_available_| and + // |blocked_hex_ssids_| and calls + // |UpdateBlockedNetworksInternal(NetworkTypePattern::Wifi())|. virtual void UpdateBlockedWifiNetworks( bool only_managed, bool available_only, const std::vector<std::string>& blocked_hex_ssids); + // Sets |allow_only_policy_cellular_networks_to_connect_| and + // calls |UpdateBlockedNetworksInternal(NetworkTypePattern::Cellular())| + virtual void UpdateBlockedCellularNetworks(bool only_managed); + // Returns the NetworkState associated to the wifi device's // available_managed_network_path or |nullptr| if no managed network is // available. @@ -532,10 +537,13 @@ typedef std::map<std::string, std::string> SpecifierGuidMap; friend class NetworkStateHandlerTest; FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, NetworkStateHandlerStub); - FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, BlockedByPolicyBlocked); - FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, BlockedByPolicyOnlyManaged); + FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, BlockedWifiByPolicyBlocked); FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, - BlockedByPolicyOnlyManagedIfAvailable); + BlockedWifiByPolicyOnlyManaged); + FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, + BlockedCellularByPolicyOnlyManaged); + FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, + BlockedWifiByPolicyOnlyManagedIfAvailable); FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, SyncStubCellularNetworks); FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, GetNetworkListAfterUpdateManagedList); @@ -684,11 +692,12 @@ // Updates the device's |managed_network_available_| depending on the list of // networks associated with this device. Calls - // |UpdateBlockedWifiNetworksInternal()| if the availability changed. + // |UpdateBlockedNetworksInternal(NetworkTypePattern::Wifi())| if the + // availability changed. void UpdateManagedWifiNetworkAvailable(); - // Calls |UpdateBlockedByPolicy()| for each wifi network. - void UpdateBlockedWifiNetworksInternal(); + // Calls |UpdateBlockedByPolicy()| for each given |network_type| network. + void UpdateBlockedNetworksInternal(const NetworkTypePattern& network_type); // Sets properties associated with the default network, currently the path and // Metered. @@ -763,10 +772,11 @@ // Ensure that we do not delete any networks while notifying observers. bool notifying_network_observers_ = false; - // Policies which control WiFi blocking (Controlled from + // Policies which control WiFi and Cellular blocking (Controlled from // |ManagedNetworkConfigurationHandler| by calling |UpdateBlockedNetworks()|). bool allow_only_policy_wifi_networks_to_connect_ = false; bool allow_only_policy_wifi_networks_to_connect_if_available_ = false; + bool allow_only_policy_cellular_networks_to_connect_ = false; std::vector<std::string> blocked_hex_ssids_; // After login the user's saved networks get updated asynchronously from
diff --git a/chromeos/network/network_state_handler_unittest.cc b/chromeos/network/network_state_handler_unittest.cc index c84b584..1b932b57 100644 --- a/chromeos/network/network_state_handler_unittest.cc +++ b/chromeos/network/network_state_handler_unittest.cc
@@ -2305,7 +2305,7 @@ EXPECT_EQ(1u, test_observer_->network_list_changed_count()); } -TEST_F(NetworkStateHandlerTest, BlockedByPolicyBlocked) { +TEST_F(NetworkStateHandlerTest, BlockedWifiByPolicyBlocked) { NetworkState* wifi1 = network_state_handler_->GetModifiableNetworkState( kShillManagerClientStubDefaultWifi); NetworkState* wifi2 = network_state_handler_->GetModifiableNetworkState( @@ -2342,7 +2342,7 @@ EXPECT_FALSE(wifi2->blocked_by_policy()); } -TEST_F(NetworkStateHandlerTest, BlockedByPolicyOnlyManaged) { +TEST_F(NetworkStateHandlerTest, BlockedWifiByPolicyOnlyManaged) { NetworkState* wifi1 = network_state_handler_->GetModifiableNetworkState( kShillManagerClientStubDefaultWifi); NetworkState* wifi2 = network_state_handler_->GetModifiableNetworkState( @@ -2376,7 +2376,44 @@ EXPECT_TRUE(wifi2->blocked_by_policy()); } -TEST_F(NetworkStateHandlerTest, BlockedByPolicyOnlyManagedIfAvailable) { +TEST_F(NetworkStateHandlerTest, BlockedCellularByPolicyOnlyManaged) { + const char kTestCellularServicePath2[] = "test_cellular_service_path2"; + const char kTestCellularServiceGuid2[] = "test_cellular_guid2"; + const char kTestCellularServiceName2[] = "test_cellular2"; + AddService(kTestCellularServicePath2, kTestCellularServiceGuid2, + kTestCellularServiceName2, shill::kTypeCellular, + shill::kStateIdle); + base::RunLoop().RunUntilIdle(); + + NetworkState* cellular1 = network_state_handler_->GetModifiableNetworkState( + kShillManagerClientStubCellular); + NetworkState* cellular2 = network_state_handler_->GetModifiableNetworkState( + kTestCellularServicePath2); + EXPECT_FALSE(cellular1->IsManagedByPolicy()); + EXPECT_FALSE(cellular1->blocked_by_policy()); + EXPECT_FALSE(cellular2->IsManagedByPolicy()); + EXPECT_FALSE(cellular2->blocked_by_policy()); + + network_state_handler_->UpdateBlockedCellularNetworks(true); + + EXPECT_TRUE(cellular1->blocked_by_policy()); + EXPECT_TRUE(cellular2->blocked_by_policy()); + + // Emulate 'cellular1' being a managed network. + std::unique_ptr<NetworkUIData> ui_data = + NetworkUIData::CreateFromONC(::onc::ONCSource::ONC_SOURCE_DEVICE_POLICY); + base::Value properties(base::Value::Type::DICTIONARY); + properties.SetKey(shill::kProfileProperty, base::Value(kProfilePath)); + properties.SetKey(shill::kUIDataProperty, base::Value(ui_data->GetAsJson())); + SetProperties(cellular1, properties); + + EXPECT_TRUE(cellular1->IsManagedByPolicy()); + EXPECT_FALSE(cellular1->blocked_by_policy()); + EXPECT_FALSE(cellular2->IsManagedByPolicy()); + EXPECT_TRUE(cellular2->blocked_by_policy()); +} + +TEST_F(NetworkStateHandlerTest, BlockedWifiByPolicyOnlyManagedIfAvailable) { NetworkState* wifi1 = network_state_handler_->GetModifiableNetworkState( kShillManagerClientStubDefaultWifi); NetworkState* wifi2 = network_state_handler_->GetModifiableNetworkState(
diff --git a/chromeos/services/bluetooth_config/device_pairing_handler.cc b/chromeos/services/bluetooth_config/device_pairing_handler.cc index 39d06f6..39002a0 100644 --- a/chromeos/services/bluetooth_config/device_pairing_handler.cc +++ b/chromeos/services/bluetooth_config/device_pairing_handler.cc
@@ -43,18 +43,17 @@ DevicePairingHandler::~DevicePairingHandler() = default; -void DevicePairingHandler::CancelPairing(mojom::PairingResult result) { +void DevicePairingHandler::CancelPairing() { device::BluetoothDevice* device = FindDevice(current_pairing_device_id_); - if (device) { - device->CancelPairing(); - } else { + if (!device) { BLUETOOTH_LOG(ERROR) << "Could not cancel pairing for device to due device no longer being " "found, identifier: " << current_pairing_device_id_; + FinishCurrentPairingRequest(mojom::PairingResult::kAuthFailed); + return; } - - FinishCurrentPairingRequest(result); + device->CancelPairing(); } void DevicePairingHandler::NotifyFinished() { @@ -102,10 +101,8 @@ current_pairing_device_id_ = device_id; device->Connect( - /*delegate=*/this, - base::BindOnce(&DevicePairingHandler::OnDeviceConnect, - weak_ptr_factory_.GetWeakPtr(), device->GetAddress(), - device->GetDeviceType())); + /*delegate=*/this, base::BindOnce(&DevicePairingHandler::OnDeviceConnect, + weak_ptr_factory_.GetWeakPtr())); } void DevicePairingHandler::RequestPinCode(device::BluetoothDevice* device) { @@ -165,12 +162,10 @@ return; // If Bluetooth disables while we are attempting to pair, cancel the pairing. - CancelPairing(mojom::PairingResult::kNonAuthFailure); + CancelPairing(); } void DevicePairingHandler::OnDeviceConnect( - const std::string& address, - device::BluetoothDeviceType device_type, absl::optional<device::BluetoothDevice::ConnectErrorCode> error_code) { if (!error_code.has_value()) { FinishCurrentPairingRequest(mojom::PairingResult::kSuccess); @@ -240,7 +235,7 @@ } // If string to uint32_t conversion was unsuccessful, cancel the pairing. - CancelPairing(mojom::PairingResult::kAuthFailed); + CancelPairing(); } void DevicePairingHandler::OnConfirmPairing(bool confirmed) { @@ -270,9 +265,9 @@ // If the delegate disconnects and we have a pairing attempt, cancel the // pairing. if (!current_pairing_device_id_.empty()) - CancelPairing(mojom::PairingResult::kNonAuthFailure); + CancelPairing(); - NotifyFinished(); + delegate_.reset(); } bool DevicePairingHandler::IsBluetoothEnabled() const {
diff --git a/chromeos/services/bluetooth_config/device_pairing_handler.h b/chromeos/services/bluetooth_config/device_pairing_handler.h index 9035718a..61e5572 100644 --- a/chromeos/services/bluetooth_config/device_pairing_handler.h +++ b/chromeos/services/bluetooth_config/device_pairing_handler.h
@@ -42,9 +42,9 @@ const std::string& device_id) const = 0; // Cancels the pairing attempt occurring with the device with identifier - // |current_pairing_device_id_| if it exists, then calls - // FinishCurrentPairingRequest(). - void CancelPairing(mojom::PairingResult result); + // |current_pairing_device_id_| if it exists. Cancelling an active pairing + // attempt will cause OnDeviceConnect() to fire with an error code. + void CancelPairing(); // Calls the finished_pairing_callback_ to indicate that this class should no // longer handle pairing requests. This is called at most once. @@ -79,8 +79,6 @@ // device::BluetoothDevice::Connect() callback. void OnDeviceConnect( - const std::string& address, - device::BluetoothDeviceType device_type, absl::optional<device::BluetoothDevice::ConnectErrorCode> error_code); // mojom::DevicePairingHandler method callbacks.
diff --git a/chromeos/services/bluetooth_config/device_pairing_handler_impl.cc b/chromeos/services/bluetooth_config/device_pairing_handler_impl.cc index b90520e..60f9326 100644 --- a/chromeos/services/bluetooth_config/device_pairing_handler_impl.cc +++ b/chromeos/services/bluetooth_config/device_pairing_handler_impl.cc
@@ -49,7 +49,7 @@ // If we have a pairing attempt and this class is destroyed, cancel the // pairing. if (!current_pairing_device_id().empty()) - CancelPairing(mojom::PairingResult::kNonAuthFailure); + CancelPairing(); NotifyFinished(); }
diff --git a/chromeos/services/bluetooth_config/device_pairing_handler_impl_unittest.cc b/chromeos/services/bluetooth_config/device_pairing_handler_impl_unittest.cc index 0c88ac0..2cd20d4 100644 --- a/chromeos/services/bluetooth_config/device_pairing_handler_impl_unittest.cc +++ b/chromeos/services/bluetooth_config/device_pairing_handler_impl_unittest.cc
@@ -121,8 +121,12 @@ })); ON_CALL(*mock_device, CancelPairing()) - .WillByDefault( - testing::Invoke([this]() { num_cancel_pairing_calls_++; })); + .WillByDefault(testing::Invoke([this]() { + num_cancel_pairing_calls_++; + std::move(connect_callback_) + .Run(device::BluetoothDevice::ConnectErrorCode:: + ERROR_AUTH_CANCELED); + })); ON_CALL(*mock_device, ConfirmPairing()) .WillByDefault( @@ -288,7 +292,8 @@ // Pairing should fail. EXPECT_TRUE(delegate->IsMojoPipeConnected()); - EXPECT_EQ(pairing_result(), mojom::PairingResult::kNonAuthFailure); + EXPECT_EQ(num_cancel_pairing_calls(), 1u); + EXPECT_EQ(pairing_result(), mojom::PairingResult::kAuthFailed); EXPECT_EQ(num_pairing_attempt_finished_calls(), 0u); } @@ -340,10 +345,30 @@ // CancelPairing() should be called since we had an active pairing. EXPECT_EQ(num_cancel_pairing_calls(), 1u); - EXPECT_EQ(pairing_result(), mojom::PairingResult::kNonAuthFailure); + EXPECT_EQ(pairing_result(), mojom::PairingResult::kAuthFailed); - // Disconnecting the pipe should call OnPairingAttemptFinished(). - EXPECT_EQ(num_pairing_attempt_finished_calls(), 1u); + // Disconnecting the pipe should not call OnPairingAttemptFinished(). + EXPECT_EQ(num_pairing_attempt_finished_calls(), 0u); +} + +TEST_F(DevicePairingHandlerImplTest, + DisconnectDelegateBeforeConnectFinishesDeviceNotFound) { + std::string device_id; + AddDevice(&device_id, AuthType::kNone); + + std::unique_ptr<FakeDevicePairingDelegate> delegate = PairDevice(device_id); + EXPECT_TRUE(HasPendingConnectCallback()); + ClearDevices(); + + delegate->DisconnectMojoPipe(); + + // CancelPairing() won't be called since the device won't be found. We should + // still return with a pairing result. + EXPECT_EQ(num_cancel_pairing_calls(), 0u); + EXPECT_EQ(pairing_result(), mojom::PairingResult::kAuthFailed); + + // Disconnecting the pipe should not call OnPairingAttemptFinished(). + EXPECT_EQ(num_pairing_attempt_finished_calls(), 0u); } TEST_F(DevicePairingHandlerImplTest, @@ -362,8 +387,8 @@ // CancelPairing() should not be called since we finished pairing. EXPECT_EQ(num_cancel_pairing_calls(), 0u); - // Disconnecting the pipe should call OnPairingAttemptFinished(). - EXPECT_EQ(num_pairing_attempt_finished_calls(), 1u); + // Disconnecting the pipe should not call OnPairingAttemptFinished(). + EXPECT_EQ(num_pairing_attempt_finished_calls(), 0u); } TEST_F(DevicePairingHandlerImplTest, PairDeviceNotFound) {
diff --git a/chromeos/services/bluetooth_config/fake_device_pairing_handler.cc b/chromeos/services/bluetooth_config/fake_device_pairing_handler.cc index 932ae6d7..fc17804 100644 --- a/chromeos/services/bluetooth_config/fake_device_pairing_handler.cc +++ b/chromeos/services/bluetooth_config/fake_device_pairing_handler.cc
@@ -19,7 +19,7 @@ // If we have a pairing attempt and this class is destroyed, cancel the // pairing. if (!current_pairing_device_id().empty()) - CancelPairing(mojom::PairingResult::kNonAuthFailure); + CancelPairing(); NotifyFinished(); }
diff --git a/components/autofill_assistant/browser/controller.cc b/components/autofill_assistant/browser/controller.cc index 462e5444..8a17973d 100644 --- a/components/autofill_assistant/browser/controller.cc +++ b/components/autofill_assistant/browser/controller.cc
@@ -2056,8 +2056,12 @@ return; } + bool is_user_initiated_or_back_forward = + !navigation_handle->IsRendererInitiated() || + navigation_handle->GetPageTransition() & ui::PAGE_TRANSITION_FORWARD_BACK; + if (state_ == AutofillAssistantState::STOPPED && - !navigation_handle->IsRendererInitiated() && + is_user_initiated_or_back_forward && !navigation_handle->WasServerRedirect()) { if (can_recover_from_stopped_) { // Usually when in STOPPED (e.g. through |OnScriptError|) the @@ -2085,23 +2089,24 @@ // In the last two cases, autofill assistant might still give up later on if // it discovers that the new page has no scripts. // - // Everything else, such as going back to a previous page, or refreshing the - // page is considered an end condition. If going back to a previous page is - // required, consider using the BROWSE state instead. + // Everything else, such as going back to a previous page (whether + // user-initiated or javascript-initiated), or refreshing the page is + // considered an end condition. If going back to a previous page is required, + // consider using the BROWSE state instead. if (state_ == AutofillAssistantState::PROMPT && web_contents()->GetLastCommittedURL().is_valid() && !navigation_handle->WasServerRedirect() && - !navigation_handle->IsRendererInitiated()) { + is_user_initiated_or_back_forward) { OnNavigationShutdownOrError(navigation_handle->GetURL(), Metrics::DropOutReason::NAVIGATION); return; } - // When in RUNNING state, all renderer initiated navigation is allowed, - // user initiated navigation will cause an error. + // When in RUNNING state, all renderer initiated navigation except + // back/forward is allowed, user initiated navigation will cause an error. if (state_ == AutofillAssistantState::RUNNING && !navigation_handle->WasServerRedirect() && - !navigation_handle->IsRendererInitiated()) { + is_user_initiated_or_back_forward) { OnNavigationShutdownOrError( navigation_handle->GetURL(), Metrics::DropOutReason::NAVIGATION_WHILE_RUNNING);
diff --git a/components/autofill_assistant/browser/controller_unittest.cc b/components/autofill_assistant/browser/controller_unittest.cc index c1d4a1d2..148b0ed 100644 --- a/components/autofill_assistant/browser/controller_unittest.cc +++ b/components/autofill_assistant/browser/controller_unittest.cc
@@ -1780,6 +1780,39 @@ content::NavigationSimulator::GoBack(web_contents()); } +TEST_F(ControllerTest, PromptStateStopsOnRendererInitiatedBack) { + SupportsScriptResponseProto script_response; + AddRunnableScript(&script_response, "runnable") + ->mutable_presentation() + ->set_autostart(true); + ActionsResponseProto runnable_script; + auto* prompt = runnable_script.add_actions()->mutable_prompt(); + prompt->set_browse_mode(false); + prompt->add_choices()->mutable_chip()->set_text("continue"); + SetupActionsForScript("runnable", runnable_script); + std::string response_str; + script_response.SerializeToString(&response_str); + EXPECT_CALL(*mock_service_, + OnGetScriptsForUrl(GURL("http://example.com/"), _, _)) + .WillOnce(RunOnceCallback<2>(net::HTTP_OK, response_str)); + + Start("http://example.com/"); + EXPECT_EQ(AutofillAssistantState::PROMPT, controller_->GetState()); + + SimulateNavigateToUrl(GURL("http://b.example.com/")); + EXPECT_EQ(AutofillAssistantState::PROMPT, controller_->GetState()); + + SimulateNavigateToUrl(GURL("http://c.example.com/")); + EXPECT_EQ(AutofillAssistantState::PROMPT, controller_->GetState()); + + // Go back, emulating a history navigation initiated from JS. + EXPECT_CALL(mock_client_, RecordDropOut(Metrics::DropOutReason::NAVIGATION)); + SetLastCommittedUrl(GURL("http://b.example.com")); + content::NavigationSimulator::CreateHistoryNavigation( + -1, web_contents(), true /* is_renderer_initiated */) + ->Commit(); +} + TEST_F(ControllerTest, UnexpectedNavigationDuringPromptAction_Tracking) { SupportsScriptResponseProto script_response; AddRunnableScript(&script_response, "runnable");
diff --git a/components/browsing_data/content/file_system_helper.cc b/components/browsing_data/content/file_system_helper.cc index 28583ec1..28c7974 100644 --- a/components/browsing_data/content/file_system_helper.cc +++ b/components/browsing_data/content/file_system_helper.cc
@@ -25,7 +25,7 @@ namespace storage { class FileSystemContext; -} +} // namespace storage namespace browsing_data { @@ -77,19 +77,17 @@ storage::FileSystemQuotaUtil* quota_util = filesystem_context_->GetQuotaUtil(type); DCHECK(quota_util); - std::vector<url::Origin> origins = - quota_util->GetOriginsForTypeOnFileTaskRunner(type); - for (const auto& current : origins) { - if (!HasWebScheme(current.GetURL())) + std::vector<blink::StorageKey> storage_keys = + quota_util->GetStorageKeysForTypeOnFileTaskRunner(type); + for (const auto& current : storage_keys) { + if (!HasWebScheme(current.origin().GetURL())) continue; // Non-websafe state is not considered browsing data. - // TODO(https://crbug.com/1247726): Refactor - // SandboxObfuscatedOriginEnumerator to use StorageKey instead of - // url::Origin and access those StorageKeys below. int64_t usage = quota_util->GetStorageKeyUsageOnFileTaskRunner( - filesystem_context_.get(), blink::StorageKey(current), type); + filesystem_context_.get(), current, type); auto inserted = file_system_info_map - .insert(std::make_pair(current.GetURL(), FileSystemInfo(current))) + .insert(std::make_pair(current.origin().GetURL(), + FileSystemInfo(current.origin()))) .first; inserted->second.usage_map[type] = usage; }
diff --git a/components/certificate_transparency/data/log_list.json b/components/certificate_transparency/data/log_list.json index 1e946aa..06e803ee 100644 --- a/components/certificate_transparency/data/log_list.json +++ b/components/certificate_transparency/data/log_list.json
@@ -1,6 +1,6 @@ { - "version": "3.37", - "log_list_timestamp": "2021-09-22T01:34:14Z", + "version": "3.40", + "log_list_timestamp": "2021-09-24T01:34:12Z", "operators": [ { "name": "Google",
diff --git a/components/component_updater/component_updater_command_line_config_policy.cc b/components/component_updater/component_updater_command_line_config_policy.cc index b3394e8..708dbb7 100644 --- a/components/component_updater/component_updater_command_line_config_policy.cc +++ b/components/component_updater/component_updater_command_line_config_policy.cc
@@ -25,9 +25,6 @@ // Speed up the initial component checking. const char kSwitchFastUpdate[] = "fast-update"; -// Add "testrequest=1" attribute to the update check request. -const char kSwitchTestRequestParam[] = "test-request"; - // Disables pings. Pings are the requests sent to the update server that report // the success or the failure of component install or update attempts. const char kSwitchDisablePings[] = "disable-pings"; @@ -68,6 +65,9 @@ } // namespace +// Add "testrequest=1" attribute to the update check request. +const char kSwitchTestRequestParam[] = "test-request"; + ComponentUpdaterCommandLineConfigPolicy:: ComponentUpdaterCommandLineConfigPolicy(const base::CommandLine* cmdline) { DCHECK(cmdline);
diff --git a/components/component_updater/component_updater_command_line_config_policy.h b/components/component_updater/component_updater_command_line_config_policy.h index 17606fe..2e7db70 100644 --- a/components/component_updater/component_updater_command_line_config_policy.h +++ b/components/component_updater/component_updater_command_line_config_policy.h
@@ -15,6 +15,8 @@ namespace component_updater { +extern const char kSwitchTestRequestParam[]; + // Component updater config policy implementation. class ComponentUpdaterCommandLineConfigPolicy final : public update_client::CommandLineConfigPolicy {
diff --git a/components/exo/client_controlled_shell_surface.cc b/components/exo/client_controlled_shell_surface.cc index d6a7e2a3..8d7e852 100644 --- a/components/exo/client_controlled_shell_surface.cc +++ b/components/exo/client_controlled_shell_surface.cc
@@ -346,7 +346,6 @@ int container, bool default_scale_cancellation) : ShellSurfaceBase(surface, gfx::Point(), can_minimize, container), - current_pin_(chromeos::WindowPinType::kNone), use_default_scale_cancellation_(default_scale_cancellation) { server_side_resize_ = true; } @@ -434,7 +433,6 @@ CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL); widget_->GetNativeWindow()->SetProperty(chromeos::kWindowPinTypeKey, type); - current_pin_ = type; } void ClientControlledShellSurface::SetSystemUiVisibility(bool autohide) { @@ -642,7 +640,6 @@ bool can_minimize, int container, bool default_scale_cancellation) { - current_pin_ = chromeos::WindowPinType::kNone; use_default_scale_cancellation_ = default_scale_cancellation; ShellSurfaceBase::RebindRootSurface(root_surface, can_minimize, container); }
diff --git a/components/exo/client_controlled_shell_surface.h b/components/exo/client_controlled_shell_surface.h index ff1a915..bc42303 100644 --- a/components/exo/client_controlled_shell_surface.h +++ b/components/exo/client_controlled_shell_surface.h
@@ -21,10 +21,6 @@ namespace ash { class NonClientFrameViewAsh; class WideFrameView; - -namespace mojom { -enum class WindowPinType; -} } // namespace ash namespace chromeos { @@ -331,8 +327,6 @@ SurfaceFrameType pending_frame_type_ = SurfaceFrameType::NONE; - chromeos::WindowPinType current_pin_; - bool can_maximize_ = true; std::unique_ptr<chromeos::ImmersiveFullscreenController>
diff --git a/components/exo/shell_surface_base.cc b/components/exo/shell_surface_base.cc index 0a4b2fe..f6417f15 100644 --- a/components/exo/shell_surface_base.cc +++ b/components/exo/shell_surface_base.cc
@@ -338,6 +338,13 @@ } ShellSurfaceBase::~ShellSurfaceBase() { + // If the surface was TrustedPinned, we have to unpin first as this might have + // locked down some system functions. + if (current_pinned_state_ == chromeos::WindowPinType::kTrustedPinned) { + pending_pinned_state_ = chromeos::WindowPinType::kNone; + UpdatePinned(); + } + // Close the overlay in case the window is deleted by the server. overlay_widget_.reset(); @@ -558,6 +565,38 @@ initial_workspace_.reset(); } +void ShellSurfaceBase::Pin(bool trusted) { + pending_pinned_state_ = trusted ? chromeos::WindowPinType::kTrustedPinned + : chromeos::WindowPinType::kPinned; + UpdatePinned(); +} + +void ShellSurfaceBase::Unpin() { + // Only need to do something when we have to set a pinned mode. + if (pending_pinned_state_ == chromeos::WindowPinType::kNone) + return; + + // Remove any pending pin states which might not have been applied yet. + pending_pinned_state_ = chromeos::WindowPinType::kNone; + UpdatePinned(); +} + +void ShellSurfaceBase::UpdatePinned() { + if (!widget_) { + // It is possible to get here before the widget has actually been created. + // The state will be set once the widget gets created. + return; + } + if (current_pinned_state_ != pending_pinned_state_) { + // TODO(crbug/1234010) - This will be done in follow up patch: call Ash to + // inform Ash of the change. + // ash::ShellDelegate* shell = ash::Shell::Get()->shell_delegate(); + // auto* window = widget_->GetNativeWindow(); + // shell->SetPinnedFromExo(window, pending_pinned_state_); + current_pinned_state_ = pending_pinned_state_; + } +} + void ShellSurfaceBase::SetChildAxTreeId(ui::AXTreeID child_ax_tree_id) { GetViewAccessibility().OverrideChildTreeID(child_ax_tree_id); this->NotifyAccessibilityEvent(ax::mojom::Event::kChildrenChanged, false); @@ -1177,6 +1216,9 @@ widget_->Init(std::move(params)); widget_->AddObserver(this); + // As setting the pinned mode may have come in earlier we apply it now. + UpdatePinned(); + aura::Window* window = widget_->GetNativeWindow(); window->SetName(base::StringPrintf("ExoShellSurface-%d", shell_id++)); window->AddChild(host_window());
diff --git a/components/exo/shell_surface_base.h b/components/exo/shell_surface_base.h index f9394c46..a4664d5 100644 --- a/components/exo/shell_surface_base.h +++ b/components/exo/shell_surface_base.h
@@ -12,6 +12,7 @@ #include "ash/display/window_tree_host_manager.h" #include "base/gtest_prod_util.h" #include "base/macros.h" +#include "chromeos/ui/base/window_pin_type.h" #include "components/exo/surface_observer.h" #include "components/exo/surface_tree_host.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -193,6 +194,8 @@ void MoveToDesk(int desk_index) override; void SetVisibleOnAllWorkspaces() override; void SetInitialWorkspace(const char* initial_workspace) override; + void Pin(bool trusted) override; + void Unpin() override; // SurfaceObserver: void OnSurfaceDestroying(Surface* surface) override; @@ -363,6 +366,8 @@ bool IsFrameDecorationSupported(SurfaceFrameType frame_type); + void UpdatePinned(); + aura::Window* parent_ = nullptr; bool activatable_ = true; bool can_minimize_ = true; @@ -391,6 +396,12 @@ bool skip_ime_processing_ = false; bool overlay_overlaps_frame_ = true; absl::optional<bool> overlay_can_resize_; + + // Pin members. + chromeos::WindowPinType current_pinned_state_ = + chromeos::WindowPinType::kNone; + chromeos::WindowPinType pending_pinned_state_ = + chromeos::WindowPinType::kNone; }; } // namespace exo
diff --git a/components/exo/sub_surface.h b/components/exo/sub_surface.h index 730a71f9..b5589f4 100644 --- a/components/exo/sub_surface.h +++ b/components/exo/sub_surface.h
@@ -81,6 +81,8 @@ void MoveToDesk(int desk_index) override {} void SetVisibleOnAllWorkspaces() override {} void SetInitialWorkspace(const char* initial_workspace) override {} + void Pin(bool trusted) override {} + void Unpin() override {} // Overridden from SurfaceObserver: void OnSurfaceDestroying(Surface* surface) override;
diff --git a/components/exo/surface.cc b/components/exo/surface.cc index 850eae0..05ffa08c 100644 --- a/components/exo/surface.cc +++ b/components/exo/surface.cc
@@ -1496,4 +1496,14 @@ delegate_->SetInitialWorkspace(initial_workspace); } +void Surface::Pin(bool trusted) { + if (delegate_) + delegate_->Pin(trusted); +} + +void Surface::Unpin() { + if (delegate_) + delegate_->Unpin(); +} + } // namespace exo
diff --git a/components/exo/surface.h b/components/exo/surface.h index 950f9391..c43cb1f 100644 --- a/components/exo/surface.h +++ b/components/exo/surface.h
@@ -382,6 +382,14 @@ // Sets the initial workspace to restore a window to the corresponding desk. void SetInitialWorkspace(const char* initial_workspace); + // Pins/locks a window to the screen so that the user cannot do anything + // else before the mode is released. If trusted is set, it is an invocation + // from a trusted app like a school test mode app. + void Pin(bool trusted); + + // Release the pinned mode and allows the user to do other things again. + void Unpin(); + private: struct State { State();
diff --git a/components/exo/surface_delegate.h b/components/exo/surface_delegate.h index a084869e..085ef29 100644 --- a/components/exo/surface_delegate.h +++ b/components/exo/surface_delegate.h
@@ -91,6 +91,14 @@ // corresponding desk. virtual void SetInitialWorkspace(const char* initial_workspace) = 0; + // Pins/locks a window to the screen so that the user cannot do anything + // else before the mode is released. If trusted is set, it is an invocation + // from a trusted app like a school test mode app. + virtual void Pin(bool trusted) = 0; + + // Releases the pinned mode and allows the user to do other things again. + virtual void Unpin() = 0; + protected: virtual ~SurfaceDelegate() {} };
diff --git a/components/exo/surface_tree_host.h b/components/exo/surface_tree_host.h index 7a0253b8..cb2d524 100644 --- a/components/exo/surface_tree_host.h +++ b/components/exo/surface_tree_host.h
@@ -113,6 +113,8 @@ void MoveToDesk(int desk_index) override {} void SetVisibleOnAllWorkspaces() override {} void SetInitialWorkspace(const char* initial_workspace) override {} + void Pin(bool trusted) override {} + void Unpin() override {} // display::DisplayObserver: void OnDisplayMetricsChanged(const display::Display& display,
diff --git a/components/exo/wayland/protocol/aura-shell.xml b/components/exo/wayland/protocol/aura-shell.xml index 51d652b..5118f0c 100644 --- a/components/exo/wayland/protocol/aura-shell.xml +++ b/components/exo/wayland/protocol/aura-shell.xml
@@ -24,7 +24,7 @@ DEALINGS IN THE SOFTWARE. </copyright> - <interface name="zaura_shell" version="24"> + <interface name="zaura_shell" version="25"> <description summary="aura_shell"> The global interface exposing aura shell capabilities is used to instantiate an interface extension for a wl_surface object. @@ -118,7 +118,7 @@ </event> </interface> - <interface name="zaura_surface" version="23"> + <interface name="zaura_surface" version="25"> <description summary="aura shell interface to a wl_surface"> An additional interface to a wl_surface object, which allows the client to access aura shell specific functionality for surface. @@ -444,6 +444,32 @@ </description> <arg name="initial_workspace" type="string" summary="intial workspace for restoring or '-1' for visible on all workspaces"/> </request> + + <!-- Version 25 additions --> + <request name="set_pin" since="25"> + <description summary="pin a window (trusted or not)"> + Requests that a window is pinned which means that the system does not allow + the user to leave the window until an exit criteria is met. + + This is a request to get the window pinned so that the user cannot get to any + other window / application. There are two modes: + A. trusted is 0 - which is slightly less restrictive and allows the user to + get out of the window by a predefined way of authentication. + B. trusted is not 0 in which case a trusted application was locking down the + system and needs to unlock. This is used for e.g. School tests. + </description> + <arg name="trusted" type="int" summary="0 for non trusted"/> + </request> + + <request name="unset_pin" since="25"> + <description summary="unpin a window"> + Requests that the user can leave a previously pinned window. + + This is a request to unpin a previously pinned window. It does not matter if + the window was locked with the trusted state or not. + </description> + </request> + </interface> <interface name="zaura_output" version="6">
diff --git a/components/exo/wayland/xdg_shell.cc b/components/exo/wayland/xdg_shell.cc index d85ed1d..7f61c4c 100644 --- a/components/exo/wayland/xdg_shell.cc +++ b/components/exo/wayland/xdg_shell.cc
@@ -297,8 +297,12 @@ wl_array_init(&states); if (state_type == chromeos::WindowStateType::kMaximized) AddState(&states, XDG_TOPLEVEL_STATE_MAXIMIZED); - if (state_type == chromeos::WindowStateType::kFullscreen) + // TODO(crbug/1250129): Pinned states need to be handled properly. + if (state_type == chromeos::WindowStateType::kFullscreen || + state_type == chromeos::WindowStateType::kPinned || + state_type == chromeos::WindowStateType::kTrustedPinned) { AddState(&states, XDG_TOPLEVEL_STATE_FULLSCREEN); + } if (resizing) AddState(&states, XDG_TOPLEVEL_STATE_RESIZING); if (activated)
diff --git a/components/exo/wayland/zaura_shell.cc b/components/exo/wayland/zaura_shell.cc index d162b14..1c506d2 100644 --- a/components/exo/wayland/zaura_shell.cc +++ b/components/exo/wayland/zaura_shell.cc
@@ -247,6 +247,16 @@ GetUserDataAs<AuraSurface>(resource)->SetInitialWorkspace(initial_workspace); } +void aura_surface_set_pin(wl_client* client, + wl_resource* resource, + int32_t trusted) { + GetUserDataAs<AuraSurface>(resource)->Pin(trusted); +} + +void aura_surface_unset_pin(wl_client* client, wl_resource* resource) { + GetUserDataAs<AuraSurface>(resource)->Unpin(); +} + const struct zaura_surface_interface aura_surface_implementation = { aura_surface_set_frame, aura_surface_set_parent, @@ -272,7 +282,9 @@ aura_surface_unset_pip, aura_surface_set_aspect_ratio, aura_surface_move_to_desk, - aura_surface_set_initial_workspace}; + aura_surface_set_initial_workspace, + aura_surface_set_pin, + aura_surface_unset_pin}; } // namespace @@ -580,6 +592,14 @@ surface_->SetInitialWorkspace(initial_workspace); } +void AuraSurface::Pin(bool trusted) { + surface_->Pin(trusted); +} + +void AuraSurface::Unpin() { + surface_->Unpin(); +} + namespace { ////////////////////////////////////////////////////////////////////////////////
diff --git a/components/exo/wayland/zaura_shell.h b/components/exo/wayland/zaura_shell.h index efecd699..4685a3c 100644 --- a/components/exo/wayland/zaura_shell.h +++ b/components/exo/wayland/zaura_shell.h
@@ -18,7 +18,7 @@ namespace exo { namespace wayland { -constexpr uint32_t kZAuraShellVersion = 24; +constexpr uint32_t kZAuraShellVersion = 25; // Adds bindings to the Aura Shell. Normally this implies Ash on ChromeOS // builds. On non-ChromeOS builds the protocol provides access to Aura windowing @@ -61,6 +61,8 @@ void SetAspectRatio(const gfx::SizeF& aspect_ratio); void MoveToDesk(int desk_index); void SetInitialWorkspace(const char* initial_workspace); + void Pin(bool trusted); + void Unpin(); // Overridden from SurfaceObserver: void OnSurfaceDestroying(Surface* surface) override;
diff --git a/components/exo/wayland/zaura_shell_unittest.cc b/components/exo/wayland/zaura_shell_unittest.cc index f34919d..ba30b9dc 100644 --- a/components/exo/wayland/zaura_shell_unittest.cc +++ b/components/exo/wayland/zaura_shell_unittest.cc
@@ -114,6 +114,8 @@ SetInitialWorkspace, (const char* initial_workspace), (override)); + MOCK_METHOD(void, Pin, (bool trusted), (override)); + MOCK_METHOD(void, Unpin, (), (override)); }; } // namespace @@ -370,6 +372,26 @@ aura_surface().SetFullscreenMode(ZAURA_SURFACE_FULLSCREEN_MODE_PLAIN); } +TEST_F(ZAuraSurfaceTest, CanPin) { + MockSurfaceDelegate delegate; + wl_resource resource; + resource.data = &aura_surface(); + surface().SetSurfaceDelegate(&delegate); + EXPECT_CALL(delegate, Pin(true)); + + aura_surface().Pin(true); +} + +TEST_F(ZAuraSurfaceTest, CanUnpin) { + MockSurfaceDelegate delegate; + wl_resource resource; + resource.data = &aura_surface(); + surface().SetSurfaceDelegate(&delegate); + EXPECT_CALL(delegate, Unpin()); + + aura_surface().Unpin(); +} + TEST_F(ZAuraSurfaceTest, CanSetFullscreenModeToImmersive) { MockSurfaceDelegate delegate; surface().SetSurfaceDelegate(&delegate);
diff --git a/components/feature_engagement/public/feature_constants.cc b/components/feature_engagement/public/feature_constants.cc index 52f5cef9..a153546 100644 --- a/components/feature_engagement/public/feature_constants.cc +++ b/components/feature_engagement/public/feature_constants.cc
@@ -41,7 +41,7 @@ const base::Feature kIPHDesktopSnoozeFeature{"IPH_DesktopSnoozeFeature", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kIPHDesktopPwaInstallFeature{ - "IPH_DesktopPwaInstall", base::FEATURE_DISABLED_BY_DEFAULT}; + "IPH_DesktopPwaInstall", base::FEATURE_ENABLED_BY_DEFAULT}; const base::Feature kIPHProfileSwitchFeature{"IPH_ProfileSwitch", base::FEATURE_ENABLED_BY_DEFAULT}; #endif // defined(OS_WIN) || defined(OS_APPLE) || defined(OS_LINUX) ||
diff --git a/components/optimization_guide/core/optimization_filter.cc b/components/optimization_guide/core/optimization_filter.cc index 798d514..ae79bd3 100644 --- a/components/optimization_guide/core/optimization_filter.cc +++ b/components/optimization_guide/core/optimization_filter.cc
@@ -6,6 +6,7 @@ #include <string> +#include "base/logging.h" #include "base/strings/string_util.h" namespace optimization_guide { @@ -78,7 +79,8 @@ std::string full_host(url.host()); int suffix_count = 1; auto left_pos = full_host.find_last_of('.'); // root domain position - while ((left_pos = full_host.find_last_of('.', left_pos - 1)) != + while ((left_pos - 1) != std::string::npos && + (left_pos = full_host.find_last_of('.', left_pos - 1)) != std::string::npos && suffix_count < kMaxSuffixCount) { if (full_host.length() - left_pos > kMinHostSuffix) {
diff --git a/components/optimization_guide/core/optimization_filter_unittest.cc b/components/optimization_guide/core/optimization_filter_unittest.cc index 854effb..297f8ee7 100644 --- a/components/optimization_guide/core/optimization_filter_unittest.cc +++ b/components/optimization_guide/core/optimization_filter_unittest.cc
@@ -131,6 +131,8 @@ // Note: full host will match even if less than min size. EXPECT_TRUE(opt_filter.Matches(GURL("https://xy.tv"))); + + EXPECT_FALSE(opt_filter.Matches(GURL("http://.../foo"))); } } // namespace
diff --git a/components/password_manager/content/browser/form_submission_tracker_util.cc b/components/password_manager/content/browser/form_submission_tracker_util.cc index 3631d1b..c5fc3c17 100644 --- a/components/password_manager/content/browser/form_submission_tracker_util.cc +++ b/components/password_manager/content/browser/form_submission_tracker_util.cc
@@ -17,12 +17,15 @@ // Password manager is interested in // - form submission navigations, - // - any JavaScript initiated navigations, because many form submissions are - // done with JavaScript. Password manager is not interested in + // - any JavaScript initiated navigations besides history navigations, because + // many form submissions are done with JavaScript. + // Password manager is not interested in // - browser initiated navigations (e.g. reload, bookmark click), // - hyperlink navigations. + // - session history navigations bool form_may_be_submitted = is_renderer_initiated && + !(transition & ui::PAGE_TRANSITION_FORWARD_BACK) && (ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_FORM_SUBMIT) || !was_initiated_by_link_click);
diff --git a/components/permissions/permission_uma_util.cc b/components/permissions/permission_uma_util.cc index 6cfe37e..304b6cd 100644 --- a/components/permissions/permission_uma_util.cc +++ b/components/permissions/permission_uma_util.cc
@@ -281,6 +281,8 @@ return "LocationBarRightStaticIcon"; case PermissionPromptDisposition::MINI_INFOBAR: return "MiniInfobar"; + case PermissionPromptDisposition::MESSAGE_UI: + return "MessageUI"; case PermissionPromptDisposition::MODAL_DIALOG: return "ModalDialog"; case PermissionPromptDisposition::NONE_VISIBLE:
diff --git a/components/permissions/permission_uma_util.h b/components/permissions/permission_uma_util.h index b4d8758..056f3a2 100644 --- a/components/permissions/permission_uma_util.h +++ b/components/permissions/permission_uma_util.h
@@ -160,6 +160,10 @@ // Only used on desktop, a less prominent version of chip on the left-hand // side of the location bar that shows a bubble when clicked. LOCATION_BAR_LEFT_QUIET_CHIP = 9, + + // Only used on Android, a message bubble near top of the screen and below the + // location bar. Message UI is an alternative UI to infobar UI. + MESSAGE_UI = 10, }; // The reason why the permission prompt disposition was used. Enum used in UKMs,
diff --git a/components/sync/base/user_selectable_type.cc b/components/sync/base/user_selectable_type.cc index d2eb1059..5f83c70 100644 --- a/components/sync/base/user_selectable_type.cc +++ b/components/sync/base/user_selectable_type.cc
@@ -199,6 +199,17 @@ return GetUserSelectableOsTypeInfo(type).type_name; } +std::string UserSelectableOsTypeSetToString(UserSelectableOsTypeSet types) { + std::string result; + for (UserSelectableOsType type : types) { + if (!result.empty()) { + result += ", "; + } + result += GetUserSelectableOsTypeName(type); + } + return result; +} + absl::optional<UserSelectableOsType> GetUserSelectableOsTypeFromString( const std::string& type) { if (type == kOsAppsTypeName) {
diff --git a/components/sync/base/user_selectable_type.h b/components/sync/base/user_selectable_type.h index f3bc37f..af6c500 100644 --- a/components/sync/base/user_selectable_type.h +++ b/components/sync/base/user_selectable_type.h
@@ -63,6 +63,7 @@ UserSelectableOsType::kLastType>; const char* GetUserSelectableOsTypeName(UserSelectableOsType type); +std::string UserSelectableOsTypeSetToString(UserSelectableOsTypeSet types); ModelTypeSet UserSelectableOsTypeToAllModelTypes(UserSelectableOsType type); ModelType UserSelectableOsTypeToCanonicalModelType(UserSelectableOsType type);
diff --git a/components/viz/service/display/external_use_client.h b/components/viz/service/display/external_use_client.h index 03d66579..c04b31b 100644 --- a/components/viz/service/display/external_use_client.h +++ b/components/viz/service/display/external_use_client.h
@@ -23,6 +23,10 @@ #include "third_party/skia/include/gpu/GrTypes.h" #include "ui/gfx/geometry/size.h" +namespace cc { +class PaintOpBuffer; +} + namespace viz { // DisplayResourceProvider takes ownership @@ -77,6 +81,16 @@ void SetImage(sk_sp<SkImage> image, GrBackendFormat backend_format); void clear_image() { image_.reset(); } const GrBackendFormat& backend_format() { return backend_format_; } + const cc::PaintOpBuffer* paint_op_buffer() const { + return paint_op_buffer_; + } + void set_paint_op_buffer(const cc::PaintOpBuffer* buffer) { + paint_op_buffer_ = buffer; + } + const absl::optional<SkColor>& clear_color() const { return clear_color_; } + void set_clear_color(const absl::optional<SkColor>& color) { + clear_color_ = color; + } private: gpu::MailboxHolder mailbox_holder_; @@ -95,6 +109,8 @@ // The promise image which is used on display thread. sk_sp<SkImage> image_; GrBackendFormat backend_format_; + const cc::PaintOpBuffer* paint_op_buffer_ = nullptr; + absl::optional<SkColor> clear_color_; }; // If |maybe_concurrent_reads| is true then there can be concurrent reads to
diff --git a/components/viz/service/display/skia_renderer.cc b/components/viz/service/display/skia_renderer.cc index 9f99b37..ab638f2 100644 --- a/components/viz/service/display/skia_renderer.cc +++ b/components/viz/service/display/skia_renderer.cc
@@ -607,9 +607,13 @@ ~ScopedSkImageBuilder() = default; const SkImage* sk_image() const { return sk_image_; } + const cc::PaintOpBuffer* paint_op_buffer() const { return paint_op_buffer_; } + const absl::optional<SkColor>& clear_color() const { return clear_color_; } private: const SkImage* sk_image_ = nullptr; + const cc::PaintOpBuffer* paint_op_buffer_ = nullptr; + absl::optional<SkColor> clear_color_; }; SkiaRenderer::ScopedSkImageBuilder::ScopedSkImageBuilder( @@ -639,10 +643,13 @@ image_context->set_alpha_type(alpha_type); image_context->set_origin(origin); } + skia_renderer->skia_output_surface_->MakePromiseSkImage(image_context); - LOG_IF(ERROR, !image_context->has_image()) - << "Failed to create the promise sk image."; + paint_op_buffer_ = image_context->paint_op_buffer(); + clear_color_ = image_context->clear_color(); sk_image_ = image_context->image().get(); + LOG_IF(ERROR, !image_context->has_image() && !paint_op_buffer_) + << "Failed to create the promise sk image or get paint ops."; } class SkiaRenderer::ScopedYUVSkImageBuilder { @@ -723,6 +730,9 @@ public: FrameResourceFence() = default; + FrameResourceFence(const FrameResourceFence&) = delete; + FrameResourceFence& operator=(const FrameResourceFence&) = delete; + // ResourceFence implementation. void Set() override { set_ = true; } bool HasPassed() override { return event_.IsSignaled(); } @@ -737,8 +747,6 @@ bool set_ = false; base::WaitableEvent event_; - - DISALLOW_COPY_AND_ASSIGN(FrameResourceFence); }; SkiaRenderer::SkiaRenderer(const RendererSettings* settings, @@ -833,14 +841,14 @@ } } - // Right now, only macOS needs to return mailboxes of released overlays, so - // we should not release |committed_overlay_locks_| here. The resources in it - // will be released by DidReceiveReleasedOverlays() later. -#if defined(OS_APPLE) + // Right now, only macOS and Ozone need to return mailboxes of released + // overlays, so we should not release |committed_overlay_locks_| here. The + // resources in it will be released by DidReceiveReleasedOverlays() later. +#if defined(OS_APPLE) || defined(USE_OZONE) for (auto& lock : committed_overlay_locks_) { awaiting_release_overlay_locks_.insert(std::move(lock)); } -#endif // defined(OS_APPLE) +#endif // defined(OS_APPLE) || defined(USE_OZONE) // Find all locks that have a read-lock fence associated with them. // If we have a release fence, it's not safe to release them here. @@ -869,8 +877,8 @@ void SkiaRenderer::DidReceiveReleasedOverlays( const std::vector<gpu::Mailbox>& released_overlays) { - // This method is only called on macOS right now. -#if defined(OS_APPLE) + // This method is only called on macOS and Ozone right now. +#if defined(OS_APPLE) || defined(USE_OZONE) for (const auto& mailbox : released_overlays) { auto it = awaiting_release_overlay_locks_.find(mailbox); if (it == awaiting_release_overlay_locks_.end()) { @@ -881,7 +889,7 @@ } #else NOTREACHED(); -#endif // !defined(OS_APPLE) +#endif // !(defined(OS_APPLE) || defined (USE_OZONE)) } bool SkiaRenderer::FlippedFramebuffer() const { @@ -1822,6 +1830,41 @@ constraint); } +void SkiaRenderer::DrawPaintOpBuffer(const cc::PaintOpBuffer* buffer, + const absl::optional<SkColor>& clear_color, + const TileDrawQuad* quad, + const DrawRPDQParams* rpdq_params, + const DrawQuadParams* params) { + if (!batched_quads_.empty()) + FlushBatchedQuads(); + + SkAutoCanvasRestore auto_canvas_restore(current_canvas_, true /* do_save */); + PrepareCanvas(params->scissor_rect, params->rounded_corner_bounds, + ¶ms->content_device_transform); + + float scale_x = params->rect.width() / quad->tex_coord_rect.width(); + float scale_y = params->rect.height() / quad->tex_coord_rect.height(); + + float offset_x = + params->visible_rect.x() - params->vis_tex_coords.x() * scale_x; + float offset_y = + params->visible_rect.y() - params->vis_tex_coords.y() * scale_y; + + auto visible_rect = gfx::RectFToSkRect(params->visible_rect); + current_canvas_->clipRect(visible_rect); + + DCHECK(!rpdq_params); + + if (clear_color) + current_canvas_->drawColor(*clear_color); + + current_canvas_->translate(offset_x, offset_y); + current_canvas_->scale(scale_x, scale_y); + + cc::PlaybackParams playback_params(nullptr, SkM44()); + buffer->Playback(current_canvas_, playback_params); +} + void SkiaRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad, DrawQuadParams* params) { DCHECK(batched_quads_.empty()); @@ -2109,12 +2152,20 @@ ScopedSkImageBuilder builder( this, quad->resource_id(), /*maybe_concurrent_reads=*/false, quad->is_premultiplied ? kPremul_SkAlphaType : kUnpremul_SkAlphaType); + + params->vis_tex_coords = cc::MathUtil::ScaleRectProportional( + quad->tex_coord_rect, gfx::RectF(quad->rect), params->visible_rect); + + if (builder.paint_op_buffer()) { + DrawPaintOpBuffer(builder.paint_op_buffer(), builder.clear_color(), quad, + rpdq_params, params); + return; + } + const SkImage* image = builder.sk_image(); if (!image) return; - params->vis_tex_coords = cc::MathUtil::ScaleRectProportional( - quad->tex_coord_rect, gfx::RectF(quad->rect), params->visible_rect); // When a tile is at the right or bottom edge of the entire tiled area, its // images won't be fully filled so use the unclipped texture coords. On // interior tiles or left/top tiles, the image has been filled with @@ -3099,7 +3150,7 @@ return delegated_ink_handler_ && delegated_ink_handler_->GetInkRenderer(); } -#if defined(OS_APPLE) +#if defined(OS_APPLE) || defined(USE_OZONE) bool SkiaRenderer::ScopedReadLockComparator::operator()( const DisplayResourceProviderSkia::ScopedReadLockSharedImage& lhs, const DisplayResourceProviderSkia::ScopedReadLockSharedImage& rhs) const { @@ -3117,6 +3168,6 @@ const DisplayResourceProviderSkia::ScopedReadLockSharedImage& rhs) const { return lhs < rhs.mailbox(); } -#endif // defined(OS_APPLE) +#endif // defined(OS_APPLE) || defined(USE_OZONE) } // namespace viz
diff --git a/components/viz/service/display/skia_renderer.h b/components/viz/service/display/skia_renderer.h index 4df9847..78b9e6f9 100644 --- a/components/viz/service/display/skia_renderer.h +++ b/components/viz/service/display/skia_renderer.h
@@ -196,6 +196,12 @@ SkPaint* paint, DrawQuadParams* params); + void DrawPaintOpBuffer(const cc::PaintOpBuffer* buffer, + const absl::optional<SkColor>& clear_color, + const TileDrawQuad* quad, + const DrawRPDQParams* rpdq_params, + const DrawQuadParams* params); + // RPDQ, DebugBorder and picture quads cannot be batched. They // either are not textures (debug, picture), or it's very likely // the texture will have advanced paint effects (rpdq). Additionally, they do @@ -336,7 +342,7 @@ std::vector<DisplayResourceProviderSkia::ScopedReadLockSharedImage>> read_lock_release_fence_overlay_locks_; -#if defined(OS_APPLE) +#if defined(OS_APPLE) || defined(USE_OZONE) class ScopedReadLockComparator { public: using is_transparent = void; @@ -357,7 +363,7 @@ base::flat_set<DisplayResourceProviderSkia::ScopedReadLockSharedImage, ScopedReadLockComparator> awaiting_release_overlay_locks_; -#endif // defined(OS_APPLE) +#endif // defined(OS_APPLE) || defined(USE_OZONE) base::flat_map<gfx::ColorSpace, base::flat_map<gfx::ColorSpace, sk_sp<SkRuntimeEffect>>>
diff --git a/components/viz/service/display_embedder/image_context_impl.cc b/components/viz/service/display_embedder/image_context_impl.cc index 34b6ab6..1f6be70 100644 --- a/components/viz/service/display_embedder/image_context_impl.cc +++ b/components/viz/service/display_embedder/image_context_impl.cc
@@ -93,6 +93,9 @@ gpu::MailboxManager* mailbox_manager, std::vector<GrBackendSemaphore>* begin_semaphores, std::vector<GrBackendSemaphore>* end_semaphores) { + if (representation_raster_scoped_access_) + return; + // Prepare for accessing shared image. if (mailbox_holder().mailbox.IsSharedImage()) { if (!BeginAccessIfNecessaryForSharedImage( @@ -158,6 +161,25 @@ // validating command decoder as well. } +bool ImageContextImpl::BeginRasterAccess( + gpu::SharedImageRepresentationFactory* representation_factory) { + auto raster = representation_factory->ProduceRaster(mailbox_holder().mailbox); + if (!raster) + return false; + + auto scoped_access = raster->BeginScopedReadAccess(); + if (!scoped_access) + return false; + + set_paint_op_buffer(scoped_access->paint_op_buffer()); + set_clear_color(scoped_access->clear_color()); + + raster_representation_ = std::move(raster); + representation_raster_scoped_access_ = std::move(scoped_access); + + return true; +} + bool ImageContextImpl::BeginAccessIfNecessaryForSharedImage( gpu::SharedContextState* context_state, gpu::SharedImageRepresentationFactory* representation_factory, @@ -253,6 +275,11 @@ } void ImageContextImpl::EndAccessIfNecessary() { + if (paint_op_buffer()) { + DCHECK(!representation_scoped_read_access_); + return; + } + if (!representation_scoped_read_access_) return;
diff --git a/components/viz/service/display_embedder/image_context_impl.h b/components/viz/service/display_embedder/image_context_impl.h index 7e7bb38..f12213a 100644 --- a/components/viz/service/display_embedder/image_context_impl.h +++ b/components/viz/service/display_embedder/image_context_impl.h
@@ -9,7 +9,6 @@ #include <utility> #include <vector> -#include "base/macros.h" #include "base/memory/ref_counted.h" #include "components/viz/common/quads/aggregated_render_pass.h" #include "components/viz/common/resources/resource_format.h" @@ -84,6 +83,8 @@ gpu::MailboxManager* mailbox_manager, std::vector<GrBackendSemaphore>* begin_semaphores, std::vector<GrBackendSemaphore>* end_semaphores); + bool BeginRasterAccess( + gpu::SharedImageRepresentationFactory* representation_factory); void EndAccessIfNecessary(); private: @@ -110,11 +111,14 @@ // Only one of the follow should be non-null at the same time. scoped_refptr<gpu::gles2::TexturePassthrough> texture_passthrough_; std::unique_ptr<gpu::SharedImageRepresentationSkia> representation_; + std::unique_ptr<gpu::SharedImageRepresentationRaster> raster_representation_; // For scoped read accessing |representation|. It is only accessed on GPU // thread. std::unique_ptr<gpu::SharedImageRepresentationSkia::ScopedReadAccess> representation_scoped_read_access_; + std::unique_ptr<gpu::SharedImageRepresentationRaster::ScopedReadAccess> + representation_raster_scoped_access_; // For holding SkPromiseImageTexture create from |fallback_texture| or legacy // mailbox.
diff --git a/components/viz/service/display_embedder/skia_output_device_buffer_queue.cc b/components/viz/service/display_embedder/skia_output_device_buffer_queue.cc index df3c9cef..eb646c0 100644 --- a/components/viz/service/display_embedder/skia_output_device_buffer_queue.cc +++ b/components/viz/service/display_embedder/skia_output_device_buffer_queue.cc
@@ -5,6 +5,7 @@ #include "components/viz/service/display_embedder/skia_output_device_buffer_queue.h" #include <memory> +#include <set> #include <utility> #include <vector> @@ -519,9 +520,11 @@ } #if defined(USE_OZONE) + std::set<gpu::Mailbox> released_solid_color_overlays; for (const auto& mailbox : overlay_mailboxes) { auto it = solid_color_images_.find(mailbox); if (it != solid_color_images_.end()) { + released_solid_color_overlays.insert(mailbox); solid_color_cache_.insert( std::make_pair(it->second.first, std::move(it->second.second))); solid_color_images_.erase(it); @@ -541,21 +544,38 @@ } #endif + std::vector<gpu::Mailbox> released_overlays; + auto on_overlay_release = +#if defined(OS_APPLE) + [&released_overlays](const OverlayData& overlay) { + // Right now, only macOS needs to return maliboxes of released + // overlays, so SkiaRenderer can unlock resources for them. + released_overlays.push_back(overlay.mailbox()); + }; +#elif defined(USE_OZONE) + [&released_overlays, + &released_solid_color_overlays](const OverlayData& overlay) { + // Delegated compositing on Ozone needs to return mailboxes of released + // overlays, so SkiaRenderer can unlock resources for them. However, the + // solid color buffers originating in this class and should not + // propagate up to SkiaRenderer. + if (released_solid_color_overlays.find(overlay.mailbox()) == + released_solid_color_overlays.end()) { + released_overlays.push_back(overlay.mailbox()); + } + }; +#else + [](const OverlayData& overlay) {}; +#endif + // Go through backings of all overlays, and release overlay backings which are // not used. - std::vector<gpu::Mailbox> released_overlays; - base::EraseIf(overlays_, [&released_overlays](auto& overlay) { + base::EraseIf(overlays_, [&on_overlay_release](auto& overlay) { if (!overlay.unique()) return false; if (overlay.IsInUseByWindowServer()) return false; -#if defined(OS_APPLE) - // Right now, only macOS needs to return maliboxes of released overlays, so - // SkiaRenderer can unlock resources for them. - released_overlays.push_back(overlay.mailbox()); -#else - ALLOW_UNUSED_LOCAL(released_overlays); -#endif + on_overlay_release(overlay); overlay.Unref(); return true; });
diff --git a/components/viz/service/display_embedder/skia_output_surface_impl.cc b/components/viz/service/display_embedder/skia_output_surface_impl.cc index 0c16740..a3f5121 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl.cc +++ b/components/viz/service/display_embedder/skia_output_surface_impl.cc
@@ -28,8 +28,10 @@ #include "components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.h" #include "gpu/command_buffer/common/swap_buffers_complete_params.h" #include "gpu/command_buffer/service/scheduler.h" +#include "gpu/command_buffer/service/shared_image_factory.h" #include "gpu/command_buffer/service/shared_image_representation.h" #include "gpu/command_buffer/service/skia_utils.h" +#include "gpu/config/gpu_finch_features.h" #include "gpu/ipc/service/context_url.h" #include "gpu/ipc/single_task_sequence.h" #include "gpu/vulkan/buildflags.h" @@ -181,6 +183,13 @@ gpu_task_scheduler_( display_compositor_controller_->gpu_task_scheduler()) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + if (features::IsUsingRawDraw()) { + auto* manager = dependency_->GetSharedImageManager(); + DCHECK(manager->is_thread_safe()); + representation_factory_ = + std::make_unique<gpu::SharedImageRepresentationFactory>(manager, + nullptr); + } } SkiaOutputSurfaceImpl::~SkiaOutputSurfaceImpl() { @@ -376,6 +385,23 @@ images_in_current_paint_.push_back( static_cast<ImageContextImpl*>(image_context)); + const auto& mailbox_holder = image_context->mailbox_holder(); + + if (representation_factory_) { + auto* sync_point_manager = dependency_->GetSyncPointManager(); + auto const& sync_token = mailbox_holder.sync_token; + if (sync_token.HasData() && + !sync_point_manager->IsSyncTokenReleased(sync_token)) { + gpu_task_sync_tokens_.push_back(sync_token); + FlushGpuTasks(/*wait_for_finish=*/true); + image_context->mutable_mailbox_holder()->sync_token.Clear(); + } + + auto* impl = static_cast<ImageContextImpl*>(image_context); + if (impl->BeginRasterAccess(representation_factory_.get())) + return; + } + if (image_context->has_image()) return; @@ -394,8 +420,8 @@ nullptr /* releaseProc */, image_context /* context */), backend_format); - if (image_context->mailbox_holder().sync_token.HasData()) { - resource_sync_tokens_.push_back(image_context->mailbox_holder().sync_token); + if (mailbox_holder.sync_token.HasData()) { + resource_sync_tokens_.push_back(mailbox_holder.sync_token); image_context->mutable_mailbox_holder()->sync_token.Clear(); } }
diff --git a/components/viz/service/display_embedder/skia_output_surface_impl.h b/components/viz/service/display_embedder/skia_output_surface_impl.h index b068914..dfd9601 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl.h +++ b/components/viz/service/display_embedder/skia_output_surface_impl.h
@@ -10,7 +10,6 @@ #include "base/callback_helpers.h" #include "base/containers/circular_deque.h" -#include "base/macros.h" #include "base/observer_list.h" #include "base/threading/thread_checker.h" #include "base/timer/timer.h" @@ -36,6 +35,10 @@ } // namespace mojom } // namespace gfx +namespace gpu { +class SharedImageRepresentationFactory; +} + namespace viz { class ImageContextImpl; @@ -64,12 +67,11 @@ DisplayCompositorMemoryAndTaskController* display_controller, const RendererSettings& renderer_settings, const DebugRendererSettings* debug_settings); + ~SkiaOutputSurfaceImpl() override; SkiaOutputSurfaceImpl(const SkiaOutputSurfaceImpl&) = delete; SkiaOutputSurfaceImpl& operator=(const SkiaOutputSurfaceImpl&) = delete; - ~SkiaOutputSurfaceImpl() override; - // OutputSurface implementation: gpu::SurfaceHandle GetSurfaceHandle() const override; void BindToClient(OutputSurfaceClient* client) override; @@ -397,6 +399,9 @@ int consecutive_frames_with_extra_buffer_ = 0; // Delayed task to drop frame buffers when idle. base::OneShotTimer idle_drop_frame_buffer_timer_; + // For accessing tile shared image backings from compositor thread. + std::unique_ptr<gpu::SharedImageRepresentationFactory> + representation_factory_; base::WeakPtr<SkiaOutputSurfaceImpl> weak_ptr_; base::WeakPtrFactory<SkiaOutputSurfaceImpl> weak_ptr_factory_{this};
diff --git a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc index 84ab258..c16b933 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc +++ b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc
@@ -1767,9 +1767,19 @@ #if defined(OS_APPLE) || defined(USE_OZONE) // |available_render_pass_overlay_backings_| are used or released in - // SwapBuffers() for every frames. + // SwapBuffers() for every frames. For Ozone-Wayland + // |available_render_pass_overlay_backings_| is not always empty because the + // buffer management in 'GbmSurfacelessWayland::SwapBuffersAsync' will cause + // an accumulation of unsubmitted frames in |unsubmitted_frames_|. These are + // submitted in 'GbmSurfacelessWayland::MaybeSubmitFrames'. Later + // 'GbmSurfacelessWayland::OnSubmission' will then call the callback of these + // |submitted_frames| more than once. This means that this function + // 'DidSwapBuffersCompleteInternal' will get executed again before the + // corresponding 'SkiaOutputSurfaceImplOnGpu::SwapBuffersInternal' has cleared + // 'available_render_pass_overlay_backings_'. +#if !defined(USE_OZONE) DCHECK(available_render_pass_overlay_backings_.empty()); - +#endif // Erase mailboxes of render pass overlays from |params.released_overlays| and // move released backings for those render pass overlays from // |in_flight_render_pass_overlay_backings_| to
diff --git a/components/viz/service/gl/gpu_service_impl.cc b/components/viz/service/gl/gpu_service_impl.cc index a43be2cc..321bb42 100644 --- a/components/viz/service/gl/gpu_service_impl.cc +++ b/components/viz/service/gl/gpu_service_impl.cc
@@ -559,6 +559,8 @@ // corresponding to a mailbox. const bool display_context_on_another_thread = features::IsDrDcEnabled(); bool thread_safe_manager = display_context_on_another_thread; + // Raw draw needs to access shared image backing on the compositor thread. + thread_safe_manager |= features::IsUsingRawDraw(); #if defined(USE_OZONE) thread_safe_manager |= features::ShouldUseRealBuffersForPageFlipTest(); #endif
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm index 0cda365..881b0fd 100644 --- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm +++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -31,7 +31,7 @@ #include "ui/base/cocoa/remote_accessibility_api.h" #import "ui/base/cocoa/touch_bar_util.h" #include "ui/base/ui_base_features.h" -#include "ui/display/display_list.h" +#include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/events/event_utils.h" #include "ui/events/keycodes/dom/dom_code.h" @@ -1362,10 +1362,11 @@ // TODO(ccameron): This will call [enclosingWindow screen], which may return // nil. Do that call here to avoid sending bogus display info to the host. - const display::DisplayList new_display_list = - display::Screen::GetScreen()->GetDisplayListNearestViewWithFallbacks( - self); - _host->OnDisplaysChanged(new_display_list); + auto* screen = display::Screen::GetScreen(); + const display::ScreenInfos new_screen_infos = + screen->GetScreenInfosNearestDisplay( + screen->GetDisplayNearestView(self).id()); + _host->OnScreenInfosChanged(new_screen_infos); } // This will be called when the NSView's NSWindow moves from one NSScreen to
diff --git a/content/browser/bad_message.h b/content/browser/bad_message.h index 926318e..c559bb83 100644 --- a/content/browser/bad_message.h +++ b/content/browser/bad_message.h
@@ -277,6 +277,7 @@ RFH_DID_CHANGE_IFRAME_ATTRIBUTE = 249, FARI_LOGOUT_BAD_ENDPOINT = 250, RFH_CHILD_FRAME_UNEXPECTED_OWNER_ELEMENT_TYPE = 251, + RFH_POPUP_REQUEST_WHILE_PRERENDERING = 252, // Please add new elements here. The naming convention is abbreviated class // name (e.g. RenderFrameHost becomes RFH) plus a unique description of the
diff --git a/content/browser/browser_interface_binders.cc b/content/browser/browser_interface_binders.cc index 2d6d79f..d777ac5 100644 --- a/content/browser/browser_interface_binders.cc +++ b/content/browser/browser_interface_binders.cc
@@ -187,33 +187,23 @@ namespace { -void BindShapeDetectionServiceOnProcessThread( - mojo::PendingReceiver<shape_detection::mojom::ShapeDetectionService> - receiver) { -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && BUILDFLAG(IS_CHROMEOS_ASH) - content::ServiceProcessHost::Launch< - shape_detection::mojom::ShapeDetectionService>( - std::move(receiver), content::ServiceProcessHost::Options() - .WithDisplayName("Shape Detection Service") - .Pass()); -#else - auto* gpu = GpuProcessHost::Get(); - if (gpu) - gpu->RunService(std::move(receiver)); -#endif -} - shape_detection::mojom::ShapeDetectionService* GetShapeDetectionService() { static base::NoDestructor< mojo::Remote<shape_detection::mojom::ShapeDetectionService>> remote; if (!*remote) { - auto task_runner = base::FeatureList::IsEnabled(features::kProcessHostOnUI) - ? content::GetUIThreadTaskRunner({}) - : content::GetIOThreadTaskRunner({}); - task_runner->PostTask( - FROM_HERE, base::BindOnce(&BindShapeDetectionServiceOnProcessThread, - remote->BindNewPipeAndPassReceiver())); +#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && BUILDFLAG(IS_CHROMEOS_ASH) + content::ServiceProcessHost::Launch< + shape_detection::mojom::ShapeDetectionService>( + remote->BindNewPipeAndPassReceiver(), + content::ServiceProcessHost::Options() + .WithDisplayName("Shape Detection Service") + .Pass()); +#else + auto* gpu = GpuProcessHost::Get(); + if (gpu) + gpu->RunService(remote->BindNewPipeAndPassReceiver()); +#endif remote->reset_on_disconnect(); }
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 2041a98..cd0dda0 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc
@@ -1184,17 +1184,10 @@ // ShaderCacheFactory. InitShaderCacheFactorySingleton(); - // Initialize the FontRenderParams on IO thread. This needs to be initialized - // before gpu process initialization below. - if (base::FeatureList::IsEnabled(features::kProcessHostOnUI)) { - viz::GpuHostImpl::InitFontRenderParams( - gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr)); - } else { - GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(&viz::GpuHostImpl::InitFontRenderParams, - gfx::GetFontRenderParams( - gfx::FontRenderParamsQuery(), nullptr))); - } + // Initialize the FontRenderParams. This needs to be initialized before gpu + // process initialization below. + viz::GpuHostImpl::InitFontRenderParams( + gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr)); bool always_uses_gpu = true; bool established_gpu_channel = false;
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc index a95bfc1a2..b29dfde 100644 --- a/content/browser/child_process_security_policy_impl.cc +++ b/content/browser/child_process_security_policy_impl.cc
@@ -19,6 +19,7 @@ #include "base/logging.h" #include "base/macros.h" #include "base/metrics/histogram_macros.h" +#include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" @@ -161,12 +162,26 @@ return keep_alive_duration_key; } +base::debug::CrashKeyString* GetCanAccessDataShutdownDelayRefCountKey() { + static auto* shutdown_delay_key = base::debug::AllocateCrashKeyString( + "shutdown_delay_ref_count", base::debug::CrashKeySize::Size32); + return shutdown_delay_key; +} + +base::debug::CrashKeyString* GetCanAccessDataProcessRFHCount() { + static auto* process_rfh_count_key = base::debug::AllocateCrashKeyString( + "process_rfh_count", base::debug::CrashKeySize::Size32); + return process_rfh_count_key; +} + void LogCanAccessDataForOriginCrashKeys( const std::string& expected_process_lock, const std::string& killed_process_origin_lock, const std::string& requested_origin, const std::string& failure_reason, - const std::string& keep_alive_durations) { + const std::string& keep_alive_durations, + const std::string& shutdown_delay_ref_count, + const std::string& process_rfh_count) { base::debug::SetCrashKeyString(GetExpectedProcessLockKey(), expected_process_lock); base::debug::SetCrashKeyString(GetKilledProcessOriginLockKey(), @@ -177,6 +192,10 @@ failure_reason); base::debug::SetCrashKeyString(GetCanAccessDataKeepAliveDurationKey(), keep_alive_durations); + base::debug::SetCrashKeyString(GetCanAccessDataShutdownDelayRefCountKey(), + shutdown_delay_ref_count); + base::debug::SetCrashKeyString(GetCanAccessDataProcessRFHCount(), + process_rfh_count); } } // namespace @@ -388,7 +407,8 @@ if (child_id_ == ChildProcessHost::kInvalidUniqueID) { LogCanAccessDataForOriginCrashKeys( "(unknown)", "(unknown)", origin.GetDebugString(), "handle_not_valid", - "no_keep_alive_durations"); + "no_keep_alive_durations", "no shutdown delay ref count", + "no process rfh count"); return false; } @@ -1827,9 +1847,14 @@ // Record the duration of KeepAlive requests to include in the crash keys. std::string keep_alive_durations; + std::string shutdown_delay_ref_count; + std::string process_rfh_count; if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { if (auto* process = RenderProcessHostImpl::FromID(child_id)) { keep_alive_durations = process->GetKeepAliveDurations(); + shutdown_delay_ref_count = + base::NumberToString(process->GetShutdownDelayRefCount()); + process_rfh_count = base::NumberToString(process->GetRfhCount()); } } else { keep_alive_durations = "no durations available: on IO thread."; @@ -1837,10 +1862,11 @@ // Returning false here will result in a renderer kill. Set some crash // keys that will help understand the circumstances of that kill. - LogCanAccessDataForOriginCrashKeys(expected_process_lock.ToString(), - GetKilledProcessOriginLock(security_state), - url.GetOrigin().spec(), failure_reason, - keep_alive_durations); + LogCanAccessDataForOriginCrashKeys( + expected_process_lock.ToString(), + GetKilledProcessOriginLock(security_state), url.GetOrigin().spec(), + failure_reason, keep_alive_durations, shutdown_delay_ref_count, + process_rfh_count); return false; }
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc b/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc index 95dd3ef..074b9664 100644 --- a/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc +++ b/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc
@@ -1411,8 +1411,8 @@ } // Flaky on Mac and Linux ASAN builds. See: crbug.com/1189512. -#if defined(OS_MAC) || (defined(OS_LINUX) && defined(ADDRESS_SANITIZER)) || \ - defined(OS_CHROMEOS) || defined(OS_ANDROID) +#if defined(OS_MAC) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || \ + (defined(OS_LINUX) && (defined(ADDRESS_SANITIZER) || defined(UBSAN))) #define MAYBE_DatabaseOperationSequencing DISABLED_DatabaseOperationSequencing #else #define MAYBE_DatabaseOperationSequencing DatabaseOperationSequencing
diff --git a/content/browser/interest_group/interest_group_browsertest.cc b/content/browser/interest_group/interest_group_browsertest.cc index 29e5816..dc301ca 100644 --- a/content/browser/interest_group/interest_group_browsertest.cc +++ b/content/browser/interest_group/interest_group_browsertest.cc
@@ -139,7 +139,6 @@ void SetUpOnMainThread() override { ContentBrowserTest::SetUpOnMainThread(); host_resolver()->AddRule("*", "127.0.0.1"); - embedded_test_server()->SetSSLConfig(net::EmbeddedTestServer::CERT_OK); ASSERT_TRUE(embedded_test_server()->Start()); https_server_ = std::make_unique<net::EmbeddedTestServer>( net::test_server::EmbeddedTestServer::TYPE_HTTPS); @@ -515,38 +514,6 @@ testing::UnorderedElementsAreArray(expected_groups)); } -IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionBasic) { - GURL test_url = https_server_->GetURL("a.test", "/echo"); - ASSERT_TRUE(NavigateToURL(shell(), test_url)); - - EXPECT_EQ( - nullptr, - RunAuctionAndWait(JsReplace( - R"({ - seller: $1, - decisionLogicUrl: $2 - })", - test_url.GetOrigin().spec(), - https_server_->GetURL("b.test", "/interest_group/decision_logic.js") - .spec()))); -} - -IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionFull) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); - - EXPECT_EQ(nullptr, RunAuctionAndWait(R"({ - seller: 'https://test.com', - decisionLogicUrl: 'https://test.com/decision_logic', - interestGroupBuyers: ['https://www.buyer1.com', 'https://www.buyer2.com'], - auctionSignals: {more: 'json', stuff: {}}, - sellerSignals: {yet: 'more', info: 1}, - perBuyerSignals: { - 'https://www.buyer1.com': {even: 'more', x: 4.5}, - 'https://www.buyer2.com': {the: 'end'} - } - })")); -} - IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionStarInterestGroupBuyers) { ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); @@ -560,7 +527,7 @@ IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, JoinInterestGroupInvalidOwner) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); + ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); EXPECT_EQ( "TypeError: Failed to execute 'joinAdInterestGroup' on 'Navigator': " @@ -768,7 +735,7 @@ IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, LeaveInterestGroupInvalidOwner) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); + ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); EXPECT_EQ( "TypeError: Failed to execute 'leaveAdInterestGroup' on 'Navigator': " @@ -791,7 +758,7 @@ } IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionInvalidSeller) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); + ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); EXPECT_EQ( "TypeError: Failed to execute 'runAdAuction' on 'Navigator': seller " @@ -803,7 +770,7 @@ } IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionHttpSeller) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); + ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); EXPECT_EQ( "TypeError: Failed to execute 'runAdAuction' on 'Navigator': seller " @@ -816,7 +783,7 @@ IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionInvalidDecisionLogicUrl) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); + ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); EXPECT_EQ( "TypeError: Failed to execute 'runAdAuction' on 'Navigator': " @@ -866,7 +833,7 @@ IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionInvalidInterestGroupBuyers) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); + ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); EXPECT_EQ( "TypeError: Failed to execute 'runAdAuction' on 'Navigator': " @@ -881,7 +848,7 @@ IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionInvalidInterestGroupBuyersStr) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); + ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); EXPECT_EQ( "TypeError: Failed to execute 'runAdAuction' on 'Navigator': " @@ -918,7 +885,7 @@ IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionInvalidAuctionSignals) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); + ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); EXPECT_EQ( "TypeError: Failed to execute 'runAdAuction' on 'Navigator': " @@ -933,7 +900,7 @@ IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionInvalidSellerSignals) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); + ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); EXPECT_EQ( "TypeError: Failed to execute 'runAdAuction' on 'Navigator': " @@ -948,7 +915,7 @@ IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionInvalidPerBuyerSignalsOrigin) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); + ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); EXPECT_EQ( "TypeError: Failed to execute 'runAdAuction' on 'Navigator': " @@ -1000,7 +967,7 @@ IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionInvalidPerBuyerSignals) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); + ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); EXPECT_EQ( "TypeError: Failed to execute 'runAdAuction' on 'Navigator': " @@ -2173,7 +2140,7 @@ // implement important security checks (Blink may also perform its own // checking, but the render process is untrusted). IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTest, RunAdAuctionBasicBypassBlink) { - ASSERT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL("/echo"))); + ASSERT_TRUE(NavigateToURL(shell(), https_server_->GetURL("a.test", "/echo"))); mojo::Remote<blink::mojom::AdAuctionService> auction_service; AdAuctionServiceImpl::CreateMojoService( @@ -2277,9 +2244,7 @@ IN_PROC_BROWSER_TEST_F(InterestGroupBrowserTestRunAdAuctionBypassBlink, SellerNotHttps) { - // Running an ad auction on a non-https origin isn't allowed. - GURL test_url_b = embedded_test_server()->GetURL("b.test", "/echo"); - ASSERT_TRUE(test_url_b.SchemeIs(url::kHttpScheme)); + GURL test_url_b = https_server_->GetURL("a.test", "/echo"); url::Origin test_origin_b = url::Origin::Create(test_url_b); ASSERT_TRUE(NavigateToURL(shell(), test_url_b)); @@ -2287,6 +2252,7 @@ config->seller = test_origin_b; config->decision_logic_url = embedded_test_server()->GetURL( "b.test", "/interest_group/decision_logic.js"); + ASSERT_TRUE(config->decision_logic_url.SchemeIs(url::kHttpScheme)); config->interest_group_buyers = blink::mojom::InterestGroupBuyers::New(); config->interest_group_buyers->set_buyers({test_origin_a_});
diff --git a/content/browser/plugin_private_storage_helper.cc b/content/browser/plugin_private_storage_helper.cc index 272dae5..e53f71e 100644 --- a/content/browser/plugin_private_storage_helper.cc +++ b/content/browser/plugin_private_storage_helper.cc
@@ -47,6 +47,18 @@ #endif } +// TODO(https://crbug.com/1231162): temporary function to convert a vector of +// StorageKeys to a vector of their origin values; should be obsolete when +// Plugin-Private File System is converted to StorageKey and partitioned. +std::vector<url::Origin> ToOrigins( + const std::vector<blink::StorageKey>& storage_keys) { + std::vector<url::Origin> origins; + origins.reserve(storage_keys.size()); + for (const blink::StorageKey& storage_key : storage_keys) + origins.emplace_back(storage_key.origin()); + return origins; +} + // Helper for checking the plugin private data for a specified origin and // plugin for the existence of any file that matches the time range specified. // All of the operations in this class are done on the IO thread. @@ -418,48 +430,50 @@ storage::kFileSystemTypePluginPrivate); storage::FileSystemQuotaUtil* quota_util = backend->GetQuotaUtil(); - // Determine the origins used. - std::vector<url::Origin> origins = - quota_util->GetOriginsForTypeOnFileTaskRunner( + // Determine the StorageKeys used. + std::vector<blink::StorageKey> storage_keys = + quota_util->GetStorageKeysForTypeOnFileTaskRunner( storage::kFileSystemTypePluginPrivate); - if (origins.empty()) { - // No origins, so nothing to do. + if (storage_keys.empty()) { + // No StorageKeys, so nothing to do. std::move(callback).Run(); return; } - // If a specific origin is provided, then check that it is in the list - // returned and remove all the other origins. + // If a specific origin parameter is provided, then check that it is in the + // list returned and remove all the other StorageKeys. if (!storage_origin_url.is_empty()) { DCHECK(!origin_matcher) << "Only 1 of |storage_origin_url| and " "|origin_matcher| should be specified."; - url::Origin storage_origin = url::Origin::Create(storage_origin_url); - if (!base::Contains(origins, storage_origin)) { + const blink::StorageKey storage_key = + blink::StorageKey(url::Origin::Create(storage_origin_url)); + if (!base::Contains(storage_keys, storage_key)) { // Nothing matches, so nothing to do. std::move(callback).Run(); return; } // List should only contain the one value that matches. - origins.clear(); - origins.push_back(storage_origin); + storage_keys.clear(); + storage_keys.push_back(storage_key); } - // If a filter is provided, determine which origins match. + // If a filter is provided, determine which StorageKeys match. if (origin_matcher) { DCHECK(storage_origin_url.is_empty()) << "Only 1 of |storage_origin_url| and |origin_matcher| should be " "specified."; - std::vector<url::Origin> origins_to_check; - origins_to_check.swap(origins); - for (auto& origin : origins_to_check) { - if (origin_matcher.Run(origin, special_storage_policy.get())) - origins.push_back(std::move(origin)); + std::vector<blink::StorageKey> storage_keys_to_check; + storage_keys_to_check.swap(storage_keys); + for (auto& storage_key : storage_keys_to_check) { + if (origin_matcher.Run(storage_key.origin(), + special_storage_policy.get())) + storage_keys.push_back(std::move(storage_key)); } - // If no origins matched, there is nothing to do. - if (origins.empty()) { + // If no StorageKeys matched, there is nothing to do. + if (storage_keys.empty()) { std::move(callback).Run(); return; } @@ -467,7 +481,7 @@ PluginPrivateDataDeletionHelper* helper = new PluginPrivateDataDeletionHelper( std::move(filesystem_context), begin, end, std::move(callback)); - helper->CheckOriginsOnFileTaskRunner(origins); + helper->CheckOriginsOnFileTaskRunner(ToOrigins(storage_keys)); // |helper| will delete itself when all origins have been checked. }
diff --git a/content/browser/renderer_host/back_forward_cache_metrics_unittest.cc b/content/browser/renderer_host/back_forward_cache_metrics_unittest.cc index 5ff06d4..6915362e 100644 --- a/content/browser/renderer_host/back_forward_cache_metrics_unittest.cc +++ b/content/browser/renderer_host/back_forward_cache_metrics_unittest.cc
@@ -164,8 +164,8 @@ clock_.Advance(base::TimeDelta::FromMilliseconds(0b1000)); { - auto simulator = - NavigationSimulator::CreateHistoryNavigation(-1, contents()); + auto simulator = NavigationSimulator::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); simulator->Start(); clock_.Advance(base::TimeDelta::FromMilliseconds(0b10000)); simulator->Commit();
diff --git a/content/browser/renderer_host/blocked_scheme_navigation_throttle.cc b/content/browser/renderer_host/blocked_scheme_navigation_throttle.cc index 3bdadb0..a4dd43166 100644 --- a/content/browser/renderer_host/blocked_scheme_navigation_throttle.cc +++ b/content/browser/renderer_host/blocked_scheme_navigation_throttle.cc
@@ -10,6 +10,7 @@ #include "content/browser/renderer_host/frame_tree.h" #include "content/browser/renderer_host/frame_tree_node.h" #include "content/browser/renderer_host/navigation_request.h" +#include "content/common/navigation_params_utils.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/render_frame_host.h" #include "content/public/common/content_features.h" @@ -51,14 +52,20 @@ std::unique_ptr<NavigationThrottle> BlockedSchemeNavigationThrottle::CreateThrottleForNavigation( NavigationHandle* navigation_handle) { - if (navigation_handle->IsInMainFrame() && - navigation_handle->IsRendererInitiated() && - !navigation_handle->IsSameDocument() && - (navigation_handle->GetURL().SchemeIs(url::kDataScheme) || - navigation_handle->GetURL().SchemeIs(url::kFileSystemScheme)) && + NavigationRequest* request = NavigationRequest::From(navigation_handle); + // Create throttles when going to blocked schemes via renderer-initiated + // navigations (which are cross-document in the main frame). Note that history + // navigations can bypass this, because the blocked scheme must have + // originally committed in a permitted case (e.g., omnibox navigation). + if (request->IsInMainFrame() && request->IsRendererInitiated() && + !request->IsSameDocument() && + !NavigationTypeUtils::IsHistory( + request->common_params().navigation_type) && + (request->GetURL().SchemeIs(url::kDataScheme) || + request->GetURL().SchemeIs(url::kFileSystemScheme)) && !base::FeatureList::IsEnabled( features::kAllowContentInitiatedDataUrlNavigations)) { - return std::make_unique<BlockedSchemeNavigationThrottle>(navigation_handle); + return std::make_unique<BlockedSchemeNavigationThrottle>(request); } return nullptr; }
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.h b/content/browser/renderer_host/browser_compositor_view_mac.h index f77d233..b0492d9 100644 --- a/content/browser/renderer_host/browser_compositor_view_mac.h +++ b/content/browser/renderer_host/browser_compositor_view_mac.h
@@ -17,7 +17,7 @@ #include "ui/compositor/compositor.h" #include "ui/compositor/compositor_observer.h" #include "ui/compositor/layer_observer.h" -#include "ui/display/display_list.h" +#include "ui/display/screen_info.h" #include "ui/gfx/ca_layer_params.h" namespace ui { @@ -35,7 +35,7 @@ virtual void DestroyCompositorForShutdown() = 0; virtual bool OnBrowserCompositorSurfaceIdChanged() = 0; virtual std::vector<viz::SurfaceId> CollectSurfaceIdsForEviction() = 0; - virtual const display::DisplayList& GetDisplayList() const = 0; + virtual display::ScreenInfo GetCurrentScreenInfo() const = 0; virtual void SetCurrentDeviceScaleFactor(float device_scale_factor) = 0; };
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm index 0be58e60..8cf6dc6 100644 --- a/content/browser/renderer_host/browser_compositor_view_mac.mm +++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -114,21 +114,20 @@ void BrowserCompositorMac::UpdateSurfaceFromNSView( const gfx::Size& new_size_dip) { - const display::Display& display = - client_->GetDisplayList().GetCurrentDisplay(); + display::ScreenInfo current = client_->GetCurrentScreenInfo(); bool is_resize = !dfh_size_dip_.IsEmpty() && new_size_dip != dfh_size_dip_; bool needs_new_surface_id = new_size_dip != dfh_size_dip_ || - display.device_scale_factor() != dfh_device_scale_factor_; + current.device_scale_factor != dfh_device_scale_factor_; dfh_size_dip_ = new_size_dip; - dfh_device_scale_factor_ = display.device_scale_factor(); + dfh_device_scale_factor_ = current.device_scale_factor; // The device scale factor is always an integer, so the result here is also // an integer. dfh_size_pixels_ = gfx::ToRoundedSize( - gfx::ConvertSizeToPixels(dfh_size_dip_, display.device_scale_factor())); + gfx::ConvertSizeToPixels(dfh_size_dip_, current.device_scale_factor)); root_layer_->SetBounds(gfx::Rect(dfh_size_dip_)); if (needs_new_surface_id) { @@ -140,8 +139,8 @@ if (recyclable_compositor_) { recyclable_compositor_->UpdateSurface(dfh_size_pixels_, - display.device_scale_factor(), - display.color_spaces()); + current.device_scale_factor, + current.display_color_spaces); } } @@ -153,18 +152,17 @@ if (dfh_local_surface_id_allocator_.UpdateFromChild(child_local_surface_id)) { if (auto_resize_enabled) { client_->SetCurrentDeviceScaleFactor(new_device_scale_factor); - const display::Display& display = - client_->GetDisplayList().GetCurrentDisplay(); + display::ScreenInfo current = client_->GetCurrentScreenInfo(); // TODO(danakj): We should avoid lossy conversions to integer DIPs. dfh_size_dip_ = gfx::ToFlooredSize(gfx::ConvertSizeToDips( - new_size_in_pixels, display.device_scale_factor())); + new_size_in_pixels, current.device_scale_factor)); dfh_size_pixels_ = new_size_in_pixels; dfh_device_scale_factor_ = new_device_scale_factor; root_layer_->SetBounds(gfx::Rect(dfh_size_dip_)); if (recyclable_compositor_) { recyclable_compositor_->UpdateSurface(dfh_size_pixels_, - display.device_scale_factor(), - display.color_spaces()); + current.device_scale_factor, + current.display_color_spaces); } } delegated_frame_host_->EmbedSurface( @@ -266,11 +264,10 @@ recyclable_compositor_ = ui::RecyclableCompositorMacFactory::Get()->CreateCompositor( content::GetContextFactory()); - const display::DisplayList& display_list = client_->GetDisplayList(); - const display::Display& display = display_list.GetCurrentDisplay(); + display::ScreenInfo current = client_->GetCurrentScreenInfo(); recyclable_compositor_->UpdateSurface(dfh_size_pixels_, - display.device_scale_factor(), - display.color_spaces()); + current.device_scale_factor, + current.display_color_spaces); recyclable_compositor_->compositor()->SetRootLayer(root_layer_.get()); recyclable_compositor_->compositor()->SetBackgroundColor(background_color_); recyclable_compositor_->widget()->SetNSView( @@ -381,7 +378,7 @@ void BrowserCompositorMac::ForceNewSurfaceForTesting() { float current_device_scale_factor = - client_->GetDisplayList().GetCurrentDisplay().device_scale_factor(); + client_->GetCurrentScreenInfo().device_scale_factor; client_->SetCurrentDeviceScaleFactor(current_device_scale_factor * 2.0f); UpdateSurfaceFromNSView(dfh_size_dip_); }
diff --git a/content/browser/renderer_host/navigation_controller_impl.cc b/content/browser/renderer_host/navigation_controller_impl.cc index 4df4cd27..10da3fa 100644 --- a/content/browser/renderer_host/navigation_controller_impl.cc +++ b/content/browser/renderer_host/navigation_controller_impl.cc
@@ -731,8 +731,11 @@ pending_entry_index_ = current_index; pending_entry_->SetTransitionType(ui::PAGE_TRANSITION_RELOAD); + // location.reload() goes through BeginNavigation, so all reloads triggered + // via this codepath are browser initiated. NavigateToExistingPendingEntry(reload_type, - FrameTreeNode::kFrameTreeNodeInvalidId); + FrameTreeNode::kFrameTreeNodeInvalidId, + true /* is_browser_initiated */); } void NavigationControllerImpl::CancelPendingReload() { @@ -961,11 +964,15 @@ } void NavigationControllerImpl::GoToIndex(int index) { - GoToIndex(index, FrameTreeNode::kFrameTreeNodeInvalidId); + GoToIndex(index, FrameTreeNode::kFrameTreeNodeInvalidId, + true /* is_browser_initiated */); } void NavigationControllerImpl::GoToIndex(int index, - int sandbox_frame_tree_node_id) { + int sandbox_frame_tree_node_id, + bool is_browser_initiated) { + DCHECK(sandbox_frame_tree_node_id == FrameTreeNode::kFrameTreeNodeInvalidId || + !is_browser_initiated); TRACE_EVENT0("browser,navigation,benchmark", "NavigationControllerImpl::GoToIndex"); if (index < 0 || index >= static_cast<int>(entries_.size())) { @@ -981,7 +988,8 @@ pending_entry_index_ = index; pending_entry_->SetTransitionType(ui::PageTransitionFromInt( pending_entry_->GetTransitionType() | ui::PAGE_TRANSITION_FORWARD_BACK)); - NavigateToExistingPendingEntry(ReloadType::NONE, sandbox_frame_tree_node_id); + NavigateToExistingPendingEntry(ReloadType::NONE, sandbox_frame_tree_node_id, + is_browser_initiated); } void NavigationControllerImpl::GoToOffset(int offset) { @@ -992,6 +1000,15 @@ GoToIndex(GetIndexForOffset(offset)); } +void NavigationControllerImpl::GoToOffsetFromRenderer(int offset) { + // Note: This is actually reached in unit tests. + if (!CanGoToOffset(offset)) + return; + + GoToIndex(GetIndexForOffset(offset), FrameTreeNode::kFrameTreeNodeInvalidId, + false /* is_browser_initiated */); +} + #if defined(OS_ANDROID) void NavigationControllerImpl::GoToOffsetWithSkipping(int offset) { // Note: This is actually reached in unit tests. @@ -2375,10 +2392,14 @@ if (!frame_entry) return false; + // |is_browser_initiated| is false here because a navigation in a new subframe + // always begins with renderer action (i.e., an HTML element being inserted + // into the DOM), so it is always renderer-initiated. std::unique_ptr<NavigationRequest> request = CreateNavigationRequestFromEntry( render_frame_host->frame_tree_node(), entry, frame_entry, ReloadType::NONE, false /* is_same_document_history_load */, - true /* is_history_navigation_in_new_child */); + true /* is_history_navigation_in_new_child */, + false /* is_browser_initiated */); if (!request) return false; @@ -2403,7 +2424,8 @@ std::unique_ptr<NavigationRequest> request = CreateNavigationRequestFromEntry( frame_tree_node, entry, frame_entry, reload_type, false /* is_same_document_history_load */, - false /* is_history_navigation_in_new_child */); + false /* is_history_navigation_in_new_child */, + true /* is_browser_initiated */); if (!request) return false; frame_tree_node->navigator().Navigate(std::move(request), reload_type); @@ -2415,7 +2437,8 @@ int sandbox_frame_tree_node_id) { if (!CanGoToOffset(offset)) return; - GoToIndex(GetIndexForOffset(offset), sandbox_frame_tree_node_id); + GoToIndex(GetIndexForOffset(offset), sandbox_frame_tree_node_id, + false /* is_browser_initiated */); } void NavigationControllerImpl::NavigateFromFrameProxy( @@ -2773,7 +2796,8 @@ void NavigationControllerImpl::NavigateToExistingPendingEntry( ReloadType reload_type, - int sandboxed_source_frame_tree_node_id) { + int sandboxed_source_frame_tree_node_id, + bool is_browser_initiated) { TRACE_EVENT0("navigation", "NavigationControllerImpl::NavigateToExistingPendingEntry"); DCHECK(pending_entry_); @@ -2809,8 +2833,8 @@ // navigated. std::vector<std::unique_ptr<NavigationRequest>> same_document_loads; std::vector<std::unique_ptr<NavigationRequest>> different_document_loads; - FindFramesToNavigate(root, reload_type, &same_document_loads, - &different_document_loads); + FindFramesToNavigate(root, reload_type, is_browser_initiated, + &same_document_loads, &different_document_loads); if (same_document_loads.empty() && different_document_loads.empty()) { // We were unable to match any frames to navigate. This can happen if a @@ -2835,7 +2859,8 @@ root, pending_entry_, pending_entry_->GetFrameEntry(root), ReloadType::NONE /* reload_type */, true /* is_same_document_history_load */, - false /* is_history_navigation_in_new_child */); + false /* is_history_navigation_in_new_child */, + is_browser_initiated); if (!navigation_request) { // If this navigation cannot start, delete the pending NavigationEntry. DiscardPendingEntry(false); @@ -2892,7 +2917,7 @@ auto navigation_request = CreateNavigationRequestFromEntry( root, pending_entry_, pending_entry_->GetFrameEntry(root), ReloadType::NONE, false /* is_same_document_history_load */, - false /* is_history_navigation_in_new_child */); + false /* is_history_navigation_in_new_child */, is_browser_initiated); root->navigator().Navigate(std::move(navigation_request), ReloadType::NONE); return; @@ -3065,6 +3090,7 @@ void NavigationControllerImpl::FindFramesToNavigate( FrameTreeNode* frame, ReloadType reload_type, + bool is_browser_initiated, std::vector<std::unique_ptr<NavigationRequest>>* same_document_loads, std::vector<std::unique_ptr<NavigationRequest>>* different_document_loads) { DCHECK(pending_entry_); @@ -3077,7 +3103,8 @@ CreateNavigationRequestFromEntry( frame, pending_entry_, new_item, reload_type, true /* is_same_document_history_load */, - false /* is_history_navigation_in_new_child */); + false /* is_history_navigation_in_new_child */, + is_browser_initiated); if (navigation_request) { // Only add the request if was properly created. It's possible for the // creation to fail in certain cases, e.g. when the URL is invalid. @@ -3088,7 +3115,8 @@ CreateNavigationRequestFromEntry( frame, pending_entry_, new_item, reload_type, false /* is_same_document_history_load */, - false /* is_history_navigation_in_new_child */); + false /* is_history_navigation_in_new_child */, + is_browser_initiated); if (navigation_request) { // Only add the request if was properly created. It's possible for the // creation to fail in certain cases, e.g. when the URL is invalid. @@ -3102,8 +3130,8 @@ } for (size_t i = 0; i < frame->child_count(); i++) { - FindFramesToNavigate(frame->child_at(i), reload_type, same_document_loads, - different_document_loads); + FindFramesToNavigate(frame->child_at(i), reload_type, is_browser_initiated, + same_document_loads, different_document_loads); } } @@ -3595,7 +3623,8 @@ FrameNavigationEntry* frame_entry, ReloadType reload_type, bool is_same_document_history_load, - bool is_history_navigation_in_new_child_frame) { + bool is_history_navigation_in_new_child_frame, + bool is_browser_initiated) { DCHECK(frame_entry); GURL dest_url = frame_entry->url(); absl::optional<url::Origin> origin_to_commit = @@ -3700,7 +3729,7 @@ return NavigationRequest::CreateBrowserInitiated( frame_tree_node, std::move(common_params), std::move(commit_params), - !entry->is_renderer_initiated(), false /* was_opener_suppressed */, + is_browser_initiated, false /* was_opener_suppressed */, nullptr /* initiator_frame_token */, ChildProcessHost::kInvalidUniqueID /* initiator_process_id */, entry->extra_headers(), frame_entry, entry, request_body, @@ -3752,12 +3781,14 @@ // cached state. if (pending_entry_) { NavigateToExistingPendingEntry(ReloadType::NONE, - FrameTreeNode::kFrameTreeNodeInvalidId); + FrameTreeNode::kFrameTreeNodeInvalidId, + true /* is_browser_initiated */); } else if (last_committed_entry_index_ != -1) { pending_entry_ = entries_[last_committed_entry_index_].get(); pending_entry_index_ = last_committed_entry_index_; NavigateToExistingPendingEntry(ReloadType::NONE, - FrameTreeNode::kFrameTreeNodeInvalidId); + FrameTreeNode::kFrameTreeNodeInvalidId, + true /* is_browser_initiated */); } else { // If there is something to reload, the successful reload will clear the // |needs_reload_| flag. Otherwise, just do it here.
diff --git a/content/browser/renderer_host/navigation_controller_impl.h b/content/browser/renderer_host/navigation_controller_impl.h index cfa40fbf..4da3a8b 100644 --- a/content/browser/renderer_host/navigation_controller_impl.h +++ b/content/browser/renderer_host/navigation_controller_impl.h
@@ -163,12 +163,20 @@ // Navigates to a specified offset from the "current entry". Currently records // a histogram indicating whether the session history navigation would only // affect frames within the subtree of |sandbox_frame_tree_node_id|, which - // initiated the navigation. + // initiated the navigation. Navigating via this function is considered + // renderer-initiated, since it is only invoked when the renderer requests a + // history traversal. void GoToOffsetInSandboxedFrame(int offset, int sandbox_frame_tree_node_id); + + // Navigates to the specified offset from the "current entry" and marks the + // navigations as initiated by the renderer. + void GoToOffsetFromRenderer(int offset); + #if defined(OS_ANDROID) - // The difference with (Can)GoToOffset/(Can)GoToOffsetInSandboxedFrame is that - // this respect the history manipulation intervention and will excludes the - // skippable entries. + // The difference between (Can)GoToOffsetWithSkipping and + // (Can)GoToOffset/(Can)GoToOffsetInSandboxedFrame is that this respects the + // history manipulation intervention and will exclude skippable entries. + // These should only be used for browser-initiated navigaitons. bool CanGoToOffsetWithSkipping(int offset); void GoToOffsetWithSkipping(int offset); #endif @@ -443,14 +451,17 @@ // |sandbox_frame_tree_node_id| is valid, then this request came // from a sandboxed iframe with top level navigation disallowed. This // is currently only used for tracking metrics. - void GoToIndex(int index, int sandbox_frame_tree_node_id); + void GoToIndex(int index, + int sandbox_frame_tree_node_id, + bool is_browser_initiated); // Starts a navigation to an already existing pending NavigationEntry. // Currently records a histogram indicating whether the session history // navigation would only affect frames within the subtree of // |sandbox_frame_tree_node_id|, which initiated the navigation. void NavigateToExistingPendingEntry(ReloadType reload_type, - int sandboxed_source_frame_tree_node_id); + int sandboxed_source_frame_tree_node_id, + bool is_browser_initiated); // Helper function used by FindFramesToNavigate to determine the appropriate // action to take for a particular frame while navigating to @@ -466,6 +477,7 @@ void FindFramesToNavigate( FrameTreeNode* frame, ReloadType reload_type, + bool is_browser_initiated, std::vector<std::unique_ptr<NavigationRequest>>* same_document_loads, std::vector<std::unique_ptr<NavigationRequest>>* different_document_loads); @@ -521,7 +533,8 @@ FrameNavigationEntry* frame_entry, ReloadType reload_type, bool is_same_document_history_load, - bool is_history_navigation_in_new_child_frame); + bool is_history_navigation_in_new_child_frame, + bool is_browser_initiated); // Returns whether there is a pending NavigationEntry whose unique ID matches // the given NavigationRequest's pending_nav_entry_id.
diff --git a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc index ec90b02..fe26988 100644 --- a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc +++ b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc
@@ -1545,7 +1545,7 @@ EXPECT_EQ(controller.GetEntryCount(), kMaxEntryCount); - // Navigate twice more more. + // Navigate twice more. for (int url_index = kMaxEntryCount; url_index < kMaxEntryCount + 2; ++url_index) { GURL url(base::StringPrintf("data:text/html,page%d", url_index)); @@ -1567,6 +1567,54 @@ controller.GetLastCommittedEntry()->GetURL()); } +IN_PROC_BROWSER_TEST_P(NavigationControllerBrowserTest, + DontIgnoreRendererInitiatedBackAfterNavEntryLimit) { + NavigationController& controller = shell()->web_contents()->GetController(); + + // The default (50) makes this test too slow and leads to flakes + // (https://crbug.com/1167300). + NavigationControllerImpl::set_max_entry_count_for_testing(10); + + const int kMaxEntryCount = + static_cast<int>(NavigationControllerImpl::max_entry_count()); + + // Load up to the max count, all entries should be there. + for (int url_index = 0; url_index < kMaxEntryCount; ++url_index) { + GURL url(base::StringPrintf("data:text/html,page%d", url_index)); + EXPECT_TRUE(NavigateToURL(shell(), url)); + } + + EXPECT_EQ(controller.GetEntryCount(), kMaxEntryCount); + + // Navigate twice more. + for (int url_index = kMaxEntryCount; url_index < kMaxEntryCount + 2; + ++url_index) { + GURL url(base::StringPrintf("data:text/html,page%d", url_index)); + EXPECT_TRUE(NavigateToURL(shell(), url)); + } + + // We expect page0 and page1 to be gone. + EXPECT_EQ(kMaxEntryCount, controller.GetEntryCount()); + EXPECT_EQ(GURL("data:text/html,page2"), + controller.GetEntryAtIndex(0)->GetURL()); + + // Now try to go back. This should not hang. + ASSERT_TRUE(controller.CanGoBack()); + { + // Renderer-initiated-back. + FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) + ->GetFrameTree() + ->root(); + FrameNavigateParamsCapturer capturer(root); + EXPECT_TRUE(ExecJs(root, "history.back()")); + capturer.Wait(); + } + + // This should have successfully gone back. + EXPECT_EQ(GURL(base::StringPrintf("data:text/html,page%d", kMaxEntryCount)), + controller.GetLastCommittedEntry()->GetURL()); +} + namespace { // Does a renderer-initiated location.replace navigation to |url|, replacing the @@ -18515,6 +18563,151 @@ EXPECT_EQ(base_url, EvalJs(shell(), "document.URL")); } +// Checks that a browser-initiated same-document navigation on a page which has +// a valid base URL preserves the base URL. +// See https://crbug.com/1082141. +IN_PROC_BROWSER_TEST_P(NavigationControllerBrowserTest, + RendererInitiatedBackToLoadDataWithBaseURL) { + // LoadDataWithBaseURL is never subject to --site-per-process policy today + // (this API is only used by Android WebView [where OOPIFs have not shipped + // yet] and GuestView cases [which always hosts guests inside a renderer + // without an origin lock]). Therefore, skip the test in --site-per-process + // mode to avoid renderer kills which won't happen in practice as described + // above. + // + // TODO(https://crbug.com/962643): Consider enabling this test once Android + // Webview or WebView guests support OOPIFs and/or origin locks. + if (AreAllSitesIsolatedForTesting()) + return; + + const GURL base_url("http://baseurl"); + const GURL history_url("http://history"); + const std::string data = "<html><title>One</title><body>foo</body></html>"; + const GURL data_url = GURL("data:text/html;charset=utf-8," + data); + + NavigationControllerImpl& controller = static_cast<NavigationControllerImpl&>( + shell()->web_contents()->GetController()); + + { + TestNavigationObserver same_tab_observer(shell()->web_contents(), 1); + shell()->LoadDataWithBaseURL(history_url, data, base_url); + same_tab_observer.Wait(); + } + + // Verify the last committed NavigationEntry. + NavigationEntryImpl* entry = controller.GetLastCommittedEntry(); + EXPECT_EQ(base_url, entry->GetBaseURLForDataURL()); + EXPECT_EQ(history_url, entry->GetVirtualURL()); + EXPECT_EQ(history_url, entry->GetHistoryURLForDataURL()); + EXPECT_EQ(data_url, entry->GetURL()); + + { + // Make a same-document navigation via history.pushState. + TestNavigationObserver same_tab_observer(shell()->web_contents(), 1); + EXPECT_TRUE(ExecJs(shell(), "history.pushState('', 'test', '#')")); + same_tab_observer.Wait(); + } + + // Verify the last committed NavigationEntry. + entry = controller.GetLastCommittedEntry(); + EXPECT_EQ(base_url, entry->GetBaseURLForDataURL()); + EXPECT_EQ(history_url, entry->GetVirtualURL()); + EXPECT_EQ(history_url, entry->GetHistoryURLForDataURL()); + EXPECT_EQ(data_url, entry->GetURL()); + + { + // Renderer-initiated-back. + FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) + ->GetFrameTree() + ->root(); + FrameNavigateParamsCapturer capturer(root); + EXPECT_TRUE(ExecJs(root, "history.back()")); + capturer.Wait(); + } + + // Verify the last committed NavigationEntry. + entry = controller.GetLastCommittedEntry(); + EXPECT_EQ(base_url, entry->GetBaseURLForDataURL()); + EXPECT_EQ(history_url, entry->GetVirtualURL()); + EXPECT_EQ(history_url, entry->GetHistoryURLForDataURL()); + EXPECT_EQ(data_url, entry->GetURL()); + EXPECT_EQ(base_url, EvalJs(shell(), "document.URL")); +} + +IN_PROC_BROWSER_TEST_P(NavigationControllerBrowserTest, + HistoryNavigationInNewSubframe) { + // This test specifically observes behavior of creating a new frame during a + // history navigation, so disable the back forward cache. + DisableBackForwardCacheForTesting(contents(), + BackForwardCache::TEST_ASSUMES_NO_CACHING); + + NavigationControllerImpl& controller = static_cast<NavigationControllerImpl&>( + shell()->web_contents()->GetController()); + RenderFrameHostImpl* main_frame = + static_cast<WebContentsImpl*>(shell()->web_contents())->GetMainFrame(); + + // Navigate to a page with an iframe. + GURL url1 = + embedded_test_server()->GetURL("/frame_tree/page_with_one_frame.html"); + ASSERT_TRUE(NavigateToURL(shell(), url1)); + GURL iframe_url = main_frame->child_at(0)->current_url(); + + // Navigate away so the iframe is destroyed. + GURL url2(embedded_test_server()->GetURL( + "/navigation_controller/simple_page_1.html")); + ASSERT_TRUE(NavigateToURL(shell(), url2)); + + // Go back (browser-initiated). + ASSERT_TRUE(controller.CanGoBack()); + TestNavigationManager observer(shell()->web_contents(), iframe_url); + controller.GoBack(); + EXPECT_TRUE(observer.WaitForRequestStart()); + + // Check the initial navigation for the new iframe. + NavigationRequest* navigation = main_frame->child_at(0)->navigation_request(); + ASSERT_TRUE(navigation); + EXPECT_TRUE(navigation->IsRendererInitiated()); +} + +IN_PROC_BROWSER_TEST_P(NavigationControllerBrowserTest, + HistoryNavigationInNewSubframeRendererInitiated) { + // This test specifically observes behavior of creating a new frame during a + // history navigation, so disable the back forward cache. + DisableBackForwardCacheForTesting(contents(), + BackForwardCache::TEST_ASSUMES_NO_CACHING); + + NavigationControllerImpl& controller = static_cast<NavigationControllerImpl&>( + shell()->web_contents()->GetController()); + RenderFrameHostImpl* main_frame = + static_cast<WebContentsImpl*>(shell()->web_contents())->GetMainFrame(); + + // Navigate to a page with an iframe. + GURL url1 = + embedded_test_server()->GetURL("/frame_tree/page_with_one_frame.html"); + ASSERT_TRUE(NavigateToURL(shell(), url1)); + GURL iframe_url = main_frame->child_at(0)->current_url(); + + // Navigate away so the iframe is destroyed. + GURL url2(embedded_test_server()->GetURL( + "/navigation_controller/simple_page_1.html")); + ASSERT_TRUE(NavigateToURL(shell(), url2)); + + // Go back (renderer-initiated). + ASSERT_TRUE(controller.CanGoBack()); + TestNavigationManager observer(shell()->web_contents(), iframe_url); + FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) + ->GetFrameTree() + ->root(); + FrameNavigateParamsCapturer capturer(root); + EXPECT_TRUE(ExecJs(root, "history.back()")); + EXPECT_TRUE(observer.WaitForRequestStart()); + + // Check the initial navigation for the new iframe. + NavigationRequest* navigation = main_frame->child_at(0)->navigation_request(); + ASSERT_TRUE(navigation); + EXPECT_TRUE(navigation->IsRendererInitiated()); +} + // Navigate an iframe, then reload it. Check the navigation and the // FrameNavigationEntry are the same in both cases. IN_PROC_BROWSER_TEST_P(NavigationControllerBrowserTest, ReloadFrame) {
diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc index ea2d38d8..8c739e9 100644 --- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc +++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
@@ -427,8 +427,8 @@ for (int test = 0; test < NUM_TESTS; ++test) { int offset = test_offsets[test]; - auto navigation = - NavigationSimulator::CreateHistoryNavigation(offset, contents()); + auto navigation = NavigationSimulator::CreateHistoryNavigation( + offset, contents(), false /* is_renderer_initiated */); navigation->Start(); url_index += offset; // Check that the GoToOffset will land on the expected page. @@ -959,8 +959,8 @@ // Now make a pending back/forward navigation to a privileged entry. // The zeroth entry should be pending. - auto back_navigation = - NavigationSimulator::CreateHistoryNavigation(-1, contents()); + auto back_navigation = NavigationSimulator::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); back_navigation->ReadyToCommit(); EXPECT_EQ(0U, navigation_entry_changed_counter_); EXPECT_EQ(0U, navigation_list_pruned_counter_); @@ -1008,8 +1008,8 @@ navigation_entry_committed_counter_ = 0; // A back navigation comes in from the renderer... - auto back_navigation = - NavigationSimulator::CreateHistoryNavigation(-1, contents()); + auto back_navigation = NavigationSimulator::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); back_navigation->ReadyToCommit(); // ...while the user tries to navigate to a new page... @@ -1473,8 +1473,8 @@ int change_counter = 0; contents()->set_web_preferences_changed_counter(&change_counter); - auto back_navigation = - NavigationSimulator::CreateHistoryNavigation(-1, contents()); + auto back_navigation = NavigationSimulator::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); back_navigation->Start(); EXPECT_FALSE(controller.GetPendingEntry()->GetIsOverridingUserAgent()); back_navigation->Commit(); @@ -1496,8 +1496,8 @@ EXPECT_EQ(1U, navigation_entry_committed_counter_); navigation_entry_committed_counter_ = 0; - auto back_navigation = - NavigationSimulator::CreateHistoryNavigation(-1, contents()); + auto back_navigation = NavigationSimulator::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); back_navigation->Start(); EXPECT_EQ(0U, navigation_entry_changed_counter_); EXPECT_EQ(0U, navigation_list_pruned_counter_); @@ -1561,8 +1561,8 @@ EXPECT_EQ(1U, navigation_entry_committed_counter_); navigation_entry_committed_counter_ = 0; - auto navigation = - NavigationSimulator::CreateHistoryNavigation(-1, contents()); + auto navigation = NavigationSimulator::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); navigation->Start(); EXPECT_EQ(0U, navigation_entry_changed_counter_); EXPECT_EQ(0U, navigation_list_pruned_counter_); @@ -1653,8 +1653,8 @@ blink::mojom::UserActivationUpdateType::kNotifyActivation, blink::mojom::UserActivationNotificationType::kTest); - auto forward_navigation = - NavigationSimulator::CreateHistoryNavigation(1, contents()); + auto forward_navigation = NavigationSimulator::CreateHistoryNavigation( + 1, contents(), false /* is_renderer_initiated */); forward_navigation->Start(); // We should now have a pending navigation to go forward. EXPECT_EQ(controller.GetEntryCount(), 2); @@ -1722,8 +1722,8 @@ blink::mojom::UserActivationUpdateType::kNotifyActivation, blink::mojom::UserActivationNotificationType::kTest); - auto forward_navigation = - NavigationSimulator::CreateHistoryNavigation(1, contents()); + auto forward_navigation = NavigationSimulator::CreateHistoryNavigation( + 1, contents(), false /* is_renderer_initiated */); forward_navigation->Start(); EXPECT_EQ(0U, navigation_list_pruned_counter_); @@ -2473,8 +2473,8 @@ // Go back, but don't commit yet. Check that we can't delete the current // and pending entries. - auto back_navigation = - NavigationSimulator::CreateHistoryNavigation(-1, contents()); + auto back_navigation = NavigationSimulator::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); back_navigation->Start(); EXPECT_FALSE(controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1)); EXPECT_FALSE(controller.RemoveEntryAtIndex(controller.GetEntryCount() - 2)); @@ -2514,8 +2514,8 @@ // Go back, but don't commit yet. Check that we can't delete the current // and pending entries. - auto back_navigation = - NavigationSimulator::CreateHistoryNavigation(-1, contents()); + auto back_navigation = NavigationSimulator::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); back_navigation->Start(); EXPECT_FALSE(controller.RemoveEntryAtIndex(2)); EXPECT_FALSE(controller.RemoveEntryAtIndex(1)); @@ -4029,8 +4029,8 @@ EXPECT_EQ(0, controller.GetCurrentEntryIndex()); // Start going forward to page B. - auto forward_navigation = - NavigationSimulator::CreateHistoryNavigation(1, contents()); + auto forward_navigation = NavigationSimulator::CreateHistoryNavigation( + 1, contents(), false /* is_renderer_initiated */); forward_navigation->ReadyToCommit(); // But the renderer unilaterally navigates to page C, pruning B.
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc index 0cf13e14..e53ad0b 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc
@@ -729,7 +729,14 @@ // for all renderer-initiated navigations (e.g. see // VerifyBeginNavigationCommonParams), but as a defense-in-depth this is // also asserted below. - CHECK(navigation_request->browser_initiated()); + // History navigations are exempt from this rule because, although they can + // be renderer-initaited via the js history API, the renderer does not + // choose the url being navigated to. A renderer-initiated history + // navigation may therefore navigate back to a previous browser-initiated + // loadDataWithBaseUrl. + CHECK(navigation_request->browser_initiated() || + NavigationTypeUtils::IsHistory( + navigation_request->common_params().navigation_type)); // loadDataWithBaseUrl submits a data: |common_params.url| (which has a // opaque origin), but commits that URL as if it came from @@ -1312,7 +1319,6 @@ previous_page_ukm_source_id_( frame_tree_node_->current_frame_host()->GetPageUkmSourceId()), is_pdf_(is_pdf) { - DCHECK(browser_initiated || common_params_->initiator_origin.has_value()); DCHECK(!blink::IsRendererDebugURL(common_params_->url)); DCHECK(common_params_->method == "POST" || !common_params_->post_data); DCHECK_EQ(common_params_->url, commit_params_->original_url);
diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc index 30633dc..034aaf1 100644 --- a/content/browser/renderer_host/navigator.cc +++ b/content/browser/renderer_host/navigator.cc
@@ -340,14 +340,20 @@ } // A renderer-initiated navigation should be ignored iff a) there is an ongoing -// request b) which is browser initiated and c) the renderer request is not -// user-initiated. +// request b) which is browser initiated or a history traversal and c) the +// renderer request is not user-initiated. +// Renderer-initiated history traversals cause navigations to be ignored for +// compatibility reasons - this behavior is asserted by several web platform +// tests. // static bool Navigator::ShouldIgnoreIncomingRendererRequest( const NavigationRequest* ongoing_navigation_request, bool has_user_gesture) { return ongoing_navigation_request && - ongoing_navigation_request->browser_initiated() && !has_user_gesture; + (ongoing_navigation_request->browser_initiated() || + NavigationTypeUtils::IsHistory( + ongoing_navigation_request->common_params().navigation_type)) && + !has_user_gesture; } NavigatorDelegate* Navigator::GetDelegate() {
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc index 604f4e75..1a09a6e 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -1415,7 +1415,9 @@ GlobalRenderFrameHostId(GetProcess()->GetID(), routing_id_), this); g_token_frame_map.Get().insert(std::make_pair(frame_token_, this)); site_instance_->AddObserver(this); - GetProcess()->AddObserver(this); + auto* process = GetProcess(); + process->IncrementRfhCount(); + process->AddObserver(this); GetSiteInstance()->IncrementActiveFrameCount(); if (parent_) { @@ -1547,8 +1549,10 @@ g_token_frame_map.Get().erase(frame_token_); + auto* process = GetProcess(); + process->DecrementRfhCount(); site_instance_->RemoveObserver(this); - GetProcess()->RemoveObserver(this); + process->RemoveObserver(this); const bool was_created = is_render_frame_created(); render_frame_state_ = RenderFrameState::kDeleted; @@ -5597,7 +5601,7 @@ frame_tree_->controller().GoToOffsetInSandboxedFrame( offset, GetFrameTreeNodeId()); } else { - frame_tree_->controller().GoToOffset(offset); + frame_tree_->controller().GoToOffsetFromRenderer(offset); } } } @@ -6182,9 +6186,16 @@ bool right_aligned, bool allow_multiple_selection) { #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) + // Do not open popups in an inactive document. if (!IsActive()) { - local_frame_host_receiver_.ReportBadMessage( - "RFHI: Attempt to show popup menu in an inactive document"); + // Sending this message requires user activation, which is impossible + // for a prerendering document, so the renderer process should be + // terminated. See + // https://html.spec.whatwg.org/multipage/interaction.html#tracking-user-activation. + if (lifecycle_state() == LifecycleStateImpl::kPrerendering) { + bad_message::ReceivedBadMessage( + GetProcess(), bad_message::RFH_POPUP_REQUEST_WHILE_PRERENDERING); + } return; } @@ -6873,13 +6884,16 @@ blink_popup_widget_host, mojo::PendingAssociatedReceiver<blink::mojom::WidgetHost> blink_widget_host, mojo::PendingAssociatedRemote<blink::mojom::Widget> blink_widget) { - // Sending this message requires user activation, which is impossible - // for an inactive document, so the renderer process should be terminated. - // See - // https://html.spec.whatwg.org/multipage/interaction.html#tracking-user-activation. + // Do not open popups in an inactive document. if (!IsActive()) { - local_frame_host_receiver_.ReportBadMessage( - "RFHI: Create a popup widget in an inactive document"); + // Sending this message requires user activation, which is impossible + // for a prerendering document, so the renderer process should be + // terminated. See + // https://html.spec.whatwg.org/multipage/interaction.html#tracking-user-activation. + if (lifecycle_state() == LifecycleStateImpl::kPrerendering) { + bad_message::ReceivedBadMessage( + GetProcess(), bad_message::RFH_POPUP_REQUEST_WHILE_PRERENDERING); + } return; }
diff --git a/content/browser/renderer_host/render_frame_host_manager_unittest.cc b/content/browser/renderer_host/render_frame_host_manager_unittest.cc index d7081501..a078a2cf 100644 --- a/content/browser/renderer_host/render_frame_host_manager_unittest.cc +++ b/content/browser/renderer_host/render_frame_host_manager_unittest.cc
@@ -1139,8 +1139,8 @@ // mojo::AgentSchedulingGroupHost::DidUnloadRenderFrame isn't received. This // shouldn't happen, but we have seen it when going back quickly across many // entries (http://crbug.com/93427). - auto back_navigation1 = - NavigationSimulatorImpl::CreateHistoryNavigation(-1, contents()); + auto back_navigation1 = NavigationSimulatorImpl::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); back_navigation1->ReadyToCommit(); EXPECT_FALSE(rfh2->is_waiting_for_beforeunload_completion());
diff --git a/content/browser/renderer_host/render_process_host_browsertest.cc b/content/browser/renderer_host/render_process_host_browsertest.cc index 577b75f..5b093b4d 100644 --- a/content/browser/renderer_host/render_process_host_browsertest.cc +++ b/content/browser/renderer_host/render_process_host_browsertest.cc
@@ -2,11 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string> + #include "base/bind.h" #include "base/callback_helpers.h" #include "base/command_line.h" #include "base/run_loop.h" #include "base/scoped_observation.h" +#include "base/strings/string_split.h" #include "base/synchronization/waitable_event.h" #include "base/test/test_timeouts.h" #include "base/threading/hang_watcher.h" @@ -46,6 +49,7 @@ #include "media/mojo/buildflags.h" #include "mojo/public/cpp/bindings/remote.h" #include "net/dns/mock_host_resolver.h" +#include "net/http/http_status_code.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" @@ -65,12 +69,6 @@ class DelayedHttpResponseWithResolver final : public net::test_server::BasicHttpResponse { public: - struct ResponseWithCallbacks final { - net::test_server::SendBytesCallback send_callback; - net::test_server::SendCompleteCallback done_callback; - std::string response_string; - }; - class Resolver final : public base::RefCountedThreadSafe<Resolver> { public: void Resolve() { @@ -82,17 +80,17 @@ return; } - task_runner_->PostTask( - FROM_HERE, - base::BindOnce(&Resolver::ResolveInServerTaskRunner, this)); + for (auto& response : response_closures_) + task_runner_->PostTask(FROM_HERE, std::move(response)); + + response_closures_.clear(); } - void Add(ResponseWithCallbacks response) { + void Add(base::OnceClosure response) { base::AutoLock auto_lock(lock_); if (resolved_) { - response.send_callback.Run(response.response_string, - std::move(response.done_callback)); + std::move(response).Run(); return; } @@ -104,25 +102,16 @@ task_runner_ = std::move(task_runner); } - responses_with_callbacks_.push_back(std::move(response)); + response_closures_.push_back(std::move(response)); } private: - void ResolveInServerTaskRunner() { - auto responses_with_callbacks = std::move(responses_with_callbacks_); - for (auto& response_with_callbacks : responses_with_callbacks) { - response_with_callbacks.send_callback.Run( - response_with_callbacks.response_string, - std::move(response_with_callbacks.done_callback)); - } - } - friend class base::RefCountedThreadSafe<Resolver>; ~Resolver() = default; base::Lock lock_; - std::vector<ResponseWithCallbacks> responses_with_callbacks_; + std::vector<base::OnceClosure> response_closures_; bool resolved_ GUARDED_BY(lock_) = false; scoped_refptr<base::SingleThreadTaskRunner> task_runner_ GUARDED_BY(lock_); }; @@ -135,9 +124,12 @@ DelayedHttpResponseWithResolver& operator=( const DelayedHttpResponseWithResolver&) = delete; - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) override { - resolver_->Add({send, std::move(done), ToResponseString()}); + void SendResponse( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) override { + resolver_->Add(base::BindOnce( + &net::test_server::HttpResponseDelegate::SendHeadersContentAndFinish, + delegate, code(), GetHttpReasonPhrase(code()), BuildHeaders(), + content())); } private:
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index fd68285..c6d07bd7 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1675,6 +1675,7 @@ keep_alive_ref_count_(0), worker_ref_count_(0), shutdown_delay_ref_count_(0), + render_frame_host_count_(0), are_ref_counts_disabled_(false), visible_clients_(0), priority_(!blink::kLaunchingProcessIsBackgrounded, @@ -2843,6 +2844,20 @@ return result.str(); } +size_t RenderProcessHostImpl::GetShutdownDelayRefCount() const { + return shutdown_delay_ref_count_; +} + +void RenderProcessHostImpl::IncrementRfhCount() { + render_frame_host_count_++; +} +void RenderProcessHostImpl::DecrementRfhCount() { + render_frame_host_count_--; +} +int RenderProcessHostImpl::GetRfhCount() const { + return render_frame_host_count_; +} + void RenderProcessHostImpl::IncrementWorkerRefCount() { DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(!are_ref_counts_disabled_);
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h index 30916df..ac4ba21c 100644 --- a/content/browser/renderer_host/render_process_host_impl.h +++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -248,6 +248,10 @@ void IncrementKeepAliveRefCount(uint64_t handle_id_) override; void DecrementKeepAliveRefCount(uint64_t handle_id_) override; std::string GetKeepAliveDurations() const override; + size_t GetShutdownDelayRefCount() const override; + void IncrementRfhCount() override; + void DecrementRfhCount() override; + int GetRfhCount() const override; void IncrementWorkerRefCount() override; void DecrementWorkerRefCount() override; void DisableRefCounts() override; @@ -963,6 +967,10 @@ // We track the start-time for each |handle_id|, for crashkey reporting. base::flat_map<uint64_t, base::Time> keep_alive_start_times_; + // Diagnostic code for https://crbug/1148542. This will be removed prior to + // resolving that issue. + int render_frame_host_count_; + // Set in DisableRefCounts(). When true, |keep_alive_ref_count_| and // |worker_ref_count_|, and |shutdown_delay_ref_count_| must no longer be // modified.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index e521c7a..00cb460e 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -943,6 +943,17 @@ visual_properties.screen_infos = GetScreenInfos(); auto& current_screen_info = visual_properties.screen_infos.mutable_current(); + // For testing, override the raster color profile. + // Note: this needs to be done here and not earlier in the pipeline because + // Mac uses the display color space to update an NSSurface and this setting + // is only for "raster" color space. + if (display::Display::HasForceRasterColorProfile()) { + for (auto& screen_info : visual_properties.screen_infos.screen_infos) { + screen_info.display_color_spaces = gfx::DisplayColorSpaces( + display::Display::GetForcedRasterColorProfile()); + } + } + visual_properties.is_fullscreen_granted = delegate_->IsFullscreen(); visual_properties.window_controls_overlay_rect = delegate_->GetWindowsControlsOverlayRect(); @@ -2114,65 +2125,7 @@ return display::ScreenInfos(current_screen_info); } - // Get displays from RenderWidgetHostView, not directly from display::Screen. - // This helps maintain consistency with the legacy singular GetScreenInfo(). - // For example, Mac may cache display info from a remote process NSWindow. - const std::vector<display::Display>& displays = view_->GetDisplays(); - - // Just return the legacy singular ScreenInfo, if its id is invalid or if the - // display::Screen is not initialized; each of which occurs in various tests. - // When there are no valid displays, some platforms can also create a - // fake default Display as well (e.g. Display::GetDefaultDisplay). - if (current_screen_info.display_id == display::kInvalidDisplayId || - current_screen_info.display_id == display::kDefaultDisplayId || - displays.empty()) { - return display::ScreenInfos(current_screen_info); - } - - // Build multi-screen info from the displays returned by RenderWidgetHostView, - // ensure its legacy singular screen info struct is included in this set. - display::ScreenInfos result; - bool current_display_added = false; - for (const auto& display : displays) { - if (display.id() == current_screen_info.display_id) { - DCHECK(!current_display_added); - result.screen_infos.push_back(current_screen_info); - result.current_display_id = current_screen_info.display_id; - current_display_added = true; - continue; - } - display::ScreenInfo screen_info; - display::DisplayUtil::DisplayToScreenInfo(&screen_info, display); - result.screen_infos.push_back(screen_info); - } - - if (current_display_added) - return result; - - // TODO(enne): temporary debugging logic. GetScreens() is called during - // frequent visual property updates, and so will crash even when the - // multi-screen window placement api is not enabled. Instead of CHECK, do a - // dump here so we can check if this is happening without having a full-on - // browser crash. - static bool have_crash_dumped = false; - if (!have_crash_dumped) { - have_crash_dumped = true; - - SCOPED_CRASH_KEY_NUMBER("GetScreenInfos", "display_id", - current_screen_info.display_id); - SCOPED_CRASH_KEY_NUMBER("GetScreenInfos", "num_displays", displays.size()); - - std::string display_ids; - for (const auto& display : displays) { - base::StringAppendF(&display_ids, "%" PRId64 ",", display.id()); - } - SCOPED_CRASH_KEY_STRING256("GetScreenInfos", "displays", display_ids); - - base::debug::DumpWithoutCrashing(); - } - - // Fall back to legacy screen info, if we are in a bad state. - return display::ScreenInfos(current_screen_info); + return view_->GetScreenInfos(); } void RenderWidgetHostImpl::GetSnapshotFromBrowser(
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index d8ec1d1..13386d72 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -155,6 +155,9 @@ void GetScreenInfo(display::ScreenInfo* screen_info) override { *screen_info = screen_info_; } + display::ScreenInfos GetScreenInfos() override { + return display::ScreenInfos(screen_info_); + } const WebTouchEvent& acked_event() const { return acked_event_; } int acked_event_count() const { return acked_event_count_; }
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc index 251157d..2060fa5 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -46,6 +46,13 @@ g_alloc_dealloc_tracker_map = LAZY_INSTANCE_INITIALIZER; } // namespace +const display::ScreenInfo MakeDefaultScreenInfo() { + // Construct a fake ScreenInfo with a valid display id. + display::ScreenInfo screen_info; + screen_info.display_id = display::kDefaultDisplayId; + return screen_info; +} + namespace content { // static @@ -60,14 +67,10 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase(RenderWidgetHost* host) : host_(RenderWidgetHostImpl::From(host)), - display_list_({display::Display(display::kDefaultDisplayId)}, - /*primary_id=*/display::kDefaultDisplayId, - /*current_id=*/display::kDefaultDisplayId) { - // `display_list_` must be initialized, to permit unconditional access to its - // current Display object. A placeholder Display is used here, so the first - // call to UpdateScreenInfo will trigger the expected updates. - CHECK(display_list_.IsValidAndHasPrimaryAndCurrentDisplays()); - + // `screen_infos_` must be initialized, to permit unconditional access to + // its current display. A placeholder ScreenInfo is used here, so the + // first call to UpdateScreenInfo will trigger the expected updates. + screen_infos_({MakeDefaultScreenInfo()}) { g_alloc_dealloc_tracker_map.Get()[this]++; } @@ -510,14 +513,24 @@ NOTREACHED(); } -const std::vector<display::Display>& RenderWidgetHostViewBase::GetDisplays() - const { +display::ScreenInfos RenderWidgetHostViewBase::GetScreenInfos() { // Get the latest info directly from display::Screen, like GetScreenInfo(). // TODO(crbug.com/1169312): Unify display info caching and change detection. - if (auto* screen = display::Screen::GetScreen()) - return screen->GetAllDisplays(); - static const base::NoDestructor<std::vector<display::Display>> kEmptyDisplays; - return *kEmptyDisplays; + // GetScreenInfos should be made non-virtual to just return screen_infos_. + // GetScreenInfo should go away and callers should use GetScreenInfos. + // UpdateScreenInfo should be the only updater of screen_infos. + if (auto* screen = display::Screen::GetScreen()) { + gfx::NativeView native_view = GetNativeView(); + const auto& display = native_view + ? screen->GetDisplayNearestView(native_view) + : screen->GetPrimaryDisplay(); + return screen->GetScreenInfosNearestDisplay(display.id()); + } + + // If there is no screen, create fake ScreenInfos (for tests). + display::ScreenInfo screen_info; + screen_info.display_id = display::kDefaultDisplayId; + return display::ScreenInfos(screen_info); } void RenderWidgetHostViewBase::UpdateScreenInfo() { @@ -540,31 +553,30 @@ host()->delegate()->SendScreenRects(); } - const display::DisplayList new_display_list = - display::Screen::GetScreen()->GetDisplayListNearestViewWithFallbacks( - GetNativeView()); - // TODO(crbug.com/1169312): Unify display info caching and change detection. - const bool has_display_property_changed = display_list_ != new_display_list; + auto new_screen_infos = GetScreenInfos(); + + if (screen_infos_ == new_screen_infos && !force_sync_visual_properties) + return; + const bool has_rotation_changed = - display_list_.GetCurrentDisplay().rotation() != - new_display_list.GetCurrentDisplay().rotation(); + screen_infos_.current().orientation_angle != + new_screen_infos.current().orientation_angle; + screen_infos_ = std::move(new_screen_infos); - if (has_display_property_changed || force_sync_visual_properties) { - display_list_ = new_display_list; - - // Notify the associated RenderWidgetHostImpl when screen info has changed. - // That will synchronize visual properties needed for frame tree rendering - // and for web platform APIs that expose screen and window info and events. - if (host()) { - OnSynchronizedDisplayPropertiesChanged(has_rotation_changed); - host()->NotifyScreenInfoChanged(); - } + // Notify the associated RenderWidgetHostImpl when screen info has changed. + // That will synchronize visual properties needed for frame tree rendering + // and for web platform APIs that expose screen and window info and events. + if (host()) { + OnSynchronizedDisplayPropertiesChanged(has_rotation_changed); + host()->NotifyScreenInfoChanged(); } } float RenderWidgetHostViewBase::GetCurrentDeviceScaleFactor() const { - return display_list_.GetCurrentDisplay().device_scale_factor(); + // TODO(enne): consolidate this GetCurrentDeviceScaleFactor() function with + // GetDeviceScaleFactor(). + return screen_infos_.current().device_scale_factor; } void RenderWidgetHostViewBase::DidUnregisterFromTextInputManager( @@ -609,7 +621,7 @@ } void RenderWidgetHostViewBase::GetScreenInfo(display::ScreenInfo* screen_info) { - display::DisplayUtil::GetNativeViewScreenInfo(screen_info, GetNativeView()); + *screen_info = GetScreenInfos().current(); } float RenderWidgetHostViewBase::GetDeviceScaleFactor() {
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index b3f79d5..0c73b9e 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -42,7 +42,7 @@ #include "ui/base/ime/text_input_mode.h" #include "ui/base/ime/text_input_type.h" #include "ui/display/display.h" -#include "ui/display/display_list.h" +#include "ui/display/screen_infos.h" #include "ui/events/event_constants.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/native_widget_types.h" @@ -169,8 +169,8 @@ virtual void SendInitialPropertiesIfNeeded() {} - // Get display info known to this view; must be consistent with GetScreenInfo. - virtual const std::vector<display::Display>& GetDisplays() const; + // Get ScreenInfos known to this view. + virtual display::ScreenInfos GetScreenInfos(); // Called when screen information or native widget bounds change. virtual void UpdateScreenInfo(); @@ -596,7 +596,7 @@ WidgetType widget_type_ = WidgetType::kFrame; // Cached information about the renderer's display environment. - display::DisplayList display_list_; + display::ScreenInfos screen_infos_; // Indicates whether keyboard lock is active for this view. bool keyboard_locked_ = false;
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.cc b/content/browser/renderer_host/render_widget_host_view_child_frame.cc index 175c9ff..d25859c 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame.cc +++ b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -131,11 +131,8 @@ SetParentFrameSinkId(parent_view->GetFrameSinkId()); } - // TODO(crbug.com/1182855): Use the parent_view's entire display::DisplayList. - display::Display display = display_list_.GetCurrentDisplay(); - display.set_device_scale_factor( - frame_connector_->screen_info().device_scale_factor); - display_list_.UpdateDisplay(display); + // TODO(crbug.com/1182855): Use the parent_view's entire display::ScreenInfos. + screen_infos_ = display::ScreenInfos(frame_connector_->screen_info()); auto* root_view = frame_connector_->GetRootRenderWidgetHostView(); if (root_view) {
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h index e7a1a34..2b262cc 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -155,7 +155,7 @@ void TransformPointToRootSurface(gfx::PointF* point) override; gfx::Rect GetBoundsInRootWindow() override; - const std::vector<display::Display>& GetDisplays() const override; + display::ScreenInfos GetScreenInfos() override; void UpdateScreenInfo() override; viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties( const cc::RenderFrameMetadata& metadata) override; @@ -334,7 +334,7 @@ bool attached_to_window) override; void OnWindowFrameInScreenChanged( const gfx::Rect& window_frame_in_screen_dip) override; - void OnDisplaysChanged(const display::DisplayList& display_list) override; + void OnScreenInfosChanged(const display::ScreenInfos& screen_infos) override; void BeginKeyboardEvent() override; void EndKeyboardEvent() override; void ForwardKeyboardEventWithCommands( @@ -410,7 +410,7 @@ void DestroyCompositorForShutdown() override; bool OnBrowserCompositorSurfaceIdChanged() override; std::vector<viz::SurfaceId> CollectSurfaceIdsForEviction() override; - const display::DisplayList& GetDisplayList() const override; + display::ScreenInfo GetCurrentScreenInfo() const override; void SetCurrentDeviceScaleFactor(float device_scale_factor) override; // AcceleratedWidgetMacNSView implementation. @@ -667,13 +667,13 @@ // this is focused. ui::AccessibilityFocusOverrider accessibility_focus_overrider_; - // Holds the latest display list sent from the remote process to be used + // Holds the latest ScreenInfos sent from the remote process to be used // in UpdateScreenInfo. Other platforms check display::Screen for the current // set of displays, but Mac has this info delivered explicitly and so can't do // that. This is therefore an out-of-band parameter to UpdateScreenInfo. - // This also allows the display_list_ to only be updated outside of resize by + // This also allows the screen_infos_ to only be updated outside of resize by // holding any updates temporarily in this variable. - absl::optional<display::DisplayList> new_display_list_from_shim_; + absl::optional<display::ScreenInfos> new_screen_infos_from_shim_; // Represents a feature of the physical display whose offset and mask_length // are expressed in DIPs relative to the view. See display_feature.h for more
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index 922e51e..d1aae9c 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -111,15 +111,13 @@ return host()->CollectSurfaceIdsForEviction(); } -const display::DisplayList& RenderWidgetHostViewMac::GetDisplayList() const { - return display_list_; +display::ScreenInfo RenderWidgetHostViewMac::GetCurrentScreenInfo() const { + return screen_infos_.current(); } void RenderWidgetHostViewMac::SetCurrentDeviceScaleFactor( float device_scale_factor) { - display::Display display = display_list_.GetCurrentDisplay(); - display.set_device_scale_factor(device_scale_factor); - display_list_.UpdateDisplay(display); + screen_infos_.mutable_current().device_scale_factor = device_scale_factor; } //////////////////////////////////////////////////////////////////////////////// @@ -199,9 +197,9 @@ // Guess that the initial screen we will be on is the screen of the current // window (since that's the best guess that we have, and is usually right). // https://crbug.com/357443 - display_list_ = - display::Screen::GetScreen()->GetDisplayListNearestWindowWithFallbacks( - [NSApp keyWindow]); + auto* screen = display::Screen::GetScreen(); + screen_infos_ = screen->GetScreenInfosNearestDisplay( + screen->GetDisplayNearestWindow([NSApp keyWindow]).id()); viz::FrameSinkId frame_sink_id = host()->GetFrameSinkId(); @@ -426,18 +424,7 @@ } void RenderWidgetHostViewMac::GetScreenInfo(display::ScreenInfo* screen_info) { - const display::Display& display = display_list_.GetCurrentDisplay(); - display::DisplayUtil::DisplayToScreenInfo(screen_info, display); - // Recalculate some ScreenInfo properties from the cached screen info, which - // may originate from a remote process that hosts the associated NSWindow. - // DisplayToScreenInfo derives some properties from the latest display::Screen - // info observed directly in this process, which may be intermittently - // out-of-sync with remote info. Also, RenderWidgetHostViewMac does not - // update its cached screen info during auto-resize. - // TODO(crbug.com/1194700): Pass cached remote process screen info to - // DisplayToScreenInfo; it should not use local process info internally. - screen_info->is_extended = display_list_.displays().size() > 1; - screen_info->is_primary = display.id() == display_list_.primary_id(); + *screen_info = screen_infos_.current(); } void RenderWidgetHostViewMac::Show() { @@ -746,14 +733,13 @@ SetTooltipText(tooltip_text); } -const std::vector<display::Display>& RenderWidgetHostViewMac::GetDisplays() - const { - // Return cached screen info, which may originate from a remote process that +display::ScreenInfos RenderWidgetHostViewMac::GetScreenInfos() { + // Return cached screen infos, which may originate from a remote process that // hosts the associated NSWindow. The latest display::Screen info observed // directly in this process may be intermittently out-of-sync with that info. // Also, RenderWidgetHostViewMac does not update its cached screen info // during auto-resize. - return display_list_.displays(); + return screen_infos_; } void RenderWidgetHostViewMac::UpdateScreenInfo() { @@ -761,7 +747,8 @@ // other properties of the NSView or pertinent NSScreens. Propagate these to // the RenderWidgetHostImpl as well. - display_link_ = ui::DisplayLinkMac::GetForDisplay(display_list_.current_id()); + display_link_ = + ui::DisplayLinkMac::GetForDisplay(screen_infos_.current().display_id); if (!display_link_) { // Note that on some headless systems, the display link will fail to be // created, so this should not be a fatal error. @@ -781,14 +768,13 @@ // Update with the latest display list from the remote process if needed. bool current_display_changed = false; bool any_display_changed = false; - if (new_display_list_from_shim_.has_value()) { + if (new_screen_infos_from_shim_.has_value()) { current_display_changed = - new_display_list_from_shim_->GetCurrentDisplay() != - display_list_.GetCurrentDisplay(); - any_display_changed = new_display_list_from_shim_.value() != display_list_; + new_screen_infos_from_shim_->current() != screen_infos_.current(); + any_display_changed = new_screen_infos_from_shim_.value() != screen_infos_; - display_list_ = new_display_list_from_shim_.value(); - new_display_list_from_shim_.reset(); + screen_infos_ = new_screen_infos_from_shim_.value(); + new_screen_infos_from_shim_.reset(); } bool dip_size_changed = view_bounds_in_window_dip_.size() != browser_compositor_->GetRendererSize(); @@ -1595,14 +1581,14 @@ host()->SendScreenRects(); } -void RenderWidgetHostViewMac::OnDisplaysChanged( - const display::DisplayList& display_list) { - // Cache this screen info, which may originate from a remote process that +void RenderWidgetHostViewMac::OnScreenInfosChanged( + const display::ScreenInfos& screen_infos) { + // Cache the screen infos, which may originate from a remote process that // hosts the associated NSWindow. The latest display::Screen info observed // directly in this process may be intermittently out-of-sync with that info. // Also, BrowserCompositorMac and RenderWidgetHostViewMac do not update their // cached screen info during auto-resize. - new_display_list_from_shim_ = display_list; + new_screen_infos_from_shim_ = screen_infos; UpdateScreenInfo(); }
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc index 182577e..2b0f059 100644 --- a/content/browser/service_worker/service_worker_browsertest.cc +++ b/content/browser/service_worker/service_worker_browsertest.cc
@@ -22,6 +22,7 @@ #include "base/scoped_observation.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -73,8 +74,10 @@ #include "content/test/content_browser_test_utils_internal.h" #include "content/test/test_content_browser_client.h" #include "media/media_buildflags.h" +#include "net/base/test_completion_callback.h" #include "net/cert/cert_status_flags.h" #include "net/dns/mock_host_resolver.h" +#include "net/http/http_status_code.h" #include "net/test/embedded_test_server/default_handlers.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_request.h" @@ -1159,8 +1162,8 @@ return client->GetUserAgent(); } - private: - base::test::ScopedFeatureList scoped_feature_list_; + private: + base::test::ScopedFeatureList scoped_feature_list_; }; IN_PROC_BROWSER_TEST_P(UserAgentServiceWorkerBrowserTest, NavigatorUserAgent) { @@ -1388,10 +1391,13 @@ } void RegisterCustomResponse(const std::string& relative_url, - const std::string& response) { - embedded_test_server()->RegisterRequestHandler(base::BindRepeating( - &ServiceWorkerNavigationPreloadTest::CustomRequestHandler, - base::Unretained(this), relative_url, response)); + const net::HttpStatusCode code, + const absl::optional<std::string>& reason, + const base::StringPairs& headers, + const std::string& content) { + embedded_test_server()->RegisterRequestHandler( + base::BindRepeating(&self::CustomRequestHandler, base::Unretained(this), + relative_url, code, reason, headers, content)); } void RegisterKeepSearchRedirect(const std::string& relative_url, @@ -1424,21 +1430,29 @@ private: class CustomResponse : public net::test_server::HttpResponse { public: - explicit CustomResponse(const std::string& response) - : response_(response) {} + explicit CustomResponse(const net::HttpStatusCode code, + const absl::optional<std::string>& reason, + const base::StringPairs& headers, + const std::string& content) + : code_(code), reason_(reason), headers_(headers), content_(content) {} CustomResponse(const CustomResponse&) = delete; CustomResponse& operator=(const CustomResponse&) = delete; ~CustomResponse() override {} - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) override { - send.Run(response_, std::move(done)); + void SendResponse(base::WeakPtr<net::test_server::HttpResponseDelegate> + delegate) override { + delegate->SendHeadersContentAndFinish( + code_, reason_.value_or(net::GetHttpReasonPhrase(code_)), headers_, + content_); } private: - const std::string response_; + net::HttpStatusCode code_; + absl::optional<std::string> reason_; + base::StringPairs headers_; + std::string content_; }; std::unique_ptr<net::test_server::HttpResponse> StaticRequestHandler( @@ -1459,12 +1473,15 @@ std::unique_ptr<net::test_server::HttpResponse> CustomRequestHandler( const std::string& relative_url, - const std::string& response, + const net::HttpStatusCode code, + const absl::optional<std::string>& reason, + const base::StringPairs& headers, + const std::string& content, const net::test_server::HttpRequest& request) const { const size_t query_position = request.relative_url.find('?'); if (request.relative_url.substr(0, query_position) != relative_url) return nullptr; - return std::make_unique<CustomResponse>(response); + return std::make_unique<CustomResponse>(code, reason, headers, content); } std::unique_ptr<net::test_server::HttpResponse> KeepSearchRedirectHandler( @@ -1932,20 +1949,17 @@ PreloadHeadersCustom) { const char kPageUrl[] = "/service_worker/navigation_preload.html"; const char kWorkerUrl[] = "/service_worker/navigation_preload.js"; - const char kPageResponse[] = - "HTTP/1.1 201 HELLOWORLD\r\n" - "Connection: close\r\n" - "Content-Length: 32\r\n" - "Content-Type: text/html\r\n" - "Custom-Header: pen pineapple\r\n" - "Custom-Header: apple pen\r\n" - "Set-Cookie: COOKIE1\r\n" - "Set-Cookie2: COOKIE2\r\n" - "\r\n" - "<title>ERROR</title>Hello world."; + const base::StringPairs kPageResponseHeaders = { + {"Connection", "close"}, {"Content-Length", "32"}, + {"Content-Type", "text/html"}, {"Custom-Header", "pen pineapple"}, + {"Custom-Header", "apple pen"}, {"Set-Cookie", "COOKIE1"}, + {"Set-Cookie2", "COOKIE2"}, + }; + const char kPageResonseContent[] = "<title>ERROR</title>Hello world."; const GURL page_url = embedded_test_server()->GetURL(kPageUrl); const GURL worker_url = embedded_test_server()->GetURL(kWorkerUrl); - RegisterCustomResponse(kPageUrl, kPageResponse); + RegisterCustomResponse(kPageUrl, net::HTTP_CREATED, "HELLOWORLD", + kPageResponseHeaders, kPageResonseContent); RegisterStaticFile( kWorkerUrl, kEnableNavigationPreloadScript + kPreloadResponseTestScript, "text/javascript"); @@ -1979,16 +1993,17 @@ "/service_worker/navigation_preload_redirected1.html"; const char kRedirectedPageUrl2[] = "/service_worker/navigation_preload_redirected2.html"; - const char kPageResponse[] = - "HTTP/1.1 302 Found\r\n" - "Connection: close\r\n" - "Location: /service_worker/navigation_preload_redirected1.html\r\n" - "Location: /service_worker/navigation_preload_redirected2.html\r\n" - "\r\n"; + const base::StringPairs kPageResponseHeaders = { + // "HTTP/1.1 302 Found\r\n" + {"Connection", "close"}, + {"Location", "/service_worker/navigation_preload_redirected1.html"}, + {"Location", "/service_worker/navigation_preload_redirected2.html"}, + }; const char kRedirectedPage[] = "<title>ERROR</title>Redirected page."; const GURL page_url = embedded_test_server()->GetURL(kPageUrl); const GURL worker_url = embedded_test_server()->GetURL(kWorkerUrl); - RegisterCustomResponse(kPageUrl, kPageResponse); + RegisterCustomResponse(kPageUrl, net::HTTP_FOUND, "FOUND", + kPageResponseHeaders, ""); RegisterStaticFile( kWorkerUrl, kEnableNavigationPreloadScript + kPreloadResponseTestScript, "text/javascript"); @@ -2012,14 +2027,15 @@ InvalidRedirect_InvalidLocation) { const char kPageUrl[] = "/service_worker/navigation_preload.html"; const char kWorkerUrl[] = "/service_worker/navigation_preload.js"; - const char kPageResponse[] = - "HTTP/1.1 302 Found\r\n" - "Connection: close\r\n" - "Location: http://\r\n" - "\r\n"; + const base::StringPairs kPageResponseHeaders = { + // "HTTP/1.1 302 Found\r\n" + {"Connection", "close"}, + {"Location", "http://"}, + }; const GURL page_url = embedded_test_server()->GetURL(kPageUrl); const GURL worker_url = embedded_test_server()->GetURL(kWorkerUrl); - RegisterCustomResponse(kPageUrl, kPageResponse); + RegisterCustomResponse(kPageUrl, net::HTTP_FOUND, "FOUND", + kPageResponseHeaders, ""); RegisterStaticFile( kWorkerUrl, kEnableNavigationPreloadScript + kPreloadResponseTestScript, "text/javascript"); @@ -3041,10 +3057,10 @@ : owner_(std::move(owner)) {} ~Inner() override = default; - void SendResponse(const net::test_server::SendBytesCallback& send, - base::OnceClosure done) override { + void SendResponse(base::WeakPtr<net::test_server::HttpResponseDelegate> + delegate) override { if (owner_) - owner_->SendResponse(std::move(send), std::move(done)); + owner_->SendResponse(delegate); } private: @@ -3062,11 +3078,10 @@ // Called by the EmbeddedTestServer via our inner class. The callbacks // are stored and invoked later when we've been told to unblock. - void SendResponse(const net::test_server::SendBytesCallback& send, - base::OnceClosure done) { + void SendResponse( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) { DCHECK(task_runner_->RunsTasksInCurrentSequence()); - send_ = send; - done_ = std::move(done); + delegate_ = delegate; if (should_block_) { blocking_ = true; return; @@ -3097,22 +3112,24 @@ void CompleteResponseOnTaskRunner() { DCHECK(task_runner_->RunsTasksInCurrentSequence()); - const char kPageResponse[] = - "HTTP/1.1 200 HELLOWORLD\r\n" - "Connection: close\r\n" - "Content-Length: 32\r\n" - "Content-Type: text/html\r\n" - "Cache-Control: no-store\r\n" - "\r\n" - "<title>ERROR</title>Hello world."; - std::move(send_).Run(kPageResponse, std::move(done_)); + const base::StringPairs kPageHeaders = { + // "HTTP/1.1 200 HELLOWORLD\r\n" + {"Connection", "close"}, + {"Content-Length", "32"}, + {"Content-Type", "text/html"}, + {"Cache-Control", "no-store"}, + }; + const char kPageContents[] = "<title>ERROR</title>Hello world."; + if (delegate_) { + delegate_->SendHeadersContentAndFinish(net::HTTP_OK, "HELLOWORLD", + kPageHeaders, kPageContents); + } } // Accessed on any thread. scoped_refptr<base::SequencedTaskRunner> task_runner_; // All other members only accessed on |task_runner_| sequence. - net::test_server::SendBytesCallback send_; - base::OnceClosure done_; + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate_ = nullptr; bool should_block_ = true; bool blocking_ = false; base::WeakPtrFactory<BlockingResponse> weak_factory_{this};
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index 676c182..113fa97 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -123,6 +123,7 @@ #include "media/base/media_switches.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "net/dns/mock_host_resolver.h" +#include "net/http/mock_http_cache.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" @@ -8469,12 +8470,11 @@ private: // Called on the test server's thread. - void AddDelayedResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) { - // Just create a closure that closes the socket without sending a response. - // This will propagate an error to the underlying request. - send_response_closures_.push_back( - base::BindOnce(send, "", std::move(done))); + void AddDelayedResponse( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) { + response_closures_.push_back(base::BindOnce( + &net::test_server::HttpResponseDelegate::SendHeadersContentAndFinish, + delegate, net::HTTP_OK, "OK", base::StringPairs(), "")); } // Custom embedded test server handler. Looks for requests matching @@ -8508,21 +8508,20 @@ if (it.second > 0) return; } - for (auto& it : send_response_closures_) { + for (auto& it : response_closures_) std::move(it).Run(); - } } - // This class passes the callbacks needed to respond to a request to the + // This class passes the delegates needed to respond to a request to the // underlying test fixture. class DelayedResponse : public net::test_server::BasicHttpResponse { public: explicit DelayedResponse( RequestDelayingSitePerProcessBrowserTest* test_harness) : test_harness_(test_harness) {} - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) override { - test_harness_->AddDelayedResponse(send, std::move(done)); + void SendResponse(base::WeakPtr<net::test_server::HttpResponseDelegate> + delegate) override { + test_harness_->AddDelayedResponse(delegate); } private: @@ -8531,9 +8530,9 @@ DISALLOW_COPY_AND_ASSIGN(DelayedResponse); }; - // Set of closures to call which will complete delayed requests. May only be + // Set of delegates to call which will complete delayed requests. May only be // modified on the test_server_'s thread. - std::vector<base::OnceClosure> send_response_closures_; + std::vector<base::OnceClosure> response_closures_; // Map from URL paths to the number of requests to delay for that particular // path. Initialized on the UI thread but modified and read on the test
diff --git a/content/browser/storage_partition_impl_unittest.cc b/content/browser/storage_partition_impl_unittest.cc index d3575a55..08d54fd 100644 --- a/content/browser/storage_partition_impl_unittest.cc +++ b/content/browser/storage_partition_impl_unittest.cc
@@ -669,11 +669,15 @@ storage::kFileSystemTypePluginPrivate); storage::FileSystemQuotaUtil* quota_util = backend->GetQuotaUtil(); - // Determine the set of origins used. - std::vector<url::Origin> origins = - quota_util->GetOriginsForTypeOnFileTaskRunner( + // Determine the set of StorageKeys used. + std::vector<blink::StorageKey> storage_keys = + quota_util->GetStorageKeysForTypeOnFileTaskRunner( storage::kFileSystemTypePluginPrivate); - *data_exists_for_origin = base::Contains(origins, origin); + // TODO(https://crbug.com/1231162): determine whether EME/CDM/plugin private + // file system will be partitioned; if so, replace the in-line conversion + // with the correct third-party StorageKey. + *data_exists_for_origin = + base::Contains(storage_keys, blink::StorageKey(origin)); // AwaitCompletionHelper and MessageLoop don't work on a // SequencedTaskRunner, so post a task on the IO thread.
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc index ebd9b10..b628e11 100644 --- a/content/browser/web_contents/web_contents_impl_unittest.cc +++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -641,8 +641,8 @@ // Going back should switch SiteInstances again. The first SiteInstance is // stored in the NavigationEntry, so it should be the same as at the start. // We should use the same RFH as before, swapping it back in. - auto back_navigation = - NavigationSimulator::CreateHistoryNavigation(-1, contents()); + auto back_navigation = NavigationSimulator::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); back_navigation->ReadyToCommit(); TestRenderFrameHost* goback_rfh = contents()->GetSpeculativePrimaryMainFrame(); @@ -1227,8 +1227,8 @@ NavigationEntryImpl::FromNavigationEntry(entry3)->site_instance()); // Go back within the site. - auto back_navigation1 = - NavigationSimulatorImpl::CreateHistoryNavigation(-1, contents()); + auto back_navigation1 = NavigationSimulatorImpl::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); back_navigation1->Start(); auto* first_pending_rfh = contents()->GetSpeculativePrimaryMainFrame(); @@ -1245,8 +1245,8 @@ // Before that commits, go back again. back_navigation1->ReadyToCommit(); - auto back_navigation2 = - NavigationSimulatorImpl::CreateHistoryNavigation(-1, contents()); + auto back_navigation2 = NavigationSimulatorImpl::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); back_navigation2->Start(); EXPECT_TRUE(contents()->CrossProcessNavigationPending()); EXPECT_TRUE(contents()->GetSpeculativePrimaryMainFrame()); @@ -1366,8 +1366,8 @@ NavigationEntryImpl::FromNavigationEntry(entry3)->site_instance()); // Go back within the site. - auto back_navigation1 = - NavigationSimulator::CreateHistoryNavigation(-1, contents()); + auto back_navigation1 = NavigationSimulator::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); back_navigation1->ReadyToCommit(); if (will_change_site_instance) { EXPECT_TRUE(contents()->CrossProcessNavigationPending()); @@ -1377,8 +1377,8 @@ EXPECT_EQ(entry2, controller().GetPendingEntry()); // Before that commits, go back again. - auto back_navigation2 = - NavigationSimulatorImpl::CreateHistoryNavigation(-1, contents()); + auto back_navigation2 = NavigationSimulatorImpl::CreateHistoryNavigation( + -1, contents(), false /* is_renderer_initiated */); back_navigation2->set_drop_unload_ack(true); back_navigation2->ReadyToCommit(); EXPECT_TRUE(contents()->CrossProcessNavigationPending());
diff --git a/content/browser/webauth/authenticator_common.cc b/content/browser/webauth/authenticator_common.cc index fa6712a..a3af1082 100644 --- a/content/browser/webauth/authenticator_common.cc +++ b/content/browser/webauth/authenticator_common.cc
@@ -337,128 +337,6 @@ std::min(kAdjustedTimeoutUpper, *timeout)); } -blink::mojom::MakeCredentialAuthenticatorResponsePtr -CreateMakeCredentialResponse( - const std::string& client_data_json, - device::AuthenticatorMakeCredentialResponse response_data, - AttestationErasureOption attestation_erasure, - const base::flat_set<RequestExtension>& requested_extensions) { - auto response = blink::mojom::MakeCredentialAuthenticatorResponse::New(); - auto common_info = blink::mojom::CommonCredentialInfo::New(); - common_info->client_data_json.assign(client_data_json.begin(), - client_data_json.end()); - common_info->authenticator_data = response_data.attestation_object() - .authenticator_data() - .SerializeToByteArray(); - common_info->raw_id = response_data.attestation_object().GetCredentialId(); - common_info->id = Base64UrlEncode(common_info->raw_id); - response->info = std::move(common_info); - - // The transport list must not contain duplicates but the order doesn't matter - // because Blink will sort the resulting strings before returning them. - std::vector<device::FidoTransportProtocol> transports; - if (response_data.transport_used()) { - transports.push_back(*response_data.transport_used()); - } - // If the attestation certificate specifies that the token supports any other - // transports, include them in the list. - absl::optional<base::span<const uint8_t>> leaf_cert = - response_data.attestation_object() - .attestation_statement() - .GetLeafCertificate(); - if (leaf_cert) { - AppendUniqueTransportsFromCertificate(*leaf_cert, &transports); - } - - response->transports = std::move(transports); - - bool did_create_hmac_secret = false; - bool did_store_cred_blob = false; - const absl::optional<cbor::Value>& maybe_extensions = - response_data.attestation_object().authenticator_data().extensions(); - if (maybe_extensions) { - DCHECK(maybe_extensions->is_map()); - const cbor::Value::MapValue& extensions = maybe_extensions->GetMap(); - - const auto hmac_secret_it = - extensions.find(cbor::Value(device::kExtensionHmacSecret)); - if (hmac_secret_it != extensions.end() && - hmac_secret_it->second.is_bool() && hmac_secret_it->second.GetBool()) { - did_create_hmac_secret = true; - } - - const auto cred_blob_it = - extensions.find(cbor::Value(device::kExtensionCredBlob)); - if (cred_blob_it != extensions.end() && cred_blob_it->second.is_bool() && - cred_blob_it->second.GetBool()) { - did_store_cred_blob = true; - } - } - - for (const RequestExtension ext : requested_extensions) { - switch (ext) { - case RequestExtension::kPRF: - response->echo_prf = true; - response->prf = did_create_hmac_secret; - break; - case RequestExtension::kHMACSecret: - response->echo_hmac_create_secret = true; - response->hmac_create_secret = did_create_hmac_secret; - break; - case RequestExtension::kCredProps: - response->echo_cred_props = true; - if (response_data.is_resident_key) { - response->has_cred_props_rk = true; - response->cred_props_rk = *response_data.is_resident_key; - } - break; - case RequestExtension::kLargeBlobEnable: - response->echo_large_blob = true; - response->supports_large_blob = - response_data.large_blob_key().has_value(); - break; - case RequestExtension::kCredBlob: - response->echo_cred_blob = true; - response->cred_blob = did_store_cred_blob; - break; - case RequestExtension::kAppID: - case RequestExtension::kLargeBlobRead: - case RequestExtension::kLargeBlobWrite: - case RequestExtension::kGetCredBlob: - NOTREACHED(); - break; - } - } - - switch (attestation_erasure) { - case AttestationErasureOption::kIncludeAttestation: - break; - case AttestationErasureOption::kEraseAttestationButIncludeAaguid: - response_data.EraseAttestationStatement( - device::AttestationObject::AAGUID::kInclude); - break; - case AttestationErasureOption::kEraseAttestationAndAaguid: - response_data.EraseAttestationStatement( - device::AttestationObject::AAGUID::kErase); - break; - } - response->attestation_object = - response_data.GetCBOREncodedAttestationObject(); - - const device::PublicKey* public_key = response_data.attestation_object() - .authenticator_data() - .attested_data() - ->public_key(); - response->public_key_algo = public_key->algorithm; - const absl::optional<std::vector<uint8_t>>& public_key_der = - public_key->der_bytes; - if (public_key_der) { - response->public_key_der.emplace(public_key_der.value()); - } - - return response; -} - bool UsesDiscoverableCreds(const device::MakeCredentialOptions& options) { return options.resident_key == device::ResidentKeyRequirement::kRequired; } @@ -720,89 +598,6 @@ WebContents::FromRenderFrameHost(GetRenderFrameHost())); } -blink::mojom::GetAssertionAuthenticatorResponsePtr -AuthenticatorCommon::CreateGetAssertionResponse( - device::AuthenticatorGetAssertionResponse response_data) { - auto response = blink::mojom::GetAssertionAuthenticatorResponse::New(); - auto common_info = blink::mojom::CommonCredentialInfo::New(); - common_info->client_data_json.assign(client_data_json_.begin(), - client_data_json_.end()); - common_info->raw_id = response_data.credential->id(); - common_info->id = Base64UrlEncode(common_info->raw_id); - response->info = std::move(common_info); - response->info->authenticator_data = - response_data.authenticator_data.SerializeToByteArray(); - response->signature = response_data.signature; - response->has_transport = transport_.has_value(); - if (response->has_transport) - response->transport = *transport_; - response_data.user_entity - ? response->user_handle.emplace(response_data.user_entity->id) - : response->user_handle.emplace(); - - for (RequestExtension ext : requested_extensions_) { - switch (ext) { - case RequestExtension::kAppID: - DCHECK(app_id_); - response->echo_appid_extension = true; - if (response_data.authenticator_data.application_parameter() == - CreateApplicationParameter(*app_id_)) { - response->appid_extension = true; - } - break; - case RequestExtension::kPRF: { - response->echo_prf = true; - absl::optional<base::span<const uint8_t>> hmac_secret = - response_data.hmac_secret; - if (hmac_secret) { - auto prf_values = blink::mojom::PRFValues::New(); - DCHECK(hmac_secret->size() == 32 || hmac_secret->size() == 64); - prf_values->first = device::fido_parsing_utils::Materialize( - hmac_secret->subspan(0, 32)); - if (hmac_secret->size() == 64) { - prf_values->second = device::fido_parsing_utils::Materialize( - hmac_secret->subspan(32, 32)); - } - response->prf_results = std::move(prf_values); - } else { - response->prf_not_evaluated = response_data.hmac_secret_not_evaluated; - } - break; - } - case RequestExtension::kLargeBlobRead: - response->echo_large_blob = true; - response->large_blob = response_data.large_blob; - break; - case RequestExtension::kLargeBlobWrite: - response->echo_large_blob = true; - response->echo_large_blob_written = true; - response->large_blob_written = response_data.large_blob_written; - break; - case RequestExtension::kGetCredBlob: { - response->echo_get_cred_blob = true; - const absl::optional<cbor::Value>& extensions = - response_data.authenticator_data.extensions(); - if (extensions) { - const cbor::Value::MapValue& map = extensions->GetMap(); - const auto& it = map.find(cbor::Value(device::kExtensionCredBlob)); - if (it != map.end() && it->second.is_bytestring()) { - response->get_cred_blob = it->second.GetBytestring(); - } - } - break; - } - case RequestExtension::kHMACSecret: - case RequestExtension::kCredProps: - case RequestExtension::kLargeBlobEnable: - case RequestExtension::kCredBlob: - NOTREACHED(); - break; - } - } - - return response; -} - void AuthenticatorCommon::OnLargeBlobCompressed( data_decoder::DataDecoder::ResultOrError<mojo_base::BigBuffer> result) { ctap_get_assertion_request_->large_blob_write = @@ -1477,15 +1272,14 @@ DCHECK(response_data.has_value()); DCHECK(authenticator); - const absl::optional<device::FidoTransportProtocol> transport_used = - authenticator->AuthenticatorTransport(); + transport_ = authenticator->AuthenticatorTransport(); bool is_transport_used_internal = false; bool is_transport_used_cable = false; - if (transport_used) { + if (transport_) { is_transport_used_internal = - *transport_used == device::FidoTransportProtocol::kInternal; + *transport_ == device::FidoTransportProtocol::kInternal; is_transport_used_cable = - *transport_used == + *transport_ == device::FidoTransportProtocol::kCloudAssistedBluetoothLowEnergy; } @@ -1560,9 +1354,8 @@ if (attestation_erasure.has_value()) { CompleteMakeCredentialRequest( blink::mojom::AuthenticatorStatus::SUCCESS, - CreateMakeCredentialResponse( - client_data_json_, std::move(*response_data), - *attestation_erasure, requested_extensions_), + CreateMakeCredentialResponse(std::move(*response_data), + *attestation_erasure), Focus::kDoCheck); } @@ -1610,8 +1403,8 @@ CompleteMakeCredentialRequest( blink::mojom::AuthenticatorStatus::SUCCESS, - CreateMakeCredentialResponse(client_data_json_, std::move(response_data), - attestation_erasure, requested_extensions_), + CreateMakeCredentialResponse(std::move(response_data), + attestation_erasure), Focus::kDoCheck); } @@ -1788,6 +1581,129 @@ CancelWithStatus(error_awaiting_user_acknowledgement_); } +blink::mojom::MakeCredentialAuthenticatorResponsePtr +AuthenticatorCommon::CreateMakeCredentialResponse( + device::AuthenticatorMakeCredentialResponse response_data, + AttestationErasureOption attestation_erasure) { + auto response = blink::mojom::MakeCredentialAuthenticatorResponse::New(); + auto common_info = blink::mojom::CommonCredentialInfo::New(); + common_info->client_data_json.assign(client_data_json_.begin(), + client_data_json_.end()); + common_info->authenticator_data = response_data.attestation_object() + .authenticator_data() + .SerializeToByteArray(); + common_info->raw_id = response_data.attestation_object().GetCredentialId(); + common_info->id = Base64UrlEncode(common_info->raw_id); + response->info = std::move(common_info); + + // The transport list must not contain duplicates but the order doesn't matter + // because Blink will sort the resulting strings before returning them. + std::vector<device::FidoTransportProtocol> transports; + if (response_data.transport_used()) { + transports.push_back(*response_data.transport_used()); + } + // If the attestation certificate specifies that the token supports any other + // transports, include them in the list. + absl::optional<base::span<const uint8_t>> leaf_cert = + response_data.attestation_object() + .attestation_statement() + .GetLeafCertificate(); + if (leaf_cert) { + AppendUniqueTransportsFromCertificate(*leaf_cert, &transports); + } + + response->transports = std::move(transports); + response->has_transport = transport_.has_value(); + if (response->has_transport) + response->transport = *transport_; + + bool did_create_hmac_secret = false; + bool did_store_cred_blob = false; + const absl::optional<cbor::Value>& maybe_extensions = + response_data.attestation_object().authenticator_data().extensions(); + if (maybe_extensions) { + DCHECK(maybe_extensions->is_map()); + const cbor::Value::MapValue& extensions = maybe_extensions->GetMap(); + + const auto hmac_secret_it = + extensions.find(cbor::Value(device::kExtensionHmacSecret)); + if (hmac_secret_it != extensions.end() && + hmac_secret_it->second.is_bool() && hmac_secret_it->second.GetBool()) { + did_create_hmac_secret = true; + } + + const auto cred_blob_it = + extensions.find(cbor::Value(device::kExtensionCredBlob)); + if (cred_blob_it != extensions.end() && cred_blob_it->second.is_bool() && + cred_blob_it->second.GetBool()) { + did_store_cred_blob = true; + } + } + + for (const RequestExtension ext : requested_extensions_) { + switch (ext) { + case RequestExtension::kPRF: + response->echo_prf = true; + response->prf = did_create_hmac_secret; + break; + case RequestExtension::kHMACSecret: + response->echo_hmac_create_secret = true; + response->hmac_create_secret = did_create_hmac_secret; + break; + case RequestExtension::kCredProps: + response->echo_cred_props = true; + if (response_data.is_resident_key) { + response->has_cred_props_rk = true; + response->cred_props_rk = *response_data.is_resident_key; + } + break; + case RequestExtension::kLargeBlobEnable: + response->echo_large_blob = true; + response->supports_large_blob = + response_data.large_blob_key().has_value(); + break; + case RequestExtension::kCredBlob: + response->echo_cred_blob = true; + response->cred_blob = did_store_cred_blob; + break; + case RequestExtension::kAppID: + case RequestExtension::kLargeBlobRead: + case RequestExtension::kLargeBlobWrite: + case RequestExtension::kGetCredBlob: + NOTREACHED(); + break; + } + } + + switch (attestation_erasure) { + case AttestationErasureOption::kIncludeAttestation: + break; + case AttestationErasureOption::kEraseAttestationButIncludeAaguid: + response_data.EraseAttestationStatement( + device::AttestationObject::AAGUID::kInclude); + break; + case AttestationErasureOption::kEraseAttestationAndAaguid: + response_data.EraseAttestationStatement( + device::AttestationObject::AAGUID::kErase); + break; + } + response->attestation_object = + response_data.GetCBOREncodedAttestationObject(); + + const device::PublicKey* public_key = response_data.attestation_object() + .authenticator_data() + .attested_data() + ->public_key(); + response->public_key_algo = public_key->algorithm; + const absl::optional<std::vector<uint8_t>>& public_key_der = + public_key->der_bytes; + if (public_key_der) { + response->public_key_der.emplace(public_key_der.value()); + } + + return response; +} + void AuthenticatorCommon::CompleteMakeCredentialRequest( blink::mojom::AuthenticatorStatus status, blink::mojom::MakeCredentialAuthenticatorResponsePtr response, @@ -1804,6 +1720,89 @@ Cleanup(); } +blink::mojom::GetAssertionAuthenticatorResponsePtr +AuthenticatorCommon::CreateGetAssertionResponse( + device::AuthenticatorGetAssertionResponse response_data) { + auto response = blink::mojom::GetAssertionAuthenticatorResponse::New(); + auto common_info = blink::mojom::CommonCredentialInfo::New(); + common_info->client_data_json.assign(client_data_json_.begin(), + client_data_json_.end()); + common_info->raw_id = response_data.credential->id(); + common_info->id = Base64UrlEncode(common_info->raw_id); + response->info = std::move(common_info); + response->info->authenticator_data = + response_data.authenticator_data.SerializeToByteArray(); + response->signature = response_data.signature; + response->has_transport = transport_.has_value(); + if (response->has_transport) + response->transport = *transport_; + response_data.user_entity + ? response->user_handle.emplace(response_data.user_entity->id) + : response->user_handle.emplace(); + + for (RequestExtension ext : requested_extensions_) { + switch (ext) { + case RequestExtension::kAppID: + DCHECK(app_id_); + response->echo_appid_extension = true; + if (response_data.authenticator_data.application_parameter() == + CreateApplicationParameter(*app_id_)) { + response->appid_extension = true; + } + break; + case RequestExtension::kPRF: { + response->echo_prf = true; + absl::optional<base::span<const uint8_t>> hmac_secret = + response_data.hmac_secret; + if (hmac_secret) { + auto prf_values = blink::mojom::PRFValues::New(); + DCHECK(hmac_secret->size() == 32 || hmac_secret->size() == 64); + prf_values->first = device::fido_parsing_utils::Materialize( + hmac_secret->subspan(0, 32)); + if (hmac_secret->size() == 64) { + prf_values->second = device::fido_parsing_utils::Materialize( + hmac_secret->subspan(32, 32)); + } + response->prf_results = std::move(prf_values); + } else { + response->prf_not_evaluated = response_data.hmac_secret_not_evaluated; + } + break; + } + case RequestExtension::kLargeBlobRead: + response->echo_large_blob = true; + response->large_blob = response_data.large_blob; + break; + case RequestExtension::kLargeBlobWrite: + response->echo_large_blob = true; + response->echo_large_blob_written = true; + response->large_blob_written = response_data.large_blob_written; + break; + case RequestExtension::kGetCredBlob: { + response->echo_get_cred_blob = true; + const absl::optional<cbor::Value>& extensions = + response_data.authenticator_data.extensions(); + if (extensions) { + const cbor::Value::MapValue& map = extensions->GetMap(); + const auto& it = map.find(cbor::Value(device::kExtensionCredBlob)); + if (it != map.end() && it->second.is_bytestring()) { + response->get_cred_blob = it->second.GetBytestring(); + } + } + break; + } + case RequestExtension::kHMACSecret: + case RequestExtension::kCredProps: + case RequestExtension::kLargeBlobEnable: + case RequestExtension::kCredBlob: + NOTREACHED(); + break; + } + } + + return response; +} + void AuthenticatorCommon::CompleteGetAssertionRequest( blink::mojom::AuthenticatorStatus status, blink::mojom::GetAssertionAuthenticatorResponsePtr response) {
diff --git a/content/browser/webauth/authenticator_common.h b/content/browser/webauth/authenticator_common.h index 0a087da8..dd4a8da7 100644 --- a/content/browser/webauth/authenticator_common.h +++ b/content/browser/webauth/authenticator_common.h
@@ -126,6 +126,12 @@ kDontCheck, }; + enum class AttestationErasureOption { + kIncludeAttestation, + kEraseAttestationButIncludeAaguid, + kEraseAttestationAndAaguid, + }; + // Replaces the current |request_| with a |MakeCredentialRequestHandler|, // effectively restarting the request. void StartMakeCredentialRequest(bool allow_skipping_pin_touch); @@ -136,10 +142,6 @@ bool IsFocused() const; - // Creates an assertion response. - blink::mojom::GetAssertionAuthenticatorResponsePtr CreateGetAssertionResponse( - device::AuthenticatorGetAssertionResponse response_data); - // Callback to handle the large blob being compressed before attempting to // start a request. void OnLargeBlobCompressed( @@ -190,12 +192,22 @@ AuthenticatorRequestClientDelegate::InterestingFailureReason reason, blink::mojom::AuthenticatorStatus status); + // Creates a make credential response + blink::mojom::MakeCredentialAuthenticatorResponsePtr + CreateMakeCredentialResponse( + device::AuthenticatorMakeCredentialResponse response_data, + AttestationErasureOption attestation_erasure); + // Runs |make_credential_response_callback_| and then Cleanup(). void CompleteMakeCredentialRequest( blink::mojom::AuthenticatorStatus status, blink::mojom::MakeCredentialAuthenticatorResponsePtr response = nullptr, Focus focus_check = Focus::kDontCheck); + // Creates a get assertion response. + blink::mojom::GetAssertionAuthenticatorResponsePtr CreateGetAssertionResponse( + device::AuthenticatorGetAssertionResponse response_data); + // Runs |get_assertion_callback_| and then Cleanup(). void CompleteGetAssertionRequest( blink::mojom::AuthenticatorStatus status,
diff --git a/content/browser/webauth/authenticator_impl_unittest.cc b/content/browser/webauth/authenticator_impl_unittest.cc index 4e94e189..467b2fa1 100644 --- a/content/browser/webauth/authenticator_impl_unittest.cc +++ b/content/browser/webauth/authenticator_impl_unittest.cc
@@ -3952,10 +3952,11 @@ for (const device::FidoTransportProtocol transport : {device::FidoTransportProtocol::kUsbHumanInterfaceDevice, device::FidoTransportProtocol::kBluetoothLowEnergy, - device::FidoTransportProtocol::kNearFieldCommunication}) { + device::FidoTransportProtocol::kNearFieldCommunication, + device::FidoTransportProtocol::kInternal}) { ResetVirtualDevice(); virtual_device_factory_->SetSupportedProtocol( - device::ProtocolVersion::kU2f); + device::ProtocolVersion::kCtap2); virtual_device_factory_->SetTransport(transport); virtual_device_factory_->mutable_state()->transport = transport; @@ -3964,6 +3965,7 @@ MakeCredentialResult create_result = AuthenticatorMakeCredential(std::move(create_options)); ASSERT_EQ(create_result.status, AuthenticatorStatus::SUCCESS); + EXPECT_EQ(create_result.response->transport, transport); PublicKeyCredentialRequestOptionsPtr get_options = GetTestPublicKeyCredentialRequestOptions(); @@ -3971,7 +3973,6 @@ device::CredentialType::kPublicKey, create_result.response->info->raw_id, {transport}); get_options->allow_credentials = {std::move(public_key)}; - GetAssertionResult get_result = AuthenticatorGetAssertion(std::move(get_options)); ASSERT_EQ(get_result.status, AuthenticatorStatus::SUCCESS);
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 458c384..f5867f6 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -394,7 +394,8 @@ {"WebAppTabStrip", features::kDesktopPWAsTabStrip}, {"WebAppWindowControlsOverlay", features::kWebAppWindowControlsOverlay}, - {"WebAuthAssertionTransport", features::kWebAuthAssertionTransport}, + {"WebAuthAuthenticatorAttachment", + features::kWebAuthAuthenticatorAttachment}, {"WebAuthenticationConditionalUI", features::kWebAuthConditionalUI}, {"SyncLoadDataUrlFonts", blink::features::kSyncLoadDataUrlFonts}, };
diff --git a/content/common/render_widget_host_ns_view.mojom b/content/common/render_widget_host_ns_view.mojom index 611df45..6a53b67 100644 --- a/content/common/render_widget_host_ns_view.mojom +++ b/content/common/render_widget_host_ns_view.mojom
@@ -10,7 +10,7 @@ import "ui/base/mojom/attributed_string.mojom"; import "ui/base/cursor/mojom/cursor.mojom"; import "ui/base/ime/mojom/ime_types.mojom"; -import "ui/display/mojom/display_list.mojom"; +import "ui/display/mojom/screen_infos.mojom"; import "ui/events/mojom/event.mojom"; import "ui/gfx/geometry/mojom/geometry.mojom"; import "ui/gfx/mojom/ca_layer_params.mojom"; @@ -140,7 +140,7 @@ gfx.mojom.Rect window_frame_in_screen_dip); // Indicate changes to the NSScreen hosting the NSView, or other NSScreens. - OnDisplaysChanged(display.mojom.DisplayList display_list); + OnScreenInfosChanged(display.mojom.ScreenInfos screen_infos); // Indicate the begin and end block of a keyboard event. The beginning of this // block will record the active RenderWidgetHost, and will forward all
diff --git a/content/public/browser/navigation_controller.h b/content/public/browser/navigation_controller.h index b97cdce9..7b6b69c 100644 --- a/content/public/browser/navigation_controller.h +++ b/content/public/browser/navigation_controller.h
@@ -436,7 +436,8 @@ virtual void GoBack() = 0; virtual void GoForward() = 0; - // Navigates to the specified absolute index. + // Navigates to the specified absolute index. Should only be used for + // browser-initiated navigations. virtual void GoToIndex(int index) = 0; // Navigates to the specified offset from the "current entry". Does nothing if
diff --git a/content/public/browser/navigation_handle.h b/content/public/browser/navigation_handle.h index 92f1a855..7185c8a 100644 --- a/content/public/browser/navigation_handle.h +++ b/content/public/browser/navigation_handle.h
@@ -125,13 +125,13 @@ // * <a> link click // * changing window.location.href // * redirect via the <meta http-equiv="refresh"> tag - // * using window.history.pushState + // * using window.history.pushState() or window.history.replaceState() + // * using window.history.forward() or window.history.back() // // This method returns false for browser-initiated navigations, including: // * any navigation initiated from the omnibox // * navigations via suggestions in browser UI // * navigations via browser UI: Ctrl-R, refresh/forward/back/home buttons - // * using window.history.forward() or window.history.back() // * any other "explicit" URL navigations, e.g. bookmarks virtual bool IsRendererInitiated() = 0; @@ -425,6 +425,12 @@ // Returns, if available, the origin of the document that has initiated the // navigation for this NavigationHandle. + // NOTE: If this is a history navigation, the initiator origin will be the + // origin that initiated the *original* navigation, not the history + // navigation. This means that if there was no initiator origin for the + // original navigation, but the history navigation was initiated by + // javascript, the initiator origin will be null even though + // IsRendererInitiated() returns true. virtual const absl::optional<url::Origin>& GetInitiatorOrigin() = 0; // Retrieves any DNS aliases for the requested URL. The alias chain order
diff --git a/content/public/browser/render_process_host.h b/content/public/browser/render_process_host.h index 8a9bb46..7ca636b 100644 --- a/content/public/browser/render_process_host.h +++ b/content/public/browser/render_process_host.h
@@ -412,6 +412,17 @@ // https://crbug.com/1148542 are known. virtual std::string GetKeepAliveDurations() const = 0; + // Returns the number of active Shutdown-Delay requests. + // For debugging only. TODO(wjmaclean): Remove once the causes behind + // https://crbug.com/1148542 are known. + virtual size_t GetShutdownDelayRefCount() const = 0; + // Diagnostic code for https://crbug/1148542. This will be removed prior to + // resolving that issue. They're included to allow MockRenderProcessHost to + // override them, and should not be called from outside of content/. + virtual void IncrementRfhCount() = 0; + virtual void DecrementRfhCount() = 0; + virtual int GetRfhCount() const = 0; + // "Worker ref count" is similar to "Keep alive ref count", but is specific to // workers since they do not have pre-defined timeouts. Also affected by // DisableRefCounts() in the same manner as for
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index a00714e..937f09c 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -553,11 +553,6 @@ const base::Feature kPepperCrossOriginRedirectRestriction{ "PepperCrossOriginRedirectRestriction", base::FEATURE_ENABLED_BY_DEFAULT}; -// All ProcessHost objects live on UI thread. -// https://crbug.com/904556 -const base::Feature kProcessHostOnUI{"ProcessHostOnUI", - base::FEATURE_ENABLED_BY_DEFAULT}; - // Enable in-browser script loading for a brand new service worker. const base::Feature kPlzServiceWorker{"PlzServiceWorker", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -959,8 +954,9 @@ base::FEATURE_ENABLED_BY_DEFAULT}; // Controls whether WebAuthn assertion transport is enabled. -const base::Feature kWebAuthAssertionTransport{ - "WebAuthenticationAssertionTransport", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kWebAuthAuthenticatorAttachment{ + "WebAuthenticationAuthenticatorAttachment", + base::FEATURE_DISABLED_BY_DEFAULT}; // Controls whether CTAP2 devices can communicate via the WebAuthentication API // using pairingless BLE protocol.
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 182ab1e..eee5857 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -141,7 +141,6 @@ CONTENT_EXPORT extern const base::Feature kFeaturePolicyHeader; CONTENT_EXPORT extern const base::Feature kPepper3DImageChromium; CONTENT_EXPORT extern const base::Feature kPepperCrossOriginRedirectRestriction; -CONTENT_EXPORT extern const base::Feature kProcessHostOnUI; CONTENT_EXPORT extern const base::Feature kPlzServiceWorker; CONTENT_EXPORT extern const base::Feature kHighPriorityBeforeUnload; CONTENT_EXPORT extern const base::Feature kPrioritizeBootstrapTasks; @@ -243,7 +242,7 @@ CONTENT_EXPORT extern const base::Feature kWebAssemblyTiering; CONTENT_EXPORT extern const base::Feature kWebAssemblyTrapHandler; CONTENT_EXPORT extern const base::Feature kWebAuth; -CONTENT_EXPORT extern const base::Feature kWebAuthAssertionTransport; +CONTENT_EXPORT extern const base::Feature kWebAuthAuthenticatorAttachment; CONTENT_EXPORT extern const base::Feature kWebAuthCable; CONTENT_EXPORT extern const base::Feature kWebAuthConditionalUI; CONTENT_EXPORT extern const base::Feature kWebBluetoothNewPermissionsBackend;
diff --git a/content/public/test/mock_render_process_host.cc b/content/public/test/mock_render_process_host.cc index d1bd32b..53a9d77 100644 --- a/content/public/test/mock_render_process_host.cc +++ b/content/public/test/mock_render_process_host.cc
@@ -401,6 +401,18 @@ return std::string("MockRenderProcessHost: durations not tracked."); } +size_t MockRenderProcessHost::GetShutdownDelayRefCount() const { + return 0; +} + +void MockRenderProcessHost::IncrementRfhCount() {} + +void MockRenderProcessHost::DecrementRfhCount() {} + +int MockRenderProcessHost::GetRfhCount() const { + return 0; +} + void MockRenderProcessHost::IncrementWorkerRefCount() { ++worker_ref_count_; }
diff --git a/content/public/test/mock_render_process_host.h b/content/public/test/mock_render_process_host.h index a9d6662..c325b09 100644 --- a/content/public/test/mock_render_process_host.h +++ b/content/public/test/mock_render_process_host.h
@@ -161,6 +161,10 @@ void IncrementKeepAliveRefCount(uint64_t handle_id) override; void DecrementKeepAliveRefCount(uint64_t handle_id) override; std::string GetKeepAliveDurations() const override; + size_t GetShutdownDelayRefCount() const override; + void IncrementRfhCount() override; + void DecrementRfhCount() override; + int GetRfhCount() const override; void DisableRefCounts() override; void IncrementWorkerRefCount() override; void DecrementWorkerRefCount() override;
diff --git a/content/public/test/navigation_simulator.h b/content/public/test/navigation_simulator.h index b13caff..ee384a7 100644 --- a/content/public/test/navigation_simulator.h +++ b/content/public/test/navigation_simulator.h
@@ -119,10 +119,13 @@ // Creates a NavigationSimulator that will be used to simulate a history // navigation to one of the |web_contents|'s navigation controller |offset|. - // E.g. offset -1 for back navigations and 1 for forward navigations. + // E.g. offset -1 for back navigations and 1 for forward navigations. If + // |is_renderer_initiated| is true, the navigation will simulate a history + // navigation initiated via JS. static std::unique_ptr<NavigationSimulator> CreateHistoryNavigation( int offset, - WebContents* web_contents); + WebContents* web_contents, + bool is_renderer_initiated); // Creates a NavigationSimulator that will be used to simulate a // renderer-initiated navigation to |original_url| started by
diff --git a/content/public/test/slow_download_http_response.cc b/content/public/test/slow_download_http_response.cc index c95a4ef..a130df57 100644 --- a/content/public/test/slow_download_http_response.cc +++ b/content/public/test/slow_download_http_response.cc
@@ -5,6 +5,7 @@ #include "content/public/test/slow_download_http_response.h" #include "base/bind.h" +#include "base/strings/string_split.h" #include "base/strings/stringprintf.h" #include "base/test/bind.h" #include "base/threading/thread_task_runner_handle.h" @@ -55,15 +56,18 @@ SlowDownloadHttpResponse::~SlowDownloadHttpResponse() = default; -void SlowDownloadHttpResponse::AddResponseHeaders(std::string* response) { - response->append("Content-type: application/octet-stream\r\n"); - response->append("Cache-Control: max-age=0\r\n"); +base::StringPairs SlowDownloadHttpResponse::ResponseHeaders() { + base::StringPairs response; + response.emplace_back("Content-type", "application/octet-stream"); + response.emplace_back("Cache-Control", "max-age=0"); if (base::LowerCaseEqualsASCII(kKnownSizeUrl, url_)) { - response->append( - base::StringPrintf("Content-Length: %d\r\n", - kFirstResponsePartSize + kSecondResponsePartSize)); + response.emplace_back( + "Content-Length", + base::NumberToString(kFirstResponsePartSize + kSecondResponsePartSize)); } + + return response; } } // namespace content
diff --git a/content/public/test/slow_download_http_response.h b/content/public/test/slow_download_http_response.h index 20ec907b..ae368c5 100644 --- a/content/public/test/slow_download_http_response.h +++ b/content/public/test/slow_download_http_response.h
@@ -5,6 +5,7 @@ #ifndef CONTENT_PUBLIC_TEST_SLOW_DOWNLOAD_HTTP_RESPONSE_H_ #define CONTENT_PUBLIC_TEST_SLOW_DOWNLOAD_HTTP_RESPONSE_H_ +#include "base/strings/string_split.h" #include "content/public/test/slow_http_response.h" namespace content { @@ -32,7 +33,7 @@ SlowDownloadHttpResponse& operator=(const SlowDownloadHttpResponse&) = delete; // SlowHttpResponse: - void AddResponseHeaders(std::string* response) override; + base::StringPairs ResponseHeaders() override; private: std::string url_;
diff --git a/content/public/test/slow_http_response.cc b/content/public/test/slow_http_response.cc index 2285977..c2fa6f4 100644 --- a/content/public/test/slow_http_response.cc +++ b/content/public/test/slow_http_response.cc
@@ -9,8 +9,12 @@ #include "base/bind.h" #include "base/bind_post_task.h" #include "base/callback_helpers.h" +#include "base/strings/string_split.h" #include "base/test/bind.h" #include "base/threading/thread_task_runner_handle.h" +#include "net/base/test_completion_callback.h" +#include "net/http/http_status_code.h" +#include "net/test/embedded_test_server/http_response.h" namespace content { @@ -46,52 +50,40 @@ return false; } -void SlowHttpResponse::AddResponseHeaders(std::string* response) { - response->append("Content-type: text/html\r\n"); +base::StringPairs SlowHttpResponse::ResponseHeaders() { + return {{"Content-type", "text/html"}}; } -void SlowHttpResponse::SetStatusLine(std::string* response) { - response->append("HTTP/1.1 200 OK\r\n"); +std::pair<net::HttpStatusCode, std::string> SlowHttpResponse::StatusLine() { + return {net::HTTP_OK, "OK"}; } void SlowHttpResponse::SendResponse( - const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) { + base::WeakPtr<HttpResponseDelegate> delegate) { // Construct the headers here so subclasses can override them. Then we will // bind them into the async task which sends them in the response. - std::string header_response; - SetStatusLine(&header_response); - AddResponseHeaders(&header_response); - header_response.append("Cache-Control: no-store\r\n"); - header_response.append("\r\n"); + net::HttpStatusCode status; + std::string status_reason; + std::tie(status, status_reason) = StatusLine(); + + base::StringPairs headers = ResponseHeaders(); + headers.emplace_back("Cache-Control", "no-store"); // SendResponse() runs off the test's main thread so we must have these tasks // post back from the test's main thread to this thread. + auto task_runner = base::ThreadTaskRunnerHandle::Get(); auto send_headers = base::BindPostTask( - base::ThreadTaskRunnerHandle::Get(), - base::BindOnce( - [](const std::string& header_response, - const net::test_server::SendBytesCallback& send) { - send.Run(header_response, base::DoNothing()); - }, - header_response, send)); + task_runner, base::BindOnce(&HttpResponseDelegate::SendResponseHeaders, + delegate, status, status_reason, headers)); + auto send_first_part = base::BindPostTask( - base::ThreadTaskRunnerHandle::Get(), - base::BindOnce( - [](const net::test_server::SendBytesCallback& send) { - std::string response(kFirstResponsePartSize, '*'); - send.Run(response, base::DoNothing()); - }, - send)); + task_runner, base::BindOnce(&HttpResponseDelegate::SendContents, delegate, + std::string(kFirstResponsePartSize, '*'), + base::DoNothing::Once())); auto send_second_part = base::BindPostTask( - base::ThreadTaskRunnerHandle::Get(), - base::BindOnce( - [](const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) { - std::string response(kSecondResponsePartSize, '*'); - send.Run(response, std::move(done)); - }, - send, std::move(done))); + task_runner, + base::BindOnce(&HttpResponseDelegate::SendContentsAndFinish, delegate, + std::string(kSecondResponsePartSize, '*'))); // We run both `send_headers` and `send_first_part` when the test asks // us to start the response, but as separate tasks.
diff --git a/content/public/test/slow_http_response.h b/content/public/test/slow_http_response.h index 72a0e9d..741900fa 100644 --- a/content/public/test/slow_http_response.h +++ b/content/public/test/slow_http_response.h
@@ -9,6 +9,8 @@ #include "base/memory/ref_counted.h" #include "base/sequenced_task_runner.h" +#include "base/strings/string_split.h" +#include "net/http/http_status_code.h" #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" @@ -16,6 +18,8 @@ // An HTTP response that may not complete ever. class SlowHttpResponse : public net::test_server::HttpResponse { + using HttpResponseDelegate = net::test_server::HttpResponseDelegate; + public: // Test URLs. static const char kSlowResponseUrl[]; @@ -51,17 +55,16 @@ // Subclasses can override this method to add custom HTTP response headers. // These headers are only applied to the slow response itself, not the // response to |kFinishSlowResponseUrl|. - virtual void AddResponseHeaders(std::string* response); + virtual base::StringPairs ResponseHeaders(); // Subclasses can override this method to write a custom status line; the // default implementation sets a 200 OK response. This status code is applied // only to the slow response itself, not the response to // |kFinishSlowResponseUrl|. - virtual void SetStatusLine(std::string* response); + virtual std::pair<net::HttpStatusCode, std::string> StatusLine(); // net::test_server::HttpResponse implementations. - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) override; + void SendResponse(base::WeakPtr<HttpResponseDelegate> delegate) override; private: scoped_refptr<base::SequencedTaskRunner> main_thread_;
diff --git a/content/public/test/test_download_http_response.cc b/content/public/test/test_download_http_response.cc index 311482e2..61e0ae5 100644 --- a/content/public/test/test_download_http_response.cc +++ b/content/public/test/test_download_http_response.cc
@@ -7,6 +7,7 @@ #include <inttypes.h> #include "base/bind.h" +#include "base/callback_forward.h" #include "base/callback_helpers.h" #include "base/cxx17_backports.h" #include "base/lazy_instance.h" @@ -19,8 +20,10 @@ #include "base/threading/thread_task_runner_handle.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" +#include "net/base/test_completion_callback.h" #include "net/http/http_request_headers.h" #include "net/http/http_util.h" +#include "net/test/embedded_test_server/http_response.h" namespace content { @@ -84,10 +87,10 @@ private: // net::test_server::HttpResponse implementations. - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) override { + void SendResponse( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) override { if (owner_) - owner_->SendResponse(send, std::move(done)); + owner_->SendResponse(delegate); } base::WeakPtr<TestDownloadHttpResponse> owner_; @@ -231,14 +234,13 @@ TestDownloadHttpResponse::~TestDownloadHttpResponse() = default; void TestDownloadHttpResponse::SendResponse( - const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) { - bytes_sender_ = send; - done_callback_ = std::move(done); + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) { + response_delegate_ = delegate; // Throw error before sending headers. if (ShouldAbortImmediately()) { - bytes_sender_.Run(std::string(), GenerateResultClosure()); + response_delegate_->SendRawResponseHeaders(""); + response_delegate_->SendContents("", GenerateResultClosure()); return; } @@ -293,7 +295,8 @@ void TestDownloadHttpResponse::SendResponseHeaders() { // Send static response in |parameters_| and close connection. if (!parameters_.static_response.empty()) { - bytes_sender_.Run(parameters_.static_response, GenerateResultClosure()); + response_delegate_->SendRawResponseHeaders(parameters_.static_response); + response_delegate_->SendContents("", GenerateResultClosure()); return; } @@ -304,16 +307,18 @@ if (GetResponseForRangeRequest(&response, &delay_response)) { if (delay_response) { delayed_response_callback_ = - base::BindOnce(bytes_sender_, response, GenerateResultClosure()); - bytes_sender_.Run(GetDefaultResponseHeaders(), base::DoNothing()); + base::BindOnce(&net::test_server::HttpResponseDelegate::SendContents, + response_delegate_, response, GenerateResultClosure()); + response_delegate_->SendRawResponseHeaders(GetDefaultResponseHeaders()); } else { - bytes_sender_.Run(response, GenerateResultClosure()); + response_delegate_->SendContents(response, GenerateResultClosure()); } return; } // Send the headers and start to send the body. - bytes_sender_.Run(GetDefaultResponseHeaders(), SendNextBodyChunkClosure()); + response_delegate_->SendRawResponseHeaders(GetDefaultResponseHeaders()); + SendResponseBodyChunk(); } std::string TestDownloadHttpResponse::GetDefaultResponseHeaders() { @@ -590,11 +595,10 @@ base::OnceClosure next) { std::string response_chunk = GetResponseChunk(buffer_range); transferred_bytes_ += static_cast<int64_t>(response_chunk.size()); - bytes_sender_.Run(response_chunk, std::move(next)); + response_delegate_->SendContents(response_chunk, std::move(next)); } -net::test_server::SendCompleteCallback -TestDownloadHttpResponse::SendNextBodyChunkClosure() { +base::OnceClosure TestDownloadHttpResponse::SendNextBodyChunkClosure() { return base::BindOnce(&TestDownloadHttpResponse::SendResponseBodyChunk, base::Unretained(this)); } @@ -612,11 +616,10 @@ std::move(completed_request)); // Close the HTTP connection. - std::move(done_callback_).Run(); + response_delegate_->FinishResponse(); } -net::test_server::SendCompleteCallback -TestDownloadHttpResponse::GenerateResultClosure() { +base::OnceClosure TestDownloadHttpResponse::GenerateResultClosure() { return base::BindOnce(&TestDownloadHttpResponse::GenerateResult, base::Unretained(this)); }
diff --git a/content/public/test/test_download_http_response.h b/content/public/test/test_download_http_response.h index f581296e..3447c1f 100644 --- a/content/public/test/test_download_http_response.h +++ b/content/public/test/test_download_http_response.h
@@ -8,6 +8,7 @@ #include <string> #include <vector> +#include "base/callback_forward.h" #include "base/containers/queue.h" #include "base/sequence_checker.h" #include "net/http/http_byte_range.h" @@ -261,11 +262,10 @@ // of the object returned is short. std::unique_ptr<net::test_server::HttpResponse> CreateResponseForTestServer(); - // Starts to send the response. |send| and |done| are functions to directly - // operate on HTTP connection in embedded test server, and will out live the - // shim HttpResponse object created by |CreateResponseForTestServer|. - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done); + // Starts to send the response. |delegate| owns the shim HttpResponse object + // created by |CreateResponseForTestServer| and will outlive it. + void SendResponse( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate); // Runs |delayed_response_callback_| to send the delayed response. void SendDelayedResponse(); @@ -312,11 +312,11 @@ void SendResponseBodyChunk(); void SendBodyChunkInternal(const net::HttpByteRange& buffer_range, base::OnceClosure next); - net::test_server::SendCompleteCallback SendNextBodyChunkClosure(); + base::OnceClosure SendNextBodyChunkClosure(); // Generate CompletedRequest as result. void GenerateResult(); - net::test_server::SendCompleteCallback GenerateResultClosure(); + base::OnceClosure GenerateResultClosure(); // The parsed range of the HTTP request. The last byte position can be larger // than the file size. @@ -336,15 +336,13 @@ // Request received from the client. net::test_server::HttpRequest request_; - // The function to send bytes on the network. - net::test_server::SendBytesCallback bytes_sender_; + // The delegate responsible for sending bytes and finishing the connection + base::WeakPtr<net::test_server::HttpResponseDelegate> response_delegate_ = + nullptr; // The number of bytes transferred. int64_t transferred_bytes_; - // The callback that will close the HTTP connection to the test server. - net::test_server::SendCompleteCallback done_callback_; - // Callback to run when the response is sent. OnResponseSentCallback on_response_sent_callback_;
diff --git a/content/test/data/gpu/vc/videos_mxn.html b/content/test/data/gpu/vc/videos_mxn.html index 44ae780..b388911 100644 --- a/content/test/data/gpu/vc/videos_mxn.html +++ b/content/test/data/gpu/vc/videos_mxn.html
@@ -107,12 +107,12 @@ const video_src = GetVideoSource(video_count, i, codec); createOneVideo(video_top, video_left, video_width, video_height, - video_src, /*has_border=*/i == (video_count-1)); + video_src, /*has_border=*/i == 0); // Create an icon on top of each video. createOneIcon(video_top, video_left, video_width, video_height, icon_height); // For the voice animation on the last video. - if (i == (video_count - 1)) { + if (i == 0) { var animatedBar = document.createElement('icon'); var icon_bottom = video_top + icon_height * 2; createVoiceAnimationBar(animatedBar, video_top, video_left, @@ -123,7 +123,7 @@ // Create one small video at the upper right corner to similate the one // from the local camera (640x360). - createLocalViceoAndIcon(video_width, video_height, codec); + createLocalVideoAndIcon(video_width, video_height, codec); // Start the voice icon animation. const frameTime30Fps = 32; // ms @@ -165,7 +165,10 @@ video.style.top = top; video.style.left = left; if (has_border) { - video.style.borderWidth = 5; + const borderWidth = 3; + video.style.borderWidth = borderWidth; + video.width = width - borderWidth * 2; + video.height = height - borderWidth * 2; video.style.borderStyle = "solid"; video.style.borderColor = "rgba(90, 129, 193, 255)"; } @@ -175,7 +178,7 @@ } function createOneIcon(video_top, video_left, video_width, video_height, icon_height) { - const icon = document.createElement('icon'); + const icon = document.createElement('icon'); icon.style.backgroundColor = "rgba(29, 110, 216, 255)"; icon.style.position = "absolute"; @@ -187,7 +190,7 @@ container.appendChild(icon); } - function createLocalViceoAndIcon(video_width, video_height, codec) { + function createLocalVideoAndIcon(video_width, video_height, codec) { const small_video_width = video_width / 3; const small_video_height = video_height / 3; const icon_height = small_video_height / 8;
diff --git a/content/test/data/gpu/vc/webgpu_video.js b/content/test/data/gpu/vc/webgpu_video.js index 8f74535..9a25239 100644 --- a/content/test/data/gpu/vc/webgpu_video.js +++ b/content/test/data/gpu/vc/webgpu_video.js
@@ -26,7 +26,7 @@ return null; } - return { device, context, canvas }; + return {adapter, device, context, canvas}; } const wgslShaders = { @@ -235,12 +235,12 @@ const rectVerts = new Float32Array(136); // (1) Voice bars. - // X, Y, width and height of the last video. + // X, Y, width and height of the first video. const maxColRow = Math.max(videoColumns, videoRows); const w = 2.0 / maxColRow; const h = 2.0 / maxColRow; - const x = -1.0 + w * (videoColumns - 1); - const y = 1.0 - h * (videoRows - 1); + const x = -1.0; + const y = 1.0; // Width and height of the icon. const wIcon = w / videos[0].width * videos[0].height / 8.0; @@ -269,7 +269,7 @@ ], array_index); } - // (2) Borders of the last video + // (2) Borders of the first video const array_index = 10 * 12; rectVerts.set([ x, y, (x + w), y, @@ -292,12 +292,12 @@ function webGpuDrawVideoFrames(gpuSetting, videos, videoRows, videoColumns, addUI, useImportTextureApi) { - const { device, context, canvas } = gpuSetting; + const {adapter, device, context, canvas} = gpuSetting; const verticesBuffer = createVertexBuffer(device, videos, videoRows, videoColumns); - const swapChainFormat = context.getPreferredFormat(device.adapter); + const swapChainFormat = context.getPreferredFormat(adapter); const swapChain = context.configure({ device, @@ -624,6 +624,13 @@ passEncoder.endPass(); device.queue.submit([commandEncoder.finish()]); + const functionDuration = performance.now() - timestamp; + const interval30Fps = 1000.0 / 30; // 33.3 ms. + if (functionDuration > interval30Fps) { + console.warn( + 'rAF callback oneFrameWithImportTextureApi() takes longer than 33.3 ms. (1sec/30fps)'); + } + window.requestAnimationFrame(oneFrameWithImportTextureApi); };
diff --git a/content/test/navigation_simulator_impl.cc b/content/test/navigation_simulator_impl.cc index 7762d80..9c3d86e8 100644 --- a/content/test/navigation_simulator_impl.cc +++ b/content/test/navigation_simulator_impl.cc
@@ -131,8 +131,8 @@ // static RenderFrameHost* NavigationSimulator::GoToOffset(WebContents* web_contents, int offset) { - auto simulator = - NavigationSimulatorImpl::CreateHistoryNavigation(offset, web_contents); + auto simulator = NavigationSimulatorImpl::CreateHistoryNavigation( + offset, web_contents, false /* is_renderer_initiated */); simulator->Commit(); return simulator->GetFinalRenderFrameHost(); } @@ -188,8 +188,8 @@ WebContents* web_contents, int offset, int net_error_code) { - auto simulator = - NavigationSimulator::CreateHistoryNavigation(offset, web_contents); + auto simulator = NavigationSimulator::CreateHistoryNavigation( + offset, web_contents, false /* is_renderer_initiated */); simulator->Fail(net_error_code); if (net_error_code == net::ERR_ABORTED) return nullptr; @@ -231,16 +231,25 @@ // static std::unique_ptr<NavigationSimulator> NavigationSimulator::CreateHistoryNavigation(int offset, - WebContents* web_contents) { - return NavigationSimulatorImpl::CreateHistoryNavigation(offset, web_contents); + WebContents* web_contents, + bool is_renderer_initiated) { + return NavigationSimulatorImpl::CreateHistoryNavigation( + offset, web_contents, is_renderer_initiated); } // static std::unique_ptr<NavigationSimulatorImpl> NavigationSimulatorImpl::CreateHistoryNavigation(int offset, - WebContents* web_contents) { - auto simulator = - NavigationSimulatorImpl::CreateBrowserInitiated(GURL(), web_contents); + WebContents* web_contents, + bool is_renderer_initiated) { + std::unique_ptr<NavigationSimulatorImpl> simulator = nullptr; + if (is_renderer_initiated) { + simulator = NavigationSimulatorImpl::CreateRendererInitiated( + GURL(), web_contents->GetMainFrame()); + } else { + simulator = + NavigationSimulatorImpl::CreateBrowserInitiated(GURL(), web_contents); + } simulator->SetSessionHistoryOffset(offset); return simulator; } @@ -434,6 +443,8 @@ CHECK(request_); if (blink::IsRendererDebugURL(navigation_url_)) return; + if (session_history_offset_) + return; if (!NeedsThrottleChecks()) return; @@ -1232,6 +1243,13 @@ } bool NavigationSimulatorImpl::SimulateRendererInitiatedStart() { + if (session_history_offset_) { + static_cast<NavigationControllerImpl&>(web_contents_->GetController()) + .GoToOffsetFromRenderer(session_history_offset_); + request_ = render_frame_host_->frame_tree_node()->navigation_request(); + return true; + } + blink::mojom::BeginNavigationParamsPtr begin_params = blink::mojom::BeginNavigationParams::New( initiator_frame_host_
diff --git a/content/test/navigation_simulator_impl.h b/content/test/navigation_simulator_impl.h index e357974..22be401 100644 --- a/content/test/navigation_simulator_impl.h +++ b/content/test/navigation_simulator_impl.h
@@ -50,7 +50,8 @@ static std::unique_ptr<NavigationSimulatorImpl> CreateHistoryNavigation( int offset, - WebContents* web_contents); + WebContents* web_contents, + bool is_renderer_initiated); // TODO(https://crbug.com/1131832): Remove |original_url| as it's not used. static std::unique_ptr<NavigationSimulatorImpl> CreateRendererInitiated(
diff --git a/extensions/browser/api/alarms/alarm_manager.h b/extensions/browser/api/alarms/alarm_manager.h index 1222f21..8f77850 100644 --- a/extensions/browser/api/alarms/alarm_manager.h +++ b/extensions/browser/api/alarms/alarm_manager.h
@@ -39,6 +39,10 @@ const api::alarms::AlarmCreateInfo& create_info, base::TimeDelta min_granularity, base::Time now); + + Alarm(const Alarm&) = delete; + Alarm& operator=(const Alarm&) = delete; + ~Alarm(); std::unique_ptr<api::alarms::Alarm> js_alarm; @@ -51,9 +55,6 @@ // The minimum granularity is the minimum allowed polling rate. This stops // alarms from polling too often. base::TimeDelta minimum_granularity; - - private: - DISALLOW_COPY_AND_ASSIGN(Alarm); }; // Manages the currently pending alarms for every extension in a profile.
diff --git a/extensions/browser/api/audio/audio_service.h b/extensions/browser/api/audio/audio_service.h index 3983927..658c362 100644 --- a/extensions/browser/api/audio/audio_service.h +++ b/extensions/browser/api/audio/audio_service.h
@@ -46,6 +46,9 @@ // Creates a platform-specific AudioService instance. static AudioService* CreateInstance(AudioDeviceIdCalculator* id_calculator); + AudioService(const AudioService&) = delete; + AudioService& operator=(const AudioService&) = delete; + virtual ~AudioService() {} // Called by listeners to this service to add/remove themselves as observers. @@ -114,9 +117,6 @@ protected: AudioService() {} - - private: - DISALLOW_COPY_AND_ASSIGN(AudioService); }; } // namespace extensions
diff --git a/extensions/browser/api/bluetooth/bluetooth_api.h b/extensions/browser/api/bluetooth/bluetooth_api.h index e98e535..16d3c374 100644 --- a/extensions/browser/api/bluetooth/bluetooth_api.h +++ b/extensions/browser/api/bluetooth/bluetooth_api.h
@@ -87,6 +87,10 @@ BluetoothGetDevicesFunction(); + BluetoothGetDevicesFunction(const BluetoothGetDevicesFunction&) = delete; + BluetoothGetDevicesFunction& operator=(const BluetoothGetDevicesFunction&) = + delete; + protected: ~BluetoothGetDevicesFunction() override; @@ -96,8 +100,6 @@ private: std::unique_ptr<bluetooth::GetDevices::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothGetDevicesFunction); }; class BluetoothGetDeviceFunction : public BluetoothExtensionFunction { @@ -106,6 +108,10 @@ BluetoothGetDeviceFunction(); + BluetoothGetDeviceFunction(const BluetoothGetDeviceFunction&) = delete; + BluetoothGetDeviceFunction& operator=(const BluetoothGetDeviceFunction&) = + delete; + // BluetoothExtensionFunction: bool CreateParams() override; void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override; @@ -115,8 +121,6 @@ private: std::unique_ptr<extensions::api::bluetooth::GetDevice::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothGetDeviceFunction); }; class BluetoothStartDiscoveryFunction : public BluetoothExtensionFunction {
diff --git a/extensions/browser/api/bluetooth/bluetooth_extension_function.h b/extensions/browser/api/bluetooth/bluetooth_extension_function.h index 2c49cba..8daf24e1 100644 --- a/extensions/browser/api/bluetooth/bluetooth_extension_function.h +++ b/extensions/browser/api/bluetooth/bluetooth_extension_function.h
@@ -26,6 +26,10 @@ public: BluetoothExtensionFunction(); + BluetoothExtensionFunction(const BluetoothExtensionFunction&) = delete; + BluetoothExtensionFunction& operator=(const BluetoothExtensionFunction&) = + delete; + protected: ~BluetoothExtensionFunction() override; @@ -43,8 +47,6 @@ // Implemented by individual bluetooth extension functions, called // automatically on the UI thread once |adapter| has been initialized. virtual void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) = 0; - - DISALLOW_COPY_AND_ASSIGN(BluetoothExtensionFunction); }; } // namespace api
diff --git a/extensions/browser/api/bluetooth/bluetooth_private_api.h b/extensions/browser/api/bluetooth/bluetooth_private_api.h index 46df482..c54bd2b 100644 --- a/extensions/browser/api/bluetooth/bluetooth_private_api.h +++ b/extensions/browser/api/bluetooth/bluetooth_private_api.h
@@ -89,6 +89,11 @@ BLUETOOTHPRIVATE_SETADAPTERSTATE) BluetoothPrivateSetAdapterStateFunction(); + BluetoothPrivateSetAdapterStateFunction( + const BluetoothPrivateSetAdapterStateFunction&) = delete; + BluetoothPrivateSetAdapterStateFunction& operator=( + const BluetoothPrivateSetAdapterStateFunction&) = delete; + private: ~BluetoothPrivateSetAdapterStateFunction() override; @@ -114,8 +119,6 @@ bool parsed_ = false; std::unique_ptr<bluetooth_private::SetAdapterState::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateSetAdapterStateFunction); }; class BluetoothPrivateSetPairingResponseFunction @@ -124,6 +127,12 @@ DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.setPairingResponse", BLUETOOTHPRIVATE_SETPAIRINGRESPONSE) BluetoothPrivateSetPairingResponseFunction(); + + BluetoothPrivateSetPairingResponseFunction( + const BluetoothPrivateSetPairingResponseFunction&) = delete; + BluetoothPrivateSetPairingResponseFunction& operator=( + const BluetoothPrivateSetPairingResponseFunction&) = delete; + // BluetoothExtensionFunction overrides: bool CreateParams() override; void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override; @@ -132,8 +141,6 @@ ~BluetoothPrivateSetPairingResponseFunction() override; std::unique_ptr<bluetooth_private::SetPairingResponse::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateSetPairingResponseFunction); }; class BluetoothPrivateDisconnectAllFunction @@ -143,6 +150,11 @@ BLUETOOTHPRIVATE_DISCONNECTALL) BluetoothPrivateDisconnectAllFunction(); + BluetoothPrivateDisconnectAllFunction( + const BluetoothPrivateDisconnectAllFunction&) = delete; + BluetoothPrivateDisconnectAllFunction& operator=( + const BluetoothPrivateDisconnectAllFunction&) = delete; + // BluetoothExtensionFunction overrides: bool CreateParams() override; void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override; @@ -155,8 +167,6 @@ const std::string& device_address); std::unique_ptr<bluetooth_private::DisconnectAll::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateDisconnectAllFunction); }; class BluetoothPrivateForgetDeviceFunction : public BluetoothExtensionFunction { @@ -165,6 +175,11 @@ BLUETOOTHPRIVATE_FORGETDEVICE) BluetoothPrivateForgetDeviceFunction(); + BluetoothPrivateForgetDeviceFunction( + const BluetoothPrivateForgetDeviceFunction&) = delete; + BluetoothPrivateForgetDeviceFunction& operator=( + const BluetoothPrivateForgetDeviceFunction&) = delete; + // BluetoothExtensionFunction overrides: bool CreateParams() override; void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override; @@ -177,8 +192,6 @@ const std::string& device_address); std::unique_ptr<bluetooth_private::ForgetDevice::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateForgetDeviceFunction); }; class BluetoothPrivateSetDiscoveryFilterFunction @@ -188,6 +201,11 @@ BLUETOOTHPRIVATE_SETDISCOVERYFILTER) BluetoothPrivateSetDiscoveryFilterFunction(); + BluetoothPrivateSetDiscoveryFilterFunction( + const BluetoothPrivateSetDiscoveryFilterFunction&) = delete; + BluetoothPrivateSetDiscoveryFilterFunction& operator=( + const BluetoothPrivateSetDiscoveryFilterFunction&) = delete; + protected: ~BluetoothPrivateSetDiscoveryFilterFunction() override; @@ -200,8 +218,6 @@ void OnErrorCallback(); std::unique_ptr<bluetooth_private::SetDiscoveryFilter::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateSetDiscoveryFilterFunction); }; class BluetoothPrivateConnectFunction : public BluetoothExtensionFunction { @@ -210,6 +226,11 @@ BLUETOOTHPRIVATE_CONNECT) BluetoothPrivateConnectFunction(); + BluetoothPrivateConnectFunction(const BluetoothPrivateConnectFunction&) = + delete; + BluetoothPrivateConnectFunction& operator=( + const BluetoothPrivateConnectFunction&) = delete; + // BluetoothExtensionFunction: bool CreateParams() override; void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override; @@ -221,8 +242,6 @@ absl::optional<device::BluetoothDevice::ConnectErrorCode> error); std::unique_ptr<bluetooth_private::Connect::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateConnectFunction); }; class BluetoothPrivatePairFunction : public BluetoothExtensionFunction { @@ -230,6 +249,10 @@ DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.pair", BLUETOOTHPRIVATE_PAIR) BluetoothPrivatePairFunction(); + BluetoothPrivatePairFunction(const BluetoothPrivatePairFunction&) = delete; + BluetoothPrivatePairFunction& operator=(const BluetoothPrivatePairFunction&) = + delete; + // BluetoothExtensionFunction: bool CreateParams() override; void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override; @@ -241,8 +264,6 @@ absl::optional<device::BluetoothDevice::ConnectErrorCode> error_code); std::unique_ptr<bluetooth_private::Pair::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothPrivatePairFunction); }; class BluetoothPrivateRecordPairingFunction @@ -253,6 +274,11 @@ BluetoothPrivateRecordPairingFunction(); + BluetoothPrivateRecordPairingFunction( + const BluetoothPrivateRecordPairingFunction&) = delete; + BluetoothPrivateRecordPairingFunction& operator=( + const BluetoothPrivateRecordPairingFunction&) = delete; + protected: ~BluetoothPrivateRecordPairingFunction() override; @@ -262,8 +288,6 @@ private: std::unique_ptr<bluetooth_private::RecordPairing::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateRecordPairingFunction); }; class BluetoothPrivateRecordReconnectionFunction @@ -274,6 +298,11 @@ BluetoothPrivateRecordReconnectionFunction(); + BluetoothPrivateRecordReconnectionFunction( + const BluetoothPrivateRecordReconnectionFunction&) = delete; + BluetoothPrivateRecordReconnectionFunction& operator=( + const BluetoothPrivateRecordReconnectionFunction&) = delete; + protected: ~BluetoothPrivateRecordReconnectionFunction() override; @@ -283,8 +312,6 @@ private: std::unique_ptr<bluetooth_private::RecordReconnection::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateRecordReconnectionFunction); }; class BluetoothPrivateRecordDeviceSelectionFunction @@ -295,6 +322,11 @@ BluetoothPrivateRecordDeviceSelectionFunction(); + BluetoothPrivateRecordDeviceSelectionFunction( + const BluetoothPrivateRecordDeviceSelectionFunction&) = delete; + BluetoothPrivateRecordDeviceSelectionFunction& operator=( + const BluetoothPrivateRecordDeviceSelectionFunction&) = delete; + protected: ~BluetoothPrivateRecordDeviceSelectionFunction() override; @@ -304,8 +336,6 @@ private: std::unique_ptr<bluetooth_private::RecordDeviceSelection::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateRecordDeviceSelectionFunction); }; } // namespace api
diff --git a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h index 2b09b0c..d663e5b 100644 --- a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h +++ b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h
@@ -96,6 +96,11 @@ public: BluetoothLowEnergyExtensionFunction(); + BluetoothLowEnergyExtensionFunction( + const BluetoothLowEnergyExtensionFunction&) = delete; + BluetoothLowEnergyExtensionFunction& operator=( + const BluetoothLowEnergyExtensionFunction&) = delete; + protected: ~BluetoothLowEnergyExtensionFunction() override; @@ -119,8 +124,6 @@ private: // Internal method to do common setup before actual DoWork is called. void PreDoWork(); - - DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyExtensionFunction); }; // Base class for bluetoothLowEnergy API peripheral mode functions. This class @@ -132,14 +135,16 @@ public: BLEPeripheralExtensionFunction(); + BLEPeripheralExtensionFunction(const BLEPeripheralExtensionFunction&) = + delete; + BLEPeripheralExtensionFunction& operator=( + const BLEPeripheralExtensionFunction&) = delete; + protected: ~BLEPeripheralExtensionFunction() override; // ExtensionFunction override. ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(BLEPeripheralExtensionFunction); }; class BluetoothLowEnergyConnectFunction @@ -481,6 +486,11 @@ public: BluetoothLowEnergyAdvertisementFunction(); + BluetoothLowEnergyAdvertisementFunction( + const BluetoothLowEnergyAdvertisementFunction&) = delete; + BluetoothLowEnergyAdvertisementFunction& operator=( + const BluetoothLowEnergyAdvertisementFunction&) = delete; + protected: ~BluetoothLowEnergyAdvertisementFunction() override; @@ -497,8 +507,6 @@ void Initialize(); ApiResourceManager<BluetoothApiAdvertisement>* advertisements_manager_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyAdvertisementFunction); }; class BluetoothLowEnergyRegisterAdvertisementFunction
diff --git a/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h b/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h index 804f971..99e2a05 100644 --- a/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h +++ b/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h
@@ -69,13 +69,14 @@ BluetoothSocketCreateFunction(); + BluetoothSocketCreateFunction(const BluetoothSocketCreateFunction&) = delete; + BluetoothSocketCreateFunction& operator=( + const BluetoothSocketCreateFunction&) = delete; + protected: ~BluetoothSocketCreateFunction() override; ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(BluetoothSocketCreateFunction); }; class BluetoothSocketUpdateFunction : public BluetoothSocketAsyncApiFunction { @@ -84,14 +85,15 @@ BluetoothSocketUpdateFunction(); + BluetoothSocketUpdateFunction(const BluetoothSocketUpdateFunction&) = delete; + BluetoothSocketUpdateFunction& operator=( + const BluetoothSocketUpdateFunction&) = delete; + protected: ~BluetoothSocketUpdateFunction() override; // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(BluetoothSocketUpdateFunction); }; class BluetoothSocketSetPausedFunction @@ -102,14 +104,16 @@ BluetoothSocketSetPausedFunction(); + BluetoothSocketSetPausedFunction(const BluetoothSocketSetPausedFunction&) = + delete; + BluetoothSocketSetPausedFunction& operator=( + const BluetoothSocketSetPausedFunction&) = delete; + protected: ~BluetoothSocketSetPausedFunction() override; // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(BluetoothSocketSetPausedFunction); }; class BluetoothSocketListenFunction : public BluetoothSocketAsyncApiFunction { @@ -248,6 +252,11 @@ BluetoothSocketDisconnectFunction(); + BluetoothSocketDisconnectFunction(const BluetoothSocketDisconnectFunction&) = + delete; + BluetoothSocketDisconnectFunction& operator=( + const BluetoothSocketDisconnectFunction&) = delete; + protected: ~BluetoothSocketDisconnectFunction() override; @@ -256,8 +265,6 @@ private: virtual void OnSuccess(); - - DISALLOW_COPY_AND_ASSIGN(BluetoothSocketDisconnectFunction); }; class BluetoothSocketCloseFunction : public BluetoothSocketAsyncApiFunction { @@ -266,14 +273,15 @@ BluetoothSocketCloseFunction(); + BluetoothSocketCloseFunction(const BluetoothSocketCloseFunction&) = delete; + BluetoothSocketCloseFunction& operator=(const BluetoothSocketCloseFunction&) = + delete; + protected: ~BluetoothSocketCloseFunction() override; // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(BluetoothSocketCloseFunction); }; class BluetoothSocketSendFunction : public BluetoothSocketAsyncApiFunction { @@ -282,6 +290,10 @@ BluetoothSocketSendFunction(); + BluetoothSocketSendFunction(const BluetoothSocketSendFunction&) = delete; + BluetoothSocketSendFunction& operator=(const BluetoothSocketSendFunction&) = + delete; + protected: ~BluetoothSocketSendFunction() override; @@ -296,8 +308,6 @@ std::unique_ptr<bluetooth_socket::Send::Params> params_; scoped_refptr<net::IOBuffer> io_buffer_; size_t io_buffer_size_; - - DISALLOW_COPY_AND_ASSIGN(BluetoothSocketSendFunction); }; class BluetoothSocketGetInfoFunction : public BluetoothSocketAsyncApiFunction { @@ -306,14 +316,16 @@ BluetoothSocketGetInfoFunction(); + BluetoothSocketGetInfoFunction(const BluetoothSocketGetInfoFunction&) = + delete; + BluetoothSocketGetInfoFunction& operator=( + const BluetoothSocketGetInfoFunction&) = delete; + protected: ~BluetoothSocketGetInfoFunction() override; // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(BluetoothSocketGetInfoFunction); }; class BluetoothSocketGetSocketsFunction
diff --git a/extensions/browser/api/bluetooth_socket/bluetooth_socket_api_unittest.cc b/extensions/browser/api/bluetooth_socket/bluetooth_socket_api_unittest.cc index 8aff607..8602897f 100644 --- a/extensions/browser/api/bluetooth_socket/bluetooth_socket_api_unittest.cc +++ b/extensions/browser/api/bluetooth_socket/bluetooth_socket_api_unittest.cc
@@ -19,8 +19,9 @@ public: BluetoothSocketApiUnittest() = default; - private: - DISALLOW_COPY_AND_ASSIGN(BluetoothSocketApiUnittest); + BluetoothSocketApiUnittest(const BluetoothSocketApiUnittest&) = delete; + BluetoothSocketApiUnittest& operator=(const BluetoothSocketApiUnittest&) = + delete; }; // Tests that bluetoothSocket.create fails as expected when extension does not
diff --git a/extensions/browser/api/cec_private/cec_private_api.h b/extensions/browser/api/cec_private/cec_private_api.h index 925ac07..4fb105a 100644 --- a/extensions/browser/api/cec_private/cec_private_api.h +++ b/extensions/browser/api/cec_private/cec_private_api.h
@@ -18,43 +18,53 @@ public: CecPrivateFunction(); + CecPrivateFunction(const CecPrivateFunction&) = delete; + CecPrivateFunction& operator=(const CecPrivateFunction&) = delete; + protected: ~CecPrivateFunction() override; bool PreRunValidation(std::string* error) override; - - private: - DISALLOW_COPY_AND_ASSIGN(CecPrivateFunction); }; class CecPrivateSendStandByFunction : public CecPrivateFunction { public: CecPrivateSendStandByFunction(); + + CecPrivateSendStandByFunction(const CecPrivateSendStandByFunction&) = delete; + CecPrivateSendStandByFunction& operator=( + const CecPrivateSendStandByFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("cecPrivate.sendStandBy", CECPRIVATE_SENDSTANDBY) protected: ~CecPrivateSendStandByFunction() override; ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(CecPrivateSendStandByFunction); }; class CecPrivateSendWakeUpFunction : public CecPrivateFunction { public: CecPrivateSendWakeUpFunction(); + + CecPrivateSendWakeUpFunction(const CecPrivateSendWakeUpFunction&) = delete; + CecPrivateSendWakeUpFunction& operator=(const CecPrivateSendWakeUpFunction&) = + delete; + DECLARE_EXTENSION_FUNCTION("cecPrivate.sendWakeUp", CECPRIVATE_SENDWAKEUP) protected: ~CecPrivateSendWakeUpFunction() override; ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(CecPrivateSendWakeUpFunction); }; class CecPrivateQueryDisplayCecPowerStateFunction : public CecPrivateFunction { public: CecPrivateQueryDisplayCecPowerStateFunction(); + + CecPrivateQueryDisplayCecPowerStateFunction( + const CecPrivateQueryDisplayCecPowerStateFunction&) = delete; + CecPrivateQueryDisplayCecPowerStateFunction& operator=( + const CecPrivateQueryDisplayCecPowerStateFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("cecPrivate.queryDisplayCecPowerState", CECPRIVATE_QUERYDISPLAYCECPOWERSTATE) @@ -65,8 +75,6 @@ private: void HandlePowerStates( const std::vector<chromeos::CecServiceClient::PowerState>& power_states); - - DISALLOW_COPY_AND_ASSIGN(CecPrivateQueryDisplayCecPowerStateFunction); }; } // namespace api
diff --git a/extensions/browser/api/declarative/declarative_api.h b/extensions/browser/api/declarative/declarative_api.h index e50aa5d..c4edfa9 100644 --- a/extensions/browser/api/declarative/declarative_api.h +++ b/extensions/browser/api/declarative/declarative_api.h
@@ -33,6 +33,9 @@ public: RulesFunction(); + RulesFunction(const RulesFunction&) = delete; + RulesFunction& operator=(const RulesFunction&) = delete; + protected: ~RulesFunction() override; @@ -55,8 +58,6 @@ private: void SendResponse(ResponseValue response); - - DISALLOW_COPY_AND_ASSIGN(RulesFunction); }; class EventsEventAddRulesFunction : public RulesFunction {
diff --git a/extensions/browser/api/declarative/declarative_rule.h b/extensions/browser/api/declarative/declarative_rule.h index 6781327..2d4a5dd 100644 --- a/extensions/browser/api/declarative/declarative_rule.h +++ b/extensions/browser/api/declarative/declarative_rule.h
@@ -64,6 +64,9 @@ using Conditions = std::vector<std::unique_ptr<const ConditionT>>; using const_iterator = typename Conditions::const_iterator; + DeclarativeConditionSet(const DeclarativeConditionSet&) = delete; + DeclarativeConditionSet& operator=(const DeclarativeConditionSet&) = delete; + // Factory method that creates a DeclarativeConditionSet for |extension| // according to the JSON array |conditions| passed by the extension API. Sets // |error| and returns NULL in case of an error. @@ -109,8 +112,6 @@ const URLMatcherIdToCondition match_id_to_condition_; const Conditions conditions_; const std::vector<const ConditionT*> conditions_without_urls_; - - DISALLOW_COPY_AND_ASSIGN(DeclarativeConditionSet); }; // Immutable container for multiple actions. @@ -148,6 +149,9 @@ explicit DeclarativeActionSet(const Actions& actions); + DeclarativeActionSet(const DeclarativeActionSet&) = delete; + DeclarativeActionSet& operator=(const DeclarativeActionSet&) = delete; + // Factory method that instantiates a DeclarativeActionSet for |extension| // according to |actions| which represents the array of actions received from // the extension API. @@ -184,8 +188,6 @@ private: const Actions actions_; - - DISALLOW_COPY_AND_ASSIGN(DeclarativeActionSet); }; // Representation of a rule of a declarative API: @@ -220,6 +222,9 @@ std::unique_ptr<ActionSet> actions, Priority priority); + DeclarativeRule(const DeclarativeRule&) = delete; + DeclarativeRule& operator=(const DeclarativeRule&) = delete; + // Creates a DeclarativeRule for |extension| given a json definition. The // format of each condition and action's json is up to the specific ConditionT // and ActionT. |extension| may be NULL in tests. @@ -262,8 +267,6 @@ std::unique_ptr<ConditionSet> conditions_; std::unique_ptr<ActionSet> actions_; Priority priority_; - - DISALLOW_COPY_AND_ASSIGN(DeclarativeRule); }; // Implementation details below here.
diff --git a/extensions/browser/api/declarative/deduping_factory_unittest.cc b/extensions/browser/api/declarative/deduping_factory_unittest.cc index 81bbeb7..7940ebc 100644 --- a/extensions/browser/api/declarative/deduping_factory_unittest.cc +++ b/extensions/browser/api/declarative/deduping_factory_unittest.cc
@@ -41,6 +41,8 @@ class Foo : public BaseClass { public: explicit Foo(int parameter) : BaseClass(FOO), parameter_(parameter) {} + Foo(const Foo&) = delete; + Foo& operator=(const Foo&) = delete; bool Equals(const BaseClass* other) const override { return other->type() == type() && static_cast<const Foo*>(other)->parameter_ == parameter_; @@ -55,7 +57,6 @@ // Note that this class must be immutable. const int parameter_; - DISALLOW_COPY_AND_ASSIGN(Foo); }; scoped_refptr<const BaseClass> CreateFoo(const std::string& /*instance_type*/,
diff --git a/extensions/browser/api/declarative/rules_registry.h b/extensions/browser/api/declarative/rules_registry.h index fddf62d..0c58c60 100644 --- a/extensions/browser/api/declarative/rules_registry.h +++ b/extensions/browser/api/declarative/rules_registry.h
@@ -54,6 +54,9 @@ RulesCacheDelegate* cache_delegate, int id); + RulesRegistry(const RulesRegistry&) = delete; + RulesRegistry& operator=(const RulesRegistry&) = delete; + const base::OneShotEvent& ready() const { return ready_; } // RulesRegistry implementation: @@ -299,8 +302,6 @@ base::WeakPtr<RulesCacheDelegate> cache_delegate_; base::WeakPtrFactory<RulesRegistry> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(RulesRegistry); }; } // namespace extensions
diff --git a/extensions/browser/api/declarative/rules_registry_service.h b/extensions/browser/api/declarative/rules_registry_service.h index 9fc4c39..f3ffbc0 100644 --- a/extensions/browser/api/declarative/rules_registry_service.h +++ b/extensions/browser/api/declarative/rules_registry_service.h
@@ -59,6 +59,10 @@ }; explicit RulesRegistryService(content::BrowserContext* context); + + RulesRegistryService(const RulesRegistryService&) = delete; + RulesRegistryService& operator=(const RulesRegistryService&) = delete; + ~RulesRegistryService() override; // Unregisters refptrs to concrete RulesRegistries at other objects that were @@ -169,8 +173,6 @@ content::BrowserContext* browser_context_; base::ObserverList<Observer>::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(RulesRegistryService); }; } // namespace extensions
diff --git a/extensions/browser/api/declarative/test_rules_registry.h b/extensions/browser/api/declarative/test_rules_registry.h index 4df114f6..9119f2db 100644 --- a/extensions/browser/api/declarative/test_rules_registry.h +++ b/extensions/browser/api/declarative/test_rules_registry.h
@@ -23,6 +23,9 @@ RulesCacheDelegate* cache_delegate, int rules_registry_id); + TestRulesRegistry(const TestRulesRegistry&) = delete; + TestRulesRegistry& operator=(const TestRulesRegistry&) = delete; + // RulesRegistry implementation: std::string AddRulesImpl( const std::string& extension_id, @@ -43,8 +46,6 @@ // The string that gets returned by the implementation functions of // RulesRegistry. Defaults to "". std::string result_; - - DISALLOW_COPY_AND_ASSIGN(TestRulesRegistry); }; } // namespace extensions
diff --git a/extensions/browser/api/declarative_content/content_rules_registry.h b/extensions/browser/api/declarative_content/content_rules_registry.h index ec4be16..4aa7e7f 100644 --- a/extensions/browser/api/declarative_content/content_rules_registry.h +++ b/extensions/browser/api/declarative_content/content_rules_registry.h
@@ -42,6 +42,9 @@ cache_delegate, rules_registry_id) {} + ContentRulesRegistry(const ContentRulesRegistry&) = delete; + ContentRulesRegistry& operator=(const ContentRulesRegistry&) = delete; + // Notifies the registry that it should evaluate rules for |contents|. virtual void MonitorWebContentsForRuleEvaluation( content::WebContents* contents) = 0; @@ -64,9 +67,6 @@ protected: ~ContentRulesRegistry() override {} - - private: - DISALLOW_COPY_AND_ASSIGN(ContentRulesRegistry); }; } // namespace extensions
diff --git a/extensions/browser/api/declarative_net_request/file_backed_ruleset_source.h b/extensions/browser/api/declarative_net_request/file_backed_ruleset_source.h index 1e37014..96e0391 100644 --- a/extensions/browser/api/declarative_net_request/file_backed_ruleset_source.h +++ b/extensions/browser/api/declarative_net_request/file_backed_ruleset_source.h
@@ -66,6 +66,7 @@ const IndexAndPersistJSONRulesetResult&) = delete; ~IndexAndPersistJSONRulesetResult(); + IndexAndPersistJSONRulesetResult(IndexAndPersistJSONRulesetResult&&); IndexAndPersistJSONRulesetResult& operator=( IndexAndPersistJSONRulesetResult&&); @@ -121,10 +122,14 @@ std::string error); ReadJSONRulesResult(); - ~ReadJSONRulesResult(); + ReadJSONRulesResult(const ReadJSONRulesResult&) = delete; ReadJSONRulesResult(ReadJSONRulesResult&&); + + ReadJSONRulesResult& operator=(const ReadJSONRulesResult&) = delete; ReadJSONRulesResult& operator=(ReadJSONRulesResult&&); + ~ReadJSONRulesResult(); + Status status = Status::kSuccess; // Empty in case of an error. @@ -135,9 +140,6 @@ // Populated on error. std::string error; - - private: - DISALLOW_COPY_AND_ASSIGN(ReadJSONRulesResult); }; // A Ruleset source which is backed on disk. The indexed version of such a
diff --git a/extensions/browser/api/declarative_net_request/file_sequence_helper.cc b/extensions/browser/api/declarative_net_request/file_sequence_helper.cc index 62d98b4..791c3e0 100644 --- a/extensions/browser/api/declarative_net_request/file_sequence_helper.cc +++ b/extensions/browser/api/declarative_net_request/file_sequence_helper.cc
@@ -48,6 +48,9 @@ IndexHelper(LoadRequestData data, IndexCallback callback) : data_(std::move(data)), callback_(std::move(callback)) {} + IndexHelper(const IndexHelper&) = delete; + IndexHelper& operator=(const IndexHelper&) = delete; + // Starts indexing rulesets. Must be called on the extension file task runner. void Start(uint8_t parse_flags) { DCHECK(GetExtensionFileTaskRunner()->RunsTasksInCurrentSequence()); @@ -137,8 +140,6 @@ // We use a single shared Data Decoder service instance to process all of the // rulesets for this IndexHelper. data_decoder::DataDecoder decoder_; - - DISALLOW_COPY_AND_ASSIGN(IndexHelper); }; UpdateDynamicRulesStatus GetUpdateDynamicRuleStatus(LoadRulesetResult result) {
diff --git a/extensions/browser/api/declarative_net_request/file_sequence_helper.h b/extensions/browser/api/declarative_net_request/file_sequence_helper.h index 8bcd801..12518e0 100644 --- a/extensions/browser/api/declarative_net_request/file_sequence_helper.h +++ b/extensions/browser/api/declarative_net_request/file_sequence_helper.h
@@ -34,13 +34,13 @@ class RulesetInfo { public: explicit RulesetInfo(FileBackedRulesetSource source); - RulesetInfo(const RulesetInfo&) = delete; + RulesetInfo(RulesetInfo&&); + RulesetInfo& operator=(const RulesetInfo&) = delete; + RulesetInfo& operator=(RulesetInfo&&); ~RulesetInfo(); - RulesetInfo(RulesetInfo&&); - RulesetInfo& operator=(RulesetInfo&&); const FileBackedRulesetSource& source() const { return source_; } @@ -97,15 +97,16 @@ // Helper to pass information related to the ruleset being loaded. struct LoadRequestData { explicit LoadRequestData(ExtensionId extension_id); - ~LoadRequestData(); + LoadRequestData(const LoadRequestData&) = delete; LoadRequestData(LoadRequestData&&); + + LoadRequestData& operator=(const LoadRequestData&) = delete; LoadRequestData& operator=(LoadRequestData&&); + ~LoadRequestData(); + ExtensionId extension_id; std::vector<RulesetInfo> rulesets; - - private: - DISALLOW_COPY_AND_ASSIGN(LoadRequestData); }; // Helper class for file sequence operations for the declarative net request
diff --git a/extensions/browser/api/declarative_net_request/file_sequence_helper_unittest.cc b/extensions/browser/api/declarative_net_request/file_sequence_helper_unittest.cc index 958e645..77bd96e 100644 --- a/extensions/browser/api/declarative_net_request/file_sequence_helper_unittest.cc +++ b/extensions/browser/api/declarative_net_request/file_sequence_helper_unittest.cc
@@ -69,6 +69,9 @@ public: FileSequenceHelperTest() = default; + FileSequenceHelperTest(const FileSequenceHelperTest&) = delete; + FileSequenceHelperTest& operator=(const FileSequenceHelperTest&) = delete; + // ExtensionsTest overrides: void SetUp() override { ExtensionsTest::SetUp(); @@ -207,8 +210,6 @@ // Required to use DataDecoder's JSON parsing for re-indexing. data_decoder::test::InProcessDataDecoder in_process_data_decoder_; - - DISALLOW_COPY_AND_ASSIGN(FileSequenceHelperTest); }; TEST_F(FileSequenceHelperTest, NoRulesetsToLoad) {
diff --git a/extensions/browser/api/declarative_net_request/filter_list_converter/converter.cc b/extensions/browser/api/declarative_net_request/filter_list_converter/converter.cc index 51e8112..e4c51da 100644 --- a/extensions/browser/api/declarative_net_request/filter_list_converter/converter.cc +++ b/extensions/browser/api/declarative_net_request/filter_list_converter/converter.cc
@@ -37,6 +37,9 @@ // supported by Declarative Net Request. class ProtoToJSONRuleConverter { public: + ProtoToJSONRuleConverter(const ProtoToJSONRuleConverter&) = delete; + ProtoToJSONRuleConverter& operator=(const ProtoToJSONRuleConverter&) = delete; + // Returns a dictionary value corresponding to a Declarative Net Request rule // on success. On error, returns an empty/null value and populates |error|. // |error| must be non-null. @@ -449,8 +452,6 @@ int rule_id_; std::string error_; base::Value json_rule_; - - DISALLOW_COPY_AND_ASSIGN(ProtoToJSONRuleConverter); }; // Writes rules/extension to |output_path| in the format supported by @@ -466,6 +467,9 @@ write_type_(type), noisy_(noisy) {} + DNRJsonRuleOutputStream(const DNRJsonRuleOutputStream&) = delete; + DNRJsonRuleOutputStream& operator=(const DNRJsonRuleOutputStream&) = delete; + bool PutUrlRule(const proto::UrlRule& rule) override { std::string error; base::Value json_rule_value = @@ -516,8 +520,6 @@ const base::FilePath output_path_; const filter_list_converter::WriteType write_type_; const bool noisy_; - - DISALLOW_COPY_AND_ASSIGN(DNRJsonRuleOutputStream); }; } // namespace
diff --git a/extensions/browser/api/declarative_net_request/indexed_rule.cc b/extensions/browser/api/declarative_net_request/indexed_rule.cc index a340cf1..541797b 100644 --- a/extensions/browser/api/declarative_net_request/indexed_rule.cc +++ b/extensions/browser/api/declarative_net_request/indexed_rule.cc
@@ -44,6 +44,9 @@ // Helper class to parse the url filter of a Declarative Net Request API rule. class UrlFilterParser { public: + UrlFilterParser(const UrlFilterParser&) = delete; + UrlFilterParser& operator=(const UrlFilterParser&) = delete; + // This sets the |url_pattern_type|, |anchor_left|, |anchor_right| and // |url_pattern| fields on the |indexed_rule_|. static void Parse(std::unique_ptr<std::string> url_filter, @@ -125,8 +128,6 @@ const size_t url_filter_len_; size_t index_; IndexedRule* indexed_rule_; // Must outlive this instance. - - DISALLOW_COPY_AND_ASSIGN(UrlFilterParser); }; bool IsCaseSensitive(const dnr_api::Rule& parsed_rule) {
diff --git a/extensions/browser/api/declarative_net_request/indexed_rule.h b/extensions/browser/api/declarative_net_request/indexed_rule.h index dcf40ba..5acbb48 100644 --- a/extensions/browser/api/declarative_net_request/indexed_rule.h +++ b/extensions/browser/api/declarative_net_request/indexed_rule.h
@@ -28,10 +28,14 @@ // UrlRule as specified by the url_pattern_index component. struct IndexedRule { IndexedRule(); - ~IndexedRule(); + IndexedRule(const IndexedRule&) = delete; IndexedRule(IndexedRule&& other); + + IndexedRule& operator=(const IndexedRule&) = delete; IndexedRule& operator=(IndexedRule&& other); + ~IndexedRule(); + static ParseResult CreateIndexedRule( extensions::api::declarative_net_request::Rule parsed_rule, const GURL& base_url, @@ -82,8 +86,6 @@ // Set of tab IDs this rule doesn't apply to. base::flat_set<int> excluded_tab_ids; - - DISALLOW_COPY_AND_ASSIGN(IndexedRule); }; // Compute the rule priority for indexing, by combining the priority from
diff --git a/extensions/browser/api/declarative_net_request/request_params.h b/extensions/browser/api/declarative_net_request/request_params.h index 1d22c4c..25102db 100644 --- a/extensions/browser/api/declarative_net_request/request_params.h +++ b/extensions/browser/api/declarative_net_request/request_params.h
@@ -34,6 +34,8 @@ explicit RequestParams(content::RenderFrameHost* host, bool is_post_navigation); RequestParams(); + RequestParams(const RequestParams&) = delete; + RequestParams& operator=(const RequestParams&) = delete; ~RequestParams(); // This is a pointer to a GURL. Hence the GURL must outlive this struct. @@ -68,8 +70,6 @@ // request. Cached for performance. mutable base::flat_map<const RegexRulesMatcher*, std::vector<RegexRuleInfo>> potential_regex_matches; - - DISALLOW_COPY_AND_ASSIGN(RequestParams); }; } // namespace declarative_net_request
diff --git a/extensions/browser/api/declarative_net_request/rules_monitor_service.h b/extensions/browser/api/declarative_net_request/rules_monitor_service.h index 7132657..6dadf668 100644 --- a/extensions/browser/api/declarative_net_request/rules_monitor_service.h +++ b/extensions/browser/api/declarative_net_request/rules_monitor_service.h
@@ -68,6 +68,9 @@ virtual ~TestObserver() = default; }; + RulesMonitorService(const RulesMonitorService&) = delete; + RulesMonitorService& operator=(const RulesMonitorService&) = delete; + // This is public so that it can be deleted by tests. ~RulesMonitorService() override; @@ -257,8 +260,6 @@ // Must be the last member variable. See WeakPtrFactory documentation for // details. base::WeakPtrFactory<RulesMonitorService> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(RulesMonitorService); }; } // namespace declarative_net_request
diff --git a/extensions/browser/api/declarative_net_request/ruleset_manager.h b/extensions/browser/api/declarative_net_request/ruleset_manager.h index b3f99fe..03fc0f4 100644 --- a/extensions/browser/api/declarative_net_request/ruleset_manager.h +++ b/extensions/browser/api/declarative_net_request/ruleset_manager.h
@@ -111,17 +111,19 @@ ExtensionRulesetData(const ExtensionId& extension_id, const base::Time& extension_install_time, std::unique_ptr<CompositeMatcher> matcher); - ~ExtensionRulesetData(); + ExtensionRulesetData(const ExtensionRulesetData&) = delete; ExtensionRulesetData(ExtensionRulesetData&& other); + + ExtensionRulesetData& operator=(const ExtensionRulesetData&) = delete; ExtensionRulesetData& operator=(ExtensionRulesetData&& other); + ~ExtensionRulesetData(); + ExtensionId extension_id; base::Time extension_install_time; std::unique_ptr<CompositeMatcher> matcher; bool operator<(const ExtensionRulesetData& other) const; - - DISALLOW_COPY_AND_ASSIGN(ExtensionRulesetData); }; using RulesetAndPageAccess =
diff --git a/extensions/browser/api/declarative_webrequest/webrequest_action.h b/extensions/browser/api/declarative_webrequest/webrequest_action.h index 0af54105..edbc777d 100644 --- a/extensions/browser/api/declarative_webrequest/webrequest_action.h +++ b/extensions/browser/api/declarative_webrequest/webrequest_action.h
@@ -179,6 +179,9 @@ public: WebRequestCancelAction(); + WebRequestCancelAction(const WebRequestCancelAction&) = delete; + WebRequestCancelAction& operator=(const WebRequestCancelAction&) = delete; + // Implementation of WebRequestAction: std::string GetName() const override; absl::optional<extension_web_request_api_helpers::EventResponseDelta> @@ -188,7 +191,6 @@ private: ~WebRequestCancelAction() override; - DISALLOW_COPY_AND_ASSIGN(WebRequestCancelAction); }; // Action that instructs to redirect a network request. @@ -196,6 +198,9 @@ public: explicit WebRequestRedirectAction(const GURL& redirect_url); + WebRequestRedirectAction(const WebRequestRedirectAction&) = delete; + WebRequestRedirectAction& operator=(const WebRequestRedirectAction&) = delete; + // Implementation of WebRequestAction: bool Equals(const WebRequestAction* other) const override; std::string GetName() const override; @@ -208,8 +213,6 @@ ~WebRequestRedirectAction() override; GURL redirect_url_; // Target to which the request shall be redirected. - - DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectAction); }; // Action that instructs to redirect a network request to a transparent image. @@ -217,6 +220,11 @@ public: WebRequestRedirectToTransparentImageAction(); + WebRequestRedirectToTransparentImageAction( + const WebRequestRedirectToTransparentImageAction&) = delete; + WebRequestRedirectToTransparentImageAction& operator=( + const WebRequestRedirectToTransparentImageAction&) = delete; + // Implementation of WebRequestAction: std::string GetName() const override; absl::optional<extension_web_request_api_helpers::EventResponseDelta> @@ -226,7 +234,6 @@ private: ~WebRequestRedirectToTransparentImageAction() override; - DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectToTransparentImageAction); }; @@ -235,6 +242,11 @@ public: WebRequestRedirectToEmptyDocumentAction(); + WebRequestRedirectToEmptyDocumentAction( + const WebRequestRedirectToEmptyDocumentAction&) = delete; + WebRequestRedirectToEmptyDocumentAction& operator=( + const WebRequestRedirectToEmptyDocumentAction&) = delete; + // Implementation of WebRequestAction: std::string GetName() const override; absl::optional<extension_web_request_api_helpers::EventResponseDelta> @@ -244,7 +256,6 @@ private: ~WebRequestRedirectToEmptyDocumentAction() override; - DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectToEmptyDocumentAction); }; // Action that instructs to redirect a network request. @@ -256,6 +267,11 @@ std::unique_ptr<re2::RE2> from_pattern, const std::string& to_pattern); + WebRequestRedirectByRegExAction(const WebRequestRedirectByRegExAction&) = + delete; + WebRequestRedirectByRegExAction& operator=( + const WebRequestRedirectByRegExAction&) = delete; + // Conversion of capture group styles between Perl style ($1, $2, ...) and // RE2 (\1, \2, ...). static std::string PerlToRe2Style(const std::string& perl); @@ -273,8 +289,6 @@ std::unique_ptr<re2::RE2> from_pattern_; std::string to_pattern_; - - DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectByRegExAction); }; // Action that instructs to set a request header. @@ -283,6 +297,11 @@ WebRequestSetRequestHeaderAction(const std::string& name, const std::string& value); + WebRequestSetRequestHeaderAction(const WebRequestSetRequestHeaderAction&) = + delete; + WebRequestSetRequestHeaderAction& operator=( + const WebRequestSetRequestHeaderAction&) = delete; + // Implementation of WebRequestAction: bool Equals(const WebRequestAction* other) const override; std::string GetName() const override; @@ -296,7 +315,6 @@ std::string name_; std::string value_; - DISALLOW_COPY_AND_ASSIGN(WebRequestSetRequestHeaderAction); }; // Action that instructs to remove a request header. @@ -304,6 +322,11 @@ public: explicit WebRequestRemoveRequestHeaderAction(const std::string& name); + WebRequestRemoveRequestHeaderAction( + const WebRequestRemoveRequestHeaderAction&) = delete; + WebRequestRemoveRequestHeaderAction& operator=( + const WebRequestRemoveRequestHeaderAction&) = delete; + // Implementation of WebRequestAction: bool Equals(const WebRequestAction* other) const override; std::string GetName() const override; @@ -316,7 +339,6 @@ ~WebRequestRemoveRequestHeaderAction() override; std::string name_; - DISALLOW_COPY_AND_ASSIGN(WebRequestRemoveRequestHeaderAction); }; // Action that instructs to add a response header. @@ -325,6 +347,11 @@ WebRequestAddResponseHeaderAction(const std::string& name, const std::string& value); + WebRequestAddResponseHeaderAction(const WebRequestAddResponseHeaderAction&) = + delete; + WebRequestAddResponseHeaderAction& operator=( + const WebRequestAddResponseHeaderAction&) = delete; + // Implementation of WebRequestAction: bool Equals(const WebRequestAction* other) const override; std::string GetName() const override; @@ -338,7 +365,6 @@ std::string name_; std::string value_; - DISALLOW_COPY_AND_ASSIGN(WebRequestAddResponseHeaderAction); }; // Action that instructs to remove a response header. @@ -348,6 +374,11 @@ const std::string& value, bool has_value); + WebRequestRemoveResponseHeaderAction( + const WebRequestRemoveResponseHeaderAction&) = delete; + WebRequestRemoveResponseHeaderAction& operator=( + const WebRequestRemoveResponseHeaderAction&) = delete; + // Implementation of WebRequestAction: bool Equals(const WebRequestAction* other) const override; std::string GetName() const override; @@ -362,7 +393,6 @@ std::string name_; std::string value_; bool has_value_; - DISALLOW_COPY_AND_ASSIGN(WebRequestRemoveResponseHeaderAction); }; // Action that instructs to ignore rules below a certain priority. @@ -371,6 +401,10 @@ explicit WebRequestIgnoreRulesAction(int minimum_priority, const std::string& ignore_tag); + WebRequestIgnoreRulesAction(const WebRequestIgnoreRulesAction&) = delete; + WebRequestIgnoreRulesAction& operator=(const WebRequestIgnoreRulesAction&) = + delete; + // Implementation of WebRequestAction: bool Equals(const WebRequestAction* other) const override; std::string GetName() const override; @@ -386,7 +420,6 @@ // Rules are ignored if they have a tag matching |ignore_tag_| and // |ignore_tag_| is non-empty. std::string ignore_tag_; - DISALLOW_COPY_AND_ASSIGN(WebRequestIgnoreRulesAction); }; // Action that instructs to modify (add, edit, remove) a request cookie. @@ -398,6 +431,10 @@ explicit WebRequestRequestCookieAction( RequestCookieModification request_cookie_modification); + WebRequestRequestCookieAction(const WebRequestRequestCookieAction&) = delete; + WebRequestRequestCookieAction& operator=( + const WebRequestRequestCookieAction&) = delete; + // Implementation of WebRequestAction: bool Equals(const WebRequestAction* other) const override; std::string GetName() const override; @@ -410,7 +447,6 @@ ~WebRequestRequestCookieAction() override; const RequestCookieModification request_cookie_modification_; - DISALLOW_COPY_AND_ASSIGN(WebRequestRequestCookieAction); }; // Action that instructs to modify (add, edit, remove) a response cookie. @@ -422,6 +458,11 @@ explicit WebRequestResponseCookieAction( ResponseCookieModification response_cookie_modification); + WebRequestResponseCookieAction(const WebRequestResponseCookieAction&) = + delete; + WebRequestResponseCookieAction& operator=( + const WebRequestResponseCookieAction&) = delete; + // Implementation of WebRequestAction: bool Equals(const WebRequestAction* other) const override; std::string GetName() const override; @@ -434,7 +475,6 @@ ~WebRequestResponseCookieAction() override; const ResponseCookieModification response_cookie_modification_; - DISALLOW_COPY_AND_ASSIGN(WebRequestResponseCookieAction); }; // Action that triggers the chrome.declarativeWebRequest.onMessage event in @@ -443,6 +483,11 @@ public: explicit WebRequestSendMessageToExtensionAction(const std::string& message); + WebRequestSendMessageToExtensionAction( + const WebRequestSendMessageToExtensionAction&) = delete; + WebRequestSendMessageToExtensionAction& operator=( + const WebRequestSendMessageToExtensionAction&) = delete; + // Implementation of WebRequestAction: bool Equals(const WebRequestAction* other) const override; std::string GetName() const override; @@ -455,7 +500,6 @@ ~WebRequestSendMessageToExtensionAction() override; std::string message_; - DISALLOW_COPY_AND_ASSIGN(WebRequestSendMessageToExtensionAction); }; } // namespace extensions
diff --git a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.h b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.h index 1ebf27b..89fa99e 100644 --- a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.h +++ b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.h
@@ -41,6 +41,10 @@ WebRequestConditionAttribute(); + WebRequestConditionAttribute(const WebRequestConditionAttribute&) = delete; + WebRequestConditionAttribute& operator=(const WebRequestConditionAttribute&) = + delete; + // Factory method that creates a WebRequestConditionAttribute for the JSON // dictionary {|name|: |value|} passed by the extension API. Sets |error| and // returns NULL if something fails. @@ -69,9 +73,6 @@ protected: friend class base::RefCounted<WebRequestConditionAttribute>; virtual ~WebRequestConditionAttribute(); - - private: - DISALLOW_COPY_AND_ASSIGN(WebRequestConditionAttribute); }; typedef std::vector<scoped_refptr<const WebRequestConditionAttribute> > @@ -85,6 +86,11 @@ class WebRequestConditionAttributeResourceType : public WebRequestConditionAttribute { public: + WebRequestConditionAttributeResourceType( + const WebRequestConditionAttributeResourceType&) = delete; + WebRequestConditionAttributeResourceType& operator=( + const WebRequestConditionAttributeResourceType&) = delete; + // Factory method, see WebRequestConditionAttribute::Create. static scoped_refptr<const WebRequestConditionAttribute> Create( const std::string& instance_type, @@ -106,8 +112,6 @@ // TODO(pkalinnikov): Make this a bitmask. const std::vector<WebRequestResourceType> types_; - - DISALLOW_COPY_AND_ASSIGN(WebRequestConditionAttributeResourceType); }; // Condition that checks whether a response's Content-Type header has a @@ -115,6 +119,11 @@ class WebRequestConditionAttributeContentType : public WebRequestConditionAttribute { public: + WebRequestConditionAttributeContentType( + const WebRequestConditionAttributeContentType&) = delete; + WebRequestConditionAttributeContentType& operator=( + const WebRequestConditionAttributeContentType&) = delete; + // Factory method, see WebRequestConditionAttribute::Create. static scoped_refptr<const WebRequestConditionAttribute> Create( const std::string& name, @@ -137,8 +146,6 @@ const std::vector<std::string> content_types_; const bool inclusive_; - - DISALLOW_COPY_AND_ASSIGN(WebRequestConditionAttributeContentType); }; // Condition attribute for matching against request headers. Uses HeaderMatcher @@ -149,6 +156,11 @@ class WebRequestConditionAttributeRequestHeaders : public WebRequestConditionAttribute { public: + WebRequestConditionAttributeRequestHeaders( + const WebRequestConditionAttributeRequestHeaders&) = delete; + WebRequestConditionAttributeRequestHeaders& operator=( + const WebRequestConditionAttributeRequestHeaders&) = delete; + // Factory method, see WebRequestConditionAttribute::Create. static scoped_refptr<const WebRequestConditionAttribute> Create( const std::string& name, @@ -171,8 +183,6 @@ const std::unique_ptr<const HeaderMatcher> header_matcher_; const bool positive_; - - DISALLOW_COPY_AND_ASSIGN(WebRequestConditionAttributeRequestHeaders); }; // Condition attribute for matching against response headers. Uses HeaderMatcher @@ -183,6 +193,11 @@ class WebRequestConditionAttributeResponseHeaders : public WebRequestConditionAttribute { public: + WebRequestConditionAttributeResponseHeaders( + const WebRequestConditionAttributeResponseHeaders&) = delete; + WebRequestConditionAttributeResponseHeaders& operator=( + const WebRequestConditionAttributeResponseHeaders&) = delete; + // Factory method, see WebRequestConditionAttribute::Create. static scoped_refptr<const WebRequestConditionAttribute> Create( const std::string& name, @@ -205,8 +220,6 @@ const std::unique_ptr<const HeaderMatcher> header_matcher_; const bool positive_; - - DISALLOW_COPY_AND_ASSIGN(WebRequestConditionAttributeResponseHeaders); }; // This condition is used as a filter for request stages. It is true exactly in @@ -214,6 +227,11 @@ class WebRequestConditionAttributeStages : public WebRequestConditionAttribute { public: + WebRequestConditionAttributeStages( + const WebRequestConditionAttributeStages&) = delete; + WebRequestConditionAttributeStages& operator=( + const WebRequestConditionAttributeStages&) = delete; + // Factory method, see WebRequestConditionAttribute::Create. static scoped_refptr<const WebRequestConditionAttribute> Create( const std::string& name, @@ -233,8 +251,6 @@ ~WebRequestConditionAttributeStages() override; const int allowed_stages_; // Composition of RequestStage values. - - DISALLOW_COPY_AND_ASSIGN(WebRequestConditionAttributeStages); }; } // namespace extensions
diff --git a/extensions/browser/api/declarative_webrequest/webrequest_rules_registry.h b/extensions/browser/api/declarative_webrequest/webrequest_rules_registry.h index 53c7c4b3..084718c 100644 --- a/extensions/browser/api/declarative_webrequest/webrequest_rules_registry.h +++ b/extensions/browser/api/declarative_webrequest/webrequest_rules_registry.h
@@ -73,6 +73,9 @@ RulesCacheDelegate* cache_delegate, int rules_registry_id); + WebRequestRulesRegistry(const WebRequestRulesRegistry&) = delete; + WebRequestRulesRegistry& operator=(const WebRequestRulesRegistry&) = delete; + // TODO(battre): This will become an implementation detail, because we need // a way to also execute the actions of the rules. std::set<const WebRequestRule*> GetMatches( @@ -172,8 +175,6 @@ url_matcher::URLMatcher url_matcher_; content::BrowserContext* browser_context_; - - DISALLOW_COPY_AND_ASSIGN(WebRequestRulesRegistry); }; } // namespace extensions
diff --git a/extensions/browser/api/device_permissions_manager.h b/extensions/browser/api/device_permissions_manager.h index cedfad13..473e49c 100644 --- a/extensions/browser/api/device_permissions_manager.h +++ b/extensions/browser/api/device_permissions_manager.h
@@ -140,6 +140,9 @@ // Manages saved device permissions for all extensions. class DevicePermissionsManager : public KeyedService { public: + DevicePermissionsManager(const DevicePermissionsManager&) = delete; + DevicePermissionsManager& operator=(const DevicePermissionsManager&) = delete; + static DevicePermissionsManager* Get(content::BrowserContext* context); static std::u16string GetPermissionMessage( @@ -191,13 +194,16 @@ base::ThreadChecker thread_checker_; content::BrowserContext* context_; std::map<std::string, DevicePermissions*> extension_id_to_device_permissions_; - - DISALLOW_COPY_AND_ASSIGN(DevicePermissionsManager); }; class DevicePermissionsManagerFactory : public BrowserContextKeyedServiceFactory { public: + DevicePermissionsManagerFactory(const DevicePermissionsManagerFactory&) = + delete; + DevicePermissionsManagerFactory& operator=( + const DevicePermissionsManagerFactory&) = delete; + static DevicePermissionsManager* GetForBrowserContext( content::BrowserContext* context); static DevicePermissionsManagerFactory* GetInstance(); @@ -213,8 +219,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(DevicePermissionsManagerFactory); }; } // namespace extensions
diff --git a/extensions/browser/api/device_permissions_prompt.h b/extensions/browser/api/device_permissions_prompt.h index 6ab5d72..a64da34 100644 --- a/extensions/browser/api/device_permissions_prompt.h +++ b/extensions/browser/api/device_permissions_prompt.h
@@ -84,6 +84,9 @@ content::BrowserContext* context, bool multiple); + Prompt(const Prompt&) = delete; + Prompt& operator=(const Prompt&) = delete; + // Only one observer may be registered at a time. virtual void SetObserver(Observer* observer); @@ -122,11 +125,13 @@ Observer* observer_ = nullptr; content::BrowserContext* browser_context_ = nullptr; bool multiple_ = false; - - DISALLOW_COPY_AND_ASSIGN(Prompt); }; explicit DevicePermissionsPrompt(content::WebContents* web_contents); + + DevicePermissionsPrompt(const DevicePermissionsPrompt&) = delete; + DevicePermissionsPrompt& operator=(const DevicePermissionsPrompt&) = delete; + virtual ~DevicePermissionsPrompt(); void AskForUsbDevices(const Extension* extension, @@ -165,8 +170,6 @@ // Parameters available to the UI implementation. scoped_refptr<Prompt> prompt_; - - DISALLOW_COPY_AND_ASSIGN(DevicePermissionsPrompt); }; } // namespace extensions
diff --git a/extensions/browser/api/execute_code_function.h b/extensions/browser/api/execute_code_function.h index f7f455d..0678fe0 100644 --- a/extensions/browser/api/execute_code_function.h +++ b/extensions/browser/api/execute_code_function.h
@@ -25,6 +25,9 @@ public: ExecuteCodeFunction(); + ExecuteCodeFunction(const ExecuteCodeFunction&) = delete; + ExecuteCodeFunction& operator=(const ExecuteCodeFunction&) = delete; + protected: ~ExecuteCodeFunction() override; @@ -99,8 +102,6 @@ // The ID of the root frame to inject into. int root_frame_id_ = -1; - - DISALLOW_COPY_AND_ASSIGN(ExecuteCodeFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.h b/extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.h index 26d07b5..2854cfa7 100644 --- a/extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.h +++ b/extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.h
@@ -16,12 +16,14 @@ APPVIEWINTERNAL_ATTACHFRAME) AppViewGuestInternalAttachFrameFunction(); + AppViewGuestInternalAttachFrameFunction( + const AppViewGuestInternalAttachFrameFunction&) = delete; + AppViewGuestInternalAttachFrameFunction& operator=( + const AppViewGuestInternalAttachFrameFunction&) = delete; + protected: ~AppViewGuestInternalAttachFrameFunction() override {} ResponseAction Run() final; - - private: - DISALLOW_COPY_AND_ASSIGN(AppViewGuestInternalAttachFrameFunction); }; class AppViewGuestInternalDenyRequestFunction : public ExtensionFunction { @@ -30,12 +32,14 @@ APPVIEWINTERNAL_DENYREQUEST) AppViewGuestInternalDenyRequestFunction(); + AppViewGuestInternalDenyRequestFunction( + const AppViewGuestInternalDenyRequestFunction&) = delete; + AppViewGuestInternalDenyRequestFunction& operator=( + const AppViewGuestInternalDenyRequestFunction&) = delete; + protected: ~AppViewGuestInternalDenyRequestFunction() override {} ResponseAction Run() final; - - private: - DISALLOW_COPY_AND_ASSIGN(AppViewGuestInternalDenyRequestFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/guest_view/guest_view_internal_api.h b/extensions/browser/api/guest_view/guest_view_internal_api.h index 0f39562..df31568 100644 --- a/extensions/browser/api/guest_view/guest_view_internal_api.h +++ b/extensions/browser/api/guest_view/guest_view_internal_api.h
@@ -16,6 +16,11 @@ GUESTVIEWINTERNAL_CREATEGUEST) GuestViewInternalCreateGuestFunction(); + GuestViewInternalCreateGuestFunction( + const GuestViewInternalCreateGuestFunction&) = delete; + GuestViewInternalCreateGuestFunction& operator=( + const GuestViewInternalCreateGuestFunction&) = delete; + protected: ~GuestViewInternalCreateGuestFunction() override {} @@ -24,7 +29,6 @@ private: void CreateGuestCallback(content::WebContents* guest_web_contents); - DISALLOW_COPY_AND_ASSIGN(GuestViewInternalCreateGuestFunction); }; class GuestViewInternalDestroyGuestFunction : public ExtensionFunction { @@ -33,6 +37,11 @@ GUESTVIEWINTERNAL_DESTROYGUEST) GuestViewInternalDestroyGuestFunction(); + GuestViewInternalDestroyGuestFunction( + const GuestViewInternalDestroyGuestFunction&) = delete; + GuestViewInternalDestroyGuestFunction& operator=( + const GuestViewInternalDestroyGuestFunction&) = delete; + protected: ~GuestViewInternalDestroyGuestFunction() override; @@ -41,7 +50,6 @@ private: void DestroyGuestCallback(content::WebContents* guest_web_contents); - DISALLOW_COPY_AND_ASSIGN(GuestViewInternalDestroyGuestFunction); }; class GuestViewInternalSetSizeFunction : public ExtensionFunction { @@ -51,14 +59,16 @@ GuestViewInternalSetSizeFunction(); + GuestViewInternalSetSizeFunction(const GuestViewInternalSetSizeFunction&) = + delete; + GuestViewInternalSetSizeFunction& operator=( + const GuestViewInternalSetSizeFunction&) = delete; + protected: ~GuestViewInternalSetSizeFunction() override; // ExtensionFunction: ResponseAction Run() final; - - private: - DISALLOW_COPY_AND_ASSIGN(GuestViewInternalSetSizeFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/guest_view/web_view/web_view_internal_api.h b/extensions/browser/api/guest_view/web_view/web_view_internal_api.h index 5b76774..9f86056 100644 --- a/extensions/browser/api/guest_view/web_view/web_view_internal_api.h +++ b/extensions/browser/api/guest_view/web_view/web_view_internal_api.h
@@ -45,6 +45,11 @@ WEBVIEWINTERNAL_CAPTUREVISIBLEREGION) WebViewInternalCaptureVisibleRegionFunction(); + WebViewInternalCaptureVisibleRegionFunction( + const WebViewInternalCaptureVisibleRegionFunction&) = delete; + WebViewInternalCaptureVisibleRegionFunction& operator=( + const WebViewInternalCaptureVisibleRegionFunction&) = delete; + protected: ~WebViewInternalCaptureVisibleRegionFunction() override {} @@ -68,8 +73,6 @@ std::string GetErrorMessage(CaptureResult result); bool is_guest_transparent_; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalCaptureVisibleRegionFunction); }; class WebViewInternalNavigateFunction @@ -79,13 +82,16 @@ WEBVIEWINTERNAL_NAVIGATE) WebViewInternalNavigateFunction() {} + WebViewInternalNavigateFunction(const WebViewInternalNavigateFunction&) = + delete; + WebViewInternalNavigateFunction& operator=( + const WebViewInternalNavigateFunction&) = delete; + protected: ~WebViewInternalNavigateFunction() override {} // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalNavigateFunction); }; class WebViewInternalExecuteCodeFunction @@ -93,6 +99,11 @@ public: WebViewInternalExecuteCodeFunction(); + WebViewInternalExecuteCodeFunction( + const WebViewInternalExecuteCodeFunction&) = delete; + WebViewInternalExecuteCodeFunction& operator=( + const WebViewInternalExecuteCodeFunction&) = delete; + protected: ~WebViewInternalExecuteCodeFunction() override; @@ -124,8 +135,6 @@ GURL guest_src_; std::unique_ptr<WebUIURLFetcher> url_fetcher_; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalExecuteCodeFunction); }; class WebViewInternalExecuteScriptFunction @@ -133,14 +142,16 @@ public: WebViewInternalExecuteScriptFunction(); + WebViewInternalExecuteScriptFunction( + const WebViewInternalExecuteScriptFunction&) = delete; + WebViewInternalExecuteScriptFunction& operator=( + const WebViewInternalExecuteScriptFunction&) = delete; + protected: ~WebViewInternalExecuteScriptFunction() override {} DECLARE_EXTENSION_FUNCTION("webViewInternal.executeScript", WEBVIEWINTERNAL_EXECUTESCRIPT) - - private: - DISALLOW_COPY_AND_ASSIGN(WebViewInternalExecuteScriptFunction); }; class WebViewInternalInsertCSSFunction @@ -148,6 +159,11 @@ public: WebViewInternalInsertCSSFunction(); + WebViewInternalInsertCSSFunction(const WebViewInternalInsertCSSFunction&) = + delete; + WebViewInternalInsertCSSFunction& operator=( + const WebViewInternalInsertCSSFunction&) = delete; + protected: ~WebViewInternalInsertCSSFunction() override {} @@ -155,9 +171,6 @@ DECLARE_EXTENSION_FUNCTION("webViewInternal.insertCSS", WEBVIEWINTERNAL_INSERTCSS) - - private: - DISALLOW_COPY_AND_ASSIGN(WebViewInternalInsertCSSFunction); }; class WebViewInternalAddContentScriptsFunction : public ExtensionFunction { @@ -167,13 +180,16 @@ WebViewInternalAddContentScriptsFunction(); + WebViewInternalAddContentScriptsFunction( + const WebViewInternalAddContentScriptsFunction&) = delete; + WebViewInternalAddContentScriptsFunction& operator=( + const WebViewInternalAddContentScriptsFunction&) = delete; + protected: ~WebViewInternalAddContentScriptsFunction() override; private: ExecuteCodeFunction::ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalAddContentScriptsFunction); }; class WebViewInternalRemoveContentScriptsFunction : public ExtensionFunction { @@ -183,14 +199,16 @@ WebViewInternalRemoveContentScriptsFunction(); + WebViewInternalRemoveContentScriptsFunction( + const WebViewInternalRemoveContentScriptsFunction&) = delete; + WebViewInternalRemoveContentScriptsFunction& operator=( + const WebViewInternalRemoveContentScriptsFunction&) = delete; + protected: ~WebViewInternalRemoveContentScriptsFunction() override; // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(WebViewInternalRemoveContentScriptsFunction); }; class WebViewInternalSetNameFunction : public WebViewInternalExtensionFunction { @@ -199,13 +217,16 @@ WebViewInternalSetNameFunction(); + WebViewInternalSetNameFunction(const WebViewInternalSetNameFunction&) = + delete; + WebViewInternalSetNameFunction& operator=( + const WebViewInternalSetNameFunction&) = delete; + protected: ~WebViewInternalSetNameFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetNameFunction); }; class WebViewInternalSetAllowTransparencyFunction @@ -216,13 +237,16 @@ WebViewInternalSetAllowTransparencyFunction(); + WebViewInternalSetAllowTransparencyFunction( + const WebViewInternalSetAllowTransparencyFunction&) = delete; + WebViewInternalSetAllowTransparencyFunction& operator=( + const WebViewInternalSetAllowTransparencyFunction&) = delete; + protected: ~WebViewInternalSetAllowTransparencyFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetAllowTransparencyFunction); }; class WebViewInternalSetAllowScalingFunction @@ -233,13 +257,16 @@ WebViewInternalSetAllowScalingFunction(); + WebViewInternalSetAllowScalingFunction( + const WebViewInternalSetAllowScalingFunction&) = delete; + WebViewInternalSetAllowScalingFunction& operator=( + const WebViewInternalSetAllowScalingFunction&) = delete; + protected: ~WebViewInternalSetAllowScalingFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetAllowScalingFunction); }; class WebViewInternalSetZoomFunction : public WebViewInternalExtensionFunction { @@ -248,13 +275,16 @@ WebViewInternalSetZoomFunction(); + WebViewInternalSetZoomFunction(const WebViewInternalSetZoomFunction&) = + delete; + WebViewInternalSetZoomFunction& operator=( + const WebViewInternalSetZoomFunction&) = delete; + protected: ~WebViewInternalSetZoomFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetZoomFunction); }; class WebViewInternalGetZoomFunction : public WebViewInternalExtensionFunction { @@ -263,13 +293,16 @@ WebViewInternalGetZoomFunction(); + WebViewInternalGetZoomFunction(const WebViewInternalGetZoomFunction&) = + delete; + WebViewInternalGetZoomFunction& operator=( + const WebViewInternalGetZoomFunction&) = delete; + protected: ~WebViewInternalGetZoomFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalGetZoomFunction); }; class WebViewInternalSetZoomModeFunction @@ -280,13 +313,16 @@ WebViewInternalSetZoomModeFunction(); + WebViewInternalSetZoomModeFunction( + const WebViewInternalSetZoomModeFunction&) = delete; + WebViewInternalSetZoomModeFunction& operator=( + const WebViewInternalSetZoomModeFunction&) = delete; + protected: ~WebViewInternalSetZoomModeFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetZoomModeFunction); }; class WebViewInternalGetZoomModeFunction @@ -297,13 +333,16 @@ WebViewInternalGetZoomModeFunction(); + WebViewInternalGetZoomModeFunction( + const WebViewInternalGetZoomModeFunction&) = delete; + WebViewInternalGetZoomModeFunction& operator=( + const WebViewInternalGetZoomModeFunction&) = delete; + protected: ~WebViewInternalGetZoomModeFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalGetZoomModeFunction); }; class WebViewInternalFindFunction : public WebViewInternalExtensionFunction { @@ -312,6 +351,10 @@ WebViewInternalFindFunction(); + WebViewInternalFindFunction(const WebViewInternalFindFunction&) = delete; + WebViewInternalFindFunction& operator=(const WebViewInternalFindFunction&) = + delete; + // Used by WebViewInternalFindHelper to Respond(). void ForwardResponse(const base::DictionaryValue& results); @@ -321,8 +364,6 @@ private: // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalFindFunction); }; class WebViewInternalStopFindingFunction @@ -333,13 +374,16 @@ WebViewInternalStopFindingFunction(); + WebViewInternalStopFindingFunction( + const WebViewInternalStopFindingFunction&) = delete; + WebViewInternalStopFindingFunction& operator=( + const WebViewInternalStopFindingFunction&) = delete; + protected: ~WebViewInternalStopFindingFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalStopFindingFunction); }; class WebViewInternalLoadDataWithBaseUrlFunction @@ -350,13 +394,16 @@ WebViewInternalLoadDataWithBaseUrlFunction(); + WebViewInternalLoadDataWithBaseUrlFunction( + const WebViewInternalLoadDataWithBaseUrlFunction&) = delete; + WebViewInternalLoadDataWithBaseUrlFunction& operator=( + const WebViewInternalLoadDataWithBaseUrlFunction&) = delete; + protected: ~WebViewInternalLoadDataWithBaseUrlFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalLoadDataWithBaseUrlFunction); }; class WebViewInternalGoFunction : public WebViewInternalExtensionFunction { @@ -365,13 +412,15 @@ WebViewInternalGoFunction(); + WebViewInternalGoFunction(const WebViewInternalGoFunction&) = delete; + WebViewInternalGoFunction& operator=(const WebViewInternalGoFunction&) = + delete; + protected: ~WebViewInternalGoFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalGoFunction); }; class WebViewInternalReloadFunction : public WebViewInternalExtensionFunction { @@ -380,13 +429,15 @@ WebViewInternalReloadFunction(); + WebViewInternalReloadFunction(const WebViewInternalReloadFunction&) = delete; + WebViewInternalReloadFunction& operator=( + const WebViewInternalReloadFunction&) = delete; + protected: ~WebViewInternalReloadFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalReloadFunction); }; class WebViewInternalSetPermissionFunction @@ -397,13 +448,16 @@ WebViewInternalSetPermissionFunction(); + WebViewInternalSetPermissionFunction( + const WebViewInternalSetPermissionFunction&) = delete; + WebViewInternalSetPermissionFunction& operator=( + const WebViewInternalSetPermissionFunction&) = delete; + protected: ~WebViewInternalSetPermissionFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetPermissionFunction); }; class WebViewInternalOverrideUserAgentFunction @@ -414,13 +468,16 @@ WebViewInternalOverrideUserAgentFunction(); + WebViewInternalOverrideUserAgentFunction( + const WebViewInternalOverrideUserAgentFunction&) = delete; + WebViewInternalOverrideUserAgentFunction& operator=( + const WebViewInternalOverrideUserAgentFunction&) = delete; + protected: ~WebViewInternalOverrideUserAgentFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalOverrideUserAgentFunction); }; class WebViewInternalStopFunction : public WebViewInternalExtensionFunction { @@ -429,13 +486,15 @@ WebViewInternalStopFunction(); + WebViewInternalStopFunction(const WebViewInternalStopFunction&) = delete; + WebViewInternalStopFunction& operator=(const WebViewInternalStopFunction&) = + delete; + protected: ~WebViewInternalStopFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalStopFunction); }; class WebViewInternalSetAudioMutedFunction @@ -446,13 +505,16 @@ WebViewInternalSetAudioMutedFunction(); + WebViewInternalSetAudioMutedFunction( + const WebViewInternalSetAudioMutedFunction&) = delete; + WebViewInternalSetAudioMutedFunction& operator=( + const WebViewInternalSetAudioMutedFunction&) = delete; + protected: ~WebViewInternalSetAudioMutedFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetAudioMutedFunction); }; class WebViewInternalIsAudioMutedFunction @@ -463,13 +525,16 @@ WebViewInternalIsAudioMutedFunction(); + WebViewInternalIsAudioMutedFunction( + const WebViewInternalIsAudioMutedFunction&) = delete; + WebViewInternalIsAudioMutedFunction& operator=( + const WebViewInternalIsAudioMutedFunction&) = delete; + protected: ~WebViewInternalIsAudioMutedFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalIsAudioMutedFunction); }; class WebViewInternalGetAudioStateFunction @@ -480,13 +545,16 @@ WebViewInternalGetAudioStateFunction(); + WebViewInternalGetAudioStateFunction( + const WebViewInternalGetAudioStateFunction&) = delete; + WebViewInternalGetAudioStateFunction& operator=( + const WebViewInternalGetAudioStateFunction&) = delete; + protected: ~WebViewInternalGetAudioStateFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalGetAudioStateFunction); }; class WebViewInternalTerminateFunction @@ -497,13 +565,16 @@ WebViewInternalTerminateFunction(); + WebViewInternalTerminateFunction(const WebViewInternalTerminateFunction&) = + delete; + WebViewInternalTerminateFunction& operator=( + const WebViewInternalTerminateFunction&) = delete; + protected: ~WebViewInternalTerminateFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalTerminateFunction); }; class WebViewInternalClearDataFunction @@ -514,6 +585,11 @@ WebViewInternalClearDataFunction(); + WebViewInternalClearDataFunction(const WebViewInternalClearDataFunction&) = + delete; + WebViewInternalClearDataFunction& operator=( + const WebViewInternalClearDataFunction&) = delete; + protected: ~WebViewInternalClearDataFunction() override; @@ -530,8 +606,6 @@ uint32_t remove_mask_; // Tracks any data related or parse errors. bool bad_message_; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalClearDataFunction); }; class WebViewInternalSetSpatialNavigationEnabledFunction @@ -542,13 +616,16 @@ WebViewInternalSetSpatialNavigationEnabledFunction(); + WebViewInternalSetSpatialNavigationEnabledFunction( + const WebViewInternalSetSpatialNavigationEnabledFunction&) = delete; + WebViewInternalSetSpatialNavigationEnabledFunction& operator=( + const WebViewInternalSetSpatialNavigationEnabledFunction&) = delete; + protected: ~WebViewInternalSetSpatialNavigationEnabledFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetSpatialNavigationEnabledFunction); }; class WebViewInternalIsSpatialNavigationEnabledFunction @@ -559,13 +636,16 @@ WebViewInternalIsSpatialNavigationEnabledFunction(); + WebViewInternalIsSpatialNavigationEnabledFunction( + const WebViewInternalIsSpatialNavigationEnabledFunction&) = delete; + WebViewInternalIsSpatialNavigationEnabledFunction& operator=( + const WebViewInternalIsSpatialNavigationEnabledFunction&) = delete; + protected: ~WebViewInternalIsSpatialNavigationEnabledFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(WebViewInternalIsSpatialNavigationEnabledFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/hid/hid_api.h b/extensions/browser/api/hid/hid_api.h index 593594f..cca18ad 100644 --- a/extensions/browser/api/hid/hid_api.h +++ b/extensions/browser/api/hid/hid_api.h
@@ -30,6 +30,9 @@ HidGetDevicesFunction(); + HidGetDevicesFunction(const HidGetDevicesFunction&) = delete; + HidGetDevicesFunction& operator=(const HidGetDevicesFunction&) = delete; + private: ~HidGetDevicesFunction() override; @@ -37,8 +40,6 @@ ResponseAction Run() override; void OnEnumerationComplete(std::unique_ptr<base::ListValue> devices); - - DISALLOW_COPY_AND_ASSIGN(HidGetDevicesFunction); }; class HidGetUserSelectedDevicesFunction : public ExtensionFunction { @@ -48,6 +49,11 @@ HidGetUserSelectedDevicesFunction(); + HidGetUserSelectedDevicesFunction(const HidGetUserSelectedDevicesFunction&) = + delete; + HidGetUserSelectedDevicesFunction& operator=( + const HidGetUserSelectedDevicesFunction&) = delete; + private: ~HidGetUserSelectedDevicesFunction() override; @@ -57,8 +63,6 @@ void OnDevicesChosen(std::vector<device::mojom::HidDeviceInfoPtr> devices); std::unique_ptr<DevicePermissionsPrompt> prompt_; - - DISALLOW_COPY_AND_ASSIGN(HidGetUserSelectedDevicesFunction); }; class HidConnectFunction : public ExtensionFunction { @@ -67,6 +71,9 @@ HidConnectFunction(); + HidConnectFunction(const HidConnectFunction&) = delete; + HidConnectFunction& operator=(const HidConnectFunction&) = delete; + private: ~HidConnectFunction() override; @@ -77,8 +84,6 @@ mojo::PendingRemote<device::mojom::HidConnection> connection); ApiResourceManager<HidConnectionResource>* connection_manager_; - - DISALLOW_COPY_AND_ASSIGN(HidConnectFunction); }; class HidDisconnectFunction : public ExtensionFunction { @@ -87,13 +92,14 @@ HidDisconnectFunction(); + HidDisconnectFunction(const HidDisconnectFunction&) = delete; + HidDisconnectFunction& operator=(const HidDisconnectFunction&) = delete; + private: ~HidDisconnectFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(HidDisconnectFunction); }; // Base class for extension functions that start some asynchronous work after @@ -124,6 +130,9 @@ HidReceiveFunction(); + HidReceiveFunction(const HidReceiveFunction&) = delete; + HidReceiveFunction& operator=(const HidReceiveFunction&) = delete; + private: ~HidReceiveFunction() override; @@ -136,8 +145,6 @@ const absl::optional<std::vector<uint8_t>>& buffer); std::unique_ptr<api::hid::Receive::Params> parameters_; - - DISALLOW_COPY_AND_ASSIGN(HidReceiveFunction); }; class HidSendFunction : public HidConnectionIoFunction { @@ -146,6 +153,9 @@ HidSendFunction(); + HidSendFunction(const HidSendFunction&) = delete; + HidSendFunction& operator=(const HidSendFunction&) = delete; + private: ~HidSendFunction() override; @@ -156,8 +166,6 @@ void OnFinished(bool success); std::unique_ptr<api::hid::Send::Params> parameters_; - - DISALLOW_COPY_AND_ASSIGN(HidSendFunction); }; class HidReceiveFeatureReportFunction : public HidConnectionIoFunction { @@ -167,6 +175,11 @@ HidReceiveFeatureReportFunction(); + HidReceiveFeatureReportFunction(const HidReceiveFeatureReportFunction&) = + delete; + HidReceiveFeatureReportFunction& operator=( + const HidReceiveFeatureReportFunction&) = delete; + private: ~HidReceiveFeatureReportFunction() override; @@ -178,8 +191,6 @@ const absl::optional<std::vector<uint8_t>>& buffer); std::unique_ptr<api::hid::ReceiveFeatureReport::Params> parameters_; - - DISALLOW_COPY_AND_ASSIGN(HidReceiveFeatureReportFunction); }; class HidSendFeatureReportFunction : public HidConnectionIoFunction { @@ -188,6 +199,10 @@ HidSendFeatureReportFunction(); + HidSendFeatureReportFunction(const HidSendFeatureReportFunction&) = delete; + HidSendFeatureReportFunction& operator=(const HidSendFeatureReportFunction&) = + delete; + private: ~HidSendFeatureReportFunction() override; @@ -198,8 +213,6 @@ void OnFinished(bool success); std::unique_ptr<api::hid::SendFeatureReport::Params> parameters_; - - DISALLOW_COPY_AND_ASSIGN(HidSendFeatureReportFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/lock_screen_data/lock_screen_data_api.h b/extensions/browser/api/lock_screen_data/lock_screen_data_api.h index 521905c..5f5050d 100644 --- a/extensions/browser/api/lock_screen_data/lock_screen_data_api.h +++ b/extensions/browser/api/lock_screen_data/lock_screen_data_api.h
@@ -22,6 +22,10 @@ public: LockScreenDataCreateFunction(); + LockScreenDataCreateFunction(const LockScreenDataCreateFunction&) = delete; + LockScreenDataCreateFunction& operator=(const LockScreenDataCreateFunction&) = + delete; + private: ~LockScreenDataCreateFunction() override; @@ -31,13 +35,16 @@ const lock_screen_data::DataItem* item); DECLARE_EXTENSION_FUNCTION("lockScreen.data.create", LOCKSCREENDATA_CREATE) - DISALLOW_COPY_AND_ASSIGN(LockScreenDataCreateFunction); }; class LockScreenDataGetAllFunction : public ExtensionFunction { public: LockScreenDataGetAllFunction(); + LockScreenDataGetAllFunction(const LockScreenDataGetAllFunction&) = delete; + LockScreenDataGetAllFunction& operator=(const LockScreenDataGetAllFunction&) = + delete; + private: ~LockScreenDataGetAllFunction() override; @@ -46,13 +53,17 @@ void OnDone(const std::vector<const lock_screen_data::DataItem*>& items); DECLARE_EXTENSION_FUNCTION("lockScreen.data.getAll", LOCKSCREENDATA_GETALL) - DISALLOW_COPY_AND_ASSIGN(LockScreenDataGetAllFunction); }; class LockScreenDataGetContentFunction : public ExtensionFunction { public: LockScreenDataGetContentFunction(); + LockScreenDataGetContentFunction(const LockScreenDataGetContentFunction&) = + delete; + LockScreenDataGetContentFunction& operator=( + const LockScreenDataGetContentFunction&) = delete; + private: ~LockScreenDataGetContentFunction() override; @@ -63,13 +74,17 @@ DECLARE_EXTENSION_FUNCTION("lockScreen.data.getContent", LOCKSCREENDATA_GETCONTENT) - DISALLOW_COPY_AND_ASSIGN(LockScreenDataGetContentFunction); }; class LockScreenDataSetContentFunction : public ExtensionFunction { public: LockScreenDataSetContentFunction(); + LockScreenDataSetContentFunction(const LockScreenDataSetContentFunction&) = + delete; + LockScreenDataSetContentFunction& operator=( + const LockScreenDataSetContentFunction&) = delete; + private: ~LockScreenDataSetContentFunction() override; @@ -79,13 +94,16 @@ DECLARE_EXTENSION_FUNCTION("lockScreen.data.setContent", LOCKSCREENDATA_SETCONTENT) - DISALLOW_COPY_AND_ASSIGN(LockScreenDataSetContentFunction); }; class LockScreenDataDeleteFunction : public ExtensionFunction { public: LockScreenDataDeleteFunction(); + LockScreenDataDeleteFunction(const LockScreenDataDeleteFunction&) = delete; + LockScreenDataDeleteFunction& operator=(const LockScreenDataDeleteFunction&) = + delete; + private: ~LockScreenDataDeleteFunction() override; @@ -94,8 +112,6 @@ void OnDone(lock_screen_data::OperationResult result); DECLARE_EXTENSION_FUNCTION("lockScreen.data.delete", LOCKSCREENDATA_DELETE) - - DISALLOW_COPY_AND_ASSIGN(LockScreenDataDeleteFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/media_perception_private/media_perception_private_api.h b/extensions/browser/api/media_perception_private/media_perception_private_api.h index a2bc396..daff8d3 100644 --- a/extensions/browser/api/media_perception_private/media_perception_private_api.h +++ b/extensions/browser/api/media_perception_private/media_perception_private_api.h
@@ -14,6 +14,12 @@ class MediaPerceptionPrivateGetStateFunction : public ExtensionFunction { public: MediaPerceptionPrivateGetStateFunction(); + + MediaPerceptionPrivateGetStateFunction( + const MediaPerceptionPrivateGetStateFunction&) = delete; + MediaPerceptionPrivateGetStateFunction& operator=( + const MediaPerceptionPrivateGetStateFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("mediaPerceptionPrivate.getState", MEDIAPERCEPTIONPRIVATE_GETSTATE) @@ -24,13 +30,17 @@ ResponseAction Run() override; void GetStateCallback(extensions::api::media_perception_private::State state); - - DISALLOW_COPY_AND_ASSIGN(MediaPerceptionPrivateGetStateFunction); }; class MediaPerceptionPrivateSetStateFunction : public ExtensionFunction { public: MediaPerceptionPrivateSetStateFunction(); + + MediaPerceptionPrivateSetStateFunction( + const MediaPerceptionPrivateSetStateFunction&) = delete; + MediaPerceptionPrivateSetStateFunction& operator=( + const MediaPerceptionPrivateSetStateFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("mediaPerceptionPrivate.setState", MEDIAPERCEPTIONPRIVATE_SETSTATE) @@ -41,13 +51,17 @@ ResponseAction Run() override; void SetStateCallback(extensions::api::media_perception_private::State state); - - DISALLOW_COPY_AND_ASSIGN(MediaPerceptionPrivateSetStateFunction); }; class MediaPerceptionPrivateGetDiagnosticsFunction : public ExtensionFunction { public: MediaPerceptionPrivateGetDiagnosticsFunction(); + + MediaPerceptionPrivateGetDiagnosticsFunction( + const MediaPerceptionPrivateGetDiagnosticsFunction&) = delete; + MediaPerceptionPrivateGetDiagnosticsFunction& operator=( + const MediaPerceptionPrivateGetDiagnosticsFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("mediaPerceptionPrivate.getDiagnostics", MEDIAPERCEPTIONPRIVATE_GETDIAGNOSTICS) @@ -59,14 +73,18 @@ void GetDiagnosticsCallback( extensions::api::media_perception_private::Diagnostics diagnostics); - - DISALLOW_COPY_AND_ASSIGN(MediaPerceptionPrivateGetDiagnosticsFunction); }; class MediaPerceptionPrivateSetAnalyticsComponentFunction : public ExtensionFunction { public: MediaPerceptionPrivateSetAnalyticsComponentFunction(); + + MediaPerceptionPrivateSetAnalyticsComponentFunction( + const MediaPerceptionPrivateSetAnalyticsComponentFunction&) = delete; + MediaPerceptionPrivateSetAnalyticsComponentFunction& operator=( + const MediaPerceptionPrivateSetAnalyticsComponentFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("mediaPerceptionPrivate.setAnalyticsComponent", MEDIAPERCEPTIONPRIVATE_SETANALYTICSCOMPONENT) @@ -79,14 +97,18 @@ void OnAnalyticsComponentSet( extensions::api::media_perception_private::ComponentState component_state); - - DISALLOW_COPY_AND_ASSIGN(MediaPerceptionPrivateSetAnalyticsComponentFunction); }; class MediaPerceptionPrivateSetComponentProcessStateFunction : public ExtensionFunction { public: MediaPerceptionPrivateSetComponentProcessStateFunction(); + + MediaPerceptionPrivateSetComponentProcessStateFunction( + const MediaPerceptionPrivateSetComponentProcessStateFunction&) = delete; + MediaPerceptionPrivateSetComponentProcessStateFunction& operator=( + const MediaPerceptionPrivateSetComponentProcessStateFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("mediaPerceptionPrivate.setComponentProcessState", MEDIAPERCEPTIONPRIVATE_SETCOMPONENTPROCESSSTATE) @@ -98,9 +120,6 @@ void OnComponentProcessStateSet( extensions::api::media_perception_private::ProcessState process_state); - - DISALLOW_COPY_AND_ASSIGN( - MediaPerceptionPrivateSetComponentProcessStateFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/messaging/message_service.cc b/extensions/browser/api/messaging/message_service.cc index e5286ca..e89eecc 100644 --- a/extensions/browser/api/messaging/message_service.cc +++ b/extensions/browser/api/messaging/message_service.cc
@@ -185,8 +185,8 @@ channel_name(channel_name), include_guest_process_info(include_guest_process_info) {} - private: - DISALLOW_COPY_AND_ASSIGN(OpenChannelParams); + OpenChannelParams(const OpenChannelParams&) = delete; + OpenChannelParams& operator=(const OpenChannelParams&) = delete; }; MessageService::MessageService(BrowserContext* context)
diff --git a/extensions/browser/api/networking_private/networking_private_api.h b/extensions/browser/api/networking_private/networking_private_api.h index bf9b1076..a2fd8fdb 100644 --- a/extensions/browser/api/networking_private/networking_private_api.h +++ b/extensions/browser/api/networking_private/networking_private_api.h
@@ -33,6 +33,12 @@ class NetworkingPrivateGetPropertiesFunction : public ExtensionFunction { public: NetworkingPrivateGetPropertiesFunction() {} + + NetworkingPrivateGetPropertiesFunction( + const NetworkingPrivateGetPropertiesFunction&) = delete; + NetworkingPrivateGetPropertiesFunction& operator=( + const NetworkingPrivateGetPropertiesFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.getProperties", NETWORKINGPRIVATE_GETPROPERTIES) @@ -45,14 +51,18 @@ private: void Result(absl::optional<base::Value> result, absl::optional<std::string> error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetPropertiesFunction); }; // Implements the chrome.networkingPrivate.getManagedProperties method. class NetworkingPrivateGetManagedPropertiesFunction : public ExtensionFunction { public: NetworkingPrivateGetManagedPropertiesFunction() {} + + NetworkingPrivateGetManagedPropertiesFunction( + const NetworkingPrivateGetManagedPropertiesFunction&) = delete; + NetworkingPrivateGetManagedPropertiesFunction& operator=( + const NetworkingPrivateGetManagedPropertiesFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.getManagedProperties", NETWORKINGPRIVATE_GETMANAGEDPROPERTIES) @@ -65,14 +75,18 @@ private: void Result(absl::optional<base::Value> result, absl::optional<std::string> error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetManagedPropertiesFunction); }; // Implements the chrome.networkingPrivate.getState method. class NetworkingPrivateGetStateFunction : public ExtensionFunction { public: NetworkingPrivateGetStateFunction() {} + + NetworkingPrivateGetStateFunction(const NetworkingPrivateGetStateFunction&) = + delete; + NetworkingPrivateGetStateFunction& operator=( + const NetworkingPrivateGetStateFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.getState", NETWORKINGPRIVATE_GETSTATE) @@ -85,14 +99,18 @@ private: void Success(std::unique_ptr<base::DictionaryValue> result); void Failure(const std::string& error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetStateFunction); }; // Implements the chrome.networkingPrivate.setProperties method. class NetworkingPrivateSetPropertiesFunction : public ExtensionFunction { public: NetworkingPrivateSetPropertiesFunction() {} + + NetworkingPrivateSetPropertiesFunction( + const NetworkingPrivateSetPropertiesFunction&) = delete; + NetworkingPrivateSetPropertiesFunction& operator=( + const NetworkingPrivateSetPropertiesFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.setProperties", NETWORKINGPRIVATE_SETPROPERTIES) @@ -105,14 +123,18 @@ private: void Success(); void Failure(const std::string& error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetPropertiesFunction); }; // Implements the chrome.networkingPrivate.createNetwork method. class NetworkingPrivateCreateNetworkFunction : public ExtensionFunction { public: NetworkingPrivateCreateNetworkFunction() {} + + NetworkingPrivateCreateNetworkFunction( + const NetworkingPrivateCreateNetworkFunction&) = delete; + NetworkingPrivateCreateNetworkFunction& operator=( + const NetworkingPrivateCreateNetworkFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.createNetwork", NETWORKINGPRIVATE_CREATENETWORK) @@ -125,14 +147,18 @@ private: void Success(const std::string& guid); void Failure(const std::string& error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateCreateNetworkFunction); }; // Implements the chrome.networkingPrivate.createNetwork method. class NetworkingPrivateForgetNetworkFunction : public ExtensionFunction { public: NetworkingPrivateForgetNetworkFunction() {} + + NetworkingPrivateForgetNetworkFunction( + const NetworkingPrivateForgetNetworkFunction&) = delete; + NetworkingPrivateForgetNetworkFunction& operator=( + const NetworkingPrivateForgetNetworkFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.forgetNetwork", NETWORKINGPRIVATE_FORGETNETWORK) @@ -145,14 +171,18 @@ private: void Success(); void Failure(const std::string& error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateForgetNetworkFunction); }; // Implements the chrome.networkingPrivate.getNetworks method. class NetworkingPrivateGetNetworksFunction : public ExtensionFunction { public: NetworkingPrivateGetNetworksFunction() {} + + NetworkingPrivateGetNetworksFunction( + const NetworkingPrivateGetNetworksFunction&) = delete; + NetworkingPrivateGetNetworksFunction& operator=( + const NetworkingPrivateGetNetworksFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.getNetworks", NETWORKINGPRIVATE_GETNETWORKS) @@ -165,14 +195,18 @@ private: void Success(std::unique_ptr<base::ListValue> network_list); void Failure(const std::string& error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetNetworksFunction); }; // Implements the chrome.networkingPrivate.getVisibleNetworks method. class NetworkingPrivateGetVisibleNetworksFunction : public ExtensionFunction { public: NetworkingPrivateGetVisibleNetworksFunction() {} + + NetworkingPrivateGetVisibleNetworksFunction( + const NetworkingPrivateGetVisibleNetworksFunction&) = delete; + NetworkingPrivateGetVisibleNetworksFunction& operator=( + const NetworkingPrivateGetVisibleNetworksFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.getVisibleNetworks", NETWORKINGPRIVATE_GETVISIBLENETWORKS) @@ -185,8 +219,6 @@ private: void Success(std::unique_ptr<base::ListValue> network_list); void Failure(const std::string& error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetVisibleNetworksFunction); }; // Implements the chrome.networkingPrivate.getEnabledNetworkTypes method. @@ -194,6 +226,12 @@ : public ExtensionFunction { public: NetworkingPrivateGetEnabledNetworkTypesFunction() {} + + NetworkingPrivateGetEnabledNetworkTypesFunction( + const NetworkingPrivateGetEnabledNetworkTypesFunction&) = delete; + NetworkingPrivateGetEnabledNetworkTypesFunction& operator=( + const NetworkingPrivateGetEnabledNetworkTypesFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.getEnabledNetworkTypes", NETWORKINGPRIVATE_GETENABLEDNETWORKTYPES) @@ -202,15 +240,18 @@ // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetEnabledNetworkTypesFunction); }; // Implements the chrome.networkingPrivate.getDeviceStates method. class NetworkingPrivateGetDeviceStatesFunction : public ExtensionFunction { public: NetworkingPrivateGetDeviceStatesFunction() {} + + NetworkingPrivateGetDeviceStatesFunction( + const NetworkingPrivateGetDeviceStatesFunction&) = delete; + NetworkingPrivateGetDeviceStatesFunction& operator=( + const NetworkingPrivateGetDeviceStatesFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.getDeviceStates", NETWORKINGPRIVATE_GETDEVICESTATES) @@ -219,15 +260,18 @@ // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetDeviceStatesFunction); }; // Implements the chrome.networkingPrivate.enableNetworkType method. class NetworkingPrivateEnableNetworkTypeFunction : public ExtensionFunction { public: NetworkingPrivateEnableNetworkTypeFunction() {} + + NetworkingPrivateEnableNetworkTypeFunction( + const NetworkingPrivateEnableNetworkTypeFunction&) = delete; + NetworkingPrivateEnableNetworkTypeFunction& operator=( + const NetworkingPrivateEnableNetworkTypeFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.enableNetworkType", NETWORKINGPRIVATE_ENABLENETWORKTYPE) @@ -236,15 +280,18 @@ // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateEnableNetworkTypeFunction); }; // Implements the chrome.networkingPrivate.disableNetworkType method. class NetworkingPrivateDisableNetworkTypeFunction : public ExtensionFunction { public: NetworkingPrivateDisableNetworkTypeFunction() {} + + NetworkingPrivateDisableNetworkTypeFunction( + const NetworkingPrivateDisableNetworkTypeFunction&) = delete; + NetworkingPrivateDisableNetworkTypeFunction& operator=( + const NetworkingPrivateDisableNetworkTypeFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.disableNetworkType", NETWORKINGPRIVATE_DISABLENETWORKTYPE) @@ -253,15 +300,18 @@ // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDisableNetworkTypeFunction); }; // Implements the chrome.networkingPrivate.requestNetworkScan method. class NetworkingPrivateRequestNetworkScanFunction : public ExtensionFunction { public: NetworkingPrivateRequestNetworkScanFunction() {} + + NetworkingPrivateRequestNetworkScanFunction( + const NetworkingPrivateRequestNetworkScanFunction&) = delete; + NetworkingPrivateRequestNetworkScanFunction& operator=( + const NetworkingPrivateRequestNetworkScanFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.requestNetworkScan", NETWORKINGPRIVATE_REQUESTNETWORKSCAN) @@ -270,15 +320,18 @@ // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateRequestNetworkScanFunction); }; // Implements the chrome.networkingPrivate.startConnect method. class NetworkingPrivateStartConnectFunction : public ExtensionFunction { public: NetworkingPrivateStartConnectFunction() {} + + NetworkingPrivateStartConnectFunction( + const NetworkingPrivateStartConnectFunction&) = delete; + NetworkingPrivateStartConnectFunction& operator=( + const NetworkingPrivateStartConnectFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.startConnect", NETWORKINGPRIVATE_STARTCONNECT) @@ -291,14 +344,18 @@ private: void Success(); void Failure(const std::string& guid, const std::string& error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartConnectFunction); }; // Implements the chrome.networkingPrivate.startDisconnect method. class NetworkingPrivateStartDisconnectFunction : public ExtensionFunction { public: NetworkingPrivateStartDisconnectFunction() {} + + NetworkingPrivateStartDisconnectFunction( + const NetworkingPrivateStartDisconnectFunction&) = delete; + NetworkingPrivateStartDisconnectFunction& operator=( + const NetworkingPrivateStartDisconnectFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.startDisconnect", NETWORKINGPRIVATE_STARTDISCONNECT) @@ -311,14 +368,18 @@ private: void Success(); void Failure(const std::string& error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartDisconnectFunction); }; // Implements the chrome.networkingPrivate.startActivate method. class NetworkingPrivateStartActivateFunction : public ExtensionFunction { public: NetworkingPrivateStartActivateFunction() {} + + NetworkingPrivateStartActivateFunction( + const NetworkingPrivateStartActivateFunction&) = delete; + NetworkingPrivateStartActivateFunction& operator=( + const NetworkingPrivateStartActivateFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.startActivate", NETWORKINGPRIVATE_STARTACTIVATE) @@ -331,14 +392,18 @@ private: void Success(); void Failure(const std::string& error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateStartActivateFunction); }; class NetworkingPrivateGetCaptivePortalStatusFunction : public ExtensionFunction { public: NetworkingPrivateGetCaptivePortalStatusFunction() {} + + NetworkingPrivateGetCaptivePortalStatusFunction( + const NetworkingPrivateGetCaptivePortalStatusFunction&) = delete; + NetworkingPrivateGetCaptivePortalStatusFunction& operator=( + const NetworkingPrivateGetCaptivePortalStatusFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.getCaptivePortalStatus", NETWORKINGPRIVATE_GETCAPTIVEPORTALSTATUS) @@ -351,13 +416,17 @@ private: void Success(const std::string& result); void Failure(const std::string& error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetCaptivePortalStatusFunction); }; class NetworkingPrivateUnlockCellularSimFunction : public ExtensionFunction { public: NetworkingPrivateUnlockCellularSimFunction() {} + + NetworkingPrivateUnlockCellularSimFunction( + const NetworkingPrivateUnlockCellularSimFunction&) = delete; + NetworkingPrivateUnlockCellularSimFunction& operator=( + const NetworkingPrivateUnlockCellularSimFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.unlockCellularSim", NETWORKINGPRIVATE_UNLOCKCELLULARSIM) @@ -370,13 +439,17 @@ private: void Success(); void Failure(const std::string& error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateUnlockCellularSimFunction); }; class NetworkingPrivateSetCellularSimStateFunction : public ExtensionFunction { public: NetworkingPrivateSetCellularSimStateFunction() {} + + NetworkingPrivateSetCellularSimStateFunction( + const NetworkingPrivateSetCellularSimStateFunction&) = delete; + NetworkingPrivateSetCellularSimStateFunction& operator=( + const NetworkingPrivateSetCellularSimStateFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.setCellularSimState", NETWORKINGPRIVATE_SETCELLULARSIMSTATE) @@ -389,14 +462,18 @@ private: void Success(); void Failure(const std::string& error); - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetCellularSimStateFunction); }; class NetworkingPrivateSelectCellularMobileNetworkFunction : public ExtensionFunction { public: NetworkingPrivateSelectCellularMobileNetworkFunction() {} + + NetworkingPrivateSelectCellularMobileNetworkFunction( + const NetworkingPrivateSelectCellularMobileNetworkFunction&) = delete; + NetworkingPrivateSelectCellularMobileNetworkFunction& operator=( + const NetworkingPrivateSelectCellularMobileNetworkFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.selectCellularMobileNetwork", NETWORKINGPRIVATE_SELECTCELLULARMOBILENETWORK) @@ -409,14 +486,17 @@ private: void Success(); void Failure(const std::string& error); - - DISALLOW_COPY_AND_ASSIGN( - NetworkingPrivateSelectCellularMobileNetworkFunction); }; class NetworkingPrivateGetGlobalPolicyFunction : public ExtensionFunction { public: NetworkingPrivateGetGlobalPolicyFunction() {} + + NetworkingPrivateGetGlobalPolicyFunction( + const NetworkingPrivateGetGlobalPolicyFunction&) = delete; + NetworkingPrivateGetGlobalPolicyFunction& operator=( + const NetworkingPrivateGetGlobalPolicyFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.getGlobalPolicy", NETWORKINGPRIVATE_GETGLOBALPOLICY) @@ -425,14 +505,17 @@ // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetGlobalPolicyFunction); }; class NetworkingPrivateGetCertificateListsFunction : public ExtensionFunction { public: NetworkingPrivateGetCertificateListsFunction() {} + + NetworkingPrivateGetCertificateListsFunction( + const NetworkingPrivateGetCertificateListsFunction&) = delete; + NetworkingPrivateGetCertificateListsFunction& operator=( + const NetworkingPrivateGetCertificateListsFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("networkingPrivate.getCertificateLists", NETWORKINGPRIVATE_GETCERTIFICATELISTS) @@ -441,9 +524,6 @@ // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetCertificateListsFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/networking_private/networking_private_delegate_factory.h b/extensions/browser/api/networking_private/networking_private_delegate_factory.h index cec3cc2..8739d3e 100644 --- a/extensions/browser/api/networking_private/networking_private_delegate_factory.h +++ b/extensions/browser/api/networking_private/networking_private_delegate_factory.h
@@ -41,6 +41,11 @@ CreateDelegate() = 0; }; + NetworkingPrivateDelegateFactory(const NetworkingPrivateDelegateFactory&) = + delete; + NetworkingPrivateDelegateFactory& operator=( + const NetworkingPrivateDelegateFactory&) = delete; + // Provide optional factories for creating delegate instances. void SetUIDelegateFactory(std::unique_ptr<UIDelegateFactory> factory); @@ -61,8 +66,6 @@ content::BrowserContext* context) const override; std::unique_ptr<UIDelegateFactory> ui_factory_; - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDelegateFactory); }; } // namespace extensions
diff --git a/extensions/browser/api/networking_private/networking_private_delegate_observer.h b/extensions/browser/api/networking_private/networking_private_delegate_observer.h index 2a294f3..2ca2bc47c 100644 --- a/extensions/browser/api/networking_private/networking_private_delegate_observer.h +++ b/extensions/browser/api/networking_private/networking_private_delegate_observer.h
@@ -17,6 +17,9 @@ // NetworkingPrivateLinux. Not used on Chrome OS. class NetworkingPrivateDelegateObserver { public: + NetworkingPrivateDelegateObserver& operator=( + const NetworkingPrivateDelegateObserver&) = delete; + // Notifes observers when properties may have changed for the networks listed // in |network_guids|. virtual void OnNetworksChangedEvent( @@ -29,9 +32,6 @@ protected: virtual ~NetworkingPrivateDelegateObserver() {} - - private: - DISALLOW_ASSIGN(NetworkingPrivateDelegateObserver); }; } // namespace extensions
diff --git a/extensions/browser/api/networking_private/networking_private_event_router.h b/extensions/browser/api/networking_private/networking_private_event_router.h index bc58257..937bbc6 100644 --- a/extensions/browser/api/networking_private/networking_private_event_router.h +++ b/extensions/browser/api/networking_private/networking_private_event_router.h
@@ -21,14 +21,15 @@ class NetworkingPrivateEventRouter : public KeyedService, public EventRouter::Observer { public: + NetworkingPrivateEventRouter(const NetworkingPrivateEventRouter&) = delete; + NetworkingPrivateEventRouter& operator=(const NetworkingPrivateEventRouter&) = + delete; + static NetworkingPrivateEventRouter* Create( content::BrowserContext* browser_context); protected: NetworkingPrivateEventRouter() {} - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateEventRouter); }; } // namespace extensions
diff --git a/extensions/browser/api/networking_private/networking_private_event_router_factory.h b/extensions/browser/api/networking_private/networking_private_event_router_factory.h index c554880..f494b11 100644 --- a/extensions/browser/api/networking_private/networking_private_event_router_factory.h +++ b/extensions/browser/api/networking_private/networking_private_event_router_factory.h
@@ -19,6 +19,11 @@ class NetworkingPrivateEventRouterFactory : public BrowserContextKeyedServiceFactory { public: + NetworkingPrivateEventRouterFactory( + const NetworkingPrivateEventRouterFactory&) = delete; + NetworkingPrivateEventRouterFactory& operator=( + const NetworkingPrivateEventRouterFactory&) = delete; + // Returns the NetworkingPrivateEventRouter for |profile|, creating it if // it is not yet created. static NetworkingPrivateEventRouter* GetForProfile( @@ -44,8 +49,6 @@ // BrowserContextKeyedServiceFactory: KeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const override; - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateEventRouterFactory); }; } // namespace extensions
diff --git a/extensions/browser/api/networking_private/networking_private_linux.h b/extensions/browser/api/networking_private/networking_private_linux.h index f6da83a..2c5e9ab 100644 --- a/extensions/browser/api/networking_private/networking_private_linux.h +++ b/extensions/browser/api/networking_private/networking_private_linux.h
@@ -35,6 +35,9 @@ NetworkingPrivateLinux(); + NetworkingPrivateLinux(const NetworkingPrivateLinux&) = delete; + NetworkingPrivateLinux& operator=(const NetworkingPrivateLinux&) = delete; + // NetworkingPrivateDelegate void GetProperties(const std::string& guid, PropertiesCallback callback) override; @@ -264,8 +267,6 @@ // Observers to Network Events. base::ObserverList<NetworkingPrivateDelegateObserver>::Unchecked network_events_observers_; - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateLinux); }; } // namespace extensions
diff --git a/extensions/browser/api/networking_private/networking_private_service_client.h b/extensions/browser/api/networking_private/networking_private_service_client.h index cf6a874..56b80ac 100644 --- a/extensions/browser/api/networking_private/networking_private_service_client.h +++ b/extensions/browser/api/networking_private/networking_private_service_client.h
@@ -41,6 +41,11 @@ explicit NetworkingPrivateServiceClient( std::unique_ptr<wifi::WiFiService> wifi_service); + NetworkingPrivateServiceClient(const NetworkingPrivateServiceClient&) = + delete; + NetworkingPrivateServiceClient& operator=( + const NetworkingPrivateServiceClient&) = delete; + // KeyedService void Shutdown() override; @@ -173,8 +178,6 @@ scoped_refptr<base::SequencedTaskRunner> task_runner_; // Use WeakPtrs for callbacks from |wifi_service_|. base::WeakPtrFactory<NetworkingPrivateServiceClient> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateServiceClient); }; } // namespace extensions
diff --git a/extensions/browser/api/power/power_api.h b/extensions/browser/api/power/power_api.h index c3d9772..ea56575 100644 --- a/extensions/browser/api/power/power_api.h +++ b/extensions/browser/api/power/power_api.h
@@ -59,6 +59,9 @@ base::RepeatingCallback<void(device::mojom::WakeLockType)>; using CancelWakeLockFunction = base::RepeatingCallback<void()>; + PowerAPI(const PowerAPI&) = delete; + PowerAPI& operator=(const PowerAPI&) = delete; + static PowerAPI* Get(content::BrowserContext* context); // BrowserContextKeyedAPI implementation. @@ -135,8 +138,6 @@ // Outstanding requests. ExtensionLevelMap extension_levels_; - - DISALLOW_COPY_AND_ASSIGN(PowerAPI); }; } // namespace extensions
diff --git a/extensions/browser/api/printer_provider/printer_provider_api_factory.h b/extensions/browser/api/printer_provider/printer_provider_api_factory.h index 128bc0b9..d6d5bec 100644 --- a/extensions/browser/api/printer_provider/printer_provider_api_factory.h +++ b/extensions/browser/api/printer_provider/printer_provider_api_factory.h
@@ -24,6 +24,10 @@ // Factory for PrinterProviderAPI. class PrinterProviderAPIFactory : public BrowserContextKeyedServiceFactory { public: + PrinterProviderAPIFactory(const PrinterProviderAPIFactory&) = delete; + PrinterProviderAPIFactory& operator=(const PrinterProviderAPIFactory&) = + delete; + static PrinterProviderAPIFactory* GetInstance(); PrinterProviderAPI* GetForBrowserContext(content::BrowserContext* context); @@ -39,8 +43,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(PrinterProviderAPIFactory); }; } // namespace extensions
diff --git a/extensions/browser/api/printer_provider/printer_provider_internal_api.h b/extensions/browser/api/printer_provider/printer_provider_internal_api.h index 0125936..bf267440 100644 --- a/extensions/browser/api/printer_provider/printer_provider_internal_api.h +++ b/extensions/browser/api/printer_provider/printer_provider_internal_api.h
@@ -97,6 +97,11 @@ public: PrinterProviderInternalReportPrintResultFunction(); + PrinterProviderInternalReportPrintResultFunction( + const PrinterProviderInternalReportPrintResultFunction&) = delete; + PrinterProviderInternalReportPrintResultFunction& operator=( + const PrinterProviderInternalReportPrintResultFunction&) = delete; + protected: ~PrinterProviderInternalReportPrintResultFunction() override; @@ -105,8 +110,6 @@ private: DECLARE_EXTENSION_FUNCTION("printerProviderInternal.reportPrintResult", PRINTERPROVIDERINTERNAL_REPORTPRINTRESULT) - - DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalReportPrintResultFunction); }; class PrinterProviderInternalReportPrinterCapabilityFunction @@ -114,6 +117,11 @@ public: PrinterProviderInternalReportPrinterCapabilityFunction(); + PrinterProviderInternalReportPrinterCapabilityFunction( + const PrinterProviderInternalReportPrinterCapabilityFunction&) = delete; + PrinterProviderInternalReportPrinterCapabilityFunction& operator=( + const PrinterProviderInternalReportPrinterCapabilityFunction&) = delete; + protected: ~PrinterProviderInternalReportPrinterCapabilityFunction() override; @@ -122,15 +130,17 @@ private: DECLARE_EXTENSION_FUNCTION("printerProviderInternal.reportPrinterCapability", PRINTERPROVIDERINTERNAL_REPORTPRINTERCAPABILITY) - - DISALLOW_COPY_AND_ASSIGN( - PrinterProviderInternalReportPrinterCapabilityFunction); }; class PrinterProviderInternalReportPrintersFunction : public ExtensionFunction { public: PrinterProviderInternalReportPrintersFunction(); + PrinterProviderInternalReportPrintersFunction( + const PrinterProviderInternalReportPrintersFunction&) = delete; + PrinterProviderInternalReportPrintersFunction& operator=( + const PrinterProviderInternalReportPrintersFunction&) = delete; + protected: ~PrinterProviderInternalReportPrintersFunction() override; ExtensionFunction::ResponseAction Run() override; @@ -138,14 +148,17 @@ private: DECLARE_EXTENSION_FUNCTION("printerProviderInternal.reportPrinters", PRINTERPROVIDERINTERNAL_REPORTPRINTERS) - - DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalReportPrintersFunction); }; class PrinterProviderInternalGetPrintDataFunction : public ExtensionFunction { public: PrinterProviderInternalGetPrintDataFunction(); + PrinterProviderInternalGetPrintDataFunction( + const PrinterProviderInternalGetPrintDataFunction&) = delete; + PrinterProviderInternalGetPrintDataFunction& operator=( + const PrinterProviderInternalGetPrintDataFunction&) = delete; + protected: ~PrinterProviderInternalGetPrintDataFunction() override; ExtensionFunction::ResponseAction Run() override; @@ -157,8 +170,6 @@ std::unique_ptr<content::BlobHandle> blob); DECLARE_EXTENSION_FUNCTION("printerProviderInternal.getPrintData", PRINTERPROVIDERINTERNAL_GETPRINTDATA) - - DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalGetPrintDataFunction); }; class PrinterProviderInternalReportUsbPrinterInfoFunction @@ -166,6 +177,11 @@ public: PrinterProviderInternalReportUsbPrinterInfoFunction(); + PrinterProviderInternalReportUsbPrinterInfoFunction( + const PrinterProviderInternalReportUsbPrinterInfoFunction&) = delete; + PrinterProviderInternalReportUsbPrinterInfoFunction& operator=( + const PrinterProviderInternalReportUsbPrinterInfoFunction&) = delete; + protected: ~PrinterProviderInternalReportUsbPrinterInfoFunction() override; ExtensionFunction::ResponseAction Run() override; @@ -173,8 +189,6 @@ private: DECLARE_EXTENSION_FUNCTION("printerProviderInternal.reportUsbPrinterInfo", PRINTERPROVIDERINTERNAL_REPORTUSBPRINTERINFO) - - DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalReportUsbPrinterInfoFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/printer_provider/printer_provider_print_job.h b/extensions/browser/api/printer_provider/printer_provider_print_job.h index d78f1fd1..641707e 100644 --- a/extensions/browser/api/printer_provider/printer_provider_print_job.h +++ b/extensions/browser/api/printer_provider/printer_provider_print_job.h
@@ -18,8 +18,12 @@ // TODO(tbarzic): This should probably be a class and have some methods. struct PrinterProviderPrintJob { PrinterProviderPrintJob(); + PrinterProviderPrintJob(const PrinterProviderPrintJob&) = delete; PrinterProviderPrintJob(PrinterProviderPrintJob&& other); + + PrinterProviderPrintJob& operator=(const PrinterProviderPrintJob&) = delete; PrinterProviderPrintJob& operator=(PrinterProviderPrintJob&& other); + ~PrinterProviderPrintJob(); // The id of the printer that should handle the print job. The id is @@ -40,9 +44,6 @@ // The document data that should be printed. scoped_refptr<base::RefCountedMemory> document_bytes; - - private: - DISALLOW_COPY_AND_ASSIGN(PrinterProviderPrintJob); }; } // namespace extensions
diff --git a/extensions/browser/api/serial/serial_api.h b/extensions/browser/api/serial/serial_api.h index a89ac74..97003c6e 100644 --- a/extensions/browser/api/serial/serial_api.h +++ b/extensions/browser/api/serial/serial_api.h
@@ -36,6 +36,9 @@ SerialGetDevicesFunction(); + SerialGetDevicesFunction(const SerialGetDevicesFunction&) = delete; + SerialGetDevicesFunction& operator=(const SerialGetDevicesFunction&) = delete; + protected: ~SerialGetDevicesFunction() override; @@ -44,8 +47,6 @@ private: void OnGotDevices(std::vector<device::mojom::SerialPortInfoPtr> devices); - - DISALLOW_COPY_AND_ASSIGN(SerialGetDevicesFunction); }; class SerialConnectFunction : public SerialExtensionFunction {
diff --git a/extensions/browser/api/socket/socket_api.h b/extensions/browser/api/socket/socket_api.h index c2a8e53..4ca3df3 100644 --- a/extensions/browser/api/socket/socket_api.h +++ b/extensions/browser/api/socket/socket_api.h
@@ -515,6 +515,9 @@ DECLARE_EXTENSION_FUNCTION("socket.secure", SOCKET_SECURE) SocketSecureFunction(); + SocketSecureFunction(const SocketSecureFunction&) = delete; + SocketSecureFunction& operator=(const SocketSecureFunction&) = delete; + protected: ~SocketSecureFunction() override; @@ -531,8 +534,6 @@ mojo::ScopedDataPipeProducerHandle send_pipe_handle); std::unique_ptr<api::socket::Secure::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(SocketSecureFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/sockets_tcp/sockets_tcp_api.h b/extensions/browser/api/sockets_tcp/sockets_tcp_api.h index 277acb1..3b1d99b 100644 --- a/extensions/browser/api/sockets_tcp/sockets_tcp_api.h +++ b/extensions/browser/api/sockets_tcp/sockets_tcp_api.h
@@ -222,6 +222,9 @@ SocketsTcpSecureFunction(); + SocketsTcpSecureFunction(const SocketsTcpSecureFunction&) = delete; + SocketsTcpSecureFunction& operator=(const SocketsTcpSecureFunction&) = delete; + protected: ~SocketsTcpSecureFunction() override; ResponseAction Work() override; @@ -238,8 +241,6 @@ bool paused_; bool persistent_; std::unique_ptr<sockets_tcp::Secure::Params> params_; - - DISALLOW_COPY_AND_ASSIGN(SocketsTcpSecureFunction); }; } // namespace api
diff --git a/extensions/browser/api/system_cpu/cpu_info_provider.h b/extensions/browser/api/system_cpu/cpu_info_provider.h index 26e35d8d..773009e 100644 --- a/extensions/browser/api/system_cpu/cpu_info_provider.h +++ b/extensions/browser/api/system_cpu/cpu_info_provider.h
@@ -17,6 +17,9 @@ class CpuInfoProvider : public SystemInfoProvider { public: + CpuInfoProvider(const CpuInfoProvider&) = delete; + CpuInfoProvider& operator=(const CpuInfoProvider&) = delete; + // Return the single shared instance of CpuInfoProvider. static CpuInfoProvider* Get(); @@ -53,8 +56,6 @@ static base::LazyInstance<scoped_refptr<CpuInfoProvider>>::DestructorAtExit provider_; base::CPU cpu_; - - DISALLOW_COPY_AND_ASSIGN(CpuInfoProvider); }; } // namespace extensions
diff --git a/extensions/browser/api/system_cpu/system_cpu_api.h b/extensions/browser/api/system_cpu/system_cpu_api.h index 849b0a6..7017497 100644 --- a/extensions/browser/api/system_cpu/system_cpu_api.h +++ b/extensions/browser/api/system_cpu/system_cpu_api.h
@@ -14,6 +14,9 @@ DECLARE_EXTENSION_FUNCTION("system.cpu.getInfo", SYSTEM_CPU_GETINFO) SystemCpuGetInfoFunction(); + SystemCpuGetInfoFunction(const SystemCpuGetInfoFunction&) = delete; + SystemCpuGetInfoFunction& operator=(const SystemCpuGetInfoFunction&) = delete; + private: ~SystemCpuGetInfoFunction() override; @@ -21,8 +24,6 @@ ResponseAction Run() override; void OnGetCpuInfoCompleted(bool success); - - DISALLOW_COPY_AND_ASSIGN(SystemCpuGetInfoFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/system_info/system_info_provider.h b/extensions/browser/api/system_info/system_info_provider.h index d3e52a2..3117bb7 100644 --- a/extensions/browser/api/system_info/system_info_provider.h +++ b/extensions/browser/api/system_info/system_info_provider.h
@@ -62,6 +62,9 @@ SystemInfoProvider(); + SystemInfoProvider(const SystemInfoProvider&) = delete; + SystemInfoProvider& operator=(const SystemInfoProvider&) = delete; + // Override to do any prepare work on UI thread before |QueryInfo()| gets // called. virtual void PrepareQueryOnUIThread(); @@ -110,8 +113,6 @@ // Sequenced task runner to safely query system information. scoped_refptr<base::SequencedTaskRunner> task_runner_; - - DISALLOW_COPY_AND_ASSIGN(SystemInfoProvider); }; } // namespace extensions
diff --git a/extensions/browser/api/system_memory/memory_info_provider.h b/extensions/browser/api/system_memory/memory_info_provider.h index 7ea30696..7fac4f36 100644 --- a/extensions/browser/api/system_memory/memory_info_provider.h +++ b/extensions/browser/api/system_memory/memory_info_provider.h
@@ -14,6 +14,9 @@ class MemoryInfoProvider : public SystemInfoProvider { public: + MemoryInfoProvider(const MemoryInfoProvider&) = delete; + MemoryInfoProvider& operator=(const MemoryInfoProvider&) = delete; + static MemoryInfoProvider* Get(); const api::system_memory::MemoryInfo& memory_info() const { return info_; } @@ -40,8 +43,6 @@ static base::LazyInstance<scoped_refptr<MemoryInfoProvider>>::DestructorAtExit provider_; - - DISALLOW_COPY_AND_ASSIGN(MemoryInfoProvider); }; } // namespace extensions
diff --git a/extensions/browser/api/system_memory/system_memory_api.h b/extensions/browser/api/system_memory/system_memory_api.h index fe307ca..e76cae1d 100644 --- a/extensions/browser/api/system_memory/system_memory_api.h +++ b/extensions/browser/api/system_memory/system_memory_api.h
@@ -15,6 +15,10 @@ DECLARE_EXTENSION_FUNCTION("system.memory.getInfo", SYSTEM_MEMORY_GETINFO) SystemMemoryGetInfoFunction(); + SystemMemoryGetInfoFunction(const SystemMemoryGetInfoFunction&) = delete; + SystemMemoryGetInfoFunction& operator=(const SystemMemoryGetInfoFunction&) = + delete; + private: ~SystemMemoryGetInfoFunction() override; @@ -22,8 +26,6 @@ ResponseAction Run() override; void OnGetMemoryInfoCompleted(bool success); - - DISALLOW_COPY_AND_ASSIGN(SystemMemoryGetInfoFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/system_storage/storage_info_provider.h b/extensions/browser/api/system_storage/storage_info_provider.h index d2ef6d9..c1ff30c 100644 --- a/extensions/browser/api/system_storage/storage_info_provider.h +++ b/extensions/browser/api/system_storage/storage_info_provider.h
@@ -19,6 +19,9 @@ class StorageInfoProvider : public SystemInfoProvider { public: + StorageInfoProvider(const StorageInfoProvider&) = delete; + StorageInfoProvider& operator=(const StorageInfoProvider&) = delete; + // Get the single shared instance of StorageInfoProvider. static StorageInfoProvider* Get(); @@ -58,8 +61,6 @@ static base::LazyInstance< scoped_refptr<StorageInfoProvider>>::DestructorAtExit provider_; - - DISALLOW_COPY_AND_ASSIGN(StorageInfoProvider); }; } // namespace extensions
diff --git a/extensions/browser/api/test/test_api.h b/extensions/browser/api/test/test_api.h index b315032..32e35fc 100644 --- a/extensions/browser/api/test/test_api.h +++ b/extensions/browser/api/test/test_api.h
@@ -100,6 +100,9 @@ // state, owned by the test code. class TestConfigState { public: + TestConfigState(const TestConfigState&) = delete; + TestConfigState& operator=(const TestConfigState&) = delete; + static TestConfigState* GetInstance(); void set_config_state(base::DictionaryValue* config_state) { @@ -113,8 +116,6 @@ TestConfigState(); base::DictionaryValue* config_state_; - - DISALLOW_COPY_AND_ASSIGN(TestConfigState); }; ~TestGetConfigFunction() override;
diff --git a/extensions/browser/api/usb/usb_api.h b/extensions/browser/api/usb/usb_api.h index 9b32b0c..57d9acb 100644 --- a/extensions/browser/api/usb/usb_api.h +++ b/extensions/browser/api/usb/usb_api.h
@@ -96,6 +96,9 @@ UsbFindDevicesFunction(); + UsbFindDevicesFunction(const UsbFindDevicesFunction&) = delete; + UsbFindDevicesFunction& operator=(const UsbFindDevicesFunction&) = delete; + private: ~UsbFindDevicesFunction() override; @@ -114,8 +117,6 @@ uint16_t product_id_; std::unique_ptr<base::ListValue> result_; base::RepeatingClosure barrier_; - - DISALLOW_COPY_AND_ASSIGN(UsbFindDevicesFunction); }; class UsbGetDevicesFunction : public UsbPermissionCheckingFunction { @@ -124,6 +125,9 @@ UsbGetDevicesFunction(); + UsbGetDevicesFunction(const UsbGetDevicesFunction&) = delete; + UsbGetDevicesFunction& operator=(const UsbGetDevicesFunction&) = delete; + private: ~UsbGetDevicesFunction() override; @@ -134,8 +138,6 @@ std::vector<device::mojom::UsbDeviceInfoPtr> devices); std::vector<device::mojom::UsbDeviceFilterPtr> filters_; - - DISALLOW_COPY_AND_ASSIGN(UsbGetDevicesFunction); }; class UsbGetUserSelectedDevicesFunction : public UsbExtensionFunction { @@ -145,6 +147,11 @@ UsbGetUserSelectedDevicesFunction(); + UsbGetUserSelectedDevicesFunction(const UsbGetUserSelectedDevicesFunction&) = + delete; + UsbGetUserSelectedDevicesFunction& operator=( + const UsbGetUserSelectedDevicesFunction&) = delete; + private: ~UsbGetUserSelectedDevicesFunction() override; @@ -154,8 +161,6 @@ void OnDevicesChosen(std::vector<device::mojom::UsbDeviceInfoPtr> devices); std::unique_ptr<DevicePermissionsPrompt> prompt_; - - DISALLOW_COPY_AND_ASSIGN(UsbGetUserSelectedDevicesFunction); }; class UsbGetConfigurationsFunction : public UsbPermissionCheckingFunction { @@ -164,13 +169,15 @@ UsbGetConfigurationsFunction(); + UsbGetConfigurationsFunction(const UsbGetConfigurationsFunction&) = delete; + UsbGetConfigurationsFunction& operator=(const UsbGetConfigurationsFunction&) = + delete; + private: ~UsbGetConfigurationsFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(UsbGetConfigurationsFunction); }; class UsbRequestAccessFunction : public ExtensionFunction { @@ -179,13 +186,14 @@ UsbRequestAccessFunction(); + UsbRequestAccessFunction(const UsbRequestAccessFunction&) = delete; + UsbRequestAccessFunction& operator=(const UsbRequestAccessFunction&) = delete; + private: ~UsbRequestAccessFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(UsbRequestAccessFunction); }; class UsbOpenDeviceFunction : public UsbPermissionCheckingFunction { @@ -194,6 +202,9 @@ UsbOpenDeviceFunction(); + UsbOpenDeviceFunction(const UsbOpenDeviceFunction&) = delete; + UsbOpenDeviceFunction& operator=(const UsbOpenDeviceFunction&) = delete; + private: ~UsbOpenDeviceFunction() override; @@ -204,8 +215,6 @@ mojo::Remote<device::mojom::UsbDevice> device, device::mojom::UsbOpenDeviceError error); void OnDisconnect(); - - DISALLOW_COPY_AND_ASSIGN(UsbOpenDeviceFunction); }; class UsbSetConfigurationFunction : public UsbConnectionFunction { @@ -214,6 +223,10 @@ UsbSetConfigurationFunction(); + UsbSetConfigurationFunction(const UsbSetConfigurationFunction&) = delete; + UsbSetConfigurationFunction& operator=(const UsbSetConfigurationFunction&) = + delete; + private: ~UsbSetConfigurationFunction() override; @@ -221,8 +234,6 @@ ResponseAction Run() override; void OnComplete(const std::string& guid, uint8_t config_value, bool success); - - DISALLOW_COPY_AND_ASSIGN(UsbSetConfigurationFunction); }; class UsbGetConfigurationFunction : public UsbConnectionFunction { @@ -231,13 +242,15 @@ UsbGetConfigurationFunction(); + UsbGetConfigurationFunction(const UsbGetConfigurationFunction&) = delete; + UsbGetConfigurationFunction& operator=(const UsbGetConfigurationFunction&) = + delete; + private: ~UsbGetConfigurationFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(UsbGetConfigurationFunction); }; class UsbListInterfacesFunction : public UsbConnectionFunction { @@ -246,13 +259,15 @@ UsbListInterfacesFunction(); + UsbListInterfacesFunction(const UsbListInterfacesFunction&) = delete; + UsbListInterfacesFunction& operator=(const UsbListInterfacesFunction&) = + delete; + private: ~UsbListInterfacesFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(UsbListInterfacesFunction); }; class UsbCloseDeviceFunction : public UsbConnectionFunction { @@ -261,13 +276,14 @@ UsbCloseDeviceFunction(); + UsbCloseDeviceFunction(const UsbCloseDeviceFunction&) = delete; + UsbCloseDeviceFunction& operator=(const UsbCloseDeviceFunction&) = delete; + private: ~UsbCloseDeviceFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(UsbCloseDeviceFunction); }; class UsbClaimInterfaceFunction : public UsbConnectionFunction { @@ -276,6 +292,10 @@ UsbClaimInterfaceFunction(); + UsbClaimInterfaceFunction(const UsbClaimInterfaceFunction&) = delete; + UsbClaimInterfaceFunction& operator=(const UsbClaimInterfaceFunction&) = + delete; + private: ~UsbClaimInterfaceFunction() override; @@ -283,8 +303,6 @@ ResponseAction Run() override; void OnComplete(device::mojom::UsbClaimInterfaceResult result); - - DISALLOW_COPY_AND_ASSIGN(UsbClaimInterfaceFunction); }; class UsbReleaseInterfaceFunction : public UsbConnectionFunction { @@ -293,6 +311,10 @@ UsbReleaseInterfaceFunction(); + UsbReleaseInterfaceFunction(const UsbReleaseInterfaceFunction&) = delete; + UsbReleaseInterfaceFunction& operator=(const UsbReleaseInterfaceFunction&) = + delete; + private: ~UsbReleaseInterfaceFunction() override; @@ -300,8 +322,6 @@ ResponseAction Run() override; void OnComplete(bool success); - - DISALLOW_COPY_AND_ASSIGN(UsbReleaseInterfaceFunction); }; class UsbSetInterfaceAlternateSettingFunction : public UsbConnectionFunction { @@ -311,6 +331,11 @@ UsbSetInterfaceAlternateSettingFunction(); + UsbSetInterfaceAlternateSettingFunction( + const UsbSetInterfaceAlternateSettingFunction&) = delete; + UsbSetInterfaceAlternateSettingFunction& operator=( + const UsbSetInterfaceAlternateSettingFunction&) = delete; + private: ~UsbSetInterfaceAlternateSettingFunction() override; @@ -318,8 +343,6 @@ ResponseAction Run() override; void OnComplete(bool success); - - DISALLOW_COPY_AND_ASSIGN(UsbSetInterfaceAlternateSettingFunction); }; class UsbControlTransferFunction : public UsbTransferFunction { @@ -328,13 +351,15 @@ UsbControlTransferFunction(); + UsbControlTransferFunction(const UsbControlTransferFunction&) = delete; + UsbControlTransferFunction& operator=(const UsbControlTransferFunction&) = + delete; + private: ~UsbControlTransferFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(UsbControlTransferFunction); }; class UsbBulkTransferFunction : public UsbGenericTransferFunction { @@ -343,13 +368,14 @@ UsbBulkTransferFunction(); + UsbBulkTransferFunction(const UsbBulkTransferFunction&) = delete; + UsbBulkTransferFunction& operator=(const UsbBulkTransferFunction&) = delete; + private: ~UsbBulkTransferFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(UsbBulkTransferFunction); }; class UsbInterruptTransferFunction : public UsbGenericTransferFunction { @@ -358,13 +384,15 @@ UsbInterruptTransferFunction(); + UsbInterruptTransferFunction(const UsbInterruptTransferFunction&) = delete; + UsbInterruptTransferFunction& operator=(const UsbInterruptTransferFunction&) = + delete; + private: ~UsbInterruptTransferFunction() override; // ExtensionFunction: ResponseAction Run() override; - - DISALLOW_COPY_AND_ASSIGN(UsbInterruptTransferFunction); }; class UsbIsochronousTransferFunction : public UsbTransferFunction { @@ -373,6 +401,11 @@ UsbIsochronousTransferFunction(); + UsbIsochronousTransferFunction(const UsbIsochronousTransferFunction&) = + delete; + UsbIsochronousTransferFunction& operator=( + const UsbIsochronousTransferFunction&) = delete; + private: ~UsbIsochronousTransferFunction() override; @@ -384,8 +417,6 @@ std::vector<device::mojom::UsbIsochronousPacketPtr> packets); void OnTransferOutCompleted( std::vector<device::mojom::UsbIsochronousPacketPtr> packets); - - DISALLOW_COPY_AND_ASSIGN(UsbIsochronousTransferFunction); }; class UsbResetDeviceFunction : public UsbConnectionFunction { @@ -394,6 +425,9 @@ UsbResetDeviceFunction(); + UsbResetDeviceFunction(const UsbResetDeviceFunction&) = delete; + UsbResetDeviceFunction& operator=(const UsbResetDeviceFunction&) = delete; + private: ~UsbResetDeviceFunction() override; @@ -403,8 +437,6 @@ void OnComplete(bool success); std::unique_ptr<api::usb::ResetDevice::Params> parameters_; - - DISALLOW_COPY_AND_ASSIGN(UsbResetDeviceFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/usb/usb_device_manager.h b/extensions/browser/api/usb/usb_device_manager.h index 44c0a3e..de7e50e 100644 --- a/extensions/browser/api/usb/usb_device_manager.h +++ b/extensions/browser/api/usb/usb_device_manager.h
@@ -32,6 +32,9 @@ public EventRouter::Observer, public device::mojom::UsbDeviceManagerClient { public: + UsbDeviceManager(const UsbDeviceManager&) = delete; + UsbDeviceManager& operator=(const UsbDeviceManager&) = delete; + static UsbDeviceManager* Get(content::BrowserContext* browser_context); // BrowserContextKeyedAPI implementation. @@ -130,7 +133,6 @@ base::ObserverList<Observer> observer_list_; base::WeakPtrFactory<UsbDeviceManager> weak_factory_{this}; - DISALLOW_COPY_AND_ASSIGN(UsbDeviceManager); }; template <>
diff --git a/extensions/browser/api/virtual_keyboard/virtual_keyboard_api.h b/extensions/browser/api/virtual_keyboard/virtual_keyboard_api.h index 3bff3ac..57066c7 100644 --- a/extensions/browser/api/virtual_keyboard/virtual_keyboard_api.h +++ b/extensions/browser/api/virtual_keyboard/virtual_keyboard_api.h
@@ -15,6 +15,11 @@ public: VirtualKeyboardRestrictFeaturesFunction(); + VirtualKeyboardRestrictFeaturesFunction( + const VirtualKeyboardRestrictFeaturesFunction&) = delete; + VirtualKeyboardRestrictFeaturesFunction& operator=( + const VirtualKeyboardRestrictFeaturesFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("virtualKeyboard.restrictFeatures", VIRTUALKEYBOARD_RESTRICTFEATURES) @@ -22,9 +27,6 @@ ~VirtualKeyboardRestrictFeaturesFunction() override = default; // ExtensionFunction override: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardRestrictFeaturesFunction); }; } // namespace extensions
diff --git a/extensions/browser/api/vpn_provider/vpn_service.cc b/extensions/browser/api/vpn_provider/vpn_service.cc index 8fe01a5..1574100 100644 --- a/extensions/browser/api/vpn_provider/vpn_service.cc +++ b/extensions/browser/api/vpn_provider/vpn_service.cc
@@ -161,6 +161,9 @@ public: explicit VpnServiceProxyImpl(base::WeakPtr<VpnService> vpn_service); + VpnServiceProxyImpl(const VpnServiceProxyImpl&) = delete; + VpnServiceProxyImpl& operator=(const VpnServiceProxyImpl&) = delete; + void Bind(const std::string& extension_id, const std::string& configuration_id, const std::string& configuration_name, @@ -175,8 +178,6 @@ private: base::WeakPtr<VpnService> vpn_service_; - - DISALLOW_COPY_AND_ASSIGN(VpnServiceProxyImpl); }; VpnService::VpnServiceProxyImpl::VpnServiceProxyImpl(
diff --git a/extensions/browser/api/vpn_provider/vpn_service_factory.h b/extensions/browser/api/vpn_provider/vpn_service_factory.h index a343602..c3b475e 100644 --- a/extensions/browser/api/vpn_provider/vpn_service_factory.h +++ b/extensions/browser/api/vpn_provider/vpn_service_factory.h
@@ -26,6 +26,9 @@ // Factory to create VpnService. class VpnServiceFactory : public BrowserContextKeyedServiceFactory { public: + VpnServiceFactory(const VpnServiceFactory&) = delete; + VpnServiceFactory& operator=(const VpnServiceFactory&) = delete; + static VpnService* GetForBrowserContext(content::BrowserContext* context); static VpnServiceFactory* GetInstance(); @@ -40,8 +43,6 @@ bool ServiceIsNULLWhileTesting() const override; KeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(VpnServiceFactory); }; } // namespace chromeos
diff --git a/extensions/browser/api/web_contents_capture_client.h b/extensions/browser/api/web_contents_capture_client.h index c0f83e8..f2c9a550 100644 --- a/extensions/browser/api/web_contents_capture_client.h +++ b/extensions/browser/api/web_contents_capture_client.h
@@ -23,6 +23,9 @@ public: WebContentsCaptureClient() {} + WebContentsCaptureClient(const WebContentsCaptureClient&) = delete; + WebContentsCaptureClient& operator=(const WebContentsCaptureClient&) = delete; + protected: virtual ~WebContentsCaptureClient() {} @@ -58,8 +61,6 @@ // Quality setting to use when encoding jpegs. Set in RunAsync(). int image_quality_; - - DISALLOW_COPY_AND_ASSIGN(WebContentsCaptureClient); }; } // namespace extensions
diff --git a/extensions/browser/api/web_request/form_data_parser.h b/extensions/browser/api/web_request/form_data_parser.h index 80b3a32..93177ec6 100644 --- a/extensions/browser/api/web_request/form_data_parser.h +++ b/extensions/browser/api/web_request/form_data_parser.h
@@ -49,6 +49,9 @@ base::Value value_; }; + FormDataParser(const FormDataParser&) = delete; + FormDataParser& operator=(const FormDataParser&) = delete; + virtual ~FormDataParser(); // Creates a correct parser instance based on the |request_headers|. Returns @@ -82,9 +85,6 @@ protected: FormDataParser(); - - private: - DISALLOW_COPY_AND_ASSIGN(FormDataParser); }; } // namespace extensions
diff --git a/extensions/browser/api/web_request/web_request_api.h b/extensions/browser/api/web_request/web_request_api.h index 08a390e..1586c1dd 100644 --- a/extensions/browser/api/web_request/web_request_api.h +++ b/extensions/browser/api/web_request/web_request_api.h
@@ -180,6 +180,10 @@ }; explicit WebRequestAPI(content::BrowserContext* context); + + WebRequestAPI(const WebRequestAPI&) = delete; + WebRequestAPI& operator=(const WebRequestAPI&) = delete; + ~WebRequestAPI() override; // BrowserContextKeyedAPI support: @@ -280,8 +284,6 @@ // Stores the last result of |MayHaveProxies()|, so it can be used in // |UpdateMayHaveProxies()|. bool may_have_proxies_; - - DISALLOW_COPY_AND_ASSIGN(WebRequestAPI); }; // This class observes network events and routes them to the appropriate @@ -590,6 +592,10 @@ }; EventListener(ID id); + + EventListener(const EventListener&) = delete; + EventListener& operator=(const EventListener&) = delete; + ~EventListener(); const ID id; @@ -598,9 +604,6 @@ RequestFilter filter; int extra_info_spec = 0; std::unordered_set<uint64_t> blocked_requests; - - private: - DISALLOW_COPY_AND_ASSIGN(EventListener); }; using RawListeners = std::vector<EventListener*>; @@ -623,6 +626,11 @@ ExtensionWebRequestEventRouter(); + ExtensionWebRequestEventRouter(const ExtensionWebRequestEventRouter&) = + delete; + ExtensionWebRequestEventRouter& operator=( + const ExtensionWebRequestEventRouter&) = delete; + // This instance is leaked. ~ExtensionWebRequestEventRouter() = delete; @@ -787,8 +795,6 @@ // respective rules registry. std::map<RulesRegistryKey, scoped_refptr<extensions::WebRequestRulesRegistry> > rules_registries_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionWebRequestEventRouter); }; class WebRequestInternalFunction : public ExtensionFunction {
diff --git a/extensions/browser/api/web_request/web_request_api_helpers.h b/extensions/browser/api/web_request/web_request_api_helpers.h index b349111..230a5e8 100644 --- a/extensions/browser/api/web_request/web_request_api_helpers.h +++ b/extensions/browser/api/web_request/web_request_api_helpers.h
@@ -173,13 +173,12 @@ struct IgnoredAction { IgnoredAction(extensions::ExtensionId extension_id, extensions::api::web_request::IgnoredActionType action_type); + IgnoredAction(const IgnoredAction&) = delete; IgnoredAction(IgnoredAction&& rhs); + IgnoredAction& operator=(const IgnoredAction&) = delete; extensions::ExtensionId extension_id; extensions::api::web_request::IgnoredActionType action_type; - - private: - DISALLOW_COPY_AND_ASSIGN(IgnoredAction); }; using IgnoredActions = std::vector<IgnoredAction>; @@ -206,7 +205,9 @@ // API definition. struct RequestCookie { RequestCookie(); + RequestCookie(const RequestCookie&) = delete; RequestCookie(RequestCookie&& other); + RequestCookie& operator=(const RequestCookie&) = delete; RequestCookie& operator=(RequestCookie&& other); ~RequestCookie(); @@ -216,15 +217,15 @@ absl::optional<std::string> name; absl::optional<std::string> value; - - DISALLOW_COPY_AND_ASSIGN(RequestCookie); }; // Data container for ResponseCookies as defined in the declarative WebRequest // API definition. struct ResponseCookie { ResponseCookie(); + ResponseCookie(const ResponseCookie&) = delete; ResponseCookie(ResponseCookie&& other); + ResponseCookie& operator=(const ResponseCookie&) = delete; ResponseCookie& operator=(ResponseCookie&& other); ~ResponseCookie(); @@ -240,15 +241,15 @@ absl::optional<std::string> path; absl::optional<bool> secure; absl::optional<bool> http_only; - - DISALLOW_COPY_AND_ASSIGN(ResponseCookie); }; // Data container for FilterResponseCookies as defined in the declarative // WebRequest API definition. struct FilterResponseCookie : ResponseCookie { FilterResponseCookie(); + FilterResponseCookie(const FilterResponseCookie&) = delete; FilterResponseCookie(FilterResponseCookie&& other); + FilterResponseCookie& operator=(const FilterResponseCookie&) = delete; FilterResponseCookie& operator=(FilterResponseCookie&& other); ~FilterResponseCookie(); @@ -259,8 +260,6 @@ absl::optional<int> age_lower_bound; absl::optional<int> age_upper_bound; absl::optional<bool> session_cookie; - - DISALLOW_COPY_AND_ASSIGN(FilterResponseCookie); }; enum CookieModificationType { @@ -271,7 +270,10 @@ struct RequestCookieModification { RequestCookieModification(); + RequestCookieModification(const RequestCookieModification&) = delete; RequestCookieModification(RequestCookieModification&& other); + RequestCookieModification& operator=(const RequestCookieModification&) = + delete; RequestCookieModification& operator=(RequestCookieModification&& other); ~RequestCookieModification(); @@ -284,13 +286,14 @@ absl::optional<RequestCookie> filter; // Used for ADD and EDIT, nullopt otherwise. absl::optional<RequestCookie> modification; - - DISALLOW_COPY_AND_ASSIGN(RequestCookieModification); }; struct ResponseCookieModification { ResponseCookieModification(); + ResponseCookieModification(const ResponseCookieModification&) = delete; ResponseCookieModification(ResponseCookieModification&& other); + ResponseCookieModification& operator=(const ResponseCookieModification&) = + delete; ResponseCookieModification& operator=(ResponseCookieModification&& other); ~ResponseCookieModification(); @@ -303,8 +306,6 @@ absl::optional<FilterResponseCookie> filter; // Used for ADD and EDIT, nullopt otherwise. absl::optional<ResponseCookie> modification; - - DISALLOW_COPY_AND_ASSIGN(ResponseCookieModification); }; using RequestCookieModifications = std::vector<RequestCookieModification>; @@ -314,7 +315,9 @@ struct EventResponseDelta { EventResponseDelta(const std::string& extension_id, const base::Time& extension_install_time); + EventResponseDelta(const EventResponseDelta&) = delete; EventResponseDelta(EventResponseDelta&& other); + EventResponseDelta& operator=(const EventResponseDelta&) = delete; EventResponseDelta& operator=(EventResponseDelta&& other); ~EventResponseDelta(); @@ -355,8 +358,6 @@ // Messages that shall be sent to the background/event/... pages of the // extension. std::set<std::string> messages_to_extension; - - DISALLOW_COPY_AND_ASSIGN(EventResponseDelta); }; using EventResponseDeltas = std::list<EventResponseDelta>;
diff --git a/extensions/browser/api/web_request/web_request_info.cc b/extensions/browser/api/web_request/web_request_info.cc index b875b176..542e23cf 100644 --- a/extensions/browser/api/web_request/web_request_info.cc +++ b/extensions/browser/api/web_request/web_request_info.cc
@@ -153,10 +153,6 @@ } // namespace WebRequestInfoInitParams::WebRequestInfoInitParams() = default; -WebRequestInfoInitParams::WebRequestInfoInitParams( - WebRequestInfoInitParams&& other) = default; -WebRequestInfoInitParams& WebRequestInfoInitParams::operator=( - WebRequestInfoInitParams&& other) = default; WebRequestInfoInitParams::WebRequestInfoInitParams( uint64_t request_id, @@ -196,6 +192,12 @@ } } +WebRequestInfoInitParams::WebRequestInfoInitParams( + WebRequestInfoInitParams&& other) = default; + +WebRequestInfoInitParams& WebRequestInfoInitParams::operator=( + WebRequestInfoInitParams&& other) = default; + WebRequestInfoInitParams::~WebRequestInfoInitParams() = default; void WebRequestInfoInitParams::InitializeWebViewAndFrameData(
diff --git a/extensions/browser/api/web_request/web_request_info.h b/extensions/browser/api/web_request/web_request_info.h index 322b396..b27e5cb3 100644 --- a/extensions/browser/api/web_request/web_request_info.h +++ b/extensions/browser/api/web_request/web_request_info.h
@@ -37,8 +37,6 @@ // Helper struct to initialize WebRequestInfo. struct WebRequestInfoInitParams { WebRequestInfoInitParams(); - WebRequestInfoInitParams(WebRequestInfoInitParams&& other); - WebRequestInfoInitParams& operator=(WebRequestInfoInitParams&& other); // Initializes a WebRequestInfoInitParams from information provided over a // URLLoaderFactory interface. @@ -55,6 +53,12 @@ absl::optional<int64_t> navigation_id, ukm::SourceIdObj ukm_source_id); + WebRequestInfoInitParams(const WebRequestInfoInitParams&) = delete; + WebRequestInfoInitParams(WebRequestInfoInitParams&& other); + + WebRequestInfoInitParams& operator=(const WebRequestInfoInitParams&) = delete; + WebRequestInfoInitParams& operator=(WebRequestInfoInitParams&& other); + ~WebRequestInfoInitParams(); uint64_t id = 0; @@ -82,8 +86,6 @@ private: void InitializeWebViewAndFrameData( const ExtensionNavigationUIData* navigation_ui_data); - - DISALLOW_COPY_AND_ASSIGN(WebRequestInfoInitParams); }; // A URL request representation used by WebRequest API internals. This structure @@ -91,6 +93,9 @@ struct WebRequestInfo { explicit WebRequestInfo(WebRequestInfoInitParams params); + WebRequestInfo(const WebRequestInfo&) = delete; + WebRequestInfo& operator=(const WebRequestInfo&) = delete; + ~WebRequestInfo(); // Fill in response data for this request. @@ -185,9 +190,6 @@ // TODO(karandeepb, mcnee): For subresources, having "parent" in the name is // misleading. This should be renamed to indicate that this is the initiator. const content::GlobalRenderFrameHostId parent_routing_id; - - private: - DISALLOW_COPY_AND_ASSIGN(WebRequestInfo); }; } // namespace extensions
diff --git a/extensions/browser/api/web_request/web_request_permissions.h b/extensions/browser/api/web_request/web_request_permissions.h index 9172e727..a52f50a 100644 --- a/extensions/browser/api/web_request/web_request_permissions.h +++ b/extensions/browser/api/web_request/web_request_permissions.h
@@ -39,6 +39,10 @@ REQUIRE_ALL_URLS }; + WebRequestPermissions() = delete; + WebRequestPermissions(const WebRequestPermissions&) = delete; + WebRequestPermissions& operator=(const WebRequestPermissions&) = delete; + // Returns true if the request shall not be reported to extensions. static bool HideRequest(extensions::PermissionHelper* permission_helper, const extensions::WebRequestInfo& request); @@ -65,8 +69,6 @@ const absl::optional<url::Origin>& initiator, int tab_id, bool crosses_incognito); - - DISALLOW_IMPLICIT_CONSTRUCTORS(WebRequestPermissions); }; #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_PERMISSIONS_H_
diff --git a/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc b/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc index cabd16ea..5051754 100644 --- a/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc +++ b/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc
@@ -62,6 +62,9 @@ class ShutdownNotifierFactory : public BrowserContextKeyedServiceShutdownNotifierFactory { public: + ShutdownNotifierFactory(const ShutdownNotifierFactory&) = delete; + ShutdownNotifierFactory& operator=(const ShutdownNotifierFactory&) = delete; + static ShutdownNotifierFactory* GetInstance() { static base::NoDestructor<ShutdownNotifierFactory> factory; return factory.get(); @@ -76,8 +79,6 @@ DependsOn(PermissionHelper::GetFactoryInstance()); } ~ShutdownNotifierFactory() override {} - - DISALLOW_COPY_AND_ASSIGN(ShutdownNotifierFactory); }; // Creates simulated net::RedirectInfo when an extension redirects a request,
diff --git a/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.h b/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.h index 2224029f..2866b98 100644 --- a/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.h +++ b/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.h
@@ -239,13 +239,13 @@ // extensions made to headers in their callbacks. struct FollowRedirectParams { FollowRedirectParams(); + FollowRedirectParams(const FollowRedirectParams&) = delete; + FollowRedirectParams& operator=(const FollowRedirectParams&) = delete; ~FollowRedirectParams(); std::vector<std::string> removed_headers; net::HttpRequestHeaders modified_headers; net::HttpRequestHeaders modified_cors_exempt_headers; absl::optional<GURL> new_url; - - DISALLOW_COPY_AND_ASSIGN(FollowRedirectParams); }; std::unique_ptr<FollowRedirectParams> pending_follow_redirect_params_; State state_ = State::kInProgress; @@ -270,6 +270,11 @@ WebRequestAPI::ProxySet* proxies, content::ContentBrowserClient::URLLoaderFactoryType loader_factory_type); + WebRequestProxyingURLLoaderFactory( + const WebRequestProxyingURLLoaderFactory&) = delete; + WebRequestProxyingURLLoaderFactory& operator=( + const WebRequestProxyingURLLoaderFactory&) = delete; + ~WebRequestProxyingURLLoaderFactory() override; static void StartProxying( @@ -363,8 +368,6 @@ base::CallbackListSubscription shutdown_notifier_subscription_; base::WeakPtrFactory<WebRequestProxyingURLLoaderFactory> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(WebRequestProxyingURLLoaderFactory); }; } // namespace extensions
diff --git a/extensions/browser/api/web_request/web_request_proxying_websocket.cc b/extensions/browser/api/web_request/web_request_proxying_websocket.cc index d8dc904..7e185f8 100644 --- a/extensions/browser/api/web_request/web_request_proxying_websocket.cc +++ b/extensions/browser/api/web_request/web_request_proxying_websocket.cc
@@ -25,6 +25,9 @@ class ShutdownNotifierFactory : public BrowserContextKeyedServiceShutdownNotifierFactory { public: + ShutdownNotifierFactory(const ShutdownNotifierFactory&) = delete; + ShutdownNotifierFactory& operator=(const ShutdownNotifierFactory&) = delete; + static ShutdownNotifierFactory* GetInstance() { static base::NoDestructor<ShutdownNotifierFactory> factory; return factory.get(); @@ -39,8 +42,6 @@ DependsOn(PermissionHelper::GetFactoryInstance()); } ~ShutdownNotifierFactory() override {} - - DISALLOW_COPY_AND_ASSIGN(ShutdownNotifierFactory); }; } // namespace
diff --git a/extensions/browser/api/web_request/web_request_time_tracker.h b/extensions/browser/api/web_request/web_request_time_tracker.h index 382636a..24bd4bd 100644 --- a/extensions/browser/api/web_request/web_request_time_tracker.h +++ b/extensions/browser/api/web_request/web_request_time_tracker.h
@@ -61,10 +61,9 @@ bool has_extra_headers_listener = false; RequestTimeLog(); + RequestTimeLog(const RequestTimeLog&) = delete; + RequestTimeLog& operator=(const RequestTimeLog&) = delete; ~RequestTimeLog(); - - private: - DISALLOW_COPY_AND_ASSIGN(RequestTimeLog); }; // Records UMA metrics for the given request and its end time.
diff --git a/extensions/browser/api/webcam_private/ip_webcam.h b/extensions/browser/api/webcam_private/ip_webcam.h index 0905fd2..7798763 100644 --- a/extensions/browser/api/webcam_private/ip_webcam.h +++ b/extensions/browser/api/webcam_private/ip_webcam.h
@@ -16,6 +16,9 @@ public: explicit IpWebcam(const std::string& device_id); + IpWebcam(const IpWebcam&) = delete; + IpWebcam& operator=(const IpWebcam&) = delete; + private: ~IpWebcam() override; @@ -52,8 +55,6 @@ const SetPTZCompleteCallback& callback) override; const std::string device_id_; - - DISALLOW_COPY_AND_ASSIGN(IpWebcam); }; } // namespace extensions
diff --git a/extensions/browser/api/webcam_private/v4l2_webcam.h b/extensions/browser/api/webcam_private/v4l2_webcam.h index 55643fc..8f54fe5 100644 --- a/extensions/browser/api/webcam_private/v4l2_webcam.h +++ b/extensions/browser/api/webcam_private/v4l2_webcam.h
@@ -17,6 +17,10 @@ class V4L2Webcam : public Webcam { public: V4L2Webcam(const std::string& device_id); + + V4L2Webcam(const V4L2Webcam&) = delete; + V4L2Webcam& operator=(const V4L2Webcam&) = delete; + bool Open(); private: @@ -64,8 +68,6 @@ const std::string device_id_; base::ScopedFD fd_; - - DISALLOW_COPY_AND_ASSIGN(V4L2Webcam); };
diff --git a/extensions/browser/api/webcam_private/visca_webcam.h b/extensions/browser/api/webcam_private/visca_webcam.h index 98b69f4..9a7eb21 100644 --- a/extensions/browser/api/webcam_private/visca_webcam.h +++ b/extensions/browser/api/webcam_private/visca_webcam.h
@@ -25,6 +25,9 @@ public: ViscaWebcam(); + ViscaWebcam(const ViscaWebcam&) = delete; + ViscaWebcam& operator=(const ViscaWebcam&) = delete; + using OpenCompleteCallback = base::RepeatingCallback<void(bool)>; // Open and initialize the web camera. This is done by the following three @@ -143,8 +146,6 @@ // store the current value of pan and tilt positions. int pan_ = 0; int tilt_ = 0; - - DISALLOW_COPY_AND_ASSIGN(ViscaWebcam); }; } // namespace extensions
diff --git a/extensions/browser/api/webcam_private/webcam.h b/extensions/browser/api/webcam_private/webcam.h index 393bf20..1f5bf61 100644 --- a/extensions/browser/api/webcam_private/webcam.h +++ b/extensions/browser/api/webcam_private/webcam.h
@@ -36,6 +36,9 @@ Webcam(); + Webcam(const Webcam&) = delete; + Webcam& operator=(const Webcam&) = delete; + using GetPTZCompleteCallback = base::RepeatingCallback< void(bool success, int value, int min_value, int max_value)>; using SetPTZCompleteCallback = base::RepeatingCallback<void(bool success)>; @@ -75,9 +78,6 @@ protected: friend class base::RefCounted<Webcam>; virtual ~Webcam(); - - private: - DISALLOW_COPY_AND_ASSIGN(Webcam); }; class WebcamResource : public ApiResource {
diff --git a/extensions/browser/api/webcam_private/webcam_private_api.h b/extensions/browser/api/webcam_private/webcam_private_api.h index a008f2f..ba8d8903 100644 --- a/extensions/browser/api/webcam_private/webcam_private_api.h +++ b/extensions/browser/api/webcam_private/webcam_private_api.h
@@ -84,6 +84,12 @@ class WebcamPrivateOpenSerialWebcamFunction : public ExtensionFunction { public: WebcamPrivateOpenSerialWebcamFunction(); + + WebcamPrivateOpenSerialWebcamFunction( + const WebcamPrivateOpenSerialWebcamFunction&) = delete; + WebcamPrivateOpenSerialWebcamFunction& operator=( + const WebcamPrivateOpenSerialWebcamFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("webcamPrivate.openSerialWebcam", WEBCAMPRIVATE_OPENSERIALWEBCAM) @@ -95,13 +101,17 @@ private: void OnOpenWebcam(const std::string& webcam_id, bool success); - - DISALLOW_COPY_AND_ASSIGN(WebcamPrivateOpenSerialWebcamFunction); }; class WebcamPrivateCloseWebcamFunction : public ExtensionFunction { public: WebcamPrivateCloseWebcamFunction(); + + WebcamPrivateCloseWebcamFunction(const WebcamPrivateCloseWebcamFunction&) = + delete; + WebcamPrivateCloseWebcamFunction& operator=( + const WebcamPrivateCloseWebcamFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("webcamPrivate.closeWebcam", WEBCAMPRIVATE_CLOSEWEBCAM) @@ -110,14 +120,15 @@ // ExtensionFunction: ResponseAction Run() override; - - private: - DISALLOW_COPY_AND_ASSIGN(WebcamPrivateCloseWebcamFunction); }; class WebcamPrivateSetFunction : public ExtensionFunction { public: WebcamPrivateSetFunction(); + + WebcamPrivateSetFunction(const WebcamPrivateSetFunction&) = delete; + WebcamPrivateSetFunction& operator=(const WebcamPrivateSetFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("webcamPrivate.set", WEBCAMPRIVATE_SET) protected: @@ -131,13 +142,15 @@ int pending_num_set_webcam_param_requests_ = 0; bool failed_ = false; - - DISALLOW_COPY_AND_ASSIGN(WebcamPrivateSetFunction); }; class WebcamPrivateGetFunction : public ExtensionFunction { public: WebcamPrivateGetFunction(); + + WebcamPrivateGetFunction(const WebcamPrivateGetFunction&) = delete; + WebcamPrivateGetFunction& operator=(const WebcamPrivateGetFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("webcamPrivate.get", WEBCAMPRIVATE_GET) protected: @@ -182,13 +195,16 @@ bool got_zoom_; bool got_focus_; bool success_; - - DISALLOW_COPY_AND_ASSIGN(WebcamPrivateGetFunction); }; class WebcamPrivateResetFunction : public ExtensionFunction { public: WebcamPrivateResetFunction(); + + WebcamPrivateResetFunction(const WebcamPrivateResetFunction&) = delete; + WebcamPrivateResetFunction& operator=(const WebcamPrivateResetFunction&) = + delete; + DECLARE_EXTENSION_FUNCTION("webcamPrivate.reset", WEBCAMPRIVATE_RESET) protected: @@ -199,13 +215,16 @@ private: void OnResetWebcam(bool success); - - DISALLOW_COPY_AND_ASSIGN(WebcamPrivateResetFunction); }; class WebcamPrivateSetHomeFunction : public ExtensionFunction { public: WebcamPrivateSetHomeFunction(); + + WebcamPrivateSetHomeFunction(const WebcamPrivateSetHomeFunction&) = delete; + WebcamPrivateSetHomeFunction& operator=(const WebcamPrivateSetHomeFunction&) = + delete; + DECLARE_EXTENSION_FUNCTION("webcamPrivate.setHome", WEBCAMPRIVATE_SET_HOME) protected: @@ -216,13 +235,17 @@ private: void OnSetHomeWebcam(bool success); - - DISALLOW_COPY_AND_ASSIGN(WebcamPrivateSetHomeFunction); }; class WebcamPrivateRestoreCameraPresetFunction : public ExtensionFunction { public: WebcamPrivateRestoreCameraPresetFunction(); + + WebcamPrivateRestoreCameraPresetFunction( + const WebcamPrivateRestoreCameraPresetFunction&) = delete; + WebcamPrivateRestoreCameraPresetFunction& operator=( + const WebcamPrivateRestoreCameraPresetFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("webcamPrivate.restoreCameraPreset", WEBCAMPRIVATE_RESTORE_CAMERA_PRESET) @@ -234,13 +257,17 @@ private: void OnRestoreCameraPresetWebcam(bool success); - - DISALLOW_COPY_AND_ASSIGN(WebcamPrivateRestoreCameraPresetFunction); }; class WebcamPrivateSetCameraPresetFunction : public ExtensionFunction { public: WebcamPrivateSetCameraPresetFunction(); + + WebcamPrivateSetCameraPresetFunction( + const WebcamPrivateSetCameraPresetFunction&) = delete; + WebcamPrivateSetCameraPresetFunction& operator=( + const WebcamPrivateSetCameraPresetFunction&) = delete; + DECLARE_EXTENSION_FUNCTION("webcamPrivate.setCameraPreset", WEBCAMPRIVATE_SET_CAMERA_PRESET) @@ -252,8 +279,6 @@ private: void OnSetCameraPresetWebcam(bool success); - - DISALLOW_COPY_AND_ASSIGN(WebcamPrivateSetCameraPresetFunction); }; } // namespace extensions
diff --git a/extensions/browser/app_window/app_web_contents_helper.h b/extensions/browser/app_window/app_web_contents_helper.h index 9321cdd..87163c8 100644 --- a/extensions/browser/app_window/app_web_contents_helper.h +++ b/extensions/browser/app_window/app_web_contents_helper.h
@@ -34,6 +34,9 @@ content::WebContents* web_contents, AppDelegate* app_delegate); + AppWebContentsHelper(const AppWebContentsHelper&) = delete; + AppWebContentsHelper& operator=(const AppWebContentsHelper&) = delete; + // Returns true if the given |event| should not be handled by the renderer. static bool ShouldSuppressGestureEvent(const blink::WebGestureEvent& event); @@ -68,8 +71,6 @@ content::WebContents* web_contents_; AppDelegate* app_delegate_; - - DISALLOW_COPY_AND_ASSIGN(AppWebContentsHelper); }; } // namespace extensions
diff --git a/extensions/browser/app_window/app_window.h b/extensions/browser/app_window/app_window.h index 383c633..6447dd6 100644 --- a/extensions/browser/app_window/app_window.h +++ b/extensions/browser/app_window/app_window.h
@@ -227,6 +227,9 @@ AppDelegate* app_delegate, const Extension* extension); + AppWindow(const AppWindow&) = delete; + AppWindow& operator=(const AppWindow&) = delete; + // Initializes the render interface, web contents, and native window. // |app_window_contents| will become owned by AppWindow. void Init(const GURL& url, @@ -590,8 +593,6 @@ bool did_finish_first_navigation_ = false; base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(AppWindow); }; } // namespace extensions
diff --git a/extensions/browser/content_hash_fetcher.h b/extensions/browser/content_hash_fetcher.h index 082f69c1..8888c3a3 100644 --- a/extensions/browser/content_hash_fetcher.h +++ b/extensions/browser/content_hash_fetcher.h
@@ -52,6 +52,9 @@ ContentHashFetcher(ContentHash::FetchKey fetch_key); + ContentHashFetcher(const ContentHashFetcher&) = delete; + ContentHashFetcher& operator=(const ContentHashFetcher&) = delete; + // Note: |this| is deleted once OnSimpleLoaderComplete() completes. void Start(HashFetcherCallback hash_fetcher_callback); @@ -72,8 +75,6 @@ std::unique_ptr<network::SimpleURLLoader> simple_loader_; SEQUENCE_CHECKER(sequence_checker_); - - DISALLOW_COPY_AND_ASSIGN(ContentHashFetcher); }; } // namespace internals
diff --git a/extensions/browser/content_verifier.cc b/extensions/browser/content_verifier.cc index cde1991..a6cd3c0 100644 --- a/extensions/browser/content_verifier.cc +++ b/extensions/browser/content_verifier.cc
@@ -255,6 +255,9 @@ public: IsCancelledChecker() {} + IsCancelledChecker(const IsCancelledChecker&) = delete; + IsCancelledChecker& operator=(const IsCancelledChecker&) = delete; + // Safe to call from any thread. void Cancel() { base::AutoLock autolock(cancelled_lock_); @@ -277,8 +280,6 @@ // A lock for synchronizing access to |cancelled_|. base::Lock cancelled_lock_; - - DISALLOW_COPY_AND_ASSIGN(IsCancelledChecker); }; // Holds information about each call to HashHelper::GetContentHash(), for a
diff --git a/extensions/browser/content_verifier.h b/extensions/browser/content_verifier.h index 26592c6..20fb17023 100644 --- a/extensions/browser/content_verifier.h +++ b/extensions/browser/content_verifier.h
@@ -73,6 +73,10 @@ ContentVerifier(content::BrowserContext* context, std::unique_ptr<ContentVerifierDelegate> delegate); + + ContentVerifier(const ContentVerifier&) = delete; + ContentVerifier& operator=(const ContentVerifier&) = delete; + void Start(); void Shutdown(); @@ -227,8 +231,6 @@ // Data that should only be used on the IO thread. ContentVerifierIOData io_data_; - - DISALLOW_COPY_AND_ASSIGN(ContentVerifier); }; } // namespace extensions
diff --git a/extensions/browser/content_verifier/content_hash.h b/extensions/browser/content_verifier/content_hash.h index 96f4b8a..d9c12e1 100644 --- a/extensions/browser/content_verifier/content_hash.h +++ b/extensions/browser/content_verifier/content_hash.h
@@ -99,6 +99,9 @@ HASH_MISMATCH }; + ContentHash(const ContentHash&) = delete; + ContentHash& operator=(const ContentHash&) = delete; + // Factory: // Returns ContentHash through |created_callback|, the returned values are: // - |hash| The content hash. This will never be nullptr, but @@ -261,8 +264,6 @@ // TODO(asargent) - use the value from verified_contents.json for each // file, instead of using a constant. int block_size_ = extension_misc::kContentVerificationDefaultBlockSize; - - DISALLOW_COPY_AND_ASSIGN(ContentHash); }; } // namespace extensions
diff --git a/extensions/browser/content_verify_job.h b/extensions/browser/content_verify_job.h index 3b178374..1648a08 100644 --- a/extensions/browser/content_verify_job.h +++ b/extensions/browser/content_verify_job.h
@@ -69,6 +69,9 @@ const base::FilePath& relative_path, FailureCallback failure_callback); + ContentVerifyJob(const ContentVerifyJob&) = delete; + ContentVerifyJob& operator=(const ContentVerifyJob&) = delete; + // This begins the process of getting expected hashes, so it should be called // as early as possible. void Start(ContentVerifier* verifier); @@ -174,8 +177,6 @@ // Used to synchronize all public methods. base::Lock lock_; - - DISALLOW_COPY_AND_ASSIGN(ContentVerifyJob); }; } // namespace extensions
diff --git a/extensions/browser/content_verify_job_unittest.cc b/extensions/browser/content_verify_job_unittest.cc index 7b2a32d..965fd6e 100644 --- a/extensions/browser/content_verify_job_unittest.cc +++ b/extensions/browser/content_verify_job_unittest.cc
@@ -723,6 +723,9 @@ public: ContentMismatchUnittest() {} + ContentMismatchUnittest(const ContentMismatchUnittest&) = delete; + ContentMismatchUnittest& operator=(const ContentMismatchUnittest&) = delete; + protected: // Runs test to verify that a modified extension resource (background.js) // causes ContentVerifyJob to fail with HASH_MISMATCH. The string @@ -751,9 +754,6 @@ modified_contents, run_mode)); } } - - private: - DISALLOW_COPY_AND_ASSIGN(ContentMismatchUnittest); }; INSTANTIATE_TEST_SUITE_P(ContentVerifyJobUnittest, @@ -783,6 +783,11 @@ &ContentVerifyJobWithHashFetchUnittest::InterceptHashFetch, base::Unretained(this))) {} + ContentVerifyJobWithHashFetchUnittest( + const ContentVerifyJobWithHashFetchUnittest&) = delete; + ContentVerifyJobWithHashFetchUnittest& operator=( + const ContentVerifyJobWithHashFetchUnittest&) = delete; + protected: // Responds to hash fetch request. void RespondToClientIfReady() { @@ -840,8 +845,6 @@ // Copy of the contents of verified_contents.json. absl::optional<std::string> verified_contents_; - - DISALLOW_COPY_AND_ASSIGN(ContentVerifyJobWithHashFetchUnittest); }; // Regression test for https://crbug.com/995436.
diff --git a/extensions/browser/event_router_factory.h b/extensions/browser/event_router_factory.h index e474713..586f2b05 100644 --- a/extensions/browser/event_router_factory.h +++ b/extensions/browser/event_router_factory.h
@@ -15,6 +15,9 @@ class EventRouterFactory : public BrowserContextKeyedServiceFactory { public: + EventRouterFactory(const EventRouterFactory&) = delete; + EventRouterFactory& operator=(const EventRouterFactory&) = delete; + static EventRouter* GetForBrowserContext(content::BrowserContext* context); static EventRouterFactory* GetInstance(); @@ -29,8 +32,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(EventRouterFactory); }; } // namespace extensions
diff --git a/extensions/browser/event_router_unittest.cc b/extensions/browser/event_router_unittest.cc index c349fb05..48d91fb 100644 --- a/extensions/browser/event_router_unittest.cc +++ b/extensions/browser/event_router_unittest.cc
@@ -156,6 +156,9 @@ public: EventRouterTest() = default; + EventRouterTest(const EventRouterTest&) = delete; + EventRouterTest& operator=(const EventRouterTest&) = delete; + protected: // Tests adding and removing observers from EventRouter. void RunEventRouterObserverTest(const EventListenerConstructor& constructor); @@ -190,8 +193,6 @@ private: base::HistogramTester histogram_tester_; - - DISALLOW_COPY_AND_ASSIGN(EventRouterTest); }; class EventRouterFilterTest : public ExtensionsTest, @@ -199,6 +200,9 @@ public: EventRouterFilterTest() {} + EventRouterFilterTest(const EventRouterFilterTest&) = delete; + EventRouterFilterTest& operator=(const EventRouterFilterTest&) = delete; + void SetUp() override { ExtensionsTest::SetUp(); render_process_host_ = @@ -262,8 +266,6 @@ } std::unique_ptr<content::RenderProcessHost> render_process_host_; - - DISALLOW_COPY_AND_ASSIGN(EventRouterFilterTest); }; TEST_F(EventRouterTest, GetBaseEventName) {
diff --git a/extensions/browser/events/event_ack_data.cc b/extensions/browser/events/event_ack_data.cc index 2c82eab..7fef32c0 100644 --- a/extensions/browser/events/event_ack_data.cc +++ b/extensions/browser/events/event_ack_data.cc
@@ -40,14 +40,15 @@ public: CoreThreadEventInfo() = default; + CoreThreadEventInfo(const CoreThreadEventInfo&) = delete; + CoreThreadEventInfo& operator=(const CoreThreadEventInfo&) = delete; + // Map of event information keyed by event_id. std::map<int, EventInfo> event_map; private: friend class base::RefCountedThreadSafe<CoreThreadEventInfo>; ~CoreThreadEventInfo() = default; - - DISALLOW_COPY_AND_ASSIGN(CoreThreadEventInfo); }; EventAckData::EventAckData()
diff --git a/extensions/browser/extension_action_manager_unittest.cc b/extensions/browser/extension_action_manager_unittest.cc index 5a62d61..01d12fa6 100644 --- a/extensions/browser/extension_action_manager_unittest.cc +++ b/extensions/browser/extension_action_manager_unittest.cc
@@ -26,6 +26,10 @@ public: ExtensionActionManagerTest(); + ExtensionActionManagerTest(const ExtensionActionManagerTest&) = delete; + ExtensionActionManagerTest& operator=(const ExtensionActionManagerTest&) = + delete; + protected: // ExtensionsTest: void SetUp() override; @@ -36,8 +40,6 @@ private: ExtensionRegistry* registry_; ExtensionActionManager* manager_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionActionManagerTest); }; ExtensionActionManagerTest::ExtensionActionManagerTest() = default;
diff --git a/extensions/browser/extension_api_frame_id_map.h b/extensions/browser/extension_api_frame_id_map.h index 5e1d7d9..5fa87a320 100644 --- a/extensions/browser/extension_api_frame_id_map.h +++ b/extensions/browser/extension_api_frame_id_map.h
@@ -72,6 +72,9 @@ // Extension API frame ID of the top-level frame. static const int kTopFrameId; + ExtensionApiFrameIdMap(const ExtensionApiFrameIdMap&) = delete; + ExtensionApiFrameIdMap& operator=(const ExtensionApiFrameIdMap&) = delete; + static ExtensionApiFrameIdMap* Get(); // Get the extension API frame ID for |rfh|. @@ -122,8 +125,6 @@ // continue after a frame is unloaded can access the FrameData. using FrameDataMap = std::map<content::GlobalRenderFrameHostId, FrameData>; FrameDataMap deleted_frame_data_map_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionApiFrameIdMap); }; } // namespace extensions
diff --git a/extensions/browser/extension_creator.h b/extensions/browser/extension_creator.h index 07553b2..59bfcef 100644 --- a/extensions/browser/extension_creator.h +++ b/extensions/browser/extension_creator.h
@@ -33,6 +33,9 @@ public: ExtensionCreator(); + ExtensionCreator(const ExtensionCreator&) = delete; + ExtensionCreator& operator=(const ExtensionCreator&) = delete; + // Settings to specify treatment of special or ignorable error conditions. enum RunFlags { kNoRunFlags = 0, @@ -123,8 +126,6 @@ // Type of error that was raised, if any. ErrorType error_type_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionCreator); }; } // namespace extensions
diff --git a/extensions/browser/extension_creator_filter.h b/extensions/browser/extension_creator_filter.h index 384e4fc..4c92b27 100644 --- a/extensions/browser/extension_creator_filter.h +++ b/extensions/browser/extension_creator_filter.h
@@ -17,6 +17,9 @@ public: ExtensionCreatorFilter(const base::FilePath& extension_dir); + ExtensionCreatorFilter(const ExtensionCreatorFilter&) = delete; + ExtensionCreatorFilter& operator=(const ExtensionCreatorFilter&) = delete; + // Returns true if the given |file_path| should be included in a packed // extension. bool ShouldPackageFile(const base::FilePath& file_path); @@ -26,8 +29,6 @@ ~ExtensionCreatorFilter() {} const base::FilePath reserved_metadata_dir_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionCreatorFilter); }; } // namespace extensions
diff --git a/extensions/browser/extension_creator_unittest.cc b/extensions/browser/extension_creator_unittest.cc index b907e24..6f89062 100644 --- a/extensions/browser/extension_creator_unittest.cc +++ b/extensions/browser/extension_creator_unittest.cc
@@ -31,6 +31,9 @@ public: ExtensionCreatorTest() = default; + ExtensionCreatorTest(const ExtensionCreatorTest&) = delete; + ExtensionCreatorTest& operator=(const ExtensionCreatorTest&) = delete; + void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); test_path_ = temp_dir_.GetPath(); @@ -55,8 +58,6 @@ base::ScopedTempDir temp_dir_; base::FilePath test_path_; std::unique_ptr<ExtensionCreator> extension_creator_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionCreatorTest); }; TEST_F(ExtensionCreatorTest, ReadInputKeyPathNonExistent) {
diff --git a/extensions/browser/extension_event_histogram_value.h b/extensions/browser/extension_event_histogram_value.h index ae0c8f5..d62e91e4 100644 --- a/extensions/browser/extension_event_histogram_value.h +++ b/extensions/browser/extension_event_histogram_value.h
@@ -500,6 +500,7 @@ STORAGE_SESSION_ON_CHANGE = 478, ACCESSIBILITY_PRIVATE_ON_TOGGLE_DICTATION = 479, WEB_AUTHENTICATION_PROXY_ON_ISUVPAA_REQUEST = 480, + SPEECH_RECOGNITION_PRIVATE_ON_STOP = 481, // Last entry: Add new entries above, then run: // python tools/metrics/histograms/update_extension_histograms.py ENUM_BOUNDARY
diff --git a/extensions/browser/extension_function.cc b/extensions/browser/extension_function.cc index a1b4509..ab940fd6 100644 --- a/extensions/browser/extension_function.cc +++ b/extensions/browser/extension_function.cc
@@ -391,6 +391,9 @@ WebContents::FromRenderFrameHost(function->render_frame_host())), function_(function) {} + RenderFrameHostTracker(const RenderFrameHostTracker&) = delete; + RenderFrameHostTracker& operator=(const RenderFrameHostTracker&) = delete; + private: // content::WebContentsObserver: void RenderFrameDeleted( @@ -406,8 +409,6 @@ } ExtensionFunction* function_; // Owns us. - - DISALLOW_COPY_AND_ASSIGN(RenderFrameHostTracker); }; ExtensionFunction::ExtensionFunction() {
diff --git a/extensions/browser/extension_function.h b/extensions/browser/extension_function.h index ce94103..a970b62e 100644 --- a/extensions/browser/extension_function.h +++ b/extensions/browser/extension_function.h
@@ -115,6 +115,9 @@ ExtensionFunction(); + ExtensionFunction(const ExtensionFunction&) = delete; + ExtensionFunction& operator=(const ExtensionFunction&) = delete; + static void EnsureShutdownNotifierFactoryBuilt(); // Returns true if the function has permission to run. @@ -614,8 +617,6 @@ std::vector<std::string> transferred_blob_uuids_; int worker_thread_id_ = -1; - - DISALLOW_COPY_AND_ASSIGN(ExtensionFunction); }; #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_
diff --git a/extensions/browser/extension_function_histogram_value.h b/extensions/browser/extension_function_histogram_value.h index dc1f46d..c5a2b107 100644 --- a/extensions/browser/extension_function_histogram_value.h +++ b/extensions/browser/extension_function_histogram_value.h
@@ -1651,6 +1651,7 @@ OS_DIAGNOSTICS_RUNMEMORYROUTINE = 1588, OS_DIAGNOSTICS_GETROUTINEUPDATE = 1589, SPEECHRECOGNITIONPRIVATE_START = 1590, + SPEECHRECOGNITIONPRIVATE_STOP = 1591, // Last entry: Add new entries above, then run: // python tools/metrics/histograms/update_extension_histograms.py ENUM_BOUNDARY
diff --git a/extensions/browser/extension_host.cc b/extensions/browser/extension_host.cc index f32ea84..c273c763c 100644 --- a/extensions/browser/extension_host.cc +++ b/extensions/browser/extension_host.cc
@@ -272,6 +272,9 @@ return; document_element_available_ = true; + ExtensionHostRegistry::Get(browser_context_) + ->ExtensionHostDocumentElementAvailable(this); + if (extension_host_type_ == mojom::ViewType::kExtensionBackgroundPage) { ExtensionSystem::Get(browser_context_) ->runtime_data()
diff --git a/extensions/browser/extension_host_registry.cc b/extensions/browser/extension_host_registry.cc index 728e2a7..de15a24 100644 --- a/extensions/browser/extension_host_registry.cc +++ b/extensions/browser/extension_host_registry.cc
@@ -138,6 +138,17 @@ } } +void ExtensionHostRegistry::ExtensionHostDocumentElementAvailable( + ExtensionHost* extension_host) { + // See note in ExtensionHostCompletedFirstLoad(). + extension_hosts_.insert(extension_host); + + for (Observer& observer : observers_) { + observer.OnExtensionHostDocumentElementAvailable( + extension_host->browser_context(), extension_host); + } +} + void ExtensionHostRegistry::AddObserver(Observer* observer) { observers_.AddObserver(observer); }
diff --git a/extensions/browser/extension_host_registry.h b/extensions/browser/extension_host_registry.h index 05c3bbd..1570f561 100644 --- a/extensions/browser/extension_host_registry.h +++ b/extensions/browser/extension_host_registry.h
@@ -51,6 +51,16 @@ virtual void OnExtensionHostCompletedFirstLoad( content::BrowserContext* browser_context, ExtensionHost* host) {} + + // Called when a document element is first available in an ExtensionHost. + // `browser_context` is the context associated with that host (which might + // be an incognito version of ExtensionHostRegistry::browser_context_). + // TODO(devlin): Do we really need both first load completed and document + // element available notifications? This matches previous implementations, + // but I'm not sure the distinction is relevant. + virtual void OnExtensionHostDocumentElementAvailable( + content::BrowserContext* browser_context, + ExtensionHost* extension_host) {} }; ExtensionHostRegistry(); @@ -75,6 +85,9 @@ void ExtensionHostDestroyed(ExtensionHost* extension_host); // Called when an ExtensionHost completes its first load. void ExtensionHostCompletedFirstLoad(ExtensionHost* extension_host); + // Called when an ExtensionHost has created a document element for its first + // time. + void ExtensionHostDocumentElementAvailable(ExtensionHost* extension_host); void AddObserver(Observer* observer); void RemoveObserver(Observer* observer);
diff --git a/extensions/browser/extension_icon_image.h b/extensions/browser/extension_icon_image.h index cb55828..46732df7 100644 --- a/extensions/browser/extension_icon_image.h +++ b/extensions/browser/extension_icon_image.h
@@ -80,6 +80,10 @@ int resource_size_in_dip, const gfx::ImageSkia& default_icon, Observer* observer); + + IconImage(const IconImage&) = delete; + IconImage& operator=(const IconImage&) = delete; + ~IconImage() override; gfx::Image image() const { return image_; } @@ -134,8 +138,6 @@ content::NotificationRegistrar registrar_; base::WeakPtrFactory<IconImage> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(IconImage); }; } // namespace extensions
diff --git a/extensions/browser/extension_message_filter.cc b/extensions/browser/extension_message_filter.cc index 10e550a..f85460f 100644 --- a/extensions/browser/extension_message_filter.cc +++ b/extensions/browser/extension_message_filter.cc
@@ -46,6 +46,9 @@ class ShutdownNotifierFactory : public BrowserContextKeyedServiceShutdownNotifierFactory { public: + ShutdownNotifierFactory(const ShutdownNotifierFactory&) = delete; + ShutdownNotifierFactory& operator=(const ShutdownNotifierFactory&) = delete; + static ShutdownNotifierFactory* GetInstance() { return base::Singleton<ShutdownNotifierFactory>::get(); } @@ -60,8 +63,6 @@ DependsOn(ProcessManagerFactory::GetInstance()); } ~ShutdownNotifierFactory() override {} - - DISALLOW_COPY_AND_ASSIGN(ShutdownNotifierFactory); }; // Returns true if the process corresponding to `render_process_id` can host an
diff --git a/extensions/browser/extension_message_filter.h b/extensions/browser/extension_message_filter.h index 4cc822f..b47b294 100644 --- a/extensions/browser/extension_message_filter.h +++ b/extensions/browser/extension_message_filter.h
@@ -37,6 +37,9 @@ ExtensionMessageFilter(int render_process_id, content::BrowserContext* context); + ExtensionMessageFilter(const ExtensionMessageFilter&) = delete; + ExtensionMessageFilter& operator=(const ExtensionMessageFilter&) = delete; + int render_process_id() { return render_process_id_; } static void EnsureShutdownNotifierFactoryBuilt(); @@ -91,8 +94,6 @@ // Only access from the UI thread. content::BrowserContext* browser_context_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionMessageFilter); }; } // namespace extensions
diff --git a/extensions/browser/extension_navigation_throttle.cc b/extensions/browser/extension_navigation_throttle.cc index aa7607c..8b1d0d0 100644 --- a/extensions/browser/extension_navigation_throttle.cc +++ b/extensions/browser/extension_navigation_throttle.cc
@@ -244,18 +244,17 @@ return content::NavigationThrottle::BLOCK_REQUEST; } - // Navigations with no initiator (e.g. browser-initiated requests) are always - // considered trusted, and thus allowed. - // - // Note that GuestView navigations initiated by the embedder also count as a - // browser-initiated navigation. - if (!navigation_handle()->GetInitiatorOrigin().has_value()) { - DCHECK(!navigation_handle()->IsRendererInitiated()); + // A browser-initiated navigation is always considered trusted, and thus + // allowed. + if (!navigation_handle()->IsRendererInitiated()) return content::NavigationThrottle::PROCEED; - } - // All renderer-initiated navigations must have an initiator. - DCHECK(navigation_handle()->GetInitiatorOrigin().has_value()); + // A renderer-initiated request without an initiator origin is a history + // traversal to an entry that was originally loaded in a browser-initiated + // navigation. Those are trusted, too. + if (!navigation_handle()->GetInitiatorOrigin().has_value()) + return content::NavigationThrottle::PROCEED; + const url::Origin& initiator_origin = navigation_handle()->GetInitiatorOrigin().value();
diff --git a/extensions/browser/extension_navigation_ui_data.h b/extensions/browser/extension_navigation_ui_data.h index d3acaf1..8bf9f54 100644 --- a/extensions/browser/extension_navigation_ui_data.h +++ b/extensions/browser/extension_navigation_ui_data.h
@@ -29,6 +29,10 @@ int tab_id, int window_id); + ExtensionNavigationUIData(const ExtensionNavigationUIData&) = delete; + ExtensionNavigationUIData& operator=(const ExtensionNavigationUIData&) = + delete; + static std::unique_ptr<ExtensionNavigationUIData> CreateForMainFrameNavigation(content::WebContents* web_contents, int tab_id, @@ -65,8 +69,6 @@ // ID for the parent RenderFrameHost of this navigation. Will only have a // valid value for sub-frame navigations. content::GlobalRenderFrameHostId parent_routing_id_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionNavigationUIData); }; } // namespace extensions
diff --git a/extensions/browser/extension_pref_store.h b/extensions/browser/extension_pref_store.h index 3585c33..7ac9b9ae 100644 --- a/extensions/browser/extension_pref_store.h +++ b/extensions/browser/extension_pref_store.h
@@ -21,6 +21,9 @@ ExtensionPrefStore(ExtensionPrefValueMap* extension_pref_value_map, bool incognito_pref_store); + ExtensionPrefStore(const ExtensionPrefStore&) = delete; + ExtensionPrefStore& operator=(const ExtensionPrefStore&) = delete; + // Overrides for ExtensionPrefValueMap::Observer: void OnInitializationCompleted() override; void OnPrefValueChanged(const std::string& key) override; @@ -32,8 +35,6 @@ private: ExtensionPrefValueMap* extension_pref_value_map_; // Weak pointer. bool incognito_pref_store_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionPrefStore); }; #endif // EXTENSIONS_BROWSER_EXTENSION_PREF_STORE_H_
diff --git a/extensions/browser/extension_pref_value_map.h b/extensions/browser/extension_pref_value_map.h index 85fa0cc..6efeb95 100644 --- a/extensions/browser/extension_pref_value_map.h +++ b/extensions/browser/extension_pref_value_map.h
@@ -79,6 +79,10 @@ }; ExtensionPrefValueMap(); + + ExtensionPrefValueMap(const ExtensionPrefValueMap&) = delete; + ExtensionPrefValueMap& operator=(const ExtensionPrefValueMap&) = delete; + ~ExtensionPrefValueMap() override; // KeyedService implementation. @@ -204,8 +208,6 @@ bool destroyed_; base::ObserverList<Observer, true>::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap); }; #endif // EXTENSIONS_BROWSER_EXTENSION_PREF_VALUE_MAP_H_
diff --git a/extensions/browser/extension_prefs.h b/extensions/browser/extension_prefs.h index 71d2e213..c9905767 100644 --- a/extensions/browser/extension_prefs.h +++ b/extensions/browser/extension_prefs.h
@@ -179,6 +179,9 @@ const std::vector<EarlyExtensionPrefsObserver*>& early_observers, base::Clock* clock); + ExtensionPrefs(const ExtensionPrefs&) = delete; + ExtensionPrefs& operator=(const ExtensionPrefs&) = delete; + ~ExtensionPrefs() override; // Convenience function to get the ExtensionPrefs for a BrowserContext. @@ -933,8 +936,6 @@ bool extensions_disabled_; base::ObserverList<ExtensionPrefsObserver>::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); }; } // namespace extensions
diff --git a/extensions/browser/extension_protocols.cc b/extensions/browser/extension_protocols.cc index 7eb72ca..108ff1e7 100644 --- a/extensions/browser/extension_protocols.cc +++ b/extensions/browser/extension_protocols.cc
@@ -532,6 +532,10 @@ class ExtensionURLLoaderFactory : public network::SelfDeletingURLLoaderFactory { public: + ExtensionURLLoaderFactory(const ExtensionURLLoaderFactory&) = delete; + ExtensionURLLoaderFactory& operator=(const ExtensionURLLoaderFactory&) = + delete; + static mojo::PendingRemote<network::mojom::URLLoaderFactory> Create( content::BrowserContext* browser_context, ukm::SourceIdObj ukm_source_id, @@ -877,8 +881,6 @@ scoped_refptr<extensions::InfoMap> extension_info_map_; base::CallbackListSubscription browser_context_shutdown_subscription_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionURLLoaderFactory); }; } // namespace
diff --git a/extensions/browser/extension_registry_factory.h b/extensions/browser/extension_registry_factory.h index ec476404..f49121d 100644 --- a/extensions/browser/extension_registry_factory.h +++ b/extensions/browser/extension_registry_factory.h
@@ -18,6 +18,9 @@ // between an incognito browser context and its original browser context. class ExtensionRegistryFactory : public BrowserContextKeyedServiceFactory { public: + ExtensionRegistryFactory(const ExtensionRegistryFactory&) = delete; + ExtensionRegistryFactory& operator=(const ExtensionRegistryFactory&) = delete; + static ExtensionRegistry* GetForBrowserContext( content::BrowserContext* context); @@ -34,8 +37,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(ExtensionRegistryFactory); }; } // namespace extensions
diff --git a/extensions/browser/extension_registry_unittest.cc b/extensions/browser/extension_registry_unittest.cc index b419ec7..95709280 100644 --- a/extensions/browser/extension_registry_unittest.cc +++ b/extensions/browser/extension_registry_unittest.cc
@@ -40,6 +40,9 @@ public: TestObserver() {} + TestObserver(const TestObserver&) = delete; + TestObserver& operator=(const TestObserver&) = delete; + void Reset() { loaded_.clear(); unloaded_.clear(); @@ -83,8 +86,6 @@ ExtensionList unloaded_; ExtensionList installed_; ExtensionList uninstalled_; - - DISALLOW_COPY_AND_ASSIGN(TestObserver); }; TEST_F(ExtensionRegistryTest, FillAndClearRegistry) {
diff --git a/extensions/browser/extension_service_worker_message_filter.cc b/extensions/browser/extension_service_worker_message_filter.cc index 837b081..014d3c0f 100644 --- a/extensions/browser/extension_service_worker_message_filter.cc +++ b/extensions/browser/extension_service_worker_message_filter.cc
@@ -29,6 +29,9 @@ class ShutdownNotifierFactory : public BrowserContextKeyedServiceShutdownNotifierFactory { public: + ShutdownNotifierFactory(const ShutdownNotifierFactory&) = delete; + ShutdownNotifierFactory& operator=(const ShutdownNotifierFactory&) = delete; + static ShutdownNotifierFactory* GetInstance() { return base::Singleton<ShutdownNotifierFactory>::get(); } @@ -43,8 +46,6 @@ DependsOn(ProcessManagerFactory::GetInstance()); } ~ShutdownNotifierFactory() override = default; - - DISALLOW_COPY_AND_ASSIGN(ShutdownNotifierFactory); }; } // namespace
diff --git a/extensions/browser/extension_service_worker_message_filter.h b/extensions/browser/extension_service_worker_message_filter.h index 8b6629e..970998c 100644 --- a/extensions/browser/extension_service_worker_message_filter.h +++ b/extensions/browser/extension_service_worker_message_filter.h
@@ -39,6 +39,11 @@ content::BrowserContext* context, content::ServiceWorkerContext* service_worker_context); + ExtensionServiceWorkerMessageFilter( + const ExtensionServiceWorkerMessageFilter&) = delete; + ExtensionServiceWorkerMessageFilter& operator=( + const ExtensionServiceWorkerMessageFilter&) = delete; + // content::BrowserMessageFilter: bool OnMessageReceived(const IPC::Message& message) override; void OverrideThreadForMessage(const IPC::Message& message, @@ -96,8 +101,6 @@ dispatcher_; std::unordered_set<std::string> active_request_uuids_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionServiceWorkerMessageFilter); }; } // namespace extensions
diff --git a/extensions/browser/extension_web_contents_observer.h b/extensions/browser/extension_web_contents_observer.h index 7e29d02..d6b2757 100644 --- a/extensions/browser/extension_web_contents_observer.h +++ b/extensions/browser/extension_web_contents_observer.h
@@ -55,6 +55,10 @@ : public content::WebContentsObserver, public ExtensionFunctionDispatcher::Delegate { public: + ExtensionWebContentsObserver(const ExtensionWebContentsObserver&) = delete; + ExtensionWebContentsObserver& operator=(const ExtensionWebContentsObserver&) = + delete; + // Returns the ExtensionWebContentsObserver for the given |web_contents|. static ExtensionWebContentsObserver* GetForWebContents( content::WebContents* web_contents); @@ -142,8 +146,6 @@ // A map of render frame host to mojo remotes. std::map<content::RenderFrameHost*, mojo::AssociatedRemote<mojom::LocalFrame>> local_frame_map_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionWebContentsObserver); }; } // namespace extensions
diff --git a/extensions/browser/extension_zoom_request_client.h b/extensions/browser/extension_zoom_request_client.h index 42c2e8b..912e8b9 100644 --- a/extensions/browser/extension_zoom_request_client.h +++ b/extensions/browser/extension_zoom_request_client.h
@@ -21,6 +21,10 @@ public: explicit ExtensionZoomRequestClient(scoped_refptr<const Extension> extension); + ExtensionZoomRequestClient(const ExtensionZoomRequestClient&) = delete; + ExtensionZoomRequestClient& operator=(const ExtensionZoomRequestClient&) = + delete; + bool ShouldSuppressBubble() const override; const Extension* extension() const { return extension_.get(); } @@ -29,8 +33,6 @@ private: scoped_refptr<const Extension> extension_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionZoomRequestClient); }; } // namespace extensions
diff --git a/extensions/browser/external_install_info.h b/extensions/browser/external_install_info.h index 8641cc4..63e4bb7 100644 --- a/extensions/browser/external_install_info.h +++ b/extensions/browser/external_install_info.h
@@ -19,15 +19,14 @@ ExternalInstallInfo(const std::string& extension_id, int creation_flags, bool mark_acknowledged); + ExternalInstallInfo(const ExternalInstallInfo&) = delete; + ExternalInstallInfo& operator=(const ExternalInstallInfo&) = delete; ExternalInstallInfo(ExternalInstallInfo&& other); virtual ~ExternalInstallInfo() {} std::string extension_id; int creation_flags; bool mark_acknowledged; - - private: - DISALLOW_COPY_AND_ASSIGN(ExternalInstallInfo); }; struct ExternalInstallInfoFile : public ExternalInstallInfo {
diff --git a/extensions/browser/file_reader.h b/extensions/browser/file_reader.h index 144e173..ed1058b 100644 --- a/extensions/browser/file_reader.h +++ b/extensions/browser/file_reader.h
@@ -35,6 +35,9 @@ OptionalFileSequenceTask file_sequence_task, DoneCallback done_callback); + FileReader(const FileReader&) = delete; + FileReader& operator=(const FileReader&) = delete; + // Called to start reading the files on a background sequence. Upon // completion, the callback will be notified of the results. void Start(); @@ -50,8 +53,6 @@ OptionalFileSequenceTask optional_file_sequence_task_; DoneCallback done_callback_; const scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_; - - DISALLOW_COPY_AND_ASSIGN(FileReader); }; #endif // EXTENSIONS_BROWSER_FILE_READER_H_
diff --git a/extensions/browser/file_reader_unittest.cc b/extensions/browser/file_reader_unittest.cc index a795f0c..8e064fc1 100644 --- a/extensions/browser/file_reader_unittest.cc +++ b/extensions/browser/file_reader_unittest.cc
@@ -24,10 +24,11 @@ public: FileReaderTest() {} + FileReaderTest(const FileReaderTest&) = delete; + FileReaderTest& operator=(const FileReaderTest&) = delete; + private: base::test::TaskEnvironment task_environment_; - - DISALLOW_COPY_AND_ASSIGN(FileReaderTest); }; class Receiver { @@ -38,6 +39,9 @@ FileReader::OptionalFileSequenceTask(), base::BindOnce(&Receiver::DidReadFile, base::Unretained(this)))) {} + Receiver(const Receiver&) = delete; + Receiver& operator=(const Receiver&) = delete; + void Run() { file_reader_->Start(); run_loop_.Run(); @@ -73,8 +77,6 @@ std::vector<std::unique_ptr<std::string>> data_; scoped_refptr<FileReader> file_reader_; base::RunLoop run_loop_; - - DISALLOW_COPY_AND_ASSIGN(Receiver); }; void RunBasicTest(const std::vector<std::string>& filenames) {
diff --git a/extensions/browser/guest_view/app_view/app_view_guest.h b/extensions/browser/guest_view/app_view/app_view_guest.h index d4d2ea2..51865d7 100644 --- a/extensions/browser/guest_view/app_view/app_view_guest.h +++ b/extensions/browser/guest_view/app_view/app_view_guest.h
@@ -24,6 +24,9 @@ public: static const char Type[]; + AppViewGuest(const AppViewGuest&) = delete; + AppViewGuest& operator=(const AppViewGuest&) = delete; + // Completes the creation of a WebContents associated with the provided // |guest_extension_id| and |guest_instance_id| for the given // |browser_context|. @@ -87,8 +90,6 @@ // This is used to ensure pending tasks will not fire after this object is // destroyed. base::WeakPtrFactory<AppViewGuest> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(AppViewGuest); }; } // namespace extensions
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.h b/extensions/browser/guest_view/extension_options/extension_options_guest.h index 9b293d0..d9e6b8c 100644 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.h +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.h
@@ -20,6 +20,10 @@ : public guest_view::GuestView<ExtensionOptionsGuest> { public: static const char Type[]; + + ExtensionOptionsGuest(const ExtensionOptionsGuest&) = delete; + ExtensionOptionsGuest& operator=(const ExtensionOptionsGuest&) = delete; + static guest_view::GuestViewBase* Create( content::WebContents* owner_web_contents); @@ -73,8 +77,6 @@ std::unique_ptr<extensions::ExtensionOptionsGuestDelegate> extension_options_guest_delegate_; GURL options_page_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionOptionsGuest); }; } // namespace extensions
diff --git a/extensions/browser/guest_view/guest_view_events.cc b/extensions/browser/guest_view/guest_view_events.cc index 68e45c1..19726ef 100644 --- a/extensions/browser/guest_view/guest_view_events.cc +++ b/extensions/browser/guest_view/guest_view_events.cc
@@ -85,6 +85,9 @@ } } + EventMap(const EventMap&) = delete; + EventMap& operator=(const EventMap&) = delete; + events::HistogramValue Get(const std::string& event_name) { auto value = values_.find(event_name); return value != values_.end() ? value->second : events::UNKNOWN; @@ -92,8 +95,6 @@ private: std::map<std::string, events::HistogramValue> values_; - - DISALLOW_COPY_AND_ASSIGN(EventMap); }; base::LazyInstance<EventMap>::DestructorAtExit g_event_map =
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h index 7482863..66332291 100644 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
@@ -84,6 +84,9 @@ class MimeHandlerViewGuest : public guest_view::GuestView<MimeHandlerViewGuest> { public: + MimeHandlerViewGuest(const MimeHandlerViewGuest&) = delete; + MimeHandlerViewGuest& operator=(const MimeHandlerViewGuest&) = delete; + static guest_view::GuestViewBase* Create( content::WebContents* owner_web_contents); @@ -212,8 +215,6 @@ pending_before_unload_control_; base::WeakPtrFactory<MimeHandlerViewGuest> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewGuest); }; } // namespace extensions
diff --git a/extensions/browser/guest_view/mime_handler_view/test_mime_handler_view_guest.h b/extensions/browser/guest_view/mime_handler_view/test_mime_handler_view_guest.h index f29442d..29498675 100644 --- a/extensions/browser/guest_view/mime_handler_view/test_mime_handler_view_guest.h +++ b/extensions/browser/guest_view/mime_handler_view/test_mime_handler_view_guest.h
@@ -21,6 +21,9 @@ // control over the MimeHandlerViewGuest for the purposes of testing. class TestMimeHandlerViewGuest : public MimeHandlerViewGuest { public: + TestMimeHandlerViewGuest(const TestMimeHandlerViewGuest&) = delete; + TestMimeHandlerViewGuest& operator=(const TestMimeHandlerViewGuest&) = delete; + static GuestViewBase* Create(content::WebContents* owner_web_contents); // Set a delay in the next creation of a guest's WebContents by |delay| @@ -55,8 +58,6 @@ // This is used to ensure pending tasks will not fire after this object is // destroyed. base::WeakPtrFactory<TestMimeHandlerViewGuest> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(TestMimeHandlerViewGuest); }; } // namespace extensions
diff --git a/extensions/browser/guest_view/web_view/web_view_apitest.cc b/extensions/browser/guest_view/web_view/web_view_apitest.cc index 9b173adc..ccdab49 100644 --- a/extensions/browser/guest_view/web_view/web_view_apitest.cc +++ b/extensions/browser/guest_view/web_view/web_view_apitest.cc
@@ -99,6 +99,10 @@ hidden_callback_(std::move(hidden_callback)), hidden_observed_(false) {} + WebContentsHiddenObserver(const WebContentsHiddenObserver&) = delete; + WebContentsHiddenObserver& operator=(const WebContentsHiddenObserver&) = + delete; + // WebContentsObserver. void OnVisibilityChanged(content::Visibility visibility) override { if (visibility == content::Visibility::HIDDEN) { @@ -112,8 +116,6 @@ private: base::RepeatingClosure hidden_callback_; bool hidden_observed_; - - DISALLOW_COPY_AND_ASSIGN(WebContentsHiddenObserver); }; // Handles |request| by serving a redirect response.
diff --git a/extensions/browser/guest_view/web_view/web_view_find_helper.h b/extensions/browser/guest_view/web_view/web_view_find_helper.h index a453a475..228a2d7 100644 --- a/extensions/browser/guest_view/web_view/web_view_find_helper.h +++ b/extensions/browser/guest_view/web_view/web_view_find_helper.h
@@ -116,6 +116,9 @@ blink::mojom::FindOptionsPtr options, scoped_refptr<WebViewInternalFindFunction> find_function); + FindInfo(const FindInfo&) = delete; + FindInfo& operator=(const FindInfo&) = delete; + // Add another request to |find_next_requests_|. void AddFindNextRequest(const base::WeakPtr<FindInfo>& request) { find_next_requests_.push_back(request); @@ -167,8 +170,6 @@ bool canceled); base::WeakPtrFactory<FindInfo> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FindInfo); }; // Pointer to the webview that is being helped.
diff --git a/extensions/browser/guest_view/web_view/web_view_guest.h b/extensions/browser/guest_view/web_view/web_view_guest.h index 848f34b..3954047 100644 --- a/extensions/browser/guest_view/web_view/web_view_guest.h +++ b/extensions/browser/guest_view/web_view/web_view_guest.h
@@ -40,6 +40,9 @@ // a particular <webview>. class WebViewGuest : public guest_view::GuestView<WebViewGuest> { public: + WebViewGuest(const WebViewGuest&) = delete; + WebViewGuest& operator=(const WebViewGuest&) = delete; + // Clean up state when this GuestView is being destroyed. See // GuestViewBase::CleanUp(). static void CleanUp(content::BrowserContext* browser_context, @@ -394,8 +397,6 @@ // This is used to ensure pending tasks will not fire after this object is // destroyed. base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(WebViewGuest); }; } // namespace extensions
diff --git a/extensions/browser/guest_view/web_view/web_view_renderer_state.h b/extensions/browser/guest_view/web_view/web_view_renderer_state.h index ad8f1a8..4510502 100644 --- a/extensions/browser/guest_view/web_view/web_view_renderer_state.h +++ b/extensions/browser/guest_view/web_view/web_view_renderer_state.h
@@ -41,6 +41,9 @@ ~WebViewInfo(); }; + WebViewRendererState(const WebViewRendererState&) = delete; + WebViewRendererState& operator=(const WebViewRendererState&) = delete; + static WebViewRendererState* GetInstance(); // Looks up the information for the embedder WebView for a RenderViewHost, @@ -104,8 +107,6 @@ mutable base::Lock web_view_info_map_lock_; WebViewPartitionIDMap web_view_partition_id_map_; mutable base::Lock web_view_partition_id_map_lock_; - - DISALLOW_COPY_AND_ASSIGN(WebViewRendererState); }; } // namespace extensions
diff --git a/extensions/browser/image_sanitizer_unittest.cc b/extensions/browser/image_sanitizer_unittest.cc index a3229d5..3682b7d 100644 --- a/extensions/browser/image_sanitizer_unittest.cc +++ b/extensions/browser/image_sanitizer_unittest.cc
@@ -69,6 +69,9 @@ public: ImageSanitizerTest() = default; + ImageSanitizerTest(const ImageSanitizerTest&) = delete; + ImageSanitizerTest& operator=(const ImageSanitizerTest&) = delete; + protected: void CreateValidImage(const base::FilePath::StringPieceType& file_name) { ASSERT_TRUE(WriteBase64DataToFile(kBase64edValidPng, file_name)); @@ -187,8 +190,6 @@ std::map<base::FilePath, SkBitmap> decoded_images_; bool done_callback_called_ = false; bool decoded_image_callback_called_ = false; - - DISALLOW_COPY_AND_ASSIGN(ImageSanitizerTest); }; } // namespace
diff --git a/extensions/browser/json_file_sanitizer_unittest.cc b/extensions/browser/json_file_sanitizer_unittest.cc index addabcd..81e9494 100644 --- a/extensions/browser/json_file_sanitizer_unittest.cc +++ b/extensions/browser/json_file_sanitizer_unittest.cc
@@ -25,6 +25,9 @@ public: JsonFileSanitizerTest() {} + JsonFileSanitizerTest(const JsonFileSanitizerTest&) = delete; + JsonFileSanitizerTest& operator=(const JsonFileSanitizerTest&) = delete; + protected: base::FilePath CreateFilePath(const base::FilePath::StringType& file_name) { return temp_dir_.GetPath().Append(file_name); @@ -84,8 +87,6 @@ base::OnceClosure done_callback_; std::unique_ptr<JsonFileSanitizer> sanitizer_; base::ScopedTempDir temp_dir_; - - DISALLOW_COPY_AND_ASSIGN(JsonFileSanitizerTest); }; } // namespace
diff --git a/extensions/browser/lazy_background_task_queue_factory.h b/extensions/browser/lazy_background_task_queue_factory.h index 9bec272..28b3b58 100644 --- a/extensions/browser/lazy_background_task_queue_factory.h +++ b/extensions/browser/lazy_background_task_queue_factory.h
@@ -16,6 +16,11 @@ class LazyBackgroundTaskQueueFactory : public BrowserContextKeyedServiceFactory { public: + LazyBackgroundTaskQueueFactory(const LazyBackgroundTaskQueueFactory&) = + delete; + LazyBackgroundTaskQueueFactory& operator=( + const LazyBackgroundTaskQueueFactory&) = delete; + static LazyBackgroundTaskQueue* GetForBrowserContext( content::BrowserContext* context); static LazyBackgroundTaskQueueFactory* GetInstance(); @@ -31,8 +36,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(LazyBackgroundTaskQueueFactory); }; } // namespace extensions
diff --git a/extensions/browser/mojo/keep_alive_impl.h b/extensions/browser/mojo/keep_alive_impl.h index 047370a..261b1d3 100644 --- a/extensions/browser/mojo/keep_alive_impl.h +++ b/extensions/browser/mojo/keep_alive_impl.h
@@ -31,6 +31,9 @@ public ExtensionRegistryObserver, public ProcessManagerObserver { public: + KeepAliveImpl(const KeepAliveImpl&) = delete; + KeepAliveImpl& operator=(const KeepAliveImpl&) = delete; + // Create a keep alive for |extension| running in |context| and connect it to // |receiver|. When the receiver closes its pipe, the keep alive ends. static void Create(content::BrowserContext* browser_context, @@ -63,8 +66,6 @@ base::ScopedObservation<ProcessManager, ProcessManagerObserver> process_manager_observation_{this}; mojo::Receiver<KeepAlive> receiver_; - - DISALLOW_COPY_AND_ASSIGN(KeepAliveImpl); }; } // namespace extensions
diff --git a/extensions/browser/process_manager_factory.h b/extensions/browser/process_manager_factory.h index 3589d207..673f6ff 100644 --- a/extensions/browser/process_manager_factory.h +++ b/extensions/browser/process_manager_factory.h
@@ -15,6 +15,9 @@ class ProcessManagerFactory : public BrowserContextKeyedServiceFactory { public: + ProcessManagerFactory(const ProcessManagerFactory&) = delete; + ProcessManagerFactory& operator=(const ProcessManagerFactory&) = delete; + static ProcessManager* GetForBrowserContext(content::BrowserContext* context); // Returns NULL if there is no ProcessManager associated with this context. static ProcessManager* GetForBrowserContextIfExists( @@ -32,8 +35,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(ProcessManagerFactory); }; } // namespace extensions
diff --git a/extensions/browser/process_map.cc b/extensions/browser/process_map.cc index 7423a85..ce4eb21 100644 --- a/extensions/browser/process_map.cc +++ b/extensions/browser/process_map.cc
@@ -24,6 +24,9 @@ process_id(process_id), site_instance_id(site_instance_id) {} + Item(const Item&) = delete; + Item& operator=(const Item&) = delete; + ~Item() { } @@ -39,9 +42,6 @@ std::string extension_id; int process_id = 0; content::SiteInstanceId site_instance_id; - - private: - DISALLOW_COPY_AND_ASSIGN(Item); };
diff --git a/extensions/browser/process_map_factory.h b/extensions/browser/process_map_factory.h index 53509efddf..5ede0bf1 100644 --- a/extensions/browser/process_map_factory.h +++ b/extensions/browser/process_map_factory.h
@@ -18,6 +18,9 @@ // incognito browser context and its original browser context. class ProcessMapFactory : public BrowserContextKeyedServiceFactory { public: + ProcessMapFactory(const ProcessMapFactory&) = delete; + ProcessMapFactory& operator=(const ProcessMapFactory&) = delete; + static ProcessMap* GetForBrowserContext(content::BrowserContext* context); static ProcessMapFactory* GetInstance(); @@ -33,9 +36,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - private: - DISALLOW_COPY_AND_ASSIGN(ProcessMapFactory); }; } // namespace extensions
diff --git a/extensions/browser/quota_service.h b/extensions/browser/quota_service.h index 79a338e..a31c351 100644 --- a/extensions/browser/quota_service.h +++ b/extensions/browser/quota_service.h
@@ -126,6 +126,10 @@ class Bucket { public: Bucket() : num_tokens_(0) {} + + Bucket(const Bucket&) = delete; + Bucket& operator=(const Bucket&) = delete; + // Removes a token from this bucket, and returns true if the bucket had // any tokens in the first place. bool DeductToken() { return num_tokens_-- > 0; } @@ -145,7 +149,6 @@ private: base::TimeTicks expiration_; int64_t num_tokens_; - DISALLOW_COPY_AND_ASSIGN(Bucket); }; using BucketList = std::list<Bucket*>; @@ -185,6 +188,10 @@ QuotaLimitHeuristic(const Config& config, std::unique_ptr<BucketMapper> map, const std::string& name); + + QuotaLimitHeuristic(const QuotaLimitHeuristic&) = delete; + QuotaLimitHeuristic& operator=(const QuotaLimitHeuristic&) = delete; + virtual ~QuotaLimitHeuristic(); // Determines if sufficient quota exists (according to the Apply @@ -214,8 +221,6 @@ // The name of the heuristic for formatting error messages. std::string name_; - - DISALLOW_COPY_AND_ASSIGN(QuotaLimitHeuristic); }; // A simple per-item heuristic to limit the number of events that can occur in
diff --git a/extensions/browser/renderer_startup_helper.h b/extensions/browser/renderer_startup_helper.h index b56d537..cccc3b49 100644 --- a/extensions/browser/renderer_startup_helper.h +++ b/extensions/browser/renderer_startup_helper.h
@@ -120,6 +120,10 @@ // compiler generate another object file. class RendererStartupHelperFactory : public BrowserContextKeyedServiceFactory { public: + RendererStartupHelperFactory(const RendererStartupHelperFactory&) = delete; + RendererStartupHelperFactory& operator=(const RendererStartupHelperFactory&) = + delete; + static RendererStartupHelper* GetForBrowserContext( content::BrowserContext* context); static RendererStartupHelperFactory* GetInstance(); @@ -136,8 +140,6 @@ content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; bool ServiceIsCreatedWithBrowserContext() const override; - - DISALLOW_COPY_AND_ASSIGN(RendererStartupHelperFactory); }; } // namespace extensions
diff --git a/extensions/browser/sandboxed_unpacker.h b/extensions/browser/sandboxed_unpacker.h index ead646a..779647c 100644 --- a/extensions/browser/sandboxed_unpacker.h +++ b/extensions/browser/sandboxed_unpacker.h
@@ -157,6 +157,9 @@ const scoped_refptr<base::SequencedTaskRunner>& unpacker_io_task_runner, SandboxedUnpackerClient* client); + SandboxedUnpacker(const SandboxedUnpacker&) = delete; + SandboxedUnpacker& operator=(const SandboxedUnpacker&) = delete; + // Start processing the extension, either from a CRX file or already unzipped // in a directory. The client is called with the results. The directory form // requires the id and base64-encoded public key (for insertion into the @@ -337,8 +340,6 @@ // Used during the message catalog rewriting phase to sanitize the extension // provided message catalogs. std::unique_ptr<JsonFileSanitizer> json_file_sanitizer_; - - DISALLOW_COPY_AND_ASSIGN(SandboxedUnpacker); }; } // namespace extensions
diff --git a/extensions/browser/script_executor.cc b/extensions/browser/script_executor.cc index 55ee136..b5b8c8d 100644 --- a/extensions/browser/script_executor.cc +++ b/extensions/browser/script_executor.cc
@@ -118,6 +118,9 @@ Finish(); } + Handler(const Handler&) = delete; + Handler& operator=(const Handler&) = delete; + private: // This class manages its own lifetime. ~Handler() override {} @@ -260,8 +263,6 @@ ScriptExecutor::ScriptFinishedCallback callback_; base::WeakPtrFactory<Handler> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(Handler); }; } // namespace
diff --git a/extensions/browser/service_worker/worker_id_set_unittest.cc b/extensions/browser/service_worker/worker_id_set_unittest.cc index 774a3de..514cd80 100644 --- a/extensions/browser/service_worker/worker_id_set_unittest.cc +++ b/extensions/browser/service_worker/worker_id_set_unittest.cc
@@ -89,6 +89,9 @@ public: WorkerIdSetTest() = default; + WorkerIdSetTest(const WorkerIdSetTest&) = delete; + WorkerIdSetTest& operator=(const WorkerIdSetTest&) = delete; + bool AreWorkerIdsEqual(const std::vector<WorkerId>& expected, const std::vector<WorkerId>& actual) { if (expected.size() != actual.size()) @@ -100,9 +103,6 @@ std::sort(actual_copy.begin(), actual_copy.end()); return expected_copy == actual_copy; } - - private: - DISALLOW_COPY_AND_ASSIGN(WorkerIdSetTest); }; TEST_F(WorkerIdSetTest, GetAllForExtension) {
diff --git a/extensions/browser/service_worker_task_queue_factory.h b/extensions/browser/service_worker_task_queue_factory.h index 0a78b5f..3c7ed06 100644 --- a/extensions/browser/service_worker_task_queue_factory.h +++ b/extensions/browser/service_worker_task_queue_factory.h
@@ -15,6 +15,10 @@ class ServiceWorkerTaskQueueFactory : public BrowserContextKeyedServiceFactory { public: + ServiceWorkerTaskQueueFactory(const ServiceWorkerTaskQueueFactory&) = delete; + ServiceWorkerTaskQueueFactory& operator=( + const ServiceWorkerTaskQueueFactory&) = delete; + static ServiceWorkerTaskQueue* GetForBrowserContext( content::BrowserContext* context); static ServiceWorkerTaskQueueFactory* GetInstance(); @@ -30,8 +34,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(ServiceWorkerTaskQueueFactory); }; } // namespace extensions
diff --git a/extensions/browser/test_event_router.h b/extensions/browser/test_event_router.h index 82c13094..2d3d61e 100644 --- a/extensions/browser/test_event_router.h +++ b/extensions/browser/test_event_router.h
@@ -36,6 +36,10 @@ }; explicit TestEventRouter(content::BrowserContext* context); + + TestEventRouter(const TestEventRouter&) = delete; + TestEventRouter& operator=(const TestEventRouter&) = delete; + ~TestEventRouter() override; // Returns the number of times an event has been broadcast or dispatched. @@ -64,8 +68,6 @@ std::map<std::string, int> seen_events_; base::ObserverList<EventObserver, false>::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(TestEventRouter); }; // Creates and enables a TestEventRouter for testing. Callers can override T to
diff --git a/extensions/browser/test_extension_registry_observer.cc b/extensions/browser/test_extension_registry_observer.cc index b5558fb..a6c0d48 100644 --- a/extensions/browser/test_extension_registry_observer.cc +++ b/extensions/browser/test_extension_registry_observer.cc
@@ -15,6 +15,9 @@ public: Waiter() : observed_(false), extension_(nullptr) {} + Waiter(const Waiter&) = delete; + Waiter& operator=(const Waiter&) = delete; + scoped_refptr<const Extension> Wait() { if (!observed_) run_loop_.Run(); @@ -31,8 +34,6 @@ bool observed_; base::RunLoop run_loop_; scoped_refptr<const Extension> extension_; - - DISALLOW_COPY_AND_ASSIGN(Waiter); }; TestExtensionRegistryObserver::TestExtensionRegistryObserver(
diff --git a/extensions/browser/updater/extension_installer.h b/extensions/browser/updater/extension_installer.h index f148d39..ec2f4b4c 100644 --- a/extensions/browser/updater/extension_installer.h +++ b/extensions/browser/updater/extension_installer.h
@@ -41,6 +41,9 @@ bool install_immediately, ExtensionInstallerCallback extension_installer_callback); + ExtensionInstaller(const ExtensionInstaller&) = delete; + ExtensionInstaller& operator=(const ExtensionInstaller&) = delete; + // update_client::CrxInstaller:: void OnUpdateError(int error) override; @@ -67,8 +70,6 @@ base::FilePath extension_root_; bool install_immediately_; ExtensionInstallerCallback extension_installer_callback_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionInstaller); }; } // namespace extensions
diff --git a/extensions/browser/updater/update_data_provider.h b/extensions/browser/updater/update_data_provider.h index 383d0ab..8b143ef 100644 --- a/extensions/browser/updater/update_data_provider.h +++ b/extensions/browser/updater/update_data_provider.h
@@ -43,6 +43,9 @@ // an update for an extension. explicit UpdateDataProvider(content::BrowserContext* browser_context); + UpdateDataProvider(const UpdateDataProvider&) = delete; + UpdateDataProvider& operator=(const UpdateDataProvider&) = delete; + // Notify this object that the associated browser context is being shut down // the pointer to the context should be dropped and no more work should be // done. @@ -65,8 +68,6 @@ UpdateClientCallback update_client_callback); content::BrowserContext* browser_context_; - - DISALLOW_COPY_AND_ASSIGN(UpdateDataProvider); }; } // namespace extensions
diff --git a/extensions/browser/updater/update_service.h b/extensions/browser/updater/update_service.h index 046fd46..c204aef 100644 --- a/extensions/browser/updater/update_service.h +++ b/extensions/browser/updater/update_service.h
@@ -44,6 +44,9 @@ class UpdateService : public KeyedService, update_client::UpdateClient::Observer { public: + UpdateService(const UpdateService&) = delete; + UpdateService& operator=(const UpdateService&) = delete; + static UpdateService* Get(content::BrowserContext* context); static void SupplyUpdateServiceForTest(UpdateService* service); @@ -114,8 +117,6 @@ // used to create WeakPtrs to |this|. base::WeakPtrFactory<UpdateService> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(UpdateService); }; } // namespace extensions
diff --git a/extensions/browser/updater/update_service_factory.h b/extensions/browser/updater/update_service_factory.h index 521070a..23a865c 100644 --- a/extensions/browser/updater/update_service_factory.h +++ b/extensions/browser/updater/update_service_factory.h
@@ -17,6 +17,9 @@ // Note that OTR browser contexts do not get an UpdateService. class UpdateServiceFactory : public BrowserContextKeyedServiceFactory { public: + UpdateServiceFactory(const UpdateServiceFactory&) = delete; + UpdateServiceFactory& operator=(const UpdateServiceFactory&) = delete; + static UpdateService* GetForBrowserContext(content::BrowserContext* context); static UpdateServiceFactory* GetInstance(); @@ -29,8 +32,6 @@ // BrowserContextKeyedServiceFactory: KeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(UpdateServiceFactory); }; } // namespace extensions
diff --git a/extensions/browser/updater/update_service_unittest.cc b/extensions/browser/updater/update_service_unittest.cc index 1f7091f..d5fb315 100644 --- a/extensions/browser/updater/update_service_unittest.cc +++ b/extensions/browser/updater/update_service_unittest.cc
@@ -54,6 +54,9 @@ public: FakeUpdateClient(); + FakeUpdateClient(const FakeUpdateClient&) = delete; + FakeUpdateClient& operator=(const FakeUpdateClient&) = delete; + // Returns the data we've gotten from the CrxDataCallback for ids passed to // the Update function. std::vector<absl::optional<update_client::CrxComponent>>* data() { @@ -159,9 +162,6 @@ bool is_malware_update_item_ = false; extensions::AllowlistState allowlist_state = extensions::ALLOWLIST_UNDEFINED; std::vector<UpdateRequest> delayed_requests_; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeUpdateClient); }; FakeUpdateClient::FakeUpdateClient() : delay_update_(false) {}
diff --git a/extensions/browser/url_loader_factory_manager.h b/extensions/browser/url_loader_factory_manager.h index 6fd828b..315189cc 100644 --- a/extensions/browser/url_loader_factory_manager.h +++ b/extensions/browser/url_loader_factory_manager.h
@@ -35,6 +35,8 @@ public: // Only static methods. URLLoaderFactoryManager() = delete; + URLLoaderFactoryManager(const URLLoaderFactoryManager&) = delete; + URLLoaderFactoryManager& operator=(const URLLoaderFactoryManager&) = delete; // Invoked when `navigation` is ready to commit with the set of `extensions` // asked to inject content script into the target frame using @@ -96,9 +98,6 @@ const url::Origin& origin, bool is_for_isolated_world, network::mojom::URLLoaderFactoryParams* factory_params); - - private: - DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryManager); }; } // namespace extensions
diff --git a/extensions/browser/warning_service_factory.h b/extensions/browser/warning_service_factory.h index 22b198d..e5e2e988 100644 --- a/extensions/browser/warning_service_factory.h +++ b/extensions/browser/warning_service_factory.h
@@ -15,6 +15,9 @@ class WarningServiceFactory : public BrowserContextKeyedServiceFactory { public: + WarningServiceFactory(const WarningServiceFactory&) = delete; + WarningServiceFactory& operator=(const WarningServiceFactory&) = delete; + static WarningService* GetForBrowserContext(content::BrowserContext* context); static WarningServiceFactory* GetInstance(); @@ -29,8 +32,6 @@ content::BrowserContext* context) const override; content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; - - DISALLOW_COPY_AND_ASSIGN(WarningServiceFactory); }; } // namespace extensions
diff --git a/extensions/browser/zipfile_installer.h b/extensions/browser/zipfile_installer.h index 0ac02499..175529a 100644 --- a/extensions/browser/zipfile_installer.h +++ b/extensions/browser/zipfile_installer.h
@@ -33,6 +33,9 @@ const base::FilePath& unzip_dir, const std::string& error)>; + ZipFileInstaller(const ZipFileInstaller&) = delete; + ZipFileInstaller& operator=(const ZipFileInstaller&) = delete; + // Creates a ZipFileInstaller that invokes |done_callback| when done. static scoped_refptr<ZipFileInstaller> Create( const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, @@ -88,8 +91,6 @@ scoped_refptr<base::SequencedTaskRunner> io_task_runner_; SEQUENCE_CHECKER(sequence_checker_); - - DISALLOW_COPY_AND_ASSIGN(ZipFileInstaller); }; } // namespace extensions
diff --git a/extensions/common/api/_api_features.json b/extensions/common/api/_api_features.json index 7de44df..62f6e52 100644 --- a/extensions/common/api/_api_features.json +++ b/extensions/common/api/_api_features.json
@@ -317,19 +317,20 @@ "matches": [ "chrome://bookmarks/*", "chrome://download-shelf.top-chrome/*", + "chrome://eche-app/*", "chrome://extensions/*", - "chrome://new-tab-page/*", - "chrome://os-settings/*", - "chrome://settings/*", - "chrome://sync-confirmation/*", - "chrome://read-later.top-chrome/*", - "chrome://tab-search.top-chrome/*", - "chrome://tab-strip.top-chrome/*", - "chrome://welcome/*", - "chrome://profile-picker/*", "chrome://file-manager/*", "chrome://help-app/*", - "chrome://eche-app/*" + "chrome://history/*", + "chrome://new-tab-page/*", + "chrome://os-settings/*", + "chrome://profile-picker/*", + "chrome://read-later.top-chrome/*", + "chrome://settings/*", + "chrome://sync-confirmation/*", + "chrome://tab-search.top-chrome/*", + "chrome://tab-strip.top-chrome/*", + "chrome://welcome/*" ] }, { "channel": "stable", @@ -580,7 +581,6 @@ "contexts": ["blessed_extension", "unblessed_extension", "content_script"] }, "storage.session": { - "channel": "canary", "min_manifest_version": 3 }, "system.cpu": {
diff --git a/extensions/common/api/declarative/declarative_manifest_data.cc b/extensions/common/api/declarative/declarative_manifest_data.cc index 5d9b464..e75804a 100644 --- a/extensions/common/api/declarative/declarative_manifest_data.cc +++ b/extensions/common/api/declarative/declarative_manifest_data.cc
@@ -21,6 +21,9 @@ public: explicit ErrorBuilder(std::u16string* error) : error_(error) {} + ErrorBuilder(const ErrorBuilder&) = delete; + ErrorBuilder& operator=(const ErrorBuilder&) = delete; + // Appends a literal string |error|. void Append(base::StringPiece error) { if (!error_->empty()) @@ -35,7 +38,6 @@ private: std::u16string* const error_; - DISALLOW_COPY_AND_ASSIGN(ErrorBuilder); }; // Converts a rule defined in the manifest into a JSON internal format. The
diff --git a/extensions/common/api/declarative_net_request/dnr_manifest_data.h b/extensions/common/api/declarative_net_request/dnr_manifest_data.h index 9d1746d..a037a5b 100644 --- a/extensions/common/api/declarative_net_request/dnr_manifest_data.h +++ b/extensions/common/api/declarative_net_request/dnr_manifest_data.h
@@ -52,6 +52,10 @@ using ManifestIDToRulesetMap = std::map<std::string, const RulesetInfo*>; explicit DNRManifestData(std::vector<RulesetInfo> ruleset); + + DNRManifestData(const DNRManifestData&) = delete; + DNRManifestData& operator=(const DNRManifestData&) = delete; + ~DNRManifestData() override; // Returns the RulesetInfo for the |extension|. For an extension, which didn't @@ -73,8 +77,6 @@ // Map from the manifest ID to the corresponding RulesetInfo. ManifestIDToRulesetMap manifest_id_to_ruleset_map; - - DISALLOW_COPY_AND_ASSIGN(DNRManifestData); }; } // namespace declarative_net_request
diff --git a/extensions/common/api/declarative_net_request/dnr_manifest_unittest.cc b/extensions/common/api/declarative_net_request/dnr_manifest_unittest.cc index 15f4b5b..5ad57fe 100644 --- a/extensions/common/api/declarative_net_request/dnr_manifest_unittest.cc +++ b/extensions/common/api/declarative_net_request/dnr_manifest_unittest.cc
@@ -41,6 +41,9 @@ public: DNRManifestTest() = default; + DNRManifestTest(const DNRManifestTest&) = delete; + DNRManifestTest& operator=(const DNRManifestTest&) = delete; + protected: // Loads the extension and verifies the |expected_error|. void LoadAndExpectError(const std::string& expected_error) { @@ -111,8 +114,6 @@ private: base::ScopedTempDir temp_dir_; - - DISALLOW_COPY_AND_ASSIGN(DNRManifestTest); }; TEST_F(DNRManifestTest, EmptyRuleset) {
diff --git a/extensions/common/csp_validator.cc b/extensions/common/csp_validator.cc index b81acca..8e6a55e 100644 --- a/extensions/common/csp_validator.cc +++ b/extensions/common/csp_validator.cc
@@ -115,7 +115,10 @@ DirectiveStatus(std::initializer_list<const char*> directives) : directive_names_(directives.begin(), directives.end()) {} + DirectiveStatus(const DirectiveStatus&) = delete; DirectiveStatus(DirectiveStatus&&) = default; + + DirectiveStatus& operator=(const DirectiveStatus&) = delete; DirectiveStatus& operator=(DirectiveStatus&&) = default; // Returns true if |directive_name| matches this DirectiveStatus. @@ -140,8 +143,6 @@ std::vector<std::string> directive_names_; // Whether or not we've seen any directive name that matches |this|. bool seen_in_policy_ = false; - - DISALLOW_COPY_AND_ASSIGN(DirectiveStatus); }; // Returns whether |url| starts with |scheme_and_separator| and does not have a @@ -328,6 +329,9 @@ explicit CSPDirectiveToken(const Directive& directive) : directive_(directive) {} + CSPDirectiveToken(const CSPDirectiveToken&) = delete; + CSPDirectiveToken& operator=(const CSPDirectiveToken&) = delete; + // Returns true if this token affects |status|. In that case, the token's // directive values are secured by |secure_function|. bool MatchAndUpdateStatus(DirectiveStatus* status, @@ -360,8 +364,6 @@ private: const Directive& directive_; absl::optional<std::string> secure_value_; - - DISALLOW_COPY_AND_ASSIGN(CSPDirectiveToken); }; // Class responsible for parsing a given CSP string |policy|, and enforcing @@ -483,6 +485,9 @@ secure_directives_.emplace_back(new DirectiveStatus({kObjectSrc})); } + ExtensionCSPEnforcer(const ExtensionCSPEnforcer&) = delete; + ExtensionCSPEnforcer& operator=(const ExtensionCSPEnforcer&) = delete; + protected: std::string GetDefaultCSPValue(const DirectiveStatus& status) override { if (status.Matches(kObjectSrc)) @@ -490,9 +495,6 @@ DCHECK(status.Matches(kScriptSrc)); return kScriptSrcDefaultDirective; } - - private: - DISALLOW_COPY_AND_ASSIGN(ExtensionCSPEnforcer); }; class AppSandboxPageCSPEnforcer : public CSPEnforcer { @@ -506,6 +508,10 @@ secure_directives_.emplace_back(new DirectiveStatus({kScriptSrc})); } + AppSandboxPageCSPEnforcer(const AppSandboxPageCSPEnforcer&) = delete; + AppSandboxPageCSPEnforcer& operator=(const AppSandboxPageCSPEnforcer&) = + delete; + protected: std::string GetDefaultCSPValue(const DirectiveStatus& status) override { if (status.Matches(kChildSrc)) @@ -513,9 +519,6 @@ DCHECK(status.Matches(kScriptSrc)); return kAppSandboxScriptSrcDefaultDirective; } - - private: - DISALLOW_COPY_AND_ASSIGN(AppSandboxPageCSPEnforcer); }; } // namespace
diff --git a/extensions/common/extension.h b/extensions/common/extension.h index db4ac880..257cb73 100644 --- a/extensions/common/extension.h +++ b/extensions/common/extension.h
@@ -156,6 +156,9 @@ // This is the highest bit index of the flags defined above. static const int kInitFromValueFlagBits; + Extension(const Extension&) = delete; + Extension& operator=(const Extension&) = delete; + static scoped_refptr<Extension> Create(const base::FilePath& path, mojom::ManifestLocation location, const base::DictionaryValue& value, @@ -471,8 +474,6 @@ // A dynamic ID that can be used when referencing extension resources via URL // instead of an extension ID. base::GUID guid_; - - DISALLOW_COPY_AND_ASSIGN(Extension); }; typedef std::vector<scoped_refptr<const Extension> > ExtensionList; @@ -483,6 +484,8 @@ const ExtensionId& id, const base::FilePath& path, mojom::ManifestLocation location); + ExtensionInfo(const ExtensionInfo&) = delete; + ExtensionInfo& operator=(const ExtensionInfo&) = delete; ~ExtensionInfo(); // Note: This may be null (e.g. for unpacked extensions retrieved from the @@ -492,9 +495,6 @@ ExtensionId extension_id; base::FilePath extension_path; mojom::ManifestLocation extension_location; - - private: - DISALLOW_COPY_AND_ASSIGN(ExtensionInfo); }; // The details sent for EXTENSION_PERMISSIONS_UPDATED notifications.
diff --git a/extensions/common/extension_api.h b/extensions/common/extension_api.h index 9f101b3..dad2240 100644 --- a/extensions/common/extension_api.h +++ b/extensions/common/extension_api.h
@@ -80,6 +80,10 @@ // Creates a completely clean instance. Configure using // RegisterDependencyProvider before use. ExtensionAPI(); + + ExtensionAPI(const ExtensionAPI&) = delete; + ExtensionAPI& operator=(const ExtensionAPI&) = delete; + virtual ~ExtensionAPI(); // Add a FeatureProvider for APIs. The features are used to specify @@ -186,8 +190,6 @@ // FeatureProviders used for resolving dependencies. typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; FeatureProviderMap dependency_providers_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); }; } // namespace extensions
diff --git a/extensions/common/extension_set.h b/extensions/common/extension_set.h index afe1d802..6ae49a5 100644 --- a/extensions/common/extension_set.h +++ b/extensions/common/extension_set.h
@@ -62,6 +62,10 @@ }; ExtensionSet(); + + ExtensionSet(const ExtensionSet&) = delete; + ExtensionSet& operator=(const ExtensionSet&) = delete; + ~ExtensionSet(); size_t size() const; @@ -137,8 +141,6 @@ private: ExtensionMap extensions_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionSet); }; } // namespace extensions
diff --git a/extensions/common/feature_switch.h b/extensions/common/feature_switch.h index cddeae1..691cff33 100644 --- a/extensions/common/feature_switch.h +++ b/extensions/common/feature_switch.h
@@ -66,6 +66,9 @@ const char* switch_name, DefaultValue default_value); + FeatureSwitch(const FeatureSwitch&) = delete; + FeatureSwitch& operator=(const FeatureSwitch&) = delete; + // Consider using ScopedOverride instead. void SetOverrideValue(OverrideValue value); OverrideValue GetOverrideValue() const; @@ -83,8 +86,6 @@ bool default_value_; OverrideValue override_value_; mutable absl::optional<bool> cached_value_; - - DISALLOW_COPY_AND_ASSIGN(FeatureSwitch); }; } // namespace extensions
diff --git a/extensions/common/features/feature_provider.cc b/extensions/common/features/feature_provider.cc index 4b749ba..1e3b6233 100644 --- a/extensions/common/features/feature_provider.cc +++ b/extensions/common/features/feature_provider.cc
@@ -73,6 +73,9 @@ } } + FeatureProviderStatic(const FeatureProviderStatic&) = delete; + FeatureProviderStatic& operator=(const FeatureProviderStatic&) = delete; + FeatureProvider* GetFeatures(const std::string& name) const { auto it = feature_providers_.find(name); if (it == feature_providers_.end()) @@ -82,8 +85,6 @@ private: std::map<std::string, std::unique_ptr<FeatureProvider>> feature_providers_; - - DISALLOW_COPY_AND_ASSIGN(FeatureProviderStatic); }; base::LazyInstance<FeatureProviderStatic>::Leaky g_feature_provider_static =
diff --git a/extensions/common/features/simple_feature.h b/extensions/common/features/simple_feature.h index 928875c..0c6abfc 100644 --- a/extensions/common/features/simple_feature.h +++ b/extensions/common/features/simple_feature.h
@@ -51,6 +51,10 @@ }; SimpleFeature(); + + SimpleFeature(const SimpleFeature&) = delete; + SimpleFeature& operator=(const SimpleFeature&) = delete; + ~SimpleFeature() override; Availability IsAvailableToContext(const Extension* extension, @@ -256,8 +260,6 @@ bool component_extensions_auto_granted_; bool is_internal_; bool disallow_for_service_workers_; - - DISALLOW_COPY_AND_ASSIGN(SimpleFeature); }; } // namespace extensions
diff --git a/extensions/common/features/simple_feature_unittest.cc b/extensions/common/features/simple_feature_unittest.cc index 558f445..aaa77c8b 100644 --- a/extensions/common/features/simple_feature_unittest.cc +++ b/extensions/common/features/simple_feature_unittest.cc
@@ -68,6 +68,10 @@ } // namespace class SimpleFeatureTest : public testing::Test { + public: + SimpleFeatureTest(const SimpleFeatureTest&) = delete; + SimpleFeatureTest& operator=(const SimpleFeatureTest&) = delete; + protected: SimpleFeatureTest() : current_channel_(Channel::UNKNOWN) {} bool LocationIsAvailable(SimpleFeature::Location feature_location, @@ -85,7 +89,6 @@ private: ScopedCurrentChannel current_channel_; - DISALLOW_COPY_AND_ASSIGN(SimpleFeatureTest); }; TEST_F(SimpleFeatureTest, IsAvailableNullCase) {
diff --git a/extensions/common/install_warning.h b/extensions/common/install_warning.h index be1937e..271f492 100644 --- a/extensions/common/install_warning.h +++ b/extensions/common/install_warning.h
@@ -21,6 +21,7 @@ InstallWarning(const std::string& message, const std::string& key, const std::string& specific); + InstallWarning(const InstallWarning&) = delete; InstallWarning(InstallWarning&& other); InstallWarning& operator=(InstallWarning&& other); ~InstallWarning(); @@ -42,8 +43,6 @@ // Optional - for specifying the incorrect portion of a key in the manifest // (e.g., an unrecognized permission "foo" in "permissions"). std::string specific; - - DISALLOW_COPY(InstallWarning); }; // Let gtest print InstallWarnings.
diff --git a/extensions/common/manifest_handler.h b/extensions/common/manifest_handler.h index c396e79..5b0c38a9 100644 --- a/extensions/common/manifest_handler.h +++ b/extensions/common/manifest_handler.h
@@ -122,6 +122,9 @@ // The global registry for manifest handlers. class ManifestHandlerRegistry { public: + ManifestHandlerRegistry(const ManifestHandlerRegistry&) = delete; + ManifestHandlerRegistry& operator=(const ManifestHandlerRegistry&) = delete; + // Get the one true instance. static ManifestHandlerRegistry* Get(); @@ -198,8 +201,6 @@ ManifestHandlerPriorityMap priority_map_; bool is_finalized_; - - DISALLOW_COPY_AND_ASSIGN(ManifestHandlerRegistry); }; } // namespace extensions
diff --git a/extensions/common/manifest_handlers/icons_handler_unittest.cc b/extensions/common/manifest_handlers/icons_handler_unittest.cc index b6a28b4..ab83b1a 100644 --- a/extensions/common/manifest_handlers/icons_handler_unittest.cc +++ b/extensions/common/manifest_handlers/icons_handler_unittest.cc
@@ -14,6 +14,9 @@ public: ProductIconManifestTest() = default; + ProductIconManifestTest(const ProductIconManifestTest&) = delete; + ProductIconManifestTest& operator=(const ProductIconManifestTest&) = delete; + protected: base::Value CreateManifest(const std::string& extra_icons) { constexpr const char kManifest[] = R"({ @@ -31,9 +34,6 @@ EXPECT_TRUE(manifest.is_dict()); return manifest; } - - private: - DISALLOW_COPY_AND_ASSIGN(ProductIconManifestTest); }; TEST_F(ProductIconManifestTest, Sizes) {
diff --git a/extensions/common/permissions/mock_manifest_permission.h b/extensions/common/permissions/mock_manifest_permission.h index f7ddba1..8a6553d 100644 --- a/extensions/common/permissions/mock_manifest_permission.h +++ b/extensions/common/permissions/mock_manifest_permission.h
@@ -24,6 +24,9 @@ explicit MockManifestPermission(const std::string& name, const std::string& value); + MockManifestPermission(const MockManifestPermission&) = delete; + MockManifestPermission& operator=(const MockManifestPermission&) = delete; + std::string name() const override; std::string id() const override; @@ -44,8 +47,6 @@ std::string name_; // value_ is ignored for the Diff, Union and Intersect operations std::string value_; - - DISALLOW_COPY_AND_ASSIGN(MockManifestPermission); }; } // namespace extensions
diff --git a/extensions/common/permissions/permission_set.h b/extensions/common/permissions/permission_set.h index 5ea42dc..7383d743 100644 --- a/extensions/common/permissions/permission_set.h +++ b/extensions/common/permissions/permission_set.h
@@ -40,6 +40,9 @@ ManifestPermissionSet manifest_permissions, URLPatternSet explicit_hosts, URLPatternSet scriptable_hosts); + + PermissionSet& operator=(const PermissionSet&) = delete; + ~PermissionSet(); PermissionSet(PermissionSet&& other); @@ -177,8 +180,6 @@ UNINITIALIZED; mutable ShouldWarnAllHostsType api_permissions_should_warn_all_hosts_ = UNINITIALIZED; - - DISALLOW_ASSIGN(PermissionSet); }; } // namespace extensions
diff --git a/extensions/common/permissions/permissions_data.cc b/extensions/common/permissions/permissions_data.cc index 8f050be..599814e 100644 --- a/extensions/common/permissions/permissions_data.cc +++ b/extensions/common/permissions/permissions_data.cc
@@ -67,10 +67,11 @@ DCHECK(!thread_checker || thread_checker->CalledOnValidThread()); } + AutoLockOnValidThread(const AutoLockOnValidThread&) = delete; + AutoLockOnValidThread& operator=(const AutoLockOnValidThread&) = delete; + private: base::AutoLock auto_lock_; - - DISALLOW_COPY_AND_ASSIGN(AutoLockOnValidThread); }; } // namespace
diff --git a/extensions/common/permissions/permissions_info.h b/extensions/common/permissions/permissions_info.h index 21ea8ad..bec0ccd 100644 --- a/extensions/common/permissions/permissions_info.h +++ b/extensions/common/permissions/permissions_info.h
@@ -30,6 +30,9 @@ // methods for accessing them. class PermissionsInfo { public: + PermissionsInfo(const PermissionsInfo&) = delete; + PermissionsInfo& operator=(const PermissionsInfo&) = delete; + static PermissionsInfo* GetInstance(); // Registers the permissions specified by |infos| along with the @@ -83,8 +86,6 @@ NameMap name_map_; size_t permission_count_; - - DISALLOW_COPY_AND_ASSIGN(PermissionsInfo); }; } // namespace extensions
diff --git a/extensions/common/user_script.h b/extensions/common/user_script.h index b570339..9028cfb 100644 --- a/extensions/common/user_script.h +++ b/extensions/common/user_script.h
@@ -110,6 +110,10 @@ // Constructor. Default the run location to document end, which is like // Greasemonkey and probably more useful for typical scripts. UserScript(); + + UserScript(const UserScript&) = delete; + UserScript& operator=(const UserScript&) = delete; + ~UserScript(); // Performs a copy of all fields except file contents. @@ -314,8 +318,6 @@ // True if the script should be injected into an incognito tab. bool incognito_enabled_ = false; - - DISALLOW_COPY_AND_ASSIGN(UserScript); }; using UserScriptList = std::vector<std::unique_ptr<UserScript>>;
diff --git a/extensions/renderer/api/automation/automation_internal_custom_bindings.cc b/extensions/renderer/api/automation/automation_internal_custom_bindings.cc index 7447b60..aab5bff 100644 --- a/extensions/renderer/api/automation/automation_internal_custom_bindings.cc +++ b/extensions/renderer/api/automation/automation_internal_custom_bindings.cc
@@ -551,6 +551,9 @@ content::RenderThread::Get()->AddFilter(this); } + AutomationMessageFilter(const AutomationMessageFilter&) = delete; + AutomationMessageFilter& operator=(const AutomationMessageFilter&) = delete; + void Detach() { owner_ = nullptr; Remove(); @@ -589,8 +592,6 @@ AutomationInternalCustomBindings* owner_; bool removed_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - - DISALLOW_COPY_AND_ASSIGN(AutomationMessageFilter); }; AutomationInternalCustomBindings::AutomationInternalCustomBindings(
diff --git a/extensions/renderer/api_definitions_natives.h b/extensions/renderer/api_definitions_natives.h index d40b60f..da5a8b2 100644 --- a/extensions/renderer/api_definitions_natives.h +++ b/extensions/renderer/api_definitions_natives.h
@@ -18,6 +18,9 @@ public: ApiDefinitionsNatives(Dispatcher* dispatcher, ScriptContext* context); + ApiDefinitionsNatives(const ApiDefinitionsNatives&) = delete; + ApiDefinitionsNatives& operator=(const ApiDefinitionsNatives&) = delete; + // ObjectBackedNativeHandler: void AddRoutes() override; @@ -28,8 +31,6 @@ // Not owned. Dispatcher* dispatcher_; - - DISALLOW_COPY_AND_ASSIGN(ApiDefinitionsNatives); }; } // namespace extensions
diff --git a/extensions/renderer/app_window_custom_bindings.h b/extensions/renderer/app_window_custom_bindings.h index 13d4b69..84d7cfd9 100644 --- a/extensions/renderer/app_window_custom_bindings.h +++ b/extensions/renderer/app_window_custom_bindings.h
@@ -16,14 +16,15 @@ public: AppWindowCustomBindings(ScriptContext* context); + AppWindowCustomBindings(const AppWindowCustomBindings&) = delete; + AppWindowCustomBindings& operator=(const AppWindowCustomBindings&) = delete; + // ObjectBackedNativeHandler: void AddRoutes() override; private: void GetFrame(const v8::FunctionCallbackInfo<v8::Value>& args); void ResumeParser(const v8::FunctionCallbackInfo<v8::Value>& args); - - DISALLOW_COPY_AND_ASSIGN(AppWindowCustomBindings); }; } // namespace extensions
diff --git a/extensions/renderer/bindings/api_binding_hooks.cc b/extensions/renderer/bindings/api_binding_hooks.cc index 2d17aa9..2fa599a 100644 --- a/extensions/renderer/bindings/api_binding_hooks.cc +++ b/extensions/renderer/bindings/api_binding_hooks.cc
@@ -28,6 +28,9 @@ explicit JSHookInterface(const std::string& api_name) : api_name_(api_name) {} + JSHookInterface(const JSHookInterface&) = delete; + JSHookInterface& operator=(const JSHookInterface&) = delete; + static gin::WrapperInfo kWrapperInfo; // gin::Wrappable: @@ -127,8 +130,6 @@ JSHooks pre_validation_hooks_; JSHooks post_validation_hooks_; JSHooks custom_callback_hooks_; - - DISALLOW_COPY_AND_ASSIGN(JSHookInterface); }; const char kExtensionAPIHooksPerContextKey[] = "extension_api_hooks";
diff --git a/extensions/renderer/bindings/api_binding_js_util_unittest.cc b/extensions/renderer/bindings/api_binding_js_util_unittest.cc index 6aba352..df34d55 100644 --- a/extensions/renderer/bindings/api_binding_js_util_unittest.cc +++ b/extensions/renderer/bindings/api_binding_js_util_unittest.cc
@@ -31,6 +31,10 @@ } // namespace class APIBindingJSUtilUnittest : public APIBindingsSystemTest { + public: + APIBindingJSUtilUnittest(const APIBindingJSUtilUnittest&) = delete; + APIBindingJSUtilUnittest& operator=(const APIBindingJSUtilUnittest&) = delete; + protected: APIBindingJSUtilUnittest() {} ~APIBindingJSUtilUnittest() override {} @@ -85,8 +89,6 @@ private: std::vector<std::string> console_errors_; - - DISALLOW_COPY_AND_ASSIGN(APIBindingJSUtilUnittest); }; TEST_F(APIBindingJSUtilUnittest, TestSetLastError) {
diff --git a/extensions/renderer/bindings/api_binding_test.h b/extensions/renderer/bindings/api_binding_test.h index aad8d8c..1046633 100644 --- a/extensions/renderer/bindings/api_binding_test.h +++ b/extensions/renderer/bindings/api_binding_test.h
@@ -24,6 +24,10 @@ // A common unit test class for testing API bindings. Creates an isolate and an // initial v8 context, and checks for v8 leaks at the end of the test. class APIBindingTest : public testing::Test { + public: + APIBindingTest(const APIBindingTest&) = delete; + APIBindingTest& operator=(const APIBindingTest&) = delete; + protected: APIBindingTest(); ~APIBindingTest() override; @@ -84,8 +88,6 @@ std::unique_ptr<gin::ContextHolder> main_context_holder_; std::unique_ptr<TestJSRunner::Scope> test_js_runner_; std::vector<std::unique_ptr<gin::ContextHolder>> additional_context_holders_; - - DISALLOW_COPY_AND_ASSIGN(APIBindingTest); }; } // namespace extensions
diff --git a/extensions/renderer/bindings/api_binding_unittest.cc b/extensions/renderer/bindings/api_binding_unittest.cc index 94032c2..020f1db 100644 --- a/extensions/renderer/bindings/api_binding_unittest.cc +++ b/extensions/renderer/bindings/api_binding_unittest.cc
@@ -152,6 +152,9 @@ class APIBindingUnittest : public APIBindingTest { public: + APIBindingUnittest(const APIBindingUnittest&) = delete; + APIBindingUnittest& operator=(const APIBindingUnittest&) = delete; + void OnFunctionCall(std::unique_ptr<APIRequestHandler::Request> request, v8::Local<v8::Context> context) { last_request_ = std::move(request); @@ -358,8 +361,6 @@ BindingAccessChecker::APIAvailabilityCallback api_availability_callback_; BindingAccessChecker::PromiseAvailabilityCallback promise_availability_callback_; - - DISALLOW_COPY_AND_ASSIGN(APIBindingUnittest); }; v8::Local<v8::Value> APIBindingUnittest::RunTest(
diff --git a/extensions/renderer/bindings/api_bindings_system_unittest.h b/extensions/renderer/bindings/api_bindings_system_unittest.h index 25d649fd..54b0874 100644 --- a/extensions/renderer/bindings/api_bindings_system_unittest.h +++ b/extensions/renderer/bindings/api_bindings_system_unittest.h
@@ -25,6 +25,10 @@ // The base class to test the APIBindingsSystem. This allows subclasses to // retrieve API schemas differently. class APIBindingsSystemTest : public APIBindingTest { + public: + APIBindingsSystemTest(const APIBindingsSystemTest&) = delete; + APIBindingsSystemTest& operator=(const APIBindingsSystemTest&) = delete; + protected: // A struct representing a "fake" API, including the name and specification. // The specification is expected to be a JSON-serializable string that @@ -102,8 +106,6 @@ // The last request to be received from the APIBindingsSystem, or null if // there is none. std::unique_ptr<APIRequestHandler::Request> last_request_; - - DISALLOW_COPY_AND_ASSIGN(APIBindingsSystemTest); }; } // namespace extensions
diff --git a/extensions/renderer/bindings/api_event_handler_unittest.cc b/extensions/renderer/bindings/api_event_handler_unittest.cc index e3ddc3f..f4ed9aa 100644 --- a/extensions/renderer/bindings/api_event_handler_unittest.cc +++ b/extensions/renderer/bindings/api_event_handler_unittest.cc
@@ -59,6 +59,10 @@ } class APIEventHandlerTest : public APIBindingTest { + public: + APIEventHandlerTest(const APIEventHandlerTest&) = delete; + APIEventHandlerTest& operator=(const APIEventHandlerTest&) = delete; + protected: APIEventHandlerTest() {} ~APIEventHandlerTest() override {} @@ -88,8 +92,6 @@ private: std::unique_ptr<APIEventHandler> handler_; - - DISALLOW_COPY_AND_ASSIGN(APIEventHandlerTest); }; } // namespace
diff --git a/extensions/renderer/bindings/api_last_error.cc b/extensions/renderer/bindings/api_last_error.cc index 3a71c69..58b9ee1 100644 --- a/extensions/renderer/bindings/api_last_error.cc +++ b/extensions/renderer/bindings/api_last_error.cc
@@ -26,6 +26,9 @@ public: explicit LastErrorObject(const std::string& error) : error_(error) {} + LastErrorObject(const LastErrorObject&) = delete; + LastErrorObject& operator=(const LastErrorObject&) = delete; + static gin::WrapperInfo kWrapperInfo; // gin::Wrappable: @@ -48,8 +51,6 @@ private: std::string error_; bool accessed_ = false; - - DISALLOW_COPY_AND_ASSIGN(LastErrorObject); }; gin::WrapperInfo LastErrorObject::kWrapperInfo = {gin::kEmbedderNativeGin};
diff --git a/extensions/renderer/bindings/api_request_handler_unittest.cc b/extensions/renderer/bindings/api_request_handler_unittest.cc index fc28cd2..1229e9700 100644 --- a/extensions/renderer/bindings/api_request_handler_unittest.cc +++ b/extensions/renderer/bindings/api_request_handler_unittest.cc
@@ -39,6 +39,9 @@ class APIRequestHandlerTest : public APIBindingTest { public: + APIRequestHandlerTest(const APIRequestHandlerTest&) = delete; + APIRequestHandlerTest& operator=(const APIRequestHandlerTest&) = delete; + std::unique_ptr<APIRequestHandler> CreateRequestHandler() { return std::make_unique<APIRequestHandler>( base::DoNothing(), @@ -75,8 +78,6 @@ bool did_run_js_ = false; std::unique_ptr<TestInteractionProvider> interaction_provider_; - - DISALLOW_COPY_AND_ASSIGN(APIRequestHandlerTest); }; // Tests adding a request to the request handler, and then triggering the
diff --git a/extensions/renderer/bindings/api_response_validator.h b/extensions/renderer/bindings/api_response_validator.h index 966b8d33..062104a 100644 --- a/extensions/renderer/bindings/api_response_validator.h +++ b/extensions/renderer/bindings/api_response_validator.h
@@ -51,6 +51,10 @@ }; explicit APIResponseValidator(const APITypeReferenceMap* type_refs); + + APIResponseValidator(const APIResponseValidator&) = delete; + APIResponseValidator& operator=(const APIResponseValidator&) = delete; + ~APIResponseValidator(); // Validates a response against the expected schema. By default, this will @@ -65,8 +69,6 @@ private: // The type reference map; guaranteed to outlive this object. const APITypeReferenceMap* type_refs_; - - DISALLOW_COPY_AND_ASSIGN(APIResponseValidator); }; } // namespace extensions
diff --git a/extensions/renderer/bindings/api_signature.cc b/extensions/renderer/bindings/api_signature.cc index 4e74640b..5f7e6c67 100644 --- a/extensions/renderer/bindings/api_signature.cc +++ b/extensions/renderer/bindings/api_signature.cc
@@ -90,6 +90,9 @@ type_refs_(type_refs), promises_allowed_(promises_allowed) {} + ArgumentParser(const ArgumentParser&) = delete; + ArgumentParser& operator=(const ArgumentParser&) = delete; + protected: v8::Isolate* GetIsolate() { return context_->GetIsolate(); } @@ -155,8 +158,6 @@ // An error to pass while parsing arguments to avoid having to allocate a new // std::string on the stack multiple times. std::string parse_error_; - - DISALLOW_COPY_AND_ASSIGN(ArgumentParser); }; class V8ArgumentParser : public ArgumentParser { @@ -172,6 +173,9 @@ type_refs, promises_allowed) {} + V8ArgumentParser(const V8ArgumentParser&) = delete; + V8ArgumentParser& operator=(const V8ArgumentParser&) = delete; + APISignature::V8ParseResult ParseArguments(bool signature_has_callback); private: @@ -190,8 +194,6 @@ v8::Local<v8::Value> last_arg_; std::vector<v8::Local<v8::Value>> values_; - - DISALLOW_COPY_AND_ASSIGN(V8ArgumentParser); }; class BaseValueArgumentParser : public ArgumentParser { @@ -209,6 +211,9 @@ promises_allowed), list_value_(std::make_unique<base::ListValue>()) {} + BaseValueArgumentParser(const BaseValueArgumentParser&) = delete; + BaseValueArgumentParser& operator=(const BaseValueArgumentParser&) = delete; + APISignature::JSONParseResult ParseArguments(bool signature_has_callback); private: @@ -235,8 +240,6 @@ std::unique_ptr<base::ListValue> list_value_; std::unique_ptr<base::Value> last_arg_; v8::Local<v8::Function> callback_; - - DISALLOW_COPY_AND_ASSIGN(BaseValueArgumentParser); }; bool ArgumentParser::ParseArgumentsImpl(bool signature_has_callback) {
diff --git a/extensions/renderer/bindings/argument_spec_unittest.cc b/extensions/renderer/bindings/argument_spec_unittest.cc index 7665dcd..c9bca53 100644 --- a/extensions/renderer/bindings/argument_spec_unittest.cc +++ b/extensions/renderer/bindings/argument_spec_unittest.cc
@@ -37,6 +37,10 @@ using V8Validator = base::OnceCallback<void(v8::Local<v8::Value>)>; class ArgumentSpecUnitTest : public gin::V8Test { + public: + ArgumentSpecUnitTest(const ArgumentSpecUnitTest&) = delete; + ArgumentSpecUnitTest& operator=(const ArgumentSpecUnitTest&) = delete; + protected: ArgumentSpecUnitTest() : type_refs_(APITypeReferenceMap::InitializeTypeCallback()) {} @@ -136,8 +140,6 @@ void RunTest(RunTestParams& params); APITypeReferenceMap type_refs_; - - DISALLOW_COPY_AND_ASSIGN(ArgumentSpecUnitTest); }; void ArgumentSpecUnitTest::RunTest(RunTestParams& params) {
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc index ecbf692..6a93454 100644 --- a/extensions/renderer/dispatcher.cc +++ b/extensions/renderer/dispatcher.cc
@@ -202,11 +202,12 @@ : handle_scope_(script_context->isolate()), context_scope_(script_context->v8_context()) {} + HandleScopeHelper(const HandleScopeHelper&) = delete; + HandleScopeHelper& operator=(const HandleScopeHelper&) = delete; + private: v8::HandleScope handle_scope_; v8::Context::Scope context_scope_; - - DISALLOW_COPY_AND_ASSIGN(HandleScopeHelper); }; base::LazyInstance<WorkerScriptContextSet>::DestructorAtExit
diff --git a/extensions/renderer/extension_interaction_provider.h b/extensions/renderer/extension_interaction_provider.h index 59b931bb..07f88c8 100644 --- a/extensions/renderer/extension_interaction_provider.h +++ b/extensions/renderer/extension_interaction_provider.h
@@ -73,6 +73,11 @@ }; ExtensionInteractionProvider(); + + ExtensionInteractionProvider(const ExtensionInteractionProvider&) = delete; + ExtensionInteractionProvider& operator=(const ExtensionInteractionProvider&) = + delete; + ~ExtensionInteractionProvider() override; // Returns true if |v8_context| has an active interaction. @@ -85,9 +90,6 @@ v8::Local<v8::Context> v8_context, std::unique_ptr<InteractionProvider::Token> token) const override; bool HasActiveInteraction(v8::Local<v8::Context> v8_context) const override; - - private: - DISALLOW_COPY_AND_ASSIGN(ExtensionInteractionProvider); }; } // namespace extensions
diff --git a/extensions/renderer/extension_throttle_simulation_unittest.cc b/extensions/renderer/extension_throttle_simulation_unittest.cc index ad4caff..18f6f5bd 100644 --- a/extensions/renderer/extension_throttle_simulation_unittest.cc +++ b/extensions/renderer/extension_throttle_simulation_unittest.cc
@@ -77,6 +77,9 @@ DiscreteTimeSimulation() {} + DiscreteTimeSimulation(const DiscreteTimeSimulation&) = delete; + DiscreteTimeSimulation& operator=(const DiscreteTimeSimulation&) = delete; + // Adds an |actor| to the simulation. The client of the simulation maintains // ownership of |actor| and must ensure its lifetime exceeds that of the // simulation. Actors should be added in the order you wish for them to @@ -106,8 +109,6 @@ private: std::vector<Actor*> actors_; - - DISALLOW_COPY_AND_ASSIGN(DiscreteTimeSimulation); }; // Represents a web server in a simulation of a server under attack by @@ -123,6 +124,9 @@ num_overloaded_ticks_(0), max_experienced_queries_per_tick_(0) {} + Server(const Server&) = delete; + Server& operator=(const Server&) = delete; + void SetDowntime(const TimeTicks& start_time, const TimeDelta& duration) { start_downtime_ = start_time; end_downtime_ = start_time + duration; @@ -277,8 +281,6 @@ int num_overloaded_ticks_; int max_experienced_queries_per_tick_; std::vector<int> requests_per_tick_; - - DISALLOW_COPY_AND_ASSIGN(Server); }; // Mock throttler entry used by Requester class. @@ -385,6 +387,9 @@ DCHECK(server_); } + Requester(const Requester&) = delete; + Requester& operator=(const Requester&) = delete; + void AdvanceTime(const TimeTicks& absolute_time) override { if (time_of_last_success_.is_null()) time_of_last_success_ = absolute_time; @@ -455,8 +460,6 @@ TimeDelta last_downtime_duration_; Server* const server_; RequesterResults* const results_; // May be nullptr. - - DISALLOW_COPY_AND_ASSIGN(Requester); }; void SimulateAttack(Server* server,
diff --git a/extensions/renderer/file_system_natives.h b/extensions/renderer/file_system_natives.h index 06b81e0..375a30be 100644 --- a/extensions/renderer/file_system_natives.h +++ b/extensions/renderer/file_system_natives.h
@@ -18,6 +18,9 @@ public: explicit FileSystemNatives(ScriptContext* context); + FileSystemNatives(const FileSystemNatives&) = delete; + FileSystemNatives& operator=(const FileSystemNatives&) = delete; + // ObjectBackedNativeHandler: void AddRoutes() override; @@ -26,8 +29,6 @@ void GetIsolatedFileSystem(const v8::FunctionCallbackInfo<v8::Value>& args); void CrackIsolatedFileSystemName( const v8::FunctionCallbackInfo<v8::Value>& args); - - DISALLOW_COPY_AND_ASSIGN(FileSystemNatives); }; } // namespace extensions
diff --git a/extensions/renderer/gc_callback.h b/extensions/renderer/gc_callback.h index 6c3e6117..eb71247 100644 --- a/extensions/renderer/gc_callback.h +++ b/extensions/renderer/gc_callback.h
@@ -34,6 +34,9 @@ base::OnceClosure callback, base::OnceClosure fallback); + GCCallback(const GCCallback&) = delete; + GCCallback& operator=(const GCCallback&) = delete; + private: GCCallback(ScriptContext* context, const v8::Local<v8::Object>& object, @@ -65,8 +68,6 @@ base::OnceClosure fallback_; base::WeakPtrFactory<GCCallback> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(GCCallback); }; } // namespace extensions
diff --git a/extensions/renderer/gc_callback_unittest.cc b/extensions/renderer/gc_callback_unittest.cc index 5a1a920c..2ea074c 100644 --- a/extensions/renderer/gc_callback_unittest.cc +++ b/extensions/renderer/gc_callback_unittest.cc
@@ -37,6 +37,9 @@ public: GCCallbackTest() : script_context_set_(&active_extensions_) {} + GCCallbackTest(const GCCallbackTest&) = delete; + GCCallbackTest& operator=(const GCCallbackTest&) = delete; + protected: ScriptContextSet& script_context_set() { return script_context_set_; } @@ -126,8 +129,6 @@ ScriptContextSet script_context_set_; v8::Global<v8::Context> v8_context_; std::unique_ptr<TestJSRunner::Scope> test_js_runner_; - - DISALLOW_COPY_AND_ASSIGN(GCCallbackTest); }; TEST_P(GCCallbackTest, GCBeforeContextInvalidated) {
diff --git a/extensions/renderer/i18n_hooks_delegate.cc b/extensions/renderer/i18n_hooks_delegate.cc index 87e8892..f5af2b0 100644 --- a/extensions/renderer/i18n_hooks_delegate.cc +++ b/extensions/renderer/i18n_hooks_delegate.cc
@@ -60,6 +60,8 @@ // array of DetectedLanguage struct LanguageDetectionResult { LanguageDetectionResult() {} + LanguageDetectionResult(const LanguageDetectionResult&) = delete; + LanguageDetectionResult& operator=(const LanguageDetectionResult&) = delete; ~LanguageDetectionResult() {} // Returns a new v8::Local<v8::Value> representing the serialized form of @@ -72,9 +74,6 @@ // Array of detectedLanguage of size 1-3. The null is returned if // there were no languages detected std::vector<DetectedLanguage> languages; - - private: - DISALLOW_COPY_AND_ASSIGN(LanguageDetectionResult); }; v8::Local<v8::Value> DetectedLanguage::ToV8(v8::Isolate* isolate) const {
diff --git a/extensions/renderer/module_system.h b/extensions/renderer/module_system.h index 4aee5ce..a041c757 100644 --- a/extensions/renderer/module_system.h +++ b/extensions/renderer/module_system.h
@@ -74,6 +74,10 @@ // |source_map| is a weak pointer. ModuleSystem(ScriptContext* context, const SourceMap* source_map); + + ModuleSystem(const ModuleSystem&) = delete; + ModuleSystem& operator=(const ModuleSystem&) = delete; + ~ModuleSystem() override; // ObjectBackedNativeHandler: @@ -272,8 +276,6 @@ // The set of modules that we've attempted to load. std::set<std::string> loaded_modules_; - - DISALLOW_COPY_AND_ASSIGN(ModuleSystem); }; } // namespace extensions
diff --git a/extensions/renderer/native_extension_bindings_system_unittest.cc b/extensions/renderer/native_extension_bindings_system_unittest.cc index a1c606c..776f548 100644 --- a/extensions/renderer/native_extension_bindings_system_unittest.cc +++ b/extensions/renderer/native_extension_bindings_system_unittest.cc
@@ -1145,6 +1145,12 @@ public testing::WithParamInterface<bool> { public: ResponseValidationNativeExtensionBindingsSystemUnittest() = default; + + ResponseValidationNativeExtensionBindingsSystemUnittest( + const ResponseValidationNativeExtensionBindingsSystemUnittest&) = delete; + ResponseValidationNativeExtensionBindingsSystemUnittest& operator=( + const ResponseValidationNativeExtensionBindingsSystemUnittest&) = delete; + ~ResponseValidationNativeExtensionBindingsSystemUnittest() override = default; void SetUp() override { @@ -1160,9 +1166,6 @@ private: std::unique_ptr<base::AutoReset<bool>> response_validation_override_; - - DISALLOW_COPY_AND_ASSIGN( - ResponseValidationNativeExtensionBindingsSystemUnittest); }; TEST_P(ResponseValidationNativeExtensionBindingsSystemUnittest,
diff --git a/extensions/renderer/render_frame_observer_natives.cc b/extensions/renderer/render_frame_observer_natives.cc index f4b14db..20bff0b 100644 --- a/extensions/renderer/render_frame_observer_natives.cc +++ b/extensions/renderer/render_frame_observer_natives.cc
@@ -31,6 +31,9 @@ base::OnceCallback<void(bool)> callback) : content::RenderFrameObserver(frame), callback_(std::move(callback)) {} + LoadWatcher(const LoadWatcher&) = delete; + LoadWatcher& operator=(const LoadWatcher&) = delete; + void DidCreateDocumentElement() override { // Defer the callback instead of running it now to avoid re-entrancy caused // by the JavaScript callback. @@ -51,8 +54,6 @@ private: base::OnceCallback<void(bool)> callback_; - - DISALLOW_COPY_AND_ASSIGN(LoadWatcher); }; } // namespace
diff --git a/extensions/renderer/scoped_web_frame.h b/extensions/renderer/scoped_web_frame.h index 2d3a8536..a4f710e 100644 --- a/extensions/renderer/scoped_web_frame.h +++ b/extensions/renderer/scoped_web_frame.h
@@ -18,6 +18,10 @@ class ScopedWebFrame { public: ScopedWebFrame(); + + ScopedWebFrame(const ScopedWebFrame&) = delete; + ScopedWebFrame& operator=(const ScopedWebFrame&) = delete; + ~ScopedWebFrame(); blink::WebLocalFrame* frame() { return frame_; } @@ -32,8 +36,6 @@ agent_group_scheduler_; blink::WebView* view_; blink::WebLocalFrame* frame_; - - DISALLOW_COPY_AND_ASSIGN(ScopedWebFrame); }; } // namespace extensions
diff --git a/extensions/renderer/scripts_run_info.h b/extensions/renderer/scripts_run_info.h index 79e4e66c..06b56fe 100644 --- a/extensions/renderer/scripts_run_info.h +++ b/extensions/renderer/scripts_run_info.h
@@ -29,6 +29,10 @@ ScriptsRunInfo(content::RenderFrame* render_frame, mojom::RunLocation location); + + ScriptsRunInfo(const ScriptsRunInfo&) = delete; + ScriptsRunInfo& operator=(const ScriptsRunInfo&) = delete; + ~ScriptsRunInfo(); // The number of CSS scripts injected. @@ -62,8 +66,6 @@ // The url of the frame, preserved for the same reason as the routing id. GURL frame_url_; - - DISALLOW_COPY_AND_ASSIGN(ScriptsRunInfo); }; } // namespace extensions
diff --git a/extensions/renderer/set_icon_natives.h b/extensions/renderer/set_icon_natives.h index 70c5cd435..508d073 100644 --- a/extensions/renderer/set_icon_natives.h +++ b/extensions/renderer/set_icon_natives.h
@@ -17,6 +17,9 @@ public: explicit SetIconNatives(ScriptContext* context); + SetIconNatives(const SetIconNatives&) = delete; + SetIconNatives& operator=(const SetIconNatives&) = delete; + // ObjectBackedNativeHandler: void AddRoutes() override; @@ -30,8 +33,6 @@ // Determines if the associated script context is for a ServiceWorker. void IsInServiceWorker(const v8::FunctionCallbackInfo<v8::Value>& args); - - DISALLOW_COPY_AND_ASSIGN(SetIconNatives); }; } // namespace extensions
diff --git a/extensions/renderer/storage_area_unittest.cc b/extensions/renderer/storage_area_unittest.cc index 7c96d92..1b05feb5 100644 --- a/extensions/renderer/storage_area_unittest.cc +++ b/extensions/renderer/storage_area_unittest.cc
@@ -23,21 +23,6 @@ using StorageAreaTest = NativeExtensionBindingsSystemUnittest; -// A specialization of StorageAreaTest that pretends it's running -// on version_info::Channel::UNKNOWN. -class StorageAreaTrunkTest : public StorageAreaTest { - public: - StorageAreaTrunkTest() = default; - ~StorageAreaTrunkTest() override = default; - StorageAreaTrunkTest(const StorageAreaTrunkTest& other) = delete; - StorageAreaTrunkTest& operator=(const StorageAreaTrunkTest& other) = delete; - - private: - // TODO(crbug.com/1185226): Remove unknown channel when chrome.storage.session - // is released in stable. - ScopedCurrentChannel current_channel_{version_info::Channel::UNKNOWN}; -}; - // Test that trying to use StorageArea.get without a StorageArea `this` fails // (with a helpful error message). TEST_F(StorageAreaTest, TestUnboundedUse) { @@ -133,7 +118,7 @@ "No matching signature.")); } -TEST_F(StorageAreaTrunkTest, HasOnChanged) { +TEST_F(StorageAreaTest, HasOnChanged) { scoped_refptr<const Extension> extension = ExtensionBuilder("foo") .SetManifestKey("manifest_version", 3)
diff --git a/extensions/renderer/test_native_handler.h b/extensions/renderer/test_native_handler.h index 8460f56d..702424a 100644 --- a/extensions/renderer/test_native_handler.h +++ b/extensions/renderer/test_native_handler.h
@@ -19,13 +19,14 @@ public: explicit TestNativeHandler(ScriptContext* context); + TestNativeHandler(const TestNativeHandler&) = delete; + TestNativeHandler& operator=(const TestNativeHandler&) = delete; + // ObjectBackedNativeHandler: void AddRoutes() override; private: void GetWakeEventPage(const v8::FunctionCallbackInfo<v8::Value>& args); - - DISALLOW_COPY_AND_ASSIGN(TestNativeHandler); }; } // namespace extensions
diff --git a/extensions/shell/browser/shell_display_info_provider.h b/extensions/shell/browser/shell_display_info_provider.h index 4bced63..ac090bd 100644 --- a/extensions/shell/browser/shell_display_info_provider.h +++ b/extensions/shell/browser/shell_display_info_provider.h
@@ -14,8 +14,8 @@ public: ShellDisplayInfoProvider(); - private: - DISALLOW_COPY_AND_ASSIGN(ShellDisplayInfoProvider); + ShellDisplayInfoProvider(const ShellDisplayInfoProvider&) = delete; + ShellDisplayInfoProvider& operator=(const ShellDisplayInfoProvider&) = delete; }; } // namespace extensions
diff --git a/extensions/shell/browser/shell_extension_loader_unittest.cc b/extensions/shell/browser/shell_extension_loader_unittest.cc index 2eb314f6..f94676a 100644 --- a/extensions/shell/browser/shell_extension_loader_unittest.cc +++ b/extensions/shell/browser/shell_extension_loader_unittest.cc
@@ -86,6 +86,10 @@ } // namespace class ShellExtensionLoaderTest : public ExtensionsTest { + public: + ShellExtensionLoaderTest(const ShellExtensionLoaderTest&) = delete; + ShellExtensionLoaderTest& operator=(const ShellExtensionLoaderTest&) = delete; + protected: ShellExtensionLoaderTest() = default; ~ShellExtensionLoaderTest() override = default; @@ -140,8 +144,6 @@ MockExtensionSystemFactory<TestExtensionSystem> factory_; TestEventRouter* event_router_ = nullptr; // Created in SetUp(). - - DISALLOW_COPY_AND_ASSIGN(ShellExtensionLoaderTest); }; // Tests with a non-existent directory. @@ -215,6 +217,11 @@ #if defined(USE_AURA) class ShellExtensionLoaderTestAura : public ShellExtensionLoaderTest { + public: + ShellExtensionLoaderTestAura(const ShellExtensionLoaderTestAura&) = delete; + ShellExtensionLoaderTestAura& operator=(const ShellExtensionLoaderTestAura&) = + delete; + protected: ShellExtensionLoaderTestAura() = default; ~ShellExtensionLoaderTestAura() override = default; @@ -250,8 +257,6 @@ private: std::unique_ptr<ShellTestHelperAura> aura_helper_; TestAppWindowClient app_window_client_; - - DISALLOW_COPY_AND_ASSIGN(ShellExtensionLoaderTestAura); }; // Tests loading and launching a platform app.
diff --git a/extensions/shell/browser/shell_extension_system_factory.h b/extensions/shell/browser/shell_extension_system_factory.h index ef4fbeb8..4eb071c1 100644 --- a/extensions/shell/browser/shell_extension_system_factory.h +++ b/extensions/shell/browser/shell_extension_system_factory.h
@@ -14,6 +14,10 @@ // A factory that provides ShellExtensionSystem for app_shell. class ShellExtensionSystemFactory : public ExtensionSystemProvider { public: + ShellExtensionSystemFactory(const ShellExtensionSystemFactory&) = delete; + ShellExtensionSystemFactory& operator=(const ShellExtensionSystemFactory&) = + delete; + // ExtensionSystemProvider implementation: ExtensionSystem* GetForBrowserContext( content::BrowserContext* context) override; @@ -32,8 +36,6 @@ content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; bool ServiceIsCreatedWithBrowserContext() const override; - - DISALLOW_COPY_AND_ASSIGN(ShellExtensionSystemFactory); }; } // namespace extensions
diff --git a/extensions/shell/browser/shell_keep_alive_requester_unittest.cc b/extensions/shell/browser/shell_keep_alive_requester_unittest.cc index 6beaf08..be4f492 100644 --- a/extensions/shell/browser/shell_keep_alive_requester_unittest.cc +++ b/extensions/shell/browser/shell_keep_alive_requester_unittest.cc
@@ -22,6 +22,11 @@ namespace extensions { class ShellKeepAliveRequesterTest : public ExtensionsTest { + public: + ShellKeepAliveRequesterTest(const ShellKeepAliveRequesterTest&) = delete; + ShellKeepAliveRequesterTest& operator=(const ShellKeepAliveRequesterTest&) = + delete; + protected: ShellKeepAliveRequesterTest() = default; ~ShellKeepAliveRequesterTest() override = default; @@ -44,9 +49,6 @@ protected: std::unique_ptr<ShellKeepAliveRequester> keep_alive_requester_; - - private: - DISALLOW_COPY_AND_ASSIGN(ShellKeepAliveRequesterTest); }; // Tests with an extension.
diff --git a/fuchsia/engine/browser/frame_impl_browsertest.cc b/fuchsia/engine/browser/frame_impl_browsertest.cc index c6946da8..7dd5541 100644 --- a/fuchsia/engine/browser/frame_impl_browsertest.cc +++ b/fuchsia/engine/browser/frame_impl_browsertest.cc
@@ -11,10 +11,12 @@ #include <string> #include "base/bind.h" +#include "base/callback_forward.h" #include "base/callback_helpers.h" #include "base/fuchsia/process_context.h" #include "base/macros.h" #include "base/memory/ptr_util.h" +#include "base/strings/string_piece_forward.h" #include "base/strings/stringprintf.h" #include "base/test/test_future.h" #include "build/build_config.h" @@ -37,6 +39,7 @@ #include "fuchsia/engine/browser/frame_impl_browser_test_base.h" #include "fuchsia/engine/switches.h" #include "fuchsia/engine/test/frame_for_test.h" +#include "net/http/http_response_headers.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" @@ -398,14 +401,12 @@ // with indeterminate-length pauses in between. class ChunkedHttpTransaction { public: - ChunkedHttpTransaction(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) + explicit ChunkedHttpTransaction( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) : io_task_runner_(base::ThreadTaskRunnerHandle::Get()), - send_callback_(send), - done_callback_(std::move(done)) { + send_state_(SendState::IDLE), + delegate_(delegate) { DCHECK(!current_instance_); - DCHECK(send_callback_); - DCHECK(done_callback_); current_instance_ = this; } @@ -417,35 +418,35 @@ void Close() { EnsureSendCompleted(); - io_task_runner_->PostTask(FROM_HERE, std::move(done_callback_)); + io_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&net::test_server::HttpResponseDelegate::FinishResponse, + delegate_)); delete this; } void EnsureSendCompleted() { - if (send_callback_) + if (send_state_ == SendState::IDLE) return; base::RunLoop run_loop; send_chunk_complete_callback_ = run_loop.QuitClosure(); run_loop.Run(); - DCHECK(send_callback_); + DCHECK_EQ(send_state_, SendState::IDLE); } - void SendChunk(std::string chunk) { + void SendChunk(const std::string& chunk) { EnsureSendCompleted(); - // Temporarily nullify |send_callback_| while the operation is inflight, to - // guard against concurrent sends. The callback will be restored by - // SendChunkComplete(). - net::test_server::SendBytesCallback inflight_send_callback = send_callback_; - send_callback_ = {}; + send_state_ = SendState::BLOCKED; io_task_runner_->PostTask( FROM_HERE, - base::BindOnce(inflight_send_callback, chunk, - base::BindRepeating( - &ChunkedHttpTransaction::SendChunkCompleteOnIoThread, - base::Unretained(this), inflight_send_callback, + base::BindOnce( + &net::test_server::HttpResponseDelegate::SendContents, delegate_, + chunk, + base::BindOnce(&ChunkedHttpTransaction::SendChunkCompleteOnIoThread, + base::Unretained(this), base::ThreadTaskRunnerHandle::Get()))); } @@ -455,17 +456,15 @@ ~ChunkedHttpTransaction() { current_instance_ = nullptr; } void SendChunkCompleteOnIoThread( - net::test_server::SendBytesCallback send_callback, scoped_refptr<base::TaskRunner> ui_thread_task_runner) { ui_thread_task_runner->PostTask( FROM_HERE, base::BindOnce(&ChunkedHttpTransaction::SendChunkCompleteOnUiThread, - base::Unretained(this), send_callback)); + base::Unretained(this))); } - void SendChunkCompleteOnUiThread( - net::test_server::SendBytesCallback send_callback) { - send_callback_ = send_callback; + void SendChunkCompleteOnUiThread() { + send_state_ = SendState::IDLE; if (send_chunk_complete_callback_) std::move(send_chunk_complete_callback_).Run(); } @@ -475,9 +474,10 @@ // Set by callers to SendChunk() waiting for the previous chunk to complete. base::OnceClosure send_chunk_complete_callback_; - // Callbacks are affine with |io_task_runner_|. - net::test_server::SendBytesCallback send_callback_; - net::test_server::SendCompleteCallback done_callback_; + enum SendState { IDLE, BLOCKED }; + + SendState send_state_; + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate_; DISALLOW_COPY_AND_ASSIGN(ChunkedHttpTransaction); }; @@ -494,10 +494,10 @@ } // net::test_server::HttpResponse implementation. - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) override { + void SendResponse( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) override { // The ChunkedHttpTransaction manages its own lifetime. - new ChunkedHttpTransaction(send, std::move(done)); + new ChunkedHttpTransaction(delegate); if (on_response_created_) std::move(on_response_created_).Run();
diff --git a/fuchsia/engine/web_engine_integration_test.cc b/fuchsia/engine/web_engine_integration_test.cc index 7654b35..55a893a 100644 --- a/fuchsia/engine/web_engine_integration_test.cc +++ b/fuchsia/engine/web_engine_integration_test.cc
@@ -584,11 +584,13 @@ TEST_F(MAYBE_VulkanWebEngineIntegrationTest, HardwareVideoDecoderFlag_Provided) { // Check that the CodecFactory service is requested. - bool is_requested = false; + base::RunLoop codec_connected_run_loop; zx_status_t status = filtered_service_directory().outgoing_directory()->AddPublicService( fidl::InterfaceRequestHandler<fuchsia::mediacodec::CodecFactory>( - [&is_requested](auto request) { is_requested = true; })); + [&codec_connected_run_loop](auto request) { + codec_connected_run_loop.Quit(); + })); ZX_CHECK(status == ZX_OK, status) << "AddPublicService"; // The VULKAN flag is required for hardware video decoders to be available. @@ -603,9 +605,7 @@ ASSERT_NO_FATAL_FAILURE(LoadUrlAndExpectResponse( kAutoplayVp9OpusToEndUrl, cr_fuchsia::CreateLoadUrlParamsWithUserActivation())); - navigation_listener()->RunUntilTitleEquals("ended"); - - EXPECT_TRUE(is_requested); + codec_connected_run_loop.Run(); } // Check that the CodecFactory service is not requested when
diff --git a/gpu/command_buffer/service/shared_image_backing_factory_raw_draw.cc b/gpu/command_buffer/service/shared_image_backing_factory_raw_draw.cc index 4912941..e05e51d 100644 --- a/gpu/command_buffer/service/shared_image_backing_factory_raw_draw.cc +++ b/gpu/command_buffer/service/shared_image_backing_factory_raw_draw.cc
@@ -4,34 +4,13 @@ #include "gpu/command_buffer/service/shared_image_backing_factory_raw_draw.h" -#include "base/hash/hash.h" #include "base/logging.h" -#include "base/memory/scoped_refptr.h" -#include "base/trace_event/memory_dump_manager.h" -#include "base/trace_event/process_memory_dump.h" +#include "base/thread_annotations.h" #include "base/types/pass_key.h" -#include "build/build_config.h" #include "cc/paint/paint_op_buffer.h" -#include "components/viz/common/resources/resource_format.h" -#include "components/viz/common/resources/resource_format_utils.h" -#include "components/viz/common/resources/resource_sizes.h" #include "gpu/command_buffer/common/shared_image_usage.h" -#include "gpu/command_buffer/service/feature_info.h" -#include "gpu/command_buffer/service/mailbox_manager.h" -#include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image_backing.h" #include "gpu/command_buffer/service/shared_image_representation.h" -#include "gpu/command_buffer/service/skia_utils.h" -#include "skia/buildflags.h" -#include "third_party/skia/include/core/SkCanvas.h" -#include "third_party/skia/include/core/SkPromiseImageTexture.h" -#include "third_party/skia/include/core/SkSurface.h" -#include "third_party/skia/include/core/SkSurfaceProps.h" -#include "third_party/skia/include/gpu/GrBackendSurface.h" -#include "third_party/skia/include/gpu/GrTypes.h" -#include "ui/gl/gl_context.h" -#include "ui/gl/gl_gl_api_implementation.h" -#include "ui/gl/trace_util.h" namespace gpu { namespace raster { @@ -50,8 +29,7 @@ GrSurfaceOrigin surface_origin, SkAlphaType alpha_type, uint32_t usage, - size_t estimated_size, - scoped_refptr<SharedContextState> context_state) + size_t estimated_size) : ClearTrackingSharedImageBacking(mailbox, format, size, @@ -60,23 +38,12 @@ alpha_type, usage, estimated_size, - false /* is_thread_safe */), - context_state_(std::move(context_state)) { - DCHECK(!!context_state_); - } + true /* is_thread_safe */) {} ~RawDrawBacking() override { - context_state_->MakeCurrent(nullptr); - promise_texture_.reset(); - context_state_->EraseCachedSkSurface(this); - + AutoLock auto_lock(this); + DCHECK_EQ(mode_, kNone); ResetPaintOpBuffer(); - - if (backend_texture_.isValid()) - DeleteGrBackendTexture(context_state_.get(), &backend_texture_); - - if (!context_state_->context_lost()) - context_state_->set_need_context_state_reset(true); } // SharedImageBacking implementation. @@ -94,49 +61,7 @@ base::trace_event::ProcessMemoryDump* pmd, uint64_t client_tracing_id) override {} - SkColorType GetSkColorType() { - return viz::ResourceFormatToClosestSkColorType( - /*gpu_compositing=*/true, format()); - } - - sk_sp<SkSurface> GetSkSurface(int final_msaa_count, - const SkSurfaceProps& surface_props) { - if (context_state_->context_lost()) { - LOG(ERROR) << "Context is lost."; - return nullptr; - } - - DCHECK(context_state_->IsCurrent(nullptr)); - - auto surface = context_state_->GetCachedSkSurface(this); - if (!surface || final_msaa_count != surface_msaa_count_ || - surface_props != surface->props()) { - DCHECK(backend_texture_.isValid()); - surface = SkSurface::MakeFromBackendTexture( - context_state_->gr_context(), backend_texture_, surface_origin(), - final_msaa_count, GetSkColorType(), color_space().ToSkColorSpace(), - &surface_props); - if (!surface) { - LOG(ERROR) << "MakeFromBackendTexture() failed."; - context_state_->EraseCachedSkSurface(this); - return nullptr; - } - surface_msaa_count_ = final_msaa_count; - context_state_->CacheSkSurface(this, surface); - } - return surface; - } - - bool SkSurfaceUnique() { - return context_state_->CachedSkSurfaceIsUnique(this); - } - protected: - std::unique_ptr<SharedImageRepresentationSkia> ProduceSkia( - SharedImageManager* manager, - MemoryTypeTracker* tracker, - scoped_refptr<SharedContextState> context_state) override; - std::unique_ptr<SharedImageRepresentationRaster> ProduceRaster( SharedImageManager* manager, MemoryTypeTracker* tracker) override; @@ -146,44 +71,6 @@ class RepresentationSkia; class RepresentationRaster; - bool Initialize() { - if (context_state_->context_lost()) { - LOG(ERROR) << "Context is lost."; - return false; - } - - // MakeCurrent to avoid destroying another client's state because Skia may - // change GL state to create and upload textures (crbug.com/1095679). - context_state_->MakeCurrent(nullptr); - context_state_->set_need_context_state_reset(true); - - DCHECK_NE(format(), viz::ResourceFormat::ETC1); - auto mipmap = usage() & SHARED_IMAGE_USAGE_MIPMAP ? GrMipMapped::kYes - : GrMipMapped::kNo; -#if DCHECK_IS_ON() - // Initializing to bright green makes it obvious if the pixels are not - // properly set before they are displayed (e.g. https://crbug.com/956555). - // We don't do this on release builds because there is a slight overhead. - backend_texture_ = context_state_->gr_context()->createBackendTexture( - size().width(), size().height(), GetSkColorType(), SkColors::kBlue, - mipmap, GrRenderable::kYes, GrProtected::kNo); -#else - backend_texture_ = context_state_->gr_context()->createBackendTexture( - size().width(), size().height(), GetSkColorType(), mipmap, - GrRenderable::kYes, GrProtected::kNo); -#endif - - if (!backend_texture_.isValid()) { - DLOG(ERROR) << "createBackendTexture() failed with SkColorType:" - << GetSkColorType(); - return false; - } - - promise_texture_ = SkPromiseImageTexture::Make(backend_texture_); - - return true; - } - void ResetPaintOpBuffer() { if (!paint_op_buffer_) { DCHECK(!clear_color_); @@ -199,87 +86,17 @@ std::move(paint_op_release_callback_).Run(); } - void FlushPaintOpBuffer() { - bool need_flush = - clear_color_ || (paint_op_buffer_ && paint_op_buffer_->size()); - - if (!need_flush) - return; - auto surface = GetSkSurface(final_msaa_count_, surface_props_); - auto* canvas = surface->getCanvas(); - - if (clear_color_) - canvas->drawColor(*clear_color_, SkBlendMode::kSrc); - - if (paint_op_buffer_ && paint_op_buffer_->size()) { - cc::PlaybackParams playback_params(nullptr, SkM44()); - paint_op_buffer_->Playback(canvas, playback_params); - } - - surface->flush(); - } - - scoped_refptr<SharedContextState> context_state_; - - GrBackendTexture backend_texture_; - sk_sp<SkPromiseImageTexture> promise_texture_; - int surface_msaa_count_ = 0; - int32_t final_msaa_count_ = 0; - - SkSurfaceProps surface_props_{/*flags=*/0, kUnknown_SkPixelGeometry}; absl::optional<SkColor> clear_color_; sk_sp<cc::PaintOpBuffer> paint_op_buffer_; base::OnceClosure paint_op_release_callback_; -}; -class RawDrawBacking::RepresentationSkia - : public SharedImageRepresentationSkia { - public: - RepresentationSkia(SharedImageManager* manager, - SharedImageBacking* backing, - MemoryTypeTracker* tracker) - : SharedImageRepresentationSkia(manager, backing, tracker) {} - - ~RepresentationSkia() override = default; - - sk_sp<SkSurface> BeginWriteAccess( - int final_msaa_count, - const SkSurfaceProps& surface_props, - std::vector<GrBackendSemaphore>* begin_semaphores, - std::vector<GrBackendSemaphore>* end_semaphores) override { - NOTREACHED() << "Not supported"; - return nullptr; - } - - sk_sp<SkPromiseImageTexture> BeginWriteAccess( - std::vector<GrBackendSemaphore>* begin_semaphores, - std::vector<GrBackendSemaphore>* end_semaphores, - std::unique_ptr<GrBackendSurfaceMutableState>* end_state) override { - NOTREACHED() << "Not supported"; - return nullptr; - } - - void EndWriteAccess(sk_sp<SkSurface> surface) override { NOTREACHED(); } - - // Skia read access is supported temporarily. It will be removed when RawDraw - // is fully supported. - sk_sp<SkPromiseImageTexture> BeginReadAccess( - std::vector<GrBackendSemaphore>* begin_semaphores, - std::vector<GrBackendSemaphore>* end_semaphores) override { - raw_draw_backing()->FlushPaintOpBuffer(); - raw_draw_backing()->ResetPaintOpBuffer(); - return raw_draw_backing()->promise_texture_; - } - - void EndReadAccess() override {} - - bool SupportsMultipleConcurrentReadAccess() override { return true; } - - private: - RawDrawBacking* raw_draw_backing() { - return static_cast<RawDrawBacking*>(backing()); - } + enum Mode { + kNone, + kRead, + kWrite, + }; + Mode mode_ GUARDED_BY(lock_) = kNone; }; class RawDrawBacking::RepresentationRaster @@ -293,31 +110,53 @@ cc::PaintOpBuffer* BeginReadAccess( absl::optional<SkColor>& clear_color) override { + AutoLock auto_lock(raw_draw_backing()); + if (raw_draw_backing()->mode_ != kNone) { + return nullptr; + } + + raw_draw_backing()->mode_ = kRead; + if (!raw_draw_backing()->paint_op_buffer_) { raw_draw_backing()->paint_op_buffer_ = sk_make_sp<cc::PaintOpBuffer>(); } + clear_color = raw_draw_backing()->clear_color_; return raw_draw_backing()->paint_op_buffer_.get(); } - void EndReadAccess() override {} + void EndReadAccess() override { + AutoLock auto_lock(raw_draw_backing()); + DCHECK_EQ(raw_draw_backing()->mode_, kRead); + raw_draw_backing()->mode_ = kNone; + } cc::PaintOpBuffer* BeginWriteAccess( int final_msaa_count, const SkSurfaceProps& surface_props, const absl::optional<SkColor>& clear_color) override { + AutoLock auto_lock(raw_draw_backing()); + if (raw_draw_backing()->mode_ != kNone) { + return nullptr; + } + + raw_draw_backing()->mode_ = kWrite; + raw_draw_backing()->ResetPaintOpBuffer(); if (!raw_draw_backing()->paint_op_buffer_) { raw_draw_backing()->paint_op_buffer_ = sk_make_sp<cc::PaintOpBuffer>(); } raw_draw_backing()->final_msaa_count_ = final_msaa_count; - raw_draw_backing()->surface_props_ = surface_props; raw_draw_backing()->clear_color_ = clear_color; return raw_draw_backing()->paint_op_buffer_.get(); } void EndWriteAccess(base::OnceClosure callback) override { + AutoLock auto_lock(raw_draw_backing()); + DCHECK_EQ(raw_draw_backing()->mode_, kWrite); + raw_draw_backing()->mode_ = kNone; + if (callback) { DCHECK(!raw_draw_backing()->paint_op_release_callback_); raw_draw_backing()->paint_op_release_callback_ = std::move(callback); @@ -330,18 +169,6 @@ } }; -// Remove skia representation support when raw draw is fully supported. -std::unique_ptr<SharedImageRepresentationSkia> RawDrawBacking::ProduceSkia( - SharedImageManager* manager, - MemoryTypeTracker* tracker, - scoped_refptr<SharedContextState> context_state) { - if (context_state_->context_lost()) - return nullptr; - - DCHECK_EQ(context_state_, context_state.get()); - return std::make_unique<RepresentationSkia>(manager, this, tracker); -} - std::unique_ptr<SharedImageRepresentationRaster> RawDrawBacking::ProduceRaster( SharedImageManager* manager, MemoryTypeTracker* tracker) { @@ -350,10 +177,7 @@ } // namespace -SharedImageBackingFactoryRawDraw::SharedImageBackingFactoryRawDraw( - scoped_refptr<SharedContextState> context_state) - : context_state_(std::move(context_state)) {} - +SharedImageBackingFactoryRawDraw::SharedImageBackingFactoryRawDraw() = default; SharedImageBackingFactoryRawDraw::~SharedImageBackingFactoryRawDraw() = default; std::unique_ptr<SharedImageBacking> @@ -370,10 +194,7 @@ DCHECK(!is_thread_safe); auto texture = std::make_unique<RawDrawBacking>( base::PassKey<SharedImageBackingFactoryRawDraw>(), mailbox, format, size, - color_space, surface_origin, alpha_type, usage, /*estimated_size=*/0, - context_state_); - if (!texture->Initialize()) - return nullptr; + color_space, surface_origin, alpha_type, usage, /*estimated_size=*/0); return texture; }
diff --git a/gpu/command_buffer/service/shared_image_backing_factory_raw_draw.h b/gpu/command_buffer/service/shared_image_backing_factory_raw_draw.h index 7a28bd9a..7a16dd3 100644 --- a/gpu/command_buffer/service/shared_image_backing_factory_raw_draw.h +++ b/gpu/command_buffer/service/shared_image_backing_factory_raw_draw.h
@@ -7,25 +7,16 @@ #include <memory> -#include "base/macros.h" -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/service/shared_image_backing_factory.h" -#include "gpu/command_buffer/service/texture_base.h" #include "gpu/gpu_gles2_export.h" -#include "third_party/skia/include/core/SkImage.h" -#include "ui/gfx/geometry/size.h" namespace gpu { - -class SharedContextState; - namespace raster { class GPU_GLES2_EXPORT SharedImageBackingFactoryRawDraw : public gpu::SharedImageBackingFactory { public: - explicit SharedImageBackingFactoryRawDraw( - scoped_refptr<SharedContextState> context_state); + SharedImageBackingFactoryRawDraw(); ~SharedImageBackingFactoryRawDraw() override; // SharedImageBackingFactory implementation: @@ -71,8 +62,6 @@ private: bool CanUseRawDrawBacking(uint32_t usage, GrContextType gr_context_type) const; - - scoped_refptr<SharedContextState> context_state_; }; } // namespace raster
diff --git a/gpu/command_buffer/service/shared_image_factory.cc b/gpu/command_buffer/service/shared_image_factory.cc index 5915aca..b41b095 100644 --- a/gpu/command_buffer/service/shared_image_factory.cc +++ b/gpu/command_buffer/service/shared_image_factory.cc
@@ -150,8 +150,7 @@ } if (features::IsUsingRawDraw() && context_state) { - auto factory = std::make_unique<raster::SharedImageBackingFactoryRawDraw>( - context_state); + auto factory = std::make_unique<raster::SharedImageBackingFactoryRawDraw>(); factories_.push_back(std::move(factory)); }
diff --git "a/infra/config/generated/builders/ci/Mac FYI arm64 Release \050Apple DTK\051/properties.textpb" b/infra/config/generated/builders/ci/GPU FYI Mac arm64 Builder/properties.textpb similarity index 100% rename from "infra/config/generated/builders/ci/Mac FYI arm64 Release \050Apple DTK\051/properties.textpb" rename to infra/config/generated/builders/ci/GPU FYI Mac arm64 Builder/properties.textpb
diff --git "a/infra/config/generated/builders/ci/Mac FYI Release \050Apple M1\051/properties.textpb" "b/infra/config/generated/builders/ci/Mac FYI Release \050Apple M1\051/properties.textpb" new file mode 100644 index 0000000..c9c5da1 --- /dev/null +++ "b/infra/config/generated/builders/ci/Mac FYI Release \050Apple M1\051/properties.textpb"
@@ -0,0 +1,18 @@ +{ + "$kitchen": { + "devshell": true, + "git_auth": true + }, + "$recipe_engine/isolated": { + "server": "https://isolateserver.appspot.com" + }, + "$recipe_engine/resultdb/test_presentation": { + "column_keys": [], + "grouping_keys": [ + "status", + "v.test_suite" + ] + }, + "perf_dashboard_machine_group": "ChromiumGPUFYI", + "recipe": "chromium" +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-archive-tagged/properties.textpb b/infra/config/generated/builders/ci/linux-archive-tagged/properties.textpb new file mode 100644 index 0000000..480a1ff --- /dev/null +++ b/infra/config/generated/builders/ci/linux-archive-tagged/properties.textpb
@@ -0,0 +1,23 @@ +{ + "$build/goma": { + "enable_ats": true, + "rpc_extra_params": "?prod", + "server_host": "goma.chromium.org", + "use_luci_auth": true + }, + "$kitchen": { + "devshell": true, + "git_auth": true + }, + "$recipe_engine/isolated": { + "server": "https://isolateserver.appspot.com" + }, + "$recipe_engine/resultdb/test_presentation": { + "column_keys": [], + "grouping_keys": [ + "status", + "v.test_suite" + ] + }, + "recipe": "chromium" +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/gpu-fyi-try-mac-arm64-apple-dtk-rel/properties.textpb b/infra/config/generated/builders/try/gpu-fyi-try-mac-arm64-apple-m1-rel/properties.textpb similarity index 100% rename from infra/config/generated/builders/try/gpu-fyi-try-mac-arm64-apple-dtk-rel/properties.textpb rename to infra/config/generated/builders/try/gpu-fyi-try-mac-arm64-apple-m1-rel/properties.textpb
diff --git a/infra/config/generated/builders/try/linux-rel-orchestrator/properties.textpb b/infra/config/generated/builders/try/linux-rel-orchestrator/properties.textpb index a9194bf..e8af8a0 100644 --- a/infra/config/generated/builders/try/linux-rel-orchestrator/properties.textpb +++ b/infra/config/generated/builders/try/linux-rel-orchestrator/properties.textpb
@@ -30,7 +30,5 @@ "v.test_suite" ] }, - "compilator": "linux-rel-compilator", - "compilator_watcher_git_revision": "ac4c95a90ea18c8ce70865c667a04ba18dfca1cd", "recipe": "chromium/orchestrator" } \ No newline at end of file
diff --git a/infra/config/generated/builders/try/win10-rel-orchestrator/properties.textpb b/infra/config/generated/builders/try/win10-rel-orchestrator/properties.textpb index 65ce93b..658a4c9 100644 --- a/infra/config/generated/builders/try/win10-rel-orchestrator/properties.textpb +++ b/infra/config/generated/builders/try/win10-rel-orchestrator/properties.textpb
@@ -30,7 +30,5 @@ "v.test_suite" ] }, - "compilator": "win10-rel-compilator", - "compilator_watcher_git_revision": "ac4c95a90ea18c8ce70865c667a04ba18dfca1cd", "recipe": "chromium/orchestrator" } \ No newline at end of file
diff --git a/infra/config/generated/luci/commit-queue.cfg b/infra/config/generated/luci/commit-queue.cfg index c184975..71c9cb11 100644 --- a/infra/config/generated/luci/commit-queue.cfg +++ b/infra/config/generated/luci/commit-queue.cfg
@@ -888,7 +888,7 @@ includable_only: true } builders { - name: "chromium/try/gpu-fyi-try-mac-arm64-apple-dtk-rel" + name: "chromium/try/gpu-fyi-try-mac-arm64-apple-m1-rel" includable_only: true } builders {
diff --git a/infra/config/generated/luci/cr-buildbucket.cfg b/infra/config/generated/luci/cr-buildbucket.cfg index e0390c8..be5dca0 100644 --- a/infra/config/generated/luci/cr-buildbucket.cfg +++ b/infra/config/generated/luci/cr-buildbucket.cfg
@@ -7665,6 +7665,95 @@ } } builders { + name: "GPU FYI Mac arm64 Builder" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "builder:GPU FYI Mac arm64 Builder" + dimensions: "cpu:x86-64" + dimensions: "os:Mac" + dimensions: "pool:luci.chromium.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" + cipd_version: "refs/heads/main" + cmd: "luciexe" + } + properties: + '{' + ' "$build/goma": {' + ' "rpc_extra_params": "?prod",' + ' "server_host": "goma.chromium.org",' + ' "use_luci_auth": true' + ' },' + ' "$kitchen": {' + ' "devshell": true,' + ' "git_auth": true' + ' },' + ' "$recipe_engine/isolated": {' + ' "server": "https://isolateserver.appspot.com"' + ' },' + ' "$recipe_engine/resultdb/test_presentation": {' + ' "column_keys": [],' + ' "grouping_keys": [' + ' "status",' + ' "v.test_suite"' + ' ]' + ' },' + ' "builder_group": "chromium.gpu.fyi",' + ' "perf_dashboard_machine_group": "ChromiumGPUFYI",' + ' "recipe": "chromium",' + ' "sheriff_rotations": [' + ' "chromium.gpu"' + ' ]' + '}' + execution_timeout_secs: 21600 + build_numbers: YES + service_account: "chromium-ci-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" + experiments { + key: "chromium.chromium_tests.use_gitiles_trigger" + value: 100 + } + experiments { + key: "chromium.chromium_tests.use_rdb_results" + value: 100 + } + experiments { + key: "luci.use_realms" + value: 100 + } + resultdb { + enable: true + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "ci_test_results" + test_results {} + } + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "gpu_ci_test_results" + test_results { + predicate { + test_id_regexp: "ninja://(chrome/test:|content/test:fuchsia_)telemetry_gpu_integration_test[^/]*/.+" + } + } + } + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "blink_web_tests_ci_test_results" + test_results { + predicate { + test_id_regexp: "ninja://[^/]*blink_web_tests/.+" + } + } + } + history_options { + use_invocation_timestamp: true + } + } + } + builders { name: "GPU FYI Win Builder" swarming_host: "chromium-swarm.appspot.com" swarming_tags: "vpython:native-python-wrapper" @@ -16037,6 +16126,92 @@ } } builders { + name: "Mac FYI Release (Apple M1)" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "builderless:1" + dimensions: "cores:2" + dimensions: "cpu:x86-64" + dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.chromium.gpu.ci" + dimensions: "ssd:0" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" + cipd_version: "refs/heads/main" + cmd: "luciexe" + } + properties: + '{' + ' "$kitchen": {' + ' "devshell": true,' + ' "git_auth": true' + ' },' + ' "$recipe_engine/isolated": {' + ' "server": "https://isolateserver.appspot.com"' + ' },' + ' "$recipe_engine/resultdb/test_presentation": {' + ' "column_keys": [],' + ' "grouping_keys": [' + ' "status",' + ' "v.test_suite"' + ' ]' + ' },' + ' "builder_group": "chromium.gpu.fyi",' + ' "perf_dashboard_machine_group": "ChromiumGPUFYI",' + ' "recipe": "chromium",' + ' "sheriff_rotations": [' + ' "chromium.gpu"' + ' ]' + '}' + execution_timeout_secs: 21600 + build_numbers: YES + service_account: "chromium-ci-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" + experiments { + key: "chromium.chromium_tests.use_gitiles_trigger" + value: 100 + } + experiments { + key: "chromium.chromium_tests.use_rdb_results" + value: 100 + } + experiments { + key: "luci.use_realms" + value: 100 + } + resultdb { + enable: true + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "ci_test_results" + test_results {} + } + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "gpu_ci_test_results" + test_results { + predicate { + test_id_regexp: "ninja://(chrome/test:|content/test:fuchsia_)telemetry_gpu_integration_test[^/]*/.+" + } + } + } + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "blink_web_tests_ci_test_results" + test_results { + predicate { + test_id_regexp: "ninja://[^/]*blink_web_tests/.+" + } + } + } + history_options { + use_invocation_timestamp: true + } + } + } + builders { name: "Mac FYI Release (Intel UHD 630)" swarming_host: "chromium-swarm.appspot.com" swarming_tags: "vpython:native-python-wrapper" @@ -16553,95 +16728,6 @@ } } builders { - name: "Mac FYI arm64 Release (Apple DTK)" - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "builder:Mac FYI arm64 Release (Apple DTK)" - dimensions: "cpu:x86-64" - dimensions: "os:Mac" - dimensions: "pool:luci.chromium.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" - cipd_version: "refs/heads/main" - cmd: "luciexe" - } - properties: - '{' - ' "$build/goma": {' - ' "rpc_extra_params": "?prod",' - ' "server_host": "goma.chromium.org",' - ' "use_luci_auth": true' - ' },' - ' "$kitchen": {' - ' "devshell": true,' - ' "git_auth": true' - ' },' - ' "$recipe_engine/isolated": {' - ' "server": "https://isolateserver.appspot.com"' - ' },' - ' "$recipe_engine/resultdb/test_presentation": {' - ' "column_keys": [],' - ' "grouping_keys": [' - ' "status",' - ' "v.test_suite"' - ' ]' - ' },' - ' "builder_group": "chromium.gpu.fyi",' - ' "perf_dashboard_machine_group": "ChromiumGPUFYI",' - ' "recipe": "chromium",' - ' "sheriff_rotations": [' - ' "chromium.gpu"' - ' ]' - '}' - execution_timeout_secs: 21600 - build_numbers: YES - service_account: "chromium-ci-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" - experiments { - key: "chromium.chromium_tests.use_gitiles_trigger" - value: 100 - } - experiments { - key: "chromium.chromium_tests.use_rdb_results" - value: 100 - } - experiments { - key: "luci.use_realms" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "ci_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_ci_test_results" - test_results { - predicate { - test_id_regexp: "ninja://(chrome/test:|content/test:fuchsia_)telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_ci_test_results" - test_results { - predicate { - test_id_regexp: "ninja://[^/]*blink_web_tests/.+" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { name: "Mac Pro FYI Release (AMD)" swarming_host: "chromium-swarm.appspot.com" swarming_tags: "vpython:native-python-wrapper" @@ -36734,6 +36820,97 @@ } } builders { + name: "linux-archive-tagged" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "builderless:1" + dimensions: "cores:32" + dimensions: "cpu:x86-64" + dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.chromium.ci" + dimensions: "ssd:0" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" + cipd_version: "refs/heads/main" + cmd: "luciexe" + } + properties: + '{' + ' "$build/goma": {' + ' "enable_ats": true,' + ' "rpc_extra_params": "?prod",' + ' "server_host": "goma.chromium.org",' + ' "use_luci_auth": true' + ' },' + ' "$kitchen": {' + ' "devshell": true,' + ' "git_auth": true' + ' },' + ' "$recipe_engine/isolated": {' + ' "server": "https://isolateserver.appspot.com"' + ' },' + ' "$recipe_engine/resultdb/test_presentation": {' + ' "column_keys": [],' + ' "grouping_keys": [' + ' "status",' + ' "v.test_suite"' + ' ]' + ' },' + ' "builder_group": "chromium",' + ' "recipe": "chromium",' + ' "sheriff_rotations": [' + ' "chromium"' + ' ]' + '}' + execution_timeout_secs: 10800 + build_numbers: YES + service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" + experiments { + key: "chromium.chromium_tests.use_gitiles_trigger" + value: 100 + } + experiments { + key: "chromium.chromium_tests.use_rdb_results" + value: 100 + } + experiments { + key: "luci.use_realms" + value: 100 + } + resultdb { + enable: true + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "ci_test_results" + test_results {} + } + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "gpu_ci_test_results" + test_results { + predicate { + test_id_regexp: "ninja://(chrome/test:|content/test:fuchsia_)telemetry_gpu_integration_test[^/]*/.+" + } + } + } + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "blink_web_tests_ci_test_results" + test_results { + predicate { + test_id_regexp: "ninja://[^/]*blink_web_tests/.+" + } + } + } + history_options { + use_invocation_timestamp: true + } + } + } + builders { name: "linux-ash-chromium-builder-fyi-rel" swarming_host: "chromium-swarm.appspot.com" swarming_tags: "vpython:native-python-wrapper" @@ -64500,13 +64677,13 @@ } } builders { - name: "gpu-fyi-try-mac-arm64-apple-dtk-rel" + name: "gpu-fyi-try-mac-arm64-apple-m1-rel" swarming_host: "chromium-swarm.appspot.com" swarming_tags: "vpython:native-python-wrapper" dimensions: "builderless:1" dimensions: "cpu:x86-64" dimensions: "os:Mac" - dimensions: "pool:luci.chromium.gpu.mac.arm64.apple.dtk.try" + dimensions: "pool:luci.chromium.gpu.mac.arm64.apple.m1.try" exe { cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" cipd_version: "refs/heads/main" @@ -72742,8 +72919,6 @@ ' ]' ' },' ' "builder_group": "tryserver.chromium.linux",' - ' "compilator": "linux-rel-compilator",' - ' "compilator_watcher_git_revision": "ac4c95a90ea18c8ce70865c667a04ba18dfca1cd",' ' "recipe": "chromium/orchestrator"' '}' execution_timeout_secs: 14400 @@ -82000,8 +82175,6 @@ ' ]' ' },' ' "builder_group": "tryserver.chromium.win",' - ' "compilator": "win10-rel-compilator",' - ' "compilator_watcher_git_revision": "ac4c95a90ea18c8ce70865c667a04ba18dfca1cd",' ' "recipe": "chromium/orchestrator"' '}' execution_timeout_secs: 14400
diff --git a/infra/config/generated/luci/luci-milo.cfg b/infra/config/generated/luci/luci-milo.cfg index d7879ba..8d8c3f5c 100644 --- a/infra/config/generated/luci/luci-milo.cfg +++ b/infra/config/generated/luci/luci-milo.cfg
@@ -46,6 +46,11 @@ short_name: "off" } builders { + name: "buildbucket/luci.chromium.ci/linux-archive-tagged" + category: "chromium|linux" + short_name: "tag" + } + builders { name: "buildbucket/luci.chromium.ci/mac-archive-dbg" category: "chromium|mac" short_name: "dbg" @@ -2615,6 +2620,11 @@ short_name: "off" } builders { + name: "buildbucket/luci.chromium.ci/linux-archive-tagged" + category: "linux" + short_name: "tag" + } + builders { name: "buildbucket/luci.chromium.ci/mac-archive-dbg" category: "mac" short_name: "dbg" @@ -8117,11 +8127,6 @@ short_name: "asn" } builders { - name: "buildbucket/luci.chromium.ci/Mac FYI arm64 Release (Apple DTK)" - category: "Mac" - short_name: "dtk" - } - builders { name: "buildbucket/luci.chromium.ci/GPU FYI Mac Builder" category: "Mac|Builder" short_name: "rel" @@ -8132,6 +8137,11 @@ short_name: "dbg" } builders { + name: "buildbucket/luci.chromium.ci/GPU FYI Mac arm64 Builder" + category: "Mac|Builder" + short_name: "arm" + } + builders { name: "buildbucket/luci.chromium.ci/Mac Pro FYI Release (AMD)" category: "Mac|AMD|Pro" short_name: "rel" @@ -8152,6 +8162,11 @@ short_name: "exp" } builders { + name: "buildbucket/luci.chromium.ci/Mac FYI Release (Apple M1)" + category: "Mac|Apple" + short_name: "rel" + } + builders { name: "buildbucket/luci.chromium.ci/Mac FYI Release (Intel)" category: "Mac|Intel" short_name: "rel" @@ -14345,7 +14360,7 @@ name: "buildbucket/luci.chromium.try/gpu-fyi-try-mac-amd-retina-rel" } builders { - name: "buildbucket/luci.chromium.try/gpu-fyi-try-mac-arm64-apple-dtk-rel" + name: "buildbucket/luci.chromium.try/gpu-fyi-try-mac-arm64-apple-m1-rel" } builders { name: "buildbucket/luci.chromium.try/gpu-fyi-try-mac-asan" @@ -15732,7 +15747,7 @@ name: "buildbucket/luci.chromium.try/gpu-fyi-try-mac-amd-retina-rel" } builders { - name: "buildbucket/luci.chromium.try/gpu-fyi-try-mac-arm64-apple-dtk-rel" + name: "buildbucket/luci.chromium.try/gpu-fyi-try-mac-arm64-apple-m1-rel" } builders { name: "buildbucket/luci.chromium.try/gpu-fyi-try-mac-asan"
diff --git a/infra/config/generated/luci/luci-scheduler.cfg b/infra/config/generated/luci/luci-scheduler.cfg index 90e674b0..acaa289 100644 --- a/infra/config/generated/luci/luci-scheduler.cfg +++ b/infra/config/generated/luci/luci-scheduler.cfg
@@ -1196,6 +1196,16 @@ } } job { + id: "GPU FYI Mac arm64 Builder" + realm: "ci" + acl_sets: "ci" + buildbucket { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "GPU FYI Mac arm64 Builder" + } +} +job { id: "GPU FYI Win Builder" realm: "ci" acl_sets: "ci" @@ -2417,6 +2427,20 @@ } } job { + id: "Mac FYI Release (Apple M1)" + realm: "ci" + acls { + role: TRIGGERER + granted_to: "chromium-ci-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" + } + acl_sets: "ci" + buildbucket { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Mac FYI Release (Apple M1)" + } +} +job { id: "Mac FYI Release (Intel UHD 630)" realm: "ci" acls { @@ -2501,16 +2525,6 @@ } } job { - id: "Mac FYI arm64 Release (Apple DTK)" - realm: "ci" - acl_sets: "ci" - buildbucket { - server: "cr-buildbucket.appspot.com" - bucket: "luci.chromium.ci" - builder: "Mac FYI arm64 Release (Apple DTK)" - } -} -job { id: "Mac M1 Builder (dbg) Goma RBE Canary (clobber)" realm: "goma" acl_sets: "goma" @@ -5588,6 +5602,17 @@ } } job { + id: "linux-archive-tagged" + realm: "ci" + schedule: "triggered" + acl_sets: "ci" + buildbucket { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "linux-archive-tagged" + } +} +job { id: "linux-ash-chromium-builder-fyi-rel" realm: "ci" acl_sets: "ci" @@ -7205,6 +7230,7 @@ triggers: "GPU FYI Linux dEQP Builder" triggers: "GPU FYI Mac Builder" triggers: "GPU FYI Mac Builder (dbg)" + triggers: "GPU FYI Mac arm64 Builder" triggers: "GPU FYI Win Builder" triggers: "GPU FYI Win x64 Builder" triggers: "GPU FYI Win x64 Builder (dbg)" @@ -7262,7 +7288,6 @@ triggers: "Mac Builder (reclient)" triggers: "Mac Builder Next" triggers: "Mac FYI GPU ASAN Release" - triggers: "Mac FYI arm64 Release (Apple DTK)" triggers: "Mac deterministic" triggers: "Mac deterministic (dbg)" triggers: "Mojo Android"
diff --git a/infra/config/subprojects/chromium/ci.star b/infra/config/subprojects/chromium/ci.star index e12c437..84b8f0c 100644 --- a/infra/config/subprojects/chromium/ci.star +++ b/infra/config/subprojects/chromium/ci.star
@@ -1529,6 +1529,20 @@ ) ci.chromium_builder( + name = "linux-archive-tagged", + console_view_entry = consoles.console_view_entry( + category = "linux", + short_name = "tag", + ), + cores = 32, + main_console_view = "main", + os = os.LINUX_BIONIC_REMOVE, + tree_closing = False, + schedule = "triggered", + triggered_by = [], +) + +ci.chromium_builder( name = "linux-official", branch_selector = branches.STANDARD_MILESTONE, builderless = False, @@ -4926,14 +4940,6 @@ ) ci.gpu_fyi_mac_builder( - name = "Mac FYI arm64 Release (Apple DTK)", - console_view_entry = consoles.console_view_entry( - category = "Mac", - short_name = "dtk", - ), -) - -ci.gpu_fyi_mac_builder( name = "Mac FYI GPU ASAN Release", console_view_entry = consoles.console_view_entry( category = "Mac", @@ -4957,6 +4963,14 @@ ), ) +ci.gpu_fyi_mac_builder( + name = "GPU FYI Mac arm64 Builder", + console_view_entry = consoles.console_view_entry( + category = "Mac|Builder", + short_name = "arm", + ), +) + ci.gpu_fyi_thin_tester( name = "Lacros FYI x64 Release (AMD)", console_view_entry = consoles.console_view_entry( @@ -5118,6 +5132,15 @@ ) ci.gpu_fyi_thin_tester( + name = "Mac FYI Release (Apple M1)", + console_view_entry = consoles.console_view_entry( + category = "Mac|Apple", + short_name = "rel", + ), + triggered_by = ["GPU FYI Mac arm64 Builder"], +) + +ci.gpu_fyi_thin_tester( name = "Mac FYI Release (Intel)", console_view_entry = consoles.console_view_entry( category = "Mac|Intel",
diff --git a/infra/config/subprojects/chromium/gpu.try.star b/infra/config/subprojects/chromium/gpu.try.star index 1d50550..b1df355 100644 --- a/infra/config/subprojects/chromium/gpu.try.star +++ b/infra/config/subprojects/chromium/gpu.try.star
@@ -254,8 +254,8 @@ ) gpu_mac_builder( - name = "gpu-fyi-try-mac-arm64-apple-dtk-rel", - pool = "luci.chromium.gpu.mac.arm64.apple.dtk.try", + name = "gpu-fyi-try-mac-arm64-apple-m1-rel", + pool = "luci.chromium.gpu.mac.arm64.apple.m1.try", ) gpu_mac_builder(
diff --git a/infra/config/subprojects/chromium/try.star b/infra/config/subprojects/chromium/try.star index 01b0f6f..942761fb 100644 --- a/infra/config/subprojects/chromium/try.star +++ b/infra/config/subprojects/chromium/try.star
@@ -1342,10 +1342,6 @@ use_clang_coverage = True, coverage_test_types = ["unit", "overall"], properties = { - # TODO (kimstephanie): Remove first two when orchestrator recipe stops - # reading these - "compilator": "linux-rel-compilator", - "compilator_watcher_git_revision": compilator_watcher_git_revision, "$build/chromium_orchestrator": { "compilator": "linux-rel-compilator", "compilator_watcher_git_revision": compilator_watcher_git_revision, @@ -1977,10 +1973,6 @@ use_clang_coverage = True, coverage_test_types = ["unit", "overall"], properties = { - # TODO (kimstephanie): Remove first two when orchestrator recipe stops - # reading these - "compilator": "win10-rel-compilator", - "compilator_watcher_git_revision": compilator_watcher_git_revision, "$build/chromium_orchestrator": { "compilator": "win10-rel-compilator", "compilator_watcher_git_revision": compilator_watcher_git_revision,
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm index aad6fafd..0ef5b97 100644 --- a/ios/chrome/browser/flags/about_flags.mm +++ b/ios/chrome/browser/flags/about_flags.mm
@@ -218,12 +218,6 @@ {"Native UI", kDiscoverFeedInNtpEnableNativeUI, base::size(kDiscoverFeedInNtpEnableNativeUI), nullptr}}; -const FeatureEntry::FeatureParam kRefactoredNTPLogging[] = { - {kRefactoredNTPLoggingEnabled, "true"}}; -const FeatureEntry::FeatureVariation kRefactoredNTPLoggingVariations[] = { - {"Logging Enabled", kRefactoredNTPLogging, - base::size(kRefactoredNTPLogging), nullptr}}; - const FeatureEntry::FeatureParam kStartSurfaceTenSecondsShrinkLogo[] = { {kStartSurfaceShrinkLogoParam, "true"}, {kReturnToStartSurfaceInactiveDurationInSeconds, "10"}}; @@ -455,11 +449,6 @@ FEATURE_WITH_PARAMS_VALUE_TYPE(kDiscoverFeedInNtp, kDiscoverFeedInNtpVariations, "IOSDiscoverFeed")}, - {"refactored-ntp", flag_descriptions::kRefactoredNTPName, - flag_descriptions::kRefactoredNTPDescription, flags_ui::kOsIos, - FEATURE_WITH_PARAMS_VALUE_TYPE(kRefactoredNTP, - kRefactoredNTPLoggingVariations, - "RefactoredNTP")}, {"expanded-tab-strip", flag_descriptions::kExpandedTabStripName, flag_descriptions::kExpandedTabStripDescription, flags_ui::kOsIos, FEATURE_VALUE_TYPE(kExpandedTabStrip)},
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc index 4eb2e35..7f2a9a1 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
@@ -365,11 +365,6 @@ "When enabled, a Messages prompt may be presented to allow the user to " "save the current page to Reading List"; -const char kRefactoredNTPName[] = "Enables refactored new tab page"; -const char kRefactoredNTPDescription[] = - "When enabled, the new tab page is replaced with the refactored version, " - "which changes the ownership and containment of views."; - const char kRestoreGaiaCookiesOnUserActionName[] = "Restore GAIA cookies on user action"; const char kRestoreGaiaCookiesOnUserActionDescription[] =
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h index 310d01e..3277d328 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
@@ -313,10 +313,6 @@ extern const char kReadingListMessagesName[]; extern const char kReadingListMessagesDescription[]; -// Title and description for the flag that enables the refactored new tab page. -extern const char kRefactoredNTPName[]; -extern const char kRefactoredNTPDescription[]; - // Title and description for the flag that makes Safe Browsing available. extern const char kSafeBrowsingAvailableName[]; extern const char kSafeBrowsingAvailableDescription[];
diff --git a/ios/chrome/browser/policy/policy_egtest.mm b/ios/chrome/browser/policy/policy_egtest.mm index 3e323bea..cab2811 100644 --- a/ios/chrome/browser/policy/policy_egtest.mm +++ b/ios/chrome/browser/policy/policy_egtest.mm
@@ -414,7 +414,6 @@ AppLaunchConfiguration config = [self appConfigurationForTestCase]; config.relaunch_policy = ForceRelaunchByCleanShutdown; config.features_enabled.push_back(kDiscoverFeedInNtp); - config.features_enabled.push_back(kRefactoredNTP); [[AppLaunchManager sharedManager] ensureAppLaunchedWithConfiguration:config]; NSString* feedTitle = l10n_util::GetNSString(IDS_IOS_DISCOVER_FEED_TITLE);
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm index ce0d342d..f1ee1ab 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm
@@ -81,8 +81,6 @@ #include "ios/chrome/grit/ios_strings.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" #import "ios/public/provider/chrome/browser/discover_feed/discover_feed_provider.h" -#import "ios/web/public/navigation/navigation_item.h" -#import "ios/web/public/navigation/navigation_manager.h" #import "ios/web/public/web_state.h" #import "ui/base/l10n/l10n_util_mac.h" @@ -125,11 +123,6 @@ @property(nonatomic, assign) AuthenticationService* authService; // Coordinator in charge of handling sharing use cases. @property(nonatomic, strong) SharingCoordinator* sharingCoordinator; -// YES if the feedShown method has already been called. -// TODO(crbug.com/1126940): The coordinator shouldn't be keeping track of this -// for its |self.discoverFeedViewController| remove once we have an appropriate -// callback. -@property(nonatomic, assign) BOOL feedShownWasCalled; @end @@ -242,22 +235,8 @@ self.headerController.promoCanShow = [self.contentSuggestionsMediator notificationPromo]->CanShow(); - // Offset to maintain Discover feed scroll position. - CGFloat offset = 0; - if (IsDiscoverFeedEnabled() && !IsRefactoredNTP()) { - web::NavigationManager* navigationManager = - self.webState->GetNavigationManager(); - if (navigationManager) { - web::NavigationItem* item = navigationManager->GetVisibleItem(); - if (item) { - offset = item->GetPageDisplayState().scroll_state().content_offset().y; - } - } - } - self.suggestionsViewController = [[ContentSuggestionsViewController alloc] - initWithStyle:CollectionViewControllerStyleDefault - offset:offset]; + initWithStyle:CollectionViewControllerStyleDefault]; [self.suggestionsViewController setDataSource:self.contentSuggestionsMediator]; self.suggestionsViewController.suggestionCommandHandler = self.ntpMediator; @@ -364,13 +343,6 @@ _discoverFeedHeaderMenuButton = menuButton; } -- (void)discoverFeedShown { - if (IsDiscoverFeedEnabled() && !self.feedShownWasCalled) { - ios::GetChromeBrowserProvider().GetDiscoverFeedProvider()->FeedWasShown(); - self.feedShownWasCalled = YES; - } -} - - (void)viewDidDisappear { if (ShouldShowReturnToMostRecentTabForStartSurface()) { [self.contentSuggestionsMediator hideRecentTabTile];
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_layout.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_layout.h index fc4ee5f..7ccb1fe 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_layout.h +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_layout.h
@@ -15,12 +15,6 @@ // is pinned to the top of the collection. @interface ContentSuggestionsLayout : MDCCollectionViewFlowLayout -// The cached scroll position of the NTP. -@property(nonatomic, assign) CGFloat offset; - -// The total scroll height of the NTP. -@property(nonatomic, assign) CGFloat ntpHeight; - // The parent collection view that contains the content suggestions collection // view. @property(nonatomic, weak) UICollectionView* parentCollectionView; @@ -32,11 +26,6 @@ // the omnibox to allow it to stick to the top of the NTP. @property(nonatomic, assign) BOOL isScrolledIntoFeed; -// Creates layout with |offset| as additional height. Allows the view's height -// to be increased enough to maintain the scroll position. Only needed if -// Discover feed is visible. -- (instancetype)initWithOffset:(CGFloat)offset; - // Minimum height of the NTP scroll view to allow for scrolling to omnibox. - (CGFloat)minimumNTPHeight;
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_layout.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_layout.mm index feed631..652a01d 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_layout.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_layout.mm
@@ -17,13 +17,6 @@ @implementation ContentSuggestionsLayout -- (instancetype)initWithOffset:(CGFloat)offset { - if (self = [super init]) { - _offset = offset; - } - return self; -} - - (CGFloat)minimumNTPHeight { CGFloat collectionViewHeight = self.parentCollectionView.bounds.size.height; CGFloat headerHeight = [self firstHeaderHeight]; @@ -33,9 +26,9 @@ // NTP bottom bar. This allows the Most Visited cells to be scrolled up to the // top of the screen. Also computes the total NTP scrolling height for // Discover infinite feed. - self.ntpHeight = collectionViewHeight + headerHeight; + CGFloat ntpHeight = collectionViewHeight + headerHeight; CGFloat minimumHeight = - self.ntpHeight - ntp_header::kScrolledToTopOmniboxBottomMargin; + ntpHeight - ntp_header::kScrolledToTopOmniboxBottomMargin; CGFloat topSafeArea = self.collectionView.safeAreaInsets.top; if (!IsRegularXRegularSizeClass(self.collectionView)) { CGFloat toolbarHeight = @@ -46,7 +39,7 @@ CGFloat additionalHeight = toolbarHeight + topSafeArea + self.collectionView.contentInset.bottom; minimumHeight -= additionalHeight; - self.ntpHeight += additionalHeight; + ntpHeight += additionalHeight; } return minimumHeight;
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm index ffdd350..7926570 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm
@@ -295,9 +295,7 @@ [sectionsInfo addObject:self.mostVisitedSectionInfo]; - // TODO(crbug.com/1105624): Observe the kArticlesForYouEnabled Pref in order - // to hide the DiscoverFeed section if the finch flag is enabled. - if (IsDiscoverFeedEnabled() && self.contentSuggestionsEnabled) { + if (self.contentSuggestionsEnabled) { [sectionsInfo addObject:self.discoverSectionInfo]; } @@ -399,7 +397,6 @@ // Replaces the Most Visited items currently displayed by the most recent ones. - (void)useFreshMostVisited { self.mostVisitedItems = self.freshMostVisitedItems; - if (IsDiscoverFeedEnabled()) { // All data needs to be reloaded in order to force a re-layout, this is // cheaper since the Feed is not part of this ViewController when Discover // is enabled. @@ -407,9 +404,6 @@ // TODO(crbug.com/1170995): Potentially remove once ContentSuggestions can // be added as part of a header. [self.discoverFeedDelegate contentSuggestionsWasUpdated]; - } else { - [self.dataSink reloadSection:self.mostVisitedSectionInfo]; - } } #pragma mark - Properties
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h index 9ab307a..2ff029cd 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h
@@ -32,10 +32,8 @@ : CollectionViewController <ContentSuggestionsCollectionControlling, ThumbStripSupporting> -// Inits view controller with |offset| to maintain scroll position if needed. -// Offset is only required if Discover feed is visible. +// Inits view controller with |style|. - (instancetype)initWithStyle:(CollectionViewControllerStyle)style - offset:(CGFloat)offset NS_DESIGNATED_INITIALIZER; - (instancetype)initWithLayout:(UICollectionViewLayout*)layout @@ -95,9 +93,6 @@ - (void)updateConstraints; // Clear the overscroll actions. - (void)clearOverscroll; -// Sets the collection contentOffset to |offset|, or caches the value and -// applies it after the first layout. -- (void)setContentOffset:(CGFloat)offset; @end
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm index fb1f381..ddd3cbea 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
@@ -48,15 +48,11 @@ const CGFloat kMostVisitedBottomMargin = 13; const CGFloat kCardBorderRadius = 11; const CGFloat kDiscoverFeedContentWith = 430; -// Value representing offset from bottom of the page to trigger pagination. -const CGFloat kPaginationOffset = 800; // Height for the Discover Feed section header. const CGFloat kDiscoverFeedFeaderHeight = 30; } -@interface ContentSuggestionsViewController ()<UIGestureRecognizerDelegate> { - CGFloat _initialContentOffset; -} +@interface ContentSuggestionsViewController () <UIGestureRecognizerDelegate> @property(nonatomic, strong) ContentSuggestionsCollectionUpdater* collectionUpdater; @@ -65,13 +61,6 @@ @property(nonatomic, strong) OverscrollActionsController* overscrollActionsController; -// Navigation offset applied to the layout height to maintain the scroll -// position, since the feed height is dynamic. -@property(nonatomic) CGFloat offset; - -// The CollectionViewController scroll position when an scrolling event starts. -@property(nonatomic, assign) int scrollStartPosition; - // The layout of the content suggestions collection view. @property(nonatomic, strong) ContentSuggestionsLayout* layout; @@ -90,14 +79,11 @@ #pragma mark - Lifecycle -- (instancetype)initWithStyle:(CollectionViewControllerStyle)style - offset:(CGFloat)offset { - _offset = offset; - _layout = [[ContentSuggestionsLayout alloc] initWithOffset:offset]; +- (instancetype)initWithStyle:(CollectionViewControllerStyle)style { + _layout = [[ContentSuggestionsLayout alloc] init]; self = [super initWithLayout:_layout style:style]; if (self) { _collectionUpdater = [[ContentSuggestionsCollectionUpdater alloc] init]; - _initialContentOffset = NAN; _discoverFeedHeaderDelegate = _collectionUpdater; } return self; @@ -193,14 +179,6 @@ [self.overscrollActionsController clear]; } -- (void)setContentOffset:(CGFloat)offset { - _initialContentOffset = offset; - if (self.isViewLoaded && self.collectionView.window && - self.collectionView.contentSize.height != 0) { - [self applyContentOffset]; - } -} - #pragma mark - UIViewController - (void)viewDidLoad { @@ -264,20 +242,9 @@ // Resize the collection as it might have been rotated while not being // presented (e.g. rotation on stack view). [self updateConstraints]; - // Remove forced height if it was already applied, since the scroll position - // was already maintained. - if (self.offset > 0) { - self.layout.offset = 0; - } - [self.bubblePresenter presentDiscoverFeedHeaderTipBubble]; } -- (void)viewDidLayoutSubviews { - [super viewDidLayoutSubviews]; - [self applyContentOffset]; -} - - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; self.headerSynchronizer.showing = NO; @@ -618,7 +585,6 @@ - (void)scrollViewWillBeginDragging:(UIScrollView*)scrollView { [self.overscrollActionsController scrollViewWillBeginDragging:scrollView]; [self.panGestureHandler scrollViewWillBeginDragging:scrollView]; - self.scrollStartPosition = scrollView.contentOffset.y; } - (void)scrollViewDidEndDragging:(UIScrollView*)scrollView @@ -729,47 +695,9 @@ [self.collectionView insertItemsAtIndexPaths:@[ emptyItem ]]; } -// Sets the collectionView's contentOffset if |_initialContentOffset| is set. -- (void)applyContentOffset { - if (!isnan(_initialContentOffset)) { - UICollectionView* collection = self.collectionView; - // Don't set the offset such as the content of the collection is smaller - // than the part of the collection which should be displayed with that - // offset, taking into account the size of the toolbar. - CGFloat offset = MAX( - 0, MIN(_initialContentOffset, - collection.contentSize.height - collection.bounds.size.height - - ToolbarExpandedHeight( - self.traitCollection.preferredContentSizeCategory) + - collection.contentInset.bottom)); - if (collection.contentOffset.y != offset) { - collection.contentOffset = CGPointMake(0, offset); - // Update the constraints in case the omnibox needs to be moved. - [self updateConstraints]; - } - } - _initialContentOffset = NAN; -} - // Opens top-level feed menu when pressing |menuButton|. - (void)openDiscoverFeedMenu { [self.discoverFeedMenuHandler openDiscoverFeedMenu]; } -// Evaluates whether or not another set of Discover feed articles should be -// fetched when scrolling. -- (BOOL)shouldTriggerInfiniteFeed:(UIScrollView*)scrollView { - float scrollPosition = - scrollView.contentOffset.y + scrollView.frame.size.height; - // Check if view is bouncing to ignore overscoll positions for infinite feed - // triggering. - BOOL isBouncing = - (scrollView.contentOffset.y >= - (scrollView.contentSize.height - scrollView.bounds.size.height)); - ContentSuggestionsLayout* layout = static_cast<ContentSuggestionsLayout*>( - self.collectionView.collectionViewLayout); - return (scrollPosition > scrollView.contentSize.height - kPaginationOffset && - scrollPosition > layout.ntpHeight && !isBouncing); -} - @end
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_audience.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_audience.h index 920bcc8f..a452f96 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_audience.h +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller_audience.h
@@ -15,11 +15,6 @@ // provides a reference to the button. - (void)discoverHeaderMenuButtonShown:(UIView*)menuButton; -// Notifies the audience that the Discover Feed has been shown. -// TODO(crbug.com/1126940): This is still a best effort approach and might be -// called multiple times. -- (void)discoverFeedShown; - // Notifies the audience of the UIKit viewDidDisappear: callback. - (void)viewDidDisappear;
diff --git a/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm b/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm index 8ac190a..e24ee451 100644 --- a/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm +++ b/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm
@@ -131,7 +131,6 @@ config.additional_args.push_back(std::string("--") + switches::kEnableDiscoverFeed); config.features_enabled.push_back(kDiscoverFeedInNtp); - config.features_enabled.push_back(kRefactoredNTP); config.features_disabled.push_back(kStartSurface); return config; }
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_coordinator.mm b/ios/chrome/browser/ui/ntp/new_tab_page_coordinator.mm index ef24298..a236ee4 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_coordinator.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_coordinator.mm
@@ -163,7 +163,6 @@ _prefService = ChromeBrowserState::FromBrowserState(browser->GetBrowserState()) ->GetPrefs(); - if (IsRefactoredNTP()) { _prefChangeRegistrar = std::make_unique<PrefChangeRegistrar>(); _prefChangeRegistrar->Init(_prefService); _prefObserverBridge.reset(new PrefObserverBridge(self)); @@ -180,7 +179,6 @@ [_discoverFeedExpanded setObserver:self]; _discoverFeedProviderObserverBridge = std::make_unique<DiscoverFeedObserverBridge>(self); - } } return self; }
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_feature.h b/ios/chrome/browser/ui/ntp/new_tab_page_feature.h index b33e8ef..543de19 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_feature.h +++ b/ios/chrome/browser/ui/ntp/new_tab_page_feature.h
@@ -7,10 +7,6 @@ #include "base/feature_list.h" -// Feature to choose between the legacy new tab page or the refactored one. -// Use IsRefactoredNTP() instead of this constant directly. -extern const base::Feature kRefactoredNTP; - // Feature flag to enable showing a live preview for discover feed when opening // the feed context menu. extern const base::Feature kEnableDiscoverFeedPreview; @@ -18,12 +14,6 @@ // Feature flag to enable improving the usage of memory of the NTP. extern const base::Feature kEnableNTPMemoryEnhancement; -// Parameter to enable/disable the logging of the refactoredNTP. -extern const char kRefactoredNTPLoggingEnabled[]; - -// Whether the refactored NTP is used instead of the legacy one. -bool IsRefactoredNTP(); - // Whether the discover feed content preview is shown in the context menu. bool IsDiscoverFeedPreviewEnabled();
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_feature.mm b/ios/chrome/browser/ui/ntp/new_tab_page_feature.mm index 494b526..4e52cb4a4 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_feature.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_feature.mm
@@ -10,11 +10,6 @@ #error "This file requires ARC support." #endif -// Feature disabled by default to keep the legacy NTP until the refactored one -// covers all existing functionality. -const base::Feature kRefactoredNTP{"RefactoredNTP", - base::FEATURE_ENABLED_BY_DEFAULT}; - const base::Feature kEnableDiscoverFeedPreview{ "EnableDiscoverFeedPreview", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -24,19 +19,10 @@ const base::Feature kEnableNTPMemoryEnhancement{ "EnableNTPMemoryEnhancement", base::FEATURE_ENABLED_BY_DEFAULT}; -const char kRefactoredNTPLoggingEnabled[] = "RefactoredNTPLoggingEnabled"; - -bool IsRefactoredNTP() { - // This feature is dependent on the DiscoverFeed being enabled, only having - // kRefactoredNTP enabled can lead to unexpected behavior. - return base::FeatureList::IsEnabled(kRefactoredNTP) && - IsDiscoverFeedEnabled(); -} - bool IsDiscoverFeedPreviewEnabled() { return base::FeatureList::IsEnabled(kEnableDiscoverFeedPreview); } bool IsDiscoverFeedAppFlowsEnabled() { return base::FeatureList::IsEnabled(kEnableDiscoverFeedAppFlows); -} \ No newline at end of file +}
diff --git a/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_manage_devices_item.mm b/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_manage_devices_item.mm index 256d47b9..bdf08e6 100644 --- a/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_manage_devices_item.mm +++ b/ios/chrome/browser/ui/send_tab_to_self/send_tab_to_self_manage_devices_item.mm
@@ -19,6 +19,12 @@ #error "This file requires ARC support." #endif +namespace { + +const CGFloat kAvatarSize = 24; + +} // namespace + #pragma mark - SendTabtoSelfManageDevicesCell // Cell class for SendTabToSelfManageDevicesItem. @@ -46,7 +52,7 @@ _avatarBadge = [[UIImageView alloc] init]; _avatarBadge.translatesAutoresizingMaskIntoConstraints = NO; _avatarBadge.contentMode = UIViewContentModeScaleAspectFit; - _avatarBadge.layer.cornerRadius = kTableViewIconImageSize / 2; + _avatarBadge.layer.cornerRadius = kAvatarSize / 2; _avatarBadge.clipsToBounds = YES; [self.contentView addSubview:_avatarBadge]; @@ -57,30 +63,37 @@ _linkAndEmailTextView.font = [UIFont preferredFontForTextStyle:kTableViewSublabelFontStyle]; _linkAndEmailTextView.textColor = [UIColor colorNamed:kTextSecondaryColor]; + _linkAndEmailTextView.backgroundColor = [UIColor clearColor]; + // Remove built-in padding. + _linkAndEmailTextView.textContainer.lineFragmentPadding = 0; + [_linkAndEmailTextView setTextContainerInset:UIEdgeInsetsZero]; _linkAndEmailTextView.delegate = self; [self.contentView addSubview:_linkAndEmailTextView]; [NSLayoutConstraint activateConstraints:@[ [_avatarBadge.centerYAnchor constraintEqualToAnchor:self.contentView.centerYAnchor], - [_avatarBadge.heightAnchor - constraintEqualToConstant:kTableViewIconImageSize], - [_avatarBadge.widthAnchor - constraintEqualToConstant:kTableViewIconImageSize], + [_avatarBadge.heightAnchor constraintEqualToConstant:kAvatarSize], + [_avatarBadge.widthAnchor constraintEqualToConstant:kAvatarSize], [_avatarBadge.leftAnchor constraintEqualToAnchor:self.contentView.leftAnchor constant:kTableViewHorizontalSpacing], + [_avatarBadge.topAnchor + constraintGreaterThanOrEqualToAnchor:self.contentView.topAnchor + constant: + kTableViewTwoLabelsCellVerticalSpacing], [_linkAndEmailTextView.centerYAnchor constraintEqualToAnchor:_avatarBadge.centerYAnchor], [_linkAndEmailTextView.leftAnchor constraintEqualToAnchor:_avatarBadge.rightAnchor - constant:kTableViewSubViewHorizontalSpacing], + constant:kTableViewImagePadding], [_linkAndEmailTextView.rightAnchor constraintEqualToAnchor:self.contentView.rightAnchor constant:-kTableViewHorizontalSpacing], [_linkAndEmailTextView.topAnchor - constraintEqualToAnchor:self.contentView.topAnchor - constant:kTableViewVerticalSpacing] + constraintGreaterThanOrEqualToAnchor:self.contentView.topAnchor + constant: + kTableViewTwoLabelsCellVerticalSpacing] ]]; return self;
diff --git a/ios/testing/embedded_test_server_handlers.cc b/ios/testing/embedded_test_server_handlers.cc index 0cad319..e815e1c8 100644 --- a/ios/testing/embedded_test_server_handlers.cc +++ b/ios/testing/embedded_test_server_handlers.cc
@@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/string_split.h" #include "base/strings/stringprintf.h" #include "base/threading/thread_task_runner_handle.h" #include "net/base/escape.h" @@ -39,34 +40,37 @@ public: DownloadResponse(int length) : length_(length) {} - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) override { - send.Run(base::StringPrintf("HTTP/1.1 200 OK\r\n" - "Content-Type:%s\r\n\r\n" - "Content-Length:%d\r\n\r\n", - kTestDownloadMimeType, length_), - base::BindOnce(&DownloadResponse::Send, send, std::move(done), - length_)); + void SendResponse( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) override { + base::StringPairs headers = { + {"content-type", kTestDownloadMimeType}, + {"content-length", base::StringPrintf("%d", length_)}}; + + delegate->SendResponseHeaders(net::HTTP_OK, "OK", headers); + Send(delegate, length_); } private: // Sends "0" |count| times using 1KB blocks. Using blocks with smaller size is // performance inefficient and can cause unnecessary delays especially when // multiple tests run in parallel on a single machine. - static void Send(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done, - int count) { + static void Send( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate, + int count) { if (!count) { - std::move(done).Run(); + if (delegate) + delegate->FinishResponse(); return; } + int block_size = std::min(count, 1000); + std::string content_block(block_size, 0); + auto next_send = + base::BindOnce(&DownloadResponse::Send, delegate, count - block_size); - const int block_size = std::min(count, 1000); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::BindOnce(send, std::string(block_size, 0), - base::BindOnce(&DownloadResponse::Send, send, - std::move(done), count - block_size)), + base::BindOnce(&net::test_server::HttpResponseDelegate::SendContents, + delegate, content_block, std::move(next_send)), base::TimeDelta::FromMilliseconds(100)); }
diff --git a/ios/web/common/features.h b/ios/web/common/features.h index 0428153..a5cb8b7 100644 --- a/ios/web/common/features.h +++ b/ios/web/common/features.h
@@ -52,6 +52,10 @@ // generate PDF when Page Snapshot is taken just to record PDF size. extern const base::Feature kRecordSnapshotSize; +// When enabled, the |attribution| property of NSMutableURLRequests passed to +// WKWebView is set as NSURLRequestAttributionUser on iOS 15. +extern const base::Feature kSetRequestAttribution; + // When enabled, use the native context menu in web content. extern const base::Feature kWebViewNativeContextMenu;
diff --git a/ios/web/common/features.mm b/ios/web/common/features.mm index 527f3e8..ca0d043 100644 --- a/ios/web/common/features.mm +++ b/ios/web/common/features.mm
@@ -43,6 +43,9 @@ const base::Feature kRecordSnapshotSize{"RecordSnapshotSize", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kSetRequestAttribution{"SetRequestAttribution", + base::FEATURE_ENABLED_BY_DEFAULT}; + const base::Feature kWebViewNativeContextMenu{"WebViewNativeContextMenu", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/ios/web/web_state/ui/crw_web_request_controller.mm b/ios/web/web_state/ui/crw_web_request_controller.mm index 9b78929..5ef2eda 100644 --- a/ios/web/web_state/ui/crw_web_request_controller.mm +++ b/ios/web/web_state/ui/crw_web_request_controller.mm
@@ -518,7 +518,9 @@ } else { #if defined(__IPHONE_15_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_15_0 if (@available(iOS 15, *)) { - request.attribution = NSURLRequestAttributionUser; + if (base::FeatureList::IsEnabled(web::features::kSetRequestAttribution)) { + request.attribution = NSURLRequestAttributionUser; + } } #endif navigation = [self.webView loadRequest:request];
diff --git a/net/BUILD.gn b/net/BUILD.gn index d50711f..d6ceb47 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -1298,8 +1298,11 @@ "proxy_resolution/win/windows_system_proxy_resolution_request.h", "proxy_resolution/win/windows_system_proxy_resolution_service.cc", "proxy_resolution/win/windows_system_proxy_resolution_service.h", - "proxy_resolution/win/windows_system_proxy_resolver.cc", "proxy_resolution/win/windows_system_proxy_resolver.h", + + # TODO(https://crbug.com/1032820): Move WinHttp code to new service + # "proxy_resolution/win/windows_system_proxy_resolver_impl.cc", + # "proxy_resolution/win/windows_system_proxy_resolver_impl.h", "proxy_resolution/win/winhttp_api_wrapper.cc", "proxy_resolution/win/winhttp_api_wrapper.h", "proxy_resolution/win/winhttp_proxy_resolver_functions.cc", @@ -4448,7 +4451,6 @@ "proxy_resolution/win/dhcp_pac_file_fetcher_win_unittest.cc", "proxy_resolution/win/proxy_config_service_win_unittest.cc", "proxy_resolution/win/windows_system_proxy_resolution_service_unittest.cc", - "proxy_resolution/win/windows_system_proxy_resolver_unittest.cc", "ssl/client_cert_store_win_unittest.cc", "ssl/ssl_platform_key_win_unittest.cc", ]
diff --git a/net/OWNERS b/net/OWNERS index 0eb7b98..95888ca0 100644 --- a/net/OWNERS +++ b/net/OWNERS
@@ -1,5 +1,6 @@ set noparent agl@chromium.org +bashi@chromium.org davidben@chromium.org dschinazi@chromium.org ericorth@chromium.org @@ -10,7 +11,9 @@ nharper@chromium.org pauljensen@chromium.org rch@chromium.org +ricea@chromium.org rsleevi@chromium.org +yhirano@chromium.org file://net/quic/OWNERS # For QUICHE rolls only.
diff --git a/net/base/proxy_server_unittest.cc b/net/base/proxy_server_unittest.cc index 1599aef8..8e29120 100644 --- a/net/base/proxy_server_unittest.cc +++ b/net/base/proxy_server_unittest.cc
@@ -100,6 +100,7 @@ "http://foo", "3ffe:2a00:100:7031::1]", "[3ffe:2a00:100:7031::1", + "foo.80", }; for (size_t i = 0; i < base::size(tests); ++i) {
diff --git a/net/base/proxy_string_util.cc b/net/base/proxy_string_util.cc index bf17400..56cecfc 100644 --- a/net/base/proxy_string_util.cc +++ b/net/base/proxy_string_util.cc
@@ -7,12 +7,13 @@ #include <string> #include "base/notreached.h" +#include "base/strings/strcat.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" -#include "net/base/host_port_pair.h" #include "net/base/proxy_server.h" #include "net/base/url_util.h" #include "net/http/http_util.h" +#include "url/third_party/mozilla/url_parse.h" namespace net { @@ -49,28 +50,50 @@ // Trim leading/trailing space. host_and_port = HttpUtil::TrimLWS(host_and_port); - if (scheme == ProxyServer::SCHEME_DIRECT && !host_and_port.empty()) - return ProxyServer(); // Invalid -- DIRECT cannot have a host/port. + if (scheme == ProxyServer::SCHEME_INVALID) + return ProxyServer(); - HostPortPair host_port_pair; - - if (scheme != ProxyServer::SCHEME_INVALID && - scheme != ProxyServer::SCHEME_DIRECT) { - std::string host; - int port = -1; - // If the scheme has a host/port, parse it. - bool ok = ParseHostAndPort(host_and_port, &host, &port); - if (!ok) - return ProxyServer(); // Invalid -- failed parsing <host>[":"<port>] - - // Choose a default port number if none was given. - if (port == -1) - port = ProxyServer::GetDefaultPortForScheme(scheme); - - host_port_pair = HostPortPair(host, static_cast<uint16_t>(port)); + if (scheme == ProxyServer::SCHEME_DIRECT) { + if (!host_and_port.empty()) + return ProxyServer(); // Invalid -- DIRECT cannot have a host/port. + return ProxyServer::Direct(); } - return ProxyServer(scheme, host_port_pair); + url::Component username_component; + url::Component password_component; + url::Component hostname_component; + url::Component port_component; + url::ParseAuthority(host_and_port.data(), + url::Component(0, host_and_port.size()), + &username_component, &password_component, + &hostname_component, &port_component); + if (username_component.is_valid() || password_component.is_valid() || + !hostname_component.is_nonempty()) { + return ProxyServer(); + } + + base::StringPiece hostname = + host_and_port.substr(hostname_component.begin, hostname_component.len); + + // Reject inputs like "foo:". /url parsing and canonicalization code generally + // allows it and treats it the same as a URL without a specified port, but + // Chrome has traditionally disallowed it in proxy specifications. + if (port_component.is_valid() && !port_component.is_nonempty()) + return ProxyServer(); + base::StringPiece port = + port_component.is_nonempty() + ? host_and_port.substr(port_component.begin, port_component.len) + : ""; + + return ProxyServer::FromSchemeHostAndPort(scheme, hostname, port); +} + +std::string ConstructHostPortString(base::StringPiece hostname, uint16_t port) { + DCHECK(!hostname.empty()); + DCHECK((hostname.front() == '[' && hostname.back() == ']') || + hostname.find(":") == base::StringPiece::npos); + + return base::StrCat({hostname, ":", base::NumberToString(port)}); } } // namespace @@ -105,16 +128,26 @@ case ProxyServer::SCHEME_DIRECT: return "DIRECT"; case ProxyServer::SCHEME_HTTP: - return std::string("PROXY ") + proxy_server.host_port_pair().ToString(); + return std::string("PROXY ") + + ConstructHostPortString(proxy_server.GetHost(), + proxy_server.GetPort()); case ProxyServer::SCHEME_SOCKS4: // For compatibility send SOCKS instead of SOCKS4. - return std::string("SOCKS ") + proxy_server.host_port_pair().ToString(); + return std::string("SOCKS ") + + ConstructHostPortString(proxy_server.GetHost(), + proxy_server.GetPort()); case ProxyServer::SCHEME_SOCKS5: - return std::string("SOCKS5 ") + proxy_server.host_port_pair().ToString(); + return std::string("SOCKS5 ") + + ConstructHostPortString(proxy_server.GetHost(), + proxy_server.GetPort()); case ProxyServer::SCHEME_HTTPS: - return std::string("HTTPS ") + proxy_server.host_port_pair().ToString(); + return std::string("HTTPS ") + + ConstructHostPortString(proxy_server.GetHost(), + proxy_server.GetPort()); case ProxyServer::SCHEME_QUIC: - return std::string("QUIC ") + proxy_server.host_port_pair().ToString(); + return std::string("QUIC ") + + ConstructHostPortString(proxy_server.GetHost(), + proxy_server.GetPort()); default: // Got called with an invalid scheme. NOTREACHED(); @@ -148,17 +181,24 @@ return "direct://"; case ProxyServer::SCHEME_HTTP: // Leave off "http://" since it is our default scheme. - return proxy_server.host_port_pair().ToString(); + return ConstructHostPortString(proxy_server.GetHost(), + proxy_server.GetPort()); case ProxyServer::SCHEME_SOCKS4: return std::string("socks4://") + - proxy_server.host_port_pair().ToString(); + ConstructHostPortString(proxy_server.GetHost(), + proxy_server.GetPort()); case ProxyServer::SCHEME_SOCKS5: return std::string("socks5://") + - proxy_server.host_port_pair().ToString(); + ConstructHostPortString(proxy_server.GetHost(), + proxy_server.GetPort()); case ProxyServer::SCHEME_HTTPS: - return std::string("https://") + proxy_server.host_port_pair().ToString(); + return std::string("https://") + + ConstructHostPortString(proxy_server.GetHost(), + proxy_server.GetPort()); case ProxyServer::SCHEME_QUIC: - return std::string("quic://") + proxy_server.host_port_pair().ToString(); + return std::string("quic://") + + ConstructHostPortString(proxy_server.GetHost(), + proxy_server.GetPort()); default: // Got called with an invalid scheme. NOTREACHED();
diff --git a/net/base/proxy_string_util_unittest.cc b/net/base/proxy_string_util_unittest.cc index 4055c7e..67f6333 100644 --- a/net/base/proxy_string_util_unittest.cc +++ b/net/base/proxy_string_util_unittest.cc
@@ -31,18 +31,13 @@ "PROXY foopy:10"}, // IPv6 HTTP proxy URIs: - {"[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:10", // No scheme. - "[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:10", ProxyServer::SCHEME_HTTP, - "FEDC:BA98:7654:3210:FEDC:BA98:7654:3210", 10, - "PROXY [FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:10"}, + {"[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:10", // No scheme. + "[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:10", ProxyServer::SCHEME_HTTP, + "fedc:ba98:7654:3210:fedc:ba98:7654:3210", 10, + "PROXY [fedc:ba98:7654:3210:fedc:ba98:7654:3210]:10"}, {"http://[3ffe:2a00:100:7031::1]", // No port. "[3ffe:2a00:100:7031::1]:80", ProxyServer::SCHEME_HTTP, "3ffe:2a00:100:7031::1", 80, "PROXY [3ffe:2a00:100:7031::1]:80"}, - {"http://[::192.9.5.5]", "[::192.9.5.5]:80", ProxyServer::SCHEME_HTTP, - "::192.9.5.5", 80, "PROXY [::192.9.5.5]:80"}, - {"http://[::FFFF:129.144.52.38]:80", "[::FFFF:129.144.52.38]:80", - ProxyServer::SCHEME_HTTP, "::FFFF:129.144.52.38", 80, - "PROXY [::FFFF:129.144.52.38]:80"}, // SOCKS4 proxy URIs: {"socks4://foopy", // No port. @@ -51,7 +46,7 @@ {"socks4://foopy:10", "socks4://foopy:10", ProxyServer::SCHEME_SOCKS4, "foopy", 10, "SOCKS foopy:10"}, - // SOCKS5 proxy URIs + // SOCKS5 proxy URIs: {"socks5://foopy", // No port. "socks5://foopy:1080", ProxyServer::SCHEME_SOCKS5, "foopy", 1080, "SOCKS5 foopy:1080"}, @@ -75,6 +70,23 @@ {"https://1.2.3.4:10", // IP Address "https://1.2.3.4:10", ProxyServer::SCHEME_HTTPS, "1.2.3.4", 10, "HTTPS 1.2.3.4:10"}, + + // Hostname canonicalization: + {"[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:10", // No scheme. + "[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:10", ProxyServer::SCHEME_HTTP, + "fedc:ba98:7654:3210:fedc:ba98:7654:3210", 10, + "PROXY [fedc:ba98:7654:3210:fedc:ba98:7654:3210]:10"}, + {"http://[::192.9.5.5]", "[::c009:505]:80", ProxyServer::SCHEME_HTTP, + "::c009:505", 80, "PROXY [::c009:505]:80"}, + {"http://[::FFFF:129.144.52.38]:80", "[::ffff:8190:3426]:80", + ProxyServer::SCHEME_HTTP, "::ffff:8190:3426", 80, + "PROXY [::ffff:8190:3426]:80"}, + {"http://f\u00fcpy:85", "xn--fpy-hoa:85", ProxyServer::SCHEME_HTTP, + "xn--fpy-hoa", 85, "PROXY xn--fpy-hoa:85"}, + {"https://0xA.020.3.4:443", "https://10.16.3.4:443", + ProxyServer::SCHEME_HTTPS, "10.16.3.4", 443, "HTTPS 10.16.3.4:443"}, + {"http://FoO.tEsT:80", "foo.test:80", ProxyServer::SCHEME_HTTP, + "foo.test", 80, "PROXY foo.test:80"}, }; for (const auto& test : tests) { @@ -112,9 +124,14 @@ "direct://xyz", // direct is not allowed a host/port. "http:/", // ambiguous, but will fail because of bad port. "http:", // ambiguous, but will fail because of bad port. + "foopy.111", // Interpreted as invalid IPv4 address. + "foo.test/" // Paths disallowed. + "foo.test:123/" // Paths disallowed. + "foo.test/foo" // Paths disallowed. }; for (const char* test : tests) { + SCOPED_TRACE(test); ProxyServer uri = ProxyUriToProxyServer(test, ProxyServer::SCHEME_HTTP); EXPECT_FALSE(uri.is_valid()); EXPECT_FALSE(uri.is_direct()); @@ -187,6 +204,9 @@ "https foopy:10", "https://foopy:10", }, + {"PROXY [FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:10", + "[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:10"}, + {"PROXY f\u00fcpy:85", "xn--fpy-hoa:85"}, }; for (const auto& test : tests) {
diff --git a/net/dns/host_resolver_manager_unittest.cc b/net/dns/host_resolver_manager_unittest.cc index e89ca6df..55d3e7e0 100644 --- a/net/dns/host_resolver_manager_unittest.cc +++ b/net/dns/host_resolver_manager_unittest.cc
@@ -7052,6 +7052,84 @@ "correct"); } +// Test that responses containing CNAME records but no address results are fine +// and treated as normal NODATA responses. +TEST_F(HostResolverManagerDnsTest, CanonicalNameWithoutResults) { + MockDnsClientRuleList rules; + + DnsResponse a_response = + BuildTestDnsResponse("a.test", dns_protocol::kTypeA, + {BuildTestCnameRecord("c.test", "d.test"), + BuildTestCnameRecord("b.test", "c.test"), + BuildTestCnameRecord("a.test", "b.test")}); + AddDnsRule(&rules, "a.test", dns_protocol::kTypeA, std::move(a_response), + /*delay=*/false); + + DnsResponse aaaa_response = + BuildTestDnsResponse("a.test", dns_protocol::kTypeAAAA, + {BuildTestCnameRecord("c.test", "d.test"), + BuildTestCnameRecord("b.test", "c.test"), + BuildTestCnameRecord("a.test", "b.test")}); + AddDnsRule(&rules, "a.test", dns_protocol::kTypeAAAA, + std::move(aaaa_response), /*delay=*/false); + + CreateResolver(); + UseMockDnsClient(CreateValidDnsConfig(), std::move(rules)); + set_allow_fallback_to_proctask(false); + + ResolveHostResponseHelper response(resolver_->CreateRequest( + HostPortPair("a.test", 80), NetworkIsolationKey(), NetLogWithSource(), + /*optional_parameters=*/absl::nullopt, resolve_context_.get(), + resolve_context_->host_cache())); + + ASSERT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED)); + + // Underlying error should be the typical no-results error + // (ERR_NAME_NOT_RESOLVED), not anything more exotic like + // ERR_DNS_MALFORMED_RESPONSE. + EXPECT_EQ(response.request()->GetResolveErrorInfo().error, + ERR_NAME_NOT_RESOLVED); +} + +// Test that if the response for one address family contains CNAME records but +// no address results, it doesn't interfere with the other address family +// receiving address results (as would happen if such a response were +// incorrectly treated as a malformed response error). +TEST_F(HostResolverManagerDnsTest, CanonicalNameWithResultsForOnlyOneFamily) { + MockDnsClientRuleList rules; + + DnsResponse a_response = + BuildTestDnsResponse("a.test", dns_protocol::kTypeA, + {BuildTestCnameRecord("c.test", "d.test"), + BuildTestCnameRecord("b.test", "c.test"), + BuildTestCnameRecord("a.test", "b.test")}); + AddDnsRule(&rules, "a.test", dns_protocol::kTypeA, std::move(a_response), + /*delay=*/false); + + DnsResponse aaaa_response = BuildTestDnsResponse( + "a.test", dns_protocol::kTypeAAAA, + {BuildTestAddressRecord("d.test", IPAddress::IPv6Localhost()), + BuildTestCnameRecord("c.test", "d.test"), + BuildTestCnameRecord("b.test", "c.test"), + BuildTestCnameRecord("a.test", "b.test")}); + AddDnsRule(&rules, "a.test", dns_protocol::kTypeAAAA, + std::move(aaaa_response), /*delay=*/false); + + CreateResolver(); + UseMockDnsClient(CreateValidDnsConfig(), std::move(rules)); + + ResolveHostResponseHelper response(resolver_->CreateRequest( + HostPortPair("a.test", 80), NetworkIsolationKey(), NetLogWithSource(), + /*optional_parameters=*/absl::nullopt, resolve_context_.get(), + resolve_context_->host_cache())); + + ASSERT_THAT(response.result_error(), IsOk()); + + ASSERT_TRUE(response.request()->GetAddressResults()); + EXPECT_THAT(response.request()->GetAddressResults().value().endpoints(), + testing::ElementsAre(IPEndPoint(IPAddress::IPv6Localhost(), 80))); +} + // Test that without specifying source, a request that would otherwise be // handled by DNS is sent to the system resolver if cannonname is requested. TEST_F(HostResolverManagerDnsTest, CanonicalNameForcesProc) {
diff --git a/net/proxy_resolution/configured_proxy_resolution_service_unittest.cc b/net/proxy_resolution/configured_proxy_resolution_service_unittest.cc index 3810b08..bc0c754 100644 --- a/net/proxy_resolution/configured_proxy_resolution_service_unittest.cc +++ b/net/proxy_resolution/configured_proxy_resolution_service_unittest.cc
@@ -1997,7 +1997,7 @@ TEST_F(ConfiguredProxyResolutionServiceTest, MarkProxiesAsBadTests) { ProxyConfig config; config.proxy_rules().ParseFromString( - "http=foopy1:8080;http=foopy2:8080;http=foopy3.8080;http=foopy4:8080"); + "http=foopy1:8080;http=foopy2:8080;http=foopy3:8080;http=foopy4:8080"); config.set_auto_detect(false); ProxyList proxy_list;
diff --git a/net/proxy_resolution/win/windows_system_proxy_resolution_request.cc b/net/proxy_resolution/win/windows_system_proxy_resolution_request.cc index 742f153..5bd2a486 100644 --- a/net/proxy_resolution/win/windows_system_proxy_resolution_request.cc +++ b/net/proxy_resolution/win/windows_system_proxy_resolution_request.cc
@@ -10,7 +10,6 @@ #include "net/proxy_resolution/proxy_info.h" #include "net/proxy_resolution/proxy_list.h" #include "net/proxy_resolution/win/windows_system_proxy_resolution_service.h" -#include "net/proxy_resolution/win/windows_system_proxy_resolver.h" #include "net/traffic_annotation/network_traffic_annotation.h" namespace net { @@ -54,9 +53,8 @@ ProxyInfo* results, CompletionOnceCallback user_callback, const NetLogWithSource& net_log, - scoped_refptr<WindowsSystemProxyResolver> windows_system_proxy_resolver) - : windows_system_proxy_resolver_(windows_system_proxy_resolver), - service_(service), + WindowsSystemProxyResolver* windows_system_proxy_resolver) + : service_(service), user_callback_(std::move(user_callback)), results_(results), url_(url), @@ -64,7 +62,9 @@ net_log_(net_log), creation_time_(base::TimeTicks::Now()) { DCHECK(!user_callback_.is_null()); - DCHECK(windows_system_proxy_resolver_); + DCHECK(windows_system_proxy_resolver); + proxy_resolution_request_ = + windows_system_proxy_resolver->GetProxyForUrl(url.spec(), this); } WindowsSystemProxyResolutionRequest::~WindowsSystemProxyResolutionRequest() { @@ -73,8 +73,7 @@ service_->RemovePendingRequest(this); net_log_.AddEvent(NetLogEventType::CANCELLED); - if (IsStarted()) - CancelResolveJob(); + CancelResolveRequest(); net_log_.EndEvent(NetLogEventType::PROXY_RESOLUTION_SERVICE); } @@ -86,49 +85,25 @@ return LOAD_STATE_RESOLVING_PROXY_FOR_URL; } -int WindowsSystemProxyResolutionRequest::Start() { +void WindowsSystemProxyResolutionRequest::CancelResolveRequest() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(!was_completed()); - DCHECK(!IsStarted()); - - // Kicks off an asynchronous call that'll eventually call back into - // AsynchronousProxyResolutionComplete() with a result. - if (!windows_system_proxy_resolver_->GetProxyForUrl(this, url_.spec())) - return ERR_FAILED; - - // Asynchronous proxy resolution has begun. - return ERR_IO_PENDING; + proxy_resolution_request_.reset(); } -void WindowsSystemProxyResolutionRequest::CancelResolveJob() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(IsStarted()); - // The request may already be running in the resolver. - // TODO(https://crbug.com/1032820): Cancel callback instead of just ignoring - // it. - windows_system_proxy_resolver_->RemovePendingCallbackTarget(this); - DCHECK(!IsStarted()); -} - -bool WindowsSystemProxyResolutionRequest::IsStarted() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return windows_system_proxy_resolver_->HasPendingCallbackTarget(this); -} - -int WindowsSystemProxyResolutionRequest::UpdateResultsOnProxyResolutionComplete( +void WindowsSystemProxyResolutionRequest::ProxyResolutionComplete( const ProxyList& proxy_list, - int net_error) { + int net_error, + int windows_error) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!was_completed()); + // TODO(https://crbug.com/1032820): Log Windows error |windows_error|. + proxy_resolution_request_.reset(); results_->UseProxyList(proxy_list); - // Make sure IsStarted() returns false while DidFinishResolvingProxy() runs. - windows_system_proxy_resolver_->RemovePendingCallbackTarget(this); - // Note that DidFinishResolvingProxy might modify |results_|. - const int updated_result = service_->DidFinishResolvingProxy( - url_, method_, results_, net_error, net_log_); + net_error = service_->DidFinishResolvingProxy(url_, method_, results_, + net_error, net_log_); // Make a note in the results which configuration was in use at the // time of the resolve. @@ -137,28 +112,6 @@ results_->set_traffic_annotation( MutableNetworkTrafficAnnotationTag(kWindowsResolverTrafficAnnotation)); - return updated_result; -} - -int WindowsSystemProxyResolutionRequest::SynchronousProxyResolutionComplete( - int net_error) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - ProxyList proxy_list; - const int updated_result = - UpdateResultsOnProxyResolutionComplete(proxy_list, net_error); - service_ = nullptr; - return updated_result; -} - -void WindowsSystemProxyResolutionRequest::AsynchronousProxyResolutionComplete( - const ProxyList& proxy_list, - int net_error, - int windows_error) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - // TODO(https://crbug.com/1032820): Log Windows error |windows_error|. - - net_error = UpdateResultsOnProxyResolutionComplete(proxy_list, net_error); - CompletionOnceCallback callback = std::move(user_callback_); service_->RemovePendingRequest(this);
diff --git a/net/proxy_resolution/win/windows_system_proxy_resolution_request.h b/net/proxy_resolution/win/windows_system_proxy_resolution_request.h index e5af2b6..04ba825e 100644 --- a/net/proxy_resolution/win/windows_system_proxy_resolution_request.h +++ b/net/proxy_resolution/win/windows_system_proxy_resolution_request.h
@@ -8,14 +8,13 @@ #include <memory> #include <string> -#include "base/memory/ref_counted.h" #include "base/sequence_checker.h" #include "base/time/time.h" #include "net/base/completion_once_callback.h" #include "net/base/net_export.h" -#include "net/base/network_isolation_key.h" #include "net/log/net_log_with_source.h" #include "net/proxy_resolution/proxy_resolution_request.h" +#include "net/proxy_resolution/win/windows_system_proxy_resolver.h" #include "url/gurl.h" namespace net { @@ -23,7 +22,6 @@ class ProxyInfo; class ProxyList; class WindowsSystemProxyResolutionService; -class WindowsSystemProxyResolver; // This is the concrete implementation of ProxyResolutionRequest used by // WindowsSystemProxyResolutionService. Manages a single asynchronous proxy @@ -31,6 +29,11 @@ class NET_EXPORT WindowsSystemProxyResolutionRequest : public ProxyResolutionRequest { public: + // The |windows_system_proxy_resolver| is not saved by this object. Rather, it + // is simply used to kick off proxy resolution in a utility process from + // within the constructor. The |windows_system_proxy_resolver| is not needed + // after construction. Every other parameter is saved by this object. Details + // for each one of these saved parameters can be found below. WindowsSystemProxyResolutionRequest( WindowsSystemProxyResolutionService* service, const GURL& url, @@ -38,7 +41,7 @@ ProxyInfo* results, const CompletionOnceCallback user_callback, const NetLogWithSource& net_log, - scoped_refptr<WindowsSystemProxyResolver> windows_system_proxy_resolver); + WindowsSystemProxyResolver* windows_system_proxy_resolver); WindowsSystemProxyResolutionRequest( const WindowsSystemProxyResolutionRequest&) = delete; @@ -50,44 +53,23 @@ // ProxyResolutionRequest LoadState GetLoadState() const override; - // Starts the resolve proxy request. - int Start(); + // Callback for when the cross-process proxy resolution has completed. The + // |proxy_list| is the list of proxies returned by WinHttp translated into + // Chromium-friendly terms. The |net_error| describes the status of the proxy + // resolution request. If WinHttp fails for some reason, |windows_error| + // contains the specific error returned by WinHttp. + virtual void ProxyResolutionComplete(const ProxyList& proxy_list, + int net_error, + int windows_error); + private: // Cancels the callback from the resolver for a previously started proxy // resolution. - void CancelResolveJob(); - - bool IsStarted(); + void CancelResolveRequest(); // Returns true if the request has been completed. bool was_completed() const { return user_callback_.is_null(); } - // Helper to call after ProxyResolver completion (both synchronous and - // asynchronous). Fixes up the result that is to be returned to user. - int UpdateResultsOnProxyResolutionComplete(const ProxyList& proxy_list, - int net_error); - - // Helper to call if the request completes synchronously, since in that case - // the request will not be added to |pending_requests_| (in - // WindowsSystemProxyResolutionService). - int SynchronousProxyResolutionComplete(int net_error); - - // Callback for when the WinHttp request has completed. This is the main way - // that proxy resolutions will complete. The |proxy_list| is the list of - // proxies returned by WinHttp translated into Chromium-friendly terms. The - // |net_error| describes the status of the proxy resolution request. If - // WinHttp fails for some reason, |windows_error| contains the specific error - // returned by WinHttp. - virtual void AsynchronousProxyResolutionComplete(const ProxyList& proxy_list, - int net_error, - int windows_error); - - protected: - // The resolver will do the work of talking to system APIs and translating the - // results into something Chromium understands. - scoped_refptr<WindowsSystemProxyResolver> windows_system_proxy_resolver_; - - private: // Note that Request holds a bare pointer to the // WindowsSystemProxyResolutionService. Outstanding requests are cancelled // during ~WindowsSystemProxyResolutionService, so this is guaranteed to be @@ -102,6 +84,12 @@ // because the time in |results_| will be cleared. base::TimeTicks creation_time_; + // Manages the cross-process proxy resolution. Deleting this will cancel a + // pending proxy resolution. After a callback has been received via + // ProxyResolutionComplete(), this object will no longer do anything. + std::unique_ptr<WindowsSystemProxyResolver::Request> + proxy_resolution_request_; + SEQUENCE_CHECKER(sequence_checker_); };
diff --git a/net/proxy_resolution/win/windows_system_proxy_resolution_service.cc b/net/proxy_resolution/win/windows_system_proxy_resolution_service.cc index 64f9bc6..87564d1 100644 --- a/net/proxy_resolution/win/windows_system_proxy_resolution_service.cc +++ b/net/proxy_resolution/win/windows_system_proxy_resolution_service.cc
@@ -16,53 +16,52 @@ #include "net/log/net_log_with_source.h" #include "net/proxy_resolution/win/windows_system_proxy_resolution_request.h" #include "net/proxy_resolution/win/windows_system_proxy_resolver.h" -#include "net/proxy_resolution/win/winhttp_proxy_resolver_functions.h" namespace net { // static bool WindowsSystemProxyResolutionService::IsSupported() { + // The WinHttp functions used in the resolver are only supported on Windows 8 + // and above. if (base::win::GetVersion() < base::win::Version::WIN8) { LOG(WARNING) << "WindowsSystemProxyResolutionService is only supported for " "Windows 8 and later."; return false; } - if (!WinHttpProxyResolverFunctions::GetInstance() - .are_all_functions_loaded()) { - LOG(ERROR) << "Failed to load functions necessary for " - "WindowsSystemProxyResolutionService!"; - return false; - } - return true; } // static std::unique_ptr<WindowsSystemProxyResolutionService> -WindowsSystemProxyResolutionService::Create(NetLog* net_log) { - if (!IsSupported()) +WindowsSystemProxyResolutionService::Create( + std::unique_ptr<WindowsSystemProxyResolver> windows_system_proxy_resolver, + NetLog* net_log) { + if (!IsSupported() || !windows_system_proxy_resolver) return nullptr; - return base::WrapUnique(new WindowsSystemProxyResolutionService(net_log)); + return base::WrapUnique(new WindowsSystemProxyResolutionService( + std::move(windows_system_proxy_resolver), net_log)); } WindowsSystemProxyResolutionService::WindowsSystemProxyResolutionService( + std::unique_ptr<WindowsSystemProxyResolver> windows_system_proxy_resolver, NetLog* net_log) - : create_proxy_resolver_function_for_testing_(nullptr), net_log_(net_log) {} + : windows_system_proxy_resolver_(std::move(windows_system_proxy_resolver)), + net_log_(net_log) {} WindowsSystemProxyResolutionService::~WindowsSystemProxyResolutionService() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Cancel any in-progress requests. // This cancels the internal requests, but leaves the responsibility of - // canceling the high-level Request (by deleting it) to the client. - // Since |pending_requests_| might be modified in one of the requests' + // canceling the high-level ProxyResolutionRequest (by deleting it) to the + // client. Since |pending_requests_| might be modified in one of the requests' // callbacks (if it deletes another request), iterating through the set in a // for-loop will not work. while (!pending_requests_.empty()) { WindowsSystemProxyResolutionRequest* req = *pending_requests_.begin(); ProxyList empty_list; - req->AsynchronousProxyResolutionComplete(empty_list, ERR_ABORTED, 0); + req->ProxyResolutionComplete(empty_list, ERR_ABORTED, 0); pending_requests_.erase(req); } } @@ -81,17 +80,11 @@ net_log.BeginEvent(NetLogEventType::PROXY_RESOLUTION_SERVICE); - // TODO(https://crbug.com/1032820): Use a more detailed error. - if (!CreateWindowsSystemProxyResolverIfNeeded()) - return DidFinishResolvingProxy(url, method, results, ERR_FAILED, net_log); - + // Once it's created, the WindowsSystemProxyResolutionRequest immediately + // kicks off proxy resolution in a separate process. auto req = std::make_unique<WindowsSystemProxyResolutionRequest>( this, url, method, results, std::move(callback), net_log, - windows_system_proxy_resolver_); - - const int net_error = req->Start(); - if (net_error != ERR_IO_PENDING) - return req->SynchronousProxyResolutionComplete(net_error); + windows_system_proxy_resolver_.get()); DCHECK(!ContainsPendingRequest(req.get())); pending_requests_.insert(req.get()); @@ -99,7 +92,7 @@ // Completion will be notified through |callback|, unless the caller cancels // the request using |request|. *request = std::move(req); - return net_error; + return ERR_IO_PENDING; } void WindowsSystemProxyResolutionService::ReportSuccess( @@ -153,19 +146,6 @@ return false; } -void WindowsSystemProxyResolutionService:: - SetCreateWindowsSystemProxyResolverFunctionForTesting( - CreateWindowsSystemProxyResolverFunctionForTesting function) { - create_proxy_resolver_function_for_testing_ = function; -} - -void WindowsSystemProxyResolutionService:: - SetWindowsSystemProxyResolverForTesting( - scoped_refptr<WindowsSystemProxyResolver> - windows_system_proxy_resolver) { - windows_system_proxy_resolver_ = windows_system_proxy_resolver; -} - bool WindowsSystemProxyResolutionService::ContainsPendingRequest( WindowsSystemProxyResolutionRequest* req) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -179,23 +159,6 @@ pending_requests_.erase(req); } -bool WindowsSystemProxyResolutionService:: - CreateWindowsSystemProxyResolverIfNeeded() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (windows_system_proxy_resolver_) - return true; - - if (create_proxy_resolver_function_for_testing_) { - windows_system_proxy_resolver_ = - create_proxy_resolver_function_for_testing_(); - } else { - windows_system_proxy_resolver_ = - WindowsSystemProxyResolver::CreateWindowsSystemProxyResolver(); - } - - return !!windows_system_proxy_resolver_; -} - int WindowsSystemProxyResolutionService::DidFinishResolvingProxy( const GURL& url, const std::string& method,
diff --git a/net/proxy_resolution/win/windows_system_proxy_resolution_service.h b/net/proxy_resolution/win/windows_system_proxy_resolution_service.h index b994b99..2a8b316 100644 --- a/net/proxy_resolution/win/windows_system_proxy_resolution_service.h +++ b/net/proxy_resolution/win/windows_system_proxy_resolution_service.h
@@ -22,9 +22,6 @@ class WindowsSystemProxyResolutionRequest; class WindowsSystemProxyResolver; -using CreateWindowsSystemProxyResolverFunctionForTesting = - scoped_refptr<WindowsSystemProxyResolver> (*)(); - // This class decides which proxy server(s) to use for a particular URL request. // It does NOT support passing in fetched proxy configurations. Instead, it // relies entirely on WinHttp APIs to determine the proxy that should be used @@ -32,13 +29,12 @@ class NET_EXPORT WindowsSystemProxyResolutionService : public ProxyResolutionService { public: - // The WinHttp functions used in the resolver via the WinHttpAPIWrapper are - // only supported on Windows 8 and above. static bool IsSupported() WARN_UNUSED_RESULT; // Creates a WindowsSystemProxyResolutionService or returns nullptr if the // runtime dependencies are not satisfied. static std::unique_ptr<WindowsSystemProxyResolutionService> Create( + std::unique_ptr<WindowsSystemProxyResolver> windows_system_proxy_resolver, NetLog* net_log); WindowsSystemProxyResolutionService( @@ -71,17 +67,12 @@ ConfiguredProxyResolutionService** configured_proxy_resolution_service) override WARN_UNUSED_RESULT; - // Used in tests to provide a fake |windows_system_proxy_resolver_|. - void SetCreateWindowsSystemProxyResolverFunctionForTesting( - CreateWindowsSystemProxyResolverFunctionForTesting function); - void SetWindowsSystemProxyResolverForTesting( - scoped_refptr<WindowsSystemProxyResolver> windows_system_proxy_resolver); - private: friend class WindowsSystemProxyResolutionRequest; - friend class WindowsSystemProxyResolutionServiceTest; - explicit WindowsSystemProxyResolutionService(NetLog* net_log); + WindowsSystemProxyResolutionService( + std::unique_ptr<WindowsSystemProxyResolver> windows_system_proxy_resolver, + NetLog* net_log); typedef std::set<WindowsSystemProxyResolutionRequest*> PendingRequests; @@ -89,9 +80,6 @@ WARN_UNUSED_RESULT; void RemovePendingRequest(WindowsSystemProxyResolutionRequest* req); - // Lazily creates |windows_system_proxy_resolver_|. - bool CreateWindowsSystemProxyResolverIfNeeded() WARN_UNUSED_RESULT; - size_t PendingRequestSizeForTesting() const { return pending_requests_.size(); } @@ -105,24 +93,20 @@ int result_code, const NetLogWithSource& net_log); - CreateWindowsSystemProxyResolverFunctionForTesting - create_proxy_resolver_function_for_testing_; - // Map of the known bad proxies and the information about the retry time. ProxyRetryInfoMap proxy_retry_info_; // Set of pending/in-progress requests. PendingRequests pending_requests_; + // This is used to launch cross-process proxy resolution requests. Individual + // WindowsSystemProxyResolutionRequest will use this to initiate proxy + // resolution. + std::unique_ptr<WindowsSystemProxyResolver> windows_system_proxy_resolver_; + // This is the log for any generated events. NetLog* net_log_; - // This object encapsulates all WinHttp logic in Chromium-friendly terms. It - // manages the lifetime of the WinHttp session (which is - // per-resolution-service). This will get handed off to individual resolution - // requests so that they can query/cancel proxy resolution as needed. - scoped_refptr<WindowsSystemProxyResolver> windows_system_proxy_resolver_; - SEQUENCE_CHECKER(sequence_checker_); };
diff --git a/net/proxy_resolution/win/windows_system_proxy_resolution_service_unittest.cc b/net/proxy_resolution/win/windows_system_proxy_resolution_service_unittest.cc index 79af57c3..fa67d51 100644 --- a/net/proxy_resolution/win/windows_system_proxy_resolution_service_unittest.cc +++ b/net/proxy_resolution/win/windows_system_proxy_resolution_service_unittest.cc
@@ -4,14 +4,10 @@ #include "net/proxy_resolution/win/windows_system_proxy_resolution_service.h" -#include <limits> #include <memory> #include <string> -#include <unordered_map> -#include "base/logging.h" -#include "base/memory/ptr_util.h" -#include "base/memory/ref_counted.h" +#include "base/memory/weak_ptr.h" #include "base/run_loop.h" #include "base/sequence_checker.h" #include "base/threading/sequenced_task_runner_handle.h" @@ -25,10 +21,8 @@ #include "net/proxy_resolution/proxy_list.h" #include "net/proxy_resolution/win/windows_system_proxy_resolution_request.h" #include "net/proxy_resolution/win/windows_system_proxy_resolver.h" -#include "net/proxy_resolution/win/winhttp_api_wrapper.h" #include "net/test/gtest_util.h" #include "net/test/test_with_task_environment.h" -#include "net/traffic_annotation/network_traffic_annotation_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -41,42 +35,35 @@ const GURL kResourceUrl("https://example.test:8080/"); -class MockWindowsSystemProxyResolver : public WindowsSystemProxyResolver { +class MockRequest : public WindowsSystemProxyResolver::Request { public: - MockWindowsSystemProxyResolver() : WindowsSystemProxyResolver(nullptr) {} - - void set_get_proxy_for_url_success(bool get_proxy_for_url_success) { - get_proxy_for_url_success_ = get_proxy_for_url_success; - } - bool GetProxyForUrl(WindowsSystemProxyResolutionRequest* callback_target, - const std::string& url) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!get_proxy_for_url_success_) - return false; - - const int request_handle = proxy_resolver_identifier_++; - pending_callback_target_map_[callback_target] = request_handle; + MockRequest(WindowsSystemProxyResolutionRequest* callback_target, + const ProxyList& proxy_list, + int net_error, + int windows_error) { base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::BindOnce(&MockWindowsSystemProxyResolver::DoQueryComplete, - base::Unretained(this), callback_target, - request_handle)); + base::BindOnce(&MockRequest::DoCallback, weak_ptr_factory_.GetWeakPtr(), + callback_target, proxy_list, net_error, windows_error)); + } + ~MockRequest() override = default; - return get_proxy_for_url_success_; + private: + void DoCallback(WindowsSystemProxyResolutionRequest* callback_target, + const ProxyList& proxy_list, + int net_error, + int windows_error) { + callback_target->ProxyResolutionComplete(proxy_list, net_error, + windows_error); } - void RemovePendingCallbackTarget( - WindowsSystemProxyResolutionRequest* callback_target) override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - pending_callback_target_map_.erase(callback_target); - } + base::WeakPtrFactory<MockRequest> weak_ptr_factory_{this}; +}; - bool HasPendingCallbackTarget( - WindowsSystemProxyResolutionRequest* callback_target) const override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return (pending_callback_target_map_.find(callback_target) != - pending_callback_target_map_.end()); - } +class MockWindowsSystemProxyResolver : public WindowsSystemProxyResolver { + public: + MockWindowsSystemProxyResolver() = default; + ~MockWindowsSystemProxyResolver() override = default; void add_server_to_proxy_list(const ProxyServer& proxy_server) { proxy_list_.AddProxyServer(proxy_server); @@ -86,42 +73,22 @@ void set_windows_error(int windows_error) { windows_error_ = windows_error; } - private: - ~MockWindowsSystemProxyResolver() override { - if (!pending_callback_target_map_.empty()) - ADD_FAILURE() - << "The WindowsSystemProxyResolutionRequests must account for all " - "pending requests in the WindowsSystemProxyResolver."; - } - - void DoQueryComplete(WindowsSystemProxyResolutionRequest* callback_target, - int request_handle) { + std::unique_ptr<Request> GetProxyForUrl( + const std::string& url, + WindowsSystemProxyResolutionRequest* callback_target) override { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (HasPendingCallbackTarget(callback_target) && - pending_callback_target_map_[callback_target] == request_handle) - callback_target->AsynchronousProxyResolutionComplete( - proxy_list_, net_error_, windows_error_); + return std::make_unique<MockRequest>(callback_target, proxy_list_, + net_error_, windows_error_); } - bool get_proxy_for_url_success_ = true; + private: ProxyList proxy_list_; int net_error_ = OK; - // TODO(https://crbug.com/1032820): Add tests for the |windows_error_| - // code when it is used. int windows_error_ = 0; - int proxy_resolver_identifier_ = 1; - std::unordered_map<WindowsSystemProxyResolutionRequest*, int> - pending_callback_target_map_; - SEQUENCE_CHECKER(sequence_checker_); }; -scoped_refptr<WindowsSystemProxyResolver> -CreateWindowsSystemProxyResolverFails() { - return nullptr; -} - } // namespace // These tests verify the behavior of the WindowsSystemProxyResolutionService in @@ -136,48 +103,21 @@ << "Windows System Proxy Resolution is only supported on Windows 8+."; } - proxy_resolver_ = base::MakeRefCounted<MockWindowsSystemProxyResolver>(); - proxy_resolution_service_ = - WindowsSystemProxyResolutionService::Create(/*net_log=*/nullptr); - proxy_resolution_service_->SetWindowsSystemProxyResolverForTesting( - proxy_resolver_); + auto proxy_resolver = std::make_unique<MockWindowsSystemProxyResolver>(); + proxy_resolver_ = proxy_resolver.get(); + proxy_resolution_service_ = WindowsSystemProxyResolutionService::Create( + std::move(proxy_resolver), /*net_log=*/nullptr); + ASSERT_TRUE(proxy_resolution_service_); } WindowsSystemProxyResolutionService* service() { return proxy_resolution_service_.get(); } - scoped_refptr<MockWindowsSystemProxyResolver> resolver() { - return proxy_resolver_; - } - - size_t PendingRequestSizeForTesting() { - return proxy_resolution_service_->PendingRequestSizeForTesting(); - } + MockWindowsSystemProxyResolver* resolver() { return proxy_resolver_; } void ResetProxyResolutionService() { proxy_resolution_service_.reset(); } - void DoResolveProxyCompletedSynchronouslyTest() { - // Make sure there would be a proxy result on success. - const ProxyServer proxy_server = - PacResultElementToProxyServer("HTTPS foopy:8443"); - resolver()->add_server_to_proxy_list(proxy_server); - - ProxyInfo info; - TestCompletionCallback callback; - NetLogWithSource log; - std::unique_ptr<ProxyResolutionRequest> request; - const int result = service()->ResolveProxy( - kResourceUrl, std::string(), NetworkIsolationKey(), &info, - callback.callback(), &request, log); - - EXPECT_THAT(result, IsOk()); - EXPECT_TRUE(info.is_direct()); - EXPECT_FALSE(callback.have_result()); - EXPECT_EQ(PendingRequestSizeForTesting(), 0u); - EXPECT_EQ(request, nullptr); - } - void DoResolveProxyTest(const ProxyList& expected_proxy_list) { ProxyInfo info; TestCompletionCallback callback; @@ -188,44 +128,29 @@ callback.callback(), &request, log); ASSERT_THAT(result, IsError(ERR_IO_PENDING)); - ASSERT_EQ(PendingRequestSizeForTesting(), 1u); ASSERT_NE(request, nullptr); // Wait for result to come back. EXPECT_THAT(callback.GetResult(result), IsOk()); EXPECT_TRUE(expected_proxy_list.Equals(info.proxy_list())); - EXPECT_EQ(PendingRequestSizeForTesting(), 0u); EXPECT_NE(request, nullptr); } - scoped_refptr<WindowsSystemProxyResolver> - CreateMockWindowsSystemProxyResolver() { - return proxy_resolver_; - } - private: std::unique_ptr<WindowsSystemProxyResolutionService> proxy_resolution_service_; - scoped_refptr<MockWindowsSystemProxyResolver> proxy_resolver_; + MockWindowsSystemProxyResolver* proxy_resolver_; }; -TEST_F(WindowsSystemProxyResolutionServiceTest, - ResolveProxyFailedToCreateResolver) { - service()->SetWindowsSystemProxyResolverForTesting(nullptr); - service()->SetCreateWindowsSystemProxyResolverFunctionForTesting( - &CreateWindowsSystemProxyResolverFails); - DoResolveProxyCompletedSynchronouslyTest(); +TEST_F(WindowsSystemProxyResolutionServiceTest, CreateWithNullResolver) { + std::unique_ptr<WindowsSystemProxyResolutionService> + proxy_resolution_service = WindowsSystemProxyResolutionService::Create( + /*windows_system_proxy_resolver=*/nullptr, /*net_log=*/nullptr); + EXPECT_FALSE(proxy_resolution_service); } -TEST_F(WindowsSystemProxyResolutionServiceTest, - ResolveProxyCompletedSynchronously) { - resolver()->set_get_proxy_for_url_success(false); - DoResolveProxyCompletedSynchronouslyTest(); -} - -TEST_F(WindowsSystemProxyResolutionServiceTest, - ResolveProxyFailedAsynchronously) { +TEST_F(WindowsSystemProxyResolutionServiceTest, ResolveProxyFailed) { resolver()->set_net_error(ERR_FAILED); // Make sure there would be a proxy result on success. @@ -242,17 +167,40 @@ callback.callback(), &request, log); ASSERT_THAT(result, IsError(ERR_IO_PENDING)); - ASSERT_EQ(PendingRequestSizeForTesting(), 1u); ASSERT_NE(request, nullptr); // Wait for result to come back. EXPECT_THAT(callback.GetResult(result), IsOk()); EXPECT_TRUE(info.is_direct()); - EXPECT_EQ(PendingRequestSizeForTesting(), 0u); EXPECT_NE(request, nullptr); } +TEST_F(WindowsSystemProxyResolutionServiceTest, ResolveProxyCancelled) { + // Make sure there would be a proxy result on success. + const ProxyServer proxy_server = + PacResultElementToProxyServer("HTTPS foopy:8443"); + resolver()->add_server_to_proxy_list(proxy_server); + + ProxyInfo info; + TestCompletionCallback callback; + NetLogWithSource log; + std::unique_ptr<ProxyResolutionRequest> request; + int result = service()->ResolveProxy(kResourceUrl, std::string(), + NetworkIsolationKey(), &info, + callback.callback(), &request, log); + + ASSERT_THAT(result, IsError(ERR_IO_PENDING)); + ASSERT_NE(request, nullptr); + + // Cancel the request. + request.reset(); + + // The proxy shouldn't resolve. + base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(callback.have_result()); +} + TEST_F(WindowsSystemProxyResolutionServiceTest, ResolveProxyEmptyResults) { ProxyList expected_proxy_list; DoResolveProxyTest(expected_proxy_list); @@ -284,7 +232,6 @@ kResourceUrl, std::string(), NetworkIsolationKey(), &first_proxy_info, first_callback.callback(), &first_request, log); ASSERT_THAT(result, IsError(ERR_IO_PENDING)); - ASSERT_EQ(PendingRequestSizeForTesting(), 1u); ASSERT_NE(first_request, nullptr); ProxyInfo second_proxy_info; @@ -294,7 +241,6 @@ kResourceUrl, std::string(), NetworkIsolationKey(), &second_proxy_info, second_callback.callback(), &second_request, log); ASSERT_THAT(result, IsError(ERR_IO_PENDING)); - ASSERT_EQ(PendingRequestSizeForTesting(), 2u); ASSERT_NE(second_request, nullptr); // Wait for results to come back. @@ -305,8 +251,6 @@ EXPECT_NE(first_request, nullptr); EXPECT_TRUE(expected_proxy_list.Equals(second_proxy_info.proxy_list())); EXPECT_NE(second_request, nullptr); - - EXPECT_EQ(PendingRequestSizeForTesting(), 0u); } TEST_F(WindowsSystemProxyResolutionServiceTest, @@ -325,7 +269,6 @@ kResourceUrl, std::string(), NetworkIsolationKey(), &first_proxy_info, first_callback.callback(), &first_request, log); ASSERT_THAT(result, IsError(ERR_IO_PENDING)); - ASSERT_EQ(PendingRequestSizeForTesting(), 1u); ASSERT_NE(first_request, nullptr); ProxyInfo second_proxy_info; @@ -335,7 +278,6 @@ kResourceUrl, std::string(), NetworkIsolationKey(), &second_proxy_info, second_callback.callback(), &second_request, log); ASSERT_THAT(result, IsError(ERR_IO_PENDING)); - ASSERT_EQ(PendingRequestSizeForTesting(), 2u); ASSERT_NE(second_request, nullptr); // There are now 2 in-flight proxy resolution requests. Deleting the proxy
diff --git a/net/proxy_resolution/win/windows_system_proxy_resolver.h b/net/proxy_resolution/win/windows_system_proxy_resolver.h index 3596ec8f..2d23e9a 100644 --- a/net/proxy_resolution/win/windows_system_proxy_resolver.h +++ b/net/proxy_resolution/win/windows_system_proxy_resolver.h
@@ -1,129 +1,45 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. +// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_PROXY_RESOLUTION_WIN_WINDOWS_SYSTEM_PROXY_RESOLVER_H_ #define NET_PROXY_RESOLUTION_WIN_WINDOWS_SYSTEM_PROXY_RESOLVER_H_ -#include <windows.h> -#include <winhttp.h> - #include <memory> #include <string> -#include <unordered_map> -#include "base/callback.h" -#include "base/compiler_specific.h" -#include "base/memory/ref_counted.h" -#include "base/sequence_checker.h" -#include "base/sequenced_task_runner.h" #include "net/base/net_export.h" -#include "net/proxy_resolution/proxy_list.h" namespace net { class WindowsSystemProxyResolutionRequest; -class WinHttpAPIWrapper; -// This provides a layer of abstraction between calling code Windows-specific -// code. It is shared between the WindowsSystemProxyResolutionService and -// inflight WinHttp callbacks. Internally, it takes care of all interaction with -// WinHttp. The only time this object is ever access outside of its sequence is -// during the WinHttp callback. For the sake of that callback, this must be -// RefcountedThreadSafe. -class NET_EXPORT WindowsSystemProxyResolver - : public base::RefCountedThreadSafe<WindowsSystemProxyResolver> { +// This is used to communicate with a utility process that resolves a proxy +// using WinHttp APIs. These APIs must be called in a separate process because +// they will not be allowed in the network service when the sandbox gets locked +// down. This interface is intended to be used via the +// WindowsSystemProxyResolutionRequest, which manages individual proxy +// resolutions. +class NET_EXPORT WindowsSystemProxyResolver { public: - static scoped_refptr<WindowsSystemProxyResolver> - CreateWindowsSystemProxyResolver(); + // A handle to a cross-process proxy resolution request. Deleting it will + // cancel the request. + class Request { + public: + virtual ~Request() = default; + }; + WindowsSystemProxyResolver() = default; WindowsSystemProxyResolver(const WindowsSystemProxyResolver&) = delete; WindowsSystemProxyResolver& operator=(const WindowsSystemProxyResolver&) = delete; + virtual ~WindowsSystemProxyResolver() = default; - // This will first fetch the current system proxy settings by calling into - // WinHttpGetIEProxyConfigForCurrentUser() and then resolve the proxy using - // those settings as an input into WinHttpGetProxyForUrlEx(). - virtual bool GetProxyForUrl( - WindowsSystemProxyResolutionRequest* callback_target, - const std::string& url) WARN_UNUSED_RESULT; - - // After calling GetProxyForUrl(), a |callback_target| is saved internally for - // when proxy resolution is complete. When a - // WindowsSystemProxyResolutionRequest wants to avoid receiving a callback, - // it must remove itself from the list of pending callback targets. - virtual void RemovePendingCallbackTarget( - WindowsSystemProxyResolutionRequest* callback_target); - virtual bool HasPendingCallbackTarget( - WindowsSystemProxyResolutionRequest* callback_target) const - WARN_UNUSED_RESULT; - - protected: - explicit WindowsSystemProxyResolver( - std::unique_ptr<WinHttpAPIWrapper> winhttp_api_wrapper); - virtual ~WindowsSystemProxyResolver(); - - private: - friend class base::RefCountedThreadSafe<WindowsSystemProxyResolver>; - friend class WindowsSystemProxyResolverTest; - - // Sets up the WinHttp session that will be used throughout the lifetime of - // this object. - bool Initialize(); - - // These will interact with |pending_callback_target_map_|. - void AddPendingCallbackTarget( - WindowsSystemProxyResolutionRequest* callback_target, - HINTERNET handle); - WindowsSystemProxyResolutionRequest* LookupCallbackTargetFromResolverHandle( - HINTERNET resolver_handle) const; - - // This is the callback provided to WinHttp. Once a call to resolve a proxy - // succeeds or errors out, it'll call into here with |context| being a pointer - // to a WindowsSystemProxyResolver that has been kept alive. This callback can - // hit in any thread and will immediately post a task to the right sequence. - static void __stdcall WinHttpStatusCallback(HINTERNET resolver_handle, - DWORD_PTR context, - DWORD status, - void* info, - DWORD info_len); - - // Called from WinHttpStatusCallback on the right sequence. This will make - // decisions about what to do from the results of the proxy resolution call. - // Note that the WindowsSystemProxyResolutionRequest that asked for this proxy - // may have decided they no longer need an answer (ex: the request has gone - // away), so this function has to deal with that situation too. - void DoWinHttpStatusCallback(HINTERNET resolver_handle, - DWORD status, - int windows_error); - - // On a successful call to WinHttpGetProxyForUrlEx(), this translates WinHttp - // results into Chromium-friendly structures before notifying the right - // WindowsSystemProxyResolutionRequest. - void GetProxyResultForCallbackTarget( - WindowsSystemProxyResolutionRequest* callback_target, - HINTERNET resolver_handle); - - // On a failed call to WinHttpGetProxyForUrlEx(), this will notify the right - // WindowsSystemProxyResolutionRequest of the error. - void HandleErrorForCallbackTarget( - WindowsSystemProxyResolutionRequest* callback_target, - int windows_error); - - // This is a thin wrapper over WinHttp APIs that may be overridden for - // testing. - std::unique_ptr<WinHttpAPIWrapper> winhttp_api_wrapper_; - - // This is the mapping of WindowsSystemProxyResolutionRequest objects that - // called GetProxyForUrl() to the handle that's being used for their proxy - // resolution call. Upon receiving a callback from WinHttp (which includes an - // HINTERNET handle), a reverse lookup here will get the right - // WindowsSystemProxyResolutionRequest to use. - std::unordered_map<WindowsSystemProxyResolutionRequest*, HINTERNET> - pending_callback_target_map_; - - SEQUENCE_CHECKER(sequence_checker_); - scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_; + // Asynchronously finds a proxy for |url|. The |callback_target| will be + // provided with the proxy resolution result. + virtual std::unique_ptr<Request> GetProxyForUrl( + const std::string& url, + WindowsSystemProxyResolutionRequest* callback_target) = 0; }; } // namespace net
diff --git a/net/proxy_resolution/win/windows_system_proxy_resolver.cc b/net/proxy_resolution/win/windows_system_proxy_resolver_impl.cc similarity index 84% rename from net/proxy_resolution/win/windows_system_proxy_resolver.cc rename to net/proxy_resolution/win/windows_system_proxy_resolver_impl.cc index 17cbebd..2ed8b4d 100644 --- a/net/proxy_resolution/win/windows_system_proxy_resolver.cc +++ b/net/proxy_resolution/win/windows_system_proxy_resolver_impl.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "net/proxy_resolution/win/windows_system_proxy_resolver.h" +#include "net/proxy_resolution/win/windows_system_proxy_resolver_impl.h" #include <cwchar> #include <string> @@ -94,23 +94,24 @@ } // namespace // static -scoped_refptr<WindowsSystemProxyResolver> -WindowsSystemProxyResolver::CreateWindowsSystemProxyResolver() { - scoped_refptr<WindowsSystemProxyResolver> resolver = base::WrapRefCounted( - new WindowsSystemProxyResolver(std::make_unique<WinHttpAPIWrapper>())); +scoped_refptr<WindowsSystemProxyResolverImpl> +WindowsSystemProxyResolverImpl::CreateWindowsSystemProxyResolver() { + scoped_refptr<WindowsSystemProxyResolverImpl> resolver = + base::WrapRefCounted(new WindowsSystemProxyResolverImpl( + std::make_unique<WinHttpAPIWrapper>())); if (resolver->Initialize()) { return resolver; } return nullptr; } -WindowsSystemProxyResolver::WindowsSystemProxyResolver( +WindowsSystemProxyResolverImpl::WindowsSystemProxyResolverImpl( std::unique_ptr<WinHttpAPIWrapper> winhttp_api_wrapper) : winhttp_api_wrapper_(std::move(winhttp_api_wrapper)), sequenced_task_runner_(base::SequencedTaskRunnerHandle::Get()) {} -WindowsSystemProxyResolver::~WindowsSystemProxyResolver() = default; +WindowsSystemProxyResolverImpl::~WindowsSystemProxyResolverImpl() = default; -bool WindowsSystemProxyResolver::Initialize() { +bool WindowsSystemProxyResolverImpl::Initialize() { if (!winhttp_api_wrapper_->CallWinHttpOpen()) return false; @@ -124,13 +125,13 @@ // This sets the entry point for every callback in the WinHttp session created // above. if (!winhttp_api_wrapper_->CallWinHttpSetStatusCallback( - &WindowsSystemProxyResolver::WinHttpStatusCallback)) + &WindowsSystemProxyResolverImpl::WinHttpStatusCallback)) return false; return true; } -bool WindowsSystemProxyResolver::GetProxyForUrl( +bool WindowsSystemProxyResolverImpl::GetProxyForUrl( WindowsSystemProxyResolutionRequest* callback_target, const std::string& url) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -200,25 +201,25 @@ // That may happen at any time on any thread. In order to make sure this // object does not destruct before that callback occurs, it must AddRef() // itself. This reference will be Release()'d in the callback. - base::RefCountedThreadSafe<WindowsSystemProxyResolver>::AddRef(); + base::RefCountedThreadSafe<WindowsSystemProxyResolverImpl>::AddRef(); return true; } -void WindowsSystemProxyResolver::AddPendingCallbackTarget( +void WindowsSystemProxyResolverImpl::AddPendingCallbackTarget( WindowsSystemProxyResolutionRequest* callback_target, HINTERNET resolver_handle) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); pending_callback_target_map_[callback_target] = resolver_handle; } -void WindowsSystemProxyResolver::RemovePendingCallbackTarget( +void WindowsSystemProxyResolverImpl::RemovePendingCallbackTarget( WindowsSystemProxyResolutionRequest* callback_target) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); pending_callback_target_map_.erase(callback_target); } -bool WindowsSystemProxyResolver::HasPendingCallbackTarget( +bool WindowsSystemProxyResolverImpl::HasPendingCallbackTarget( WindowsSystemProxyResolutionRequest* callback_target) const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return (pending_callback_target_map_.find(callback_target) != @@ -226,7 +227,7 @@ } WindowsSystemProxyResolutionRequest* -WindowsSystemProxyResolver::LookupCallbackTargetFromResolverHandle( +WindowsSystemProxyResolverImpl::LookupCallbackTargetFromResolverHandle( HINTERNET resolver_handle) const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); WindowsSystemProxyResolutionRequest* pending_callback_target = nullptr; @@ -240,16 +241,16 @@ } // static -void __stdcall WindowsSystemProxyResolver::WinHttpStatusCallback( - HINTERNET resolver_handle, - DWORD_PTR context, - DWORD status, - void* info, - DWORD info_len) { +void CALLBACK +WindowsSystemProxyResolverImpl::WinHttpStatusCallback(HINTERNET resolver_handle, + DWORD_PTR context, + DWORD status, + void* info, + DWORD info_len) { DCHECK(resolver_handle); DCHECK(context); - WindowsSystemProxyResolver* windows_system_proxy_resolver = - reinterpret_cast<WindowsSystemProxyResolver*>(context); + WindowsSystemProxyResolverImpl* windows_system_proxy_resolver = + reinterpret_cast<WindowsSystemProxyResolverImpl*>(context); // Make a copy of any error information in |info| so it can be accessed from // the subsequently posted task. The |info| pointer's lifetime is managed by @@ -261,18 +262,18 @@ } // It is possible for PostTask() to fail (ex: during shutdown). In that case, - // the WindowsSystemProxyResolver in |context| will leak. This is expected to - // be either unusual or to occur during shutdown, where a leak doesn't matter. - // Since calling the |context| on the wrong thread may be problematic, it will - // be allowed to leak here if PostTask() fails. + // the WindowsSystemProxyResolverImpl in |context| will leak. This is expected + // to be either unusual or to occur during shutdown, where a leak doesn't + // matter. Since calling the |context| on the wrong thread may be problematic, + // it will be allowed to leak here if PostTask() fails. windows_system_proxy_resolver->sequenced_task_runner_->PostTask( FROM_HERE, - base::BindOnce(&WindowsSystemProxyResolver::DoWinHttpStatusCallback, + base::BindOnce(&WindowsSystemProxyResolverImpl::DoWinHttpStatusCallback, windows_system_proxy_resolver, resolver_handle, status, windows_error)); } -void WindowsSystemProxyResolver::DoWinHttpStatusCallback( +void WindowsSystemProxyResolverImpl::DoWinHttpStatusCallback( HINTERNET resolver_handle, DWORD status, int windows_error) { @@ -315,13 +316,13 @@ // longer needed. winhttp_api_wrapper_->CallWinHttpCloseHandle(resolver_handle); - // The current WindowsSystemProxyResolver object may now be Release()'d on the - // correct sequence after all work is done, thus balancing out the AddRef() - // from WinHttpGetProxyForUrlEx(). - base::RefCountedThreadSafe<WindowsSystemProxyResolver>::Release(); + // The current WindowsSystemProxyResolverImpl object may now be Release()'d on + // the correct sequence after all work is done, thus balancing out the + // AddRef() from WinHttpGetProxyForUrlEx(). + base::RefCountedThreadSafe<WindowsSystemProxyResolverImpl>::Release(); } -void WindowsSystemProxyResolver::GetProxyResultForCallbackTarget( +void WindowsSystemProxyResolverImpl::GetProxyResultForCallbackTarget( WindowsSystemProxyResolutionRequest* callback_target, HINTERNET resolver_handle) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -355,7 +356,7 @@ 0); } -void WindowsSystemProxyResolver::HandleErrorForCallbackTarget( +void WindowsSystemProxyResolverImpl::HandleErrorForCallbackTarget( WindowsSystemProxyResolutionRequest* callback_target, int windows_error) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/net/proxy_resolution/win/windows_system_proxy_resolver_impl.h b/net/proxy_resolution/win/windows_system_proxy_resolver_impl.h new file mode 100644 index 0000000..1ba4236 --- /dev/null +++ b/net/proxy_resolution/win/windows_system_proxy_resolver_impl.h
@@ -0,0 +1,131 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NET_PROXY_RESOLUTION_WIN_WINDOWS_SYSTEM_PROXY_RESOLVER_IMPL_H_ +#define NET_PROXY_RESOLUTION_WIN_WINDOWS_SYSTEM_PROXY_RESOLVER_IMPL_H_ + +#include <windows.h> +#include <winhttp.h> + +#include <memory> +#include <string> +#include <unordered_map> + +#include "base/callback.h" +#include "base/compiler_specific.h" +#include "base/memory/ref_counted.h" +#include "base/sequence_checker.h" +#include "base/sequenced_task_runner.h" +#include "base/win/windows_types.h" +#include "net/base/net_export.h" +#include "net/proxy_resolution/proxy_list.h" + +namespace net { + +class WindowsSystemProxyResolutionRequest; +class WinHttpAPIWrapper; + +// This provides a layer of abstraction between calling code and +// Windows-specific code. It is shared between the +// WindowsSystemProxyResolutionService and inflight WinHttp callbacks. +// Internally, it takes care of all interaction with WinHttp. The only time this +// object is ever accessed outside of its sequence is during the WinHttp +// callback. For the sake of that callback, this must be RefCountedThreadSafe. +class NET_EXPORT WindowsSystemProxyResolverImpl + : public base::RefCountedThreadSafe<WindowsSystemProxyResolverImpl> { + public: + static scoped_refptr<WindowsSystemProxyResolverImpl> + CreateWindowsSystemProxyResolver(); + + WindowsSystemProxyResolverImpl(const WindowsSystemProxyResolverImpl&) = + delete; + WindowsSystemProxyResolverImpl& operator=( + const WindowsSystemProxyResolverImpl&) = delete; + + // This will first fetch the current system proxy settings by calling into + // WinHttpGetIEProxyConfigForCurrentUser() and then resolve the proxy using + // those settings as an input into WinHttpGetProxyForUrlEx(). + bool GetProxyForUrl(WindowsSystemProxyResolutionRequest* callback_target, + const std::string& url) WARN_UNUSED_RESULT; + + // After calling GetProxyForUrl(), a |callback_target| is saved internally for + // when proxy resolution is complete. When a + // WindowsSystemProxyResolutionRequest wants to avoid receiving a callback, + // it must remove itself from the list of pending callback targets. + void RemovePendingCallbackTarget( + WindowsSystemProxyResolutionRequest* callback_target); + bool HasPendingCallbackTarget(WindowsSystemProxyResolutionRequest* + callback_target) const WARN_UNUSED_RESULT; + + private: + friend class base::RefCountedThreadSafe<WindowsSystemProxyResolverImpl>; + friend class WindowsSystemProxyResolverTest; + + explicit WindowsSystemProxyResolverImpl( + std::unique_ptr<WinHttpAPIWrapper> winhttp_api_wrapper); + ~WindowsSystemProxyResolverImpl(); + + // Sets up the WinHttp session that will be used throughout the lifetime of + // this object. + bool Initialize(); + + // These will interact with |pending_callback_target_map_|. + void AddPendingCallbackTarget( + WindowsSystemProxyResolutionRequest* callback_target, + HINTERNET handle); + WindowsSystemProxyResolutionRequest* LookupCallbackTargetFromResolverHandle( + HINTERNET resolver_handle) const; + + // This is the callback provided to WinHttp. Once a call to resolve a proxy + // succeeds or errors out, it'll call into here with |context| being a pointer + // to a WindowsSystemProxyResolverImpl that has been kept alive. This callback + // can hit in any thread and will immediately post a task to the right + // sequence. + static void CALLBACK WinHttpStatusCallback(HINTERNET resolver_handle, + DWORD_PTR context, + DWORD status, + void* info, + DWORD info_len); + + // Called from WinHttpStatusCallback on the right sequence. This will make + // decisions about what to do from the results of the proxy resolution call. + // Note that the WindowsSystemProxyResolutionRequest that asked for this proxy + // may have decided they no longer need an answer (ex: the request has gone + // away), so this function has to deal with that situation too. + void DoWinHttpStatusCallback(HINTERNET resolver_handle, + DWORD status, + int windows_error); + + // On a successful call to WinHttpGetProxyForUrlEx(), this translates WinHttp + // results into Chromium-friendly structures before notifying the right + // WindowsSystemProxyResolutionRequest. + void GetProxyResultForCallbackTarget( + WindowsSystemProxyResolutionRequest* callback_target, + HINTERNET resolver_handle); + + // On a failed call to WinHttpGetProxyForUrlEx(), this will notify the right + // WindowsSystemProxyResolutionRequest of the error. + void HandleErrorForCallbackTarget( + WindowsSystemProxyResolutionRequest* callback_target, + int windows_error); + + // This is a thin wrapper over WinHttp APIs that may be overridden for + // testing. + std::unique_ptr<WinHttpAPIWrapper> winhttp_api_wrapper_; + + // This is the mapping of WindowsSystemProxyResolutionRequest objects that + // called GetProxyForUrl() to the handle that's being used for their proxy + // resolution call. Upon receiving a callback from WinHttp (which includes an + // HINTERNET handle), a reverse lookup here will get the right + // WindowsSystemProxyResolutionRequest to use. + std::unordered_map<WindowsSystemProxyResolutionRequest*, HINTERNET> + pending_callback_target_map_; + + SEQUENCE_CHECKER(sequence_checker_); + scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_; +}; + +} // namespace net + +#endif // NET_PROXY_RESOLUTION_WIN_WINDOWS_SYSTEM_PROXY_RESOLVER_IMPL_H_
diff --git a/net/proxy_resolution/win/windows_system_proxy_resolver_unittest.cc b/net/proxy_resolution/win/windows_system_proxy_resolver_unittest.cc deleted file mode 100644 index 8d1448a..0000000 --- a/net/proxy_resolution/win/windows_system_proxy_resolver_unittest.cc +++ /dev/null
@@ -1,835 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "net/proxy_resolution/win/windows_system_proxy_resolver.h" - -#include <windows.h> -#include <winhttp.h> - -#include <memory> -#include <set> -#include <string> -#include <vector> - -#include "base/bind.h" -#include "base/logging.h" -#include "base/memory/ptr_util.h" -#include "base/memory/ref_counted.h" -#include "base/run_loop.h" -#include "base/strings/utf_string_conversions.h" -#include "base/threading/sequenced_task_runner_handle.h" -#include "net/base/net_errors.h" -#include "net/base/proxy_server.h" -#include "net/base/proxy_string_util.h" -#include "net/base/test_completion_callback.h" -#include "net/proxy_resolution/proxy_config.h" -#include "net/proxy_resolution/proxy_list.h" -#include "net/proxy_resolution/win/windows_system_proxy_resolution_request.h" -#include "net/proxy_resolution/win/windows_system_proxy_resolution_service.h" -#include "net/proxy_resolution/win/winhttp_api_wrapper.h" -#include "net/test/test_with_task_environment.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "url/gurl.h" - -namespace net { - -namespace { - -constexpr char kUrl[] = "https://example.test:8080/"; - -void CopySettingToIEProxyConfigString(const std::wstring& setting, - LPWSTR* ie_proxy_config_string) { - *ie_proxy_config_string = static_cast<LPWSTR>( - GlobalAlloc(GPTR, sizeof(wchar_t) * (setting.length() + 1))); - memcpy(*ie_proxy_config_string, setting.data(), - sizeof(wchar_t) * setting.length()); -} - -class MockProxyResolutionRequest final - : public WindowsSystemProxyResolutionRequest { - public: - MockProxyResolutionRequest( - CompletionOnceCallback user_callback, - const NetLogWithSource& net_log, - scoped_refptr<WindowsSystemProxyResolver> windows_system_proxy_resolver) - : WindowsSystemProxyResolutionRequest(/*service=*/nullptr, - GURL(), - /*method=*/std::string(), - /*results=*/nullptr, - std::move(user_callback), - net_log, - windows_system_proxy_resolver) {} - ~MockProxyResolutionRequest() override = default; - - LoadState GetLoadState() const override { - return LOAD_STATE_RESOLVING_PROXY_FOR_URL; - } - - void AsynchronousProxyResolutionComplete(const ProxyList& proxy_list, - int net_error, - int windows_error) override { - run_loop_.Quit(); - EXPECT_TRUE(windows_system_proxy_resolver_->HasPendingCallbackTarget(this)); - windows_system_proxy_resolver_->RemovePendingCallbackTarget(this); - EXPECT_FALSE( - windows_system_proxy_resolver_->HasPendingCallbackTarget(this)); - - proxy_list_ = proxy_list; - net_error_ = net_error; - windows_error_ = windows_error; - } - - void WaitForProxyResolutionComplete() { run_loop_.Run(); } - - const ProxyList& proxy_list() const { return proxy_list_; } - - int net_error() const { return net_error_; } - - int windows_error() const { return windows_error_; } - - private: - base::RunLoop run_loop_; - ProxyList proxy_list_; - int net_error_ = 0; - int windows_error_ = 0; -}; - -// This limit is arbitrary and exists only to make memory management in this -// test easier. -constexpr unsigned int kMaxProxyEntryLimit = 10u; - -// This class will internally validate behavior that MUST be present in the code -// in order to successfully use WinHttp APIs. -class MockWinHttpAPIWrapper : public WinHttpAPIWrapper { - public: - MockWinHttpAPIWrapper() {} - ~MockWinHttpAPIWrapper() override { - if (did_call_get_proxy_result_) - EXPECT_TRUE(did_call_free_proxy_result_); - EXPECT_TRUE(opened_proxy_resolvers_.empty()); - ResetWinHttpResults(); - } - - void set_call_winhttp_open_success(bool open_success) { - open_success_ = open_success; - } - bool CallWinHttpOpen() override { - did_call_open_ = true; - return open_success_; - } - - void set_call_winhttp_set_timeouts_success(bool set_timeouts_success) { - set_timeouts_success_ = set_timeouts_success; - } - bool CallWinHttpSetTimeouts(int resolve_timeout, - int connect_timeout, - int send_timeout, - int receive_timeout) override { - EXPECT_TRUE(did_call_open_); - did_call_set_timeouts_ = true; - return set_timeouts_success_; - } - - void set_call_winhttp_set_status_callback_success( - bool set_status_callback_success) { - set_status_callback_success_ = set_status_callback_success; - } - bool CallWinHttpSetStatusCallback( - WINHTTP_STATUS_CALLBACK internet_callback) override { - EXPECT_TRUE(did_call_open_); - EXPECT_NE(internet_callback, nullptr); - EXPECT_EQ(callback_, nullptr); - callback_ = internet_callback; - did_call_set_status_callback_ = true; - return set_status_callback_success_; - } - - void set_call_winhttp_get_ie_proxy_config_success( - bool get_ie_proxy_config_success) { - get_ie_proxy_config_success_ = get_ie_proxy_config_success; - } - void set_ie_proxy_config(bool is_autoproxy_enabled, - const std::wstring& pac_url, - const std::wstring& proxy, - const std::wstring& proxy_bypass) { - is_autoproxy_enabled_ = is_autoproxy_enabled; - pac_url_ = pac_url; - proxy_ = proxy; - proxy_bypass_ = proxy_bypass; - } - bool CallWinHttpGetIEProxyConfigForCurrentUser( - WINHTTP_CURRENT_USER_IE_PROXY_CONFIG* ie_proxy_config) override { - did_call_get_ie_proxy_config_ = true; - ie_proxy_config->fAutoDetect = is_autoproxy_enabled_ ? TRUE : FALSE; - if (!pac_url_.empty()) { - CopySettingToIEProxyConfigString(pac_url_, - &ie_proxy_config->lpszAutoConfigUrl); - } - if (!proxy_.empty()) { - CopySettingToIEProxyConfigString(proxy_, &ie_proxy_config->lpszProxy); - } - if (!proxy_bypass_.empty()) { - CopySettingToIEProxyConfigString(proxy_bypass_, - &ie_proxy_config->lpszProxyBypass); - } - return get_ie_proxy_config_success_; - } - - void set_call_winhttp_create_proxy_resolver_success( - bool create_proxy_resolver_success) { - create_proxy_resolver_success_ = create_proxy_resolver_success; - } - bool CallWinHttpCreateProxyResolver(HINTERNET* out_resolver_handle) override { - EXPECT_TRUE(did_call_set_status_callback_); - EXPECT_NE(out_resolver_handle, nullptr); - if (!out_resolver_handle) - return false; - - did_call_create_proxy_resolver_ = true; - if (!create_proxy_resolver_success_) - return false; - - // The caller will be using this handle as an identifier later, so make this - // unique. - *out_resolver_handle = - reinterpret_cast<HINTERNET>(proxy_resolver_identifier_++); - EXPECT_EQ(opened_proxy_resolvers_.count(*out_resolver_handle), 0u); - opened_proxy_resolvers_.emplace(*out_resolver_handle); - - return true; - } - - void set_call_winhttp_get_proxy_for_url_success( - bool get_proxy_for_url_success) { - get_proxy_for_url_success_ = get_proxy_for_url_success; - } - bool CallWinHttpGetProxyForUrlEx(HINTERNET resolver_handle, - const std::string& url, - WINHTTP_AUTOPROXY_OPTIONS* autoproxy_options, - DWORD_PTR context) override { - // This API must be called only after the session has been correctly set up. - EXPECT_TRUE(did_call_open_); - EXPECT_TRUE(did_call_set_timeouts_); - EXPECT_TRUE(did_call_set_status_callback_); - EXPECT_NE(callback_, nullptr); - EXPECT_TRUE(did_call_get_ie_proxy_config_); - EXPECT_TRUE(did_call_create_proxy_resolver_); - EXPECT_TRUE(!did_call_get_proxy_result_); - EXPECT_TRUE(!did_call_free_proxy_result_); - - // This API must always receive valid inputs. - EXPECT_TRUE(!url.empty()); - EXPECT_TRUE(autoproxy_options); - EXPECT_FALSE(autoproxy_options->fAutoLogonIfChallenged); - EXPECT_TRUE(autoproxy_options->dwFlags & WINHTTP_AUTOPROXY_ALLOW_STATIC); - EXPECT_TRUE(autoproxy_options->dwFlags & WINHTTP_AUTOPROXY_ALLOW_CM); - if (autoproxy_options->dwFlags & WINHTTP_AUTOPROXY_CONFIG_URL) { - EXPECT_TRUE(autoproxy_options->lpszAutoConfigUrl); - } else { - EXPECT_TRUE(!autoproxy_options->lpszAutoConfigUrl); - } - if (autoproxy_options->dwFlags & WINHTTP_AUTOPROXY_AUTO_DETECT) { - EXPECT_TRUE(autoproxy_options->dwAutoDetectFlags & - WINHTTP_AUTO_DETECT_TYPE_DNS_A); - EXPECT_TRUE(autoproxy_options->dwAutoDetectFlags & - WINHTTP_AUTO_DETECT_TYPE_DHCP); - } else { - EXPECT_TRUE(!autoproxy_options->dwAutoDetectFlags); - } - - EXPECT_NE(resolver_handle, nullptr); - EXPECT_EQ(opened_proxy_resolvers_.count(resolver_handle), 1u); - EXPECT_NE(context, 0u); - if (!resolver_handle || !context || !callback_) - return false; - - did_call_get_proxy_for_url_ = true; - base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::BindOnce(&MockWinHttpAPIWrapper::RunCallback, - base::Unretained(this), resolver_handle, context)); - return get_proxy_for_url_success_; - } - - void set_call_winhttp_get_proxy_result_success( - bool get_proxy_result_success) { - get_proxy_result_success_ = get_proxy_result_success; - } - void SetCallbackStatusAndInfo(DWORD callback_status, DWORD info_error) { - callback_status_ = callback_status; - callback_info_ = std::make_unique<WINHTTP_ASYNC_RESULT>(); - callback_info_->dwError = info_error; - } - void AddBypassToProxyResults() { - EXPECT_LT(proxy_result_.cEntries, kMaxProxyEntryLimit - 1); - AllocateProxyResultEntriesIfNeeded(); - proxy_result_.pEntries[proxy_result_.cEntries].fBypass = TRUE; - proxy_result_.cEntries++; - } - void AddDirectToProxyResults() { - EXPECT_LT(proxy_result_.cEntries, kMaxProxyEntryLimit - 1); - AllocateProxyResultEntriesIfNeeded(); - proxy_result_.cEntries++; - } - void AddToProxyResults(INTERNET_SCHEME scheme, - std::wstring proxy_host, - INTERNET_PORT port) { - EXPECT_LT(proxy_result_.cEntries, kMaxProxyEntryLimit - 1); - AllocateProxyResultEntriesIfNeeded(); - - proxy_list_.push_back(std::move(proxy_host)); - wchar_t* proxy_host_raw = const_cast<wchar_t*>(proxy_list_.back().data()); - - proxy_result_.pEntries[proxy_result_.cEntries].fProxy = TRUE; - proxy_result_.pEntries[proxy_result_.cEntries].ProxyScheme = scheme; - proxy_result_.pEntries[proxy_result_.cEntries].pwszProxy = proxy_host_raw; - proxy_result_.pEntries[proxy_result_.cEntries].ProxyPort = port; - - proxy_result_.cEntries++; - } - bool CallWinHttpGetProxyResult(HINTERNET resolver_handle, - WINHTTP_PROXY_RESULT* proxy_result) override { - EXPECT_TRUE(did_call_get_proxy_for_url_); - EXPECT_NE(resolver_handle, nullptr); - EXPECT_EQ(opened_proxy_resolvers_.count(resolver_handle), 1u); - if (!get_proxy_result_success_) - return false; - - EXPECT_NE(proxy_result, nullptr); - proxy_result->cEntries = proxy_result_.cEntries; - proxy_result->pEntries = proxy_result_.pEntries; - - did_call_get_proxy_result_ = true; - return get_proxy_result_success_; - } - - void CallWinHttpFreeProxyResult(WINHTTP_PROXY_RESULT* proxy_result) override { - EXPECT_TRUE(did_call_get_proxy_result_); - EXPECT_NE(proxy_result, nullptr); - did_call_free_proxy_result_ = true; - } - - void CallWinHttpCloseHandle(HINTERNET internet_handle) override { - EXPECT_EQ(opened_proxy_resolvers_.count(internet_handle), 1u); - opened_proxy_resolvers_.erase(internet_handle); - } - - void ResetWinHttpResults() { - if (proxy_result_.pEntries) { - delete[] proxy_result_.pEntries; - proxy_result_.pEntries = nullptr; - proxy_result_ = {0}; - } - proxy_list_.clear(); - } - - private: - void RunCallback(HINTERNET resolver_handle, DWORD_PTR context) { - EXPECT_NE(callback_, nullptr); - EXPECT_NE(resolver_handle, nullptr); - EXPECT_EQ(opened_proxy_resolvers_.count(resolver_handle), 1u); - EXPECT_NE(context, 0u); - callback_(resolver_handle, context, callback_status_, callback_info_.get(), - sizeof(callback_info_.get())); - - // As soon as the callback resolves, WinHttp may choose to delete the memory - // contained by |callback_info_|. This is simulated here. - callback_info_.reset(); - } - - void AllocateProxyResultEntriesIfNeeded() { - if (proxy_result_.cEntries != 0) - return; - - proxy_result_.pEntries = - new WINHTTP_PROXY_RESULT_ENTRY[kMaxProxyEntryLimit]; - std::memset(proxy_result_.pEntries, 0, - kMaxProxyEntryLimit * sizeof(WINHTTP_PROXY_RESULT_ENTRY)); - - // The memory of the strings above will be backed by a vector of strings. - proxy_list_.reserve(kMaxProxyEntryLimit); - } - - // Data configurable by tests to simulate errors and results from WinHttp. - bool open_success_ = true; - bool set_timeouts_success_ = true; - bool set_status_callback_success_ = true; - bool get_ie_proxy_config_success_ = true; - bool create_proxy_resolver_success_ = true; - bool get_proxy_for_url_success_ = true; - bool get_proxy_result_success_ = true; - DWORD callback_status_ = WINHTTP_CALLBACK_STATUS_GETPROXYFORURL_COMPLETE; - std::unique_ptr<WINHTTP_ASYNC_RESULT> callback_info_; - bool is_autoproxy_enabled_ = false; - std::wstring pac_url_; - std::wstring proxy_; - std::wstring proxy_bypass_; - WINHTTP_PROXY_RESULT proxy_result_ = {0}; - std::vector<std::wstring> proxy_list_; - - // Data used internally in the mock to function and validate its own behavior. - bool did_call_open_ = false; - bool did_call_set_timeouts_ = false; - bool did_call_set_status_callback_ = false; - bool did_call_get_ie_proxy_config_ = false; - int proxy_resolver_identifier_ = 1; - std::set<HINTERNET> opened_proxy_resolvers_; - bool did_call_create_proxy_resolver_ = false; - bool did_call_get_proxy_for_url_ = false; - bool did_call_get_proxy_result_ = false; - bool did_call_free_proxy_result_ = false; - WINHTTP_STATUS_CALLBACK callback_ = nullptr; -}; - -} // namespace - -// These tests verify the behavior of the WindowsSystemProxyResolver in -// isolation by mocking out the WinHttpAPIWrapper it uses and the -// WindowsSystemProxyResolutionRequest it normally reports back to. -class WindowsSystemProxyResolverTest : public TestWithTaskEnvironment { - public: - void SetUp() override { - testing::Test::SetUp(); - - if (!WindowsSystemProxyResolutionService::IsSupported()) { - GTEST_SKIP() - << "Windows System Proxy Resolution is only supported on Windows 8+."; - } - - winhttp_api_wrapper_ = new MockWinHttpAPIWrapper(); - // In general, the WindowsSystemProxyResolver should be created via - // CreateWindowsSystemProxyResolver(), so the constructor is protected. Thus - // base::MakeRefCounted cannot be used here. - proxy_resolver_ = base::WrapRefCounted( - new WindowsSystemProxyResolver(base::WrapUnique(winhttp_api_wrapper_))); - } - - void TearDown() override { - EXPECT_TRUE(!proxy_resolver_ || proxy_resolver_->HasOneRef()) - << "This test has a memory leak!"; - ResetProxyResolutionService(); - - testing::Test::TearDown(); - } - - MockWinHttpAPIWrapper* winhttp_api_wrapper() { return winhttp_api_wrapper_; } - - scoped_refptr<WindowsSystemProxyResolver> proxy_resolver() { - return proxy_resolver_; - } - - bool InitializeResolver() { return proxy_resolver_->Initialize(); } - - void PerformGetProxyForUrlAndValidateResult(const ProxyList& proxy_list, - int net_error, - int windows_error) { - ASSERT_TRUE(InitializeResolver()); - TestCompletionCallback unused_callback; - NetLogWithSource unused_log; - MockProxyResolutionRequest proxy_resolution_request( - unused_callback.callback(), unused_log, proxy_resolver()); - ASSERT_TRUE( - proxy_resolver()->GetProxyForUrl(&proxy_resolution_request, kUrl)); - ASSERT_TRUE( - proxy_resolver()->HasPendingCallbackTarget(&proxy_resolution_request)); - - proxy_resolution_request.WaitForProxyResolutionComplete(); - - EXPECT_TRUE(proxy_list.Equals(proxy_resolution_request.proxy_list())); - EXPECT_EQ(proxy_resolution_request.net_error(), net_error); - EXPECT_EQ(proxy_resolution_request.windows_error(), windows_error); - } - - void DoFailedGetProxyForUrlTest(int net_error, int windows_error) { - PerformGetProxyForUrlAndValidateResult(ProxyList(), net_error, - windows_error); - } - - void DoProxyConfigTest(const ProxyConfig& proxy_config) { - winhttp_api_wrapper()->AddToProxyResults(INTERNET_SCHEME_HTTPS, L"foopy", - 8443); - ProxyList proxy_list; - proxy_list.AddProxyServer( - PacResultElementToProxyServer("HTTPS foopy:8443")); - - std::wstring pac_url; - if (proxy_config.has_pac_url()) - pac_url = base::UTF8ToWide(proxy_config.pac_url().spec()); - - std::wstring proxy; - if (!proxy_config.proxy_rules().single_proxies.IsEmpty()) - proxy = base::UTF8ToWide( - proxy_config.proxy_rules().single_proxies.ToPacString()); - - std::wstring proxy_bypass; - if (!proxy_config.proxy_rules().bypass_rules.ToString().empty()) - proxy_bypass = - base::UTF8ToWide(proxy_config.proxy_rules().bypass_rules.ToString()); - - winhttp_api_wrapper_->set_ie_proxy_config(proxy_config.auto_detect(), - pac_url, proxy, proxy_bypass); - - PerformGetProxyForUrlAndValidateResult(proxy_list, OK, 0); - } - - void DoGetProxyForUrlTest(const ProxyList& proxy_list) { - PerformGetProxyForUrlAndValidateResult(proxy_list, OK, 0); - } - - void ResetProxyResolutionService() { - winhttp_api_wrapper_ = nullptr; - proxy_resolver_.reset(); - } - - private: - MockWinHttpAPIWrapper* winhttp_api_wrapper_ = nullptr; - scoped_refptr<WindowsSystemProxyResolver> proxy_resolver_; -}; - -TEST_F(WindowsSystemProxyResolverTest, InitializeFailOnOpen) { - winhttp_api_wrapper()->set_call_winhttp_open_success(false); - EXPECT_FALSE(InitializeResolver()); -} - -TEST_F(WindowsSystemProxyResolverTest, InitializeFailOnSetTimeouts) { - winhttp_api_wrapper()->set_call_winhttp_set_timeouts_success(false); - EXPECT_FALSE(InitializeResolver()); -} - -TEST_F(WindowsSystemProxyResolverTest, InitializeFailOnSetStatusCallback) { - winhttp_api_wrapper()->set_call_winhttp_set_status_callback_success(false); - EXPECT_FALSE(InitializeResolver()); -} - -TEST_F(WindowsSystemProxyResolverTest, InitializeSucceedsIfWinHttpAPIsWork) { - EXPECT_TRUE(InitializeResolver()); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlFailOnGetIEProxySettings) { - winhttp_api_wrapper()->set_call_winhttp_get_ie_proxy_config_success(false); - ASSERT_TRUE(InitializeResolver()); - TestCompletionCallback unused_callback; - NetLogWithSource unused_log; - MockProxyResolutionRequest proxy_resolution_request( - unused_callback.callback(), unused_log, proxy_resolver()); - EXPECT_FALSE( - proxy_resolver()->GetProxyForUrl(&proxy_resolution_request, kUrl)); - EXPECT_FALSE( - proxy_resolver()->HasPendingCallbackTarget(&proxy_resolution_request)); -} - -TEST_F(WindowsSystemProxyResolverTest, - GetProxyForUrlFailOnCreateProxyResolver) { - winhttp_api_wrapper()->set_call_winhttp_create_proxy_resolver_success(false); - ASSERT_TRUE(InitializeResolver()); - TestCompletionCallback unused_callback; - NetLogWithSource unused_log; - MockProxyResolutionRequest proxy_resolution_request( - unused_callback.callback(), unused_log, proxy_resolver()); - EXPECT_FALSE( - proxy_resolver()->GetProxyForUrl(&proxy_resolution_request, kUrl)); - EXPECT_FALSE( - proxy_resolver()->HasPendingCallbackTarget(&proxy_resolution_request)); -} - -TEST_F(WindowsSystemProxyResolverTest, - GetProxyForUrlFailOnWinHttpGetProxyForUrlEx) { - winhttp_api_wrapper()->set_call_winhttp_get_proxy_for_url_success(false); - ASSERT_TRUE(InitializeResolver()); - TestCompletionCallback unused_callback; - NetLogWithSource unused_log; - MockProxyResolutionRequest proxy_resolution_request( - unused_callback.callback(), unused_log, proxy_resolver()); - EXPECT_FALSE( - proxy_resolver()->GetProxyForUrl(&proxy_resolution_request, kUrl)); - EXPECT_FALSE( - proxy_resolver()->HasPendingCallbackTarget(&proxy_resolution_request)); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlFailOnFailedCallback) { - winhttp_api_wrapper()->SetCallbackStatusAndInfo( - WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, API_RECEIVE_RESPONSE); - DoFailedGetProxyForUrlTest(ERR_FAILED, API_RECEIVE_RESPONSE); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlFailOnGetProxyResult) { - winhttp_api_wrapper()->set_call_winhttp_get_proxy_result_success(false); - DoFailedGetProxyForUrlTest(ERR_FAILED, 0); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlFailOnDefaultPort) { - winhttp_api_wrapper()->AddToProxyResults(INTERNET_SCHEME_HTTP, L"foopy", - INTERNET_DEFAULT_PORT); - DoFailedGetProxyForUrlTest(ERR_FAILED, 0); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlFailOnNoResults) { - DoFailedGetProxyForUrlTest(ERR_FAILED, 0); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlCancellation) { - ASSERT_TRUE(InitializeResolver()); - - // This extra scope is needed so that the MockProxyResolutionRequest destructs - // before the end of the test. This should help catch any use-after-free issue - // in the code. - { - TestCompletionCallback unused_callback; - NetLogWithSource unused_log; - MockProxyResolutionRequest proxy_resolution_request( - unused_callback.callback(), unused_log, proxy_resolver()); - ASSERT_TRUE( - proxy_resolver()->GetProxyForUrl(&proxy_resolution_request, kUrl)); - ASSERT_TRUE( - proxy_resolver()->HasPendingCallbackTarget(&proxy_resolution_request)); - - proxy_resolver()->RemovePendingCallbackTarget(&proxy_resolution_request); - EXPECT_FALSE( - proxy_resolver()->HasPendingCallbackTarget(&proxy_resolution_request)); - } - - // There must never be a callback and the resolver must not be leaked. - base::RunLoop().RunUntilIdle(); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlCancelAndRestart) { - winhttp_api_wrapper()->AddToProxyResults(INTERNET_SCHEME_HTTPS, L"foopy", - 8443); - ProxyList expected_proxy_list; - expected_proxy_list.AddProxyServer( - PacResultElementToProxyServer("HTTPS foopy:8443")); - - ASSERT_TRUE(InitializeResolver()); - TestCompletionCallback unused_callback; - NetLogWithSource unused_log; - MockProxyResolutionRequest proxy_resolution_request( - unused_callback.callback(), unused_log, proxy_resolver()); - ASSERT_TRUE( - proxy_resolver()->GetProxyForUrl(&proxy_resolution_request, kUrl)); - ASSERT_TRUE( - proxy_resolver()->HasPendingCallbackTarget(&proxy_resolution_request)); - - // Abandon the proxy resolution for this request. - proxy_resolver()->RemovePendingCallbackTarget(&proxy_resolution_request); - EXPECT_FALSE( - proxy_resolver()->HasPendingCallbackTarget(&proxy_resolution_request)); - - // Start a new proxy resolution for the request. - ASSERT_TRUE( - proxy_resolver()->GetProxyForUrl(&proxy_resolution_request, kUrl)); - ASSERT_TRUE( - proxy_resolver()->HasPendingCallbackTarget(&proxy_resolution_request)); - - // The received callback must be for the second GetProxyForUrl(). - proxy_resolution_request.WaitForProxyResolutionComplete(); - EXPECT_TRUE( - expected_proxy_list.Equals(proxy_resolution_request.proxy_list())); - EXPECT_EQ(proxy_resolution_request.net_error(), OK); - EXPECT_EQ(proxy_resolution_request.windows_error(), 0); - - // There must never be a callback for the first request and the resolver must - // not be leaked. - base::RunLoop().RunUntilIdle(); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlConfigDirect) { - DoProxyConfigTest(ProxyConfig::CreateDirect()); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlConfigAutoDetect) { - DoProxyConfigTest(ProxyConfig::CreateAutoDetect()); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlConfigPacUrl) { - const GURL pac_url("http://pac-site.test/path/to/pac-url.pac"); - DoProxyConfigTest(ProxyConfig::CreateFromCustomPacURL(pac_url)); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlConfigSingleProxy) { - ProxyConfig config; - const ProxyServer proxy_server = - PacResultElementToProxyServer("HTTPS ignored:33"); - config.proxy_rules().single_proxies.AddProxyServer(proxy_server); - DoProxyConfigTest(config); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlConfigBypass) { - ProxyConfig config; - config.proxy_rules().bypass_rules.AddRuleFromString("example.test"); - DoProxyConfigTest(config); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlConfigMultipleSettings) { - ProxyConfig config; - config.set_auto_detect(true); - - const GURL pac_url("http://pac-site.test/path/to/pac-url.pac"); - config.set_pac_url(pac_url); - - const ProxyServer proxy_server = - PacResultElementToProxyServer("HTTPS ignored:33"); - config.proxy_rules().single_proxies.AddProxyServer(proxy_server); - - DoProxyConfigTest(config); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlDirect) { - winhttp_api_wrapper()->AddDirectToProxyResults(); - ProxyList expected_proxy_list; - expected_proxy_list.AddProxyServer(ProxyServer::Direct()); - DoGetProxyForUrlTest(expected_proxy_list); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlBypass) { - winhttp_api_wrapper()->AddBypassToProxyResults(); - ProxyList expected_proxy_list; - expected_proxy_list.AddProxyServer(ProxyServer::Direct()); - DoGetProxyForUrlTest(expected_proxy_list); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlHTTP) { - winhttp_api_wrapper()->AddToProxyResults(INTERNET_SCHEME_HTTP, L"foopy", - 8080); - ProxyList expected_proxy_list; - expected_proxy_list.AddProxyServer( - PacResultElementToProxyServer("PROXY foopy:8080")); - DoGetProxyForUrlTest(expected_proxy_list); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlHTTPS) { - winhttp_api_wrapper()->AddToProxyResults(INTERNET_SCHEME_HTTPS, L"foopy", - 8443); - ProxyList expected_proxy_list; - expected_proxy_list.AddProxyServer( - PacResultElementToProxyServer("HTTPS foopy:8443")); - DoGetProxyForUrlTest(expected_proxy_list); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlSOCKS) { - winhttp_api_wrapper()->AddToProxyResults(INTERNET_SCHEME_SOCKS, L"foopy", - 8080); - ProxyList expected_proxy_list; - expected_proxy_list.AddProxyServer( - PacResultElementToProxyServer("SOCKS4 foopy:8080")); - DoGetProxyForUrlTest(expected_proxy_list); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlIDNProxy) { - winhttp_api_wrapper()->AddToProxyResults(INTERNET_SCHEME_HTTPS, L"föopy", - 8080); - - // Expect L"föopy" to be ascii-encoded as "xn--fopy-5qa". - ProxyList expected_proxy_list; - expected_proxy_list.AddProxyServer( - PacResultElementToProxyServer("HTTPS xn--fopy-5qa:8080")); - - DoGetProxyForUrlTest(expected_proxy_list); -} - -TEST_F(WindowsSystemProxyResolverTest, GetProxyForUrlMultipleResults) { - winhttp_api_wrapper()->AddToProxyResults(INTERNET_SCHEME_HTTPS, L"foopy", - 8443); - winhttp_api_wrapper()->AddDirectToProxyResults(); - - ProxyList expected_proxy_list; - expected_proxy_list.AddProxyServer( - PacResultElementToProxyServer("HTTPS foopy:8443")); - expected_proxy_list.AddProxyServer(ProxyServer::Direct()); - - DoGetProxyForUrlTest(expected_proxy_list); -} - -TEST_F(WindowsSystemProxyResolverTest, MultipleCallsToGetProxyForUrl) { - winhttp_api_wrapper()->AddToProxyResults(INTERNET_SCHEME_HTTPS, L"foopy", - 8443); - winhttp_api_wrapper()->AddDirectToProxyResults(); - - ProxyList expected_proxy_list; - expected_proxy_list.AddProxyServer( - PacResultElementToProxyServer("HTTPS foopy:8443")); - expected_proxy_list.AddProxyServer(ProxyServer::Direct()); - - ASSERT_TRUE(InitializeResolver()); - - TestCompletionCallback unused_callback; - NetLogWithSource unused_log; - MockProxyResolutionRequest first_proxy_resolution_request( - unused_callback.callback(), unused_log, proxy_resolver()); - ASSERT_TRUE( - proxy_resolver()->GetProxyForUrl(&first_proxy_resolution_request, kUrl)); - ASSERT_TRUE(proxy_resolver()->HasPendingCallbackTarget( - &first_proxy_resolution_request)); - - MockProxyResolutionRequest second_proxy_resolution_request( - unused_callback.callback(), unused_log, proxy_resolver()); - ASSERT_TRUE( - proxy_resolver()->GetProxyForUrl(&second_proxy_resolution_request, kUrl)); - ASSERT_TRUE(proxy_resolver()->HasPendingCallbackTarget( - &second_proxy_resolution_request)); - - first_proxy_resolution_request.WaitForProxyResolutionComplete(); - second_proxy_resolution_request.WaitForProxyResolutionComplete(); - - EXPECT_TRUE( - expected_proxy_list.Equals(first_proxy_resolution_request.proxy_list())); - EXPECT_EQ(first_proxy_resolution_request.net_error(), OK); - EXPECT_EQ(first_proxy_resolution_request.windows_error(), 0); - - EXPECT_TRUE( - expected_proxy_list.Equals(second_proxy_resolution_request.proxy_list())); - EXPECT_EQ(second_proxy_resolution_request.net_error(), OK); - EXPECT_EQ(second_proxy_resolution_request.windows_error(), 0); -} - -TEST_F(WindowsSystemProxyResolverTest, - MultipleCallsToGetProxyForUrlWithOneCancellation) { - winhttp_api_wrapper()->AddToProxyResults(INTERNET_SCHEME_HTTPS, L"foopy", - 8443); - winhttp_api_wrapper()->AddDirectToProxyResults(); - - ProxyList expected_proxy_list; - expected_proxy_list.AddProxyServer( - PacResultElementToProxyServer("HTTPS foopy:8443")); - expected_proxy_list.AddProxyServer(ProxyServer::Direct()); - - ASSERT_TRUE(InitializeResolver()); - - // This extra scope is needed so that the MockProxyResolutionRequests destruct - // before the end of the test. This should help catch any use-after-free issue - // in the code. - { - TestCompletionCallback unused_callback; - NetLogWithSource unused_log; - MockProxyResolutionRequest first_proxy_resolution_request( - unused_callback.callback(), unused_log, proxy_resolver()); - ASSERT_TRUE(proxy_resolver()->GetProxyForUrl( - &first_proxy_resolution_request, kUrl)); - ASSERT_TRUE(proxy_resolver()->HasPendingCallbackTarget( - &first_proxy_resolution_request)); - - MockProxyResolutionRequest second_proxy_resolution_request( - unused_callback.callback(), unused_log, proxy_resolver()); - ASSERT_TRUE(proxy_resolver()->GetProxyForUrl( - &second_proxy_resolution_request, kUrl)); - ASSERT_TRUE(proxy_resolver()->HasPendingCallbackTarget( - &second_proxy_resolution_request)); - - proxy_resolver()->RemovePendingCallbackTarget( - &first_proxy_resolution_request); - EXPECT_FALSE(proxy_resolver()->HasPendingCallbackTarget( - &first_proxy_resolution_request)); - second_proxy_resolution_request.WaitForProxyResolutionComplete(); - - EXPECT_TRUE(expected_proxy_list.Equals( - second_proxy_resolution_request.proxy_list())); - EXPECT_EQ(second_proxy_resolution_request.net_error(), OK); - EXPECT_EQ(second_proxy_resolution_request.windows_error(), 0); - } - - // There must never be a callback for the first request and the resolver must - // not be leaked. - base::RunLoop().RunUntilIdle(); -} - -} // namespace net
diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc index d34fe85..5840204 100644 --- a/net/socket/ssl_client_socket_unittest.cc +++ b/net/socket/ssl_client_socket_unittest.cc
@@ -21,6 +21,7 @@ #include "base/memory/ref_counted.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" +#include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/stringprintf.h" #include "base/synchronization/lock.h" @@ -696,33 +697,34 @@ ManySmallRecordsHttpResponse(size_t chunk_size, size_t chunk_count) : chunk_size_(chunk_size), chunk_count_(chunk_count) {} - void SendResponse(const test_server::SendBytesCallback& send, - test_server::SendCompleteCallback done) override { - std::string headers = base::StringPrintf( - "HTTP/1.1 200 OK\r\n" - "Connection: close\r\n" - "Content-Length: %zu\r\n" - "Content-Type: text/plain\r\n\r\n", - chunk_size_ * chunk_count_); - send.Run(headers, base::BindOnce(&SendChunks, chunk_size_, chunk_count_, - send, std::move(done))); + void SendResponse( + base::WeakPtr<test_server::HttpResponseDelegate> delegate) override { + base::StringPairs headers = { + {"Connection", "close"}, + {"Content-Length", base::NumberToString(chunk_size_ * chunk_count_)}, + {"Content-Type", "text/plain"}}; + delegate->SendResponseHeaders(HTTP_OK, "OK", headers); + SendChunks(chunk_size_, chunk_count_, delegate); } private: - static void SendChunks(size_t chunk_size, - size_t chunk_count, - const test_server::SendBytesCallback& send, - test_server::SendCompleteCallback done) { + static void SendChunks( + size_t chunk_size, + size_t chunk_count, + base::WeakPtr<test_server::HttpResponseDelegate> delegate) { + if (!delegate) + return; + if (chunk_count == 0) { - std::move(done).Run(); + delegate->FinishResponse(); return; } std::string chunk(chunk_size, '*'); // This assumes that splitting output into separate |send| calls will // produce separate TLS records. - send.Run(chunk, base::BindOnce(&SendChunks, chunk_size, chunk_count - 1, - send, std::move(done))); + delegate->SendContents(chunk, base::BindOnce(&SendChunks, chunk_size, + chunk_count - 1, delegate)); } size_t chunk_size_; @@ -1339,8 +1341,8 @@ ~ZeroRTTResponse() override {} - void SendResponse(const test_server::SendBytesCallback& send, - test_server::SendCompleteCallback done) override { + void SendResponse( + base::WeakPtr<test_server::HttpResponseDelegate> delegate) override { std::string response; if (zero_rtt_) { response = "1"; @@ -1351,7 +1353,7 @@ // Since the EmbeddedTestServer doesn't keep the socket open by default, it // is explicitly kept alive to allow the remaining leg of the 0RTT handshake // to be received after the early data. - send.Run(response, base::BindOnce([]() {})); + delegate->SendContents(response); } private:
diff --git a/net/test/embedded_test_server/DEPS b/net/test/embedded_test_server/DEPS new file mode 100644 index 0000000..b307e7d --- /dev/null +++ b/net/test/embedded_test_server/DEPS
@@ -0,0 +1,3 @@ +include_rules = [ + "+absl" +] \ No newline at end of file
diff --git a/net/test/embedded_test_server/controllable_http_response.cc b/net/test/embedded_test_server/controllable_http_response.cc index 7541b2c..0834b1c 100644 --- a/net/test/embedded_test_server/controllable_http_response.cc +++ b/net/test/embedded_test_server/controllable_http_response.cc
@@ -8,6 +8,7 @@ #include "base/check_op.h" #include "base/strings/stringprintf.h" #include "base/threading/thread_task_runner_handle.h" +#include "net/test/embedded_test_server/http_response.h" namespace net { @@ -29,13 +30,12 @@ ~Interceptor() override {} private: - void SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) override { + void SendResponse(base::WeakPtr<HttpResponseDelegate> delegate) override { controller_task_runner_->PostTask( FROM_HERE, base::BindOnce(&ControllableHttpResponse::OnRequest, controller_, - base::ThreadTaskRunnerHandle::Get(), send, - std::move(done), std::move(http_request_))); + base::ThreadTaskRunnerHandle::Get(), delegate, + std::move(http_request_))); } base::WeakPtr<ControllableHttpResponse> controller_; @@ -63,8 +63,6 @@ << "WaitForRequest() called twice."; loop_.Run(); DCHECK(embedded_test_server_task_runner_); - DCHECK(send_); - DCHECK(done_); state_ = State::READY_TO_SEND_DATA; } @@ -89,7 +87,8 @@ "call WaitForRequest()?"; base::RunLoop loop; embedded_test_server_task_runner_->PostTask( - FROM_HERE, base::BindOnce(send_, bytes, loop.QuitClosure())); + FROM_HERE, base::BindOnce(&HttpResponseDelegate::SendContents, delegate_, + bytes, loop.QuitClosure())); loop.Run(); } @@ -98,22 +97,22 @@ DCHECK_EQ(State::READY_TO_SEND_DATA, state_) << "Done() called without any " "opened connection. Did you " "call WaitForRequest()?"; - embedded_test_server_task_runner_->PostTask(FROM_HERE, std::move(done_)); + embedded_test_server_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&HttpResponseDelegate::FinishResponse, delegate_)); state_ = State::DONE; } void ControllableHttpResponse::OnRequest( scoped_refptr<base::SingleThreadTaskRunner> embedded_test_server_task_runner, - const SendBytesCallback& send, - SendCompleteCallback done, + base::WeakPtr<HttpResponseDelegate> delegate, std::unique_ptr<HttpRequest> http_request) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!embedded_test_server_task_runner_) << "A ControllableHttpResponse can only handle one request at a time"; embedded_test_server_task_runner_ = embedded_test_server_task_runner; - send_ = send; - done_ = std::move(done); + delegate_ = delegate; http_request_ = std::move(http_request); loop_.Quit(); }
diff --git a/net/test/embedded_test_server/controllable_http_response.h b/net/test/embedded_test_server/controllable_http_response.h index 9e8cb0d..3caaf269 100644 --- a/net/test/embedded_test_server/controllable_http_response.h +++ b/net/test/embedded_test_server/controllable_http_response.h
@@ -71,8 +71,7 @@ void OnRequest(scoped_refptr<base::SingleThreadTaskRunner> embedded_test_server_task_runner, - const SendBytesCallback& send, - SendCompleteCallback done, + base::WeakPtr<HttpResponseDelegate> delegate, std::unique_ptr<HttpRequest> http_request); static std::unique_ptr<HttpResponse> RequestHandler( @@ -86,8 +85,7 @@ State state_ = State::WAITING_FOR_REQUEST; base::RunLoop loop_; scoped_refptr<base::SingleThreadTaskRunner> embedded_test_server_task_runner_; - SendBytesCallback send_; - SendCompleteCallback done_; + base::WeakPtr<HttpResponseDelegate> delegate_; std::unique_ptr<HttpRequest> http_request_; SEQUENCE_CHECKER(sequence_checker_);
diff --git a/net/test/embedded_test_server/default_handlers.cc b/net/test/embedded_test_server/default_handlers.cc index f442f8d..83d3794 100644 --- a/net/test/embedded_test_server/default_handlers.cc +++ b/net/test/embedded_test_server/default_handlers.cc
@@ -14,6 +14,7 @@ #include "base/base64.h" #include "base/bind.h" +#include "base/callback_forward.h" #include "base/callback_helpers.h" #include "base/files/file_path.h" #include "base/files/file_util.h" @@ -686,38 +687,12 @@ return http_response; } -// Never returns a response. -class HungHttpResponse : public HttpResponse { - public: - HungHttpResponse() = default; - - void SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) override {} - - private: - DISALLOW_COPY_AND_ASSIGN(HungHttpResponse); -}; - // /hung // Never returns a response. std::unique_ptr<HttpResponse> HandleHungResponse(const HttpRequest& request) { - return std::make_unique<HungHttpResponse>(); + return std::make_unique<HungResponse>(); } -// Return headers, then hangs. -class HungAfterHeadersHttpResponse : public HttpResponse { - public: - HungAfterHeadersHttpResponse() = default; - - void SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) override { - send.Run("HTTP/1.1 OK\r\n\r\n", base::DoNothing()); - } - - private: - DISALLOW_COPY_AND_ASSIGN(HungAfterHeadersHttpResponse); -}; - // /hung-after-headers // Never returns a response. std::unique_ptr<HttpResponse> HandleHungAfterHeadersResponse( @@ -731,25 +706,32 @@ public: ExabyteResponse() {} - void SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) override { + void SendResponse(base::WeakPtr<HttpResponseDelegate> delegate) override { // Use 10^18 bytes (exabyte) as the content length so that the client will // be expecting data. - send.Run("HTTP/1.1 200 OK\r\nContent-Length:1000000000000000000\r\n\r\n", - base::BindOnce(&ExabyteResponse::SendExabyte, send)); + delegate->SendResponseHeaders(HTTP_OK, "OK", + {{"Content-Length", "1000000000000000000"}}); + SendExabyte(delegate); } private: // Keeps sending the word "echo" over and over again. It can go further to // limit the response to exactly an exabyte, but it shouldn't be necessary // for the purpose of testing. - static void SendExabyte(const SendBytesCallback& send) { - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::BindOnce(send, "echo", - base::BindOnce(&ExabyteResponse::SendExabyte, send))); + void SendExabyte(base::WeakPtr<HttpResponseDelegate> delegate) { + delegate->SendContents( + "echo", base::BindOnce(&ExabyteResponse::PostSendExabyteTask, + weak_factory_.GetWeakPtr(), delegate)); } + void PostSendExabyteTask(base::WeakPtr<HttpResponseDelegate> delegate) { + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(&ExabyteResponse::SendExabyte, + weak_factory_.GetWeakPtr(), delegate)); + } + + base::WeakPtrFactory<ExabyteResponse> weak_factory_{this}; + DISALLOW_COPY_AND_ASSIGN(ExabyteResponse); }; @@ -817,10 +799,8 @@ DelayedChunkedHttpResponse& operator=(const DelayedChunkedHttpResponse&) = delete; - void SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) override { - send_bytes_callback_ = send; - send_complete_callback_ = std::move(done); + void SendResponse(base::WeakPtr<HttpResponseDelegate> delegate) override { + delegate_ = delegate; base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, @@ -831,19 +811,16 @@ private: void SendHeaders() { - send_bytes_callback_.Run( - "HTTP/1.1 200 OK\r\n" - "Content-Type: text/plain\r\n" - "Connection: close\r\n" - "Transfer-Encoding: chunked\r\n\r\n", - base::BindOnce(&DelayedChunkedHttpResponse::PrepateToSendNextChunk, - weak_ptr_factory_.GetWeakPtr())); + base::StringPairs headers = {{"Content-Type", "text/plain"}, + {"Connection", "close"}, + {"Transfer-Encoding", "chunked"}}; + delegate_->SendResponseHeaders(HTTP_OK, "OK", headers); + PrepareToSendNextChunk(); } - void PrepateToSendNextChunk() { + void PrepareToSendNextChunk() { if (remaining_chunks_ == 0) { - send_bytes_callback_.Run(CreateChunk(0 /* chunk_size */), - std::move(send_complete_callback_)); + delegate_->SendContentsAndFinish(CreateChunk(0 /* chunk_size */)); return; } @@ -857,9 +834,10 @@ void SendNextChunk() { DCHECK_GT(remaining_chunks_, 0); remaining_chunks_--; - send_bytes_callback_.Run( + + delegate_->SendContents( CreateChunk(chunk_size_), - base::BindOnce(&DelayedChunkedHttpResponse::PrepateToSendNextChunk, + base::BindOnce(&DelayedChunkedHttpResponse::PrepareToSendNextChunk, weak_ptr_factory_.GetWeakPtr())); } @@ -876,8 +854,7 @@ int chunk_size_; int remaining_chunks_; - SendBytesCallback send_bytes_callback_; - SendCompleteCallback send_complete_callback_; + base::WeakPtr<HttpResponseDelegate> delegate_ = nullptr; base::WeakPtrFactory<DelayedChunkedHttpResponse> weak_ptr_factory_{this}; };
diff --git a/net/test/embedded_test_server/embedded_test_server.cc b/net/test/embedded_test_server/embedded_test_server.cc index ecaa5b45..18bdb99 100644 --- a/net/test/embedded_test_server/embedded_test_server.cc +++ b/net/test/embedded_test_server/embedded_test_server.cc
@@ -643,8 +643,9 @@ connections_.clear(); } -void EmbeddedTestServer::HandleRequest(HttpConnection* connection, - std::unique_ptr<HttpRequest> request) { +void EmbeddedTestServer::HandleRequest( + base::WeakPtr<HttpResponseDelegate> delegate, + std::unique_ptr<HttpRequest> request) { DCHECK(io_thread_->task_runner()->BelongsToCurrentThread()); request->base_url = base_url_; @@ -676,12 +677,8 @@ } HttpResponse* const response_ptr = response.get(); - response_ptr->SendResponse( - base::BindRepeating(&HttpConnection::SendResponseBytes, - connection->GetWeakPtr()), - base::BindOnce(&EmbeddedTestServer::OnResponseCompleted, - weak_factory_.GetWeakPtr(), connection, - std::move(response))); + delegate->AddResponse(std::move(response)); + response_ptr->SendResponse(delegate); } GURL EmbeddedTestServer::GetURL(const std::string& relative_url) const { @@ -950,23 +947,6 @@ return connection; } -void EmbeddedTestServer::OnResponseCompleted( - HttpConnection* connection, - std::unique_ptr<HttpResponse> response) { - // TODO(crbug.com/1232482): This is here to ensure the response lives until - // after the connection sends it. Factor this out with re-factor of response - // API. - DCHECK(io_thread_->task_runner()->BelongsToCurrentThread()); - DCHECK(connection); - DCHECK_EQ(1u, connections_.count(&connection->Socket())); - - std::unique_ptr<StreamSocket> socket = connection->TakeSocket(); - connections_.erase(socket.get()); - - if (connection_listener_ && socket->IsConnected()) - connection_listener_->OnResponseCompletedSuccessfully(std::move(socket)); -} - void EmbeddedTestServer::RemoveConnection( HttpConnection* connection, EmbeddedTestServerConnectionListener* listener) {
diff --git a/net/test/embedded_test_server/embedded_test_server.h b/net/test/embedded_test_server/embedded_test_server.h index 0a191b3..01cbe21 100644 --- a/net/test/embedded_test_server/embedded_test_server.h +++ b/net/test/embedded_test_server/embedded_test_server.h
@@ -44,6 +44,7 @@ class EmbeddedTestServerConnectionListener; class HttpConnection; class HttpResponse; +class HttpResponseDelegate; struct HttpRequest; class EmbeddedTestServer; @@ -327,7 +328,7 @@ // Send a request to the server to be handled. If a response is created, // SendResponseBytes() should be called on the provided HttpConnection. - void HandleRequest(HttpConnection* connection, + void HandleRequest(base::WeakPtr<HttpResponseDelegate> connection, std::unique_ptr<HttpRequest> request); // Notify the server that a connection is no longer usable and is safe to @@ -523,12 +524,6 @@ // Handles async callback when new data has been read from the |connection|. void OnReadCompleted(HttpConnection* connection, int rv); - // Called when |connection| is finished writing the response and the socket - // can be closed, allowing for |connnection_listener_| to take it if the - // socket is still open. - void OnResponseCompleted(HttpConnection* connection, - std::unique_ptr<HttpResponse> response); - // Returns true if the current |cert_| configuration uses a static // pre-generated cert loaded from the filesystem. bool UsingStaticCert() const;
diff --git a/net/test/embedded_test_server/embedded_test_server_unittest.cc b/net/test/embedded_test_server/embedded_test_server_unittest.cc index 91edebf..465ef26 100644 --- a/net/test/embedded_test_server/embedded_test_server_unittest.cc +++ b/net/test/embedded_test_server/embedded_test_server_unittest.cc
@@ -451,22 +451,20 @@ class InfiniteResponse : public BasicHttpResponse { public: - InfiniteResponse() {} + InfiniteResponse() = default; - void SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) override { - send.Run(ToResponseString(), - base::BindOnce(&InfiniteResponse::SendInfinite, - weak_ptr_factory_.GetWeakPtr(), send)); + void SendResponse(base::WeakPtr<HttpResponseDelegate> delegate) override { + delegate->SendResponseHeaders(code(), GetHttpReasonPhrase(code()), + BuildHeaders()); + SendInfinite(delegate); } private: - void SendInfinite(const SendBytesCallback& send) { + void SendInfinite(base::WeakPtr<HttpResponseDelegate> delegate) { + delegate->SendContents("echo", base::DoNothing()); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::BindOnce(send, "echo", - base::BindOnce(&InfiniteResponse::SendInfinite, - weak_ptr_factory_.GetWeakPtr(), send))); + FROM_HERE, base::BindOnce(&InfiniteResponse::SendInfinite, + weak_ptr_factory_.GetWeakPtr(), delegate)); } base::WeakPtrFactory<InfiniteResponse> weak_ptr_factory_{this};
diff --git a/net/test/embedded_test_server/http1_connection.cc b/net/test/embedded_test_server/http1_connection.cc index 306a2fb..530a3db 100644 --- a/net/test/embedded_test_server/http1_connection.cc +++ b/net/test/embedded_test_server/http1_connection.cc
@@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 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. @@ -9,11 +9,13 @@ #include "base/bind.h" #include "base/callback_forward.h" #include "base/callback_helpers.h" +#include "base/strings/stringprintf.h" #include "net/base/completion_once_callback.h" #include "net/base/net_errors.h" #include "net/base/test_completion_callback.h" #include "net/socket/stream_socket.h" #include "net/test/embedded_test_server/embedded_test_server.h" +#include "net/test/embedded_test_server/http_response.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" namespace net { @@ -32,20 +34,6 @@ weak_factory_.InvalidateWeakPtrs(); } -void Http1Connection::SendResponseBytes(const std::string& response_string, - SendCompleteCallback callback) { - if (response_string.length() > 0) { - scoped_refptr<DrainableIOBuffer> write_buf = - base::MakeRefCounted<DrainableIOBuffer>( - base::MakeRefCounted<StringIOBuffer>(response_string), - response_string.length()); - - SendInternal(std::move(callback), write_buf); - } else { - std::move(callback).Run(); - } -} - void Http1Connection::OnSocketReady() { ReadData(); } @@ -103,10 +91,69 @@ request->headers["Early-Data"] = "1"; } - server_delegate_->HandleRequest(this, std::move(request)); + server_delegate_->HandleRequest(weak_factory_.GetWeakPtr(), + std::move(request)); return true; } +void Http1Connection::AddResponse(std::unique_ptr<HttpResponse> response) { + responses_.push_back(std::move(response)); +} + +void Http1Connection::SendResponseHeaders(HttpStatusCode status, + const std::string& status_reason, + const base::StringPairs& headers) { + std::string response_builder; + + base::StringAppendF(&response_builder, "HTTP/1.1 %d %s\r\n", status, + status_reason.c_str()); + for (const auto& header_pair : headers) { + const std::string& header_name = header_pair.first; + const std::string& header_value = header_pair.second; + base::StringAppendF(&response_builder, "%s: %s\r\n", header_name.c_str(), + header_value.c_str()); + } + + base::StringAppendF(&response_builder, "\r\n"); + SendRawResponseHeaders(response_builder); +} + +void Http1Connection::SendRawResponseHeaders(const std::string& headers) { + SendContents(headers, base::DoNothing()); +} + +void Http1Connection::SendContents(const std::string& contents, + base::OnceClosure callback) { + if (contents.empty()) { + std::move(callback).Run(); + return; + } + + scoped_refptr<DrainableIOBuffer> buf = + base::MakeRefCounted<DrainableIOBuffer>( + base::MakeRefCounted<StringIOBuffer>(contents), contents.length()); + + SendInternal(std::move(callback), buf); +} + +void Http1Connection::FinishResponse() { + server_delegate_->RemoveConnection(this, connection_listener_); +} + +void Http1Connection::SendContentsAndFinish(const std::string& contents) { + SendContents(contents, base::BindOnce(&HttpResponseDelegate::FinishResponse, + weak_factory_.GetWeakPtr())); +} + +void Http1Connection::SendHeadersContentAndFinish( + HttpStatusCode status, + const std::string& status_reason, + const base::StringPairs& headers, + const std::string& contents) { + SendResponseHeaders(status, status_reason, headers); + SendContentsAndFinish(contents); +} + void Http1Connection::SendInternal(base::OnceClosure callback, scoped_refptr<DrainableIOBuffer> buf) { while (buf->BytesRemaining() > 0) {
diff --git a/net/test/embedded_test_server/http1_connection.h b/net/test/embedded_test_server/http1_connection.h index cc2531f..7bedac1 100644 --- a/net/test/embedded_test_server/http1_connection.h +++ b/net/test/embedded_test_server/http1_connection.h
@@ -29,7 +29,17 @@ // Wraps the connection socket. Accepts incoming data and sends responses via // HTTP/1.1. -class Http1Connection : public HttpConnection { +// +// Should be owned by the EmbeddedTestServer passed to the constructor. +// +// Lifetime of this connection (and the delegate) is one request/response pair. +// Calling FinishResponse will immediately send a signal to the owning +// EmbeddedTestServer that the connection can be safely destroyed and the socket +// can taken by a connection listener (if it has not already closed and a +// listener exists). The connection will also immediately signal the server +// to destroy the connection if the socket closes early or returns an error on +// read or write. +class Http1Connection : public HttpConnection, public HttpResponseDelegate { public: Http1Connection(std::unique_ptr<StreamSocket> socket, EmbeddedTestServerConnectionListener* connection_listener, @@ -39,13 +49,26 @@ Http1Connection& operator=(Http1Connection&) = delete; // HttpConnection - void SendResponseBytes(const std::string& response_string, - SendCompleteCallback callback) override; void OnSocketReady() override; std::unique_ptr<StreamSocket> TakeSocket() override; const StreamSocket& Socket() override; base::WeakPtr<HttpConnection> GetWeakPtr() override; + // HttpResponseDelegate + void AddResponse(std::unique_ptr<HttpResponse> response) override; + void SendResponseHeaders(HttpStatusCode status, + const std::string& status_reason, + const base::StringPairs& headers) override; + void SendRawResponseHeaders(const std::string& headers) override; + void SendContents(const std::string& contents, + base::OnceClosure callback) override; + void FinishResponse() override; + void SendContentsAndFinish(const std::string& contents) override; + void SendHeadersContentAndFinish(HttpStatusCode status, + const std::string& status_reason, + const base::StringPairs& headers, + const std::string& contents) override; + private: void ReadData(); void OnReadCompleted(int rv); @@ -61,6 +84,7 @@ EmbeddedTestServer* server_delegate_; HttpRequestParser request_parser_; scoped_refptr<IOBufferWithSize> read_buf_; + std::vector<std::unique_ptr<HttpResponse>> responses_; base::WeakPtrFactory<Http1Connection> weak_factory_{this}; };
diff --git a/net/test/embedded_test_server/http_connection.h b/net/test/embedded_test_server/http_connection.h index 5c75ef3..2d64cc3 100644 --- a/net/test/embedded_test_server/http_connection.h +++ b/net/test/embedded_test_server/http_connection.h
@@ -28,10 +28,6 @@ HttpConnection(HttpConnection&) = delete; virtual HttpConnection& operator=(HttpConnection&) = delete; - // Sends the |response_string| to the client and calls |callback| once done. - virtual void SendResponseBytes(const std::string& response_string, - SendCompleteCallback callback) = 0; - // Notify that the socket is ready to receive data (which may not be // immediately, due to SSL handshake). May call the delegate's HandleRequest() // or CloseConnection() methods, and may call them asynchronously.
diff --git a/net/test/embedded_test_server/http_response.cc b/net/test/embedded_test_server/http_response.cc index c4c80f7..9aba8cad 100644 --- a/net/test/embedded_test_server/http_response.cc +++ b/net/test/embedded_test_server/http_response.cc
@@ -4,19 +4,32 @@ #include "net/test/embedded_test_server/http_response.h" +#include <algorithm> +#include <iterator> +#include <map> +#include <string> #include <utility> #include "base/bind.h" +#include "base/callback_forward.h" #include "base/check.h" +#include "base/containers/flat_map.h" #include "base/format_macros.h" +#include "base/logging.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/threading/sequenced_task_runner_handle.h" #include "net/http/http_status_code.h" +#include "net/test/embedded_test_server/http_request.h" namespace net { namespace test_server { +HttpResponseDelegate::HttpResponseDelegate() = default; +HttpResponseDelegate::~HttpResponseDelegate() = default; + HttpResponse::~HttpResponse() = default; RawHttpResponse::RawHttpResponse(const std::string& headers, @@ -25,68 +38,65 @@ RawHttpResponse::~RawHttpResponse() = default; -void RawHttpResponse::SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) { - std::string response; +void RawHttpResponse::SendResponse( + base::WeakPtr<HttpResponseDelegate> delegate) { if (!headers_.empty()) { - response = headers_; + std::string response = headers_; // LocateEndOfHeadersHelper() searches for the first "\n\n" and "\n\r\n" as // the end of the header. std::size_t index = response.find_last_not_of("\r\n"); if (index != std::string::npos) response.erase(index + 1); response += "\n\n"; - response += contents_; - } else { - response = contents_; + delegate->SendRawResponseHeaders(response); } - send.Run(response, std::move(done)); + + delegate->SendContentsAndFinish(contents_); } void RawHttpResponse::AddHeader(const std::string& key_value_pair) { headers_.append(base::StringPrintf("%s\r\n", key_value_pair.c_str())); } -BasicHttpResponse::BasicHttpResponse() : code_(HTTP_OK) { -} +BasicHttpResponse::BasicHttpResponse() : code_(HTTP_OK) {} BasicHttpResponse::~BasicHttpResponse() = default; std::string BasicHttpResponse::ToResponseString() const { + base::StringPairs headers = BuildHeaders(); // Response line with headers. std::string response_builder; - std::string http_reason_phrase(GetHttpReasonPhrase(code_)); - // TODO(mtomasz): For http/1.0 requests, send http/1.0. - base::StringAppendF(&response_builder, - "HTTP/1.1 %d %s\r\n", - code_, - http_reason_phrase.c_str()); - base::StringAppendF(&response_builder, "Connection: close\r\n"); - base::StringAppendF(&response_builder, "Content-Length: %" PRIuS "\r\n", - content_.size()); - base::StringAppendF(&response_builder, "Content-Type: %s\r\n", - content_type_.c_str()); - for (size_t i = 0; i < custom_headers_.size(); ++i) { - const std::string& header_name = custom_headers_[i].first; - const std::string& header_value = custom_headers_[i].second; - DCHECK(header_value.find_first_of("\n\r") == std::string::npos) << - "Malformed header value."; - base::StringAppendF(&response_builder, - "%s: %s\r\n", - header_name.c_str(), - header_value.c_str()); - } + base::StringAppendF(&response_builder, "HTTP/1.1 %d %s\r\n", code_, + reason().c_str()); + + for (const auto& header : headers) + base::StringAppendF(&response_builder, "%s: %s\r\n", header.first.c_str(), + header.second.c_str()); + base::StringAppendF(&response_builder, "\r\n"); return response_builder + content_; } -void BasicHttpResponse::SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) { - send.Run(ToResponseString(), std::move(done)); +base::StringPairs BasicHttpResponse::BuildHeaders() const { + base::StringPairs headers; + headers.emplace_back("Connection", "close"); + headers.emplace_back("Content-Length", base::NumberToString(content_.size())); + headers.emplace_back("Content-Type", content_type_); + + std::copy(custom_headers_.begin(), custom_headers_.end(), + std::back_inserter(headers)); + + return headers; +} + +void BasicHttpResponse::SendResponse( + base::WeakPtr<HttpResponseDelegate> delegate) { + delegate->SendHeadersContentAndFinish(code_, reason(), BuildHeaders(), + content_); } DelayedHttpResponse::DelayedHttpResponse(const base::TimeDelta delay) @@ -94,15 +104,26 @@ DelayedHttpResponse::~DelayedHttpResponse() = default; -void DelayedHttpResponse::SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) { +void DelayedHttpResponse::SendResponse( + base::WeakPtr<HttpResponseDelegate> delegate) { base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::BindOnce(send, ToResponseString(), std::move(done)), + FROM_HERE, + base::BindOnce(&HttpResponseDelegate::SendHeadersContentAndFinish, + delegate, code(), reason(), BuildHeaders(), content()), delay_); } -void HungResponse::SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) {} +void HungResponse::SendResponse(base::WeakPtr<HttpResponseDelegate> delegate) {} + +HungAfterHeadersHttpResponse::HungAfterHeadersHttpResponse( + base::StringPairs headers) + : headers_(headers) {} +HungAfterHeadersHttpResponse::~HungAfterHeadersHttpResponse() = default; + +void HungAfterHeadersHttpResponse::SendResponse( + base::WeakPtr<HttpResponseDelegate> delegate) { + delegate->SendResponseHeaders(HTTP_OK, "OK", {}); +} } // namespace test_server } // namespace net
diff --git a/net/test/embedded_test_server/http_response.h b/net/test/embedded_test_server/http_response.h index 64b704a..dcebec1 100644 --- a/net/test/embedded_test_server/http_response.h +++ b/net/test/embedded_test_server/http_response.h
@@ -7,36 +7,74 @@ #include <string> +#include "absl/types/optional.h" +#include "base/bind.h" #include "base/callback.h" +#include "base/callback_helpers.h" #include "base/compiler_specific.h" -#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/time/time.h" #include "net/http/http_status_code.h" - namespace net { namespace test_server { -// Callback called when the response is done being sent. -using SendCompleteCallback = base::OnceClosure; +class HttpResponse; -// Callback called when the response is ready to be sent that takes the -// |response| that is being sent along with the callback |write_done| that is -// called when the response has been fully written. -using SendBytesCallback = - base::RepeatingCallback<void(const std::string& response, - SendCompleteCallback write_done)>; +// Delegate that actually sends the response bytes. Any response created should +// be owned by the delegate that passed in via HttpResponse::SendResponse(). +class HttpResponseDelegate { + public: + HttpResponseDelegate(); + virtual ~HttpResponseDelegate(); + HttpResponseDelegate(HttpResponseDelegate&) = delete; + HttpResponseDelegate& operator=(const HttpResponseDelegate&) = delete; -// Interface for HTTP response implementations. -class HttpResponse{ + // The delegate needs to take ownership of the response to ensure the + // response can stay alive until the delegate has finished sending it. + virtual void AddResponse(std::unique_ptr<HttpResponse> response) = 0; + + // Builds and sends header block. Should only be called once. + virtual void SendResponseHeaders(HttpStatusCode status, + const std::string& status_reason, + const base::StringPairs& headers) = 0; + // Sends a raw header block, in the form of an HTTP1.1 response header block + // (separated by "\r\n". Best effort will be maintained to preserve the raw + // headers. + virtual void SendRawResponseHeaders(const std::string& headers) = 0; + + // Sends a content block, then calls the closure. + virtual void SendContents(const std::string& contents, + base::OnceClosure callback = base::DoNothing()) = 0; + + // Called after the last content block or after the header block. The response + // will hang until this is called. + virtual void FinishResponse() = 0; + + // The following functions are essentially shorthand for common combinations + // of function calls that may have a more efficient layout than just calling + // one after the other. + virtual void SendContentsAndFinish(const std::string& contents) = 0; + virtual void SendHeadersContentAndFinish(HttpStatusCode status, + const std::string& status_reason, + const base::StringPairs& headers, + const std::string& contents) = 0; +}; + +// Interface for HTTP response implementations. The response should be owned by +// the HttpResponseDelegate passed into SendResponse(), and should stay alive +// until FinishResponse() is called on the delegate (or the owning delegate is +// destroyed). +class HttpResponse { public: virtual ~HttpResponse(); - // |send| will send the specified data to the network socket, and invoke - // |write_done| when complete. When the entire response has been sent, - // |done| must be called. Invoking |done| will delete the HttpResponse object. - virtual void SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) = 0; + // Note that this is a WeakPtr. WeakPtrs can not be dereferenced or + // invalidated outside of the thread that created them, so any use of the + // delegate must either be from the same thread or posted to the original + // task runner + virtual void SendResponse(base::WeakPtr<HttpResponseDelegate> delegate) = 0; }; // This class is used to handle basic HTTP responses with commonly used @@ -54,6 +92,11 @@ HttpStatusCode code() const { return code_; } void set_code(HttpStatusCode code) { code_ = code; } + std::string reason() const { + return reason_.value_or(GetHttpReasonPhrase(code_)); + } + void set_reason(absl::optional<std::string> reason) { reason_ = reason; } + // The content of the response. const std::string& content() const { return content_; } void set_content(const std::string& content) { content_ = content; } @@ -72,14 +115,17 @@ // Generates and returns a http response string. std::string ToResponseString() const; - void SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) override; + base::StringPairs BuildHeaders() const; + + void SendResponse(base::WeakPtr<HttpResponseDelegate> delegate) override; private: HttpStatusCode code_; + absl::optional<std::string> reason_; std::string content_; std::string content_type_; base::StringPairs custom_headers_; + base::WeakPtrFactory<BasicHttpResponse> weak_factory_{this}; }; class DelayedHttpResponse : public BasicHttpResponse { @@ -92,8 +138,7 @@ ~DelayedHttpResponse() override; // Issues a delayed send to the to the task runner. - void SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) override; + void SendResponse(base::WeakPtr<HttpResponseDelegate> delegate) override; private: // The delay time for the response. @@ -109,8 +154,7 @@ ~RawHttpResponse() override; - void SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) override; + void SendResponse(base::WeakPtr<HttpResponseDelegate> delegate) override; void AddHeader(const std::string& key_value_pair); @@ -130,8 +174,19 @@ ~HungResponse() override {} - void SendResponse(const SendBytesCallback& send, - SendCompleteCallback done) override; + void SendResponse(base::WeakPtr<HttpResponseDelegate> delegate) override; +}; + +// Return headers, then hangs. +class HungAfterHeadersHttpResponse : public HttpResponse { + public: + explicit HungAfterHeadersHttpResponse(base::StringPairs headers = {}); + ~HungAfterHeadersHttpResponse() override; + + void SendResponse(base::WeakPtr<HttpResponseDelegate> delegate) override; + + private: + base::StringPairs headers_; }; } // namespace test_server
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 8ec878c..580f350 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc
@@ -12291,8 +12291,8 @@ ~ZeroRTTResponse() override {} - void SendResponse(const test_server::SendBytesCallback& send, - test_server::SendCompleteCallback done) override { + void SendResponse( + base::WeakPtr<test_server::HttpResponseDelegate> delegate) override { AddCustomHeader("Vary", "Early-Data"); set_content_type("text/plain"); AddCustomHeader("Cache-Control", "no-cache"); @@ -12307,7 +12307,9 @@ // Since the EmbeddedTestServer doesn't keep the socket open by default, // it is explicitly kept alive to allow the remaining leg of the 0RTT // handshake to be received after the early data. - send.Run(ToResponseString(), base::DoNothing()); + delegate->SendResponseHeaders(code(), GetHttpReasonPhrase(code()), + BuildHeaders()); + delegate->SendContents(content(), base::DoNothing()); } private:
diff --git a/sandbox/policy/win/sandbox_win.cc b/sandbox/policy/win/sandbox_win.cc index 0cd5567..4dacb688 100644 --- a/sandbox/policy/win/sandbox_win.cc +++ b/sandbox/policy/win/sandbox_win.cc
@@ -305,7 +305,7 @@ // Checks if the sandbox can be let to run without a job object assigned. // Returns true if the job object has to be applied to the sandbox and false // otherwise. -bool ShouldSetJobLevel(const base::CommandLine& cmd_line) { +bool ShouldSetJobLevel(bool allow_no_sandbox_job) { // Windows 8 allows nested jobs so we don't need to check if we are in other // job. if (base::win::GetVersion() >= base::win::Version::WIN8) @@ -337,7 +337,7 @@ // TODO(pastarmovj): Even though the number are low, this flag is still // necessary in some limited set of cases. Remove it once Windows 7 is no // longer supported together with the rest of the checks in this function. - return !cmd_line.HasSwitch(switches::kAllowNoSandboxJob); + return !allow_no_sandbox_job; } // Allow running without the sandbox in this case. This slightly reduces the @@ -817,7 +817,7 @@ JobLevel job_level, uint32_t ui_exceptions, TargetPolicy* policy) { - if (!ShouldSetJobLevel(cmd_line)) + if (!ShouldSetJobLevel(policy->GetAllowNoSandboxJob())) return policy->SetJobLevel(JOB_NONE, 0); ResultCode ret = policy->SetJobLevel(job_level, ui_exceptions); @@ -986,12 +986,6 @@ const base::CommandLine& launcher_process_command_line = *base::CommandLine::ForCurrentProcess(); - // Propagate the --allow-no-job flag if present. - if (launcher_process_command_line.HasSwitch(switches::kAllowNoSandboxJob) && - !cmd_line->HasSwitch(switches::kAllowNoSandboxJob)) { - cmd_line->AppendSwitch(switches::kAllowNoSandboxJob); - } - SandboxType sandbox_type = delegate->GetSandboxType(); // --no-sandbox and kNoSandbox are launched without creating a Policy. if (IsUnsandboxedSandboxType(sandbox_type) || @@ -1003,6 +997,10 @@ scoped_refptr<TargetPolicy> policy = g_broker_services->CreatePolicy(); + // Allow no sandbox job if the --allow-no-sandbox-job switch is present. + if (launcher_process_command_line.HasSwitch(switches::kAllowNoSandboxJob)) + policy->SetAllowNoSandboxJob(); + // Add any handles to be inherited to the policy. for (HANDLE handle : handles_to_inherit) policy->AddHandleToShare(handle);
diff --git a/sandbox/policy/win/sandbox_win_unittest.cc b/sandbox/policy/win/sandbox_win_unittest.cc index 44a6ea7..1d4e9a7 100644 --- a/sandbox/policy/win/sandbox_win_unittest.cc +++ b/sandbox/policy/win/sandbox_win_unittest.cc
@@ -17,6 +17,7 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/memory/ref_counted.h" +#include "base/notreached.h" #include "base/path_service.h" #include "base/scoped_native_library.h" #include "base/strings/strcat.h" @@ -140,6 +141,8 @@ } std::unique_ptr<PolicyInfo> GetPolicyInfo() override { return nullptr; } + void SetAllowNoSandboxJob() override { NOTREACHED(); } + bool GetAllowNoSandboxJob() override { return false; } private: std::vector<std::wstring> blocklisted_dlls_;
diff --git a/sandbox/win/src/sandbox_policy.h b/sandbox/win/src/sandbox_policy.h index d24baf4..df8491f 100644 --- a/sandbox/win/src/sandbox_policy.h +++ b/sandbox/win/src/sandbox_policy.h
@@ -274,6 +274,13 @@ // Returns a snapshot of the policy configuration. virtual std::unique_ptr<PolicyInfo> GetPolicyInfo() = 0; + // Allows the launch of the the target process to proceed even if no job can + // be created. + virtual void SetAllowNoSandboxJob() = 0; + + // Returns true if target process launch should proceed if job creation fails. + virtual bool GetAllowNoSandboxJob() = 0; + protected: ~TargetPolicy() {} };
diff --git a/sandbox/win/src/sandbox_policy_base.cc b/sandbox/win/src/sandbox_policy_base.cc index 4f585e5e..8295069 100644 --- a/sandbox/win/src/sandbox_policy_base.cc +++ b/sandbox/win/src/sandbox_policy_base.cc
@@ -110,7 +110,8 @@ policy_(nullptr), lockdown_default_dacl_(false), add_restricting_random_sid_(false), - effective_token_(nullptr) { + effective_token_(nullptr), + allow_no_sandbox_job_(false) { ::InitializeCriticalSection(&lock_); dispatcher_ = std::make_unique<TopLevelDispatcher>(this); } @@ -801,4 +802,12 @@ return diagnostic; } +void PolicyBase::SetAllowNoSandboxJob() { + allow_no_sandbox_job_ = true; +} + +bool PolicyBase::GetAllowNoSandboxJob() { + return allow_no_sandbox_job_; +} + } // namespace sandbox
diff --git a/sandbox/win/src/sandbox_policy_base.h b/sandbox/win/src/sandbox_policy_base.h index 6004194..456cba6 100644 --- a/sandbox/win/src/sandbox_policy_base.h +++ b/sandbox/win/src/sandbox_policy_base.h
@@ -80,6 +80,8 @@ scoped_refptr<AppContainer> GetAppContainer() override; void SetEffectiveToken(HANDLE token) override; std::unique_ptr<PolicyInfo> GetPolicyInfo() override; + void SetAllowNoSandboxJob() override; + bool GetAllowNoSandboxJob() override; // Get the AppContainer profile as its internal type. scoped_refptr<AppContainerBase> GetAppContainerBase(); @@ -192,6 +194,7 @@ scoped_refptr<AppContainerBase> app_container_; HANDLE effective_token_; + bool allow_no_sandbox_job_; DISALLOW_COPY_AND_ASSIGN(PolicyBase); };
diff --git a/services/network/url_loader_unittest.cc b/services/network/url_loader_unittest.cc index 4cfdec8..9a9c986 100644 --- a/services/network/url_loader_unittest.cc +++ b/services/network/url_loader_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <stdint.h> +#include "stdint.h" #include <limits> #include <list> @@ -1744,14 +1744,13 @@ private: // net::test_server::HttpResponse implementation. - void SendResponse(const net::test_server::SendBytesCallback& send, - net::test_server::SendCompleteCallback done) override { - send.Run( - "HTTP/1.1 200 OK\r\n" - "Content-Type: text/plain\r\n\r\n" + void SendResponse( + base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) override { + delegate->SendResponseHeaders(net::HTTP_OK, "OK", + {{"Content-Type", "text/plain"}}); + delegate->SendContents( "long long ago..." + - std::string(1024 * 1024, 'a'), - base::DoNothing()); + std::string(static_cast<uint64_t>(1024 * 1024), 'a')); // Never call |done|, so the other side will never see the completion of the // response body.
diff --git a/services/proxy_resolver/proxy_resolver_v8_tracing_unittest.cc b/services/proxy_resolver/proxy_resolver_v8_tracing_unittest.cc index b3dcb3f..2d7895ef 100644 --- a/services/proxy_resolver/proxy_resolver_v8_tracing_unittest.cc +++ b/services/proxy_resolver/proxy_resolver_v8_tracing_unittest.cc
@@ -349,7 +349,7 @@ "-" // dnsResolveEx('host6') "133.122.100.200-" // myIpAddressEx() "166.155.144.44" // dnsResolve('host1') - ":99"; + ".test:99"; EXPECT_EQ(kExpectedResult, ProxyServerToProxyUri(proxy_info.proxy_server())); @@ -392,7 +392,7 @@ // invocation. EXPECT_EQ(3u, host_resolver.num_resolve()); - EXPECT_EQ("166.155.144.11-133.199.111.4:100", + EXPECT_EQ("166.155.144.11-133.199.111.4.test:100", ProxyServerToProxyUri(proxy_info.proxy_server())); // No errors. @@ -436,7 +436,7 @@ EXPECT_EQ(3u, host_resolver.num_resolve()); - EXPECT_EQ("166.155.144.44:100", + EXPECT_EQ("166.155.144.44.test:100", ProxyServerToProxyUri(proxy_info.proxy_server())); // There were no alerts or errors. @@ -569,7 +569,7 @@ // should not have been cached. EXPECT_EQ(4u, host_resolver.num_resolve()); - EXPECT_EQ("91.13.12.1-91.13.12.2-145.88.13.3-137.89.8.45:99", + EXPECT_EQ("91.13.12.1-91.13.12.2-145.88.13.3-137.89.8.45.test:99", ProxyServerToProxyUri(proxy_info.proxy_server())); // 2 alerts. @@ -987,7 +987,7 @@ "-" // dnsResolveEx('host6') "133.122.100.200-" // myIpAddressEx() "166.155.144.44" // dnsResolve('host1') - ":99"; + ".test:99"; for (size_t i = 0; i < kNumResults; ++i) { size_t resolver_i = i % kNumResolvers; @@ -1000,7 +1000,7 @@ } else if (resolver_i == 2) { EXPECT_EQ("foo:99", proxy_uri); } else if (resolver_i == 3) { - EXPECT_EQ("166.155.144.33:", + EXPECT_EQ("166.155.144.33.test:", proxy_uri.substr(0, proxy_uri.find(':') + 1)); } else { NOTREACHED(); @@ -1044,7 +1044,7 @@ mock_bindings.CreateBindings()); EXPECT_THAT(callback.WaitForResult(), IsOk()); EXPECT_EQ(2u, host_resolver.num_resolve()); - EXPECT_EQ(kIPAddress1.ToString(), + EXPECT_EQ(kIPAddress1.ToString() + ".test", proxy_info1.proxy_server().host_port_pair().host()); net::ProxyInfo proxy_info2; @@ -1053,7 +1053,7 @@ mock_bindings.CreateBindings()); EXPECT_THAT(callback.WaitForResult(), IsOk()); EXPECT_EQ(4u, host_resolver.num_resolve()); - EXPECT_EQ(kIPAddress2.ToString(), + EXPECT_EQ(kIPAddress2.ToString() + ".test", proxy_info2.proxy_server().host_port_pair().host()); } @@ -1096,7 +1096,7 @@ mock_bindings.CreateBindings()); EXPECT_THAT(callback.WaitForResult(), IsOk()); EXPECT_EQ(2u, host_resolver.num_resolve()); - EXPECT_EQ("1.2.3.4-5.6.7.8", + EXPECT_EQ("1.2.3.4-5.6.7.8.test", proxy_info.proxy_server().host_port_pair().host()); }
diff --git a/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/dns.js b/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/dns.js index fbfb74ec5..e4feb7a 100644 --- a/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/dns.js +++ b/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/dns.js
@@ -27,5 +27,5 @@ var proxyHost = ips.join('-'); proxyHost = proxyHost.replace(/[^0-9a-zA-Z.-]/g, '_'); - return "PROXY " + proxyHost + ":99"; + return "PROXY " + proxyHost + ".test:99"; }
diff --git a/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/dns_during_init.js b/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/dns_during_init.js index 55aef52..3848f3d6 100644 --- a/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/dns_during_init.js +++ b/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/dns_during_init.js
@@ -10,5 +10,5 @@ // Note that host1 and host2 should not resolve using the same cache as was // used for g_ips! var ips = g_ips.concat([dnsResolve('host1'), dnsResolve('host2')]); - return 'PROXY ' + ips.join('-') + ':99'; + return 'PROXY ' + ips.join('-') + '.test:99'; }
diff --git a/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/global_sideffects1.js b/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/global_sideffects1.js index 251af9f..aa83146d 100644 --- a/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/global_sideffects1.js +++ b/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/global_sideffects1.js
@@ -10,5 +10,5 @@ alert('iteration: ' + g_iteration); - return 'PROXY ' + ips.join('-') + ':100'; + return 'PROXY ' + ips.join('-') + '.test:100'; }
diff --git a/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/global_sideffects2.js b/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/global_sideffects2.js index f5e5076a..8c6961e 100644 --- a/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/global_sideffects2.js +++ b/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/global_sideffects2.js
@@ -14,5 +14,5 @@ ips = [ dnsResolve('host' + g_iteration) ]; } - return 'PROXY ' + ips.join('-') + ':100'; + return 'PROXY ' + ips.join('-') + '.test:100'; }
diff --git a/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/my_ip_address.js b/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/my_ip_address.js index ce323ce9..7d1eab57 100644 --- a/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/my_ip_address.js +++ b/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/my_ip_address.js
@@ -3,5 +3,5 @@ // found in the LICENSE file. function FindProxyForURL(url, host) { - return "PROXY " + myIpAddress() + "-" + myIpAddressEx() + ":99"; + return "PROXY " + myIpAddress() + "-" + myIpAddressEx() + ".test:99"; }
diff --git a/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/simple_dns.js b/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/simple_dns.js index 24867b0..9f99b1d 100644 --- a/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/simple_dns.js +++ b/services/proxy_resolver/test/data/proxy_resolver_v8_tracing_unittest/simple_dns.js
@@ -4,5 +4,5 @@ g_iteration++; myIpAddress(); var ip = dnsResolve(host); - return "PROXY " + ip + ':' + g_iteration; + return "PROXY " + ip + '.test:' + g_iteration; }
diff --git a/storage/browser/file_system/file_system_quota_client.cc b/storage/browser/file_system/file_system_quota_client.cc index 949e4d4d..c2683591 100644 --- a/storage/browser/file_system/file_system_quota_client.cc +++ b/storage/browser/file_system/file_system_quota_client.cc
@@ -26,7 +26,6 @@ #include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/storage_key/storage_key.h" #include "third_party/blink/public/mojom/quota/quota_types.mojom.h" -#include "url/origin.h" namespace storage { @@ -40,15 +39,6 @@ static const FileSystemType kPersistent[] = {kFileSystemTypePersistent}; static const FileSystemType kSyncable[] = {kFileSystemTypeSyncable}; -std::vector<blink::StorageKey> ToStorageKeys( - const std::vector<url::Origin>& origins) { - std::vector<blink::StorageKey> storage_keys; - storage_keys.reserve(origins.size()); - for (const url::Origin& origin : origins) - storage_keys.emplace_back(blink::StorageKey(origin)); - return storage_keys; -} - template <typename T> std::vector<T> MergeWithoutDuplicates(const std::vector<std::vector<T>>& tss) { if (tss.size() == 1) { @@ -99,7 +89,7 @@ FileSystemQuotaUtil* quota_util = context->GetQuotaUtil(type); if (!quota_util) return {}; - return ToStorageKeys(quota_util->GetOriginsForTypeOnFileTaskRunner(type)); + return quota_util->GetStorageKeysForTypeOnFileTaskRunner(type); } std::vector<blink::StorageKey> GetStorageKeysForHostOnFileTaskRunner( @@ -109,8 +99,7 @@ FileSystemQuotaUtil* quota_util = context->GetQuotaUtil(type); if (!quota_util) return {}; - return ToStorageKeys( - quota_util->GetOriginsForHostOnFileTaskRunner(type, host)); + return quota_util->GetStorageKeysForHostOnFileTaskRunner(type, host); } blink::mojom::QuotaStatusCode DeleteStorageKeyOnFileTaskRunner(
diff --git a/storage/browser/file_system/file_system_quota_util.h b/storage/browser/file_system/file_system_quota_util.h index 1b0731b..d329f63 100644 --- a/storage/browser/file_system/file_system_quota_util.h +++ b/storage/browser/file_system/file_system_quota_util.h
@@ -19,10 +19,6 @@ class StorageKey; } // namespace blink -namespace url { -class Origin; -} // namespace url - namespace storage { class FileSystemContext; @@ -49,16 +45,10 @@ QuotaManagerProxy* proxy, FileSystemType type) = 0; - // TODO(https://crbug.com/1247726): Refactor SandboxObfuscatedOriginEnumerator - // to use StorageKey instead of url::Origin and access those StorageKeys - // below. - virtual std::vector<url::Origin> GetOriginsForTypeOnFileTaskRunner( + virtual std::vector<blink::StorageKey> GetStorageKeysForTypeOnFileTaskRunner( FileSystemType type) = 0; - // TODO(https://crbug.com/1247726): Refactor SandboxObfuscatedOriginEnumerator - // to use StorageKey instead of url::Origin and access those StorageKeys - // below. - virtual std::vector<url::Origin> GetOriginsForHostOnFileTaskRunner( + virtual std::vector<blink::StorageKey> GetStorageKeysForHostOnFileTaskRunner( FileSystemType type, const std::string& host) = 0;
diff --git a/storage/browser/file_system/obfuscated_file_util.cc b/storage/browser/file_system/obfuscated_file_util.cc index 5377d85..7bf3ceaa 100644 --- a/storage/browser/file_system/obfuscated_file_util.cc +++ b/storage/browser/file_system/obfuscated_file_util.cc
@@ -109,6 +109,15 @@ } // namespace +// TODO(https://crbug.com/1248104): This class will eventually interface with +// Storage Buckets instead of directly interfacing with LevelDB. Thus, the below +// functions were converted from url::Origin to blink::StorageKey to prepare for +// Storage Partitioning of the FileSystem APIs. However, it is important to note +// that, until the refactor to use Storage Buckets, the LevelDB structure above +// is still used, and the entries are still keyed per-origin (achieved by +// storage_key.origin()) and per-type. Going forward, OriginRecords will be +// retrieved from the database and converted into StorageKey values until +// Storage Buckets are implemented instead. class ObfuscatedFileEnumerator final : public FileSystemFileUtil::AbstractFileEnumerator { public: @@ -206,38 +215,37 @@ base::File::Info current_platform_file_info_; }; -// TODO(https://crbug.com/1247726): Refactor SandboxObfuscatedOriginEnumerator -// to use StorageKey instead of url::Origin. -class ObfuscatedOriginEnumerator - : public ObfuscatedFileUtil::AbstractOriginEnumerator { +class ObfuscatedStorageKeyEnumerator + : public ObfuscatedFileUtil::AbstractStorageKeyEnumerator { public: using OriginRecord = SandboxOriginDatabase::OriginRecord; - ObfuscatedOriginEnumerator( + ObfuscatedStorageKeyEnumerator( SandboxOriginDatabaseInterface* origin_database, base::WeakPtr<ObfuscatedFileUtilMemoryDelegate> memory_file_util, const base::FilePath& base_file_path) : base_file_path_(base_file_path), memory_file_util_(std::move(memory_file_util)) { if (origin_database) - origin_database->ListAllOrigins(&origins_); + origin_database->ListAllOrigins(&origin_records_); } - ~ObfuscatedOriginEnumerator() override = default; + ~ObfuscatedStorageKeyEnumerator() override = default; - // Returns the next origin. Returns empty if there are no more origins. - absl::optional<url::Origin> Next() override { + // Returns the next StorageKey. Returns empty if there are no more + // StorageKeys. + absl::optional<blink::StorageKey> Next() override { OriginRecord record; - if (origins_.empty()) { + if (origin_records_.empty()) { current_ = record; return absl::nullopt; } - record = origins_.back(); - origins_.pop_back(); + record = origin_records_.back(); + origin_records_.pop_back(); current_ = record; - return GetOriginFromIdentifier(record.origin); + return blink::StorageKey(GetOriginFromIdentifier(record.origin)); } - // Returns the current origin's information. + // Returns the current StorageKey.origin()'s information. bool HasTypeDirectory(const std::string& type_string) const override { if (current_.path.empty()) return false; @@ -254,7 +262,7 @@ } private: - std::vector<OriginRecord> origins_; + std::vector<OriginRecord> origin_records_; OriginRecord current_; base::FilePath base_file_path_; base::WeakPtr<ObfuscatedFileUtilMemoryDelegate> memory_file_util_; @@ -943,14 +951,10 @@ } } -// TODO(https://crbug.com/1247726): Refactor SandboxObfuscatedOriginEnumerator -// to use StorageKey instead of url::Origin. -std::unique_ptr<ObfuscatedFileUtil::AbstractOriginEnumerator> -ObfuscatedFileUtil::CreateOriginEnumerator() { +std::unique_ptr<ObfuscatedFileUtil::AbstractStorageKeyEnumerator> +ObfuscatedFileUtil::CreateStorageKeyEnumerator() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - std::vector<SandboxOriginDatabase::OriginRecord> origins; - InitOriginDatabase(url::Origin(), false); base::WeakPtr<ObfuscatedFileUtilMemoryDelegate> file_util_delegate; if (is_incognito()) { @@ -958,7 +962,7 @@ static_cast<ObfuscatedFileUtilMemoryDelegate*>(delegate()) ->GetWeakPtr(); } - return std::make_unique<ObfuscatedOriginEnumerator>( + return std::make_unique<ObfuscatedStorageKeyEnumerator>( origin_database_.get(), file_util_delegate, file_system_directory_); }
diff --git a/storage/browser/file_system/obfuscated_file_util.h b/storage/browser/file_system/obfuscated_file_util.h index 3a0f65b..6605e83 100644 --- a/storage/browser/file_system/obfuscated_file_util.h +++ b/storage/browser/file_system/obfuscated_file_util.h
@@ -81,18 +81,15 @@ class COMPONENT_EXPORT(STORAGE_BROWSER) ObfuscatedFileUtil : public FileSystemFileUtil { public: - // TODO(https://crbug.com/1247726): Refactor SandboxObfuscatedOriginEnumerator - // to use StorageKey instead of url::Origin. - // - // Origin enumerator interface. + // StorageKey enumerator interface. // An instance of this interface is assumed to be called on the file thread. - class AbstractOriginEnumerator { + class AbstractStorageKeyEnumerator { public: - virtual ~AbstractOriginEnumerator() = default; + virtual ~AbstractStorageKeyEnumerator() = default; - // Returns the next origin. Returns absl::nullopt if there are no more - // origins. - virtual absl::optional<url::Origin> Next() = 0; + // Returns the next StorageKey. Returns absl::nullopt if there are no more + // StorageKeys. + virtual absl::optional<blink::StorageKey> Next() = 0; // Returns the current origin's information. // `type_string` must be ascii string. @@ -197,13 +194,10 @@ void CloseFileSystemForStorageKeyAndType(const blink::StorageKey& storage_key, const std::string& type_string); - // TODO(https://crbug.com/1247726): Refactor SandboxObfuscatedOriginEnumerator - // to use StorageKey instead of url::Origin. - // // This method and all methods of its returned class must be called only on // the FILE thread. The caller is responsible for deleting the returned // object. - std::unique_ptr<AbstractOriginEnumerator> CreateOriginEnumerator(); + std::unique_ptr<AbstractStorageKeyEnumerator> CreateStorageKeyEnumerator(); // Deletes a directory database from the database list in the ObfuscatedFSFU // and destroys the database on the disk.
diff --git a/storage/browser/file_system/obfuscated_file_util_unittest.cc b/storage/browser/file_system/obfuscated_file_util_unittest.cc index f9076b7..32967a2b 100644 --- a/storage/browser/file_system/obfuscated_file_util_unittest.cc +++ b/storage/browser/file_system/obfuscated_file_util_unittest.cc
@@ -52,7 +52,6 @@ #include "third_party/blink/public/common/storage_key/storage_key.h" #include "third_party/leveldatabase/leveldb_chrome.h" #include "url/gurl.h" -#include "url/origin.h" using url::Origin; @@ -140,8 +139,9 @@ return SandboxFileSystemBackendDelegate::GetTypeString(type); } -bool HasFileSystemType(ObfuscatedFileUtil::AbstractOriginEnumerator* enumerator, - FileSystemType type) { +bool HasFileSystemType( + ObfuscatedFileUtil::AbstractStorageKeyEnumerator* enumerator, + FileSystemType type) { return enumerator->HasTypeDirectory(GetTypeString(type)); } @@ -1565,12 +1565,12 @@ EXPECT_FALSE(DirectoryExists(dest_url)); } -TEST_P(ObfuscatedFileUtilTest, TestOriginEnumerator) { - std::unique_ptr<ObfuscatedFileUtil::AbstractOriginEnumerator> enumerator = - ofu()->CreateOriginEnumerator(); +TEST_P(ObfuscatedFileUtilTest, TestStorageKeyEnumerator) { + std::unique_ptr<ObfuscatedFileUtil::AbstractStorageKeyEnumerator> enumerator = + ofu()->CreateStorageKeyEnumerator(); // The test helper starts out with a single filesystem. EXPECT_TRUE(enumerator.get()); - EXPECT_EQ(origin(), enumerator->Next()); + EXPECT_EQ(storage_key(), enumerator->Next()); ASSERT_TRUE(type() == kFileSystemTypeTemporary); EXPECT_TRUE(HasFileSystemType(enumerator.get(), kFileSystemTypeTemporary)); EXPECT_FALSE(HasFileSystemType(enumerator.get(), kFileSystemTypePersistent)); @@ -1578,19 +1578,20 @@ EXPECT_FALSE(HasFileSystemType(enumerator.get(), kFileSystemTypeTemporary)); EXPECT_FALSE(HasFileSystemType(enumerator.get(), kFileSystemTypePersistent)); - std::set<Origin> origins_expected; - origins_expected.insert(origin()); + std::set<blink::StorageKey> storage_keys_expected; + storage_keys_expected.insert(storage_key()); for (size_t i = 0; i < base::size(kOriginEnumerationTestRecords); ++i) { SCOPED_TRACE(testing::Message() << "Validating kOriginEnumerationTestRecords " << i); const OriginEnumerationTestRecord& record = kOriginEnumerationTestRecords[i]; - Origin origin = Origin::Create(GURL(record.origin_url)); - origins_expected.insert(origin); + blink::StorageKey storage_key = + blink::StorageKey::CreateFromStringForTesting(record.origin_url); + storage_keys_expected.insert(storage_key); if (record.has_temporary) { std::unique_ptr<SandboxFileSystemTestHelper> file_system = - NewFileSystem(origin, kFileSystemTypeTemporary); + NewFileSystem(storage_key.origin(), kFileSystemTypeTemporary); std::unique_ptr<FileSystemOperationContext> context( NewContext(file_system.get())); bool created = false; @@ -1602,7 +1603,7 @@ } if (record.has_persistent) { std::unique_ptr<SandboxFileSystemTestHelper> file_system = - NewFileSystem(origin, kFileSystemTypePersistent); + NewFileSystem(storage_key.origin(), kFileSystemTypePersistent); std::unique_ptr<FileSystemOperationContext> context( NewContext(file_system.get())); bool created = false; @@ -1613,17 +1614,18 @@ EXPECT_TRUE(created); } } - enumerator = ofu()->CreateOriginEnumerator(); + enumerator = ofu()->CreateStorageKeyEnumerator(); EXPECT_TRUE(enumerator.get()); - std::set<Origin> origins_found; - absl::optional<url::Origin> enumerator_origin; - while ((enumerator_origin = enumerator->Next()).has_value()) { - origins_found.insert(enumerator_origin.value()); + std::set<blink::StorageKey> storage_keys_found; + absl::optional<blink::StorageKey> enumerator_storage_key; + while ((enumerator_storage_key = enumerator->Next()).has_value()) { + storage_keys_found.insert(enumerator_storage_key.value()); SCOPED_TRACE(testing::Message() - << "Handling " << enumerator_origin->Serialize()); + << "Handling " + << enumerator_storage_key->origin().Serialize()); bool found = false; for (const auto& record : kOriginEnumerationTestRecords) { - if (enumerator_origin->GetURL() != record.origin_url) + if (enumerator_storage_key->origin().GetURL() != record.origin_url) continue; found = true; EXPECT_EQ(record.has_temporary, @@ -1632,7 +1634,7 @@ HasFileSystemType(enumerator.get(), kFileSystemTypePersistent)); } // Deal with the default filesystem created by the test helper. - if (!found && enumerator_origin == origin()) { + if (!found && enumerator_storage_key == storage_key()) { ASSERT_TRUE(type() == kFileSystemTypeTemporary); EXPECT_TRUE( HasFileSystemType(enumerator.get(), kFileSystemTypeTemporary)); @@ -1643,10 +1645,11 @@ EXPECT_TRUE(found); } - std::set<Origin> diff; + std::set<blink::StorageKey> diff; std::set_symmetric_difference( - origins_expected.begin(), origins_expected.end(), origins_found.begin(), - origins_found.end(), inserter(diff, diff.begin())); + storage_keys_expected.begin(), storage_keys_expected.end(), + storage_keys_found.begin(), storage_keys_found.end(), + inserter(diff, diff.begin())); EXPECT_TRUE(diff.empty()); }
diff --git a/storage/browser/file_system/plugin_private_file_system_backend.cc b/storage/browser/file_system/plugin_private_file_system_backend.cc index eaac9f8..280ec77 100644 --- a/storage/browser/file_system/plugin_private_file_system_backend.cc +++ b/storage/browser/file_system/plugin_private_file_system_backend.cc
@@ -260,35 +260,35 @@ obfuscated_file_util()->RewriteDatabases(); } -std::vector<url::Origin> -PluginPrivateFileSystemBackend::GetOriginsForTypeOnFileTaskRunner( +std::vector<blink::StorageKey> +PluginPrivateFileSystemBackend::GetStorageKeysForTypeOnFileTaskRunner( FileSystemType type) { if (!CanHandleType(type)) - return std::vector<url::Origin>(); - std::unique_ptr<ObfuscatedFileUtil::AbstractOriginEnumerator> enumerator( - obfuscated_file_util()->CreateOriginEnumerator()); - std::vector<url::Origin> origins; - absl::optional<url::Origin> origin; - while ((origin = enumerator->Next()).has_value()) - origins.push_back(std::move(origin).value()); - return origins; + return std::vector<blink::StorageKey>(); + std::unique_ptr<ObfuscatedFileUtil::AbstractStorageKeyEnumerator> enumerator( + obfuscated_file_util()->CreateStorageKeyEnumerator()); + std::vector<blink::StorageKey> storage_keys; + absl::optional<blink::StorageKey> storage_key; + while ((storage_key = enumerator->Next()).has_value()) + storage_keys.push_back(std::move(storage_key).value()); + return storage_keys; } -std::vector<url::Origin> -PluginPrivateFileSystemBackend::GetOriginsForHostOnFileTaskRunner( +std::vector<blink::StorageKey> +PluginPrivateFileSystemBackend::GetStorageKeysForHostOnFileTaskRunner( FileSystemType type, const std::string& host) { if (!CanHandleType(type)) - return std::vector<url::Origin>(); - std::unique_ptr<ObfuscatedFileUtil::AbstractOriginEnumerator> enumerator( - obfuscated_file_util()->CreateOriginEnumerator()); - std::vector<url::Origin> origins; - absl::optional<url::Origin> origin; - while ((origin = enumerator->Next()).has_value()) { - if (host == origin->host()) - origins.push_back(std::move(origin).value()); + return std::vector<blink::StorageKey>(); + std::unique_ptr<ObfuscatedFileUtil::AbstractStorageKeyEnumerator> enumerator( + obfuscated_file_util()->CreateStorageKeyEnumerator()); + std::vector<blink::StorageKey> storage_keys; + absl::optional<blink::StorageKey> storage_key; + while ((storage_key = enumerator->Next()).has_value()) { + if (host == storage_key->origin().host()) + storage_keys.push_back(std::move(storage_key).value()); } - return origins; + return storage_keys; } int64_t PluginPrivateFileSystemBackend::GetStorageKeyUsageOnFileTaskRunner(
diff --git a/storage/browser/file_system/plugin_private_file_system_backend.h b/storage/browser/file_system/plugin_private_file_system_backend.h index 07cc6734..e2778fbc 100644 --- a/storage/browser/file_system/plugin_private_file_system_backend.h +++ b/storage/browser/file_system/plugin_private_file_system_backend.h
@@ -115,9 +115,9 @@ void PerformStorageCleanupOnFileTaskRunner(FileSystemContext* context, QuotaManagerProxy* proxy, FileSystemType type) override; - std::vector<url::Origin> GetOriginsForTypeOnFileTaskRunner( + std::vector<blink::StorageKey> GetStorageKeysForTypeOnFileTaskRunner( FileSystemType type) override; - std::vector<url::Origin> GetOriginsForHostOnFileTaskRunner( + std::vector<blink::StorageKey> GetStorageKeysForHostOnFileTaskRunner( FileSystemType type, const std::string& host) override; int64_t GetStorageKeyUsageOnFileTaskRunner(
diff --git a/storage/browser/file_system/sandbox_file_system_backend.cc b/storage/browser/file_system/sandbox_file_system_backend.cc index 44d6690..8b640d8 100644 --- a/storage/browser/file_system/sandbox_file_system_backend.cc +++ b/storage/browser/file_system/sandbox_file_system_backend.cc
@@ -174,10 +174,10 @@ return delegate_->GetAccessObservers(type); } -SandboxFileSystemBackendDelegate::OriginEnumerator* -SandboxFileSystemBackend::CreateOriginEnumerator() { +SandboxFileSystemBackendDelegate::StorageKeyEnumerator* +SandboxFileSystemBackend::CreateStorageKeyEnumerator() { DCHECK(delegate_); - return delegate_->CreateOriginEnumerator(); + return delegate_->CreateStorageKeyEnumerator(); } } // namespace storage
diff --git a/storage/browser/file_system/sandbox_file_system_backend.h b/storage/browser/file_system/sandbox_file_system_backend.h index d4da824..bd85b972 100644 --- a/storage/browser/file_system/sandbox_file_system_backend.h +++ b/storage/browser/file_system/sandbox_file_system_backend.h
@@ -68,9 +68,10 @@ const AccessObserverList* GetAccessObservers( FileSystemType type) const override; - // Returns an origin enumerator of this backend. + // Returns a StorageKey enumerator of this backend. // This method can only be called on the file thread. - SandboxFileSystemBackendDelegate::OriginEnumerator* CreateOriginEnumerator(); + SandboxFileSystemBackendDelegate::StorageKeyEnumerator* + CreateStorageKeyEnumerator(); private: SandboxFileSystemBackendDelegate* delegate_; // Not owned.
diff --git a/storage/browser/file_system/sandbox_file_system_backend_delegate.cc b/storage/browser/file_system/sandbox_file_system_backend_delegate.cc index 5c6a407f..55c15286 100644 --- a/storage/browser/file_system/sandbox_file_system_backend_delegate.cc +++ b/storage/browser/file_system/sandbox_file_system_backend_delegate.cc
@@ -38,7 +38,6 @@ #include "storage/common/file_system/file_system_util.h" #include "third_party/blink/public/common/storage_key/storage_key.h" #include "url/gurl.h" -#include "url/origin.h" namespace storage { @@ -95,17 +94,16 @@ return known_type_strings; } -// TODO(https://crbug.com/1247726): Refactor SandboxObfuscatedOriginEnumerator -// to use StorageKey instead of url::Origin. -class SandboxObfuscatedOriginEnumerator - : public SandboxFileSystemBackendDelegate::OriginEnumerator { +class SandboxObfuscatedStorageKeyEnumerator + : public SandboxFileSystemBackendDelegate::StorageKeyEnumerator { public: - explicit SandboxObfuscatedOriginEnumerator(ObfuscatedFileUtil* file_util) { - enum_ = file_util->CreateOriginEnumerator(); + explicit SandboxObfuscatedStorageKeyEnumerator( + ObfuscatedFileUtil* file_util) { + enum_ = file_util->CreateStorageKeyEnumerator(); } - ~SandboxObfuscatedOriginEnumerator() override = default; + ~SandboxObfuscatedStorageKeyEnumerator() override = default; - absl::optional<url::Origin> Next() override { return enum_->Next(); } + absl::optional<blink::StorageKey> Next() override { return enum_->Next(); } bool HasFileSystemType(FileSystemType type) const override { return enum_->HasTypeDirectory( @@ -113,7 +111,7 @@ } private: - std::unique_ptr<ObfuscatedFileUtil::AbstractOriginEnumerator> enum_; + std::unique_ptr<ObfuscatedFileUtil::AbstractStorageKeyEnumerator> enum_; }; base::File::Error OpenSandboxFileSystemOnFileTaskRunner( @@ -226,9 +224,9 @@ } } -SandboxFileSystemBackendDelegate::OriginEnumerator* -SandboxFileSystemBackendDelegate::CreateOriginEnumerator() { - return new SandboxObfuscatedOriginEnumerator(obfuscated_file_util()); +SandboxFileSystemBackendDelegate::StorageKeyEnumerator* +SandboxFileSystemBackendDelegate::CreateStorageKeyEnumerator() { + return new SandboxObfuscatedStorageKeyEnumerator(obfuscated_file_util()); } base::FilePath @@ -361,47 +359,47 @@ obfuscated_file_util()->RewriteDatabases(); } -// TODO(https://crbug.com/1247726): Refactor SandboxObfuscatedOriginEnumerator -// to use StorageKey instead of url::Origin and access those StorageKeys below. -std::vector<url::Origin> -SandboxFileSystemBackendDelegate::GetOriginsForTypeOnFileTaskRunner( +std::vector<blink::StorageKey> +SandboxFileSystemBackendDelegate::GetStorageKeysForTypeOnFileTaskRunner( FileSystemType type) { DCHECK(file_task_runner_->RunsTasksInCurrentSequence()); - std::unique_ptr<OriginEnumerator> enumerator(CreateOriginEnumerator()); - std::vector<url::Origin> origins; - absl::optional<url::Origin> origin; - while ((origin = enumerator->Next()).has_value()) { + std::unique_ptr<StorageKeyEnumerator> enumerator( + CreateStorageKeyEnumerator()); + std::vector<blink::StorageKey> storage_keys; + absl::optional<blink::StorageKey> storage_key; + while ((storage_key = enumerator->Next()).has_value()) { if (enumerator->HasFileSystemType(type)) - origins.push_back(std::move(origin).value()); + storage_keys.push_back(std::move(storage_key).value()); } switch (type) { case kFileSystemTypeTemporary: - UMA_HISTOGRAM_COUNTS_1M(kTemporaryOriginsCountLabel, origins.size()); + UMA_HISTOGRAM_COUNTS_1M(kTemporaryOriginsCountLabel, storage_keys.size()); break; case kFileSystemTypePersistent: - UMA_HISTOGRAM_COUNTS_1M(kPersistentOriginsCountLabel, origins.size()); + UMA_HISTOGRAM_COUNTS_1M(kPersistentOriginsCountLabel, + storage_keys.size()); break; default: break; } - return origins; + return storage_keys; } -// TODO(https://crbug.com/1247726): Refactor SandboxObfuscatedOriginEnumerator -// to use StorageKey instead of url::Origin and access those StorageKeys below. -std::vector<url::Origin> -SandboxFileSystemBackendDelegate::GetOriginsForHostOnFileTaskRunner( +std::vector<blink::StorageKey> +SandboxFileSystemBackendDelegate::GetStorageKeysForHostOnFileTaskRunner( FileSystemType type, const std::string& host) { DCHECK(file_task_runner_->RunsTasksInCurrentSequence()); - std::vector<url::Origin> origins; - std::unique_ptr<OriginEnumerator> enumerator(CreateOriginEnumerator()); - absl::optional<url::Origin> origin; - while ((origin = enumerator->Next()).has_value()) { - if (host == origin->host() && enumerator->HasFileSystemType(type)) - origins.push_back(std::move(origin).value()); + std::vector<blink::StorageKey> storage_keys; + std::unique_ptr<StorageKeyEnumerator> enumerator( + CreateStorageKeyEnumerator()); + absl::optional<blink::StorageKey> storage_key; + while ((storage_key = enumerator->Next()).has_value()) { + if (host == storage_key->origin().host() && + enumerator->HasFileSystemType(type)) + storage_keys.push_back(std::move(storage_key).value()); } - return origins; + return storage_keys; } int64_t SandboxFileSystemBackendDelegate::GetStorageKeyUsageOnFileTaskRunner(
diff --git a/storage/browser/file_system/sandbox_file_system_backend_delegate.h b/storage/browser/file_system/sandbox_file_system_backend_delegate.h index d897b1d..cc1cc70 100644 --- a/storage/browser/file_system/sandbox_file_system_backend_delegate.h +++ b/storage/browser/file_system/sandbox_file_system_backend_delegate.h
@@ -28,7 +28,7 @@ namespace base { class SequencedTaskRunner; -} +} // namespace base namespace blink { class StorageKey; @@ -41,11 +41,11 @@ namespace leveldb { class Env; -} +} // namespace leveldb namespace url { class Origin; -} +} // namespace url namespace storage { @@ -73,23 +73,23 @@ // The FileSystem directory name. static const base::FilePath::CharType kFileSystemDirectory[]; - // Origin enumerator interface. + // StorageKey enumerator interface. // An instance of this interface is assumed to be called on the file thread. - class OriginEnumerator { + class StorageKeyEnumerator { public: - OriginEnumerator(const OriginEnumerator&) = delete; - OriginEnumerator& operator=(const OriginEnumerator&) = delete; - virtual ~OriginEnumerator() = default; + StorageKeyEnumerator(const StorageKeyEnumerator&) = delete; + StorageKeyEnumerator& operator=(const StorageKeyEnumerator&) = delete; + virtual ~StorageKeyEnumerator() = default; - // Returns the next origin. Returns absl::nullopt if there are no more - // origins. - virtual absl::optional<url::Origin> Next() = 0; + // Returns the next StorageKey. Returns absl::nullopt if there are no more + // StorageKey. + virtual absl::optional<blink::StorageKey> Next() = 0; - // Returns the current origin's information. + // Returns the current StorageKey's information. virtual bool HasFileSystemType(FileSystemType type) const = 0; protected: - OriginEnumerator() = default; + StorageKeyEnumerator() = default; }; // Returns the type directory name in sandbox directory for given |type|. @@ -109,9 +109,9 @@ const SandboxFileSystemBackendDelegate&) = delete; ~SandboxFileSystemBackendDelegate() override; - // Returns an origin enumerator of sandbox filesystem. + // Returns a StorageKey enumerator of sandbox filesystem. // This method can only be called on the file thread. - OriginEnumerator* CreateOriginEnumerator(); + StorageKeyEnumerator* CreateStorageKeyEnumerator(); // Gets a base directory path of the sandboxed filesystem that is // specified by `storage_key` and `type`. @@ -154,9 +154,9 @@ void PerformStorageCleanupOnFileTaskRunner(FileSystemContext* context, QuotaManagerProxy* proxy, FileSystemType type) override; - std::vector<url::Origin> GetOriginsForTypeOnFileTaskRunner( + std::vector<blink::StorageKey> GetStorageKeysForTypeOnFileTaskRunner( FileSystemType type) override; - std::vector<url::Origin> GetOriginsForHostOnFileTaskRunner( + std::vector<blink::StorageKey> GetStorageKeysForHostOnFileTaskRunner( FileSystemType type, const std::string& host) override; int64_t GetStorageKeyUsageOnFileTaskRunner(
diff --git a/storage/browser/file_system/sandbox_file_system_backend_unittest.cc b/storage/browser/file_system/sandbox_file_system_backend_unittest.cc index d9dfc8a6..11ba94b 100644 --- a/storage/browser/file_system/sandbox_file_system_backend_unittest.cc +++ b/storage/browser/file_system/sandbox_file_system_backend_unittest.cc
@@ -30,7 +30,6 @@ #include "third_party/blink/public/common/storage_key/storage_key.h" #include "third_party/leveldatabase/leveldb_chrome.h" #include "url/gurl.h" -#include "url/origin.h" // PS stands for path separator. #if defined(FILE_PATH_USES_WIN_SEPARATORS) @@ -105,9 +104,9 @@ backend_ = std::make_unique<SandboxFileSystemBackend>(delegate_.get()); } - SandboxFileSystemBackendDelegate::OriginEnumerator* CreateOriginEnumerator() - const { - return backend_->CreateOriginEnumerator(); + SandboxFileSystemBackendDelegate::StorageKeyEnumerator* + CreateStorageKeyEnumerator() const { + return backend_->CreateStorageKeyEnumerator(); } void CreateOriginTypeDirectory(const char* origin_url, FileSystemType type) { @@ -158,8 +157,8 @@ TEST_P(SandboxFileSystemBackendTest, Empty) { SetUpNewBackend(CreateAllowFileAccessOptions()); - std::unique_ptr<SandboxFileSystemBackendDelegate::OriginEnumerator> - enumerator(CreateOriginEnumerator()); + std::unique_ptr<SandboxFileSystemBackendDelegate::StorageKeyEnumerator> + enumerator(CreateStorageKeyEnumerator()); ASSERT_FALSE(enumerator->Next()); } @@ -177,25 +176,27 @@ }; size_t temporary_size = base::size(temporary_origins); size_t persistent_size = base::size(persistent_origins); - std::set<url::Origin> temporary_set, persistent_set; + std::set<blink::StorageKey> temporary_set, persistent_set; for (size_t i = 0; i < temporary_size; ++i) { CreateOriginTypeDirectory(temporary_origins[i], kFileSystemTypeTemporary); - temporary_set.insert(url::Origin::Create(GURL(temporary_origins[i]))); + temporary_set.insert( + blink::StorageKey::CreateFromStringForTesting(temporary_origins[i])); } for (size_t i = 0; i < persistent_size; ++i) { CreateOriginTypeDirectory(persistent_origins[i], kFileSystemTypePersistent); - persistent_set.insert(url::Origin::Create(GURL(persistent_origins[i]))); + persistent_set.insert( + blink::StorageKey::CreateFromStringForTesting(persistent_origins[i])); } - std::unique_ptr<SandboxFileSystemBackendDelegate::OriginEnumerator> - enumerator(CreateOriginEnumerator()); + std::unique_ptr<SandboxFileSystemBackendDelegate::StorageKeyEnumerator> + enumerator(CreateStorageKeyEnumerator()); size_t temporary_actual_size = 0; size_t persistent_actual_size = 0; - absl::optional<url::Origin> current; + absl::optional<blink::StorageKey> current; while ((current = enumerator->Next()).has_value()) { SCOPED_TRACE(testing::Message() - << "EnumerateOrigin " << current->Serialize()); + << "EnumerateOrigin " << current->origin().Serialize()); if (enumerator->HasFileSystemType(kFileSystemTypeTemporary)) { ASSERT_TRUE(temporary_set.find(current.value()) != temporary_set.end()); ++temporary_actual_size;
diff --git a/storage/browser/test/test_file_system_backend.cc b/storage/browser/test/test_file_system_backend.cc index 66cb561..1b9885ac 100644 --- a/storage/browser/test/test_file_system_backend.cc +++ b/storage/browser/test/test_file_system_backend.cc
@@ -86,17 +86,17 @@ return scoped_refptr<QuotaReservation>(); } - std::vector<url::Origin> GetOriginsForTypeOnFileTaskRunner( + std::vector<blink::StorageKey> GetStorageKeysForTypeOnFileTaskRunner( FileSystemType type) override { NOTREACHED(); - return std::vector<url::Origin>(); + return std::vector<blink::StorageKey>(); } - std::vector<url::Origin> GetOriginsForHostOnFileTaskRunner( + std::vector<blink::StorageKey> GetStorageKeysForHostOnFileTaskRunner( FileSystemType type, const std::string& host) override { NOTREACHED(); - return std::vector<url::Origin>(); + return std::vector<blink::StorageKey>(); } int64_t GetStorageKeyUsageOnFileTaskRunner(
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index ac6e008..5332bb3 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -5840,21 +5840,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.38/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.50/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 94.0.4606.38", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 94.0.4606.50", "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_v94.0.4606.38", - "revision": "version:94.0.4606.38" + "location": "lacros_version_skew_tests_v94.0.4606.50", + "revision": "version:94.0.4606.50" } ], "dimension_sets": [ @@ -5869,21 +5869,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4631.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4648.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 95.0.4631.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4648.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_v95.0.4631.0", - "revision": "version:95.0.4631.0" + "location": "lacros_version_skew_tests_v96.0.4648.0", + "revision": "version:96.0.4648.0" } ], "dimension_sets": [ @@ -5898,21 +5898,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4641.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4652.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.4641.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4652.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.4641.0", - "revision": "version:96.0.4641.0" + "location": "lacros_version_skew_tests_v96.0.4652.0", + "revision": "version:96.0.4652.0" } ], "dimension_sets": [ @@ -5948,21 +5948,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.38/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.50/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 94.0.4606.38", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 94.0.4606.50", "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_v94.0.4606.38", - "revision": "version:94.0.4606.38" + "location": "lacros_version_skew_tests_v94.0.4606.50", + "revision": "version:94.0.4606.50" } ], "dimension_sets": [ @@ -5977,21 +5977,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4631.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4648.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 95.0.4631.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4648.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_v95.0.4631.0", - "revision": "version:95.0.4631.0" + "location": "lacros_version_skew_tests_v96.0.4648.0", + "revision": "version:96.0.4648.0" } ], "dimension_sets": [ @@ -6006,21 +6006,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4641.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4652.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.4641.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4652.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.4641.0", - "revision": "version:96.0.4641.0" + "location": "lacros_version_skew_tests_v96.0.4652.0", + "revision": "version:96.0.4652.0" } ], "dimension_sets": [
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 25efbd1..51cfa68 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -83613,7 +83613,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.38/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.50/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -83621,14 +83621,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 94.0.4606.38", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 94.0.4606.50", "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_v94.0.4606.38", - "revision": "version:94.0.4606.38" + "location": "lacros_version_skew_tests_v94.0.4606.50", + "revision": "version:94.0.4606.50" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -83638,7 +83638,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4631.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4648.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -83646,14 +83646,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 95.0.4631.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4648.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_v95.0.4631.0", - "revision": "version:95.0.4631.0" + "location": "lacros_version_skew_tests_v96.0.4648.0", + "revision": "version:96.0.4648.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -83663,7 +83663,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4641.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4652.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -83671,14 +83671,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4641.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4652.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.4641.0", - "revision": "version:96.0.4641.0" + "location": "lacros_version_skew_tests_v96.0.4652.0", + "revision": "version:96.0.4652.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -83705,7 +83705,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.38/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.50/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -83713,14 +83713,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 94.0.4606.38", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 94.0.4606.50", "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_v94.0.4606.38", - "revision": "version:94.0.4606.38" + "location": "lacros_version_skew_tests_v94.0.4606.50", + "revision": "version:94.0.4606.50" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -83730,7 +83730,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4631.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4648.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -83738,14 +83738,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 95.0.4631.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4648.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_v95.0.4631.0", - "revision": "version:95.0.4631.0" + "location": "lacros_version_skew_tests_v96.0.4648.0", + "revision": "version:96.0.4648.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -83755,7 +83755,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4641.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4652.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -83763,14 +83763,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4641.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4652.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.4641.0", - "revision": "version:96.0.4641.0" + "location": "lacros_version_skew_tests_v96.0.4652.0", + "revision": "version:96.0.4652.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -85079,21 +85079,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.38/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.50/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 94.0.4606.38", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 94.0.4606.50", "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_v94.0.4606.38", - "revision": "version:94.0.4606.38" + "location": "lacros_version_skew_tests_v94.0.4606.50", + "revision": "version:94.0.4606.50" } ], "dimension_sets": [ @@ -85109,21 +85109,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4631.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4648.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 95.0.4631.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4648.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_v95.0.4631.0", - "revision": "version:95.0.4631.0" + "location": "lacros_version_skew_tests_v96.0.4648.0", + "revision": "version:96.0.4648.0" } ], "dimension_sets": [ @@ -85139,21 +85139,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4641.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4652.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.4641.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4652.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.4641.0", - "revision": "version:96.0.4641.0" + "location": "lacros_version_skew_tests_v96.0.4652.0", + "revision": "version:96.0.4652.0" } ], "dimension_sets": [ @@ -85191,21 +85191,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.38/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.50/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 94.0.4606.38", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 94.0.4606.50", "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_v94.0.4606.38", - "revision": "version:94.0.4606.38" + "location": "lacros_version_skew_tests_v94.0.4606.50", + "revision": "version:94.0.4606.50" } ], "dimension_sets": [ @@ -85221,21 +85221,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4631.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4648.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 95.0.4631.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4648.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_v95.0.4631.0", - "revision": "version:95.0.4631.0" + "location": "lacros_version_skew_tests_v96.0.4648.0", + "revision": "version:96.0.4648.0" } ], "dimension_sets": [ @@ -85251,21 +85251,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4641.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4652.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.4641.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4652.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.4641.0", - "revision": "version:96.0.4641.0" + "location": "lacros_version_skew_tests_v96.0.4652.0", + "revision": "version:96.0.4652.0" } ], "dimension_sets": [ @@ -86746,21 +86746,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.38/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.50/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 94.0.4606.38", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 94.0.4606.50", "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_v94.0.4606.38", - "revision": "version:94.0.4606.38" + "location": "lacros_version_skew_tests_v94.0.4606.50", + "revision": "version:94.0.4606.50" } ], "dimension_sets": [ @@ -86776,21 +86776,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4631.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4648.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 95.0.4631.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4648.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_v95.0.4631.0", - "revision": "version:95.0.4631.0" + "location": "lacros_version_skew_tests_v96.0.4648.0", + "revision": "version:96.0.4648.0" } ], "dimension_sets": [ @@ -86806,21 +86806,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4641.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4652.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.4641.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4652.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.4641.0", - "revision": "version:96.0.4641.0" + "location": "lacros_version_skew_tests_v96.0.4652.0", + "revision": "version:96.0.4652.0" } ], "dimension_sets": [ @@ -86858,21 +86858,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.38/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.50/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 94.0.4606.38", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 94.0.4606.50", "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_v94.0.4606.38", - "revision": "version:94.0.4606.38" + "location": "lacros_version_skew_tests_v94.0.4606.50", + "revision": "version:94.0.4606.50" } ], "dimension_sets": [ @@ -86888,21 +86888,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4631.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4648.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 95.0.4631.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4648.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_v95.0.4631.0", - "revision": "version:95.0.4631.0" + "location": "lacros_version_skew_tests_v96.0.4648.0", + "revision": "version:96.0.4648.0" } ], "dimension_sets": [ @@ -86918,21 +86918,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4641.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4652.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.4641.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4652.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.4641.0", - "revision": "version:96.0.4641.0" + "location": "lacros_version_skew_tests_v96.0.4652.0", + "revision": "version:96.0.4652.0" } ], "dimension_sets": [ @@ -87603,21 +87603,21 @@ "gtest_tests": [ { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v93.0.4577.69/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v93.0.4577.85/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 93.0.4577.69", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 93.0.4577.85", "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_v93.0.4577.69", - "revision": "version:93.0.4577.69" + "location": "lacros_version_skew_tests_v93.0.4577.85", + "revision": "version:93.0.4577.85" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -87627,21 +87627,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.38/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.50/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 94.0.4606.38", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 94.0.4606.50", "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_v94.0.4606.38", - "revision": "version:94.0.4606.38" + "location": "lacros_version_skew_tests_v94.0.4606.50", + "revision": "version:94.0.4606.50" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -87651,21 +87651,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4631.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4648.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 95.0.4631.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4648.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_v95.0.4631.0", - "revision": "version:95.0.4631.0" + "location": "lacros_version_skew_tests_v96.0.4648.0", + "revision": "version:96.0.4648.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -87675,21 +87675,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4641.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4652.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.4641.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 96.0.4652.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.4641.0", - "revision": "version:96.0.4641.0" + "location": "lacros_version_skew_tests_v96.0.4652.0", + "revision": "version:96.0.4652.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -87699,21 +87699,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v93.0.4577.69/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v93.0.4577.85/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 93.0.4577.69", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 93.0.4577.85", "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_v93.0.4577.69", - "revision": "version:93.0.4577.69" + "location": "lacros_version_skew_tests_v93.0.4577.85", + "revision": "version:93.0.4577.85" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -87723,21 +87723,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.38/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.50/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 94.0.4606.38", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 94.0.4606.50", "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_v94.0.4606.38", - "revision": "version:94.0.4606.38" + "location": "lacros_version_skew_tests_v94.0.4606.50", + "revision": "version:94.0.4606.50" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -87747,21 +87747,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4631.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4648.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 95.0.4631.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4648.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_v95.0.4631.0", - "revision": "version:95.0.4631.0" + "location": "lacros_version_skew_tests_v96.0.4648.0", + "revision": "version:96.0.4648.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -87771,21 +87771,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4641.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4652.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.4641.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 96.0.4652.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.4641.0", - "revision": "version:96.0.4641.0" + "location": "lacros_version_skew_tests_v96.0.4652.0", + "revision": "version:96.0.4652.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com"
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index fe23143..53abc4f 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -17911,6 +17911,1370 @@ } ] }, + "Mac FYI Release (Apple M1)": { + "gtest_tests": [ + { + "args": [ + "angle_end2end_tests", + "--gtest_filter=-*Vulkan_SwiftShader*", + "--bot-mode" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 2 + }, + "test": "angle_end2end_tests", + "test_id_prefix": "ninja://third_party/angle/src/tests:angle_end2end_tests/", + "use_isolated_scripts_api": true + }, + { + "args": [ + "angle_unittests" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "angle_unittests", + "test_id_prefix": "ninja://third_party/angle/src/tests:angle_unittests/", + "use_isolated_scripts_api": true + }, + { + "args": [ + "--enable-gpu", + "--test-launcher-bot-mode", + "--test-launcher-jobs=1", + "--gtest_filter=TabCaptureApiPixelTest.EndToEnd*" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "tab_capture_end2end_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "browser_tests", + "test_id_prefix": "ninja://chrome/test:browser_tests/" + }, + { + "args": [ + "--use-cmd-decoder=passthrough", + "--use-gl=angle", + "--use-gpu-in-tests" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "gl_tests_passthrough", + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 2 + }, + "test": "gl_tests", + "test_id_prefix": "ninja://gpu:gl_tests/" + }, + { + "args": [ + "--use-cmd-decoder=validating", + "--use-gpu-in-tests" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "gl_tests_validating", + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gl_tests", + "test_id_prefix": "ninja://gpu:gl_tests/" + }, + { + "args": [ + "--use-gpu-in-tests" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gl_unittests", + "test_id_prefix": "ninja://ui/gl:gl_unittests/" + }, + { + "args": [ + "--use-gpu-in-tests" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gles2_conform_test", + "test_id_prefix": "ninja://gpu/gles2_conform_support:gles2_conform_test/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gpu_unittests", + "test_id_prefix": "ninja://gpu:gpu_unittests/" + }, + { + "args": [ + "--gtest_filter=*Detection*", + "--use-gpu-in-tests" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "services_unittests", + "test_id_prefix": "ninja://services:services_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "swiftshader_unittests", + "test_id_prefix": "ninja://third_party/swiftshader/tests/GLESUnitTests:swiftshader_unittests/" + } + ], + "isolated_scripts": [ + { + "args": [ + "context_lost", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "context_lost_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "context_lost", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "context_lost_validating_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "depth_capture", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "depth_capture_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "context_lost", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "gl_renderer_context_lost_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "depth_capture", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "gl_renderer_depth_capture_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "gpu_process", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "gl_renderer_gpu_process_launch_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "hardware_accelerated_feature", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "gl_renderer_hardware_accelerated_feature_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "maps", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer", + "--dont-restore-color-profile-after-test", + "--test-machine-name", + "${buildername}", + "--git-revision=${got_revision}" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "gl_renderer_maps_pixel_tests", + "precommit_args": [ + "--gerrit-issue=${patch_issue}", + "--gerrit-patchset=${patch_set}", + "--buildbucket-id=${buildbucket_build_id}" + ], + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "pixel", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer", + "--dont-restore-color-profile-after-test", + "--test-machine-name", + "${buildername}", + "--git-revision=${got_revision}" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "gl_renderer_pixel_skia_gold_tests", + "precommit_args": [ + "--gerrit-issue=${patch_issue}", + "--gerrit-patchset=${patch_set}", + "--buildbucket-id=${buildbucket_build_id}" + ], + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "screenshot_sync", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer", + "--dont-restore-color-profile-after-test" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "gl_renderer_screenshot_sync_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "gpu_process", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "gpu_process_launch_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "hardware_accelerated_feature", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "hardware_accelerated_feature_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "info_collection", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --force_high_performance_gpu", + "--expected-vendor-id", + "106b", + "--expected-device-id", + "0" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "info_collection_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "maps", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle", + "--dont-restore-color-profile-after-test", + "--test-machine-name", + "${buildername}", + "--git-revision=${got_revision}" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "maps_pixel_passthrough_test", + "precommit_args": [ + "--gerrit-issue=${patch_issue}", + "--gerrit-patchset=${patch_set}", + "--buildbucket-id=${buildbucket_build_id}" + ], + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "maps", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating", + "--dont-restore-color-profile-after-test", + "--test-machine-name", + "${buildername}", + "--git-revision=${got_revision}" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "maps_pixel_validating_test", + "precommit_args": [ + "--gerrit-issue=${patch_issue}", + "--gerrit-patchset=${patch_set}", + "--buildbucket-id=${buildbucket_build_id}" + ], + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "mediapipe", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --force_higher_performance_gpu --use-cmd-decoder=passthrough --use-gl=angle" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "mediapipe_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "mediapipe", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --force_higher_performance_gpu --use-cmd-decoder=validating" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "mediapipe_validating_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "pixel", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle", + "--dont-restore-color-profile-after-test", + "--test-machine-name", + "${buildername}", + "--git-revision=${got_revision}" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "pixel_skia_gold_passthrough_test", + "precommit_args": [ + "--gerrit-issue=${patch_issue}", + "--gerrit-patchset=${patch_set}", + "--buildbucket-id=${buildbucket_build_id}" + ], + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "pixel", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating", + "--dont-restore-color-profile-after-test", + "--test-machine-name", + "${buildername}", + "--git-revision=${got_revision}" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "pixel_skia_gold_validating_test", + "precommit_args": [ + "--gerrit-issue=${patch_issue}", + "--gerrit-patchset=${patch_set}", + "--buildbucket-id=${buildbucket_build_id}" + ], + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "../../tools/perf/run_benchmark", + "--benchmarks=rendering.desktop" + ], + "isolate_name": "rendering_representative_perf_tests", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "rendering_representative_perf_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:rendering_representative_perf_tests/" + }, + { + "args": [ + "screenshot_sync", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle", + "--dont-restore-color-profile-after-test" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "screenshot_sync_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "screenshot_sync", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating", + "--dont-restore-color-profile-after-test" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "screenshot_sync_validating_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "trace_test", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "trace_test", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "webgl_conformance", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=gl --use-cmd-decoder=passthrough --force_high_performance_gpu", + "--webgl-conformance-version=2.0.1", + "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl2_conformance_tests_output.json" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "webgl2_conformance_gl_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 20 + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "webgl_conformance", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating --force_high_performance_gpu", + "--webgl-conformance-version=2.0.1", + "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl2_conformance_tests_output.json" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "webgl2_conformance_validating_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 20 + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "webgl_conformance", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=gl --use-cmd-decoder=passthrough --force_high_performance_gpu", + "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl_conformance_tests_output.json" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "webgl_conformance_gl_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 2 + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "webgl_conformance", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=metal --use-cmd-decoder=passthrough --force_high_performance_gpu", + "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl_conformance_tests_output.json" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "webgl_conformance_metal_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 3 + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "webgl_conformance", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=swiftshader --use-cmd-decoder=passthrough --force_high_performance_gpu", + "--test-filter=conformance/rendering/gl-drawelements.html" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "webgl_conformance_swangle_passthrough_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + }, + { + "args": [ + "webgl_conformance", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating --force_high_performance_gpu", + "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl_conformance_tests_output.json" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "webgl_conformance_validating_tests", + "resultdb": { + "enable": true, + "has_native_resultdb_integration": true + }, + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "cpu": "arm64", + "display_attached": "1", + "os": "Mac-11", + "pool": "chromium.tests" + } + ], + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", + "shards": 2 + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" + } + ] + }, "Mac FYI Release (Intel UHD 630)": { "gtest_tests": [ { @@ -24676,1370 +26040,6 @@ } ] }, - "Mac FYI arm64 Release (Apple DTK)": { - "gtest_tests": [ - { - "args": [ - "angle_end2end_tests", - "--gtest_filter=-*Vulkan_SwiftShader*", - "--bot-mode" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "angle_end2end_tests", - "test_id_prefix": "ninja://third_party/angle/src/tests:angle_end2end_tests/", - "use_isolated_scripts_api": true - }, - { - "args": [ - "angle_unittests" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_unittests", - "test_id_prefix": "ninja://third_party/angle/src/tests:angle_unittests/", - "use_isolated_scripts_api": true - }, - { - "args": [ - "--enable-gpu", - "--test-launcher-bot-mode", - "--test-launcher-jobs=1", - "--gtest_filter=TabCaptureApiPixelTest.EndToEnd*" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "browser_tests", - "test_id_prefix": "ninja://chrome/test:browser_tests/" - }, - { - "args": [ - "--use-cmd-decoder=passthrough", - "--use-gl=angle", - "--use-gpu-in-tests" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gl_tests_passthrough", - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "gl_tests", - "test_id_prefix": "ninja://gpu:gl_tests/" - }, - { - "args": [ - "--use-cmd-decoder=validating", - "--use-gpu-in-tests" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gl_tests_validating", - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gl_tests", - "test_id_prefix": "ninja://gpu:gl_tests/" - }, - { - "args": [ - "--use-gpu-in-tests" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gl_unittests", - "test_id_prefix": "ninja://ui/gl:gl_unittests/" - }, - { - "args": [ - "--use-gpu-in-tests" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gles2_conform_test", - "test_id_prefix": "ninja://gpu/gles2_conform_support:gles2_conform_test/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gpu_unittests", - "test_id_prefix": "ninja://gpu:gpu_unittests/" - }, - { - "args": [ - "--gtest_filter=*Detection*", - "--use-gpu-in-tests" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "services_unittests", - "test_id_prefix": "ninja://services:services_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "swiftshader_unittests", - "test_id_prefix": "ninja://third_party/swiftshader/tests/GLESUnitTests:swiftshader_unittests/" - } - ], - "isolated_scripts": [ - { - "args": [ - "context_lost", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "context_lost_passthrough_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "context_lost", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "context_lost_validating_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "depth_capture", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "depth_capture_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "context_lost", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "gl_renderer_context_lost_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "depth_capture", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "gl_renderer_depth_capture_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "gpu_process", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "gl_renderer_gpu_process_launch_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "hardware_accelerated_feature", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "gl_renderer_hardware_accelerated_feature_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "maps", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer", - "--dont-restore-color-profile-after-test", - "--test-machine-name", - "${buildername}", - "--git-revision=${got_revision}" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "gl_renderer_maps_pixel_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "pixel", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer", - "--dont-restore-color-profile-after-test", - "--test-machine-name", - "${buildername}", - "--git-revision=${got_revision}" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "gl_renderer_pixel_skia_gold_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "screenshot_sync", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer", - "--dont-restore-color-profile-after-test" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "gl_renderer_screenshot_sync_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "gpu_process", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "gpu_process_launch_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "hardware_accelerated_feature", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "hardware_accelerated_feature_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "info_collection", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --force_high_performance_gpu", - "--expected-vendor-id", - "106b", - "--expected-device-id", - "0" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "info_collection_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "maps", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle", - "--dont-restore-color-profile-after-test", - "--test-machine-name", - "${buildername}", - "--git-revision=${got_revision}" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "maps_pixel_passthrough_test", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "maps", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating", - "--dont-restore-color-profile-after-test", - "--test-machine-name", - "${buildername}", - "--git-revision=${got_revision}" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "maps_pixel_validating_test", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "mediapipe", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --force_higher_performance_gpu --use-cmd-decoder=passthrough --use-gl=angle" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "mediapipe_passthrough_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "mediapipe", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --force_higher_performance_gpu --use-cmd-decoder=validating" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "mediapipe_validating_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "pixel", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle", - "--dont-restore-color-profile-after-test", - "--test-machine-name", - "${buildername}", - "--git-revision=${got_revision}" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "pixel_skia_gold_passthrough_test", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "pixel", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating", - "--dont-restore-color-profile-after-test", - "--test-machine-name", - "${buildername}", - "--git-revision=${got_revision}" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "pixel_skia_gold_validating_test", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}" - ], - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "../../tools/perf/run_benchmark", - "--benchmarks=rendering.desktop" - ], - "isolate_name": "rendering_representative_perf_tests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "rendering_representative_perf_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:rendering_representative_perf_tests/" - }, - { - "args": [ - "screenshot_sync", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=passthrough --use-gl=angle", - "--dont-restore-color-profile-after-test" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "screenshot_sync_passthrough_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "screenshot_sync", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating", - "--dont-restore-color-profile-after-test" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "screenshot_sync_validating_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "trace_test", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "trace_test", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgl_conformance", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=gl --use-cmd-decoder=passthrough --force_high_performance_gpu", - "--webgl-conformance-version=2.0.1", - "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl2_conformance_tests_output.json" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgl2_conformance_gl_passthrough_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 20 - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgl_conformance", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating --force_high_performance_gpu", - "--webgl-conformance-version=2.0.1", - "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl2_conformance_tests_output.json" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgl2_conformance_validating_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 20 - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgl_conformance", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=gl --use-cmd-decoder=passthrough --force_high_performance_gpu", - "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl_conformance_tests_output.json" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgl_conformance_gl_passthrough_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgl_conformance", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=metal --use-cmd-decoder=passthrough --force_high_performance_gpu", - "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl_conformance_tests_output.json" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgl_conformance_metal_passthrough_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 3 - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgl_conformance", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=swiftshader --use-cmd-decoder=passthrough --force_high_performance_gpu", - "--test-filter=conformance/rendering/gl-drawelements.html" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgl_conformance_swangle_passthrough_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - }, - { - "args": [ - "webgl_conformance", - "--show-stdout", - "--browser=release", - "--passthrough", - "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-cmd-decoder=validating --force_high_performance_gpu", - "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl_conformance_tests_output.json" - ], - "isolate_name": "telemetry_gpu_integration_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "webgl_conformance_validating_tests", - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "should_retry_with_patch": false, - "swarming": { - "can_use_on_swarming_builders": true, - "containment_type": "AUTO", - "dimension_sets": [ - { - "cpu": "arm64", - "display_attached": "1", - "os": "Mac-11", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/" - } - ] - }, "Mac Pro FYI Release (AMD)": { "gtest_tests": [ {
diff --git a/testing/buildbot/filters/fuchsia.views_unittests.filter b/testing/buildbot/filters/fuchsia.views_unittests.filter index f54774f..60d4f7f 100644 --- a/testing/buildbot/filters/fuchsia.views_unittests.filter +++ b/testing/buildbot/filters/fuchsia.views_unittests.filter
@@ -25,6 +25,7 @@ -DesktopNativeWidgetAuraTest.DesktopAuraWindowSizeTest -DesktopWidgetObserverTest.OnWidgetMovedWhenOriginChangesNative -DesktopWidgetTest.GetRestoredBounds +-DesktopWidgetTest.GetWindowPlacement -DesktopWidgetTest.MinimumSizeConstraints -DesktopWindowTreeHostPlatformTest.SetBoundsWithUnchangedSize -NativeWidgetAuraTest.CenterWindowLargeParent
diff --git a/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter b/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter index 75687fa..d52a20a8 100644 --- a/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter +++ b/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter
@@ -9,6 +9,9 @@ -ClipboardTest/PlatformClipboardTest.ReadAvailablePlatformSpecificFormatNamesTest -CrossSiteSubframe/DragAndDropBrowserTest* -DesktopWidgetTestInteractive.DesktopNativeWidgetWithModalTransientChild +-DesktopWindowTreeHostLinuxTest.CaptureEventForwarding +-DesktopWindowTreeHostLinuxTest.Deactivate +-DesktopWindowTreeHostLinuxTest.InputMethodFocus -ExtensionApiTest.WindowOpenFocus -MenuViewDragAndDropTestNestedDrag.MenuViewDragAndDropNestedDrag -MenuViewDragAndDropTestTestInMenuDrag.TestInMenuDrag
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index ba30362..4407ebbf0 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -1753,7 +1753,7 @@ '$$MAGIC_SUBSTITUTION_GPUExpectedDeviceId': None, }, }, - 'Mac FYI arm64 Release (Apple DTK)': { + 'Mac FYI Release (Apple M1)': { 'args': { # The GPU information is not yet exposed in swarming, so we can't # explicitly request it and have the JSON generation handle this
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 58989f4..45143ae0 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -52,64 +52,64 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4641.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4652.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.4641.0', + 'identifier': 'Lacros version skew testing ash 96.0.4652.0', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v96.0.4641.0', - 'revision': 'version:96.0.4641.0', + 'location': 'lacros_version_skew_tests_v96.0.4652.0', + 'revision': 'version:96.0.4652.0', }, ], }, }, 'LACROS_VERSION_SKEW_DEV': { 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v95.0.4631.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v96.0.4648.0/test_ash_chrome', '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter', ], - 'identifier': 'Lacros version skew testing ash 95.0.4631.0', + 'identifier': 'Lacros version skew testing ash 96.0.4648.0', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v95.0.4631.0', - 'revision': 'version:95.0.4631.0', + 'location': 'lacros_version_skew_tests_v96.0.4648.0', + 'revision': 'version:96.0.4648.0', }, ], }, }, 'LACROS_VERSION_SKEW_BETA': { 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.38/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v94.0.4606.50/test_ash_chrome', '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter', ], - 'identifier': 'Lacros version skew testing ash 94.0.4606.38', + 'identifier': 'Lacros version skew testing ash 94.0.4606.50', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v94.0.4606.38', - 'revision': 'version:94.0.4606.38', + 'location': 'lacros_version_skew_tests_v94.0.4606.50', + 'revision': 'version:94.0.4606.50', }, ], }, }, 'LACROS_VERSION_SKEW_STABLE': { 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v93.0.4577.69/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v93.0.4577.85/test_ash_chrome', '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter', ], - 'identifier': 'Lacros version skew testing ash 93.0.4577.69', + 'identifier': 'Lacros version skew testing ash 93.0.4577.85', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v93.0.4577.69', - 'revision': 'version:93.0.4577.69', + 'location': 'lacros_version_skew_tests_v93.0.4577.85', + 'revision': 'version:93.0.4577.85', }, ], },
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index 2955479..fa9f4b4 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -4406,6 +4406,18 @@ 'gpu_telemetry_tests': 'gpu_fyi_mac_release_telemetry_tests', }, }, + 'Mac FYI Release (Apple M1)': { + 'os_type': 'mac', + 'browser_config': 'release', + 'mixins': [ + 'mac_arm64_apple_m1_gpu', + ], + 'test_suites': { + 'gtest_tests': 'gpu_fyi_mac_release_gtests', + 'gpu_telemetry_tests': 'gpu_fyi_mac_release_telemetry_tests', + 'isolated_scripts': 'rendering_desktop_representative_perf_tests_isolated_scripts', + }, + }, 'Mac FYI Release (Intel UHD 630)': { 'os_type': 'mac', 'browser_config': 'release', @@ -4475,18 +4487,6 @@ 'gpu_telemetry_tests': 'gpu_fyi_mac_release_telemetry_tests', }, }, - 'Mac FYI arm64 Release (Apple DTK)': { - 'os_type': 'mac', - 'browser_config': 'release', - 'mixins': [ - 'mac_arm64_apple_m1_gpu', - ], - 'test_suites': { - 'gtest_tests': 'gpu_fyi_mac_release_gtests', - 'gpu_telemetry_tests': 'gpu_fyi_mac_release_telemetry_tests', - 'isolated_scripts': 'rendering_desktop_representative_perf_tests_isolated_scripts', - }, - }, 'Mac Pro FYI Release (AMD)': { 'os_type': 'mac', 'browser_config': 'release',
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 470d241..b637b5d 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -6231,25 +6231,6 @@ ] } ], - "PreconnectSameOriginDesktop": [ - { - "platforms": [ - "windows", - "chromeos", - "chromeos_lacros", - "mac", - "linux" - ], - "experiments": [ - { - "name": "EnabledWithExtendedSocket", - "disable_features": [ - "NavigationPredictorPreconnectHoldback" - ] - } - ] - } - ], "PreconnectToSearch": [ { "platforms": [ @@ -6565,6 +6546,7 @@ "params": { "base_url": "https://chromeupboarding-pa.googleapis.com", "experiment_tag": "{maxLevels : 1, rankTiles : true}", + "expire_duration": "86400", "image_prefetch_mode": "top", "is_unmetered_network_required": "false", "max_trending_tile_impressions": "1", @@ -8806,58 +8788,6 @@ ] } ], - "WebRTC-Aec3DelayEstimateSmoothingDelayFoundOverride": [ - { - "platforms": [ - "windows", - "mac", - "linux" - ], - "experiments": [ - { - "name": "0.1" - }, - { - "name": "0.3" - }, - { - "name": "0.7" - } - ] - } - ], - "WebRTC-Aec3TransparentModeHmm": [ - { - "platforms": [ - "windows", - "mac", - "chromeos", - "chromeos_lacros", - "linux" - ], - "experiments": [ - { - "name": "Enabled" - } - ] - } - ], - "WebRTC-Aec3UseUnboundedEchoSpectrum": [ - { - "platforms": [ - "windows", - "mac", - "chromeos", - "chromeos_lacros", - "linux" - ], - "experiments": [ - { - "name": "Enabled" - } - ] - } - ], "WebRTC-Audio-AnalogAgcClippingControl": [ { "platforms": [ @@ -8888,215 +8818,6 @@ ] } ], - "WebRTC-Audio-NetEqDelayManagerConfig": [ - { - "platforms": [ - "windows", - "mac", - "chromeos", - "chromeos_lacros", - "linux", - "ios", - "android", - "android_weblayer", - "android_webview" - ], - "experiments": [ - { - "name": "quantile:0.95,forget_factor:0.983,resample_interval_ms:500" - } - ] - } - ], - "WebRTC-Audio-OpusAvoidNoisePumpingDuringDtx": [ - { - "platforms": [ - "android", - "chromeos", - "ios", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled" - } - ] - } - ], - "WebRTC-Bwe-ReceiverLimitCapsOnly": [ - { - "platforms": [ - "android", - "android_webview", - "chromeos", - "ios", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled" - } - ] - } - ], - "WebRTC-PreStreamDecoders": [ - { - "platforms": [ - "windows", - "mac", - "chromeos", - "chromeos_lacros", - "linux", - "ios", - "android", - "android_weblayer", - "android_webview" - ], - "experiments": [ - { - "name": "max:0,_V1" - } - ] - } - ], - "WebRTC-TaskQueuePacer": [ - { - "platforms": [ - "windows", - "mac", - "chromeos", - "chromeos_lacros", - "linux", - "ios", - "android", - "android_webview" - ], - "experiments": [ - { - "name": "Enabled" - } - ] - } - ], - "WebRTC-VP8-Postproc-Config": [ - { - "platforms": [ - "windows", - "mac", - "chromeos", - "chromeos_lacros", - "linux", - "android", - "android_weblayer", - "android_webview" - ], - "experiments": [ - { - "name": "Enabled-8,30,60" - } - ] - } - ], - "WebRTC-VP8ConferenceTemporalLayers": [ - { - "platforms": [ - "windows", - "mac", - "chromeos", - "chromeos_lacros", - "linux", - "android", - "android_weblayer", - "android_webview" - ], - "experiments": [ - { - "name": "2_V1" - } - ] - } - ], - "WebRTC-VP9-PerformanceFlags": [ - { - "platforms": [ - "windows", - "mac", - "chromeos", - "chromeos_lacros", - "linux", - "android", - "android_weblayer", - "android_webview" - ], - "experiments": [ - { - "name": "use_per_layer_speed,min_pixel_count:0|129600,base_layer_speed:5|7,high_layer_speed:8|8,deblock_mode:1|0,_V3" - } - ] - } - ], - "WebRTC-Vp9DependencyDescriptor": [ - { - "platforms": [ - "android", - "android_webview", - "chromeos", - "chromeos_lacros", - "ios", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled" - } - ] - } - ], - "WebRTC-Vp9ExternalRefCtrl": [ - { - "platforms": [ - "windows", - "mac", - "chromeos", - "chromeos_lacros", - "linux", - "ios", - "android", - "android_weblayer" - ], - "experiments": [ - { - "name": "Enabled" - } - ] - } - ], - "WebRTC-ZeroPlayoutDelay": [ - { - "platforms": [ - "windows", - "mac", - "chromeos", - "chromeos_lacros", - "linux", - "ios", - "android", - "android_weblayer", - "android_webview" - ], - "experiments": [ - { - "name": "min_pacing:8ms,max_decode_queue_size:8,_V2" - } - ] - } - ], "WebRtcDistinctWorkerThread": [ { "platforms": [
diff --git a/third_party/abseil-cpp/README.chromium b/third_party/abseil-cpp/README.chromium index 4c4ca86..b9ce0888 100644 --- a/third_party/abseil-cpp/README.chromium +++ b/third_party/abseil-cpp/README.chromium
@@ -4,7 +4,7 @@ License: Apache 2.0 License File: LICENSE Version: 0 -Revision: de71511109d967000e68baedb75de104adb2b778 +Revision: 1ce4ceca2b2931bc4d7e470228c2dbb2f3dfea0f Security Critical: yes Description:
diff --git a/third_party/abseil-cpp/absl/base/attributes.h b/third_party/abseil-cpp/absl/base/attributes.h index 2665d8f..e390782 100644 --- a/third_party/abseil-cpp/absl/base/attributes.h +++ b/third_party/abseil-cpp/absl/base/attributes.h
@@ -318,8 +318,16 @@ // `__start_ ## name` and `__stop_ ## name` symbols to bracket the section. // This functionality is supported by GNU linker. #ifndef ABSL_ATTRIBUTE_SECTION_VARIABLE +#ifdef _AIX +// __attribute__((section(#name))) on AIX is achived by using the `.csect` psudo +// op which includes an additional integer as part of its syntax indcating +// alignment. If data fall under different alignments then you might get a +// compilation error indicating a `Section type conflict`. +#define ABSL_ATTRIBUTE_SECTION_VARIABLE(name) +#else #define ABSL_ATTRIBUTE_SECTION_VARIABLE(name) __attribute__((section(#name))) #endif +#endif // ABSL_DECLARE_ATTRIBUTE_SECTION_VARS //
diff --git a/third_party/abseil-cpp/absl/base/config.h b/third_party/abseil-cpp/absl/base/config.h index c7b2e64..5d3edcd 100644 --- a/third_party/abseil-cpp/absl/base/config.h +++ b/third_party/abseil-cpp/absl/base/config.h
@@ -408,10 +408,10 @@ // POSIX.1-2001. #ifdef ABSL_HAVE_MMAP #error ABSL_HAVE_MMAP cannot be directly set -#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ - defined(__ros__) || defined(__native_client__) || defined(__asmjs__) || \ - defined(__wasm__) || defined(__Fuchsia__) || defined(__sun) || \ - defined(__ASYLO__) || defined(__myriad2__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ + defined(_AIX) || defined(__ros__) || defined(__native_client__) || \ + defined(__asmjs__) || defined(__wasm__) || defined(__Fuchsia__) || \ + defined(__sun) || defined(__ASYLO__) || defined(__myriad2__) #define ABSL_HAVE_MMAP 1 #endif @@ -422,7 +422,7 @@ #ifdef ABSL_HAVE_PTHREAD_GETSCHEDPARAM #error ABSL_HAVE_PTHREAD_GETSCHEDPARAM cannot be directly set #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ - defined(__ros__) + defined(_AIX) || defined(__ros__) #define ABSL_HAVE_PTHREAD_GETSCHEDPARAM 1 #endif
diff --git a/third_party/abseil-cpp/absl/base/internal/sysinfo.cc b/third_party/abseil-cpp/absl/base/internal/sysinfo.cc index 08a1e28..a7cfb46 100644 --- a/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +++ b/third_party/abseil-cpp/absl/base/internal/sysinfo.cc
@@ -131,6 +131,8 @@ #elif defined(_WIN32) const unsigned hardware_concurrency = Win32NumCPUs(); return hardware_concurrency ? hardware_concurrency : 1; +#elif defined(_AIX) + return sysconf(_SC_NPROCESSORS_ONLN); #else // Other possibilities: // - Read /sys/devices/system/cpu/online and use cpumask_parse()
diff --git a/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc b/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc index fc07e30..4d352bd1 100644 --- a/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +++ b/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
@@ -87,6 +87,10 @@ double UnscaledCycleClock::Frequency() { #ifdef __GLIBC__ return __ppc_get_timebase_freq(); +#elif defined(_AIX) + // This is the same constant value as returned by + // __ppc_get_timebase_freq(). + return static_cast<double>(512000000); #elif defined(__FreeBSD__) static once_flag init_timebase_frequency_once; static double timebase_frequency = 0.0;
diff --git a/third_party/abseil-cpp/absl/container/btree_map.h b/third_party/abseil-cpp/absl/container/btree_map.h index 6bbf414..f0a8d4a 100644 --- a/third_party/abseil-cpp/absl/container/btree_map.h +++ b/third_party/abseil-cpp/absl/container/btree_map.h
@@ -693,9 +693,8 @@ // btree_multimap::merge() // - // Extracts elements from a given `source` btree_multimap into this - // `btree_multimap`. If the destination `btree_multimap` already contains an - // element with an equivalent key, that element is not extracted. + // Extracts all elements from a given `source` btree_multimap into this + // `btree_multimap`. using Base::merge; // btree_multimap::swap(btree_multimap& other)
diff --git a/third_party/abseil-cpp/absl/container/btree_set.h b/third_party/abseil-cpp/absl/container/btree_set.h index c07ccd9..89739006 100644 --- a/third_party/abseil-cpp/absl/container/btree_set.h +++ b/third_party/abseil-cpp/absl/container/btree_set.h
@@ -604,9 +604,8 @@ // btree_multiset::merge() // - // Extracts elements from a given `source` btree_multiset into this - // `btree_multiset`. If the destination `btree_multiset` already contains an - // element with an equivalent key, that element is not extracted. + // Extracts all elements from a given `source` btree_multiset into this + // `btree_multiset`. using Base::merge; // btree_multiset::swap(btree_multiset& other)
diff --git a/third_party/abseil-cpp/absl/container/inlined_vector.h b/third_party/abseil-cpp/absl/container/inlined_vector.h index 37e5fef..df9e099 100644 --- a/third_party/abseil-cpp/absl/container/inlined_vector.h +++ b/third_party/abseil-cpp/absl/container/inlined_vector.h
@@ -207,8 +207,8 @@ other.storage_.SetInlinedSize(0); } else if (other.storage_.GetIsAllocated()) { - storage_.SetAllocatedData(other.storage_.GetAllocatedData(), - other.storage_.GetAllocatedCapacity()); + storage_.SetAllocation({other.storage_.GetAllocatedData(), + other.storage_.GetAllocatedCapacity()}); storage_.SetAllocatedSize(other.storage_.GetSize()); other.storage_.SetInlinedSize(0); @@ -242,8 +242,8 @@ other.storage_.SetInlinedSize(0); } else if ((storage_.GetAllocator() == other.storage_.GetAllocator()) && other.storage_.GetIsAllocated()) { - storage_.SetAllocatedData(other.storage_.GetAllocatedData(), - other.storage_.GetAllocatedCapacity()); + storage_.SetAllocation({other.storage_.GetAllocatedData(), + other.storage_.GetAllocatedCapacity()}); storage_.SetAllocatedSize(other.storage_.GetSize()); other.storage_.SetInlinedSize(0); @@ -735,15 +735,12 @@ // `InlinedVector::shrink_to_fit()` // - // Reduces memory usage by freeing unused memory. After being called, calls to - // `capacity()` will be equal to `max(N, size())`. + // Attempts to reduce memory usage by moving elements to (or keeping elements + // in) the smallest available buffer sufficient for containing `size()` + // elements. // - // If `size() <= N` and the inlined vector contains allocated memory, the - // elements will all be moved to the inlined space and the allocated memory - // will be deallocated. - // - // If `size() > N` and `size() < capacity()`, the elements will be moved to a - // smaller allocation. + // If `size()` is sufficiently small, the elements will be moved into (or kept + // in) the inlined space. void shrink_to_fit() { if (storage_.GetIsAllocated()) { storage_.ShrinkToFit();
diff --git a/third_party/abseil-cpp/absl/container/internal/inlined_vector.h b/third_party/abseil-cpp/absl/container/internal/inlined_vector.h index 1cfba9b2..e2ecf46 100644 --- a/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +++ b/third_party/abseil-cpp/absl/container/internal/inlined_vector.h
@@ -21,8 +21,11 @@ #include <iterator> #include <limits> #include <memory> +#include <new> +#include <type_traits> #include <utility> +#include "absl/base/attributes.h" #include "absl/base/macros.h" #include "absl/container/internal/compressed_tuple.h" #include "absl/memory/memory.h" @@ -95,13 +98,34 @@ void DestroyElements(NoTypeDeduction<A>& allocator, Pointer<A> destroy_first, SizeType<A> destroy_size) { if (destroy_first != nullptr) { - for (auto i = destroy_size; i != 0;) { + for (SizeType<A> i = destroy_size; i != 0;) { --i; AllocatorTraits<A>::destroy(allocator, destroy_first + i); } } } +template <typename A> +struct Allocation { + Pointer<A> data; + SizeType<A> capacity; +}; + +template <typename A, + bool IsOverAligned = + (alignof(ValueType<A>) > ABSL_INTERNAL_DEFAULT_NEW_ALIGNMENT)> +struct MallocAdapter { + static Allocation<A> Allocate(A& allocator, SizeType<A> requested_capacity) { + return {AllocatorTraits<A>::allocate(allocator, requested_capacity), + requested_capacity}; + } + + static void Deallocate(A& allocator, Pointer<A> pointer, + SizeType<A> capacity) { + AllocatorTraits<A>::deallocate(allocator, pointer, capacity); + } +}; + // If kUseMemcpy is true, memcpy(dst, src, n); else do nothing. // Useful to avoid compiler warnings when memcpy() is used for T values // that are not trivially copyable in non-reachable code. @@ -201,7 +225,7 @@ ~AllocationTransaction() { if (DidAllocate()) { - AllocatorTraits<A>::deallocate(GetAllocator(), GetData(), GetCapacity()); + MallocAdapter<A>::Deallocate(GetAllocator(), GetData(), GetCapacity()); } } @@ -213,18 +237,27 @@ SizeType<A>& GetCapacity() { return capacity_; } bool DidAllocate() { return GetData() != nullptr; } - Pointer<A> Allocate(SizeType<A> capacity) { - GetData() = AllocatorTraits<A>::allocate(GetAllocator(), capacity); - GetCapacity() = capacity; - return GetData(); + + Pointer<A> Allocate(SizeType<A> requested_capacity) { + Allocation<A> result = + MallocAdapter<A>::Allocate(GetAllocator(), requested_capacity); + GetData() = result.data; + GetCapacity() = result.capacity; + return result.data; } + ABSL_MUST_USE_RESULT Allocation<A> Release() && { + Allocation<A> result = {GetData(), GetCapacity()}; + Reset(); + return result; + } + + private: void Reset() { GetData() = nullptr; GetCapacity() = 0; } - private: container_internal::CompressedTuple<A, Pointer<A>> allocator_data_; SizeType<A> capacity_; }; @@ -405,15 +438,9 @@ GetSizeAndIsAllocated() -= count << static_cast<SizeType<A>>(1); } - void SetAllocatedData(Pointer<A> data, SizeType<A> capacity) { - data_.allocated.allocated_data = data; - data_.allocated.allocated_capacity = capacity; - } - - void AcquireAllocatedData(AllocationTransaction<A>& allocation_tx) { - SetAllocatedData(allocation_tx.GetData(), allocation_tx.GetCapacity()); - - allocation_tx.Reset(); + void SetAllocation(Allocation<A> allocation) { + data_.allocated.allocated_data = allocation.data; + data_.allocated.allocated_capacity = allocation.capacity; } void MemcpyFrom(const Storage& other_storage) { @@ -425,8 +452,8 @@ void DeallocateIfAllocated() { if (GetIsAllocated()) { - AllocatorTraits<A>::deallocate(GetAllocator(), GetAllocatedData(), - GetAllocatedCapacity()); + MallocAdapter<A>::Deallocate(GetAllocator(), GetAllocatedData(), + GetAllocatedCapacity()); } } @@ -465,7 +492,7 @@ template <typename T, size_t N, typename A> void Storage<T, N, A>::InitFrom(const Storage& other) { - const auto n = other.GetSize(); + const SizeType<A> n = other.GetSize(); assert(n > 0); // Empty sources handled handled in caller. ConstPointer<A> src; Pointer<A> dst; @@ -476,9 +503,11 @@ // Because this is only called from the `InlinedVector` constructors, it's // safe to take on the allocation with size `0`. If `ConstructElements(...)` // throws, deallocation will be automatically handled by `~Storage()`. - SizeType<A> new_capacity = ComputeCapacity(GetInlinedCapacity(), n); - dst = AllocatorTraits<A>::allocate(GetAllocator(), new_capacity); - SetAllocatedData(dst, new_capacity); + SizeType<A> requested_capacity = ComputeCapacity(GetInlinedCapacity(), n); + Allocation<A> allocation = + MallocAdapter<A>::Allocate(GetAllocator(), requested_capacity); + SetAllocation(allocation); + dst = allocation.data; src = other.GetAllocatedData(); } if (IsMemcpyOk<A>::value) { @@ -503,9 +532,12 @@ // Because this is only called from the `InlinedVector` constructors, it's // safe to take on the allocation with size `0`. If `ConstructElements(...)` // throws, deallocation will be automatically handled by `~Storage()`. - SizeType<A> new_capacity = ComputeCapacity(GetInlinedCapacity(), new_size); - construct_data = AllocatorTraits<A>::allocate(GetAllocator(), new_capacity); - SetAllocatedData(construct_data, new_capacity); + SizeType<A> requested_capacity = + ComputeCapacity(GetInlinedCapacity(), new_size); + Allocation<A> allocation = + MallocAdapter<A>::Allocate(GetAllocator(), requested_capacity); + construct_data = allocation.data; + SetAllocation(allocation); SetIsAllocated(); } else { construct_data = GetInlinedData(); @@ -532,8 +564,9 @@ absl::Span<ValueType<A>> destroy_loop; if (new_size > storage_view.capacity) { - SizeType<A> new_capacity = ComputeCapacity(storage_view.capacity, new_size); - construct_loop = {allocation_tx.Allocate(new_capacity), new_size}; + SizeType<A> requested_capacity = + ComputeCapacity(storage_view.capacity, new_size); + construct_loop = {allocation_tx.Allocate(requested_capacity), new_size}; destroy_loop = {storage_view.data, storage_view.size}; } else if (new_size > storage_view.size) { assign_loop = {storage_view.data, storage_view.size}; @@ -553,7 +586,7 @@ if (allocation_tx.DidAllocate()) { DeallocateIfAllocated(); - AcquireAllocatedData(allocation_tx); + SetAllocation(std::move(allocation_tx).Release()); SetIsAllocated(); } @@ -565,9 +598,9 @@ auto Storage<T, N, A>::Resize(ValueAdapter values, SizeType<A> new_size) -> void { StorageView<A> storage_view = MakeStorageView(); - auto* const base = storage_view.data; + Pointer<A> const base = storage_view.data; const SizeType<A> size = storage_view.size; - auto& alloc = GetAllocator(); + A& alloc = GetAllocator(); if (new_size <= size) { // Destroy extra old elements. DestroyElements<A>(alloc, base + new_size, size - new_size); @@ -583,8 +616,9 @@ // Use transactional wrappers for the first two steps so we can roll // back if necessary due to exceptions. AllocationTransaction<A> allocation_tx(alloc); - SizeType<A> new_capacity = ComputeCapacity(storage_view.capacity, new_size); - Pointer<A> new_data = allocation_tx.Allocate(new_capacity); + SizeType<A> requested_capacity = + ComputeCapacity(storage_view.capacity, new_size); + Pointer<A> new_data = allocation_tx.Allocate(requested_capacity); ConstructionTransaction<A> construction_tx(alloc); construction_tx.Construct(new_data + size, values, new_size - size); @@ -596,7 +630,7 @@ DestroyElements<A>(alloc, base, size); construction_tx.Commit(); DeallocateIfAllocated(); - AcquireAllocatedData(allocation_tx); + SetAllocation(std::move(allocation_tx).Release()); SetIsAllocated(); } SetSize(new_size); @@ -621,8 +655,9 @@ IteratorValueAdapter<A, MoveIterator<A>> move_values( MoveIterator<A>(storage_view.data)); - SizeType<A> new_capacity = ComputeCapacity(storage_view.capacity, new_size); - Pointer<A> new_data = allocation_tx.Allocate(new_capacity); + SizeType<A> requested_capacity = + ComputeCapacity(storage_view.capacity, new_size); + Pointer<A> new_data = allocation_tx.Allocate(requested_capacity); construction_tx.Construct(new_data + insert_index, values, insert_count); @@ -636,7 +671,7 @@ construction_tx.Commit(); move_construction_tx.Commit(); DeallocateIfAllocated(); - AcquireAllocatedData(allocation_tx); + SetAllocation(std::move(allocation_tx).Release()); SetAllocatedSize(new_size); return Iterator<A>(new_data + insert_index); @@ -697,7 +732,7 @@ template <typename... Args> auto Storage<T, N, A>::EmplaceBack(Args&&... args) -> Reference<A> { StorageView<A> storage_view = MakeStorageView(); - const auto n = storage_view.size; + const SizeType<A> n = storage_view.size; if (ABSL_PREDICT_TRUE(n != storage_view.capacity)) { // Fast path; new element fits. Pointer<A> last_ptr = storage_view.data + n; @@ -717,8 +752,8 @@ AllocationTransaction<A> allocation_tx(GetAllocator()); IteratorValueAdapter<A, MoveIterator<A>> move_values( MoveIterator<A>(storage_view.data)); - SizeType<A> new_capacity = NextCapacity(storage_view.capacity); - Pointer<A> construct_data = allocation_tx.Allocate(new_capacity); + SizeType<A> requested_capacity = NextCapacity(storage_view.capacity); + Pointer<A> construct_data = allocation_tx.Allocate(requested_capacity); Pointer<A> last_ptr = construct_data + storage_view.size; // Construct new element. @@ -737,7 +772,7 @@ DestroyElements<A>(GetAllocator(), storage_view.data, storage_view.size); DeallocateIfAllocated(); - AcquireAllocatedData(allocation_tx); + SetAllocation(std::move(allocation_tx).Release()); SetIsAllocated(); AddSize(1); return *last_ptr; @@ -778,9 +813,9 @@ IteratorValueAdapter<A, MoveIterator<A>> move_values( MoveIterator<A>(storage_view.data)); - SizeType<A> new_capacity = + SizeType<A> new_requested_capacity = ComputeCapacity(storage_view.capacity, requested_capacity); - Pointer<A> new_data = allocation_tx.Allocate(new_capacity); + Pointer<A> new_data = allocation_tx.Allocate(new_requested_capacity); ConstructElements<A>(GetAllocator(), new_data, move_values, storage_view.size); @@ -788,7 +823,7 @@ DestroyElements<A>(GetAllocator(), storage_view.data, storage_view.size); DeallocateIfAllocated(); - AcquireAllocatedData(allocation_tx); + SetAllocation(std::move(allocation_tx).Release()); SetIsAllocated(); } @@ -809,8 +844,12 @@ Pointer<A> construct_data; if (storage_view.size > GetInlinedCapacity()) { - SizeType<A> new_capacity = storage_view.size; - construct_data = allocation_tx.Allocate(new_capacity); + SizeType<A> requested_capacity = storage_view.size; + construct_data = allocation_tx.Allocate(requested_capacity); + if (allocation_tx.GetCapacity() >= storage_view.capacity) { + // Already using the smallest available heap allocation. + return; + } } else { construct_data = GetInlinedData(); } @@ -820,17 +859,17 @@ storage_view.size); } ABSL_INTERNAL_CATCH_ANY { - SetAllocatedData(storage_view.data, storage_view.capacity); + SetAllocation({storage_view.data, storage_view.capacity}); ABSL_INTERNAL_RETHROW; } DestroyElements<A>(GetAllocator(), storage_view.data, storage_view.size); - AllocatorTraits<A>::deallocate(GetAllocator(), storage_view.data, - storage_view.capacity); + MallocAdapter<A>::Deallocate(GetAllocator(), storage_view.data, + storage_view.capacity); if (allocation_tx.DidAllocate()) { - AcquireAllocatedData(allocation_tx); + SetAllocation(std::move(allocation_tx).Release()); } else { UnsetIsAllocated(); } @@ -881,16 +920,16 @@ inlined_ptr->GetSize()); } ABSL_INTERNAL_CATCH_ANY { - allocated_ptr->SetAllocatedData(allocated_storage_view.data, - allocated_storage_view.capacity); + allocated_ptr->SetAllocation( + {allocated_storage_view.data, allocated_storage_view.capacity}); ABSL_INTERNAL_RETHROW; } DestroyElements<A>(inlined_ptr->GetAllocator(), inlined_ptr->GetInlinedData(), inlined_ptr->GetSize()); - inlined_ptr->SetAllocatedData(allocated_storage_view.data, - allocated_storage_view.capacity); + inlined_ptr->SetAllocation( + {allocated_storage_view.data, allocated_storage_view.capacity}); } swap(GetSizeAndIsAllocated(), other_storage_ptr->GetSizeAndIsAllocated());
diff --git a/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h b/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h index 212052e..5c5db12 100644 --- a/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +++ b/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
@@ -87,6 +87,17 @@ // // This probing function guarantees that after N probes, all the groups of the // table will be probed exactly once. +// +// The control state and slot array are stored contiguously in a shared heap +// allocation. The layout of this allocation is: `capacity()` control bytes, +// one sentinel control byte, `Group::kWidth - 1` cloned control bytes, +// <possible padding>, `capacity()` slots. The sentinel control byte is used in +// iteration so we know when we reach the end of the table. The cloned control +// bytes at the end of the table are cloned from the beginning of the table so +// groups that begin near the end of the table can see a full group. In cases in +// which there are more than `capacity()` cloned control bytes, the extra bytes +// are `kEmpty`, and these ensure that we always see at least one empty slot and +// can stop an unsuccessful search. #ifndef ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_ #define ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_
diff --git a/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc b/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc index 24cc013..d6832ea 100644 --- a/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +++ b/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc
@@ -22,6 +22,7 @@ #include <string.h> #include <cassert> #include <cstddef> +#include "absl/base/config.h" #include "absl/base/internal/raw_logging.h" // From binutils/include/elf/common.h (this doesn't appear to be documented @@ -43,11 +44,11 @@ namespace { -#if __WORDSIZE == 32 +#if __SIZEOF_POINTER__ == 4 const int kElfClass = ELFCLASS32; int ElfBind(const ElfW(Sym) *symbol) { return ELF32_ST_BIND(symbol->st_info); } int ElfType(const ElfW(Sym) *symbol) { return ELF32_ST_TYPE(symbol->st_info); } -#elif __WORDSIZE == 64 +#elif __SIZEOF_POINTER__ == 8 const int kElfClass = ELFCLASS64; int ElfBind(const ElfW(Sym) *symbol) { return ELF64_ST_BIND(symbol->st_info); } int ElfType(const ElfW(Sym) *symbol) { return ELF64_ST_TYPE(symbol->st_info); } @@ -175,17 +176,17 @@ } switch (base_as_char[EI_DATA]) { case ELFDATA2LSB: { - if (__LITTLE_ENDIAN != __BYTE_ORDER) { - assert(false); - return; - } +#ifndef ABSL_IS_LITTLE_ENDIAN + assert(false); + return; +#endif break; } case ELFDATA2MSB: { - if (__BIG_ENDIAN != __BYTE_ORDER) { - assert(false); - return; - } +#ifndef ABSL_IS_BIG_ENDIAN + assert(false); + return; +#endif break; } default: {
diff --git a/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h b/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h index 46bfade3..8647481 100644 --- a/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +++ b/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h
@@ -31,8 +31,8 @@ #error ABSL_HAVE_ELF_MEM_IMAGE cannot be directly set #endif -#if defined(__ELF__) && defined(__GLIBC__) && !defined(__native_client__) && \ - !defined(__asmjs__) && !defined(__wasm__) +#if defined(__ELF__) && !defined(__native_client__) && !defined(__asmjs__) && \ + !defined(__wasm__) #define ABSL_HAVE_ELF_MEM_IMAGE 1 #endif
diff --git a/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h b/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h index 29b26bdd..ff21b71 100644 --- a/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +++ b/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h
@@ -35,7 +35,7 @@ // Thread local support required for UnwindImpl. #define ABSL_STACKTRACE_INL_HEADER \ "absl/debugging/internal/stacktrace_generic-inl.inc" -#endif +#endif // defined(ABSL_HAVE_THREAD_LOCAL) #elif defined(__EMSCRIPTEN__) #define ABSL_STACKTRACE_INL_HEADER \ @@ -55,7 +55,7 @@ // Note: When using glibc this may require -funwind-tables to function properly. #define ABSL_STACKTRACE_INL_HEADER \ "absl/debugging/internal/stacktrace_generic-inl.inc" -#endif +#endif // __has_include(<execinfo.h>) #elif defined(__i386__) || defined(__x86_64__) #define ABSL_STACKTRACE_INL_HEADER \ "absl/debugging/internal/stacktrace_x86-inl.inc" @@ -73,9 +73,10 @@ // Note: When using glibc this may require -funwind-tables to function properly. #define ABSL_STACKTRACE_INL_HEADER \ "absl/debugging/internal/stacktrace_generic-inl.inc" -#endif -#endif -#endif +#endif // __has_include(<execinfo.h>) +#endif // defined(__has_include) + +#endif // defined(__linux__) && !defined(__ANDROID__) // Fallback to the empty implementation. #if !defined(ABSL_STACKTRACE_INL_HEADER)
diff --git a/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc b/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc index 6be16d9..0dfe9ca 100644 --- a/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +++ b/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc
@@ -20,12 +20,25 @@ #ifdef ABSL_HAVE_VDSO_SUPPORT // defined in vdso_support.h +#if !defined(__has_include) +#define __has_include(header) 0 +#endif + #include <errno.h> #include <fcntl.h> +#if __has_include(<syscall.h>) +#include <syscall.h> +#elif __has_include(<sys/syscall.h>) #include <sys/syscall.h> +#endif #include <unistd.h> -#if __GLIBC_PREREQ(2, 16) // GLIBC-2.16 implements getauxval. +#if defined(__GLIBC__) && \ + (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) +#define ABSL_HAVE_GETAUXVAL +#endif + +#ifdef ABSL_HAVE_GETAUXVAL #include <sys/auxv.h> #endif @@ -65,7 +78,7 @@ // the operation should be idempotent. const void *VDSOSupport::Init() { const auto kInvalidBase = debugging_internal::ElfMemImage::kInvalidBase; -#if __GLIBC_PREREQ(2, 16) +#ifdef ABSL_HAVE_GETAUXVAL if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) { errno = 0; const void *const sysinfo_ehdr = @@ -74,7 +87,7 @@ vdso_base_.store(sysinfo_ehdr, std::memory_order_relaxed); } } -#endif // __GLIBC_PREREQ(2, 16) +#endif // ABSL_HAVE_GETAUXVAL if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) { int fd = open("/proc/self/auxv", O_RDONLY); if (fd == -1) {
diff --git a/third_party/abseil-cpp/absl/flags/internal/flag.h b/third_party/abseil-cpp/absl/flags/internal/flag.h index 8636fad..124a2f1 100644 --- a/third_party/abseil-cpp/absl/flags/internal/flag.h +++ b/third_party/abseil-cpp/absl/flags/internal/flag.h
@@ -290,7 +290,7 @@ template <typename ValueT, typename GenT, typename std::enable_if<std::is_integral<ValueT>::value, int>::type = - (GenT{}, 0)> + ((void)GenT{}, 0)> constexpr FlagDefaultArg DefaultArg(int) { return {FlagDefaultSrc(GenT{}.value), FlagDefaultKind::kOneWord}; }
diff --git a/third_party/abseil-cpp/absl/meta/type_traits.h b/third_party/abseil-cpp/absl/meta/type_traits.h index e7c1239..8358e79 100644 --- a/third_party/abseil-cpp/absl/meta/type_traits.h +++ b/third_party/abseil-cpp/absl/meta/type_traits.h
@@ -35,7 +35,7 @@ #ifndef ABSL_META_TYPE_TRAITS_H_ #define ABSL_META_TYPE_TRAITS_H_ -#include <stddef.h> +#include <cstddef> #include <functional> #include <type_traits> @@ -47,6 +47,14 @@ #define ABSL_META_INTERNAL_STD_CONSTRUCTION_TRAITS_DONT_CHECK_DESTRUCTION 1 #endif +// Defines the default alignment. `__STDCPP_DEFAULT_NEW_ALIGNMENT__` is a C++17 +// feature. +#if defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__) +#define ABSL_INTERNAL_DEFAULT_NEW_ALIGNMENT __STDCPP_DEFAULT_NEW_ALIGNMENT__ +#else // defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__) +#define ABSL_INTERNAL_DEFAULT_NEW_ALIGNMENT alignof(std::max_align_t) +#endif // defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__) + namespace absl { ABSL_NAMESPACE_BEGIN
diff --git a/third_party/abseil-cpp/absl/profiling/BUILD.bazel b/third_party/abseil-cpp/absl/profiling/BUILD.bazel index 5f3a1030..ba4811b 100644 --- a/third_party/abseil-cpp/absl/profiling/BUILD.bazel +++ b/third_party/abseil-cpp/absl/profiling/BUILD.bazel
@@ -27,7 +27,9 @@ hdrs = ["internal/sample_recorder.h"], copts = ABSL_DEFAULT_COPTS, linkopts = ABSL_DEFAULT_LINKOPTS, - visibility = ["//absl:__subpackages__"], + visibility = [ + "//absl:__subpackages__", + ], deps = [ "//absl/base:config", "//absl/base:core_headers",
diff --git a/third_party/abseil-cpp/absl/profiling/BUILD.gn b/third_party/abseil-cpp/absl/profiling/BUILD.gn index bbb7829..4aa4039 100644 --- a/third_party/abseil-cpp/absl/profiling/BUILD.gn +++ b/third_party/abseil-cpp/absl/profiling/BUILD.gn
@@ -12,4 +12,7 @@ "//third_party/abseil-cpp/absl/synchronization", "//third_party/abseil-cpp/absl/time", ] + visibility = [ + "//third_party/abseil-cpp/absl/*", + ] }
diff --git a/third_party/abseil-cpp/absl/strings/charconv.h b/third_party/abseil-cpp/absl/strings/charconv.h index e04be32..7c50981 100644 --- a/third_party/abseil-cpp/absl/strings/charconv.h +++ b/third_party/abseil-cpp/absl/strings/charconv.h
@@ -64,8 +64,9 @@ // the result in `value`. // // The matching pattern format is almost the same as that of strtod(), except -// that C locale is not respected, and an initial '+' character in the input -// range will never be matched. +// that (1) C locale is not respected, (2) an initial '+' character in the +// input range will never be matched, and (3) leading whitespaces are not +// ignored. // // If `fmt` is set, it must be one of the enumerator values of the chars_format. // (This is despite the fact that chars_format is a bitmask type.) If set to
diff --git a/third_party/abseil-cpp/absl/strings/numbers.cc b/third_party/abseil-cpp/absl/strings/numbers.cc index 966d94bd..cbd84c91 100644 --- a/third_party/abseil-cpp/absl/strings/numbers.cc +++ b/third_party/abseil-cpp/absl/strings/numbers.cc
@@ -505,7 +505,7 @@ *out++ = '-'; d = -d; } - if (std::isinf(d)) { + if (d > std::numeric_limits<double>::max()) { strcpy(out, "inf"); // NOLINT(runtime/printf) return out + 3 - buffer; }
diff --git a/third_party/abseil-cpp/absl/time/clock_test.cc b/third_party/abseil-cpp/absl/time/clock_test.cc index 4bcfc6bc..e6f627b 100644 --- a/third_party/abseil-cpp/absl/time/clock_test.cc +++ b/third_party/abseil-cpp/absl/time/clock_test.cc
@@ -18,6 +18,8 @@ #if defined(ABSL_HAVE_ALARM) #include <signal.h> #include <unistd.h> +#elif defined(_AIX) +typedef void (*sig_t)(int); #elif defined(__linux__) || defined(__APPLE__) #error all known Linux and Apple targets have alarm #endif
diff --git a/third_party/abseil-cpp/symbols_arm64_dbg.def b/third_party/abseil-cpp/symbols_arm64_dbg.def index 22d8101..17fccd4 100644 --- a/third_party/abseil-cpp/symbols_arm64_dbg.def +++ b/third_party/abseil-cpp/symbols_arm64_dbg.def
@@ -782,6 +782,11 @@ ??$move@AEAUTransition@cctz@time_internal@absl@@@__1@std@@YA$$QEAUTransition@cctz@time_internal@absl@@AEAU2345@@Z ??$move@AEAUTransitionType@cctz@time_internal@absl@@@__1@std@@YA$$QEAUTransitionType@cctz@time_internal@absl@@AEAU2345@@Z ??$move@AEAUViableSubstitution@strings_internal@absl@@@__1@std@@YA$$QEAUViableSubstitution@strings_internal@absl@@AEAU234@@Z + ??$move@AEAV?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QEAV?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@AEAV234@@Z + ??$move@AEAV?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QEAV?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAV234@@Z + ??$move@AEAV?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QEAV?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAV234@@Z + ??$move@AEAV?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QEAV?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAV234@@Z + ??$move@AEAV?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QEAV?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAV234@@Z ??$move@AEAV?$FunctionRef@$$A6AXPEAUCordRep@cord_internal@absl@@_K1@Z@absl@@@__1@std@@YA$$QEAV?$FunctionRef@$$A6AXPEAUCordRep@cord_internal@absl@@_K1@Z@absl@@AEAV23@@Z ??$move@AEAV?$__allocator_destructor@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@@__1@std@@YA$$QEAV?$__allocator_destructor@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@01@AEAV201@@Z ??$move@AEAV?$__hash_node_destructor@V?$allocator@U?$__hash_node@U?$__hash_value_type@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@PEAX@__1@std@@@__1@std@@@__1@std@@@__1@std@@YA$$QEAV?$__hash_node_destructor@V?$allocator@U?$__hash_node@U?$__hash_value_type@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@PEAX@__1@std@@@__1@std@@@01@AEAV201@@Z @@ -1519,12 +1524,6 @@ ?AbslParseFlag@absl@@YA_NVstring_view@1@PEAVTime@1@PEAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z ?AbslUnparseFlag@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@VDuration@1@@Z ?AbslUnparseFlag@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@VTime@1@@Z - ?AcquireAllocatedData@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QEAAXAEAV?$AllocationTransaction@V?$allocator@H@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@PEAUCordRep@cord_internal@absl@@$01V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXAEAV?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXAEAV?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@PEBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXAEAV?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXAEAV?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXAEAV?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@23@@Z ?Add@Filler@CordRepRing@cord_internal@absl@@QEAAXPEAUCordRep@34@_K1@Z ?AddDataOffset@CordRepRing@cord_internal@absl@@AEAAXI_K@Z ?AddNode@CordForest@absl@@AEAAXPEAUCordRep@cord_internal@2@@Z @@ -1558,6 +1557,11 @@ ?Allocate@?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAPEAPEBUCordRep@cord_internal@3@_K@Z ?Allocate@?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAPEAUPayload@status_internal@3@_K@Z ?Allocate@?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAPEAUSubRange@3@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@H@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@H@__1@std@@@23@AEAV?$allocator@H@__1@std@@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@AEAV?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@23@AEAV?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@UPayload@status_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@AEAV?$allocator@UPayload@status_internal@absl@@@__1@std@@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@USubRange@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@USubRange@absl@@@__1@std@@@23@AEAV?$allocator@USubRange@absl@@@__1@std@@_K@Z ?AllocatedSize@CordRepFlat@cord_internal@absl@@QEBA_KXZ ?AllocatedSizeToTag@cord_internal@absl@@YAE_K@Z ?AllocatedSizeToTagUnchecked@cord_internal@absl@@YAE_K@Z @@ -1697,6 +1701,11 @@ ?DataLength@Header@TimeZoneInfo@cctz@time_internal@absl@@QEBA_K_K@Z ?DataLossError@absl@@YA?AVStatus@1@Vstring_view@1@@Z ?DeadlineExceededError@absl@@YA?AVStatus@1@Vstring_view@1@@Z + ?Deallocate@?$MallocAdapter@V?$allocator@H@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAEAV?$allocator@H@__1@std@@PEAH_K@Z + ?Deallocate@?$MallocAdapter@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAEAV?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@PEAPEAUCordRep@cord_internal@3@_K@Z + ?Deallocate@?$MallocAdapter@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAEAV?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@PEAPEBUCordRep@cord_internal@3@_K@Z + ?Deallocate@?$MallocAdapter@V?$allocator@UPayload@status_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAEAV?$allocator@UPayload@status_internal@absl@@@__1@std@@PEAUPayload@status_internal@3@_K@Z + ?Deallocate@?$MallocAdapter@V?$allocator@USubRange@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAEAV?$allocator@USubRange@absl@@@__1@std@@PEAUSubRange@3@_K@Z ?DeallocateIfAllocated@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ ?DeallocateIfAllocated@?$Storage@PEAUCordRep@cord_internal@absl@@$01V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ ?DeallocateIfAllocated@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ @@ -2288,6 +2297,11 @@ ?RegisterMutexTracer@absl@@YAXP6AXPEBDPEBX_J@Z@Z ?RegisterSpinLockProfiler@base_internal@absl@@YAXP6AXPEBX_J@Z@Z ?RegisterSymbolizer@absl@@YAXP6A_NPEBXPEADH@Z@Z + ?Release@?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QEHAA?AU?$Allocation@V?$allocator@H@__1@std@@@23@XZ + ?Release@?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEHAA?AU?$Allocation@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@XZ + ?Release@?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEHAA?AU?$Allocation@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@23@XZ + ?Release@?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEHAA?AU?$Allocation@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@XZ + ?Release@?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEHAA?AU?$Allocation@V?$allocator@USubRange@absl@@@__1@std@@@23@XZ ?Release@ReleasableMutexLock@absl@@QEAAXXZ ?Remove@CondVar@absl@@AEAAXPEAUPerThreadSynch@base_internal@2@@Z ?RemoveChunkPrefix@ChunkIterator@Cord@absl@@AEAAX_K@Z @@ -2299,11 +2313,11 @@ ?RemoveSuffix@Cord@absl@@QEAAX_K@Z ?RemoveSuffix@CordRepRing@cord_internal@absl@@SAPEAV123@PEAV123@_K1@Z ?RepToPointer@Status@absl@@CAPEAUStatusRep@status_internal@2@_K@Z - ?Reset@?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ - ?Reset@?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ - ?Reset@?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ - ?Reset@?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ - ?Reset@?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ + ?Reset@?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@AEAAXXZ + ?Reset@?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAXXZ + ?Reset@?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAXXZ + ?Reset@?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAXXZ + ?Reset@?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAXXZ ?ResetToBuiltinUTC@TimeZoneInfo@cctz@time_internal@absl@@AEAA_NAEBV?$duration@_JV?$ratio@$00$00@__1@std@@@chrono@__1@std@@@Z ?ResetToEmpty@InlineRep@Cord@absl@@AEAAXXZ ?Resize@?$ResizeUninitializedTraits@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@X@strings_internal@absl@@SAXPEAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@_K@Z @@ -2317,12 +2331,12 @@ ?SampleSlow@container_internal@absl@@YAPEAUHashtablezInfo@12@PEA_J@Z ?Seek@CordRepBtreeNavigator@cord_internal@absl@@QEAA?AUPosition@123@_K@Z ?Seek@CordRepBtreeReader@cord_internal@absl@@QEAA?AVstring_view@3@_K@Z - ?SetAllocatedData@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QEAAXPEAH_K@Z - ?SetAllocatedData@?$Storage@PEAUCordRep@cord_internal@absl@@$01V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXPEAPEAUCordRep@cord_internal@3@_K@Z - ?SetAllocatedData@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXPEAPEAUCordRep@cord_internal@3@_K@Z - ?SetAllocatedData@?$Storage@PEBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXPEAPEBUCordRep@cord_internal@3@_K@Z - ?SetAllocatedData@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXPEAUPayload@status_internal@3@_K@Z - ?SetAllocatedData@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXPEAUSubRange@3@_K@Z + ?SetAllocation@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QEAAXU?$Allocation@V?$allocator@H@__1@std@@@23@@Z + ?SetAllocation@?$Storage@PEAUCordRep@cord_internal@absl@@$01V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXU?$Allocation@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@@Z + ?SetAllocation@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXU?$Allocation@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@@Z + ?SetAllocation@?$Storage@PEBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXU?$Allocation@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@23@@Z + ?SetAllocation@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXU?$Allocation@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@@Z + ?SetAllocation@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXU?$Allocation@V?$allocator@USubRange@absl@@@__1@std@@@23@@Z ?SetCapacityForTesting@CordRepRing@cord_internal@absl@@QEAAX_K@Z ?SetConversionChar@FormatConversionSpecImplFriend@str_format_internal@absl@@SAXW4FormatConversionChar@3@PEAVFormatConversionSpecImpl@23@@Z ?SetCordRep@CordzInfo@cord_internal@absl@@QEAAXPEAUCordRep@23@@Z
diff --git a/third_party/abseil-cpp/symbols_arm64_rel.def b/third_party/abseil-cpp/symbols_arm64_rel.def index 167d8a42..66f934c9 100644 --- a/third_party/abseil-cpp/symbols_arm64_rel.def +++ b/third_party/abseil-cpp/symbols_arm64_rel.def
@@ -217,6 +217,10 @@ ?AdvanceStack@ChunkIterator@Cord@absl@@AEAAAEAV123@XZ ?Alloc@LowLevelAlloc@base_internal@absl@@SAPEAX_K@Z ?AllocWithArena@LowLevelAlloc@base_internal@absl@@SAPEAX_KPEAUArena@123@@Z + ?Allocate@?$MallocAdapter@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@AEAV?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@23@AEAV?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@UPayload@status_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@AEAV?$allocator@UPayload@status_internal@absl@@@__1@std@@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@USubRange@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@USubRange@absl@@@__1@std@@@23@AEAV?$allocator@USubRange@absl@@@__1@std@@_K@Z ?AlreadyExistsError@absl@@YA?AVStatus@1@Vstring_view@1@@Z ?Append@Cord@absl@@QEAAX$$QEAV12@@Z ?Append@Cord@absl@@QEAAXAEBV12@@Z
diff --git a/third_party/abseil-cpp/symbols_x64_dbg.def b/third_party/abseil-cpp/symbols_x64_dbg.def index ba2dee8..51684ba9 100644 --- a/third_party/abseil-cpp/symbols_x64_dbg.def +++ b/third_party/abseil-cpp/symbols_x64_dbg.def
@@ -786,6 +786,11 @@ ??$move@AEAUTransition@cctz@time_internal@absl@@@__1@std@@YA$$QEAUTransition@cctz@time_internal@absl@@AEAU2345@@Z ??$move@AEAUTransitionType@cctz@time_internal@absl@@@__1@std@@YA$$QEAUTransitionType@cctz@time_internal@absl@@AEAU2345@@Z ??$move@AEAUViableSubstitution@strings_internal@absl@@@__1@std@@YA$$QEAUViableSubstitution@strings_internal@absl@@AEAU234@@Z + ??$move@AEAV?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QEAV?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@AEAV234@@Z + ??$move@AEAV?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QEAV?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAV234@@Z + ??$move@AEAV?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QEAV?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAV234@@Z + ??$move@AEAV?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QEAV?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAV234@@Z + ??$move@AEAV?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QEAV?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAV234@@Z ??$move@AEAV?$FunctionRef@$$A6AXPEAUCordRep@cord_internal@absl@@_K1@Z@absl@@@__1@std@@YA$$QEAV?$FunctionRef@$$A6AXPEAUCordRep@cord_internal@absl@@_K1@Z@absl@@AEAV23@@Z ??$move@AEAV?$__allocator_destructor@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@@__1@std@@YA$$QEAV?$__allocator_destructor@V?$allocator@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@01@AEAV201@@Z ??$move@AEAV?$__hash_node_destructor@V?$allocator@U?$__hash_node@U?$__hash_value_type@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@PEAX@__1@std@@@__1@std@@@__1@std@@@__1@std@@YA$$QEAV?$__hash_node_destructor@V?$allocator@U?$__hash_node@U?$__hash_value_type@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PEBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@PEAX@__1@std@@@__1@std@@@01@AEAV201@@Z @@ -1523,12 +1528,6 @@ ?AbslParseFlag@absl@@YA_NVstring_view@1@PEAVTime@1@PEAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z ?AbslUnparseFlag@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@VDuration@1@@Z ?AbslUnparseFlag@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@VTime@1@@Z - ?AcquireAllocatedData@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QEAAXAEAV?$AllocationTransaction@V?$allocator@H@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@PEAUCordRep@cord_internal@absl@@$01V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXAEAV?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXAEAV?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@PEBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXAEAV?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXAEAV?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXAEAV?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@23@@Z ?Add@Filler@CordRepRing@cord_internal@absl@@QEAAXPEAUCordRep@34@_K1@Z ?AddDataOffset@CordRepRing@cord_internal@absl@@AEAAXI_K@Z ?AddNode@CordForest@absl@@AEAAXPEAUCordRep@cord_internal@2@@Z @@ -1562,6 +1561,11 @@ ?Allocate@?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAPEAPEBUCordRep@cord_internal@3@_K@Z ?Allocate@?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAPEAUPayload@status_internal@3@_K@Z ?Allocate@?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAPEAUSubRange@3@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@H@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@H@__1@std@@@23@AEAV?$allocator@H@__1@std@@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@AEAV?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@23@AEAV?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@UPayload@status_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@AEAV?$allocator@UPayload@status_internal@absl@@@__1@std@@_K@Z + ?Allocate@?$MallocAdapter@V?$allocator@USubRange@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@USubRange@absl@@@__1@std@@@23@AEAV?$allocator@USubRange@absl@@@__1@std@@_K@Z ?AllocatedSize@CordRepFlat@cord_internal@absl@@QEBA_KXZ ?AllocatedSizeToTag@cord_internal@absl@@YAE_K@Z ?AllocatedSizeToTagUnchecked@cord_internal@absl@@YAE_K@Z @@ -1701,6 +1705,11 @@ ?DataLength@Header@TimeZoneInfo@cctz@time_internal@absl@@QEBA_K_K@Z ?DataLossError@absl@@YA?AVStatus@1@Vstring_view@1@@Z ?DeadlineExceededError@absl@@YA?AVStatus@1@Vstring_view@1@@Z + ?Deallocate@?$MallocAdapter@V?$allocator@H@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAEAV?$allocator@H@__1@std@@PEAH_K@Z + ?Deallocate@?$MallocAdapter@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAEAV?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@PEAPEAUCordRep@cord_internal@3@_K@Z + ?Deallocate@?$MallocAdapter@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAEAV?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@PEAPEBUCordRep@cord_internal@3@_K@Z + ?Deallocate@?$MallocAdapter@V?$allocator@UPayload@status_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAEAV?$allocator@UPayload@status_internal@absl@@@__1@std@@PEAUPayload@status_internal@3@_K@Z + ?Deallocate@?$MallocAdapter@V?$allocator@USubRange@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAEAV?$allocator@USubRange@absl@@@__1@std@@PEAUSubRange@3@_K@Z ?DeallocateIfAllocated@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ ?DeallocateIfAllocated@?$Storage@PEAUCordRep@cord_internal@absl@@$01V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ ?DeallocateIfAllocated@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ @@ -2290,6 +2299,11 @@ ?RegisterMutexTracer@absl@@YAXP6AXPEBDPEBX_J@Z@Z ?RegisterSpinLockProfiler@base_internal@absl@@YAXP6AXPEBX_J@Z@Z ?RegisterSymbolizer@absl@@YAXP6A_NPEBXPEADH@Z@Z + ?Release@?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QEHAA?AU?$Allocation@V?$allocator@H@__1@std@@@23@XZ + ?Release@?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEHAA?AU?$Allocation@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@XZ + ?Release@?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEHAA?AU?$Allocation@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@23@XZ + ?Release@?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEHAA?AU?$Allocation@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@XZ + ?Release@?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEHAA?AU?$Allocation@V?$allocator@USubRange@absl@@@__1@std@@@23@XZ ?Release@ReleasableMutexLock@absl@@QEAAXXZ ?Remove@CondVar@absl@@AEAAXPEAUPerThreadSynch@base_internal@2@@Z ?RemoveChunkPrefix@ChunkIterator@Cord@absl@@AEAAX_K@Z @@ -2301,11 +2315,11 @@ ?RemoveSuffix@Cord@absl@@QEAAX_K@Z ?RemoveSuffix@CordRepRing@cord_internal@absl@@SAPEAV123@PEAV123@_K1@Z ?RepToPointer@Status@absl@@CAPEAUStatusRep@status_internal@2@_K@Z - ?Reset@?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ - ?Reset@?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ - ?Reset@?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ - ?Reset@?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ - ?Reset@?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXXZ + ?Reset@?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@AEAAXXZ + ?Reset@?$AllocationTransaction@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAXXZ + ?Reset@?$AllocationTransaction@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAXXZ + ?Reset@?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAXXZ + ?Reset@?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AEAAXXZ ?ResetToBuiltinUTC@TimeZoneInfo@cctz@time_internal@absl@@AEAA_NAEBV?$duration@_JV?$ratio@$00$00@__1@std@@@chrono@__1@std@@@Z ?ResetToEmpty@InlineRep@Cord@absl@@AEAAXXZ ?Resize@?$ResizeUninitializedTraits@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@X@strings_internal@absl@@SAXPEAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@_K@Z @@ -2319,12 +2333,12 @@ ?SampleSlow@container_internal@absl@@YAPEAUHashtablezInfo@12@PEA_J@Z ?Seek@CordRepBtreeNavigator@cord_internal@absl@@QEAA?AUPosition@123@_K@Z ?Seek@CordRepBtreeReader@cord_internal@absl@@QEAA?AVstring_view@3@_K@Z - ?SetAllocatedData@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QEAAXPEAH_K@Z - ?SetAllocatedData@?$Storage@PEAUCordRep@cord_internal@absl@@$01V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXPEAPEAUCordRep@cord_internal@3@_K@Z - ?SetAllocatedData@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXPEAPEAUCordRep@cord_internal@3@_K@Z - ?SetAllocatedData@?$Storage@PEBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXPEAPEBUCordRep@cord_internal@3@_K@Z - ?SetAllocatedData@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXPEAUPayload@status_internal@3@_K@Z - ?SetAllocatedData@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXPEAUSubRange@3@_K@Z + ?SetAllocation@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QEAAXU?$Allocation@V?$allocator@H@__1@std@@@23@@Z + ?SetAllocation@?$Storage@PEAUCordRep@cord_internal@absl@@$01V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXU?$Allocation@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@@Z + ?SetAllocation@?$Storage@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXU?$Allocation@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@23@@Z + ?SetAllocation@?$Storage@PEBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXU?$Allocation@V?$allocator@PEBUCordRep@cord_internal@absl@@@__1@std@@@23@@Z + ?SetAllocation@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXU?$Allocation@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@@Z + ?SetAllocation@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QEAAXU?$Allocation@V?$allocator@USubRange@absl@@@__1@std@@@23@@Z ?SetCapacityForTesting@CordRepRing@cord_internal@absl@@QEAAX_K@Z ?SetConversionChar@FormatConversionSpecImplFriend@str_format_internal@absl@@SAXW4FormatConversionChar@3@PEAVFormatConversionSpecImpl@23@@Z ?SetCordRep@CordzInfo@cord_internal@absl@@QEAAXPEAUCordRep@23@@Z
diff --git a/third_party/abseil-cpp/symbols_x86_dbg.def b/third_party/abseil-cpp/symbols_x86_dbg.def index d66998e2..615d5ff 100644 --- a/third_party/abseil-cpp/symbols_x86_dbg.def +++ b/third_party/abseil-cpp/symbols_x86_dbg.def
@@ -781,6 +781,11 @@ ??$move@AAUTransition@cctz@time_internal@absl@@@__1@std@@YA$$QAUTransition@cctz@time_internal@absl@@AAU2345@@Z ??$move@AAUTransitionType@cctz@time_internal@absl@@@__1@std@@YA$$QAUTransitionType@cctz@time_internal@absl@@AAU2345@@Z ??$move@AAUViableSubstitution@strings_internal@absl@@@__1@std@@YA$$QAUViableSubstitution@strings_internal@absl@@AAU234@@Z + ??$move@AAV?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QAV?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@AAV234@@Z + ??$move@AAV?$AllocationTransaction@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QAV?$AllocationTransaction@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAV234@@Z + ??$move@AAV?$AllocationTransaction@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QAV?$AllocationTransaction@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAV234@@Z + ??$move@AAV?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QAV?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAV234@@Z + ??$move@AAV?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@@__1@std@@YA$$QAV?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AAV234@@Z ??$move@AAV?$FunctionRef@$$A6AXPAUCordRep@cord_internal@absl@@II@Z@absl@@@__1@std@@YA$$QAV?$FunctionRef@$$A6AXPAUCordRep@cord_internal@absl@@II@Z@absl@@AAV23@@Z ??$move@AAV?$__allocator_destructor@V?$allocator@PBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@__1@std@@@__1@std@@YA$$QAV?$__allocator_destructor@V?$allocator@PBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@@01@AAV201@@Z ??$move@AAV?$__hash_node_destructor@V?$allocator@U?$__hash_node@U?$__hash_value_type@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@PAX@__1@std@@@__1@std@@@__1@std@@@__1@std@@YA$$QAV?$__hash_node_destructor@V?$allocator@U?$__hash_node@U?$__hash_value_type@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PBVImpl@time_zone@cctz@time_internal@absl@@@__1@std@@PAX@__1@std@@@__1@std@@@01@AAV201@@Z @@ -1517,12 +1522,6 @@ ?AbslParseFlag@absl@@YA_NVstring_view@1@PAVTime@1@PAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z ?AbslUnparseFlag@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@VDuration@1@@Z ?AbslUnparseFlag@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@VTime@1@@Z - ?AcquireAllocatedData@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QAEXAAV?$AllocationTransaction@V?$allocator@H@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@PAUCordRep@cord_internal@absl@@$01V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXAAV?$AllocationTransaction@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@PAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXAAV?$AllocationTransaction@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@PBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXAAV?$AllocationTransaction@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXAAV?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@@Z - ?AcquireAllocatedData@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXAAV?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@23@@Z ?Add@Filler@CordRepRing@cord_internal@absl@@QAEXPAUCordRep@34@II@Z ?AddDataOffset@CordRepRing@cord_internal@absl@@AAEXII@Z ?AddNode@CordForest@absl@@AAEXPAUCordRep@cord_internal@2@@Z @@ -1556,6 +1555,11 @@ ?Allocate@?$AllocationTransaction@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEPAPBUCordRep@cord_internal@3@I@Z ?Allocate@?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEPAUPayload@status_internal@3@I@Z ?Allocate@?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEPAUSubRange@3@I@Z + ?Allocate@?$MallocAdapter@V?$allocator@H@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@H@__1@std@@@23@AAV?$allocator@H@__1@std@@I@Z + ?Allocate@?$MallocAdapter@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@23@AAV?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@I@Z + ?Allocate@?$MallocAdapter@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@23@AAV?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@I@Z + ?Allocate@?$MallocAdapter@V?$allocator@UPayload@status_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@AAV?$allocator@UPayload@status_internal@absl@@@__1@std@@I@Z + ?Allocate@?$MallocAdapter@V?$allocator@USubRange@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@USubRange@absl@@@__1@std@@@23@AAV?$allocator@USubRange@absl@@@__1@std@@I@Z ?AllocatedSize@CordRepFlat@cord_internal@absl@@QBEIXZ ?AllocatedSizeToTag@cord_internal@absl@@YAEI@Z ?AllocatedSizeToTagUnchecked@cord_internal@absl@@YAEI@Z @@ -1695,6 +1699,11 @@ ?DataLength@Header@TimeZoneInfo@cctz@time_internal@absl@@QBEII@Z ?DataLossError@absl@@YA?AVStatus@1@Vstring_view@1@@Z ?DeadlineExceededError@absl@@YA?AVStatus@1@Vstring_view@1@@Z + ?Deallocate@?$MallocAdapter@V?$allocator@H@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAAV?$allocator@H@__1@std@@PAHI@Z + ?Deallocate@?$MallocAdapter@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAAV?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@PAPAUCordRep@cord_internal@3@I@Z + ?Deallocate@?$MallocAdapter@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAAV?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@PAPBUCordRep@cord_internal@3@I@Z + ?Deallocate@?$MallocAdapter@V?$allocator@UPayload@status_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAAV?$allocator@UPayload@status_internal@absl@@@__1@std@@PAUPayload@status_internal@3@I@Z + ?Deallocate@?$MallocAdapter@V?$allocator@USubRange@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SAXAAV?$allocator@USubRange@absl@@@__1@std@@PAUSubRange@3@I@Z ?DeallocateIfAllocated@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QAEXXZ ?DeallocateIfAllocated@?$Storage@PAUCordRep@cord_internal@absl@@$01V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXXZ ?DeallocateIfAllocated@?$Storage@PAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXXZ @@ -2284,6 +2293,11 @@ ?RegisterMutexTracer@absl@@YAXP6AXPBDPBX_J@Z@Z ?RegisterSpinLockProfiler@base_internal@absl@@YAXP6AXPBX_J@Z@Z ?RegisterSymbolizer@absl@@YAXP6A_NPBXPADH@Z@Z + ?Release@?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QHAE?AU?$Allocation@V?$allocator@H@__1@std@@@23@XZ + ?Release@?$AllocationTransaction@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QHAE?AU?$Allocation@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@23@XZ + ?Release@?$AllocationTransaction@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QHAE?AU?$Allocation@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@23@XZ + ?Release@?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QHAE?AU?$Allocation@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@XZ + ?Release@?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QHAE?AU?$Allocation@V?$allocator@USubRange@absl@@@__1@std@@@23@XZ ?Release@ReleasableMutexLock@absl@@QAEXXZ ?Remove@CondVar@absl@@AAEXPAUPerThreadSynch@base_internal@2@@Z ?RemoveChunkPrefix@ChunkIterator@Cord@absl@@AAEXI@Z @@ -2295,11 +2309,11 @@ ?RemoveSuffix@Cord@absl@@QAEXI@Z ?RemoveSuffix@CordRepRing@cord_internal@absl@@SAPAV123@PAV123@II@Z ?RepToPointer@Status@absl@@CAPAUStatusRep@status_internal@2@I@Z - ?Reset@?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QAEXXZ - ?Reset@?$AllocationTransaction@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXXZ - ?Reset@?$AllocationTransaction@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXXZ - ?Reset@?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXXZ - ?Reset@?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXXZ + ?Reset@?$AllocationTransaction@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@AAEXXZ + ?Reset@?$AllocationTransaction@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEXXZ + ?Reset@?$AllocationTransaction@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEXXZ + ?Reset@?$AllocationTransaction@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEXXZ + ?Reset@?$AllocationTransaction@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@AAEXXZ ?ResetToBuiltinUTC@TimeZoneInfo@cctz@time_internal@absl@@AAE_NABV?$duration@_JV?$ratio@$00$00@__1@std@@@chrono@__1@std@@@Z ?ResetToEmpty@InlineRep@Cord@absl@@AAEXXZ ?Resize@?$ResizeUninitializedTraits@V?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@X@strings_internal@absl@@SAXPAV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@I@Z @@ -2313,12 +2327,12 @@ ?SampleSlow@container_internal@absl@@YAPAUHashtablezInfo@12@PA_J@Z ?Seek@CordRepBtreeNavigator@cord_internal@absl@@QAE?AUPosition@123@I@Z ?Seek@CordRepBtreeReader@cord_internal@absl@@QAE?AVstring_view@3@I@Z - ?SetAllocatedData@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QAEXPAHI@Z - ?SetAllocatedData@?$Storage@PAUCordRep@cord_internal@absl@@$01V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXPAPAUCordRep@cord_internal@3@I@Z - ?SetAllocatedData@?$Storage@PAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXPAPAUCordRep@cord_internal@3@I@Z - ?SetAllocatedData@?$Storage@PBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXPAPBUCordRep@cord_internal@3@I@Z - ?SetAllocatedData@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXPAUPayload@status_internal@3@I@Z - ?SetAllocatedData@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXPAUSubRange@3@I@Z + ?SetAllocation@?$Storage@H$0CP@V?$allocator@H@__1@std@@@inlined_vector_internal@absl@@QAEXU?$Allocation@V?$allocator@H@__1@std@@@23@@Z + ?SetAllocation@?$Storage@PAUCordRep@cord_internal@absl@@$01V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXU?$Allocation@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@23@@Z + ?SetAllocation@?$Storage@PAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXU?$Allocation@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@23@@Z + ?SetAllocation@?$Storage@PBUCordRep@cord_internal@absl@@$0CP@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXU?$Allocation@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@23@@Z + ?SetAllocation@?$Storage@UPayload@status_internal@absl@@$00V?$allocator@UPayload@status_internal@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXU?$Allocation@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@@Z + ?SetAllocation@?$Storage@USubRange@absl@@$0CP@V?$allocator@USubRange@absl@@@__1@std@@@inlined_vector_internal@absl@@QAEXU?$Allocation@V?$allocator@USubRange@absl@@@__1@std@@@23@@Z ?SetCapacityForTesting@CordRepRing@cord_internal@absl@@QAEXI@Z ?SetConversionChar@FormatConversionSpecImplFriend@str_format_internal@absl@@SAXW4FormatConversionChar@3@PAVFormatConversionSpecImpl@23@@Z ?SetCordRep@CordzInfo@cord_internal@absl@@QAEXPAUCordRep@23@@Z
diff --git a/third_party/abseil-cpp/symbols_x86_rel.def b/third_party/abseil-cpp/symbols_x86_rel.def index 7340dcb..f00ae5ee 100644 --- a/third_party/abseil-cpp/symbols_x86_rel.def +++ b/third_party/abseil-cpp/symbols_x86_rel.def
@@ -218,6 +218,10 @@ ?AdvanceStack@ChunkIterator@Cord@absl@@AAEAAV123@XZ ?Alloc@LowLevelAlloc@base_internal@absl@@SAPAXI@Z ?AllocWithArena@LowLevelAlloc@base_internal@absl@@SAPAXIPAUArena@123@@Z + ?Allocate@?$MallocAdapter@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@23@AAV?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@I@Z + ?Allocate@?$MallocAdapter@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@@23@AAV?$allocator@PBUCordRep@cord_internal@absl@@@__1@std@@I@Z + ?Allocate@?$MallocAdapter@V?$allocator@UPayload@status_internal@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@UPayload@status_internal@absl@@@__1@std@@@23@AAV?$allocator@UPayload@status_internal@absl@@@__1@std@@I@Z + ?Allocate@?$MallocAdapter@V?$allocator@USubRange@absl@@@__1@std@@$0A@@inlined_vector_internal@absl@@SA?AU?$Allocation@V?$allocator@USubRange@absl@@@__1@std@@@23@AAV?$allocator@USubRange@absl@@@__1@std@@I@Z ?AlreadyExistsError@absl@@YA?AVStatus@1@Vstring_view@1@@Z ?Append@Cord@absl@@QAEX$$QAV12@@Z ?Append@Cord@absl@@QAEXABV12@@Z
diff --git a/third_party/blink/public/mojom/webauthn/authenticator.mojom b/third_party/blink/public/mojom/webauthn/authenticator.mojom index 9da6e82..e6af2825 100644 --- a/third_party/blink/public/mojom/webauthn/authenticator.mojom +++ b/third_party/blink/public/mojom/webauthn/authenticator.mojom
@@ -87,6 +87,12 @@ struct MakeCredentialAuthenticatorResponse { CommonCredentialInfo info; + // True if transport exists. False if transport does not exist, e.g. on old + // Windows. + bool has_transport; + // The transport method used to authenticate. + AuthenticatorTransport transport; + // A blob of data returned by the authenticator after creating a credential. array<uint8> attestation_object; @@ -152,7 +158,7 @@ // True if transport exists. False if transport does not exist, e.g. on old // Windows. bool has_transport; - // The transport method used to authenticate, cannot be optional, because it is an enum. + // The transport method used to authenticate. AuthenticatorTransport transport; // Cryptographic signature proving possession of the credential private key.
diff --git a/third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h b/third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h index 0dd3409..6830cf9 100644 --- a/third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h +++ b/third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h
@@ -35,6 +35,9 @@ template <typename T> class ActiveScriptWrappable : public ActiveScriptWrappableBase { public: + ActiveScriptWrappable(const ActiveScriptWrappable&) = delete; + ActiveScriptWrappable& operator=(const ActiveScriptWrappable&) = delete; + ~ActiveScriptWrappable() override = default; protected: @@ -48,9 +51,6 @@ bool DispatchHasPendingActivity() const final { return static_cast<const T*>(this)->HasPendingActivity(); } - - private: - DISALLOW_COPY_AND_ASSIGN(ActiveScriptWrappable); }; // Helper for ActiveScriptWrappable<T>::IsContextDestroyed();
diff --git a/third_party/blink/renderer/bindings/core/v8/scheduled_action.h b/third_party/blink/renderer/bindings/core/v8/scheduled_action.h index 28aa854..2efadf8c 100644 --- a/third_party/blink/renderer/bindings/core/v8/scheduled_action.h +++ b/third_party/blink/renderer/bindings/core/v8/scheduled_action.h
@@ -47,7 +47,6 @@ class ScheduledAction final : public GarbageCollected<ScheduledAction>, public NameClient { - DISALLOW_COPY_AND_ASSIGN(ScheduledAction); public: ScheduledAction(ScriptState*, @@ -58,6 +57,9 @@ ExecutionContext* target, const String& handler); + ScheduledAction(const ScheduledAction&) = delete; + ScheduledAction& operator=(const ScheduledAction&) = delete; + ~ScheduledAction() override; void Dispose();
diff --git a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h index 9300b44b..c8676a37 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h +++ b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h
@@ -37,6 +37,11 @@ ScriptCustomElementDefinition(const ScriptCustomElementDefinitionData& data, const CustomElementDescriptor&, CustomElementDefinition::Id); + + ScriptCustomElementDefinition(const ScriptCustomElementDefinition&) = delete; + ScriptCustomElementDefinition& operator=( + const ScriptCustomElementDefinition&) = delete; + ~ScriptCustomElementDefinition() override = default; void Trace(Visitor*) const override; @@ -94,8 +99,6 @@ Member<V8VoidFunction> form_reset_callback_; Member<V8CustomElementFormDisabledCallback> form_disabled_callback_; Member<V8CustomElementFormStateRestoreCallback> form_state_restore_callback_; - - DISALLOW_COPY_AND_ASSIGN(ScriptCustomElementDefinition); }; } // namespace blink
diff --git a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.h b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.h index d4d2906..c0eba3a 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.h +++ b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.h
@@ -25,6 +25,12 @@ CustomElementRegistry*, V8CustomElementConstructor* constructor, ExceptionState&); + + ScriptCustomElementDefinitionBuilder( + const ScriptCustomElementDefinitionBuilder&) = delete; + ScriptCustomElementDefinitionBuilder& operator=( + const ScriptCustomElementDefinitionBuilder&) = delete; + ~ScriptCustomElementDefinitionBuilder() = default; bool CheckConstructorIntrinsics() override; @@ -51,8 +57,6 @@ v8::Local<v8::Value> v8_form_reset_callback_; v8::Local<v8::Value> v8_form_disabled_callback_; v8::Local<v8::Value> v8_form_state_restore_callback_; - - DISALLOW_COPY_AND_ASSIGN(ScriptCustomElementDefinitionBuilder); }; } // namespace blink
diff --git a/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h b/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h index ebe69661..89e1da8 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h +++ b/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h
@@ -43,6 +43,10 @@ public: explicit ScriptPromiseResolver(ScriptState*); + + ScriptPromiseResolver(const ScriptPromiseResolver&) = delete; + ScriptPromiseResolver& operator=(const ScriptPromiseResolver&) = delete; + ~ScriptPromiseResolver() override; void Dispose(); @@ -171,8 +175,6 @@ base::debug::StackTrace create_stack_trace_{8}; #endif - - DISALLOW_COPY_AND_ASSIGN(ScriptPromiseResolver); }; } // namespace blink
diff --git a/third_party/blink/renderer/bindings/core/v8/script_streamer.cc b/third_party/blink/renderer/bindings/core/v8/script_streamer.cc index a69c3fb..ec260ea8 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_streamer.cc +++ b/third_party/blink/renderer/bindings/core/v8/script_streamer.cc
@@ -45,6 +45,10 @@ class SourceStream : public v8::ScriptCompiler::ExternalSourceStream { public: SourceStream() = default; + + SourceStream(const SourceStream&) = delete; + SourceStream& operator=(const SourceStream&) = delete; + ~SourceStream() override = default; // Called by V8 on a background thread. Should block until we can return @@ -265,8 +269,6 @@ CrossThreadWeakPersistent<ResponseBodyLoaderClient> response_body_loader_client_; scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner_; - - DISALLOW_COPY_AND_ASSIGN(SourceStream); }; std::tuple<ScriptStreamer*, ScriptStreamer::NotStreamingReason>
diff --git a/third_party/blink/renderer/bindings/core/v8/script_streamer.h b/third_party/blink/renderer/bindings/core/v8/script_streamer.h index b0f47085..423d77a 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_streamer.h +++ b/third_party/blink/renderer/bindings/core/v8/script_streamer.h
@@ -75,6 +75,10 @@ mojo::ScopedDataPipeConsumerHandle data_pipe, ResponseBodyLoaderClient* response_body_loader_client, scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner); + + ScriptStreamer(const ScriptStreamer&) = delete; + ScriptStreamer& operator=(const ScriptStreamer&) = delete; + ~ScriptStreamer(); void Trace(Visitor*) const; @@ -234,8 +238,6 @@ v8::ScriptType script_type_; scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner_; - - DISALLOW_COPY_AND_ASSIGN(ScriptStreamer); }; } // namespace blink
diff --git a/third_party/blink/renderer/bindings/core/v8/serialization/transferables.h b/third_party/blink/renderer/bindings/core/v8/serialization/transferables.h index 2c3b9205..0d75f0c 100644 --- a/third_party/blink/renderer/bindings/core/v8/serialization/transferables.h +++ b/third_party/blink/renderer/bindings/core/v8/serialization/transferables.h
@@ -36,6 +36,10 @@ public: Transferables() = default; + + Transferables(const Transferables&) = delete; + Transferables& operator=(const Transferables&) = delete; + ~Transferables(); ArrayBufferArray array_buffers; @@ -70,9 +74,6 @@ return nullptr; return static_cast<T*>(it->value.Get()); } - - private: - DISALLOW_COPY_AND_ASSIGN(Transferables); }; // Along with extending |Transferables| to hold a new kind of transferable
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_idle_task_runner.h b/third_party/blink/renderer/bindings/core/v8/v8_idle_task_runner.h index fa00422..226f66e 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_idle_task_runner.h +++ b/third_party/blink/renderer/bindings/core/v8/v8_idle_task_runner.h
@@ -45,6 +45,10 @@ public: explicit V8IdleTaskRunner(ThreadScheduler* scheduler) : scheduler_(scheduler) {} + + V8IdleTaskRunner(const V8IdleTaskRunner&) = delete; + V8IdleTaskRunner& operator=(const V8IdleTaskRunner&) = delete; + ~V8IdleTaskRunner() override = default; void PostIdleTask(std::unique_ptr<v8::IdleTask> task) override { DCHECK(RuntimeEnabledFeatures::V8IdleTasksEnabled()); @@ -59,8 +63,6 @@ private: ThreadScheduler* scheduler_; - - DISALLOW_COPY_AND_ASSIGN(V8IdleTaskRunner); }; } // namespace blink
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_wasm_response_extensions.cc b/third_party/blink/renderer/bindings/core/v8/v8_wasm_response_extensions.cc index 5cfdb99..41916c7 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_wasm_response_extensions.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_wasm_response_extensions.cc
@@ -196,6 +196,11 @@ ExceptionState& exception_state) : streaming_(streaming), exception_state_(exception_state) {} + ExceptionToAbortStreamingScope(const ExceptionToAbortStreamingScope&) = + delete; + ExceptionToAbortStreamingScope& operator=( + const ExceptionToAbortStreamingScope&) = delete; + ~ExceptionToAbortStreamingScope() { if (!exception_state_.HadException()) return; @@ -207,8 +212,6 @@ private: std::shared_ptr<v8::WasmStreaming> streaming_; ExceptionState& exception_state_; - - DISALLOW_COPY_AND_ASSIGN(ExceptionToAbortStreamingScope); }; void SendCachedData(String response_url,
diff --git a/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.h b/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.h index 50054a00..72b646f9 100644 --- a/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.h +++ b/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.h
@@ -46,6 +46,12 @@ : public GarbageCollected<WorkerOrWorkletScriptController> { public: WorkerOrWorkletScriptController(WorkerOrWorkletGlobalScope*, v8::Isolate*); + + WorkerOrWorkletScriptController(const WorkerOrWorkletScriptController&) = + delete; + WorkerOrWorkletScriptController& operator=( + const WorkerOrWorkletScriptController&) = delete; + virtual ~WorkerOrWorkletScriptController(); void Dispose(); @@ -110,8 +116,6 @@ bool execution_forbidden_ = false; scoped_refptr<RejectedPromises> rejected_promises_; - - DISALLOW_COPY_AND_ASSIGN(WorkerOrWorkletScriptController); }; } // namespace blink
diff --git a/third_party/blink/renderer/controller/blink_leak_detector.h b/third_party/blink/renderer/controller/blink_leak_detector.h index d13685bc..ea5bd4e 100644 --- a/third_party/blink/renderer/controller/blink_leak_detector.h +++ b/third_party/blink/renderer/controller/blink_leak_detector.h
@@ -20,6 +20,10 @@ static void Bind(mojo::PendingReceiver<mojom::blink::LeakDetector>); BlinkLeakDetector(); + + BlinkLeakDetector(const BlinkLeakDetector&) = delete; + BlinkLeakDetector& operator=(const BlinkLeakDetector&) = delete; + ~BlinkLeakDetector() override; private: @@ -35,8 +39,6 @@ PerformLeakDetectionCallback callback_; mojo::Receiver<mojom::blink::LeakDetector> receiver_{this}; - - DISALLOW_COPY_AND_ASSIGN(BlinkLeakDetector); }; } // namespace blink
diff --git a/third_party/blink/renderer/controller/dev_tools_frontend_impl.h b/third_party/blink/renderer/controller/dev_tools_frontend_impl.h index 593b1ff..caef07e 100644 --- a/third_party/blink/renderer/controller/dev_tools_frontend_impl.h +++ b/third_party/blink/renderer/controller/dev_tools_frontend_impl.h
@@ -64,6 +64,10 @@ DevToolsFrontendImpl( LocalFrame&, mojo::PendingAssociatedReceiver<mojom::blink::DevToolsFrontend>); + + DevToolsFrontendImpl(const DevToolsFrontendImpl&) = delete; + DevToolsFrontendImpl& operator=(const DevToolsFrontendImpl&) = delete; + ~DevToolsFrontendImpl() override; void DidClearWindowObject(); void Trace(Visitor*) const override; @@ -91,8 +95,6 @@ HeapMojoAssociatedReceiver<mojom::blink::DevToolsFrontend, DevToolsFrontendImpl> receiver_{this, nullptr}; - - DISALLOW_COPY_AND_ASSIGN(DevToolsFrontendImpl); }; } // namespace blink
diff --git a/third_party/blink/renderer/core/css/css_segmented_font_face.cc b/third_party/blink/renderer/core/css/css_segmented_font_face.cc index f51a8f3..4f5d9a64 100644 --- a/third_party/blink/renderer/core/css/css_segmented_font_face.cc +++ b/third_party/blink/renderer/core/css/css_segmented_font_face.cc
@@ -83,9 +83,6 @@ void CSSSegmentedFontFace::AddFontFace(FontFace* font_face, bool css_connected) { - // TODO(crbug.com/1250831): Remove CHECKs once we get crash data. - CHECK(this); - CHECK(font_face); PruneTable(); font_face->CssFontFace()->AddSegmentedFontFace(this); font_faces_->Insert(font_face, css_connected); @@ -250,16 +247,14 @@ const FontFace& existing_font_face) { // We should reach here only for CSS-connected font faces, which must have an // owner document. - // TODO(crbug.com/1250831): Convert to DCHECKs once we get crash data. - CHECK(new_font_face.GetDocument()); - CHECK_EQ(new_font_face.GetDocument(), existing_font_face.GetDocument()); - CHECK(new_font_face.GetStyleRule()); - CHECK(existing_font_face.GetStyleRule()); + DCHECK(new_font_face.GetDocument()); + DCHECK_EQ(new_font_face.GetDocument(), existing_font_face.GetDocument()); + DCHECK(new_font_face.GetStyleRule()); + DCHECK(existing_font_face.GetStyleRule()); if (new_font_face.IsUserStyle() != existing_font_face.IsUserStyle()) return existing_font_face.IsUserStyle(); const CascadeLayerMap* map = nullptr; if (new_font_face.IsUserStyle()) { - CHECK(&new_font_face.GetDocument()->GetStyleEngine()); map = new_font_face.GetDocument()->GetStyleEngine().GetUserCascadeLayerMap(); } else if (new_font_face.GetDocument()->GetScopedStyleResolver()) { @@ -277,8 +272,6 @@ } // namespace void FontFaceList::Insert(FontFace* font_face, bool css_connected) { - // TODO(crbug.com/1250831): Remove CHECKs once we get crash data. - CHECK(this); if (!css_connected) { non_css_connected_face_.insert(font_face); return; @@ -288,7 +281,6 @@ while (it != css_connected_face_.begin()) { auto prev = it; --prev; - CHECK(*prev); if (CascadePriorityHigherThan(*font_face, **prev)) break; it = prev;
diff --git a/third_party/blink/renderer/core/css/resolver/style_adjuster.cc b/third_party/blink/renderer/core/css/resolver/style_adjuster.cc index 7308ce2..a2e7a1f 100644 --- a/third_party/blink/renderer/core/css/resolver/style_adjuster.cc +++ b/third_party/blink/renderer/core/css/resolver/style_adjuster.cc
@@ -802,9 +802,13 @@ style.ClearAppliedTextDecorations(); else style.RestoreParentTextDecorations(parent_style); - style.ApplyTextDecorations( - parent_style.VisitedDependentColor(GetCSSPropertyTextDecorationColor()), - OverridesTextDecorationColors(element)); + if (svg_element) { + style.ApplySvgTextDecorations(); + } else { + style.ApplyTextDecorations( + parent_style.VisitedDependentColor(GetCSSPropertyTextDecorationColor()), + OverridesTextDecorationColors(element)); + } // Cull out any useless layers and also repeat patterns into additional // layers.
diff --git a/third_party/blink/renderer/core/css/style_engine.cc b/third_party/blink/renderer/core/css/style_engine.cc index 169892fa..7d942f41 100644 --- a/third_party/blink/renderer/core/css/style_engine.cc +++ b/third_party/blink/renderer/core/css/style_engine.cc
@@ -2614,6 +2614,7 @@ // DetachLayoutTree will clear dirty bits which means we also need to simulate // that we are in a dom removal to make the style recalc root be updated // correctly. + StyleEngine::DetachLayoutTreeScope detach_scope(*this); StyleEngine::DOMRemovalScope removal_scope(*this); To<Element>(select).DetachLayoutTree(); // If the recalc root is in this subtree, DetachLayoutTree() above clears the
diff --git a/third_party/blink/renderer/core/css/style_engine.h b/third_party/blink/renderer/core/css/style_engine.h index 9c2fac1..bcc0e70 100644 --- a/third_party/blink/renderer/core/css/style_engine.h +++ b/third_party/blink/renderer/core/css/style_engine.h
@@ -110,11 +110,21 @@ STACK_ALLOCATED(); public: - explicit DetachLayoutTreeScope(StyleEngine& engine) : engine_(engine) {} + explicit DetachLayoutTreeScope(StyleEngine& engine) + : engine_(engine) +#if DCHECK_IS_ON() + , + in_detach_scope_(&engine.in_detach_scope_, true) +#endif // DCHECK_IS_ON() + { + } ~DetachLayoutTreeScope() { engine_.MarkForLayoutTreeChangesAfterDetach(); } private: StyleEngine& engine_; +#if DCHECK_IS_ON() + base::AutoReset<bool> in_detach_scope_; +#endif // DCHECK_IS_ON() }; // There are a few instances where we are marking nodes style dirty from @@ -482,8 +492,14 @@ // This method will be called for every LayoutObject while detaching a // subtree. Since the trees are detached bottom up, the last parent passed // in will be the parent of one of the roots being detached. - if (in_dom_removal_) + if (in_dom_removal_) { +#if DCHECK_IS_ON() + DCHECK(in_detach_scope_) + << "A DetachLayoutTreeScope must wrap a DOMRemovalScope to handle " + "and reset parent_for_detached_subtree_"; +#endif // DCHECK_IS_ON() parent_for_detached_subtree_ = parent; + } } void SetColorSchemeFromMeta(const CSSValue* color_scheme); @@ -685,6 +701,9 @@ bool in_layout_tree_rebuild_{false}; bool in_container_query_style_recalc_{false}; bool in_dom_removal_{false}; +#if DCHECK_IS_ON() + bool in_detach_scope_{false}; +#endif // DCHECK_IS_ON() bool in_apply_animation_update_{false}; bool viewport_style_dirty_{false}; bool fonts_need_update_{false};
diff --git a/third_party/blink/renderer/core/css/style_engine_test.cc b/third_party/blink/renderer/core/css/style_engine_test.cc index ffe8f7a..8a347a8 100644 --- a/third_party/blink/renderer/core/css/style_engine_test.cc +++ b/third_party/blink/renderer/core/css/style_engine_test.cc
@@ -37,6 +37,7 @@ #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/frame/viewport_data.h" #include "third_party/blink/renderer/core/html/forms/html_input_element.h" +#include "third_party/blink/renderer/core/html/forms/html_select_element.h" #include "third_party/blink/renderer/core/html/html_collection.h" #include "third_party/blink/renderer/core/html/html_element.h" #include "third_party/blink/renderer/core/html/html_iframe_element.h" @@ -89,6 +90,10 @@ return GetStyleEngine().style_recalc_root_.GetRootNode(); } + LayoutObject* GetParentForDetachedSubtree() { + return GetStyleEngine().parent_for_detached_subtree_.Get(); + } + const CSSValue* ComputedValue(Element* element, String property_name) { CSSPropertyRef ref(property_name, GetDocument()); DCHECK(ref.IsValid()); @@ -4749,4 +4754,15 @@ UpdateAllLifecyclePhases(); } +TEST_F(StyleEngineTest, ChangeRenderingForHTMLSelect_DetachParent) { + GetDocument().body()->setInnerHTML(R"HTML( + <select id="select"></select> + )HTML"); + UpdateAllLifecyclePhases(); + EXPECT_FALSE(GetParentForDetachedSubtree()); + GetStyleEngine().ChangeRenderingForHTMLSelect( + To<HTMLSelectElement>(*GetDocument().getElementById("select"))); + EXPECT_FALSE(GetParentForDetachedSubtree()); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/dom/node.h b/third_party/blink/renderer/core/dom/node.h index 389f3299..52b1e3a 100644 --- a/third_party/blink/renderer/core/dom/node.h +++ b/third_party/blink/renderer/core/dom/node.h
@@ -205,7 +205,6 @@ virtual void setNodeValue(const String&); virtual NodeType getNodeType() const = 0; ContainerNode* parentNode() const; - ContainerNode* ParentNodeWithCounting() const; Element* parentElement() const; ContainerNode* ParentElementOrShadowRoot() const; ContainerNode* ParentElementOrDocumentFragment() const;
diff --git a/third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc b/third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc index e34c443..c8bd39a 100644 --- a/third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc +++ b/third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc
@@ -343,6 +343,9 @@ InitializeWebMediaPlayerImplInternal(nullptr); } + WebMediaPlayerImplTest(const WebMediaPlayerImplTest&) = delete; + WebMediaPlayerImplTest& operator=(const WebMediaPlayerImplTest&) = delete; + ~WebMediaPlayerImplTest() override { if (!wmpi_) return; @@ -874,9 +877,6 @@ std::unique_ptr<WebMediaPlayerImpl> wmpi_; std::unique_ptr<base::trace_event::MemoryDumpManager> memory_dump_manager_; - - private: - DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImplTest); }; TEST_F(WebMediaPlayerImplTest, ConstructAndDestroy) {
diff --git a/third_party/blink/renderer/core/html/html_popup_element.cc b/third_party/blink/renderer/core/html/html_popup_element.cc index 51c11d0..5dd7110 100644 --- a/third_party/blink/renderer/core/html/html_popup_element.cc +++ b/third_party/blink/renderer/core/html/html_popup_element.cc
@@ -12,8 +12,7 @@ #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/html/forms/html_select_menu_element.h" -#include "third_party/blink/renderer/core/resize_observer/resize_observer.h" -#include "third_party/blink/renderer/core/resize_observer/resize_observer_entry.h" +#include "third_party/blink/renderer/core/layout/adjust_for_absolute_zoom.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/geometry/float_rect.h" #include "third_party/blink/renderer/platform/geometry/int_rect.h" @@ -22,31 +21,11 @@ namespace blink { -class HTMLPopupElement::PopupResizeDelegate final - : public ResizeObserver::Delegate { - public: - PopupResizeDelegate() : ResizeObserver::Delegate() {} - void OnResize( - const HeapVector<Member<ResizeObserverEntry>>& entries) override { - DCHECK_EQ(entries.size(), 1u); - auto* popup = DynamicTo<HTMLPopupElement>(entries[0]->target()); - DCHECK(popup); - if (popup->being_shown_) - popup->being_shown_ = false; - else - popup->hide(); - } -}; - HTMLPopupElement::HTMLPopupElement(Document& document) : HTMLElement(html_names::kPopupTag, document), open_(false), - being_shown_(false), had_initiallyopen_when_parsed_(false), invoker_(nullptr), - resize_observer_( - ResizeObserver::Create(GetDocument().domWindow(), - MakeGarbageCollected<PopupResizeDelegate>())), needs_repositioning_for_select_menu_(false), owner_select_menu_element_(nullptr) { DCHECK(RuntimeEnabledFeatures::HTMLPopupElementEnabled()); @@ -67,7 +46,6 @@ void HTMLPopupElement::hide() { if (!open_) return; - resize_observer_->disconnect(); open_ = false; invoker_ = nullptr; if (!isConnected()) @@ -101,15 +79,6 @@ PushNewPopupElement(this); MarkStyleDirty(); SetFocus(); - being_shown_ = true; - resize_observer_->observe(this); - // We need to update lifecycle phases to ensure the initial resize - // observation gets fired before the popup.show() call returns. Otherwise - // code like this will fail to work properly: - // popup.show(); - // popup.style.width = change; // Should light-dismiss popup, but won't - GetDocument().GetFrame()->View()->UpdateAllLifecyclePhases( - DocumentUpdateReason::kPagePopup); } bool HTMLPopupElement::IsKeyboardFocusable() const { @@ -369,8 +338,15 @@ IntRect anchor_rect_in_screen = RoundedIntRect( owner_select_menu_element_->GetBoundingClientRectNoLifecycleUpdate()); - IntRect avail_rect = - IntRect(0, 0, window->innerWidth(), window->innerHeight()); + // Don't use the LocalDOMWindow innerHeight/innerWidth getters, as those can + // trigger a re-entrant style and layout update. + int zoomAdjustedWidth = + AdjustForAbsoluteZoom::AdjustInt(GetDocument().View()->Size().Width(), + window->GetFrame()->PageZoomFactor()); + int zoomAdjustedHeight = + AdjustForAbsoluteZoom::AdjustInt(GetDocument().View()->Size().Height(), + window->GetFrame()->PageZoomFactor()); + IntRect avail_rect = IntRect(0, 0, zoomAdjustedWidth, zoomAdjustedHeight); // Position the listbox part where is more space available. const int available_space_above = anchor_rect_in_screen.Y() - avail_rect.Y(); @@ -407,7 +383,6 @@ void HTMLPopupElement::Trace(Visitor* visitor) const { visitor->Trace(invoker_); - visitor->Trace(resize_observer_); visitor->Trace(owner_select_menu_element_); HTMLElement::Trace(visitor); }
diff --git a/third_party/blink/renderer/core/html/html_popup_element.h b/third_party/blink/renderer/core/html/html_popup_element.h index 74048912f..ae5b83a 100644 --- a/third_party/blink/renderer/core/html/html_popup_element.h +++ b/third_party/blink/renderer/core/html/html_popup_element.h
@@ -49,8 +49,6 @@ void Trace(Visitor*) const override; private: - class PopupResizeDelegate; - void ScheduleHideEvent(); void MarkStyleDirty(); void focus(const FocusParams& params) override; @@ -74,12 +72,8 @@ static const HTMLPopupElement* NearestOpenAncestralPopup(Node*); bool open_; - // |being_shown_| is set to true when .show() is called, to let the resize - // observer know not to fire. - bool being_shown_; bool had_initiallyopen_when_parsed_; WeakMember<Element> invoker_; - Member<ResizeObserver> resize_observer_; bool needs_repositioning_for_select_menu_; WeakMember<HTMLSelectMenuElement> owner_select_menu_element_;
diff --git a/third_party/blink/renderer/core/inspector/inspector_dom_snapshot_agent.cc b/third_party/blink/renderer/core/inspector/inspector_dom_snapshot_agent.cc index 3cb6859..2597a0a 100644 --- a/third_party/blink/renderer/core/inspector/inspector_dom_snapshot_agent.cc +++ b/third_party/blink/renderer/core/inspector/inspector_dom_snapshot_agent.cc
@@ -290,7 +290,7 @@ // Update layout before traversal of document so that we inspect a // current and consistent state of all trees. - inspected_frames_->Root()->View()->UpdateLifecycleToLayoutClean( + inspected_frames_->Root()->View()->UpdateLifecycleToCompositingInputsClean( DocumentUpdateReason::kInspector); strings_ = std::make_unique<protocol::Array<String>>(); @@ -679,8 +679,15 @@ if (paint_order_map_) { PaintLayer* paint_layer = layout_object->EnclosingLayer(); - int paint_order = paint_order_map_->at(paint_layer); - layout_tree_snapshot->getPaintOrders(nullptr)->emplace_back(paint_order); + const auto paint_order = paint_order_map_->find(paint_layer); + if (paint_order != paint_order_map_->end()) { + layout_tree_snapshot->getPaintOrders(nullptr)->emplace_back( + paint_order->value); + } else { + // Previously this returned the empty value if the paint order wasn't + // found. The empty value for this HashMap is 0, so just pick that here. + layout_tree_snapshot->getPaintOrders(nullptr)->emplace_back(0); + } } String text = layout_object->IsText()
diff --git a/third_party/blink/renderer/core/inspector/legacy_dom_snapshot_agent.cc b/third_party/blink/renderer/core/inspector/legacy_dom_snapshot_agent.cc index f15f711..0d81b56e 100644 --- a/third_party/blink/renderer/core/inspector/legacy_dom_snapshot_agent.cc +++ b/third_party/blink/renderer/core/inspector/legacy_dom_snapshot_agent.cc
@@ -113,7 +113,7 @@ layout_tree_nodes, std::unique_ptr<protocol::Array<protocol::DOMSnapshot::ComputedStyle>>* computed_styles) { - document->View()->UpdateLifecycleToLayoutClean( + document->View()->UpdateLifecycleToCompositingInputsClean( DocumentUpdateReason::kInspector); // Setup snapshot. dom_nodes_ = @@ -399,8 +399,9 @@ PaintLayer* paint_layer = layout_object->EnclosingLayer(); // We visited all PaintLayers when building |paint_order_map_|. - if (int paint_order = paint_order_map_->at(paint_layer)) - layout_tree_node->setPaintOrder(paint_order); + const auto paint_order = paint_order_map_->find(paint_layer); + if (paint_order != paint_order_map_->end()) + layout_tree_node->setPaintOrder(paint_order->value); } if (layout_object->IsText()) {
diff --git a/third_party/blink/renderer/core/style/applied_text_decoration.cc b/third_party/blink/renderer/core/style/applied_text_decoration.cc index 6a5fba5..9299501 100644 --- a/third_party/blink/renderer/core/style/applied_text_decoration.cc +++ b/third_party/blink/renderer/core/style/applied_text_decoration.cc
@@ -38,6 +38,19 @@ thickness_(thickness), underline_offset_(underline_offset) {} +AppliedTextDecoration::AppliedTextDecoration(TextDecoration line, + ETextDecorationStyle style, + const SVGPaint& fill, + const SVGPaint& stroke, + TextDecorationThickness thickness, + Length underline_offset) + + : lines_(static_cast<unsigned>(line)), + style_(static_cast<unsigned>(style)), + thickness_(thickness), + underline_offset_(underline_offset), + svg_paints_(std::make_unique<TextDecorationSvgPaints>(fill, stroke)) {} + AppliedTextDecoration::AppliedTextDecoration(const AppliedTextDecoration& other) : lines_(other.lines_), style_(other.style_),
diff --git a/third_party/blink/renderer/core/style/applied_text_decoration.h b/third_party/blink/renderer/core/style/applied_text_decoration.h index 3f13d968..b79dc4d 100644 --- a/third_party/blink/renderer/core/style/applied_text_decoration.h +++ b/third_party/blink/renderer/core/style/applied_text_decoration.h
@@ -24,6 +24,12 @@ Color, TextDecorationThickness, Length); + AppliedTextDecoration(TextDecoration line, + ETextDecorationStyle style, + const SVGPaint& fill, + const SVGPaint& stroke, + TextDecorationThickness thickness, + Length underline_offset); AppliedTextDecoration(const AppliedTextDecoration& other); ~AppliedTextDecoration(); AppliedTextDecoration& operator=(const AppliedTextDecoration& other);
diff --git a/third_party/blink/renderer/core/style/applied_text_decoration_test.cc b/third_party/blink/renderer/core/style/applied_text_decoration_test.cc new file mode 100644 index 0000000..c3a5d77 --- /dev/null +++ b/third_party/blink/renderer/core/style/applied_text_decoration_test.cc
@@ -0,0 +1,187 @@ +// 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 "third_party/blink/renderer/core/style/applied_text_decoration.h" + +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/renderer/core/style/computed_style_base_constants.h" +#include "third_party/blink/renderer/core/style/svg_paint.h" +#include "third_party/blink/renderer/core/style/text_decoration_thickness.h" + +namespace blink { + +TEST(AppliedTextDecorationTest, OperatorEqual) { + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length()); + AppliedTextDecoration instance2( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length()); + EXPECT_EQ(instance1, instance2); + } + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, SVGPaint(), + SVGPaint(), TextDecorationThickness(Length()), Length()); + AppliedTextDecoration instance2( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, SVGPaint(), + SVGPaint(), TextDecorationThickness(Length()), Length()); + EXPECT_EQ(instance1, instance2); + } + + // Only TextDecoration is different. + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length()); + AppliedTextDecoration instance2( + TextDecoration::kOverline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length()); + EXPECT_NE(instance1, instance2); + } + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, SVGPaint(), + SVGPaint(), TextDecorationThickness(Length()), Length()); + AppliedTextDecoration instance2( + TextDecoration::kLineThrough, ETextDecorationStyle::kSolid, SVGPaint(), + SVGPaint(), TextDecorationThickness(Length()), Length()); + EXPECT_NE(instance1, instance2); + } + + // Only ETextDecorationStyle is different. + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length()); + AppliedTextDecoration instance2( + TextDecoration::kUnderline, ETextDecorationStyle::kDouble, Color(), + TextDecorationThickness(Length()), Length()); + EXPECT_NE(instance1, instance2); + } + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, SVGPaint(), + SVGPaint(), TextDecorationThickness(Length()), Length()); + AppliedTextDecoration instance2( + TextDecoration::kUnderline, ETextDecorationStyle::kWavy, SVGPaint(), + SVGPaint(), TextDecorationThickness(Length()), Length()); + EXPECT_NE(instance1, instance2); + } + + // Only Color is different. + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length()); + AppliedTextDecoration instance2( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, + Color(Color::kBlack), TextDecorationThickness(Length()), Length()); + EXPECT_NE(instance1, instance2); + } + + // Only |fill| is different. + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, SVGPaint(), + SVGPaint(), TextDecorationThickness(Length()), Length()); + SVGPaint fill; + fill.type = SVG_PAINTTYPE_COLOR; + AppliedTextDecoration instance2( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, fill, + SVGPaint(), TextDecorationThickness(Length()), Length()); + EXPECT_NE(instance1, instance2); + } + + // Only |stroke| is different. + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, SVGPaint(), + SVGPaint(), TextDecorationThickness(Length()), Length()); + SVGPaint stroke; + stroke.type = SVG_PAINTTYPE_COLOR; + AppliedTextDecoration instance2( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, SVGPaint(), + stroke, TextDecorationThickness(Length()), Length()); + EXPECT_NE(instance1, instance2); + } + + // Color vs. SVGPaint + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length()); + AppliedTextDecoration instance2( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, SVGPaint(), + SVGPaint(), TextDecorationThickness(Length()), Length()); + EXPECT_NE(instance1, instance2); + } + + // Only TextDecorationThickness is different. + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length(42, Length::kFixed)), Length()); + AppliedTextDecoration instance2( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length()); + EXPECT_NE(instance1, instance2); + } + + // Only |underline_offset_| is different. + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length(13, Length::kPercent)); + AppliedTextDecoration instance2( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length(13, Length::kFixed)); + EXPECT_NE(instance1, instance2); + } +} + +TEST(AppliedTextDecorationTest, CopyConstructor) { + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length()); + AppliedTextDecoration instance2(instance1); + EXPECT_EQ(instance1, instance2); + } + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, SVGPaint(), + SVGPaint(), TextDecorationThickness(Length()), Length()); + AppliedTextDecoration instance2(instance1); + EXPECT_EQ(instance1, instance2); + } +} + +TEST(AppliedTextDecorationTest, Assignment) { + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length()); + AppliedTextDecoration instance2( + TextDecoration::kOverline, ETextDecorationStyle::kSolid, Color(), + TextDecorationThickness(Length()), Length()); + EXPECT_NE(instance1, instance2); + instance2 = instance1; + EXPECT_EQ(instance1, instance2); + } + { + AppliedTextDecoration instance1( + TextDecoration::kUnderline, ETextDecorationStyle::kSolid, SVGPaint(), + SVGPaint(), TextDecorationThickness(Length()), Length()); + AppliedTextDecoration instance2( + TextDecoration::kBlink, ETextDecorationStyle::kSolid, SVGPaint(), + SVGPaint(), TextDecorationThickness(Length()), Length()); + EXPECT_NE(instance1, instance2); + instance1 = instance2; + EXPECT_EQ(instance1, instance2); + } +} + +} // namespace blink
diff --git a/third_party/blink/renderer/core/style/build.gni b/third_party/blink/renderer/core/style/build.gni index 6c6ebaf..69fc284 100644 --- a/third_party/blink/renderer/core/style/build.gni +++ b/third_party/blink/renderer/core/style/build.gni
@@ -112,6 +112,7 @@ ] blink_core_tests_style = [ + "applied_text_decoration_test.cc", "border_value_test.cc", "computed_style_test.cc", "filter_operations_test.cc",
diff --git a/third_party/blink/renderer/core/style/computed_style.cc b/third_party/blink/renderer/core/style/computed_style.cc index 4aaff104..ac87a4b 100644 --- a/third_party/blink/renderer/core/style/computed_style.cc +++ b/third_party/blink/renderer/core/style/computed_style.cc
@@ -2230,6 +2230,14 @@ GetTextDecorationThickness(), TextUnderlineOffset())); } +void ComputedStyle::ApplySvgTextDecorations() { + if (GetTextDecoration() == TextDecoration::kNone) + return; + AddAppliedTextDecoration(AppliedTextDecoration( + GetTextDecoration(), TextDecorationStyle(), FillPaint(), StrokePaint(), + GetTextDecorationThickness(), TextUnderlineOffset())); +} + void ComputedStyle::ClearAppliedTextDecorations() { SetHasSimpleUnderlineInternal(false);
diff --git a/third_party/blink/renderer/core/style/computed_style.h b/third_party/blink/renderer/core/style/computed_style.h index ab2e30e3..fdf55f21 100644 --- a/third_party/blink/renderer/core/style/computed_style.h +++ b/third_party/blink/renderer/core/style/computed_style.h
@@ -2173,6 +2173,7 @@ bool TextDecorationVisualOverflowEqual(const ComputedStyle& o) const; void ApplyTextDecorations(const Color& parent_text_decoration_color, bool override_existing_colors); + void ApplySvgTextDecorations(); void ClearAppliedTextDecorations(); void RestoreParentTextDecorations(const ComputedStyle& parent_style); CORE_EXPORT const Vector<AppliedTextDecoration>& AppliedTextDecorations()
diff --git a/third_party/blink/renderer/modules/accessibility/ax_image_map_link.h b/third_party/blink/renderer/modules/accessibility/ax_image_map_link.h index c43de037..cebd74e 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_image_map_link.h +++ b/third_party/blink/renderer/modules/accessibility/ax_image_map_link.h
@@ -41,6 +41,10 @@ class AXImageMapLink final : public AXNodeObject { public: explicit AXImageMapLink(HTMLAreaElement*, AXObjectCacheImpl&); + + AXImageMapLink(const AXImageMapLink&) = delete; + AXImageMapLink& operator=(const AXImageMapLink&) = delete; + ~AXImageMapLink() override; void Trace(Visitor*) const override; @@ -72,8 +76,6 @@ private: bool IsImageMapLink() const override; - - DISALLOW_COPY_AND_ASSIGN(AXImageMapLink); }; template <>
diff --git a/third_party/blink/renderer/modules/accessibility/ax_layout_object.h b/third_party/blink/renderer/modules/accessibility/ax_layout_object.h index 44bf3fd..4affd2f 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_layout_object.h +++ b/third_party/blink/renderer/modules/accessibility/ax_layout_object.h
@@ -44,6 +44,10 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { public: AXLayoutObject(LayoutObject*, AXObjectCacheImpl&); + + AXLayoutObject(const AXLayoutObject&) = delete; + AXLayoutObject& operator=(const AXLayoutObject&) = delete; + ~AXLayoutObject() override; void Trace(Visitor*) const override; @@ -140,8 +144,6 @@ LayoutRect ComputeElementRect() const; bool IsPlaceholder() const; - - DISALLOW_COPY_AND_ASSIGN(AXLayoutObject); }; template <>
diff --git a/third_party/blink/renderer/modules/accessibility/ax_list_box.h b/third_party/blink/renderer/modules/accessibility/ax_list_box.h index bebd874..1e1b228 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_list_box.h +++ b/third_party/blink/renderer/modules/accessibility/ax_list_box.h
@@ -39,6 +39,10 @@ class AXListBox final : public AXLayoutObject { public: AXListBox(LayoutObject*, AXObjectCacheImpl&); + + AXListBox(const AXListBox&) = delete; + AXListBox& operator=(const AXListBox&) = delete; + ~AXListBox() override; ax::mojom::blink::Role NativeRoleIgnoringAria() const final; @@ -49,8 +53,6 @@ private: int active_index_; - - DISALLOW_COPY_AND_ASSIGN(AXListBox); }; template <>
diff --git a/third_party/blink/renderer/modules/accessibility/ax_list_box_option.h b/third_party/blink/renderer/modules/accessibility/ax_list_box_option.h index 345992a..db8ed43 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_list_box_option.h +++ b/third_party/blink/renderer/modules/accessibility/ax_list_box_option.h
@@ -41,6 +41,10 @@ class AXListBoxOption final : public AXLayoutObject { public: AXListBoxOption(LayoutObject*, AXObjectCacheImpl&); + + AXListBoxOption(const AXListBoxOption&) = delete; + AXListBoxOption& operator=(const AXListBoxOption&) = delete; + ~AXListBoxOption() override; bool IsAXListBoxOption() const override { return true; } @@ -61,8 +65,6 @@ bool ComputeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override; HTMLSelectElement* ListBoxOptionParentNode() const; - - DISALLOW_COPY_AND_ASSIGN(AXListBoxOption); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/accessibility/ax_media_element.h b/third_party/blink/renderer/modules/accessibility/ax_media_element.h index e58ceb9..ea73c52 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_media_element.h +++ b/third_party/blink/renderer/modules/accessibility/ax_media_element.h
@@ -18,6 +18,11 @@ static AXObject* Create(LayoutObject*, AXObjectCacheImpl&); AccessibilityMediaElement(LayoutObject*, AXObjectCacheImpl&); + + AccessibilityMediaElement(const AccessibilityMediaElement&) = delete; + AccessibilityMediaElement& operator=(const AccessibilityMediaElement&) = + delete; + ~AccessibilityMediaElement() override = default; // AXLayoutObject overrides. @@ -35,8 +40,6 @@ protected: bool IsUnplayable() const; - - DISALLOW_COPY_AND_ASSIGN(AccessibilityMediaElement); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/accessibility/ax_menu_list_option.h b/third_party/blink/renderer/modules/accessibility/ax_menu_list_option.h index 3623560..e35d603 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_menu_list_option.h +++ b/third_party/blink/renderer/modules/accessibility/ax_menu_list_option.h
@@ -37,6 +37,10 @@ class AXMenuListOption final : public AXNodeObject { public: AXMenuListOption(HTMLOptionElement*, AXObjectCacheImpl&); + + AXMenuListOption(const AXMenuListOption&) = delete; + AXMenuListOption& operator=(const AXMenuListOption&) = delete; + ~AXMenuListOption() override = default; // For an <option>/<optgroup>, return an AXObject* for its popup, if any, @@ -67,8 +71,6 @@ AXRelatedObjectVector*, NameSources*) const override; bool ComputeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override; - - DISALLOW_COPY_AND_ASSIGN(AXMenuListOption); }; template <>
diff --git a/third_party/blink/renderer/modules/accessibility/ax_mock_object.h b/third_party/blink/renderer/modules/accessibility/ax_mock_object.h index a03d6af..0ddc90c 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_mock_object.h +++ b/third_party/blink/renderer/modules/accessibility/ax_mock_object.h
@@ -44,6 +44,9 @@ explicit AXMockObject(AXObjectCacheImpl&); public: + AXMockObject(const AXMockObject&) = delete; + AXMockObject& operator=(const AXMockObject&) = delete; + ~AXMockObject() override; // AXObject overrides. @@ -54,8 +57,6 @@ private: bool ComputeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override; - - DISALLOW_COPY_AND_ASSIGN(AXMockObject); }; template <>
diff --git a/third_party/blink/renderer/modules/accessibility/ax_node_object.h b/third_party/blink/renderer/modules/accessibility/ax_node_object.h index 1fb6e81..06bc3b6 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_node_object.h +++ b/third_party/blink/renderer/modules/accessibility/ax_node_object.h
@@ -46,6 +46,10 @@ class MODULES_EXPORT AXNodeObject : public AXObject { public: AXNodeObject(Node*, AXObjectCacheImpl&); + + AXNodeObject(const AXNodeObject&) = delete; + AXNodeObject& operator=(const AXNodeObject&) = delete; + ~AXNodeObject() override; static absl::optional<String> GetCSSAltText(const Node*); @@ -322,8 +326,6 @@ static bool IsRedundantLabel(HTMLLabelElement* label); Member<Node> node_; - - DISALLOW_COPY_AND_ASSIGN(AXNodeObject); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.h b/third_party/blink/renderer/modules/accessibility/ax_object.h index 5157649..da615686 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object.h +++ b/third_party/blink/renderer/modules/accessibility/ax_object.h
@@ -262,6 +262,9 @@ #endif public: + AXObject(const AXObject&) = delete; + AXObject& operator=(const AXObject&) = delete; + virtual ~AXObject(); virtual void Trace(Visitor*) const; @@ -1436,8 +1439,6 @@ uint32_t max_len = kMaxStringAttributeLength) const; static unsigned number_of_live_ax_objects_; - - DISALLOW_COPY_AND_ASSIGN(AXObject); }; MODULES_EXPORT bool operator==(const AXObject& first, const AXObject& second);
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h index 64cb1bad4..fc6be6e 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h +++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h
@@ -69,6 +69,10 @@ static AXObjectCache* Create(Document&, const ui::AXMode&); AXObjectCacheImpl(Document&, const ui::AXMode&); + + AXObjectCacheImpl(const AXObjectCacheImpl&) = delete; + AXObjectCacheImpl& operator=(const AXObjectCacheImpl&) = delete; + ~AXObjectCacheImpl() override; void Trace(Visitor*) const override; @@ -687,8 +691,6 @@ // instead. static bool use_ax_menu_list_; - DISALLOW_COPY_AND_ASSIGN(AXObjectCacheImpl); - FRIEND_TEST_ALL_PREFIXES(AccessibilityTest, PauseUpdatesAfterMaxNumberQueued); };
diff --git a/third_party/blink/renderer/modules/accessibility/ax_relation_cache.h b/third_party/blink/renderer/modules/accessibility/ax_relation_cache.h index 5d7bb01..8b1b471 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_relation_cache.h +++ b/third_party/blink/renderer/modules/accessibility/ax_relation_cache.h
@@ -20,6 +20,10 @@ public: explicit AXRelationCache(AXObjectCacheImpl*); + + AXRelationCache(const AXRelationCache&) = delete; + AXRelationCache& operator=(const AXRelationCache&) = delete; + virtual ~AXRelationCache(); // @@ -178,8 +182,6 @@ // Do an initial scan of the document to find any relationships. // We'll catch any subsequent ones when attributes change. void DoInitialDocumentScan(); - - DISALLOW_COPY_AND_ASSIGN(AXRelationCache); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/accessibility/ax_slider.h b/third_party/blink/renderer/modules/accessibility/ax_slider.h index a743ce5..bdb97a2b 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_slider.h +++ b/third_party/blink/renderer/modules/accessibility/ax_slider.h
@@ -41,6 +41,10 @@ class AXSlider : public AXLayoutObject { public: AXSlider(LayoutObject*, AXObjectCacheImpl&); + + AXSlider(const AXSlider&) = delete; + AXSlider& operator=(const AXSlider&) = delete; + ~AXSlider() override = default; private: @@ -52,8 +56,6 @@ bool OnNativeSetValueAction(const String&) final; AccessibilityOrientation Orientation() const final; - - DISALLOW_COPY_AND_ASSIGN(AXSlider); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/accessibility/ax_validation_message.h b/third_party/blink/renderer/modules/accessibility/ax_validation_message.h index f0b2007..c767b0e 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_validation_message.h +++ b/third_party/blink/renderer/modules/accessibility/ax_validation_message.h
@@ -20,6 +20,10 @@ class AXValidationMessage final : public AXMockObject { public: explicit AXValidationMessage(AXObjectCacheImpl&); + + AXValidationMessage(const AXValidationMessage&) = delete; + AXValidationMessage& operator=(const AXValidationMessage&) = delete; + ~AXValidationMessage() override; private: @@ -46,8 +50,6 @@ ax::mojom::blink::Role NativeRoleIgnoringAria() const override; ListedElement* RelatedFormControlIfVisible() const; - - DISALLOW_COPY_AND_ASSIGN(AXValidationMessage); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/animationworklet/animation_worklet.h b/third_party/blink/renderer/modules/animationworklet/animation_worklet.h index cd8a4e99..2526488 100644 --- a/third_party/blink/renderer/modules/animationworklet/animation_worklet.h +++ b/third_party/blink/renderer/modules/animationworklet/animation_worklet.h
@@ -24,6 +24,10 @@ class MODULES_EXPORT AnimationWorklet final : public Worklet { public: explicit AnimationWorklet(LocalDOMWindow&); + + AnimationWorklet(const AnimationWorklet&) = delete; + AnimationWorklet& operator=(const AnimationWorklet&) = delete; + ~AnimationWorklet() override; WorkletAnimationId NextWorkletAnimationId(); @@ -40,8 +44,6 @@ WorkletGlobalScopeProxy* CreateGlobalScope() final; Member<AnimationWorkletProxyClient> proxy_client_; - - DISALLOW_COPY_AND_ASSIGN(AnimationWorklet); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/audio_output_devices/html_media_element_audio_output_device.cc b/third_party/blink/renderer/modules/audio_output_devices/html_media_element_audio_output_device.cc index c2b6710..dae62d5 100644 --- a/third_party/blink/renderer/modules/audio_output_devices/html_media_element_audio_output_device.cc +++ b/third_party/blink/renderer/modules/audio_output_devices/html_media_element_audio_output_device.cc
@@ -55,6 +55,10 @@ HTMLMediaElement&, const String& sink_id); SetSinkIdResolver(ScriptState*, HTMLMediaElement&, const String& sink_id); + + SetSinkIdResolver(const SetSinkIdResolver&) = delete; + SetSinkIdResolver& operator=(const SetSinkIdResolver&) = delete; + ~SetSinkIdResolver() override = default; void StartAsync(); @@ -69,8 +73,6 @@ Member<HTMLMediaElement> element_; String sink_id_; - - DISALLOW_COPY_AND_ASSIGN(SetSinkIdResolver); }; SetSinkIdResolver* SetSinkIdResolver::Create(ScriptState* script_state,
diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetch_bridge.h b/third_party/blink/renderer/modules/background_fetch/background_fetch_bridge.h index fa156f30..fbab4b8b 100644 --- a/third_party/blink/renderer/modules/background_fetch/background_fetch_bridge.h +++ b/third_party/blink/renderer/modules/background_fetch/background_fetch_bridge.h
@@ -39,6 +39,10 @@ static BackgroundFetchBridge* From(ServiceWorkerRegistration* registration); explicit BackgroundFetchBridge(ServiceWorkerRegistration& registration); + + BackgroundFetchBridge(const BackgroundFetchBridge&) = delete; + BackgroundFetchBridge& operator=(const BackgroundFetchBridge&) = delete; + virtual ~BackgroundFetchBridge(); void Trace(Visitor* visitor) const override; @@ -79,8 +83,6 @@ HeapMojoRemote<mojom::blink::BackgroundFetchService> background_fetch_service_; - - DISALLOW_COPY_AND_ASSIGN(BackgroundFetchBridge); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/background_fetch/service_worker_registration_background_fetch.h b/third_party/blink/renderer/modules/background_fetch/service_worker_registration_background_fetch.h index 371f0cd..1e5b2bf 100644 --- a/third_party/blink/renderer/modules/background_fetch/service_worker_registration_background_fetch.h +++ b/third_party/blink/renderer/modules/background_fetch/service_worker_registration_background_fetch.h
@@ -23,6 +23,12 @@ explicit ServiceWorkerRegistrationBackgroundFetch( ServiceWorkerRegistration* registration); + + ServiceWorkerRegistrationBackgroundFetch( + const ServiceWorkerRegistrationBackgroundFetch&) = delete; + ServiceWorkerRegistrationBackgroundFetch& operator=( + const ServiceWorkerRegistrationBackgroundFetch&) = delete; + virtual ~ServiceWorkerRegistrationBackgroundFetch(); static ServiceWorkerRegistrationBackgroundFetch& From( @@ -36,8 +42,6 @@ private: Member<BackgroundFetchManager> background_fetch_manager_; - - DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistrationBackgroundFetch); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/background_sync/service_worker_registration_sync.h b/third_party/blink/renderer/modules/background_sync/service_worker_registration_sync.h index 56b652f..e5df4929 100644 --- a/third_party/blink/renderer/modules/background_sync/service_worker_registration_sync.h +++ b/third_party/blink/renderer/modules/background_sync/service_worker_registration_sync.h
@@ -31,6 +31,11 @@ explicit ServiceWorkerRegistrationSync( ServiceWorkerRegistration* registration); + + ServiceWorkerRegistrationSync(const ServiceWorkerRegistrationSync&) = delete; + ServiceWorkerRegistrationSync& operator=( + const ServiceWorkerRegistrationSync&) = delete; + virtual ~ServiceWorkerRegistrationSync(); PeriodicSyncManager* periodicSync(); @@ -41,8 +46,6 @@ private: Member<SyncManager> sync_manager_; Member<PeriodicSyncManager> periodic_sync_manager_; - - DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistrationSync); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/broadcastchannel/broadcast_channel.h b/third_party/blink/renderer/modules/broadcastchannel/broadcast_channel.h index 535c91c..883e092 100644 --- a/third_party/blink/renderer/modules/broadcastchannel/broadcast_channel.h +++ b/third_party/blink/renderer/modules/broadcastchannel/broadcast_channel.h
@@ -32,6 +32,10 @@ ExceptionState&); BroadcastChannel(ExecutionContext*, const String& name); + + BroadcastChannel(const BroadcastChannel&) = delete; + BroadcastChannel& operator=(const BroadcastChannel&) = delete; + ~BroadcastChannel() override; void Dispose(); @@ -73,8 +77,6 @@ // Notifies the scheduler that a broadcast channel is active. FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle feature_handle_for_scheduler_; - - DISALLOW_COPY_AND_ASSIGN(BroadcastChannel); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/cache_storage/cache_storage.h b/third_party/blink/renderer/modules/cache_storage/cache_storage.h index 5a4e763..ee35fcb 100644 --- a/third_party/blink/renderer/modules/cache_storage/cache_storage.h +++ b/third_party/blink/renderer/modules/cache_storage/cache_storage.h
@@ -32,6 +32,10 @@ public: CacheStorage(ExecutionContext*, GlobalFetch::ScopedFetcher*); + + CacheStorage(const CacheStorage&) = delete; + CacheStorage& operator=(const CacheStorage&) = delete; + ~CacheStorage() override; ScriptPromise open(ScriptState*, const String& cache_name); @@ -61,8 +65,6 @@ HeapMojoRemote<mojom::blink::CacheStorage> cache_storage_remote_; absl::optional<bool> allowed_; bool ever_used_; - - DISALLOW_COPY_AND_ASSIGN(CacheStorage); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/cache_storage/inspector_cache_storage_agent.h b/third_party/blink/renderer/modules/cache_storage/inspector_cache_storage_agent.h index f0c46d6..959ee8a 100644 --- a/third_party/blink/renderer/modules/cache_storage/inspector_cache_storage_agent.h +++ b/third_party/blink/renderer/modules/cache_storage/inspector_cache_storage_agent.h
@@ -25,6 +25,11 @@ using CachesMap = HashMap<String, mojo::Remote<mojom::blink::CacheStorage>>; explicit InspectorCacheStorageAgent(InspectedFrames*); + + InspectorCacheStorageAgent(const InspectorCacheStorageAgent&) = delete; + InspectorCacheStorageAgent& operator=(const InspectorCacheStorageAgent&) = + delete; + ~InspectorCacheStorageAgent() override; void Trace(Visitor*) const override; @@ -51,8 +56,6 @@ Member<InspectedFrames> frames_; CachesMap caches_; - - DISALLOW_COPY_AND_ASSIGN(InspectorCacheStorageAgent); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.h b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.h index 97775852..5442f6b 100644 --- a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.h +++ b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.h
@@ -32,6 +32,9 @@ class MODULES_EXPORT BaseRenderingContext2D : public CanvasPath { public: + BaseRenderingContext2D(const BaseRenderingContext2D&) = delete; + BaseRenderingContext2D& operator=(const BaseRenderingContext2D&) = delete; + ~BaseRenderingContext2D() override; V8UnionCSSColorValueOrCanvasGradientOrCanvasPatternOrString* strokeStyle() @@ -632,8 +635,6 @@ CanvasImageSource*); bool origin_tainted_by_content_; - - DISALLOW_COPY_AND_ASSIGN(BaseRenderingContext2D); }; ALWAYS_INLINE void BaseRenderingContext2D::CheckOverdraw(
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h index d1d81b5a..2b59d13 100644 --- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h +++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h
@@ -73,6 +73,10 @@ class Factory : public CanvasRenderingContextFactory { public: Factory() = default; + + Factory(const Factory&) = delete; + Factory& operator=(const Factory&) = delete; + ~Factory() override = default; CanvasRenderingContext* Create( @@ -83,9 +87,6 @@ const override { return CanvasRenderingContext::CanvasRenderingAPI::k2D; } - - private: - DISALLOW_COPY_AND_ASSIGN(Factory); }; CanvasRenderingContext2D(HTMLCanvasElement*,
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_state.h b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_state.h index 7c12c40..f295df4 100644 --- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_state.h +++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_state.h
@@ -47,6 +47,11 @@ CanvasRenderingContext2DState(const CanvasRenderingContext2DState&, ClipListCopyMode, SaveType); + + CanvasRenderingContext2DState(const CanvasRenderingContext2DState&) = delete; + CanvasRenderingContext2DState& operator=( + const CanvasRenderingContext2DState&) = delete; + ~CanvasRenderingContext2DState() override; void Trace(Visitor*) const override; @@ -317,8 +322,6 @@ const SaveType save_type_ = SaveType::kInitial; - DISALLOW_COPY_AND_ASSIGN(CanvasRenderingContext2DState); - // Some endlayer calls need to restore to a specific save count. // If no such restore is needed, restore_to_count_ is set to nullopt. absl::optional<int> restore_to_count_ = absl::nullopt;
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/path_2d.h b/third_party/blink/renderer/modules/canvas/canvas2d/path_2d.h index aa38648f..a564620 100644 --- a/third_party/blink/renderer/modules/canvas/canvas2d/path_2d.h +++ b/third_party/blink/renderer/modules/canvas/canvas2d/path_2d.h
@@ -102,10 +102,11 @@ identifiability_study_helper_.SetExecutionContext(context); BuildPathFromString(path_data, path_); } - ~Path2D() override = default; - private: - DISALLOW_COPY_AND_ASSIGN(Path2D); + Path2D(const Path2D&) = delete; + Path2D& operator=(const Path2D&) = delete; + + ~Path2D() override = default; }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context.h b/third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context.h index 730c9b1f..b9d6de8 100644 --- a/third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context.h +++ b/third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context.h
@@ -25,6 +25,10 @@ class Factory : public CanvasRenderingContextFactory { public: Factory() = default; + + Factory(const Factory&) = delete; + Factory& operator=(const Factory&) = delete; + ~Factory() override = default; CanvasRenderingContext* Create( @@ -34,9 +38,6 @@ const override { return CanvasRenderingContext::CanvasRenderingAPI::kBitmaprenderer; } - - private: - DISALLOW_COPY_AND_ASSIGN(Factory); }; ImageBitmapRenderingContext(CanvasRenderingContextHost*,
diff --git a/third_party/blink/renderer/modules/clipboard/clipboard_promise.h b/third_party/blink/renderer/modules/clipboard/clipboard_promise.h index c2f0cbd0f..03559c51 100644 --- a/third_party/blink/renderer/modules/clipboard/clipboard_promise.h +++ b/third_party/blink/renderer/modules/clipboard/clipboard_promise.h
@@ -42,6 +42,10 @@ const String&); ClipboardPromise(ExecutionContext*, ScriptState*); + + ClipboardPromise(const ClipboardPromise&) = delete; + ClipboardPromise& operator=(const ClipboardPromise&) = delete; + ~ClipboardPromise() override; // Completes current write and starts next write. @@ -107,8 +111,6 @@ // Because v8 is thread-hostile, ensures that all interactions with // ScriptState and ScriptPromiseResolver occur on the main thread. SEQUENCE_CHECKER(sequence_checker_); - - DISALLOW_COPY_AND_ASSIGN(ClipboardPromise); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/compression/deflate_transformer.h b/third_party/blink/renderer/modules/compression/deflate_transformer.h index 26d40a2..d1af054 100644 --- a/third_party/blink/renderer/modules/compression/deflate_transformer.h +++ b/third_party/blink/renderer/modules/compression/deflate_transformer.h
@@ -18,6 +18,10 @@ class DeflateTransformer final : public TransformStreamTransformer { public: DeflateTransformer(ScriptState*, CompressionFormat, int level); + + DeflateTransformer(const DeflateTransformer&) = delete; + DeflateTransformer& operator=(const DeflateTransformer&) = delete; + ~DeflateTransformer() override; ScriptPromise Transform(v8::Local<v8::Value> chunk, @@ -50,8 +54,6 @@ // This buffer size has been experimentally verified to be optimal. static constexpr wtf_size_t kBufferSize = 16384; - - DISALLOW_COPY_AND_ASSIGN(DeflateTransformer); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/compression/inflate_transformer.h b/third_party/blink/renderer/modules/compression/inflate_transformer.h index b602cdc..d450f85 100644 --- a/third_party/blink/renderer/modules/compression/inflate_transformer.h +++ b/third_party/blink/renderer/modules/compression/inflate_transformer.h
@@ -18,6 +18,10 @@ class InflateTransformer final : public TransformStreamTransformer { public: InflateTransformer(ScriptState*, CompressionFormat); + + InflateTransformer(const InflateTransformer&) = delete; + InflateTransformer& operator=(const InflateTransformer&) = delete; + ~InflateTransformer() override; ScriptPromise Transform(v8::Local<v8::Value> chunk, @@ -55,8 +59,6 @@ // This buffer size has been experimentally verified to be optimal. static constexpr wtf_size_t kBufferSize = 65536; - - DISALLOW_COPY_AND_ASSIGN(InflateTransformer); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/credentialmanager/authenticator_assertion_response.cc b/third_party/blink/renderer/modules/credentialmanager/authenticator_assertion_response.cc index 8bdbe4c..afed7aa 100644 --- a/third_party/blink/renderer/modules/credentialmanager/authenticator_assertion_response.cc +++ b/third_party/blink/renderer/modules/credentialmanager/authenticator_assertion_response.cc
@@ -20,13 +20,11 @@ const Vector<uint8_t> client_data_json, const Vector<uint8_t> authenticator_data, const Vector<uint8_t> signature, - const absl::optional<String> transport, const absl::optional<Vector<uint8_t>> optional_user_handle) : AuthenticatorAssertionResponse( VectorToDOMArrayBuffer(client_data_json), VectorToDOMArrayBuffer(authenticator_data), VectorToDOMArrayBuffer(signature), - std::move(transport), optional_user_handle && optional_user_handle->size() > 0 ? VectorToDOMArrayBuffer(std::move(*optional_user_handle)) : nullptr) {} @@ -35,12 +33,10 @@ DOMArrayBuffer* client_data_json, DOMArrayBuffer* authenticator_data, DOMArrayBuffer* signature, - absl::optional<String> transport, DOMArrayBuffer* user_handle) : AuthenticatorResponse(client_data_json), authenticator_data_(authenticator_data), signature_(signature), - transport_(std::move(transport)), user_handle_(user_handle) {} AuthenticatorAssertionResponse::~AuthenticatorAssertionResponse() = default;
diff --git a/third_party/blink/renderer/modules/credentialmanager/authenticator_assertion_response.h b/third_party/blink/renderer/modules/credentialmanager/authenticator_assertion_response.h index 39ac1c47..ab33675 100644 --- a/third_party/blink/renderer/modules/credentialmanager/authenticator_assertion_response.h +++ b/third_party/blink/renderer/modules/credentialmanager/authenticator_assertion_response.h
@@ -12,7 +12,6 @@ #include "third_party/blink/renderer/modules/credentialmanager/authenticator_response.h" #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" -#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" #include "third_party/blink/renderer/platform/wtf/vector.h" namespace blink { @@ -30,13 +29,11 @@ const Vector<uint8_t> client_data_json, const Vector<uint8_t> authenticator_data, const Vector<uint8_t> signature, - const absl::optional<String> transport, const absl::optional<Vector<uint8_t>> optional_user_handle); AuthenticatorAssertionResponse(DOMArrayBuffer* client_data_json, DOMArrayBuffer* authenticator_data, DOMArrayBuffer* signature, - absl::optional<String> transport, DOMArrayBuffer* user_handle); ~AuthenticatorAssertionResponse() override; @@ -46,8 +43,6 @@ DOMArrayBuffer* signature() const { return signature_.Get(); } - absl::optional<String> transport() const { return transport_; } - DOMArrayBuffer* userHandle() const { return user_handle_.Get(); } void Trace(Visitor*) const override; @@ -55,7 +50,6 @@ private: const Member<DOMArrayBuffer> authenticator_data_; const Member<DOMArrayBuffer> signature_; - const absl::optional<String> transport_; const Member<DOMArrayBuffer> user_handle_; };
diff --git a/third_party/blink/renderer/modules/credentialmanager/authenticator_assertion_response.idl b/third_party/blink/renderer/modules/credentialmanager/authenticator_assertion_response.idl index 593dfbe..26700ef 100644 --- a/third_party/blink/renderer/modules/credentialmanager/authenticator_assertion_response.idl +++ b/third_party/blink/renderer/modules/credentialmanager/authenticator_assertion_response.idl
@@ -11,6 +11,5 @@ ] interface AuthenticatorAssertionResponse : AuthenticatorResponse { [SameObject] readonly attribute ArrayBuffer authenticatorData; [SameObject] readonly attribute ArrayBuffer signature; - [RuntimeEnabled=WebAuthAssertionTransport, SameObject] readonly attribute DOMString? transport; [SameObject] readonly attribute ArrayBuffer? userHandle; };
diff --git a/third_party/blink/renderer/modules/credentialmanager/credentials_container.cc b/third_party/blink/renderer/modules/credentialmanager/credentials_container.cc index e11d1bf..6f182e7 100644 --- a/third_party/blink/renderer/modules/credentialmanager/credentials_container.cc +++ b/third_party/blink/renderer/modules/credentialmanager/credentials_container.cc
@@ -590,9 +590,9 @@ extension_outputs->setLargeBlob(large_blob_outputs); } resolver->Resolve(MakeGarbageCollected<PublicKeyCredential>( - credential->info->id, raw_id, authenticator_response, extension_outputs)); + credential->info->id, raw_id, authenticator_response, + credential->has_transport, credential->transport, extension_outputs)); } - bool IsForPayment(const CredentialCreationOptions* options, ExecutionContext* context) { return RuntimeEnabledFeatures::SecurePaymentConfirmationEnabled(context) && @@ -664,10 +664,6 @@ std::move(credential->info->client_data_json), std::move(credential->info->authenticator_data), std::move(credential->signature), - credential->has_transport - ? absl::make_optional( - mojo::ConvertTo<String>(credential->transport)) - : absl::nullopt, credential->user_handle); AuthenticationExtensionsClientOutputs* extension_outputs = @@ -708,7 +704,8 @@ resolver->Resolve(MakeGarbageCollected<PublicKeyCredential>( credential->info->id, VectorToDOMArrayBuffer(std::move(credential->info->raw_id)), - authenticator_response, extension_outputs)); + authenticator_response, credential->has_transport, + credential->transport, extension_outputs)); return; } DCHECK(!credential);
diff --git a/third_party/blink/renderer/modules/credentialmanager/credentials_container_test.cc b/third_party/blink/renderer/modules/credentialmanager/credentials_container_test.cc index 7b2b6340..ea49f95 100644 --- a/third_party/blink/renderer/modules/credentialmanager/credentials_container_test.cc +++ b/third_party/blink/renderer/modules/credentialmanager/credentials_container_test.cc
@@ -47,6 +47,10 @@ class MockCredentialManager : public mojom::blink::CredentialManager { public: MockCredentialManager() {} + + MockCredentialManager(const MockCredentialManager&) = delete; + MockCredentialManager& operator=(const MockCredentialManager&) = delete; + ~MockCredentialManager() override {} void Bind(mojo::PendingReceiver<::blink::mojom::blink::CredentialManager> @@ -96,8 +100,6 @@ mojo::Receiver<::blink::mojom::blink::CredentialManager> receiver_{this}; GetCallback get_callback_; - - DISALLOW_COPY_AND_ASSIGN(MockCredentialManager); }; class CredentialManagerTestingContext {
diff --git a/third_party/blink/renderer/modules/credentialmanager/public_key_credential.cc b/third_party/blink/renderer/modules/credentialmanager/public_key_credential.cc index 7461beab..c66341f 100644 --- a/third_party/blink/renderer/modules/credentialmanager/public_key_credential.cc +++ b/third_party/blink/renderer/modules/credentialmanager/public_key_credential.cc
@@ -33,13 +33,29 @@ const String& id, DOMArrayBuffer* raw_id, AuthenticatorResponse* response, + bool has_transport, + mojom::AuthenticatorTransport transport, const AuthenticationExtensionsClientOutputs* extension_outputs, const String& type) : Credential(id, type.IsEmpty() ? kPublicKeyCredentialType : type), raw_id_(raw_id), response_(response), + authenticatorAttachment_( + GetAuthenticatorAttachment(has_transport, transport)), extension_outputs_(extension_outputs) {} +absl::optional<String> PublicKeyCredential::GetAuthenticatorAttachment( + bool has_transport, + mojom::AuthenticatorTransport transport) { + absl::optional<String> authenticatorAttachment; + if (has_transport) { + authenticatorAttachment = + transport == mojom::AuthenticatorTransport::INTERNAL ? "platform" + : "cross-platform"; + } + return authenticatorAttachment; +} + ScriptPromise PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable( ScriptState* script_state) {
diff --git a/third_party/blink/renderer/modules/credentialmanager/public_key_credential.h b/third_party/blink/renderer/modules/credentialmanager/public_key_credential.h index 09fe670..028a493 100644 --- a/third_party/blink/renderer/modules/credentialmanager/public_key_credential.h +++ b/third_party/blink/renderer/modules/credentialmanager/public_key_credential.h
@@ -5,16 +5,20 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_CREDENTIALMANAGER_PUBLIC_KEY_CREDENTIAL_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_CREDENTIALMANAGER_PUBLIC_KEY_CREDENTIAL_H_ +#include "third_party/abseil-cpp/absl/types/optional.h" +#include "third_party/blink/public/mojom/webauthn/authenticator.mojom-shared.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_authentication_extensions_client_outputs.h" #include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h" #include "third_party/blink/renderer/modules/credentialmanager/authenticator_response.h" #include "third_party/blink/renderer/modules/credentialmanager/credential.h" #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/platform/heap/handle.h" +#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" namespace blink { class AuthenticatorResponse; +class AuthenticatorTransport; class ScriptPromise; class ScriptState; @@ -22,15 +26,23 @@ DEFINE_WRAPPERTYPEINFO(); public: - explicit PublicKeyCredential( + PublicKeyCredential( const String& id, DOMArrayBuffer* raw_id, AuthenticatorResponse*, + bool has_transport, + mojom::AuthenticatorTransport transport, const AuthenticationExtensionsClientOutputs* extension_outputs, const String& type = ""); DOMArrayBuffer* rawId() const { return raw_id_.Get(); } AuthenticatorResponse* response() const { return response_.Get(); } + absl::optional<String> authenticatorAttachment() const { + return authenticatorAttachment_; + } + absl::optional<String> GetAuthenticatorAttachment( + bool has_transport, + mojom::AuthenticatorTransport transport); static ScriptPromise isUserVerifyingPlatformAuthenticatorAvailable( ScriptState*); AuthenticationExtensionsClientOutputs* getClientExtensionResults() const; @@ -42,6 +54,7 @@ private: const Member<DOMArrayBuffer> raw_id_; const Member<AuthenticatorResponse> response_; + const absl::optional<String> authenticatorAttachment_; Member<const AuthenticationExtensionsClientOutputs> extension_outputs_; };
diff --git a/third_party/blink/renderer/modules/credentialmanager/public_key_credential.idl b/third_party/blink/renderer/modules/credentialmanager/public_key_credential.idl index 76bcc33..b3a71e7e 100644 --- a/third_party/blink/renderer/modules/credentialmanager/public_key_credential.idl +++ b/third_party/blink/renderer/modules/credentialmanager/public_key_credential.idl
@@ -11,6 +11,7 @@ ] interface PublicKeyCredential : Credential { [SameObject] readonly attribute ArrayBuffer rawId; [SameObject] readonly attribute AuthenticatorResponse response; + [RuntimeEnabled=WebAuthAuthenticatorAttachment, SameObject] readonly attribute DOMString? authenticatorAttachment; [CallWith=ScriptState] static Promise<boolean> isUserVerifyingPlatformAuthenticatorAvailable(); AuthenticationExtensionsClientOutputs getClientExtensionResults(); };
diff --git a/third_party/blink/renderer/modules/credentialmanager/scoped_promise_resolver.h b/third_party/blink/renderer/modules/credentialmanager/scoped_promise_resolver.h index 63a9866..571b281b 100644 --- a/third_party/blink/renderer/modules/credentialmanager/scoped_promise_resolver.h +++ b/third_party/blink/renderer/modules/credentialmanager/scoped_promise_resolver.h
@@ -18,6 +18,9 @@ public: explicit ScopedPromiseResolver(ScriptPromiseResolver* resolver); + ScopedPromiseResolver(const ScopedPromiseResolver&) = delete; + ScopedPromiseResolver& operator=(const ScopedPromiseResolver&) = delete; + ~ScopedPromiseResolver(); // Releases the owned |resolver_|. This is to be called by the Mojo response @@ -32,8 +35,6 @@ void OnConnectionError(); Persistent<ScriptPromiseResolver> resolver_; - - DISALLOW_COPY_AND_ASSIGN(ScopedPromiseResolver); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/csspaint/paint_size.h b/third_party/blink/renderer/modules/csspaint/paint_size.h index 7719929..3e05713 100644 --- a/third_party/blink/renderer/modules/csspaint/paint_size.h +++ b/third_party/blink/renderer/modules/csspaint/paint_size.h
@@ -17,6 +17,10 @@ public: explicit PaintSize(FloatSize size) : size_(size) {} + + PaintSize(const PaintSize&) = delete; + PaintSize& operator=(const PaintSize&) = delete; + ~PaintSize() override = default; float width() const { return size_.Width(); } @@ -24,8 +28,6 @@ private: FloatSize size_; - - DISALLOW_COPY_AND_ASSIGN(PaintSize); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/csspaint/paint_worklet.h b/third_party/blink/renderer/modules/csspaint/paint_worklet.h index 822f5ef..949ecfd 100644 --- a/third_party/blink/renderer/modules/csspaint/paint_worklet.h +++ b/third_party/blink/renderer/modules/csspaint/paint_worklet.h
@@ -33,6 +33,10 @@ static PaintWorklet* From(LocalDOMWindow&); explicit PaintWorklet(LocalDOMWindow&); + + PaintWorklet(const PaintWorklet&) = delete; + PaintWorklet& operator=(const PaintWorklet&) = delete; + ~PaintWorklet() override; void AddPendingGenerator(const String& name, CSSPaintImageGeneratorImpl*); @@ -145,8 +149,6 @@ // tests may be testing the functionality of the APIs when the paint worklet // is off the main thread. bool is_paint_off_thread_; - - DISALLOW_COPY_AND_ASSIGN(PaintWorklet); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/csspaint/paint_worklet_proxy_client.h b/third_party/blink/renderer/modules/csspaint/paint_worklet_proxy_client.h index 07ba7b9..5530434 100644 --- a/third_party/blink/renderer/modules/csspaint/paint_worklet_proxy_client.h +++ b/third_party/blink/renderer/modules/csspaint/paint_worklet_proxy_client.h
@@ -36,7 +36,6 @@ : public GarbageCollected<PaintWorkletProxyClient>, public Supplement<WorkerClients>, public PaintWorkletPainter { - DISALLOW_COPY_AND_ASSIGN(PaintWorkletProxyClient); public: // blink::Supplement hook to retrieve the PaintWorkletProxyClient for a given @@ -53,6 +52,10 @@ PaintWorklet*, base::WeakPtr<PaintWorkletPaintDispatcher> compositor_paintee, scoped_refptr<base::SingleThreadTaskRunner> compositor_host_queue); + + PaintWorkletProxyClient(const PaintWorkletProxyClient&) = delete; + PaintWorkletProxyClient& operator=(const PaintWorkletProxyClient&) = delete; + ~PaintWorkletProxyClient() override = default; // PaintWorkletPainter implementation.
diff --git a/third_party/blink/renderer/modules/device_orientation/device_motion_event_pump.h b/third_party/blink/renderer/modules/device_orientation/device_motion_event_pump.h index b8ff087c..7733e71 100644 --- a/third_party/blink/renderer/modules/device_orientation/device_motion_event_pump.h +++ b/third_party/blink/renderer/modules/device_orientation/device_motion_event_pump.h
@@ -21,6 +21,10 @@ public DeviceSensorEventPump { public: explicit DeviceMotionEventPump(LocalFrame&); + + DeviceMotionEventPump(const DeviceMotionEventPump&) = delete; + DeviceMotionEventPump& operator=(const DeviceMotionEventPump&) = delete; + ~DeviceMotionEventPump() override; void SetController(PlatformEventController*); @@ -57,8 +61,6 @@ Member<DeviceMotionData> data_; Member<PlatformEventController> controller_; - - DISALLOW_COPY_AND_ASSIGN(DeviceMotionEventPump); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/device_orientation/device_motion_event_pump_unittest.cc b/third_party/blink/renderer/modules/device_orientation/device_motion_event_pump_unittest.cc index 690cd10..012dd8c 100644 --- a/third_party/blink/renderer/modules/device_orientation/device_motion_event_pump_unittest.cc +++ b/third_party/blink/renderer/modules/device_orientation/device_motion_event_pump_unittest.cc
@@ -37,6 +37,11 @@ : PlatformEventController(window), did_change_device_motion_(false), motion_pump_(motion_pump) {} + + MockDeviceMotionController(const MockDeviceMotionController&) = delete; + MockDeviceMotionController& operator=(const MockDeviceMotionController&) = + delete; + ~MockDeviceMotionController() override {} void Trace(Visitor* visitor) const override { @@ -69,8 +74,6 @@ bool did_change_device_motion_; int number_of_events_; Member<DeviceMotionEventPump> motion_pump_; - - DISALLOW_COPY_AND_ASSIGN(MockDeviceMotionController); }; class DeviceMotionEventPumpTest : public testing::Test {
diff --git a/third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump.h b/third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump.h index d1ed8ef..2654c83 100644 --- a/third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump.h +++ b/third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump.h
@@ -25,6 +25,11 @@ static const double kOrientationThreshold; explicit DeviceOrientationEventPump(LocalFrame&, bool absolute); + + DeviceOrientationEventPump(const DeviceOrientationEventPump&) = delete; + DeviceOrientationEventPump& operator=(const DeviceOrientationEventPump&) = + delete; + ~DeviceOrientationEventPump() override; void SetController(PlatformEventController*); @@ -66,8 +71,6 @@ bool attempted_to_fall_back_to_absolute_orientation_sensor_; Member<DeviceOrientationData> data_; Member<PlatformEventController> controller_; - - DISALLOW_COPY_AND_ASSIGN(DeviceOrientationEventPump); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump_unittest.cc b/third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump_unittest.cc index 5765c17b..de2a005 100644 --- a/third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump_unittest.cc +++ b/third_party/blink/renderer/modules/device_orientation/device_orientation_event_pump_unittest.cc
@@ -41,6 +41,12 @@ : PlatformEventController(window), did_change_device_orientation_(false), orientation_pump_(orientation_pump) {} + + MockDeviceOrientationController(const MockDeviceOrientationController&) = + delete; + MockDeviceOrientationController& operator=( + const MockDeviceOrientationController&) = delete; + ~MockDeviceOrientationController() override {} void Trace(Visitor* visitor) const override { @@ -80,8 +86,6 @@ private: bool did_change_device_orientation_; Member<DeviceOrientationEventPump> orientation_pump_; - - DISALLOW_COPY_AND_ASSIGN(MockDeviceOrientationController); }; class DeviceOrientationEventPumpTest : public testing::Test {
diff --git a/third_party/blink/renderer/modules/device_orientation/device_orientation_inspector_agent.h b/third_party/blink/renderer/modules/device_orientation/device_orientation_inspector_agent.h index 111e5a7..9c01da3 100644 --- a/third_party/blink/renderer/modules/device_orientation/device_orientation_inspector_agent.h +++ b/third_party/blink/renderer/modules/device_orientation/device_orientation_inspector_agent.h
@@ -20,6 +20,12 @@ : public InspectorBaseAgent<protocol::DeviceOrientation::Metainfo> { public: explicit DeviceOrientationInspectorAgent(InspectedFrames*); + + DeviceOrientationInspectorAgent(const DeviceOrientationInspectorAgent&) = + delete; + DeviceOrientationInspectorAgent& operator=( + const DeviceOrientationInspectorAgent&) = delete; + ~DeviceOrientationInspectorAgent() override; void Trace(Visitor*) const override; @@ -42,7 +48,6 @@ InspectorAgentState::Double alpha_; InspectorAgentState::Double beta_; InspectorAgentState::Double gamma_; - DISALLOW_COPY_AND_ASSIGN(DeviceOrientationInspectorAgent); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/encoding/text_decoder_stream.h b/third_party/blink/renderer/modules/encoding/text_decoder_stream.h index 81fb773..0d2ec4d 100644 --- a/third_party/blink/renderer/modules/encoding/text_decoder_stream.h +++ b/third_party/blink/renderer/modules/encoding/text_decoder_stream.h
@@ -38,6 +38,10 @@ const WTF::TextEncoding&, const TextDecoderOptions*, ExceptionState&); + + TextDecoderStream(const TextDecoderStream&) = delete; + TextDecoderStream& operator=(const TextDecoderStream&) = delete; + ~TextDecoderStream() override; // From text_decoder_stream.idl @@ -56,8 +60,6 @@ const WTF::TextEncoding encoding_; const bool fatal_; const bool ignore_bom_; - - DISALLOW_COPY_AND_ASSIGN(TextDecoderStream); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/encoding/text_encoder_stream.h b/third_party/blink/renderer/modules/encoding/text_encoder_stream.h index a9c21a4..f5d797f 100644 --- a/third_party/blink/renderer/modules/encoding/text_encoder_stream.h +++ b/third_party/blink/renderer/modules/encoding/text_encoder_stream.h
@@ -30,6 +30,10 @@ static TextEncoderStream* Create(ScriptState*, ExceptionState&); TextEncoderStream(ScriptState*, ExceptionState&); + + TextEncoderStream(const TextEncoderStream&) = delete; + TextEncoderStream& operator=(const TextEncoderStream&) = delete; + ~TextEncoderStream() override; // From text_encoder_stream.idl @@ -43,8 +47,6 @@ class Transformer; const Member<TransformStream> transform_; - - DISALLOW_COPY_AND_ASSIGN(TextEncoderStream); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/encryptedmedia/html_media_element_encrypted_media.cc b/third_party/blink/renderer/modules/encryptedmedia/html_media_element_encrypted_media.cc index b6eb80e5..c46dbc3 100644 --- a/third_party/blink/renderer/modules/encryptedmedia/html_media_element_encrypted_media.cc +++ b/third_party/blink/renderer/modules/encryptedmedia/html_media_element_encrypted_media.cc
@@ -35,6 +35,10 @@ static ScriptPromise Create(ScriptState*, HTMLMediaElement&, MediaKeys*); SetMediaKeysHandler(ScriptState*, HTMLMediaElement&, MediaKeys*); + + SetMediaKeysHandler(const SetMediaKeysHandler&) = delete; + SetMediaKeysHandler& operator=(const SetMediaKeysHandler&) = delete; + ~SetMediaKeysHandler() override; void Trace(Visitor*) const override; @@ -56,8 +60,6 @@ Member<MediaKeys> new_media_keys_; bool made_reservation_; HeapTaskRunnerTimer<SetMediaKeysHandler> timer_; - - DISALLOW_COPY_AND_ASSIGN(SetMediaKeysHandler); }; typedef base::OnceCallback<void()> SuccessCallback;
diff --git a/third_party/blink/renderer/modules/encryptedmedia/media_key_system_access.cc b/third_party/blink/renderer/modules/encryptedmedia/media_key_system_access.cc index 3ff12c5..cdffb3a 100644 --- a/third_party/blink/renderer/modules/encryptedmedia/media_key_system_access.cc +++ b/third_party/blink/renderer/modules/encryptedmedia/media_key_system_access.cc
@@ -48,6 +48,9 @@ : ContentDecryptionModuleResultPromise(script_state, type), supported_session_types_(supported_session_types) {} + NewCdmResultPromise(const NewCdmResultPromise&) = delete; + NewCdmResultPromise& operator=(const NewCdmResultPromise&) = delete; + ~NewCdmResultPromise() override = default; // ContentDecryptionModuleResult implementation. @@ -68,8 +71,6 @@ private: WebVector<WebEncryptedMediaSessionType> supported_session_types_; - - DISALLOW_COPY_AND_ASSIGN(NewCdmResultPromise); }; // These methods are the inverses of those with the same names in
diff --git a/third_party/blink/renderer/modules/encryptedmedia/media_key_system_access_initializer_base.h b/third_party/blink/renderer/modules/encryptedmedia/media_key_system_access_initializer_base.h index 9026e0c..3fb5f7b 100644 --- a/third_party/blink/renderer/modules/encryptedmedia/media_key_system_access_initializer_base.h +++ b/third_party/blink/renderer/modules/encryptedmedia/media_key_system_access_initializer_base.h
@@ -24,6 +24,12 @@ const String& key_system, const HeapVector<Member<MediaKeySystemConfiguration>>& supported_configurations); + + MediaKeySystemAccessInitializerBase( + const MediaKeySystemAccessInitializerBase&) = delete; + MediaKeySystemAccessInitializerBase& operator=( + const MediaKeySystemAccessInitializerBase&) = delete; + ~MediaKeySystemAccessInitializerBase() override = default; // EncryptedMediaRequest implementation. @@ -53,8 +59,6 @@ Member<ScriptPromiseResolver> resolver_; const String key_system_; WebVector<WebMediaKeySystemConfiguration> supported_configurations_; - - DISALLOW_COPY_AND_ASSIGN(MediaKeySystemAccessInitializerBase); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/encryptedmedia/navigator_request_media_key_system_access.cc b/third_party/blink/renderer/modules/encryptedmedia/navigator_request_media_key_system_access.cc index 016d31e..3e1b22c 100644 --- a/third_party/blink/renderer/modules/encryptedmedia/navigator_request_media_key_system_access.cc +++ b/third_party/blink/renderer/modules/encryptedmedia/navigator_request_media_key_system_access.cc
@@ -51,6 +51,12 @@ const String& key_system, const HeapVector<Member<MediaKeySystemConfiguration>>& supported_configurations); + + MediaKeySystemAccessInitializer(const MediaKeySystemAccessInitializer&) = + delete; + MediaKeySystemAccessInitializer& operator=( + const MediaKeySystemAccessInitializer&) = delete; + ~MediaKeySystemAccessInitializer() override = default; // EncryptedMediaRequest implementation. @@ -63,9 +69,6 @@ void Trace(Visitor* visitor) const override { MediaKeySystemAccessInitializerBase::Trace(visitor); } - - private: - DISALLOW_COPY_AND_ASSIGN(MediaKeySystemAccessInitializer); }; MediaKeySystemAccessInitializer::MediaKeySystemAccessInitializer(
diff --git a/third_party/blink/renderer/modules/exported/web_embedded_worker_impl.h b/third_party/blink/renderer/modules/exported/web_embedded_worker_impl.h index 061ab96..2e76588 100644 --- a/third_party/blink/renderer/modules/exported/web_embedded_worker_impl.h +++ b/third_party/blink/renderer/modules/exported/web_embedded_worker_impl.h
@@ -59,6 +59,10 @@ class MODULES_EXPORT WebEmbeddedWorkerImpl final : public WebEmbeddedWorker { public: explicit WebEmbeddedWorkerImpl(WebServiceWorkerContextClient*); + + WebEmbeddedWorkerImpl(const WebEmbeddedWorkerImpl&) = delete; + WebEmbeddedWorkerImpl& operator=(const WebEmbeddedWorkerImpl&) = delete; + ~WebEmbeddedWorkerImpl() override; // WebEmbeddedWorker overrides. @@ -103,8 +107,6 @@ std::unique_ptr<ServiceWorkerThread> worker_thread_; bool asked_to_terminate_ = false; - - DISALLOW_COPY_AND_ASSIGN(WebEmbeddedWorkerImpl); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/filesystem/local_file_system.h b/third_party/blink/renderer/modules/filesystem/local_file_system.h index c25ebcd3..ac4ed99 100644 --- a/third_party/blink/renderer/modules/filesystem/local_file_system.h +++ b/third_party/blink/renderer/modules/filesystem/local_file_system.h
@@ -59,6 +59,10 @@ static const char kSupplementName[]; explicit LocalFileSystem(ExecutionContext&); + + LocalFileSystem(const LocalFileSystem&) = delete; + LocalFileSystem& operator=(const LocalFileSystem&) = delete; + ~LocalFileSystem() final = default; void ResolveURL(const KURL&, @@ -91,8 +95,6 @@ void ResolveURLInternal(const KURL&, std::unique_ptr<ResolveURICallbacks>, SynchronousType sync_type); - - DISALLOW_COPY_AND_ASSIGN(LocalFileSystem); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/handwriting/handwriting_drawing.h b/third_party/blink/renderer/modules/handwriting/handwriting_drawing.h index 83126b5..d914882 100644 --- a/third_party/blink/renderer/modules/handwriting/handwriting_drawing.h +++ b/third_party/blink/renderer/modules/handwriting/handwriting_drawing.h
@@ -27,6 +27,10 @@ explicit HandwritingDrawing(ExecutionContext* context, HandwritingRecognizer* recognizer, const HandwritingHints* hints); + + HandwritingDrawing(const HandwritingDrawing&) = delete; + HandwritingDrawing& operator=(const HandwritingDrawing&) = delete; + ~HandwritingDrawing() override; // IDL Interface: @@ -46,8 +50,6 @@ HeapVector<Member<HandwritingStroke>> strokes_; WeakMember<HandwritingRecognizer> recognizer_; - - DISALLOW_COPY_AND_ASSIGN(HandwritingDrawing); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/handwriting/handwriting_recognizer.h b/third_party/blink/renderer/modules/handwriting/handwriting_recognizer.h index 05a9636c..54d2560 100644 --- a/third_party/blink/renderer/modules/handwriting/handwriting_recognizer.h +++ b/third_party/blink/renderer/modules/handwriting/handwriting_recognizer.h
@@ -27,6 +27,10 @@ ExecutionContext* context, mojo::PendingRemote<handwriting::mojom::blink::HandwritingRecognizer> pending_remote); + + HandwritingRecognizer(const HandwritingRecognizer&) = delete; + HandwritingRecognizer& operator=(const HandwritingRecognizer&) = delete; + ~HandwritingRecognizer() override; // Used by the drawing to see if the recognizer is valid. @@ -53,8 +57,6 @@ HeapMojoRemote<handwriting::mojom::blink::HandwritingRecognizer> remote_service_; - - DISALLOW_COPY_AND_ASSIGN(HandwritingRecognizer); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/handwriting/handwriting_stroke.h b/third_party/blink/renderer/modules/handwriting/handwriting_stroke.h index fdac1905..0fea803 100644 --- a/third_party/blink/renderer/modules/handwriting/handwriting_stroke.h +++ b/third_party/blink/renderer/modules/handwriting/handwriting_stroke.h
@@ -21,6 +21,10 @@ public: HandwritingStroke(); + + HandwritingStroke(const HandwritingStroke&) = delete; + HandwritingStroke& operator=(const HandwritingStroke&) = delete; + ~HandwritingStroke() override; static HandwritingStroke* Create(); @@ -34,8 +38,6 @@ private: HeapVector<Member<const HandwritingPoint>> points_; - - DISALLOW_COPY_AND_ASSIGN(HandwritingStroke); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.h b/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.h index b78a6fd0..d1ab5678 100644 --- a/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.h +++ b/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.h
@@ -30,6 +30,10 @@ static const char kSupplementName[]; explicit ImageDownloaderImpl(LocalFrame&); + + ImageDownloaderImpl(const ImageDownloaderImpl&) = delete; + ImageDownloaderImpl& operator=(const ImageDownloaderImpl&) = delete; + ~ImageDownloaderImpl() override; using DownloadCallback = @@ -98,8 +102,6 @@ ImageDownloaderImpl, HeapMojoWrapperMode::kForceWithoutContextObserver> receiver_; - - DISALLOW_COPY_AND_ASSIGN(ImageDownloaderImpl); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.cc b/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.cc index 81c9128..0fb9839 100644 --- a/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.cc +++ b/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.cc
@@ -34,6 +34,9 @@ explicit ClientImpl(StartCallback callback) : completed_(false), status_(LOADING), callback_(std::move(callback)) {} + ClientImpl(const ClientImpl&) = delete; + ClientImpl& operator=(const ClientImpl&) = delete; + ~ClientImpl() override {} virtual void Cancel() { OnLoadCompleteInternal(LOAD_FAILED); } @@ -100,8 +103,6 @@ // Callback when we're done. StartCallback callback_; - - DISALLOW_COPY_AND_ASSIGN(ClientImpl); }; MultiResolutionImageResourceFetcher::MultiResolutionImageResourceFetcher(
diff --git a/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.h b/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.h index 933acb1..dbff864 100644 --- a/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.h +++ b/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.h
@@ -48,6 +48,11 @@ mojom::blink::FetchCacheMode cache_mode, Callback callback); + MultiResolutionImageResourceFetcher( + const MultiResolutionImageResourceFetcher&) = delete; + MultiResolutionImageResourceFetcher& operator=( + const MultiResolutionImageResourceFetcher&) = delete; + virtual ~MultiResolutionImageResourceFetcher(); // HTTP status code upon fetch completion. @@ -101,8 +106,6 @@ // Request to send. WebURLRequest request_; - - DISALLOW_COPY_AND_ASSIGN(MultiResolutionImageResourceFetcher); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h b/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h index 429af29..7cc3760dc 100644 --- a/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h +++ b/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h
@@ -128,6 +128,10 @@ class ImageCaptureFrameGrabber final : public MediaStreamVideoSink { public: ImageCaptureFrameGrabber(); + + ImageCaptureFrameGrabber(const ImageCaptureFrameGrabber&) = delete; + ImageCaptureFrameGrabber& operator=(const ImageCaptureFrameGrabber&) = delete; + ~ImageCaptureFrameGrabber() override; void GrabFrame(MediaStreamComponent* component, @@ -146,8 +150,6 @@ THREAD_CHECKER(thread_checker_); base::WeakPtrFactory<ImageCaptureFrameGrabber> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ImageCaptureFrameGrabber); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/installedapp/installed_app_controller.h b/third_party/blink/renderer/modules/installedapp/installed_app_controller.h index 71698ce9..9c00d03 100644 --- a/third_party/blink/renderer/modules/installedapp/installed_app_controller.h +++ b/third_party/blink/renderer/modules/installedapp/installed_app_controller.h
@@ -35,6 +35,10 @@ static const char kSupplementName[]; explicit InstalledAppController(LocalDOMWindow&); + + InstalledAppController(const InstalledAppController&) = delete; + InstalledAppController& operator=(const InstalledAppController&) = delete; + virtual ~InstalledAppController(); // Gets a list of related apps from the current page's manifest that belong @@ -62,8 +66,6 @@ // Handle to the InstalledApp mojo service. HeapMojoRemote<mojom::blink::InstalledAppProvider> provider_; - - DISALLOW_COPY_AND_ASSIGN(InstalledAppController); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/keyboard/keyboard.h b/third_party/blink/renderer/modules/keyboard/keyboard.h index 1e53101..8b01c8be 100644 --- a/third_party/blink/renderer/modules/keyboard/keyboard.h +++ b/third_party/blink/renderer/modules/keyboard/keyboard.h
@@ -22,6 +22,10 @@ public: explicit Keyboard(ExecutionContext*); + + Keyboard(const Keyboard&) = delete; + Keyboard& operator=(const Keyboard&) = delete; + ~Keyboard() override; // KeyboardLock API: https://w3c.github.io/keyboard-lock/ @@ -36,8 +40,6 @@ private: Member<KeyboardLock> keyboard_lock_; Member<KeyboardLayout> keyboard_layout_; - - DISALLOW_COPY_AND_ASSIGN(Keyboard); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/keyboard/keyboard_layout.h b/third_party/blink/renderer/modules/keyboard/keyboard_layout.h index 6239820..012ae9aa 100644 --- a/third_party/blink/renderer/modules/keyboard/keyboard_layout.h +++ b/third_party/blink/renderer/modules/keyboard/keyboard_layout.h
@@ -23,6 +23,10 @@ public ExecutionContextClient { public: explicit KeyboardLayout(ExecutionContext*); + + KeyboardLayout(const KeyboardLayout&) = delete; + KeyboardLayout& operator=(const KeyboardLayout&) = delete; + virtual ~KeyboardLayout() = default; ScriptPromise GetKeyboardLayoutMap(ScriptState*, ExceptionState&); @@ -45,8 +49,6 @@ Member<ScriptPromiseResolver> script_promise_resolver_; HeapMojoRemote<mojom::blink::KeyboardLockService> service_; - - DISALLOW_COPY_AND_ASSIGN(KeyboardLayout); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/keyboard/keyboard_lock.h b/third_party/blink/renderer/modules/keyboard/keyboard_lock.h index 723888c..c72af71 100644 --- a/third_party/blink/renderer/modules/keyboard/keyboard_lock.h +++ b/third_party/blink/renderer/modules/keyboard/keyboard_lock.h
@@ -23,6 +23,10 @@ public ExecutionContextClient { public: explicit KeyboardLock(ExecutionContext*); + + KeyboardLock(const KeyboardLock&) = delete; + KeyboardLock& operator=(const KeyboardLock&) = delete; + ~KeyboardLock(); ScriptPromise lock(ScriptState*, const Vector<String>&, ExceptionState&); @@ -45,8 +49,6 @@ HeapMojoRemote<mojom::blink::KeyboardLockService> service_; Member<ScriptPromiseResolver> request_keylock_resolver_; - - DISALLOW_COPY_AND_ASSIGN(KeyboardLock); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/locks/lock_manager.cc b/third_party/blink/renderer/modules/locks/lock_manager.cc index 03d4053..7ae985d 100644 --- a/third_party/blink/renderer/modules/locks/lock_manager.cc +++ b/third_party/blink/renderer/modules/locks/lock_manager.cc
@@ -86,6 +86,9 @@ manager->GetExecutionContext()->GetTaskRunner(TaskType::kWebLocks)); } + LockRequestImpl(const LockRequestImpl&) = delete; + LockRequestImpl& operator=(const LockRequestImpl&) = delete; + ~LockRequestImpl() override = default; void Trace(Visitor* visitor) const { @@ -203,8 +206,6 @@ // registered. If the context is destroyed then |manager_| will dispose of // |this| which terminates the request on the service side. Member<LockManager> manager_; - - DISALLOW_COPY_AND_ASSIGN(LockRequestImpl); }; const char LockManager::kSupplementName[] = "LockManager";
diff --git a/third_party/blink/renderer/modules/manifest/manifest_change_notifier.h b/third_party/blink/renderer/modules/manifest/manifest_change_notifier.h index 812f798..9cfe3de 100644 --- a/third_party/blink/renderer/modules/manifest/manifest_change_notifier.h +++ b/third_party/blink/renderer/modules/manifest/manifest_change_notifier.h
@@ -20,6 +20,10 @@ : public GarbageCollected<ManifestChangeNotifier> { public: explicit ManifestChangeNotifier(LocalDOMWindow& window); + + ManifestChangeNotifier(const ManifestChangeNotifier&) = delete; + ManifestChangeNotifier& operator=(const ManifestChangeNotifier&) = delete; + virtual ~ManifestChangeNotifier(); virtual void Trace(Visitor*) const; @@ -34,8 +38,6 @@ HeapMojoAssociatedRemote<mojom::blink::ManifestUrlChangeObserver> manifest_change_observer_; bool report_task_scheduled_ = false; - - DISALLOW_COPY_AND_ASSIGN(ManifestChangeNotifier); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/manifest/manifest_fetcher.h b/third_party/blink/renderer/modules/manifest/manifest_fetcher.h index d18e2dc..ebcd2ba 100644 --- a/third_party/blink/renderer/modules/manifest/manifest_fetcher.h +++ b/third_party/blink/renderer/modules/manifest/manifest_fetcher.h
@@ -36,6 +36,10 @@ public: explicit ManifestFetcher(const KURL& url); + + ManifestFetcher(const ManifestFetcher&) = delete; + ManifestFetcher& operator=(const ManifestFetcher&) = delete; + ~ManifestFetcher() override; void Start(LocalDOMWindow& window, @@ -61,8 +65,6 @@ std::unique_ptr<TextResourceDecoder> decoder_; StringBuilder data_; Member<ThreadableLoader> loader_; - - DISALLOW_COPY_AND_ASSIGN(ManifestFetcher); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/manifest/manifest_manager.h b/third_party/blink/renderer/modules/manifest/manifest_manager.h index b1e52ab..981ed0e 100644 --- a/third_party/blink/renderer/modules/manifest/manifest_manager.h +++ b/third_party/blink/renderer/modules/manifest/manifest_manager.h
@@ -40,6 +40,10 @@ static ManifestManager* From(LocalDOMWindow&); explicit ManifestManager(LocalDOMWindow&); + + ManifestManager(const ManifestManager&) = delete; + ManifestManager& operator=(const ManifestManager&) = delete; + ~ManifestManager() override; void DidChangeManifest(); @@ -110,8 +114,6 @@ HeapMojoReceiverSet<mojom::blink::ManifestManager, ManifestManager> receivers_; - - DISALLOW_COPY_AND_ASSIGN(ManifestManager); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/manifest/manifest_parser.h b/third_party/blink/renderer/modules/manifest/manifest_parser.h index e8a0fc0..fef37b9 100644 --- a/third_party/blink/renderer/modules/manifest/manifest_parser.h +++ b/third_party/blink/renderer/modules/manifest/manifest_parser.h
@@ -36,6 +36,10 @@ const KURL& manifest_url, const KURL& document_url, const FeatureContext* feature_context); + + ManifestParser(const ManifestParser&) = delete; + ManifestParser& operator=(const ManifestParser&) = delete; + ~ManifestParser(); // Parse the Manifest from a string using following: @@ -445,8 +449,6 @@ bool failed_; mojom::blink::ManifestPtr manifest_; Vector<mojom::blink::ManifestErrorPtr> errors_; - - DISALLOW_COPY_AND_ASSIGN(ManifestParser); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_manager.h b/third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_manager.h index a58d788..130b1870 100644 --- a/third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_manager.h +++ b/third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_manager.h
@@ -43,6 +43,10 @@ class BLINK_MODULES_EXPORT AudioRendererMixerManager final : public media::AudioRendererMixerPool { public: + AudioRendererMixerManager(const AudioRendererMixerManager&) = delete; + AudioRendererMixerManager& operator=(const AudioRendererMixerManager&) = + delete; + ~AudioRendererMixerManager() final; // AudioRendererMixerManager instance which manages renderer side mixer @@ -172,8 +176,6 @@ // Active mixers. AudioRendererMixerMap mixers_; base::Lock mixers_lock_; - - DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerManager); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/media/audio/audio_renderer_sink_cache.cc b/third_party/blink/renderer/modules/media/audio/audio_renderer_sink_cache.cc index 1e7371a1..4528cb0 100644 --- a/third_party/blink/renderer/modules/media/audio/audio_renderer_sink_cache.cc +++ b/third_party/blink/renderer/modules/media/audio/audio_renderer_sink_cache.cc
@@ -39,6 +39,10 @@ explicit WindowObserver(LocalDOMWindow& window) : Supplement<LocalDOMWindow>(window), ExecutionContextLifecycleObserver(&window) {} + + WindowObserver(const WindowObserver&) = delete; + WindowObserver& operator=(const WindowObserver&) = delete; + ~WindowObserver() override = default; void Trace(Visitor* visitor) const final { @@ -51,8 +55,6 @@ if (auto* cache_instance = AudioRendererSinkCache::instance_) cache_instance->DropSinksForFrame(DomWindow()->GetLocalFrameToken()); } - - DISALLOW_COPY_AND_ASSIGN(WindowObserver); }; const char AudioRendererSinkCache::WindowObserver::kSupplementName[] =
diff --git a/third_party/blink/renderer/modules/media/audio/audio_renderer_sink_cache.h b/third_party/blink/renderer/modules/media/audio/audio_renderer_sink_cache.h index 76c4209..9349043 100644 --- a/third_party/blink/renderer/modules/media/audio/audio_renderer_sink_cache.h +++ b/third_party/blink/renderer/modules/media/audio/audio_renderer_sink_cache.h
@@ -53,6 +53,10 @@ scoped_refptr<base::SequencedTaskRunner> cleanup_task_runner, CreateSinkCallback create_sink_callback, base::TimeDelta delete_timeout); + + AudioRendererSinkCache(const AudioRendererSinkCache&) = delete; + AudioRendererSinkCache& operator=(const AudioRendererSinkCache&) = delete; + ~AudioRendererSinkCache(); // AudioRendererSinkCache implementation: @@ -116,8 +120,6 @@ // Cached sinks, protected by lock. base::Lock cache_lock_; CacheContainer cache_; - - DISALLOW_COPY_AND_ASSIGN(AudioRendererSinkCache); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/media/audio/audio_renderer_sink_cache_test.cc b/third_party/blink/renderer/modules/media/audio/audio_renderer_sink_cache_test.cc index cdbe7d0..c94ab5e 100644 --- a/third_party/blink/renderer/modules/media/audio/audio_renderer_sink_cache_test.cc +++ b/third_party/blink/renderer/modules/media/audio/audio_renderer_sink_cache_test.cc
@@ -43,6 +43,11 @@ base::BindRepeating(&AudioRendererSinkCacheTest::CreateSink, base::Unretained(this)), kDeleteTimeout)) {} + + AudioRendererSinkCacheTest(const AudioRendererSinkCacheTest&) = delete; + AudioRendererSinkCacheTest& operator=(const AudioRendererSinkCacheTest&) = + delete; + ~AudioRendererSinkCacheTest() override { task_runner_->FastForwardUntilNoTasksRemain(); } @@ -100,9 +105,6 @@ task_runner_context_; std::unique_ptr<AudioRendererSinkCache> cache_; - - private: - DISALLOW_COPY_AND_ASSIGN(AudioRendererSinkCacheTest); }; // Verify that normal get/release sink sequence works.
diff --git a/third_party/blink/renderer/modules/media/audio/mojo_audio_input_ipc.h b/third_party/blink/renderer/modules/media/audio/mojo_audio_input_ipc.h index 7ea9c28..5b38e35 100644 --- a/third_party/blink/renderer/modules/media/audio/mojo_audio_input_ipc.h +++ b/third_party/blink/renderer/modules/media/audio/mojo_audio_input_ipc.h
@@ -49,6 +49,10 @@ MojoAudioInputIPC(const media::AudioSourceParameters& source_params, StreamCreatorCB stream_creator, StreamAssociatorCB stream_associator); + + MojoAudioInputIPC(const MojoAudioInputIPC&) = delete; + MojoAudioInputIPC& operator=(const MojoAudioInputIPC&) = delete; + ~MojoAudioInputIPC() override; // AudioInputIPC implementation @@ -91,8 +95,6 @@ media::AudioInputIPCDelegate* delegate_ = nullptr; base::WeakPtrFactory<MojoAudioInputIPC> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MojoAudioInputIPC); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/media/audio/mojo_audio_output_ipc.h b/third_party/blink/renderer/modules/media/audio/mojo_audio_output_ipc.h index 6b0378d..7eb8b69 100644 --- a/third_party/blink/renderer/modules/media/audio/mojo_audio_output_ipc.h +++ b/third_party/blink/renderer/modules/media/audio/mojo_audio_output_ipc.h
@@ -41,6 +41,9 @@ FactoryAccessorCB factory_accessor, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner); + MojoAudioOutputIPC(const MojoAudioOutputIPC&) = delete; + MojoAudioOutputIPC& operator=(const MojoAudioOutputIPC&) = delete; + ~MojoAudioOutputIPC() override; // AudioOutputIPC implementation. @@ -107,8 +110,6 @@ // To make sure we don't send an "authorization completed" callback for a // stream after it's closed, we use this weak factory. base::WeakPtrFactory<MojoAudioOutputIPC> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MojoAudioOutputIPC); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/media/audio/web_audio_output_ipc_factory.cc b/third_party/blink/renderer/modules/media/audio/web_audio_output_ipc_factory.cc index 97b4c72..84328cb 100644 --- a/third_party/blink/renderer/modules/media/audio/web_audio_output_ipc_factory.cc +++ b/third_party/blink/renderer/modules/media/audio/web_audio_output_ipc_factory.cc
@@ -28,6 +28,10 @@ explicit Impl(scoped_refptr<base::SingleThreadTaskRunner> io_task_runner) : io_task_runner_(std::move(io_task_runner)) {} + + Impl(const Impl&) = delete; + Impl& operator=(const Impl&) = delete; + ~Impl() { DCHECK(factory_remotes_.IsEmpty()); } mojom::blink::RendererAudioOutputStreamFactory* GetRemoteFactory( @@ -44,9 +48,6 @@ // Maps frame id to the corresponding factory. StreamFactoryMap factory_remotes_; const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; - - private: - DISALLOW_COPY_AND_ASSIGN(Impl); }; // static
diff --git a/third_party/blink/renderer/modules/media_capabilities/media_capabilities.cc b/third_party/blink/renderer/modules/media_capabilities/media_capabilities.cc index 5f74ced..47948ef0 100644 --- a/third_party/blink/renderer/modules/media_capabilities/media_capabilities.cc +++ b/third_party/blink/renderer/modules/media_capabilities/media_capabilities.cc
@@ -192,6 +192,11 @@ supported_configurations), get_perf_callback_(std::move(get_perf_callback)) {} + MediaCapabilitiesKeySystemAccessInitializer( + const MediaCapabilitiesKeySystemAccessInitializer&) = delete; + MediaCapabilitiesKeySystemAccessInitializer& operator=( + const MediaCapabilitiesKeySystemAccessInitializer&) = delete; + ~MediaCapabilitiesKeySystemAccessInitializer() override = default; void RequestSucceeded( @@ -226,8 +231,6 @@ private: GetPerfCallback get_perf_callback_; - - DISALLOW_COPY_AND_ASSIGN(MediaCapabilitiesKeySystemAccessInitializer); }; bool IsValidFrameRate(double framerate) {
diff --git a/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc b/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc index cc93e734..53c59ad 100644 --- a/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc +++ b/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc
@@ -231,6 +231,10 @@ DCHECK_GE(batch_depth_, 0); ++batch_depth_; } + + BatchedControlUpdate(const BatchedControlUpdate&) = delete; + BatchedControlUpdate& operator=(const BatchedControlUpdate&) = delete; + ~BatchedControlUpdate() { DCHECK(IsMainThread()); DCHECK_GT(batch_depth_, 0); @@ -241,8 +245,6 @@ private: MediaControlsImpl* controls_; static int batch_depth_; - - DISALLOW_COPY_AND_ASSIGN(BatchedControlUpdate); }; // Count of number open batches for controls visibility.
diff --git a/third_party/blink/renderer/modules/media_controls/media_controls_impl.h b/third_party/blink/renderer/modules/media_controls/media_controls_impl.h index 1d66036e..eb66d6a 100644 --- a/third_party/blink/renderer/modules/media_controls/media_controls_impl.h +++ b/third_party/blink/renderer/modules/media_controls/media_controls_impl.h
@@ -81,6 +81,10 @@ static MediaControlsImpl* Create(HTMLMediaElement&, ShadowRoot&); explicit MediaControlsImpl(HTMLMediaElement&); + + MediaControlsImpl(const MediaControlsImpl&) = delete; + MediaControlsImpl& operator=(const MediaControlsImpl&) = delete; + ~MediaControlsImpl() override = default; // Returns whether the event is considered a touch event. @@ -439,8 +443,6 @@ Member<MediaControlsTextTrackManager> text_track_manager_; bool is_test_mode_ = false; - - DISALLOW_COPY_AND_ASSIGN(MediaControlsImpl); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/media_controls/media_controls_resource_loader.h b/third_party/blink/renderer/modules/media_controls/media_controls_resource_loader.h index 3c2e5a65..d3f05fbc 100644 --- a/third_party/blink/renderer/modules/media_controls/media_controls_resource_loader.h +++ b/third_party/blink/renderer/modules/media_controls/media_controls_resource_loader.h
@@ -42,14 +42,17 @@ String GetUAStyleSheet() override; MediaControlsResourceLoader(); + + MediaControlsResourceLoader(const MediaControlsResourceLoader&) = delete; + MediaControlsResourceLoader& operator=(const MediaControlsResourceLoader&) = + delete; + ~MediaControlsResourceLoader() override; private: String GetMediaControlsCSS() const; String GetMediaControlsAndroidCSS() const; - - DISALLOW_COPY_AND_ASSIGN(MediaControlsResourceLoader); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.cc b/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.cc index 0305d9f4..c7eaafc 100644 --- a/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.cc +++ b/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.cc
@@ -132,6 +132,11 @@ : new_frame_callback_(new_frame_callback) { DETACH_FROM_THREAD(io_thread_checker_); } + + CanvasCaptureHandlerDelegate(const CanvasCaptureHandlerDelegate&) = delete; + CanvasCaptureHandlerDelegate& operator=(const CanvasCaptureHandlerDelegate&) = + delete; + ~CanvasCaptureHandlerDelegate() { DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_); } @@ -152,8 +157,6 @@ // Bound to IO thread. THREAD_CHECKER(io_thread_checker_); base::WeakPtrFactory<CanvasCaptureHandlerDelegate> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(CanvasCaptureHandlerDelegate); }; CanvasCaptureHandler::CanvasCaptureHandler(
diff --git a/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.h b/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.h index 1feb573b..43712c0 100644 --- a/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.h +++ b/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.h
@@ -49,6 +49,9 @@ // used to send back frames to |io_task_runner_|, i.e. IO thread. class MODULES_EXPORT CanvasCaptureHandler { public: + CanvasCaptureHandler(const CanvasCaptureHandler&) = delete; + CanvasCaptureHandler& operator=(const CanvasCaptureHandler&) = delete; + ~CanvasCaptureHandler(); // Creates a CanvasCaptureHandler instance and updates UMA histogram. @@ -150,8 +153,6 @@ // Bound to Main Render thread. THREAD_CHECKER(main_render_thread_checker_); base::WeakPtrFactory<CanvasCaptureHandler> weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(CanvasCaptureHandler); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediacapturefromelement/html_audio_element_capturer_source.h b/third_party/blink/renderer/modules/mediacapturefromelement/html_audio_element_capturer_source.h index 85aa8fd3..31dfbae 100644 --- a/third_party/blink/renderer/modules/mediacapturefromelement/html_audio_element_capturer_source.h +++ b/third_party/blink/renderer/modules/mediacapturefromelement/html_audio_element_capturer_source.h
@@ -37,6 +37,12 @@ HtmlAudioElementCapturerSource( scoped_refptr<blink::WebAudioSourceProviderImpl> audio_source, scoped_refptr<base::SingleThreadTaskRunner> task_runner); + + HtmlAudioElementCapturerSource(const HtmlAudioElementCapturerSource&) = + delete; + HtmlAudioElementCapturerSource& operator=( + const HtmlAudioElementCapturerSource&) = delete; + ~HtmlAudioElementCapturerSource() override; private: @@ -60,8 +66,6 @@ THREAD_CHECKER(thread_checker_); base::WeakPtrFactory<HtmlAudioElementCapturerSource> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(HtmlAudioElementCapturerSource); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediacapturefromelement/html_video_element_capturer_source.h b/third_party/blink/renderer/modules/mediacapturefromelement/html_video_element_capturer_source.h index 196b1da0..2ea2ec8d 100644 --- a/third_party/blink/renderer/modules/mediacapturefromelement/html_video_element_capturer_source.h +++ b/third_party/blink/renderer/modules/mediacapturefromelement/html_video_element_capturer_source.h
@@ -37,6 +37,12 @@ const base::WeakPtr<blink::WebMediaPlayer>& player, const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, scoped_refptr<base::SingleThreadTaskRunner> task_runner); + + HtmlVideoElementCapturerSource(const HtmlVideoElementCapturerSource&) = + delete; + HtmlVideoElementCapturerSource& operator=( + const HtmlVideoElementCapturerSource&) = delete; + ~HtmlVideoElementCapturerSource() override; // media::VideoCapturerSource Implementation. @@ -75,8 +81,6 @@ // Used on main render thread to schedule future capture events. base::WeakPtrFactory<HtmlVideoElementCapturerSource> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(HtmlVideoElementCapturerSource); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediarecorder/audio_track_recorder.h b/third_party/blink/renderer/modules/mediarecorder/audio_track_recorder.h index 5355286b..65c49a3 100644 --- a/third_party/blink/renderer/modules/mediarecorder/audio_track_recorder.h +++ b/third_party/blink/renderer/modules/mediarecorder/audio_track_recorder.h
@@ -56,6 +56,10 @@ base::OnceClosure on_track_source_ended_cb, int32_t bits_per_second, BitrateMode bitrate_mode); + + AudioTrackRecorder(const AudioTrackRecorder&) = delete; + AudioTrackRecorder& operator=(const AudioTrackRecorder&) = delete; + ~AudioTrackRecorder() override; // Implement MediaStreamAudioSink. @@ -102,8 +106,6 @@ // Number of frames per chunked buffer passed to the encoder. int frames_per_chunk_ = 0; - - DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorder); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediarecorder/audio_track_recorder_unittest.cc b/third_party/blink/renderer/modules/mediarecorder/audio_track_recorder_unittest.cc index 6cb703d..9c2cd26 100644 --- a/third_party/blink/renderer/modules/mediarecorder/audio_track_recorder_unittest.cc +++ b/third_party/blink/renderer/modules/mediarecorder/audio_track_recorder_unittest.cc
@@ -137,6 +137,9 @@ 0 /* bits_per_second */, GetParam().bitrateMode); } + AudioTrackRecorderTest(const AudioTrackRecorderTest&) = delete; + AudioTrackRecorderTest& operator=(const AudioTrackRecorderTest&) = delete; + ~AudioTrackRecorderTest() { opus_decoder_destroy(opus_decoder_); opus_decoder_ = nullptr; @@ -267,8 +270,6 @@ CHECK(MediaStreamAudioSource::From(source)->ConnectToTrack( media_stream_component_)); } - - DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorderTest); }; TEST_P(AudioTrackRecorderTest, OnDataOpus) {
diff --git a/third_party/blink/renderer/modules/mediarecorder/media_recorder_handler.h b/third_party/blink/renderer/modules/mediarecorder/media_recorder_handler.h index 1a1d806..241aae1a 100644 --- a/third_party/blink/renderer/modules/mediarecorder/media_recorder_handler.h +++ b/third_party/blink/renderer/modules/mediarecorder/media_recorder_handler.h
@@ -49,6 +49,10 @@ public: explicit MediaRecorderHandler( scoped_refptr<base::SingleThreadTaskRunner> task_runner); + + MediaRecorderHandler(const MediaRecorderHandler&) = delete; + MediaRecorderHandler& operator=(const MediaRecorderHandler&) = delete; + ~MediaRecorderHandler(); // MediaRecorder API isTypeSupported(), which boils down to @@ -170,8 +174,6 @@ std::unique_ptr<media::WebmMuxer> webm_muxer_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - - DISALLOW_COPY_AND_ASSIGN(MediaRecorderHandler); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediarecorder/media_recorder_handler_unittest.cc b/third_party/blink/renderer/modules/mediarecorder/media_recorder_handler_unittest.cc index 664be24..f4f95461 100644 --- a/third_party/blink/renderer/modules/mediarecorder/media_recorder_handler_unittest.cc +++ b/third_party/blink/renderer/modules/mediarecorder/media_recorder_handler_unittest.cc
@@ -128,6 +128,10 @@ registry_.Init(); } + MediaRecorderHandlerFixture(const MediaRecorderHandlerFixture&) = delete; + MediaRecorderHandlerFixture& operator=(const MediaRecorderHandlerFixture&) = + delete; + ~MediaRecorderHandlerFixture() { registry_.reset(); ThreadState::Current()->CollectAllGarbageForTesting(); @@ -203,9 +207,6 @@ media::SineWaveAudioSource audio_source_; MockMediaStreamVideoSource* video_source_ = nullptr; - - private: - DISALLOW_COPY_AND_ASSIGN(MediaRecorderHandlerFixture); }; class MediaRecorderHandlerTest : public TestWithParam<MediaRecorderTestParams>, @@ -698,6 +699,11 @@ EXPECT_FALSE(media_recorder_handler_->recording_); } + MediaRecorderHandlerPassthroughTest( + const MediaRecorderHandlerPassthroughTest&) = delete; + MediaRecorderHandlerPassthroughTest& operator=( + const MediaRecorderHandlerPassthroughTest&) = delete; + ~MediaRecorderHandlerPassthroughTest() { registry_.reset(); media_recorder_handler_ = nullptr; @@ -713,9 +719,6 @@ MockMediaStreamRegistry registry_; MockMediaStreamVideoSource* video_source_ = nullptr; Persistent<MediaRecorderHandler> media_recorder_handler_; - - private: - DISALLOW_COPY_AND_ASSIGN(MediaRecorderHandlerPassthroughTest); }; TEST_P(MediaRecorderHandlerPassthroughTest, PassesThrough) {
diff --git a/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.h b/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.h index 0c6d7a0..c034e66 100644 --- a/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.h +++ b/third_party/blink/renderer/modules/mediarecorder/video_track_recorder.h
@@ -257,6 +257,10 @@ public: CodecEnumerator(const media::VideoEncodeAccelerator::SupportedProfiles& vea_supported_profiles); + + CodecEnumerator(const CodecEnumerator&) = delete; + CodecEnumerator& operator=(const CodecEnumerator&) = delete; + ~CodecEnumerator(); // Returns the first CodecId that has an associated VEA VideoCodecProfile, @@ -284,8 +288,6 @@ HashMap<CodecId, media::VideoEncodeAccelerator::SupportedProfiles> supported_profiles_; CodecId preferred_codec_id_ = CodecId::LAST; - - DISALLOW_COPY_AND_ASSIGN(CodecEnumerator); }; explicit VideoTrackRecorder(base::OnceClosure on_track_source_ended_cb); @@ -325,6 +327,10 @@ base::OnceClosure on_track_source_ended_cb, int32_t bits_per_second, scoped_refptr<base::SequencedTaskRunner> main_task_runner); + + VideoTrackRecorderImpl(const VideoTrackRecorderImpl&) = delete; + VideoTrackRecorderImpl& operator=(const VideoTrackRecorderImpl&) = delete; + ~VideoTrackRecorderImpl() override; void Pause() override; @@ -374,8 +380,6 @@ scoped_refptr<base::SequencedTaskRunner> main_task_runner_; base::WeakPtrFactory<VideoTrackRecorderImpl> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorderImpl); }; // VideoTrackRecorderPassthrough uses the inherited WebMediaStreamSink to @@ -387,6 +391,11 @@ OnEncodedVideoCB on_encoded_video_cb, base::OnceClosure on_track_source_ended_cb, scoped_refptr<base::SequencedTaskRunner> main_task_runner); + + VideoTrackRecorderPassthrough(const VideoTrackRecorderPassthrough&) = delete; + VideoTrackRecorderPassthrough& operator=( + const VideoTrackRecorderPassthrough&) = delete; + ~VideoTrackRecorderPassthrough() override; // VideoTrackRecorderBase @@ -420,8 +429,6 @@ const scoped_refptr<base::SequencedTaskRunner> main_task_runner_; const OnEncodedVideoCB callback_; base::WeakPtrFactory<VideoTrackRecorderPassthrough> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorderPassthrough); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediarecorder/video_track_recorder_unittest.cc b/third_party/blink/renderer/modules/mediarecorder/video_track_recorder_unittest.cc index 19044c7..3dc43ed 100644 --- a/third_party/blink/renderer/modules/mediarecorder/video_track_recorder_unittest.cc +++ b/third_party/blink/renderer/modules/mediarecorder/video_track_recorder_unittest.cc
@@ -138,6 +138,9 @@ ON_CALL(*platform_, GetGpuFactories()).WillByDefault(Return(nullptr)); } + VideoTrackRecorderTest(const VideoTrackRecorderTest&) = delete; + VideoTrackRecorderTest& operator=(const VideoTrackRecorderTest&) = delete; + ~VideoTrackRecorderTest() override { component_ = nullptr; source_ = nullptr; @@ -238,9 +241,6 @@ return video_frame; return video_frame2; } - - private: - DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorderTest); }; // Construct and destruct all objects, in particular |video_track_recorder_| and @@ -722,6 +722,10 @@ using CodecId = VideoTrackRecorder::CodecId; CodecEnumeratorTest() = default; + + CodecEnumeratorTest(const CodecEnumeratorTest&) = delete; + CodecEnumeratorTest& operator=(const CodecEnumeratorTest&) = delete; + ~CodecEnumeratorTest() override = default; media::VideoEncodeAccelerator::SupportedProfiles MakeVp8Profiles() { @@ -758,9 +762,6 @@ 1); return profiles; } - - private: - DISALLOW_COPY_AND_ASSIGN(CodecEnumeratorTest); }; TEST_F(CodecEnumeratorTest, GetPreferredCodecIdDefault) {
diff --git a/third_party/blink/renderer/modules/mediastream/apply_constraints_processor.h b/third_party/blink/renderer/modules/mediastream/apply_constraints_processor.h index fdfe859..e0179667 100644 --- a/third_party/blink/renderer/modules/mediastream/apply_constraints_processor.h +++ b/third_party/blink/renderer/modules/mediastream/apply_constraints_processor.h
@@ -35,6 +35,11 @@ ApplyConstraintsProcessor( MediaDevicesDispatcherCallback media_devices_dispatcher_cb, scoped_refptr<base::SingleThreadTaskRunner> task_runner); + + ApplyConstraintsProcessor(const ApplyConstraintsProcessor&) = delete; + ApplyConstraintsProcessor& operator=(const ApplyConstraintsProcessor&) = + delete; + ~ApplyConstraintsProcessor(); // Starts processing of |request|. When processing of |request| is complete, @@ -92,8 +97,6 @@ THREAD_CHECKER(thread_checker_); const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - - DISALLOW_COPY_AND_ASSIGN(ApplyConstraintsProcessor); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/local_media_stream_audio_source.h b/third_party/blink/renderer/modules/mediastream/local_media_stream_audio_source.h index c30fd4b..ab84be7 100644 --- a/third_party/blink/renderer/modules/mediastream/local_media_stream_audio_source.h +++ b/third_party/blink/renderer/modules/mediastream/local_media_stream_audio_source.h
@@ -39,6 +39,10 @@ ConstraintsRepeatingCallback started_callback, scoped_refptr<base::SingleThreadTaskRunner> task_runner); + LocalMediaStreamAudioSource(const LocalMediaStreamAudioSource&) = delete; + LocalMediaStreamAudioSource& operator=(const LocalMediaStreamAudioSource&) = + delete; + ~LocalMediaStreamAudioSource() final; // MediaStreamAudioSource implementation. @@ -79,8 +83,6 @@ // In debug builds, check that all methods that could cause object graph // or data flow changes are being called on the main thread. THREAD_CHECKER(thread_checker_); - - DISALLOW_COPY_AND_ASSIGN(LocalMediaStreamAudioSource); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/local_video_capturer_source.h b/third_party/blink/renderer/modules/mediastream/local_video_capturer_source.h index 5f37ee2..4b69946 100644 --- a/third_party/blink/renderer/modules/mediastream/local_video_capturer_source.h +++ b/third_party/blink/renderer/modules/mediastream/local_video_capturer_source.h
@@ -45,6 +45,10 @@ scoped_refptr<base::SingleThreadTaskRunner> task_runner, LocalFrame* frame, const base::UnguessableToken& session_id); + + LocalVideoCapturerSource(const LocalVideoCapturerSource&) = delete; + LocalVideoCapturerSource& operator=(const LocalVideoCapturerSource&) = delete; + ~LocalVideoCapturerSource() override; // VideoCaptureSource Implementation. @@ -83,8 +87,6 @@ THREAD_CHECKER(thread_checker_); base::WeakPtrFactory<LocalVideoCapturerSource> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(LocalVideoCapturerSource); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/low_latency_video_renderer_algorithm_unittest.cc b/third_party/blink/renderer/modules/mediastream/low_latency_video_renderer_algorithm_unittest.cc index 4910fd0..2913c885 100644 --- a/third_party/blink/renderer/modules/mediastream/low_latency_video_renderer_algorithm_unittest.cc +++ b/third_party/blink/renderer/modules/mediastream/low_latency_video_renderer_algorithm_unittest.cc
@@ -17,6 +17,11 @@ current_render_time_(base::TimeTicks() + base::TimeDelta::FromDays(1)) { } + LowLatencyVideoRendererAlgorithmTest( + const LowLatencyVideoRendererAlgorithmTest&) = delete; + LowLatencyVideoRendererAlgorithmTest& operator=( + const LowLatencyVideoRendererAlgorithmTest&) = delete; + ~LowLatencyVideoRendererAlgorithmTest() override = default; scoped_refptr<media::VideoFrame> CreateFrame( @@ -83,9 +88,6 @@ media::VideoFramePool frame_pool_; LowLatencyVideoRendererAlgorithm algorithm_; base::TimeTicks current_render_time_; - - private: - DISALLOW_COPY_AND_ASSIGN(LowLatencyVideoRendererAlgorithmTest); }; TEST_F(LowLatencyVideoRendererAlgorithmTest, Empty) {
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_device_observer.h b/third_party/blink/renderer/modules/mediastream/media_stream_device_observer.h index 3e1e217..1dd67443 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_device_observer.h +++ b/third_party/blink/renderer/modules/mediastream/media_stream_device_observer.h
@@ -27,6 +27,10 @@ public: explicit MediaStreamDeviceObserver(LocalFrame* frame); + MediaStreamDeviceObserver(const MediaStreamDeviceObserver&) = delete; + MediaStreamDeviceObserver& operator=(const MediaStreamDeviceObserver&) = + delete; + ~MediaStreamDeviceObserver() override; // Get all the media devices of video capture, e.g. webcam. This is the set @@ -103,8 +107,6 @@ using LabelStreamMap = HashMap<String, Stream>; LabelStreamMap label_stream_map_; - - DISALLOW_COPY_AND_ASSIGN(MediaStreamDeviceObserver); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_renderer_factory.h b/third_party/blink/renderer/modules/mediastream/media_stream_renderer_factory.h index 633ecd7..535b4b5 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_renderer_factory.h +++ b/third_party/blink/renderer/modules/mediastream/media_stream_renderer_factory.h
@@ -27,6 +27,11 @@ class MODULES_EXPORT MediaStreamRendererFactory { public: MediaStreamRendererFactory(); + + MediaStreamRendererFactory(const MediaStreamRendererFactory&) = delete; + MediaStreamRendererFactory& operator=(const MediaStreamRendererFactory&) = + delete; + virtual ~MediaStreamRendererFactory(); virtual scoped_refptr<WebMediaStreamVideoRenderer> GetVideoRenderer( @@ -40,9 +45,6 @@ WebLocalFrame* web_frame, const WebString& device_id, base::RepeatingCallback<void()> on_render_error_callback); - - private: - DISALLOW_COPY_AND_ASSIGN(MediaStreamRendererFactory); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h index 4dff4e9..51cd7aa 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h +++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h
@@ -48,6 +48,12 @@ const MediaStreamDevice& device, const media::VideoCaptureParams& capture_params, DeviceCapturerFactoryCallback device_capturer_factory_callback); + + MediaStreamVideoCapturerSource(const MediaStreamVideoCapturerSource&) = + delete; + MediaStreamVideoCapturerSource& operator=( + const MediaStreamVideoCapturerSource&) = delete; + ~MediaStreamVideoCapturerSource() override; void SetDeviceCapturerFactoryCallbackForTesting( @@ -112,8 +118,6 @@ DeviceCapturerFactoryCallback device_capturer_factory_callback_; base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoCapturerSource); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_renderer_sink.cc b/third_party/blink/renderer/modules/mediastream/media_stream_video_renderer_sink.cc index f25aa5e2..3c64770 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_video_renderer_sink.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_renderer_sink.cc
@@ -44,6 +44,9 @@ DETACH_FROM_THREAD(io_thread_checker_); } + FrameDeliverer(const FrameDeliverer&) = delete; + FrameDeliverer& operator=(const FrameDeliverer&) = delete; + ~FrameDeliverer() { DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_); DCHECK(state_ == STARTED || state_ == PAUSED) << state_; @@ -132,8 +135,6 @@ // Used for DCHECKs to ensure method calls are executed on the correct thread. THREAD_CHECKER(io_thread_checker_); - - DISALLOW_COPY_AND_ASSIGN(FrameDeliverer); }; MediaStreamVideoRendererSink::MediaStreamVideoRendererSink(
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_track.h b/third_party/blink/renderer/modules/mediastream/media_stream_video_track.h index a643df0b..c9de41e8 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_video_track.h +++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_track.h
@@ -77,6 +77,10 @@ bool pan_tilt_zoom_allowed, MediaStreamVideoSource::ConstraintsOnceCallback callback, bool enabled); + + MediaStreamVideoTrack(const MediaStreamVideoTrack&) = delete; + MediaStreamVideoTrack& operator=(const MediaStreamVideoTrack&) = delete; + ~MediaStreamVideoTrack() override; // MediaStreamTrack overrides. @@ -234,8 +238,6 @@ WeakPersistent<MediaStreamVideoTrackSignalObserver> signal_observer_; base::WeakPtrFactory<MediaStreamVideoTrack> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoTrack); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/mock_constraint_factory.h b/third_party/blink/renderer/modules/mediastream/mock_constraint_factory.h index 27457d9..4f032ae3 100644 --- a/third_party/blink/renderer/modules/mediastream/mock_constraint_factory.h +++ b/third_party/blink/renderer/modules/mediastream/mock_constraint_factory.h
@@ -16,6 +16,10 @@ class MockConstraintFactory { public: MockConstraintFactory(); + + MockConstraintFactory(const MockConstraintFactory&) = delete; + MockConstraintFactory& operator=(const MockConstraintFactory&) = delete; + ~MockConstraintFactory(); MediaConstraints CreateMediaConstraints() const; @@ -29,8 +33,6 @@ private: MediaTrackConstraintSetPlatform basic_; Vector<MediaTrackConstraintSetPlatform> advanced_; - - DISALLOW_COPY_AND_ASSIGN(MockConstraintFactory); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.h b/third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.h index 12b476e..488f212a 100644 --- a/third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.h +++ b/third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.h
@@ -18,6 +18,11 @@ explicit MockMediaStreamVideoSource(bool respond_to_request_refresh_frame); MockMediaStreamVideoSource(const media::VideoCaptureFormat& format, bool respond_to_request_refresh_frame); + + MockMediaStreamVideoSource(const MockMediaStreamVideoSource&) = delete; + MockMediaStreamVideoSource& operator=(const MockMediaStreamVideoSource&) = + delete; + ~MockMediaStreamVideoSource() override; MOCK_METHOD1(DoSetMutedState, void(bool muted_state)); @@ -103,8 +108,6 @@ EncodedVideoFrameCB encoded_frame_callback_; base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MockMediaStreamVideoSource); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/mock_mojo_media_stream_dispatcher_host.h b/third_party/blink/renderer/modules/mediastream/mock_mojo_media_stream_dispatcher_host.h index 9bfb58bd..4e48474 100644 --- a/third_party/blink/renderer/modules/mediastream/mock_mojo_media_stream_dispatcher_host.h +++ b/third_party/blink/renderer/modules/mediastream/mock_mojo_media_stream_dispatcher_host.h
@@ -20,6 +20,12 @@ : public mojom::blink::MediaStreamDispatcherHost { public: MockMojoMediaStreamDispatcherHost(); + + MockMojoMediaStreamDispatcherHost(const MockMojoMediaStreamDispatcherHost&) = + delete; + MockMojoMediaStreamDispatcherHost& operator=( + const MockMojoMediaStreamDispatcherHost&) = delete; + ~MockMojoMediaStreamDispatcherHost() override; mojo::PendingRemote<mojom::blink::MediaStreamDispatcherHost> @@ -76,8 +82,6 @@ WTF::Vector<MediaStreamDevice> video_devices_; GenerateStreamCallback generate_stream_cb_; mojo::Receiver<mojom::blink::MediaStreamDispatcherHost> receiver_{this}; - - DISALLOW_COPY_AND_ASSIGN(MockMojoMediaStreamDispatcherHost); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/processed_local_audio_source.h b/third_party/blink/renderer/modules/mediastream/processed_local_audio_source.h index 311a4c1..45cf48c 100644 --- a/third_party/blink/renderer/modules/mediastream/processed_local_audio_source.h +++ b/third_party/blink/renderer/modules/mediastream/processed_local_audio_source.h
@@ -52,6 +52,10 @@ ConstraintsOnceCallback started_callback, scoped_refptr<base::SingleThreadTaskRunner> task_runner); + ProcessedLocalAudioSource(const ProcessedLocalAudioSource&) = delete; + ProcessedLocalAudioSource& operator=(const ProcessedLocalAudioSource&) = + delete; + ~ProcessedLocalAudioSource() final; // If |source| is an instance of ProcessedLocalAudioSource, return a @@ -162,8 +166,6 @@ // Provides weak pointers for tasks posted by this instance. base::WeakPtrFactory<ProcessedLocalAudioSource> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ProcessedLocalAudioSource); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/user_media_client.h b/third_party/blink/renderer/modules/mediastream/user_media_client.h index 044c525..bbcf358 100644 --- a/third_party/blink/renderer/modules/mediastream/user_media_client.h +++ b/third_party/blink/renderer/modules/mediastream/user_media_client.h
@@ -48,6 +48,10 @@ UserMediaClient(LocalFrame* frame, UserMediaProcessor* user_media_processor, scoped_refptr<base::SingleThreadTaskRunner> task_runner); + + UserMediaClient(const UserMediaClient&) = delete; + UserMediaClient& operator=(const UserMediaClient&) = delete; + virtual ~UserMediaClient(); void RequestUserMedia(UserMediaRequest* user_media_request); @@ -74,6 +78,10 @@ explicit Request(UserMediaRequest* request); explicit Request(blink::ApplyConstraintsRequest* request); explicit Request(MediaStreamComponent* request); + + Request(const Request&) = delete; + Request& operator=(const Request&) = delete; + ~Request(); UserMediaRequest* MoveUserMediaRequest(); @@ -98,8 +106,6 @@ Member<UserMediaRequest> user_media_request_; Member<blink::ApplyConstraintsRequest> apply_constraints_request_; Member<MediaStreamComponent> track_to_stop_; - - DISALLOW_COPY_AND_ASSIGN(Request); }; void MaybeProcessNextRequestInfo(); @@ -131,8 +137,6 @@ HeapDeque<Member<Request>> pending_request_infos_; THREAD_CHECKER(thread_checker_); - - DISALLOW_COPY_AND_ASSIGN(UserMediaClient); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/user_media_processor.h b/third_party/blink/renderer/modules/mediastream/user_media_processor.h index e8c863c8..637369b 100644 --- a/third_party/blink/renderer/modules/mediastream/user_media_processor.h +++ b/third_party/blink/renderer/modules/mediastream/user_media_processor.h
@@ -56,6 +56,10 @@ UserMediaProcessor(LocalFrame* frame, MediaDevicesDispatcherCallback media_devices_dispatcher_cb, scoped_refptr<base::SingleThreadTaskRunner> task_runner); + + UserMediaProcessor(const UserMediaProcessor&) = delete; + UserMediaProcessor& operator=(const UserMediaProcessor&) = delete; + virtual ~UserMediaProcessor(); // It can be assumed that the output of CurrentRequest() remains the same @@ -305,8 +309,6 @@ scoped_refptr<base::SingleThreadTaskRunner> task_runner_; THREAD_CHECKER(thread_checker_); - - DISALLOW_COPY_AND_ASSIGN(UserMediaProcessor); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/webaudio_media_stream_audio_sink.h b/third_party/blink/renderer/modules/mediastream/webaudio_media_stream_audio_sink.h index c12e1b1..c7eebcbd 100644 --- a/third_party/blink/renderer/modules/mediastream/webaudio_media_stream_audio_sink.h +++ b/third_party/blink/renderer/modules/mediastream/webaudio_media_stream_audio_sink.h
@@ -50,6 +50,11 @@ explicit WebAudioMediaStreamAudioSink(MediaStreamComponent* component, int context_sample_rate); + + WebAudioMediaStreamAudioSink(const WebAudioMediaStreamAudioSink&) = delete; + WebAudioMediaStreamAudioSink& operator=(const WebAudioMediaStreamAudioSink&) = + delete; + ~WebAudioMediaStreamAudioSink() override; // WebMediaStreamAudioSink implementation. @@ -111,8 +116,6 @@ // Used to assert that OnReadyStateChanged() is not accessed concurrently. REENTRANCY_CHECKER(ready_state_reentrancy_checker_); - - DISALLOW_COPY_AND_ASSIGN(WebAudioMediaStreamAudioSink); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms.cc b/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms.cc index 05fb8d8d..2a94b39 100644 --- a/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms.cc +++ b/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms.cc
@@ -164,6 +164,9 @@ } } + FrameDeliverer(const FrameDeliverer&) = delete; + FrameDeliverer& operator=(const FrameDeliverer&) = delete; + ~FrameDeliverer() { DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_); if (gpu_memory_buffer_pool_) { @@ -299,8 +302,6 @@ base::WeakPtrFactory<FrameDeliverer> weak_factory_for_pool_{this}; base::WeakPtrFactory<FrameDeliverer> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FrameDeliverer); }; WebMediaPlayerMS::WebMediaPlayerMS(
diff --git a/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_test.cc b/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_test.cc index 4cbe188..c50d5709 100644 --- a/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_test.cc +++ b/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_test.cc
@@ -87,6 +87,11 @@ public base::SupportsWeakPtr<FakeWebMediaPlayerDelegate> { public: FakeWebMediaPlayerDelegate() {} + + FakeWebMediaPlayerDelegate(const FakeWebMediaPlayerDelegate&) = delete; + FakeWebMediaPlayerDelegate& operator=(const FakeWebMediaPlayerDelegate&) = + delete; + ~FakeWebMediaPlayerDelegate() override { DCHECK(!observer_); DCHECK(is_gone_); @@ -156,8 +161,6 @@ bool is_hidden_ = false; bool is_gone_ = true; bool is_idle_ = false; - - DISALLOW_COPY_AND_ASSIGN(FakeWebMediaPlayerDelegate); }; class ReusableMessageLoopEvent {
diff --git a/third_party/blink/renderer/modules/notifications/notification_manager.h b/third_party/blink/renderer/modules/notifications/notification_manager.h index 5fa5d7b..97c1e453 100644 --- a/third_party/blink/renderer/modules/notifications/notification_manager.h +++ b/third_party/blink/renderer/modules/notifications/notification_manager.h
@@ -34,6 +34,10 @@ static NotificationManager* From(ExecutionContext* context); explicit NotificationManager(ExecutionContext& context); + + NotificationManager(const NotificationManager&) = delete; + NotificationManager& operator=(const NotificationManager&) = delete; + ~NotificationManager(); // Returns the notification permission status of the current origin. This @@ -104,8 +108,6 @@ HeapMojoRemote<mojom::blink::NotificationService> notification_service_; HeapMojoRemote<mojom::blink::PermissionService> permission_service_; - - DISALLOW_COPY_AND_ASSIGN(NotificationManager); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/payments/abort_payment_event.h b/third_party/blink/renderer/modules/payments/abort_payment_event.h index 43b7457..47ee996 100644 --- a/third_party/blink/renderer/modules/payments/abort_payment_event.h +++ b/third_party/blink/renderer/modules/payments/abort_payment_event.h
@@ -36,6 +36,10 @@ const ExtendableEventInit*, RespondWithObserver*, WaitUntilObserver*); + + AbortPaymentEvent(const AbortPaymentEvent&) = delete; + AbortPaymentEvent& operator=(const AbortPaymentEvent&) = delete; + ~AbortPaymentEvent() override; const AtomicString& InterfaceName() const override; @@ -46,8 +50,6 @@ private: Member<RespondWithObserver> observer_; - - DISALLOW_COPY_AND_ASSIGN(AbortPaymentEvent); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/payments/can_make_payment_event.h b/third_party/blink/renderer/modules/payments/can_make_payment_event.h index 0e5ad67f..94dc7df 100644 --- a/third_party/blink/renderer/modules/payments/can_make_payment_event.h +++ b/third_party/blink/renderer/modules/payments/can_make_payment_event.h
@@ -38,6 +38,10 @@ const CanMakePaymentEventInit*, CanMakePaymentRespondWithObserver*, WaitUntilObserver*); + + CanMakePaymentEvent(const CanMakePaymentEvent&) = delete; + CanMakePaymentEvent& operator=(const CanMakePaymentEvent&) = delete; + ~CanMakePaymentEvent() override; const AtomicString& InterfaceName() const override; @@ -58,8 +62,6 @@ HeapVector<Member<PaymentDetailsModifier>> modifiers_; Member<CanMakePaymentRespondWithObserver> observer_; - - DISALLOW_COPY_AND_ASSIGN(CanMakePaymentEvent); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/payments/merchant_validation_event.h b/third_party/blink/renderer/modules/payments/merchant_validation_event.h index 41c3532..df8d5367 100644 --- a/third_party/blink/renderer/modules/payments/merchant_validation_event.h +++ b/third_party/blink/renderer/modules/payments/merchant_validation_event.h
@@ -35,6 +35,10 @@ const AtomicString& type, const MerchantValidationEventInit*, ExceptionState&); + + MerchantValidationEvent(const MerchantValidationEvent&) = delete; + MerchantValidationEvent& operator=(const MerchantValidationEvent&) = delete; + ~MerchantValidationEvent() override; const AtomicString& InterfaceName() const override; @@ -49,8 +53,6 @@ // Set to true after .complete() is called. bool wait_for_update_; - - DISALLOW_COPY_AND_ASSIGN(MerchantValidationEvent); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/payments/payment_address.h b/third_party/blink/renderer/modules/payments/payment_address.h index ed6b7dae..0d5cace 100644 --- a/third_party/blink/renderer/modules/payments/payment_address.h +++ b/third_party/blink/renderer/modules/payments/payment_address.h
@@ -21,6 +21,10 @@ public: explicit PaymentAddress(payments::mojom::blink::PaymentAddressPtr); + + PaymentAddress(const PaymentAddress&) = delete; + PaymentAddress& operator=(const PaymentAddress&) = delete; + ~PaymentAddress() override; ScriptValue toJSONForBinding(ScriptState*) const; @@ -47,8 +51,6 @@ String organization_; String recipient_; String phone_; - - DISALLOW_COPY_AND_ASSIGN(PaymentAddress); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/payments/payment_app_service_worker_registration.h b/third_party/blink/renderer/modules/payments/payment_app_service_worker_registration.h index 3871acd..5c4438c96 100644 --- a/third_party/blink/renderer/modules/payments/payment_app_service_worker_registration.h +++ b/third_party/blink/renderer/modules/payments/payment_app_service_worker_registration.h
@@ -23,6 +23,12 @@ static const char kSupplementName[]; explicit PaymentAppServiceWorkerRegistration(ServiceWorkerRegistration*); + + PaymentAppServiceWorkerRegistration( + const PaymentAppServiceWorkerRegistration&) = delete; + PaymentAppServiceWorkerRegistration& operator=( + const PaymentAppServiceWorkerRegistration&) = delete; + virtual ~PaymentAppServiceWorkerRegistration(); static PaymentAppServiceWorkerRegistration& From(ServiceWorkerRegistration&); @@ -35,8 +41,6 @@ private: Member<PaymentManager> payment_manager_; - - DISALLOW_COPY_AND_ASSIGN(PaymentAppServiceWorkerRegistration); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/payments/payment_request.h b/third_party/blink/renderer/modules/payments/payment_request.h index d18cc156..9aa1ed0f 100644 --- a/third_party/blink/renderer/modules/payments/payment_request.h +++ b/third_party/blink/renderer/modules/payments/payment_request.h
@@ -67,6 +67,10 @@ mojo::PendingRemote<payments::mojom::blink::PaymentRequest> mock_payment_provider, ExceptionState&); + + PaymentRequest(const PaymentRequest&) = delete; + PaymentRequest& operator=(const PaymentRequest&) = delete; + ~PaymentRequest() override; ScriptPromise show(ScriptState*, ExceptionState&); @@ -187,8 +191,6 @@ HeapTaskRunnerTimer<PaymentRequest> update_payment_details_timer_; bool is_waiting_for_show_promise_to_resolve_; bool ignore_total_; - - DISALLOW_COPY_AND_ASSIGN(PaymentRequest); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/payments/payment_request_event.h b/third_party/blink/renderer/modules/payments/payment_request_event.h index bc2483b..e1e1ca2 100644 --- a/third_party/blink/renderer/modules/payments/payment_request_event.h +++ b/third_party/blink/renderer/modules/payments/payment_request_event.h
@@ -49,6 +49,10 @@ RespondWithObserver*, WaitUntilObserver*, ExecutionContext* execution_context); + + PaymentRequestEvent(const PaymentRequestEvent&) = delete; + PaymentRequestEvent& operator=(const PaymentRequestEvent&) = delete; + ~PaymentRequestEvent() override; const AtomicString& InterfaceName() const override; @@ -101,8 +105,6 @@ Member<RespondWithObserver> observer_; HeapMojoRemote<payments::mojom::blink::PaymentHandlerHost> payment_handler_host_; - - DISALLOW_COPY_AND_ASSIGN(PaymentRequestEvent); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/payments/payment_request_update_event_test.cc b/third_party/blink/renderer/modules/payments/payment_request_update_event_test.cc index 791252ca..5427551 100644 --- a/third_party/blink/renderer/modules/payments/payment_request_update_event_test.cc +++ b/third_party/blink/renderer/modules/payments/payment_request_update_event_test.cc
@@ -26,6 +26,10 @@ public PaymentRequestDelegate { public: MockPaymentRequest() = default; + + MockPaymentRequest(const MockPaymentRequest&) = delete; + MockPaymentRequest& operator=(const MockPaymentRequest&) = delete; + ~MockPaymentRequest() override = default; MOCK_METHOD1(OnUpdatePaymentDetails, @@ -34,9 +38,6 @@ bool IsInteractive() const override { return true; } void Trace(Visitor* visitor) const override {} - - private: - DISALLOW_COPY_AND_ASSIGN(MockPaymentRequest); }; TEST(PaymentRequestUpdateEventTest, OnUpdatePaymentDetailsCalled) {
diff --git a/third_party/blink/renderer/modules/payments/payment_response.cc b/third_party/blink/renderer/modules/payments/payment_response.cc index 409aa58..5a7a284d 100644 --- a/third_party/blink/renderer/modules/payments/payment_response.cc +++ b/third_party/blink/renderer/modules/payments/payment_response.cc
@@ -36,17 +36,14 @@ std::move(info->client_data_json), std::move(info->authenticator_data), std::move(secure_payment_confirmation->signature), - secure_payment_confirmation->has_transport - ? absl::make_optional(mojo::ConvertTo<String>( - secure_payment_confirmation->transport)) - : absl::nullopt, secure_payment_confirmation->user_handle); auto* result = MakeGarbageCollected<PublicKeyCredential>( secure_payment_confirmation->credential_info->id, DOMArrayBuffer::Create(static_cast<const void*>(info->raw_id.data()), info->raw_id.size()), - authenticator_response, + authenticator_response, secure_payment_confirmation->has_transport, + secure_payment_confirmation->transport, AuthenticationExtensionsClientOutputs::Create()); return result->Wrap(script_state).ToLocalChecked(); }
diff --git a/third_party/blink/renderer/modules/payments/payment_response.h b/third_party/blink/renderer/modules/payments/payment_response.h index 1af46c3..1142c9e 100644 --- a/third_party/blink/renderer/modules/payments/payment_response.h +++ b/third_party/blink/renderer/modules/payments/payment_response.h
@@ -39,6 +39,10 @@ PaymentAddress* shipping_address, PaymentStateResolver* payment_state_resolver, const String& request_id); + + PaymentResponse(const PaymentResponse&) = delete; + PaymentResponse& operator=(const PaymentResponse&) = delete; + ~PaymentResponse() override; void Update(ScriptState* script_state, @@ -81,8 +85,6 @@ String payer_email_; String payer_phone_; Member<PaymentStateResolver> payment_state_resolver_; - - DISALLOW_COPY_AND_ASSIGN(PaymentResponse); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/payments/payment_response_test.cc b/third_party/blink/renderer/modules/payments/payment_response_test.cc index 1c17ecd..6949ae0 100644 --- a/third_party/blink/renderer/modules/payments/payment_response_test.cc +++ b/third_party/blink/renderer/modules/payments/payment_response_test.cc
@@ -33,6 +33,9 @@ .WillByDefault(testing::ReturnPointee(&dummy_promise_)); } + MockPaymentStateResolver(const MockPaymentStateResolver&) = delete; + MockPaymentStateResolver& operator=(const MockPaymentStateResolver&) = delete; + ~MockPaymentStateResolver() override = default; MOCK_METHOD3(Complete, @@ -50,8 +53,6 @@ private: ScriptPromise dummy_promise_; - - DISALLOW_COPY_AND_ASSIGN(MockPaymentStateResolver); }; TEST(PaymentResponseTest, DataCopiedOver) {
diff --git a/third_party/blink/renderer/modules/peerconnection/media_stream_remote_video_source.h b/third_party/blink/renderer/modules/peerconnection/media_stream_remote_video_source.h index 555a514..e75e31a 100644 --- a/third_party/blink/renderer/modules/peerconnection/media_stream_remote_video_source.h +++ b/third_party/blink/renderer/modules/peerconnection/media_stream_remote_video_source.h
@@ -27,6 +27,11 @@ explicit MediaStreamRemoteVideoSource( scoped_refptr<base::SingleThreadTaskRunner> task_runner, std::unique_ptr<TrackObserver> observer); + + MediaStreamRemoteVideoSource(const MediaStreamRemoteVideoSource&) = delete; + MediaStreamRemoteVideoSource& operator=(const MediaStreamRemoteVideoSource&) = + delete; + ~MediaStreamRemoteVideoSource() override; // Should be called when the remote video track this source originates from is @@ -63,8 +68,6 @@ std::unique_ptr<TrackObserver> observer_; base::WeakPtrFactory<MediaStreamVideoSource> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MediaStreamRemoteVideoSource); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/media_stream_track_metrics.h b/third_party/blink/renderer/modules/peerconnection/media_stream_track_metrics.h index 8156ad0..fc71746 100644 --- a/third_party/blink/renderer/modules/peerconnection/media_stream_track_metrics.h +++ b/third_party/blink/renderer/modules/peerconnection/media_stream_track_metrics.h
@@ -31,6 +31,10 @@ class MODULES_EXPORT MediaStreamTrackMetrics { public: explicit MediaStreamTrackMetrics(); + + MediaStreamTrackMetrics(const MediaStreamTrackMetrics&) = delete; + MediaStreamTrackMetrics& operator=(const MediaStreamTrackMetrics&) = delete; + ~MediaStreamTrackMetrics(); enum class Direction { kSend, kReceive }; @@ -100,8 +104,6 @@ webrtc::PeerConnectionInterface::IceConnectionState ice_state_; THREAD_CHECKER(thread_checker_); - - DISALLOW_COPY_AND_ASSIGN(MediaStreamTrackMetrics); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/media_stream_video_webrtc_sink.h b/third_party/blink/renderer/modules/peerconnection/media_stream_video_webrtc_sink.h index eed2442..914e79c 100644 --- a/third_party/blink/renderer/modules/peerconnection/media_stream_video_webrtc_sink.h +++ b/third_party/blink/renderer/modules/peerconnection/media_stream_video_webrtc_sink.h
@@ -37,6 +37,11 @@ MediaStreamComponent* component, PeerConnectionDependencyFactory* factory, scoped_refptr<base::SingleThreadTaskRunner> task_runner); + + MediaStreamVideoWebRtcSink(const MediaStreamVideoWebRtcSink&) = delete; + MediaStreamVideoWebRtcSink& operator=(const MediaStreamVideoWebRtcSink&) = + delete; + ~MediaStreamVideoWebRtcSink() override; webrtc::VideoTrackInterface* webrtc_video_track() { @@ -74,8 +79,6 @@ // TODO(crbug.com/787254): Make this object Oilpan-able, and get // rid of this weak prt factory use. base::WeakPtrFactory<MediaStreamVideoWebRtcSink> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoWebRtcSink); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/mock_peer_connection_dependency_factory.h b/third_party/blink/renderer/modules/peerconnection/mock_peer_connection_dependency_factory.h index c904047..f5c5870 100644 --- a/third_party/blink/renderer/modules/peerconnection/mock_peer_connection_dependency_factory.h +++ b/third_party/blink/renderer/modules/peerconnection/mock_peer_connection_dependency_factory.h
@@ -166,6 +166,12 @@ : public blink::PeerConnectionDependencyFactory { public: MockPeerConnectionDependencyFactory(); + + MockPeerConnectionDependencyFactory( + const MockPeerConnectionDependencyFactory&) = delete; + MockPeerConnectionDependencyFactory& operator=( + const MockPeerConnectionDependencyFactory&) = delete; + ~MockPeerConnectionDependencyFactory() override; scoped_refptr<webrtc::PeerConnectionInterface> CreatePeerConnection( @@ -196,8 +202,6 @@ // TODO(crbug.com/787254): Replace with the appropriate Blink class. base::Thread signaling_thread_; bool fail_to_create_session_description_ = false; - - DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionDependencyFactory); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_client.h b/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_client.h index 7b0d1c7..82668a9 100644 --- a/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_client.h +++ b/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_client.h
@@ -22,6 +22,12 @@ : public RTCPeerConnectionHandlerClient { public: MockRTCPeerConnectionHandlerClient(); + + MockRTCPeerConnectionHandlerClient( + const MockRTCPeerConnectionHandlerClient&) = delete; + MockRTCPeerConnectionHandlerClient& operator=( + const MockRTCPeerConnectionHandlerClient&) = delete; + ~MockRTCPeerConnectionHandlerClient() override; // RTCPeerConnectionHandlerClient implementation. @@ -99,8 +105,6 @@ std::string candidate_sdp_; absl::optional<uint16_t> candidate_mline_index_; std::string candidate_mid_; - - DISALLOW_COPY_AND_ASSIGN(MockRTCPeerConnectionHandlerClient); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.h b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.h index 08fbc7f..8fe12e7 100644 --- a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.h +++ b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.h
@@ -67,6 +67,12 @@ PeerConnectionDependencyFactory( ExecutionContext& context, base::PassKey<PeerConnectionDependencyFactory>); + + PeerConnectionDependencyFactory(const PeerConnectionDependencyFactory&) = + delete; + PeerConnectionDependencyFactory& operator=( + const PeerConnectionDependencyFactory&) = delete; + ~PeerConnectionDependencyFactory() override; // Create a RTCPeerConnectionHandler object. @@ -189,8 +195,6 @@ media::GpuVideoAcceleratorFactories* gpu_factories_; THREAD_CHECKER(thread_checker_); - - DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_tracker.h b/third_party/blink/renderer/modules/peerconnection/peer_connection_tracker.h index 61a558c..26cf467 100644 --- a/third_party/blink/renderer/modules/peerconnection/peer_connection_tracker.h +++ b/third_party/blink/renderer/modules/peerconnection/peer_connection_tracker.h
@@ -55,6 +55,10 @@ LocalDOMWindow& window, scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, base::PassKey<PeerConnectionTracker>); + + PeerConnectionTracker(const PeerConnectionTracker&) = delete; + PeerConnectionTracker& operator=(const PeerConnectionTracker&) = delete; + ~PeerConnectionTracker() override; // Ctors for tests. @@ -313,8 +317,6 @@ mojo::Receiver<blink::mojom::blink::PeerConnectionManager> receiver_{this}; scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; - - DISALLOW_COPY_AND_ASSIGN(PeerConnectionTracker); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_certificate_generator.h b/third_party/blink/renderer/modules/peerconnection/rtc_certificate_generator.h index d8846c7..96a8a32 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_certificate_generator.h +++ b/third_party/blink/renderer/modules/peerconnection/rtc_certificate_generator.h
@@ -27,6 +27,10 @@ class MODULES_EXPORT RTCCertificateGenerator { public: RTCCertificateGenerator() {} + + RTCCertificateGenerator(const RTCCertificateGenerator&) = delete; + RTCCertificateGenerator& operator=(const RTCCertificateGenerator&) = delete; + ~RTCCertificateGenerator() {} // Start generating a certificate asynchronously. |observer| is invoked on the @@ -53,9 +57,6 @@ // |rtc::RTCCertificate::ToPEM|. rtc::scoped_refptr<rtc::RTCCertificate> FromPEM(String pem_private_key, String pem_certificate); - - private: - DISALLOW_COPY_AND_ASSIGN(RTCCertificateGenerator); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_data_channel_test.cc b/third_party/blink/renderer/modules/peerconnection/rtc_data_channel_test.cc index be026790..f2f3f6ce 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_data_channel_test.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_data_channel_test.cc
@@ -214,6 +214,10 @@ class RTCDataChannelTest : public ::testing::Test { public: RTCDataChannelTest() : signaling_thread_(new base::TestSimpleTaskRunner()) {} + + RTCDataChannelTest(const RTCDataChannelTest&) = delete; + RTCDataChannelTest& operator=(const RTCDataChannelTest&) = delete; + ~RTCDataChannelTest() override { execution_context_->NotifyContextDestroyed(); } @@ -228,8 +232,6 @@ private: scoped_refptr<base::TestSimpleTaskRunner> signaling_thread_; - - DISALLOW_COPY_AND_ASSIGN(RTCDataChannelTest); }; } // namespace
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.h b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.h index 0279dff..5760b24 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.h +++ b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.h
@@ -168,6 +168,10 @@ scoped_refptr<base::SingleThreadTaskRunner> task_runner, bool force_encoded_audio_insertable_streams, bool force_encoded_video_insertable_streams); + + RTCPeerConnectionHandler(const RTCPeerConnectionHandler&) = delete; + RTCPeerConnectionHandler& operator=(const RTCPeerConnectionHandler&) = delete; + virtual ~RTCPeerConnectionHandler(); // Initialize method only used for unit test. @@ -537,8 +541,6 @@ scoped_refptr<base::SingleThreadTaskRunner> task_runner_; base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/webrtc_set_description_observer.h b/third_party/blink/renderer/modules/peerconnection/webrtc_set_description_observer.h index 196348e2..2c1f8f62 100644 --- a/third_party/blink/renderer/modules/peerconnection/webrtc_set_description_observer.h +++ b/third_party/blink/renderer/modules/peerconnection/webrtc_set_description_observer.h
@@ -52,6 +52,10 @@ struct MODULES_EXPORT States { States(); States(States&& other); + + States(const States&) = delete; + States& operator=(const States&) = delete; + ~States(); States& operator=(States&& other); @@ -67,8 +71,6 @@ pending_remote_description; std::unique_ptr<webrtc::SessionDescriptionInterface> current_remote_description; - - DISALLOW_COPY_AND_ASSIGN(States); }; WebRtcSetDescriptionObserver();
diff --git a/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.h b/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.h index f9d09a5..df4d8c1 100644 --- a/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.h +++ b/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_impl.h
@@ -37,6 +37,12 @@ public blink::mojom::blink::PictureInPictureSessionObserver { public: explicit PictureInPictureControllerImpl(Document&); + + PictureInPictureControllerImpl(const PictureInPictureControllerImpl&) = + delete; + PictureInPictureControllerImpl& operator=( + const PictureInPictureControllerImpl&) = delete; + ~PictureInPictureControllerImpl() override = default; // Gets, or creates, PictureInPictureControllerImpl supplement on Document. @@ -152,8 +158,6 @@ // Instance of the Picture-in-Picture session sent back by the service. HeapMojoRemote<mojom::blink::PictureInPictureSession> picture_in_picture_session_; - - DISALLOW_COPY_AND_ASSIGN(PictureInPictureControllerImpl); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_test.cc b/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_test.cc index f5635cc..f7fff0b 100644 --- a/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_test.cc +++ b/third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_controller_test.cc
@@ -78,6 +78,11 @@ .WillByDefault(testing::Invoke( this, &MockPictureInPictureService::StartSessionInternal)); } + + MockPictureInPictureService(const MockPictureInPictureService&) = delete; + MockPictureInPictureService& operator=(const MockPictureInPictureService&) = + delete; + ~MockPictureInPictureService() override = default; void Bind(mojo::ScopedMessagePipeHandle handle) { @@ -116,8 +121,6 @@ mojo::Receiver<mojom::blink::PictureInPictureService> receiver_{this}; std::unique_ptr<MockPictureInPictureSession> session_; mojo::PendingRemote<mojom::blink::PictureInPictureSession> session_remote_; - - DISALLOW_COPY_AND_ASSIGN(MockPictureInPictureService); }; class PictureInPictureControllerFrameClient @@ -140,6 +143,12 @@ class PictureInPictureControllerPlayer final : public EmptyWebMediaPlayer { public: PictureInPictureControllerPlayer() = default; + + PictureInPictureControllerPlayer(const PictureInPictureControllerPlayer&) = + delete; + PictureInPictureControllerPlayer& operator=( + const PictureInPictureControllerPlayer&) = delete; + ~PictureInPictureControllerPlayer() override = default; double Duration() const override { @@ -157,8 +166,6 @@ private: bool infinity_duration_ = false; absl::optional<viz::SurfaceId> surface_id_; - - DISALLOW_COPY_AND_ASSIGN(PictureInPictureControllerPlayer); }; class PictureInPictureTestWebFrameClient
diff --git a/third_party/blink/renderer/modules/presentation/presentation_availability_callbacks.h b/third_party/blink/renderer/modules/presentation/presentation_availability_callbacks.h index 0c12191..0168dd0 100644 --- a/third_party/blink/renderer/modules/presentation/presentation_availability_callbacks.h +++ b/third_party/blink/renderer/modules/presentation/presentation_availability_callbacks.h
@@ -24,6 +24,12 @@ public: PresentationAvailabilityCallbacks(PresentationAvailabilityProperty*, const WTF::Vector<KURL>&); + + PresentationAvailabilityCallbacks(const PresentationAvailabilityCallbacks&) = + delete; + PresentationAvailabilityCallbacks& operator=( + const PresentationAvailabilityCallbacks&) = delete; + virtual ~PresentationAvailabilityCallbacks(); virtual void Resolve(bool value); @@ -34,8 +40,6 @@ private: Member<PresentationAvailabilityProperty> resolver_; const WTF::Vector<KURL> urls_; - - DISALLOW_COPY_AND_ASSIGN(PresentationAvailabilityCallbacks); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/presentation/presentation_availability_state.h b/third_party/blink/renderer/modules/presentation/presentation_availability_state.h index d93fe9c..832ccf3 100644 --- a/third_party/blink/renderer/modules/presentation/presentation_availability_state.h +++ b/third_party/blink/renderer/modules/presentation/presentation_availability_state.h
@@ -32,6 +32,11 @@ : public GarbageCollected<PresentationAvailabilityState> { public: explicit PresentationAvailabilityState(mojom::blink::PresentationService*); + + PresentationAvailabilityState(const PresentationAvailabilityState&) = delete; + PresentationAvailabilityState& operator=( + const PresentationAvailabilityState&) = delete; + ~PresentationAvailabilityState(); // Requests availability for the given URLs and invokes the given callbacks @@ -64,6 +69,10 @@ : public GarbageCollected<AvailabilityListener> { public: explicit AvailabilityListener(const Vector<KURL>& availability_urls); + + AvailabilityListener(const AvailabilityListener&) = delete; + AvailabilityListener& operator=(const AvailabilityListener&) = delete; + ~AvailabilityListener(); const Vector<KURL> urls; @@ -72,9 +81,6 @@ HeapVector<Member<PresentationAvailabilityObserver>> availability_observers; void Trace(Visitor*) const; - - private: - DISALLOW_COPY_AND_ASSIGN(AvailabilityListener); }; // Tracks listening status and screen availability of |availability_url|. @@ -125,8 +131,6 @@ // A pointer to PresentationService owned by PresentationController. mojom::blink::PresentationService* const presentation_service_; - - DISALLOW_COPY_AND_ASSIGN(PresentationAvailabilityState); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/presentation/presentation_connection_callbacks.h b/third_party/blink/renderer/modules/presentation/presentation_connection_callbacks.h index f890e28..b23ddc8a 100644 --- a/third_party/blink/renderer/modules/presentation/presentation_connection_callbacks.h +++ b/third_party/blink/renderer/modules/presentation/presentation_connection_callbacks.h
@@ -33,6 +33,12 @@ PresentationConnectionCallbacks(ScriptPromiseResolver*, PresentationRequest*); PresentationConnectionCallbacks(ScriptPromiseResolver*, ControllerPresentationConnection*); + + PresentationConnectionCallbacks(const PresentationConnectionCallbacks&) = + delete; + PresentationConnectionCallbacks& operator=( + const PresentationConnectionCallbacks&) = delete; + ~PresentationConnectionCallbacks() = default; void HandlePresentationResponse(mojom::blink::PresentationConnectionResultPtr, @@ -54,8 +60,6 @@ Persistent<ScriptPromiseResolver> resolver_; Persistent<PresentationRequest> request_; WeakPersistent<ControllerPresentationConnection> connection_; - - DISALLOW_COPY_AND_ASSIGN(PresentationConnectionCallbacks); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/presentation/presentation_controller.h b/third_party/blink/renderer/modules/presentation/presentation_controller.h index 41312f0d..166758b3 100644 --- a/third_party/blink/renderer/modules/presentation/presentation_controller.h +++ b/third_party/blink/renderer/modules/presentation/presentation_controller.h
@@ -35,6 +35,10 @@ static const char kSupplementName[]; explicit PresentationController(LocalDOMWindow&); + + PresentationController(const PresentationController&) = delete; + PresentationController& operator=(const PresentationController&) = delete; + ~PresentationController() override; static PresentationController* From(LocalDOMWindow&); @@ -105,8 +109,6 @@ // to |presentation_service_|'s implementation. HeapMojoReceiver<mojom::blink::PresentationController, PresentationController> presentation_controller_receiver_; - - DISALLOW_COPY_AND_ASSIGN(PresentationController); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/push_messaging/push_messaging_bridge.h b/third_party/blink/renderer/modules/push_messaging/push_messaging_bridge.h index e8c2236..eda14605 100644 --- a/third_party/blink/renderer/modules/push_messaging/push_messaging_bridge.h +++ b/third_party/blink/renderer/modules/push_messaging/push_messaging_bridge.h
@@ -33,6 +33,10 @@ static PushMessagingBridge* From(ServiceWorkerRegistration* registration); explicit PushMessagingBridge(ServiceWorkerRegistration& registration); + + PushMessagingBridge(const PushMessagingBridge&) = delete; + PushMessagingBridge& operator=(const PushMessagingBridge&) = delete; + virtual ~PushMessagingBridge(); // Asynchronously determines the permission state for the current origin. @@ -48,8 +52,6 @@ mojom::blink::PermissionStatus status); HeapMojoRemote<mojom::blink::PermissionService> permission_service_; - - DISALLOW_COPY_AND_ASSIGN(PushMessagingBridge); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/push_messaging/push_messaging_client.h b/third_party/blink/renderer/modules/push_messaging/push_messaging_client.h index 12672fd1..a016e74f 100644 --- a/third_party/blink/renderer/modules/push_messaging/push_messaging_client.h +++ b/third_party/blink/renderer/modules/push_messaging/push_messaging_client.h
@@ -33,6 +33,10 @@ static const char kSupplementName[]; explicit PushMessagingClient(LocalDOMWindow&); + + PushMessagingClient(const PushMessagingClient&) = delete; + PushMessagingClient& operator=(const PushMessagingClient&) = delete; + ~PushMessagingClient() = default; static PushMessagingClient* From(LocalDOMWindow&); @@ -66,8 +70,6 @@ mojom::blink::PushSubscriptionPtr subscription); HeapMojoRemote<mojom::blink::PushMessaging> push_messaging_manager_; - - DISALLOW_COPY_AND_ASSIGN(PushMessagingClient); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/push_messaging/push_provider.h b/third_party/blink/renderer/modules/push_messaging/push_provider.h index b9cb8cc..e0bd8450 100644 --- a/third_party/blink/renderer/modules/push_messaging/push_provider.h +++ b/third_party/blink/renderer/modules/push_messaging/push_provider.h
@@ -35,6 +35,10 @@ static const char kSupplementName[]; explicit PushProvider(ServiceWorkerRegistration& registration); + + PushProvider(const PushProvider&) = delete; + PushProvider& operator=(const PushProvider&) = delete; + ~PushProvider() = default; static PushProvider* From(ServiceWorkerRegistration* registration); @@ -66,8 +70,6 @@ mojom::blink::PushSubscriptionPtr subscription); HeapMojoRemote<mojom::blink::PushMessaging> push_messaging_manager_; - - DISALLOW_COPY_AND_ASSIGN(PushProvider); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/push_messaging/push_subscription_callbacks.h b/third_party/blink/renderer/modules/push_messaging/push_subscription_callbacks.h index 4191beac..b302d1b 100644 --- a/third_party/blink/renderer/modules/push_messaging/push_subscription_callbacks.h +++ b/third_party/blink/renderer/modules/push_messaging/push_subscription_callbacks.h
@@ -30,6 +30,11 @@ PushSubscriptionCallbacks( ScriptPromiseResolver* resolver, ServiceWorkerRegistration* service_worker_registration); + + PushSubscriptionCallbacks(const PushSubscriptionCallbacks&) = delete; + PushSubscriptionCallbacks& operator=(const PushSubscriptionCallbacks&) = + delete; + ~PushSubscriptionCallbacks() override; // WebCallbacks<S, T> interface. @@ -39,8 +44,6 @@ private: Persistent<ScriptPromiseResolver> resolver_; Persistent<ServiceWorkerRegistration> service_worker_registration_; - - DISALLOW_COPY_AND_ASSIGN(PushSubscriptionCallbacks); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/push_messaging/service_worker_registration_push.h b/third_party/blink/renderer/modules/push_messaging/service_worker_registration_push.h index d577ca9..3b23451f 100644 --- a/third_party/blink/renderer/modules/push_messaging/service_worker_registration_push.h +++ b/third_party/blink/renderer/modules/push_messaging/service_worker_registration_push.h
@@ -23,6 +23,11 @@ explicit ServiceWorkerRegistrationPush( ServiceWorkerRegistration* registration); + + ServiceWorkerRegistrationPush(const ServiceWorkerRegistrationPush&) = delete; + ServiceWorkerRegistrationPush& operator=( + const ServiceWorkerRegistrationPush&) = delete; + virtual ~ServiceWorkerRegistrationPush(); static ServiceWorkerRegistrationPush& From( ServiceWorkerRegistration& registration); @@ -34,8 +39,6 @@ private: Member<PushManager> push_manager_; - - DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistrationPush); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/remoteplayback/availability_callback_wrapper.h b/third_party/blink/renderer/modules/remoteplayback/availability_callback_wrapper.h index fefd1f7..32154828 100644 --- a/third_party/blink/renderer/modules/remoteplayback/availability_callback_wrapper.h +++ b/third_party/blink/renderer/modules/remoteplayback/availability_callback_wrapper.h
@@ -23,6 +23,11 @@ public: explicit AvailabilityCallbackWrapper(V8RemotePlaybackAvailabilityCallback*); explicit AvailabilityCallbackWrapper(base::RepeatingClosure); + + AvailabilityCallbackWrapper(const AvailabilityCallbackWrapper&) = delete; + AvailabilityCallbackWrapper& operator=(const AvailabilityCallbackWrapper&) = + delete; + ~AvailabilityCallbackWrapper() override = default; void Run(RemotePlayback*, bool new_availability); @@ -36,8 +41,6 @@ // Only one of these callbacks must be set. Member<V8RemotePlaybackAvailabilityCallback> bindings_cb_; base::RepeatingClosure internal_cb_; - - DISALLOW_COPY_AND_ASSIGN(AvailabilityCallbackWrapper); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/scheduler/task_priority_change_event.h b/third_party/blink/renderer/modules/scheduler/task_priority_change_event.h index 416f303..3ef18c83 100644 --- a/third_party/blink/renderer/modules/scheduler/task_priority_change_event.h +++ b/third_party/blink/renderer/modules/scheduler/task_priority_change_event.h
@@ -24,6 +24,10 @@ TaskPriorityChangeEvent(const AtomicString& type, const TaskPriorityChangeEventInit*); + + TaskPriorityChangeEvent(const TaskPriorityChangeEvent&) = delete; + TaskPriorityChangeEvent& operator=(const TaskPriorityChangeEvent&) = delete; + ~TaskPriorityChangeEvent() override; const AtomicString& InterfaceName() const override; @@ -32,8 +36,6 @@ private: const V8TaskPriority previous_priority_; - - DISALLOW_COPY_AND_ASSIGN(TaskPriorityChangeEvent); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/screen_orientation/lock_orientation_callback.h b/third_party/blink/renderer/modules/screen_orientation/lock_orientation_callback.h index 282497e..60de987 100644 --- a/third_party/blink/renderer/modules/screen_orientation/lock_orientation_callback.h +++ b/third_party/blink/renderer/modules/screen_orientation/lock_orientation_callback.h
@@ -22,6 +22,10 @@ public: explicit LockOrientationCallback(ScriptPromiseResolver*); + + LockOrientationCallback(const LockOrientationCallback&) = delete; + LockOrientationCallback& operator=(const LockOrientationCallback&) = delete; + ~LockOrientationCallback() override; void OnSuccess() override; @@ -29,8 +33,6 @@ private: Persistent<ScriptPromiseResolver> resolver_; - - DISALLOW_COPY_AND_ASSIGN(LockOrientationCallback); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/screen_orientation/screen_orientation_controller.h b/third_party/blink/renderer/modules/screen_orientation/screen_orientation_controller.h index e27043b..41d8bc22e 100644 --- a/third_party/blink/renderer/modules/screen_orientation/screen_orientation_controller.h +++ b/third_party/blink/renderer/modules/screen_orientation/screen_orientation_controller.h
@@ -32,6 +32,11 @@ public Supplement<LocalDOMWindow> { public: explicit ScreenOrientationController(LocalDOMWindow&); + + ScreenOrientationController(const ScreenOrientationController&) = delete; + ScreenOrientationController& operator=(const ScreenOrientationController&) = + delete; + ~ScreenOrientationController() override; void SetOrientation(ScreenOrientation*); @@ -84,8 +89,6 @@ screen_orientation_service_; std::unique_ptr<WebLockOrientationCallback> pending_callback_; int request_id_ = 0; - - DISALLOW_COPY_AND_ASSIGN(ScreenOrientationController); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/sensor/sensor_provider_proxy.h b/third_party/blink/renderer/modules/sensor/sensor_provider_proxy.h index 7c002d4..1f52f48 100644 --- a/third_party/blink/renderer/modules/sensor/sensor_provider_proxy.h +++ b/third_party/blink/renderer/modules/sensor/sensor_provider_proxy.h
@@ -30,6 +30,10 @@ static SensorProviderProxy* From(LocalDOMWindow*); explicit SensorProviderProxy(LocalDOMWindow&); + + SensorProviderProxy(const SensorProviderProxy&) = delete; + SensorProviderProxy& operator=(const SensorProviderProxy&) = delete; + ~SensorProviderProxy(); SensorProxy* CreateSensorProxy(device::mojom::blink::SensorType, Page*); @@ -55,8 +59,6 @@ HeapHashSet<WeakMember<SensorProxy>> sensor_proxies_; HeapMojoRemote<device::mojom::blink::SensorProvider> sensor_provider_; bool inspector_mode_; - - DISALLOW_COPY_AND_ASSIGN(SensorProviderProxy); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/sensor/sensor_proxy.h b/third_party/blink/renderer/modules/sensor/sensor_proxy.h index f19de97a..22b0789 100644 --- a/third_party/blink/renderer/modules/sensor/sensor_proxy.h +++ b/third_party/blink/renderer/modules/sensor/sensor_proxy.h
@@ -40,6 +40,9 @@ const String& unsanitized_message) {} }; + SensorProxy(const SensorProxy&) = delete; + SensorProxy& operator=(const SensorProxy&) = delete; + ~SensorProxy() override; void Dispose(); @@ -110,8 +113,6 @@ sizeof(device::SensorReadingSharedBuffer) == device::mojom::blink::SensorInitParams::kReadBufferSizeForTests, "Check reading buffer size for tests"); - - DISALLOW_COPY_AND_ASSIGN(SensorProxy); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/sensor/sensor_proxy_impl.h b/third_party/blink/renderer/modules/sensor/sensor_proxy_impl.h index 7b1db97..178ecdc 100644 --- a/third_party/blink/renderer/modules/sensor/sensor_proxy_impl.h +++ b/third_party/blink/renderer/modules/sensor/sensor_proxy_impl.h
@@ -25,6 +25,10 @@ SensorProxyImpl(device::mojom::blink::SensorType, SensorProviderProxy*, Page*); + + SensorProxyImpl(const SensorProxyImpl&) = delete; + SensorProxyImpl& operator=(const SensorProxyImpl&) = delete; + ~SensorProxyImpl() override; void Trace(Visitor*) const override; @@ -87,8 +91,6 @@ WTF::Vector<double> active_frequencies_; HeapTaskRunnerTimer<SensorProxyImpl> polling_timer_; - - DISALLOW_COPY_AND_ASSIGN(SensorProxyImpl); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/sensor/sensor_proxy_inspector_impl.h b/third_party/blink/renderer/modules/sensor/sensor_proxy_inspector_impl.h index be5cfde..9c67fbe 100644 --- a/third_party/blink/renderer/modules/sensor/sensor_proxy_inspector_impl.h +++ b/third_party/blink/renderer/modules/sensor/sensor_proxy_inspector_impl.h
@@ -16,6 +16,10 @@ SensorProxyInspectorImpl(device::mojom::blink::SensorType sensor_type, SensorProviderProxy* provider, Page* page); + + SensorProxyInspectorImpl(const SensorProxyInspectorImpl&) = delete; + SensorProxyInspectorImpl& operator=(const SensorProxyInspectorImpl&) = delete; + ~SensorProxyInspectorImpl() override; void Trace(Visitor*) const override; @@ -45,8 +49,6 @@ void Resume() override; bool suspended_ = false; - - DISALLOW_COPY_AND_ASSIGN(SensorProxyInspectorImpl); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_container.cc b/third_party/blink/renderer/modules/service_worker/service_worker_container.cc index 902368f..e0059de 100644 --- a/third_party/blink/renderer/modules/service_worker/service_worker_container.cc +++ b/third_party/blink/renderer/modules/service_worker/service_worker_container.cc
@@ -108,6 +108,10 @@ public: explicit GetRegistrationCallback(ScriptPromiseResolver* resolver) : resolver_(resolver) {} + + GetRegistrationCallback(const GetRegistrationCallback&) = delete; + GetRegistrationCallback& operator=(const GetRegistrationCallback&) = delete; + ~GetRegistrationCallback() override = default; void OnSuccess(WebServiceWorkerRegistrationObjectInfo info) override { @@ -133,7 +137,6 @@ private: Persistent<ScriptPromiseResolver> resolver_; - DISALLOW_COPY_AND_ASSIGN(GetRegistrationCallback); }; } // namespace
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_content_settings_proxy.h b/third_party/blink/renderer/modules/service_worker/service_worker_content_settings_proxy.h index 375e5c9..a6405c3 100644 --- a/third_party/blink/renderer/modules/service_worker/service_worker_content_settings_proxy.h +++ b/third_party/blink/renderer/modules/service_worker/service_worker_content_settings_proxy.h
@@ -23,6 +23,12 @@ public: explicit ServiceWorkerContentSettingsProxy( mojo::PendingRemote<mojom::blink::WorkerContentSettingsProxy> host_info); + + ServiceWorkerContentSettingsProxy(const ServiceWorkerContentSettingsProxy&) = + delete; + ServiceWorkerContentSettingsProxy& operator=( + const ServiceWorkerContentSettingsProxy&) = delete; + ~ServiceWorkerContentSettingsProxy() override; void SetSecurityOrigin(scoped_refptr<const blink::SecurityOrigin>); @@ -41,8 +47,6 @@ // local storage on the service worker thread when GetService() is called for // the first time. mojo::PendingRemote<mojom::blink::WorkerContentSettingsProxy> host_info_; - - DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContentSettingsProxy); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.h b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.h index 783dbe19..fe58a9d 100644 --- a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.h +++ b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope_proxy.h
@@ -72,6 +72,11 @@ WebServiceWorkerContextClient&, scoped_refptr<base::SingleThreadTaskRunner> parent_thread_default_task_runner); + + ServiceWorkerGlobalScopeProxy(const ServiceWorkerGlobalScopeProxy&) = delete; + ServiceWorkerGlobalScopeProxy& operator=( + const ServiceWorkerGlobalScopeProxy&) = delete; + ~ServiceWorkerGlobalScopeProxy() override; // WebServiceWorkerContextProxy overrides: @@ -157,8 +162,6 @@ CrossThreadPersistent<ServiceWorkerGlobalScope> worker_global_scope_; THREAD_CHECKER(worker_thread_checker_); - - DISALLOW_COPY_AND_ASSIGN(ServiceWorkerGlobalScopeProxy); }; // TODO(leonhsl): This is only used by ServiceWorkerGlobalScope for calling
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager_test.cc b/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager_test.cc index e6225c9..bc8285b 100644 --- a/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager_test.cc +++ b/third_party/blink/renderer/modules/service_worker/service_worker_installed_scripts_manager_test.cc
@@ -27,6 +27,10 @@ : mojom::blink::ServiceWorkerInstalledScriptsManagerHost { public: BrowserSideSender() = default; + + BrowserSideSender(const BrowserSideSender&) = delete; + BrowserSideSender& operator=(const BrowserSideSender&) = delete; + ~BrowserSideSender() override = default; mojom::blink::ServiceWorkerInstalledScriptsInfoPtr CreateAndBind( @@ -110,8 +114,6 @@ mojo::ScopedDataPipeProducerHandle body_handle_; mojo::ScopedDataPipeProducerHandle meta_data_handle_; - - DISALLOW_COPY_AND_ASSIGN(BrowserSideSender); }; CrossThreadHTTPHeaderMapData ToCrossThreadHTTPHeaderMapData(
diff --git a/third_party/blink/renderer/modules/vibration/vibration_controller.h b/third_party/blink/renderer/modules/vibration/vibration_controller.h index 4ae4905..45e0874 100644 --- a/third_party/blink/renderer/modules/vibration/vibration_controller.h +++ b/third_party/blink/renderer/modules/vibration/vibration_controller.h
@@ -52,6 +52,10 @@ static bool vibrate(Navigator&, const VibrationPattern&); explicit VibrationController(Navigator&); + + VibrationController(const VibrationController&) = delete; + VibrationController& operator=(const VibrationController&) = delete; + ~VibrationController() override; static VibrationPattern SanitizeVibrationPattern( @@ -108,8 +112,6 @@ bool is_calling_vibrate_; VibrationPattern pattern_; - - DISALLOW_COPY_AND_ASSIGN(VibrationController); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/video_rvfc/video_frame_callback_requester_impl.h b/third_party/blink/renderer/modules/video_rvfc/video_frame_callback_requester_impl.h index 6c8e442..e4326b9 100644 --- a/third_party/blink/renderer/modules/video_rvfc/video_frame_callback_requester_impl.h +++ b/third_party/blink/renderer/modules/video_rvfc/video_frame_callback_requester_impl.h
@@ -31,6 +31,12 @@ static void cancelVideoFrameCallback(HTMLVideoElement&, int); explicit VideoFrameCallbackRequesterImpl(HTMLVideoElement&); + + VideoFrameCallbackRequesterImpl(const VideoFrameCallbackRequesterImpl&) = + delete; + VideoFrameCallbackRequesterImpl& operator=( + const VideoFrameCallbackRequesterImpl&) = delete; + ~VideoFrameCallbackRequesterImpl() override; void Trace(Visitor*) const override; @@ -117,8 +123,6 @@ // Only used to invalidate pending OnExecution() calls. base::WeakPtrFactory<VideoFrameCallbackRequesterImpl> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(VideoFrameCallbackRequesterImpl); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webaudio/async_audio_decoder.h b/third_party/blink/renderer/modules/webaudio/async_audio_decoder.h index 6f782e2c..3e4400d 100644 --- a/third_party/blink/renderer/modules/webaudio/async_audio_decoder.h +++ b/third_party/blink/renderer/modules/webaudio/async_audio_decoder.h
@@ -52,6 +52,10 @@ public: AsyncAudioDecoder() = default; + + AsyncAudioDecoder(const AsyncAudioDecoder&) = delete; + AsyncAudioDecoder& operator=(const AsyncAudioDecoder&) = delete; + ~AsyncAudioDecoder() = default; // Must be called on the main thread. |decodeAsync| and callees must not @@ -81,8 +85,6 @@ AudioBus*, ScriptPromiseResolver*, BaseAudioContext*); - - DISALLOW_COPY_AND_ASSIGN(AsyncAudioDecoder); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet.h b/third_party/blink/renderer/modules/webaudio/audio_worklet.h index 83677b5..a77ca8a 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet.h +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet.h
@@ -24,6 +24,10 @@ public: explicit AudioWorklet(BaseAudioContext*); + + AudioWorklet(const AudioWorklet&) = delete; + AudioWorklet& operator=(const AudioWorklet&) = delete; + ~AudioWorklet() override = default; void CreateProcessor(scoped_refptr<AudioWorkletHandler>, @@ -61,8 +65,6 @@ bool worklet_started_ = false; Member<BaseAudioContext> context_; - - DISALLOW_COPY_AND_ASSIGN(AudioWorklet); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webaudio/inspector_web_audio_agent.h b/third_party/blink/renderer/modules/webaudio/inspector_web_audio_agent.h index 7351c42b..5b40b3dd 100644 --- a/third_party/blink/renderer/modules/webaudio/inspector_web_audio_agent.h +++ b/third_party/blink/renderer/modules/webaudio/inspector_web_audio_agent.h
@@ -24,6 +24,10 @@ : public InspectorBaseAgent<protocol::WebAudio::Metainfo> { public: explicit InspectorWebAudioAgent(Page*); + + InspectorWebAudioAgent(const InspectorWebAudioAgent&) = delete; + InspectorWebAudioAgent& operator=(const InspectorWebAudioAgent&) = delete; + ~InspectorWebAudioAgent() override; // Base Agent methods. @@ -69,7 +73,6 @@ Member<Page> page_; InspectorAgentState::Boolean enabled_; - DISALLOW_COPY_AND_ASSIGN(InspectorWebAudioAgent); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.cc b/third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.cc index 5cdd8fcd..b0ad1248 100644 --- a/third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.cc +++ b/third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.cc
@@ -51,12 +51,16 @@ : lockable_(lockable) { lockable_.lock(); } + + MediaElementAudioSourceHandlerLocker( + const MediaElementAudioSourceHandlerLocker&) = delete; + MediaElementAudioSourceHandlerLocker& operator=( + const MediaElementAudioSourceHandlerLocker&) = delete; + ~MediaElementAudioSourceHandlerLocker() { lockable_.unlock(); } private: MediaElementAudioSourceHandler& lockable_; - - DISALLOW_COPY_AND_ASSIGN(MediaElementAudioSourceHandlerLocker); }; MediaElementAudioSourceHandler::MediaElementAudioSourceHandler(
diff --git a/third_party/blink/renderer/modules/webdatabase/database_task.h b/third_party/blink/renderer/modules/webdatabase/database_task.h index 44994e9..5d0b419 100644 --- a/third_party/blink/renderer/modules/webdatabase/database_task.h +++ b/third_party/blink/renderer/modules/webdatabase/database_task.h
@@ -48,6 +48,9 @@ USING_FAST_MALLOC(DatabaseTask); public: + DatabaseTask(const DatabaseTask&) = delete; + DatabaseTask& operator=(const DatabaseTask&) = delete; + virtual ~DatabaseTask(); void Run(); @@ -68,8 +71,6 @@ virtual const char* DebugTaskName() const = 0; bool complete_; #endif - - DISALLOW_COPY_AND_ASSIGN(DatabaseTask); }; class Database::DatabaseOpenTask final : public DatabaseTask {
diff --git a/third_party/blink/renderer/modules/webdatabase/inspector_database_agent.h b/third_party/blink/renderer/modules/webdatabase/inspector_database_agent.h index 47ef962..2bfd947 100644 --- a/third_party/blink/renderer/modules/webdatabase/inspector_database_agent.h +++ b/third_party/blink/renderer/modules/webdatabase/inspector_database_agent.h
@@ -47,6 +47,10 @@ : public InspectorBaseAgent<protocol::Database::Metainfo> { public: explicit InspectorDatabaseAgent(Page*); + + InspectorDatabaseAgent(const InspectorDatabaseAgent&) = delete; + InspectorDatabaseAgent& operator=(const InspectorDatabaseAgent&) = delete; + ~InspectorDatabaseAgent() override; void Trace(Visitor*) const override; @@ -80,8 +84,6 @@ DatabaseResourcesHeapMap; DatabaseResourcesHeapMap resources_; InspectorAgentState::Boolean enabled_; - - DISALLOW_COPY_AND_ASSIGN(InspectorDatabaseAgent); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_database.h b/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_database.h index 17617ee..ce43432 100644 --- a/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_database.h +++ b/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_database.h
@@ -55,6 +55,10 @@ public: SQLiteDatabase(); + + SQLiteDatabase(const SQLiteDatabase&) = delete; + SQLiteDatabase& operator=(const SQLiteDatabase&) = delete; + ~SQLiteDatabase(); bool Open(const String& filename); @@ -150,8 +154,6 @@ std::string open_error_message_; int last_changes_count_; - - DISALLOW_COPY_AND_ASSIGN(SQLiteDatabase); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_statement.h b/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_statement.h index a9faab2d..f2cfdd6 100644 --- a/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_statement.h +++ b/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_statement.h
@@ -41,6 +41,10 @@ public: SQLiteStatement(SQLiteDatabase&, const String&); + + SQLiteStatement(const SQLiteStatement&) = delete; + SQLiteStatement& operator=(const SQLiteStatement&) = delete; + ~SQLiteStatement(); int Prepare(); @@ -81,8 +85,6 @@ #if DCHECK_IS_ON() bool is_prepared_ = false; #endif - - DISALLOW_COPY_AND_ASSIGN(SQLiteStatement); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_transaction.h b/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_transaction.h index 5cb79f4..b1a337a 100644 --- a/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_transaction.h +++ b/third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_transaction.h
@@ -38,6 +38,10 @@ public: SQLiteTransaction(SQLiteDatabase& db, bool read_only = false); + + SQLiteTransaction(const SQLiteTransaction&) = delete; + SQLiteTransaction& operator=(const SQLiteTransaction&) = delete; + ~SQLiteTransaction(); void begin(); @@ -52,8 +56,6 @@ SQLiteDatabase& db_; bool in_progress_; bool read_only_; - - DISALLOW_COPY_AND_ASSIGN(SQLiteTransaction); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webgl/webgl2_rendering_context.h b/third_party/blink/renderer/modules/webgl/webgl2_rendering_context.h index 6e1927b..dedfd7c 100644 --- a/third_party/blink/renderer/modules/webgl/webgl2_rendering_context.h +++ b/third_party/blink/renderer/modules/webgl/webgl2_rendering_context.h
@@ -41,6 +41,10 @@ class Factory : public CanvasRenderingContextFactory { public: Factory() = default; + + Factory(const Factory&) = delete; + Factory& operator=(const Factory&) = delete; + ~Factory() override = default; CanvasRenderingContext* Create( @@ -51,9 +55,6 @@ return CanvasRenderingContext::CanvasRenderingAPI::kWebgl2; } void OnError(HTMLCanvasElement*, const String& error) override; - - private: - DISALLOW_COPY_AND_ASSIGN(Factory); }; WebGL2RenderingContext(
diff --git a/third_party/blink/renderer/modules/webgl/webgl_context_group.h b/third_party/blink/renderer/modules/webgl/webgl_context_group.h index 9e94ef3..826f3e6 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_context_group.h +++ b/third_party/blink/renderer/modules/webgl/webgl_context_group.h
@@ -37,6 +37,10 @@ public NameClient { public: WebGLContextGroup(); + + WebGLContextGroup(const WebGLContextGroup&) = delete; + WebGLContextGroup& operator=(const WebGLContextGroup&) = delete; + ~WebGLContextGroup() final = default; void AddContext(WebGLRenderingContextBase*); @@ -70,8 +74,6 @@ uint32_t number_of_context_losses_; HeapHashSet<Member<WebGLRenderingContextBase>> contexts_; - - DISALLOW_COPY_AND_ASSIGN(WebGLContextGroup); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webgl/webgl_object.h b/third_party/blink/renderer/modules/webgl/webgl_object.h index 61038f13..7e4806b1 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_object.h +++ b/third_party/blink/renderer/modules/webgl/webgl_object.h
@@ -63,6 +63,9 @@ USING_PRE_FINALIZER(WebGLObject, Dispose); public: + WebGLObject(const WebGLObject&) = delete; + WebGLObject& operator=(const WebGLObject&) = delete; + // We can't call virtual functions like deleteObjectImpl in this class's // destructor; doing so results in a pure virtual function call. Further, // making this destructor non-virtual is complicated with respect to @@ -135,8 +138,6 @@ // Indicates whether the destructor has been entered and we therefore // need to be careful in subclasses to not touch other on-heap objects. bool destruction_in_progress_; - - DISALLOW_COPY_AND_ASSIGN(WebGLObject); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context.h b/third_party/blink/renderer/modules/webgl/webgl_rendering_context.h index 82c5673..877f6fac 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context.h +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context.h
@@ -69,6 +69,10 @@ class Factory : public CanvasRenderingContextFactory { public: Factory() = default; + + Factory(const Factory&) = delete; + Factory& operator=(const Factory&) = delete; + ~Factory() override = default; CanvasRenderingContext* Create( @@ -80,9 +84,6 @@ return CanvasRenderingContext::CanvasRenderingAPI::kWebgl; } void OnError(HTMLCanvasElement*, const String& error) override; - - private: - DISALLOW_COPY_AND_ASSIGN(Factory); }; WebGLRenderingContext(CanvasRenderingContextHost*,
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h index 7cd14233..36f5a5d 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
@@ -139,6 +139,10 @@ public DrawingBuffer::Client, public NoAllocDirectCallHost { public: + WebGLRenderingContextBase(const WebGLRenderingContextBase&) = delete; + WebGLRenderingContextBase& operator=(const WebGLRenderingContextBase&) = + delete; + ~WebGLRenderingContextBase() override; HTMLCanvasElement* canvas() const { @@ -1907,8 +1911,6 @@ bool has_been_drawn_to_ = false; CanvasColorParams color_params_; - - DISALLOW_COPY_AND_ASSIGN(WebGLRenderingContextBase); }; template <>
diff --git a/third_party/blink/renderer/modules/webgpu/gpu.h b/third_party/blink/renderer/modules/webgpu/gpu.h index 54ddcd9..d059b172 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu.h +++ b/third_party/blink/renderer/modules/webgpu/gpu.h
@@ -36,6 +36,10 @@ static GPU* gpu(NavigatorBase&); explicit GPU(NavigatorBase&); + + GPU(const GPU&) = delete; + GPU& operator=(const GPU&) = delete; + ~GPU() override; // ScriptWrappable overrides @@ -69,8 +73,6 @@ scoped_refptr<DawnControlClientHolder> dawn_control_client_; HeapHashSet<WeakMember<GPUBuffer>> mappable_buffers_; - - DISALLOW_COPY_AND_ASSIGN(GPU); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.h b/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.h index c33e13f..1833774 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.h +++ b/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.h
@@ -27,10 +27,13 @@ public: class Factory : public CanvasRenderingContextFactory { - DISALLOW_COPY_AND_ASSIGN(Factory); public: Factory(); + + Factory(const Factory&) = delete; + Factory& operator=(const Factory&) = delete; + ~Factory() override; CanvasRenderingContext* Create( @@ -41,6 +44,10 @@ GPUCanvasContext(CanvasRenderingContextHost*, const CanvasContextCreationAttributesCore&); + + GPUCanvasContext(const GPUCanvasContext&) = delete; + GPUCanvasContext& operator=(const GPUCanvasContext&) = delete; + ~GPUCanvasContext() override; void Trace(Visitor*) const override; @@ -83,8 +90,6 @@ GPUTexture* getCurrentTexture(ExceptionState&); private: - DISALLOW_COPY_AND_ASSIGN(GPUCanvasContext); - cc::PaintFlags::FilterQuality filter_quality_ = cc::PaintFlags::FilterQuality::kLow; Member<GPUSwapChain> swapchain_;
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_device.h b/third_party/blink/renderer/modules/webgpu/gpu_device.h index 92f0839..a8deb2b 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_device.h +++ b/third_party/blink/renderer/modules/webgpu/gpu_device.h
@@ -66,6 +66,10 @@ WGPUDevice dawn_device, const WGPUSupportedLimits* limits, const GPUDeviceDescriptor* descriptor); + + GPUDevice(const GPUDevice&) = delete; + GPUDevice& operator=(const GPUDevice&) = delete; + ~GPUDevice() override; void Trace(Visitor* visitor) const override; @@ -178,8 +182,6 @@ bool has_pending_microtask_ = false; HeapVector<Member<GPUExternalTexture>> external_textures_pending_destroy_; - - DISALLOW_COPY_AND_ASSIGN(GPUDevice); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h b/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h index 352430b..f3efc3c 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h +++ b/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h
@@ -31,6 +31,10 @@ WGPUTextureFormat, cc::PaintFlags::FilterQuality, IntSize); + + GPUSwapChain(const GPUSwapChain&) = delete; + GPUSwapChain& operator=(const GPUSwapChain&) = delete; + virtual ~GPUSwapChain(); void Trace(Visitor* visitor) const; @@ -62,9 +66,6 @@ // WebGPUSwapBufferProvider::Client implementation void OnTextureTransferred() override; - private: - DISALLOW_COPY_AND_ASSIGN(GPUSwapChain); - scoped_refptr<WebGPUSwapBufferProvider> swap_buffers_; Member<GPUDevice> device_;
diff --git a/third_party/blink/renderer/modules/websockets/websocket_channel.h b/third_party/blink/renderer/modules/websockets/websocket_channel.h index e981932d..ef6adcc 100644 --- a/third_party/blink/renderer/modules/websockets/websocket_channel.h +++ b/third_party/blink/renderer/modules/websockets/websocket_channel.h
@@ -52,6 +52,10 @@ enum class SendResult { SENT_SYNCHRONOUSLY, CALLBACK_WILL_BE_CALLED }; WebSocketChannel() = default; + + WebSocketChannel(const WebSocketChannel&) = delete; + WebSocketChannel& operator=(const WebSocketChannel&) = delete; + virtual ~WebSocketChannel() = default; enum CloseEventCode { @@ -116,9 +120,6 @@ virtual void RemoveBackpressure() = 0; virtual void Trace(Visitor* visitor) const {} - - private: - DISALLOW_COPY_AND_ASSIGN(WebSocketChannel); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/websockets/websocket_common.h b/third_party/blink/renderer/modules/websockets/websocket_common.h index e4507b0..43be129 100644 --- a/third_party/blink/renderer/modules/websockets/websocket_common.h +++ b/third_party/blink/renderer/modules/websockets/websocket_common.h
@@ -28,6 +28,10 @@ public: WebSocketCommon() = default; + + WebSocketCommon(const WebSocketCommon&) = delete; + WebSocketCommon& operator=(const WebSocketCommon&) = delete; + ~WebSocketCommon() = default; enum State { kConnecting = 0, kOpen = 1, kClosing = 2, kClosed = 3 }; @@ -71,8 +75,6 @@ KURL url_; State state_ = kConnecting; - - DISALLOW_COPY_AND_ASSIGN(WebSocketCommon); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/xr/xr_enter_fullscreen_observer.h b/third_party/blink/renderer/modules/xr/xr_enter_fullscreen_observer.h index d687dc6..d5e2a43b 100644 --- a/third_party/blink/renderer/modules/xr/xr_enter_fullscreen_observer.h +++ b/third_party/blink/renderer/modules/xr/xr_enter_fullscreen_observer.h
@@ -18,6 +18,11 @@ class XrEnterFullscreenObserver : public NativeEventListener { public: XrEnterFullscreenObserver(); + + XrEnterFullscreenObserver(const XrEnterFullscreenObserver&) = delete; + XrEnterFullscreenObserver& operator=(const XrEnterFullscreenObserver&) = + delete; + ~XrEnterFullscreenObserver() override; // NativeEventListener @@ -34,7 +39,6 @@ private: Member<Element> fullscreen_element_; base::OnceCallback<void(bool)> on_completed_; - DISALLOW_COPY_AND_ASSIGN(XrEnterFullscreenObserver); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/xr/xr_exit_fullscreen_observer.h b/third_party/blink/renderer/modules/xr/xr_exit_fullscreen_observer.h index 2e3928e..78481f64 100644 --- a/third_party/blink/renderer/modules/xr/xr_exit_fullscreen_observer.h +++ b/third_party/blink/renderer/modules/xr/xr_exit_fullscreen_observer.h
@@ -20,6 +20,10 @@ class XrExitFullscreenObserver : public NativeEventListener { public: XrExitFullscreenObserver(); + + XrExitFullscreenObserver(const XrExitFullscreenObserver&) = delete; + XrExitFullscreenObserver& operator=(const XrExitFullscreenObserver&) = delete; + ~XrExitFullscreenObserver() override; // NativeEventListener @@ -32,7 +36,6 @@ private: Member<Document> document_; base::OnceClosure on_exited_; - DISALLOW_COPY_AND_ASSIGN(XrExitFullscreenObserver); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/xr/xr_rigid_transform.h b/third_party/blink/renderer/modules/xr/xr_rigid_transform.h index 9a0e47a..d42b14d 100644 --- a/third_party/blink/renderer/modules/xr/xr_rigid_transform.h +++ b/third_party/blink/renderer/modules/xr/xr_rigid_transform.h
@@ -31,6 +31,9 @@ DOMPointInit*, ExceptionState&); + XRRigidTransform(const XRRigidTransform&) = delete; + XRRigidTransform& operator=(const XRRigidTransform&) = delete; + ~XRRigidTransform() override = default; DOMPointReadOnly* position() const { return position_; } @@ -53,8 +56,6 @@ Member<XRRigidTransform> inverse_; Member<DOMFloat32Array> matrix_array_; std::unique_ptr<TransformationMatrix> matrix_; - - DISALLOW_COPY_AND_ASSIGN(XRRigidTransform); }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/xr/xr_system.h b/third_party/blink/renderer/modules/xr/xr_system.h index c003219..19b2459 100644 --- a/third_party/blink/renderer/modules/xr/xr_system.h +++ b/third_party/blink/renderer/modules/xr/xr_system.h
@@ -172,6 +172,11 @@ device::mojom::blink::XRSessionMode mode, RequestedXRSessionFeatureSet required_features, RequestedXRSessionFeatureSet optional_features); + + PendingRequestSessionQuery(const PendingRequestSessionQuery&) = delete; + PendingRequestSessionQuery& operator=(const PendingRequestSessionQuery&) = + delete; + virtual ~PendingRequestSessionQuery() = default; // Resolves underlying promise with passed in XR session. @@ -272,8 +277,6 @@ Vector<device::mojom::XRDepthUsage> preferred_usage_; Vector<device::mojom::XRDepthDataFormat> preferred_format_; - - DISALLOW_COPY_AND_ASSIGN(PendingRequestSessionQuery); }; static device::mojom::blink::XRSessionOptionsPtr XRSessionOptionsFromQuery( @@ -289,6 +292,11 @@ PendingSupportsSessionQuery(ScriptPromiseResolver*, device::mojom::blink::XRSessionMode, bool throw_on_unsupported); + + PendingSupportsSessionQuery(const PendingSupportsSessionQuery&) = delete; + PendingSupportsSessionQuery& operator=(const PendingSupportsSessionQuery&) = + delete; + virtual ~PendingSupportsSessionQuery() = default; // Resolves underlying promise. @@ -327,8 +335,6 @@ // Only set when calling the deprecated supportsSession method. const bool throw_on_unsupported_ = false; - - DISALLOW_COPY_AND_ASSIGN(PendingSupportsSessionQuery); }; // Helper, logs message to the console as well as DVLOGs.
diff --git a/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc b/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc index ce0b6c70..5084294 100644 --- a/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc +++ b/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc
@@ -693,9 +693,6 @@ // https://github.com/AOMediaCodec/libavif/issues/636. decoder_->maxThreads = 2; - // TODO(wtc): Currently libavif always prioritizes the animation, but that's - // not correct. It should instead select animation or still image based on - // the preferred and major brands listed in the file. if (animation_option_ != AnimationOption::kUnspecified && avifDecoderSetSource( decoder_.get(),
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index d6774ee..3c38e93 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -2401,9 +2401,10 @@ name: "WebAuth", status: "stable", }, - // When enabled adds the transport used for authentication to the assertion payload. + // When enabled adds the authenticator attachment used for registration and + // authentication to the public key credential response. { - name: "WebAuthAssertionTransport", + name: "WebAuthAuthenticatorAttachment", }, // A more subtle UI for WebAuthn that is web exposed. Under development. // It's controlled by the corresponding Chromium feature which needs to
diff --git a/third_party/blink/web_tests/NeverFixTests b/third_party/blink/web_tests/NeverFixTests index 4f01e87..d054f545 100644 --- a/third_party/blink/web_tests/NeverFixTests +++ b/third_party/blink/web_tests/NeverFixTests
@@ -1087,6 +1087,7 @@ external/wpt/appmanifest/display-override-member/display-override-member-media-feature-standalone-manual.tentative.html [ Skip ] external/wpt/appmanifest/display-override-member/display-override-member-media-feature-standalone-overrides-browser-manual.tentative.html [ Skip ] external/wpt/appmanifest/file_handlers-member/file_handlers-member-manual.tentative.html [ Skip ] +external/wpt/appmanifest/protocol_handlers-member/protocol_handlers-member-manual.tentative.html [ Skip ] external/wpt/appmanifest/shortcuts-member/shortcuts-member-manual.html [ Skip ] external/wpt/appmanifest/shortcuts-member/shortcuts-member-skip-for-empty-name-manual.html [ Skip ] external/wpt/appmanifest/shortcuts-member/shortcuts-member-skip-for-invalid-url-manual.html [ Skip ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 54302cf..76b8a4e 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -72,7 +72,7 @@ crbug.com/807686 crbug.com/24182 jquery/manipulation.html [ Pass Skip Timeout ] -# The following tests need to remove the assumption that user activation isvirtual/text-antialias/firstline/capitalize-transform.html +# The following tests need to remove the assumption that user activation is # available in child/sibling frames. This assumption doesn't hold with User # Activation v2 (UAv2). crbug.com/906791 external/wpt/fullscreen/api/element-ready-check-allowed-cross-origin-manual.sub.html [ Timeout ] @@ -331,9 +331,6 @@ crbug.com/1106590 virtual/gpu/fast/canvas/canvas-path-non-invertible-transform.html [ Crash Pass ] -crbug.com/974720 [ Mac10.13 ] virtual/text-antialias/firstline/capitalize-transform-2.html [ Crash Pass ] -crbug.com/974720 [ Mac10.13 ] virtual/text-antialias/firstline/capitalize-transform.html [ Crash Pass ] - crbug.com/1237275 fast/canvas/layers-lonebeginlayer.html [ Failure Pass ] crbug.com/1237275 fast/canvas/layers-unmatched-beginlayer.html [ Failure Pass ] crbug.com/1231615 fast/canvas/layers-nested.html [ Failure Pass ] @@ -2023,6 +2020,13 @@ # crbug.com/1218723 This test fails when SplitCacheByNetworkIsolationKey is enabled. crbug.com/1218723 http/tests/devtools/network/network-prefetch.js [ Failure ] +# We've removed the existing console warning and replaced it with error message +# tooltips in the HTTP request cookies view. We intend to also add a DevTools +# Issue that makes it easier for developers to notice that a large cookie has +# been rejected. Once that occurs, modify this test to look for the DevTools +# Issue being created and then re-enable it. +crbug.com/1252463 http/tests/devtools/network/warning-for-long-cookie.js [ Failure ] + # No support for WPT print-reftests: crbug.com/1090628 external/wpt/infrastructure/reftest/reftest_match-print.html [ Failure ] crbug.com/1090628 external/wpt/infrastructure/reftest/reftest_match_fail-print.html [ Failure ] @@ -2849,9 +2853,6 @@ # ====== New tests from wpt-importer added here ====== 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 external/wpt/css/css-transforms/transform-fixed-bg-005.html [ Failure ] -crbug.com/626703 virtual/backface-visibility-interop/external/wpt/css/css-transforms/transform-fixed-bg-005.html [ Failure ] -crbug.com/626703 virtual/transform-interop-disabled/external/wpt/css/css-transforms/transform-fixed-bg-005.html [ Failure ] 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 ] @@ -5206,6 +5207,7 @@ crbug.com/1008483 virtual/transform-interop-disabled/external/wpt/css/css-transforms/3d-rendering-context-and-fixpos.html [ Failure ] crbug.com/1008483 virtual/transform-interop-disabled/external/wpt/css/css-transforms/3d-rendering-context-and-inline.html [ Failure ] crbug.com/1008483 virtual/transform-interop-disabled/external/wpt/css/css-transforms/transform3d-sorting-004.html [ Failure ] +crbug.com/1008483 virtual/transform-interop-disabled/external/wpt/css/css-transforms/transform-table-008.html [ Failure ] # 3d-point-mapping-2 tests incorrect (pre-TransformInterop) behavior, # but we should keep testing that until TransformInterop is shipped. @@ -6267,10 +6269,10 @@ external/wpt/css/css-transforms/transform-background-002.html [ Failure ] external/wpt/css/css-transforms/transform-background-007.html [ Failure ] external/wpt/css/css-transforms/transform-background-008.html [ Failure ] -external/wpt/css/css-transforms/transform-fixed-bg-001.html [ Failure ] external/wpt/css/css-transforms/transform-fixed-bg-002.html [ Failure ] external/wpt/css/css-transforms/transform-fixed-bg-003.html [ Failure ] external/wpt/css/css-transforms/transform-fixed-bg-004.html [ Failure ] +external/wpt/css/css-transforms/transform-fixed-bg-005.html [ Failure ] external/wpt/css/css-transforms/transform-fixed-bg-006.html [ Failure ] external/wpt/css/css-transforms/transform-fixed-bg-007.html [ Failure ] external/wpt/css/css-transforms/transform-image-001.html [ Failure ] @@ -6286,24 +6288,13 @@ external/wpt/css/css-transforms/transform-origin/svg-origin-length-pt-003.html [ Failure ] external/wpt/css/css-transforms/transform-origin/svg-origin-length-pt-004.html [ Failure ] external/wpt/css/css-transforms/transform-origin/svg-origin-length-pt-005.html [ Failure ] -external/wpt/css/css-transforms/transform-origin/svg-origin-relative-length-030.html [ Failure ] -external/wpt/css/css-transforms/transform-origin/svg-origin-relative-length-036.html [ Failure ] -external/wpt/css/css-transforms/transform-origin/svg-origin-relative-length-044.html [ Failure ] -external/wpt/css/css-transforms/transform-origin/svg-origin-relative-length-046.html [ Failure ] external/wpt/css/css-transforms/transform-percent-008.html [ Failure ] -external/wpt/css/css-transforms/transform-rotate-006.html [ Failure ] external/wpt/css/css-transforms/transform-rotate-007.html [ Failure ] -external/wpt/css/css-transforms/transform-scale-001.html [ Failure ] -external/wpt/css/css-transforms/transform-scale-002.html [ Failure ] -external/wpt/css/css-transforms/transform-scaley-001.html [ Failure ] crbug.com/1008483 virtual/transform-interop-disabled/external/wpt/css/css-transforms/transform-table-006.html [ Failure ] crbug.com/1008483 virtual/transform-interop-disabled/external/wpt/css/css-transforms/transform-table-007.html [ Failure ] -external/wpt/css/css-transforms/transform-table-008.html [ Failure ] -external/wpt/css/css-transforms/transform-translatex-006.html [ Failure ] external/wpt/css/css-transforms/transforms-rotate-degree-45.html [ Failure ] external/wpt/css/css-transforms/ttwf-transform-skewx-001.html [ Failure ] external/wpt/css/css-transforms/ttwf-transform-skewy-001.html [ Failure ] -external/wpt/css/css-transforms/ttwf-transform-translatex-001.html [ Failure ] # Started failing after rolling new version of check-layout-th.js css3/flexbox/perpendicular-writing-modes-inside-flex-item.html [ Failure ]
diff --git a/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/protocol_handlers-member-manual.tentative.html b/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/protocol_handlers-member-manual.tentative.html new file mode 100644 index 0000000..fa9c958 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/protocol_handlers-member-manual.tentative.html
@@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <link rel="manifest" href="resources/protocol_handlers-member.webmanifest" /> + <title>Protocol Handling Web Platform Test</title> + <script> + navigator.serviceWorker.register( + 'protocol_handlers-member-service-worker.js'); + </script> +</head> +<body> + <h1>Protocol Handling Web Platform Test</h1> + <p>This test validates that an install application can register URL protocol + handlers via a property in the web app manifest. The app should open + directly when the 'web+testing' custom-scheme URL is visited. + </p> + <h2>Manual Test Steps:</h2> + <p> + <ol> + <li>Install this app.</li> + <li>Launch 'web+testing://test-url/'. Instructions will vary by OS. + <ul> + <li>On Windows - open a command prompt, and run "start web+testing://test-url/".</li> + <li>On MacOS - open a terminal, and "open web+testing://test-url/".</li> + <li>On Linux - open a terminal, and "xgd-open web+testing://test-url/".</li> + </ul> + </li> + <li>If your browser prompts you, allow the app to open.</li> + <li>The app window that opens should indicate success of this test.</li> + </ol> + </p> +</body> +</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/protocol_handlers-member-service-worker.js b/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/protocol_handlers-member-service-worker.js new file mode 100644 index 0000000..e502e2a9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/protocol_handlers-member-service-worker.js
@@ -0,0 +1,52 @@ +// Some user agents only offer app installation if there is a SW and it handles +// offline requests. + +const cacheVersion = "1.1"; +const CACHE_NAME = `cache-v${cacheVersion}`; + +// The resources cached by this service worker. +const resources = [ + "protocol_handlers-member-service-worker.js", + "protocol_handlers-member-manual.tentative.html", + "resources/icon.png", + "resources/protocol_handlers_entry.html", +]; + +// Load all resources for this service worker. +const precache = async () => { + const cache = await caches.open(CACHE_NAME); + await cache.addAll(resources); +}; + +// Get a resource from the cache. +const fromCache = async request => { + const cache = await caches.open(CACHE_NAME); + return await cache.match(request.url); +}; + +// Attempt to get resources from the network first, fallback to the cache if we're +// offline. +const networkFallbackToCache = async request => { + try { + const response = await fetch(request); + if (response.ok) return response; + } catch (err) {} + return await fromCache(request); +}; + +// When we have a new service worker, update the caches and swap immediately. +self.addEventListener("install", e => { + e.waitUntil(precache().then(() => self.skipWaiting())); +}); + +// Claim existing clients. +self.addEventListener("activate", e => { + e.waitUntil(self.clients.claim()); +}); + +// When a resource need to be fetched, check whether it is +// contained in the cache and return the cached version, otherwise +// get it from the network. +self.addEventListener("fetch", e => { + e.respondWith(networkFallbackToCache(e.request)); +});
diff --git a/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/resources/icon.png b/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/resources/icon.png new file mode 100644 index 0000000..9255547 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/resources/icon.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/resources/protocol_handlers-member.webmanifest b/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/resources/protocol_handlers-member.webmanifest new file mode 100644 index 0000000..cce6ae1e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/resources/protocol_handlers-member.webmanifest
@@ -0,0 +1,18 @@ +{ + "name": "Protocol_handlers test", + "icons": [ + { + "src": "icon.png", + "sizes": "144x144" + } + ], + "start_url": "../protocol_handlers-member-manual.tentative.html", + "display": "standalone", + "scope": "../../protocol_handlers-member/", + "protocol_handlers": [ + { + "protocol": "web+testing", + "url": "protocol_handlers_entry.html?value=%s" + } + ] +} \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/resources/protocol_handlers-member.webmanifest.headers b/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/resources/protocol_handlers-member.webmanifest.headers new file mode 100644 index 0000000..2bab061 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/resources/protocol_handlers-member.webmanifest.headers
@@ -0,0 +1 @@ +Content-Type: application/manifest+json; charset=utf-8
diff --git a/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/resources/protocol_handlers_entry.html b/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/resources/protocol_handlers_entry.html new file mode 100644 index 0000000..c5fa629f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/appmanifest/protocol_handlers-member/resources/protocol_handlers_entry.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>Protocol Handling Web Platform Test - Pass</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + setup({ single_test: true }); + const urlParams = new URLSearchParams(window.location.search); + assert_equals(urlParams.get('value'), "web+testing://test-url/"); + done(); + </script> +</head> +<body> + <h1>Protocol Handling Page</h1> + <p>This test validates that the app was launched with the web+testing://test-url/ URL.</p> +</body> +</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/interactive-elements/the-popup-element/popup-light-dismiss-resize.tentative.html b/third_party/blink/web_tests/external/wpt/html/semantics/interactive-elements/the-popup-element/popup-light-dismiss-resize.tentative.html deleted file mode 100644 index cec65f77..0000000 --- a/third_party/blink/web_tests/external/wpt/html/semantics/interactive-elements/the-popup-element/popup-light-dismiss-resize.tentative.html +++ /dev/null
@@ -1,55 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8" /> -<title>Popup light dismiss behavior</title> -<link rel="author" href="mailto:masonf@chromium.org"> -<link rel=help href="https://open-ui.org/components/popup.research.explainer"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/resources/testdriver.js"></script> -<script src="/resources/testdriver-actions.js"></script> -<script src="/resources/testdriver-vendor.js"></script> - -<button popup=popup>Popup 1</button> -<popup id=popup><span>Inside popup 1</span></popup> - -<style> - popup { border: 5px solid red; top: 50px; } -</style> - -<script> - const popup = document.querySelector('#popup'); - - function waitForHide() { - return new Promise(function(resolve) { - popup.addEventListener('hide', () => resolve(), {'once': true}); - }); - } - - promise_test(async () => { - return new Promise(async resolve => { - popup.show(); - assert_true(popup.open,'popup should be open'); - popup.style.width = "250px"; - assert_true(popup.open,'popup should be hidden asynchronously'); - await waitForHide(); // Wait for the popup to be hidden - assert_false(popup.open,'popup should close when resized'); - popup.style.width = ""; // Reset - resolve(); - }); - },'Popup should be closed by an explicit resize of the popup'); - - promise_test(async () => { - return new Promise(async resolve => { - popup.show(); - assert_true(popup.open,'popup should be open'); - const popupText = popup.querySelector('span'); - const originalText = popupText.textContent; - popupText.textContent = "This is a test, which is longer than the original"; - assert_true(popup.open,'popup should be hidden asynchronously'); - await waitForHide(); // Wait for the popup to be hidden - assert_false(popup.open,'popup should close when text content forces its size to change'); - popupText.textContent = originalText; // Reset - resolve(); - }); - },'Popup should be closed by an implicit resize of the popup'); -</script>
diff --git a/third_party/blink/web_tests/html/selectmenu/selectmenu-viewport.html b/third_party/blink/web_tests/html/selectmenu/selectmenu-viewport.html new file mode 100644 index 0000000..ac69a36f --- /dev/null +++ b/third_party/blink/web_tests/html/selectmenu/selectmenu-viewport.html
@@ -0,0 +1,40 @@ +<!DOCTYPE html> +<html lang="en"> +<script src='../../resources/testharness.js'></script> +<script src='../../resources/testharnessreport.js'></script> +<script src="../../resources/testdriver.js"></script> +<script src="../../resources/testdriver-actions.js"></script> +<script src="../../resources/testdriver-vendor.js"></script> + +<selectmenu id="selectMenu"> + <option>one</option> + <option>two</option> + <option>three</option> +</selectmenu> + +<script> +function clickOn(element) { + const actions = new test_driver.Actions(); + return actions.pointerMove(0, 0, {origin: element}) + .pointerDown({button: actions.ButtonType.LEFT}) + .pointerUp({button: actions.ButtonType.LEFT}) + .send(); +} + +promise_test(async () => { + if (window.internals) { + // Regression test for crbug.com/1252600 + // On mobile, <meta name="viewport"> can trigger a layout pass when + // querying FrameView size. This test ensures that that this doesn't + // cause a re-entrant layout when opening the <selectmenu> popup. + // Since desktop browsers ignore <meta name="viewport">, set viewport + // using internals.settings. + internals.settings.setViewportEnabled(true); + internals.settings.setViewportMetaEnabled(true); + } + const selectMenu = document.getElementById("selectMenu"); + assert_false(selectMenu.open); + await clickOn(selectMenu); + assert_true(selectMenu.open); +}, "select should open successfully if viewport is enabled"); +</script> \ No newline at end of file
diff --git a/third_party/closure_compiler/externs/speech_recognition_private.js b/third_party/closure_compiler/externs/speech_recognition_private.js index 49a73cb..bfd071f 100644 --- a/third_party/closure_compiler/externs/speech_recognition_private.js +++ b/third_party/closure_compiler/externs/speech_recognition_private.js
@@ -16,6 +16,13 @@ /** * @typedef {{ + * clientId: (number|undefined) + * }} + */ +chrome.speechRecognitionPrivate.SpeechRecognitionStopEvent; + +/** + * @typedef {{ * clientId: (number|undefined), * locale: (string|undefined), * interimResults: (boolean|undefined) @@ -24,6 +31,13 @@ chrome.speechRecognitionPrivate.StartOptions; /** + * @typedef {{ + * clientId: (number|undefined) + * }} + */ +chrome.speechRecognitionPrivate.StopOptions; + +/** * Starts listening to audio from the user. The callback is invoked when speech * recognition has started. * @param {!chrome.speechRecognitionPrivate.StartOptions} options @@ -31,3 +45,18 @@ * listening to the user's audio. */ chrome.speechRecognitionPrivate.start = function(options, callback) {}; + +/** + * Stops listening to audio from the user. The callback is invoked when speech + * recognition has stopped. + * @param {!chrome.speechRecognitionPrivate.StopOptions} options + * @param {function(): void} callback Called when speech recogntion has stopped + * listening to the user's audio. + */ +chrome.speechRecognitionPrivate.stop = function(options, callback) {}; + +/** + * Fired when speech recognition stops. + * @type {!ChromeEvent} + */ +chrome.speechRecognitionPrivate.onStop;
diff --git a/third_party/hunspell/google/bdict_writer.h b/third_party/hunspell/google/bdict_writer.h index 8f5085f..0af445e 100644 --- a/third_party/hunspell/google/bdict_writer.h +++ b/third_party/hunspell/google/bdict_writer.h
@@ -21,6 +21,10 @@ typedef std::vector< std::pair<std::string, std::vector<int> > > WordList; BDictWriter(); + + BDictWriter(const BDictWriter&) = delete; + BDictWriter& operator=(const BDictWriter&) = delete; + ~BDictWriter(); // Affix setters. @@ -61,8 +65,6 @@ // Root of the generated trie. Filled by SetWords. DicNode* trie_root_; - - DISALLOW_COPY_AND_ASSIGN(BDictWriter); }; } // namespace hunspell
diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc index 619e131..b9181f1 100644 --- a/third_party/leveldatabase/env_chromium.cc +++ b/third_party/leveldatabase/env_chromium.cc
@@ -92,6 +92,10 @@ limit_(start_ + kMaxRetryDuration), last_(start_), time_to_sleep_(base::TimeDelta::FromMilliseconds(10)) {} + + Retrier(const Retrier&) = delete; + Retrier& operator=(const Retrier&) = delete; + ~Retrier() = default; bool ShouldKeepTrying() { if (last_ < limit_) { @@ -109,14 +113,16 @@ base::TimeTicks limit_; base::TimeTicks last_; base::TimeDelta time_to_sleep_; - - DISALLOW_COPY_AND_ASSIGN(Retrier); }; class ChromiumSequentialFile : public leveldb::SequentialFile { public: ChromiumSequentialFile(const std::string& fname, base::File f) : filename_(fname), file_(std::move(f)) {} + + ChromiumSequentialFile(const ChromiumSequentialFile&) = delete; + ChromiumSequentialFile& operator=(const ChromiumSequentialFile&) = delete; + ~ChromiumSequentialFile() override = default; // Note: This method is relatively hot during leveldb database @@ -145,8 +151,6 @@ private: std::string filename_; base::File file_; - - DISALLOW_COPY_AND_ASSIGN(ChromiumSequentialFile); }; void RemoveFile(const Slice& key, void* value) { @@ -200,6 +204,11 @@ 1 /* charge */, &RemoveFile)); } + ChromiumEvictableRandomAccessFile(const ChromiumEvictableRandomAccessFile&) = + delete; + ChromiumEvictableRandomAccessFile& operator=( + const ChromiumEvictableRandomAccessFile&) = delete; + virtual ~ChromiumEvictableRandomAccessFile() { file_cache_->Erase(cache_key_); } @@ -235,8 +244,6 @@ mutable leveldb::Cache* file_cache_; const ChromiumEvictableRandomAccessFile* cache_key_data_; leveldb::Slice cache_key_; - - DISALLOW_COPY_AND_ASSIGN(ChromiumEvictableRandomAccessFile); }; class ChromiumRandomAccessFile : public leveldb::RandomAccessFile { @@ -244,6 +251,9 @@ ChromiumRandomAccessFile(base::FilePath file_path, base::File file) : filepath_(std::move(file_path)), file_(std::move(file)) {} + ChromiumRandomAccessFile(const ChromiumRandomAccessFile&) = delete; + ChromiumRandomAccessFile& operator=(const ChromiumRandomAccessFile&) = delete; + virtual ~ChromiumRandomAccessFile() {} // Note: This method is relatively hot during leveldb database @@ -258,8 +268,6 @@ private: const base::FilePath filepath_; mutable base::File file_; - - DISALLOW_COPY_AND_ASSIGN(ChromiumRandomAccessFile); }; class ChromiumWritableFile : public leveldb::WritableFile { @@ -267,6 +275,10 @@ ChromiumWritableFile(const std::string& fname, base::File f, storage::FilesystemProxy* filesystem); + + ChromiumWritableFile(const ChromiumWritableFile&) = delete; + ChromiumWritableFile& operator=(const ChromiumWritableFile&) = delete; + ~ChromiumWritableFile() override = default; leveldb::Status Append(const leveldb::Slice& data) override; leveldb::Status Close() override; @@ -284,8 +296,6 @@ #endif Type file_type_; std::string parent_dir_; - - DISALLOW_COPY_AND_ASSIGN(ChromiumWritableFile); }; ChromiumWritableFile::ChromiumWritableFile(const std::string& fname, @@ -1020,6 +1030,10 @@ bool success = base::PlatformThread::Create(0, this, &handle); DCHECK(success); } + + Thread(const Thread&) = delete; + Thread& operator=(const Thread&) = delete; + virtual ~Thread() {} void ThreadMain() override { (*function_)(arg_); @@ -1029,8 +1043,6 @@ private: void (*function_)(void* arg); void* arg_; - - DISALLOW_COPY_AND_ASSIGN(Thread); }; void ChromiumEnv::Schedule(ScheduleFunc* function, void* arg) { @@ -1094,6 +1106,9 @@ tracker_->DatabaseOpened(this, shared_read_cache_use_); } + TrackedDBImpl(const TrackedDBImpl&) = delete; + TrackedDBImpl& operator=(const TrackedDBImpl&) = delete; + ~TrackedDBImpl() override { tracker_->DatabaseDestroyed(this, shared_read_cache_use_); base::ScopedAllowBaseSyncPrimitives allow_base_sync_primitives; @@ -1171,8 +1186,6 @@ SharedReadCacheUse shared_read_cache_use_; const DatabaseErrorReportingCallback on_get_error_; const DatabaseErrorReportingCallback on_write_error_; - - DISALLOW_COPY_AND_ASSIGN(TrackedDBImpl); }; // Reports live databases and in-memory env's to memory-infra. For each live
diff --git a/third_party/leveldatabase/leveldb_chrome.cc b/third_party/leveldatabase/leveldb_chrome.cc index a5c2071..65b180ac 100644 --- a/third_party/leveldatabase/leveldb_chrome.cc +++ b/third_party/leveldatabase/leveldb_chrome.cc
@@ -138,6 +138,9 @@ Globals::GetInstance()->DidCreateChromeMemEnv(this); } + ChromeMemEnv(const ChromeMemEnv&) = delete; + ChromeMemEnv& operator=(const ChromeMemEnv&) = delete; + ~ChromeMemEnv() override { Globals::GetInstance()->WillDestroyChromeMemEnv(this); } @@ -241,7 +244,6 @@ const std::string name_; base::Lock files_lock_; std::set<std::string> file_names_; - DISALLOW_COPY_AND_ASSIGN(ChromeMemEnv); }; void Globals::DumpAllTrackedEnvs(const MemoryDumpArgs& dump_args,
diff --git a/third_party/libaddressinput/chromium/canonicalize_string.cc b/third_party/libaddressinput/chromium/canonicalize_string.cc index 07a501b..f477ac5 100644 --- a/third_party/libaddressinput/chromium/canonicalize_string.cc +++ b/third_party/libaddressinput/chromium/canonicalize_string.cc
@@ -31,6 +31,10 @@ DCHECK(U_SUCCESS(error_code_)); } + ChromeStringCanonicalizer(const ChromeStringCanonicalizer&) = delete; + ChromeStringCanonicalizer& operator=(const ChromeStringCanonicalizer&) = + delete; + virtual ~ChromeStringCanonicalizer() {} // StringCanonicalizer implementation. @@ -57,8 +61,6 @@ private: UErrorCode error_code_; scoped_ptr<icu::Collator> collator_; - - DISALLOW_COPY_AND_ASSIGN(ChromeStringCanonicalizer); }; } // namespace
diff --git a/third_party/libaddressinput/chromium/chrome_address_validator.h b/third_party/libaddressinput/chromium/chrome_address_validator.h index b1aab29d..304b0ed 100644 --- a/third_party/libaddressinput/chromium/chrome_address_validator.h +++ b/third_party/libaddressinput/chromium/chrome_address_validator.h
@@ -81,6 +81,9 @@ std::unique_ptr<::i18n::addressinput::Storage> storage, LoadRulesListener* load_rules_listener); + AddressValidator(const AddressValidator&) = delete; + AddressValidator& operator=(const AddressValidator&) = delete; + virtual ~AddressValidator(); // Loads the generic validation rules for |region_code| and specific rules @@ -208,8 +211,6 @@ // any WeakPtrs to AddressValidator are invalidated before its members // variable's destructors are executed, rendering them invalid. base::WeakPtrFactory<AddressValidator> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(AddressValidator); }; } // namespace autofill
diff --git a/third_party/libaddressinput/chromium/chrome_address_validator_unittest.cc b/third_party/libaddressinput/chromium/chrome_address_validator_unittest.cc index b1232f1..8b95ea5 100644 --- a/third_party/libaddressinput/chromium/chrome_address_validator_unittest.cc +++ b/third_party/libaddressinput/chromium/chrome_address_validator_unittest.cc
@@ -850,15 +850,15 @@ std::move(storage), load_rules_listener) {} + TestAddressValidator(const TestAddressValidator&) = delete; + TestAddressValidator& operator=(const TestAddressValidator&) = delete; + virtual ~TestAddressValidator() {} protected: base::TimeDelta GetBaseRetryPeriod() const override { return base::TimeDelta::FromSeconds(0); } - - private: - DISALLOW_COPY_AND_ASSIGN(TestAddressValidator); }; // A source that always fails |failures_number| times before downloading @@ -867,6 +867,10 @@ public: FailingSource() : failures_number_(0), attempts_number_(0), actual_source_(true) {} + + FailingSource(const FailingSource&) = delete; + FailingSource& operator=(const FailingSource&) = delete; + virtual ~FailingSource() {} // Sets the number of times to fail before downloading data. @@ -897,8 +901,6 @@ // The source to use for successful downloads. TestdataSource actual_source_; - - DISALLOW_COPY_AND_ASSIGN(FailingSource); }; FailingAddressValidatorTest()
diff --git a/third_party/libaddressinput/chromium/chrome_metadata_source.h b/third_party/libaddressinput/chromium/chrome_metadata_source.h index 5739a4d..b1355c2 100644 --- a/third_party/libaddressinput/chromium/chrome_metadata_source.h +++ b/third_party/libaddressinput/chromium/chrome_metadata_source.h
@@ -27,6 +27,10 @@ ChromeMetadataSource( const std::string& validation_data_url, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory); + + ChromeMetadataSource(const ChromeMetadataSource&) = delete; + ChromeMetadataSource& operator=(const ChromeMetadataSource&) = delete; + virtual ~ChromeMetadataSource(); // ::i18n::addressinput::Source: @@ -60,8 +64,6 @@ // Holds all pending requests and their URL loaders. RequestList requests_; - - DISALLOW_COPY_AND_ASSIGN(ChromeMetadataSource); }; } // namespace autofill
diff --git a/third_party/libaddressinput/chromium/chrome_storage_impl.h b/third_party/libaddressinput/chromium/chrome_storage_impl.h index 53adbf7..1317705 100644 --- a/third_party/libaddressinput/chromium/chrome_storage_impl.h +++ b/third_party/libaddressinput/chromium/chrome_storage_impl.h
@@ -26,6 +26,10 @@ public: // |store| must outlive |this|. explicit ChromeStorageImpl(WriteablePrefStore* store); + + ChromeStorageImpl(const ChromeStorageImpl&) = delete; + ChromeStorageImpl& operator=(const ChromeStorageImpl&) = delete; + virtual ~ChromeStorageImpl(); // ::i18n::addressinput::Storage implementation. @@ -55,8 +59,6 @@ base::ScopedObservation<PrefStore, PrefStore::Observer> scoped_observation_{ this}; - - DISALLOW_COPY_AND_ASSIGN(ChromeStorageImpl); }; } // namespace autofill
diff --git a/third_party/libaddressinput/chromium/input_suggester.cc b/third_party/libaddressinput/chromium/input_suggester.cc index c1201be..bdf204f 100644 --- a/third_party/libaddressinput/chromium/input_suggester.cc +++ b/third_party/libaddressinput/chromium/input_suggester.cc
@@ -79,6 +79,10 @@ class AddressSuggestions { public: AddressSuggestions() {} + + AddressSuggestions(const AddressSuggestions&) = delete; + AddressSuggestions& operator=(const AddressSuggestions&) = delete; + ~AddressSuggestions() {} // Marks all regions at |address_field| level as matching user input. @@ -218,8 +222,6 @@ // Suggestions at ADMIN_AREA, LOCALITY, and DEPENDENT_LOCALITY levels. std::map<AddressField, std::vector<Suggestion> > suggestions_; - - DISALLOW_COPY_AND_ASSIGN(AddressSuggestions); }; } // namespace
diff --git a/third_party/libaddressinput/chromium/input_suggester.h b/third_party/libaddressinput/chromium/input_suggester.h index 0dca1a2..7cf7cae9 100644 --- a/third_party/libaddressinput/chromium/input_suggester.h +++ b/third_party/libaddressinput/chromium/input_suggester.h
@@ -34,6 +34,10 @@ public: // Does not take ownership of |supplier|, which should not be NULL. explicit InputSuggester(::i18n::addressinput::PreloadSupplier* supplier); + + InputSuggester(const InputSuggester&) = delete; + InputSuggester& operator=(const InputSuggester&) = delete; + ~InputSuggester(); // Fills in |suggestions| for the partially typed in |user_input|, assuming @@ -78,6 +82,10 @@ // Initializes the canonicalizer. This is slow, so avoid calling it more // often than necessary. StringCanonicalizer(); + + StringCanonicalizer(const StringCanonicalizer&) = delete; + StringCanonicalizer& operator=(const StringCanonicalizer&) = delete; + ~StringCanonicalizer(); // Returns a 0-terminated canonical version of the string that can be used @@ -97,8 +105,6 @@ mutable std::vector<uint8_t> buffer_; std::unique_ptr<icu::Collator> collator_; - - DISALLOW_COPY_AND_ASSIGN(StringCanonicalizer); }; // The method to be invoked by |validated_| callback. @@ -126,8 +132,6 @@ // Canonicalizes strings for case and diacritic insensitive search of // sub-region names. StringCanonicalizer canonicalizer_; - - DISALLOW_COPY_AND_ASSIGN(InputSuggester); }; } // namespace autofill
diff --git a/third_party/libaddressinput/chromium/json.cc b/third_party/libaddressinput/chromium/json.cc index 4cc25ba..60d097a 100644 --- a/third_party/libaddressinput/chromium/json.cc +++ b/third_party/libaddressinput/chromium/json.cc
@@ -49,6 +49,9 @@ : owned_(Parse(json, &parser_error_)), dict_(*owned_) {} + JsonImpl(const JsonImpl&) = delete; + JsonImpl& operator=(const JsonImpl&) = delete; + ~JsonImpl() {} bool parser_error() const { return parser_error_; } @@ -88,8 +91,6 @@ const base::DictionaryValue& dict_; std::vector<const Json*> sub_dicts_; std::vector<std::unique_ptr<Json>> owned_sub_dicts_; - - DISALLOW_COPY_AND_ASSIGN(JsonImpl); }; Json::Json() {}
diff --git a/third_party/libaddressinput/chromium/storage_test_runner.h b/third_party/libaddressinput/chromium/storage_test_runner.h index f710ac5..7b1db09 100644 --- a/third_party/libaddressinput/chromium/storage_test_runner.h +++ b/third_party/libaddressinput/chromium/storage_test_runner.h
@@ -19,6 +19,10 @@ public: // Does not take ownership of |storage|. explicit StorageTestRunner(::i18n::addressinput::Storage* storage); + + StorageTestRunner(const StorageTestRunner&) = delete; + StorageTestRunner& operator=(const StorageTestRunner&) = delete; + ~StorageTestRunner(); // Runs all the tests from the standard test suite. @@ -38,8 +42,6 @@ bool success_; std::string key_; std::string data_; - - DISALLOW_COPY_AND_ASSIGN(StorageTestRunner); }; } // namespace autofill
diff --git a/third_party/libaddressinput/chromium/string_compare.cc b/third_party/libaddressinput/chromium/string_compare.cc index 2a78446..c817c66 100644 --- a/third_party/libaddressinput/chromium/string_compare.cc +++ b/third_party/libaddressinput/chromium/string_compare.cc
@@ -26,6 +26,9 @@ collator_->setStrength(icu::Collator::PRIMARY); } + IcuStringComparer(const IcuStringComparer&) = delete; + IcuStringComparer& operator=(const IcuStringComparer&) = delete; + ~IcuStringComparer() {} int Compare(const std::string& a, const std::string& b) const { @@ -37,8 +40,6 @@ private: std::unique_ptr<icu::Collator> collator_; - - DISALLOW_COPY_AND_ASSIGN(IcuStringComparer); }; static base::LazyInstance<IcuStringComparer>::DestructorAtExit g_comparer =
diff --git a/third_party/libjingle_xmpp/task_runner/task_unittest.cc b/third_party/libjingle_xmpp/task_runner/task_unittest.cc index e8b63d25..f88d811 100644 --- a/third_party/libjingle_xmpp/task_runner/task_unittest.cc +++ b/third_party/libjingle_xmpp/task_runner/task_unittest.cc
@@ -64,6 +64,9 @@ public: TaskAbortTest() {} + TaskAbortTest(const TaskAbortTest&) = delete; + TaskAbortTest& operator=(const TaskAbortTest&) = delete; + // no need to delete any tasks; the task runner owns them ~TaskAbortTest() {} @@ -81,7 +84,6 @@ } MyTaskRunner task_runner_; - DISALLOW_COPY_AND_ASSIGN(TaskAbortTest); }; TEST(start_task_test, Abort) { @@ -101,6 +103,9 @@ EXPECT_FALSE(*set_when_deleted); } + SetBoolOnDeleteTask(const SetBoolOnDeleteTask&) = delete; + SetBoolOnDeleteTask& operator=(const SetBoolOnDeleteTask&) = delete; + virtual ~SetBoolOnDeleteTask() { *set_when_deleted_ = true; } @@ -111,13 +116,15 @@ private: bool* set_when_deleted_; - DISALLOW_COPY_AND_ASSIGN(SetBoolOnDeleteTask); }; class AbortShouldWakeTest : public sigslot::has_slots<> { public: AbortShouldWakeTest() {} + AbortShouldWakeTest(const AbortShouldWakeTest&) = delete; + AbortShouldWakeTest& operator=(const AbortShouldWakeTest&) = delete; + // no need to delete any tasks; the task runner owns them ~AbortShouldWakeTest() {} @@ -144,7 +151,6 @@ } MyTaskRunner task_runner_; - DISALLOW_COPY_AND_ASSIGN(AbortShouldWakeTest); }; TEST(start_task_test, AbortShouldWake) {
diff --git a/third_party/libjingle_xmpp/task_runner/taskparent.h b/third_party/libjingle_xmpp/task_runner/taskparent.h index f5ed893..be35e36 100644 --- a/third_party/libjingle_xmpp/task_runner/taskparent.h +++ b/third_party/libjingle_xmpp/task_runner/taskparent.h
@@ -26,6 +26,10 @@ public: TaskParent(Task *derived_instance, TaskParent *parent); explicit TaskParent(TaskRunner *derived_instance); + + TaskParent(const TaskParent&) = delete; + TaskParent& operator=(const TaskParent&) = delete; + virtual ~TaskParent(); TaskParent *GetParent() { return parent_; } @@ -54,7 +58,6 @@ bool child_error_; typedef std::set<Task *> ChildSet; std::unique_ptr<ChildSet> children_; - DISALLOW_COPY_AND_ASSIGN(TaskParent); };
diff --git a/third_party/libjingle_xmpp/xmpp/xmpptask.h b/third_party/libjingle_xmpp/xmpp/xmpptask.h index 3c3a29a..8ca780d 100644 --- a/third_party/libjingle_xmpp/xmpp/xmpptask.h +++ b/third_party/libjingle_xmpp/xmpp/xmpptask.h
@@ -57,6 +57,10 @@ class XmppClientInterface { public: XmppClientInterface(); + + XmppClientInterface(const XmppClientInterface&) = delete; + XmppClientInterface& operator=(const XmppClientInterface&) = delete; + virtual ~XmppClientInterface(); virtual XmppEngine::State GetState() const = 0; @@ -69,8 +73,6 @@ virtual void AddXmppTask(XmppTask* task, XmppEngine::HandlerLevel level) = 0; virtual void RemoveXmppTask(XmppTask* task) = 0; sigslot::signal0<> SignalDisconnected; - - DISALLOW_COPY_AND_ASSIGN(XmppClientInterface); }; // XmppTaskParentInterface is the interface require for any parent of @@ -85,11 +87,13 @@ explicit XmppTaskParentInterface(jingle_xmpp::TaskParent* parent) : Task(parent) { } + + XmppTaskParentInterface(const XmppTaskParentInterface&) = delete; + XmppTaskParentInterface& operator=(const XmppTaskParentInterface&) = delete; + virtual ~XmppTaskParentInterface() {} virtual XmppClientInterface* GetClient() = 0; - - DISALLOW_COPY_AND_ASSIGN(XmppTaskParentInterface); }; class XmppTaskBase : public XmppTaskParentInterface { @@ -98,6 +102,10 @@ : XmppTaskParentInterface(parent), parent_(parent) { } + + XmppTaskBase(const XmppTaskBase&) = delete; + XmppTaskBase& operator=(const XmppTaskBase&) = delete; + virtual ~XmppTaskBase() {} virtual XmppClientInterface* GetClient() { @@ -106,8 +114,6 @@ protected: XmppTaskParentInterface* parent_; - - DISALLOW_COPY_AND_ASSIGN(XmppTaskBase); }; class XmppTask : public XmppTaskBase,
diff --git a/third_party/tcmalloc/chromium/src/base/low_level_alloc.cc b/third_party/tcmalloc/chromium/src/base/low_level_alloc.cc index 6a944b6..346a793 100644 --- a/third_party/tcmalloc/chromium/src/base/low_level_alloc.cc +++ b/third_party/tcmalloc/chromium/src/base/low_level_alloc.cc
@@ -248,6 +248,10 @@ } this->arena_->mu.Lock(); } + + ArenaLock(const ArenaLock&) = delete; + ArenaLock& operator=(const ArenaLock&) = delete; + ~ArenaLock() { RAW_CHECK(this->left_, "haven't left Arena region"); } void Leave() UNLOCK_FUNCTION() { this->arena_->mu.Unlock(); @@ -265,7 +269,6 @@ sigset_t mask_; // old mask of blocked signals #endif LowLevelAlloc::Arena *arena_; - DISALLOW_COPY_AND_ASSIGN(ArenaLock); }; } // anonymous namespace
diff --git a/third_party/tcmalloc/chromium/src/heap-profile-table.h b/third_party/tcmalloc/chromium/src/heap-profile-table.h index 3c62847..0429ec4 100644 --- a/third_party/tcmalloc/chromium/src/heap-profile-table.h +++ b/third_party/tcmalloc/chromium/src/heap-profile-table.h
@@ -86,6 +86,10 @@ // interface --------------------------- HeapProfileTable(Allocator alloc, DeAllocator dealloc, bool profile_mmap); + + HeapProfileTable(const HeapProfileTable&) = delete; + HeapProfileTable& operator=(const HeapProfileTable&) = delete; + ~HeapProfileTable(); // Collect the stack trace for the function that asked to do the @@ -340,8 +344,6 @@ // Map of all currently allocated objects and mapped regions we know about. AllocationMap* address_map_; - - DISALLOW_COPY_AND_ASSIGN(HeapProfileTable); }; class HeapProfileTable::Snapshot {
diff --git a/third_party/tcmalloc/chromium/src/memory_region_map.h b/third_party/tcmalloc/chromium/src/memory_region_map.h index f774994..2cb097f4 100644 --- a/third_party/tcmalloc/chromium/src/memory_region_map.h +++ b/third_party/tcmalloc/chromium/src/memory_region_map.h
@@ -126,9 +126,11 @@ class LockHolder { public: LockHolder() { Lock(); } + + LockHolder(const LockHolder&) = delete; + LockHolder& operator=(const LockHolder&) = delete; + ~LockHolder() { Unlock(); } - private: - DISALLOW_COPY_AND_ASSIGN(LockHolder); }; // A memory region that we know about through malloc_hook-s.
diff --git a/third_party/tcmalloc/vendor/src/base/low_level_alloc.cc b/third_party/tcmalloc/vendor/src/base/low_level_alloc.cc index 6b467cf..9aa372a 100644 --- a/third_party/tcmalloc/vendor/src/base/low_level_alloc.cc +++ b/third_party/tcmalloc/vendor/src/base/low_level_alloc.cc
@@ -248,6 +248,10 @@ } this->arena_->mu.Lock(); } + + ArenaLock(const ArenaLock&) = delete; + ArenaLock& operator=(const ArenaLock&) = delete; + ~ArenaLock() { RAW_CHECK(this->left_, "haven't left Arena region"); } void Leave() /*UNLOCK_FUNCTION()*/ { this->arena_->mu.Unlock(); @@ -265,7 +269,6 @@ sigset_t mask_; // old mask of blocked signals #endif LowLevelAlloc::Arena *arena_; - DISALLOW_COPY_AND_ASSIGN(ArenaLock); }; } // anonymous namespace
diff --git a/third_party/tcmalloc/vendor/src/heap-profile-table.h b/third_party/tcmalloc/vendor/src/heap-profile-table.h index 3c62847..0429ec4 100644 --- a/third_party/tcmalloc/vendor/src/heap-profile-table.h +++ b/third_party/tcmalloc/vendor/src/heap-profile-table.h
@@ -86,6 +86,10 @@ // interface --------------------------- HeapProfileTable(Allocator alloc, DeAllocator dealloc, bool profile_mmap); + + HeapProfileTable(const HeapProfileTable&) = delete; + HeapProfileTable& operator=(const HeapProfileTable&) = delete; + ~HeapProfileTable(); // Collect the stack trace for the function that asked to do the @@ -340,8 +344,6 @@ // Map of all currently allocated objects and mapped regions we know about. AllocationMap* address_map_; - - DISALLOW_COPY_AND_ASSIGN(HeapProfileTable); }; class HeapProfileTable::Snapshot {
diff --git a/third_party/tcmalloc/vendor/src/memory_region_map.h b/third_party/tcmalloc/vendor/src/memory_region_map.h index ec388e1..b6ae95b7 100644 --- a/third_party/tcmalloc/vendor/src/memory_region_map.h +++ b/third_party/tcmalloc/vendor/src/memory_region_map.h
@@ -126,9 +126,11 @@ class LockHolder { public: LockHolder() { Lock(); } + + LockHolder(const LockHolder&) = delete; + LockHolder& operator=(const LockHolder&) = delete; + ~LockHolder() { Unlock(); } - private: - DISALLOW_COPY_AND_ASSIGN(LockHolder); }; // A memory region that we know about through malloc_hook-s.
diff --git a/third_party/webrtc_overrides/rtc_base/event.h b/third_party/webrtc_overrides/rtc_base/event.h index 78a76e8..4159282 100644 --- a/third_party/webrtc_overrides/rtc_base/event.h +++ b/third_party/webrtc_overrides/rtc_base/event.h
@@ -19,6 +19,10 @@ Event(); Event(bool manual_reset, bool initially_signaled); + + Event(const Event&) = delete; + Event& operator=(const Event&) = delete; + ~Event(); void Set(); @@ -33,7 +37,6 @@ private: base::WaitableEvent event_; - DISALLOW_COPY_AND_ASSIGN(Event); }; // Pull ScopedAllowBaseSyncPrimitives(ForTesting) into the rtc namespace.
diff --git a/third_party/zlib/google/zip_reader.cc b/third_party/zlib/google/zip_reader.cc index 2ad1398..0c6a93aa 100644 --- a/third_party/zlib/google/zip_reader.cc +++ b/third_party/zlib/google/zip_reader.cc
@@ -36,6 +36,10 @@ class StringWriterDelegate : public WriterDelegate { public: StringWriterDelegate(size_t max_read_bytes, std::string* output); + + StringWriterDelegate(const StringWriterDelegate&) = delete; + StringWriterDelegate& operator=(const StringWriterDelegate&) = delete; + ~StringWriterDelegate() override; // WriterDelegate methods: @@ -52,8 +56,6 @@ private: size_t max_read_bytes_; std::string* output_; - - DISALLOW_COPY_AND_ASSIGN(StringWriterDelegate); }; StringWriterDelegate::StringWriterDelegate(size_t max_read_bytes,
diff --git a/third_party/zlib/google/zip_reader.h b/third_party/zlib/google/zip_reader.h index d442d42..9374beb 100644 --- a/third_party/zlib/google/zip_reader.h +++ b/third_party/zlib/google/zip_reader.h
@@ -240,6 +240,9 @@ // Constructs a FileWriterDelegate that takes ownership of |file|. explicit FileWriterDelegate(std::unique_ptr<base::File> file); + FileWriterDelegate(const FileWriterDelegate&) = delete; + FileWriterDelegate& operator=(const FileWriterDelegate&) = delete; + // Truncates the file to the number of bytes written. ~FileWriterDelegate() override; @@ -267,14 +270,16 @@ std::unique_ptr<base::File> owned_file_; int64_t file_length_ = 0; - - DISALLOW_COPY_AND_ASSIGN(FileWriterDelegate); }; // A writer delegate that writes a file at a given path. class FilePathWriterDelegate : public WriterDelegate { public: explicit FilePathWriterDelegate(const base::FilePath& output_file_path); + + FilePathWriterDelegate(const FilePathWriterDelegate&) = delete; + FilePathWriterDelegate& operator=(const FilePathWriterDelegate&) = delete; + ~FilePathWriterDelegate() override; // WriterDelegate methods: @@ -292,8 +297,6 @@ private: base::FilePath output_file_path_; base::File file_; - - DISALLOW_COPY_AND_ASSIGN(FilePathWriterDelegate); }; } // namespace zip
diff --git a/third_party/zlib/google/zip_unittest.cc b/third_party/zlib/google/zip_unittest.cc index 876f3eb1..daaad21 100644 --- a/third_party/zlib/google/zip_unittest.cc +++ b/third_party/zlib/google/zip_unittest.cc
@@ -88,6 +88,9 @@ file_tree_[bar2_txt_path] = {}; } + VirtualFileSystem(const VirtualFileSystem&) = delete; + VirtualFileSystem& operator=(const VirtualFileSystem&) = delete; + ~VirtualFileSystem() override = default; private: @@ -153,8 +156,6 @@ std::map<base::FilePath, DirContents> file_tree_; std::map<base::FilePath, base::File> files_; - - DISALLOW_COPY_AND_ASSIGN(VirtualFileSystem); }; // static
diff --git a/third_party/zlib/google/zip_writer.h b/third_party/zlib/google/zip_writer.h index c67903d7..c58b1b11 100644 --- a/third_party/zlib/google/zip_writer.h +++ b/third_party/zlib/google/zip_writer.h
@@ -44,6 +44,9 @@ static std::unique_ptr<ZipWriter> Create(const base::FilePath& zip_file, FileAccessor* file_accessor); + ZipWriter(const ZipWriter&) = delete; + ZipWriter& operator=(const ZipWriter&) = delete; + ~ZipWriter(); // Sets the optional progress callback. The callback is called once for each @@ -135,8 +138,6 @@ // Should recursively add directories? bool recursive_ = false; - - DISALLOW_COPY_AND_ASSIGN(ZipWriter); }; } // namespace internal
diff --git a/tools/binary_size/libsupersize/archive.py b/tools/binary_size/libsupersize/archive.py index 401c148..f989c0f 100644 --- a/tools/binary_size/libsupersize/archive.py +++ b/tools/binary_size/libsupersize/archive.py
@@ -31,6 +31,7 @@ import data_quality import demangle import describe +import dwarfdump import file_format import function_signature import linker_map_parser @@ -291,38 +292,51 @@ return True, path -def _ExtractSourcePathsAndNormalizeObjectPaths(raw_symbols, source_mapper): +def _ExtractSourcePathsAndNormalizeObjectPaths(raw_symbols, + object_source_mapper, + address_source_mapper): """Fills in the |source_path| attribute and normalizes |object_path|.""" - logging.info('Normalizing dex symbol paths') - dex_and_other = models.DEX_SECTIONS + (models.SECTION_OTHER, ) - for symbol in raw_symbols: - if symbol.source_path and symbol.section_name in dex_and_other: - symbol.generated_source, symbol.source_path = _NormalizeSourcePath( - symbol.source_path) - - if source_mapper: + if object_source_mapper: logging.info('Looking up source paths from ninja files') for symbol in raw_symbols: if symbol.IsDex() or symbol.IsOther(): continue # Native symbols and pak symbols use object paths. object_path = symbol.object_path - if object_path: - # We don't have source info for prebuilt .a files. - if not os.path.isabs(object_path) and not object_path.startswith('..'): - source_path = source_mapper.FindSourceForPath(object_path) - if source_path: - symbol.generated_source, symbol.source_path = ( - _NormalizeSourcePath(source_path)) - symbol.object_path = _NormalizeObjectPath(object_path) - assert source_mapper.unmatched_paths_count == 0, ( + if not object_path: + continue + + # We don't have source info for prebuilt .a files. + if not os.path.isabs(object_path) and not object_path.startswith('..'): + symbol.source_path = object_source_mapper.FindSourceForPath(object_path) + assert object_source_mapper.unmatched_paths_count == 0, ( 'One or more source file paths could not be found. Likely caused by ' '.ninja files being generated at a different time than the .map file.') - else: - logging.info('Normalizing object paths') + if address_source_mapper: + logging.info('Looking up source paths from dwarfdump') for symbol in raw_symbols: - if symbol.object_path: - symbol.object_path = _NormalizeObjectPath(symbol.object_path) + + if symbol.section_name != models.SECTION_TEXT: + continue + source_path = address_source_mapper.FindSourceForTextAddress( + symbol.address) + if source_path and not os.path.isabs(source_path): + symbol.source_path = source_path + # Majority of unmatched queries are for assembly source files (ex libav1d) + # and v8 builtins. + assert address_source_mapper.unmatched_queries_ratio < 0.03, ( + 'Percentage of failing |address_source_mapper| queries ' + + '({}%) >= 3% '.format( + address_source_mapper.unmatched_queries_ratio * 100) + + 'FindSourceForTextAddress() likely has a bug.') + + logging.info('Normalizing source and object paths') + for symbol in raw_symbols: + if symbol.object_path: + symbol.object_path = _NormalizeObjectPath(symbol.object_path) + if symbol.source_path: + symbol.generated_source, symbol.source_path = _NormalizeSourcePath( + symbol.source_path) def _ComputeAncestorPath(path_list, symbol_count): @@ -969,7 +983,7 @@ # single path for these symbols. # Rather than record all paths for each symbol, set the paths to be the # common ancestor of all paths. - if outdir_context: + if outdir_context and map_path: bulk_analyzer = obj_analyzer.BulkObjectFileAnalyzer( tool_prefix, outdir_context.output_directory, track_string_literals=track_string_literals) @@ -988,7 +1002,7 @@ raw_symbols = nm.CreateUniqueSymbols(elf_path, tool_prefix, elf_section_ranges) - if map_path and elf_path: + if elf_path and map_path: logging.debug('Validating section sizes') differing_elf_section_sizes = {} differing_map_section_sizes = {} @@ -1005,14 +1019,14 @@ logging.error('.map file: %r', differing_map_section_sizes) sys.exit(1) - if elf_path and outdir_context: + if elf_path and map_path and outdir_context: missed_object_paths = _DiscoverMissedObjectPaths( raw_symbols, outdir_context.known_inputs) missed_object_paths = ar.ExpandThinArchives( missed_object_paths, outdir_context.output_directory)[0] bulk_analyzer.AnalyzePaths(missed_object_paths) bulk_analyzer.SortPaths() - if track_string_literals and map_path: + if track_string_literals: merge_string_syms = [s for s in raw_symbols if s.full_name == '** merge strings' or s.full_name == '** lld merge strings'] @@ -1036,7 +1050,7 @@ raw_symbols = _AddNmAliases(raw_symbols, names_by_address) - if outdir_context: + if map_path and outdir_context: object_paths_by_name = bulk_analyzer.GetSymbolNames() logging.debug( 'Fetched path information for %d symbols from %d files', @@ -1596,13 +1610,20 @@ apk_elf_result = None outdir_context = None - source_mapper = None + object_source_mapper = None + address_source_mapper = None section_ranges = {} raw_symbols = [] if opts.analyze_native and output_directory: - # Finds all objects passed to the linker and creates a map of .o -> .cc. - source_mapper, ninja_elf_object_paths = _ParseNinjaFiles( - output_directory, elf_path) + if map_path: + # Finds all objects passed to the linker and creates a map of .o -> .cc. + object_source_mapper, ninja_elf_object_paths = _ParseNinjaFiles( + output_directory, elf_path) + else: + ninja_elf_object_paths = None + logging.info('Parsing source path info via dwarfdump') + address_source_mapper = dwarfdump.CreateAddressSourceMapper( + elf_path, tool_prefix) # Start by finding elf_object_paths so that nm can run on them while the # linker .map is being parsed. @@ -1612,12 +1633,12 @@ known_inputs = set(elf_object_paths) known_inputs.update(ninja_elf_object_paths) else: - elf_object_paths = None + elf_object_paths = [] known_inputs = None # When we don't know which elf file is used, just search all paths. - if opts.analyze_native: + if opts.analyze_native and object_source_mapper: thin_archives = set( - p for p in source_mapper.IterAllPaths() if p.endswith('.a') + p for p in object_source_mapper.IterAllPaths() if p.endswith('.a') and ar.IsThinArchive(os.path.join(output_directory, p))) else: thin_archives = None @@ -1723,7 +1744,8 @@ '**'), s.address, s.full_name)) raw_symbols.extend(other_symbols) - _ExtractSourcePathsAndNormalizeObjectPaths(raw_symbols, source_mapper) + _ExtractSourcePathsAndNormalizeObjectPaths(raw_symbols, object_source_mapper, + address_source_mapper) _PopulateComponents(raw_symbols, source_directory) logging.info('Converting excessive aliases into shared-path symbols') _CompactLargeAliasesIntoSharedSymbols(raw_symbols, knobs)
diff --git a/tools/binary_size/libsupersize/dwarfdump.py b/tools/binary_size/libsupersize/dwarfdump.py new file mode 100755 index 0000000..de6cf07 --- /dev/null +++ b/tools/binary_size/libsupersize/dwarfdump.py
@@ -0,0 +1,195 @@ +#!/usr/bin/env python3 +# 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. +"""Runs dwarfdump on passed-in .so.""" + +import bisect +import dataclasses +import subprocess +import typing + +import path_util + + +@dataclasses.dataclass(order=True) +class _AddressRange: + start: int + stop: int + + +class _SourceMapper: + def __init__(self, range_info_list): + self._range_info_list = range_info_list + self._largest_address = 0 + self._unmatched_queries_count = 0 + self._total_queries_count = 0 + + if self._range_info_list: + self._largest_address = self._range_info_list[-1][0].stop + + def FindSourceForTextAddress(self, address): + """Returns source file path matching passed-in symbol address. + + Only symbols in the .text section of the elf file are supported. + """ + self._total_queries_count += 1 + # Bisect against stop = self._largest_address + 1 to avoid bisecting against + # the "source path" tuple component. + bisect_index = bisect.bisect_right( + self._range_info_list, + (_AddressRange(address, self._largest_address + 1), '')) - 1 + if bisect_index >= 0: + info = self._range_info_list[bisect_index] + if info[0].start <= address < info[0].stop: + return info[1] + + self._unmatched_queries_count += 1 + return None + + @property + def unmatched_queries_ratio(self): + return self._unmatched_queries_count / self._total_queries_count + + +def CreateAddressSourceMapper(elf_path, tool_prefix): + """Runs dwarfdump. Returns object for querying source path given address.""" + return _SourceMapper(_Parse(elf_path, tool_prefix)) + + +def CreateAddressSourceMapperForTest(lines): + return _SourceMapper(_ParseDumpOutput(lines)) + + +def ParseDumpOutputForTest(lines): + return _ParseDumpOutput(lines) + + +def _Parse(elf_path, tool_prefix): + cmd = [ + path_util.GetDwarfdumpPath(tool_prefix), + elf_path, + '--debug-info', + '--summarize-types', + '--recurse-depth=0', + ] + stdout = subprocess.check_output(cmd, + stderr=subprocess.DEVNULL, + encoding='utf-8') + return _ParseDumpOutput(stdout.splitlines()) + + +def _ParseDumpOutput(lines): + """Parses passed-in dwarfdump stdout.""" + + # List of (_AddressRange, source path) tuples. + range_info_list = [] + + line_it = iter(lines) + line = next(line_it, None) + while line is not None: + if 'DW_TAG_compile_unit' not in line: + line = next(line_it, None) + continue + + line, address_ranges, source_path = _ParseCompileUnit(line_it) + if source_path and address_ranges: + for address_range in address_ranges: + range_info_list.append((address_range, source_path)) + + return sorted(range_info_list) + + +def _ParseCompileUnit(line_it): + """Parses DW_AT_compile_unit block. + + Example: + 0x000026: DW_AT_compile_unit + DW_AT_low_pc (0x02f) + DW_AT_high_pc (0x03f) + DW_AT_name (foo.cc) + """ + source_path = None + single_range = _AddressRange(0, 0) + range_addresses = [] + + while True: + line = next(line_it, None) + + dw_index = 0 if line is None else line.find('DW_') + if dw_index < 0: + continue + + if line is None or line.startswith('DW_TAG', dw_index): + if range_addresses: + # If compile unit specifies both DW_AT_ranges and DW_AT_low_pc, + # DW_AT_low_pc is base offset. Base offset is currently unsupported. + assert single_range.start == 0 + elif single_range.start > 0: + range_addresses.append(single_range) + return (line, range_addresses, source_path) + + if line.startswith('DW_AT_low_pc', dw_index): + single_range.start = int(_ExtractDwValue(line), 16) + if single_range.stop == 0: + single_range.stop = single_range.start + 1 + continue + if line.startswith('DW_AT_high_pc', dw_index): + single_range.stop = int(_ExtractDwValue(line), 16) + continue + if line.startswith('DW_AT_name', dw_index): + source_path = _ExtractDwValue(line) + continue + + if line.startswith('DW_AT_ranges', dw_index): + range_addresses = _ParseRanges(line_it) + + +def _ParseRanges(line_it): + """Parses DW_AT_ranges from dwarfdump stdout. + + Example: + [0x1, 0x2) + [0x5, 0x10)) + """ + range_addresses = [] + + line = next(line_it, None) + while line is not None: + num_opening_brackets = line.count('(') + line.count('[') + num_closing_brackets = line.count(')') + line.count(']') + + tokens = line.strip('([]) \t').split(',') + if len(tokens) == 2: + start_address = int(tokens[0], 16) + end_address = int(tokens[1], 16) + # Dwarf spec does not assign special meaning to empty ranges. + if start_address != end_address: + range_addresses.append(_AddressRange(start_address, end_address)) + + if num_closing_brackets > num_opening_brackets: + break + line = next(line_it, None) + + return range_addresses + + +def _ExtractDwValue(line): + """Extract DW_AT_ value from dwarfdump stdout. + + Examples: + DW_AT_name ("foo.cc") + DW_AT_decl_line (177) + DW_AT_low_pc (0x2) + """ + lparen_index = line.rfind('(') + if lparen_index < 0: + return None + rparen_index = line.find(')', lparen_index + 1) + if rparen_index < 0: + return None + if (lparen_index < rparen_index - 2 and line[lparen_index + 1] == '"' + and line[rparen_index - 1] == '"'): + lparen_index += 1 + rparen_index -= 1 + return line[lparen_index + 1:rparen_index]
diff --git a/tools/binary_size/libsupersize/dwarfdump_test.py b/tools/binary_size/libsupersize/dwarfdump_test.py new file mode 100755 index 0000000..b2f8aa2 --- /dev/null +++ b/tools/binary_size/libsupersize/dwarfdump_test.py
@@ -0,0 +1,182 @@ +#!/usr/bin/env python3 +# Copyright 2021 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import unittest + +import dwarfdump + + +class DwarfDumpTest(unittest.TestCase): + def _MakeRangeInfoList(self, flat_list): + out = [] + for item in flat_list: + assert len(item) == 3 + out.append((dwarfdump._AddressRange(item[0], item[1]), item[2])) + return out + + def testParseNonContiguousAddressRange(self): + """Test parsing DW_TAG_compile_unit with non-contiguous address range.""" + lines = [ + 'DW_TAG_compile_unit', + 'DW_AT_name ("solution.cc")', + 'DW_AT_low_pc (0x0)', + 'DW_AT_ranges (0x1', + '[0x10, 0x21)', + '[0x31, 0x41))', + ] + expected_info_list = [(0x10, 0x21, 'solution.cc'), + (0x31, 0x41, 'solution.cc')] + self.assertEqual(self._MakeRangeInfoList(expected_info_list), + dwarfdump.ParseDumpOutputForTest(lines)) + + def testParseNonContiguousAddressRangeOtherBrackets(self): + """Test parsing DW_AT_ranges when non-standard brackets are used.""" + lines = [ + 'DW_TAG_compile_unit', + 'DW_AT_name ("solution.cc")', + 'DW_AT_low_pc (0x0)', + 'DW_AT_ranges [0x1', + '(0x10, 0x21)', + '[0x31, 0x41]]', + ] + expected_info_list = [(0x10, 0x21, 'solution.cc'), + (0x31, 0x41, 'solution.cc')] + self.assertEqual(self._MakeRangeInfoList(expected_info_list), + dwarfdump.ParseDumpOutputForTest(lines)) + + def testParseNonContiguousIgnoreEmptyRanges(self): + """Test that empty ranges are ignored when parsing DW_AT_ranges.""" + lines = [ + 'DW_TAG_compile_unit', + 'DW_AT_name ("solution.cc")', + 'DW_AT_ranges (0x1', + '[0x1, 0x1)', + '[0x10, 0x21)', + '[0x22, 0x22)', + '[0x31, 0x41)', + '[0x42, 0x42))', + ] + expected_info_list = [(0x10, 0x21, 'solution.cc'), + (0x31, 0x41, 'solution.cc')] + self.assertEqual(self._MakeRangeInfoList(expected_info_list), + dwarfdump.ParseDumpOutputForTest(lines)) + + def testParseContiguousAddressRange(self): + """Test parsing DW_TAG_compile_unit with contiguous address range.""" + lines = [ + 'DW_TAG_compile_unit', + 'DW_AT_name ("solution.cc")', + 'DW_AT_low_pc (0x1)', + 'DW_AT_high_pc (0x10)', + ] + expected_info_list = [ + (0x1, 0x10, 'solution.cc'), + ] + self.assertEqual(self._MakeRangeInfoList(expected_info_list), + dwarfdump.ParseDumpOutputForTest(lines)) + + def testParseSingleAddress(self): + """Test parsing DW_TAG_compile_unit with single address.""" + lines = [ + 'DW_TAG_compile_unit', + 'DW_AT_name ("solution.cc")', + 'DW_AT_low_pc (0x10)', + ] + expected_info_list = [ + (0x10, 0x11, 'solution.cc'), + ] + self.assertEqual(self._MakeRangeInfoList(expected_info_list), + dwarfdump.ParseDumpOutputForTest(lines)) + + def testParseEmptyCompileUnit(self): + """Test parsing empty DW_TAG_compile_unit.""" + lines = ['DW_TAG_compile_unit'] + self.assertEqual([], dwarfdump.ParseDumpOutputForTest(lines)) + + def testConsecutiveCompileUnits(self): + """Test parsing consecutive DW_TAG_compile_units.""" + lines = [ + 'DW_TAG_compile_unit', + 'DW_AT_name ("foo.cc")', + 'DW_AT_low_pc (0x1)', + 'DW_AT_high_pc (0x10)', + 'DW_TAG_compile_unit', + 'DW_AT_name ("bar.cc")', + 'DW_AT_low_pc (0x12)', + 'DW_AT_high_pc (0x20)', + ] + expected_info_list = [(0x1, 0x10, 'foo.cc'), (0x12, 0x20, 'bar.cc')] + self.assertEqual(self._MakeRangeInfoList(expected_info_list), + dwarfdump.ParseDumpOutputForTest(lines)) + + def testTagTerminatedCompileUnit(self): + """Test parsing DW_TAG_compile_unit where compile unit is followed by a + non-DW_TAG_compile_unit entry. + """ + lines = [ + 'DW_TAG_compile_unit', + 'DW_AT_name ("foo.cc")', + 'DW_AT_low_pc (0x1)', + 'DW_AT_high_pc (0x10)', + 'DW_TAG_subprogram', + 'DW_AT_name ("bar.cc")', + 'DW_AT_low_pc (0x12)', + 'DW_AT_high_pc (0x20)', + ] + expected_info_list = [ + (0x1, 0x10, 'foo.cc'), + ] + self.assertEqual(self._MakeRangeInfoList(expected_info_list), + dwarfdump.ParseDumpOutputForTest(lines)) + + def testHandlePrefixes(self): + """Test parsing DW_TAG_compile_unit where 'DW_' does not start line in + DW_TAG_compile_unit entry. + """ + lines = [ + '0x1 DW_TAG_compile_unit', + ' DW_AT_language (DW_LANG_C_plus_plus_14)', + ' DW_AT_name ("solution.cc")', + ' DW_AT_stmt_list (0x5)', + ' DW_AT_low_pc (0x1)', + ' DW_AT_high_pc (0x10)', + ] + expected_info_list = [ + (0x1, 0x10, 'solution.cc'), + ] + self.assertEqual(self._MakeRangeInfoList(expected_info_list), + dwarfdump.ParseDumpOutputForTest(lines)) + + def testFindAddress(self): + """Tests for _SourceMapper.FindSourceForTextAddress()""" + lines = [ + 'DW_TAG_compile_unit', + 'DW_AT_name ("foo.cc")', + 'DW_AT_low_pc (0x1)', + 'DW_AT_high_pc (0x10)', + 'DW_TAG_compile_unit', + 'DW_AT_name ("bar.cc")', + 'DW_AT_low_pc (0x21)', + 'DW_AT_high_pc (0x30)', + 'DW_TAG_compile_unit', + 'DW_AT_name ("baz.cc")', + 'DW_AT_low_pc (0x41)', + 'DW_AT_high_pc (0x50)', + ] + source_mapper = dwarfdump.CreateAddressSourceMapperForTest(lines) + # Address is before first range. + self.assertIsNone(source_mapper.FindSourceForTextAddress(0x0)) + # Address matches start of first range. + self.assertEqual('foo.cc', source_mapper.FindSourceForTextAddress(0x1)) + # Address is in the middle of middle range. + self.assertEqual('bar.cc', source_mapper.FindSourceForTextAddress(0x2a)) + # Address matches end of last range. + self.assertEqual('baz.cc', source_mapper.FindSourceForTextAddress(0x4f)) + # Address is after lange range. + self.assertIsNone(source_mapper.FindSourceForTextAddress(0x50)) + + +if __name__ == '__main__': + unittest.main()
diff --git a/tools/binary_size/libsupersize/path_util.py b/tools/binary_size/libsupersize/path_util.py index fccae775..7dad64c1 100644 --- a/tools/binary_size/libsupersize/path_util.py +++ b/tools/binary_size/libsupersize/path_util.py
@@ -193,6 +193,10 @@ return tool_prefix + 'c++filt' +def GetDwarfdumpPath(tool_prefix): + return tool_prefix + 'dwarfdump' + + def GetStripPath(tool_prefix): # Chromium's toolchain uses //buildtools/third_party/eu-strip, but first # look for the test-only "fakestrip" for the sake of tests.
diff --git a/tools/binary_size/libsupersize/testdata/Archive_Elf_No_Map.golden b/tools/binary_size/libsupersize/testdata/Archive_Elf_No_Map.golden index a6d84f4..cbe1a6f 100644 --- a/tools/binary_size/libsupersize/testdata/Archive_Elf_No_Map.golden +++ b/tools/binary_size/libsupersize/testdata/Archive_Elf_No_Map.golden
@@ -8,18 +8,18 @@ tool_prefix=tools/binary_size/libsupersize/testdata/mock_toolchain/ Section .text: has 100.0% of 35982248 bytes accounted for from 11 symbols. 0 bytes are unaccounted for. * Padding accounts for 83704 bytes (0.2%) -* 3 have source paths. Accounts for 8472 bytes (0.0%). -* 3 have a component assigned. Accounts for 8472 bytes (0.0%). +* 11 have source paths. Accounts for 35982248 bytes (100.0%). +* 11 have a component assigned. Accounts for 35982248 bytes (100.0%). * 1 placeholders exist (symbols that start with **). Accounts for 35897728 bytes (99.8%). * 5 aliases exist, mapped to 2 unique addresses (32 bytes saved) * 0 symbols have shared ownership. * 1 symbols are clones. Accounts for 8 bytes (0.0%). Large padding of 75512 between: - A) .text@28d900(size_without_padding=8,padding=0,full_name=startup._GLOBAL__sub_I_page_allocator.cc,object_path=,source_path=,flags={},num_aliases=1,component=) - B) .text@2a0000(size_without_padding=16,padding=75512,full_name=BazAlias(bool),object_path=,source_path=,flags={},num_aliases=2,component=) + A) .text@28d900(size_without_padding=8,padding=0,full_name=startup._GLOBAL__sub_I_page_allocator.cc,object_path=,source_path=third_party/container/container.c,flags={},num_aliases=1,component=UI>Browser) + B) .text@2a0000(size_without_padding=16,padding=75512,full_name=BazAlias(bool),object_path=,source_path=third_party/container/container.c,flags={},num_aliases=2,component=UI>Browser) Large padding of 8168 between: - A) .text@2a0010(size_without_padding=8,padding=0,full_name=blink::ContiguousContainerBase::shrinkToFit(),object_path=third_party/sub/PaintChunker.o,source_path=third_party/paint.cc,flags={clone},num_aliases=3,component=Internal>Android) - B) .text@2a2000(size_without_padding=8,padding=8168,full_name=OUTLINED_FUNCTION_0,object_path=third_party/sub/ContiguousContainer.o,source_path=third_party/container/container.c,flags={},num_aliases=1,component=UI>Browser) + A) .text@2a0010(size_without_padding=8,padding=0,full_name=blink::ContiguousContainerBase::shrinkToFit(),object_path=,source_path=third_party/container/container.c,flags={clone},num_aliases=3,component=UI>Browser) + B) .text@2a2000(size_without_padding=8,padding=8168,full_name=OUTLINED_FUNCTION_0,object_path=,source_path=base/allocator/page_allocator.cc,flags={},num_aliases=1,component=Blink>Internal) Section .rodata: has 0.0% of 0 bytes accounted for from 0 symbols. 5927652 bytes are unaccounted for. * Padding accounts for 0 bytes (0.0%) * 0 have source paths. Accounts for 0 bytes (0.0%). @@ -67,17 +67,17 @@ * 0 have a component assigned. Accounts for 0 bytes (0.0%). * 22 placeholders exist (symbols that start with **). Accounts for 56448494 bytes (62.5%). * 0 symbols have shared ownership. -.text@28d900(size_without_padding=8,padding=0,full_name=startup._GLOBAL__sub_I_page_allocator.cc,object_path=,source_path=,flags={},num_aliases=1,component=) -.text@2a0000(size_without_padding=16,padding=75512,full_name=BazAlias(bool),object_path=,source_path=,flags={},num_aliases=2,component=) -.text@2a0000(size_without_padding=16,padding=75512,full_name=blink::ContiguousContainerBase::shrinkToFit(),object_path=,source_path=,flags={},num_aliases=2,component=) -.text@2a0010(size_without_padding=8,padding=0,full_name=BarAlias(),object_path=,source_path=,flags={},num_aliases=3,component=) -.text@2a0010(size_without_padding=8,padding=0,full_name=FooAlias(),object_path=,source_path=,flags={},num_aliases=3,component=) -.text@2a0010(size_without_padding=8,padding=0,full_name=blink::ContiguousContainerBase::shrinkToFit(),object_path=third_party/sub/PaintChunker.o,source_path=third_party/paint.cc,flags={clone},num_aliases=3,component=Internal>Android) -.text@2a2000(size_without_padding=8,padding=8168,full_name=OUTLINED_FUNCTION_0,object_path=third_party/sub/ContiguousContainer.o,source_path=third_party/container/container.c,flags={},num_aliases=1,component=UI>Browser) -.text@2a2020(size_without_padding=264,padding=24,full_name=OUTLINED_FUNCTION_1,object_path=third_party/sub/ContiguousContainer.o,source_path=third_party/container/container.c,flags={},num_aliases=1,component=UI>Browser) -.text@2a2128(size_without_padding=248,padding=0,full_name=AssemblySymbol,object_path=,source_path=,flags={},num_aliases=1,component=) -.text@2a2220(size_without_padding=264,padding=0,full_name=aliasedWithOutlinedFunction(),object_path=,source_path=,flags={},num_aliases=1,component=) -.text@2a2328(size_without_padding=35897728,padding=0,full_name=** .text (unattributed),object_path=,source_path=,flags={},num_aliases=1,component=) +.text@28d900(size_without_padding=8,padding=0,full_name=startup._GLOBAL__sub_I_page_allocator.cc,object_path=,source_path=third_party/container/container.c,flags={},num_aliases=1,component=UI>Browser) +.text@2a0000(size_without_padding=16,padding=75512,full_name=BazAlias(bool),object_path=,source_path=third_party/container/container.c,flags={},num_aliases=2,component=UI>Browser) +.text@2a0000(size_without_padding=16,padding=75512,full_name=blink::ContiguousContainerBase::shrinkToFit(),object_path=,source_path=third_party/container/container.c,flags={},num_aliases=2,component=UI>Browser) +.text@2a0010(size_without_padding=8,padding=0,full_name=BarAlias(),object_path=,source_path=third_party/container/container.c,flags={},num_aliases=3,component=UI>Browser) +.text@2a0010(size_without_padding=8,padding=0,full_name=FooAlias(),object_path=,source_path=third_party/container/container.c,flags={},num_aliases=3,component=UI>Browser) +.text@2a0010(size_without_padding=8,padding=0,full_name=blink::ContiguousContainerBase::shrinkToFit(),object_path=,source_path=third_party/container/container.c,flags={clone},num_aliases=3,component=UI>Browser) +.text@2a2000(size_without_padding=8,padding=8168,full_name=OUTLINED_FUNCTION_0,object_path=,source_path=base/allocator/page_allocator.cc,flags={},num_aliases=1,component=Blink>Internal) +.text@2a2020(size_without_padding=264,padding=24,full_name=OUTLINED_FUNCTION_1,object_path=,source_path=base/allocator/page_allocator.cc,flags={},num_aliases=1,component=Blink>Internal) +.text@2a2128(size_without_padding=248,padding=0,full_name=AssemblySymbol,object_path=,source_path=base/allocator/page_allocator.cc,flags={},num_aliases=1,component=Blink>Internal) +.text@2a2220(size_without_padding=264,padding=0,full_name=aliasedWithOutlinedFunction(),object_path=,source_path=base/allocator/page_allocator.cc,flags={},num_aliases=1,component=Blink>Internal) +.text@2a2328(size_without_padding=35897728,padding=0,full_name=** .text (unattributed),object_path=,source_path=base/allocator/page_allocator.cc,flags={},num_aliases=1,component=Blink>Internal) .other@0(size_without_padding=60,padding=0,full_name=** ELF Section: .ARM.attributes,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=1536456,padding=0,full_name=** ELF Section: .ARM.exidx,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=183632,padding=0,full_name=** ELF Section: .ARM.extab,object_path=,source_path=,flags={},num_aliases=1,component=)
diff --git a/tools/binary_size/libsupersize/testdata/mock_toolchain/dwarfdump b/tools/binary_size/libsupersize/testdata/mock_toolchain/dwarfdump new file mode 100755 index 0000000..7e36a4e --- /dev/null +++ b/tools/binary_size/libsupersize/testdata/mock_toolchain/dwarfdump
@@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +base_dir=$(dirname "$0") +exec python "$base_dir/mock_dwarfdump.py" "$@"
diff --git a/tools/binary_size/libsupersize/testdata/mock_toolchain/mock_dwarfdump.py b/tools/binary_size/libsupersize/testdata/mock_toolchain/mock_dwarfdump.py new file mode 100644 index 0000000..1cc53fa --- /dev/null +++ b/tools/binary_size/libsupersize/testdata/mock_toolchain/mock_dwarfdump.py
@@ -0,0 +1,39 @@ +# Copyright 2021 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import sys + +_OUTPUT = """\ +{}: +0x06435d99: DW_TAG_compile_unit + DW_AT_producer ("") + DW_AT_language (DW_LANG_C_plus_plus_14) + DW_AT_name ("../../base/allocator/page_allocator.cc") + DW_AT_stmt_list (0x041db38d) + DW_AT_comp_dir (".") + DW_AT_low_pc (0x00000000) + DW_AT_ranges (0x00a6f848 + [0x02a2000, 0x02a3000)) +0x06435f01: DW_TAG_compile_unit + DW_AT_producer ("") + DW_AT_language (DW_LANG_C_plus_plus_14) + DW_AT_name ("../../third_party/container/container.c") + DW_AT_stmt_list (0x0846bbf7) + DW_AT_comp_dir (".") + DW_AT_low_pc (0x00000000) + DW_AT_ranges (0x0150ea78 + [0x028d800, 0x028da00) + [0x02a0000, 0x02a0020) + [0x0000001, 0x0000001)) +""" + + +def main(): + paths = [p for p in sys.argv[1:] if not p.startswith('-')] + sys.stdout.write(_OUTPUT.format(paths[0])) + sys.stdout.write('\n') + + +if __name__ == '__main__': + main()
diff --git a/tools/bisect/OWNERS b/tools/bisect/OWNERS new file mode 100644 index 0000000..0e5f33c6 --- /dev/null +++ b/tools/bisect/OWNERS
@@ -0,0 +1,2 @@ +svenzheng@chromium.org +
diff --git a/tools/bisect/bisect.py b/tools/bisect/bisect.py new file mode 100755 index 0000000..b49a55a --- /dev/null +++ b/tools/bisect/bisect.py
@@ -0,0 +1,125 @@ +#!/usr/bin/env python3 +# Copyright 2021 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# This is a script helping developer bisect test failures. +# +# Currently this only supports bisecting gtest based test failures. +# Say you're assigned a BrowserTest.TestCase1 failure. You would generally do +# 1 Find a good commit and bad commit. +# 2 `git bisect start` +# 3 `git bisect good <good commit id>` +# 4 `git bisect bad <bad commit id>` +# 5 `gclient sync` +# 6 `autoninja -C out/Default browser_tests` +# 7 `out/Default/browser_tests --gtest_filter=BrowserTest.TestCase1` +# 8 if the test pass, `git bisect good`, otherwise `git bisect bad`. +# 9 repeat 5 - 8 until finding the culprit. +# This script will help you on 2 - 9. You first do 1, then run +# `python3 tools/bisect/bisect.py -g <good commit id> -b <bad commit id> +# --build_command 'autoninja -C out/Default browser_tests' +# --test_command 'out/Default/browser_tests +# --gtest_filter=BrowserTest.TestCase1'` +# The script will run until it finds the culprit cl breaking the test. +# +# Note1: We only support non-flaky -> failure, or non-flaky -> flaky. +# Flaky -> failure can't get correct result. For non-flaky -> flaky, +# you can use `--gtest_repeat`. +# Note2: For tests using python launching script, this is supported. e.g. +# `--test_command 'build/lacros/test_runner.py test +# out/lacrosdesktop/lacros_chrome_browsertests +# --ash-chrome-path=out/lacrosdesktop/ash_clang_x64/test_ash_chrome +# --gtest_filter=BrowserTest.TestCase1'` + +import argparse +import subprocess +import sys + +# This is the message from `git bisect` when it +# finds the culprit cl. +GIT_BAD_COMMENT_MSG = 'is the first bad commit' +GIT_BISECT_IN_PROCESS_MSG = 'left to test after this' + + +def Run(command, print_stdout_on_error=True): + print(command) + c = subprocess.run(command, shell=True) + if print_stdout_on_error and c.returncode != 0: + print(c.stdout) + return c.returncode == 0 + + +def StartBisect(good_rev, bad_rev, build_command, test_command): + assert (Run('git bisect start')) + assert (Run('git bisect bad %s' % bad_rev)) + assert (Run('git bisect good %s' % good_rev)) + + while True: + assert (Run('gclient sync')) + assert (Run(build_command)) + test_ret = None + # If the test result is different running twice, then + # try again. + for _ in range(5): + c1 = Run(test_command, print_stdout_on_error=False) + c2 = Run(test_command, print_stdout_on_error=False) + if c1 == c2: + test_ret = c2 + break + + gitcp = None + if test_ret: + print('git bisect good') + gitcp = subprocess.run('git bisect good', + shell=True, + capture_output=True, + text=True) + else: + print('git bisect bad') + gitcp = subprocess.run('git bisect bad', + shell=True, + capture_output=True, + text=True) + # git should always print 'left to test after this'. No stdout + # means something is wrong. + if not gitcp.stdout: + print('Something is wrong! Exit bisect.') + if gitcp.stderr: + print(gitcp.stderr) + break + + print(gitcp.stdout) + first_line = gitcp.stdout[:gitcp.stdout.find('\n')] + # Found the culprit! + if GIT_BAD_COMMENT_MSG in first_line: + print('Found the culprit change!') + return 0 + if GIT_BISECT_IN_PROCESS_MSG not in first_line: + print('Something is wrong! Exit bisect.') + if gitcp.stderr: + print(gitcp.stderr) + break + return 1 + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('-b', + '--bad', + type=str, + help='A bad revision to start bisection.') + parser.add_argument('-g', + '--good', + type=str, + help='A good revision to start bisection.') + parser.add_argument('--build_command', + type=str, + help='Command to build test target.') + parser.add_argument('--test_command', type=str, help='Command to run test.') + args = parser.parse_args() + return StartBisect(args.good, args.bad, args.build_command, args.test_command) + + +if __name__ == '__main__': + sys.exit(main())
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 24e71da..d71fb1c 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -478,6 +478,7 @@ 'GPU FYI Linux dEQP Builder': 'angle_deqp_release_trybot', 'GPU FYI Mac Builder': 'gpu_fyi_tests_release_trybot', 'GPU FYI Mac Builder (dbg)': 'gpu_fyi_tests_debug_trybot', + 'GPU FYI Mac arm64 Builder': 'gpu_fyi_tests_release_trybot_arm64', 'GPU FYI Win Builder': 'gpu_fyi_tests_release_trybot_x86', 'GPU FYI Win x64 Builder': 'gpu_fyi_tests_release_trybot', 'GPU FYI Win x64 Builder (dbg)': 'gpu_fyi_tests_debug_trybot', @@ -486,7 +487,6 @@ 'GPU FYI XR Win x64 Builder': 'gpu_fyi_tests_release_trybot', 'Linux FYI GPU TSAN Release': 'gpu_fyi_tests_release_trybot_tsan', 'Linux FYI SkiaRenderer Dawn Release (Intel HD 630)': 'gpu_tests_sk_dawn_release_trybot', - 'Mac FYI arm64 Release (Apple DTK)': 'gpu_fyi_tests_release_trybot_arm64', 'Mac FYI GPU ASAN Release': 'gpu_fyi_tests_release_trybot_asan', 'Optional Android Release (Nexus 5X)': 'gpu_tests_android_release_trybot_arm64', 'Optional Android Release (Pixel 4)': 'gpu_tests_android_release_trybot', @@ -1091,7 +1091,7 @@ 'gpu-fyi-try-mac-amd-retina-dbg': 'gpu_fyi_tests_debug_trybot', 'gpu-fyi-try-mac-amd-retina-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-amd-retina-rel': 'gpu_fyi_tests_release_trybot', - 'gpu-fyi-try-mac-arm64-apple-dtk-rel': 'gpu_fyi_tests_release_trybot_arm64', + 'gpu-fyi-try-mac-arm64-apple-m1-rel': 'gpu_fyi_tests_release_trybot_arm64', 'gpu-fyi-try-mac-asan': 'gpu_fyi_tests_release_trybot_asan', 'gpu-fyi-try-mac-intel-dbg': 'gpu_fyi_tests_debug_trybot', 'gpu-fyi-try-mac-intel-exp': 'gpu_fyi_tests_release_trybot',
diff --git a/tools/mb/mb_config_expectations/chromium.gpu.fyi.json b/tools/mb/mb_config_expectations/chromium.gpu.fyi.json index 3552781..2f840cb 100644 --- a/tools/mb/mb_config_expectations/chromium.gpu.fyi.json +++ b/tools/mb/mb_config_expectations/chromium.gpu.fyi.json
@@ -275,6 +275,23 @@ "use_goma": true } }, + "GPU FYI Mac arm64 Builder": { + "gn_args": { + "blink_enable_generated_code_formatting": false, + "build_angle_trace_perf_tests": true, + "dcheck_always_on": true, + "enable_nacl": false, + "ffmpeg_branding": "Chrome", + "internal_gles2_conform_tests": true, + "is_component_build": false, + "is_debug": false, + "is_gpu_fyi_bot": true, + "proprietary_codecs": true, + "symbol_level": 1, + "target_cpu": "arm64", + "use_goma": true + } + }, "GPU FYI Win Builder": { "gn_args": { "blink_enable_generated_code_formatting": false, @@ -418,23 +435,6 @@ "use_goma": true } }, - "Mac FYI arm64 Release (Apple DTK)": { - "gn_args": { - "blink_enable_generated_code_formatting": false, - "build_angle_trace_perf_tests": true, - "dcheck_always_on": true, - "enable_nacl": false, - "ffmpeg_branding": "Chrome", - "internal_gles2_conform_tests": true, - "is_component_build": false, - "is_debug": false, - "is_gpu_fyi_bot": true, - "proprietary_codecs": true, - "symbol_level": 1, - "target_cpu": "arm64", - "use_goma": true - } - }, "Optional Android Release (Nexus 5X)": { "gn_args": { "blink_enable_generated_code_formatting": false,
diff --git a/tools/mb/mb_config_expectations/tryserver.chromium.mac.json b/tools/mb/mb_config_expectations/tryserver.chromium.mac.json index 3533624..aa73d84a 100644 --- a/tools/mb/mb_config_expectations/tryserver.chromium.mac.json +++ b/tools/mb/mb_config_expectations/tryserver.chromium.mac.json
@@ -61,7 +61,7 @@ "use_goma": true } }, - "gpu-fyi-try-mac-arm64-apple-dtk-rel": { + "gpu-fyi-try-mac-arm64-apple-m1-rel": { "gn_args": { "blink_enable_generated_code_formatting": false, "build_angle_trace_perf_tests": true,
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index 1f30b8a..0026669 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -802,6 +802,11 @@ <description>User pressed the stop media control button.</description> </action> +<action name="Accel_Microphone_Mute"> + <owner>rtinkoff@google.com</owner> + <description>User pressed the microphone mute toggle key.</description> +</action> + <action name="Accel_Minimize_Top_Window_On_Back"> <owner>minch@chromium.org</owner> <description> @@ -10139,6 +10144,20 @@ <description>Please enter the description of this user action.</description> </action> +<action name="Keyboard_Microphone_Muted"> + <owner>rtinkoff@chromium.org</owner> + <description> + The user muted the mic by pressing the mic mute keyboard key. + </description> +</action> + +<action name="Keyboard_Microphone_Unmuted"> + <owner>rtinkoff@chromium.org</owner> + <description> + The user unmuted the mic by pressing the mic mute keyboard key. + </description> +</action> + <action name="KeyboardShortcutViewer.CreateWindow"> <owner>wutao@chromium.org</owner> <description>
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 0128075..d9a8816 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -7773,6 +7773,7 @@ <int value="249" label="RFH_DID_CHANGE_IFRAME_ATTRIBUTE"/> <int value="250" label="FARI_LOGOUT_BAD_ENDPOINT"/> <int value="251" label="RFH_CHILD_FRAME_UNEXPECTED_OWNER_ELEMENT_TYPE"/> + <int value="252" label="RFH_POPUP_REQUEST_WHILE_PRERENDERING"/> </enum> <enum name="BadMessageReasonExtensions"> @@ -27671,6 +27672,7 @@ <int value="478" label="STORAGE_SESSION_ON_CHANGE"/> <int value="479" label="ACCESSIBILITY_PRIVATE_ON_TOGGLE_DICTATION"/> <int value="480" label="WEB_AUTHENTICATION_PROXY_ON_ISUVPAA_REQUEST"/> + <int value="481" label="SPEECH_RECOGNITION_PRIVATE_ON_STOP"/> </enum> <enum name="ExtensionFileWriteResult"> @@ -29338,6 +29340,7 @@ <int value="1588" label="OS_DIAGNOSTICS_RUNMEMORYROUTINE"/> <int value="1589" label="OS_DIAGNOSTICS_GETROUTINEUPDATE"/> <int value="1590" label="SPEECHRECOGNITIONPRIVATE_START"/> + <int value="1591" label="SPEECHRECOGNITIONPRIVATE_STOP"/> </enum> <enum name="ExtensionIconState"> @@ -47877,7 +47880,6 @@ <int value="-1730755478" label="ClosedTabCache:disabled"/> <int value="-1729926412" label="enable-webusb-notifications"/> <int value="-1729808721" label="SubresourceRedirect:enabled"/> - <int value="-1729264718" label="WebAuthenticationAssertionTransport:enabled"/> <int value="-1728605240" label="UseXpsForPrintingFromPdf:enabled"/> <int value="-1727530898" label="LookalikeUrlNavigationSuggestionsUI:enabled"/> <int value="-1727173228" label="OmniboxZeroSuggestionsOnNTP:enabled"/> @@ -49371,6 +49373,7 @@ <int value="-594732580" label="CCTResizableForThirdParties:enabled"/> <int value="-594076614" label="PluginVmShowCameraPermissions:disabled"/> <int value="-593536514" label="ExperimentalTabController:enabled"/> + <int value="-593079381" label="component-updater"/> <int value="-592628080" label="DnsProxyEnableDOH:disabled"/> <int value="-591874964" label="LiteVideo:enabled"/> <int value="-591219096" label="SystemChinesePhysicalTyping:enabled"/> @@ -50355,6 +50358,8 @@ <int value="203776499" label="enable-virtual-keyboard-overscroll"/> <int value="207907053" label="OmniboxUIExperimentBlueSearchLoopAndSearchQuery:enabled"/> + <int value="209341217" + label="WebAuthenticationAuthenticatorAttachment:disabled"/> <int value="209792775" label="TabGroupsAndroid:enabled"/> <int value="211313007" label="CrOSEnforceSystemAecNs:disabled"/> <int value="212489101" label="AutofillAssistantChromeEntry:enabled"/> @@ -50970,7 +50975,6 @@ <int value="672067370" label="InstallableAmbientBadgeMessage:enabled"/> <int value="673588373" label="OmniboxPedalSuggestions:disabled"/> <int value="674627327" label="MagnifierNewFocusFollowing:enabled"/> - <int value="674777894" label="WebAuthenticationAssertionTransport:disabled"/> <int value="674788251" label="EnableNewBadgeOnMenuItems:enabled"/> <int value="677866592" label="ClickToCallUI:disabled"/> <int value="677883800" label="DiagnosticsAppNavigation:disabled"/> @@ -52778,6 +52782,8 @@ <int value="2084477383" label="CrostiniDiskResizing:enabled"/> <int value="2084638930" label="AutofillEnforceMinRequiredFieldsForUpload:enabled"/> + <int value="2085105493" + label="WebAuthenticationAuthenticatorAttachment:enabled"/> <int value="2085186092" label="BulkPrinters:disabled"/> <int value="2085438501" label="ChromeHome:enabled"/> <int value="2087069781" label="ui-debug-tools:enabled"/>
diff --git a/tools/metrics/histograms/metadata/chrome/histograms.xml b/tools/metrics/histograms/metadata/chrome/histograms.xml index 4ee9518a..b1a8313 100644 --- a/tools/metrics/histograms/metadata/chrome/histograms.xml +++ b/tools/metrics/histograms/metadata/chrome/histograms.xml
@@ -43,14 +43,14 @@ <histogram name="Chrome.ProcessSingleton.RemoteHungProcessTerminateReason" enum="RemoteHungProcessTerminateReason" expires_after="M98"> <owner>gab@chromium.org</owner> - <owner>aseren@yandex-team.ru</owner> + <owner>etienneb@chromium.org</owner> <summary>The reason of remote hang processes termination.</summary> </histogram> <histogram name="Chrome.ProcessSingleton.RemoteProcessInteractionResult" - enum="RemoteProcessInteractionResult" expires_after="M81"> + enum="RemoteProcessInteractionResult" expires_after="M98"> <owner>gab@chromium.org</owner> - <owner>aseren@yandex-team.ru</owner> + <owner>etienneb@chromium.org</owner> <summary> Used to send the result of interaction with remote process as histograms in case when remote process influences on start. @@ -58,9 +58,9 @@ </histogram> <histogram name="Chrome.ProcessSingleton.TerminateProcessErrorCode.Posix" - enum="PopularOSErrno" expires_after="M77"> + enum="PopularOSErrno" expires_after="M98"> <owner>gab@chromium.org</owner> - <owner>aseren@yandex-team.ru</owner> + <owner>etienneb@chromium.org</owner> <summary> The error code of remote process termination on Posix in case when remote process hung. @@ -70,7 +70,7 @@ <histogram name="Chrome.ProcessSingleton.TerminateProcessErrorCode.Windows" enum="WinGetLastError" expires_after="M98"> <owner>gab@chromium.org</owner> - <owner>aseren@yandex-team.ru</owner> + <owner>etienneb@chromium.org</owner> <summary> The error code of remote process termination on Windows in case when remote process hung. @@ -80,7 +80,7 @@ <histogram name="Chrome.ProcessSingleton.TerminateProcessTime" units="ms" expires_after="M98"> <owner>gab@chromium.org</owner> - <owner>aseren@yandex-team.ru</owner> + <owner>etienneb@chromium.org</owner> <summary> Time it takes from TerminateProcess call to the moment when we stop waiting for remote process switches to signal state. @@ -88,9 +88,9 @@ </histogram> <histogram name="Chrome.ProcessSingleton.TerminationWaitErrorCode.Windows" - enum="WinGetLastError" expires_after="M81"> + enum="WinGetLastError" expires_after="M98"> <owner>gab@chromium.org</owner> - <owner>aseren@yandex-team.ru</owner> + <owner>etienneb@chromium.org</owner> <summary> The error code of wating for remote process termination on Windows. </summary>
diff --git a/tools/metrics/histograms/metadata/hang_watcher/histograms.xml b/tools/metrics/histograms/metadata/hang_watcher/histograms.xml index 5796fe1..3c6857a 100644 --- a/tools/metrics/histograms/metadata/hang_watcher/histograms.xml +++ b/tools/metrics/histograms/metadata/hang_watcher/histograms.xml
@@ -33,7 +33,7 @@ </variants> <histogram name="HangWatcher.IsThreadHung.{ProcessType}.{ThreadType}" - enum="BooleanHung" expires_after="2021-10-23"> + enum="BooleanHung" expires_after="2022-10-23"> <owner>olivierli@chromium.org</owner> <owner>catan-team@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/histogram_suffixes_list.xml b/tools/metrics/histograms/metadata/histogram_suffixes_list.xml index 6981d7a..20ab30f 100644 --- a/tools/metrics/histograms/metadata/histogram_suffixes_list.xml +++ b/tools/metrics/histograms/metadata/histogram_suffixes_list.xml
@@ -12939,28 +12939,6 @@ </affected-histogram> </histogram_suffixes> -<histogram_suffixes name="PermissionPromptDisposition" separator="."> - <suffix name="AnchoredBubble" - label="A bubble under the site settings padlock"/> - <suffix name="CustomModalDialog" label="Other custom modal dialogs"/> - <suffix name="LocationBarLeftChip" - label="A chip on the left-hand side of the location bar that shows a - bubble when clicked"/> - <suffix name="LocationBarLeftQuietChip" - label="A less prominent version of a chip on the left-hand side of the - location bar that shows a bubble when clicked"/> - <suffix name="LocationBarRightAnimatedIcon" - label="An animated indicator on the right-hand side of the location bar"/> - <suffix name="LocationBarRightStaticIcon" - label="A static indicator on the right-hand side of the location bar"/> - <suffix name="MiniInfobar" - label="An initially-collapsed infobar at the bottom of the page"/> - <suffix name="ModalDialog" label="A modal dialog"/> - <suffix name="NoneVisible" label="There was no UI being shown"/> - <suffix name="NotApplicable" label="No permission prompt at all"/> - <affected-histogram name="Permissions.Action.WithDisposition"/> -</histogram_suffixes> - <histogram_suffixes name="PermissionRequestGesture" separator="."> <suffix name="Gesture" label="With user gesture"/> <suffix name="NoGesture" label="Without user gesture"/>
diff --git a/tools/metrics/histograms/metadata/history/histograms.xml b/tools/metrics/histograms/metadata/history/histograms.xml index 93dccdf..2e176af 100644 --- a/tools/metrics/histograms/metadata/history/histograms.xml +++ b/tools/metrics/histograms/metadata/history/histograms.xml
@@ -415,6 +415,61 @@ </summary> </histogram> +<histogram name="History.Clusters.UIActions.Cluster.{ClusterAction}" + units="index" expires_after="2022-02-25"> + <owner>mahmadi@chromium.org</owner> + <owner>chrome-memories@google.com</owner> + <summary> + Recorded every time the user {ClusterAction} in chrome://history/journeys. + The value represents the 0-indexed index of the cluster. + </summary> + <token key="ClusterAction"> + <variant name="Deleted" summary="deletes a history cluster"/> + <variant name="RelatedSearchClicked" + summary="clicks a related search suggestion"/> + <variant name="RelatedVisitsVisibilityToggled" + summary="toggles visibility of the default-hidden related visits"/> + <variant name="VisitClicked" summary="clicks a visit"/> + </token> +</histogram> + +<histogram + name="History.Clusters.UIActions.RelatedSearch.{RelatedSearchAction}" + units="index" expires_after="2022-02-25"> + <owner>mahmadi@chromium.org</owner> + <owner>chrome-memories@google.com</owner> + <summary> + Recorded every time the user {RelatedSearchAction} a related search + suggestion in a history cluster in chrome://history/journeys. The value + represents the 0-indexed index of the related search suggestion in the + respective cluster. + </summary> + <token key="RelatedSearchAction"> + <variant name="Clicked" summary="clicks"/> + </token> +</histogram> + +<histogram name="History.Clusters.UIActions.{VisitType}Visit.{VisitAction}" + units="index" expires_after="2022-02-25"> + <owner>mahmadi@chromium.org</owner> + <owner>chrome-memories@google.com</owner> + <summary> + Recorded every time the user {VisitAction} a {VisitType} in a history + cluster in chrome://history/journeys. The value represents the 0-indexed + index of the visit in the respective cluster. + </summary> + <token key="VisitAction"> + <variant name="Clicked" summary="clicks"/> + <variant name="Deleted" summary="deletes"/> + </token> + <token key="VisitType"> + <variant name="" summary="visit"/> + <variant name="nonSRP" + summary="visit to a url other than the default search results page"/> + <variant name="SRP" summary="visit to the default search results page"/> + </token> +</histogram> + <histogram name="History.DatabaseAdvancedMetricsTime" units="ms" expires_after="M77"> <owner>shess@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/new_tab_page/histograms.xml b/tools/metrics/histograms/metadata/new_tab_page/histograms.xml index 244fd880..52c7185 100644 --- a/tools/metrics/histograms/metadata/new_tab_page/histograms.xml +++ b/tools/metrics/histograms/metadata/new_tab_page/histograms.xml
@@ -796,6 +796,18 @@ </summary> </histogram> +<histogram name="NewTabPage.Height" units="pixels" expires_after="2022-06-01"> + <owner>danpeng@google.com</owner> + <owner>tiborg@chromium.org</owner> + <owner>chrome-desktop-ntp@google.com</owner> + <summary> + Height of the NTP viewport in CSS pixels. Logged when the NTP loads. Only + logged on the 1P NTP. Note that even if the user has Google as their default + search engine, Incognito and Guest mode NTPs are not considered 1P and don't + log this histogram. + </summary> +</histogram> + <histogram name="NewTabPage.Languages.UILanguageRatioInTwoTopLanguages" units="%" expires_after="M77"> <owner>jkrcal@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/permissions/histograms.xml b/tools/metrics/histograms/metadata/permissions/histograms.xml index 18aecb4..cb9442f 100644 --- a/tools/metrics/histograms/metadata/permissions/histograms.xml +++ b/tools/metrics/histograms/metadata/permissions/histograms.xml
@@ -48,8 +48,8 @@ </summary> </histogram> -<histogram name="Permissions.Action.WithDisposition" enum="PermissionAction" - expires_after="2022-08-25"> +<histogram name="Permissions.Action.WithDisposition.{DispositionType}" + enum="PermissionAction" expires_after="2022-08-25"> <owner>andypaicu@chromium.org</owner> <owner>engedy@chromium.org</owner> <owner>hkamila@chromium.org</owner> @@ -59,6 +59,31 @@ disposition. Suffixed by the UI disposition that the prompt used. Recorded when a permission prompt has been resolved. </summary> + <token key="DispositionType"> + <variant name="AnchoredBubble" + summary="A bubble under the site settings padlock"/> + <variant name="CustomModalDialog" summary="Other custom modal dialogs"/> + <variant name="LocationBarLeftChip" + summary="A chip on the left-hand side of the location bar that shows + a bubble when clicked"/> + <variant name="LocationBarLeftQuietChip" + summary="A less prominent version of a chip on the left-hand side of + the location bar that shows a bubble when clicked"/> + <variant name="LocationBarRightAnimatedIcon" + summary="An animated indicator on the right-hand side of the location + bar"/> + <variant name="LocationBarRightStaticIcon" + summary="A static indicator on the right-hand side of the location + bar"/> + <variant name="MessageUI" + summary="A message bubble near top of the screen and below the + location bar (alternative to Infobar UI)"/> + <variant name="MiniInfobar" + summary="An initially-collapsed infobar at the bottom of the page"/> + <variant name="ModalDialog" summary="A modal dialog"/> + <variant name="NoneVisible" summary="There was no UI being shown"/> + <variant name="NotApplicable" summary="No permission prompt at all"/> + </token> </histogram> <histogram name="Permissions.API.CreatedPermissionStatusObjects" units="units"
diff --git a/tools/perf/chrome_telemetry_build/BUILD.gn b/tools/perf/chrome_telemetry_build/BUILD.gn index 39d7132..2d6c25ea 100644 --- a/tools/perf/chrome_telemetry_build/BUILD.gn +++ b/tools/perf/chrome_telemetry_build/BUILD.gn
@@ -168,7 +168,7 @@ # switching has proven to be very difficult due to interactions with Pinpoint. group("all_chrome_android_targets_for_perf_testing") { testonly = true - data_deps = [] + data_deps = [ "//chrome/android/webapk/shell_apk:maps_go_webapk" ] foreach(_target_suffix, telemetry_android_browser_target_suffixes) { data_deps += [ ":telemetry_chrome_test${_target_suffix}" ] }
diff --git a/ui/chromeos/styles/cros_colors.json5 b/ui/chromeos/styles/cros_colors.json5 index 44160394..0592408 100644 --- a/ui/chromeos/styles/cros_colors.json5 +++ b/ui/chromeos/styles/cros_colors.json5
@@ -92,8 +92,8 @@ debug: "#00ffff", }, icon_color_disabled: { - light: "rgba($google_grey_700_rgb, $disabled_opacity)", - dark: "rgba($google_grey_200_rgb, $disabled_opacity)", + light: "$google_grey_600", + dark: "$google_grey_500", }, icon_color_alert: { light: "$google_red_600",
diff --git a/ui/display/screen.cc b/ui/display/screen.cc index 77249bb..4317bc0 100644 --- a/ui/display/screen.cc +++ b/ui/display/screen.cc
@@ -12,6 +12,7 @@ #include "base/time/time.h" #include "build/build_config.h" #include "ui/display/display.h" +#include "ui/display/display_util.h" #include "ui/display/types/display_constants.h" #include "ui/gfx/geometry/rect.h" @@ -50,8 +51,8 @@ return GetDisplayNearestWindow(GetWindowForView(view)); } -display::Display Screen::GetDisplayForNewWindows() const { - display::Display display; +Display Screen::GetDisplayForNewWindows() const { + Display display; // Scoped value can override if it is set. if (scoped_display_id_for_new_windows_ != kInvalidDisplayId && GetDisplayWithDisplayId(scoped_display_id_for_new_windows_, &display)) { @@ -70,17 +71,6 @@ display_id_for_new_windows_ = display_id; } -DisplayList Screen::GetDisplayListNearestViewWithFallbacks( - gfx::NativeView view) const { - return GetDisplayListNearestDisplayWithFallbacks(GetDisplayNearestView(view)); -} - -DisplayList Screen::GetDisplayListNearestWindowWithFallbacks( - gfx::NativeWindow window) const { - return GetDisplayListNearestDisplayWithFallbacks( - GetDisplayNearestWindow(window)); -} - void Screen::SetScreenSaverSuspended(bool suspend) { NOTIMPLEMENTED_LOG_ONCE(); } @@ -145,34 +135,61 @@ scoped_display_id_for_new_windows_ = display_id; } -DisplayList Screen::GetDisplayListNearestDisplayWithFallbacks( - Display nearest) const { - DisplayList display_list; - const std::vector<Display>& displays = GetAllDisplays(); +ScreenInfos Screen::GetScreenInfosNearestDisplay(int64_t nearest_id) const { + ScreenInfos result; + + // Determine the current and primary display ids. + std::vector<Display> displays = GetAllDisplays(); Display primary = GetPrimaryDisplay(); + // Note: displays being empty can happen in Fuchsia unit tests. if (displays.empty()) { - // The nearest display's metrics are of greater value to clients of this - // function than those of the primary display, so prefer to use that Display - // object as the fallback, if GetAllDisplays() returned an empty array. - if (nearest.id() == kInvalidDisplayId && primary.id() != kInvalidDisplayId) - display_list = DisplayList({primary}, primary.id(), primary.id()); - else - display_list = DisplayList({nearest}, nearest.id(), nearest.id()); - } else { - // Use the primary and nearest displays as fallbacks for each other, if the - // counterpart exists in `displays`. Otherwise, use `display[0]` for both. - int64_t primary_id = primary.id(); - int64_t nearest_id = nearest.id(); - const bool has_primary = base::Contains(displays, primary_id, &Display::id); - const bool has_nearest = base::Contains(displays, nearest_id, &Display::id); - if (!has_primary) - primary_id = has_nearest ? nearest_id : displays[0].id(); - if (!has_nearest) - nearest_id = primary_id; - display_list = DisplayList(displays, primary_id, nearest_id); + if (primary.id() == kInvalidDisplayId) { + // If we are in a situation where we have no displays and so the primary + // display is invalid, then it's a logic error (elsewhere) to pass in a + // valid id, because where would it come from? + DCHECK_EQ(nearest_id, kInvalidDisplayId); + primary.set_id(kDefaultDisplayId); + } + displays = {primary}; } - CHECK(display_list.IsValidAndHasPrimaryAndCurrentDisplays()); - return display_list; + + // Use the primary and nearest displays as fallbacks for each other, if the + // counterpart exists in `displays`. Otherwise, use `display[0]` for both. + int64_t primary_id = primary.id(); + int64_t current_id = nearest_id; + const bool has_primary = base::Contains(displays, primary_id, &Display::id); + const bool has_nearest = base::Contains(displays, nearest_id, &Display::id); + if (!has_primary) + primary_id = has_nearest ? nearest_id : displays[0].id(); + if (!has_nearest) + current_id = primary_id; + + // Build ScreenInfos from discovered ids and set of all displays. + bool current_display_exists = false; + bool primary_display_exists = false; + for (const auto& display : displays) { + ScreenInfo screen_info; + DisplayUtil::DisplayToScreenInfo(&screen_info, display); + + if (display.id() == current_id) { + result.current_display_id = display.id(); + current_display_exists = true; + } + + // TODO(enne): move DisplayToScreenInfo to be a private function here, + // so that we don't need to overwrite this. + screen_info.is_primary = display.id() == primary_id; + if (display.id() == primary_id) + primary_display_exists = true; + + result.screen_infos.push_back(screen_info); + } + + // This is a bit overkill, but verify that the logic above is correct + // because it will cause crashes elsewhere to not have a current display. + CHECK(current_display_exists); + CHECK(primary_display_exists); + return result; } } // namespace display
diff --git a/ui/display/screen.h b/ui/display/screen.h index b9a251b..188fcb56 100644 --- a/ui/display/screen.h +++ b/ui/display/screen.h
@@ -12,7 +12,7 @@ #include "base/values.h" #include "ui/display/display.h" #include "ui/display/display_export.h" -#include "ui/display/display_list.h" +#include "ui/display/screen_infos.h" #include "ui/gfx/gpu_extra_info.h" #include "ui/gfx/native_widget_types.h" @@ -110,15 +110,12 @@ // Sets the suggested display to use when creating a new window. void SetDisplayForNewWindows(int64_t display_id); - // Returns a DisplayList with its `current` display set to the display nearest - // the specified window or view. These functions perform fallback to ensure - // the list is non-empty and has coherent primary and current display ids. - // This is useful to cache a sensible multi-display snapshot for clients that - // otherwise relied on fallback Displays from Screen::GetDisplayNearestView. - DisplayList GetDisplayListNearestViewWithFallbacks( - gfx::NativeView view) const; - DisplayList GetDisplayListNearestWindowWithFallbacks( - gfx::NativeWindow window) const; + // Returns ScreenInfos, attempting to set the current ScreenInfo to the + // display corresponding to `nearest_id`. The returned result is guaranteed + // to be non-empty. This function also performs fallback to ensure the result + // also has a valid current ScreenInfo and exactly one primary ScreenInfo + // (both of which may or may not be `nearest_id`). + display::ScreenInfos GetScreenInfosNearestDisplay(int64_t nearest_id) const; // Suspends the platform-specific screensaver, if applicable. virtual void SetScreenSaverSuspended(bool suspend); @@ -175,9 +172,6 @@ static gfx::NativeWindow GetWindowForView(gfx::NativeView view); - // A shared helper for GetDisplayListNearest[Window|View]WithFallbacks(). - DisplayList GetDisplayListNearestDisplayWithFallbacks(Display nearest) const; - int64_t display_id_for_new_windows_; int64_t scoped_display_id_for_new_windows_ = display::kInvalidDisplayId; };
diff --git a/ui/display/screen_unittest.cc b/ui/display/screen_unittest.cc index 97ff347..d9ac79f 100644 --- a/ui/display/screen_unittest.cc +++ b/ui/display/screen_unittest.cc
@@ -23,7 +23,7 @@ } // namespace class ScreenTest : public testing::Test { - protected: + public: ScreenTest() { const Display test_display = test_screen_.GetPrimaryDisplay(); Display display(test_display); @@ -37,12 +37,30 @@ Screen::SetScreenInstance(&test_screen_); } + ScreenTest(const ScreenTest&) = delete; + ScreenTest& operator=(const ScreenTest&) = delete; + ~ScreenTest() override { Screen::SetScreenInstance(nullptr); } private: test::TestScreen test_screen_; +}; - DISALLOW_COPY_AND_ASSIGN(ScreenTest); +class ZeroDisplayScreenTest : public testing::Test { + public: + ZeroDisplayScreenTest() { + const Display test_display = test_screen_.GetPrimaryDisplay(); + test_screen_.display_list().RemoveDisplay(test_display.id()); + Screen::SetScreenInstance(&test_screen_); + } + + ZeroDisplayScreenTest(const ZeroDisplayScreenTest&) = delete; + ZeroDisplayScreenTest& operator=(const ZeroDisplayScreenTest&) = delete; + + ~ZeroDisplayScreenTest() override { Screen::SetScreenInstance(nullptr); } + + private: + test::TestScreen test_screen_; }; TEST_F(ScreenTest, GetPrimaryDisplaySize) { @@ -88,15 +106,50 @@ EXPECT_EQ(DEFAULT_DISPLAY_ID, screen->GetDisplayForNewWindows().id()); } -TEST_F(ScreenTest, GetDisplayListNearestWindowWithFallbacks) { +TEST_F(ScreenTest, GetScreenInfosNearestDisplay) { Screen* screen = Screen::GetScreen(); - DisplayList display_list = - screen->GetDisplayListNearestWindowWithFallbacks(gfx::kNullNativeWindow); - ASSERT_FALSE(display_list.displays().empty()); + + // Nearest default + { + ScreenInfos screen_infos = + screen->GetScreenInfosNearestDisplay(DEFAULT_DISPLAY_ID); + ASSERT_EQ(screen_infos.screen_infos.size(), 2u); + + // Verify that the current display is also the primary display. + EXPECT_EQ(screen_infos.current().display_id, DEFAULT_DISPLAY_ID); + EXPECT_EQ(screen->GetPrimaryDisplay().id(), + screen_infos.current().display_id); + EXPECT_TRUE(screen_infos.current().is_primary); + } + + // Nearest display 2 + { + ScreenInfos screen_infos = + screen->GetScreenInfosNearestDisplay(DISPLAY_2_ID); + ASSERT_EQ(screen_infos.screen_infos.size(), 2u); + + // Display 2 is current, but not the primary display. + EXPECT_EQ(screen_infos.current().display_id, DISPLAY_2_ID); + EXPECT_NE(screen->GetPrimaryDisplay().id(), + screen_infos.current().display_id); + EXPECT_FALSE(screen_infos.current().is_primary); + } +} + +// This unit test is a cross-platform replication of some Fuchsia unit tests +// which have no displays (and don't need displays) but also need to have +// this function return non-empty ScreenInfos. +TEST_F(ZeroDisplayScreenTest, GetScreenInfosZeroDisplays) { + Screen* screen = Screen::GetScreen(); + ScreenInfos screen_infos = + screen->GetScreenInfosNearestDisplay(kInvalidDisplayId); + + EXPECT_TRUE(screen->GetAllDisplays().empty()); + EXPECT_EQ(screen_infos.screen_infos.size(), 1u); + EXPECT_NE(screen_infos.current().display_id, kInvalidDisplayId); EXPECT_EQ(screen->GetPrimaryDisplay().id(), - display_list.GetPrimaryDisplay().id()); - EXPECT_EQ(screen->GetPrimaryDisplay().id(), - display_list.GetCurrentDisplay().id()); + screen_infos.current().display_id); + EXPECT_TRUE(screen_infos.current().is_primary); } } // namespace display
diff --git a/ui/message_center/views/notification_view.cc b/ui/message_center/views/notification_view.cc index 2227067..f5a5267 100644 --- a/ui/message_center/views/notification_view.cc +++ b/ui/message_center/views/notification_view.cc
@@ -49,8 +49,12 @@ header_row->AddChildView(CreateControlButtonsView()); auto content_row = CreateContentRow(); + auto* content_row_layout = + static_cast<views::BoxLayout*>(content_row->GetLayoutManager()); + content_row_layout->set_inside_border_insets(kContentRowPadding); auto left_content = CreateLeftContentView(); + left_content->SetBorder(views::CreateEmptyBorder(kLeftContentPadding)); auto* left_content_ptr_ = content_row->AddChildView(std::move(left_content)); static_cast<views::BoxLayout*>(content_row->GetLayoutManager()) ->SetFlexForView(left_content_ptr_, 1); @@ -91,6 +95,9 @@ } void NotificationView::UpdateViewForExpandedState(bool expanded) { + left_content()->SetBorder(views::CreateEmptyBorder( + IsIconViewShown() ? kLeftContentPaddingWithIcon : kLeftContentPadding)); + // TODO(tetsui): Workaround https://crbug.com/682266 by explicitly setting // the width. // Ideally, we should fix the original bug, but it seems there's no obvious @@ -101,7 +108,13 @@ GetInsets().width(); if (title_view_) title_view_->SizeToFit(message_view_width); + if (message_view()) + message_view()->SizeToFit(message_view_width); NotificationViewBase::UpdateViewForExpandedState(expanded); } +gfx::Size NotificationView::GetIconViewSize() const { + return kIconViewSize; +} + } // namespace message_center
diff --git a/ui/message_center/views/notification_view.h b/ui/message_center/views/notification_view.h index afa40d7..490ed2fc 100644 --- a/ui/message_center/views/notification_view.h +++ b/ui/message_center/views/notification_view.h
@@ -27,6 +27,7 @@ // NotificationViewBase: void CreateOrUpdateTitleView(const Notification& notification) override; void UpdateViewForExpandedState(bool expanded) override; + gfx::Size GetIconViewSize() const override; // Notification title, which is dynamically created inside view hierarchy. views::Label* title_view_ = nullptr;
diff --git a/ui/message_center/views/notification_view_base.cc b/ui/message_center/views/notification_view_base.cc index 6ee1783..7821d89 100644 --- a/ui/message_center/views/notification_view_base.cc +++ b/ui/message_center/views/notification_view_base.cc
@@ -77,23 +77,16 @@ namespace { // Dimensions. -constexpr gfx::Insets kContentRowPadding(0, 12, 16, 12); constexpr gfx::Insets kActionsRowPadding(8, 8, 8, 8); constexpr int kActionsRowHorizontalSpacing = 8; constexpr gfx::Insets kStatusTextPadding(4, 0, 0, 0); constexpr gfx::Size kActionButtonMinSize(0, 32); -// TODO(tetsui): Move |kIconViewSize| to public/cpp/message_center_constants.h -// and merge with contradicting |kNotificationIconSize|. -constexpr gfx::Size kIconViewSize(36, 36); constexpr gfx::Insets kLargeImageContainerPadding(0, 16, 16, 16); constexpr int kLargeImageMaxHeight = 218; -constexpr gfx::Insets kLeftContentPadding(2, 4, 0, 4); -constexpr gfx::Insets kLeftContentPaddingWithIcon(2, 4, 0, 12); constexpr gfx::Insets kSettingsRowPadding(8, 0, 0, 0); constexpr gfx::Insets kSettingsRadioButtonPadding(14, 18, 14, 18); constexpr gfx::Insets kSettingsButtonRowPadding(8); - // Max number of lines for title_view_. constexpr int kMaxLinesForTitleView = 1; // Max number of lines for message_view_. @@ -104,16 +97,6 @@ constexpr int kProgressBarHeight = 4; -constexpr int kMessageViewWidthWithIcon = - kNotificationWidth - kIconViewSize.width() - - kLeftContentPaddingWithIcon.left() - kLeftContentPaddingWithIcon.right() - - kContentRowPadding.left() - kContentRowPadding.right(); - -constexpr int kMessageViewWidth = - kNotificationWidth - kLeftContentPadding.left() - - kLeftContentPadding.right() - kContentRowPadding.left() - - kContentRowPadding.right(); - // Character limit = pixels per line * line limit / min. pixels per character. constexpr size_t kMessageCharacterLimit = kNotificationWidth * kMessageExpandedLineLimit / 3; @@ -324,7 +307,6 @@ // NotificationInputContainer //////////////////////////////////////////////// - // InlineSettingsRadioButton /////////////////////////////////////////////////// class InlineSettingsRadioButton : public views::RadioButton { @@ -665,7 +647,6 @@ auto left_content = std::make_unique<views::View>(); left_content->SetLayoutManager(std::make_unique<views::BoxLayout>( views::BoxLayout::Orientation::kVertical, gfx::Insets(), 0)); - left_content->SetBorder(views::CreateEmptyBorder(kLeftContentPadding)); left_content_ = left_content.get(); return left_content; } @@ -683,7 +664,7 @@ auto content_row = std::make_unique<views::View>(); auto* content_row_layout = content_row->SetLayoutManager(std::make_unique<views::BoxLayout>( - views::BoxLayout::Orientation::kHorizontal, kContentRowPadding, 0)); + views::BoxLayout::Orientation::kHorizontal)); content_row_layout->set_cross_axis_alignment( views::BoxLayout::CrossAxisAlignment::kStart); content_row->SetID(kContentRow); @@ -707,10 +688,6 @@ image_container_view->SetLayoutManager(std::make_unique<views::FillLayout>()); image_container_view->SetBorder( views::CreateEmptyBorder(kLargeImageContainerPadding)); - int max_width = kNotificationWidth - kLargeImageContainerPadding.width() - - GetInsets().width(); - image_container_view->AddChildView(std::make_unique<LargeImageView>( - gfx::Size(max_width, kLargeImageMaxHeight))); image_container_view_ = image_container_view.get(); return image_container_view; } @@ -936,7 +913,7 @@ } if (!icon_view_) { - icon_view_ = new ProportionalImageView(kIconViewSize); + icon_view_ = new ProportionalImageView(GetIconViewSize()); right_content_->AddChildView(icon_view_); } @@ -988,6 +965,7 @@ GetInsets().width(); image_container_view_->AddChildView(std::make_unique<LargeImageView>( gfx::Size(max_width, kLargeImageMaxHeight))); + image_container_view_->SetVisible(true); } static_cast<LargeImageView*>(image_container_view_->children().front()) @@ -1006,8 +984,6 @@ actions_row_->SetVisible(expanded_ && !buttons.empty()); } - // DCHECK_EQ(this, actions_row_->parent()); - // Hide inline reply field if it doesn't exist anymore. if (inline_reply_->GetVisible()) { const size_t index = inline_reply_->GetTextfieldIndex(); @@ -1233,19 +1209,6 @@ bool has_icon = IsIconViewShown(); right_content_->SetVisible(has_icon); - left_content_->SetBorder(views::CreateEmptyBorder( - has_icon ? kLeftContentPaddingWithIcon : kLeftContentPadding)); - - // TODO(tetsui): Workaround https://crbug.com/682266 by explicitly setting - // the width. - // Ideally, we should fix the original bug, but it seems there's no obvious - // solution for the bug according to https://crbug.com/678337#c7, we should - // ensure that the change won't break any of the users of BoxLayout class. - const int message_view_width = - (has_icon ? kMessageViewWidthWithIcon : kMessageViewWidth) - - GetInsets().width(); - if (message_view_) - message_view_->SizeToFit(message_view_width); content_row_->InvalidateLayout(); }
diff --git a/ui/message_center/views/notification_view_base.h b/ui/message_center/views/notification_view_base.h index 429b936..ee815cb 100644 --- a/ui/message_center/views/notification_view_base.h +++ b/ui/message_center/views/notification_view_base.h
@@ -238,6 +238,9 @@ virtual void SetExpandButtonEnabled(bool enabled); + // Returns the size of `icon_view_`. + virtual gfx::Size GetIconViewSize() const = 0; + private: FRIEND_TEST_ALL_PREFIXES(NotificationViewBaseTest, AppNameExtension); FRIEND_TEST_ALL_PREFIXES(NotificationViewBaseTest, AppNameSystemNotification);
diff --git a/ui/message_center/views/notification_view_base_unittest.cc b/ui/message_center/views/notification_view_base_unittest.cc index 501a93e7..248efe4 100644 --- a/ui/message_center/views/notification_view_base_unittest.cc +++ b/ui/message_center/views/notification_view_base_unittest.cc
@@ -94,6 +94,7 @@ ~TestNotificationView() override = default; void CreateOrUpdateTitleView(const Notification& notification) override {} + gfx::Size GetIconViewSize() const override { return gfx::Size(); } }; class NotificationTestDelegate : public NotificationDelegate {
diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn index 6b5a374..0942348 100644 --- a/ui/ozone/platform/wayland/BUILD.gn +++ b/ui/ozone/platform/wayland/BUILD.gn
@@ -61,6 +61,14 @@ "host/shell_surface_wrapper.h", "host/shell_toplevel_wrapper.cc", "host/shell_toplevel_wrapper.h", + "host/wayland_buffer_backing.cc", + "host/wayland_buffer_backing.h", + "host/wayland_buffer_backing_dmabuf.cc", + "host/wayland_buffer_backing_dmabuf.h", + "host/wayland_buffer_backing_shm.cc", + "host/wayland_buffer_backing_shm.h", + "host/wayland_buffer_handle.cc", + "host/wayland_buffer_handle.h", "host/wayland_buffer_manager_connector.cc", "host/wayland_buffer_manager_connector.h", "host/wayland_buffer_manager_host.cc",
diff --git a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc index 858ebc9e..117b31f 100644 --- a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc +++ b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc
@@ -170,20 +170,10 @@ std::vector<gfx::GpuFence> release_fences) { DCHECK_NE(widget, gfx::kNullAcceleratedWidget); - // It's possible for a buffer to be attached to a different widget or - // wl_surface if this buffer represents an overlay and is being tab-dragged to - // a different window. Recreate wl_buffer handle if this happens. - // TODO(fangzhoug): Remove this workaround once better buffer management is - // implemented. - z_order_ = z_order_set_ ? z_order_ : plane_z_order; - if (widget_ != widget || z_order_ != plane_z_order) { - if (widget_ != gfx::kNullAcceleratedWidget) - buffer_manager_->DestroyBuffer(widget_, buffer_id_); + if (widget_ == gfx::kNullAcceleratedWidget) CreateDmabufBasedBuffer(); - widget_ = widget; - z_order_ = plane_z_order; - } - z_order_set_ = true; + + widget_ = widget; auto* surface = buffer_manager_->GetSurface(widget); // This must never be hit.
diff --git a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h index 9a8181a2..91d3cc7 100644 --- a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h +++ b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h
@@ -90,11 +90,6 @@ // A unique ID to identify the buffer for this pixmap. const uint32_t buffer_id_; - // Represents the z-axis order of the wayland surface this buffer is attach - // to. - int32_t z_order_ = 0; - bool z_order_set_ = false; - // Size of the visible area of the buffer. gfx::Size visible_area_size_;
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_backing.cc b/ui/ozone/platform/wayland/host/wayland_buffer_backing.cc new file mode 100644 index 0000000..dc913f2 --- /dev/null +++ b/ui/ozone/platform/wayland/host/wayland_buffer_backing.cc
@@ -0,0 +1,51 @@ +// 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 "ui/ozone/platform/wayland/host/wayland_buffer_backing.h" + +#include "base/check_op.h" +#include "ui/ozone/platform/wayland/host/wayland_buffer_handle.h" + +namespace ui { + +WaylandBufferBacking::WaylandBufferBacking(const WaylandConnection* connection, + uint32_t buffer_id, + const gfx::Size& size) + : connection_(connection), buffer_id_(buffer_id), size_(size) { + DCHECK(connection_); + DCHECK_NE(buffer_id_, kInvalidBufferId); +} + +WaylandBufferBacking::~WaylandBufferBacking() = default; + +bool WaylandBufferBacking::EnsureBufferHandle(WaylandSurface* requestor) { + auto& buffer_handle = buffer_handles_[requestor]; + + if (buffer_handle) + return buffer_handle->wl_buffer_.get(); + + // Assign the anonymous handle to the |requestor|. + auto& anonymous_handle = buffer_handles_[nullptr]; + if (anonymous_handle) { + buffer_handle.swap(anonymous_handle); + return buffer_handle->wl_buffer_.get(); + } + + // The requested wl_buffer object is not requested. + buffer_handle = std::make_unique<WaylandBufferHandle>(this); + + // Create wl_buffer associated with the internal Buffer. + RequestBufferHandle(base::BindOnce(&WaylandBufferHandle::OnWlBufferCreated, + buffer_handle->AsWeakPtr())); + + return buffer_handle->wl_buffer_.get(); +} + +WaylandBufferHandle* WaylandBufferBacking::GetBufferHandle( + WaylandSurface* requestor) { + DCHECK(requestor); + return buffer_handles_[requestor].get(); +} + +} // namespace ui
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_backing.h b/ui/ozone/platform/wayland/host/wayland_buffer_backing.h new file mode 100644 index 0000000..69bc929 --- /dev/null +++ b/ui/ozone/platform/wayland/host/wayland_buffer_backing.h
@@ -0,0 +1,75 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_BUFFER_BACKING_H_ +#define UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_BUFFER_BACKING_H_ + +#include "base/callback_forward.h" +#include "base/containers/flat_map.h" +#include "ui/gfx/geometry/size.h" +#include "ui/gfx/native_widget_types.h" +#include "ui/ozone/platform/wayland/common/wayland_object.h" + +namespace ui { + +class WaylandSurface; +class WaylandBufferHandle; +class WaylandConnection; + +// This represents a dmabuf/shm buffer, which the GPU process creates when +// CreateBuffer is called. It's used for asynchronous buffer creation. It +// dynamically requests wl_buffer objects when a buffer should be attached to a +// wl_surface. +// +// Has one-to-many relationship with WaylandBufferHandle. +class WaylandBufferBacking { + public: + WaylandBufferBacking() = delete; + WaylandBufferBacking(const WaylandBufferBacking&) = delete; + WaylandBufferBacking& operator=(const WaylandBufferBacking&) = delete; + WaylandBufferBacking(const WaylandConnection* connection, + uint32_t buffer_id, + const gfx::Size& size); + virtual ~WaylandBufferBacking(); + + uint32_t id() const { return buffer_id_; } + gfx::Size size() const { return size_; } + + // Returns true if a wl_buffer can be attached to the |requestor|. Requests a + // new wl_buffer if such a wl_buffer does not exist. + bool EnsureBufferHandle(WaylandSurface* requestor = nullptr); + + // Returns a wl_buffer wrapper that can be attached to the |requestor|. + WaylandBufferHandle* GetBufferHandle(WaylandSurface* requestor); + + protected: + // Non-owned pointer to the main connection. + const WaylandConnection* connection_; + + private: + // Requests a new wl_buffer. |callback| will be run with the created wl_buffer + // object when creation is complete. + virtual void RequestBufferHandle( + base::OnceCallback<void(wl::Object<wl_buffer>)> callback) = 0; + + // Use |kInvalidBufferId| to commit surface state without updating wl_buffer. + constexpr static uint32_t kInvalidBufferId = 0u; + + // The id of this buffer. + const uint32_t buffer_id_; + + // Actual buffer size in pixels. + const gfx::Size size_; + + // Collection of wl_buffers objects backed by this backing. Maintains the + // relationship of wl_surfaces to wl_buffers, corresponding to the + // wl_surface.attach(wl_buffer) request. |buffer_handles_[nullptr]| represents + // an anonymous WaylandBufferHandle not attached to any wl_surface yet. + base::flat_map<WaylandSurface*, std::unique_ptr<WaylandBufferHandle>> + buffer_handles_; +}; + +} // namespace ui + +#endif // UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_BUFFER_BACKING_H_
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_backing_dmabuf.cc b/ui/ozone/platform/wayland/host/wayland_buffer_backing_dmabuf.cc new file mode 100644 index 0000000..be9d5fe --- /dev/null +++ b/ui/ozone/platform/wayland/host/wayland_buffer_backing_dmabuf.cc
@@ -0,0 +1,51 @@ +// 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 "ui/ozone/platform/wayland/host/wayland_buffer_backing_dmabuf.h" + +#include "ui/ozone/platform/wayland/host/wayland_connection.h" +#include "ui/ozone/platform/wayland/host/wayland_drm.h" +#include "ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.h" + +namespace ui { + +WaylandBufferBackingDmabuf::WaylandBufferBackingDmabuf( + const WaylandConnection* connection, + base::ScopedFD fd, + const gfx::Size& size, + std::vector<uint32_t> strides, + std::vector<uint32_t> offsets, + std::vector<uint64_t> modifiers, + uint32_t format, + uint32_t planes_count, + uint32_t buffer_id) + : WaylandBufferBacking(connection, buffer_id, size), + fd_(std::move(fd)), + strides_(std::move(strides)), + offsets_(std::move(offsets)), + modifiers_(std::move(modifiers)), + format_(format), + planes_count_(planes_count) {} + +WaylandBufferBackingDmabuf::~WaylandBufferBackingDmabuf() = default; + +void WaylandBufferBackingDmabuf::RequestBufferHandle( + base::OnceCallback<void(wl::Object<wl_buffer>)> callback) { + DCHECK(!callback.is_null()); + if (connection_->zwp_dmabuf()) { + connection_->zwp_dmabuf()->CreateBuffer(fd_, size(), strides_, offsets_, + modifiers_, format_, planes_count_, + std::move(callback)); + } else if (connection_->drm()) { + connection_->drm()->CreateBuffer(fd_, size(), strides_, offsets_, + modifiers_, format_, planes_count_, + std::move(callback)); + } else { + // This method must never be called if neither zwp_linux_dmabuf or wl_drm + // are supported. + NOTREACHED(); + } +} + +} // namespace ui
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_backing_dmabuf.h b/ui/ozone/platform/wayland/host/wayland_buffer_backing_dmabuf.h new file mode 100644 index 0000000..2d524ac --- /dev/null +++ b/ui/ozone/platform/wayland/host/wayland_buffer_backing_dmabuf.h
@@ -0,0 +1,46 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_BUFFER_BACKING_DMABUF_H_ +#define UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_BUFFER_BACKING_DMABUF_H_ + +#include "base/files/scoped_file.h" +#include "ui/ozone/platform/wayland/host/wayland_buffer_backing.h" + +namespace ui { + +// Manager of wl_buffers backed by a dmabuf buffer. +class WaylandBufferBackingDmabuf : public WaylandBufferBacking { + public: + WaylandBufferBackingDmabuf() = delete; + WaylandBufferBackingDmabuf(const WaylandBufferBackingDmabuf&) = delete; + WaylandBufferBackingDmabuf& operator=(const WaylandBufferBackingDmabuf&) = + delete; + WaylandBufferBackingDmabuf(const WaylandConnection* connection, + base::ScopedFD fd, + const gfx::Size& size, + std::vector<uint32_t> strides, + std::vector<uint32_t> offsets, + std::vector<uint64_t> modifiers, + uint32_t format, + uint32_t planes_count, + uint32_t buffer_id); + ~WaylandBufferBackingDmabuf() override; + + private: + // WaylandBufferBacking override: + void RequestBufferHandle( + base::OnceCallback<void(wl::Object<wl_buffer>)> callback) override; + + base::ScopedFD fd_; + const std::vector<uint32_t> strides_; + const std::vector<uint32_t> offsets_; + const std::vector<uint64_t> modifiers_; + const uint32_t format_; + const uint32_t planes_count_; +}; + +} // namespace ui + +#endif // UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_BUFFER_BACKING_DMABUF_H_
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_backing_shm.cc b/ui/ozone/platform/wayland/host/wayland_buffer_backing_shm.cc new file mode 100644 index 0000000..8b1ee7d --- /dev/null +++ b/ui/ozone/platform/wayland/host/wayland_buffer_backing_shm.cc
@@ -0,0 +1,31 @@ +// 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 "ui/ozone/platform/wayland/host/wayland_buffer_backing_shm.h" + +#include "ui/ozone/platform/wayland/host/wayland_connection.h" +#include "ui/ozone/platform/wayland/host/wayland_shm.h" + +namespace ui { + +WaylandBufferBackingShm::WaylandBufferBackingShm( + const WaylandConnection* connection, + base::ScopedFD fd, + uint64_t length, + const gfx::Size& size, + uint32_t buffer_id) + : WaylandBufferBacking(connection, buffer_id, size), + fd_(std::move(fd)), + length_(length) {} + +WaylandBufferBackingShm::~WaylandBufferBackingShm() = default; + +void WaylandBufferBackingShm::RequestBufferHandle( + base::OnceCallback<void(wl::Object<wl_buffer>)> callback) { + DCHECK(!callback.is_null()); + std::move(callback).Run( + connection_->shm()->CreateBuffer(fd_, length_, size())); +} + +} // namespace ui
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_backing_shm.h b/ui/ozone/platform/wayland/host/wayland_buffer_backing_shm.h new file mode 100644 index 0000000..e99b4ae --- /dev/null +++ b/ui/ozone/platform/wayland/host/wayland_buffer_backing_shm.h
@@ -0,0 +1,37 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_BUFFER_BACKING_SHM_H_ +#define UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_BUFFER_BACKING_SHM_H_ + +#include "base/files/scoped_file.h" +#include "ui/ozone/platform/wayland/host/wayland_buffer_backing.h" + +namespace ui { + +// Manager of wl_buffers backed by a shm buffer. +class WaylandBufferBackingShm : public WaylandBufferBacking { + public: + WaylandBufferBackingShm() = delete; + WaylandBufferBackingShm(const WaylandBufferBackingShm&) = delete; + WaylandBufferBackingShm& operator=(const WaylandBufferBackingShm&) = delete; + WaylandBufferBackingShm(const WaylandConnection* connection, + base::ScopedFD fd, + uint64_t length, + const gfx::Size& size, + uint32_t buffer_id); + ~WaylandBufferBackingShm() override; + + private: + // WaylandBufferBacking override: + void RequestBufferHandle( + base::OnceCallback<void(wl::Object<wl_buffer>)> callback) override; + + base::ScopedFD fd_; + const uint64_t length_; +}; + +} // namespace ui + +#endif // UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_BUFFER_BACKING_SHM_H_
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_handle.cc b/ui/ozone/platform/wayland/host/wayland_buffer_handle.cc new file mode 100644 index 0000000..1d461d8 --- /dev/null +++ b/ui/ozone/platform/wayland/host/wayland_buffer_handle.cc
@@ -0,0 +1,51 @@ +// 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 "ui/ozone/platform/wayland/host/wayland_buffer_handle.h" + +namespace ui { + +WaylandBufferHandle::WaylandBufferHandle(WaylandBufferBacking* backing) + : backing_(backing), weak_factory_(this) {} + +WaylandBufferHandle::~WaylandBufferHandle() { + if (!released_callback_.is_null()) + std::move(released_callback_).Run(); +} + +void WaylandBufferHandle::OnWlBufferCreated( + wl::Object<struct wl_buffer> wl_buffer) { + CHECK(wl_buffer) << "Failed to create wl_buffer object."; + + wl_buffer_ = std::move(wl_buffer); + + // Setup buffer release listener callbacks. + static struct wl_buffer_listener buffer_listener = { + &WaylandBufferHandle::BufferRelease, + }; + wl_buffer_add_listener(wl_buffer_.get(), &buffer_listener, this); + + if (!created_callback_.is_null()) + std::move(created_callback_).Run(); +} + +void WaylandBufferHandle::OnRelease(struct wl_buffer* wl_buff) { + DCHECK_EQ(wl_buff, wl_buffer_.get()); + if (!released_callback_.is_null()) + std::move(released_callback_).Run(); +} + +base::WeakPtr<WaylandBufferHandle> WaylandBufferHandle::AsWeakPtr() { + return weak_factory_.GetWeakPtr(); +} + +// static +void WaylandBufferHandle::BufferRelease(void* data, + struct wl_buffer* wl_buffer) { + WaylandBufferHandle* self = static_cast<WaylandBufferHandle*>(data); + DCHECK(self); + self->OnRelease(wl_buffer); +} + +} // namespace ui
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_handle.h b/ui/ozone/platform/wayland/host/wayland_buffer_handle.h new file mode 100644 index 0000000..f1a3f42 --- /dev/null +++ b/ui/ozone/platform/wayland/host/wayland_buffer_handle.h
@@ -0,0 +1,78 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_BUFFER_HANDLE_H_ +#define UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_BUFFER_HANDLE_H_ + +#include "base/callback.h" +#include "base/memory/weak_ptr.h" +#include "ui/gfx/gpu_fence_handle.h" +#include "ui/ozone/platform/wayland/host/wayland_buffer_backing.h" + +namespace ui { + +// This is a wrapper of a wl_buffer. Instances of this class are managed by the +// corresponding WaylandBufferBackings. +class WaylandBufferHandle { + public: + WaylandBufferHandle() = delete; + WaylandBufferHandle(const WaylandBufferHandle&) = delete; + WaylandBufferHandle& operator=(const WaylandBufferHandle&) = delete; + explicit WaylandBufferHandle(WaylandBufferBacking* backing); + ~WaylandBufferHandle(); + + void set_buffer_created_callback(base::OnceClosure callback) { + DCHECK(created_callback_.is_null()); + created_callback_ = std::move(callback); + } + void set_buffer_released_callback(base::OnceClosure callback) { + released_callback_ = std::move(callback); + } + + // Returns a weak pointer that is invalidated when the WaylandBufferHandle + // becomes invalid to use. + base::WeakPtr<WaylandBufferHandle> AsWeakPtr(); + + uint32_t id() const { return backing_->id(); } + gfx::Size size() const { return backing_->size(); } + struct wl_buffer* wl_buffer() const { + return wl_buffer_.get(); + } + + // Tells if the buffer has already been released aka not busy, and the + // surface can tell the gpu about successful swap. + bool released = true; + + // Optional release fence. This may be set if the buffer is released + // via the explicit synchronization Wayland protocol. + gfx::GpuFenceHandle release_fence; + + private: + // Called when wl_buffer object is created. + void OnWlBufferCreated(wl::Object<struct wl_buffer> wl_buffer); + + void OnRelease(struct wl_buffer* wl_buffer); + + // wl_buffer_listener: + static void BufferRelease(void* data, struct wl_buffer* wl_buffer); + + const WaylandBufferBacking* backing_; + + // A wl_buffer backed by the dmabuf/shm |backing_| created on the GPU side. + wl::Object<struct wl_buffer> wl_buffer_; + + // A callback that runs when the wl_buffer is created. + base::OnceClosure created_callback_; + // A callback that runs when the wl_buffer is released by the Wayland + // compositor. + base::OnceClosure released_callback_; + + friend WaylandBufferBacking; + + base::WeakPtrFactory<WaylandBufferHandle> weak_factory_; +}; + +} // namespace ui + +#endif // UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_BUFFER_HANDLE_H_
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.cc b/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.cc index b949154..5a65cf3 100644 --- a/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.cc +++ b/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.cc
@@ -6,9 +6,11 @@ #include <presentation-time-client-protocol.h> #include <memory> +#include <utility> #include "base/bind.h" #include "base/callback_helpers.h" +#include "base/compiler_specific.h" #include "base/containers/cxx20_erase.h" #include "base/i18n/number_formatting.h" #include "base/strings/strcat.h" @@ -18,6 +20,10 @@ #include "ui/gfx/gpu_fence.h" #include "ui/gfx/gpu_fence_handle.h" #include "ui/gfx/linux/drm_util_linux.h" +#include "ui/ozone/platform/wayland/host/wayland_buffer_backing.h" +#include "ui/ozone/platform/wayland/host/wayland_buffer_backing_dmabuf.h" +#include "ui/ozone/platform/wayland/host/wayland_buffer_backing_shm.h" +#include "ui/ozone/platform/wayland/host/wayland_buffer_handle.h" #include "ui/ozone/platform/wayland/host/wayland_connection.h" #include "ui/ozone/platform/wayland/host/wayland_drm.h" #include "ui/ozone/platform/wayland/host/wayland_shm.h" @@ -64,13 +70,8 @@ void PendingActionComplete() { DCHECK(base::CurrentUIThread::IsSet()); CHECK_GT(pending_actions, 0u); - if (!--pending_actions && !frame_commit_cb.is_null() && - !std::move(frame_commit_cb).Run()) { - buffer_manager_->error_message_ = - base::StrCat({"Buffer with ", NumberToString(buffer_id), - " id does not exist or failed to be created."}); - buffer_manager_->TerminateGpuProcess(); - } + if (!--pending_actions && !frame_commit_cb.is_null()) + std::move(frame_commit_cb).Run(); } // |root_surface| and |buffer_id| are saved so this Frame can be destroyed to @@ -127,84 +128,34 @@ if (buffer_id == kInvalidBufferId) { DCHECK(access_fence_handle.is_null()); pending_commits_.push_back({nullptr, wait_for_frame_callback, nullptr, - std::move(post_commit_cb)}); + std::move(post_commit_cb), gfx::Rect()}); MaybeProcessPendingBuffer(); return true; } - WaylandBuffer* buffer = GetBuffer(buffer_id); - if (!buffer) { - // Get the anonymous_wl_buffer aka the buffer that has not been attached - // to any of the surfaces previously. - auto anonymous_wayland_buffer = - buffer_manager_->PassAnonymousWlBuffer(buffer_id); - if (!anonymous_wayland_buffer) - return false; + bool wl_buffer_created = + buffer_manager_->EnsureBufferHandle(wayland_surface_, buffer_id); + WaylandBufferHandle* buffer = + buffer_manager_->GetBufferHandle(wayland_surface_, buffer_id); - buffer = anonymous_wayland_buffer.get(); - buffers_.emplace(buffer_id, std::move(anonymous_wayland_buffer)); - if (buffer->wl_buffer) - SetupBufferReleaseListener(buffer); - } - - buffer->damage_region = damage_region; - - // If the wl_buffer has been attached, but the wl_buffer still is null, it - // means the Wayland server failed to create the buffer and we have to fail - // here. - // - // TODO(msisov): should we ask to recreate buffers instead of failing? - if (buffer->attached && !buffer->wl_buffer) + if (!buffer) return false; + if (!wl_buffer_created) { + buffer->set_buffer_created_callback(base::BindOnce( + &WaylandBufferManagerHost::Surface::MaybeProcessPendingBuffer, + weak_ptr_factory_.GetWeakPtr())); + } + pending_commits_.push_back( - {buffer, wait_for_frame_callback, + {buffer->AsWeakPtr(), wait_for_frame_callback, std::make_unique<gfx::GpuFence>(std::move(access_fence_handle)), - std::move(post_commit_cb)}); + std::move(post_commit_cb), damage_region}); MaybeProcessPendingBuffer(); return true; } - size_t DestroyBuffer(uint32_t buffer_id) { - auto* buffer = GetBuffer(buffer_id); - - // Treat destroying a buffer as a release, and make sure to call any - // OnSubmission callbacks that would be sent as a result of that. - if (buffer) { - buffer->released = true; - MaybeProcessSubmittedBuffers(); - for (auto it = pending_commits_.begin(); it != pending_commits_.end(); - ++it) { - if (it->buffer == buffer) { - std::move(it->post_commit_cb).Run(); - pending_commits_.erase(it++); - } - } - } - - return buffers_.erase(buffer_id); - } - - void AttachWlBuffer(uint32_t buffer_id, wl::Object<wl_buffer> new_buffer) { - WaylandBuffer* buffer = GetBuffer(buffer_id); - // It can happen that the buffer was destroyed by the client while the - // Wayland compositor was processing the request to create a wl_buffer. - if (!buffer) - return; - - DCHECK(!buffer->wl_buffer); - buffer->wl_buffer = std::move(new_buffer); - buffer->attached = true; - - if (buffer->wl_buffer) - SetupBufferReleaseListener(buffer); - - MaybeProcessPendingBuffer(); - } - void ClearState() { - buffers_.clear(); - ResetSurfaceContents(); feedback_queue_.clear(); @@ -229,14 +180,13 @@ if (!pending_commit.buffer) continue; - submitted_buffers_.push_back( - SubmissionInfo{pending_commit.buffer->buffer_id, - /*acked=*/submitted_buffers_.empty() ? true : false}); + submitted_buffers_.push_back(SubmissionInfo{ + pending_commit.buffer->AsWeakPtr(), pending_commit.buffer->id(), + /*acked=*/submitted_buffers_.empty() ? true : false}); if (connection_->presentation()) { feedback_queue_.push_back( {wl::Object<struct wp_presentation_feedback>(), - pending_commit.buffer->buffer_id, - gfx::PresentationFeedback::Failure(), + pending_commit.buffer->id(), gfx::PresentationFeedback::Failure(), /*submission_completed=*/false}); } } @@ -245,7 +195,7 @@ // destroyed, causing graphics freeze. Manually release them and trigger // OnSubmission callbacks. for (auto& buffer : submitted_buffers_) { - auto* buff = GetBuffer(buffer.buffer_id); + auto* buff = buffer.buffer.get(); if (buff) buff->released = true; } @@ -263,13 +213,6 @@ connection_->ScheduleFlush(); } - bool BufferExists(uint32_t buffer_id) const { - auto* buffer = GetBuffer(buffer_id); - return !!buffer; - } - - bool HasBuffers() const { return !buffers_.empty(); } - void OnSurfaceRemoved() { wayland_surface_ = nullptr; } bool HasSurface() const { return !!wayland_surface_; } @@ -298,6 +241,8 @@ // Holds information about a submitted buffer. struct SubmissionInfo { + // Weak reference to the submitted buffer handle. + base::WeakPtr<WaylandBufferHandle> buffer; // ID of the submitted buffer. Buffers may be destroyed after they have been // submitted but before we send OnSubmission for them, e.g. if the same // buffer is submitted twice in a row. Keep the ID so we send OnSubmission @@ -310,7 +255,7 @@ // Represents a pending surface commit. struct PendingCommit { // If null, means this commit will not attach buffer. - WaylandBuffer* buffer = nullptr; + base::WeakPtr<WaylandBufferHandle> buffer; // Whether this commit must wait for a wl_frame_callback and setup another // wl_frame_callback. bool wait_for_callback = false; @@ -319,10 +264,13 @@ std::unique_ptr<gfx::GpuFence> access_fence; // Callback to run once this commit is applied. base::OnceClosure post_commit_cb; + // Damage region this buffer describes. + gfx::Rect damage_region; }; - bool CommitBufferInternal(WaylandBuffer* buffer, + bool CommitBufferInternal(WaylandBufferHandle* buffer, bool wait_for_callback, + const gfx::Rect& damage_region, const gfx::GpuFenceHandle& access_fence_handle) { DCHECK(buffer && wayland_surface_); @@ -332,8 +280,7 @@ // to reattach the buffer. bool should_attach_buffer = submitted_buffers_.empty() || - submitted_buffers_.back().buffer_id != buffer->buffer_id || - buffer->released; + submitted_buffers_.back().buffer_id != buffer->id() || buffer->released; if (should_attach_buffer) { // Once the BufferRelease is called, the buffer will be released. DCHECK(buffer->released); @@ -344,9 +291,9 @@ // If the client submits the same buffer twice, we need to store it twice, // because the client will expect two acks for it. submitted_buffers_.push_back( - SubmissionInfo{buffer->buffer_id, /*acked=*/false}); + SubmissionInfo{buffer->AsWeakPtr(), buffer->id(), /*acked=*/false}); - DamageBuffer(buffer); + DamageBuffer(buffer, damage_region); // On Mutter, we don't receive frame.callback acks if we don't attach a new // wl_buffer. This is more likely to happen with overlay single-on-top @@ -355,7 +302,7 @@ if (should_attach_buffer && wait_for_callback) SetupFrameCallback(); - SetupPresentationFeedback(buffer->buffer_id); + SetupPresentationFeedback(buffer->id()); CommitSurface(); connection_->ScheduleFlush(); @@ -364,18 +311,17 @@ return true; } - void DamageBuffer(WaylandBuffer* buffer) { + void DamageBuffer(WaylandBufferHandle* buffer, gfx::Rect damage_region) { DCHECK(wayland_surface_); - wayland_surface_->UpdateBufferDamageRegion(buffer->damage_region, - buffer->size); + wayland_surface_->UpdateBufferDamageRegion(damage_region, buffer->size()); } - void AttachBuffer(WaylandBuffer* buffer, + void AttachBuffer(WaylandBufferHandle* buffer, const gfx::GpuFenceHandle& access_fence_handle) { DCHECK(wayland_surface_ && configured_); if (!access_fence_handle.is_null()) wayland_surface_->SetAcquireFence(access_fence_handle); - wayland_surface_->AttachBuffer(buffer->wl_buffer.get()); + wayland_surface_->AttachBuffer(buffer->wl_buffer()); } void CommitSurface() { @@ -411,11 +357,6 @@ &feedback_listener, this); } - WaylandBuffer* GetBuffer(uint32_t buffer_id) const { - auto it = buffers_.find(buffer_id); - return it != buffers_.end() ? it->second.get() : nullptr; - } - void OnFrameCallback(struct wl_callback* callback) { DCHECK(wl_frame_callback_.get() == callback); wl_frame_callback_.reset(); @@ -438,10 +379,10 @@ // Releases may not necessarily come in order, so search the submitted // buffers. - WaylandBuffer* buffer = nullptr; + WaylandBufferHandle* buffer = nullptr; for (const auto& buff : submitted_buffers_) { - auto* submitted_buffer = GetBuffer(buff.buffer_id); - if (submitted_buffer && wl_buffer == submitted_buffer->wl_buffer.get()) { + auto* submitted_buffer = buff.buffer.get(); + if (submitted_buffer && wl_buffer == submitted_buffer->wl_buffer()) { buffer = submitted_buffer; break; } @@ -459,13 +400,6 @@ MaybeProcessSubmittedBuffers(); } - void SetupBufferReleaseListener(WaylandBuffer* buffer) { - static struct wl_buffer_listener buffer_listener = { - &Surface::BufferRelease, - }; - wl_buffer_add_listener(buffer->wl_buffer.get(), &buffer_listener, this); - } - // Called when we receive an immediate or fenced release for a buffer, via // the explicit synchronization protocol. void BufferExplicitRelease(wl_buffer* wl_buffer, @@ -479,13 +413,6 @@ } } - // wl_buffer_listener - static void BufferRelease(void* data, struct wl_buffer* wl_buffer) { - Surface* self = static_cast<Surface*>(data); - DCHECK(self); - self->OnRelease(wl_buffer, /*release_fence=*/gfx::GpuFenceHandle()); - } - void MaybeProcessSubmittedBuffers() { if (!wayland_surface_) return; @@ -501,7 +428,7 @@ // Buffers may be released out of order, but we need to provide the // guarantee that OnSubmission will be called in order of buffer submission. while (submitted_buffers_.size() >= 2) { - auto* buffer0 = GetBuffer(submitted_buffers_[0].buffer_id); + auto* buffer0 = submitted_buffers_[0].buffer.get(); // Treat a buffer as released if it has been explicitly released or // destroyed. This includes if we have a release fence for it - in that // case, the OnSubmission for the 2nd oldest buffer should contain the @@ -668,7 +595,7 @@ // The third case happens if the window hasn't been configured until a // request to attach a buffer to its surface is sent. const auto& pending_commit = pending_commits_.front(); - if ((pending_commit.buffer && !pending_commit.buffer->wl_buffer) || + if ((pending_commit.buffer && !pending_commit.buffer->wl_buffer()) || (wl_frame_callback_ && pending_commit.wait_for_callback) || !configured_) { return; @@ -688,7 +615,13 @@ return; } - CommitBufferInternal(commit.buffer, commit.wait_for_callback, + commit.buffer->set_buffer_released_callback(base::BindOnce( + &WaylandBufferManagerHost::Surface::OnRelease, + weak_ptr_factory_.GetWeakPtr(), commit.buffer->wl_buffer(), + /*release_fence=*/gfx::GpuFenceHandle())); + + CommitBufferInternal(commit.buffer.get(), commit.wait_for_callback, + commit.damage_region, commit.access_fence->GetGpuFenceHandle()); std::move(commit.post_commit_cb).Run(); } @@ -705,9 +638,6 @@ // Non-owned pointer to the buffer manager. WaylandBufferManagerHost* const buffer_manager_; - // A container of created buffers. - base::flat_map<uint32_t, std::unique_ptr<WaylandBuffer>> buffers_; - // A Wayland callback, which is triggered once wl_buffer has been committed // and it is right time to notify the GPU that it can start a new drawing // operation. @@ -733,20 +663,13 @@ base::WeakPtrFactory<Surface> weak_ptr_factory_{this}; }; -WaylandBuffer::WaylandBuffer(const gfx::Size& size, uint32_t buffer_id) - : size(size), buffer_id(buffer_id) {} -WaylandBuffer::~WaylandBuffer() = default; - WaylandBufferManagerHost::WaylandBufferManagerHost( WaylandConnection* connection) : connection_(connection), receiver_(this), weak_factory_(this) { connection_->wayland_window_manager()->AddObserver(this); } -WaylandBufferManagerHost::~WaylandBufferManagerHost() { - DCHECK(surfaces_.empty()); - DCHECK(anonymous_buffers_.empty()); -} +WaylandBufferManagerHost::~WaylandBufferManagerHost() = default; void WaylandBufferManagerHost::OnWindowAdded(WaylandWindow* window) { DCHECK(window); @@ -758,10 +681,6 @@ DCHECK(window); auto it = surfaces_.find(window->root_surface()); DCHECK(it != surfaces_.end()); - if (it->second->HasBuffers()) { - it->second->OnSurfaceRemoved(); - surface_graveyard_.emplace_back(std::move(it->second)); - } surfaces_.erase(it); RemovePendingFrames(window->root_surface(), 0u); @@ -790,10 +709,6 @@ DCHECK(subsurface); auto it = surfaces_.find(subsurface->wayland_surface()); DCHECK(it != surfaces_.end()); - if (it->second->HasBuffers()) { - it->second->OnSurfaceRemoved(); - surface_graveyard_.emplace_back(std::move(it->second)); - } surfaces_.erase(it); RemovePendingFrames(subsurface->wayland_surface(), 0u); @@ -830,8 +745,8 @@ buffer_manager_gpu_associated_.reset(); receiver_.reset(); - anonymous_buffers_.clear(); pending_frames_.clear(); + buffer_backings_.clear(); } wl::BufferFormatsWithModifiersMap @@ -884,29 +799,27 @@ // Validate data and ask surface to create a buffer associated with the // |buffer_id|. if (!ValidateDataFromGpu(fd, size, strides, offsets, modifiers, format, - planes_count, buffer_id) || - !CreateBuffer(size, buffer_id)) { + planes_count, buffer_id)) { TerminateGpuProcess(); return; } - // Create wl_buffer associated with the internal Buffer. - auto callback = - base::BindOnce(&WaylandBufferManagerHost::OnCreateBufferComplete, - weak_factory_.GetWeakPtr(), buffer_id); - if (connection_->zwp_dmabuf()) { - connection_->zwp_dmabuf()->CreateBuffer(std::move(fd), size, strides, - offsets, modifiers, format, - planes_count, std::move(callback)); - } else if (connection_->drm()) { - connection_->drm()->CreateBuffer(std::move(fd), size, strides, offsets, - modifiers, format, planes_count, - std::move(callback)); - } else { - // This method must never be called if neither zwp_linux_dmabuf or wl_drm - // are supported. - NOTREACHED(); + // Check if any of the surfaces has already had a buffer with the same id. + auto result = buffer_backings_.emplace( + buffer_id, std::make_unique<WaylandBufferBackingDmabuf>( + connection_, std::move(fd), size, std::move(strides), + std::move(offsets), std::move(modifiers), format, + planes_count, buffer_id)); + + if (!result.second) { + error_message_ = base::StrCat( + {"A buffer with id= ", NumberToString(buffer_id), " already exists"}); + TerminateGpuProcess(); + return; } + + auto* backing = result.first->second.get(); + backing->EnsureBufferHandle(); } void WaylandBufferManagerHost::CreateShmBasedBuffer(mojo::PlatformHandle shm_fd, @@ -921,17 +834,56 @@ base::ScopedFD fd = shm_fd.TakeFD(); // Validate data and create a buffer associated with the |buffer_id|. - if (!ValidateDataFromGpu(fd, length, size, buffer_id) || - !CreateBuffer(size, buffer_id)) { + if (!ValidateDataFromGpu(fd, length, size, buffer_id)) { TerminateGpuProcess(); return; } - // Create a shm based wl_buffer and attach it to the created buffer. - auto buffer = connection_->shm()->CreateBuffer(std::move(fd), length, size); - OnCreateBufferComplete(buffer_id, std::move(buffer)); + // Check if any of the surfaces has already had a buffer with the same id. + auto result = buffer_backings_.emplace( + buffer_id, std::make_unique<WaylandBufferBackingShm>( + connection_, std::move(fd), length, size, buffer_id)); - connection_->ScheduleFlush(); + if (!result.second) { + error_message_ = base::StrCat( + {"A buffer with id= ", NumberToString(buffer_id), " already exists"}); + TerminateGpuProcess(); + return; + } + + auto* backing = result.first->second.get(); + backing->EnsureBufferHandle(); +} + +bool WaylandBufferManagerHost::EnsureBufferHandle(WaylandSurface* requestor, + uint32_t buffer_id) { + DCHECK(base::CurrentUIThread::IsSet()); + DCHECK(error_message_.empty()); + DCHECK(requestor); + + auto it = buffer_backings_.find(buffer_id); + if (it == buffer_backings_.end()) { + error_message_ = base::StrCat( + {"Buffer with ", NumberToString(buffer_id), " id does not exist"}); + TerminateGpuProcess(); + return false; + } + + return it->second->EnsureBufferHandle(requestor); +} + +WaylandBufferHandle* WaylandBufferManagerHost::GetBufferHandle( + WaylandSurface* requestor, + uint32_t buffer_id) { + DCHECK(base::CurrentUIThread::IsSet()); + DCHECK(error_message_.empty()); + DCHECK(requestor); + + auto it = buffer_backings_.find(buffer_id); + if (it == buffer_backings_.end()) + return nullptr; + + return it->second->GetBufferHandle(requestor); } void WaylandBufferManagerHost::StartFrame(WaylandSurface* root_surface) { @@ -996,17 +948,9 @@ base::BindOnce(&WaylandBufferManagerHost::Frame::PendingActionComplete, pending_frames_.back()->weak_factory.GetWeakPtr()); } - if (!surface->CommitBuffer(buffer_id, damage_region, wait_for_frame_callback, - std::move(subsurface_committed_cb), - std::move(access_fence_handle))) { - error_message_ = - base::StrCat({"Buffer with ", NumberToString(buffer_id), - " id does not exist or failed to be created."}); - } - - if (!error_message_.empty()) - TerminateGpuProcess(); - return true; + return surface->CommitBuffer( + buffer_id, damage_region, wait_for_frame_callback, + std::move(subsurface_committed_cb), std::move(access_fence_handle)); } void WaylandBufferManagerHost::CommitOverlays( @@ -1035,6 +979,9 @@ void WaylandBufferManagerHost::DestroyBuffer(gfx::AcceleratedWidget widget, uint32_t buffer_id) { + // TODO(fangzhoug): Remove |widget| from the argument list of the mojo + // interface. + ALLOW_UNUSED_LOCAL(widget); DCHECK(base::CurrentUIThread::IsSet()); TRACE_EVENT1("wayland", "WaylandBufferManagerHost::DestroyBuffer", @@ -1046,71 +993,15 @@ return; } - // We allow creating buffers and attaching them to surfaces later. Thus, we - // must pay attention to the following things during the destruction of the - // buffers. - // 1) the |widget| is basically a hint where we must search for buffers. If no - // such surface exists (has already been destroyed), check if the buffer still - // has been stored in the |anonymous_buffers_|. - // 2) if the |widget| is null, always search a buffer with the |buffer_id| in - // the |anonymous_buffers_|. - // 3) if the |widget| hints at a non-existing window, it's likely that the - // window has been destroyed. In that case, the surface containing the buffer - // is in the graveyard. - - uint32_t destroyed_count = 0u; - - auto* window = connection_->wayland_window_manager()->GetWindow(widget); - if (window) { - // Case 1). - Surface* surface = GetSurface(window->root_surface()); - if (surface) { - destroyed_count = surface->DestroyBuffer(buffer_id); - if (!surface->HasBuffers() && !surface->HasSurface()) - surfaces_.erase(window->root_surface()); - } - if (!destroyed_count) { - surface = GetSurface(window->primary_subsurface()->wayland_surface()); - if (surface) { - destroyed_count = surface->DestroyBuffer(buffer_id); - if (!surface->HasBuffers() && !surface->HasSurface()) - surfaces_.erase(window->root_surface()); - } - } - if (!destroyed_count) { - const auto& subsurfaces = window->wayland_subsurfaces(); - for (const auto& it : subsurfaces) { - Surface* subsurface = GetSurface((*it).wayland_surface()); - if (subsurface) - destroyed_count += subsurface->DestroyBuffer(buffer_id); - } - } - } else { - // Case 3) - auto it = surface_graveyard_.begin(); - while (it != surface_graveyard_.end()) { - destroyed_count += (*it)->DestroyBuffer(buffer_id); - if (!(*it)->HasBuffers() && !(*it)->HasSurface()) { - surface_graveyard_.erase(it++); - } else { - ++it; - } - } + auto it = buffer_backings_.find(buffer_id); + if (it == buffer_backings_.end()) { + error_message_ = base::StrCat( + {"Buffer with ", NumberToString(buffer_id), " id does not exist"}); + TerminateGpuProcess(); + return; } - RemovePendingFrames(nullptr, buffer_id); - - // Ensure that we can't destroy more than 1 buffer. This can be 0 as well - // if no buffers are destroyed. - DCHECK_LE(destroyed_count, 1u); - - // Case 2) - if (destroyed_count == 1u || DestroyAnonymousBuffer(buffer_id)) - return; - - error_message_ = base::StrCat( - {"Buffer with ", NumberToString(buffer_id), " id does not exist"}); - TerminateGpuProcess(); + buffer_backings_.erase(it); } void WaylandBufferManagerHost::ResetSurfaceContents( @@ -1125,36 +1016,6 @@ surface->ResetSurfaceContents(); } -std::unique_ptr<WaylandBuffer> WaylandBufferManagerHost::PassAnonymousWlBuffer( - uint32_t buffer_id) { - auto it = anonymous_buffers_.find(buffer_id); - if (it == anonymous_buffers_.end()) - return nullptr; - auto buffer = std::move(it->second); - anonymous_buffers_.erase(it); - return buffer; -} - -bool WaylandBufferManagerHost::CreateBuffer(const gfx::Size& size, - uint32_t buffer_id) { - // First check if any of the surfaces has already had a buffer with the same - // id. - for (auto const& surface : surfaces_) { - if (surface.second->BufferExists(buffer_id)) { - error_message_ = base::StrCat( - {"A buffer with id= ", NumberToString(buffer_id), " already exists"}); - return false; - } - } - - auto result = anonymous_buffers_.emplace( - buffer_id, std::make_unique<WaylandBuffer>(size, buffer_id)); - if (!result.second) - error_message_ = base::StrCat( - {"A buffer with id= ", NumberToString(buffer_id), " already exists"}); - return result.second; -} - WaylandBufferManagerHost::Surface* WaylandBufferManagerHost::GetSurface( WaylandSurface* wayland_surface) const { auto it = surfaces_.find(wayland_surface); @@ -1245,25 +1106,6 @@ return true; } -void WaylandBufferManagerHost::OnCreateBufferComplete( - uint32_t buffer_id, - wl::Object<struct wl_buffer> new_buffer) { - auto it = anonymous_buffers_.find(buffer_id); - // It might have already been destroyed or stored by any of the surfaces. - if (it != anonymous_buffers_.end()) { - it->second->wl_buffer = std::move(new_buffer); - } else { - for (auto& surface : surfaces_) { - if (surface.second->BufferExists(buffer_id)) { - surface.second.get()->AttachWlBuffer(buffer_id, std::move(new_buffer)); - break; - } - } - } - // There is no need for the buffer anymore. Let it go out of the scope and - // be destroyed. -} - void WaylandBufferManagerHost::OnSubmission(gfx::AcceleratedWidget widget, uint32_t buffer_id, const gfx::SwapResult& swap_result, @@ -1291,13 +1133,4 @@ // The GPU process' failure results in calling ::OnChannelDestroyed. } -bool WaylandBufferManagerHost::DestroyAnonymousBuffer(uint32_t buffer_id) { - auto it = anonymous_buffers_.find(buffer_id); - if (it == anonymous_buffers_.end()) - return false; - - anonymous_buffers_.erase(it); - return true; -} - } // namespace ui
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h b/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h index c1259bc4..43ac0fc 100644 --- a/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h +++ b/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h
@@ -28,52 +28,13 @@ namespace ui { +class WaylandBufferBacking; +class WaylandBufferHandle; class WaylandConnection; class WaylandSubsurface; class WaylandWindow; class WaylandSurface; -// This is an internal helper representation of a wayland buffer object, which -// the GPU process creates when CreateBuffer is called. It's used for -// asynchronous buffer creation and stores |params| parameter to find out, -// which Buffer the wl_buffer corresponds to when CreateSucceeded is called. -// What is more, the Buffer stores such information as a widget it is attached -// to, its buffer id for simpler buffer management and other members specific -// to this Buffer object on run-time. -struct WaylandBuffer { - WaylandBuffer() = delete; - WaylandBuffer(const gfx::Size& size, uint32_t buffer_id); - ~WaylandBuffer(); - - // Actual buffer size. - const gfx::Size size; - - // Damage region this buffer describes. Must be emptied once buffer is - // submitted. - gfx::Rect damage_region; - - // The id of this buffer. - const uint32_t buffer_id; - - // A wl_buffer backed by a dmabuf created on the GPU side. - wl::Object<struct wl_buffer> wl_buffer; - - // Tells if the buffer has the wl_buffer attached. This can be used to - // identify potential problems, when the Wayland compositor fails to create - // wl_buffers. - bool attached = false; - - // Tells if the buffer has already been released aka not busy, and the - // surface can tell the gpu about successful swap. - bool released = true; - - // Optional release fence. This may be set if the buffer is released - // via the explicit synchronization Wayland protocol. - gfx::GpuFenceHandle release_fence; - - DISALLOW_COPY_AND_ASSIGN(WaylandBuffer); -}; - // This is the buffer manager which creates wl_buffers based on dmabuf (hw // accelerated compositing) or shared memory (software compositing) and uses // internal representation of surfaces, which are used to store buffers @@ -192,8 +153,13 @@ // surface on their screens. void ResetSurfaceContents(WaylandSurface* wayland_surface); - // Returns the anonymously created WaylandBuffer. - std::unique_ptr<WaylandBuffer> PassAnonymousWlBuffer(uint32_t buffer_id); + // Ensures a WaylandBufferHandle of |buffer_id| is created for the + // |requestor|, with its wl_buffer object requested via Wayland. + bool EnsureBufferHandle(WaylandSurface* requestor, uint32_t buffer_id); + + // Gets the WaylandBufferHandle of |buffer_id| used for |requestor|. + WaylandBufferHandle* GetBufferHandle(WaylandSurface* requestor, + uint32_t buffer_id); private: // This is an internal representation of a real surface, which holds a pointer @@ -206,8 +172,6 @@ // committing the root surface until all child surfaces' states are ready. struct Frame; - bool CreateBuffer(const gfx::Size& size, uint32_t buffer_id); - Surface* GetSurface(WaylandSurface* wayland_surface) const; void RemovePendingFrames(WaylandSurface* root_surface, uint32_t buffer_id); @@ -275,15 +239,9 @@ // data sent by the GPU to the browser process. base::OnceCallback<void(std::string)> terminate_gpu_cb_; - // Contains anonymous buffers aka buffers that are not attached to any of the - // existing surfaces and that will be mapped to surfaces later. - // Typically created when CreateAnonymousImage is called on the gpu process - // side. - // We assume that a buffer_id/wl_buffer will never be used on multiple - // wl_surfaces so we never re-map buffers to surfaces. If we ever need to use - // the same buffer for 2 surfaces at the same time, create multiple wl_buffers - // referencing the same dmabuf or underlying storage. - base::flat_map<uint32_t, std::unique_ptr<WaylandBuffer>> anonymous_buffers_; + // Maps buffer_id's to corresponding WaylandBufferBacking objects. + base::flat_map<uint32_t, std::unique_ptr<WaylandBufferBacking>> + buffer_backings_; base::WeakPtrFactory<WaylandBufferManagerHost> weak_factory_; };
diff --git a/ui/ozone/platform/wayland/host/wayland_drm.cc b/ui/ozone/platform/wayland/host/wayland_drm.cc index cb1062d..e11d58c 100644 --- a/ui/ozone/platform/wayland/host/wayland_drm.cc +++ b/ui/ozone/platform/wayland/host/wayland_drm.cc
@@ -63,7 +63,7 @@ return authenticated_ && !!wl_drm_; } -void WaylandDrm::CreateBuffer(base::ScopedFD fd, +void WaylandDrm::CreateBuffer(const base::ScopedFD& fd, const gfx::Size& size, const std::vector<uint32_t>& strides, const std::vector<uint32_t>& offsets,
diff --git a/ui/ozone/platform/wayland/host/wayland_drm.h b/ui/ozone/platform/wayland/host/wayland_drm.h index cfe924f5..b03ae72d 100644 --- a/ui/ozone/platform/wayland/host/wayland_drm.h +++ b/ui/ozone/platform/wayland/host/wayland_drm.h
@@ -49,7 +49,7 @@ // The result is sent back via the |callback|. If buffer creation failed, // nullptr is sent back via the callback. Otherwise, a pointer to the // |wl_buffer| is sent. - void CreateBuffer(base::ScopedFD fd, + void CreateBuffer(const base::ScopedFD& fd, const gfx::Size& size, const std::vector<uint32_t>& strides, const std::vector<uint32_t>& offsets,
diff --git a/ui/ozone/platform/wayland/host/wayland_shm.cc b/ui/ozone/platform/wayland/host/wayland_shm.cc index 27afbcf..1b39c82 100644 --- a/ui/ozone/platform/wayland/host/wayland_shm.cc +++ b/ui/ozone/platform/wayland/host/wayland_shm.cc
@@ -41,7 +41,7 @@ WaylandShm::~WaylandShm() = default; -wl::Object<wl_buffer> WaylandShm::CreateBuffer(base::ScopedFD fd, +wl::Object<wl_buffer> WaylandShm::CreateBuffer(const base::ScopedFD& fd, size_t length, const gfx::Size& size) { if (!fd.is_valid() || length == 0 || size.IsEmpty())
diff --git a/ui/ozone/platform/wayland/host/wayland_shm.h b/ui/ozone/platform/wayland/host/wayland_shm.h index 273614e..9484dda 100644 --- a/ui/ozone/platform/wayland/host/wayland_shm.h +++ b/ui/ozone/platform/wayland/host/wayland_shm.h
@@ -37,7 +37,7 @@ // Creates a wl_buffer based on shared memory handle for the specified // |widget|. - wl::Object<struct wl_buffer> CreateBuffer(base::ScopedFD fd, + wl::Object<struct wl_buffer> CreateBuffer(const base::ScopedFD& fd, size_t length, const gfx::Size& size);
diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc index ce34ede..83504ee 100644 --- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc +++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
@@ -472,6 +472,7 @@ workspace_ = kVisibleOnAllWorkspaces; } + SetPinnedModeExtension(this, static_cast<PinnedModeExtension*>(this)); return true; } @@ -679,6 +680,20 @@ } } +void WaylandToplevelWindow::Pin(bool trusted) const { + if (aura_surface_ && zaura_surface_get_version(aura_surface_.get()) >= + ZAURA_SURFACE_SET_PIN_SINCE_VERSION) { + zaura_surface_set_pin(aura_surface_.get(), trusted); + } +} + +void WaylandToplevelWindow::Unpin() const { + if (aura_surface_ && zaura_surface_get_version(aura_surface_.get()) >= + ZAURA_SURFACE_UNSET_PIN_SINCE_VERSION) { + zaura_surface_unset_pin(aura_surface_.get()); + } +} + std::string WaylandToplevelWindow::GetWorkspace() const { return workspace_.has_value() ? base::NumberToString(workspace_.value()) : std::string();
diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.h b/ui/ozone/platform/wayland/host/wayland_toplevel_window.h index 5248512a..5a7897e 100644 --- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.h +++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.h
@@ -11,6 +11,7 @@ #include "ui/gfx/geometry/vector2d.h" #include "ui/ozone/platform/wayland/host/wayland_window.h" #include "ui/platform_window/extensions/desk_extension.h" +#include "ui/platform_window/extensions/pinned_mode_extension.h" #include "ui/platform_window/extensions/wayland_extension.h" #include "ui/platform_window/extensions/workspace_extension.h" #include "ui/platform_window/extensions/workspace_extension_delegate.h" @@ -27,7 +28,8 @@ public WmMoveLoopHandler, public WaylandExtension, public WorkspaceExtension, - public DeskExtension { + public DeskExtension, + public PinnedModeExtension { public: WaylandToplevelWindow(PlatformWindowDelegate* delegate, WaylandConnection* connection); @@ -141,6 +143,10 @@ void SetWorkspaceExtensionDelegate( WorkspaceExtensionDelegate* delegate) override; + // PinnedModeExtension: + void Pin(bool trusted) const override; + void Unpin() const override; + void TriggerStateChanges(); void SetWindowState(PlatformWindowState state);
diff --git a/ui/ozone/platform/wayland/host/wayland_zaura_shell.cc b/ui/ozone/platform/wayland/host/wayland_zaura_shell.cc index d9e7ab0..593fb11 100644 --- a/ui/ozone/platform/wayland/host/wayland_zaura_shell.cc +++ b/ui/ozone/platform/wayland/host/wayland_zaura_shell.cc
@@ -18,7 +18,7 @@ namespace ui { namespace { -constexpr uint32_t kMaxAuraShellVersion = 23; +constexpr uint32_t kMaxAuraShellVersion = 24; } // static @@ -46,6 +46,11 @@ ReportShellUMA(UMALinuxWaylandShell::kZauraShell); } +void OnActivated(void* data, + struct zaura_shell* zaura_shell, + wl_surface* x, + wl_surface* y) {} + WaylandZAuraShell::WaylandZAuraShell(zaura_shell* aura_shell, WaylandConnection* connection) : obj_(aura_shell), connection_(connection) { @@ -53,10 +58,8 @@ DCHECK(connection_); static constexpr zaura_shell_listener zaura_shell_listener = { - &OnLayoutMode, - &OnBugFix, - &OnDesksChanged, - &OnDeskActivationChanged, + &OnLayoutMode, &OnBugFix, &OnDesksChanged, &OnDeskActivationChanged, + &OnActivated, }; zaura_shell_add_listener(obj_.get(), &zaura_shell_listener, this); }
diff --git a/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc b/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc index edc00fc5..099c93f 100644 --- a/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc +++ b/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc
@@ -59,7 +59,7 @@ WaylandZwpLinuxDmabuf::~WaylandZwpLinuxDmabuf() = default; -void WaylandZwpLinuxDmabuf::CreateBuffer(base::ScopedFD fd, +void WaylandZwpLinuxDmabuf::CreateBuffer(const base::ScopedFD& fd, const gfx::Size& size, const std::vector<uint32_t>& strides, const std::vector<uint32_t>& offsets,
diff --git a/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.h b/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.h index e4dfeb0..c3ad237 100644 --- a/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.h +++ b/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.h
@@ -48,7 +48,7 @@ // The result is sent back via the |callback|. If buffer creation failed, // nullptr is sent back via the callback. Otherwise, a pointer to the // |wl_buffer| is sent. - void CreateBuffer(base::ScopedFD fd, + void CreateBuffer(const base::ScopedFD& fd, const gfx::Size& size, const std::vector<uint32_t>& strides, const std::vector<uint32_t>& offsets,
diff --git a/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc b/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc index 4a5ac1ce..dd7c3b6 100644 --- a/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc +++ b/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc
@@ -373,8 +373,7 @@ kBufferId1, true /*fail*/); } - // ... impossible to try to destroy an attached buffer if the widget is not - // specified. + // Can destroy the buffer without specifying the widget. { EXPECT_CALL(*server_.zwp_linux_dmabuf_v1(), CreateParams(_, _, _)).Times(1); CreateDmabufBasedBufferAndSetTerminateExpectation(false /*fail*/, @@ -384,7 +383,7 @@ kDefaultScale, window_->GetBounds()); DestroyBufferAndSetTerminateExpectation(gfx::kNullAcceleratedWidget, - kBufferId1, true /*fail*/); + kBufferId1, false /*fail*/); } // Still can destroy the buffer even if it has not been attached to any @@ -467,6 +466,40 @@ Sync(); } +TEST_P(WaylandBufferManagerTest, CommitOverlaysWithSameBufferId) { + EXPECT_CALL(*server_.zwp_linux_dmabuf_v1(), CreateParams(_, _, _)).Times(2); + CreateDmabufBasedBufferAndSetTerminateExpectation(false /*fail*/, 1u); + + // Re-using the same buffer id across multiple surfaces is allowed. + SetTerminateCallbackExpectationAndDestroyChannel(&callback_, false /*fail*/); + + std::vector<ui::ozone::mojom::WaylandOverlayConfigPtr> overlay_configs; + overlay_configs.push_back(ui::ozone::mojom::WaylandOverlayConfig::New( + 0, gfx::OverlayTransform::OVERLAY_TRANSFORM_NONE, 1u, kDefaultScale, + window_->GetBounds(), gfx::RectF(), window_->GetBounds(), false, 1.0f, + gfx::GpuFenceHandle(), gfx::OverlayPriorityHint::kNone)); + overlay_configs.push_back(ui::ozone::mojom::WaylandOverlayConfig::New( + 1, gfx::OverlayTransform::OVERLAY_TRANSFORM_NONE, 1u, kDefaultScale, + window_->GetBounds(), gfx::RectF(), window_->GetBounds(), false, 1.0f, + gfx::GpuFenceHandle(), gfx::OverlayPriorityHint::kNone)); + + buffer_manager_gpu_->CommitOverlays(window_->GetWidget(), + std::move(overlay_configs)); + + Sync(); + ProcessCreatedBufferResourcesWithExpectation(2u /* expected size */, + false /* fail */); + + // Destroying the buffer causes all wl_buffer objects to be destroyed. + DestroyBufferAndSetTerminateExpectation(window_->GetWidget(), 1u, + false /*fail*/); + SetTerminateCallbackExpectationAndDestroyChannel(&callback_, true /*fail*/); + buffer_manager_gpu_->CommitBuffer(window_->GetWidget(), 1u, + window_->GetBounds(), kDefaultScale, + window_->GetBounds()); + Sync(); +} + TEST_P(WaylandBufferManagerTest, CommitBufferNullWidget) { constexpr uint32_t kBufferId = 1; EXPECT_CALL(*server_.zwp_linux_dmabuf_v1(), CreateParams(_, _, _)).Times(1); @@ -1674,7 +1707,6 @@ Sync(); // Ack creation for only the first 2 wl_buffers. - LOG(ERROR) << linux_dmabuf->buffer_params().size(); zwp_linux_buffer_params_v1_send_created( linux_dmabuf->buffer_params()[0]->resource(), linux_dmabuf->buffer_params()[0]->buffer_resource());
diff --git a/ui/platform_window/BUILD.gn b/ui/platform_window/BUILD.gn index c3565924..6c0b391 100644 --- a/ui/platform_window/BUILD.gn +++ b/ui/platform_window/BUILD.gn
@@ -46,6 +46,8 @@ sources += [ "extensions/desk_extension.cc", "extensions/desk_extension.h", + "extensions/pinned_mode_extension.cc", + "extensions/pinned_mode_extension.h", "extensions/wayland_extension.cc", "extensions/wayland_extension.h", "extensions/x11_extension.cc",
diff --git a/ui/platform_window/extensions/pinned_mode_extension.cc b/ui/platform_window/extensions/pinned_mode_extension.cc new file mode 100644 index 0000000..efc4f3d --- /dev/null +++ b/ui/platform_window/extensions/pinned_mode_extension.cc
@@ -0,0 +1,30 @@ +// 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 "ui/platform_window/extensions/pinned_mode_extension.h" + +#include "ui/base/class_property.h" +#include "ui/platform_window/platform_window.h" + +DEFINE_UI_CLASS_PROPERTY_TYPE(ui::PinnedModeExtension*) + +namespace ui { + +DEFINE_UI_CLASS_PROPERTY_KEY(PinnedModeExtension*, + kPinnedModeExtensionKey, + nullptr) + +PinnedModeExtension::~PinnedModeExtension() = default; + +void PinnedModeExtension::SetPinnedModeExtension( + PlatformWindow* window, + PinnedModeExtension* extension) { + window->SetProperty(kPinnedModeExtensionKey, extension); +} + +PinnedModeExtension* GetPinnedModeExtension(const PlatformWindow& window) { + return window.GetProperty(kPinnedModeExtensionKey); +} + +} // namespace ui
diff --git a/ui/platform_window/extensions/pinned_mode_extension.h b/ui/platform_window/extensions/pinned_mode_extension.h new file mode 100644 index 0000000..a881f07 --- /dev/null +++ b/ui/platform_window/extensions/pinned_mode_extension.h
@@ -0,0 +1,39 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_PLATFORM_WINDOW_EXTENSIONS_PINNED_MODE_EXTENSION_H_ +#define UI_PLATFORM_WINDOW_EXTENSIONS_PINNED_MODE_EXTENSION_H_ + +#include "base/component_export.h" + +namespace ui { + +class PlatformWindow; + +// A pinned mode extension that platforms can use to add support for pinned +// mode operations which are used e.g. in EDU tests / quizzes. +class COMPONENT_EXPORT(PLATFORM_WINDOW) PinnedModeExtension { + public: + // Pins/locks a window to the screen so that the user cannot do anything + // else before the mode is released. If trusted is set, it is an invocation + // from a trusted app like a school test mode app. + virtual void Pin(bool trusted) const = 0; + + // Releases the pinned mode and allows the user to do other things again. + virtual void Unpin() const = 0; + + protected: + virtual ~PinnedModeExtension(); + + // Sets the pointer to the extension as a property of the PlatformWindow. + static void SetPinnedModeExtension(PlatformWindow* window, + PinnedModeExtension* extension); +}; + +COMPONENT_EXPORT(PLATFORM_WINDOW) +PinnedModeExtension* GetPinnedModeExtension(const PlatformWindow& window); + +} // namespace ui + +#endif // UI_PLATFORM_WINDOW_EXTENSIONS_PINNED_MODE_EXTENSION_H_
diff --git a/ui/views/controls/menu/menu_controller_unittest.cc b/ui/views/controls/menu/menu_controller_unittest.cc index a61e0b5..346f92b 100644 --- a/ui/views/controls/menu/menu_controller_unittest.cc +++ b/ui/views/controls/menu/menu_controller_unittest.cc
@@ -67,7 +67,7 @@ #endif #endif -#if defined(USE_X11) || defined(USE_OZONE_PLATFORM_X11) +#if defined(USE_OZONE_PLATFORM_X11) #include "ui/events/test/events_test_utils_x11.h" #endif @@ -941,7 +941,7 @@ } #endif // defined(USE_AURA) -#if defined(USE_X11) || defined(USE_OZONE_PLATFORM_X11) +#if defined(USE_OZONE_PLATFORM_X11) // Tests that touch event ids are released correctly. See crbug.com/439051 for // details. When the ids aren't managed correctly, we get stuck down touches. TEST_F(MenuControllerTest, TouchIdsReleasedCorrectly) { @@ -973,7 +973,7 @@ GetRootWindow(owner())->RemovePreTargetHandler(&test_event_handler); } -#endif // defined(USE_X11) || defined(USE_OZONE_PLATFORM_X11) +#endif // defined(USE_OZONE_PLATFORM_X11) // Tests that initial selected menu items are correct when items are enabled or // disabled.
diff --git a/ui/views/controls/menu/menu_runner_impl.cc b/ui/views/controls/menu/menu_runner_impl.cc index 6e54d8d..f549be8 100644 --- a/ui/views/controls/menu/menu_runner_impl.cc +++ b/ui/views/controls/menu/menu_runner_impl.cc
@@ -22,10 +22,6 @@ #include "ui/events/win/system_event_state_lookup.h" #endif -#if defined(USE_X11) -#include "ui/events/x/events_x_utils.h" // nogncheck -#endif - #if defined(USE_OZONE) #include "ui/base/ui_base_features.h" #include "ui/events/event_constants.h" @@ -50,24 +46,16 @@ } } -#if defined(USE_X11) || defined(USE_OZONE) -bool IsAltPressed() { #if defined(USE_OZONE) - if (features::IsUsingOzonePlatform()) { - const auto* const platorm_menu_utils = - ui::OzonePlatform::GetInstance()->GetPlatformMenuUtils(); - if (platorm_menu_utils) - return (platorm_menu_utils->GetCurrentKeyModifiers() & ui::EF_ALT_DOWN) != - 0; +bool IsAltPressed() { + if (const auto* const platorm_menu_utils = + ui::OzonePlatform::GetInstance()->GetPlatformMenuUtils()) { + return (platorm_menu_utils->GetCurrentKeyModifiers() & ui::EF_ALT_DOWN) != + 0; } -#endif -#if defined(USE_X11) - return ui::IsAltPressed(); -#else return false; -#endif } -#endif // defined(USE_X11) || degined(USE_OZONE) +#endif // defined(USE_OZONE) } // namespace @@ -268,7 +256,7 @@ // Show mnemonics if the button has focus or alt is pressed. #if defined(OS_WIN) show_mnemonics |= ui::win::IsAltPressed(); -#elif defined(USE_X11) || defined(USE_OZONE) +#elif defined(USE_OZONE) show_mnemonics |= IsAltPressed(); #elif defined(OS_MAC) show_mnemonics = false;
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc index 4e29f7c..39b811a 100644 --- a/ui/views/controls/textfield/textfield.cc +++ b/ui/views/controls/textfield/textfield.cc
@@ -77,10 +77,6 @@ #include "ui/base/ime/linux/text_edit_key_bindings_delegate_auralinux.h" #endif -#if defined(USE_X11) -#include "ui/base/x/x11_util.h" // nogncheck -#endif - #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ui/aura/window.h" #include "ui/wm/core/ime_util_chromeos.h" @@ -183,16 +179,10 @@ bool CanUseTransparentBackgroundForDragImage() { #if defined(USE_OZONE) - if (::features::IsUsingOzonePlatform()) { const auto* const egl_utility = ui::OzonePlatform::GetInstance()->GetPlatformGLEGLUtility(); return egl_utility ? egl_utility->IsTransparentBackgroundSupported() : false; - } -#endif -#if defined(USE_X11) - // Fallback on the background color if the system doesn't support compositing. - return ui::XVisualManager::GetInstance()->ArgbVisualAvailable(); #else // Other platforms allow this. return true;
diff --git a/ui/views/corewm/tooltip_controller_unittest.cc b/ui/views/corewm/tooltip_controller_unittest.cc index a3e596e..48c1e4b 100644 --- a/ui/views/corewm/tooltip_controller_unittest.cc +++ b/ui/views/corewm/tooltip_controller_unittest.cc
@@ -765,10 +765,10 @@ EXPECT_TRUE(helper_->GetTooltipParentWindow() == nullptr); } -// Disabled on X11 as DesktopScreenX11::GetWindowAtScreenPoint() doesn't -// consider z-order. +// Disabled on Linux as X11ScreenOzone::GetAcceleratedWidgetAtScreenPoint +// and WaylandScreen::GetAcceleratedWidgetAtScreenPoint don't consider z-order. // Disabled on Windows due to failing bots. http://crbug.com/604479 -#if defined(USE_X11) || defined(OS_WIN) +#if defined(OS_LINUX) || defined(OS_WIN) #define MAYBE_Capture DISABLED_Capture #else #define MAYBE_Capture Capture
diff --git a/ui/views/test/views_test_base.cc b/ui/views/test/views_test_base.cc index 803521e9..67db6de 100644 --- a/ui/views/test/views_test_base.cc +++ b/ui/views/test/views_test_base.cc
@@ -28,12 +28,7 @@ #include "ui/views/widget/native_widget_mac.h" #endif -#if defined(USE_X11) -#include "ui/base/x/x11_util.h" -#endif - #if defined(USE_OZONE) -#include "ui/base/ui_base_features.h" #include "ui/ozone/public/ozone_platform.h" #include "ui/ozone/public/platform_gl_egl_utility.h" #endif @@ -44,14 +39,9 @@ bool DoesVisualHaveAlphaForTest() { #if defined(USE_OZONE) - if (features::IsUsingOzonePlatform()) { - const auto* const egl_utility = - ui::OzonePlatform::GetInstance()->GetPlatformGLEGLUtility(); - return egl_utility ? egl_utility->X11DoesVisualHaveAlphaForTest() : false; - } -#endif -#if defined(USE_X11) - return ui::DoesVisualHaveAlphaForTest(); + const auto* const egl_utility = + ui::OzonePlatform::GetInstance()->GetPlatformGLEGLUtility(); + return egl_utility ? egl_utility->X11DoesVisualHaveAlphaForTest() : false; #else return false; #endif
diff --git a/ui/views/test/widget_test_aura.cc b/ui/views/test/widget_test_aura.cc index 83c559a..fc8aca0 100644 --- a/ui/views/test/widget_test_aura.cc +++ b/ui/views/test/widget_test_aura.cc
@@ -20,10 +20,6 @@ #include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h" #endif -#if defined(USE_X11) -#include "ui/base/x/x11_util.h" // nogncheck -#endif - namespace views { namespace test { @@ -131,19 +127,7 @@ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. #elif defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) -#if defined(USE_OZONE) - if (features::IsUsingOzonePlatform()) - return widget->GetNativeWindow()->delegate()->GetMinimumSize(); -#endif // USE_OZONE -#if defined(USE_X11) - EXPECT_FALSE(features::IsUsingOzonePlatform()); - ui::SizeHints hints; - ui::GetWmNormalHints( - static_cast<x11::Window>( - widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget()), - &hints); - return gfx::Size(hints.min_width, hints.min_height); -#endif // USE_X11 + return widget->GetNativeWindow()->delegate()->GetMinimumSize(); #endif // OS_LINUX && !OS_CHROMEOS NOTREACHED(); return gfx::Size();
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc index ef2109d5..81199d5 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc
@@ -22,6 +22,7 @@ #include "ui/display/screen.h" #include "ui/events/event.h" #include "ui/platform_window/extensions/desk_extension.h" +#include "ui/platform_window/extensions/pinned_mode_extension.h" #include "ui/platform_window/extensions/wayland_extension.h" #include "ui/platform_window/extensions/x11_extension.h" #include "ui/platform_window/platform_window_init_properties.h" @@ -183,6 +184,15 @@ return ui::GetDeskExtension(*(platform_window())); } +ui::PinnedModeExtension* DesktopWindowTreeHostLinux::GetPinnedModeExtension() { + return ui::GetPinnedModeExtension(*(platform_window())); +} + +const ui::PinnedModeExtension* +DesktopWindowTreeHostLinux::GetPinnedModeExtension() const { + return ui::GetPinnedModeExtension(*(platform_window())); +} + void DesktopWindowTreeHostLinux::Init(const Widget::InitParams& params) { DesktopWindowTreeHostPlatform::Init(params);
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h index 8e520478..a1c768d 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h
@@ -26,6 +26,7 @@ namespace ui { class DeskExtension; +class PinnedModeExtension; class X11Extension; class WaylandExtension; } // namespace ui @@ -83,6 +84,9 @@ ui::DeskExtension* GetDeskExtension(); const ui::DeskExtension* GetDeskExtension() const; + ui::PinnedModeExtension* GetPinnedModeExtension(); + const ui::PinnedModeExtension* GetPinnedModeExtension() const; + protected: // Overridden from DesktopWindowTreeHost: void Init(const Widget::InitParams& params) override;
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux_interactive_uitest.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux_interactive_uitest.cc index d6614ac..4e93a96 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_linux_interactive_uitest.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_linux_interactive_uitest.cc
@@ -4,28 +4,22 @@ #include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h" +#include "base/run_loop.h" #include "ui/aura/client/aura_constants.h" +#include "ui/aura/env.h" #include "ui/aura/window_tree_host_platform.h" #include "ui/base/hit_test.h" +#include "ui/base/ime/input_method.h" +#include "ui/base/test/ui_controls.h" #include "ui/platform_window/platform_window.h" #include "ui/platform_window/wm/wm_move_resize_handler.h" +#include "ui/views/controls/textfield/textfield.h" #include "ui/views/test/widget_test.h" #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" #include "ui/views/widget/desktop_aura/window_event_filter_linux.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/window/native_frame_view.h" -#if defined(USE_X11) -#include "ui/aura/env.h" -#include "ui/base/ime/input_method.h" -#include "ui/base/x/test/x11_property_change_waiter.h" -#include "ui/base/x/x11_util.h" -#include "ui/gfx/x/x11_atom_cache.h" -#include "ui/gfx/x/xproto.h" -#include "ui/gfx/x/xproto_util.h" -#include "ui/views/controls/textfield/textfield.h" -#endif // defined(USE_X11) - namespace views { namespace { @@ -47,8 +41,6 @@ } } -#if defined(USE_X11) -// Creates a widget with the given bounds. std::unique_ptr<Widget> CreateWidget(const gfx::Rect& bounds) { std::unique_ptr<Widget> widget(new Widget); Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); @@ -60,55 +52,14 @@ return widget; } -// Dispatches a XMotionEvent targeted at |host|'s X window with location -// |point_in_screen|. -void DispatchMouseMotionEvent(DesktopWindowTreeHostLinux* desktop_host, - const gfx::Point& point_in_screen) { - gfx::Rect bounds_in_screen = desktop_host->window()->GetBoundsInScreen(); - - auto* connection = x11::Connection::Get(); - x11::MotionNotifyEvent xev{ - .detail = x11::Motion::Normal, - .root = connection->default_root(), - .event = static_cast<x11::Window>(desktop_host->GetAcceleratedWidget()), - .root_x = static_cast<int16_t>(point_in_screen.x()), - .root_y = static_cast<int16_t>(point_in_screen.y()), - .event_x = - static_cast<int16_t>(point_in_screen.x() - bounds_in_screen.x()), - .event_y = - static_cast<int16_t>(point_in_screen.y() - bounds_in_screen.y()), - .same_screen = true, - }; - - connection->DispatchEvent(x11::Event{xev}); +// Dispatches a motion event targeted to |point_in_screen|. +void DispatchMouseMotionEventSync(const gfx::Point& point_in_screen) { + base::RunLoop run_loop; + ui_controls::SendMouseMoveNotifyWhenDone( + point_in_screen.x(), point_in_screen.y(), run_loop.QuitClosure()); + run_loop.Run(); } -// Blocks till |window| gets activated. -class ActivationWaiter : public ui::X11PropertyChangeWaiter { - public: - explicit ActivationWaiter(x11::Window window) - : ui::X11PropertyChangeWaiter(ui::GetX11RootWindow(), - "_NET_ACTIVE_WINDOW"), - window_(window) {} - - ~ActivationWaiter() override = default; - - ActivationWaiter(const ActivationWaiter&) = delete; - ActivationWaiter& operator=(ActivationWaiter&) = delete; - - private: - // ui::X11PropertyChangeWaiter: - bool ShouldKeepOnWaiting() override { - x11::Window window = x11::Window::None; - GetProperty(ui::GetX11RootWindow(), x11::GetAtom("_NET_ACTIVE_WINDOW"), - &window); - return window != window_; - } - - x11::Window window_; -}; -#endif // defined(USE_X11) - // An event handler which counts the number of mouse moves it has seen. class MouseMoveCounterHandler : public ui::EventHandler { public: @@ -121,7 +72,13 @@ // ui::EventHandler: void OnMouseEvent(ui::MouseEvent* event) override { - if (event->type() == ui::ET_MOUSE_MOVED) + // ui_controls::SendMouseMoveNotifyWhenDone calls + // aura::Window::MoveCursorTo, which internally results in calling both + // aura::WindowEventDispatcher::PostSynthesizeMouseMove and + // aura::WindowTreeHostPlatform::MoveCursorToScreenLocationInPixels. Thus, + // two events will come - one is synthetic and another one is our real one. + // Ignore the synthetic events as we are not interested in them. + if (event->type() == ui::ET_MOUSE_MOVED && !event->IsSynthesized()) ++count_; } @@ -544,15 +501,13 @@ widget->CloseNow(); } -#if defined(USE_X11) // Test that calling Widget::Deactivate() sets the widget as inactive wrt to // Chrome even if it not possible to deactivate the window wrt to the x server. // This behavior is required by several interactive_ui_tests. TEST_F(DesktopWindowTreeHostLinuxTest, Deactivate) { std::unique_ptr<Widget> widget(CreateWidget(gfx::Rect(100, 100, 100, 100))); - ActivationWaiter waiter(static_cast<x11::Window>( - widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget())); + views::test::WidgetActivationWaiter waiter(widget.get(), true); widget->Show(); widget->Activate(); waiter.Wait(); @@ -574,17 +529,19 @@ // Chrome synchronously switches the window that mouse events are forwarded to // when capture is changed. TEST_F(DesktopWindowTreeHostLinuxTest, CaptureEventForwarding) { + ui_controls::EnableUIControls(); + std::unique_ptr<Widget> widget1(CreateWidget(gfx::Rect(100, 100, 100, 100))); aura::Window* window1 = widget1->GetNativeWindow(); - DesktopWindowTreeHostLinux* host1 = - static_cast<DesktopWindowTreeHostLinux*>(window1->GetHost()); + views::test::WidgetActivationWaiter waiter1(widget1.get(), true); widget1->Show(); + waiter1.Wait(); std::unique_ptr<Widget> widget2(CreateWidget(gfx::Rect(200, 100, 100, 100))); aura::Window* window2 = widget2->GetNativeWindow(); - DesktopWindowTreeHostLinux* host2 = - static_cast<DesktopWindowTreeHostLinux*>(window2->GetHost()); + views::test::WidgetActivationWaiter waiter2(widget2.get(), true); widget2->Show(); + waiter2.Wait(); MouseMoveCounterHandler recorder1; window1->AddPreTargetHandler(&recorder1); @@ -593,7 +550,7 @@ // Move the mouse to the center of |widget2|. gfx::Point point_in_screen = widget2->GetWindowBoundsInScreen().CenterPoint(); - DispatchMouseMotionEvent(host2, point_in_screen); + DispatchMouseMotionEventSync(point_in_screen); EXPECT_EQ(0, recorder1.num_mouse_moves()); EXPECT_EQ(1, recorder2.num_mouse_moves()); EXPECT_EQ(point_in_screen.ToString(), @@ -605,7 +562,7 @@ // redirects mouse events to |widget1|. widget1->SetCapture(nullptr); point_in_screen += gfx::Vector2d(1, 0); - DispatchMouseMotionEvent(host2, point_in_screen); + DispatchMouseMotionEventSync(point_in_screen); EXPECT_EQ(1, recorder1.num_mouse_moves()); EXPECT_EQ(1, recorder2.num_mouse_moves()); // If the event's location was correctly changed to be relative to |widget1|, @@ -617,7 +574,7 @@ // forwarded. widget2->SetCapture(nullptr); point_in_screen += gfx::Vector2d(1, 0); - DispatchMouseMotionEvent(host2, point_in_screen); + DispatchMouseMotionEventSync(point_in_screen); EXPECT_EQ(1, recorder1.num_mouse_moves()); EXPECT_EQ(2, recorder2.num_mouse_moves()); EXPECT_EQ(point_in_screen.ToString(), @@ -626,7 +583,7 @@ // If the mouse is not hovered over |widget1| or |widget2|, the X server will // send events to the window which has capture. Test the mouse events sent to // |widget2| are not forwarded. - DispatchMouseMotionEvent(host2, point_in_screen); + DispatchMouseMotionEventSync(point_in_screen); EXPECT_EQ(1, recorder1.num_mouse_moves()); EXPECT_EQ(3, recorder2.num_mouse_moves()); EXPECT_EQ(point_in_screen.ToString(), @@ -636,7 +593,7 @@ // longer forwarded to other widgets. widget2->ReleaseCapture(); point_in_screen = widget1->GetWindowBoundsInScreen().CenterPoint(); - DispatchMouseMotionEvent(host1, point_in_screen); + DispatchMouseMotionEventSync(point_in_screen); EXPECT_EQ(2, recorder1.num_mouse_moves()); EXPECT_EQ(3, recorder2.num_mouse_moves()); EXPECT_EQ(point_in_screen.ToString(), @@ -650,11 +607,6 @@ TEST_F(DesktopWindowTreeHostLinuxTest, InputMethodFocus) { std::unique_ptr<Widget> widget(CreateWidget(gfx::Rect(100, 100, 100, 100))); - // Waiter should be created as early as possible so that PropertyNotify has - // time to be set before widget is activated. - ActivationWaiter waiter(static_cast<x11::Window>( - widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget())); - std::unique_ptr<Textfield> textfield(new Textfield); textfield->SetBounds(0, 0, 200, 20); widget->GetRootView()->AddChildView(textfield.get()); @@ -667,6 +619,7 @@ // EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, // widget->GetInputMethod()->GetTextInputType()); + views::test::WidgetActivationWaiter waiter(widget.get(), true); widget->Activate(); waiter.Wait(); @@ -681,6 +634,4 @@ widget->GetInputMethod()->GetTextInputType()); } -#endif // defined(USE_X11) - } // namespace views
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc index dbca821..19af290 100644 --- a/ui/views/widget/widget_unittest.cc +++ b/ui/views/widget/widget_unittest.cc
@@ -69,7 +69,6 @@ #endif #if defined(USE_OZONE) -#include "ui/base/ui_base_features.h" #include "ui/ozone/public/ozone_platform.h" #include "ui/ozone/public/platform_gl_egl_utility.h" #endif @@ -1229,7 +1228,7 @@ } // Test behavior of NativeWidget*::GetWindowPlacement on the native desktop. -#if defined(USE_X11) +#if defined(OS_LINUX) // On desktop-Linux cheat and use non-desktop widgets. On X11, minimize is // asynchronous. Also (harder) showing a window doesn't activate it without // user interaction (or extra steps only done for interactive ui tests). @@ -1239,13 +1238,6 @@ #else TEST_F(DesktopWidgetTest, GetWindowPlacement) { #endif -#if defined(USE_OZONE) - if (features::IsUsingOzonePlatform() && - ui::OzonePlatform::GetPlatformNameForTest() != "x11") { - GTEST_SKIP() << "This test is X11-only"; - } -#endif - WidgetAutoclosePtr widget; widget.reset(CreateTopLevelNativeWidget()); @@ -4189,14 +4181,9 @@ bool CanHaveCompositingManager() { #if defined(USE_OZONE) - if (features::IsUsingOzonePlatform()) { - auto* const egl_utility = - ui::OzonePlatform::GetInstance()->GetPlatformGLEGLUtility(); - return (egl_utility != nullptr) && egl_utility->HasVisualManager(); - } -#endif -#if defined(USE_X11) - return true; + auto* const egl_utility = + ui::OzonePlatform::GetInstance()->GetPlatformGLEGLUtility(); + return (egl_utility != nullptr) && egl_utility->HasVisualManager(); #else return false; #endif
diff --git a/ui/webui/resources/cr_elements/chromeos/cr_picture/cr_picture_pane.html b/ui/webui/resources/cr_elements/chromeos/cr_picture/cr_picture_pane.html index 67ad649b..3cc6e66 100644 --- a/ui/webui/resources/cr_elements/chromeos/cr_picture/cr_picture_pane.html +++ b/ui/webui/resources/cr_elements/chromeos/cr_picture/cr_picture_pane.html
@@ -23,8 +23,7 @@ img { background-size: 100% 100%; - border-top-left-radius: 2px; - border-top-right-radius: 2px; + border-radius: 50%; display: block; height: 288px; width: 288px; @@ -32,7 +31,7 @@ img:not([data-show-discard]) { background-color: rgba(0, 0, 0, 0.08); - border-radius: 2px; + border-radius: 50%; bottom: 0; height: var(--cr-picture-image-size, 228px); left: 0;
diff --git a/weblayer/browser/android/javatests/skew/expectations.txt b/weblayer/browser/android/javatests/skew/expectations.txt index 3efaede..842b980 100644 --- a/weblayer/browser/android/javatests/skew/expectations.txt +++ b/weblayer/browser/android/javatests/skew/expectations.txt
@@ -5,7 +5,7 @@ # with versions less than or equal to $VERSION of the implementation. # # These lines are not comments! They define the set of known tags and other information. -# tags: [ client_lte_91 client_lte_94 client_lte_95 ] +# tags: [ client_lte_91 client_lte_94 client_lte_95 impl_lte_95 ] # 'all' disables the test from any skew test. # tags: [ all ] # results: [ Skip ] @@ -56,6 +56,24 @@ crbug.com/1249962 [ client_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testUserClicksLinkToPageWithExternalIntentLaunchedViaOnLoad [ Skip ] crbug.com/1249962 [ client_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testUserDecidingExternalIntentNavigationParamSetOnNavigationsToIntentsInIncognito [ Skip ] crbug.com/1249962 [ client_lte_95 ] org.chromium.weblayer.test.NavigationTest#testIsKnownProtocol [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentAfterRedirectInBackgroundTabLaunchedWhenBackgroundLaunchesAllowed [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentAfterRedirectLaunched [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentInNewTabLaunchedOnLinkClick [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentInSameTabLaunchedOnLinkClick [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentNavigationParamSetOnIntentLaunchViaLinkClick [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentNavigationParamSetOnNavigationsToIntents [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentViaOnLoadLaunched [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentWithFallbackUrlAfterRedirectLaunched [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentWithNoRedirectInBackgroundTabLaunchedWhenBackgroundLaunchesAllowed [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentWithNoRedirectInBrowserStartupInIncognitoBlockedWhenBackgroundLaunchesAllowedAndUserForbids [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentWithNoRedirectInBrowserStartupInIncognitoLaunchedWhenBackgroundLaunchesAllowedAndUserConsents [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentWithNoRedirectInBrowserStartupInIncognitoWithEmbedderPresentingWarningDialogBlockedWhenBackgroundLaunchesAllowedAndUserForbids [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentWithNoRedirectInBrowserStartupInIncognitoWithEmbedderPresentingWarningDialogLaunchedWhenBackgroundLaunchesAllowedAndUserConsents [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentWithNoRedirectInBrowserStartupLaunchedWhenBackgroundLaunchesAllowed [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentWithNoRedirectLaunched [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testUserClicksLinkToPageWithExternalIntentLaunchedViaOnLoad [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.ExternalNavigationTest#testUserDecidingExternalIntentNavigationParamSetOnNavigationsToIntentsInIncognito [ Skip ] +crbug.com/1249962 [ impl_lte_95 ] org.chromium.weblayer.test.NavigationTest#testIsKnownProtocol [ Skip ] # Bulk disable to get bot green. crbug.com/1191751 [ all ] org.chromium.weblayer.test.InputTypesTest* [ Skip ]