Bug 1885598: Assert on a passed remoteTypeOverride to avoid footguns r=nika

Differential Revision: https://phabricator.services.mozilla.com/D204791
This commit is contained in:
Tom Ritter 2024-03-25 18:57:07 +00:00
Родитель 1cb477fd69
Коммит b8555f5d7d
2 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -901,6 +901,14 @@ void nsDocShellLoadState::SetFileName(const nsAString& aFileName) {
mFileName = aFileName;
}
void nsDocShellLoadState::SetRemoteTypeOverride(
const nsCString& aRemoteTypeOverride) {
MOZ_DIAGNOSTIC_ASSERT(
NS_IsAboutBlank(mURI),
"Should only have aRemoteTypeOverride for about:blank URIs");
mRemoteTypeOverride = mozilla::Some(aRemoteTypeOverride);
}
const nsCString& nsDocShellLoadState::GetEffectiveTriggeringRemoteType() const {
// Consider non-errorpage loads from session history as being triggred by the
// parent process, as we'll validate them against the history entry.

Просмотреть файл

@ -323,9 +323,7 @@ class nsDocShellLoadState final {
return mRemoteTypeOverride;
}
void SetRemoteTypeOverride(const nsCString& aRemoteTypeOverride) {
mRemoteTypeOverride = mozilla::Some(aRemoteTypeOverride);
}
void SetRemoteTypeOverride(const nsCString& aRemoteTypeOverride);
void SetWasSchemelessInput(bool aWasSchemelessInput) {
mWasSchemelessInput = aWasSchemelessInput;