Bug 1500347 - Port Bug 1492648: nsIDocShell.loadURI() takes a nsDocShellLoadState parameter now. rs=bustage-fix
This commit is contained in:
Родитель
0ecf549303
Коммит
4a14a9e0aa
|
@ -50,6 +50,7 @@
|
|||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsDocShellLoadState.h"
|
||||
|
||||
// mail
|
||||
#include "nsIMsgMailNewsUrl.h"
|
||||
|
@ -590,7 +591,11 @@ nsMessenger::LoadURL(mozIDOMWindowProxy *aWin, const nsACString& aURL)
|
|||
AddMsgUrlToNavigateHistory(aURL);
|
||||
mNavigatingToUri.Truncate();
|
||||
mLastDisplayURI = aURL; // Remember the last uri we displayed.
|
||||
return mDocShell->LoadURI(uri, nullptr, nsIWebNavigation::LOAD_FLAGS_NONE, true);
|
||||
RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
|
||||
loadState->SetURI(uri);
|
||||
loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
loadState->SetFirstParty(true);
|
||||
return mDocShell->LoadURI(loadState);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMessenger::SaveAttachmentToFile(nsIFile *aFile,
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "mozilla/Services.h"
|
||||
#include "nsProxyRelease.h"
|
||||
#include "mozilla/Encoding.h"
|
||||
#include "nsDocShellLoadState.h"
|
||||
|
||||
nsMsgMailNewsUrl::nsMsgMailNewsUrl()
|
||||
{
|
||||
|
@ -794,7 +795,11 @@ NS_IMETHODIMP nsMsgMailNewsUrl::LoadURI(nsIDocShell* docShell,
|
|||
uint32_t aLoadFlags)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(docShell);
|
||||
return docShell->LoadURI(this, nullptr, aLoadFlags, false);
|
||||
RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
|
||||
loadState->SetURI(this);
|
||||
loadState->SetLoadFlags(aLoadFlags);
|
||||
loadState->SetFirstParty(false);
|
||||
return docShell->LoadURI(loadState);
|
||||
}
|
||||
|
||||
#define SAVE_BUF_SIZE FILE_IO_BUFFER_SIZE
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
#include "nsMsgMessageFlags.h"
|
||||
#include "nsIMsgPluggableStore.h"
|
||||
#include "../../base/src/MailnewsLoadContextInfo.h"
|
||||
#include "nsDocShellLoadState.h"
|
||||
|
||||
#define PREF_MAIL_ROOT_IMAP "mail.root.imap" // old - for backward compatibility only
|
||||
#define PREF_MAIL_ROOT_IMAP_REL "mail.root.imap-rel"
|
||||
|
@ -623,12 +624,13 @@ nsresult nsImapService::FetchMimePart(nsIImapUrl *aImapUrl,
|
|||
// DIRTY LITTLE HACK --> if we are opening an attachment we want the docshell to
|
||||
// treat this load as if it were a user click event. Then the dispatching stuff will be much
|
||||
// happier.
|
||||
rv = docShell->LoadURI(url,
|
||||
nullptr,
|
||||
aImapAction == nsImapUrl::nsImapOpenMimePart
|
||||
RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
|
||||
loadState->SetURI(url);
|
||||
loadState->SetLoadFlags(aImapAction == nsImapUrl::nsImapOpenMimePart
|
||||
? nsIWebNavigation::LOAD_FLAGS_IS_LINK
|
||||
: nsIWebNavigation::LOAD_FLAGS_NONE,
|
||||
false);
|
||||
: nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
loadState->SetFirstParty(false);
|
||||
rv = docShell->LoadURI(loadState);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1058,7 +1060,11 @@ nsresult nsImapService::GetMessageFromUrl(nsIImapUrl *aImapUrl,
|
|||
if (NS_SUCCEEDED(rv) && docShell)
|
||||
{
|
||||
NS_ASSERTION(!aConvertDataToText, "can't convert to text when using docshell");
|
||||
rv = docShell->LoadURI(url, nullptr, nsIWebNavigation::LOAD_FLAGS_NONE, false);
|
||||
RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
|
||||
loadState->SetURI(url);
|
||||
loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
loadState->SetFirstParty(false);
|
||||
rv = docShell->LoadURI(loadState);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "nsIMsgHdr.h"
|
||||
#include "nsIFileURL.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsDocShellLoadState.h"
|
||||
#include "nsIRDFService.h"
|
||||
|
||||
nsMailboxService::nsMailboxService()
|
||||
|
@ -234,12 +235,13 @@ nsresult nsMailboxService::FetchMessage(const char* aMessageURI,
|
|||
// DIRTY LITTLE HACK --> if we are opening an attachment we want the docshell to
|
||||
// treat this load as if it were a user click event. Then the dispatching stuff will be much
|
||||
// happier.
|
||||
rv = docShell->LoadURI(url,
|
||||
nullptr,
|
||||
mailboxAction == nsIMailboxUrl::ActionFetchPart
|
||||
RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
|
||||
loadState->SetURI(url);
|
||||
loadState->SetLoadFlags(mailboxAction == nsIMailboxUrl::ActionFetchPart
|
||||
? nsIWebNavigation::LOAD_FLAGS_IS_LINK
|
||||
: nsIWebNavigation::LOAD_FLAGS_NONE,
|
||||
false);
|
||||
: nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
loadState->SetFirstParty(false);
|
||||
rv = docShell->LoadURI(loadState);
|
||||
}
|
||||
else
|
||||
rv = RunMailboxUrl(url, aDisplayConsumer);
|
||||
|
@ -363,7 +365,11 @@ NS_IMETHODIMP nsMailboxService::OpenAttachment(const char *aContentType,
|
|||
// DIRTY LITTLE HACK --> since we are opening an attachment we want the docshell to
|
||||
// treat this load as if it were a user click event. Then the dispatching stuff will be much
|
||||
// happier.
|
||||
return docShell->LoadURI(URL, nullptr, nsIWebNavigation::LOAD_FLAGS_IS_LINK, false);
|
||||
RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
|
||||
loadState->SetURI(URL);
|
||||
loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_IS_LINK);
|
||||
loadState->SetFirstParty(false);
|
||||
return docShell->LoadURI(loadState);
|
||||
}
|
||||
return RunMailboxUrl(URL, aDisplayConsumer);
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "nsIInputStream.h"
|
||||
#include "nsIURIMutator.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsDocShellLoadState.h"
|
||||
|
||||
#include "../../base/src/MailnewsLoadContextInfo.h"
|
||||
|
||||
|
@ -307,12 +308,13 @@ nsresult nsNntpService::GetMessageFromUrl(nsIURI *aUrl,
|
|||
// DIRTY LITTLE HACK --> if we are opening an attachment we want the docshell to
|
||||
// treat this load as if it were a user click event. Then the dispatching stuff will be much
|
||||
// happier.
|
||||
rv = docShell->LoadURI(aUrl,
|
||||
nullptr,
|
||||
mOpenAttachmentOperation
|
||||
RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
|
||||
loadState->SetURI(aUrl);
|
||||
loadState->SetLoadFlags(mOpenAttachmentOperation
|
||||
? nsIWebNavigation::LOAD_FLAGS_IS_LINK
|
||||
: nsIWebNavigation::LOAD_FLAGS_NONE,
|
||||
false);
|
||||
: nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
loadState->SetFirstParty(false);
|
||||
rv = docShell->LoadURI(loadState);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -442,11 +444,16 @@ NS_IMETHODIMP nsNntpService::OpenAttachment(const char *aContentType,
|
|||
msgUrl->RegisterListener(aUrlListener);
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aDisplayConsumer, &rv));
|
||||
if (NS_SUCCEEDED(rv) && docShell)
|
||||
return docShell->LoadURI(url, nullptr, nsIWebNavigation::LOAD_FLAGS_IS_LINK, false);
|
||||
else
|
||||
if (NS_SUCCEEDED(rv) && docShell) {
|
||||
RefPtr<nsDocShellLoadState> loadState = new nsDocShellLoadState();
|
||||
loadState->SetURI(url);
|
||||
loadState->SetLoadFlags(nsIWebNavigation::LOAD_FLAGS_IS_LINK);
|
||||
loadState->SetFirstParty(false);
|
||||
return docShell->LoadURI(loadState);
|
||||
} else {
|
||||
return RunNewsUrl(url, aMsgWindow, aDisplayConsumer);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче