Commit ec366c57 authored by Timothy Gu's avatar Timothy Gu Committed by Commit Bot

Simplify code with EnteredDOMWindow()

Change-Id: Id940eaf4ad7703f20009ae9dcb0497b07ef010be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2223982
Auto-Submit: Timothy Gu <timothygu@chromium.org>
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773544}
parent 86dd70c3
...@@ -153,9 +153,8 @@ void V8DevToolsHost::ShowContextMenuAtPointMethodCustom( ...@@ -153,9 +153,8 @@ void V8DevToolsHost::ShowContextMenuAtPointMethodCustom(
if (info.Length() >= 4 && info[3]->IsObject()) { if (info.Length() >= 4 && info[3]->IsObject()) {
document = V8HTMLDocument::ToImplWithTypeCheck(isolate, info[3]); document = V8HTMLDocument::ToImplWithTypeCheck(isolate, info[3]);
} else { } else {
DOMWindow* window = V8Window::ToImplWithTypeCheck( LocalDOMWindow* window = EnteredDOMWindow(isolate);
isolate, isolate->GetEnteredOrMicrotaskContext()->Global()); document = window ? window->document() : nullptr;
document = window ? To<LocalDOMWindow>(window)->document() : nullptr;
} }
if (!document || !document->GetFrame()) if (!document || !document->GetFrame())
return; return;
......
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