From a0b7a236127a63e1f40182831079f936cabec05e Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Fri, 7 Sep 2007 18:43:13 -0700 Subject: [PATCH] Back out patch for bug 395256 because it caused bug 395467 (a=schrep/bsmedberg) --- js/src/xpconnect/idl/xpcjsid.idl | 2 +- js/src/xpconnect/src/xpcjsid.cpp | 27 +++++++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/js/src/xpconnect/idl/xpcjsid.idl b/js/src/xpconnect/idl/xpcjsid.idl index d2e298870eec..654715cae07e 100644 --- a/js/src/xpconnect/idl/xpcjsid.idl +++ b/js/src/xpconnect/idl/xpcjsid.idl @@ -48,7 +48,7 @@ interface nsIJSID : nsISupports [noscript] readonly attribute nsIDPtr id; readonly attribute boolean valid; - boolean equals(in nsIDRef other); + boolean equals(in nsIJSID other); void initialize(in string idString); diff --git a/js/src/xpconnect/src/xpcjsid.cpp b/js/src/xpconnect/src/xpcjsid.cpp index 3f21e8c9901f..ee0d80b3b42c 100644 --- a/js/src/xpconnect/src/xpcjsid.cpp +++ b/js/src/xpconnect/src/xpcjsid.cpp @@ -138,17 +138,22 @@ nsJSID::GetValid(PRBool *aValid) } NS_IMETHODIMP -nsJSID::Equals(REFNSIID other, PRBool *_retval) +nsJSID::Equals(nsIJSID *other, PRBool *_retval) { if(!_retval) return NS_ERROR_NULL_POINTER; *_retval = PR_FALSE; - if(mID.Equals(GetInvalidIID())) + if(!other || mID.Equals(GetInvalidIID())) return NS_OK; - *_retval = mID.Equals(other); + nsID* otherID; + if(NS_SUCCEEDED(other->GetId(&otherID))) + { + *_retval = mID.Equals(*otherID); + nsMemory::Free(otherID); + } return NS_OK; } @@ -428,12 +433,22 @@ NS_IMETHODIMP nsJSIID::GetValid(PRBool *aValid) return NS_OK; } -NS_IMETHODIMP nsJSIID::Equals(const nsID &other, PRBool *_retval) +NS_IMETHODIMP nsJSIID::Equals(nsIJSID *other, PRBool *_retval) { if(!_retval) return NS_ERROR_NULL_POINTER; - mInfo->IsIID((nsIID*) &other, _retval); + *_retval = PR_FALSE; + + if(!other) + return NS_OK; + + nsID* otherID; + if(NS_SUCCEEDED(other->GetId(&otherID))) + { + mInfo->IsIID((nsIID*)otherID, _retval); + nsMemory::Free(otherID); + } return NS_OK; } @@ -664,7 +679,7 @@ NS_IMETHODIMP nsJSCID::GetId(nsID* *aId) NS_IMETHODIMP nsJSCID::GetValid(PRBool *aValid) {return mDetails.GetValid(aValid);} -NS_IMETHODIMP nsJSCID::Equals(const nsID &other, PRBool *_retval) +NS_IMETHODIMP nsJSCID::Equals(nsIJSID *other, PRBool *_retval) {return mDetails.Equals(other, _retval);} NS_IMETHODIMP nsJSCID::Initialize(const char *idString)