fix: initialize tracing controller before starting platform (#14499)

This commit is contained in:
Jeremy Apthorp 2018-09-08 01:42:57 -07:00 committed by Aleksei Kuzmin
parent 7589555cec
commit 829b230b85

View file

@ -49,11 +49,12 @@ bool JavascriptEnvironment::Initialize() {
// The V8Platform of gin relies on Chromium's task schedule, which has not
// been started at this point, so we have to rely on Node's V8Platform.
auto* tracing_controller = new v8::TracingController();
node::tracing::TraceEventHelper::SetTracingController(tracing_controller);
platform_ = node::CreatePlatform(
base::RecommendedMaxNumberOfThreadsInPool(3, 8, 0.1, 0), nullptr);
base::RecommendedMaxNumberOfThreadsInPool(3, 8, 0.1, 0),
tracing_controller);
v8::V8::InitializePlatform(platform_);
node::tracing::TraceEventHelper::SetTracingController(
new v8::TracingController());
gin::IsolateHolder::Initialize(
gin::IsolateHolder::kNonStrictMode, gin::IsolateHolder::kStableV8Extras,
gin::ArrayBufferAllocator::SharedInstance(),