Bug 514280 Consistently declare and define IID accessors r=bsmedberg
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Fri, 28 Mar 2014 08:45:02 +0000
changeset 187875 4509cc145dfc241e323333c7aa098f402b6bd104
parent 187874 d91f49580ec82187515b25da7578b3b8c0f4ca73
child 187876 83714ee6b2bb6eddf388088c79e61fb39a8a53a9
push id5832
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:43:22 +0000
treeherdermozilla-aurora@4974d9da2f7d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs514280
milestone31.0a1
Bug 514280 Consistently declare and define IID accessors r=bsmedberg
content/html/content/src/HTMLInputElement.cpp
content/html/content/src/HTMLSelectElement.cpp
content/html/content/src/HTMLSelectElement.h
content/svg/content/src/SVGComponentTransferFunctionElement.h
content/svg/content/src/nsSVGFilters.cpp
content/svg/content/src/nsSVGFilters.h
content/xul/templates/src/nsRDFQuery.h
dom/bindings/test/TestBindingHeader.h
dom/indexedDB/IDBEvents.cpp
dom/indexedDB/IDBEvents.h
layout/base/nsIPresShell.h
layout/style/NameSpaceRule.h
layout/style/StyleRule.h
parser/htmlparser/public/nsIFragmentContentSink.h
toolkit/system/dbus/nsDBusService.cpp
toolkit/system/dbus/nsDBusService.h
widget/nsINativeMenuService.h
xpcom/glue/nsCycleCollectionParticipant.h
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -267,18 +267,19 @@ class HTMLInputElementState MOZ_FINAL : 
 
   protected:
     nsString mValue;
     nsTArray<nsCOMPtr<nsIDOMFile> > mFiles;
     bool mChecked;
     bool mCheckedSet;
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(HTMLInputElementState, NS_INPUT_ELEMENT_STATE_IID)
+
 NS_IMPL_ISUPPORTS1(HTMLInputElementState, HTMLInputElementState)
-NS_DEFINE_STATIC_IID_ACCESSOR(HTMLInputElementState, NS_INPUT_ELEMENT_STATE_IID)
 
 HTMLInputElement::nsFilePickerShownCallback::nsFilePickerShownCallback(
   HTMLInputElement* aInput, nsIFilePicker* aFilePicker)
   : mFilePicker(aFilePicker)
   , mInput(aInput)
 {
 }
 
--- a/content/html/content/src/HTMLSelectElement.cpp
+++ b/content/html/content/src/HTMLSelectElement.cpp
@@ -36,17 +36,16 @@
 #include "nsTextNode.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Select)
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_ISUPPORTS1(SelectState, SelectState)
-NS_DEFINE_STATIC_IID_ACCESSOR(SelectState, NS_SELECT_STATE_IID)
 
 //----------------------------------------------------------------------
 //
 // SafeOptionListMutation
 //
 
 SafeOptionListMutation::SafeOptionListMutation(nsIContent* aSelect,
                                                nsIContent* aParent,
--- a/content/html/content/src/HTMLSelectElement.h
+++ b/content/html/content/src/HTMLSelectElement.h
@@ -72,16 +72,18 @@ public:
     return mValues.Contains(aValue) || mIndices.Contains(aIndex);
   }
 
 private:
   nsCheapSet<nsStringHashKey> mValues;
   nsCheapSet<nsUint32HashKey> mIndices;
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(SelectState, NS_SELECT_STATE_IID)
+
 class MOZ_STACK_CLASS SafeOptionListMutation
 {
 public:
   /**
    * @param aSelect The select element which option list is being mutated.
    *                Can be null.
    * @param aParent The content object which is being mutated.
    * @param aKid    If not null, a new child element is being inserted to
--- a/content/svg/content/src/SVGComponentTransferFunctionElement.h
+++ b/content/svg/content/src/SVGComponentTransferFunctionElement.h
@@ -72,16 +72,18 @@ protected:
   static NumberInfo sNumberInfo[5];
 
   enum { TYPE };
   nsSVGEnum mEnumAttributes[1];
   static nsSVGEnumMapping sTypeMap[];
   static EnumInfo sEnumInfo[1];
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(SVGComponentTransferFunctionElement, NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
+
 } // namespace dom
 } // namespace mozilla
 
 nsresult NS_NewSVGFEFuncRElement(
     nsIContent** aResult, already_AddRefed<nsINodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 namespace dom {
--- a/content/svg/content/src/nsSVGFilters.cpp
+++ b/content/svg/content/src/nsSVGFilters.cpp
@@ -59,18 +59,16 @@ nsSVGElement::LengthInfo nsSVGFE::sLengt
 };
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ADDREF_INHERITED(nsSVGFE,nsSVGFEBase)
 NS_IMPL_RELEASE_INHERITED(nsSVGFE,nsSVGFEBase)
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsSVGFE, NS_SVG_FE_CID)
-
 NS_INTERFACE_MAP_BEGIN(nsSVGFE)
    // nsISupports is an ambiguous base of nsSVGFE so we have to work
    // around that
    if ( aIID.Equals(NS_GET_IID(nsSVGFE)) )
      foundInterface = static_cast<nsISupports*>(static_cast<void*>(this));
    else
 NS_INTERFACE_MAP_END_INHERITING(nsSVGFEBase)
 
@@ -240,18 +238,16 @@ nsSVGElement::EnumInfo SVGComponentTrans
 };
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ADDREF_INHERITED(SVGComponentTransferFunctionElement,SVGComponentTransferFunctionElementBase)
 NS_IMPL_RELEASE_INHERITED(SVGComponentTransferFunctionElement,SVGComponentTransferFunctionElementBase)
 
-NS_DEFINE_STATIC_IID_ACCESSOR(SVGComponentTransferFunctionElement, NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
-
 NS_INTERFACE_MAP_BEGIN(SVGComponentTransferFunctionElement)
    // nsISupports is an ambiguous base of nsSVGFE so we have to work
    // around that
    if ( aIID.Equals(NS_GET_IID(SVGComponentTransferFunctionElement)) )
      foundInterface = static_cast<nsISupports*>(static_cast<void*>(this));
    else
 NS_INTERFACE_MAP_END_INHERITING(SVGComponentTransferFunctionElementBase)
 
--- a/content/svg/content/src/nsSVGFilters.h
+++ b/content/svg/content/src/nsSVGFilters.h
@@ -142,16 +142,18 @@ protected:
   Size GetKernelUnitLength(nsSVGFilterInstance* aInstance,
                           nsSVGNumberPair *aKernelUnitLength);
 
   enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
   nsSVGLength2 mLengthAttributes[4];
   static LengthInfo sLengthInfo[4];
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(nsSVGFE, NS_SVG_FE_CID)
+
 typedef nsSVGElement SVGFEUnstyledElementBase;
 
 class SVGFEUnstyledElement : public SVGFEUnstyledElementBase
 {
 protected:
   SVGFEUnstyledElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
     : SVGFEUnstyledElementBase(aNodeInfo) {}
 
--- a/content/xul/templates/src/nsRDFQuery.h
+++ b/content/xul/templates/src/nsRDFQuery.h
@@ -119,11 +119,11 @@ protected:
     nsCOMPtr<nsIDOMNode> mQueryNode;
 
     // used for simple rules since their results are all determined in one step
     nsCOMPtr<nsISimpleEnumerator> mCachedResults;
 
     void Finish();
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsRDFQuery, NS_ITEMPLATERDFQUERY_IID)
+NS_DEFINE_STATIC_IID_ACCESSOR(nsITemplateRDFQuery, NS_ITEMPLATERDFQUERY_IID)
 
 #endif // nsRDFQuery_h__
--- a/dom/bindings/test/TestBindingHeader.h
+++ b/dom/bindings/test/TestBindingHeader.h
@@ -43,16 +43,18 @@ class nsRenamedInterface : public nsISup
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_RENAMED_INTERFACE_IID)
   NS_DECL_ISUPPORTS
 
   // We need a GetParentObject to make binding codegen happy
   virtual nsISupports* GetParentObject();
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(nsRenamedInterface, NS_RENAMED_INTERFACE_IID)
+
 // IID for the IndirectlyImplementedInterface
 #define NS_INDIRECTLY_IMPLEMENTED_INTERFACE_IID \
 { 0xfed55b69, 0x7012, 0x4849, \
  { 0xaf, 0x56, 0x4b, 0xa9, 0xee, 0x41, 0x30, 0x89 } }
 
 class IndirectlyImplementedInterface : public nsISupports,
                                        public nsWrapperCache
 {
@@ -63,27 +65,31 @@ public:
   // We need a GetParentObject to make binding codegen happy
   virtual nsISupports* GetParentObject();
 
   bool IndirectlyImplementedProperty();
   void IndirectlyImplementedProperty(bool);
   void IndirectlyImplementedMethod();
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(IndirectlyImplementedInterface, NS_INDIRECTLY_IMPLEMENTED_INTERFACE_IID)
+
 // IID for the TestExternalInterface
 #define NS_TEST_EXTERNAL_INTERFACE_IID \
 { 0xd5ba0c99, 0x9b1d, 0x4e71, \
  { 0x8a, 0x94, 0x56, 0x38, 0x6c, 0xa3, 0xda, 0x3d } }
 class TestExternalInterface : public nsISupports
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_TEST_EXTERNAL_INTERFACE_IID)
   NS_DECL_ISUPPORTS
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(TestExternalInterface, NS_TEST_EXTERNAL_INTERFACE_IID)
+
 class TestNonWrapperCacheInterface : public nsISupports
 {
 public:
   NS_DECL_ISUPPORTS
 
   virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> scope);
 };
 
--- a/dom/indexedDB/IDBEvents.cpp
+++ b/dom/indexedDB/IDBEvents.cpp
@@ -10,18 +10,16 @@
 #include "nsThreadUtils.h"
 
 #include "IDBRequest.h"
 #include "IDBTransaction.h"
 
 USING_INDEXEDDB_NAMESPACE
 using namespace mozilla::dom;
 
-NS_DEFINE_STATIC_IID_ACCESSOR(IDBVersionChangeEvent, IDBVERSIONCHANGEEVENT_IID)
-
 namespace {
 
 class EventFiringRunnable : public nsRunnable
 {
 public:
   EventFiringRunnable(EventTarget* aTarget,
                       nsIDOMEvent* aEvent)
   : mTarget(aTarget), mEvent(aEvent)
--- a/dom/indexedDB/IDBEvents.h
+++ b/dom/indexedDB/IDBEvents.h
@@ -153,11 +153,13 @@ protected:
                          const nsAString& aType,
                          uint64_t aOldVersion,
                          uint64_t aNewVersion);
 
   uint64_t mOldVersion;
   uint64_t mNewVersion;
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(IDBVersionChangeEvent, IDBVERSIONCHANGEEVENT_IID)
+
 END_INDEXEDDB_NAMESPACE
 
 #endif // mozilla_dom_indexeddb_idbevents_h__
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -163,27 +163,21 @@ enum nsRectVisibility {
  * presentation context, the style manager, the style set and the root
  * frame. <p>
  *
  * When this object is Release'd, it will release the document, the
  * presentation context, the style manager, the style set and the root
  * frame.
  */
 
-// hack to make egcs / gcc 2.95.2 happy
-class nsIPresShell_base : public nsISupports
+class nsIPresShell : public nsISupports
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRESSHELL_IID)
-};
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsIPresShell_base, NS_IPRESSHELL_IID)
-
-class nsIPresShell : public nsIPresShell_base
-{
 protected:
   typedef mozilla::layers::LayerManager LayerManager;
   typedef mozilla::gfx::SourceSurface SourceSurface;
 
   enum eRenderFlag {
     STATE_IGNORING_VIEWPORT_SCROLLING = 0x1,
     STATE_DRAWWINDOW_NOT_FLUSHING = 0x2
   };
@@ -1641,9 +1635,11 @@ protected:
   nscoord mMaxLineBoxWidth;
 
   // If a document belongs to an invisible DocShell, this flag must be set
   // to true, so we can avoid any paint calls for widget related to this
   // presshell.
   bool mIsNeverPainting;
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(nsIPresShell, NS_IPRESSHELL_IID)
+
 #endif /* nsIPresShell_h___ */
--- a/layout/style/NameSpaceRule.h
+++ b/layout/style/NameSpaceRule.h
@@ -59,14 +59,14 @@ public:
   // nsIDOMCSSRule interface
   NS_DECL_NSIDOMCSSRULE
 
 private:
   nsCOMPtr<nsIAtom> mPrefix;
   nsString          mURLSpec;
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(NameSpaceRule, NS_CSS_NAMESPACE_RULE_IMPL_CID)
+
 } // namespace css
 } // namespace mozilla
 
-NS_DEFINE_STATIC_IID_ACCESSOR(mozilla::css::NameSpaceRule, NS_CSS_NAMESPACE_RULE_IMPL_CID)
-
 #endif /* mozilla_css_NameSpaceRule_h__ */
--- a/layout/style/StyleRule.h
+++ b/layout/style/StyleRule.h
@@ -377,14 +377,14 @@ private:
   uint32_t                mLineNumber;
   uint32_t                mColumnNumber : 31;
   uint32_t                mWasMatched : 1;
 
 private:
   StyleRule& operator=(const StyleRule& aCopy) MOZ_DELETE;
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(StyleRule, NS_CSS_STYLE_RULE_IMPL_CID)
+
 } // namespace css
 } // namespace mozilla
 
-NS_DEFINE_STATIC_IID_ACCESSOR(mozilla::css::StyleRule, NS_CSS_STYLE_RULE_IMPL_CID)
-
 #endif /* mozilla_css_StyleRule_h__ */
--- a/parser/htmlparser/public/nsIFragmentContentSink.h
+++ b/parser/htmlparser/public/nsIFragmentContentSink.h
@@ -66,31 +66,12 @@ public:
    * Sets whether scripts elements are marked as unexecutable.
    */
   NS_IMETHOD SetPreventScriptExecution(bool aPreventScriptExecution) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIFragmentContentSink,
                               NS_I_FRAGMENT_CONTENT_SINK_IID)
 
-/**
- * This interface is implemented by paranoid content sinks, and allows consumers
- * to add tags and attributes to the default white-list set.
- */
-class nsIParanoidFragmentContentSink : public nsISupports {
-public:
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_I_PARANOID_FRAGMENT_CONTENT_SINK_IID)
-
-  /**
-   * Allow the content sink to accept style elements and attributes.
-   */
-  virtual void AllowStyles() = 0;
-
-  /**
-   * Allow the content sink to accept comments.
-   */
-  virtual void AllowComments() = 0;
-};
-
 nsresult
 NS_NewXMLFragmentContentSink(nsIFragmentContentSink** aInstancePtrResult);
 
 #endif
--- a/toolkit/system/dbus/nsDBusService.cpp
+++ b/toolkit/system/dbus/nsDBusService.cpp
@@ -23,17 +23,16 @@ nsDBusService::~nsDBusService() {
   DropConnection();
   if (mReconnectTimer) {
     mReconnectTimer->Cancel();
   }
   gSingleton = nullptr;
 }
 
 NS_IMPL_ISUPPORTS1(nsDBusService, nsDBusService)
-NS_DEFINE_STATIC_IID_ACCESSOR(nsDBusService, NS_DBUS_IID)
 
 nsDBusService* nsDBusService::gSingleton = nullptr;
 
 already_AddRefed<nsDBusService>
 nsDBusService::Get() {
   if (!gSingleton) {
     gSingleton = new nsDBusService();
   }
--- a/toolkit/system/dbus/nsDBusService.h
+++ b/toolkit/system/dbus/nsDBusService.h
@@ -67,9 +67,11 @@ private:
 
   static nsDBusService* gSingleton;
   
   DBusConnection*    mConnection;
   nsCOMPtr<nsITimer> mReconnectTimer;
   DBusClient*        mSingleClient;
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(nsDBusService, NS_DBUS_IID)
+
 #endif /*NSDBUSSERVICE_H_*/
--- a/widget/nsINativeMenuService.h
+++ b/widget/nsINativeMenuService.h
@@ -13,15 +13,18 @@ class nsIContent;
 
 // {90DF88F9-F084-4EF3-829A-49496E636DED}
 #define NS_INATIVEMENUSERVICE_IID \
 { 0x90DF88F9, 0xF084, 0x4EF3, \
 { 0x82, 0x9A, 0x49, 0x49, 0x6E, 0x63, 0x6D, 0xED} }
 
 class nsINativeMenuService : public nsISupports {
 public:
+  NS_DECLARE_STATIC_IID_ACCESSOR(NS_INATIVEMENUSERVICE_IID)
   // Given a top-level window widget and a menu bar DOM node, sets up native
   // menus. Once created, native menus are controlled via the DOM, including
   // destruction.
   NS_IMETHOD CreateNativeMenuBar(nsIWidget* aParent, nsIContent* aMenuBarNode)=0;
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(nsINativeMenuService, NS_INATIVEMENUSERVICE_IID)
+
 #endif // nsINativeMenuService_h_
--- a/xpcom/glue/nsCycleCollectionParticipant.h
+++ b/xpcom/glue/nsCycleCollectionParticipant.h
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsCycleCollectionParticipant_h__
 #define nsCycleCollectionParticipant_h__
 
 #include "nsCycleCollectionNoteChild.h"
 #include "js/RootingAPI.h"
 
-#define NS_CYCLECOLLECTIONPARTICIPANT_IID                                      \
+#define NS_XPCOMCYCLECOLLECTIONPARTICIPANT_IID                                 \
 {                                                                              \
     0x9674489b,                                                                \
     0x1f6f,                                                                    \
     0x4550,                                                                    \
     { 0xa7, 0x30, 0xcc, 0xae, 0xdd, 0x10, 0x4c, 0xf9 }                         \
 }
 
 /**
@@ -90,18 +90,16 @@ struct TraceCallbackFunc : public TraceC
  * Participant implementation classes
  */
 class NS_NO_VTABLE nsCycleCollectionParticipant
 {
 public:
     MOZ_CONSTEXPR nsCycleCollectionParticipant() : mMightSkip(false) {}
     MOZ_CONSTEXPR nsCycleCollectionParticipant(bool aSkip) : mMightSkip(aSkip) {}
 
-    NS_DECLARE_STATIC_IID_ACCESSOR(NS_CYCLECOLLECTIONPARTICIPANT_IID)
-
     NS_IMETHOD Traverse(void *p, nsCycleCollectionTraversalCallback &cb) = 0;
 
     NS_IMETHOD_(void) Root(void *p) = 0;
     NS_IMETHOD_(void) Unlink(void *p) = 0;
     NS_IMETHOD_(void) Unroot(void *p) = 0;
 
     NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure) {};
 
@@ -148,19 +146,16 @@ protected:
         NS_ASSERTION(false, "Forgot to implement CanSkipThisReal?");
         return false;
     }
 
 private:
     const bool mMightSkip;
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsCycleCollectionParticipant,
-                              NS_CYCLECOLLECTIONPARTICIPANT_IID)
-
 class NS_NO_VTABLE nsScriptObjectTracer : public nsCycleCollectionParticipant
 {
 public:
     MOZ_CONSTEXPR nsScriptObjectTracer() : nsCycleCollectionParticipant(false) {}
     MOZ_CONSTEXPR nsScriptObjectTracer(bool aSkip) : nsCycleCollectionParticipant(aSkip) {}
 
     NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure) = 0;
 
@@ -169,24 +164,29 @@ public:
 };
 
 class NS_NO_VTABLE nsXPCOMCycleCollectionParticipant : public nsScriptObjectTracer
 {
 public:
     MOZ_CONSTEXPR nsXPCOMCycleCollectionParticipant() : nsScriptObjectTracer(false) {}
     MOZ_CONSTEXPR nsXPCOMCycleCollectionParticipant(bool aSkip) : nsScriptObjectTracer(aSkip) {}
 
+    NS_DECLARE_STATIC_IID_ACCESSOR(NS_XPCOMCYCLECOLLECTIONPARTICIPANT_IID)
+
     NS_IMETHOD_(void) Root(void *p);
     NS_IMETHOD_(void) Unroot(void *p);
 
     NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure);
 
     static bool CheckForRightISupports(nsISupports *s);
 };
 
+NS_DEFINE_STATIC_IID_ACCESSOR(nsXPCOMCycleCollectionParticipant,
+                              NS_XPCOMCYCLECOLLECTIONPARTICIPANT_IID)
+
 ///////////////////////////////////////////////////////////////////////////////
 // Helpers for implementing a QI to nsXPCOMCycleCollectionParticipant
 ///////////////////////////////////////////////////////////////////////////////
 
 #define NS_CYCLE_COLLECTION_CLASSNAME(_class)                                  \
         _class::NS_CYCLE_COLLECTION_INNERCLASS
 
 #define NS_IMPL_QUERY_CYCLE_COLLECTION(_class)                                 \