Bug 1296726, part 1 - Remove trailing whitespace from xpcom/reflect/xptinfo. r=froydnj draft
authorAndrew McCreight <continuation@gmail.com>
Thu, 18 Aug 2016 19:40:17 -0700
changeset 404101 8ef8b714044b5b5d145542a57cba5fe3269e5e69
parent 404100 c95b5e55266683f2571a9ab35374861997c6eb1f
child 404102 865730a2d5778dcc5f2f1ae0cb0197b2035e72ee
push id27116
push userbmo:continuation@gmail.com
push dateMon, 22 Aug 2016 22:46:30 +0000
reviewersfroydnj
bugs1296726
milestone51.0a1
Bug 1296726, part 1 - Remove trailing whitespace from xpcom/reflect/xptinfo. r=froydnj MozReview-Commit-ID: ewdP6XFfmr
xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
xpcom/reflect/xptinfo/nsIInterfaceInfo.idl
xpcom/reflect/xptinfo/nsIInterfaceInfoManager.idl
xpcom/reflect/xptinfo/xptiInterfaceInfoManager.cpp
xpcom/reflect/xptinfo/xptiTypelibGuts.cpp
xpcom/reflect/xptinfo/xptinfo.h
xpcom/reflect/xptinfo/xptiprivate.h
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
@@ -325,17 +325,17 @@ struct ComponentsInterfaceShimEntry {
  *   interface.  Otherwise, use DEFINE_SHIM_WITH_CUSTOM_INTERFACE.
  */
 
 const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] =
 {
   DEFINE_SHIM(AnimationEvent),
   DEFINE_SHIM(Attr),
   DEFINE_SHIM(BeforeUnloadEvent),
-  DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIBrowserBoxObject, ContainerBoxObject),  
+  DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIBrowserBoxObject, ContainerBoxObject),
   DEFINE_SHIM(CanvasRenderingContext2D),
   DEFINE_SHIM(CDATASection),
   DEFINE_SHIM(CharacterData),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMClientRect, DOMRectReadOnly),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMClientRectList, DOMRectList),
   DEFINE_SHIM(ClipboardEvent),
   DEFINE_SHIM(CommandEvent),
   DEFINE_SHIM(Comment),
@@ -428,28 +428,28 @@ const ComponentsInterfaceShimEntry kComp
   DEFINE_SHIM(OfflineResourceList),
   DEFINE_SHIM(PaintRequest),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMParser, DOMParser),
   DEFINE_SHIM(ProcessingInstruction),
   DEFINE_SHIM(Range),
   DEFINE_SHIM(Rect),
   DEFINE_SHIM(Screen),
   DEFINE_SHIM(ScrollAreaEvent),
-  DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIScrollBoxObject, ScrollBoxObject),  
+  DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIScrollBoxObject, ScrollBoxObject),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMSerializer, XMLSerializer),
   DEFINE_SHIM(SimpleGestureEvent),
   DEFINE_SHIM(StyleSheet),
   DEFINE_SHIM(StyleSheetList),
   DEFINE_SHIM(SVGElement),
   DEFINE_SHIM(SVGLength),
   DEFINE_SHIM(Text),
   DEFINE_SHIM(TimeEvent),
   DEFINE_SHIM(TimeRanges),
   DEFINE_SHIM(TransitionEvent),
-  DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsITreeBoxObject, TreeBoxObject),  
+  DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsITreeBoxObject, TreeBoxObject),
   DEFINE_SHIM(TreeWalker),
   DEFINE_SHIM(UIEvent),
   DEFINE_SHIM(ValidityState),
   DEFINE_SHIM(WheelEvent),
   DEFINE_SHIM(XMLDocument),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIXMLHttpRequestEventTarget, XMLHttpRequestEventTarget),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIXMLHttpRequestUpload, XMLHttpRequestUpload),
   DEFINE_SHIM(XPathEvaluator),
--- a/xpcom/reflect/xptinfo/nsIInterfaceInfo.idl
+++ b/xpcom/reflect/xptinfo/nsIInterfaceInfo.idl
@@ -9,17 +9,17 @@
 #include "nsISupports.idl"
 
 // forward declaration of non-XPCOM types
 
 [ptr] native nsXPTMethodInfoPtr(nsXPTMethodInfo);
 [ptr] native nsXPTParamInfoPtr(nsXPTParamInfo);
       native nsXPTType(nsXPTType);
 
-// We bend the rules to do a [shared] nsIID (but this is never scriptable)  
+// We bend the rules to do a [shared] nsIID (but this is never scriptable)
 [ptr] native nsIIDPtrShared(nsIID);
 
 %{C++
 class nsXPTMethodInfo;
 class nsXPTParamInfo;
 class nsXPTType;
 %}
 
@@ -37,66 +37,65 @@ interface nsIInterfaceInfo : nsISupports
     /**
     * These include counts for parent (and all ancestors).
     */
     readonly attribute uint16_t methodCount;
     readonly attribute uint16_t constantCount;
 
     /**
     * These include methods and constants for parent (and all ancestors).
-    * 
+    *
     * These do *not* make copies ***explicit bending of XPCOM rules***.
     */
-    
-    void getMethodInfo(in uint16_t index, 
+
+    void getMethodInfo(in uint16_t index,
                        [shared, retval] out nsXPTMethodInfoPtr info);
 
-    void getMethodInfoForName(in string methodName, out uint16_t index, 
+    void getMethodInfoForName(in string methodName, out uint16_t index,
                        [shared, retval] out nsXPTMethodInfoPtr info);
 
     void getConstant(in uint16_t index,
                      out jsval constant,
                      out string name);
 
 
     /**
     * Get the interface information or iid associated with a param of some
     * method in this interface.
     */
 
-    nsIInterfaceInfo getInfoForParam(in uint16_t methodIndex, 
+    nsIInterfaceInfo getInfoForParam(in uint16_t methodIndex,
                                      [const] in nsXPTParamInfoPtr param);
 
-    nsIIDPtr getIIDForParam(in uint16_t methodIndex, 
+    nsIIDPtr getIIDForParam(in uint16_t methodIndex,
                             [const] in nsXPTParamInfoPtr param);
 
 
     /**
     * These do *not* make copies ***explicit bending of XPCOM rules***.
     */
 
-    nsXPTType getTypeForParam(in uint16_t methodIndex, 
+    nsXPTType getTypeForParam(in uint16_t methodIndex,
                               [const] in nsXPTParamInfoPtr param,
                               in uint16_t dimension);
 
-    uint8_t getSizeIsArgNumberForParam(in uint16_t methodIndex, 
+    uint8_t getSizeIsArgNumberForParam(in uint16_t methodIndex,
                                        [const] in nsXPTParamInfoPtr param,
                                        in uint16_t dimension);
 
-    uint8_t getInterfaceIsArgNumberForParam(in uint16_t methodIndex, 
+    uint8_t getInterfaceIsArgNumberForParam(in uint16_t methodIndex,
                                             [const] in nsXPTParamInfoPtr param);
 
     boolean isIID(in nsIIDPtr IID);
 
     void   getNameShared([shared,retval] out string name);
     void   getIIDShared([shared,retval] out nsIIDPtrShared iid);
 
     boolean isFunction();
 
     boolean hasAncestor(in nsIIDPtr iid);
 
-    [notxpcom] nsresult getIIDForParamNoAlloc(in uint16_t methodIndex, 
+    [notxpcom] nsresult getIIDForParamNoAlloc(in uint16_t methodIndex,
                                               [const] in nsXPTParamInfoPtr param,
                                               out nsIID iid);
 
     boolean isMainProcessScriptableOnly();
 };
-
--- a/xpcom/reflect/xptinfo/nsIInterfaceInfoManager.idl
+++ b/xpcom/reflect/xptinfo/nsIInterfaceInfoManager.idl
@@ -24,14 +24,13 @@ interface nsIInterfaceInfoManager : nsIS
 
     nsIEnumerator enumerateInterfacesWhoseNamesStartWith(in string prefix);
 };
 
 %{C++
 #define NS_INTERFACEINFOMANAGER_SERVICE_CID            \
  { /* 13bef784-f8e0-4f96-85c1-09f9ef4f9a19 */          \
   0x13bef784, 0xf8e0, 0x4f96,                          \
-  {0x85, 0xc1, 0x09, 0xf9, 0xef, 0x4f, 0x9a, 0x19} }  
+  {0x85, 0xc1, 0x09, 0xf9, 0xef, 0x4f, 0x9a, 0x19} }
 
 #define NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID  \
    "@mozilla.org/xpti/interfaceinfomanager-service;1"
 %}
-
--- a/xpcom/reflect/xptinfo/xptiInterfaceInfoManager.cpp
+++ b/xpcom/reflect/xptinfo/xptiInterfaceInfoManager.cpp
@@ -141,26 +141,26 @@ XPTInterfaceInfoManager::VerifyAndAddEnt
     // in xpcom/reflect/xptcall/genstubs.pl; do not change this value
     // without changing that one or you WILL see problems.
     if (iface->interface_descriptor->num_methods > 250 &&
             !(XPT_ID_IS_BUILTINCLASS(iface->interface_descriptor->flags))) {
         NS_ASSERTION(0, "Too many methods to handle for the stub, cannot load");
         fprintf(stderr, "ignoring too large interface: %s\n", iface->name);
         return;
     }
-    
+
     mWorkingSet.mTableReentrantMonitor.AssertCurrentThreadIn();
     xptiInterfaceEntry* entry = mWorkingSet.mIIDTable.Get(iface->iid);
     if (entry) {
         // XXX validate this info to find possible inconsistencies
         LOG_AUTOREG(("      ignoring repeated interface: %s\n", iface->name));
         return;
     }
-    
-    // Build a new xptiInterfaceEntry object and hook it up. 
+
+    // Build a new xptiInterfaceEntry object and hook it up.
 
     entry = xptiInterfaceEntry::Create(iface->name,
                                        iface->iid,
                                        iface->interface_descriptor,
                                        typelib);
     if (!entry)
         return;
 
@@ -174,27 +174,27 @@ XPTInterfaceInfoManager::VerifyAndAddEnt
     mWorkingSet.mNameTable.Put(entry->GetTheName(), entry);
 
     typelib->SetEntryAt(idx, entry);
 
     LOG_AUTOREG(("      added interface: %s\n", iface->name));
 }
 
 // this is a private helper
-static nsresult 
+static nsresult
 EntryToInfo(xptiInterfaceEntry* entry, nsIInterfaceInfo **_retval)
 {
     if (!entry) {
         *_retval = nullptr;
-        return NS_ERROR_FAILURE;    
+        return NS_ERROR_FAILURE;
     }
 
     RefPtr<xptiInterfaceInfo> info = entry->InterfaceInfo();
     info.forget(_retval);
-    return NS_OK;    
+    return NS_OK;
 }
 
 xptiInterfaceEntry*
 XPTInterfaceInfoManager::GetInterfaceEntryForIID(const nsIID *iid)
 {
     ReentrantMonitorAutoEnter monitor(mWorkingSet.mTableReentrantMonitor);
     return mWorkingSet.mIIDTable.Get(*iid);
 }
@@ -226,33 +226,33 @@ XPTInterfaceInfoManager::GetIIDForName(c
 {
     NS_ASSERTION(name, "bad param");
     NS_ASSERTION(_retval, "bad param");
 
     ReentrantMonitorAutoEnter monitor(mWorkingSet.mTableReentrantMonitor);
     xptiInterfaceEntry* entry = mWorkingSet.mNameTable.Get(name);
     if (!entry) {
         *_retval = nullptr;
-        return NS_ERROR_FAILURE;    
+        return NS_ERROR_FAILURE;
     }
 
     return entry->GetIID(_retval);
 }
 
 NS_IMETHODIMP
 XPTInterfaceInfoManager::GetNameForIID(const nsIID * iid, char **_retval)
 {
     NS_ASSERTION(iid, "bad param");
     NS_ASSERTION(_retval, "bad param");
 
     ReentrantMonitorAutoEnter monitor(mWorkingSet.mTableReentrantMonitor);
     xptiInterfaceEntry* entry = mWorkingSet.mIIDTable.Get(*iid);
     if (!entry) {
         *_retval = nullptr;
-        return NS_ERROR_FAILURE;    
+        return NS_ERROR_FAILURE;
     }
 
     return entry->GetName(_retval);
 }
 
 void
 XPTInterfaceInfoManager::GetScriptableInterfaces(nsCOMArray<nsIInterfaceInfo>& aInterfaces)
 {
--- a/xpcom/reflect/xptinfo/xptiTypelibGuts.cpp
+++ b/xpcom/reflect/xptinfo/xptiTypelibGuts.cpp
@@ -12,18 +12,18 @@ using namespace mozilla;
 
 // Ensure through static analysis that xptiTypelibGuts won't have a vtable.
 template <class T>
 class MOZ_NEEDS_NO_VTABLE_TYPE CheckNoVTable
 {
 };
 CheckNoVTable<xptiTypelibGuts> gChecker;
 
-// static 
-xptiTypelibGuts* 
+// static
+xptiTypelibGuts*
 xptiTypelibGuts::Create(XPTHeader* aHeader)
 {
     NS_ASSERTION(aHeader, "bad param");
     size_t n = sizeof(xptiTypelibGuts) +
                sizeof(xptiInterfaceEntry*) * (aHeader->num_interfaces - 1);
     void* place = XPT_CALLOC8(gXPTIStructArena, n);
     if (!place)
         return nullptr;
--- a/xpcom/reflect/xptinfo/xptinfo.h
+++ b/xpcom/reflect/xptinfo/xptinfo.h
@@ -6,17 +6,17 @@
 /* XPTI_PUBLIC_API and XPTI_GetInterfaceInfoManager declarations. */
 
 #ifndef xptiinfo_h___
 #define xptiinfo_h___
 
 #include "nscore.h"
 #include "xpt_struct.h"
 
-// Flyweight wrapper classes for xpt_struct.h structs. 
+// Flyweight wrapper classes for xpt_struct.h structs.
 // Everything here is dependent upon - and sensitive to changes in -
 // xpcom/typelib/xpt/xpt_struct.h!
 
 class nsXPTType : public XPTTypeDescriptorPrefix
 {
 // NO DATA - this a flyweight wrapper
 public:
     nsXPTType()
@@ -62,18 +62,18 @@ public:
              case T_INTERFACE_IS:
                return true;
            }
         }
 
     bool IsArray() const
         {return TagPart() == T_ARRAY;}
 
-    // 'Dependent' means that params of this type are dependent upon other 
-    // params. e.g. an T_INTERFACE_IS is dependent upon some other param at 
+    // 'Dependent' means that params of this type are dependent upon other
+    // params. e.g. an T_INTERFACE_IS is dependent upon some other param at
     // runtime to say what the interface type of this param really is.
     bool IsDependent() const
         {  switch (TagPart()) {
              default:
                return false;
              case T_INTERFACE_IS:
              case TD_ARRAY:
              case T_PSTRING_SIZE_IS:
--- a/xpcom/reflect/xptinfo/xptiprivate.h
+++ b/xpcom/reflect/xptinfo/xptiprivate.h
@@ -90,23 +90,23 @@ extern XPTArena* gXPTIStructArena;
 
 class xptiTypelibGuts
 {
 public:
     static xptiTypelibGuts* Create(XPTHeader* aHeader);
 
     XPTHeader*          GetHeader()           {return mHeader;}
     uint16_t            GetEntryCount() const {return mHeader->num_interfaces;}
-    
+
     void                SetEntryAt(uint16_t i, xptiInterfaceEntry* ptr)
     {
         NS_ASSERTION(mHeader,"bad state!");
         NS_ASSERTION(i < GetEntryCount(),"bad param!");
         mEntryArray[i] = ptr;
-    }        
+    }
 
     xptiInterfaceEntry* GetEntryAt(uint16_t i);
     const char* GetEntryNameAt(uint16_t i);
 
 private:
     explicit xptiTypelibGuts(XPTHeader* aHeader)
         : mHeader(aHeader)
     { }
@@ -116,52 +116,52 @@ private:
     XPTHeader*           mHeader;        // hold pointer into arena
     xptiInterfaceEntry*  mEntryArray[1]; // Always last. Sized to fit.
 };
 
 /***************************************************************************/
 
 /***************************************************************************/
 
-// This class exists to help xptiInterfaceInfo store a 4-state (2 bit) value 
+// This class exists to help xptiInterfaceInfo store a 4-state (2 bit) value
 // and a set of bitflags in one 8bit value. See below.
 
 class xptiInfoFlags
 {
     enum {STATE_MASK = 3};
 public:
     explicit xptiInfoFlags(uint8_t n) : mData(n) {}
     xptiInfoFlags(const xptiInfoFlags& r) : mData(r.mData) {}
 
     static uint8_t GetStateMask()
         {return uint8_t(STATE_MASK);}
-    
+
     void Clear()
         {mData = 0;}
 
     uint8_t GetData() const
         {return mData;}
 
-    uint8_t GetState() const 
+    uint8_t GetState() const
         {return mData & GetStateMask();}
 
-    void SetState(uint8_t state) 
-        {mData &= ~GetStateMask(); mData |= state;}                                   
+    void SetState(uint8_t state)
+        {mData &= ~GetStateMask(); mData |= state;}
 
-    void SetFlagBit(uint8_t flag, bool on) 
+    void SetFlagBit(uint8_t flag, bool on)
         {if(on)
             mData |= ~GetStateMask() & flag;
          else
             mData &= GetStateMask() | ~flag;}
 
-    bool GetFlagBit(uint8_t flag) const 
+    bool GetFlagBit(uint8_t flag) const
         {return (mData & flag) ? true : false;}
 
 private:
-    uint8_t mData;    
+    uint8_t mData;
 };
 
 /****************************************************/
 
 // No virtual methods.
 // We always create in the struct arena and construct using "placement new".
 // No members need dtor calls.
 
@@ -173,24 +173,24 @@ public:
                                       XPTInterfaceDescriptor* aDescriptor,
                                       xptiTypelibGuts* aTypelib);
 
     enum {
         PARTIALLY_RESOLVED    = 1,
         FULLY_RESOLVED        = 2,
         RESOLVE_FAILED        = 3
     };
-    
+
     // Additional bit flags...
     enum {SCRIPTABLE = 4, BUILTINCLASS = 8, HASNOTXPCOM = 16,
           MAIN_PROCESS_SCRIPTABLE_ONLY = 32};
 
     uint8_t GetResolveState() const {return mFlags.GetState();}
-    
-    bool IsFullyResolved() const 
+
+    bool IsFullyResolved() const
         {return GetResolveState() == (uint8_t) FULLY_RESOLVED;}
 
     void SetScriptableFlag(bool on)
                 {mFlags.SetFlagBit(uint8_t(SCRIPTABLE),on);}
     bool GetScriptableFlag() const
                 {return mFlags.GetFlagBit(uint8_t(SCRIPTABLE));}
     void SetBuiltinClassFlag(bool on)
                 {mFlags.SetFlagBit(uint8_t(BUILTINCLASS),on);}
@@ -214,19 +214,19 @@ public:
 
     const nsID* GetTheIID()  const {return &mIID;}
     const char* GetTheName() const {return mName;}
 
     bool EnsureResolved()
         {return IsFullyResolved() ? true : Resolve();}
 
     already_AddRefed<xptiInterfaceInfo> InterfaceInfo();
-    bool     InterfaceInfoEquals(const xptiInterfaceInfo* info) const 
+    bool     InterfaceInfoEquals(const xptiInterfaceInfo* info) const
         {return info == mInfo;}
-    
+
     void     LockedInvalidateInterfaceInfo();
     void     LockedInterfaceInfoDeathNotification() {mInfo = nullptr;}
 
     xptiInterfaceEntry* Parent() const {
         NS_ASSERTION(IsFullyResolved(), "Parent() called while not resolved?");
         return mParent;
     }
 
@@ -268,32 +268,32 @@ public:
 private:
     xptiInterfaceEntry(const char* name,
                        size_t nameLength,
                        const nsID& iid,
                        XPTInterfaceDescriptor* aDescriptor,
                        xptiTypelibGuts* aTypelib);
     ~xptiInterfaceEntry();
 
-    void SetResolvedState(int state) 
+    void SetResolvedState(int state)
         {mFlags.SetState(uint8_t(state));}
 
     bool Resolve();
 
-    // We only call these "*Locked" variants after locking. This is done to 
-    // allow reentrace as files are loaded and various interfaces resolved 
+    // We only call these "*Locked" variants after locking. This is done to
+    // allow reentrace as files are loaded and various interfaces resolved
     // without having to worry about the locked state.
 
     bool EnsureResolvedLocked()
         {return IsFullyResolved() ? true : ResolveLocked();}
     bool ResolveLocked();
 
     // private helpers
 
-    nsresult GetEntryForParam(uint16_t methodIndex, 
+    nsresult GetEntryForParam(uint16_t methodIndex,
                               const nsXPTParamInfo * param,
                               xptiInterfaceEntry** entry);
 
     nsresult GetTypeInArray(const nsXPTParamInfo* param,
                             uint16_t dimension,
                             const XPTTypeDescriptor** type);
 
     nsresult GetInterfaceIndexForParam(uint16_t methodIndex,
@@ -369,17 +369,17 @@ private:
     ~xptiInterfaceInfo();
 
     // Note that mParent might still end up as nullptr if we don't have one.
     bool EnsureParent()
     {
         NS_ASSERTION(mEntry && mEntry->IsFullyResolved(), "bad EnsureParent call");
         return mParent || !mEntry->Parent() || BuildParent();
     }
-    
+
     bool EnsureResolved()
     {
         return mEntry && mEntry->EnsureResolved();
     }
 
     bool BuildParent();
 
     xptiInterfaceInfo();  // not implemented