зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1620107 - P2: Remove loadType from DocumentChannelCreationArgs. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D65432 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
b5bd2e5db0
Коммит
73cd3c19e9
|
@ -9383,8 +9383,8 @@ static bool SchemeUsesDocChannel(nsIURI* aURI) {
|
|||
nsDocShellLoadState* aLoadState, LoadInfo* aLoadInfo,
|
||||
nsIInterfaceRequestor* aCallbacks, nsDocShell* aDocShell,
|
||||
const OriginAttributes& aOriginAttributes, nsLoadFlags aLoadFlags,
|
||||
uint32_t aLoadType, uint32_t aCacheKey, bool aIsActive, bool aIsTopLevelDoc,
|
||||
nsresult& aRv, nsIChannel** aChannel) {
|
||||
uint32_t aCacheKey, bool aIsActive, bool aIsTopLevelDoc, nsresult& aRv,
|
||||
nsIChannel** aChannel) {
|
||||
MOZ_ASSERT(aLoadInfo);
|
||||
|
||||
nsString srcdoc = VoidString();
|
||||
|
@ -9564,6 +9564,7 @@ static bool SchemeUsesDocChannel(nsIURI* aURI) {
|
|||
}
|
||||
|
||||
nsCOMPtr<nsICacheInfoChannel> cacheChannel(do_QueryInterface(channel));
|
||||
auto loadType = aLoadState->LoadType();
|
||||
|
||||
// figure out if we need to set the post data stream on the channel...
|
||||
if (aLoadState->PostDataStream()) {
|
||||
|
@ -9590,15 +9591,14 @@ static bool SchemeUsesDocChannel(nsIURI* aURI) {
|
|||
* cache is free to go to the server for updated postdata.
|
||||
*/
|
||||
if (cacheChannel && aCacheKey != 0) {
|
||||
if (aLoadType == LOAD_HISTORY ||
|
||||
aLoadType == LOAD_RELOAD_CHARSET_CHANGE) {
|
||||
if (loadType == LOAD_HISTORY || loadType == LOAD_RELOAD_CHARSET_CHANGE) {
|
||||
cacheChannel->SetCacheKey(aCacheKey);
|
||||
uint32_t loadFlags;
|
||||
if (NS_SUCCEEDED(channel->GetLoadFlags(&loadFlags))) {
|
||||
channel->SetLoadFlags(loadFlags |
|
||||
nsICachingChannel::LOAD_ONLY_FROM_CACHE);
|
||||
}
|
||||
} else if (aLoadType == LOAD_RELOAD_NORMAL) {
|
||||
} else if (loadType == LOAD_RELOAD_NORMAL) {
|
||||
cacheChannel->SetCacheKey(aCacheKey);
|
||||
}
|
||||
}
|
||||
|
@ -9609,10 +9609,10 @@ static bool SchemeUsesDocChannel(nsIURI* aURI) {
|
|||
* New cache may use it creatively on CGI pages with GET
|
||||
* method and even on those that say "no-cache"
|
||||
*/
|
||||
if (aLoadType == LOAD_HISTORY || aLoadType == LOAD_RELOAD_NORMAL ||
|
||||
aLoadType == LOAD_RELOAD_CHARSET_CHANGE ||
|
||||
aLoadType == LOAD_RELOAD_CHARSET_CHANGE_BYPASS_CACHE ||
|
||||
aLoadType == LOAD_RELOAD_CHARSET_CHANGE_BYPASS_PROXY_AND_CACHE) {
|
||||
if (loadType == LOAD_HISTORY || loadType == LOAD_RELOAD_NORMAL ||
|
||||
loadType == LOAD_RELOAD_CHARSET_CHANGE ||
|
||||
loadType == LOAD_RELOAD_CHARSET_CHANGE_BYPASS_CACHE ||
|
||||
loadType == LOAD_RELOAD_CHARSET_CHANGE_BYPASS_PROXY_AND_CACHE) {
|
||||
if (cacheChannel && aCacheKey != 0) {
|
||||
cacheChannel->SetCacheKey(aCacheKey);
|
||||
}
|
||||
|
@ -9949,13 +9949,12 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
|
|||
|
||||
if (StaticPrefs::browser_tabs_documentchannel() && XRE_IsContentProcess() &&
|
||||
canUseDocumentChannel) {
|
||||
channel =
|
||||
new DocumentChannelChild(aLoadState, loadInfo, loadFlags, mLoadType,
|
||||
channel = new DocumentChannelChild(aLoadState, loadInfo, loadFlags,
|
||||
cacheKey, isActive, isTopLevelDoc);
|
||||
channel->SetNotificationCallbacks(this);
|
||||
} else if (!CreateAndConfigureRealChannelForLoadState(
|
||||
aLoadState, loadInfo, this, this, GetOriginAttributes(),
|
||||
loadFlags, mLoadType, cacheKey, isActive, isTopLevelDoc, rv,
|
||||
loadFlags, cacheKey, isActive, isTopLevelDoc, rv,
|
||||
getter_AddRefs(channel))) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -502,8 +502,8 @@ class nsDocShell final : public nsDocLoader,
|
|||
nsDocShellLoadState* aLoadState, mozilla::net::LoadInfo* aLoadInfo,
|
||||
nsIInterfaceRequestor* aCallbacks, nsDocShell* aDocShell,
|
||||
const mozilla::OriginAttributes& aOriginAttributes,
|
||||
nsLoadFlags aLoadFlags, uint32_t aLoadType, uint32_t aCacheKey,
|
||||
bool aIsActive, bool aIsTopLevelDoc, nsresult& rv, nsIChannel** aChannel);
|
||||
nsLoadFlags aLoadFlags, uint32_t aCacheKey, bool aIsActive,
|
||||
bool aIsTopLevelDoc, nsresult& rv, nsIChannel** aChannel);
|
||||
|
||||
// Notify consumers of a search being loaded through the observer service:
|
||||
static void MaybeNotifyKeywordSearchLoading(const nsString& aProvider,
|
||||
|
|
|
@ -55,12 +55,10 @@ NS_INTERFACE_MAP_END
|
|||
|
||||
DocumentChannel::DocumentChannel(nsDocShellLoadState* aLoadState,
|
||||
net::LoadInfo* aLoadInfo,
|
||||
nsLoadFlags aLoadFlags, uint32_t aLoadType,
|
||||
uint32_t aCacheKey, bool aIsActive,
|
||||
bool aIsTopLevelDoc)
|
||||
nsLoadFlags aLoadFlags, uint32_t aCacheKey,
|
||||
bool aIsActive, bool aIsTopLevelDoc)
|
||||
: mAsyncOpenTime(TimeStamp::Now()),
|
||||
mLoadState(aLoadState),
|
||||
mLoadType(aLoadType),
|
||||
mCacheKey(aCacheKey),
|
||||
mIsActive(aIsActive),
|
||||
mIsTopLevelDoc(aIsTopLevelDoc),
|
||||
|
|
|
@ -46,8 +46,8 @@ class DocumentChannel : public nsIIdentChannel, public nsITraceableChannel {
|
|||
NS_DECLARE_STATIC_IID_ACCESSOR(DOCUMENT_CHANNEL_IID)
|
||||
|
||||
DocumentChannel(nsDocShellLoadState* aLoadState, class LoadInfo* aLoadInfo,
|
||||
nsLoadFlags aLoadFlags, uint32_t aLoadType,
|
||||
uint32_t aCacheKey, bool aIsActive, bool aIsTopLevelDoc);
|
||||
nsLoadFlags aLoadFlags, uint32_t aCacheKey, bool aIsActive,
|
||||
bool aIsTopLevelDoc);
|
||||
|
||||
const nsTArray<DocumentChannelRedirect>& GetRedirectChain() const {
|
||||
return mRedirects;
|
||||
|
@ -81,7 +81,6 @@ class DocumentChannel : public nsIIdentChannel, public nsITraceableChannel {
|
|||
|
||||
const TimeStamp mAsyncOpenTime;
|
||||
const RefPtr<nsDocShellLoadState> mLoadState;
|
||||
const uint32_t mLoadType;
|
||||
const uint32_t mCacheKey;
|
||||
const bool mIsActive;
|
||||
const bool mIsTopLevelDoc;
|
||||
|
|
|
@ -29,11 +29,10 @@ NS_IMPL_RELEASE_INHERITED(DocumentChannelChild, DocumentChannel)
|
|||
DocumentChannelChild::DocumentChannelChild(nsDocShellLoadState* aLoadState,
|
||||
net::LoadInfo* aLoadInfo,
|
||||
nsLoadFlags aLoadFlags,
|
||||
uint32_t aLoadType,
|
||||
uint32_t aCacheKey, bool aIsActive,
|
||||
bool aIsTopLevelDoc)
|
||||
: DocumentChannel(aLoadState, aLoadInfo, aLoadFlags, aLoadType, aCacheKey,
|
||||
aIsActive, aIsTopLevelDoc) {
|
||||
: DocumentChannel(aLoadState, aLoadInfo, aLoadFlags, aCacheKey, aIsActive,
|
||||
aIsTopLevelDoc) {
|
||||
LOG(("DocumentChannelChild ctor [this=%p, uri=%s]", this,
|
||||
aLoadState->URI()->GetSpecOrDefault().get()));
|
||||
}
|
||||
|
@ -86,7 +85,6 @@ DocumentChannelChild::AsyncOpen(nsIStreamListener* aListener) {
|
|||
|
||||
args.loadInfo() = *maybeArgs;
|
||||
args.loadFlags() = mLoadFlags;
|
||||
args.loadType() = mLoadType;
|
||||
args.cacheKey() = mCacheKey;
|
||||
args.isActive() = mIsActive;
|
||||
args.isTopLevelDoc() = mIsTopLevelDoc;
|
||||
|
|
|
@ -26,8 +26,7 @@ class DocumentChannelChild final : public DocumentChannel,
|
|||
public:
|
||||
DocumentChannelChild(nsDocShellLoadState* aLoadState,
|
||||
class LoadInfo* aLoadInfo, nsLoadFlags aLoadFlags,
|
||||
uint32_t aLoadType, uint32_t aCacheKey, bool aIsActive,
|
||||
bool aIsTopLevelDoc);
|
||||
uint32_t aCacheKey, bool aIsActive, bool aIsTopLevelDoc);
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
|
||||
|
|
|
@ -53,12 +53,11 @@ bool DocumentChannelParent::Init(const DocumentChannelCreationArgs& aArgs) {
|
|||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
|
||||
rv = NS_ERROR_UNEXPECTED;
|
||||
if (!mParent->Open(loadState, loadInfo, aArgs.loadFlags(), aArgs.loadType(),
|
||||
aArgs.cacheKey(), aArgs.isActive(), aArgs.isTopLevelDoc(),
|
||||
aArgs.channelId(), aArgs.asyncOpenTime(),
|
||||
aArgs.documentOpenFlags(), aArgs.pluginsAllowed(),
|
||||
aArgs.timing().refOr(nullptr), std::move(clientInfo),
|
||||
aArgs.outerWindowId(), &rv)) {
|
||||
if (!mParent->Open(loadState, loadInfo, aArgs.loadFlags(), aArgs.cacheKey(),
|
||||
aArgs.isActive(), aArgs.isTopLevelDoc(), aArgs.channelId(),
|
||||
aArgs.asyncOpenTime(), aArgs.documentOpenFlags(),
|
||||
aArgs.pluginsAllowed(), aArgs.timing().refOr(nullptr),
|
||||
std::move(clientInfo), aArgs.outerWindowId(), &rv)) {
|
||||
return SendFailedAsyncOpen(rv);
|
||||
}
|
||||
|
||||
|
|
|
@ -345,8 +345,8 @@ CanonicalBrowsingContext* DocumentLoadListener::GetBrowsingContext() {
|
|||
|
||||
bool DocumentLoadListener::Open(
|
||||
nsDocShellLoadState* aLoadState, class LoadInfo* aLoadInfo,
|
||||
nsLoadFlags aLoadFlags, uint32_t aLoadType, uint32_t aCacheKey,
|
||||
bool aIsActive, bool aIsTopLevelDoc, const uint64_t& aChannelId,
|
||||
nsLoadFlags aLoadFlags, uint32_t aCacheKey, bool aIsActive,
|
||||
bool aIsTopLevelDoc, const uint64_t& aChannelId,
|
||||
const TimeStamp& aAsyncOpenTime, const Maybe<uint32_t>& aDocumentOpenFlags,
|
||||
bool aPluginsAllowed, nsDOMNavigationTiming* aTiming,
|
||||
Maybe<ClientInfo>&& aInfo, uint64_t aOuterWindowId, nsresult* aRv) {
|
||||
|
@ -374,7 +374,7 @@ bool DocumentLoadListener::Open(
|
|||
|
||||
if (!nsDocShell::CreateAndConfigureRealChannelForLoadState(
|
||||
aLoadState, loadInfo, mParentChannelListener, nullptr, attrs,
|
||||
aLoadFlags, aLoadType, aCacheKey, aIsActive, aIsTopLevelDoc, *aRv,
|
||||
aLoadFlags, aCacheKey, aIsActive, aIsTopLevelDoc, *aRv,
|
||||
getter_AddRefs(mChannel))) {
|
||||
mParentChannelListener = nullptr;
|
||||
return false;
|
||||
|
|
|
@ -70,8 +70,8 @@ class DocumentLoadListener : public nsIInterfaceRequestor,
|
|||
|
||||
// Creates the channel, and then calls AsyncOpen on it.
|
||||
bool Open(nsDocShellLoadState* aLoadState, LoadInfo* aLoadInfo,
|
||||
nsLoadFlags aLoadFlags, uint32_t aLoadType, uint32_t aCacheKey,
|
||||
bool aIsActive, bool aIsTopLevelDoc, const uint64_t& aChannelId,
|
||||
nsLoadFlags aLoadFlags, uint32_t aCacheKey, bool aIsActive,
|
||||
bool aIsTopLevelDoc, const uint64_t& aChannelId,
|
||||
const TimeStamp& aAsyncOpenTime,
|
||||
const Maybe<uint32_t>& aDocumentOpenFlags, bool aPluginsAllowed,
|
||||
nsDOMNavigationTiming* aTiming, Maybe<dom::ClientInfo>&& aInfo,
|
||||
|
|
|
@ -413,7 +413,6 @@ struct DocumentChannelCreationArgs {
|
|||
TimeStamp asyncOpenTime;
|
||||
uint64_t channelId;
|
||||
uint32_t loadFlags;
|
||||
uint32_t loadType;
|
||||
uint32_t cacheKey;
|
||||
uint32_t? documentOpenFlags;
|
||||
bool isActive;
|
||||
|
|
Загрузка…
Ссылка в новой задаче