summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-16 02:17:23 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-16 02:17:23 +0000
commitc56428f24b67efa6a2eff77a709b7b6489403617 (patch)
treeab1966b7a60fe6d97062480d501e16fcbc00837a /chrome_frame
parent6c23230f2e2b345a7fafb4caf814e07b8228cae7 (diff)
downloadchromium_src-c56428f24b67efa6a2eff77a709b7b6489403617.zip
chromium_src-c56428f24b67efa6a2eff77a709b7b6489403617.tar.gz
chromium_src-c56428f24b67efa6a2eff77a709b7b6489403617.tar.bz2
Add DISABLE_RUNNABLE_METHOD_REFCOUNT to make disabling refcounts in RunnableMethods easier.
BUG=none TEST=none Review URL: http://codereview.chromium.org/2830006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49887 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_frame_automation.cc5
-rw-r--r--chrome_frame/chrome_frame_delegate.h7
-rw-r--r--chrome_frame/test/automation_client_mock.cc17
-rw-r--r--chrome_frame/test/proxy_factory_mock.cc5
4 files changed, 7 insertions, 27 deletions
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;