Skip to content

Commit

Permalink
Fix use of deprecated 'Set' method
Browse files Browse the repository at this point in the history
R=lazyboy@chromium.org

Bug: v8:7283, v8:8015
Change-Id: I7a311c864bb2c6a5587215fc8e4057247ec15d8a
Reviewed-on: https://chromium-review.googlesource.com/1238454
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595013}
  • Loading branch information
szuend authored and Commit Bot committed Sep 28, 2018
1 parent e57a8b1 commit 084a665
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion extensions/renderer/dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class ChromeNativeHandler : public ObjectBackedNativeHandler {
v8::Local<v8::Value> chrome(global->Get(chrome_string));
if (chrome->IsUndefined()) {
chrome = v8::Object::New(context()->isolate());
global->Set(chrome_string, chrome);
global->Set(context()->v8_context(), chrome_string, chrome).ToChecked();
}
args.GetReturnValue().Set(chrome);
}
Expand Down
12 changes: 6 additions & 6 deletions extensions/renderer/js_extension_bindings_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ namespace {
// exist.
v8::Local<v8::Object> GetOrCreateObject(const v8::Local<v8::Object>& object,
const std::string& field,
v8::Isolate* isolate) {
ScriptContext* context) {
v8::Local<v8::String> key =
v8::String::NewFromUtf8(isolate, field.c_str(),
v8::String::NewFromUtf8(context->isolate(), field.c_str(),
v8::NewStringType::kInternalized)
.ToLocalChecked();
// If the object has a callback property, it is assumed it is an unavailable
Expand All @@ -52,8 +52,8 @@ v8::Local<v8::Object> GetOrCreateObject(const v8::Local<v8::Object>& object,
return v8::Local<v8::Object>::Cast(value);
}

v8::Local<v8::Object> new_object = v8::Object::New(isolate);
object->Set(key, new_object);
v8::Local<v8::Object> new_object = v8::Object::New(context->isolate());
object->Set(context->v8_context(), key, new_object).ToChecked();
return new_object;
}

Expand All @@ -70,7 +70,7 @@ v8::Local<v8::Object> GetOrCreateChrome(ScriptContext* context) {
v8::Local<v8::Value> chrome(global->Get(chrome_string));
if (chrome->IsUndefined()) {
chrome = v8::Object::New(context->isolate());
global->Set(chrome_string, chrome);
global->Set(context->v8_context(), chrome_string, chrome).ToChecked();
}
return chrome->IsObject() ? chrome.As<v8::Object>() : v8::Local<v8::Object>();
}
Expand Down Expand Up @@ -113,7 +113,7 @@ v8::Local<v8::Object> GetOrCreateBindObjectIfAvailable(
if (bind_object.IsEmpty())
return v8::Local<v8::Object>();
}
bind_object = GetOrCreateObject(bind_object, split[i], context->isolate());
bind_object = GetOrCreateObject(bind_object, split[i], context);
}

if (only_ancestor_available)
Expand Down

0 comments on commit 084a665

Please sign in to comment.