Bug 1814686 - Part 1a: Wrap refcounted types in NotNull by default, r=ipc-reviewers,mccr8

These are the IPDL compiler changes to make all refcounted types be considered
NotNull by default, building on the changes from bug 1607634.

Existing uses of IPDL refcounted types will be marked as nullable in part 1b.

Differential Revision: https://phabricator.services.mozilla.com/D168888
This commit is contained in:
Nika Layzell 2023-03-20 15:40:37 +00:00
parent f47e7d485e
commit 9e5c372ef3
2 changed files with 12 additions and 1 deletions

View File

@ -210,6 +210,9 @@ class ImportedCxxType(Type):
def isRefcounted(self):
return self.refcounted
def supportsNullable(self):
return self.refcounted
def isSendMoveOnly(self):
return self.sendmoveonly

View File

@ -1,7 +1,12 @@
[RefCounted] using class nsIURI from "nsIURI.h";
union Union {
nullable PNullable;
nullable PNullable[];
nullable PNullable?;
nullable nsIURI;
nullable nsIURI[];
nullable nsIURI?;
};
protocol PNullable {
@ -9,5 +14,8 @@ child:
async Msg(nullable PNullable n);
async Msg2(nullable PNullable[] N);
async Msg3(nullable PNullable? n);
async Msg4(Union u);
async Msg4(nullable nsIURI u);
async Msg5(nullable nsIURI[] u);
async Msg6(nullable nsIURI? u);
async Msg7(Union u);
};