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

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: Fix names. 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
« no previous file with comments | « third_party/WebKit/Source/platform/SharedBuffer.h ('k') | third_party/WebKit/Source/web/WebKit.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 99acec2c38f67988b3748805a84662af6b8b6b38..1502f6a4a33802e8eda574f54c34d0bd71495431 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
+{
+ if (m_buffer.size()) {
+ m_buffer.onMemoryDump(dumpPrefix + "/shared_buffer", memoryDump);
+ } else {
+ // 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
« no previous file with comments | « third_party/WebKit/Source/platform/SharedBuffer.h ('k') | third_party/WebKit/Source/web/WebKit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698