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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp

Issue 2745483002: Ensure that we can repeatedly set an expando on a plugin object (Closed)
Patch Set: Created 3 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 | « third_party/WebKit/LayoutTests/plugins/simple-expando.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp
index 1c60662c05a1535f9d58a73be1ab03851a21bf90..0bd54b57b921bab2b278fb610c127e42a1602418 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp
@@ -74,11 +74,6 @@ void setScriptableObjectProperty(
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<v8::Value>& info) {
ASSERT(!value.IsEmpty());
- // Don't intercept any of the properties of the HTMLPluginElement.
- v8::Local<v8::String> v8Name = v8String(info.GetIsolate(), name);
- if (v8CallBoolean(
- info.Holder()->Has(info.GetIsolate()->GetCurrentContext(), v8Name)))
- return;
HTMLPlugInElement* impl = ElementType::toImpl(info.Holder());
RefPtr<SharedPersistent<v8::Object>> wrapper = impl->pluginWrapper();
@@ -90,6 +85,15 @@ void setScriptableObjectProperty(
if (instance.IsEmpty())
return;
+ // Don't intercept any of the properties of the HTMLPluginElement.
+ v8::Local<v8::String> v8Name = v8String(info.GetIsolate(), name);
+ if (!v8CallBoolean(instance->HasOwnProperty(
+ info.GetIsolate()->GetCurrentContext(), v8Name)) &&
+ v8CallBoolean(
+ info.Holder()->Has(info.GetIsolate()->GetCurrentContext(), v8Name))) {
+ return;
+ }
+
// FIXME: The gTalk pepper plugin is the only plugin to make use of
// SetProperty and that is being deprecated. This can be removed as soon as
// it goes away.
« no previous file with comments | « third_party/WebKit/LayoutTests/plugins/simple-expando.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698