Bug 1814686 - Part 2: Make nsDocShellLoadState not-null, and simplify handling of nsDOMNavigationTiming, r=necko-reviewers,valentin,smaug

These types were already non-nullable, with the serializer implementation not
supporting nullptr values. This patch converts the uses to be explicitly
non-nullable, and adds the relevant `WrapNotNull` changes.

Differential Revision: https://phabricator.services.mozilla.com/D168890
This commit is contained in:
Nika Layzell
2023-03-14 19:31:42 +00:00
parent 0af9a30fe5
commit 4c261fb18c
18 changed files with 69 additions and 59 deletions

View File

@@ -4143,8 +4143,8 @@ nsDocShell::Reload(uint32_t aReloadFlags) {
mBrowsingContext, forceReload,
[docShell, doc, loadType, browsingContext, currentURI, referrerInfo,
loadGroup, stopDetector](
Tuple<bool, Maybe<RefPtr<nsDocShellLoadState>>, Maybe<bool>>&&
aResult) {
Tuple<bool, Maybe<NotNull<RefPtr<nsDocShellLoadState>>>,
Maybe<bool>>&& aResult) {
auto scopeExit = MakeScopeExit([loadGroup, stopDetector]() {
if (loadGroup) {
loadGroup->RemoveRequest(stopDetector, nullptr, NS_OK);
@@ -4154,7 +4154,7 @@ nsDocShell::Reload(uint32_t aReloadFlags) {
return;
}
bool canReload;
Maybe<RefPtr<nsDocShellLoadState>> loadState;
Maybe<NotNull<RefPtr<nsDocShellLoadState>>> loadState;
Maybe<bool> reloadingActiveEntry;
Tie(canReload, loadState, reloadingActiveEntry) = aResult;
@@ -4182,7 +4182,7 @@ nsDocShell::Reload(uint32_t aReloadFlags) {
} else {
// Parent process
bool canReload = false;
Maybe<RefPtr<nsDocShellLoadState>> loadState;
Maybe<NotNull<RefPtr<nsDocShellLoadState>>> loadState;
Maybe<bool> reloadingActiveEntry;
if (!mBrowsingContext->IsDiscarded()) {
mBrowsingContext->Canonical()->NotifyOnHistoryReload(