diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-25 12:17:15 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-25 12:17:15 +0000 |
commit | c9f977b25e6475fc36593965784cfd5ee81a59c4 (patch) | |
tree | 4b66315355116a30cc081953cd01d087ce164c85 | |
parent | 26c8bba2a5d0078d87770ce4a0ed83ebb665b23e (diff) | |
download | chromium_src-c9f977b25e6475fc36593965784cfd5ee81a59c4.zip chromium_src-c9f977b25e6475fc36593965784cfd5ee81a59c4.tar.gz chromium_src-c9f977b25e6475fc36593965784cfd5ee81a59c4.tar.bz2 |
base: Remove usage of ALLOW_THIS_IN_INITIALIZER_LIST macro.
See discussion in chromium-dev mailing list:
https://groups.google.com/a/chromium.org/forum/?fromgroups#!topic/chromium-dev/2EdybzAxSu8
The consensul was to remove it as it hasn't been providing us much value.
BUG=234765
R=darin@chromium.org
TBR=darin@chromium.org
Review URL: https://chromiumcodereview.appspot.com/14471006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196383 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/cancelable_callback.h | 8 | ||||
-rw-r--r-- | base/files/file_util_proxy_unittest.cc | 2 | ||||
-rw-r--r-- | base/memory/ref_counted_unittest.cc | 4 | ||||
-rw-r--r-- | base/message_pump_libevent.cc | 2 | ||||
-rw-r--r-- | base/observer_list_unittest.cc | 2 | ||||
-rw-r--r-- | base/test/sequenced_worker_pool_owner.cc | 4 | ||||
-rw-r--r-- | base/threading/sequenced_worker_pool.cc | 6 | ||||
-rw-r--r-- | base/threading/watchdog.cc | 2 |
8 files changed, 12 insertions, 18 deletions
diff --git a/base/cancelable_callback.h b/base/cancelable_callback.h index acbffdd..1cfcf2b 100644 --- a/base/cancelable_callback.h +++ b/base/cancelable_callback.h @@ -58,11 +58,11 @@ class CancelableCallback; template <> class CancelableCallback<void(void)> { public: - CancelableCallback() : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {} + CancelableCallback() : weak_factory_(this) {} // |callback| must not be null. explicit CancelableCallback(const base::Callback<void(void)>& callback) - : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), + : weak_factory_(this), callback_(callback) { DCHECK(!callback.is_null()); InitializeForwarder(); @@ -128,11 +128,11 @@ class CancelableCallback<void(void)> { template <typename A1> class CancelableCallback<void(A1)> { public: - CancelableCallback() : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {} + CancelableCallback() : weak_factory_(this) {} // |callback| must not be null. explicit CancelableCallback(const base::Callback<void(A1)>& callback) - : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), + : weak_factory_(this), callback_(callback) { DCHECK(!callback.is_null()); InitializeForwarder(); diff --git a/base/files/file_util_proxy_unittest.cc b/base/files/file_util_proxy_unittest.cc index 447c43b..9a5a0d6 100644 --- a/base/files/file_util_proxy_unittest.cc +++ b/base/files/file_util_proxy_unittest.cc @@ -26,7 +26,7 @@ class FileUtilProxyTest : public testing::Test { created_(false), file_(kInvalidPlatformFileValue), bytes_written_(-1), - weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {} + weak_factory_(this) {} virtual void SetUp() OVERRIDE { ASSERT_TRUE(dir_.CreateUniqueTempDir()); diff --git a/base/memory/ref_counted_unittest.cc b/base/memory/ref_counted_unittest.cc index 8ddd5be..e8eb0fd 100644 --- a/base/memory/ref_counted_unittest.cc +++ b/base/memory/ref_counted_unittest.cc @@ -24,9 +24,7 @@ class CheckDerivedMemberAccess : public scoped_refptr<SelfAssign> { class ScopedRefPtrToSelf : public base::RefCounted<ScopedRefPtrToSelf> { public: - ScopedRefPtrToSelf() - : ALLOW_THIS_IN_INITIALIZER_LIST(self_ptr_(this)) { - } + ScopedRefPtrToSelf() : self_ptr_(this) {} static bool was_destroyed() { return was_destroyed_; } diff --git a/base/message_pump_libevent.cc b/base/message_pump_libevent.cc index bf3c7af..364f44a 100644 --- a/base/message_pump_libevent.cc +++ b/base/message_pump_libevent.cc @@ -57,7 +57,7 @@ MessagePumpLibevent::FileDescriptorWatcher::FileDescriptorWatcher() : event_(NULL), pump_(NULL), watcher_(NULL), - ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { + weak_factory_(this) { } MessagePumpLibevent::FileDescriptorWatcher::~FileDescriptorWatcher() { diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc index 591d230..99c9e5f 100644 --- a/base/observer_list_unittest.cc +++ b/base/observer_list_unittest.cc @@ -106,7 +106,7 @@ class AddRemoveThread : public PlatformThread::Delegate, count_observes_(0), count_addtask_(0), do_notifies_(notify), - ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { + weak_factory_(this) { } virtual ~AddRemoveThread() { diff --git a/base/test/sequenced_worker_pool_owner.cc b/base/test/sequenced_worker_pool_owner.cc index afffe25..ea31441 100644 --- a/base/test/sequenced_worker_pool_owner.cc +++ b/base/test/sequenced_worker_pool_owner.cc @@ -13,9 +13,7 @@ SequencedWorkerPoolOwner::SequencedWorkerPoolOwner( size_t max_threads, const std::string& thread_name_prefix) : constructor_message_loop_(MessageLoop::current()), - pool_(new SequencedWorkerPool( - max_threads, thread_name_prefix, - ALLOW_THIS_IN_INITIALIZER_LIST(this))), + pool_(new SequencedWorkerPool(max_threads, thread_name_prefix, this)), has_work_call_count_(0) {} SequencedWorkerPoolOwner::~SequencedWorkerPoolOwner() { diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc index f89a582..e35242e 100644 --- a/base/threading/sequenced_worker_pool.cc +++ b/base/threading/sequenced_worker_pool.cc @@ -1094,8 +1094,7 @@ SequencedWorkerPool::SequencedWorkerPool( size_t max_threads, const std::string& thread_name_prefix) : constructor_message_loop_(MessageLoopProxy::current()), - inner_(new Inner(ALLOW_THIS_IN_INITIALIZER_LIST(this), - max_threads, thread_name_prefix, NULL)) { + inner_(new Inner(this, max_threads, thread_name_prefix, NULL)) { } SequencedWorkerPool::SequencedWorkerPool( @@ -1103,8 +1102,7 @@ SequencedWorkerPool::SequencedWorkerPool( const std::string& thread_name_prefix, TestingObserver* observer) : constructor_message_loop_(MessageLoopProxy::current()), - inner_(new Inner(ALLOW_THIS_IN_INITIALIZER_LIST(this), - max_threads, thread_name_prefix, observer)) { + inner_(new Inner(this, max_threads, thread_name_prefix, observer)) { } SequencedWorkerPool::~SequencedWorkerPool() {} diff --git a/base/threading/watchdog.cc b/base/threading/watchdog.cc index d060655..a18efec 100644 --- a/base/threading/watchdog.cc +++ b/base/threading/watchdog.cc @@ -41,7 +41,7 @@ Watchdog::Watchdog(const TimeDelta& duration, state_(DISARMED), duration_(duration), thread_watched_name_(thread_watched_name), - ALLOW_THIS_IN_INITIALIZER_LIST(delegate_(this)) { + delegate_(this) { if (!enabled_) return; // Don't start thread, or doing anything really. enabled_ = PlatformThread::Create(0, // Default stack size. |