Handle v8::MicrotasksScope in the main process
This commit is contained in:
parent
5826a8f9a9
commit
ee28f4fc32
7 changed files with 27 additions and 25 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "gin/array_buffer.h"
|
||||
#include "gin/v8_initializer.h"
|
||||
|
@ -23,6 +24,14 @@ JavascriptEnvironment::JavascriptEnvironment()
|
|||
context_scope_(v8::Local<v8::Context>::New(isolate_, context_)) {
|
||||
}
|
||||
|
||||
void JavascriptEnvironment::OnMessageLoopCreated() {
|
||||
isolate_holder_.AddRunMicrotasksObserver();
|
||||
}
|
||||
|
||||
void JavascriptEnvironment::OnMessageLoopDestroying() {
|
||||
isolate_holder_.RemoveRunMicrotasksObserver();
|
||||
}
|
||||
|
||||
bool JavascriptEnvironment::Initialize() {
|
||||
auto cmd = base::CommandLine::ForCurrentProcess();
|
||||
if (cmd->HasSwitch("debug-brk")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue