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

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

Issue 2604273002: Migrate data from old localstorage format to new format. (Closed)
Patch Set: nit Created 3 years, 11 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 | « no previous file | content/browser/dom_storage/local_storage_context_mojo.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 926b4c0feb646961094a9d79062c1f0bf5675766..c2023a6ada6a644fa693b20251cdf0ceeefa2be9 100644
--- a/content/browser/dom_storage/dom_storage_context_wrapper.cc
+++ b/content/browser/dom_storage/dom_storage_context_wrapper.cc
@@ -83,18 +83,6 @@ DOMStorageContextWrapper::DOMStorageContextWrapper(
const base::FilePath& profile_path,
const base::FilePath& local_partition_path,
storage::SpecialStoragePolicy* special_storage_policy) {
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kMojoLocalStorage)) {
- base::FilePath storage_dir;
- if (!profile_path.empty())
- storage_dir = local_partition_path.AppendASCII(kLocalStorageDirectory);
- // TODO(michaeln): Enable writing to disk when db is versioned,
- // for now using an empty subdirectory to use an in-memory db.
- // subdirectory_(subdirectory),
- mojo_state_.reset(new LocalStorageContextMojo(
- connector, base::FilePath() /* storage_dir */));
- }
-
base::FilePath data_path;
if (!profile_path.empty())
data_path = profile_path.Append(local_partition_path);
@@ -134,6 +122,21 @@ DOMStorageContextWrapper::DOMStorageContextWrapper(
new DOMStorageWorkerPoolTaskRunner(std::move(primary_sequence),
std::move(commit_sequence)));
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kMojoLocalStorage)) {
+ base::FilePath storage_dir;
+ if (!profile_path.empty())
+ storage_dir = local_partition_path.AppendASCII(kLocalStorageDirectory);
+ // TODO(michaeln): Enable writing to disk when db is versioned,
+ // for now using an empty subdirectory to use an in-memory db.
+ // subdirectory_(subdirectory),
+ mojo_state_.reset(new LocalStorageContextMojo(
+ connector, context_->task_runner(),
+ data_path.empty() ? data_path
+ : data_path.AppendASCII(kLocalStorageDirectory),
+ base::FilePath() /* storage_dir */));
+ }
+
if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) {
base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this);
} else {
« no previous file with comments | « no previous file | content/browser/dom_storage/local_storage_context_mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698