Bug 867350 - remove JS_UnwrapObject and JS_UnwrapObjectAndInnerize from jsdbgapi.h r=sfink
authorAndrew McCreight <amccreight@mozilla.com>
Wed, 01 May 2013 09:19:18 -0700
changeset 141426 fc1062d6135cadd1c12c0baa56dc4656dbeefd91
parent 141425 6982875b0dfd301f6ee5f7681c5b6c8744b76b89
child 141427 3f18ab3e32f27805cf10faffb80137d0cfeaaf2a
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs867350
milestone23.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 867350 - remove JS_UnwrapObject and JS_UnwrapObjectAndInnerize from jsdbgapi.h r=sfink
js/ductwork/debugger/JSDebugger.cpp
js/jsd/jsd_val.cpp
js/src/jsdbgapi.cpp
js/src/jsdbgapi.h
js/src/shell/js.cpp
--- a/js/ductwork/debugger/JSDebugger.cpp
+++ b/js/ductwork/debugger/JSDebugger.cpp
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "JSDebugger.h"
 #include "nsIXPConnect.h"
 #include "nsThreadUtils.h"
 #include "jsapi.h"
 #include "jsfriendapi.h"
 #include "jsdbgapi.h"
+#include "jswrapper.h"
 #include "mozilla/ModuleUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsMemory.h"
 
 #define JSDEBUGGER_CONTRACTID \
   "@mozilla.org/jsdebugger;1"
 
 #define JSDEBUGGER_CID \
@@ -40,17 +41,17 @@ JSDebugger::AddClass(const JS::Value &gl
   nsresult rv;
   nsCOMPtr<nsIXPConnect> xpc = do_GetService(nsIXPConnect::GetCID(), &rv);
 
   if (!global.isObject()) {
     return NS_ERROR_INVALID_ARG;
   }
   
   JSObject* obj = &global.toObject();
-  obj = JS_UnwrapObjectAndInnerize(obj);
+  obj = js::UncheckedUnwrap(obj, /* stopAtOuter = */ false);
   if (!obj) {
     return NS_ERROR_FAILURE;
   }
 
   JSAutoCompartment ac(cx, obj);
   if (JS_GetGlobalForObject(cx, obj) != obj) {
     return NS_ERROR_INVALID_ARG;
   }
--- a/js/jsd/jsd_val.cpp
+++ b/js/jsd/jsd_val.cpp
@@ -6,16 +6,17 @@
 
 /*
  * JavaScript Debugging support - Value and Property support
  */
 
 #include "jsd.h"
 #include "jsapi.h"
 #include "jsfriendapi.h"
+#include "jswrapper.h"
 
 #ifdef DEBUG
 void JSD_ASSERT_VALID_VALUE(JSDValue* jsdval)
 {
     JS_ASSERT(jsdval);
     JS_ASSERT(jsdval->nref > 0);
     if(!JS_CLIST_IS_EMPTY(&jsdval->props))
     {
@@ -600,17 +601,17 @@ jsd_GetValueFunction(JSDContext* jsdc, J
 {
     JSObject *obj;
     JSFunction *fun;
 
     JSCompartment* oldCompartment = NULL;
     if (JSVAL_IS_PRIMITIVE(jsdval->val))
         return NULL;
 
-    obj = JS_UnwrapObject(JSVAL_TO_OBJECT(jsdval->val));
+    obj = js::UncheckedUnwrap(JSVAL_TO_OBJECT(jsdval->val));
     oldCompartment = JS_EnterCompartment(jsdc->dumbContext, obj);
     fun = JS_ValueToFunction(jsdc->dumbContext, OBJECT_TO_JSVAL(obj));
     JS_LeaveCompartment(jsdc->dumbContext, oldCompartment);
 
     return fun;
 }
 
 JSDValue*
--- a/js/src/jsdbgapi.cpp
+++ b/js/src/jsdbgapi.cpp
@@ -946,28 +946,16 @@ JS_DumpCompartmentPCCounts(JSContext *cx
                 fputs(sprinter.string(), stdout);
                 fprintf(stdout, "--- END Asm.js Module ---\n");
             }
         }
     }
 #endif
 }
 
-JS_PUBLIC_API(JSObject *)
-JS_UnwrapObject(JSObject *obj)
-{
-    return UncheckedUnwrap(obj);
-}
-
-JS_PUBLIC_API(JSObject *)
-JS_UnwrapObjectAndInnerize(JSObject *obj)
-{
-    return UncheckedUnwrap(obj, /* stopAtOuter = */ false);
-}
-
 JS_FRIEND_API(JSBool)
 js_CallContextDebugHandler(JSContext *cx)
 {
     NonBuiltinScriptFrameIter iter(cx);
     JS_ASSERT(!iter.done());
 
     RootedValue rval(cx);
     RootedScript script(cx, iter.script());
--- a/js/src/jsdbgapi.h
+++ b/js/src/jsdbgapi.h
@@ -456,19 +456,13 @@ extern JS_PUBLIC_API(void)
 JS_DumpCompartmentBytecode(JSContext *cx);
 
 extern JS_PUBLIC_API(void)
 JS_DumpPCCounts(JSContext *cx, JSScript *script);
 
 extern JS_PUBLIC_API(void)
 JS_DumpCompartmentPCCounts(JSContext *cx);
 
-extern JS_PUBLIC_API(JSObject *)
-JS_UnwrapObject(JSObject *obj);
-
-extern JS_PUBLIC_API(JSObject *)
-JS_UnwrapObjectAndInnerize(JSObject *obj);
-
 /* Call the context debug handler on the topmost scripted frame. */
 extern JS_FRIEND_API(JSBool)
 js_CallContextDebugHandler(JSContext *cx);
 
 #endif /* jsdbgapi_h___ */
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -979,17 +979,17 @@ Evaluate(JSContext *cx, unsigned argc, j
             lineNumber = u;
         }
 
         if (!JS_GetProperty(cx, options, "global", v.address()))
             return false;
         if (!JSVAL_IS_VOID(v)) {
             global = JSVAL_IS_PRIMITIVE(v) ? NULL : JSVAL_TO_OBJECT(v);
             if (global) {
-                global = JS_UnwrapObject(global);
+                global = js::UncheckedUnwrap(global);
                 if (!global)
                     return false;
             }
             if (!global || !(JS_GetClass(global)->flags & JSCLASS_IS_GLOBAL)) {
                 JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_UNEXPECTED_TYPE,
                                      "\"global\" passed to evaluate()", "not a global object");
                 return false;
             }