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

Side by Side Diff: content/browser/dom_storage/dom_storage_context_wrapper.cc

Issue 2649963002: Enable mojo localstorage to actually store on disk. (Closed)
Patch Set: Remove Sync() method, and instead make sure browser test waits long enough. Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" 5 #include "content/browser/dom_storage/dom_storage_context_wrapper.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 base::FilePath storage_dir; 127 base::FilePath storage_dir;
128 if (!profile_path.empty()) 128 if (!profile_path.empty())
129 storage_dir = local_partition_path.AppendASCII(kLocalStorageDirectory); 129 storage_dir = local_partition_path.AppendASCII(kLocalStorageDirectory);
130 // TODO(michaeln): Enable writing to disk when db is versioned, 130 // TODO(michaeln): Enable writing to disk when db is versioned,
131 // for now using an empty subdirectory to use an in-memory db. 131 // for now using an empty subdirectory to use an in-memory db.
132 // subdirectory_(subdirectory), 132 // subdirectory_(subdirectory),
133 mojo_state_.reset(new LocalStorageContextMojo( 133 mojo_state_.reset(new LocalStorageContextMojo(
134 connector, context_->task_runner(), 134 connector, context_->task_runner(),
135 data_path.empty() ? data_path 135 data_path.empty() ? data_path
136 : data_path.AppendASCII(kLocalStorageDirectory), 136 : data_path.AppendASCII(kLocalStorageDirectory),
137 base::FilePath() /* storage_dir */)); 137 storage_dir));
138 } 138 }
139 139
140 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { 140 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) {
141 base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this); 141 base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this);
142 } else { 142 } else {
143 memory_pressure_listener_.reset(new base::MemoryPressureListener( 143 memory_pressure_listener_.reset(new base::MemoryPressureListener(
144 base::Bind(&DOMStorageContextWrapper::OnMemoryPressure, this))); 144 base::Bind(&DOMStorageContextWrapper::OnMemoryPressure, this)));
145 } 145 }
146 } 146 }
147 147
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 GetLocalStorageUsageCallback callback, 308 GetLocalStorageUsageCallback callback,
309 std::vector<LocalStorageUsageInfo> usage) { 309 std::vector<LocalStorageUsageInfo> usage) {
310 context_->task_runner()->PostShutdownBlockingTask( 310 context_->task_runner()->PostShutdownBlockingTask(
311 FROM_HERE, DOMStorageTaskRunner::PRIMARY_SEQUENCE, 311 FROM_HERE, DOMStorageTaskRunner::PRIMARY_SEQUENCE,
312 base::Bind(&GetLocalStorageUsageHelper, base::Passed(&usage), 312 base::Bind(&GetLocalStorageUsageHelper, base::Passed(&usage),
313 base::RetainedRef(base::ThreadTaskRunnerHandle::Get()), 313 base::RetainedRef(base::ThreadTaskRunnerHandle::Get()),
314 base::RetainedRef(context_), callback)); 314 base::RetainedRef(context_), callback));
315 } 315 }
316 316
317 } // namespace content 317 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_wrapper.h ('k') | content/browser/dom_storage/local_storage_context_mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698