Commit 2a5c4a35 authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

Fix deprecated V8 function use in blink/renderer

Fix uses of deprecated Object::Get/Set V8 functions by instead using the
Context versions and checking the return values.

Bug: v8:7283, v8:8562
Change-Id: Ib404f83495ae5988050b9fd6e9722d8593b05f50
Reviewed-on: https://chromium-review.googlesource.com/c/1454490
Commit-Queue: Dan Elphick <delphick@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629166}
parent 172ccc05
......@@ -84,7 +84,10 @@ void DevToolsFrontendImpl::DidClearWindowObject() {
v8::Local<v8::Value> devtools_host_obj =
ToV8(devtools_host_.Get(), global, script_state->GetIsolate());
DCHECK(!devtools_host_obj.IsEmpty());
global->Set(V8AtomicString(isolate, "DevToolsHost"), devtools_host_obj);
global
->Set(script_state->GetContext(),
V8AtomicString(isolate, "DevToolsHost"), devtools_host_obj)
.Check();
}
if (!api_script_.IsEmpty()) {
......
......@@ -6516,7 +6516,8 @@ class CompositedSelectionBoundsTest
ASSERT_NE(selection.end, cc::LayerSelectionBound());
blink::Node* layer_owner_node_for_start = V8Node::ToImplWithTypeCheck(
v8::Isolate::GetCurrent(), expected_result.Get(0));
v8::Isolate::GetCurrent(),
expected_result.Get(context, 0).ToLocalChecked());
ASSERT_TRUE(layer_owner_node_for_start);
EXPECT_EQ(GetExpectedLayerForSelection(layer_owner_node_for_start)
->CcLayer()
......
......@@ -37,9 +37,10 @@ std::unique_ptr<IDBValue> CreateNullIDBValueForTesting(v8::Isolate* isolate) {
std::unique_ptr<IDBValue> CreateIDBValueForTesting(v8::Isolate* isolate,
bool create_wrapped_value) {
uint32_t element_count = create_wrapped_value ? 16 : 2;
v8::Local<v8::Context> context = isolate->GetCurrentContext();
v8::Local<v8::Array> v8_array = v8::Array::New(isolate, element_count);
for (uint32_t i = 0; i < element_count; ++i)
v8_array->Set(i, v8::True(isolate));
v8_array->Set(context, i, v8::True(isolate)).Check();
NonThrowableExceptionState non_throwable_exception_state;
IDBValueWrapper wrapper(isolate, v8_array,
......
......@@ -78,8 +78,11 @@ TEST(PaymentResponseTest, DataCopiedOver) {
ScriptValue transaction_id(
scope.GetScriptState(),
details.V8Value().As<v8::Object>()->Get(
V8String(scope.GetScriptState()->GetIsolate(), "transactionId")));
details.V8Value()
.As<v8::Object>()
->Get(scope.GetContext(),
V8String(scope.GetIsolate(), "transactionId"))
.ToLocalChecked());
ASSERT_TRUE(transaction_id.V8Value()->IsNumber());
EXPECT_EQ(123, transaction_id.V8Value().As<v8::Number>()->Value());
......
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