| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 if (V8HTMLAppletElement::hasInstance(info.Holder(), info.GetIsolate()) || V8
HTMLEmbedElement::hasInstance(info.Holder(), info.GetIsolate()) | 74 if (V8HTMLAppletElement::hasInstance(info.Holder(), info.GetIsolate()) || V8
HTMLEmbedElement::hasInstance(info.Holder(), info.GetIsolate()) |
| 75 || V8HTMLObjectElement::hasInstance(info.Holder(), info.GetIsolate())) { | 75 || V8HTMLObjectElement::hasInstance(info.Holder(), info.GetIsolate())) { |
| 76 // The holder object is a subtype of HTMLPlugInElement. | 76 // The holder object is a subtype of HTMLPlugInElement. |
| 77 HTMLPlugInElement* element; | 77 HTMLPlugInElement* element; |
| 78 if (V8HTMLAppletElement::hasInstance(info.Holder(), info.GetIsolate())) | 78 if (V8HTMLAppletElement::hasInstance(info.Holder(), info.GetIsolate())) |
| 79 element = V8HTMLAppletElement::toNative(info.Holder()); | 79 element = V8HTMLAppletElement::toNative(info.Holder()); |
| 80 else if (V8HTMLEmbedElement::hasInstance(info.Holder(), info.GetIsolate(
))) | 80 else if (V8HTMLEmbedElement::hasInstance(info.Holder(), info.GetIsolate(
))) |
| 81 element = V8HTMLEmbedElement::toNative(info.Holder()); | 81 element = V8HTMLEmbedElement::toNative(info.Holder()); |
| 82 else | 82 else |
| 83 element = V8HTMLObjectElement::toNative(info.Holder()); | 83 element = V8HTMLObjectElement::toNative(info.Holder()); |
| 84 ScriptValue wrapper = element->pluginWrapper(); | 84 if (RefPtr<SharedPersistent<v8::Object> > wrapper = element->pluginWrapp
er()) { |
| 85 if (!wrapper.hasNoValue()) { | |
| 86 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 85 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 87 v8::HandleScope handleScope(isolate); | 86 v8::HandleScope handleScope(isolate); |
| 88 npObject = v8ObjectToNPObject(v8::Handle<v8::Object>::Cast(wrapper.v
8Value())); | 87 npObject = v8ObjectToNPObject(wrapper->newLocal(isolate)); |
| 89 } else | 88 } else |
| 90 npObject = 0; | 89 npObject = 0; |
| 91 } else { | 90 } else { |
| 92 // The holder object is not a subtype of HTMLPlugInElement, it must be a
n NPObject which has three | 91 // The holder object is not a subtype of HTMLPlugInElement, it must be a
n NPObject which has three |
| 93 // internal fields. | 92 // internal fields. |
| 94 if (info.Holder()->InternalFieldCount() != npObjectInternalFieldCount) { | 93 if (info.Holder()->InternalFieldCount() != npObjectInternalFieldCount) { |
| 95 throwError(v8ReferenceError, "NPMethod called on non-NPObject", info
.GetIsolate()); | 94 throwError(v8ReferenceError, "NPMethod called on non-NPObject", info
.GetIsolate()); |
| 96 return; | 95 return; |
| 97 } | 96 } |
| 98 | 97 |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 v8::HandleScope scope(isolate); | 477 v8::HandleScope scope(isolate); |
| 479 v8::Handle<v8::Object> wrapper = staticNPObjectMap().newLocal(object, isolat
e); | 478 v8::Handle<v8::Object> wrapper = staticNPObjectMap().newLocal(object, isolat
e); |
| 480 if (!wrapper.IsEmpty()) { | 479 if (!wrapper.IsEmpty()) { |
| 481 V8DOMWrapper::clearNativeInfo(wrapper, npObjectTypeInfo()); | 480 V8DOMWrapper::clearNativeInfo(wrapper, npObjectTypeInfo()); |
| 482 staticNPObjectMap().removeAndDispose(object); | 481 staticNPObjectMap().removeAndDispose(object); |
| 483 _NPN_ReleaseObject(object); | 482 _NPN_ReleaseObject(object); |
| 484 } | 483 } |
| 485 } | 484 } |
| 486 | 485 |
| 487 } // namespace WebCore | 486 } // namespace WebCore |
| OLD | NEW |