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

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

Issue 640033003: Don't call SetProperty on the plugin unless HasProperty is true (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | no next file » | 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 8cdbdb98c3cb5d64a95e25c329d6260eb655f3c0..c7dd883f46dad5c54415d09b329d9678b4df08a7 100644
--- a/content/renderer/pepper/plugin_object.cc
+++ b/content/renderer/pepper/plugin_object.cc
@@ -97,6 +97,16 @@ bool PluginObject::SetNamedProperty(v8::Isolate* isolate,
StringVar::StringToPPVar(identifier));
PepperTryCatchV8 try_catch(instance_, V8VarConverter::kAllowObjectVars,
isolate);
+
+ bool has_property =
+ ppp_class_->HasProperty(ppp_class_data_, identifier_var.get(),
+ try_catch.exception());
+ if (try_catch.ThrowException())
+ return false;
+
+ if (!has_property)
+ return false;
+
ScopedPPVar var = try_catch.FromV8(value);
if (try_catch.ThrowException())
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698