Bug 975419 - Used a TenuredHeap pointer for SandboxPrivate and BackstagePass. r=mccr8
authorBobby Holley <bobbyholley@gmail.com>
Mon, 03 Mar 2014 08:53:42 -0800
changeset 171528 4d8af86981730f2a3ec732b60797e3865dd12211
parent 171527 aad192167a84258f2d006062a09fcf1c48ff773b
child 171529 058ed6c240bbd1abbf7518b72a07c26d996e50b8
push id40487
push userbobbyholley@gmail.com
push dateMon, 03 Mar 2014 16:54:24 +0000
treeherdermozilla-inbound@1742ecba9c09 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs975419
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 975419 - Used a TenuredHeap pointer for SandboxPrivate and BackstagePass. r=mccr8
js/xpconnect/public/SandboxPrivate.h
js/xpconnect/src/BackstagePass.h
--- a/js/xpconnect/public/SandboxPrivate.h
+++ b/js/xpconnect/public/SandboxPrivate.h
@@ -5,16 +5,18 @@
 #ifndef __SANDBOXPRIVATE_H__
 #define __SANDBOXPRIVATE_H__
 
 #include "nsIGlobalObject.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsIPrincipal.h"
 #include "nsWeakReference.h"
 
+#include "js/RootingAPI.h"
+
 // This interface is public only because it is used in jsd.
 // Once jsd is gone this file should be moved back to xpconnect/src.
 
 class SandboxPrivate : public nsIGlobalObject,
                        public nsIScriptObjectPrincipal,
                        public nsSupportsWeakReference
 {
 public:
@@ -38,12 +40,12 @@ public:
     }
 
     void ForgetGlobalObject()
     {
         mGlobalJSObject = nullptr;
     }
 private:
     nsCOMPtr<nsIPrincipal> mPrincipal;
-    JSObject *mGlobalJSObject;
+    JS::TenuredHeap<JSObject*> mGlobalJSObject;
 };
 
 #endif // __SANDBOXPRIVATE_H__
--- a/js/xpconnect/src/BackstagePass.h
+++ b/js/xpconnect/src/BackstagePass.h
@@ -7,16 +7,18 @@
 #define BackstagePass_h__
 
 #include "nsISupports.h"
 #include "nsWeakReference.h"
 #include "nsIGlobalObject.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsIXPCScriptable.h"
 
+#include "js/HeapAPI.h"
+
 class BackstagePass : public nsIGlobalObject,
                       public nsIScriptObjectPrincipal,
                       public nsIXPCScriptable,
                       public nsIClassInfo,
                       public nsSupportsWeakReference
 {
 public:
   NS_DECL_ISUPPORTS
@@ -43,15 +45,15 @@ public:
     mPrincipal(prin)
   {
   }
 
   virtual ~BackstagePass() { }
 
 private:
   nsCOMPtr<nsIPrincipal> mPrincipal;
-  JSObject *mGlobal;
+  JS::TenuredHeap<JSObject*> mGlobal;
 };
 
 NS_EXPORT nsresult
 NS_NewBackstagePass(BackstagePass** ret);
 
 #endif // BackstagePass_h__