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

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

Issue 2594723002: Count number of origins with data affected by clearing "cookies and site data". (Closed)
Patch Set: Add comments for issues with incomplete data deletion 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_impl.h" 5 #include "content/browser/dom_storage/dom_storage_context_impl.h"
6 6
7 #include <inttypes.h> 7 #include <inttypes.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 10
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 persistent_namespace_id_to_namespace_id_.find( 249 persistent_namespace_id_to_namespace_id_.find(
250 usage_info.persistent_namespace_id); 250 usage_info.persistent_namespace_id);
251 if (it != persistent_namespace_id_to_namespace_id_.end()) { 251 if (it != persistent_namespace_id_to_namespace_id_.end()) {
252 dom_storage_namespace = GetStorageNamespace(it->second); 252 dom_storage_namespace = GetStorageNamespace(it->second);
253 } else { 253 } else {
254 int64_t namespace_id = AllocateSessionId(); 254 int64_t namespace_id = AllocateSessionId();
255 CreateSessionNamespace(namespace_id, usage_info.persistent_namespace_id); 255 CreateSessionNamespace(namespace_id, usage_info.persistent_namespace_id);
256 dom_storage_namespace = GetStorageNamespace(namespace_id); 256 dom_storage_namespace = GetStorageNamespace(namespace_id);
257 } 257 }
258 dom_storage_namespace->DeleteSessionStorageOrigin(usage_info.origin); 258 dom_storage_namespace->DeleteSessionStorageOrigin(usage_info.origin);
259 // TODO? This removes remaining traces of deleted sessions but I don't know if
260 // it could interfere with whatever happens with this clear event below?
261 /*if (session_storage_database_.get()) {
msramek 2017/01/09 12:54:44 Since you already know how to solve it, just need
dullweber 2017/01/09 16:05:46 I created https://codereview.chromium.org/26226030
262 task_runner_->PostShutdownBlockingTask(
263 FROM_HERE, DOMStorageTaskRunner::COMMIT_SEQUENCE,
264 base::Bind(base::IgnoreResult(&SessionStorageDatabase::DeleteArea),
265 session_storage_database_,
266 usage_info.persistent_namespace_id, usage_info.origin));
267 }*/
259 // Synthesize a 'cleared' event if the area is open so CachedAreas in 268 // Synthesize a 'cleared' event if the area is open so CachedAreas in
260 // renderers get emptied out too. 269 // renderers get emptied out too.
261 DOMStorageArea* area = 270 DOMStorageArea* area =
262 dom_storage_namespace->GetOpenStorageArea(usage_info.origin); 271 dom_storage_namespace->GetOpenStorageArea(usage_info.origin);
263 if (area) 272 if (area)
264 NotifyAreaCleared(area, usage_info.origin); 273 NotifyAreaCleared(area, usage_info.origin);
265 } 274 }
266 275
267 void DOMStorageContextImpl::Flush() { 276 void DOMStorageContextImpl::Flush() {
268 for (auto& entry : namespaces_) 277 for (auto& entry : namespaces_)
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 if (!deletable_persistent_namespace_ids_.empty()) { 640 if (!deletable_persistent_namespace_ids_.empty()) {
632 task_runner_->PostDelayedTask( 641 task_runner_->PostDelayedTask(
633 FROM_HERE, base::Bind( 642 FROM_HERE, base::Bind(
634 &DOMStorageContextImpl::DeleteNextUnusedNamespace, 643 &DOMStorageContextImpl::DeleteNextUnusedNamespace,
635 this), 644 this),
636 base::TimeDelta::FromSeconds(kSessionStoraceScavengingSeconds)); 645 base::TimeDelta::FromSeconds(kSessionStoraceScavengingSeconds));
637 } 646 }
638 } 647 }
639 648
640 } // namespace content 649 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698