Commit 9d90e601 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

cppgc: Provide default implementation of Platform::GetTracingController

Bug: chromium:1056170
Change-Id: I53e0e45045282c1fd217af34ff31b7e6411624b1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2552508
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71316}
parent 32d2c0df
......@@ -116,9 +116,11 @@ class V8_EXPORT Platform {
}
/**
* Returns an instance of a TracingController. This must be non-nullptr.
* Returns an instance of a `TracingController`. This must be non-nullptr. The
* default implementation returns an empty `TracingController` that consumes
* trace data without effect.
*/
virtual TracingController* GetTracingController() = 0;
virtual TracingController* GetTracingController();
};
/**
......
......@@ -4,11 +4,17 @@
#include "include/cppgc/platform.h"
#include "src/base/lazy-instance.h"
#include "src/base/platform/platform.h"
#include "src/heap/cppgc/gc-info-table.h"
namespace cppgc {
TracingController* Platform::GetTracingController() {
static v8::base::LeakyObject<TracingController> tracing_controller;
return tracing_controller.get();
}
void InitializeProcess(PageAllocator* page_allocator) {
internal::GlobalGCInfoTable::Create(page_allocator);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment