Bug 1124268, part 1 - Take advantage of the infallibility of nsContentUtils::GetSameOriginChecker(). r=smaug

This commit is contained in:
Andrew McCreight 2015-01-26 09:28:15 -08:00
parent e05321fd66
commit 53e1f836f4
4 changed files with 1 additions and 7 deletions

View File

@ -5652,7 +5652,7 @@ nsContentUtils::GetSameOriginChecker()
{
if (!sSameOriginChecker) {
sSameOriginChecker = new SameOriginChecker();
NS_IF_ADDREF(sSameOriginChecker);
NS_ADDREF(sSameOriginChecker);
}
return sSameOriginChecker;
}

View File

@ -1338,7 +1338,6 @@ nsExternalResourceMap::PendingLoad::StartLoad(nsIURI* aURI,
nsIDocument* doc = aRequestingNode->OwnerDoc();
nsCOMPtr<nsIInterfaceRequestor> req = nsContentUtils::GetSameOriginChecker();
NS_ENSURE_TRUE(req, NS_ERROR_OUT_OF_MEMORY);
nsCOMPtr<nsILoadGroup> loadGroup = doc->GetDocumentLoadGroup();
nsCOMPtr<nsIChannel> channel;

View File

@ -1101,7 +1101,6 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIDocument* aBoun
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIInterfaceRequestor> sameOriginChecker = nsContentUtils::GetSameOriginChecker();
NS_ENSURE_TRUE(sameOriginChecker, NS_ERROR_OUT_OF_MEMORY);
channel->SetNotificationCallbacks(sameOriginChecker);

View File

@ -435,10 +435,6 @@ XMLDocument::Load(const nsAString& aUrl, ErrorResult& aRv)
// Create a channel
nsCOMPtr<nsIInterfaceRequestor> req = nsContentUtils::GetSameOriginChecker();
if (!req) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return false;
}
nsCOMPtr<nsIChannel> channel;
// nsIRequest::LOAD_BACKGROUND prevents throbber from becoming active,