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

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

Issue 2417673003: Revert changes made to ImageResource memory accounting at crrev.com/2337733002 (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
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698