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

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

Issue 1410333006: Enough hacks to make wstring printfs unneeded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 absolute_name.c_str()))) { 55 absolute_name.c_str()))) {
56 string_conversion_buffer_.reserve(16); 56 string_conversion_buffer_.reserve(16);
57 } 57 }
58 58
59 MemoryAllocatorDump::~MemoryAllocatorDump() { 59 MemoryAllocatorDump::~MemoryAllocatorDump() {
60 } 60 }
61 61
62 void MemoryAllocatorDump::AddScalar(const char* name, 62 void MemoryAllocatorDump::AddScalar(const char* name,
63 const char* units, 63 const char* units,
64 uint64 value) { 64 uint64 value) {
65 SStringPrintf(&string_conversion_buffer_, "%" PRIx64, value); 65 /*SStringPrintf(&string_conversion_buffer_, "%" PRIx64, value);*/
66 attributes_->BeginDictionary(name); 66 attributes_->BeginDictionary(name);
67 attributes_->SetString("type", kTypeScalar); 67 attributes_->SetString("type", kTypeScalar);
68 attributes_->SetString("units", units); 68 attributes_->SetString("units", units);
69 attributes_->SetString("value", string_conversion_buffer_); 69 attributes_->SetString("value", string_conversion_buffer_);
70 attributes_->EndDictionary(); 70 attributes_->EndDictionary();
71 } 71 }
72 72
73 void MemoryAllocatorDump::AddScalarF(const char* name, 73 void MemoryAllocatorDump::AddScalarF(const char* name,
74 const char* units, 74 const char* units,
75 double value) { 75 double value) {
(...skipping 16 matching lines...) Expand all
92 92
93 void MemoryAllocatorDump::AsValueInto(TracedValue* value) const { 93 void MemoryAllocatorDump::AsValueInto(TracedValue* value) const {
94 value->BeginDictionaryWithCopiedName(absolute_name_); 94 value->BeginDictionaryWithCopiedName(absolute_name_);
95 value->SetString("guid", guid_.ToString()); 95 value->SetString("guid", guid_.ToString());
96 value->SetValue("attrs", *attributes_); 96 value->SetValue("attrs", *attributes_);
97 value->EndDictionary(); // "allocator_name/heap_subheap": { ... } 97 value->EndDictionary(); // "allocator_name/heap_subheap": { ... }
98 } 98 }
99 99
100 } // namespace trace_event 100 } // namespace trace_event
101 } // namespace base 101 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698