v8_shared_memory_dump_provider.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2019 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.
  4. #ifndef GIN_V8_SHARED_MEMORY_DUMP_PROVIDER_H_
  5. #define GIN_V8_SHARED_MEMORY_DUMP_PROVIDER_H_
  6. #include "base/trace_event/memory_dump_provider.h"
  7. #include "gin/gin_export.h"
  8. namespace gin {
  9. // Memory dump provider for the chrome://tracing infrastructure. It dumps
  10. // summarized memory stats about V8 Memory shared between Isolates in the same
  11. // process.
  12. class GIN_EXPORT V8SharedMemoryDumpProvider
  13. : public base::trace_event::MemoryDumpProvider {
  14. public:
  15. V8SharedMemoryDumpProvider();
  16. V8SharedMemoryDumpProvider(const V8SharedMemoryDumpProvider&) = delete;
  17. V8SharedMemoryDumpProvider& operator=(const V8SharedMemoryDumpProvider&) =
  18. delete;
  19. // MemoryDumpProvider implementation.
  20. bool OnMemoryDump(
  21. const base::trace_event::MemoryDumpArgs& args,
  22. base::trace_event::ProcessMemoryDump* process_memory_dump) override;
  23. static void Register();
  24. };
  25. } // namespace gin
  26. #endif // GIN_V8_SHARED_MEMORY_DUMP_PROVIDER_H_