Bug 514280 Remove GetIID r=bsmedberg
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Tue, 18 Mar 2014 00:23:11 +0000
changeset 173982 57165fdfa87ff60abb472ba26bd812c143dd7565
parent 173981 1d805dccc3572d5108c4a9cc06180c047a2ceaa4
child 173983 1fb7e8584deaad8031d0a25208034e4c84d3c5d6
push id26438
push userphilringnalda@gmail.com
push dateTue, 18 Mar 2014 05:39:07 +0000
treeherderautoland@89275f0ae29f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs514280
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 514280 Remove GetIID r=bsmedberg
uriloader/exthandler/android/nsExternalSharingAppService.cpp
xpcom/glue/nsID.h
xpcom/tests/TestCOMPtr.cpp
xpcom/tests/TestHashtables.cpp
xpcom/tests/TestRefPtr.cpp
--- a/uriloader/exthandler/android/nsExternalSharingAppService.cpp
+++ b/uriloader/exthandler/android/nsExternalSharingAppService.cpp
@@ -47,14 +47,14 @@ nsExternalSharingAppService::GetSharingA
     return NS_OK;
   AndroidBridge::Bridge()->GetHandlersForMimeType(aMIMEType, array,
                                                   nullptr, sendAction);
   array->GetLength(aLen);
   *aHandlers =
     static_cast<nsISharingHandlerApp**>(NS_Alloc(sizeof(nsISharingHandlerApp*)
                                                  * *aLen));
   for (uint32_t i = 0; i < *aLen; i++) {
-    rv = array->QueryElementAt(i, nsISharingHandlerApp::GetIID(),
+    rv = array->QueryElementAt(i, NS_GET_IID(nsISharingHandlerApp),
                                (void**)(*aHandlers + i));
     NS_ENSURE_SUCCESS(rv, rv);
   }
   return NS_OK;
 }
--- a/xpcom/glue/nsID.h
+++ b/xpcom/glue/nsID.h
@@ -118,26 +118,25 @@ typedef nsID nsIID;
  * merged on windows). Dummy should always be instantiated as "int".
  */
 
 #define NS_DECLARE_STATIC_IID_ACCESSOR(the_iid)                         \
   template <class Dummy>                                                \
   struct COMTypeInfo                                                    \
   {                                                                     \
     static const nsIID kIID NS_HIDDEN;                                  \
-  };                                                                    \
-  static const nsIID& GetIID() {return COMTypeInfo<int>::kIID;}
+  };
 
 #define NS_DEFINE_STATIC_IID_ACCESSOR(the_interface, the_iid)           \
   template <class Dummy>                                                \
   const nsIID the_interface::COMTypeInfo<Dummy>::kIID NS_HIDDEN = the_iid;
 
 /**
  * A macro to build the static const CID accessor method
  */
 
 #define NS_DEFINE_STATIC_CID_ACCESSOR(the_cid) \
   static const nsID& GetCID() {static const nsID cid = the_cid; return cid;}
 
-#define NS_GET_IID(T) (::T::COMTypeInfo<int>::kIID)
+#define NS_GET_IID(T) (T::COMTypeInfo<int>::kIID)
 #define NS_GET_TEMPLATE_IID(T) (T::template COMTypeInfo<int>::kIID)
 
 #endif
--- a/xpcom/tests/TestCOMPtr.cpp
+++ b/xpcom/tests/TestCOMPtr.cpp
@@ -132,17 +132,17 @@ IFoo::Release()
 
 nsresult
 IFoo::QueryInterface( const nsIID& aIID, void** aResult )
 	{
     printf("IFoo@%p::QueryInterface()\n", static_cast<void*>(this));
 		nsISupports* rawPtr = 0;
 		nsresult status = NS_OK;
 
-		if ( aIID.Equals(GetIID()) )
+		if ( aIID.Equals(NS_GET_IID(IFoo)) )
 			rawPtr = this;
 		else
 			{
 				nsID iid_of_ISupports = NS_ISUPPORTS_IID;
 				if ( aIID.Equals(iid_of_ISupports) )
 					rawPtr = static_cast<nsISupports*>(this);
 				else
 					status = NS_ERROR_NO_INTERFACE;
@@ -222,17 +222,17 @@ IBar::~IBar()
 
 nsresult
 IBar::QueryInterface( const nsID& aIID, void** aResult )
 	{
     printf("IBar@%p::QueryInterface()\n", static_cast<void*>(this));
 		nsISupports* rawPtr = 0;
 		nsresult status = NS_OK;
 
-		if ( aIID.Equals(GetIID()) )
+		if ( aIID.Equals(NS_GET_IID(IBar)) )
 			rawPtr = this;
 		else if ( aIID.Equals(NS_GET_IID(IFoo)) )
 			rawPtr = static_cast<IFoo*>(this);
 		else
 			{
 				nsID iid_of_ISupports = NS_ISUPPORTS_IID;
 				if ( aIID.Equals(iid_of_ISupports) )
 					rawPtr = static_cast<nsISupports*>(this);
--- a/xpcom/tests/TestHashtables.cpp
+++ b/xpcom/tests/TestHashtables.cpp
@@ -276,17 +276,17 @@ IFoo::Release()
 
 nsresult
 IFoo::QueryInterface( const nsIID& aIID, void** aResult )
   {
     printf("IFoo@%p::QueryInterface()\n", static_cast<void*>(this));
     nsISupports* rawPtr = 0;
     nsresult status = NS_OK;
 
-    if ( aIID.Equals(GetIID()) )
+    if ( aIID.Equals(NS_GET_IID(IFoo)) )
       rawPtr = this;
     else
       {
         nsID iid_of_ISupports = NS_ISUPPORTS_IID;
         if ( aIID.Equals(iid_of_ISupports) )
           rawPtr = static_cast<nsISupports*>(this);
         else
           status = NS_ERROR_NO_INTERFACE;
--- a/xpcom/tests/TestRefPtr.cpp
+++ b/xpcom/tests/TestRefPtr.cpp
@@ -133,17 +133,17 @@ Foo::Release()
 
 nsresult
 Foo::QueryInterface( const nsIID& aIID, void** aResult )
 	{
     printf("Foo@%p::QueryInterface()\n", static_cast<void*>(this));
 		nsISupports* rawPtr = 0;
 		nsresult status = NS_OK;
 
-		if ( aIID.Equals(GetIID()) )
+		if ( aIID.Equals(NS_GET_IID(Foo)) )
 			rawPtr = this;
 		else
 			{
 				nsID iid_of_ISupports = NS_ISUPPORTS_IID;
 				if ( aIID.Equals(iid_of_ISupports) )
 					rawPtr = static_cast<nsISupports*>(this);
 				else
 					status = NS_ERROR_NO_INTERFACE;
@@ -223,17 +223,17 @@ Bar::~Bar()
 
 nsresult
 Bar::QueryInterface( const nsID& aIID, void** aResult )
 	{
     printf("Bar@%p::QueryInterface()\n", static_cast<void*>(this));
 		nsISupports* rawPtr = 0;
 		nsresult status = NS_OK;
 
-		if ( aIID.Equals(GetIID()) )
+		if ( aIID.Equals(NS_GET_IID(Bar)) )
 			rawPtr = this;
 		else if ( aIID.Equals(NS_GET_IID(Foo)) )
 			rawPtr = static_cast<Foo*>(this);
 		else
 			{
 				nsID iid_of_ISupports = NS_ISUPPORTS_IID;
 				if ( aIID.Equals(iid_of_ISupports) )
 					rawPtr = static_cast<nsISupports*>(this);