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

Side by Side Diff: third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp

Issue 2388303002: reflow comments in platform/ (Closed)
Patch Set: Created 4 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 "platform/PartitionAllocMemoryDumpProvider.h" 5 #include "platform/PartitionAllocMemoryDumpProvider.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/trace_event/heap_profiler_allocation_context.h" 8 #include "base/trace_event/heap_profiler_allocation_context.h"
9 #include "base/trace_event/heap_profiler_allocation_context_tracker.h" 9 #include "base/trace_event/heap_profiler_allocation_context_tracker.h"
10 #include "base/trace_event/heap_profiler_allocation_register.h" 10 #include "base/trace_event/heap_profiler_allocation_register.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 memoryDump->DumpHeapUsage(metricsByContext, overhead, "partition_alloc"); 149 memoryDump->DumpHeapUsage(metricsByContext, overhead, "partition_alloc");
150 } 150 }
151 151
152 PartitionStatsDumperImpl partitionStatsDumper(memoryDump, levelOfDetail); 152 PartitionStatsDumperImpl partitionStatsDumper(memoryDump, levelOfDetail);
153 153
154 base::trace_event::MemoryAllocatorDump* partitionsDump = 154 base::trace_event::MemoryAllocatorDump* partitionsDump =
155 memoryDump->CreateAllocatorDump(base::StringPrintf( 155 memoryDump->CreateAllocatorDump(base::StringPrintf(
156 "%s/%s", kPartitionAllocDumpName, kPartitionsDumpName)); 156 "%s/%s", kPartitionAllocDumpName, kPartitionsDumpName));
157 157
158 // This method calls memoryStats.partitionsDumpBucketStats with memory statist ics. 158 // This method calls memoryStats.partitionsDumpBucketStats with memory
159 // statistics.
159 WTF::Partitions::dumpMemoryStats( 160 WTF::Partitions::dumpMemoryStats(
160 levelOfDetail != MemoryDumpLevelOfDetail::DETAILED, 161 levelOfDetail != MemoryDumpLevelOfDetail::DETAILED,
161 &partitionStatsDumper); 162 &partitionStatsDumper);
162 163
163 base::trace_event::MemoryAllocatorDump* allocatedObjectsDump = 164 base::trace_event::MemoryAllocatorDump* allocatedObjectsDump =
164 memoryDump->CreateAllocatorDump(Partitions::kAllocatedObjectPoolName); 165 memoryDump->CreateAllocatorDump(Partitions::kAllocatedObjectPoolName);
165 allocatedObjectsDump->AddScalar("size", "bytes", 166 allocatedObjectsDump->AddScalar("size", "bytes",
166 partitionStatsDumper.totalActiveBytes()); 167 partitionStatsDumper.totalActiveBytes());
167 memoryDump->AddOwnershipEdge(allocatedObjectsDump->guid(), 168 memoryDump->AddOwnershipEdge(allocatedObjectsDump->guid(),
168 partitionsDump->guid()); 169 partitionsDump->guid());
169 170
170 return true; 171 return true;
171 } 172 }
172 173
173 // |m_allocationRegister| should be initialized only when necessary to avoid was te of memory. 174 // |m_allocationRegister| should be initialized only when necessary to avoid
175 // waste of memory.
174 PartitionAllocMemoryDumpProvider::PartitionAllocMemoryDumpProvider() 176 PartitionAllocMemoryDumpProvider::PartitionAllocMemoryDumpProvider()
175 : m_allocationRegister(nullptr), m_isHeapProfilingEnabled(false) {} 177 : m_allocationRegister(nullptr), m_isHeapProfilingEnabled(false) {}
176 178
177 PartitionAllocMemoryDumpProvider::~PartitionAllocMemoryDumpProvider() {} 179 PartitionAllocMemoryDumpProvider::~PartitionAllocMemoryDumpProvider() {}
178 180
179 void PartitionAllocMemoryDumpProvider::OnHeapProfilingEnabled(bool enabled) { 181 void PartitionAllocMemoryDumpProvider::OnHeapProfilingEnabled(bool enabled) {
180 if (enabled) { 182 if (enabled) {
181 { 183 {
182 MutexLocker locker(m_allocationRegisterMutex); 184 MutexLocker locker(m_allocationRegisterMutex);
183 if (!m_allocationRegister) 185 if (!m_allocationRegister)
(...skipping 20 matching lines...) Expand all
204 m_allocationRegister->Insert(address, size, context); 206 m_allocationRegister->Insert(address, size, context);
205 } 207 }
206 208
207 void PartitionAllocMemoryDumpProvider::remove(void* address) { 209 void PartitionAllocMemoryDumpProvider::remove(void* address) {
208 MutexLocker locker(m_allocationRegisterMutex); 210 MutexLocker locker(m_allocationRegisterMutex);
209 if (m_allocationRegister) 211 if (m_allocationRegister)
210 m_allocationRegister->Remove(address); 212 m_allocationRegister->Remove(address);
211 } 213 }
212 214
213 } // namespace blink 215 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/PODIntervalTreeTest.cpp ('k') | third_party/WebKit/Source/platform/PlatformEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698