Bug 1625156 - Error page for HTTPS Only Mode. r=fluent-reviewers,ckerschb,nhnt11,flod,nika,johannh,mattwoodrow

Differential Revision: https://phabricator.services.mozilla.com/D72129
This commit is contained in:
JulianWels
2020-05-26 11:45:21 +00:00
parent 70661b239c
commit a3dfbd187a
32 changed files with 419 additions and 5 deletions

View File

@@ -92,6 +92,7 @@ nsDocShellLoadState::nsDocShellLoadState(nsIURI* aURI)
mHasValidUserGestureActivation(false),
mTypeHint(VoidCString()),
mFileName(VoidString()),
mIsHttpsOnlyModeUpgradeExempt(false),
mIsFromProcessingFrameAttributes(false),
mLoadIdentifier(0) {
MOZ_ASSERT(aURI, "Cannot create a LoadState with a null URI!");
@@ -116,6 +117,7 @@ nsDocShellLoadState::nsDocShellLoadState(
mHasValidUserGestureActivation = aLoadState.HasValidUserGestureActivation();
mTypeHint = aLoadState.TypeHint();
mFileName = aLoadState.FileName();
mIsHttpsOnlyModeUpgradeExempt = aLoadState.IsHttpsOnlyModeUpgradeExempt();
mIsFromProcessingFrameAttributes =
aLoadState.IsFromProcessingFrameAttributes();
mReferrerInfo = aLoadState.ReferrerInfo();
@@ -165,6 +167,7 @@ nsDocShellLoadState::nsDocShellLoadState(const nsDocShellLoadState& aOther)
mHasValidUserGestureActivation(aOther.mHasValidUserGestureActivation),
mTypeHint(aOther.mTypeHint),
mFileName(aOther.mFileName),
mIsHttpsOnlyModeUpgradeExempt(aOther.mIsHttpsOnlyModeUpgradeExempt),
mIsFromProcessingFrameAttributes(aOther.mIsFromProcessingFrameAttributes),
mPendingRedirectedChannel(aOther.mPendingRedirectedChannel),
mOriginalURIString(aOther.mOriginalURIString),
@@ -349,6 +352,8 @@ nsresult nsDocShellLoadState::CreateFromLoadURIOptions(
if (aLoadURIOptions.mCancelContentJSEpoch) {
loadState->SetCancelContentJSEpoch(aLoadURIOptions.mCancelContentJSEpoch);
}
loadState->SetIsHttpsOnlyModeUpgradeExempt(
aLoadURIOptions.mIsHttpsOnlyModeUpgradeExempt);
if (fixupInfo) {
nsAutoString searchProvider, keyword;
@@ -601,6 +606,14 @@ void nsDocShellLoadState::SetFileName(const nsAString& aFileName) {
mFileName = aFileName;
}
bool nsDocShellLoadState::IsHttpsOnlyModeUpgradeExempt() const {
return mIsHttpsOnlyModeUpgradeExempt;
}
void nsDocShellLoadState::SetIsHttpsOnlyModeUpgradeExempt(bool aIsExempt) {
mIsHttpsOnlyModeUpgradeExempt = aIsExempt;
}
nsresult nsDocShellLoadState::SetupInheritingPrincipal(
BrowsingContext::Type aType,
const mozilla::OriginAttributes& aOriginAttributes) {
@@ -863,6 +876,7 @@ DocShellLoadStateInit nsDocShellLoadState::Serialize() {
loadState.HasValidUserGestureActivation() = mHasValidUserGestureActivation;
loadState.TypeHint() = mTypeHint;
loadState.FileName() = mFileName;
loadState.IsHttpsOnlyModeUpgradeExempt() = mIsHttpsOnlyModeUpgradeExempt;
loadState.IsFromProcessingFrameAttributes() =
mIsFromProcessingFrameAttributes;
loadState.URI() = mURI;