Bug 1199491 - Use channel->ascynOpen2 in netwerk/base/nsURIChecker (r=sicking,jduell)

This commit is contained in:
Christoph Kerschbaumer 2015-09-11 18:54:00 -07:00
parent 2767440adb
commit 5814f812b3

View File

@ -6,10 +6,10 @@
#include "nsURIChecker.h"
#include "nsIAuthPrompt.h"
#include "nsIHttpChannel.h"
#include "nsContentUtils.h"
#include "nsNetUtil.h"
#include "nsString.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "nsNullPrincipal.h"
//-----------------------------------------------------------------------------
@ -137,12 +137,10 @@ NS_IMETHODIMP
nsURIChecker::Init(nsIURI *aURI)
{
nsresult rv;
nsCOMPtr<nsIPrincipal> nullPrincipal = nsNullPrincipal::Create();
NS_ENSURE_TRUE(nullPrincipal, NS_ERROR_FAILURE);
rv = NS_NewChannel(getter_AddRefs(mChannel),
aURI,
nullPrincipal,
nsILoadInfo::SEC_NORMAL,
nsContentUtils::GetSystemPrincipal(),
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
nsIContentPolicy::TYPE_OTHER);
NS_ENSURE_SUCCESS(rv, rv);
@ -180,9 +178,9 @@ nsURIChecker::AsyncCheck(nsIRequestObserver *aObserver,
// Hook us up to listen to redirects and the like (this creates a reference
// cycle!)
mChannel->SetNotificationCallbacks(this);
// and start the request:
nsresult rv = mChannel->AsyncOpen(this, nullptr);
nsresult rv = mChannel->AsyncOpen2(this);
if (NS_FAILED(rv))
mChannel = nullptr;
else {