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); |
} |