summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsenorblanco@chromium.org <senorblanco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 19:21:41 +0000
committersenorblanco@chromium.org <senorblanco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 19:21:41 +0000
commit359e88bc6b5c70a789b0f5bea155954f0660a232 (patch)
tree8c2114ff268739901f213e2a052bb50e04da8272
parent27b51d38027a9927cdc8bc0c8d7eef1d1bcb7108 (diff)
downloadchromium_src-359e88bc6b5c70a789b0f5bea155954f0660a232.zip
chromium_src-359e88bc6b5c70a789b0f5bea155954f0660a232.tar.gz
chromium_src-359e88bc6b5c70a789b0f5bea155954f0660a232.tar.bz2
Reverting 27379, in hopes of fixing browser_tests.
TBR=darin Review URL: http://codereview.chromium.org/248021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27389 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/message_pump_glib_unittest.cc4
-rw-r--r--base/ref_counted.h4
-rw-r--r--base/task.h34
-rw-r--r--chrome/browser/browser_process_impl.cc4
-rw-r--r--chrome/browser/browsing_data_remover.cc15
-rw-r--r--chrome/browser/chrome_plugin_host.cc13
-rw-r--r--chrome/browser/chromeos/touchpad.cc13
-rw-r--r--chrome/browser/dom_ui/chrome_url_data_manager.h4
-rw-r--r--chrome/browser/gears_integration.cc26
-rw-r--r--chrome/browser/history/history_unittest.cc4
-rw-r--r--chrome/browser/printing/print_job.h11
-rw-r--r--chrome/browser/printing/print_job_unittest.cc10
-rw-r--r--chrome/browser/printing/print_job_worker.cc3
-rw-r--r--chrome/browser/printing/print_job_worker.h1
-rw-r--r--chrome/browser/printing/print_job_worker_owner.h6
-rw-r--r--chrome/browser/printing/printer_query.h10
-rw-r--r--chrome/browser/renderer_host/render_crash_handler_host_linux.cc4
-rw-r--r--chrome/browser/visitedlink_master.cc5
-rw-r--r--chrome/common/extensions/extension_error_reporter.cc4
-rw-r--r--chrome/test/in_process_browser_test.h1
-rw-r--r--chrome/test/interactive_ui/view_event_test_base.h1
-rw-r--r--chrome_frame/chrome_frame_automation.cc4
-rw-r--r--chrome_frame/chrome_frame_delegate.h7
-rw-r--r--chrome_frame/test/chrome_frame_unittests.cc24
-rw-r--r--ipc/ipc_logging.cc4
-rw-r--r--ipc/ipc_sync_channel_unittest.cc1
-rw-r--r--net/proxy/proxy_config_service_linux_unittest.cc11
27 files changed, 122 insertions, 106 deletions
diff --git a/base/message_pump_glib_unittest.cc b/base/message_pump_glib_unittest.cc
index e3a04e8..e0ad260 100644
--- a/base/message_pump_glib_unittest.cc
+++ b/base/message_pump_glib_unittest.cc
@@ -185,8 +185,8 @@ class MessagePumpGLibTest : public testing::Test {
// This lets us call NewRunnableMethod on EventInjector instances.
template<>
struct RunnableMethodTraits<EventInjector> {
- void RetainCallee(EventInjector* obj) { }
- void ReleaseCallee(EventInjector* obj) { }
+ static void RetainCallee(EventInjector* obj) { }
+ static void ReleaseCallee(EventInjector* obj) { }
};
TEST_F(MessagePumpGLibTest, TestQuit) {
diff --git a/base/ref_counted.h b/base/ref_counted.h
index 70536b9..097d16e 100644
--- a/base/ref_counted.h
+++ b/base/ref_counted.h
@@ -14,8 +14,6 @@ namespace subtle {
class RefCountedBase {
public:
- static bool ImplementsThreadSafeReferenceCounting() { return false; }
-
bool HasOneRef() const { return ref_count_ == 1; }
protected:
@@ -40,8 +38,6 @@ class RefCountedBase {
class RefCountedThreadSafeBase {
public:
- static bool ImplementsThreadSafeReferenceCounting() { return true; }
-
bool HasOneRef() const;
protected:
diff --git a/base/task.h b/base/task.h
index e9da8b3..c827681 100644
--- a/base/task.h
+++ b/base/task.h
@@ -205,33 +205,12 @@ class ReleaseTask : public CancelableTask {
template <class T>
struct RunnableMethodTraits {
- RunnableMethodTraits() {
-#ifndef NDEBUG
- origin_thread_id_ = 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_ != PlatformThread::CurrentId())
- DCHECK(T::ImplementsThreadSafeReferenceCounting());
-#endif
- }
-
- void RetainCallee(T* obj) {
+ static void RetainCallee(T* obj) {
obj->AddRef();
}
-
- void ReleaseCallee(T* obj) {
+ static void ReleaseCallee(T* obj) {
obj->Release();
}
-
- private:
-#ifndef NDEBUG
- PlatformThreadId origin_thread_id_;
-#endif
};
// RunnableMethod and RunnableFunction -----------------------------------------
@@ -261,13 +240,13 @@ struct RunnableMethodTraits {
// RunnableMethod and NewRunnableMethod implementation -------------------------
template <class T, class Method, class Params>
-class RunnableMethod : public CancelableTask {
+class RunnableMethod : public CancelableTask,
+ public RunnableMethodTraits<T> {
public:
RunnableMethod(T* obj, Method meth, const Params& params)
: obj_(obj), meth_(meth), params_(params) {
- traits_.RetainCallee(obj_);
+ RetainCallee(obj_);
}
-
~RunnableMethod() {
ReleaseCallee();
}
@@ -284,7 +263,7 @@ class RunnableMethod : public CancelableTask {
private:
void ReleaseCallee() {
if (obj_) {
- traits_.ReleaseCallee(obj_);
+ RunnableMethodTraits<T>::ReleaseCallee(obj_);
obj_ = NULL;
}
}
@@ -292,7 +271,6 @@ class RunnableMethod : public CancelableTask {
T* obj_;
Method meth_;
Params params_;
- RunnableMethodTraits<T> traits_;
};
template <class T, class Method>
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 918d970..f971e80 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -442,8 +442,8 @@ void BrowserProcessImpl::CreateGoogleURLTracker() {
// which don't do any management.
template <>
struct RunnableMethodTraits<BrowserProcessImpl> {
- void RetainCallee(BrowserProcessImpl*) {}
- void ReleaseCallee(BrowserProcessImpl*) {}
+ static void RetainCallee(BrowserProcessImpl*) {}
+ static void ReleaseCallee(BrowserProcessImpl*) {}
};
void BrowserProcessImpl::CheckForInspectorFiles() {
diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc
index 6d70cc9..96e1543 100644
--- a/chrome/browser/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data_remover.cc
@@ -22,13 +22,16 @@
#include "net/url_request/url_request_context.h"
#include "webkit/glue/password_form.h"
-// Done so that we can use PostTask on BrowsingDataRemovers and not have
+// Done so that we can use invokeLater on BrowsingDataRemovers and not have
// BrowsingDataRemover implement RefCounted.
-template <>
-struct RunnableMethodTraits<BrowsingDataRemover> {
- void RetainCallee(BrowsingDataRemover*) {}
- void ReleaseCallee(BrowsingDataRemover*) {}
-};
+template<>
+void RunnableMethodTraits<BrowsingDataRemover>::RetainCallee(
+ BrowsingDataRemover* remover) {
+}
+template<>
+void RunnableMethodTraits<BrowsingDataRemover>::ReleaseCallee(
+ BrowsingDataRemover* remover) {
+}
bool BrowsingDataRemover::removing_ = false;
diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc
index bfb5852..1b62b9a 100644
--- a/chrome/browser/chrome_plugin_host.cc
+++ b/chrome/browser/chrome_plugin_host.cc
@@ -367,11 +367,14 @@ 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*) {}
- void ReleaseCallee(ModelessHtmlDialogDelegate*) {}
-};
+template<>
+void RunnableMethodTraits<ModelessHtmlDialogDelegate>::RetainCallee(
+ ModelessHtmlDialogDelegate* remover) {
+}
+template<>
+void RunnableMethodTraits<ModelessHtmlDialogDelegate>::ReleaseCallee(
+ ModelessHtmlDialogDelegate* remover) {
+}
namespace {
diff --git a/chrome/browser/chromeos/touchpad.cc b/chrome/browser/chromeos/touchpad.cc
index e4c27b3..81a7eb4 100644
--- a/chrome/browser/chromeos/touchpad.cc
+++ b/chrome/browser/chromeos/touchpad.cc
@@ -19,11 +19,14 @@
// Allows InvokeLater without adding refcounting. The object is only deleted
// when its last InvokeLater is run anyway.
-template <>
-struct RunnableMethodTraits<Touchpad> {
- void RetainCallee(Touchpad*) {}
- void ReleaseCallee(Touchpad*) {}
-};
+template<>
+void RunnableMethodTraits<Touchpad>::RetainCallee(
+ Touchpad* remover) {
+}
+template<>
+void RunnableMethodTraits<Touchpad>::ReleaseCallee(
+ Touchpad* remover) {
+}
// static
void Touchpad::RegisterUserPrefs(PrefService* prefs) {
diff --git a/chrome/browser/dom_ui/chrome_url_data_manager.h b/chrome/browser/dom_ui/chrome_url_data_manager.h
index 80fc862..81f220c 100644
--- a/chrome/browser/dom_ui/chrome_url_data_manager.h
+++ b/chrome/browser/dom_ui/chrome_url_data_manager.h
@@ -153,8 +153,8 @@ private:
// 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*) {}
- void ReleaseCallee(ChromeURLDataManager*) {}
+ static void RetainCallee(ChromeURLDataManager*) {}
+ static void ReleaseCallee(ChromeURLDataManager*) {}
};
// The single global instance of ChromeURLDataManager.
diff --git a/chrome/browser/gears_integration.cc b/chrome/browser/gears_integration.cc
index d7cf898..6805175 100644
--- a/chrome/browser/gears_integration.cc
+++ b/chrome/browser/gears_integration.cc
@@ -225,11 +225,14 @@ 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*) {}
- void ReleaseCallee(CreateShortcutCommand*) {}
-};
+template<>
+void RunnableMethodTraits<CreateShortcutCommand>::RetainCallee(
+ CreateShortcutCommand* remover) {
+}
+template<>
+void RunnableMethodTraits<CreateShortcutCommand>::ReleaseCallee(
+ CreateShortcutCommand* remover) {
+}
void GearsCreateShortcut(
const webkit_glue::WebApplicationInfo& app_info,
@@ -296,11 +299,14 @@ class QueryShortcutsCommand : public CPCommandInterface {
// Allows InvokeLater without adding refcounting. The object is only deleted
// when its last InvokeLater is run anyway.
-template <>
-struct RunnableMethodTraits<QueryShortcutsCommand> {
- void RetainCallee(QueryShortcutsCommand*) {}
- void ReleaseCallee(QueryShortcutsCommand*) {}
-};
+template<>
+void RunnableMethodTraits<QueryShortcutsCommand>::RetainCallee(
+ QueryShortcutsCommand* remover) {
+}
+template<>
+void RunnableMethodTraits<QueryShortcutsCommand>::ReleaseCallee(
+ QueryShortcutsCommand* remover) {
+}
void GearsQueryShortcuts(GearsQueryShortcutsCallback* callback) {
CPHandleCommand(GEARSPLUGINCOMMAND_GET_SHORTCUT_LIST,
diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc
index f26aa9d..23463440 100644
--- a/chrome/browser/history/history_unittest.cc
+++ b/chrome/browser/history/history_unittest.cc
@@ -57,8 +57,8 @@ class HistoryTest;
// the HistoryTest object.
template <>
struct RunnableMethodTraits<history::HistoryTest> {
- void RetainCallee(history::HistoryTest* obj) { }
- void ReleaseCallee(history::HistoryTest* obj) { }
+ static void RetainCallee(history::HistoryTest* obj) { }
+ static void ReleaseCallee(history::HistoryTest* obj) { }
};
namespace history {
diff --git a/chrome/browser/printing/print_job.h b/chrome/browser/printing/print_job.h
index cf4badc..45d5d12 100644
--- a/chrome/browser/printing/print_job.h
+++ b/chrome/browser/printing/print_job.h
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/gfx/native_widget_types.h"
#include "base/message_loop.h"
+#include "base/ref_counted.h"
#include "chrome/browser/printing/print_job_worker_owner.h"
#include "chrome/common/notification_registrar.h"
@@ -31,8 +32,9 @@ class PrinterQuery;
// any state change. While printing, the PrintJobManager instance keeps a
// reference to the job to be sure it is kept alive. All the code in this class
// runs in the UI thread.
-class PrintJob : public PrintJobWorkerOwner,
+class PrintJob : public base::RefCountedThreadSafe<PrintJob>,
public NotificationObserver,
+ public PrintJobWorkerOwner,
public MessageLoop::DestructionObserver {
public:
// Create a empty PrintJob. When initializing with this constructor,
@@ -50,6 +52,13 @@ class PrintJob : public PrintJobWorkerOwner,
const NotificationDetails& details);
// PrintJobWorkerOwner
+ virtual void AddRef() {
+ return base::RefCountedThreadSafe<PrintJob>::AddRef();
+ }
+ virtual void Release() {
+ return base::RefCountedThreadSafe<PrintJob>::Release();
+ }
+
virtual void GetSettingsDone(const PrintSettings& new_settings,
PrintingContext::Result result);
virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner);
diff --git a/chrome/browser/printing/print_job_unittest.cc b/chrome/browser/printing/print_job_unittest.cc
index 3ef795c..fe98964 100644
--- a/chrome/browser/printing/print_job_unittest.cc
+++ b/chrome/browser/printing/print_job_unittest.cc
@@ -33,6 +33,12 @@ class TestPrintJobWorker : public printing::PrintJobWorker {
class TestOwner : public printing::PrintJobWorkerOwner {
public:
+ virtual void AddRef() {
+ EXPECT_FALSE(true);
+ }
+ virtual void Release() {
+ EXPECT_FALSE(true);
+ }
virtual void GetSettingsDone(const printing::PrintSettings& new_settings,
printing::PrintingContext::Result result) {
EXPECT_FALSE(true);
@@ -98,9 +104,9 @@ TEST(PrintJobTest, SimplePrint) {
volatile bool check = false;
scoped_refptr<printing::PrintJob> job(new TestPrintJob(&check));
EXPECT_EQ(MessageLoop::current(), job->message_loop());
- scoped_refptr<TestOwner> owner(new TestOwner);
+ TestOwner owner;
TestSource source;
- job->Initialize(owner, &source);
+ job->Initialize(&owner, &source);
job->Stop();
job = NULL;
EXPECT_TRUE(check);
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index 375c2407..caf5ad3 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -275,6 +275,9 @@ void PrintJobWorker::OnFailure() {
} // namespace printing
+RunnableMethodTraits<printing::PrintJobWorker>::RunnableMethodTraits() {
+}
+
void RunnableMethodTraits<printing::PrintJobWorker>::RetainCallee(
printing::PrintJobWorker* obj) {
DCHECK(!owner_.get());
diff --git a/chrome/browser/printing/print_job_worker.h b/chrome/browser/printing/print_job_worker.h
index fce8912..9ad2c39 100644
--- a/chrome/browser/printing/print_job_worker.h
+++ b/chrome/browser/printing/print_job_worker.h
@@ -98,6 +98,7 @@ class PrintJobWorker : public base::Thread {
template <>
struct RunnableMethodTraits<printing::PrintJobWorker> {
+ RunnableMethodTraits();
void RetainCallee(printing::PrintJobWorker* obj);
void ReleaseCallee(printing::PrintJobWorker* obj);
private:
diff --git a/chrome/browser/printing/print_job_worker_owner.h b/chrome/browser/printing/print_job_worker_owner.h
index e1ba719..1810eca 100644
--- a/chrome/browser/printing/print_job_worker_owner.h
+++ b/chrome/browser/printing/print_job_worker_owner.h
@@ -5,7 +5,6 @@
#ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__
#define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__
-#include "base/ref_counted.h"
#include "printing/printing_context.h"
class MessageLoop;
@@ -15,11 +14,12 @@ namespace printing {
class PrintJobWorker;
class PrintSettings;
-class PrintJobWorkerOwner :
- public base::RefCountedThreadSafe<PrintJobWorkerOwner> {
+class PrintJobWorkerOwner {
public:
virtual ~PrintJobWorkerOwner() {
}
+ virtual void AddRef() = 0;
+ virtual void Release() = 0;
// Finishes the initialization began by PrintJobWorker::Init(). Creates a
// new PrintedDocument if necessary. Solely meant to be called by
diff --git a/chrome/browser/printing/printer_query.h b/chrome/browser/printing/printer_query.h
index b0502c8..6d6fd88 100644
--- a/chrome/browser/printing/printer_query.h
+++ b/chrome/browser/printing/printer_query.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_
#include "base/scoped_ptr.h"
+#include "base/ref_counted.h"
#include "chrome/browser/printing/print_job_worker_owner.h"
class CancelableTask;
@@ -20,7 +21,8 @@ namespace printing {
class PrintJobWorker;
// Query the printer for settings.
-class PrinterQuery : public PrintJobWorkerOwner {
+class PrinterQuery : public base::RefCountedThreadSafe<PrinterQuery>,
+ public PrintJobWorkerOwner {
public:
// GetSettings() UI parameter.
enum GetSettingsAskParam {
@@ -32,6 +34,12 @@ class PrinterQuery : public PrintJobWorkerOwner {
virtual ~PrinterQuery();
// PrintJobWorkerOwner
+ virtual void AddRef() {
+ return base::RefCountedThreadSafe<PrinterQuery>::AddRef();
+ }
+ virtual void Release() {
+ return base::RefCountedThreadSafe<PrinterQuery>::Release();
+ }
virtual void GetSettingsDone(const PrintSettings& new_settings,
PrintingContext::Result result);
virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner);
diff --git a/chrome/browser/renderer_host/render_crash_handler_host_linux.cc b/chrome/browser/renderer_host/render_crash_handler_host_linux.cc
index 805e231..4e9fdf9 100644
--- a/chrome/browser/renderer_host/render_crash_handler_host_linux.cc
+++ b/chrome/browser/renderer_host/render_crash_handler_host_linux.cc
@@ -151,8 +151,8 @@ static bool FindProcessHoldingSocket(pid_t* pid_out, uint64_t socket_inode) {
// end of the processes lifetime, which is greater in span then the lifetime of
// the IO message loop.
template<> struct RunnableMethodTraits<RenderCrashHandlerHostLinux> {
- void RetainCallee(RenderCrashHandlerHostLinux*) { }
- void ReleaseCallee(RenderCrashHandlerHostLinux*) { }
+ static void RetainCallee(RenderCrashHandlerHostLinux*) { }
+ static void ReleaseCallee(RenderCrashHandlerHostLinux*) { }
};
RenderCrashHandlerHostLinux::RenderCrashHandlerHostLinux()
diff --git a/chrome/browser/visitedlink_master.cc b/chrome/browser/visitedlink_master.cc
index 6bd06bb..0e1ac9c 100644
--- a/chrome/browser/visitedlink_master.cc
+++ b/chrome/browser/visitedlink_master.cc
@@ -165,9 +165,8 @@ class AsyncCloseHandle : public Task {
// Sometimes, the master will be deleted before the rebuild is complete, in
// which case it notifies the builder via DisownMaster(). The builder will
// delete itself once rebuilding is complete, and not execute any callback.
-class VisitedLinkMaster::TableBuilder :
- public HistoryService::URLEnumerator,
- public base::RefCountedThreadSafe<TableBuilder> {
+class VisitedLinkMaster::TableBuilder : public HistoryService::URLEnumerator,
+ public base::RefCounted<TableBuilder> {
public:
TableBuilder(VisitedLinkMaster* master,
const uint8 salt[LINK_SALT_LENGTH]);
diff --git a/chrome/common/extensions/extension_error_reporter.cc b/chrome/common/extensions/extension_error_reporter.cc
index 493b1a3..f6f0917 100644
--- a/chrome/common/extensions/extension_error_reporter.cc
+++ b/chrome/common/extensions/extension_error_reporter.cc
@@ -21,8 +21,8 @@
// 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*) {}
+ static void RetainCallee(ExtensionErrorReporter*) {}
+ static void ReleaseCallee(ExtensionErrorReporter*) {}
};
ExtensionErrorReporter* ExtensionErrorReporter::instance_ = NULL;
diff --git a/chrome/test/in_process_browser_test.h b/chrome/test/in_process_browser_test.h
index ace6e07..2f519b7 100644
--- a/chrome/test/in_process_browser_test.h
+++ b/chrome/test/in_process_browser_test.h
@@ -45,7 +45,6 @@ class InProcessBrowserTest : public testing::Test {
// We do this so we can be used in a Task.
void AddRef() {}
void Release() {}
- static bool ImplementsThreadSafeReferenceCounting() { return false; }
// Configures everything for an in process browser test, then invokes
// BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop.
diff --git a/chrome/test/interactive_ui/view_event_test_base.h b/chrome/test/interactive_ui/view_event_test_base.h
index 456cefc..1bb7bd0 100644
--- a/chrome/test/interactive_ui/view_event_test_base.h
+++ b/chrome/test/interactive_ui/view_event_test_base.h
@@ -79,7 +79,6 @@ class ViewEventTestBase : public views::WindowDelegate,
// Overriden to do nothing so that this class can be used in runnable tasks.
void AddRef() {}
void Release() {}
- static bool ImplementsThreadSafeReferenceCounting() { return false; }
protected:
// Returns the view that is added to the window.
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index 1f369b5..79c0c38 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -144,8 +144,8 @@ ProxyFactory::ProxyCacheEntry::ProxyCacheEntry(const std::wstring& profile)
}
template <> struct RunnableMethodTraits<ProxyFactory> {
- void RetainCallee(ProxyFactory* obj) {}
- void ReleaseCallee(ProxyFactory* obj) {}
+ static void RetainCallee(ProxyFactory* obj) {}
+ static void ReleaseCallee(ProxyFactory* obj) {}
};
ProxyFactory::ProxyFactory()
diff --git a/chrome_frame/chrome_frame_delegate.h b/chrome_frame/chrome_frame_delegate.h
index ebde626..a3302da 100644
--- a/chrome_frame/chrome_frame_delegate.h
+++ b/chrome_frame/chrome_frame_delegate.h
@@ -37,8 +37,11 @@ class ChromeFrameDelegate {
// Template specialization
template <> struct RunnableMethodTraits<ChromeFrameDelegate> {
- void RetainCallee(ChromeFrameDelegate* obj) {}
- void ReleaseCallee(ChromeFrameDelegate* obj) {}
+ static void RetainCallee(ChromeFrameDelegate* obj) {
+ }
+
+ static void ReleaseCallee(ChromeFrameDelegate* obj) {
+ }
};
extern UINT kAutomationServerReady;
diff --git a/chrome_frame/test/chrome_frame_unittests.cc b/chrome_frame/test/chrome_frame_unittests.cc
index d24f5b3..20826b1 100644
--- a/chrome_frame/test/chrome_frame_unittests.cc
+++ b/chrome_frame/test/chrome_frame_unittests.cc
@@ -34,7 +34,7 @@ const wchar_t kDocRoot[] = L"chrome_frame\\test\\data";
const int kLongWaitTimeout = 60 * 1000;
const int kShortWaitTimeout = 25 * 1000;
-_ATL_FUNC_INFO WebBrowserEventSink::kNavigateErrorInfo = {
+_ATL_FUNC_INFO WebBrowserEventSink::kNavigateErrorInfo = {
CC_STDCALL, VT_EMPTY, 5, {
VT_DISPATCH,
VT_VARIANT | VT_BYREF,
@@ -51,7 +51,7 @@ _ATL_FUNC_INFO WebBrowserEventSink::kNavigateComplete2Info = {
}
};
-_ATL_FUNC_INFO WebBrowserEventSink::kBeforeNavigate2Info = {
+_ATL_FUNC_INFO WebBrowserEventSink::kBeforeNavigate2Info = {
CC_STDCALL, VT_EMPTY, 7, {
VT_DISPATCH,
VT_VARIANT | VT_BYREF,
@@ -797,7 +797,7 @@ class ChromeFrameTestEnvironment: public testing::Environment {
public:
~ChromeFrameTestEnvironment() {
}
-
+
void SetUp() {
ScopedChromeFrameRegistrar::RegisterDefaults();
}
@@ -806,7 +806,7 @@ class ChromeFrameTestEnvironment: public testing::Environment {
}
};
-::testing::Environment* const chrome_frame_env =
+::testing::Environment* const chrome_frame_env =
::testing::AddGlobalTestEnvironment(new ChromeFrameTestEnvironment);
// TODO(stoyan): - Move everything below in separate file(s).
@@ -988,18 +988,18 @@ struct MockAutomationMessageSender : public AutomationMessageSender {
};
template <> struct RunnableMethodTraits<ProxyFactory::LaunchDelegate> {
- void RetainCallee(ProxyFactory::LaunchDelegate* obj) {}
- void ReleaseCallee(ProxyFactory::LaunchDelegate* obj) {}
+ static void RetainCallee(ProxyFactory::LaunchDelegate* obj) {}
+ static void ReleaseCallee(ProxyFactory::LaunchDelegate* obj) {}
};
template <> struct RunnableMethodTraits<MockProxyFactory> {
- void RetainCallee(MockProxyFactory* obj) {}
- void ReleaseCallee(MockProxyFactory* obj) {}
+ static void RetainCallee(MockProxyFactory* obj) {}
+ static void ReleaseCallee(MockProxyFactory* obj) {}
};
template <> struct RunnableMethodTraits<ChromeFrameAutomationClient> {
- void RetainCallee(ChromeFrameAutomationClient* obj) {}
- void ReleaseCallee(ChromeFrameAutomationClient* obj) {}
+ static void RetainCallee(ChromeFrameAutomationClient* obj) {}
+ static void ReleaseCallee(ChromeFrameAutomationClient* obj) {}
};
// MessageLoopForUI wrapper that runs only for a limited time.
@@ -1019,8 +1019,8 @@ struct TimedMsgLoop {
};
template <> struct RunnableMethodTraits<TimedMsgLoop> {
- void RetainCallee(TimedMsgLoop* obj) {}
- void ReleaseCallee(TimedMsgLoop* obj) {}
+ static void RetainCallee(TimedMsgLoop* obj) {}
+ static void ReleaseCallee(TimedMsgLoop* obj) {}
};
// Saves typing. It's somewhat hard to create a wrapper around
diff --git a/ipc/ipc_logging.cc b/ipc/ipc_logging.cc
index e1684d7..9d4f4bb 100644
--- a/ipc/ipc_logging.cc
+++ b/ipc/ipc_logging.cc
@@ -36,8 +36,8 @@ using base::Time;
// special retention program.
template <>
struct RunnableMethodTraits<IPC::Logging> {
- void RetainCallee(IPC::Logging*) {}
- void ReleaseCallee(IPC::Logging*) {}
+ static void RetainCallee(IPC::Logging*) {}
+ static void ReleaseCallee(IPC::Logging*) {}
};
namespace IPC {
diff --git a/ipc/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc
index f6bf10e..f20f788 100644
--- a/ipc/ipc_sync_channel_unittest.cc
+++ b/ipc/ipc_sync_channel_unittest.cc
@@ -66,7 +66,6 @@ class Worker : public Channel::Listener, public Message::Sender {
}
void AddRef() { }
void Release() { }
- static bool ImplementsThreadSafeReferenceCounting() { return true; }
bool Send(Message* msg) { return channel_->Send(msg); }
bool SendWithTimeout(Message* msg, int timeout_ms) {
return channel_->SendWithTimeout(msg, timeout_ms);
diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc
index 26149e5..761b20a 100644
--- a/net/proxy/proxy_config_service_linux_unittest.cc
+++ b/net/proxy/proxy_config_service_linux_unittest.cc
@@ -309,11 +309,12 @@ class SynchConfigGetter {
int get_config_result_; // Return value from GetProxyConfig().
};
-template <>
-struct RunnableMethodTraits<SynchConfigGetter> {
- void RetainCallee(SynchConfigGetter*) {}
- void ReleaseCallee(SynchConfigGetter*) {}
-};
+template<>
+void RunnableMethodTraits<SynchConfigGetter>::RetainCallee(
+ SynchConfigGetter* remover) {}
+template<>
+void RunnableMethodTraits<SynchConfigGetter>::ReleaseCallee(
+ SynchConfigGetter* remover) {}
namespace net {