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

Unified Diff: content/browser/browser_context.cc

Issue 17518004: Move IndexedDB from WEBKIT_DEPRECATED to dedicated thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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
Index: content/browser/browser_context.cc
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 62037b58a36f55f9a0b9949ec13ab11a5087a047..d02aa7244b45fb8ebf0d8f1462a6a98ec33d15a8 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -82,7 +82,7 @@ void SaveSessionStateOnIOThread(
appcache_service->set_force_keep_session_state();
}
-void SaveSessionStateOnWebkitThread(
+void SaveSessionStateOnIndexedDBThread(
scoped_refptr<IndexedDBContextImpl> indexed_db_context) {
indexed_db_context->SetForceKeepSessionState();
}
@@ -238,13 +238,15 @@ void BrowserContext::SaveSessionState(BrowserContext* browser_context) {
storage_partition->GetDOMStorageContext());
dom_storage_context_impl->SetForceKeepSessionState();
- if (BrowserThread::IsMessageLoopValid(BrowserThread::WEBKIT_DEPRECATED)) {
- IndexedDBContextImpl* indexed_db = static_cast<IndexedDBContextImpl*>(
+ IndexedDBContextImpl* indexed_db_context_impl =
+ static_cast<IndexedDBContextImpl*>(
storage_partition->GetIndexedDBContext());
- BrowserThread::PostTask(
- BrowserThread::WEBKIT_DEPRECATED, FROM_HERE,
- base::Bind(&SaveSessionStateOnWebkitThread,
- make_scoped_refptr(indexed_db)));
+ // No task runner in unit tests.
jam 2013/06/21 19:41:59 same question as before, i thought the tests set t
+ if (indexed_db_context_impl->TaskRunner()) {
+ indexed_db_context_impl->TaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&SaveSessionStateOnIndexedDBThread,
+ make_scoped_refptr(indexed_db_context_impl)));
}
}

Powered by Google App Engine
This is Rietveld 408576698