| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/child/child_discardable_shared_memory_manager.h" | 5 #include "content/child/child_discardable_shared_memory_manager.h" |
| 6 | 6 |
| 7 #include "base/atomic_sequence_num.h" | 7 #include "base/atomic_sequence_num.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
| 10 #include "base/memory/discardable_memory.h" | 10 #include "base/memory/discardable_memory.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 DiscardableSharedMemoryId id) { | 275 DiscardableSharedMemoryId id) { |
| 276 sender_->Send(new ChildProcessHostMsg_DeletedDiscardableSharedMemory(id)); | 276 sender_->Send(new ChildProcessHostMsg_DeletedDiscardableSharedMemory(id)); |
| 277 } | 277 } |
| 278 | 278 |
| 279 void ChildDiscardableSharedMemoryManager::MemoryUsageChanged( | 279 void ChildDiscardableSharedMemoryManager::MemoryUsageChanged( |
| 280 size_t new_bytes_total, | 280 size_t new_bytes_total, |
| 281 size_t new_bytes_free) const { | 281 size_t new_bytes_free) const { |
| 282 TRACE_COUNTER2("renderer", "DiscardableMemoryUsage", "allocated", | 282 TRACE_COUNTER2("renderer", "DiscardableMemoryUsage", "allocated", |
| 283 new_bytes_total - new_bytes_free, "free", new_bytes_free); | 283 new_bytes_total - new_bytes_free, "free", new_bytes_free); |
| 284 | 284 |
| 285 static const char kDiscardableMemoryUsageKey[] = "dm-usage"; | 285 static const char kDiscardableMemoryAllocatedKey[] = |
| 286 base::debug::SetCrashKeyValue(kDiscardableMemoryUsageKey, | 286 "discardable-memory-allocated"; |
| 287 base::debug::SetCrashKeyValue(kDiscardableMemoryAllocatedKey, |
| 287 base::Uint64ToString(new_bytes_total)); | 288 base::Uint64ToString(new_bytes_total)); |
| 288 | 289 |
| 289 static const char kDiscardableMemoryUsageFreeKey[] = "dm-usage-free"; | 290 static const char kDiscardableMemoryFreeKey[] = "discardable-memory-free"; |
| 290 base::debug::SetCrashKeyValue(kDiscardableMemoryUsageFreeKey, | 291 base::debug::SetCrashKeyValue(kDiscardableMemoryFreeKey, |
| 291 base::Uint64ToString(new_bytes_free)); | 292 base::Uint64ToString(new_bytes_free)); |
| 292 } | 293 } |
| 293 | 294 |
| 294 } // namespace content | 295 } // namespace content |
| OLD | NEW |