| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 } | 248 } |
| 249 | 249 |
| 250 void SharedBuffer::onMemoryDump(const String& dumpPrefix, | 250 void SharedBuffer::onMemoryDump(const String& dumpPrefix, |
| 251 WebProcessMemoryDump* memoryDump) const { | 251 WebProcessMemoryDump* memoryDump) const { |
| 252 if (m_buffer.size()) { | 252 if (m_buffer.size()) { |
| 253 WebMemoryAllocatorDump* dump = | 253 WebMemoryAllocatorDump* dump = |
| 254 memoryDump->createMemoryAllocatorDump(dumpPrefix + "/shared_buffer"); | 254 memoryDump->createMemoryAllocatorDump(dumpPrefix + "/shared_buffer"); |
| 255 dump->addScalar("size", "bytes", m_buffer.size()); | 255 dump->addScalar("size", "bytes", m_buffer.size()); |
| 256 memoryDump->addSuballocation( | 256 memoryDump->addSuballocation( |
| 257 dump->guid(), String(WTF::Partitions::kAllocatedObjectPoolName)); | 257 dump->guid(), String(WTF::Partitions::kAllocatedObjectPoolName)); |
| 258 } | 258 } else { |
| 259 if (m_segments.size()) { | |
| 260 // If there is data in the segments, then it should have been allocated | 259 // If there is data in the segments, then it should have been allocated |
| 261 // using fastMalloc. | 260 // using fastMalloc. |
| 262 const String dataDumpName = dumpPrefix + "/segments"; | 261 const String dataDumpName = dumpPrefix + "/segments"; |
| 263 auto dump = memoryDump->createMemoryAllocatorDump(dataDumpName); | 262 auto dump = memoryDump->createMemoryAllocatorDump(dataDumpName); |
| 264 dump->addScalar("size", "bytes", m_size - m_buffer.size()); | 263 dump->addScalar("size", "bytes", m_size); |
| 265 memoryDump->addSuballocation( | 264 memoryDump->addSuballocation( |
| 266 dump->guid(), String(WTF::Partitions::kAllocatedObjectPoolName)); | 265 dump->guid(), String(WTF::Partitions::kAllocatedObjectPoolName)); |
| 267 } | 266 } |
| 268 } | 267 } |
| 269 | 268 |
| 270 } // namespace blink | 269 } // namespace blink |
| OLD | NEW |