summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 22:19:24 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 22:19:24 +0000
commit00ed48fe2d42c952a3d41c83ed26a130342521aa (patch)
tree80e7d1b3f210725306d505c21a989c963e902f0a /chrome/browser
parent8c7697346f2632d3356e9d57b8f105e9cfa26747 (diff)
downloadchromium_src-00ed48fe2d42c952a3d41c83ed26a130342521aa.zip
chromium_src-00ed48fe2d42c952a3d41c83ed26a130342521aa.tar.gz
chromium_src-00ed48fe2d42c952a3d41c83ed26a130342521aa.tar.bz2
Revert "Revert "Const-ify RefCountedThreadSafe::AddRef and Release.""
chrome_frame failed to compile last time. I needed to add a "mutable" to a member variable in chrome_frame/metrics_service.cc. Review URL: http://codereview.chromium.org/3971004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63574 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_thread.h6
-rw-r--r--chrome/browser/browser_thread_unittest.cc6
-rw-r--r--chrome/browser/chrome_plugin_unittest.cc2
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc2
-rw-r--r--chrome/browser/net/chrome_url_request_context.h2
-rw-r--r--chrome/browser/renderer_host/pepper_file_message_filter.cc2
-rw-r--r--chrome/browser/renderer_host/pepper_file_message_filter.h2
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc2
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h2
-rw-r--r--chrome/browser/sync/glue/http_bridge.cc2
-rw-r--r--chrome/browser/sync/glue/http_bridge.h2
-rw-r--r--chrome/browser/sync/glue/http_bridge_unittest.cc2
12 files changed, 17 insertions, 15 deletions
diff --git a/chrome/browser/browser_thread.h b/chrome/browser/browser_thread.h
index c034851..f6a022e 100644
--- a/chrome/browser/browser_thread.h
+++ b/chrome/browser/browser_thread.h
@@ -109,7 +109,7 @@ class BrowserThread : public base::Thread {
template <class T>
static bool DeleteSoon(ID identifier,
const tracked_objects::Location& from_here,
- T* object) {
+ const T* object) {
return PostNonNestableTask(
identifier, from_here, new DeleteTask<T>(object));
}
@@ -117,7 +117,7 @@ class BrowserThread : public base::Thread {
template <class T>
static bool ReleaseSoon(ID identifier,
const tracked_objects::Location& from_here,
- T* object) {
+ const T* object) {
return PostNonNestableTask(
identifier, from_here, new ReleaseTask<T>(object));
}
@@ -154,7 +154,7 @@ class BrowserThread : public base::Thread {
template<ID thread>
struct DeleteOnThread {
template<typename T>
- static void Destruct(T* x) {
+ static void Destruct(const T* x) {
if (CurrentlyOn(thread)) {
delete x;
} else {
diff --git a/chrome/browser/browser_thread_unittest.cc b/chrome/browser/browser_thread_unittest.cc
index d2c19d8..948709a 100644
--- a/chrome/browser/browser_thread_unittest.cc
+++ b/chrome/browser/browser_thread_unittest.cc
@@ -11,7 +11,7 @@
class BrowserThreadTest : public testing::Test {
public:
- void Release() {
+ void Release() const {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask);
}
@@ -77,7 +77,9 @@ class BrowserThreadTest : public testing::Test {
private:
scoped_ptr<BrowserThread> ui_thread_;
scoped_ptr<BrowserThread> file_thread_;
- MessageLoop loop_;
+ // It's kind of ugly to make this mutable - solely so we can post the Quit
+ // Task from Release(). This should be fixed.
+ mutable MessageLoop loop_;
};
TEST_F(BrowserThreadTest, PostTask) {
diff --git a/chrome/browser/chrome_plugin_unittest.cc b/chrome/browser/chrome_plugin_unittest.cc
index 38b4bd5..a7eee5b 100644
--- a/chrome/browser/chrome_plugin_unittest.cc
+++ b/chrome/browser/chrome_plugin_unittest.cc
@@ -33,7 +33,7 @@ class TestURLRequestContextGetter : public URLRequestContextGetter {
context_ = new TestURLRequestContext();
return context_;
}
- virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() {
+ virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const {
return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
}
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index e59e00e..0abe211 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -609,7 +609,7 @@ net::CookieStore* ChromeURLRequestContextGetter::GetCookieStore() {
}
scoped_refptr<base::MessageLoopProxy>
-ChromeURLRequestContextGetter::GetIOMessageLoopProxy() {
+ChromeURLRequestContextGetter::GetIOMessageLoopProxy() const {
return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
}
diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h
index a580282..43b1b21 100644
--- a/chrome/browser/net/chrome_url_request_context.h
+++ b/chrome/browser/net/chrome_url_request_context.h
@@ -240,7 +240,7 @@ class ChromeURLRequestContextGetter : public URLRequestContextGetter,
// URLRequestContextGetter implementation.
virtual URLRequestContext* GetURLRequestContext();
virtual net::CookieStore* GetCookieStore();
- virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy();
+ virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const;
// Convenience overload of GetURLRequestContext() that returns a
// ChromeURLRequestContext* rather than a URLRequestContext*.
diff --git a/chrome/browser/renderer_host/pepper_file_message_filter.cc b/chrome/browser/renderer_host/pepper_file_message_filter.cc
index e7b331b..cbd09af 100644
--- a/chrome/browser/renderer_host/pepper_file_message_filter.cc
+++ b/chrome/browser/renderer_host/pepper_file_message_filter.cc
@@ -104,7 +104,7 @@ void PepperFileMessageFilter::OnMessageReceivedFileThread(
}
}
-void PepperFileMessageFilter::OnDestruct() {
+void PepperFileMessageFilter::OnDestruct() const {
BrowserThread::DeleteOnIOThread::Destruct(this);
}
diff --git a/chrome/browser/renderer_host/pepper_file_message_filter.h b/chrome/browser/renderer_host/pepper_file_message_filter.h
index 37e57f6..003d258 100644
--- a/chrome/browser/renderer_host/pepper_file_message_filter.h
+++ b/chrome/browser/renderer_host/pepper_file_message_filter.h
@@ -37,7 +37,7 @@ class PepperFileMessageFilter : public IPC::ChannelProxy::MessageFilter {
virtual void OnChannelError();
virtual void OnChannelClosing();
virtual bool OnMessageReceived(const IPC::Message& message);
- virtual void OnDestruct();
+ virtual void OnDestruct() const;
// Called from the FILE thread.
void Send(IPC::Message* message);
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index a5f4f5e..5c853e9 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -524,7 +524,7 @@ bool ResourceMessageFilter::OnMessageReceived(const IPC::Message& msg) {
return handled;
}
-void ResourceMessageFilter::OnDestruct() {
+void ResourceMessageFilter::OnDestruct() const {
BrowserThread::DeleteOnIOThread::Destruct(this);
}
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index fa1932e..399a122 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -107,7 +107,7 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
virtual void OnChannelError();
virtual void OnChannelClosing();
virtual bool OnMessageReceived(const IPC::Message& message);
- virtual void OnDestruct();
+ virtual void OnDestruct() const;
// ResourceDispatcherHost::Receiver methods:
virtual bool Send(IPC::Message* message);
diff --git a/chrome/browser/sync/glue/http_bridge.cc b/chrome/browser/sync/glue/http_bridge.cc
index 3adaaf0..044cc75 100644
--- a/chrome/browser/sync/glue/http_bridge.cc
+++ b/chrome/browser/sync/glue/http_bridge.cc
@@ -44,7 +44,7 @@ URLRequestContext* HttpBridge::RequestContextGetter::GetURLRequestContext() {
}
scoped_refptr<base::MessageLoopProxy>
-HttpBridge::RequestContextGetter::GetIOMessageLoopProxy() {
+HttpBridge::RequestContextGetter::GetIOMessageLoopProxy() const {
return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
}
diff --git a/chrome/browser/sync/glue/http_bridge.h b/chrome/browser/sync/glue/http_bridge.h
index 1951ce5..5b9d4b2 100644
--- a/chrome/browser/sync/glue/http_bridge.h
+++ b/chrome/browser/sync/glue/http_bridge.h
@@ -85,7 +85,7 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>,
// URLRequestContextGetter implementation.
virtual URLRequestContext* GetURLRequestContext();
- virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy();
+ virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const;
private:
~RequestContextGetter() {}
diff --git a/chrome/browser/sync/glue/http_bridge_unittest.cc b/chrome/browser/sync/glue/http_bridge_unittest.cc
index dc4948d..eac7c32 100644
--- a/chrome/browser/sync/glue/http_bridge_unittest.cc
+++ b/chrome/browser/sync/glue/http_bridge_unittest.cc
@@ -26,7 +26,7 @@ class TestURLRequestContextGetter : public URLRequestContextGetter {
context_ = new TestURLRequestContext;
return context_;
}
- virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() {
+ virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const {
return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
}