Commit 7d878392 authored by Yuki Yamada's avatar Yuki Yamada Committed by Commit Bot

Rename scopes and context in JSBasedEventListener::handleEvent()

This CL renames some ambiguous name of scope and context in
JSBasedEventListener::handleEvent().

Split from another one:
https://chromium-review.googlesource.com/c/chromium/src/+/1270300

Bug: 872138
Change-Id: I8e772ecdc283fd1585566cf56a52170b777f4608
Reviewed-on: https://chromium-review.googlesource.com/c/1277135Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Commit-Queue: Yuki Yamada <yukiy@google.com>
Cr-Commit-Position: refs/heads/master@{#599114}
parent dce70a03
......@@ -73,7 +73,7 @@ void JSBasedEventListener::handleEvent(
return;
{
v8::HandleScope scope(isolate);
v8::HandleScope handle_scope(isolate);
// Calling |GetListenerObject()| here may cause compilation of the
// uncompiled script body in eventHandler's value earlier than standard's
......@@ -92,7 +92,7 @@ void JSBasedEventListener::handleEvent(
if (!script_state_of_listener->ContextIsValid())
return;
ScriptState::Scope scope(script_state_of_listener);
ScriptState::Scope listener_script_state_scope(script_state_of_listener);
// https://dom.spec.whatwg.org/#firing-events
// Step 2. of firing events: Let event be the result of creating an event
......@@ -101,11 +101,12 @@ void JSBasedEventListener::handleEvent(
// |js_event|, a V8 wrapper object for |event|, must be created in the
// relevant realm of the event target. The world must match the event
// listener's world.
v8::Local<v8::Context> v8_context =
v8::Local<v8::Context> v8_context_of_event_target =
ToV8Context(execution_context_of_event_target, GetWorld());
if (v8_context.IsEmpty())
if (v8_context_of_event_target.IsEmpty())
return;
v8::Local<v8::Value> js_event = ToV8(event, v8_context->Global(), isolate);
v8::Local<v8::Value> js_event =
ToV8(event, v8_context_of_event_target->Global(), isolate);
if (js_event.IsEmpty())
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