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
[email protected]
[email protected]

Review URL: https://chromiumcodereview.appspot.com/14471006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196383 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/cancelable_callback.h b/base/cancelable_callback.h
index acbffdd9..1cfcf2b6 100644
--- a/base/cancelable_callback.h
+++ b/base/cancelable_callback.h
@@ -58,11 +58,11 @@
 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 @@
 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 @@
         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 8ddd5be0..e8eb0fd 100644
--- a/base/memory/ref_counted_unittest.cc
+++ b/base/memory/ref_counted_unittest.cc
@@ -24,9 +24,7 @@
 
 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 @@
     : 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 @@
         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..ea314415 100644
--- a/base/test/sequenced_worker_pool_owner.cc
+++ b/base/test/sequenced_worker_pool_owner.cc
@@ -13,9 +13,7 @@
     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 @@
     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 @@
     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 @@
     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.