зеркало из https://github.com/mozilla/gecko-dev.git
WIP on 40449, a/r=gagan
This commit is contained in:
Родитель
bf1d8d13be
Коммит
87373a21f6
|
@ -1352,8 +1352,11 @@ nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader,
|
|||
|
||||
// Stop loading of the earlier document completely when the document url
|
||||
// load starts. Now we know that this url is valid and available.
|
||||
nsLoadFlags loadFlags = 0;
|
||||
channel -> GetLoadAttributes (&loadFlags);
|
||||
|
||||
PRBool equals = PR_FALSE;
|
||||
if (NS_SUCCEEDED(aURL->Equals(mCurrentURI, &equals)) && equals)
|
||||
if (NS_SUCCEEDED(aURL->Equals(mCurrentURI, &equals)) && equals && !(loadFlags & nsIChannel::LOAD_REPLACE))
|
||||
Stop();
|
||||
|
||||
/*
|
||||
|
|
|
@ -277,6 +277,12 @@ interface nsIChannel : nsIRequest
|
|||
const unsigned long VALIDATE_ONCE_PER_SESSION = 1 << 14;
|
||||
const unsigned long VALIDATE_HEURISTICALLY = 1 << 15;
|
||||
|
||||
/**
|
||||
* This flag is used to tell the webshell not to cancel the load in cases
|
||||
* when the channel is receiving multipart/replace document
|
||||
*/
|
||||
const unsigned long LOAD_REPLACE = 1 << 16;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// nsIChannel operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -323,8 +323,8 @@ nsMultiMixedConv::BuildURI(nsIChannel *aChannel, nsIURI **_retval) {
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCAutoString dummyURIStr(uriSpec);
|
||||
dummyURIStr.Append("##");
|
||||
dummyURIStr.AppendInt(mPartCount, 10 /* radix */);
|
||||
// dummyURIStr.Append("##");
|
||||
// dummyURIStr.AppendInt(mPartCount, 10 /* radix */);
|
||||
|
||||
return mIOService->NewURI(dummyURIStr.GetBuffer(), nsnull, _retval);
|
||||
}
|
||||
|
@ -349,8 +349,10 @@ nsMultiMixedConv::SendStart(nsIChannel *aChannel) {
|
|||
|
||||
// First build up a dummy uri.
|
||||
nsCOMPtr<nsIURI> partURI;
|
||||
rv = BuildURI(aChannel, getter_AddRefs(partURI));
|
||||
rv = aChannel->GetURI(getter_AddRefs (partURI));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
// rv = BuildURI(aChannel, getter_AddRefs(partURI));
|
||||
// if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (mContentType.IsEmpty())
|
||||
mContentType = UNKNOWN_CONTENT_TYPE;
|
||||
|
@ -362,6 +364,11 @@ nsMultiMixedConv::SendStart(nsIChannel *aChannel) {
|
|||
mContentLength);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsLoadFlags loadFlags = 0;
|
||||
mPartChannel -> GetLoadAttributes (&loadFlags);
|
||||
loadFlags |= nsIChannel::LOAD_REPLACE;
|
||||
mPartChannel -> SetLoadAttributes ( loadFlags);
|
||||
|
||||
nsCOMPtr<nsILoadGroup> loadGroup;
|
||||
(void)aChannel->GetLoadGroup(getter_AddRefs(loadGroup));
|
||||
// Add the new channel to the load group (if any)
|
||||
|
|
|
@ -1352,8 +1352,11 @@ nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader,
|
|||
|
||||
// Stop loading of the earlier document completely when the document url
|
||||
// load starts. Now we know that this url is valid and available.
|
||||
nsLoadFlags loadFlags = 0;
|
||||
channel -> GetLoadAttributes (&loadFlags);
|
||||
|
||||
PRBool equals = PR_FALSE;
|
||||
if (NS_SUCCEEDED(aURL->Equals(mCurrentURI, &equals)) && equals)
|
||||
if (NS_SUCCEEDED(aURL->Equals(mCurrentURI, &equals)) && equals && !(loadFlags & nsIChannel::LOAD_REPLACE))
|
||||
Stop();
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче