Skip to content

Commit

Permalink
Implement DISALLOW_COPY_AND_ASSIGN using =delete, stage two.
Browse files Browse the repository at this point in the history
This enables the new implementation on all platforms, but only for non-branded
builds.  Since the CQ doesn't include these by default, the chance of breaking
them is greater.

Stage three will be to enable this all the time.

BUG=447156
TEST=none
TBR=thakis

Review-Url: https://codereview.chromium.org/2017813002
Cr-Commit-Position: refs/heads/master@{#396380}
  • Loading branch information
pkasting authored and Commit bot committed May 27, 2016
1 parent fcd2684 commit bdc5de3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions base/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

#include <stddef.h> // For size_t.

#include "build/build_config.h" // For OS_XXX. TODO(pkasting): Remove.

// Put this in the declarations for a class to be uncopyable.
#define DISALLOW_COPY(TypeName) \
TypeName(const TypeName&) = delete
Expand All @@ -24,10 +22,10 @@

// A macro to disallow the copy constructor and operator= functions.
// This should be used in the private: declarations for a class.
// TODO(pkasting): Using "= delete" is Linux-specific initially to prevent
// cross-platform code from regressing while other platforms are fixed. Remove
// the ifdefs here and use "= delete" on all platforms.
#if defined(CHROMIUM_BUILD) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
// TODO(pkasting): Using "= delete" is non-branded-build-specific initially to
// limit the rollout to reduce the chance of build breakage. Remove the ifdef
// here and use "= delete" always.
#if defined(CHROMIUM_BUILD)
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&) = delete; \
void operator=(const TypeName&) = delete
Expand Down

0 comments on commit bdc5de3

Please sign in to comment.