Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "Source/platform/heap/BlinkGCMemoryDumpProvider.h" | 6 #include "Source/platform/heap/BlinkGCMemoryDumpProvider.h" |
| 7 | 7 |
| 8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
| 9 #include "public/platform/WebMemoryAllocatorDump.h" | 9 #include "public/platform/WebMemoryAllocatorDump.h" |
| 10 #include "public/platform/WebProcessMemoryDump.h" | 10 #include "public/platform/WebProcessMemoryDump.h" |
| 11 #include "wtf/StdLibExtras.h" | 11 #include "wtf/StdLibExtras.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 BlinkGCMemoryDumpProvider* BlinkGCMemoryDumpProvider::instance() | 15 BlinkGCMemoryDumpProvider* BlinkGCMemoryDumpProvider::instance() |
| 16 { | 16 { |
| 17 DEFINE_STATIC_LOCAL(BlinkGCMemoryDumpProvider, instance, ()); | 17 DEFINE_STATIC_LOCAL(BlinkGCMemoryDumpProvider, instance, ()); |
| 18 return &instance; | 18 return &instance; |
| 19 } | 19 } |
| 20 | 20 |
| 21 bool BlinkGCMemoryDumpProvider::onMemoryDump(blink::WebProcessMemoryDump* memory Dump) | 21 BlinkGCMemoryDumpProvider::~BlinkGCMemoryDumpProvider() |
| 22 { | 22 { |
| 23 } | |
| 24 | |
| 25 bool BlinkGCMemoryDumpProvider::onMemoryDump(WebProcessMemoryDump* memoryDump) | |
| 26 { | |
| 27 // The current heap statistics are added to the memory dump. | |
| 23 WebMemoryAllocatorDump* allocatorDump = memoryDump->createMemoryAllocatorDum p("blink_gc"); | 28 WebMemoryAllocatorDump* allocatorDump = memoryDump->createMemoryAllocatorDum p("blink_gc"); |
| 24 allocatorDump->AddScalar("inner_size", "bytes", Heap::allocatedObjectSize()) ; | 29 allocatorDump->AddScalar("inner_size", "bytes", Heap::allocatedObjectSize()) ; |
| 25 allocatorDump->AddScalar("outer_size", "bytes", Heap::allocatedSpace()); | 30 allocatorDump->AddScalar("outer_size", "bytes", Heap::allocatedSpace()); |
| 26 allocatorDump->AddScalar("estimated_live_object_size", "bytes", Heap::estima tedLiveObjectSize()); | 31 allocatorDump->AddScalar("estimated_live_object_size", "bytes", Heap::estima tedLiveObjectSize()); |
| 32 | |
| 33 // If available, the last GC memory statistics are added. | |
| 34 if (Heap::getLastProcessMemoryDump()) | |
| 35 memoryDump->takeAllDumpsFrom(Heap::getLastProcessMemoryDump()); | |
|
Primiano Tucci (use gerrit)
2015/05/22 15:50:21
Ok here you need the TODO pointing to crbug.com/49
ssid
2015/05/22 16:05:16
But we are dumping some overall numbers even if th
| |
| 36 | |
| 27 return true; | 37 return true; |
| 28 } | 38 } |
| 29 | 39 |
| 30 BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider() | 40 BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider() |
| 31 { | 41 { |
| 32 } | 42 } |
| 33 | 43 |
| 34 BlinkGCMemoryDumpProvider::~BlinkGCMemoryDumpProvider() | |
|
Primiano Tucci (use gerrit)
2015/05/22 15:50:21
Is this intended? I think you accidentally removed
ssid
2015/05/22 16:05:16
It is moved up to maintain the function order in h
| |
| 35 { | |
| 36 } | |
| 37 | |
| 38 } // namespace blink | 44 } // namespace blink |
| OLD | NEW |