summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-19 21:41:41 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-19 21:41:41 +0000
commitfc7b441f6e9541d111fadd050d0cbdb6ac761614 (patch)
treea6b746844dfeaca19926f5f423fcfacf998c9ae7
parentcb08ba2b4460e3d873cb4fec72ad5b34fe433ff7 (diff)
downloadchromium_src-fc7b441f6e9541d111fadd050d0cbdb6ac761614.zip
chromium_src-fc7b441f6e9541d111fadd050d0cbdb6ac761614.tar.gz
chromium_src-fc7b441f6e9541d111fadd050d0cbdb6ac761614.tar.bz2
base::Bind: Cleanups in in_process_webkit.
BUG=none TEST=none R=csilv@chromium.org Review URL: http://codereview.chromium.org/8357015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106385 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/in_process_webkit/dom_storage_context.cc7
-rw-r--r--content/browser/in_process_webkit/dom_storage_message_filter.cc8
-rw-r--r--content/browser/in_process_webkit/indexed_db_browsertest.cc7
-rw-r--r--content/browser/in_process_webkit/indexed_db_context.cc22
-rw-r--r--content/browser/in_process_webkit/indexed_db_dispatcher_host.cc3
-rw-r--r--content/browser/in_process_webkit/indexed_db_key_utility_client.cc26
-rw-r--r--content/browser/in_process_webkit/webkit_context.cc12
7 files changed, 39 insertions, 46 deletions
diff --git a/content/browser/in_process_webkit/dom_storage_context.cc b/content/browser/in_process_webkit/dom_storage_context.cc
index d86b089..80940bf 100644
--- a/content/browser/in_process_webkit/dom_storage_context.cc
+++ b/content/browser/in_process_webkit/dom_storage_context.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "base/bind.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/string_util.h"
@@ -91,9 +92,9 @@ int64 DOMStorageContext::CloneSessionStorage(int64 original_id) {
DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
int64 clone_id = AllocateSessionStorageNamespaceId();
BrowserThread::PostTask(
- BrowserThread::WEBKIT, FROM_HERE, NewRunnableFunction(
- &DOMStorageContext::CompleteCloningSessionStorage,
- this, original_id, clone_id));
+ BrowserThread::WEBKIT, FROM_HERE,
+ base::Bind(&DOMStorageContext::CompleteCloningSessionStorage, this,
+ original_id, clone_id));
return clone_id;
}
diff --git a/content/browser/in_process_webkit/dom_storage_message_filter.cc b/content/browser/in_process_webkit/dom_storage_message_filter.cc
index 61f20a9..fd65f89 100644
--- a/content/browser/in_process_webkit/dom_storage_message_filter.cc
+++ b/content/browser/in_process_webkit/dom_storage_message_filter.cc
@@ -4,6 +4,7 @@
#include "content/browser/in_process_webkit/dom_storage_message_filter.h"
+#include "base/bind.h"
#include "base/nullable_string16.h"
#include "content/browser/browser_thread.h"
#include "content/browser/in_process_webkit/dom_storage_area.h"
@@ -73,9 +74,10 @@ void DOMStorageMessageFilter::DispatchStorageEvent(const NullableString16& key,
: DOM_STORAGE_SESSION;
// The storage_event_message_filter is the DOMStorageMessageFilter that is up
// in the current call stack since it caused the storage event to fire.
- BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(storage_event_message_filter,
- &DOMStorageMessageFilter::OnStorageEvent, params));
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&DOMStorageMessageFilter::OnStorageEvent,
+ storage_event_message_filter, params));
}
bool DOMStorageMessageFilter::OnMessageReceived(const IPC::Message& message,
diff --git a/content/browser/in_process_webkit/indexed_db_browsertest.cc b/content/browser/in_process_webkit/indexed_db_browsertest.cc
index b112e30..1c57ae6 100644
--- a/content/browser/in_process_webkit/indexed_db_browsertest.cc
+++ b/content/browser/in_process_webkit/indexed_db_browsertest.cc
@@ -228,9 +228,10 @@ class IndexedDBBrowserTestWithLowQuota : public IndexedDBBrowserTest {
static void SetTempQuota(int64 bytes, scoped_refptr<QuotaManager> qm) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
- BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- NewRunnableFunction(&IndexedDBBrowserTestWithLowQuota::SetTempQuota,
- bytes, qm));
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&IndexedDBBrowserTestWithLowQuota::SetTempQuota, bytes,
+ qm));
return;
}
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
diff --git a/content/browser/in_process_webkit/indexed_db_context.cc b/content/browser/in_process_webkit/indexed_db_context.cc
index 59fc64a..5d7f0f5 100644
--- a/content/browser/in_process_webkit/indexed_db_context.cc
+++ b/content/browser/in_process_webkit/indexed_db_context.cc
@@ -124,11 +124,10 @@ IndexedDBContext::~IndexedDBContext() {
// No WEBKIT thread here means we are running in a unit test where no clean
// up is needed.
- BrowserThread::PostTask(BrowserThread::WEBKIT, FROM_HERE,
- NewRunnableFunction(&ClearLocalState,
- data_path_,
- clear_local_state_on_exit_,
- special_storage_policy_));
+ BrowserThread::PostTask(
+ BrowserThread::WEBKIT, FROM_HERE,
+ base::Bind(&ClearLocalState, data_path_, clear_local_state_on_exit_,
+ special_storage_policy_));
}
WebIDBFactory* IndexedDBContext::GetIDBFactory() {
@@ -294,11 +293,8 @@ void IndexedDBContext::GotUsageAndQuota(const GURL& origin_url,
}
BrowserThread::PostTask(
BrowserThread::WEBKIT, FROM_HERE,
- NewRunnableMethod(this,
- &IndexedDBContext::GotUpdatedQuota,
- origin_url,
- usage,
- quota));
+ base::Bind(&IndexedDBContext::GotUpdatedQuota, this, origin_url, usage,
+ quota));
}
void IndexedDBContext::GotUpdatedQuota(const GURL& origin_url, int64 usage,
@@ -311,9 +307,9 @@ void IndexedDBContext::QueryAvailableQuota(const GURL& origin_url) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
if (quota_manager_proxy())
- BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(this, &IndexedDBContext::QueryAvailableQuota,
- origin_url));
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&IndexedDBContext::QueryAvailableQuota, this, origin_url));
return;
}
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
index 990d3a3..b6f23c2 100644
--- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
+++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
@@ -4,6 +4,7 @@
#include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/utf_string_conversions.h"
#include "content/browser/browser_thread.h"
@@ -79,7 +80,7 @@ void IndexedDBDispatcherHost::OnChannelClosing() {
bool success = BrowserThread::PostTask(
BrowserThread::WEBKIT, FROM_HERE,
- NewRunnableMethod(this, &IndexedDBDispatcherHost::ResetDispatcherHosts));
+ base::Bind(&IndexedDBDispatcherHost::ResetDispatcherHosts, this));
if (!success)
ResetDispatcherHosts();
diff --git a/content/browser/in_process_webkit/indexed_db_key_utility_client.cc b/content/browser/in_process_webkit/indexed_db_key_utility_client.cc
index 9683385..b9ded5a 100644
--- a/content/browser/in_process_webkit/indexed_db_key_utility_client.cc
+++ b/content/browser/in_process_webkit/indexed_db_key_utility_client.cc
@@ -4,6 +4,7 @@
#include "content/browser/in_process_webkit/indexed_db_key_utility_client.h"
+#include "base/bind.h"
#include "base/lazy_instance.h"
#include "base/synchronization/waitable_event.h"
#include "content/browser/utility_process_host.h"
@@ -250,9 +251,7 @@ void KeyUtilityClientImpl::GetRDHAndStartUtilityProcess() {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(
- this,
- &KeyUtilityClientImpl::GetRDHAndStartUtilityProcess));
+ base::Bind(&KeyUtilityClientImpl::GetRDHAndStartUtilityProcess, this));
return;
}
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -265,9 +264,7 @@ void KeyUtilityClientImpl::StartUtilityProcessInternal() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(
- this,
- &KeyUtilityClientImpl::StartUtilityProcessInternal));
+ base::Bind(&KeyUtilityClientImpl::StartUtilityProcessInternal, this));
return;
}
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -285,9 +282,7 @@ void KeyUtilityClientImpl::EndUtilityProcessInternal() {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(
- this,
- &KeyUtilityClientImpl::EndUtilityProcessInternal));
+ base::Bind(&KeyUtilityClientImpl::EndUtilityProcessInternal, this));
return;
}
@@ -304,10 +299,9 @@ void KeyUtilityClientImpl::CallStartIDBKeyFromValueAndKeyPathFromIOThread(
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(this,
- &KeyUtilityClientImpl::
- CallStartIDBKeyFromValueAndKeyPathFromIOThread,
- values, key_path));
+ base::Bind(&KeyUtilityClientImpl::
+ CallStartIDBKeyFromValueAndKeyPathFromIOThread,
+ this, values, key_path));
return;
}
@@ -323,10 +317,8 @@ void KeyUtilityClientImpl::CallStartInjectIDBKeyFromIOThread(
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(this,
- &KeyUtilityClientImpl::
- CallStartInjectIDBKeyFromIOThread,
- key, value, key_path));
+ base::Bind(&KeyUtilityClientImpl::CallStartInjectIDBKeyFromIOThread,
+ this, key, value, key_path));
return;
}
diff --git a/content/browser/in_process_webkit/webkit_context.cc b/content/browser/in_process_webkit/webkit_context.cc
index 8fd9d11..37c4c54 100644
--- a/content/browser/in_process_webkit/webkit_context.cc
+++ b/content/browser/in_process_webkit/webkit_context.cc
@@ -4,6 +4,7 @@
#include "content/browser/in_process_webkit/webkit_context.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "content/browser/browser_thread.h"
@@ -47,7 +48,7 @@ void WebKitContext::PurgeMemory() {
if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) {
BrowserThread::PostTask(
BrowserThread::WEBKIT, FROM_HERE,
- NewRunnableMethod(this, &WebKitContext::PurgeMemory));
+ base::Bind(&WebKitContext::PurgeMemory, this));
return;
}
@@ -58,8 +59,7 @@ void WebKitContext::DeleteDataModifiedSince(const base::Time& cutoff) {
if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) {
BrowserThread::PostTask(
BrowserThread::WEBKIT, FROM_HERE,
- NewRunnableMethod(this, &WebKitContext::DeleteDataModifiedSince,
- cutoff));
+ base::Bind(&WebKitContext::DeleteDataModifiedSince, this, cutoff));
return;
}
@@ -70,7 +70,7 @@ void WebKitContext::DeleteSessionOnlyData() {
if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) {
BrowserThread::PostTask(
BrowserThread::WEBKIT, FROM_HERE,
- NewRunnableMethod(this, &WebKitContext::DeleteSessionOnlyData));
+ base::Bind(&WebKitContext::DeleteSessionOnlyData, this));
return;
}
@@ -82,8 +82,8 @@ void WebKitContext::DeleteSessionStorageNamespace(
if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) {
BrowserThread::PostTask(
BrowserThread::WEBKIT, FROM_HERE,
- NewRunnableMethod(this, &WebKitContext::DeleteSessionStorageNamespace,
- session_storage_namespace_id));
+ base::Bind(&WebKitContext::DeleteSessionStorageNamespace, this,
+ session_storage_namespace_id));
return;
}