Bug 1168158 - Make URLValue::mString a smart pointer. r=heycam

This commit is contained in:
Michael Layzell 2015-05-28 08:54:00 -04:00
parent bb019f6a50
commit 7d35de2ca3
2 changed files with 2 additions and 10 deletions

View File

@ -2326,7 +2326,6 @@ css::URLValue::URLValue(nsIURI* aURI, nsStringBuffer* aString,
mURIResolved(true)
{
MOZ_ASSERT(aOriginPrincipal, "Must have an origin principal");
mString->AddRef();
}
css::URLValue::URLValue(nsStringBuffer* aString, nsIURI* aBaseURI,
@ -2338,12 +2337,6 @@ css::URLValue::URLValue(nsStringBuffer* aString, nsIURI* aBaseURI,
mURIResolved(false)
{
MOZ_ASSERT(aOriginPrincipal, "Must have an origin principal");
mString->AddRef();
}
css::URLValue::~URLValue()
{
mString->Release();
}
bool

View File

@ -87,7 +87,7 @@ struct URLValue {
nsIPrincipal* aOriginPrincipal);
protected:
~URLValue();
~URLValue() {};
public:
bool operator==(const URLValue& aOther) const;
@ -108,8 +108,7 @@ private:
// null if the URI is invalid.
mutable nsCOMPtr<nsIURI> mURI;
public:
nsStringBuffer* mString; // Could use nsRefPtr, but it'd add useless
// null-checks; this is never null.
nsRefPtr<nsStringBuffer> mString;
nsCOMPtr<nsIURI> mReferrer;
nsCOMPtr<nsIPrincipal> mOriginPrincipal;