Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1740)

Unified Diff: content/renderer/pepper/plugin_object.cc

Issue 1814093003: LayoutTests: migrate nested-plugin-objects to ppapi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_linux_plugins_expectations
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ppapi/proxy/plugin_var_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/plugin_object.cc
diff --git a/content/renderer/pepper/plugin_object.cc b/content/renderer/pepper/plugin_object.cc
index 2c1f91cb9aee8f7893b970aee0ca009d1cf4003f..3fb63795de43b5dc1f275b4913cf0ede464b154c 100644
--- a/content/renderer/pepper/plugin_object.cc
+++ b/content/renderer/pepper/plugin_object.cc
@@ -94,6 +94,12 @@ PP_Var PluginObject::Create(PepperPluginInstanceImpl* instance,
v8::Local<v8::Value> PluginObject::GetNamedProperty(
v8::Isolate* isolate,
const std::string& identifier) {
+ if (!instance_) {
+ std::string error = "Property " + identifier + " does not exist.";
+ isolate->ThrowException(
+ v8::Exception::ReferenceError(gin::StringToV8(isolate, error)));
+ return v8::Local<v8::Value>();
+ }
ScopedPPVar identifier_var(ScopedPPVar::PassRef(),
StringVar::StringToPPVar(identifier));
return GetPropertyOrMethod(instance_->GetIsolate(), identifier_var.get());
@@ -102,8 +108,12 @@ v8::Local<v8::Value> PluginObject::GetNamedProperty(
bool PluginObject::SetNamedProperty(v8::Isolate* isolate,
const std::string& identifier,
v8::Local<v8::Value> value) {
- if (!instance_)
+ if (!instance_) {
+ std::string error = "Property " + identifier + " does not exist.";
+ isolate->ThrowException(
+ v8::Exception::ReferenceError(gin::StringToV8(isolate, error)));
return false;
+ }
ScopedPPVar identifier_var(ScopedPPVar::PassRef(),
StringVar::StringToPPVar(identifier));
V8VarConverter var_converter(instance_->pp_instance(),
« no previous file with comments | « no previous file | ppapi/proxy/plugin_var_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698