Skip to content

Commit

Permalink
src: clean up embedder API
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Oct 24, 2022
1 parent bf88f05 commit f047342
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions shell/browser/javascript_environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop) {
auto* tracing_agent = node::CreateAgent();
auto* tracing_controller = new TracingControllerImpl();
node::tracing::TraceEventHelper::SetAgent(tracing_agent);
platform_ = node::CreatePlatform(
platform_ = node::MultiIsolatePlatform::Create(
base::RecommendedMaxNumberOfThreadsInThreadGroup(3, 8, 0.1, 0),
tracing_controller, gin::V8Platform::PageAllocator());

v8::V8::InitializePlatform(platform_);
v8::V8::InitializePlatform(platform_.get());
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,
gin::ArrayBufferAllocator::SharedInstance(),
nullptr /* external_reference_table */,
Expand Down
5 changes: 2 additions & 3 deletions shell/browser/javascript_environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class JavascriptEnvironment {
void CreateMicrotasksRunner();
void DestroyMicrotasksRunner();

node::MultiIsolatePlatform* platform() const { return platform_; }
node::MultiIsolatePlatform* platform() const { return platform_.get(); }
v8::Isolate* isolate() const { return isolate_; }
v8::Local<v8::Context> context() const {
return v8::Local<v8::Context>::New(isolate_, context_);
Expand All @@ -42,8 +42,7 @@ class JavascriptEnvironment {

private:
v8::Isolate* Initialize(uv_loop_t* event_loop);
// Leaked on exit.
node::MultiIsolatePlatform* platform_;
std::unique_ptr<node::MultiIsolatePlatform> platform_;

v8::Isolate* isolate_;
gin::IsolateHolder isolate_holder_;
Expand Down

0 comments on commit f047342

Please sign in to comment.