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

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: 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/storage_partition_impl.cc
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc
index e32fc72ff6d3e7c9d6f63d0698b8793c6dad9d51..443a59f77cc7ebf644f6e4a3a9f8c6e8dcce3452 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) &&
jam 2013/06/21 19:41:59 what is the point of the "BrowserThread::Currently
jsbell 2013/06/21 20:37:14 BrowserMainLoop::GetInstance() DCHECK()s that it's
+ BrowserMainLoop::GetInstance()
+ ? BrowserMainLoop::GetInstance()->indexed_db_thread()
+ ->message_loop_proxy()
jam 2013/06/21 19:41:59 nit: this is weird formatting, usually the "->" ne
jsbell 2013/06/21 20:37:14 clang-format - I'll file a bug.
+ : 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());

Powered by Google App Engine
This is Rietveld 408576698