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

Unified Diff: third_party/WebKit/Source/core/fetch/ScriptResource.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
Index: third_party/WebKit/Source/core/fetch/ScriptResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ScriptResource.cpp b/third_party/WebKit/Source/core/fetch/ScriptResource.cpp
index 50935706761b2a9ed2ec6e79fe6cfd3d62aa4e04..b6bd636de33ebdcb8e8af408418636e987b11ab0 100644
--- a/third_party/WebKit/Source/core/fetch/ScriptResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ScriptResource.cpp
@@ -33,6 +33,7 @@
#include "platform/MIMETypeRegistry.h"
#include "platform/SharedBuffer.h"
#include "platform/network/HTTPParsers.h"
+#include "public/platform/WebProcessMemoryDump.h"
namespace blink {
@@ -72,6 +73,15 @@ void ScriptResource::appendData(const char* data, unsigned length)
client->notifyAppendData(this);
}
+void ScriptResource::onMemoryDump(WebProcessMemoryDump* memoryDump) const
+{
+ Resource::onMemoryDump(memoryDump);
+ const String name = getMemoryDumpName() + "/decoded_script";
+ auto dump = memoryDump->createMemoryAllocatorDump(name);
+ dump->AddScalar("size", "bytes", m_script.string().sizeInBytes());
+ memoryDump->AddSuballocation(dump->guid(), String(WTF::Partitions::kAllocatedObjectPoolName));
+}
+
AtomicString ScriptResource::mimeType() const
{
return extractMIMETypeFromMediaType(m_response.httpHeaderField("Content-Type")).lower();

Powered by Google App Engine
This is Rietveld 408576698