Bug 736752 - Compartment mismatch in JetPack 'test-content-proxy.testTypedArrays', r=bholley
authorMs2ger <ms2ger@gmail.com>
Tue, 20 Mar 2012 13:57:00 -0700
changeset 93376 ab2ff3b5611fe63c94b3de9beae3757076214ef5
parent 93375 996b89200406b4abae2ab874be1ed412aa14017c
child 93430 c20ec27eb0e8ec666a987a6f71a3902257f8128d
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs736752
milestone14.0a1
first release with
nightly linux32
ab2ff3b5611f / 14.0a1 / 20120323031214 / files
nightly linux64
ab2ff3b5611f / 14.0a1 / 20120323031214 / files
nightly mac
ab2ff3b5611f / 14.0a1 / 20120323031214 / files
nightly win32
ab2ff3b5611f / 14.0a1 / 20120323031214 / files
nightly win64
ab2ff3b5611f / 14.0a1 / 20120323031214 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 736752 - Compartment mismatch in JetPack 'test-content-proxy.testTypedArrays', r=bholley
content/canvas/src/ImageData.cpp
content/canvas/src/ImageData.h
dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl
--- a/content/canvas/src/ImageData.cpp
+++ b/content/canvas/src/ImageData.cpp
@@ -52,20 +52,20 @@ NS_IMETHODIMP
 ImageData::GetHeight(PRUint32* aHeight)
 {
   *aHeight = GetHeight();
   return NS_OK;
 }
 
 /* readonly attribute jsval data; */
 NS_IMETHODIMP
-ImageData::GetData(JS::Value* aData)
+ImageData::GetData(JSContext* aCx, JS::Value* aData)
 {
-  *aData = GetData();
-  return NS_OK;
+  *aData = JS::ObjectOrNullValue(GetDataObject());
+  return JS_WrapValue(aCx, aData) ? NS_OK : NS_ERROR_FAILURE;
 }
 
 void
 ImageData::HoldData()
 {
   NS_HOLD_JS_OBJECTS(this, ImageData);
 }
 
--- a/content/canvas/src/ImageData.h
+++ b/content/canvas/src/ImageData.h
@@ -46,20 +46,16 @@ public:
   uint32_t GetWidth()
   {
     return mWidth;
   }
   uint32_t GetHeight()
   {
     return mHeight;
   }
-  JS::Value GetData()
-  {
-    return JS::ObjectOrNullValue(GetDataObject());
-  }
   JSObject* GetDataObject()
   {
     xpc_UnmarkGrayObject(mData);
     return mData;
   }
 
 private:
   void HoldData();
--- a/dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl
+++ b/dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl
@@ -62,17 +62,17 @@ interface nsIDOMTextMetrics : nsISupport
   readonly attribute float width;
 };
 
 [scriptable, builtinclass, uuid(1ea11207-b3e3-4ffc-a256-bf5c7011e806)]
 interface nsIDOMImageData : nsISupports
 {
   readonly attribute unsigned long width;
   readonly attribute unsigned long height;
-  readonly attribute jsval data;
+  [implicit_jscontext] readonly attribute jsval data;
 };
 
 [scriptable, uuid(c835c768-2dcc-461c-82f5-3653710d2942)]
 interface nsIDOMCanvasRenderingContext2D : nsISupports
 {
   // back-reference to the canvas element for which
   // this context was created
   readonly attribute nsIDOMHTMLCanvasElement canvas;