| 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 bool BlinkGCMemoryDumpProvider::onMemoryDump(blink::WebProcessMemoryDump* memory
Dump) |
| 22 { | 22 { |
| 23 WebMemoryAllocatorDump* allocatorDump = memoryDump->createMemoryAllocatorDum
p("blink_gc"); | 23 WebMemoryAllocatorDump* allocatorDump = memoryDump->createMemoryAllocatorDum
p("blink_gc"); |
| 24 allocatorDump->AddScalar("inner_size", "bytes", Heap::allocatedObjectSize())
; | 24 allocatorDump->AddScalar("size", "bytes", Heap::allocatedSpace()); |
| 25 allocatorDump->AddScalar("outer_size", "bytes", Heap::allocatedSpace()); | 25 |
| 26 allocatorDump->AddScalar("estimated_live_object_size", "bytes", Heap::estima
tedLiveObjectSize()); | 26 WebMemoryAllocatorDump* objectsDump = memoryDump->createMemoryAllocatorDump(
"blink_gc/allocated_objects"); |
| 27 objectsDump->AddScalar("size", "bytes", Heap::allocatedObjectSize()); |
| 28 objectsDump->AddScalar("estimated_live_object_size", "bytes", Heap::estimate
dLiveObjectSize()); |
| 29 |
| 27 return true; | 30 return true; |
| 28 } | 31 } |
| 29 | 32 |
| 30 BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider() | 33 BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider() |
| 31 { | 34 { |
| 32 } | 35 } |
| 33 | 36 |
| 34 BlinkGCMemoryDumpProvider::~BlinkGCMemoryDumpProvider() | 37 BlinkGCMemoryDumpProvider::~BlinkGCMemoryDumpProvider() |
| 35 { | 38 { |
| 36 } | 39 } |
| 37 | 40 |
| 38 } // namespace blink | 41 } // namespace blink |
| OLD | NEW |