Bug 849665 - Outparamdel nsHTMLDocument::GetDomainURI; r=khuey

This commit is contained in:
Ms2ger 2013-03-17 09:51:39 +01:00
parent 947d25f1a8
commit fe39d61dc1
2 changed files with 13 additions and 11 deletions

View File

@ -937,15 +937,19 @@ nsHTMLDocument::SetCompatibilityMode(nsCompatibility aMode)
//
// nsIDOMHTMLDocument interface implementation
//
void
nsHTMLDocument::GetDomainURI(nsIURI **aURI)
already_AddRefed<nsIURI>
nsHTMLDocument::GetDomainURI()
{
nsIPrincipal *principal = NodePrincipal();
nsIPrincipal* principal = NodePrincipal();
principal->GetDomain(aURI);
if (!*aURI) {
principal->GetURI(aURI);
nsCOMPtr<nsIURI> uri;
principal->GetDomain(getter_AddRefs(uri));
if (uri) {
return uri.forget();
}
principal->GetURI(getter_AddRefs(uri));
return uri.forget();
}
@ -960,8 +964,7 @@ nsHTMLDocument::GetDomain(nsAString& aDomain)
void
nsHTMLDocument::GetDomain(nsAString& aDomain, ErrorResult& rv)
{
nsCOMPtr<nsIURI> uri;
GetDomainURI(getter_AddRefs(uri));
nsCOMPtr<nsIURI> uri = GetDomainURI();
if (!uri) {
rv.Throw(NS_ERROR_FAILURE);
@ -996,8 +999,7 @@ nsHTMLDocument::SetDomain(const nsAString& aDomain, ErrorResult& rv)
}
// Create new URI
nsCOMPtr<nsIURI> uri;
GetDomainURI(getter_AddRefs(uri));
nsCOMPtr<nsIURI> uri = GetDomainURI();
if (!uri) {
rv.Throw(NS_ERROR_FAILURE);

View File

@ -268,7 +268,7 @@ protected:
static void DocumentWriteTerminationFunc(nsISupports *aRef);
void GetDomainURI(nsIURI **uri);
already_AddRefed<nsIURI> GetDomainURI();
nsresult WriteCommon(JSContext *cx, const nsAString& aText,
bool aNewlineTerminate);