Chromium Code Reviews| 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 347de8c64735c7c9973b08253083e3c32f3f3d9b..1b47d0854460c01c5bf038cf904b00d8326b61c9 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 |
|
haraken
2015/09/28 14:54:02
Why do you specialize for ScriptResource (while yo
ssid
2015/09/28 16:24:38
Ah because the Scripts keep count of the decoded s
|
| +{ |
| + 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::allocatorPoolNameForTracing())); |
| +} |
| + |
| AtomicString ScriptResource::mimeType() const |
| { |
| return extractMIMETypeFromMediaType(m_response.httpHeaderField("Content-Type")).lower(); |