@@ -351,6 +351,7 @@ one in ``PMyManager.ipdl``:
351
351
352
352
.. code-block :: cpp
353
353
354
+ [ChildProc=Content]
354
355
sync protocol PMyManager {
355
356
manages PMyManaged;
356
357
@@ -406,6 +407,12 @@ They will be discussed further in `Nested messages`_.
406
407
response.
407
408
============================== ================================================
408
409
410
+ In addition, top-level protocols are annotated with which processes each side
411
+ should be bound into using the ``[ParentProc=*] `` and ``[ChildProc=*] ``
412
+ attributes. The ``[ParentProc] `` attribute is optional, and defaults to the
413
+ ``Parent `` process. The ``[ChildProc] `` attribute is required. See `Process
414
+ Type Attributes `_ for possible values.
415
+
409
416
The ``manages `` clause tells IPDL that ``PMyManager `` manages the
410
417
``PMyManaged `` actor that was previously ``include `` d. As with any managed
411
418
protocol, it must also be the case that ``PMyManaged.ipdl `` includes
@@ -730,7 +737,62 @@ for use in IPDL files:
730
737
``Recv `` methods should be used instead of direct
731
738
function calls. *New uses of this attribute are
732
739
discouraged. *
740
+ ``[ChildProc=...] `` Indicates which process the child side of the actor
741
+ is expected to be bound in. This will be release
742
+ asserted when creating the actor. Required for
743
+ top-level actors. See `Process Type Attributes `_
744
+ for possible values.
745
+ ``[ParentProc=...] `` Indicates which process the parent side of the
746
+ actor is expected to be bound in. This will be
747
+ release asserted when creating the actor.
748
+ Defaults to ``Parent `` for top-level actors. See
749
+ `Process Type Attributes `_ for possible values.
750
+ ============================= =================================================
751
+
752
+ .. _Process Type Attributes :
753
+
754
+ Process Type Attributes
755
+ ^^^^^^^^^^^^^^^^^^^^^^^
756
+
757
+ The following are valid values for the ``[ChildProc=...] `` and
758
+ ``[ParentProc=...] `` attributes on protocols, each corresponding to a specific
759
+ process type:
760
+
733
761
============================= =================================================
762
+ ``Parent `` The primary "parent" or "main" process
763
+ ``Content `` A content process, such as those used to host web
764
+ pages, workers, and extensions
765
+ ``IPDLUnitTest `` Test-only process used in IPDL gtests
766
+ ``GMPlugin `` Gecko Media Plugin (GMP) process
767
+ ``GPU `` GPU process
768
+ ``VR `` VR process
769
+ ``RDD `` Remote Data Decoder (RDD) process
770
+ ``Socket `` Socket/Networking process
771
+ ``RemoteSandboxBroker `` Remote Sandbox Broker process
772
+ ``ForkServer `` Fork Server process
773
+ ``Utility `` Utility process
774
+ ============================= =================================================
775
+
776
+ The attributes also support some wildcard values, which can be used when an
777
+ actor can be bound in multiple processes. If you are adding an actor which
778
+ needs a new wildcard value, please reach out to the IPC team, and we can add one
779
+ for your use-case. They are as follows:
780
+
781
+ ============================= =================================================
782
+ ``any `` Any process. If a more specific value is
783
+ applicable, it should be preferred where possible.
784
+ ``anychild `` Any process other than ``Parent ``. Often used for
785
+ utility actors which are bound on a per-process
786
+ basis, such as profiling.
787
+ ``compositor `` Either the ``GPU `` or ``Parent `` process. Often
788
+ used for actors bound to the compositor thread.
789
+ ``anydom `` Either the ``Parent `` or a ``Content `` process.
790
+ Often used for actors used to implement DOM APIs.
791
+ ============================= =================================================
792
+
793
+ Note that these assertions do not provide security guarantees, and are primarily
794
+ intended for use when auditing and as documentation for how actors are being
795
+ used.
734
796
735
797
736
798
The C++ Interface
0 commit comments