| 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 GIN_V8_ISOLATE_MEMORY_DUMP_PROVIDER_H_ | 5 #ifndef GIN_V8_ISOLATE_MEMORY_DUMP_PROVIDER_H_ |
| 6 #define GIN_V8_ISOLATE_MEMORY_DUMP_PROVIDER_H_ | 6 #define GIN_V8_ISOLATE_MEMORY_DUMP_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/trace_event/memory_dump_provider.h" | 10 #include "base/trace_event/memory_dump_provider.h" |
| 11 #include "gin/gin_export.h" | 11 #include "gin/gin_export.h" |
| 12 | 12 |
| 13 namespace gin { | 13 namespace gin { |
| 14 | 14 |
| 15 class IsolateHolder; | 15 class IsolateHolder; |
| 16 | 16 |
| 17 // Memory dump provider for the chrome://tracing infrastructure. It dumps | 17 // Memory dump provider for the chrome://tracing infrastructure. It dumps |
| 18 // summarized memory stats about the V8 Isolate. | 18 // summarized memory stats about the V8 Isolate. |
| 19 class V8IsolateMemoryDumpProvider | 19 class V8IsolateMemoryDumpProvider |
| 20 : public base::trace_event::MemoryDumpProvider { | 20 : public base::trace_event::MemoryDumpProvider { |
| 21 public: | 21 public: |
| 22 explicit V8IsolateMemoryDumpProvider(IsolateHolder* isolate_holder); | 22 explicit V8IsolateMemoryDumpProvider(IsolateHolder* isolate_holder); |
| 23 ~V8IsolateMemoryDumpProvider() override; | 23 ~V8IsolateMemoryDumpProvider() override; |
| 24 | 24 |
| 25 // MemoryDumpProvider implementation. | 25 // MemoryDumpProvider implementation. |
| 26 bool OnMemoryDump( | 26 bool OnMemoryDump( |
| 27 const base::trace_event::MemoryDumpArgs& args, |
| 27 base::trace_event::ProcessMemoryDump* process_memory_dump) override; | 28 base::trace_event::ProcessMemoryDump* process_memory_dump) override; |
| 28 | 29 |
| 29 private: | 30 private: |
| 30 void DumpHeapStatistics( | 31 void DumpHeapStatistics( |
| 31 base::trace_event::ProcessMemoryDump* process_memory_dump); | 32 base::trace_event::ProcessMemoryDump* process_memory_dump); |
| 32 | 33 |
| 33 IsolateHolder* isolate_holder_; // Not owned. | 34 IsolateHolder* isolate_holder_; // Not owned. |
| 34 | 35 |
| 35 DISALLOW_COPY_AND_ASSIGN(V8IsolateMemoryDumpProvider); | 36 DISALLOW_COPY_AND_ASSIGN(V8IsolateMemoryDumpProvider); |
| 36 }; | 37 }; |
| 37 | 38 |
| 38 } // namespace gin | 39 } // namespace gin |
| 39 | 40 |
| 40 #endif // GIN_V8_ISOLATE_MEMORY_DUMP_PROVIDER_H_ | 41 #endif // GIN_V8_ISOLATE_MEMORY_DUMP_PROVIDER_H_ |
| OLD | NEW |