Chromium Code Reviews| Index: content/browser/dom_storage/dom_storage_namespace.cc |
| diff --git a/content/browser/dom_storage/dom_storage_namespace.cc b/content/browser/dom_storage/dom_storage_namespace.cc |
| index a8681b6e6c2b148491689f6c47b543172dbab08d..fa31abc8a961e0cb2bd79069c37420827cb0913c 100644 |
| --- a/content/browser/dom_storage/dom_storage_namespace.cc |
| +++ b/content/browser/dom_storage/dom_storage_namespace.cc |
| @@ -7,6 +7,7 @@ |
| #include "base/bind.h" |
| #include "base/location.h" |
| #include "base/logging.h" |
| +#include "base/trace_event/memory_dump_manager.h" |
| #include "content/browser/dom_storage/dom_storage_area.h" |
| #include "content/browser/dom_storage/dom_storage_task_runner.h" |
| #include "content/browser/dom_storage/session_storage_database.h" |
| @@ -32,9 +33,16 @@ DOMStorageNamespace::DOMStorageNamespace( |
| task_runner_(task_runner), |
| session_storage_database_(session_storage_database) { |
| DCHECK_NE(kLocalStorageNamespaceId, namespace_id); |
| + base::trace_event::MemoryDumpManager::GetInstance() |
| + ->RegisterDumpProviderWithSequencedTaskRunner( |
| + this, "DOMStorage", task_runner_->GetSequencedTaskRunner( |
| + DOMStorageTaskRunner::PRIMARY_SEQUENCE), |
| + base::trace_event::MemoryDumpProvider::Options()); |
| } |
| DOMStorageNamespace::~DOMStorageNamespace() { |
| + base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( |
|
michaeln
2016/04/23 00:28:38
is the thread-safety-ness of this dependent on the
ssid
2016/04/23 00:33:13
Yes. Doesn't it?
michaeln
2016/04/25 21:44:19
no, this is not guaranteed to be called task runne
ssid
2016/04/26 00:51:54
Thanks, I was thinking DOMStorageContextImpl::Dele
|
| + this); |
| } |
| DOMStorageArea* DOMStorageNamespace::OpenStorageArea(const GURL& origin) { |
| @@ -176,6 +184,15 @@ unsigned int DOMStorageNamespace::CountInMemoryAreas() const { |
| return area_count; |
| } |
| +bool DOMStorageNamespace::OnMemoryDump( |
| + const base::trace_event::MemoryDumpArgs& args, |
| + base::trace_event::ProcessMemoryDump* pmd) { |
| + DCHECK(task_runner_->IsRunningOnPrimarySequence()); |
| + for (const auto& it : areas_) |
| + it.second.area_->OnMemoryDump(pmd); |
| + return true; |
| +} |
| + |
| DOMStorageNamespace::AreaHolder* |
| DOMStorageNamespace::GetAreaHolder(const GURL& origin) { |
| AreaMap::iterator found = areas_.find(origin); |