Commit d2b35f5b authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[cleanup] Fix use of deprecated GetFunction method

Use MaybeLocal version of GetFunction in SandboxStatusExtension as
original function is deprecated. Since the original code DCHECKs that
other failure can't happen, I've used the same pattern rather than
ToLocalChecked.

Bug: v8:7295, v8:8238
Change-Id: I29178794660dc7c5cf6d6bba0c617dfbbb37757d
Reviewed-on: https://chromium-review.googlesource.com/c/1348047Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611052}
parent 0a13c906
......@@ -76,11 +76,16 @@ void SandboxStatusExtension::Install() {
v8::Local<v8::Object> chrome =
content::GetOrCreateChromeObject(isolate, context->Global());
bool success = chrome->Set(
gin::StringToSymbol(isolate, "getAndroidSandboxStatus"),
v8::Local<v8::Function> function;
bool success =
gin::CreateFunctionTemplate(
isolate, base::Bind(&SandboxStatusExtension::GetSandboxStatus, this))
->GetFunction());
->GetFunction(context)
.ToLocal(&function);
if (success) {
success = chrome->Set(
gin::StringToSymbol(isolate, "getAndroidSandboxStatus"), function);
}
DCHECK(success);
}
......
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