Back out patch for bug 395256 because it caused bug 395467 (a=schrep/bsmedberg)

This commit is contained in:
gavin@gavinsharp.com 2007-09-07 18:43:13 -07:00
parent 303da8daac
commit b239b12db5
2 changed files with 22 additions and 7 deletions

View File

@ -48,7 +48,7 @@ interface nsIJSID : nsISupports
[noscript] readonly attribute nsIDPtr id; [noscript] readonly attribute nsIDPtr id;
readonly attribute boolean valid; readonly attribute boolean valid;
boolean equals(in nsIDRef other); boolean equals(in nsIJSID other);
void initialize(in string idString); void initialize(in string idString);

View File

@ -138,17 +138,22 @@ nsJSID::GetValid(PRBool *aValid)
} }
NS_IMETHODIMP NS_IMETHODIMP
nsJSID::Equals(REFNSIID other, PRBool *_retval) nsJSID::Equals(nsIJSID *other, PRBool *_retval)
{ {
if(!_retval) if(!_retval)
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
*_retval = PR_FALSE; *_retval = PR_FALSE;
if(mID.Equals(GetInvalidIID())) if(!other || mID.Equals(GetInvalidIID()))
return NS_OK; 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; return NS_OK;
} }
@ -428,12 +433,22 @@ NS_IMETHODIMP nsJSIID::GetValid(PRBool *aValid)
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP nsJSIID::Equals(const nsID &other, PRBool *_retval) NS_IMETHODIMP nsJSIID::Equals(nsIJSID *other, PRBool *_retval)
{ {
if(!_retval) if(!_retval)
return NS_ERROR_NULL_POINTER; 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; return NS_OK;
} }
@ -664,7 +679,7 @@ NS_IMETHODIMP nsJSCID::GetId(nsID* *aId)
NS_IMETHODIMP nsJSCID::GetValid(PRBool *aValid) NS_IMETHODIMP nsJSCID::GetValid(PRBool *aValid)
{return mDetails.GetValid(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);} {return mDetails.Equals(other, _retval);}
NS_IMETHODIMP nsJSCID::Initialize(const char *idString) NS_IMETHODIMP nsJSCID::Initialize(const char *idString)