diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index 739073ba17db..666f055e2cec 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -9033,7 +9033,7 @@ void Document::SetDomain(const nsAString& aDomain, ErrorResult& rv) { MOZ_ALWAYS_SUCCEEDS(NodePrincipal()->SetDomain(newURI)); MOZ_ALWAYS_SUCCEEDS(PartitionedPrincipal()->SetDomain(newURI)); if (WindowGlobalChild* wgc = GetWindowGlobalChild()) { - wgc->SendSetDocumentDomain(newURI); + wgc->SendSetDocumentDomain(WrapNotNull(newURI)); } } diff --git a/dom/ipc/PWindowGlobal.ipdl b/dom/ipc/PWindowGlobal.ipdl index 38ac45de4d11..a063852f56a7 100644 --- a/dom/ipc/PWindowGlobal.ipdl +++ b/dom/ipc/PWindowGlobal.ipdl @@ -109,7 +109,7 @@ parent: async InternalLoad(nsDocShellLoadState aLoadState); /// Update the URI of the document in this WindowGlobal. - [LazySend] async UpdateDocumentURI(nullable nsIURI aUri); + [LazySend] async UpdateDocumentURI(nsIURI aUri); // We expose frameAncestors to web-extensions and they extract URIs from the // principals collected. In order to be compatible with that API, we need to @@ -196,7 +196,7 @@ parent: */ async SetSingleChannelId(uint64_t? singleChannelId); - async SetDocumentDomain(nullable nsIURI aDomain); + async SetDocumentDomain(nsIURI aDomain); async Destroy(); diff --git a/dom/ipc/WindowGlobalChild.cpp b/dom/ipc/WindowGlobalChild.cpp index 62dffe7549a3..ec2811f972ae 100644 --- a/dom/ipc/WindowGlobalChild.cpp +++ b/dom/ipc/WindowGlobalChild.cpp @@ -615,7 +615,7 @@ void WindowGlobalChild::SetDocumentURI(nsIURI* aDocumentURI) { } mDocumentURI = aDocumentURI; - SendUpdateDocumentURI(aDocumentURI); + SendUpdateDocumentURI(WrapNotNull(aDocumentURI)); } void WindowGlobalChild::SetDocumentPrincipal( diff --git a/dom/ipc/WindowGlobalParent.cpp b/dom/ipc/WindowGlobalParent.cpp index 0dd7e869ae2a..2a02d2246c38 100644 --- a/dom/ipc/WindowGlobalParent.cpp +++ b/dom/ipc/WindowGlobalParent.cpp @@ -381,7 +381,7 @@ mozilla::ipc::IPCResult WindowGlobalParent::RecvInternalLoad( return IPC_OK(); } -IPCResult WindowGlobalParent::RecvUpdateDocumentURI(nsIURI* aURI) { +IPCResult WindowGlobalParent::RecvUpdateDocumentURI(NotNull aURI) { // XXX(nika): Assert that the URI change was one which makes sense (either // about:blank -> a real URI, or a legal push/popstate URI change): if (StaticPrefs::dom_security_setdocumenturi()) { @@ -1317,7 +1317,7 @@ mozilla::ipc::IPCResult WindowGlobalParent::RecvSetSingleChannelId( } mozilla::ipc::IPCResult WindowGlobalParent::RecvSetDocumentDomain( - nsIURI* aDomain) { + NotNull aDomain) { if (mSandboxFlags & SANDBOXED_DOMAIN) { // We're sandboxed; disallow setting domain return IPC_FAIL(this, "Sandbox disallows domain setting."); @@ -1335,7 +1335,7 @@ mozilla::ipc::IPCResult WindowGlobalParent::RecvSetDocumentDomain( } } - if (!aDomain || !Document::IsValidDomain(uri, aDomain)) { + if (!Document::IsValidDomain(uri, aDomain)) { // Error: illegal domain return IPC_FAIL( this, "Setting domain that's not a suffix of existing domain value."); diff --git a/dom/ipc/WindowGlobalParent.h b/dom/ipc/WindowGlobalParent.h index e0f8091a7837..d801e8cfddc6 100644 --- a/dom/ipc/WindowGlobalParent.h +++ b/dom/ipc/WindowGlobalParent.h @@ -244,7 +244,7 @@ class WindowGlobalParent final : public WindowContext, const MaybeDiscarded& aTargetBC, nsDocShellLoadState* aLoadState, bool aSetNavigating); mozilla::ipc::IPCResult RecvInternalLoad(nsDocShellLoadState* aLoadState); - mozilla::ipc::IPCResult RecvUpdateDocumentURI(nsIURI* aURI); + mozilla::ipc::IPCResult RecvUpdateDocumentURI(NotNull aURI); mozilla::ipc::IPCResult RecvUpdateDocumentPrincipal( nsIPrincipal* aNewDocumentPrincipal, nsIPrincipal* aNewDocumentStoragePrincipal); @@ -312,7 +312,7 @@ class WindowGlobalParent final : public WindowContext, mozilla::ipc::IPCResult RecvSetSingleChannelId( const Maybe& aSingleChannelId); - mozilla::ipc::IPCResult RecvSetDocumentDomain(nsIURI* aDomain); + mozilla::ipc::IPCResult RecvSetDocumentDomain(NotNull aDomain); mozilla::ipc::IPCResult RecvReloadWithHttpsOnlyException();