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

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

Issue 2000803003: Use std::unique_ptr for base::DictionaryValue and base::ListValue's internal store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More fixes Created 4 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/trace_event/trace_event_argument.cc ('k') | base/values.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/trace_event_memory_overhead.h" 5 #include "base/trace_event/trace_event_memory_overhead.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bits.h" 9 #include "base/bits.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 it.Advance()) { 97 it.Advance()) {
98 AddString(it.key()); 98 AddString(it.key());
99 AddValue(it.value()); 99 AddValue(it.value());
100 } 100 }
101 } break; 101 } break;
102 102
103 case Value::TYPE_LIST: { 103 case Value::TYPE_LIST: {
104 const ListValue* list_value = nullptr; 104 const ListValue* list_value = nullptr;
105 value.GetAsList(&list_value); 105 value.GetAsList(&list_value);
106 Add("ListValue", sizeof(ListValue)); 106 Add("ListValue", sizeof(ListValue));
107 for (const Value* v : *list_value) 107 for (const auto& v : *list_value)
108 AddValue(*v); 108 AddValue(*v);
109 } break; 109 } break;
110 110
111 default: 111 default:
112 NOTREACHED(); 112 NOTREACHED();
113 } 113 }
114 } 114 }
115 115
116 void TraceEventMemoryOverhead::AddSelf() { 116 void TraceEventMemoryOverhead::AddSelf() {
117 size_t estimated_size = sizeof(*this); 117 size_t estimated_size = sizeof(*this);
(...skipping 29 matching lines...) Expand all
147 it.second.allocated_size_in_bytes); 147 it.second.allocated_size_in_bytes);
148 mad->AddScalar("resident_size", MemoryAllocatorDump::kUnitsBytes, 148 mad->AddScalar("resident_size", MemoryAllocatorDump::kUnitsBytes,
149 it.second.resident_size_in_bytes); 149 it.second.resident_size_in_bytes);
150 mad->AddScalar(MemoryAllocatorDump::kNameObjectCount, 150 mad->AddScalar(MemoryAllocatorDump::kNameObjectCount,
151 MemoryAllocatorDump::kUnitsObjects, it.second.count); 151 MemoryAllocatorDump::kUnitsObjects, it.second.count);
152 } 152 }
153 } 153 }
154 154
155 } // namespace trace_event 155 } // namespace trace_event
156 } // namespace base 156 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/trace_event_argument.cc ('k') | base/values.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698