Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 1149280 part 2. Drop the useless mScheme member of nsNullPrincipa…
Browse files Browse the repository at this point in the history
…lURI. r=smaug
  • Loading branch information
bzbarsky committed Mar 31, 2015
1 parent ab624ae commit f5ee261
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
19 changes: 8 additions & 11 deletions caps/nsNullPrincipalURI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
//// nsNullPrincipalURI

nsNullPrincipalURI::nsNullPrincipalURI()
: mScheme(NS_NULLPRINCIPAL_SCHEME),
mPath(mPathBytes, ArrayLength(mPathBytes), ArrayLength(mPathBytes) - 1)
: mPath(mPathBytes, ArrayLength(mPathBytes), ArrayLength(mPathBytes) - 1)
{
}

nsNullPrincipalURI::nsNullPrincipalURI(const nsNullPrincipalURI& aOther)
: mScheme(NS_NULLPRINCIPAL_SCHEME),
mPath(mPathBytes, ArrayLength(mPathBytes), ArrayLength(mPathBytes) - 1)
: mPath(mPathBytes, ArrayLength(mPathBytes), ArrayLength(mPathBytes) - 1)
{
mPath.Assign(aOther.mPath);
}
Expand Down Expand Up @@ -171,7 +169,7 @@ nsNullPrincipalURI::SetRef(const nsACString &aRef)
NS_IMETHODIMP
nsNullPrincipalURI::GetPrePath(nsACString &_prePath)
{
_prePath = mScheme + NS_LITERAL_CSTRING(":");
_prePath = NS_LITERAL_CSTRING(NS_NULLPRINCIPAL_SCHEME ":");
return NS_OK;
}

Expand All @@ -190,7 +188,7 @@ nsNullPrincipalURI::SetPort(int32_t aPort)
NS_IMETHODIMP
nsNullPrincipalURI::GetScheme(nsACString &_scheme)
{
_scheme = mScheme;
_scheme = NS_LITERAL_CSTRING(NS_NULLPRINCIPAL_SCHEME);
return NS_OK;
}

Expand All @@ -203,7 +201,7 @@ nsNullPrincipalURI::SetScheme(const nsACString &aScheme)
NS_IMETHODIMP
nsNullPrincipalURI::GetSpec(nsACString &_spec)
{
_spec = mScheme + NS_LITERAL_CSTRING(":") + mPath;
_spec = NS_LITERAL_CSTRING(NS_NULLPRINCIPAL_SCHEME ":") + mPath;
return NS_OK;
}

Expand Down Expand Up @@ -275,7 +273,7 @@ nsNullPrincipalURI::Equals(nsIURI *aOther, bool *_equals)
nsresult rv = aOther->QueryInterface(kNullPrincipalURIImplementationCID,
(void **)&otherURI);
if (NS_SUCCEEDED(rv)) {
*_equals = (mScheme == otherURI->mScheme && mPath == otherURI->mPath);
*_equals = mPath == otherURI->mPath;
NS_RELEASE(otherURI);
}
return NS_OK;
Expand All @@ -300,7 +298,7 @@ nsNullPrincipalURI::Resolve(const nsACString &aRelativePath,
NS_IMETHODIMP
nsNullPrincipalURI::SchemeIs(const char *aScheme, bool *_schemeIs)
{
*_schemeIs = (0 == nsCRT::strcasecmp(mScheme.get(), aScheme));
*_schemeIs = (0 == nsCRT::strcasecmp(NS_NULLPRINCIPAL_SCHEME, aScheme));
return NS_OK;
}

Expand Down Expand Up @@ -333,8 +331,7 @@ nsNullPrincipalURI::Deserialize(const mozilla::ipc::URIParams &aParams)
size_t
nsNullPrincipalURI::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
return mScheme.SizeOfExcludingThisIfUnshared(aMallocSizeOf) +
mPath.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
return mPath.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
}

size_t
Expand Down
1 change: 0 additions & 1 deletion caps/nsNullPrincipalURI.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class nsNullPrincipalURI final : public nsIURI
nsresult Init();

char mPathBytes[NSID_LENGTH];
nsCString mScheme;
nsFixedCString mPath;
};

Expand Down

0 comments on commit f5ee261

Please sign in to comment.