| OLD | NEW |
| 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_namespace.h" | 5 #include "content/browser/dom_storage/dom_storage_namespace.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/browser/dom_storage/dom_storage_area.h" | 10 #include "content/browser/dom_storage/dom_storage_area.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 ++stats.total_area_count; | 177 ++stats.total_area_count; |
| 178 if (it->second.open_count_ == 0) | 178 if (it->second.open_count_ == 0) |
| 179 ++stats.inactive_area_count; | 179 ++stats.inactive_area_count; |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 return stats; | 182 return stats; |
| 183 } | 183 } |
| 184 | 184 |
| 185 void DOMStorageNamespace::OnMemoryDump( | 185 void DOMStorageNamespace::OnMemoryDump( |
| 186 base::trace_event::ProcessMemoryDump* pmd) { | 186 base::trace_event::ProcessMemoryDump* pmd) { |
| 187 DCHECK(task_runner_->IsRunningOnPrimarySequence()); | 187 task_runner_->AssertIsRunningOnPrimarySequence(); |
| 188 for (const auto& it : areas_) | 188 for (const auto& it : areas_) |
| 189 it.second.area_->OnMemoryDump(pmd); | 189 it.second.area_->OnMemoryDump(pmd); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void DOMStorageNamespace::GetOriginsWithAreas( | 192 void DOMStorageNamespace::GetOriginsWithAreas( |
| 193 std::vector<GURL>* origins) const { | 193 std::vector<GURL>* origins) const { |
| 194 origins->clear(); | 194 origins->clear(); |
| 195 for (const auto& entry : areas_) | 195 for (const auto& entry : areas_) |
| 196 origins->push_back(entry.first); | 196 origins->push_back(entry.first); |
| 197 } | 197 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 214 DOMStorageArea* area, int count) | 214 DOMStorageArea* area, int count) |
| 215 : area_(area), open_count_(count) { | 215 : area_(area), open_count_(count) { |
| 216 } | 216 } |
| 217 | 217 |
| 218 DOMStorageNamespace::AreaHolder::AreaHolder(const AreaHolder& other) = default; | 218 DOMStorageNamespace::AreaHolder::AreaHolder(const AreaHolder& other) = default; |
| 219 | 219 |
| 220 DOMStorageNamespace::AreaHolder::~AreaHolder() { | 220 DOMStorageNamespace::AreaHolder::~AreaHolder() { |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace content | 223 } // namespace content |
| OLD | NEW |