Bug 339587 - content canvas getImageData always returns null from chrome context; r+sr=mrbkap
authorbrian :crowder <crowder@fiverocks.com>
Mon, 20 Apr 2009 12:29:40 +0200
changeset 27520 40530e79373cfafa9e1e4dabdf43d15b2cd43794
parent 27519 d9a68f43d7d890ed7650884888a39b7704f58a60
child 27521 a5eda661725158a6b6000a130b19d321fcd481c4
push id6590
push usersgautherie.bz@free.fr
push dateMon, 20 Apr 2009 10:32:42 +0000
treeherdermozilla-central@a5eda6617251 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs339587
milestone1.9.2a1pre
Bug 339587 - content canvas getImageData always returns null from chrome context; r+sr=mrbkap
js/src/xpconnect/src/XPCNativeWrapper.cpp
--- a/js/src/xpconnect/src/XPCNativeWrapper.cpp
+++ b/js/src/xpconnect/src/XPCNativeWrapper.cpp
@@ -443,21 +443,18 @@ XPC_NW_RewrapIfDeepWrapper(JSContext *cx
       // which will fail below (since it isn't a wrapped native).
       if (!JSVAL_IS_PRIMITIVE(v)) {
         nativeObj = JSVAL_TO_OBJECT(v);
       }
     }
 
     XPCWrappedNative* wrappedNative =
       XPCWrappedNative::GetWrappedNativeOfJSObject(cx, nativeObj);
-    if (!wrappedNative) {
-      // Not something we can protect... just make it JSVAL_NULL
-      *rval = JSVAL_NULL;
-      return JS_TRUE;
-    }
+    if (!wrappedNative)
+      return XPC_SJOW_Construct(cx, nsnull, 1, &v, rval);
 
     if (HAS_FLAGS(flags, FLAG_EXPLICIT)) {
 #ifdef DEBUG_XPCNativeWrapper
       printf("Rewrapping for deep explicit wrapper\n");
 #endif
       if (wrappedNative == XPCNativeWrapper::SafeGetWrappedNative(obj)) {
         // Already wrapped, return the wrapper.
         *rval = OBJECT_TO_JSVAL(obj);