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: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#71316}
This commit is contained in:
parent
32d2c0df3e
commit
9d90e60105
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user