Backing out patch by Mook from bug 390328 due to compile errors.
authorreed@reedloden.com
Sat, 15 Sep 2007 11:15:01 -0700
changeset 5905 7086cced1ecc6eb64ea596e8b8020f9baf09da9b
parent 5904 e31e297c4fa937bb58d42f6f13962236b1aeb2a0
child 5906 e80a6231ea8a849760275010fece548855cc3352
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs390328
milestone1.9a8pre
Backing out patch by Mook from bug 390328 due to compile errors.
js/src/xpconnect/idl/nsIXPConnect.idl
js/src/xpconnect/src/nsXPConnect.cpp
js/src/xpconnect/src/xpcdebug.cpp
js/src/xpconnect/src/xpcprivate.h
js/src/xpconnect/src/xpcwrappednative.cpp
--- a/js/src/xpconnect/idl/nsIXPConnect.idl
+++ b/js/src/xpconnect/idl/nsIXPConnect.idl
@@ -60,17 +60,16 @@
 
 [ptr] native JSContextPtr(JSContext);
 [ptr] native JSObjectPtr(JSObject);
 [ptr] native JSValPtr(jsval);
       native JSVal(jsval);
       native JSID(jsid);
 [ptr] native voidPtrPtr(void*);
 [ptr] native JSTracerPtr(JSTracer);
-      native fd(int);
 
 /***************************************************************************/
 
 %{ C++
 /***************************************************************************/
 #define GENERATE_XPC_FAILURE(x) \
             (NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_XPCONNECT,x))
 
@@ -579,18 +578,17 @@ interface nsIXPConnect : nsISupports
 
     readonly attribute nsIStackFrame                CurrentJSStack;
     readonly attribute nsIXPCNativeCallContext      CurrentNativeCallContext;
     /* pass nsnull to clear pending exception */
              attribute nsIException                 PendingException;
 
     void debugDump(in short depth);
     void debugDumpObject(in nsISupports aCOMObj, in short depth);
-    void debugDumpJSStack(in fd filedesc,
-                          in PRBool showArgs,
+    void debugDumpJSStack(in PRBool showArgs,
                           in PRBool showLocals,
                           in PRBool showThisProps);
     void debugDumpEvalInJSStackFrame(in PRUint32 aFrameNumber,
                                      in string aSourceText);
 
     /**
     * Set fallback JSContext to use when xpconnect can't find an appropriate
     * context to use to execute JavaScript.
--- a/js/src/xpconnect/src/nsXPConnect.cpp
+++ b/js/src/xpconnect/src/nsXPConnect.cpp
@@ -37,17 +37,16 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /* High level class and public functions implementation. */
 
-#include <io.h>
 #include "xpcprivate.h"
 #include "XPCNativeWrapper.h"
 #include "nsBaseHashtable.h"
 #include "nsHashKeys.h"
 #include "jsatom.h"
 #include "jsfun.h"
 #include "jsobj.h"
 #include "jsscript.h"
@@ -1960,39 +1959,35 @@ nsXPConnect::DebugDumpObject(nsISupports
         NS_RELEASE(wjs);
     }
     else
         XPC_LOG_ALWAYS(("*** Could not dump the nsISupports @ %x", p));
 #endif
     return NS_OK;
 }
 
-/* void debugDumpJSStack (in fd filedesc, in PRBool showArgs, in PRBool showLocals, in PRBool showThisProps); */
+/* void debugDumpJSStack (in PRBool showArgs, in PRBool showLocals, in PRBool showThisProps); */
 NS_IMETHODIMP
-nsXPConnect::DebugDumpJSStack(int filedesc,
-                              PRBool showArgs,
+nsXPConnect::DebugDumpJSStack(PRBool showArgs,
                               PRBool showLocals,
                               PRBool showThisProps)
 {
 #ifdef DEBUG
-    static const char kGetServiceFailed[] = "failed to get nsIThreadJSContextStack service!\n";
-    static const char kPeekFailed[] = "failed to peek into nsIThreadJSContextStack service!\n";
-    static const char kNoContext[] = "there is no JSContext on the nsIThreadJSContextStack!\n";
     JSContext* cx;
     nsresult rv;
     nsCOMPtr<nsIThreadJSContextStack> stack = 
              do_GetService(XPC_CONTEXT_STACK_CONTRACTID, &rv);
     if(NS_FAILED(rv) || !stack)
-        _write(filedesc, kGetServiceFailed, sizeof(kGetServiceFailed) - 1);
+        printf("failed to get nsIThreadJSContextStack service!\n");
     else if(NS_FAILED(stack->Peek(&cx)))
-        _write(filedesc, kPeekFailed, sizeof(kPeekFailed) - 1);
+        printf("failed to peek into nsIThreadJSContextStack service!\n");
     else if(!cx)
-        _write(filedesc, kNoContext, sizeof(kNoContext) - 1);
+        printf("there is no JSContext on the nsIThreadJSContextStack!\n");
     else
-        xpc_DumpJSStack(filedesc, cx, showArgs, showLocals, showThisProps);
+        xpc_DumpJSStack(cx, showArgs, showLocals, showThisProps);
 #endif
     return NS_OK;
 }
 
 /* void debugDumpEvalInJSStackFrame (in PRUint32 aFrameNumber, in string aSourceText); */
 NS_IMETHODIMP
 nsXPConnect::DebugDumpEvalInJSStackFrame(PRUint32 aFrameNumber, const char *aSourceText)
 {
@@ -2105,17 +2100,17 @@ nsXPConnect::OnDispatchedEvent(nsIThread
 #ifdef DEBUG
 /* These are here to be callable from a debugger */
 JS_BEGIN_EXTERN_C
 void DumpJSStack()
 {
     nsresult rv;
     nsCOMPtr<nsIXPConnect> xpc(do_GetService(nsIXPConnect::GetCID(), &rv));
     if(NS_SUCCEEDED(rv) && xpc)
-        xpc->DebugDumpJSStack(1/*stdout*/, PR_TRUE, PR_TRUE, PR_FALSE);
+        xpc->DebugDumpJSStack(PR_TRUE, PR_TRUE, PR_FALSE);
     else
         printf("failed to get XPConnect service!\n");
 }
 
 void DumpJSEval(PRUint32 frameno, const char* text)
 {
     nsresult rv;
     nsCOMPtr<nsIXPConnect> xpc(do_GetService(nsIXPConnect::GetCID(), &rv));
--- a/js/src/xpconnect/src/xpcdebug.cpp
+++ b/js/src/xpconnect/src/xpcdebug.cpp
@@ -33,18 +33,16 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include <io.h>
-
 #include "xpcprivate.h"
 #if defined(DEBUG_xpc_hacker) || defined(DEBUG)
 
 #ifdef TAB
 #undef TAB
 #endif
 #define TAB "    "
 
@@ -286,31 +284,28 @@ static char* FormatJSStackDump(JSContext
 
     if(!num)
         buf = JS_sprintf_append(buf, "JavaScript stack is empty\n");
 
     return buf;
 }
 
 JSBool
-xpc_DumpJSStack(int filedesc, JSContext* cx, JSBool showArgs, JSBool showLocals, JSBool showThisProps)
+xpc_DumpJSStack(JSContext* cx, JSBool showArgs, JSBool showLocals, JSBool showThisProps)
 {
     char* buf;
 
     buf = FormatJSStackDump(cx, nsnull, showArgs, showLocals, showThisProps);
     if(buf)
     {
-        _write(filedesc, buf, strlen(buf));
+        fputs(buf, stdout);
         JS_smprintf_free(buf);
     }
     else
-    {
-        const char kDumpFailed[] = "Failed to format JavaScript stack for dump";
-        _write(filedesc, kDumpFailed, sizeof(kDumpFailed) - 1);
-    }
+        puts("Failed to format JavaScript stack for dump");
     return JS_TRUE;
 }
 
 /***************************************************************************/
 
 JS_STATIC_DLL_CALLBACK(void)
 xpcDumpEvalErrorReporter(JSContext *cx, const char *message,
                          JSErrorReport *report)
@@ -372,17 +367,17 @@ xpc_DumpEvalInJSStackFrame(JSContext* cx
 JSTrapStatus JS_DLL_CALLBACK
 xpc_DebuggerKeywordHandler(JSContext *cx, JSScript *script, jsbytecode *pc,
                            jsval *rval, void *closure)
 {
     static const char line[] =
     "------------------------------------------------------------------------";
     puts(line);
     puts("Hit JavaScript \"debugger\" keyword. JS call stack...");
-    xpc_DumpJSStack(1/*stdout*/, cx, JS_TRUE, JS_TRUE, JS_FALSE);
+    xpc_DumpJSStack(cx, JS_TRUE, JS_TRUE, JS_FALSE);
     puts(line);
     return JSTRAP_CONTINUE;
 }
 
 JSBool xpc_InstallJSDebuggerKeywordHandler(JSRuntime* rt)
 {
     return JS_SetDebuggerHandler(rt, xpc_DebuggerKeywordHandler, nsnull);
 }
--- a/js/src/xpconnect/src/xpcprivate.h
+++ b/js/src/xpconnect/src/xpcprivate.h
@@ -3227,17 +3227,17 @@ xpc_JSObjectToID(JSContext *cx, JSObject
 
 extern JSBool
 xpc_JSObjectIsID(JSContext *cx, JSObject* obj);
 
 /***************************************************************************/
 // in xpcdebug.cpp
 
 extern JSBool
-xpc_DumpJSStack(int filedesc, JSContext* cx, JSBool showArgs, JSBool showLocals,
+xpc_DumpJSStack(JSContext* cx, JSBool showArgs, JSBool showLocals,
                 JSBool showThisProps);
 
 extern JSBool
 xpc_DumpEvalInJSStackFrame(JSContext* cx, JSUint32 frameno, const char* text);
 
 extern JSBool
 xpc_DumpJSObject(JSObject* obj);
 
--- a/js/src/xpconnect/src/xpcwrappednative.cpp
+++ b/js/src/xpconnect/src/xpcwrappednative.cpp
@@ -3248,17 +3248,17 @@ void DEBUG_ReportWrapperThreadSafetyErro
     {
         printf("  %s\n  wrapper: %s\n", msg, wrapperDump);
         JS_smprintf_free(wrapperDump);
     }
     else
         printf("  %s\n  wrapper @ 0x%p\n", msg, (void *)wrapper);
 
     printf("  JS call stack...\n");
-    xpc_DumpJSStack(1/*stdout*/, ccx, JS_TRUE, JS_TRUE, JS_TRUE);
+    xpc_DumpJSStack(ccx, JS_TRUE, JS_TRUE, JS_TRUE);
     printf("---------------------------------------------------------------\n");
     
     tls->ClearWrappedNativeThreadsafetyReportDepth();
 }
 
 void DEBUG_CheckWrapperThreadSafety(const XPCWrappedNative* wrapper)
 {
     XPCWrappedNativeProto* proto = wrapper->GetProto();