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

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

Issue 1141793003: Update from https://crrev.com/329939 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « base/time/time_unittest.cc ('k') | base/trace_event/memory_dump_request_args.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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 const std::string& value) { 102 const std::string& value) {
103 scoped_ptr<Value> str_value(new StringValue(value)); 103 scoped_ptr<Value> str_value(new StringValue(value));
104 Add(name, kTypeString, units, str_value.Pass()); 104 Add(name, kTypeString, units, str_value.Pass());
105 } 105 }
106 106
107 void MemoryAllocatorDump::AsValueInto(TracedValue* value) const { 107 void MemoryAllocatorDump::AsValueInto(TracedValue* value) const {
108 value->BeginDictionary(absolute_name_.c_str()); 108 value->BeginDictionary(absolute_name_.c_str());
109 value->BeginDictionary("attrs"); 109 value->BeginDictionary("attrs");
110 110
111 for (DictionaryValue::Iterator it(attributes_); !it.IsAtEnd(); it.Advance()) 111 for (DictionaryValue::Iterator it(attributes_); !it.IsAtEnd(); it.Advance())
112 value->SetValue(it.key().c_str(), it.value().DeepCopy()); 112 value->SetValue(it.key().c_str(), it.value().CreateDeepCopy());
113 113
114 value->EndDictionary(); // "attrs": { ... } 114 value->EndDictionary(); // "attrs": { ... }
115 value->EndDictionary(); // "allocator_name/heap_subheap": { ... } 115 value->EndDictionary(); // "allocator_name/heap_subheap": { ... }
116 } 116 }
117 117
118 } // namespace trace_event 118 } // namespace trace_event
119 } // namespace base 119 } // namespace base
OLDNEW
« no previous file with comments | « base/time/time_unittest.cc ('k') | base/trace_event/memory_dump_request_args.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698