From 059765dea436523cc3cbf7c0e1726eb037cd8095 Mon Sep 17 00:00:00 2001 From: Johnny Stenback Date: Fri, 25 Dec 2009 13:16:57 -0500 Subject: [PATCH] Fix regression calling unique methods for the first time on plugin objects. b=536116 r=josh --- dom/base/nsDOMClassInfo.cpp | 16 ++++++++++++++++ dom/base/nsDOMClassInfo.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 0cef1b5d23dc..21064b4d13d3 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -9802,7 +9802,23 @@ nsHTMLPluginObjElementSH::GetPluginJSObject(JSContext *cx, JSObject *obj, return NS_OK; } +NS_IMETHODIMP +nsHTMLPluginObjElementSH::NewResolve(nsIXPConnectWrappedNative *wrapper, + JSContext *cx, JSObject *obj, jsval id, + PRUint32 flags, JSObject **objp, + PRBool *_retval) +{ + // Make sure the plugin instance is loaded and instantiated, if + // possible. + nsCOMPtr pi; + nsresult rv = GetPluginInstanceIfSafe(wrapper, obj, getter_AddRefs(pi)); + NS_ENSURE_SUCCESS(rv, rv); + + return nsElementSH::NewResolve(wrapper, cx, obj, id, flags, objp, + _retval); +} + // HTMLOptionsCollection helper NS_IMETHODIMP diff --git a/dom/base/nsDOMClassInfo.h b/dom/base/nsDOMClassInfo.h index 205d761fc8fb..9d46b1143bda 100644 --- a/dom/base/nsDOMClassInfo.h +++ b/dom/base/nsDOMClassInfo.h @@ -1112,6 +1112,9 @@ protected: JSObject **plugin_proto); public: + NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx, + JSObject *obj, jsval id, PRUint32 flags, + JSObject **objp, PRBool *_retval); NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj, JSObject **parentObj); NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,