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

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

Issue 2566663002: Better handle non-existant wrappers when intercepting writes to plugin objects (Closed)
Patch Set: updates Created 4 years 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/reattach-plugin-during-access-expected.txt ('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 4c0349500b8151f69e1b9bd2bddbba5a65eb38a8..6404f1361fae6d2a11dd421c2c8953055e0d0dfc 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp
@@ -74,32 +74,30 @@ void setScriptableObjectProperty(
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<v8::Value>& info) {
ASSERT(!value.IsEmpty());
- HTMLPlugInElement* impl = ElementType::toImpl(info.Holder());
- RefPtr<SharedPersistent<v8::Object>> wrapper = impl->pluginWrapper();
- if (!wrapper)
- return;
-
- v8::Local<v8::Object> instance = wrapper->newLocal(info.GetIsolate());
- 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(
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.
- // Call SetProperty on a pepper plugin's scriptable object. Note that we
- // never set the return value here which would indicate that the plugin has
- // intercepted the SetProperty call, which means that the property on the
- // DOM element will also be set. For plugin's that don't intercept the call
- // (all except gTalk) this makes no difference at all. For gTalk the fact
- // that the property on the DOM element also gets set is inconsequential.
- v8CallBoolean(instance->CreateDataProperty(
- info.GetIsolate()->GetCurrentContext(), v8Name, value));
+ HTMLPlugInElement* impl = ElementType::toImpl(info.Holder());
+ RefPtr<SharedPersistent<v8::Object>> wrapper = impl->pluginWrapper();
+ v8::Local<v8::Object> instance;
+ if (wrapper)
+ instance = wrapper->newLocal(info.GetIsolate());
+ if (!instance.IsEmpty()) {
+ // 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.
+ // Call SetProperty on a pepper plugin's scriptable object. Note that we
+ // never set the return value here which would indicate that the plugin has
+ // intercepted the SetProperty call, which means that the property on the
+ // DOM element will also be set. For plugin's that don't intercept the call
+ // (all except gTalk) this makes no difference at all. For gTalk the fact
+ // that the property on the DOM element also gets set is inconsequential.
+ v8CallBoolean(instance->CreateDataProperty(
+ info.GetIsolate()->GetCurrentContext(), v8Name, value));
+ }
v8SetReturnValue(info, value);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/plugins/reattach-plugin-during-access-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698