OLD | NEW |
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 Loading... |
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 |
OLD | NEW |