зеркало из https://github.com/mozilla/gecko-dev.git
fall back on nsILoadGroup when nsIChannel has no nsIPrompt.
Bug 72111; r=bbaetz, sr=darin
This commit is contained in:
Родитель
a5c73d7696
Коммит
d0c4ee54ef
|
@ -1806,6 +1806,16 @@ nsFtpState::Init(nsIFTPChannel* aChannel,
|
|||
|
||||
mKeepRunning = PR_TRUE;
|
||||
mPrompter = aPrompter;
|
||||
if (!mPrompter) {
|
||||
nsCOMPtr<nsILoadGroup> ldGrp;
|
||||
aChannel->GetLoadGroup(getter_AddRefs(ldGrp));
|
||||
if (ldGrp) {
|
||||
nsCOMPtr<nsIInterfaceRequestor> cbs;
|
||||
rv = ldGrp->GetNotificationCallbacks(getter_AddRefs(cbs));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
mPrompter = do_GetInterface(cbs);
|
||||
}
|
||||
}
|
||||
mFTPEventSink = sink;
|
||||
mAuthPrompter = aAuthPrompter;
|
||||
mCacheEntry = cacheEntry;
|
||||
|
|
|
@ -582,8 +582,16 @@ nsGopherChannel::SendRequest(nsITransport* aTransport)
|
|||
// We require a query string here - if we don't have one,
|
||||
// then we need to ask the user
|
||||
if (!mPrompter) {
|
||||
NS_ERROR("We need a prompter!");
|
||||
return NS_ERROR_FAILURE;
|
||||
if (mLoadGroup) {
|
||||
nsCOMPtr<nsIInterfaceRequestor> cbs;
|
||||
rv = mLoadGroup->GetNotificationCallbacks(getter_AddRefs(cbs));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
mPrompter = do_GetInterface(cbs);
|
||||
}
|
||||
if (!mPrompter) {
|
||||
NS_ERROR("We need a prompter!");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
nsXPIDLString search;
|
||||
PRBool res;
|
||||
|
|
Загрузка…
Ссылка в новой задаче