Chromium Code Reviews

Side by Side Diff: content/child/child_discardable_shared_memory_manager.cc

Issue 1028853002: content: Crash key and trace counter cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | content/common/host_discardable_shared_memory_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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...)
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
OLDNEW
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | content/common/host_discardable_shared_memory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine