Update V8 to version 4.7.1.
[chromium-blink-merge.git] / gin / v8_isolate_memory_dump_provider.h
blob2a2c5dbcdb007a2f1a5f642bb143091f80b608da
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
3 // found in the LICENSE file.
5 #ifndef GIN_V8_ISOLATE_MEMORY_DUMP_PROVIDER_H_
6 #define GIN_V8_ISOLATE_MEMORY_DUMP_PROVIDER_H_
8 #include <string>
10 #include "base/trace_event/memory_dump_provider.h"
11 #include "gin/gin_export.h"
13 namespace gin {
15 class IsolateHolder;
17 // Memory dump provider for the chrome://tracing infrastructure. It dumps
18 // summarized memory stats about the V8 Isolate.
19 class V8IsolateMemoryDumpProvider
20 : public base::trace_event::MemoryDumpProvider {
21 public:
22 explicit V8IsolateMemoryDumpProvider(IsolateHolder* isolate_holder);
23 ~V8IsolateMemoryDumpProvider() override;
25 // MemoryDumpProvider implementation.
26 bool OnMemoryDump(
27 const base::trace_event::MemoryDumpArgs& args,
28 base::trace_event::ProcessMemoryDump* process_memory_dump) override;
30 private:
31 void DumpHeapStatistics(
32 const base::trace_event::MemoryDumpArgs& args,
33 base::trace_event::ProcessMemoryDump* process_memory_dump);
35 IsolateHolder* isolate_holder_; // Not owned.
37 DISALLOW_COPY_AND_ASSIGN(V8IsolateMemoryDumpProvider);
40 } // namespace gin
42 #endif // GIN_V8_ISOLATE_MEMORY_DUMP_PROVIDER_H_