Skip to content

Commit

Permalink
Remove DISALLOW_* macros from chrome/
Browse files Browse the repository at this point in the history
This inlines all remaining DISALLOW_* macros in chrome/. This is done
manually (vim regex + manually finding insertion position).

IWYU cleanup is left as a separate pass that is easier when these macros
go away.

Bug: 1010217
Change-Id: Idb18af9d32397a302fe0fcf51636160f744a572e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3192336
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#926874}
  • Loading branch information
pbos authored and Chromium LUCI CQ committed Sep 30, 2021
1 parent 41587ce commit fadb175
Show file tree
Hide file tree
Showing 948 changed files with 4,691 additions and 2,496 deletions.
6 changes: 4 additions & 2 deletions chrome/app/chrome_crash_reporter_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient {
public:
static void Create();

ChromeCrashReporterClient(const ChromeCrashReporterClient&) = delete;
ChromeCrashReporterClient& operator=(const ChromeCrashReporterClient&) =
delete;

#if BUILDFLAG(IS_CHROMEOS_ASH)
// If true, processes of this type should pass crash-loop-before down to the
// crash reporter and to their children (if the children's type is a process
Expand Down Expand Up @@ -72,8 +76,6 @@ class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient {

ChromeCrashReporterClient();
~ChromeCrashReporterClient() override;

DISALLOW_COPY_AND_ASSIGN(ChromeCrashReporterClient);
};

#endif // OS_WIN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class AccessibilityLabelsBrowserTest : public InProcessBrowserTest {
public:
AccessibilityLabelsBrowserTest() {}

AccessibilityLabelsBrowserTest(const AccessibilityLabelsBrowserTest&) =
delete;
AccessibilityLabelsBrowserTest& operator=(
const AccessibilityLabelsBrowserTest&) = delete;

// InProcessBrowserTest overrides:
void SetUp() override {
scoped_feature_list_.InitAndEnableFeature(
Expand Down Expand Up @@ -52,7 +57,6 @@ class AccessibilityLabelsBrowserTest : public InProcessBrowserTest {

private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(AccessibilityLabelsBrowserTest);
};

// Changing the kAccessibilityImageLabelsEnabled pref should affect the
Expand Down
7 changes: 4 additions & 3 deletions chrome/browser/accessibility/caption_settings_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ namespace captions {
// sub-section of Settings.
class CaptionSettingsDialog {
public:
CaptionSettingsDialog() = delete;
CaptionSettingsDialog(const CaptionSettingsDialog&) = delete;
CaptionSettingsDialog& operator=(const CaptionSettingsDialog&) = delete;

// Displays the native captions manager dialog.
static void ShowCaptionSettingsDialog();

private:
DISALLOW_IMPLICIT_CONSTRUCTORS(CaptionSettingsDialog);
};

} // namespace captions
Expand Down
6 changes: 4 additions & 2 deletions chrome/browser/accessibility/image_annotation_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ class ImageAnnotationBrowserTest : public InProcessBrowserTest {
https_server_.AddDefaultHandlers(base::FilePath(kDocRoot));
}

ImageAnnotationBrowserTest(const ImageAnnotationBrowserTest&) = delete;
ImageAnnotationBrowserTest& operator=(const ImageAnnotationBrowserTest&) =
delete;

protected:
void SetUp() override {
scoped_feature_list_.InitWithFeatures(
Expand Down Expand Up @@ -277,8 +281,6 @@ class ImageAnnotationBrowserTest : public InProcessBrowserTest {

private:
base::test::ScopedFeatureList scoped_feature_list_;

DISALLOW_COPY_AND_ASSIGN(ImageAnnotationBrowserTest);
};

IN_PROC_BROWSER_TEST_F(ImageAnnotationBrowserTest,
Expand Down
6 changes: 4 additions & 2 deletions chrome/browser/after_startup_task_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class SequencedTaskRunner;

class AfterStartupTaskUtils {
public:
AfterStartupTaskUtils() = delete;
AfterStartupTaskUtils(const AfterStartupTaskUtils&) = delete;
AfterStartupTaskUtils& operator=(const AfterStartupTaskUtils&) = delete;

// Observes startup and when complete runs tasks that have accrued.
static void StartMonitoringStartup();

Expand Down Expand Up @@ -50,8 +54,6 @@ class AfterStartupTaskUtils {
friend class android::AfterStartupTaskUtilsJNI;

static void SetBrowserStartupIsComplete();

DISALLOW_IMPLICIT_CONSTRUCTORS(AfterStartupTaskUtils);
};

#endif // CHROME_BROWSER_AFTER_STARTUP_TASK_UTILS_H_
6 changes: 4 additions & 2 deletions chrome/browser/android/background_sync_launcher_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class BackgroundSyncLauncherAndroid {
public:
static BackgroundSyncLauncherAndroid* Get();

BackgroundSyncLauncherAndroid(const BackgroundSyncLauncherAndroid&) = delete;
BackgroundSyncLauncherAndroid& operator=(
const BackgroundSyncLauncherAndroid&) = delete;

// Schedules a BackgroundTaskScheduler task for |sync_type| with delay |delay|
// to ensure that the browser is running when the device next goes online
// after that time has passed. If |delay| is base::TimeDelta::Max(), the
Expand Down Expand Up @@ -59,8 +63,6 @@ class BackgroundSyncLauncherAndroid {

base::android::ScopedJavaGlobalRef<jobject>
java_background_sync_background_task_scheduler_launcher_;

DISALLOW_COPY_AND_ASSIGN(BackgroundSyncLauncherAndroid);
};

#endif // CHROME_BROWSER_ANDROID_BACKGROUND_SYNC_LAUNCHER_ANDROID_H_
6 changes: 4 additions & 2 deletions chrome/browser/android/bookmarks/bookmark_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
BookmarkBridge(JNIEnv* env,
const base::android::JavaRef<jobject>& obj,
const base::android::JavaRef<jobject>& j_profile);

BookmarkBridge(const BookmarkBridge&) = delete;
BookmarkBridge& operator=(const BookmarkBridge&) = delete;

void Destroy(JNIEnv*, const base::android::JavaParamRef<jobject>&);

jlong GetBookmarkIdForWebContents(
Expand Down Expand Up @@ -359,8 +363,6 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,

// Observes the profile destruction and creation.
base::ScopedObservation<Profile, ProfileObserver> profile_observation_{this};

DISALLOW_COPY_AND_ASSIGN(BookmarkBridge);
};

#endif // CHROME_BROWSER_ANDROID_BOOKMARKS_BOOKMARK_BRIDGE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,21 @@ using testing::_;
class MockObserver : public PartnerBookmarksShim::Observer {
public:
MockObserver() {}

MockObserver(const MockObserver&) = delete;
MockObserver& operator=(const MockObserver&) = delete;

MOCK_METHOD1(PartnerShimChanged, void(PartnerBookmarksShim*));
MOCK_METHOD1(PartnerShimLoaded, void(PartnerBookmarksShim*));

private:
DISALLOW_COPY_AND_ASSIGN(MockObserver);
};

class PartnerBookmarksShimTest : public testing::Test {
public:
PartnerBookmarksShimTest() = default;

PartnerBookmarksShimTest(const PartnerBookmarksShimTest&) = delete;
PartnerBookmarksShimTest& operator=(const PartnerBookmarksShimTest&) = delete;

PartnerBookmarksShim* partner_bookmarks_shim() const {
return PartnerBookmarksShim::BuildForBrowserContext(profile_.get());
}
Expand All @@ -65,9 +69,6 @@ class PartnerBookmarksShimTest : public testing::Test {
content::BrowserTaskEnvironment task_environment_;

MockObserver observer_;

private:
DISALLOW_COPY_AND_ASSIGN(PartnerBookmarksShimTest);
};

TEST_F(PartnerBookmarksShimTest, GetNodeByID) {
Expand Down
5 changes: 3 additions & 2 deletions chrome/browser/android/compositor/compositor_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class CompositorView : public content::CompositorClient,
ui::WindowAndroid* window_android,
TabContentManager* tab_content_manager);

CompositorView(const CompositorView&) = delete;
CompositorView& operator=(const CompositorView&) = delete;

void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& object);

ui::ResourceManager* GetResourceManager();
Expand Down Expand Up @@ -149,8 +152,6 @@ class CompositorView : public content::CompositorClient,
bool overlay_immersive_ar_mode_;

base::WeakPtrFactory<CompositorView> weak_factory_{this};

DISALLOW_COPY_AND_ASSIGN(CompositorView);
};

} // namespace android
Expand Down
7 changes: 4 additions & 3 deletions chrome/browser/android/compositor/layer/content_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class ContentLayer : public Layer {
public:
static scoped_refptr<ContentLayer> Create(
TabContentManager* tab_content_manager);

ContentLayer(const ContentLayer&) = delete;
ContentLayer& operator=(const ContentLayer&) = delete;

void SetProperties(int id,
bool can_use_live_layer,
float static_to_view_blend,
Expand All @@ -48,9 +52,6 @@ class ContentLayer : public Layer {
// is available).
scoped_refptr<cc::Layer> layer_;
TabContentManager* tab_content_manager_;

private:
DISALLOW_COPY_AND_ASSIGN(ContentLayer);
};

} // namespace android
Expand Down
5 changes: 3 additions & 2 deletions chrome/browser/android/compositor/layer/layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace android {
// layers and add functionalities to it.
class Layer : public base::RefCounted<Layer> {
public:
Layer(const Layer&) = delete;
Layer& operator=(const Layer&) = delete;

virtual scoped_refptr<cc::Layer> layer() = 0;

protected:
Expand All @@ -25,8 +28,6 @@ class Layer : public base::RefCounted<Layer> {

private:
friend class base::RefCounted<Layer>;

DISALLOW_COPY_AND_ASSIGN(Layer);
};

} // namespace android
Expand Down
5 changes: 3 additions & 2 deletions chrome/browser/android/compositor/layer/tab_handle_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class TabHandleLayer : public Layer {
static scoped_refptr<TabHandleLayer> Create(
LayerTitleCache* layer_title_cache);

TabHandleLayer(const TabHandleLayer&) = delete;
TabHandleLayer& operator=(const TabHandleLayer&) = delete;

void SetProperties(int id,
ui::Resource* close_button_resource,
ui::NinePatchResource* tab_handle_resource,
Expand Down Expand Up @@ -63,8 +66,6 @@ class TabHandleLayer : public Layer {

float brightness_;
bool foreground_;

DISALLOW_COPY_AND_ASSIGN(TabHandleLayer);
};

} // namespace android
Expand Down
5 changes: 3 additions & 2 deletions chrome/browser/android/compositor/layer/tab_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class TabLayer : public Layer {
LayerTitleCache* layer_title_cache,
TabContentManager* tab_content_manager);

TabLayer(const TabLayer&) = delete;
TabLayer& operator=(const TabLayer&) = delete;

// TODO(meiliang): This method needs another parameter, a resource that can be
// used to indicate the currently selected tab for the TabLayer.
void SetProperties(int id,
Expand Down Expand Up @@ -163,8 +166,6 @@ class TabLayer : public Layer {
scoped_refptr<cc::NinePatchLayer> shadow_;
scoped_refptr<cc::UIResourceLayer> back_logo_;
float brightness_;

DISALLOW_COPY_AND_ASSIGN(TabLayer);
};

} // namespace android
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class TabGroupContentLayer : public ContentLayer {
static scoped_refptr<TabGroupContentLayer> Create(
TabContentManager* tab_content_manager);

TabGroupContentLayer(const TabGroupContentLayer&) = delete;
TabGroupContentLayer& operator=(const TabGroupContentLayer&) = delete;

void SetProperties(int id,
const std::vector<int>& tab_ids,
bool can_use_live_layer,
Expand All @@ -43,7 +46,6 @@ class TabGroupContentLayer : public ContentLayer {

private:
std::vector<scoped_refptr<TabGroupTabContentLayer>> group_tab_content_layers_;
DISALLOW_COPY_AND_ASSIGN(TabGroupContentLayer);
};

} // namespace android
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class TabGroupTabContentLayer : public Layer {
static scoped_refptr<TabGroupTabContentLayer> Create(
TabContentManager* tab_content_manager);

TabGroupTabContentLayer(const TabGroupTabContentLayer&) = delete;
TabGroupTabContentLayer& operator=(const TabGroupTabContentLayer&) = delete;

void SetProperties(int id,
bool can_use_live_layer,
float static_to_view_blend,
Expand All @@ -55,7 +58,6 @@ class TabGroupTabContentLayer : public Layer {
scoped_refptr<cc::Layer> layer_;
scoped_refptr<ContentLayer> content_;
scoped_refptr<cc::NinePatchLayer> front_border_inner_shadow_;
DISALLOW_COPY_AND_ASSIGN(TabGroupTabContentLayer);
};

} // namespace android
Expand Down
6 changes: 4 additions & 2 deletions chrome/browser/android/compositor/layer/thumbnail_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class ThumbnailLayer : public Layer {
public:
// Creates a ThumbnailLayer.
static scoped_refptr<ThumbnailLayer> Create();

ThumbnailLayer(const ThumbnailLayer&) = delete;
ThumbnailLayer& operator=(const ThumbnailLayer&) = delete;

// Sets thumbnail that will be shown. |thumbnail| should not be nullptr.
void SetThumbnail(Thumbnail* thumbnail);
// Clip the thumbnail to the given |clipping|.
Expand All @@ -54,8 +58,6 @@ class ThumbnailLayer : public Layer {
gfx::Rect last_clipping_;
bool clipped_ = false;
gfx::SizeF resource_size_;

DISALLOW_COPY_AND_ASSIGN(ThumbnailLayer);
};

} // namespace android
Expand Down
5 changes: 3 additions & 2 deletions chrome/browser/android/compositor/layer/toolbar_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class ToolbarLayer : public Layer {
static scoped_refptr<ToolbarLayer> Create(
ui::ResourceManager* resource_manager);

ToolbarLayer(const ToolbarLayer&) = delete;
ToolbarLayer& operator=(const ToolbarLayer&) = delete;

// Implements Layer
scoped_refptr<cc::Layer> layer() override;

Expand Down Expand Up @@ -66,8 +69,6 @@ class ToolbarLayer : public Layer {
scoped_refptr<cc::SolidColorLayer> progress_bar_layer_;
scoped_refptr<cc::SolidColorLayer> progress_bar_background_layer_;
scoped_refptr<cc::SolidColorLayer> debug_layer_;

DISALLOW_COPY_AND_ASSIGN(ToolbarLayer);
};

} // namespace android
Expand Down
6 changes: 4 additions & 2 deletions chrome/browser/android/compositor/layer_title_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class LayerTitleCache {
jint spinner_resource_id,
jint spinner_incognito_resource_id,
ui::ResourceManager* resource_manager);

LayerTitleCache(const LayerTitleCache&) = delete;
LayerTitleCache& operator=(const LayerTitleCache&) = delete;

void Destroy(JNIEnv* env);

// Called from Java, updates a native cc::Layer based on the new texture
Expand Down Expand Up @@ -84,8 +88,6 @@ class LayerTitleCache {
int spinner_incognito_resource_id_;

ui::ResourceManager* resource_manager_;

DISALLOW_COPY_AND_ASSIGN(LayerTitleCache);
};

} // namespace android
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ namespace {

class ContextMenuImageRequest : public ImageDecoder::ImageRequest {
public:
ContextMenuImageRequest() = delete;
ContextMenuImageRequest(const ContextMenuImageRequest&) = delete;
ContextMenuImageRequest& operator=(const ContextMenuImageRequest&) = delete;

static void Start(const JavaRef<jobject>& jcallback,
const std::vector<uint8_t>& thumbnail_data) {
auto* request = new ContextMenuImageRequest(jcallback);
Expand All @@ -49,8 +53,6 @@ class ContextMenuImageRequest : public ImageDecoder::ImageRequest {
: jcallback_(jcallback) {}

const base::android::ScopedJavaGlobalRef<jobject> jcallback_;

DISALLOW_IMPLICIT_CONSTRUCTORS(ContextMenuImageRequest);
};

chrome::mojom::ImageFormat ToChromeMojomImageFormat(int image_format) {
Expand Down
Loading

0 comments on commit fadb175

Please sign in to comment.