Bug 441324, part 1: Shuffle around includes to avoid problems with #define malloc et al. r=bsmedberg
authorChris Jones <jones.chris.g@gmail.com>
Wed, 03 Mar 2010 23:02:55 -0600
changeset 38922 d8c18f04396efc787769bd54998d3ea6fa48e97e
parent 38921 e99cd091fdf0d43880eeba3f992268b06affd5ca
child 38923 5257693bcfbf901398bce97f823b5ba95b43dd53
push id11938
push usercjones@mozilla.com
push dateThu, 04 Mar 2010 05:05:07 +0000
treeherdermozilla-central@130a52770a7b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs441324
milestone1.9.3a3pre
Bug 441324, part 1: Shuffle around includes to avoid problems with #define malloc et al. r=bsmedberg
content/base/src/nsScriptLoader.cpp
content/xul/document/src/nsXULContentSink.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsJSEnvironment.cpp
dom/src/threads/nsDOMThreadService.cpp
embedding/browser/activex/src/plugin/LegacyPlugin.cpp
js/ctypes/Function.cpp
js/jsd/jsd_xpc.cpp
js/src/xpconnect/shell/xpcshell.cpp
js/src/xpconnect/src/qsgen.py
js/src/xpconnect/src/xpcJSWeakReference.cpp
js/src/xpconnect/src/xpcprivate.h
js/src/xpconnect/tests/TestXPC.cpp
modules/plugin/base/src/nsJSNPRuntime.cpp
modules/plugin/base/src/nsNPAPIPlugin.cpp
toolkit/components/remote/nsGTKRemoteService.cpp
xpinstall/src/nsXPITriggerInfo.cpp
--- a/content/base/src/nsScriptLoader.cpp
+++ b/content/base/src/nsScriptLoader.cpp
@@ -36,16 +36,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * A class that handles loading and evaluation of <script> elements.
  */
 
+#include "jscntxt.h"
 #include "nsScriptLoader.h"
 #include "nsIDOMCharacterData.h"
 #include "nsParserUtils.h"
 #include "nsICharsetConverterManager.h"
 #include "nsIUnicodeDecoder.h"
 #include "nsIContent.h"
 #include "nsGkAtoms.h"
 #include "nsNetUtil.h"
@@ -55,17 +56,16 @@
 #include "nsIScriptSecurityManager.h"
 #include "nsIPrincipal.h"
 #include "nsContentPolicyUtils.h"
 #include "nsIDOMWindow.h"
 #include "nsIHttpChannel.h"
 #include "nsIScriptElement.h"
 #include "nsIDOMHTMLScriptElement.h"
 #include "nsIDocShell.h"
-#include "jscntxt.h"
 #include "nsContentUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsAutoPtr.h"
 #include "nsIXPConnect.h"
 #include "nsContentErrors.h"
 #include "nsIParser.h"
 #include "nsThreadUtils.h"
 #include "nsIChannelClassifier.h"
--- a/content/xul/document/src/nsXULContentSink.cpp
+++ b/content/xul/document/src/nsXULContentSink.cpp
@@ -42,16 +42,17 @@
 /*
  * An implementation for a Gecko-style content sink that knows how
  * to build a content model (the "prototype" document) from XUL.
  *
  * For more information on XUL,
  * see http://developer.mozilla.org/en/docs/XUL
  */
 
+#include "jscntxt.h"  // for JSVERSION_HAS_XML
 #include "nsXULContentSink.h"
 #include "nsCOMPtr.h"
 #include "nsForwardReference.h"
 #include "nsIContentSink.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMHTMLFormElement.h"
 #include "nsIDOMXULDocument.h"
@@ -74,17 +75,16 @@
 #include "nsNetUtil.h"
 #include "nsRDFCID.h"
 #include "nsParserUtils.h"
 #include "nsXPIDLString.h"
 #include "nsReadableUtils.h"
 #include "nsXULElement.h"
 #include "prlog.h"
 #include "prmem.h"
-#include "jscntxt.h"  // for JSVERSION_HAS_XML
 #include "nsCRT.h"
 
 #include "nsXULPrototypeDocument.h"     // XXXbe temporary
 #include "nsCSSLoader.h"
 
 #include "nsUnicharUtils.h"
 #include "nsGkAtoms.h"
 #include "nsContentUtils.h"
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -32,16 +32,23 @@
  * 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 ***** */
 
+// JavaScript includes
+#include "jsapi.h"
+#include "jsprvtd.h"    // we are using private JS typedefs...
+#include "jscntxt.h"
+#include "jsdbgapi.h"
+#include "jsnum.h"
+
 #include "nscore.h"
 #include "nsDOMClassInfo.h"
 #include "nsCRT.h"
 #include "nsCRTGlue.h"
 #include "nsIServiceManager.h"
 #include "nsICategoryManager.h"
 #include "nsIComponentRegistrar.h"
 #include "nsXPCOM.h"
@@ -57,23 +64,16 @@
 #include "nsUnicharUtils.h"
 #include "xptcall.h"
 #include "prprf.h"
 #include "nsTArray.h"
 #include "nsCSSValue.h"
 #include "nsIRunnable.h"
 #include "nsThreadUtils.h"
 
-// JavaScript includes
-#include "jsapi.h"
-#include "jsprvtd.h"    // we are using private JS typedefs...
-#include "jscntxt.h"
-#include "jsdbgapi.h"
-#include "jsnum.h"
-
 // General helper includes
 #include "nsGlobalWindow.h"
 #include "nsIContent.h"
 #include "nsIAttribute.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOM3Document.h"
 #include "nsIDOMXMLDocument.h"
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -32,16 +32,17 @@
  * 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 "jscntxt.h"
 #include "nsJSEnvironment.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsIDOMChromeWindow.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMDocument.h"
@@ -71,17 +72,16 @@
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIPrompt.h"
 #include "nsIObserverService.h"
 #include "nsGUIEvent.h"
 #include "nsThreadUtils.h"
 #include "nsITimer.h"
 #include "nsIAtom.h"
 #include "nsContentUtils.h"
-#include "jscntxt.h"
 #include "nsEventDispatcher.h"
 #include "nsIContent.h"
 #include "nsCycleCollector.h"
 #include "nsNetUtil.h"
 #include "nsXPCOMCIDInternal.h"
 #include "nsIXULRuntime.h"
 
 // For locale aware string methods
--- a/dom/src/threads/nsDOMThreadService.cpp
+++ b/dom/src/threads/nsDOMThreadService.cpp
@@ -32,16 +32,18 @@
  * 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 "jscntxt.h"
+
 #include "nsDOMThreadService.h"
 
 // Interfaces
 #include "nsIComponentManager.h"
 #include "nsIConsoleService.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMNavigator.h"
@@ -55,17 +57,16 @@
 #include "nsIScriptGlobalObject.h"
 #include "nsIServiceManager.h"
 #include "nsISupportsPriority.h"
 #include "nsIThreadPool.h"
 #include "nsIXPConnect.h"
 #include "nsPIDOMWindow.h"
 
 // Other includes
-#include "jscntxt.h"
 #include "nsAutoLock.h"
 #include "nsAutoPtr.h"
 #include "nsContentUtils.h"
 #include "nsDeque.h"
 #include "nsIClassInfoImpl.h"
 #include "nsStringBuffer.h"
 #include "nsThreadUtils.h"
 #include "nsXPCOM.h"
--- a/embedding/browser/activex/src/plugin/LegacyPlugin.cpp
+++ b/embedding/browser/activex/src/plugin/LegacyPlugin.cpp
@@ -34,16 +34,19 @@
  * 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 "stdafx.h"
 
 #include "npapi.h"
 
+#include "jsapi.h"
+#include "jscntxt.h"
+
 #include "nsISupports.h"
 
 #ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
 #include "XPConnect.h"
 #endif
 
 #include "LegacyPlugin.h"
 
@@ -53,18 +56,16 @@
 #include "nsIDocument.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMWindow.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptContext.h"
 #include "nsIURI.h"
 #include "nsIJSContextStack.h"
-#include "jsapi.h"
-#include "jscntxt.h"
 #include "nsIScriptSecurityManager.h"
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////
 // These are constants to control certain default behaviours
 
 #ifndef MOZ_ACTIVEX_PLUGIN_XPCONNECT
 // Flag determines if controls should be created if they are not marked
--- a/js/ctypes/Function.cpp
+++ b/js/ctypes/Function.cpp
@@ -33,20 +33,20 @@
  * 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 "jscntxt.h"
 #include "Function.h"
 #include "Library.h"
 #include "nsAutoPtr.h"
-#include "jscntxt.h"
 
 namespace mozilla {
 namespace ctypes {
 
 /*******************************************************************************
 ** Static helpers
 *******************************************************************************/
 
--- a/js/jsd/jsd_xpc.cpp
+++ b/js/jsd/jsd_xpc.cpp
@@ -32,20 +32,20 @@
  * 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 "jsd_xpc.h"
 #include "jsdbgapi.h"
 #include "jscntxt.h"
 #include "jsfun.h"
+#include "jsd_xpc.h"
 
 #include "nsIXPConnect.h"
 #include "nsIGenericFactory.h"
 #include "nsIServiceManager.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsICategoryManager.h"
--- a/js/src/xpconnect/shell/xpcshell.cpp
+++ b/js/src/xpconnect/shell/xpcshell.cpp
@@ -41,16 +41,20 @@
  * 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 ***** */
 
 /* XPConnect JavaScript interactive shell. */
 
 #include <stdio.h>
+#include "jsapi.h"
+#include "jscntxt.h"
+#include "jsdbgapi.h"
+#include "jsprf.h"
 #include "nsXULAppAPI.h"
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsStringAPI.h"
 #include "nsIXPConnect.h"
 #include "nsIXPCScriptable.h"
 #include "nsIInterfaceInfo.h"
 #include "nsIInterfaceInfoManager.h"
@@ -59,19 +63,16 @@
 #include "nsIComponentManager.h"
 #include "nsIComponentRegistrar.h"
 #include "nsILocalFile.h"
 #include "nsStringAPI.h"
 #include "nsIDirectoryService.h"
 #include "nsILocalFile.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsAppDirectoryServiceDefs.h"
-#include "jsapi.h"
-#include "jsdbgapi.h"
-#include "jsprf.h"
 #include "nscore.h"
 #include "nsArrayEnumerator.h"
 #include "nsCOMArray.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsMemory.h"
 #include "nsIGenericFactory.h"
 #include "nsISupportsImpl.h"
 #include "nsIJSRuntimeService.h"
@@ -524,19 +525,16 @@ DumpXPC(JSContext *cx, JSObject *obj, ui
     }
 
     nsCOMPtr<nsIXPConnect> xpc = do_GetService(nsIXPConnect::GetCID());
     if(xpc)
         xpc->DebugDump((int16)depth);
     return JS_TRUE;
 }
 
-/* XXX needed only by GC() */
-#include "jscntxt.h"
-
 static JSBool
 GC(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 {
     JSRuntime *rt;
     uint32 preBytes;
 
     rt = cx->runtime;
     preBytes = rt->gcBytes;
--- a/js/src/xpconnect/src/qsgen.py
+++ b/js/src/xpconnect/src/qsgen.py
@@ -1524,16 +1524,21 @@ def writeDefiner(f, conf, interfaces):
             "cx, proto, flags, count, iids, %d, tableData);\n" % size)
     f.write("}\n\n\n")
 
 
 stubTopTemplate = '''\
 /* THIS FILE IS AUTOGENERATED - DO NOT EDIT */
 #include "jsapi.h"
 #include "jscntxt.h"
+/* Include nanojit.h early to avoid conflicting with nscore's |#define free|.
+ * NB: needs to be kept in sync with jsbuiltins.h */
+#ifdef JS_TRACER
+#  include "nanojit/nanojit.h"
+#endif
 #include "prtypes.h"
 #include "nsID.h"
 #include "%s"
 #include "nscore.h"
 #include "nsCOMPtr.h"
 #include "nsDependentString.h"
 #include "xpcprivate.h"  // for XPCCallContext
 #include "xpcquickstubs.h"
--- a/js/src/xpconnect/src/xpcJSWeakReference.cpp
+++ b/js/src/xpconnect/src/xpcJSWeakReference.cpp
@@ -29,18 +29,18 @@
  * 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 "xpcprivate.h"
 #include "xpcJSWeakReference.h"
-#include "xpcprivate.h"
 
 xpcJSWeakReference::xpcJSWeakReference()
 {
 }
 
 NS_IMPL_ISUPPORTS1(xpcJSWeakReference, xpcIJSWeakReference)
 
 nsresult xpcJSWeakReference::Init()
--- a/js/src/xpconnect/src/xpcprivate.h
+++ b/js/src/xpconnect/src/xpcprivate.h
@@ -45,16 +45,24 @@
 
 #ifndef xpcprivate_h___
 #define xpcprivate_h___
 
 #include <string.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <math.h>
+#include "jsapi.h"
+#include "jsdhash.h"
+#include "jsprf.h"
+#include "prprf.h"
+#include "jsinterp.h"
+#include "jscntxt.h"
+#include "jsdbgapi.h"
+#include "jsgc.h"
 #include "nscore.h"
 #include "nsXPCOM.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsCycleCollector.h"
 #include "nsISupports.h"
 #include "nsIServiceManager.h"
 #include "nsIClassInfoImpl.h"
@@ -69,24 +77,16 @@
 #include "nsIXPCScriptable.h"
 #include "nsIXPCSecurityManager.h"
 #include "nsIJSRuntimeService.h"
 #include "nsWeakReference.h"
 #include "nsCOMPtr.h"
 #include "nsIModule.h"
 #include "nsAutoLock.h"
 #include "nsXPTCUtils.h"
-#include "jsapi.h"
-#include "jsdhash.h"
-#include "jsprf.h"
-#include "prprf.h"
-#include "jsinterp.h"
-#include "jscntxt.h"
-#include "jsdbgapi.h"
-#include "jsgc.h"
 #include "xptinfo.h"
 #include "xpcforwards.h"
 #include "xpclog.h"
 #include "xpccomponents.h"
 #include "xpcexception.h"
 #include "xpcjsid.h"
 #include "prlong.h"
 #include "prmem.h"
--- a/js/src/xpconnect/tests/TestXPC.cpp
+++ b/js/src/xpconnect/tests/TestXPC.cpp
@@ -39,35 +39,35 @@
  * ***** END LICENSE BLOCK ***** */
 
 /* API tests for XPConnect - use xpcshell for JS tests. */
 
 #include <stdio.h>
 #include <ctype.h>
 #include <stdarg.h>
 
+#include "jsapi.h"
+#include "jscntxt.h"
+
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIXPConnect.h"
 #include "nsIScriptError.h"
 #include "nsIServiceManager.h"
 #include "nsIComponentManager.h"
 #include "nsIComponentRegistrar.h"
 #include "nsIJSContextStack.h"
 #include "nsIJSRuntimeService.h"
 #include "nsMemory.h"
 #include "nsIXPCSecurityManager.h"
 #include "nsICategoryManager.h"
 #include "nsIVariant.h"
 #include "nsStringAPI.h"
 #include "nsEmbedString.h"
 
-#include "jsapi.h"
-#include "jscntxt.h"
-
 #include "xpctest.h"
 
 /***************************************************************************/
 // host support for jsengine
 
 FILE *gOutFile = NULL;
 FILE *gErrFile = NULL;
 
--- a/modules/plugin/base/src/nsJSNPRuntime.cpp
+++ b/modules/plugin/base/src/nsJSNPRuntime.cpp
@@ -31,33 +31,33 @@
  * 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 ***** */
 
+// FIXME(bug 332648): Give me a real API please!
+#include "jscntxt.h"
+
 #include "nsJSNPRuntime.h"
 #include "nsNPAPIPlugin.h"
 #include "nsNPAPIPluginInstance.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptContext.h"
 #include "nsDOMJSUtils.h"
 #include "nsIDocument.h"
 #include "nsIJSRuntimeService.h"
 #include "nsIJSContextStack.h"
 #include "nsIXPConnect.h"
 #include "nsIDOMElement.h"
 #include "prmem.h"
 #include "nsIContent.h"
 
-// FIXME(bug 332648): Give me a real API please!
-#include "jscntxt.h"
-
 using namespace mozilla::plugins::parent;
 
 // Hash of JSObject wrappers that wraps JSObjects as NPObjects. There
 // will be one wrapper per JSObject per plugin instance, i.e. if two
 // plugins access the JSObject x, two wrappers for x will be
 // created. This is needed to be able to properly drop the wrappers
 // when a plugin is torn down in case there's a leak in the plugin (we
 // don't want to leak the world just because a plugin leaks an
--- a/modules/plugin/base/src/nsNPAPIPlugin.cpp
+++ b/modules/plugin/base/src/nsNPAPIPlugin.cpp
@@ -39,16 +39,19 @@
 #ifdef MOZ_IPC
 #include "base/basictypes.h"
 #endif 
 
 #include "prtypes.h"
 #include "prmem.h"
 #include "prenv.h"
 #include "prclist.h"
+
+#include "jscntxt.h"
+
 #include "nsAutoLock.h"
 #include "nsNPAPIPlugin.h"
 #include "nsNPAPIPluginInstance.h"
 #include "nsNPAPIPluginStreamListener.h"
 #include "nsIServiceManager.h"
 #include "nsThreadUtils.h"
 #include "nsIPrivateBrowsingService.h"
 
@@ -65,18 +68,16 @@
 #include "nsIDOMDocument.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDocument.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptContext.h"
 #include "nsDOMJSUtils.h"
 #include "nsIPrincipal.h"
 
-#include "jscntxt.h"
-
 #include "nsIXPConnect.h"
 
 #include "nsIObserverService.h"
 #include <prinrval.h>
 
 #ifdef XP_MACOSX
 #include <Carbon/Carbon.h>
 #endif
--- a/toolkit/components/remote/nsGTKRemoteService.cpp
+++ b/toolkit/components/remote/nsGTKRemoteService.cpp
@@ -337,20 +337,16 @@ nsGTKRemoteService::HandleCommand(char* 
   if (p1 == kNotFound || p2 == kNotFound || p1 == 0 || p2 < p1) {
     return "500 command not parseable";
   }
 
   command.Truncate(p1);
   command.Trim(" ", PR_TRUE, PR_TRUE);
   ToLowerCase(command);
 
-#ifdef DEBUG_bsmedberg
-  printf("Processing xremote command: %s\n", command.get());
-#endif
-
   if (!command.EqualsLiteral("ping")) {
     nsCAutoString desktopStartupID;
     nsDependentCString cmd(aCommand);
     FindExtensionParameterInCommand("DESKTOP_STARTUP_ID",
                                     cmd, '\n',
                                     &desktopStartupID);
 
     char* argv[3] = {"dummyappname", "-remote", aCommand};
@@ -388,23 +384,16 @@ nsGTKRemoteService::HandleCommandLine(ch
   // followed by a series of null-terminated strings:
   //
   // [argc][offsetargv0][offsetargv1...]<workingdir>\0<argv[0]>\0argv[1]...\0
   // (offset is from the beginning of the buffer)
 
   PRInt32 argc = TO_LITTLE_ENDIAN32(*reinterpret_cast<PRInt32*>(aBuffer));
   char *wd   = aBuffer + ((argc + 1) * sizeof(PRInt32));
 
-#ifdef DEBUG_bsmedberg
-  printf("Receiving command line:\n"
-         "  wd:\t%s\n"
-         "  argc:\t%i\n",
-         wd, argc);
-#endif
-
   nsCOMPtr<nsILocalFile> lf;
   rv = NS_NewNativeLocalFile(nsDependentCString(wd), PR_TRUE,
                              getter_AddRefs(lf));
   if (NS_FAILED(rv))
     return "509 internal error";
 
   nsCAutoString desktopStartupID;
 
@@ -417,19 +406,16 @@ nsGTKRemoteService::HandleCommandLine(ch
     argv[i] = aBuffer + TO_LITTLE_ENDIAN32(offset[i]);
 
     if (i == 0) {
       nsDependentCString cmd(argv[0]);
       FindExtensionParameterInCommand("DESKTOP_STARTUP_ID",
                                       cmd, ' ',
                                       &desktopStartupID);
     }
-#ifdef DEBUG_bsmedberg
-    printf("  argv[%i]:\t%s\n", i, argv[i]);
-#endif
   }
 
   rv = cmdline->Init(argc, argv, lf, nsICommandLine::STATE_REMOTE_AUTO);
   free (argv);
   if (NS_FAILED(rv)) {
     return "509 internal error";
   }
 
@@ -520,20 +506,16 @@ nsGTKRemoteService::HandlePropertyChange
                                  &actual_type,             /* actual_type return */
                                  &actual_format,           /* actual_format_return */
                                  &nitems,                  /* nitems_return */
                                  &bytes_after,             /* bytes_after_return */
                                  (unsigned char **)&data); /* prop_return
                                                               (we only care
                                                               about the first ) */
 
-#ifdef DEBUG_bsmedberg
-    printf("Handling command: %s\n", data);
-#endif
-
     // Failed to get property off the window?
     if (result != Success)
       return FALSE;
 
     // Failed to get the data off the window or it was the wrong type?
     if (!data || !TO_LITTLE_ENDIAN32(*reinterpret_cast<PRInt32*>(data)))
       return FALSE;
 
--- a/xpinstall/src/nsXPITriggerInfo.cpp
+++ b/xpinstall/src/nsXPITriggerInfo.cpp
@@ -33,29 +33,29 @@
  * 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 "jscntxt.h"
 #include "nscore.h"
 #include "plstr.h"
 #include "nsXPITriggerInfo.h"
 #include "nsNetUtil.h"
 #include "nsDebug.h"
 #include "nsAutoPtr.h"
 #include "nsThreadUtils.h"
 #include "nsIServiceManager.h"
 #include "nsIJSContextStack.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsICryptoHash.h"
 #include "nsIX509Cert.h"
-#include "jscntxt.h"
 
 //
 // nsXPITriggerItem
 //
 
 nsXPITriggerItem::nsXPITriggerItem( const PRUnichar* aName,
                                     const PRUnichar* aURL,
                                     const PRUnichar* aIconURL,