diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-21 16:51:03 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-21 16:51:03 +0000 |
commit | 2eab6ef1a62e560b7e24dd903e4496d11b745d0a (patch) | |
tree | 99b4083a48172545c9ef35e87e9c020b5910f181 /content | |
parent | d9456cb582bd0cc38b68b30b9a12295bfadedaa3 (diff) | |
download | chromium_src-2eab6ef1a62e560b7e24dd903e4496d11b745d0a.zip chromium_src-2eab6ef1a62e560b7e24dd903e4496d11b745d0a.tar.gz chromium_src-2eab6ef1a62e560b7e24dd903e4496d11b745d0a.tar.bz2 |
DomStorage commit task sequencing. Use two workerpool task sequences (primary vs commit) instead of one to avoid DomStorage access queuing up behind commits.
* Initialization, shutdown, and administrative tasks are performed as shutdown-blocking primary sequence tasks.
* Methods that return values to the java-scriptable interface are performed as non-shutdown-blocking primary sequence tasks.
* Internal tasks related to committing changes to disk are performed as shutdown-blocking commit sequence tasks.
BUG=106763
Review URL: https://chromiumcodereview.appspot.com/9718029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127981 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/dom_storage/dom_storage_context_impl_new.cc | 28 | ||||
-rw-r--r-- | content/browser/dom_storage/dom_storage_message_filter_new.cc | 7 |
2 files changed, 24 insertions, 11 deletions
diff --git a/content/browser/dom_storage/dom_storage_context_impl_new.cc b/content/browser/dom_storage/dom_storage_context_impl_new.cc index dec97e0..105f8be 100644 --- a/content/browser/dom_storage/dom_storage_context_impl_new.cc +++ b/content/browser/dom_storage/dom_storage_context_impl_new.cc @@ -21,6 +21,7 @@ using content::BrowserThread; using content::DOMStorageContext; using dom_storage::DomStorageArea; using dom_storage::DomStorageContext; +using dom_storage::DomStorageTaskRunner; using dom_storage::DomStorageWorkerPoolTaskRunner; using webkit_database::DatabaseUtil; @@ -85,7 +86,8 @@ DOMStorageContextImpl::DOMStorageContextImpl( special_storage_policy, new DomStorageWorkerPoolTaskRunner( worker_pool, - worker_pool->GetNamedSequenceToken("dom_storage"), + worker_pool->GetNamedSequenceToken("dom_storage_primary"), + worker_pool->GetNamedSequenceToken("dom_storage_commit"), BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); } @@ -95,8 +97,9 @@ DOMStorageContextImpl::~DOMStorageContextImpl() { void DOMStorageContextImpl::GetAllStorageFiles( const GetAllStorageFilesCallback& callback) { DCHECK(context_); - context_->task_runner()->PostTask( + context_->task_runner()->PostShutdownBlockingTask( FROM_HERE, + DomStorageTaskRunner::PRIMARY_SEQUENCE, base::Bind(&GetAllStorageFilesHelper, base::MessageLoopProxy::current(), context_, callback)); @@ -109,54 +112,61 @@ FilePath DOMStorageContextImpl::GetFilePath(const string16& origin_id) const { void DOMStorageContextImpl::DeleteForOrigin(const string16& origin_id) { DCHECK(context_); - context_->task_runner()->PostTask( + context_->task_runner()->PostShutdownBlockingTask( FROM_HERE, + DomStorageTaskRunner::PRIMARY_SEQUENCE, base::Bind(&DomStorageContext::DeleteOrigin, context_, OriginIdToGURL(origin_id))); } void DOMStorageContextImpl::DeleteLocalStorageFile(const FilePath& file_path) { DCHECK(context_); - context_->task_runner()->PostTask( + context_->task_runner()->PostShutdownBlockingTask( FROM_HERE, + DomStorageTaskRunner::PRIMARY_SEQUENCE, base::Bind(&DomStorageContext::DeleteOrigin, context_, FilePathToOrigin(file_path))); } void DOMStorageContextImpl::DeleteDataModifiedSince(const base::Time& cutoff) { DCHECK(context_); - context_->task_runner()->PostTask( + context_->task_runner()->PostShutdownBlockingTask( FROM_HERE, + DomStorageTaskRunner::PRIMARY_SEQUENCE, base::Bind(&DomStorageContext::DeleteDataModifiedSince, context_, cutoff)); } void DOMStorageContextImpl::PurgeMemory() { DCHECK(context_); - context_->task_runner()->PostTask( + context_->task_runner()->PostShutdownBlockingTask( FROM_HERE, + DomStorageTaskRunner::PRIMARY_SEQUENCE, base::Bind(&DomStorageContext::PurgeMemory, context_)); } void DOMStorageContextImpl::SetClearLocalState(bool clear_local_state) { DCHECK(context_); - context_->task_runner()->PostTask( + context_->task_runner()->PostShutdownBlockingTask( FROM_HERE, + DomStorageTaskRunner::PRIMARY_SEQUENCE, base::Bind(&DomStorageContext::SetClearLocalState, context_, clear_local_state)); } void DOMStorageContextImpl::SaveSessionState() { DCHECK(context_); - context_->task_runner()->PostTask( + context_->task_runner()->PostShutdownBlockingTask( FROM_HERE, + DomStorageTaskRunner::PRIMARY_SEQUENCE, base::Bind(&DomStorageContext::SaveSessionState, context_)); } void DOMStorageContextImpl::Shutdown() { DCHECK(context_); - context_->task_runner()->PostTask( + context_->task_runner()->PostShutdownBlockingTask( FROM_HERE, + DomStorageTaskRunner::PRIMARY_SEQUENCE, base::Bind(&DomStorageContext::Shutdown, context_)); } diff --git a/content/browser/dom_storage/dom_storage_message_filter_new.cc b/content/browser/dom_storage/dom_storage_message_filter_new.cc index 2511cd4..511ac19 100644 --- a/content/browser/dom_storage/dom_storage_message_filter_new.cc +++ b/content/browser/dom_storage/dom_storage_message_filter_new.cc @@ -19,6 +19,7 @@ #include "webkit/dom_storage/dom_storage_task_runner.h" using content::BrowserThread; +using dom_storage::DomStorageTaskRunner; using WebKit::WebStorageArea; DOMStorageMessageFilter::DOMStorageMessageFilter( @@ -47,16 +48,18 @@ void DOMStorageMessageFilter::UninitializeInSequence() { void DOMStorageMessageFilter::OnFilterAdded(IPC::Channel* channel) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); BrowserMessageFilter::OnFilterAdded(channel); - context_->task_runner()->PostTask( + context_->task_runner()->PostShutdownBlockingTask( FROM_HERE, + DomStorageTaskRunner::PRIMARY_SEQUENCE, base::Bind(&DOMStorageMessageFilter::InitializeInSequence, this)); } void DOMStorageMessageFilter::OnFilterRemoved() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); BrowserMessageFilter::OnFilterRemoved(); - context_->task_runner()->PostTask( + context_->task_runner()->PostShutdownBlockingTask( FROM_HERE, + DomStorageTaskRunner::PRIMARY_SEQUENCE, base::Bind(&DOMStorageMessageFilter::UninitializeInSequence, this)); } |