Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(521)

Unified Diff: content/browser/dom_storage/dom_storage_context_wrapper.cc

Issue 2788813002: Try to flush DOMStorage too when ending the browsing session.
Patch Set: fixes Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_wrapper.h ('k') | content/browser/storage_partition_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/dom_storage/dom_storage_context_wrapper.cc
diff --git a/content/browser/dom_storage/dom_storage_context_wrapper.cc b/content/browser/dom_storage/dom_storage_context_wrapper.cc
index be4ffb4c0b619f129745bb2b14a1d742ccb5f950..05541ae950535bf55fc1f9b421db287a0e20165d 100644
--- a/content/browser/dom_storage/dom_storage_context_wrapper.cc
+++ b/content/browser/dom_storage/dom_storage_context_wrapper.cc
@@ -248,13 +248,22 @@ void DOMStorageContextWrapper::Shutdown() {
}
-void DOMStorageContextWrapper::Flush() {
+std::vector<scoped_refptr<base::SequencedTaskRunner>>
+DOMStorageContextWrapper::Flush() {
DCHECK(context_.get());
+ std::vector<scoped_refptr<base::SequencedTaskRunner>> flush_runners;
+ if (mojo_state_) {
+ mojo_state_->Flush();
+ // TODO(michaeln): Add mojo impl task runners to flush_runners
Marijn Kruisselbrink 2017/04/12 21:55:58 I'm a bit confused about the implied semantics of
+ }
context_->task_runner()->PostShutdownBlockingTask(
FROM_HERE, DOMStorageTaskRunner::PRIMARY_SEQUENCE,
base::Bind(&DOMStorageContextImpl::Flush, context_));
- if (mojo_state_)
- mojo_state_->Flush();
+ flush_runners.push_back(context_->task_runner()->GetSequencedTaskRunner(
+ DOMStorageTaskRunner::PRIMARY_SEQUENCE));
+ flush_runners.push_back(context_->task_runner()->GetSequencedTaskRunner(
+ DOMStorageTaskRunner::COMMIT_SEQUENCE));
+ return flush_runners;
}
void DOMStorageContextWrapper::OpenLocalStorage(
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_wrapper.h ('k') | content/browser/storage_partition_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698