Commit 5619c57d authored by Keishi Hattori's avatar Keishi Hattori Committed by Commit Bot

Support remote objects in WorldSafeV8Reference

Support remote objects in WorldSafeV8Reference by skipping the world check when creation context is not available.

Since ScriptValue is backed by WorldSafeV8Reference since r701030, remote objects may be assigned to WorldSafeV8References.

Bug: 1009159
Change-Id: I1117dffcd9a09279ea6add1d45f56ac69c6dfa25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832844Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701491}
parent 779cda84
......@@ -41,8 +41,12 @@ void WorldSafeV8ReferenceInternal::MaybeCheckCreationContextWorld(
if (!value->IsObject())
return;
ScriptState* script_state =
ScriptState::From(value.As<v8::Object>()->CreationContext());
v8::Local<v8::Context> context = value.As<v8::Object>()->CreationContext();
// Creation context is null if the value is a remote object.
if (context.IsEmpty())
return;
ScriptState* script_state = ScriptState::From(context);
CHECK_EQ(&world, &script_state->World());
}
......
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