Bug 1578624 - P2: Extend nsDocShellLoadState for the extra options needed to describe front end loads. r=kmag,nika

Differential Revision: https://phabricator.services.mozilla.com/D44758
This commit is contained in:
Matt Woodrow
2019-10-09 04:53:06 +00:00
parent 4473694d54
commit 7a1fd26761
5 changed files with 46 additions and 0 deletions

View File

@@ -192,6 +192,20 @@ class nsDocShellLoadState final {
return mPendingRedirectedChannel;
}
void SetOriginalURIString(const nsCString& aOriginalURI) {
mOriginalURIString.emplace(aOriginalURI);
}
const Maybe<nsCString>& GetOriginalURIString() const {
return mOriginalURIString;
}
void SetCancelContentJSEpoch(int32_t aCancelEpoch) {
mCancelContentJSEpoch.emplace(aCancelEpoch);
}
const Maybe<int32_t>& GetCancelContentJSEpoch() const {
return mCancelContentJSEpoch;
}
// When loading a document through nsDocShell::LoadURI(), a special set of
// flags needs to be set based on other values in nsDocShellLoadState. This
// function calculates those flags, before the LoadState is passed to
@@ -338,6 +352,15 @@ class nsDocShellLoadState final {
// If set, a pending cross-process redirected channel should be used to
// perform the load. The channel will be stored in this value.
nsCOMPtr<nsIChildChannel> mPendingRedirectedChannel;
// An optional string representation of mURI, before any
// fixups were applied, so that we can send it to a search
// engine service if needed.
Maybe<nsCString> mOriginalURIString;
// An optional value to pass to nsIDocShell::setCancelJSEpoch
// when initiating the load.
Maybe<int32_t> mCancelContentJSEpoch;
};
#endif /* nsDocShellLoadState_h__ */