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

Fix deprecated V8 function use in content_shell

Fixes use of deprecated Object::Set V8 function by instead using the
Context version and checking the return value.

Bug: v8:7283, v8:8562
Change-Id: Ia3ab123d36507576bde1a9dcd79ffbdc545469a4
Reviewed-on: https://chromium-review.googlesource.com/c/1454528
Commit-Queue: Dan Elphick <delphick@chromium.org>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629162}
parent 1479ac65
...@@ -71,8 +71,10 @@ void AccessibilityControllerBindings::Install( ...@@ -71,8 +71,10 @@ void AccessibilityControllerBindings::Install(
if (bindings.IsEmpty()) if (bindings.IsEmpty())
return; return;
v8::Local<v8::Object> global = context->Global(); v8::Local<v8::Object> global = context->Global();
global->Set(gin::StringToV8(isolate, "accessibilityController"), global
bindings.ToV8()); ->Set(context, gin::StringToV8(isolate, "accessibilityController"),
bindings.ToV8())
.Check();
} }
AccessibilityControllerBindings::AccessibilityControllerBindings( AccessibilityControllerBindings::AccessibilityControllerBindings(
......
...@@ -702,7 +702,8 @@ void EventSenderBindings::Install(base::WeakPtr<EventSender> sender, ...@@ -702,7 +702,8 @@ void EventSenderBindings::Install(base::WeakPtr<EventSender> sender,
if (bindings.IsEmpty()) if (bindings.IsEmpty())
return; return;
v8::Local<v8::Object> global = context->Global(); v8::Local<v8::Object> global = context->Global();
global->Set(gin::StringToV8(isolate, "eventSender"), bindings.ToV8()); global->Set(context, gin::StringToV8(isolate, "eventSender"), bindings.ToV8())
.Check();
} }
gin::ObjectTemplateBuilder EventSenderBindings::GetObjectTemplateBuilder( gin::ObjectTemplateBuilder EventSenderBindings::GetObjectTemplateBuilder(
......
...@@ -91,7 +91,10 @@ void GamepadControllerBindings::Install( ...@@ -91,7 +91,10 @@ void GamepadControllerBindings::Install(
if (bindings.IsEmpty()) if (bindings.IsEmpty())
return; return;
v8::Local<v8::Object> global = context->Global(); v8::Local<v8::Object> global = context->Global();
global->Set(gin::StringToV8(isolate, "gamepadController"), bindings.ToV8()); global
->Set(context, gin::StringToV8(isolate, "gamepadController"),
bindings.ToV8())
.Check();
} }
GamepadControllerBindings::GamepadControllerBindings( GamepadControllerBindings::GamepadControllerBindings(
......
...@@ -34,7 +34,10 @@ void GCController::Install(TestInterfaces* interfaces, ...@@ -34,7 +34,10 @@ void GCController::Install(TestInterfaces* interfaces,
if (controller.IsEmpty()) if (controller.IsEmpty())
return; return;
v8::Local<v8::Object> global = context->Global(); v8::Local<v8::Object> global = context->Global();
global->Set(gin::StringToV8(isolate, "GCController"), controller.ToV8()); global
->Set(context, gin::StringToV8(isolate, "GCController"),
controller.ToV8())
.Check();
} }
GCController::GCController(TestInterfaces* interfaces) GCController::GCController(TestInterfaces* interfaces)
......
...@@ -332,7 +332,8 @@ void TestRunnerBindings::Install( ...@@ -332,7 +332,8 @@ void TestRunnerBindings::Install(
v8::Local<v8::Object> global = context->Global(); v8::Local<v8::Object> global = context->Global();
v8::Local<v8::Value> v8_bindings = bindings.ToV8(); v8::Local<v8::Value> v8_bindings = bindings.ToV8();
global->Set(gin::StringToV8(isolate, "testRunner"), v8_bindings); global->Set(context, gin::StringToV8(isolate, "testRunner"), v8_bindings)
.Check();
// Inject some JavaScript to the top-level frame of a reftest in the // Inject some JavaScript to the top-level frame of a reftest in the
// web-platform-tests suite to have the same reftest screenshot timing as // web-platform-tests suite to have the same reftest screenshot timing as
......
...@@ -85,7 +85,10 @@ void TextInputControllerBindings::Install( ...@@ -85,7 +85,10 @@ void TextInputControllerBindings::Install(
if (bindings.IsEmpty()) if (bindings.IsEmpty())
return; return;
v8::Local<v8::Object> global = context->Global(); v8::Local<v8::Object> global = context->Global();
global->Set(gin::StringToV8(isolate, "textInputController"), bindings.ToV8()); global
->Set(context, gin::StringToV8(isolate, "textInputController"),
bindings.ToV8())
.Check();
} }
TextInputControllerBindings::TextInputControllerBindings( TextInputControllerBindings::TextInputControllerBindings(
......
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