From af909242bc41b24d42894982b8815225947987c9 Mon Sep 17 00:00:00 2001 From: Neil Rashbrook Date: Mon, 17 Mar 2014 19:07:46 +0000 Subject: [PATCH] Bug 514280 Remove GetIID r=bsmedberg --HG-- extra : rebase_source : 179d6cd1cfb272ca258b0bc64225b27252c9ffbe --- uriloader/exthandler/android/nsExternalSharingAppService.cpp | 2 +- xpcom/glue/nsID.h | 3 +-- xpcom/tests/TestCOMPtr.cpp | 4 ++-- xpcom/tests/TestHashtables.cpp | 2 +- xpcom/tests/TestRefPtr.cpp | 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/uriloader/exthandler/android/nsExternalSharingAppService.cpp b/uriloader/exthandler/android/nsExternalSharingAppService.cpp index 058f810414cd..5b3e155b9f88 100644 --- a/uriloader/exthandler/android/nsExternalSharingAppService.cpp +++ b/uriloader/exthandler/android/nsExternalSharingAppService.cpp @@ -52,7 +52,7 @@ nsExternalSharingAppService::GetSharingApps(const nsAString & aMIMEType, static_cast(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); } diff --git a/xpcom/glue/nsID.h b/xpcom/glue/nsID.h index 0c5ecd535919..001afe878fd8 100644 --- a/xpcom/glue/nsID.h +++ b/xpcom/glue/nsID.h @@ -123,8 +123,7 @@ typedef nsID nsIID; struct COMTypeInfo \ { \ static const nsIID kIID NS_HIDDEN; \ - }; \ - static const nsIID& GetIID() {return COMTypeInfo::kIID;} + }; #define NS_DEFINE_STATIC_IID_ACCESSOR(the_interface, the_iid) \ template \ diff --git a/xpcom/tests/TestCOMPtr.cpp b/xpcom/tests/TestCOMPtr.cpp index 411c114682b2..30b5079245c5 100644 --- a/xpcom/tests/TestCOMPtr.cpp +++ b/xpcom/tests/TestCOMPtr.cpp @@ -137,7 +137,7 @@ IFoo::QueryInterface( const nsIID& aIID, void** aResult ) nsISupports* rawPtr = 0; nsresult status = NS_OK; - if ( aIID.Equals(GetIID()) ) + if ( aIID.Equals(NS_GET_IID(IFoo)) ) rawPtr = this; else { @@ -227,7 +227,7 @@ IBar::QueryInterface( const nsID& aIID, void** aResult ) 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(this); diff --git a/xpcom/tests/TestHashtables.cpp b/xpcom/tests/TestHashtables.cpp index 5b3d26a8adc1..c14891d99c9e 100644 --- a/xpcom/tests/TestHashtables.cpp +++ b/xpcom/tests/TestHashtables.cpp @@ -281,7 +281,7 @@ IFoo::QueryInterface( const nsIID& aIID, void** aResult ) nsISupports* rawPtr = 0; nsresult status = NS_OK; - if ( aIID.Equals(GetIID()) ) + if ( aIID.Equals(NS_GET_IID(IFoo)) ) rawPtr = this; else { diff --git a/xpcom/tests/TestRefPtr.cpp b/xpcom/tests/TestRefPtr.cpp index fd80cc9b8cd0..c4a74e79e19e 100644 --- a/xpcom/tests/TestRefPtr.cpp +++ b/xpcom/tests/TestRefPtr.cpp @@ -138,7 +138,7 @@ Foo::QueryInterface( const nsIID& aIID, void** aResult ) nsISupports* rawPtr = 0; nsresult status = NS_OK; - if ( aIID.Equals(GetIID()) ) + if ( aIID.Equals(NS_GET_IID(Foo)) ) rawPtr = this; else { @@ -228,7 +228,7 @@ Bar::QueryInterface( const nsID& aIID, void** aResult ) 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(this);