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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 491 |
492 bool DOMStorageContextImpl::OnMemoryDump( | 492 bool DOMStorageContextImpl::OnMemoryDump( |
493 const base::trace_event::MemoryDumpArgs& args, | 493 const base::trace_event::MemoryDumpArgs& args, |
494 base::trace_event::ProcessMemoryDump* pmd) { | 494 base::trace_event::ProcessMemoryDump* pmd) { |
495 if (session_storage_database_) | 495 if (session_storage_database_) |
496 session_storage_database_->OnMemoryDump(pmd); | 496 session_storage_database_->OnMemoryDump(pmd); |
497 if (args.level_of_detail == | 497 if (args.level_of_detail == |
498 base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND) { | 498 base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND) { |
499 DOMStorageNamespace::UsageStatistics total_stats = | 499 DOMStorageNamespace::UsageStatistics total_stats = |
500 GetTotalNamespaceStatistics(namespaces_); | 500 GetTotalNamespaceStatistics(namespaces_); |
501 auto mad = pmd->CreateAllocatorDump( | 501 auto* mad = pmd->CreateAllocatorDump( |
502 base::StringPrintf("dom_storage/0x%" PRIXPTR "/cache_size", | 502 base::StringPrintf("dom_storage/0x%" PRIXPTR "/cache_size", |
503 reinterpret_cast<uintptr_t>(this))); | 503 reinterpret_cast<uintptr_t>(this))); |
504 mad->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, | 504 mad->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
505 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 505 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
506 total_stats.total_cache_size); | 506 total_stats.total_cache_size); |
507 mad->AddScalar("inactive_areas", | 507 mad->AddScalar("inactive_areas", |
508 base::trace_event::MemoryAllocatorDump::kUnitsObjects, | 508 base::trace_event::MemoryAllocatorDump::kUnitsObjects, |
509 total_stats.inactive_area_count); | 509 total_stats.inactive_area_count); |
510 mad->AddScalar("total_areas", | 510 mad->AddScalar("total_areas", |
511 base::trace_event::MemoryAllocatorDump::kUnitsObjects, | 511 base::trace_event::MemoryAllocatorDump::kUnitsObjects, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 if (!deletable_persistent_namespace_ids_.empty()) { | 581 if (!deletable_persistent_namespace_ids_.empty()) { |
582 task_runner_->PostDelayedTask( | 582 task_runner_->PostDelayedTask( |
583 FROM_HERE, base::Bind( | 583 FROM_HERE, base::Bind( |
584 &DOMStorageContextImpl::DeleteNextUnusedNamespace, | 584 &DOMStorageContextImpl::DeleteNextUnusedNamespace, |
585 this), | 585 this), |
586 base::TimeDelta::FromSeconds(kSessionStoraceScavengingSeconds)); | 586 base::TimeDelta::FromSeconds(kSessionStoraceScavengingSeconds)); |
587 } | 587 } |
588 } | 588 } |
589 | 589 |
590 } // namespace content | 590 } // namespace content |
OLD | NEW |