Commit 2555486f authored by Mythri Alle's avatar Mythri Alle Committed by Commit Bot

Use maybe version of v8::Object::Has, v8::Object::Delete

V8 API will deprecate the non maybe versions of v8::Object::Has
and v8::Object::Delete. Updated pepper implementation to use
maybe versions.

Bug: v8:7284
Change-Id: Ie582b1ef97f3943ba06e8f3f76d2225f9fffe616
Reviewed-on: https://chromium-review.googlesource.com/c/1254145
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: default avatarBill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597053}
parent 6cba024f
...@@ -98,9 +98,16 @@ bool HasPropertyDeprecated(PP_Var var, PP_Var name, PP_Var* exception) { ...@@ -98,9 +98,16 @@ bool HasPropertyDeprecated(PP_Var var, PP_Var name, PP_Var* exception) {
if (try_catch.HasException()) if (try_catch.HasException())
return false; return false;
bool result = accessor.GetObject()->Has(v8_name); v8::Local<v8::Context> context = try_catch.GetContext();
if (try_catch.HasException()) if (try_catch.HasException())
return false; return false;
bool result = false;
if (!accessor.GetObject()->Has(context, v8_name).To(&result)) {
try_catch.HasException();
return false;
}
return result; return result;
} }
...@@ -115,8 +122,17 @@ bool HasMethodDeprecated(PP_Var var, PP_Var name, PP_Var* exception) { ...@@ -115,8 +122,17 @@ bool HasMethodDeprecated(PP_Var var, PP_Var name, PP_Var* exception) {
if (try_catch.HasException()) if (try_catch.HasException())
return false; return false;
bool result = accessor.GetObject()->Has(v8_name) && v8::Local<v8::Context> context = try_catch.GetContext();
accessor.GetObject()->Get(v8_name)->IsFunction(); if (try_catch.HasException())
return false;
bool has_name = false;
if (!accessor.GetObject()->Has(context, v8_name).To(&has_name)) {
try_catch.HasException();
return false;
}
bool result = has_name && accessor.GetObject()->Get(v8_name)->IsFunction();
if (try_catch.HasException()) if (try_catch.HasException())
return false; return false;
return result; return result;
...@@ -203,8 +219,16 @@ void DeletePropertyDeprecated(PP_Var var, PP_Var name, PP_Var* exception) { ...@@ -203,8 +219,16 @@ void DeletePropertyDeprecated(PP_Var var, PP_Var name, PP_Var* exception) {
if (try_catch.HasException()) if (try_catch.HasException())
return; return;
accessor.GetObject()->Delete(v8_name); v8::Local<v8::Context> context = try_catch.GetContext();
try_catch.HasException(); // Ensure an exception gets set if one occured. if (try_catch.HasException())
return;
if (accessor.GetObject()->Delete(context, v8_name).IsNothing()) {
// Ensure exception object is created if V8 has thrown.
try_catch.HasException();
return;
}
return;
} }
PP_Var CallDeprecatedInternal(PP_Var var, PP_Var CallDeprecatedInternal(PP_Var var,
......
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