Commits

ms2ger  committed 7c52cb4

Merge up to nsXPConnect.

  • Participants
  • Parent commits 374f2a8

Comments (0)

Files changed (4)

File XPCJSObjectHolder

 +#include "nsIURI.h"
 +#include "nsJSEnvironment.h"
 +#include "nsNullPrincipal.h"
-+#include "nsThreadUtilsInternal.h"
++#include "nsThreadUtils.h"
 +
  #include "jsatom.h"
  #include "jsfriendapi.h"
  #include "jsgc.h"
--#include "nsThreadUtilsInternal.h"
 -#include "dom_quickstubs.h"
 -#include "nsNullPrincipal.h"
 -#include "nsIURI.h"
 -#include "nsJSEnvironment.h"
+-#include "nsThreadUtils.h"
 -
 -#include "XrayWrapper.h"
 -#include "WrapperFactory.h"
 -
  #include "mozilla/Assertions.h"
  #include "mozilla/Base64.h"
+ #include "mozilla/Util.h"
  
  #include "nsWrapperCacheInlines.h"
  
  NS_IMPL_THREADSAFE_ISUPPORTS7(nsXPConnect,
                                nsIXPConnect,
-                               nsISupportsWeakReference,
 diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h
 --- a/js/xpconnect/src/xpcprivate.h
 +++ b/js/xpconnect/src/xpcprivate.h
-@@ -2905,45 +2905,16 @@ private:
+@@ -2912,45 +2912,16 @@ private:
  private:
      XPCJSRuntime* mRuntime;
      nsIInterfaceInfo* mInfo;

File XPCWrappedNativeTearOff

  
  class XPCCallContext;
  
- #define XPC_QS_NULL_INDEX  ((size_t) -1)
+ #define XPC_QS_NULL_INDEX  ((uint16_t) -1)
 diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrappedNative.cpp
 --- a/js/xpconnect/src/XPCWrappedNative.cpp
 +++ b/js/xpconnect/src/XPCWrappedNative.cpp
  #include "jsdbgapi.h"
  #include "jsfriendapi.h"
  #include "jsgc.h"
-@@ -2267,84 +2269,16 @@ extern JSBool MorphSlimWrapper(JSContext
+@@ -2274,84 +2276,16 @@ extern JSBool MorphSlimWrapper(JSContext
  
  static inline XPCWrappedNativeProto*
  GetSlimWrapperProto(JSObject *obj)
 diff --git a/js/xpconnect/src/qsgen.py b/js/xpconnect/src/qsgen.py
 --- a/js/xpconnect/src/qsgen.py
 +++ b/js/xpconnect/src/qsgen.py
-@@ -369,16 +369,19 @@ def writeHeaderFile(filename, name):
+@@ -367,16 +367,19 @@ def writeHeaderFile(filename, name):
      print "Creating header file", filename
  
      headerMacro = '__gen_%s__' % filename.replace('.', '_')
                  "inline void " + name + "_InitInterfaces()\n"
                  "{\n"
                  "  " + name + "_ClearInterfaces();\n"
-@@ -1243,21 +1246,21 @@ def writeDefiner(f, conf, interfaces):
-             "{\n")
+@@ -1287,21 +1290,21 @@ def writeDefiner(f, conf, stringtable, i
      f.write("    return xpc_qsDefineQuickStubs("
-             "cx, proto, flags, count, iids, %d, tableData);\n" % size)
+             "cx, proto, flags, count, iids, %d, tableData, %s, %s, %s);\n" % (
+             size, prop_array_name, func_array_name, table_name))
      f.write("}\n\n\n")
  
  

File nsXPConnect2

 new file mode 100644
 --- /dev/null
 +++ b/js/xpconnect/src/nsXPConnect.h
-@@ -0,0 +1,178 @@
+@@ -0,0 +1,185 @@
 +/* This Source Code Form is subject to the terms of the Mozilla Public
 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
 +    PRUint16 mDefaultSecurityManagerFlags;
 +    JSBool mShuttingDown;
 +    JSBool mNeedGCBeforeCC;
++
++    // nsIThreadInternal doesn't remember which observers it called
++    // OnProcessNextEvent on when it gets around to calling AfterProcessNextEvent.
++    // So if XPConnect gets initialized mid-event (which can happen), we'll get
++    // an 'after' notification without getting an 'on' notification. If we don't
++    // watch out for this, we'll do an unmatched |pop| on the context stack.
++    uint16_t mEventDepth;
 +#ifdef DEBUG_CC
 +    PLDHashTable mJSRoots;
 +#endif
  
  #if defined(DEBUG_jband) || defined(DEBUG_jst) || defined(DEBUG_dbradley) || defined(DEBUG_shaver_no) || defined(DEBUG_timeless)
  #define DEBUG_xpc_hacker
-@@ -294,164 +295,16 @@ inline bool
+@@ -294,171 +295,16 @@ inline bool
  AddToCCKind(JSGCTraceKind kind)
  {
      return kind == JSTRACE_OBJECT || kind == JSTRACE_XML || kind == JSTRACE_SCRIPT;
 -    PRUint16                 mDefaultSecurityManagerFlags;
 -    JSBool                   mShuttingDown;
 -    JSBool                   mNeedGCBeforeCC;
+-
+-    // nsIThreadInternal doesn't remember which observers it called
+-    // OnProcessNextEvent on when it gets around to calling AfterProcessNextEvent.
+-    // So if XPConnect gets initialized mid-event (which can happen), we'll get
+-    // an 'after' notification without getting an 'on' notification. If we don't
+-    // watch out for this, we'll do an unmatched |pop| on the context stack.
+-    PRUint16                   mEventDepth;
 -#ifdef DEBUG_CC
 -    PLDHashTable             mJSRoots;
 -#endif