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

Unified Diff: content/browser/storage_partition_impl.cc

Issue 2930183002: Let IndexedDBContextImpl create its own task runner (Closed)
Patch Set: Use ScopedTaskEnvironment for most tests Created 3 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 5c4270512f9614eafefc00b3d70723b7c9f8f3cd..9b5acc991b92194671e4de51e586c110d8b0bd95 100644
--- a/content/browser/storage_partition_impl.cc
+++ b/content/browser/storage_partition_impl.cc
@@ -15,7 +15,6 @@
#include "base/sequenced_task_runner.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
#include "content/browser/blob_storage/chrome_blob_storage_context.h"
#include "content/browser/browser_main_loop.h"
#include "content/browser/browsing_data/storage_partition_http_cache_data_remover.h"
@@ -472,25 +471,9 @@ std::unique_ptr<StoragePartitionImpl> StoragePartitionImpl::Create(
in_memory ? base::FilePath() : context->GetPath(),
relative_partition_path, context->GetSpecialStoragePolicy());
- // BrowserMainLoop may not be initialized in unit tests. Tests will
- // need to inject their own task runner into the IndexedDBContext.
- // TODO(jsbell): This is no longer true, update tests to provide use a
- // base::test::ScopedTaskEnvironment instead of injecting a test task
- // runner.
- scoped_refptr<base::SequencedTaskRunner> idb_task_runner =
- BrowserThread::CurrentlyOn(BrowserThread::UI) &&
- BrowserMainLoop::GetInstance()
- ? base::CreateSequencedTaskRunnerWithTraits({
- base::MayBlock(), base::WithBaseSyncPrimitives(),
- base::TaskPriority::USER_VISIBLE,
- base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN,
- })
- : nullptr;
-
base::FilePath path = in_memory ? base::FilePath() : partition_path;
- partition->indexed_db_context_ =
- new IndexedDBContextImpl(path, context->GetSpecialStoragePolicy(),
- quota_manager_proxy.get(), idb_task_runner);
+ partition->indexed_db_context_ = new IndexedDBContextImpl(
+ path, context->GetSpecialStoragePolicy(), quota_manager_proxy.get());
partition->cache_storage_context_ = new CacheStorageContextImpl(context);
partition->cache_storage_context_->Init(path, quota_manager_proxy);

Powered by Google App Engine
This is Rietveld 408576698