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

Unified Diff: content/browser/storage_partition_impl.cc

Issue 17518004: Move IndexedDB from WEBKIT_DEPRECATED to dedicated thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: IOS build fix 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
« no previous file with comments | « content/browser/indexed_db/indexed_db_unittest.cc ('k') | content/public/browser/indexed_db_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/storage_partition_impl.cc
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc
index e32fc72ff6d3e7c9d6f63d0698b8793c6dad9d51..ec838a293e4bdb63c6a15e53b9d2dd2714027b7f 100644
--- a/content/browser/storage_partition_impl.cc
+++ b/content/browser/storage_partition_impl.cc
@@ -4,7 +4,9 @@
#include "content/browser/storage_partition_impl.h"
+#include "base/sequenced_task_runner.h"
#include "base/strings/utf_string_conversions.h"
+#include "content/browser/browser_main_loop.h"
#include "content/browser/fileapi/browser_file_system_helper.h"
#include "content/browser/gpu/shader_disk_cache.h"
#include "content/public/browser/browser_context.h"
@@ -224,12 +226,19 @@ StoragePartitionImpl* StoragePartitionImpl::Create(
scoped_refptr<DOMStorageContextImpl> dom_storage_context =
new DOMStorageContextImpl(path, context->GetSpecialStoragePolicy());
+ // BrowserMainLoop may not be initialized in unit tests. Tests will
+ // need to inject their own task runner into the IndexedDBContext.
+ base::SequencedTaskRunner* idb_task_runner =
+ BrowserThread::CurrentlyOn(BrowserThread::UI) &&
+ BrowserMainLoop::GetInstance()
+ ? BrowserMainLoop::GetInstance()->indexed_db_thread()->
+ message_loop_proxy()
+ : NULL;
scoped_refptr<IndexedDBContextImpl> indexed_db_context =
new IndexedDBContextImpl(path,
context->GetSpecialStoragePolicy(),
quota_manager->proxy(),
- BrowserThread::GetMessageLoopProxyForThread(
- BrowserThread::WEBKIT_DEPRECATED).get());
+ idb_task_runner);
scoped_refptr<ChromeAppCacheService> appcache_service =
new ChromeAppCacheService(quota_manager->proxy());
« no previous file with comments | « content/browser/indexed_db/indexed_db_unittest.cc ('k') | content/public/browser/indexed_db_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698