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

Unified Diff: third_party/WebKit/Source/platform/SharedBuffer.cpp

Issue 1369253002: Add Web Resources usage to chrome://tracing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_cache2_base
Patch Set: Use singleton provider. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/SharedBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/SharedBuffer.cpp b/third_party/WebKit/Source/platform/SharedBuffer.cpp
index 5f497652937790abb6eaf518eaf4feae66a8ba74..b5e8e466317864f7437934c5f2f8b61f779d0414 100644
--- a/third_party/WebKit/Source/platform/SharedBuffer.cpp
+++ b/third_party/WebKit/Source/platform/SharedBuffer.cpp
@@ -27,6 +27,7 @@
#include "config.h"
#include "platform/SharedBuffer.h"
+#include "public/platform/WebProcessMemoryDump.h"
#include "wtf/text/UTF8.h"
#include "wtf/text/Unicode.h"
@@ -414,4 +415,18 @@ bool SharedBuffer::isLocked() const
return m_buffer.isLocked();
}
+void SharedBuffer::onMemoryDump(const String& dumpPrefix, WebProcessMemoryDump* memoryDump) const
+{
+ m_buffer.onMemoryDump(dumpPrefix + "/shared_buffer", memoryDump);
haraken 2015/10/14 09:04:07 if (m_buffer.size()) { m_buffer.onMemoryDump(dum
ssid 2015/10/14 12:06:40 Done.
+
+ if (!m_buffer.size()) {
+ // If there is data in the segments, then it should have been allocated
+ // using fastMalloc.
+ const String dataDumpName = dumpPrefix + "/segments";
+ auto dump = memoryDump->createMemoryAllocatorDump(dataDumpName);
+ dump->AddScalar("size", "bytes", m_size);
+ memoryDump->AddSuballocation(dump->guid(), String(WTF::Partitions::kAllocatedObjectPoolName));
+ }
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698