| 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 #ifndef WebProcessMemoryDump_h | 5 #ifndef WebProcessMemoryDump_h |
| 6 #define WebProcessMemoryDump_h | 6 #define WebProcessMemoryDump_h |
| 7 | 7 |
| 8 #include "WebCommon.h" | 8 #include "WebCommon.h" |
| 9 #include "WebMemoryAllocatorDump.h" | 9 #include "WebMemoryAllocatorDump.h" |
| 10 #include "WebMemoryDumpProvider.h" | |
| 11 #include "WebString.h" | 10 #include "WebString.h" |
| 12 #include "base/trace_event/heap_profiler_allocation_context.h" | 11 #include "base/trace_event/heap_profiler_allocation_context.h" |
| 13 | 12 |
| 14 class SkTraceMemoryDump; | 13 class SkTraceMemoryDump; |
| 15 | 14 |
| 16 namespace base { | 15 namespace base { |
| 17 | 16 |
| 18 class DiscardableMemory; | 17 class DiscardableMemory; |
| 19 | 18 |
| 20 namespace trace_event { | 19 namespace trace_event { |
| 21 | 20 |
| 22 class ProcessMemoryDump; | 21 class ProcessMemoryDump; |
| 23 class TraceEventMemoryOverhead; | 22 class TraceEventMemoryOverhead; |
| 24 | 23 |
| 25 } // namespace trace_event | 24 } // namespace trace_event |
| 26 } // namespace base | 25 } // namespace base |
| 27 | 26 |
| 28 namespace blink { | 27 namespace blink { |
| 29 | 28 |
| 29 // Used to specify the type of memory dump the WebProcessMemoryDump should |
| 30 // generate on dump requests. |
| 31 // TODO(hajimehoshi): Remove this and use base::trace_event:: |
| 32 // MemoryDumpLevelOfDetail instead. |
| 33 enum class WebMemoryDumpLevelOfDetail { |
| 34 Light, |
| 35 Detailed |
| 36 }; |
| 37 |
| 30 // A container which holds all the dumps for the various allocators for a given | 38 // A container which holds all the dumps for the various allocators for a given |
| 31 // process. Embedders of WebMemoryDumpProvider are expected to populate a | 39 // process. Embedders of WebMemoryDumpProvider are expected to populate a |
| 32 // WebProcessMemoryDump instance with the stats of their allocators. | 40 // WebProcessMemoryDump instance with the stats of their allocators. |
| 33 class BLINK_PLATFORM_EXPORT WebProcessMemoryDump { | 41 class BLINK_PLATFORM_EXPORT WebProcessMemoryDump { |
| 34 public: | 42 public: |
| 35 virtual ~WebProcessMemoryDump(); | 43 virtual ~WebProcessMemoryDump(); |
| 36 | 44 |
| 37 // Creates a new MemoryAllocatorDump with the given name and returns the | 45 // Creates a new MemoryAllocatorDump with the given name and returns the |
| 38 // empty object back to the caller. |absoluteName| uniquely identifies the | 46 // empty object back to the caller. |absoluteName| uniquely identifies the |
| 39 // dump within the scope of a ProcessMemoryDump. It is possible to express | 47 // dump within the scope of a ProcessMemoryDump. It is possible to express |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 virtual blink::WebMemoryAllocatorDump* createDiscardableMemoryAllocatorDump(
const std::string& name, base::DiscardableMemory*) = 0; | 97 virtual blink::WebMemoryAllocatorDump* createDiscardableMemoryAllocatorDump(
const std::string& name, base::DiscardableMemory*) = 0; |
| 90 | 98 |
| 91 // Dumps heap memory usage. |allocatorName| is used as an absolute name for | 99 // Dumps heap memory usage. |allocatorName| is used as an absolute name for |
| 92 // base::trace_event::ProcessMemoryDump::AddHeapDump. | 100 // base::trace_event::ProcessMemoryDump::AddHeapDump. |
| 93 virtual void dumpHeapUsage(const base::hash_map<base::trace_event::Allocatio
nContext, base::trace_event::AllocationMetrics>& metricsByContext, base::trace_e
vent::TraceEventMemoryOverhead&, const char* allocatorName) = 0; | 101 virtual void dumpHeapUsage(const base::hash_map<base::trace_event::Allocatio
nContext, base::trace_event::AllocationMetrics>& metricsByContext, base::trace_e
vent::TraceEventMemoryOverhead&, const char* allocatorName) = 0; |
| 94 }; | 102 }; |
| 95 | 103 |
| 96 } // namespace blink | 104 } // namespace blink |
| 97 | 105 |
| 98 #endif // WebProcessMemoryDump_h | 106 #endif // WebProcessMemoryDump_h |
| OLD | NEW |