Commit c0147f42 authored by tzik's avatar tzik Committed by Commit Bot

Use GetEnteredOrMicrotaskContext instead of GetEnteredContext

This CL replaces all usage of v8::Isolate::GetEnteredContext in Blink
with GetEnteredOrMicrotaskContext.
GetEnteredOrMicrotaskContext should be the better fit here as the
EnteredContext may be unrelated to the currently running script's context
when it's in the microtask queue.

chromium: 887920
Change-Id: I9da9777fb3b365fa181d2d9660c36a071734acf3
Reviewed-on: https://chromium-review.googlesource.com/c/1319220Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605964}
parent 8524ac46
...@@ -155,7 +155,7 @@ void V8DevToolsHost::showContextMenuAtPointMethodCustom( ...@@ -155,7 +155,7 @@ void V8DevToolsHost::showContextMenuAtPointMethodCustom(
} else { } else {
v8::Local<v8::Object> window_wrapper = v8::Local<v8::Object> window_wrapper =
V8Window::findInstanceInPrototypeChain( V8Window::findInstanceInPrototypeChain(
isolate->GetEnteredContext()->Global(), isolate); isolate->GetEnteredOrMicrotaskContext()->Global(), isolate);
if (window_wrapper.IsEmpty()) if (window_wrapper.IsEmpty())
return; return;
DOMWindow* window = V8Window::ToImpl(window_wrapper); DOMWindow* window = V8Window::ToImpl(window_wrapper);
......
...@@ -242,7 +242,7 @@ void V8Initializer::MessageHandlerInMainThread(v8::Local<v8::Message> message, ...@@ -242,7 +242,7 @@ void V8Initializer::MessageHandlerInMainThread(v8::Local<v8::Message> message,
DCHECK(IsMainThread()); DCHECK(IsMainThread());
v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::Isolate* isolate = v8::Isolate::GetCurrent();
if (isolate->GetEnteredContext().IsEmpty()) if (isolate->GetEnteredOrMicrotaskContext().IsEmpty())
return; return;
// If called during context initialization, there will be no entered context. // If called during context initialization, there will be no entered context.
......
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