Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Side by Side Diff: base/trace_event/memory_allocator_dump.cc

Issue 1546033002: Switch to standard integer types in base/trace_event/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/trace_event/memory_allocator_dump.h ('k') | base/trace_event/memory_allocator_dump_guid.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/trace_event/memory_allocator_dump.h" 5 #include "base/trace_event/memory_allocator_dump.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/trace_event/memory_dump_manager.h" 9 #include "base/trace_event/memory_dump_manager.h"
10 #include "base/trace_event/memory_dump_provider.h" 10 #include "base/trace_event/memory_dump_provider.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 TraceLog::GetInstance()->process_id(), 50 TraceLog::GetInstance()->process_id(),
51 absolute_name.c_str()))) { 51 absolute_name.c_str()))) {
52 string_conversion_buffer_.reserve(16); 52 string_conversion_buffer_.reserve(16);
53 } 53 }
54 54
55 MemoryAllocatorDump::~MemoryAllocatorDump() { 55 MemoryAllocatorDump::~MemoryAllocatorDump() {
56 } 56 }
57 57
58 void MemoryAllocatorDump::AddScalar(const char* name, 58 void MemoryAllocatorDump::AddScalar(const char* name,
59 const char* units, 59 const char* units,
60 uint64 value) { 60 uint64_t value) {
61 SStringPrintf(&string_conversion_buffer_, "%" PRIx64, value); 61 SStringPrintf(&string_conversion_buffer_, "%" PRIx64, value);
62 attributes_->BeginDictionary(name); 62 attributes_->BeginDictionary(name);
63 attributes_->SetString("type", kTypeScalar); 63 attributes_->SetString("type", kTypeScalar);
64 attributes_->SetString("units", units); 64 attributes_->SetString("units", units);
65 attributes_->SetString("value", string_conversion_buffer_); 65 attributes_->SetString("value", string_conversion_buffer_);
66 attributes_->EndDictionary(); 66 attributes_->EndDictionary();
67 } 67 }
68 68
69 void MemoryAllocatorDump::AddScalarF(const char* name, 69 void MemoryAllocatorDump::AddScalarF(const char* name,
70 const char* units, 70 const char* units,
(...skipping 17 matching lines...) Expand all
88 88
89 void MemoryAllocatorDump::AsValueInto(TracedValue* value) const { 89 void MemoryAllocatorDump::AsValueInto(TracedValue* value) const {
90 value->BeginDictionaryWithCopiedName(absolute_name_); 90 value->BeginDictionaryWithCopiedName(absolute_name_);
91 value->SetString("guid", guid_.ToString()); 91 value->SetString("guid", guid_.ToString());
92 value->SetValue("attrs", *attributes_); 92 value->SetValue("attrs", *attributes_);
93 value->EndDictionary(); // "allocator_name/heap_subheap": { ... } 93 value->EndDictionary(); // "allocator_name/heap_subheap": { ... }
94 } 94 }
95 95
96 } // namespace trace_event 96 } // namespace trace_event
97 } // namespace base 97 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/memory_allocator_dump.h ('k') | base/trace_event/memory_allocator_dump_guid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698