Bug 860085 - Remove unused AutoPopJSContext. r=gabor
authorBobby Holley <bobbyholley@gmail.com>
Fri, 19 Jul 2013 18:21:53 -0700
changeset 147983 0dbbd5e84d465000d4e302245fa09b239f31a047
parent 147982 73630d43606b8386a88c50a5773d50cdcc64b83b
child 147984 b831de023e6f4cd1eade30ac04f2f5a7b414c69a
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgabor
bugs860085
milestone24.0a2
Bug 860085 - Remove unused AutoPopJSContext. r=gabor
js/xpconnect/src/XPCWrappedNativeJSOps.cpp
--- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp
@@ -1105,51 +1105,16 @@ XPC_WN_JSOp_Enumerate(JSContext *cx, Han
         }
     }
 
     // else call js_ObjectOps.enumerate...
 
     return JS_EnumerateState(cx, obj, enum_op, statep, idp);
 }
 
-namespace {
-
-class MOZ_STACK_CLASS AutoPopJSContext
-{
-public:
-  AutoPopJSContext(XPCJSContextStack *stack)
-  : mCx(nullptr), mStack(stack)
-  {
-      NS_ASSERTION(stack, "Null stack!");
-  }
-
-  ~AutoPopJSContext()
-  {
-      if (mCx)
-          mStack->Pop();
-  }
-
-  void PushIfNotTop(JSContext *cx)
-  {
-      NS_ASSERTION(cx, "Null context!");
-      NS_ASSERTION(!mCx, "This class is only meant to be used once!");
-
-      JSContext *cxTop = mStack->Peek();
-
-      if (cxTop != cx && mStack->Push(cx))
-          mCx = cx;
-  }
-
-private:
-  JSContext *mCx;
-  XPCJSContextStack *mStack;
-};
-
-} // namespace
-
 JSObject*
 XPC_WN_JSOp_ThisObject(JSContext *cx, HandleObject obj)
 {
     return JS_ObjectToOuterObject(cx, obj);
 }
 
 /***************************************************************************/