Commits

ms2ger committed 3480d26

Cleanup up to nsJSCID.

  • Participants
  • Parent commits d9ef055

Comments (0)

Files changed (11)

 new file mode 100644
 --- /dev/null
 +++ b/js/xpconnect/src/XPCConvert.h
-@@ -0,0 +1,163 @@
+@@ -0,0 +1,167 @@
++/* 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/. */
++
 +#ifndef XPCConvert_h
 +#define XPCConvert_h
 +
 +
 +namespace XPCConvert {
 +
-+JSBool IsMethodReflectable(const XPTMethodDescriptor& info);
++JSBool IsMethodReflectable(const XPTMethodDescriptor &info);
 +
-+JSBool NativeData2JS(XPCLazyCallContext& lccx, JS::Value* d,
-+                     const void* s, const nsXPTType& type,
-+                     const nsID* iid, nsresult* pErr);
++JSBool NativeData2JS(XPCLazyCallContext &lccx, JS::Value *d,
++                     const void *s, const nsXPTType &type,
++                     const nsID *iid, nsresult *pErr);
 +
 +/**
 + * Convert a native object into a JS::Value.
 + *        chain
 + * @param pErr [out] relevant error code, if any.
 + */
-+inline JSBool NativeData2JS(XPCCallContext& ccx, JS::Value* d, const void* s,
-+                            const nsXPTType& type, const nsID* iid,
-+                            nsresult* pErr)
++inline JSBool NativeData2JS(XPCCallContext &ccx, JS::Value *d, const void *s,
++                            const nsXPTType &type, const nsID *iid,
++                            nsresult *pErr)
 +{
 +    XPCLazyCallContext lccx(ccx);
 +    return NativeData2JS(lccx, d, s, type, iid, pErr);
 +}
 +
-+JSBool JSData2Native(XPCCallContext& ccx, void* d, JS::Value s,
-+                     const nsXPTType& type,
-+                     JSBool useAllocator, const nsID* iid,
-+                     nsresult* pErr);
++JSBool JSData2Native(XPCCallContext &ccx, void *d, JS::Value s,
++                     const nsXPTType &type,
++                     JSBool useAllocator, const nsID *iid,
++                     nsresult *pErr);
 +
-+JSBool NativeInterface2JSObject(XPCLazyCallContext& lccx,
-+                                JS::Value* d,
-+                                nsIXPConnectJSObjectHolder** dest,
-+                                xpcObjectHelper& aHelper,
-+                                const nsID* iid,
-+                                XPCNativeInterface** Interface,
++JSBool NativeInterface2JSObject(XPCLazyCallContext &lccx,
++                                JS::Value *d,
++                                nsIXPConnectJSObjectHolder **dest,
++                                xpcObjectHelper &aHelper,
++                                const nsID *iid,
++                                XPCNativeInterface **Interface,
 +                                bool allowNativeWrapper,
 +                                bool isGlobal,
-+                                nsresult* pErr);
++                                nsresult *pErr);
 +/**
 + * Convert a native nsISupports into a JSObject.
 + *
 + * @param src_is_identity optional performance hint. Set to true only
 + *                        if src is the identity pointer.
 + */
-+inline JSBool NativeInterface2JSObject(XPCCallContext& ccx,
-+                                       JS::Value* d,
-+                                       nsIXPConnectJSObjectHolder** dest,
-+                                       xpcObjectHelper& aHelper,
-+                                       const nsID* iid,
-+                                       XPCNativeInterface** Interface,
++inline JSBool NativeInterface2JSObject(XPCCallContext &ccx,
++                                       JS::Value *d,
++                                       nsIXPConnectJSObjectHolder **dest,
++                                       xpcObjectHelper &aHelper,
++                                       const nsID *iid,
++                                       XPCNativeInterface **Interface,
 +                                       bool allowNativeWrapper,
 +                                       bool isGlobal,
-+                                       nsresult* pErr)
++                                       nsresult *pErr)
 +{
 +    XPCLazyCallContext lccx(ccx);
 +    return NativeInterface2JSObject(lccx, d, dest, aHelper, iid, Interface,
 +                                    allowNativeWrapper, isGlobal, pErr);
 +}
 +
-+JSBool GetNativeInterfaceFromJSObject(XPCCallContext& ccx,
-+                                      void** dest, JSObject* src,
-+                                      const nsID* iid,
-+                                      nsresult* pErr);
-+JSBool JSObject2NativeInterface(XPCCallContext& ccx,
-+                                void** dest, JSObject* src,
-+                                const nsID* iid,
-+                                nsISupports* aOuter,
-+                                nsresult* pErr);
-+JSBool GetISupportsFromJSObject(JSObject* obj, nsISupports** iface);
++JSBool GetNativeInterfaceFromJSObject(XPCCallContext &ccx,
++                                      void **dest, JSObject *src,
++                                      const nsID *iid,
++                                      nsresult *pErr);
++JSBool JSObject2NativeInterface(XPCCallContext &ccx,
++                                void **dest, JSObject *src,
++                                const nsID *iid,
++                                nsISupports *aOuter,
++                                nsresult *pErr);
++JSBool GetISupportsFromJSObject(JSObject *obj, nsISupports **iface);
 +
 +/**
 + * Convert a native array into a JS::Value.
 + * @param scope the default scope to put on the new JSObjects' parent chain
 + * @param pErr [out] relevant error code, if any.
 + */
-+JSBool NativeArray2JS(XPCLazyCallContext& ccx,
-+                      JS::Value* d, const void** s,
-+                      const nsXPTType& type, const nsID* iid,
-+                      uint32_t count, nsresult* pErr);
++JSBool NativeArray2JS(XPCLazyCallContext &ccx,
++                      JS::Value *d, const void **s,
++                      const nsXPTType &type, const nsID *iid,
++                      uint32_t count, nsresult *pErr);
 +
-+JSBool JSArray2Native(XPCCallContext& ccx, void** d, JS::Value s,
-+                      uint32_t count, const nsXPTType& type,
-+                      const nsID* iid, nsresult* pErr);
++JSBool JSArray2Native(XPCCallContext &ccx, void **d, JS::Value s,
++                      uint32_t count, const nsXPTType &type,
++                      const nsID *iid, nsresult *pErr);
 +
-+JSBool JSTypedArray2Native(XPCCallContext& ccx,
-+                           void** d,
-+                           JSObject* jsarray,
++JSBool JSTypedArray2Native(XPCCallContext &ccx,
++                           void **d,
++                           JSObject *jsarray,
 +                           uint32_t count,
-+                           const nsXPTType& type,
-+                           nsresult* pErr);
++                           const nsXPTType &type,
++                           nsresult *pErr);
 +
-+JSBool NativeStringWithSize2JS(JSContext* cx,
-+                               JS::Value* d, const void* s,
-+                               const nsXPTType& type,
++JSBool NativeStringWithSize2JS(JSContext *cx,
++                               JS::Value *d, const void *s,
++                               const nsXPTType &type,
 +                               uint32_t count,
-+                               nsresult* pErr);
++                               nsresult *pErr);
 +
-+JSBool JSStringWithSize2Native(XPCCallContext& ccx, void* d, JS::Value s,
-+                               uint32_t count, const nsXPTType& type,
-+                               nsresult* pErr);
++JSBool JSStringWithSize2Native(XPCCallContext &ccx, void *d, JS::Value s,
++                               uint32_t count, const nsXPTType &type,
++                               nsresult *pErr);
 +
-+nsresult JSValToXPCException(XPCCallContext& ccx,
++nsresult JSValToXPCException(XPCCallContext &ccx,
 +                             JS::Value s,
-+                             const char* ifaceName,
-+                             const char* methodName,
-+                             nsIException** exception);
++                             const char *ifaceName,
++                             const char *methodName,
++                             nsIException **exception);
 +
-+nsresult JSErrorToXPCException(XPCCallContext& ccx,
-+                               const char* message,
-+                               const char* ifaceName,
-+                               const char* methodName,
-+                               const JSErrorReport* report,
-+                               nsIException** exception);
++nsresult JSErrorToXPCException(XPCCallContext &ccx,
++                               const char *message,
++                               const char *ifaceName,
++                               const char *methodName,
++                               const JSErrorReport *report,
++                               nsIException **exception);
 +
-+nsresult ConstructException(nsresult rv, const char* message,
-+                            const char* ifaceName,
-+                            const char* methodName,
-+                            nsISupports* data,
-+                            nsIException** exception,
-+                            JSContext* cx,
++nsresult ConstructException(nsresult rv, const char *message,
++                            const char *ifaceName,
++                            const char *methodName,
++                            nsISupports *data,
++                            nsIException **exception,
++                            JSContext *cx,
 +                            JS::Value *jsExceptionPtr);
 +
 +void RemoveXPCOMUCStringFinalizer();
 new file mode 100644
 --- /dev/null
 +++ b/js/xpconnect/src/XPCJSStack.h
-@@ -0,0 +1,27 @@
+@@ -0,0 +1,31 @@
++/* 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/. */
++
 +#ifndef XPCJSStack_h
 +#define XPCJSStack_h
 +
 +namespace XPCJSStack {
 +
 +nsresult
-+CreateStack(JSContext* cx, nsIStackFrame** stack);
++CreateStack(JSContext *cx, nsIStackFrame **stack);
 +
 +nsresult
 +CreateStackFrameLocation(PRUint32 aLanguage,
-+                         const char* aFilename,
-+                         const char* aFunctionName,
++                         const char *aFilename,
++                         const char *aFunctionName,
 +                         PRInt32 aLineNumber,
-+                         nsIStackFrame* aCaller,
-+                         nsIStackFrame** stack);
++                         nsIStackFrame *aCaller,
++                         nsIStackFrame **stack);
 +
 +} // namespace XPCJSStack
 +

File XPCStringConvert

 new file mode 100644
 --- /dev/null
 +++ b/js/xpconnect/src/XPCStringConvert.h
-@@ -0,0 +1,22 @@
+@@ -0,0 +1,26 @@
++/* 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/. */
++
 +#ifndef XPCStringConvert_h
 +#define XPCStringConvert_h
 +
 +// get assigned to *sharedBuffer.  Otherwise null will be
 +// assigned.
 +JS::Value ReadableToJSVal(JSContext *cx, const nsAString &readable,
-+                          nsStringBuffer** sharedBuffer);
++                          nsStringBuffer **sharedBuffer);
 +
 +void ShutdownDOMStringFinalizer();
 +
 new file mode 100644
 --- /dev/null
 +++ b/js/xpconnect/src/XPCThrower.h
-@@ -0,0 +1,36 @@
+@@ -0,0 +1,44 @@
++/* 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/. */
++
 +#ifndef XPCThrower_h
 +#define XPCThrower_h
 +
 +class XPCThrower
 +{
 +public:
-+    static void Throw(nsresult rv, JSContext* cx);
-+    static void Throw(nsresult rv, XPCCallContext& ccx);
-+    static void ThrowBadResult(nsresult rv, nsresult result, XPCCallContext& ccx);
-+    static void ThrowBadParam(nsresult rv, uintN paramNum, XPCCallContext& ccx);
++    static void Throw(nsresult rv, JSContext *cx);
++    static void Throw(nsresult rv, XPCCallContext &ccx);
++    static void ThrowBadResult(nsresult rv, nsresult result, XPCCallContext &ccx);
++    static void ThrowBadParam(nsresult rv, uintN paramNum, XPCCallContext &ccx);
 +    static JSBool SetVerbosity(JSBool state)
-+        {JSBool old = sVerbose; sVerbose = state; return old;}
++    {
++        JSBool old = sVerbose;
++        sVerbose = state;
++        return old;
++    }
 +
-+    static void BuildAndThrowException(JSContext* cx, nsresult rv, const char* sz);
++    static void BuildAndThrowException(JSContext *cx, nsresult rv, const char *sz);
 +    static JSBool CheckForPendingException(nsresult result, JSContext *cx);
 +
 +private:
-+    static void Verbosify(XPCCallContext& ccx,
-+                          char** psz, bool own);
++    static void Verbosify(XPCCallContext &ccx,
++                          char **psz, bool own);
 +
-+    static JSBool ThrowExceptionObject(JSContext* cx, nsIException* e);
++    static JSBool ThrowExceptionObject(JSContext *cx, nsIException *e);
 +
 +private:
 +    static JSBool sVerbose;
 new file mode 100644
 --- /dev/null
 +++ b/js/xpconnect/src/nsJSCID.h
-@@ -0,0 +1,34 @@
+@@ -0,0 +1,38 @@
++/* 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/. */
++
 +#ifndef nsJSCID_h
 +#define nsJSCID_h
 +
 +    NS_DECL_NSIJSCID
 +    NS_DECL_NSIXPCSCRIPTABLE
 +
-+    static nsJSCID* NewID(const char* str);
++    static nsJSCID *NewID(const char *str);
 +
 +    nsJSCID();
 +    virtual ~nsJSCID();
 new file mode 100644
 --- /dev/null
 +++ b/js/xpconnect/src/nsJSID.h
-@@ -0,0 +1,45 @@
+@@ -0,0 +1,52 @@
++/* 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/. */
++
 +#ifndef nsJSID_h
 +#define nsJSID_h
 +
 +    NS_DECL_ISUPPORTS
 +    NS_DECL_NSIJSID
 +
-+    bool InitWithName(const nsID& id, const char *nameString);
-+    bool SetName(const char* name);
-+    void   SetNameToNoString()
-+        {NS_ASSERTION(!mName, "name already set"); mName = gNoString;}
-+    bool NameIsSet() const {return nsnull != mName;}
-+    const nsID& ID() const {return mID;}
++    bool InitWithName(const nsID &id, const char *nameString);
++    bool SetName(const char *name);
++    void SetNameToNoString()
++    {
++        NS_ASSERTION(!mName, "name already set");
++        mName = gNoString;
++    }
++    bool NameIsSet() const {return !!mName;}
++    const nsID &ID() const {return mID;}
 +    bool IsValid() const {return !mID.Equals(GetInvalidIID());}
 +
-+    static nsJSID* NewID(const char* str);
-+    static nsJSID* NewID(const nsID& id);
++    static nsJSID *NewID(const char *str);
++    static nsJSID *NewID(const nsID &id);
 +
 +    nsJSID();
 +    virtual ~nsJSID();
++
 +protected:
-+
 +    void Reset();
-+    const nsID& GetInvalidIID() const;
++    const nsID &GetInvalidIID() const;
 +
 +protected:
 +    static char gNoString[];
-+    nsID    mID;
-+    char*   mNumber;
-+    char*   mName;
++    nsID mID;
++    char *mNumber;
++    char *mName;
 +};
 +
 +#endif // nsJSID_h
 new file mode 100644
 --- /dev/null
 +++ b/js/xpconnect/src/nsJSIID.h
-@@ -0,0 +1,36 @@
+@@ -0,0 +1,43 @@
++/* 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/. */
++
 +#ifndef nsJSIID_h
 +#define nsJSIID_h
 +
 +#include "nsIXPCScriptable.h"
 +#include "nsISecurityCheckedComponent.h"
 +
++#include "mozilla/Attributes.h"
++
 +#include "nsCOMPtr.h"
 +#include "nsIInterfaceInfo.h"
 +
 +    NS_DECL_NSIXPCSCRIPTABLE
 +    NS_DECL_NSISECURITYCHECKEDCOMPONENT
 +
-+    static nsJSIID* NewID(nsIInterfaceInfo* aInfo);
++    static nsJSIID *NewID(nsIInterfaceInfo *aInfo);
 +
 +    nsJSIID(nsIInterfaceInfo* aInfo);
-+    nsJSIID(); // not implemented
 +    virtual ~nsJSIID();
 +
 +private:
++    nsJSIID() MOZ_DELETE;
++
 +    nsCOMPtr<nsIInterfaceInfo> mInfo;
 +};
 +

File nsXPCException

 new file mode 100644
 --- /dev/null
 +++ b/js/xpconnect/src/nsXPCException.h
-@@ -0,0 +1,57 @@
+@@ -0,0 +1,61 @@
++/* 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/. */
++
 +#ifndef nsXPCException_h
 +#define nsXPCException_h
 +
 +                                 nsresult aResult,
 +                                 nsIStackFrame *aLocation,
 +                                 nsISupports *aData,
-+                                 nsIException** exception);
++                                 nsIException **exception);
 +
 +    static JSBool NameAndFormatForNSResult(nsresult rv,
-+                                           const char** name,
-+                                           const char** format);
++                                           const char **name,
++                                           const char **format);
 +
-+    static void* IterateNSResults(nsresult* rv,
-+                                  const char** name,
-+                                  const char** format,
-+                                  void** iterp);
++    static void* IterateNSResults(nsresult *rv,
++                                  const char **name,
++                                  const char **format,
++                                  void **iterp);
 +
 +    static PRUint32 GetNSResultCount();
 +
 +protected:
 +    void Reset();
 +private:
-+    char*           mMessage;
-+    nsresult        mResult;
-+    char*           mName;
-+    nsIStackFrame*  mLocation;
-+    nsISupports*    mData;
-+    char*           mFilename;
-+    int             mLineNumber;
-+    nsIException*   mInner;
-+    bool            mInitialized;
++    char *mMessage;
++    nsresult mResult;
++    char *mName;
++    nsIStackFrame *mLocation;
++    nsISupports *mData;
++    char *mFilename;
++    int mLineNumber;
++    nsIException *mInner;
++    bool mInitialized;
 +
 +    nsAutoJSValHolder mThrownJSVal;
 +

File nsXPCWrappedJSClass

 new file mode 100644
 --- /dev/null
 +++ b/js/xpconnect/src/nsXPCWrappedJSClass.h
-@@ -0,0 +1,131 @@
+@@ -0,0 +1,143 @@
++/* 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/. */
++
 +#ifndef nsXPCWrappedJSClass_h
 +#define nsXPCWrappedJSClass_h
 +
++#include "mozilla/Attributes.h"
++
 +#include "nsID.h"
 +#include "nsISupports.h"
 +
 +public:
 +
 +    static nsresult
-+    GetNewOrUsed(XPCCallContext& ccx,
++    GetNewOrUsed(XPCCallContext &ccx,
 +                 REFNSIID aIID,
-+                 nsXPCWrappedJSClass** clazz);
++                 nsXPCWrappedJSClass **clazz);
 +
 +    REFNSIID GetIID() const {return mIID;}
-+    XPCJSRuntime* GetRuntime() const {return mRuntime;}
-+    nsIInterfaceInfo* GetInterfaceInfo() const {return mInfo;}
-+    const char* GetInterfaceName();
++    XPCJSRuntime *GetRuntime() const {return mRuntime;}
++    nsIInterfaceInfo *GetInterfaceInfo() const {return mInfo;}
++    const char *GetInterfaceName();
 +
-+    static JSBool IsWrappedJS(nsISupports* aPtr);
++    static JSBool IsWrappedJS(nsISupports *aPtr);
 +
-+    NS_IMETHOD DelegatedQueryInterface(nsXPCWrappedJS* self, REFNSIID aIID,
-+                                       void** aInstancePtr);
++    NS_IMETHOD DelegatedQueryInterface(nsXPCWrappedJS *self, REFNSIID aIID,
++                                       void **aInstancePtr);
 +
-+    JSObject* GetRootJSObject(XPCCallContext& ccx, JSObject* aJSObj);
++    JSObject *GetRootJSObject(XPCCallContext &ccx, JSObject *aJSObj);
 +
-+    NS_IMETHOD CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex,
-+                          const XPTMethodDescriptor* info,
-+                          nsXPTCMiniVariant* params);
++    NS_IMETHOD CallMethod(nsXPCWrappedJS *wrapper, uint16_t methodIndex,
++                          const XPTMethodDescriptor *info,
++                          nsXPTCMiniVariant *params);
 +
-+    JSObject*  CallQueryInterfaceOnJSObject(XPCCallContext& ccx,
-+                                            JSObject* jsobj, REFNSIID aIID);
++    JSObject *CallQueryInterfaceOnJSObject(XPCCallContext &ccx,
++                                           JSObject *jsobj, REFNSIID aIID);
 +
-+    static nsresult BuildPropertyEnumerator(XPCCallContext& ccx,
-+                                            JSObject* aJSObj,
-+                                            nsISimpleEnumerator** aEnumerate);
++    static nsresult BuildPropertyEnumerator(XPCCallContext &ccx,
++                                            JSObject *aJSObj,
++                                            nsISimpleEnumerator **aEnumerate);
 +
-+    static nsresult GetNamedPropertyAsVariant(XPCCallContext& ccx,
-+                                              JSObject* aJSObj,
++    static nsresult GetNamedPropertyAsVariant(XPCCallContext &ccx,
++                                              JSObject *aJSObj,
 +                                              JS::Value aName,
-+                                              nsIVariant** aResult);
++                                              nsIVariant **aResult);
 +
 +    virtual ~nsXPCWrappedJSClass();
 +
-+    static nsresult CheckForException(XPCCallContext & ccx,
-+                                      const char * aPropertyName,
-+                                      const char * anInterfaceName,
++    static nsresult CheckForException(XPCCallContext &ccx,
++                                      const char *aPropertyName,
++                                      const char *anInterfaceName,
 +                                      bool aForceReport);
 +private:
-+    nsXPCWrappedJSClass();   // not implemented
-+    nsXPCWrappedJSClass(XPCCallContext& ccx, REFNSIID aIID,
-+                        nsIInterfaceInfo* aInfo);
++    nsXPCWrappedJSClass() MOZ_DELETE;
++    nsXPCWrappedJSClass(XPCCallContext &ccx, REFNSIID aIID,
++                        nsIInterfaceInfo *aInfo);
 +
-+    JSObject*  NewOutObject(JSContext* cx, JSObject* scope);
++    JSObject *NewOutObject(JSContext *cx, JSObject *scope);
 +
-+    JSBool IsReflectable(uint16_t i) const
-+        {return (JSBool)(mDescriptors[i/32] & (1 << (i%32)));}
-+    void SetReflectable(uint16_t i, JSBool b)
-+        {if (b) mDescriptors[i/32] |= (1 << (i%32));
-+         else mDescriptors[i/32] &= ~(1 << (i%32));}
++    bool IsReflectable(uint16_t i) const
++    {
++        return !!(mDescriptors[i / 32] & (1 << (i % 32)));
++    }
++    void SetReflectable(uint16_t i, bool b)
++    {
++        if (b)
++            mDescriptors[i / 32] |= (1 << (i % 32));
++        else
++            mDescriptors[i / 32] &= ~(1 << (i % 32));
++    }
 +
-+    JSBool GetArraySizeFromParam(JSContext* cx,
-+                                 const XPTMethodDescriptor* method,
-+                                 const nsXPTParamInfo& param,
++    JSBool GetArraySizeFromParam(JSContext *cx,
++                                 const XPTMethodDescriptor *method,
++                                 const nsXPTParamInfo &param,
 +                                 uint16_t methodIndex,
 +                                 uint8_t paramIndex,
-+                                 nsXPTCMiniVariant* params,
-+                                 uint32_t* result);
++                                 nsXPTCMiniVariant *params,
++                                 uint32_t *result);
 +
-+    JSBool GetInterfaceTypeFromParam(JSContext* cx,
-+                                     const XPTMethodDescriptor* method,
-+                                     const nsXPTParamInfo& param,
++    JSBool GetInterfaceTypeFromParam(JSContext *cx,
++                                     const XPTMethodDescriptor *method,
++                                     const nsXPTParamInfo &param,
 +                                     uint16_t methodIndex,
-+                                     const nsXPTType& type,
-+                                     nsXPTCMiniVariant* params,
-+                                     nsID* result);
++                                     const nsXPTType &type,
++                                     nsXPTCMiniVariant *params,
++                                     nsID *result);
 +
-+    void CleanupPointerArray(const nsXPTType& datum_type,
++    void CleanupPointerArray(const nsXPTType &datum_type,
 +                             uint32_t array_count,
-+                             void** arrayp);
++                             void **arrayp);
 +
-+    void CleanupPointerTypeObject(const nsXPTType& type,
-+                                  void** pp);
++    void CleanupPointerTypeObject(const nsXPTType &type,
++                                  void **pp);
 +
 +private:
-+    XPCJSRuntime* mRuntime;
-+    nsIInterfaceInfo* mInfo;
-+    char* mName;
++    XPCJSRuntime *mRuntime;
++    nsIInterfaceInfo *mInfo;
++    char *mName;
 +    nsIID mIID;
-+    uint32_t* mDescriptors;
++    uint32_t *mDescriptors;
 +};
 +
 +#endif // nsXPCWrappedJSClass_h

File xpcObjectHelper

 new file mode 100644
 --- /dev/null
 +++ b/js/xpconnect/src/xpcObjectHelper.h
-@@ -0,0 +1,109 @@
+@@ -0,0 +1,115 @@
++/* 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/. */
++
 +#ifndef xpcObjectHelper_h
 +#define xpcObjectHelper_h
 +
++#include "mozilla/Attributes.h"
++
 +#include "nsAutoPtr.h"
 +#include "nsCOMPtr.h"
 +#include "nsIClassInfo.h"
 +class xpcObjectHelper
 +{
 +public:
-+    xpcObjectHelper(nsISupports *aObject, nsWrapperCache *aCache = nsnull)
-+    : mCanonical(nsnull),
-+      mObject(aObject),
-+      mCache(aCache),
-+      mIsNode(false)
++    xpcObjectHelper(nsISupports *aObject, nsWrapperCache *aCache = NULL)
++      : mCanonical(NULL)
++      , mObject(aObject)
++      , mCache(aCache)
++      , mIsNode(false)
 +    {
 +        if (!mCache) {
 +            if (aObject)
 +                CallQueryInterface(aObject, &mCache);
 +            else
-+                mCache = nsnull;
++                mCache = NULL;
 +        }
 +    }
 +
-+    nsISupports* Object()
++    nsISupports *Object()
 +    {
 +        return mObject;
 +    }
 +
-+    nsISupports* GetCanonical()
++    nsISupports *GetCanonical()
 +    {
 +        if (!mCanonical) {
 +            mCanonicalStrong = do_QueryInterface(mObject);
 +
 +        if (!mCanonicalStrong)
 +            mCanonicalStrong = mCanonical;
-+        mCanonical = nsnull;
++        mCanonical = NULL;
 +        return mCanonicalStrong.forget();
 +    }
 +
 +protected:
 +    xpcObjectHelper(nsISupports *aObject, nsISupports *aCanonical,
 +                    nsWrapperCache *aCache, bool aIsNode)
-+    : mCanonical(aCanonical),
-+      mObject(aObject),
-+      mCache(aCache),
-+      mIsNode(aIsNode)
++      : mCanonical(aCanonical)
++      , mObject(aObject)
++      , mCache(aCache)
++      , mIsNode(aIsNode)
 +    {
 +        if (!mCache && aObject)
 +            CallQueryInterface(aObject, &mCache);
 +    }
 +
-+    nsCOMPtr<nsISupports>    mCanonicalStrong;
-+    nsISupports*             mCanonical;
++    nsCOMPtr<nsISupports> mCanonicalStrong;
++    nsISupports *mCanonical;
 +
 +private:
-+    xpcObjectHelper(xpcObjectHelper& aOther);
++    xpcObjectHelper(xpcObjectHelper &aOther) MOZ_DELETE;
 +
-+    nsISupports*             mObject;
-+    nsWrapperCache*          mCache;
-+    nsCOMPtr<nsIClassInfo>   mClassInfo;
++    nsISupports *mObject;
++    nsWrapperCache *mCache;
++    nsCOMPtr<nsIClassInfo> mClassInfo;
 +    nsRefPtr<nsXPCClassInfo> mXPCClassInfo;
-+    bool                     mIsNode;
++    bool mIsNode;
 +};
 +
 +#endif
 +    NS_DECL_ISUPPORTS
 +    NS_DECL_NSIPROPERTY
 +
-+    xpcProperty(const PRUnichar* aName, PRUint32 aNameLen, nsIVariant* aValue);
++    xpcProperty(const PRUnichar *aName, PRUint32 aNameLen, nsIVariant *aValue);
 +    virtual ~xpcProperty() {}
 +
 +private: