OLD | NEW |
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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 if (area) | 233 if (area) |
234 NotifyAreaCleared(area, usage_info.origin); | 234 NotifyAreaCleared(area, usage_info.origin); |
235 } | 235 } |
236 | 236 |
237 void DOMStorageContextImpl::Flush() { | 237 void DOMStorageContextImpl::Flush() { |
238 for (auto& entry : namespaces_) | 238 for (auto& entry : namespaces_) |
239 entry.second->Flush(); | 239 entry.second->Flush(); |
240 } | 240 } |
241 | 241 |
242 void DOMStorageContextImpl::Shutdown() { | 242 void DOMStorageContextImpl::Shutdown() { |
243 DCHECK(!task_runner_ || task_runner_->IsRunningOnPrimarySequence()); | 243 if (task_runner_) |
| 244 task_runner_->AssertIsRunningOnPrimarySequence(); |
244 is_shutdown_ = true; | 245 is_shutdown_ = true; |
245 StorageNamespaceMap::const_iterator it = namespaces_.begin(); | 246 StorageNamespaceMap::const_iterator it = namespaces_.begin(); |
246 for (; it != namespaces_.end(); ++it) | 247 for (; it != namespaces_.end(); ++it) |
247 it->second->Shutdown(); | 248 it->second->Shutdown(); |
248 | 249 |
249 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( | 250 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( |
250 this); | 251 this); |
251 | 252 |
252 if (localstorage_directory_.empty() && !session_storage_database_.get()) | 253 if (localstorage_directory_.empty() && !session_storage_database_.get()) |
253 return; | 254 return; |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 if (!deletable_persistent_namespace_ids_.empty()) { | 604 if (!deletable_persistent_namespace_ids_.empty()) { |
604 task_runner_->PostDelayedTask( | 605 task_runner_->PostDelayedTask( |
605 FROM_HERE, base::Bind( | 606 FROM_HERE, base::Bind( |
606 &DOMStorageContextImpl::DeleteNextUnusedNamespace, | 607 &DOMStorageContextImpl::DeleteNextUnusedNamespace, |
607 this), | 608 this), |
608 base::TimeDelta::FromSeconds(kSessionStoraceScavengingSeconds)); | 609 base::TimeDelta::FromSeconds(kSessionStoraceScavengingSeconds)); |
609 } | 610 } |
610 } | 611 } |
611 | 612 |
612 } // namespace content | 613 } // namespace content |
OLD | NEW |