diff --git a/caps/NullPrincipalURI.cpp b/caps/NullPrincipalURI.cpp index 739f4860cf5c..904e178eabe3 100644 --- a/caps/NullPrincipalURI.cpp +++ b/caps/NullPrincipalURI.cpp @@ -257,8 +257,8 @@ NullPrincipalURI::GetHasRef(bool* _result) return NS_OK; } -NS_IMETHODIMP -NullPrincipalURI::SetSpec(const nsACString& aSpec) +nsresult +NullPrincipalURI::SetSpecInternal(const nsACString& aSpec) { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/image/decoders/icon/nsIconURI.cpp b/image/decoders/icon/nsIconURI.cpp index 5f096674bd35..69bfb70fe598 100644 --- a/image/decoders/icon/nsIconURI.cpp +++ b/image/decoders/icon/nsIconURI.cpp @@ -204,8 +204,8 @@ extractAttributeValue(const char* aSearchString, } // if we got non-null search string and attribute name values } -NS_IMETHODIMP -nsMozIconURI::SetSpec(const nsACString& aSpec) +nsresult +nsMozIconURI::SetSpecInternal(const nsACString& aSpec) { // Reset everything to default values. mIconURL = nullptr; diff --git a/modules/libjar/nsJARURI.cpp b/modules/libjar/nsJARURI.cpp index e546d2a93c98..0ea19afc2f4f 100644 --- a/modules/libjar/nsJARURI.cpp +++ b/modules/libjar/nsJARURI.cpp @@ -258,8 +258,8 @@ nsJARURI::GetHasRef(bool *result) return mJAREntry->GetHasRef(result); } -NS_IMETHODIMP -nsJARURI::SetSpec(const nsACString& aSpec) +nsresult +nsJARURI::SetSpecInternal(const nsACString& aSpec) { return SetSpecWithBase(aSpec, nullptr); } diff --git a/netwerk/base/nsIURI.idl b/netwerk/base/nsIURI.idl index a1a40c2495a5..8e9917194a5c 100644 --- a/netwerk/base/nsIURI.idl +++ b/netwerk/base/nsIURI.idl @@ -80,7 +80,16 @@ interface nsIURI : nsISupports */ /** - * Returns a string representation of the URI. Setting the spec causes + * Returns a string representation of the URI. + * + * Some characters may be escaped. + */ + readonly attribute AUTF8String spec; + + /* + * This method should only be called by nsIURIMutator or C++ unit tests. + * + * Setting the spec causes * the new spec to be parsed per the rules for the scheme the URI * currently has. In particular, setting the spec to a URI string with a * different scheme will generally produce incorrect results; no one @@ -88,10 +97,9 @@ interface nsIURI : nsISupports * the URI stores information from the nsIIOService.newURI call used to * create it other than just the parsed string, then behavior of this * information on setting the spec attribute is undefined. - * - * Some characters may be escaped. */ - attribute AUTF8String spec; + [noscript,notxpcom,nostdcall] + nsresult setSpecInternal(in ACString aSpec); %{ C++ // An infallible wrapper for GetSpec() that returns a failure indication diff --git a/netwerk/base/nsIURIMutator.idl b/netwerk/base/nsIURIMutator.idl index d31384492bc9..687a691a83c1 100644 --- a/netwerk/base/nsIURIMutator.idl +++ b/netwerk/base/nsIURIMutator.idl @@ -75,7 +75,7 @@ protected: uri = new T(); } - rv = uri->SetSpec(aSpec); + rv = uri->SetSpecInternal(aSpec); if (NS_FAILED(rv)) { return rv; } diff --git a/netwerk/base/nsSimpleURI.cpp b/netwerk/base/nsSimpleURI.cpp index d1e3c651db04..dd2802b75fe2 100644 --- a/netwerk/base/nsSimpleURI.cpp +++ b/netwerk/base/nsSimpleURI.cpp @@ -287,8 +287,8 @@ nsSimpleURI::GetHasRef(bool *result) return NS_OK; } -NS_IMETHODIMP -nsSimpleURI::SetSpec(const nsACString &aSpec) +nsresult +nsSimpleURI::SetSpecInternal(const nsACString &aSpec) { NS_ENSURE_STATE(mMutable); diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index b4ac62405a32..e11d312c8df6 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -1554,8 +1554,8 @@ IsSpecialProtocol(const nsACString &input) protocol.LowerCaseEqualsLiteral("gopher"); } -NS_IMETHODIMP -nsStandardURL::SetSpec(const nsACString &input) +nsresult +nsStandardURL::SetSpecInternal(const nsACString &input) { return SetSpecWithEncoding(input, nullptr); } @@ -2209,7 +2209,7 @@ nsStandardURL::SetPathQueryRef(const nsACString &input) spec.Append('/'); spec.Append(path); - return SetSpec(spec); + return SetSpecInternal(spec); } else if (mPath.mLen >= 1) { mSpec.Cut(mPath.mPos + 1, mPath.mLen - 1); @@ -2893,7 +2893,7 @@ nsStandardURL::SetFilePath(const nsACString &input) spec.Append(mSpec.get() + end, mSpec.Length() - end); } - return SetSpec(spec); + return SetSpecInternal(spec); } else if (mPath.mLen > 1) { mSpec.Cut(mPath.mPos + 1, mFilepath.mLen - 1);