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

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

Issue 2337733002: [tracing] Support BACKGROUND mode in MemoryCache dump provider (Closed)
Patch Set: remove trace_event change. Created 4 years, 3 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 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 } 268 }
269 return data; 269 return data;
270 } 270 }
271 271
272 void SharedBuffer::onMemoryDump(const String& dumpPrefix, WebProcessMemoryDump* memoryDump) const 272 void SharedBuffer::onMemoryDump(const String& dumpPrefix, WebProcessMemoryDump* memoryDump) const
273 { 273 {
274 if (m_buffer.size()) { 274 if (m_buffer.size()) {
275 WebMemoryAllocatorDump* dump = memoryDump->createMemoryAllocatorDump(dum pPrefix + "/shared_buffer"); 275 WebMemoryAllocatorDump* dump = memoryDump->createMemoryAllocatorDump(dum pPrefix + "/shared_buffer");
276 dump->addScalar("size", "bytes", m_buffer.size()); 276 dump->addScalar("size", "bytes", m_buffer.size());
277 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllo catedObjectPoolName)); 277 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllo catedObjectPoolName));
278 } else { 278 }
279 if (m_segments.size()) {
279 // If there is data in the segments, then it should have been allocated 280 // If there is data in the segments, then it should have been allocated
280 // using fastMalloc. 281 // using fastMalloc.
281 const String dataDumpName = dumpPrefix + "/segments"; 282 const String dataDumpName = dumpPrefix + "/segments";
282 auto dump = memoryDump->createMemoryAllocatorDump(dataDumpName); 283 auto dump = memoryDump->createMemoryAllocatorDump(dataDumpName);
283 dump->addScalar("size", "bytes", m_size); 284 dump->addScalar("size", "bytes", m_size - m_buffer.size());
284 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllo catedObjectPoolName)); 285 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllo catedObjectPoolName));
285 } 286 }
286 } 287 }
287 288
288 } // namespace blink 289 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698