diff options
35 files changed, 67 insertions, 182 deletions
diff --git a/base/message_pump_glib_unittest.cc b/base/message_pump_glib_unittest.cc index efe1cb4..cb9a84f3 100644 --- a/base/message_pump_glib_unittest.cc +++ b/base/message_pump_glib_unittest.cc @@ -182,12 +182,7 @@ class MessagePumpGLibTest : public testing::Test { } // namespace // EventInjector is expected to always live longer than the runnable methods. -// This lets us call NewRunnableMethod on EventInjector instances. -template<> -struct RunnableMethodTraits<EventInjector> { - void RetainCallee(EventInjector* obj) { } - void ReleaseCallee(EventInjector* obj) { } -}; +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 454878a..1425546 100644 --- a/base/task.h +++ b/base/task.h @@ -212,6 +212,9 @@ class ReleaseTask : public CancelableTask { // 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 { @@ -251,6 +254,30 @@ struct RunnableMethodTraits { #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 and RunnableFunction ----------------------------------------- // // Runnable methods are a type of task that call a function on an object when diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index a9cda45..a74f5ab 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -463,11 +463,7 @@ void BrowserProcessImpl::CreateStatusTrayManager() { // The BrowserProcess object must outlive the file thread so we use traits // which don't do any management. -template <> -struct RunnableMethodTraits<BrowserProcessImpl> { - void RetainCallee(BrowserProcessImpl* process) {} - void ReleaseCallee(BrowserProcessImpl* process) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(BrowserProcessImpl); void BrowserProcessImpl::CheckForInspectorFiles() { file_thread()->message_loop()->PostTask diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc index dac2404..61a1cb6 100644 --- a/chrome/browser/browsing_data_remover.cc +++ b/chrome/browser/browsing_data_remover.cc @@ -31,11 +31,7 @@ // Done so that we can use PostTask on BrowsingDataRemovers and not have // BrowsingDataRemover implement RefCounted. -template <> -struct RunnableMethodTraits<BrowsingDataRemover> { - void RetainCallee(BrowsingDataRemover* remover) {} - void ReleaseCallee(BrowsingDataRemover* remover) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(BrowsingDataRemover); bool BrowsingDataRemover::removing_ = false; diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc index 4d45f93..dc06c09 100644 --- a/chrome/browser/chrome_plugin_host.cc +++ b/chrome/browser/chrome_plugin_host.cc @@ -369,11 +369,7 @@ class ModelessHtmlDialogDelegate : public HtmlDialogUIDelegate { // Allows InvokeLater without adding refcounting. The object is only deleted // when its last InvokeLater is run anyway. -template <> -struct RunnableMethodTraits<ModelessHtmlDialogDelegate> { - void RetainCallee(ModelessHtmlDialogDelegate* delegate) {} - void ReleaseCallee(ModelessHtmlDialogDelegate* delegate) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(ModelessHtmlDialogDelegate); namespace { diff --git a/chrome/browser/chromeos/cros/language_library.cc b/chrome/browser/chromeos/cros/language_library.cc index f7346bc..022d58c 100644 --- a/chrome/browser/chromeos/cros/language_library.cc +++ b/chrome/browser/chromeos/cros/language_library.cc @@ -15,11 +15,7 @@ // Allows InvokeLater without adding refcounting. This class is a Singleton and // won't be deleted until it's last InvokeLater is run. -template <> -struct RunnableMethodTraits<chromeos::LanguageLibraryImpl> { - void RetainCallee(chromeos::LanguageLibraryImpl* obj) {} - void ReleaseCallee(chromeos::LanguageLibraryImpl* obj) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::LanguageLibraryImpl); namespace { diff --git a/chrome/browser/chromeos/cros/mount_library.cc b/chrome/browser/chromeos/cros/mount_library.cc index 74de250..894bccf8 100644 --- a/chrome/browser/chromeos/cros/mount_library.cc +++ b/chrome/browser/chromeos/cros/mount_library.cc @@ -11,11 +11,7 @@ // Allows InvokeLater without adding refcounting. This class is a Singleton and // won't be deleted until it's last InvokeLater is run. -template <> -struct RunnableMethodTraits<chromeos::MountLibraryImpl> { - void RetainCallee(chromeos::MountLibraryImpl* obj) {} - void ReleaseCallee(chromeos::MountLibraryImpl* obj) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::MountLibraryImpl); namespace chromeos { diff --git a/chrome/browser/chromeos/cros/network_library.cc b/chrome/browser/chromeos/cros/network_library.cc index 9af0847..28a4364 100644 --- a/chrome/browser/chromeos/cros/network_library.cc +++ b/chrome/browser/chromeos/cros/network_library.cc @@ -14,11 +14,7 @@ // Allows InvokeLater without adding refcounting. This class is a Singleton and // won't be deleted until it's last InvokeLater is run. -template <> -struct RunnableMethodTraits<chromeos::NetworkLibraryImpl> { - void RetainCallee(chromeos::NetworkLibraryImpl* obj) {} - void ReleaseCallee(chromeos::NetworkLibraryImpl* obj) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImpl); namespace chromeos { diff --git a/chrome/browser/chromeos/cros/power_library.cc b/chrome/browser/chromeos/cros/power_library.cc index 112f43c..42978aa 100644 --- a/chrome/browser/chromeos/cros/power_library.cc +++ b/chrome/browser/chromeos/cros/power_library.cc @@ -11,11 +11,7 @@ // Allows InvokeLater without adding refcounting. This class is a Singleton and // won't be deleted until it's last InvokeLater is run. -template <> -struct RunnableMethodTraits<chromeos::PowerLibraryImpl> { - void RetainCallee(chromeos::PowerLibraryImpl* obj) {} - void ReleaseCallee(chromeos::PowerLibraryImpl* obj) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::PowerLibraryImpl); namespace chromeos { diff --git a/chrome/browser/chromeos/cros/screen_lock_library.cc b/chrome/browser/chromeos/cros/screen_lock_library.cc index 5786c6c..d9fca88 100644 --- a/chrome/browser/chromeos/cros/screen_lock_library.cc +++ b/chrome/browser/chromeos/cros/screen_lock_library.cc @@ -11,11 +11,7 @@ // Allows InvokeLater without adding refcounting. This class is a Singleton and // won't be deleted until it's last InvokeLater is run. -template <> -struct RunnableMethodTraits<chromeos::ScreenLockLibraryImpl> { - void RetainCallee(chromeos::ScreenLockLibraryImpl* obj) {} - void ReleaseCallee(chromeos::ScreenLockLibraryImpl* obj) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::ScreenLockLibraryImpl); namespace chromeos { diff --git a/chrome/browser/crash_handler_host_linux.cc b/chrome/browser/crash_handler_host_linux.cc index 34166d6..b23b7ea 100644 --- a/chrome/browser/crash_handler_host_linux.cc +++ b/chrome/browser/crash_handler_host_linux.cc @@ -30,10 +30,7 @@ // Since classes derived from CrashHandlerHostLinux are singletons, it's only // destroyed at the end of the processes lifetime, which is greater in span than // the lifetime of the IO message loop. -template<> struct RunnableMethodTraits<CrashHandlerHostLinux> { - void RetainCallee(CrashHandlerHostLinux*) { } - void ReleaseCallee(CrashHandlerHostLinux*) { } -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(CrashHandlerHostLinux); CrashHandlerHostLinux::CrashHandlerHostLinux() : process_socket_(-1), diff --git a/chrome/browser/dom_ui/chrome_url_data_manager.h b/chrome/browser/dom_ui/chrome_url_data_manager.h index 0247a2b..f08daaf 100644 --- a/chrome/browser/dom_ui/chrome_url_data_manager.h +++ b/chrome/browser/dom_ui/chrome_url_data_manager.h @@ -159,10 +159,7 @@ class ChromeURLDataManager { // Since we have a single global ChromeURLDataManager, we don't need to // grab a reference to it when creating Tasks involving it. -template <> struct RunnableMethodTraits<ChromeURLDataManager> { - void RetainCallee(ChromeURLDataManager* manager) {} - void ReleaseCallee(ChromeURLDataManager* manager) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(ChromeURLDataManager); // Register our special URL handler under our special URL scheme. // Must be done once at startup. diff --git a/chrome/browser/dom_ui/mediaplayer_ui.cc b/chrome/browser/dom_ui/mediaplayer_ui.cc index a3e8bcd..e35df55 100644 --- a/chrome/browser/dom_ui/mediaplayer_ui.cc +++ b/chrome/browser/dom_ui/mediaplayer_ui.cc @@ -345,11 +345,7 @@ void MediaplayerHandler::HandleTogglePlaylist(const Value* value) { // Allows InvokeLater without adding refcounting. This class is a Singleton and // won't be deleted until it's last InvokeLater is run. -template <> -struct RunnableMethodTraits<MediaPlayer> { - void RetainCallee(MediaPlayer* obj) {} - void ReleaseCallee(MediaPlayer* obj) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(MediaPlayer); void MediaPlayer::EnqueueMediaURL(const GURL& url, Browser* creator) { if (handler_ == NULL) { diff --git a/chrome/browser/extensions/extension_error_reporter.cc b/chrome/browser/extensions/extension_error_reporter.cc index 92f854e..00ffb85 100644 --- a/chrome/browser/extensions/extension_error_reporter.cc +++ b/chrome/browser/extensions/extension_error_reporter.cc @@ -14,10 +14,7 @@ // No AddRef required when using ExtensionErrorReporter with RunnableMethod. // This is okay since the ExtensionErrorReporter is a singleton that lives until // the end of the process. -template <> struct RunnableMethodTraits<ExtensionErrorReporter> { - void RetainCallee(ExtensionErrorReporter*) {} - void ReleaseCallee(ExtensionErrorReporter*) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(ExtensionErrorReporter); ExtensionErrorReporter* ExtensionErrorReporter::instance_ = NULL; diff --git a/chrome/browser/gears_integration.cc b/chrome/browser/gears_integration.cc index e29f224..5cfad85 100644 --- a/chrome/browser/gears_integration.cc +++ b/chrome/browser/gears_integration.cc @@ -228,11 +228,7 @@ class CreateShortcutCommand : public CPCommandInterface { // Allows InvokeLater without adding refcounting. The object is only deleted // when its last InvokeLater is run anyway. -template <> -struct RunnableMethodTraits<CreateShortcutCommand> { - void RetainCallee(CreateShortcutCommand* command) {} - void ReleaseCallee(CreateShortcutCommand* command) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(CreateShortcutCommand); void GearsCreateShortcut( const webkit_glue::WebApplicationInfo& app_info, diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index 1886cdc..be0cd0a 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -58,11 +58,7 @@ 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. -template <> -struct RunnableMethodTraits<history::HistoryTest> { - void RetainCallee(history::HistoryTest* obj) { } - void ReleaseCallee(history::HistoryTest* obj) { } -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(history::HistoryTest); namespace history { diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index 5dfd284..5fcdb3d 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -81,11 +81,7 @@ net::HostResolver* CreateGlobalHostResolver( // The IOThread object must outlive any tasks posted to the IO thread before the // Quit task. -template <> -struct RunnableMethodTraits<IOThread> { - void RetainCallee(IOThread* /* io_thread */) {} - void ReleaseCallee(IOThread* /* io_thread */) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(IOThread); IOThread::IOThread() : BrowserProcessSubThread(ChromeThread::IO), diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc index 754ddae..452e584 100644 --- a/chrome/browser/sync/engine/syncapi.cc +++ b/chrome/browser/sync/engine/syncapi.cc @@ -85,11 +85,7 @@ static const int kThreadExitTimeoutMsec = 60000; static const int kSSLPort = 443; // We manage the lifetime of sync_api::SyncManager::SyncInternal ourselves. -template <> -struct RunnableMethodTraits<sync_api::SyncManager::SyncInternal> { - void RetainCallee(sync_api::SyncManager::SyncInternal*) {} - void ReleaseCallee(sync_api::SyncManager::SyncInternal*) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(sync_api::SyncManager::SyncInternal); namespace sync_api { diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc index e1dc105..fce3da3 100644 --- a/chrome/browser/web_applications/web_app.cc +++ b/chrome/browser/web_applications/web_app.cc @@ -678,11 +678,7 @@ void UpdateShortcutWorker::DeleteMeOnUIThread() { #if defined(OS_WIN) // Allows UpdateShortcutWorker without adding refcounting. UpdateShortcutWorker // manages its own life time and will delete itself when it's done. -template <> -struct RunnableMethodTraits<UpdateShortcutWorker> { - void RetainCallee(UpdateShortcutWorker* worker) {} - void ReleaseCallee(UpdateShortcutWorker* worker) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(UpdateShortcutWorker); #endif // defined(OS_WIN) namespace web_app { diff --git a/chrome/common/net/fake_network_change_notifier_thread.cc b/chrome/common/net/fake_network_change_notifier_thread.cc index 6c22d48..b8059ab 100644 --- a/chrome/common/net/fake_network_change_notifier_thread.cc +++ b/chrome/common/net/fake_network_change_notifier_thread.cc @@ -11,12 +11,8 @@ // We manage the lifetime of // chrome_common_net::FakeNetworkChangeNotifierThread ourselves. -template <> -struct RunnableMethodTraits<chrome_common_net:: - FakeNetworkChangeNotifierThread> { - void RetainCallee(chrome_common_net::FakeNetworkChangeNotifierThread*) {} - void ReleaseCallee(chrome_common_net::FakeNetworkChangeNotifierThread*) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT( + chrome_common_net::FakeNetworkChangeNotifierThread); namespace chrome_common_net { diff --git a/chrome/common/net/fake_network_change_notifier_thread_unittest.cc b/chrome/common/net/fake_network_change_notifier_thread_unittest.cc index 3902888..25eb1ec9 100644 --- a/chrome/common/net/fake_network_change_notifier_thread_unittest.cc +++ b/chrome/common/net/fake_network_change_notifier_thread_unittest.cc @@ -16,11 +16,7 @@ class FlagToggler; } // namespace chrome_common_net // We manage the lifetime of chrome_common_net::FlagToggler ourselves. -template <> -struct RunnableMethodTraits<chrome_common_net::FlagToggler> { - void RetainCallee(chrome_common_net::FlagToggler*) {} - void ReleaseCallee(chrome_common_net::FlagToggler*) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(chrome_common_net::FlagToggler); namespace chrome_common_net { diff --git a/chrome/common/net/notifier/listener/mediator_thread_impl.cc b/chrome/common/net/notifier/listener/mediator_thread_impl.cc index ac88983..d15e2c8 100644 --- a/chrome/common/net/notifier/listener/mediator_thread_impl.cc +++ b/chrome/common/net/notifier/listener/mediator_thread_impl.cc @@ -23,11 +23,7 @@ #include "talk/xmpp/xmppclientsettings.h" // We manage the lifetime of notifier::MediatorThreadImpl ourselves. -template <> -struct RunnableMethodTraits<notifier::MediatorThreadImpl> { - void RetainCallee(notifier::MediatorThreadImpl*) {} - void ReleaseCallee(notifier::MediatorThreadImpl*) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(notifier::MediatorThreadImpl); namespace notifier { diff --git a/chrome/common/net/thread_blocker.cc b/chrome/common/net/thread_blocker.cc index 4ecce8a..2291d33 100644 --- a/chrome/common/net/thread_blocker.cc +++ b/chrome/common/net/thread_blocker.cc @@ -12,11 +12,7 @@ // Since a ThreadBlocker is outlived by its target thread, we don't // have to ref-count it. -template <> -struct RunnableMethodTraits<chrome_common_net::ThreadBlocker> { - void RetainCallee(chrome_common_net::ThreadBlocker*) {} - void ReleaseCallee(chrome_common_net::ThreadBlocker*) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(chrome_common_net::ThreadBlocker); namespace chrome_common_net { diff --git a/chrome/common/net/thread_blocker_unittest.cc b/chrome/common/net/thread_blocker_unittest.cc index 1f54482..7ce0668 100644 --- a/chrome/common/net/thread_blocker_unittest.cc +++ b/chrome/common/net/thread_blocker_unittest.cc @@ -18,11 +18,7 @@ class Flag; }; // namespace chrome_common_net // We manage the lifetime of chrome_common_net::Flag ourselves. -template <> -struct RunnableMethodTraits<chrome_common_net::Flag> { - void RetainCallee(chrome_common_net::Flag*) {} - void ReleaseCallee(chrome_common_net::Flag*) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(chrome_common_net::Flag); namespace chrome_common_net { diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index 1679758..880a645 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -195,10 +195,7 @@ ProxyFactory::ProxyCacheEntry::ProxyCacheEntry(const std::wstring& profile) thread->Start(); } -template <> struct RunnableMethodTraits<ProxyFactory> { - void RetainCallee(ProxyFactory* obj) {} - void ReleaseCallee(ProxyFactory* obj) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(ProxyFactory); ProxyFactory::ProxyFactory() : uma_send_interval_(0) { diff --git a/chrome_frame/chrome_frame_delegate.h b/chrome_frame/chrome_frame_delegate.h index 8ca11c7..0a98f84 100644 --- a/chrome_frame/chrome_frame_delegate.h +++ b/chrome_frame/chrome_frame_delegate.h @@ -54,11 +54,8 @@ class ChromeFrameDelegate { virtual ~ChromeFrameDelegate() {} }; -// Template specialization -template <> struct RunnableMethodTraits<ChromeFrameDelegate> { - void RetainCallee(ChromeFrameDelegate* obj) {} - void ReleaseCallee(ChromeFrameDelegate* obj) {} -}; +// Disable refcounting of ChromeFrameDelegate. +DISABLE_RUNNABLE_METHOD_REFCOUNT(ChromeFrameDelegate); extern UINT kAutomationServerReady; extern UINT kMessageFromChromeFrame; diff --git a/chrome_frame/test/automation_client_mock.cc b/chrome_frame/test/automation_client_mock.cc index 048a0c3..d8a4cca 100644 --- a/chrome_frame/test/automation_client_mock.cc +++ b/chrome_frame/test/automation_client_mock.cc @@ -15,20 +15,9 @@ using testing::_; using testing::CreateFunctor; using testing::Return; -template <> struct RunnableMethodTraits<ProxyFactory::LaunchDelegate> { - void RetainCallee(ProxyFactory::LaunchDelegate* obj) {} - void ReleaseCallee(ProxyFactory::LaunchDelegate* obj) {} -}; - -template <> struct RunnableMethodTraits<ChromeFrameAutomationClient> { - void RetainCallee(ChromeFrameAutomationClient* obj) {} - void ReleaseCallee(ChromeFrameAutomationClient* obj) {} -}; - -template <> struct RunnableMethodTraits<chrome_frame_test::TimedMsgLoop> { - void RetainCallee(chrome_frame_test::TimedMsgLoop* obj) {} - void ReleaseCallee(chrome_frame_test::TimedMsgLoop* obj) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(ProxyFactory::LaunchDelegate); +DISABLE_RUNNABLE_METHOD_REFCOUNT(ChromeFrameAutomationClient); +DISABLE_RUNNABLE_METHOD_REFCOUNT(chrome_frame_test::TimedMsgLoop); void MockProxyFactory::GetServerImpl(ChromeFrameAutomationProxy* pxy, void* proxy_id, diff --git a/chrome_frame/test/proxy_factory_mock.cc b/chrome_frame/test/proxy_factory_mock.cc index 2a587f4..8c3040e 100644 --- a/chrome_frame/test/proxy_factory_mock.cc +++ b/chrome_frame/test/proxy_factory_mock.cc @@ -10,10 +10,7 @@ using testing::CreateFunctor; using testing::_; -template <> struct RunnableMethodTraits<MockProxyFactory> { - void RetainCallee(MockProxyFactory* obj) {} - void ReleaseCallee(MockProxyFactory* obj) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(MockProxyFactory); TEST(ProxyFactoryTest, CreateDestroy) { ProxyFactory f; diff --git a/ipc/ipc_logging.cc b/ipc/ipc_logging.cc index ac96666..fb2f79b 100644 --- a/ipc/ipc_logging.cc +++ b/ipc/ipc_logging.cc @@ -32,11 +32,7 @@ using base::Time; // IPC::Logging is allocated as a singleton, so we don't need any kind of // special retention program. -template <> -struct RunnableMethodTraits<IPC::Logging> { - void RetainCallee(IPC::Logging*) {} - void ReleaseCallee(IPC::Logging*) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(IPC::Logging); namespace IPC { diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc index 6b0a882..cf1c810 100644 --- a/net/proxy/proxy_config_service_linux_unittest.cc +++ b/net/proxy/proxy_config_service_linux_unittest.cc @@ -316,11 +316,7 @@ class SynchConfigGetter { int get_config_result_; // Return value from GetProxyConfig(). }; -template <> -struct RunnableMethodTraits<SynchConfigGetter> { - void RetainCallee(SynchConfigGetter*) {} - void ReleaseCallee(SynchConfigGetter*) {} -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(SynchConfigGetter); namespace net { diff --git a/webkit/appcache/appcache_request_handler_unittest.cc b/webkit/appcache/appcache_request_handler_unittest.cc index 5dc5d729..85db41a 100644 --- a/webkit/appcache/appcache_request_handler_unittest.cc +++ b/webkit/appcache/appcache_request_handler_unittest.cc @@ -729,8 +729,4 @@ TEST_F(AppCacheRequestHandlerTest, WorkerRequest) { // AppCacheRequestHandlerTest is expected to always live longer than the // runnable methods. This lets us call NewRunnableMethod on its instances. -template<> -struct RunnableMethodTraits<appcache::AppCacheRequestHandlerTest> { - void RetainCallee(appcache::AppCacheRequestHandlerTest* obj) { } - void ReleaseCallee(appcache::AppCacheRequestHandlerTest* obj) { } -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheRequestHandlerTest); diff --git a/webkit/appcache/appcache_response_unittest.cc b/webkit/appcache/appcache_response_unittest.cc index c0a4eb5..52514ae 100644 --- a/webkit/appcache/appcache_response_unittest.cc +++ b/webkit/appcache/appcache_response_unittest.cc @@ -716,8 +716,4 @@ TEST_F(AppCacheResponseTest, DeleteWithIOPending) { // AppCacheResponseTest is expected to always live longer than the // runnable methods. This lets us call NewRunnableMethod on its instances. -template<> -struct RunnableMethodTraits<appcache::AppCacheResponseTest> { - void RetainCallee(appcache::AppCacheResponseTest* obj) { } - void ReleaseCallee(appcache::AppCacheResponseTest* obj) { } -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheResponseTest); diff --git a/webkit/appcache/appcache_storage_impl_unittest.cc b/webkit/appcache/appcache_storage_impl_unittest.cc index 304f50f..204f5e6 100644 --- a/webkit/appcache/appcache_storage_impl_unittest.cc +++ b/webkit/appcache/appcache_storage_impl_unittest.cc @@ -1060,8 +1060,4 @@ TEST_F(AppCacheStorageImplTest, FindMainResponseExclusionsInWorkingSet) { // AppCacheStorageImplTest is expected to always live longer than the // runnable methods. This lets us call NewRunnableMethod on its instances. -template<> -struct RunnableMethodTraits<appcache::AppCacheStorageImplTest> { - void RetainCallee(appcache::AppCacheStorageImplTest* obj) { } - void ReleaseCallee(appcache::AppCacheStorageImplTest* obj) { } -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheStorageImplTest); diff --git a/webkit/appcache/appcache_update_job_unittest.cc b/webkit/appcache/appcache_update_job_unittest.cc index 2936d70..665150a 100644 --- a/webkit/appcache/appcache_update_job_unittest.cc +++ b/webkit/appcache/appcache_update_job_unittest.cc @@ -3366,14 +3366,6 @@ TEST_F(AppCacheUpdateJobTest, MultipleHeadersRefetch) { // AppCacheUpdateJobTest is expected to always live longer than the // runnable methods. This lets us call NewRunnableMethod on its instances. -template<> -struct RunnableMethodTraits<appcache::AppCacheUpdateJobTest> { - void RetainCallee(appcache::AppCacheUpdateJobTest* obj) { } - void ReleaseCallee(appcache::AppCacheUpdateJobTest* obj) { } -}; -template<> -struct RunnableMethodTraits<appcache::AppCacheUpdateJobTest::MockAppCachePolicy> -{ - void RetainCallee(appcache::AppCacheUpdateJobTest::MockAppCachePolicy* o) { } - void ReleaseCallee(appcache::AppCacheUpdateJobTest::MockAppCachePolicy* o) { } -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheUpdateJobTest); +DISABLE_RUNNABLE_METHOD_REFCOUNT( + appcache::AppCacheUpdateJobTest::MockAppCachePolicy); diff --git a/webkit/appcache/appcache_url_request_job_unittest.cc b/webkit/appcache/appcache_url_request_job_unittest.cc index 330784d..c067fa6 100644 --- a/webkit/appcache/appcache_url_request_job_unittest.cc +++ b/webkit/appcache/appcache_url_request_job_unittest.cc @@ -744,8 +744,4 @@ TEST_F(AppCacheURLRequestJobTest, CancelRequestWithIOPending) { // AppCacheURLRequestJobTest is expected to always live longer than the // runnable methods. This lets us call NewRunnableMethod on its instances. -template<> -struct RunnableMethodTraits<appcache::AppCacheURLRequestJobTest> { - void RetainCallee(appcache::AppCacheURLRequestJobTest* obj) { } - void ReleaseCallee(appcache::AppCacheURLRequestJobTest* obj) { } -}; +DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheURLRequestJobTest); |