summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-04 00:57:39 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-04 00:57:39 +0000
commitac4c668a5d726a0aa77097b11c4e63b188d3b47c (patch)
tree08d345b0170311401ef03c9f5342b7ea46752420
parent1f139d1513ac3332cf940820e8be5195ca21333a (diff)
downloadchromium_src-ac4c668a5d726a0aa77097b11c4e63b188d3b47c.zip
chromium_src-ac4c668a5d726a0aa77097b11c4e63b188d3b47c.tar.gz
chromium_src-ac4c668a5d726a0aa77097b11c4e63b188d3b47c.tar.bz2
And now NewRunnableMethod(), you die.
Kill off NewRunnableMethod() and remove silly declarations of unused ScopedRunnableMethodFactory(s). BUG=none TEST=existing. Review URL: http://codereview.chromium.org/9034032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116250 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/callback.h6
-rw-r--r--base/callback.h.pump6
-rw-r--r--base/message_loop_unittest.cc40
-rw-r--r--base/message_pump_glib_unittest.cc5
-rw-r--r--base/task.h228
-rw-r--r--base/task_unittest.cc43
-rw-r--r--chrome/browser/browsing_data_remover.cc6
-rw-r--r--chrome/browser/chromeos/audio_handler.h4
-rw-r--r--chrome/browser/chromeos/chrome_browser_main_chromeos.cc4
-rw-r--r--chrome/browser/chromeos/customization_document.cc4
-rw-r--r--chrome/browser/chromeos/input_method/input_method_manager.cc7
-rw-r--r--chrome/browser/chromeos/login/ownership_service.cc6
-rw-r--r--chrome/browser/chromeos/media/media_player.cc6
-rw-r--r--chrome/browser/chromeos/mobile_config.cc4
-rw-r--r--chrome/browser/history/history_unittest.cc7
-rw-r--r--chrome/browser/metrics/thread_watcher.cc7
-rw-r--r--chrome/browser/metrics/thread_watcher.h7
-rw-r--r--chrome/browser/metrics/thread_watcher_unittest.cc8
-rw-r--r--chrome/browser/net/predictor.cc6
-rw-r--r--chrome/browser/service/service_process_control.cc4
-rw-r--r--chrome/browser/service/service_process_control_browsertest.cc4
-rw-r--r--chrome/service/service_process.h6
-rw-r--r--chrome/test/webdriver/webdriver_automation.h4
-rw-r--r--chrome/test/webdriver/webdriver_session.h4
-rw-r--r--chrome_frame/chrome_frame_automation.cc7
-rw-r--r--content/browser/renderer_host/media/audio_input_device_manager.h4
-rw-r--r--content/browser/renderer_host/media/video_capture_manager.h4
-rw-r--r--content/renderer/media/video_capture_impl.h4
-rw-r--r--jingle/glue/thread_wrapper.h6
-rw-r--r--media/audio/audio_manager.h4
-rw-r--r--media/video/capture/fake_video_capture_device.h4
-rw-r--r--media/video/capture/linux/video_capture_device_linux.h4
-rw-r--r--media/video/capture/video_capture_proxy.h3
-rw-r--r--net/proxy/proxy_config_service_linux_unittest.cc4
-rw-r--r--remoting/host/plugin/host_script_object.h4
35 files changed, 40 insertions, 434 deletions
diff --git a/base/callback.h b/base/callback.h
index 84abef9..ab8f7bb 100644
--- a/base/callback.h
+++ b/base/callback.h
@@ -3,7 +3,7 @@
// DO NOT EDIT BY HAND!!!
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -18,10 +18,6 @@
// NOTE: Header files that do not require the full definition of Callback or
// Closure should #include "base/callback_forward.h" instead of this file.
-// New, super-duper, unified Callback system. This will eventually replace
-// NewRunnableMethod, CreateFunctor, and CreateCallback systems currently in the
-// Chromium code base.
-//
// WHAT IS THIS:
//
// The templated Callback class is a generalized function object. Together
diff --git a/base/callback.h.pump b/base/callback.h.pump
index cab7a38..ef65e83 100644
--- a/base/callback.h.pump
+++ b/base/callback.h.pump
@@ -8,7 +8,7 @@ $$
$$ See comment for MAX_ARITY in base/bind.h.pump.
$var MAX_ARITY = 7
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -23,10 +23,6 @@ $var MAX_ARITY = 7
// NOTE: Header files that do not require the full definition of Callback or
// Closure should #include "base/callback_forward.h" instead of this file.
-// New, super-duper, unified Callback system. This will eventually replace
-// NewRunnableMethod, CreateFunctor, and CreateCallback systems currently in the
-// Chromium code base.
-//
// WHAT IS THIS:
//
// The templated Callback class is a generalized function object. Together
diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc
index 01a57c8..e528286 100644
--- a/base/message_loop_unittest.cc
+++ b/base/message_loop_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -81,38 +81,6 @@ class Foo : public base::RefCounted<Foo> {
std::string result_;
};
-// TODO(ajwong): Remove this once we've finished getting rid of the PostTask()
-// compatibility methods.
-void RunTest_PostLegacyTask(MessageLoop::Type message_loop_type) {
- MessageLoop loop(message_loop_type);
-
- // Add tests to message loop
- scoped_refptr<Foo> foo(new Foo());
- std::string a("a"), b("b"), c("c"), d("d");
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- foo.get(), &Foo::Test0));
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- foo.get(), &Foo::Test1ConstRef, a));
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- foo.get(), &Foo::Test1Ptr, &b));
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- foo.get(), &Foo::Test1Int, 100));
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- foo.get(), &Foo::Test2Ptr, &a, &c));
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- foo.get(), &Foo::Test2Mixed, a, &d));
-
- // After all tests, post a message that will shut down the message loop
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
- &MessageLoop::Quit, base::Unretained(MessageLoop::current())));
-
- // Now kick things off
- MessageLoop::current()->Run();
-
- EXPECT_EQ(foo->test_count(), 105);
- EXPECT_EQ(foo->result(), "abacad");
-}
-
void RunTest_PostTask(MessageLoop::Type message_loop_type) {
MessageLoop loop(message_loop_type);
@@ -1299,12 +1267,6 @@ void RunTest_WaitForIO() {
// that message loops work properly in all configurations. Of course, in some
// cases, a unit test may only be for a particular type of loop.
-TEST(MessageLoopTest, PostLegacyTask) {
- RunTest_PostLegacyTask(MessageLoop::TYPE_DEFAULT);
- RunTest_PostLegacyTask(MessageLoop::TYPE_UI);
- RunTest_PostLegacyTask(MessageLoop::TYPE_IO);
-}
-
TEST(MessageLoopTest, PostTask) {
RunTest_PostTask(MessageLoop::TYPE_DEFAULT);
RunTest_PostTask(MessageLoop::TYPE_UI);
diff --git a/base/message_pump_glib_unittest.cc b/base/message_pump_glib_unittest.cc
index 5286c66..467088c 100644
--- a/base/message_pump_glib_unittest.cc
+++ b/base/message_pump_glib_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -188,9 +188,6 @@ class MessagePumpGLibTest : public testing::Test {
} // namespace
-// EventInjector is expected to always live longer than the runnable methods.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(EventInjector);
-
TEST_F(MessagePumpGLibTest, TestQuit) {
// Checks that Quit works and that the basic infrastructure is working.
diff --git a/base/task.h b/base/task.h
index 9666a65..f22300a 100644
--- a/base/task.h
+++ b/base/task.h
@@ -70,231 +70,9 @@ void DeletePointer(T* obj) {
delete obj;
}
-// RunnableMethodTraits --------------------------------------------------------
-//
-// This traits-class is used by RunnableMethod to manage the lifetime of the
-// callee object. By default, it is assumed that the callee supports AddRef
-// and Release methods. A particular class can specialize this template to
-// define other lifetime management. For example, if the callee is known to
-// live longer than the RunnableMethod object, then a RunnableMethodTraits
-// struct could be defined with empty RetainCallee and ReleaseCallee methods.
-//
-// The DISABLE_RUNNABLE_METHOD_REFCOUNT macro is provided as a convenient way
-// for declaring a RunnableMethodTraits that disables refcounting.
-
-template <class T>
-struct RunnableMethodTraits {
- RunnableMethodTraits() {
-#ifndef NDEBUG
- origin_thread_id_ = base::PlatformThread::CurrentId();
-#endif
- }
-
- ~RunnableMethodTraits() {
-#ifndef NDEBUG
- // If destroyed on a separate thread, then we had better have been using
- // thread-safe reference counting!
- if (origin_thread_id_ != base::PlatformThread::CurrentId())
- DCHECK(T::ImplementsThreadSafeReferenceCounting());
-#endif
- }
-
- void RetainCallee(T* obj) {
-#ifndef NDEBUG
- // Catch NewRunnableMethod being called in an object's constructor. This
- // isn't safe since the method can be invoked before the constructor
- // completes, causing the object to be deleted.
- obj->AddRef();
- obj->Release();
-#endif
- obj->AddRef();
- }
-
- void ReleaseCallee(T* obj) {
- obj->Release();
- }
-
- private:
-#ifndef NDEBUG
- base::PlatformThreadId origin_thread_id_;
-#endif
-};
-
-// Convenience macro for declaring a RunnableMethodTraits that disables
-// refcounting of a class. This is useful if you know that the callee
-// will outlive the RunnableMethod object and thus do not need the ref counts.
-//
-// The invocation of DISABLE_RUNNABLE_METHOD_REFCOUNT should be done at the
-// global namespace scope. Example:
-//
-// namespace foo {
-// class Bar {
-// ...
-// };
-// } // namespace foo
-//
-// DISABLE_RUNNABLE_METHOD_REFCOUNT(foo::Bar);
-//
-// This is different from DISALLOW_COPY_AND_ASSIGN which is declared inside the
-// class.
-#define DISABLE_RUNNABLE_METHOD_REFCOUNT(TypeName) \
- template <> \
- struct RunnableMethodTraits<TypeName> { \
- void RetainCallee(TypeName* manager) {} \
- void ReleaseCallee(TypeName* manager) {} \
- }
-
-// RunnableMethod --------------------------------------------------------------
-//
-// Runnable methods are a type of task that call a function on an object when
-// they are run. We implement both an object and a set of NewRunnableMethod
-// functions for convenience. These functions are overloaded and will infer the
-// template types, simplifying calling code.
-//
-// The template definitions all use the following names:
-// T - the class type of the object you're supplying
-// this is not needed for the Static version of the call
-// Method/Function - the signature of a pointer to the method or function you
-// want to call
-// Param - the parameter(s) to the method, possibly packed as a Tuple
-// A - the first parameter (if any) to the method
-// B - the second parameter (if any) to the method
-//
-// Put these all together and you get an object that can call a method whose
-// signature is:
-// R T::MyFunction([A[, B]])
-//
-// Usage:
-// PostTask(FROM_HERE, NewRunnableMethod(object, &Object::method[, a[, b]])
-
-// RunnableMethod and NewRunnableMethod implementation -------------------------
-
-template <class T, class Method, class Params>
-class RunnableMethod : public CancelableTask {
- public:
- RunnableMethod(T* obj, Method meth, const Params& params)
- : obj_(obj), meth_(meth), params_(params) {
- traits_.RetainCallee(obj_);
- COMPILE_ASSERT(
- (base::internal::ParamsUseScopedRefptrCorrectly<Params>::value),
- badrunnablemethodparams);
- }
-
- ~RunnableMethod() {
- ReleaseCallee();
- obj_ = reinterpret_cast<T*>(base::kDeadTask);
- }
-
- virtual void Run() {
- if (obj_)
- DispatchToMethod(obj_, meth_, params_);
- }
-
- virtual void Cancel() {
- ReleaseCallee();
- }
-
- private:
- void ReleaseCallee() {
- T* obj = obj_;
- obj_ = NULL;
- if (obj)
- traits_.ReleaseCallee(obj);
- }
-
- T* obj_;
- Method meth_;
- Params params_;
- RunnableMethodTraits<T> traits_;
-};
-
-template <class T, class Method>
-inline CancelableTask* NewRunnableMethod(T* object, Method method) {
- return new RunnableMethod<T, Method, Tuple0>(object, method, MakeTuple());
-}
-
-template <class T, class Method, class A>
-inline CancelableTask* NewRunnableMethod(T* object, Method method, const A& a) {
- return new RunnableMethod<T, Method, Tuple1<A> >(object,
- method,
- MakeTuple(a));
-}
-
-template <class T, class Method, class A, class B>
-inline CancelableTask* NewRunnableMethod(T* object, Method method,
-const A& a, const B& b) {
- return new RunnableMethod<T, Method, Tuple2<A, B> >(object, method,
- MakeTuple(a, b));
-}
-
-template <class T, class Method, class A, class B, class C>
-inline CancelableTask* NewRunnableMethod(T* object, Method method,
- const A& a, const B& b, const C& c) {
- return new RunnableMethod<T, Method, Tuple3<A, B, C> >(object, method,
- MakeTuple(a, b, c));
-}
-
-template <class T, class Method, class A, class B, class C, class D>
-inline CancelableTask* NewRunnableMethod(T* object, Method method,
- const A& a, const B& b,
- const C& c, const D& d) {
- return new RunnableMethod<T, Method, Tuple4<A, B, C, D> >(object, method,
- MakeTuple(a, b,
- c, d));
-}
-
-template <class T, class Method, class A, class B, class C, class D, class E>
-inline CancelableTask* NewRunnableMethod(T* object, Method method,
- const A& a, const B& b,
- const C& c, const D& d, const E& e) {
- return new RunnableMethod<T,
- Method,
- Tuple5<A, B, C, D, E> >(object,
- method,
- MakeTuple(a, b, c, d, e));
-}
-
-template <class T, class Method, class A, class B, class C, class D, class E,
- class F>
-inline CancelableTask* NewRunnableMethod(T* object, Method method,
- const A& a, const B& b,
- const C& c, const D& d, const E& e,
- const F& f) {
- return new RunnableMethod<T,
- Method,
- Tuple6<A, B, C, D, E, F> >(object,
- method,
- MakeTuple(a, b, c, d, e,
- f));
-}
-
-template <class T, class Method, class A, class B, class C, class D, class E,
- class F, class G>
-inline CancelableTask* NewRunnableMethod(T* object, Method method,
- const A& a, const B& b,
- const C& c, const D& d, const E& e,
- const F& f, const G& g) {
- return new RunnableMethod<T,
- Method,
- Tuple7<A, B, C, D, E, F, G> >(object,
- method,
- MakeTuple(a, b, c, d,
- e, f, g));
-}
-
-template <class T, class Method, class A, class B, class C, class D, class E,
- class F, class G, class H>
-inline CancelableTask* NewRunnableMethod(T* object, Method method,
- const A& a, const B& b,
- const C& c, const D& d, const E& e,
- const F& f, const G& g, const H& h) {
- return new RunnableMethod<T,
- Method,
- Tuple8<A, B, C, D, E, F, G, H> >(object,
- method,
- MakeTuple(a, b, c,
- d, e, f,
- g, h));
+template<typename T>
+void ReleasePointer(T* obj) {
+ obj->Release();
}
namespace base {
diff --git a/base/task_unittest.cc b/base/task_unittest.cc
index f192415..956e77f 100644
--- a/base/task_unittest.cc
+++ b/base/task_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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,47 +9,6 @@
namespace {
-class CancelInDestructor : public base::RefCounted<CancelInDestructor> {
- public:
- CancelInDestructor() : cancelable_task_(NULL) {}
-
- void Start() {
- if (cancelable_task_) {
- ADD_FAILURE();
- return;
- }
- AddRef();
- cancelable_task_ = NewRunnableMethod(
- this, &CancelInDestructor::NeverIssuedCallback);
- Release();
- }
-
- CancelableTask* cancelable_task() {
- return cancelable_task_;
- }
-
- private:
- friend class base::RefCounted<CancelInDestructor>;
-
- ~CancelInDestructor() {
- if (cancelable_task_)
- cancelable_task_->Cancel();
- }
-
- void NeverIssuedCallback() { NOTREACHED(); }
-
- CancelableTask* cancelable_task_;
-};
-
-TEST(TaskTest, TestCancelInDestructor) {
- // Intentionally not using a scoped_refptr for cancel_in_destructor.
- CancelInDestructor* cancel_in_destructor = new CancelInDestructor();
- cancel_in_destructor->Start();
- CancelableTask* cancelable_task = cancel_in_destructor->cancelable_task();
- ASSERT_TRUE(cancelable_task);
- delete cancelable_task;
-}
-
class DoneTask : public Task {
public:
DoneTask(int* run_count, bool* was_deleted)
diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc
index 44f697e..25ef011 100644
--- a/chrome/browser/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data_remover.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -61,10 +61,6 @@ using content::BrowserThread;
using content::DownloadManager;
using content::UserMetricsAction;
-// Done so that we can use PostTask on BrowsingDataRemovers and not have
-// BrowsingDataRemover implement RefCounted.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(BrowsingDataRemover);
-
bool BrowsingDataRemover::removing_ = false;
BrowsingDataRemover::NotificationDetails::NotificationDetails()
diff --git a/chrome/browser/chromeos/audio_handler.h b/chrome/browser/chromeos/audio_handler.h
index 2d99808..0051a07 100644
--- a/chrome/browser/chromeos/audio_handler.h
+++ b/chrome/browser/chromeos/audio_handler.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -64,6 +64,4 @@ class AudioHandler {
} // namespace chromeos
-DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::AudioHandler);
-
#endif // CHROME_BROWSER_CHROMEOS_AUDIO_HANDLER_H_
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
index 5aa499f..bb32a82 100644
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -171,10 +171,6 @@ class StubLogin : public chromeos::LoginStatusConsumer,
bool profile_prepared_;
};
-// Allows authenticator to be invoked without adding refcounting. The instances
-// will delete themselves upon completion.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(StubLogin);
-
void OptionallyRunChromeOSLoginManager(const CommandLine& parsed_command_line,
Profile* profile) {
if (parsed_command_line.HasSwitch(switches::kLoginManager)) {
diff --git a/chrome/browser/chromeos/customization_document.cc b/chrome/browser/chromeos/customization_document.cc
index 27e504d..ea04841 100644
--- a/chrome/browser/chromeos/customization_document.cc
+++ b/chrome/browser/chromeos/customization_document.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -69,8 +69,6 @@ const int kRetriesDelayInSec = 2;
} // anonymous namespace
-DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::ServicesCustomizationDocument);
-
namespace chromeos {
// CustomizationDocument implementation. ---------------------------------------
diff --git a/chrome/browser/chromeos/input_method/input_method_manager.cc b/chrome/browser/chromeos/input_method/input_method_manager.cc
index 3729be5..a54d195 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -1430,8 +1430,3 @@ InputMethodManager* InputMethodManager::GetInstance() {
} // namespace input_method
} // namespace chromeos
-
-// Allows InvokeLater without adding refcounting. This class is a Singleton and
-// won't be deleted until it's last InvokeLater is run.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(
- chromeos::input_method::InputMethodManagerImpl);
diff --git a/chrome/browser/chromeos/login/ownership_service.cc b/chrome/browser/chromeos/login/ownership_service.cc
index 6e7fa1e..6d3cf6a 100644
--- a/chrome/browser/chromeos/login/ownership_service.cc
+++ b/chrome/browser/chromeos/login/ownership_service.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -55,8 +55,8 @@ void OwnershipService::Prewarm() {
// This can happen only for particular test: OwnershipServiceTest. It uses
// mocks and for that uses OwnershipService not as a regular singleton but
// as a resurrecting object. This behaviour conflicts with
- // DISABLE_RUNNABLE_METHOD_REFCOUNT. So avoid posting task in those
- // circumstances in order to avoid accessing already deleted object.
+ // base::Unretained(). So avoid posting task in those circumstances
+ // in order to avoid accessing already deleted object.
}
}
diff --git a/chrome/browser/chromeos/media/media_player.cc b/chrome/browser/chromeos/media/media_player.cc
index f3cb2db..4642824 100644
--- a/chrome/browser/chromeos/media/media_player.cc
+++ b/chrome/browser/chromeos/media/media_player.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -75,10 +75,6 @@ int MediaPlayer::GetPlaylistPosition() const {
//
////////////////////////////////////////////////////////////////////////////////
-// Allows InvokeLater without adding refcounting. This class is a Singleton and
-// won't be deleted until it's last InvokeLater is run.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(MediaPlayer);
-
MediaPlayer::~MediaPlayer() {
}
diff --git a/chrome/browser/chromeos/mobile_config.cc b/chrome/browser/chromeos/mobile_config.cc
index 852696a..9ed9a1d 100644
--- a/chrome/browser/chromeos/mobile_config.cc
+++ b/chrome/browser/chromeos/mobile_config.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -56,8 +56,6 @@ const char kLocalCarrierConfigPath[] =
} // anonymous namespace
-DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::MobileConfig);
-
namespace chromeos {
// MobileConfig::CarrierDeal implementation. -----------------------------------
diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc
index 2ae6073..dba30db 100644
--- a/chrome/browser/history/history_unittest.cc
+++ b/chrome/browser/history/history_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -64,11 +64,6 @@ namespace history {
class HistoryTest;
}
-// Specialize RunnableMethodTraits for HistoryTest so we can create callbacks.
-// None of these callbacks can outlast the test, so there is not need to retain
-// the HistoryTest object.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(history::HistoryTest);
-
namespace history {
namespace {
diff --git a/chrome/browser/metrics/thread_watcher.cc b/chrome/browser/metrics/thread_watcher.cc
index 52968bd..1c8796b 100644
--- a/chrome/browser/metrics/thread_watcher.cc
+++ b/chrome/browser/metrics/thread_watcher.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -722,11 +722,6 @@ static base::LazyInstance<base::Lock,
// The singleton of this class.
static WatchDogThread* g_watchdog_thread = NULL;
-
-// The WatchDogThread object must outlive any tasks posted to the IO thread
-// before the Quit task.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(WatchDogThread);
-
WatchDogThread::WatchDogThread() : Thread("BrowserWatchdog") {
}
diff --git a/chrome/browser/metrics/thread_watcher.h b/chrome/browser/metrics/thread_watcher.h
index 9eaccd9..d876caf 100644
--- a/chrome/browser/metrics/thread_watcher.h
+++ b/chrome/browser/metrics/thread_watcher.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -549,9 +549,4 @@ class ShutdownWatcherHelper {
DISALLOW_COPY_AND_ASSIGN(ShutdownWatcherHelper);
};
-// DISABLE_RUNNABLE_METHOD_REFCOUNT is a convenience macro for disabling
-// refcounting of ThreadWatcher and ThreadWatcherList classes.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(ThreadWatcher);
-DISABLE_RUNNABLE_METHOD_REFCOUNT(ThreadWatcherList);
-
#endif // CHROME_BROWSER_METRICS_THREAD_WATCHER_H_
diff --git a/chrome/browser/metrics/thread_watcher_unittest.cc b/chrome/browser/metrics/thread_watcher_unittest.cc
index dac63cf..6c0bfbb 100644
--- a/chrome/browser/metrics/thread_watcher_unittest.cc
+++ b/chrome/browser/metrics/thread_watcher_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -230,8 +230,6 @@ class CustomThreadWatcher : public ThreadWatcher {
}
};
-DISABLE_RUNNABLE_METHOD_REFCOUNT(CustomThreadWatcher);
-
class ThreadWatcherTest : public ::testing::Test {
public:
static const TimeDelta kSleepTime;
@@ -317,10 +315,6 @@ class ThreadWatcherTest : public ::testing::Test {
scoped_ptr<WatchDogThread> watchdog_thread_;
};
-// DISABLE_RUNNABLE_METHOD_REFCOUNT is a convenience macro for disabling
-// refcounting of ThreadWatcherTest classes.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(ThreadWatcherTest);
-
// Define static constants.
const TimeDelta ThreadWatcherTest::kSleepTime =
TimeDelta::FromMilliseconds(50);
diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc
index 54c03fa..be02c16 100644
--- a/chrome/browser/net/predictor.cc
+++ b/chrome/browser/net/predictor.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -697,10 +697,10 @@ void Predictor::FinalizeInitializationOnIOThread(
initial_observer_.reset(new InitialObserver());
host_resolver_ = io_thread->globals()->host_resolver.get();
- // ScopedRunnableMethodFactory instances need to be created and destroyed
+ // base::WeakPtrFactory instances need to be created and destroyed
// on the same thread. The predictor lives on the IO thread and will die
// from there so now that we're on the IO thread we need to properly
- // initialize the ScopedrunnableMethodFactory.
+ // initialize the base::WeakPtrFactory.
// TODO(groby): Check if WeakPtrFactory has the same constraint.
weak_factory_.reset(new base::WeakPtrFactory<Predictor>(this));
diff --git a/chrome/browser/service/service_process_control.cc b/chrome/browser/service/service_process_control.cc
index fdaa7e2..f7a1eed 100644
--- a/chrome/browser/service/service_process_control.cc
+++ b/chrome/browser/service/service_process_control.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -256,8 +256,6 @@ ServiceProcessControl* ServiceProcessControl::GetInstance() {
return Singleton<ServiceProcessControl>::get();
}
-DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControl);
-
ServiceProcessControl::Launcher::Launcher(ServiceProcessControl* process,
CommandLine* cmd_line)
: process_(process),
diff --git a/chrome/browser/service/service_process_control_browsertest.cc b/chrome/browser/service/service_process_control_browsertest.cc
index f269b85..638ec51 100644
--- a/chrome/browser/service/service_process_control_browsertest.cc
+++ b/chrome/browser/service/service_process_control_browsertest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -203,5 +203,3 @@ IN_PROC_BROWSER_TEST_F(ServiceProcessControlBrowserTest, CheckPid) {
// Disconnect from service process.
ServiceProcessControl::GetInstance()->Disconnect();
}
-
-DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControlBrowserTest);
diff --git a/chrome/service/service_process.h b/chrome/service/service_process.h
index 4468bca..8859304 100644
--- a/chrome/service/service_process.h
+++ b/chrome/service/service_process.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -142,10 +142,6 @@ class ServiceProcess : public CloudPrintProxy::Client {
DISALLOW_COPY_AND_ASSIGN(ServiceProcess);
};
-// Disable refcounting for runnable method because it is really not needed
-// when we post tasks on the main message loop.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcess);
-
extern ServiceProcess* g_service_process;
#endif // CHROME_SERVICE_SERVICE_PROCESS_H_
diff --git a/chrome/test/webdriver/webdriver_automation.h b/chrome/test/webdriver/webdriver_automation.h
index 295f844..861f53a 100644
--- a/chrome/test/webdriver/webdriver_automation.h
+++ b/chrome/test/webdriver/webdriver_automation.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -241,6 +241,4 @@ class Automation {
} // namespace webdriver
-DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Automation);
-
#endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_AUTOMATION_H_
diff --git a/chrome/test/webdriver/webdriver_session.h b/chrome/test/webdriver/webdriver_session.h
index 80a4e18..6fb7cee 100644
--- a/chrome/test/webdriver/webdriver_session.h
+++ b/chrome/test/webdriver/webdriver_session.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -443,6 +443,4 @@ class Session {
} // namespace webdriver
-DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session);
-
#endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index f6127dc..5ca6dd2 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -504,11 +504,6 @@ static base::LazyInstance<ProxyFactory,
base::LeakyLazyInstanceTraits<ProxyFactory> >
g_proxy_factory = LAZY_INSTANCE_INITIALIZER;
-template <> struct RunnableMethodTraits<ChromeFrameAutomationClient> {
- static void RetainCallee(ChromeFrameAutomationClient* obj) {}
- static void ReleaseCallee(ChromeFrameAutomationClient* obj) {}
-};
-
ChromeFrameAutomationClient::ChromeFrameAutomationClient()
: chrome_frame_delegate_(NULL),
chrome_window_(NULL),
diff --git a/content/browser/renderer_host/media/audio_input_device_manager.h b/content/browser/renderer_host/media/audio_input_device_manager.h
index 2f21583..46cc3fb 100644
--- a/content/browser/renderer_host/media/audio_input_device_manager.h
+++ b/content/browser/renderer_host/media/audio_input_device_manager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
//
@@ -73,6 +73,4 @@ class CONTENT_EXPORT AudioInputDeviceManager : public MediaStreamProvider {
} // namespace media_stream
-DISABLE_RUNNABLE_METHOD_REFCOUNT(media_stream::AudioInputDeviceManager);
-
#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEVICE_MANAGER_H_
diff --git a/content/browser/renderer_host/media/video_capture_manager.h b/content/browser/renderer_host/media/video_capture_manager.h
index cd2fda1..e604a05 100644
--- a/content/browser/renderer_host/media/video_capture_manager.h
+++ b/content/browser/renderer_host/media/video_capture_manager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -153,6 +153,4 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider {
} // namespace media_stream
-DISABLE_RUNNABLE_METHOD_REFCOUNT(media_stream::VideoCaptureManager);
-
#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_
diff --git a/content/renderer/media/video_capture_impl.h b/content/renderer/media/video_capture_impl.h
index 6175725..57b6238 100644
--- a/content/renderer/media/video_capture_impl.h
+++ b/content/renderer/media/video_capture_impl.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -110,6 +110,4 @@ class CONTENT_EXPORT VideoCaptureImpl
DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl);
};
-DISABLE_RUNNABLE_METHOD_REFCOUNT(VideoCaptureImpl);
-
#endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_
diff --git a/jingle/glue/thread_wrapper.h b/jingle/glue/thread_wrapper.h
index 1ddf506..284c762 100644
--- a/jingle/glue/thread_wrapper.h
+++ b/jingle/glue/thread_wrapper.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -113,8 +113,4 @@ class JingleThreadWrapper
}
-// Safe to disable refcounting because JingleThreadWrapper deletes
-// itself with the thread.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(jingle_glue::JingleThreadWrapper);
-
#endif // JINGLE_GLUE_THREAD_WRAPPER_H_
diff --git a/media/audio/audio_manager.h b/media/audio/audio_manager.h
index 74d839b..2c5f2af 100644
--- a/media/audio/audio_manager.h
+++ b/media/audio/audio_manager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -132,6 +132,4 @@ class MEDIA_EXPORT AudioManager
virtual ~AudioManager();
};
-DISABLE_RUNNABLE_METHOD_REFCOUNT(AudioManager);
-
#endif // MEDIA_AUDIO_AUDIO_MANAGER_H_
diff --git a/media/video/capture/fake_video_capture_device.h b/media/video/capture/fake_video_capture_device.h
index a39e4c8..1d8c3f1 100644
--- a/media/video/capture/fake_video_capture_device.h
+++ b/media/video/capture/fake_video_capture_device.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -57,6 +57,4 @@ class MEDIA_EXPORT FakeVideoCaptureDevice : public VideoCaptureDevice {
} // namespace media
-DISABLE_RUNNABLE_METHOD_REFCOUNT(media::FakeVideoCaptureDevice);
-
#endif // MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_
diff --git a/media/video/capture/linux/video_capture_device_linux.h b/media/video/capture/linux/video_capture_device_linux.h
index 25154cb..19c4bc9 100644
--- a/media/video/capture/linux/video_capture_device_linux.h
+++ b/media/video/capture/linux/video_capture_device_linux.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -75,6 +75,4 @@ class VideoCaptureDeviceLinux : public VideoCaptureDevice {
} // namespace media
-DISABLE_RUNNABLE_METHOD_REFCOUNT(media::VideoCaptureDeviceLinux);
-
#endif // MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_
diff --git a/media/video/capture/video_capture_proxy.h b/media/video/capture/video_capture_proxy.h
index 54fa666..2db3dbf 100644
--- a/media/video/capture/video_capture_proxy.h
+++ b/media/video/capture/video_capture_proxy.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -94,6 +94,5 @@ class MEDIA_EXPORT VideoCaptureHandlerProxy
};
} // namespace media
-DISABLE_RUNNABLE_METHOD_REFCOUNT(media::VideoCaptureHandlerProxy);
#endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_PROXY_H_
diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc
index 37aeb57..d0e70ee 100644
--- a/net/proxy/proxy_config_service_linux_unittest.cc
+++ b/net/proxy/proxy_config_service_linux_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -345,8 +345,6 @@ class SynchConfigGetter {
net::ProxyConfigService::ConfigAvailability get_latest_config_result_;
};
-DISABLE_RUNNABLE_METHOD_REFCOUNT(SynchConfigGetter);
-
namespace net {
// This test fixture is only really needed for the KDEConfigParser test case,
diff --git a/remoting/host/plugin/host_script_object.h b/remoting/host/plugin/host_script_object.h
index 2e04370..a87b712 100644
--- a/remoting/host/plugin/host_script_object.h
+++ b/remoting/host/plugin/host_script_object.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -219,6 +219,4 @@ class HostNPScriptObject : public HostStatusObserver {
} // namespace remoting
-DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::HostNPScriptObject);
-
#endif // REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_