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

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

Issue 2788813002: Try to flush DOMStorage too when ending the browsing session.
Patch Set: compile (doh!) Created 3 years, 8 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 void DOMStorageContextWrapper::Flush() { 251 void DOMStorageContextWrapper::Flush() {
252 DCHECK(context_.get()); 252 DCHECK(context_.get());
253 context_->task_runner()->PostShutdownBlockingTask( 253 context_->task_runner()->PostShutdownBlockingTask(
254 FROM_HERE, DOMStorageTaskRunner::PRIMARY_SEQUENCE, 254 FROM_HERE, DOMStorageTaskRunner::PRIMARY_SEQUENCE,
255 base::Bind(&DOMStorageContextImpl::Flush, context_)); 255 base::Bind(&DOMStorageContextImpl::Flush, context_));
256 if (mojo_state_) 256 if (mojo_state_)
257 mojo_state_->Flush(); 257 mojo_state_->Flush();
258 } 258 }
259 259
260 scoped_refptr<base::SequencedTaskRunner>
261 DOMStorageContextWrapper::GetSequencedTaskRunner(
262 DOMStorageTaskRunner::SequenceID id) {
263 return context_->task_runner()->GetSequencedTaskRunner(id);
264 }
265
260 void DOMStorageContextWrapper::OpenLocalStorage( 266 void DOMStorageContextWrapper::OpenLocalStorage(
261 const url::Origin& origin, 267 const url::Origin& origin,
262 mojom::LevelDBWrapperRequest request) { 268 mojom::LevelDBWrapperRequest request) {
263 if (!mojo_state_) 269 if (!mojo_state_)
264 return; 270 return;
265 mojo_state_->OpenLocalStorage(origin, std::move(request)); 271 mojo_state_->OpenLocalStorage(origin, std::move(request));
266 } 272 }
267 273
268 void DOMStorageContextWrapper::OnMemoryPressure( 274 void DOMStorageContextWrapper::OnMemoryPressure(
269 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { 275 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) {
(...skipping 23 matching lines...) Expand all
293 GetLocalStorageUsageCallback callback, 299 GetLocalStorageUsageCallback callback,
294 std::vector<LocalStorageUsageInfo> usage) { 300 std::vector<LocalStorageUsageInfo> usage) {
295 context_->task_runner()->PostShutdownBlockingTask( 301 context_->task_runner()->PostShutdownBlockingTask(
296 FROM_HERE, DOMStorageTaskRunner::PRIMARY_SEQUENCE, 302 FROM_HERE, DOMStorageTaskRunner::PRIMARY_SEQUENCE,
297 base::Bind(&GetLocalStorageUsageHelper, base::Passed(&usage), 303 base::Bind(&GetLocalStorageUsageHelper, base::Passed(&usage),
298 base::RetainedRef(base::ThreadTaskRunnerHandle::Get()), 304 base::RetainedRef(base::ThreadTaskRunnerHandle::Get()),
299 base::RetainedRef(context_), callback)); 305 base::RetainedRef(context_), callback));
300 } 306 }
301 307
302 } // namespace content 308 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698