tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

PBackground.ipdl (10467B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2  * License, v. 2.0. If a copy of the MPL was not distributed with this
      3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 include protocol PBackgroundDataBridge;
      6 include protocol PBackgroundIDBFactory;
      7 include protocol PBackgroundIndexedDBUtils;
      8 include protocol PBackgroundSDBConnection;
      9 include protocol PBackgroundLSObserver;
     10 include protocol PBackgroundLSRequest;
     11 include protocol PBackgroundLSSimpleRequest;
     12 include protocol PBackgroundLocalStorageCache;
     13 include protocol PBackgroundSessionStorageManager;
     14 include protocol PBackgroundSessionStorageService;
     15 include protocol PBackgroundStorage;
     16 include protocol PBackgroundTest;
     17 include protocol PBoundStorageKey;
     18 include protocol PBroadcastChannel;
     19 include protocol PCache;
     20 include protocol PCacheStorage;
     21 include protocol PCacheStreamControl;
     22 include protocol PClientManager;
     23 include protocol PCookieStore;
     24 include protocol PEndpointForReport;
     25 include protocol PFileSystemManager;
     26 include protocol PFileSystemRequest;
     27 include protocol PGamepadEventChannel;
     28 include protocol PGamepadTestChannel;
     29 include protocol PHttpBackgroundChannel;
     30 include protocol PIdleScheduler;
     31 include protocol PRemoteWorkerController;
     32 include protocol PRemoteWorkerService;
     33 include protocol PSharedWorker;
     34 include protocol PTemporaryIPCBlob;
     35 include protocol PFileCreator;
     36 include protocol PMessagePort;
     37 include protocol PCameras;
     38 include protocol PLockManager;
     39 include protocol PMIDIManager;
     40 include protocol PMIDIPort;
     41 include protocol PMLSTransaction;
     42 include protocol PQuota;
     43 include protocol PServiceWorker;
     44 include protocol PServiceWorkerContainer;
     45 include protocol PServiceWorkerManager;
     46 include protocol PServiceWorkerRegistration;
     47 include protocol PUDPSocket;
     48 include protocol PVsync;
     49 include protocol PRemoteMediaManager;
     50 include protocol PWebTransport;
     51 include protocol PFetch;
     52 include protocol PNotification;
     53 
     54 include ClientIPCTypes;
     55 include DOMTypes;
     56 include IPCBlob;
     57 include IPCServiceWorkerDescriptor;
     58 include IPCServiceWorkerRegistrationDescriptor;
     59 include PBackgroundLSSharedTypes;
     60 include PBackgroundSharedTypes;
     61 include PBackgroundIDBSharedTypes;
     62 include PFileSystemParams;
     63 include ProtocolTypes;
     64 include RemoteWorkerTypes;
     65 include MIDITypes;
     66 
     67 include "mozilla/dom/cache/IPCUtils.h";
     68 include "mozilla/dom/quota/SerializationHelpers.h";
     69 include "mozilla/dom/PermissionMessageUtils.h";
     70 include "mozilla/layers/LayersMessageUtils.h";
     71 
     72 using mozilla::dom::cache::Namespace
     73   from "mozilla/dom/cache/Types.h";
     74 
     75 using class mozilla::dom::SSCacheCopy from "mozilla/dom/PBackgroundSessionStorageCache.h";
     76 
     77 using mozilla::RemoteMediaIn from "mozilla/RemoteMediaManagerChild.h";
     78 
     79 using mozilla::camera::CamerasAccessStatus from "mozilla/media/CamerasTypes.h";
     80 
     81 namespace mozilla {
     82 namespace ipc {
     83 
     84 [NeedsOtherPid, ChildImpl=virtual, ParentImpl=virtual, ChildProc=anydom]
     85 sync protocol PBackground
     86 {
     87   manages PBackgroundIDBFactory;
     88   manages PBackgroundIndexedDBUtils;
     89   manages PBackgroundSDBConnection;
     90   manages PBackgroundLSObserver;
     91   manages PBackgroundLSRequest;
     92   manages PBackgroundLSSimpleRequest;
     93   manages PBackgroundLocalStorageCache;
     94   manages PBackgroundSessionStorageManager;
     95   manages PBackgroundSessionStorageService;
     96   manages PBackgroundStorage;
     97   manages PBackgroundTest;
     98   manages PBroadcastChannel;
     99   manages PCache;
    100   manages PCacheStorage;
    101   manages PCacheStreamControl;
    102   manages PClientManager;
    103   manages PCookieStore;
    104   manages PEndpointForReport;
    105   manages PFileSystemRequest;
    106   manages PGamepadEventChannel;
    107   manages PGamepadTestChannel;
    108   manages PHttpBackgroundChannel;
    109   manages PIdleScheduler;
    110   manages PLockManager;
    111   manages PRemoteWorkerController;
    112   manages PSharedWorker;
    113   manages PTemporaryIPCBlob;
    114   manages PFileCreator;
    115   manages PMessagePort;
    116   manages PCameras;
    117   manages PQuota;
    118   manages PServiceWorker;
    119   manages PServiceWorkerContainer;
    120   manages PServiceWorkerManager;
    121   manages PServiceWorkerRegistration;
    122   manages PUDPSocket;
    123   manages PVsync;
    124   manages PFetch;
    125 
    126 parent:
    127   // Only called at startup during mochitests to check the basic infrastructure.
    128   async PBackgroundTest(nsCString testArg);
    129 
    130   async PBackgroundIDBFactory(LoggingInfo loggingInfo,
    131                               nsCString systemLocale);
    132 
    133   async PBackgroundIndexedDBUtils();
    134 
    135   // Use only for testing!
    136   async FlushPendingFileDeletions();
    137 
    138   async PBackgroundSDBConnection(PersistenceType persistenceType,
    139                                  PrincipalInfo principalInfo);
    140 
    141   async PBackgroundLSObserver(uint64_t observerId);
    142 
    143   /**
    144    * Issue an asynchronous request that will be used in a synchronous fashion
    145    * through complex machinations described in `PBackgroundLSRequest.ipdl` and
    146    * `LSObject.h`.
    147    */
    148   async PBackgroundLSRequest(LSRequestParams params);
    149 
    150   /**
    151    * Issues a simple, non-cancelable asynchronous request that's used in an
    152    * asynchronous fashion by callers.  (LSRequest is not simple because it used
    153    * in a synchronous fashion which leads to complexities regarding cancelation,
    154    * see `PBackgroundLSRequest.ipdl` for details.)
    155    */
    156   async PBackgroundLSSimpleRequest(LSSimpleRequestParams params);
    157 
    158   async PBackgroundLocalStorageCache(PrincipalInfo principalInfo,
    159                                      nsCString originKey,
    160                                      uint32_t privateBrowsingId);
    161 
    162   async PBackgroundSessionStorageManager(uint64_t aTopContextId);
    163 
    164   async PBackgroundSessionStorageService();
    165 
    166   async PBackgroundStorage(nsString profilePath, uint32_t privateBrowsingId);
    167 
    168   /**
    169    * Finish the setup of a new PFileSystemManager top level protocol.
    170    */
    171   async CreateFileSystemManagerParent(
    172       PrincipalInfo principalInfo,
    173       Endpoint<PFileSystemManagerParent> aParentEndpoint)
    174       returns(nsresult rv);
    175 
    176   /**
    177    * Finish the setup of a new PWebTransport top level protocol.
    178    */
    179   async CreateWebTransportParent(
    180       nsString aURL,
    181       nullable nsIPrincipal aPrincipal,
    182       uint64_t aBrowsingContextID,
    183       IPCClientInfo?  aClientInfo,
    184       bool aDedicated,
    185       bool aRequireUnreliable,
    186       uint32_t aCongestionControl,
    187       WebTransportHash[] aServerCertHashes,
    188       Endpoint<PWebTransportParent> aParentEndpoint)
    189       returns(nsresult rv, uint8_t aReliability); // Actually WebTransportReliabityMode enum
    190 
    191 
    192   // XXX(krosylight): This should ultimately use nsID instead of scope, see bug 1881812.
    193   /**
    194    * Finish the setup of a new PNotification top level protocol.
    195    */
    196   async CreateNotificationParent(
    197     Endpoint<PNotificationParent> aParentEndpoint,
    198     nsIPrincipal aPrincipal,
    199     nsIPrincipal aEffectiveStoragePrincipal,
    200     bool aIsSecureContext,
    201     nsString aScope,
    202     IPCNotification aNotification
    203   ) returns (bool rv);
    204 
    205   async PVsync();
    206 
    207   async PCameras();
    208 
    209   async PUDPSocket(PrincipalInfo? pInfo, nsCString filter);
    210   async PBroadcastChannel(PrincipalInfo pInfo, nsCString origin, nsString channel);
    211 
    212   async PCookieStore();
    213 
    214   async PServiceWorkerManager();
    215 
    216   async ShutdownServiceWorkerRegistrar();
    217 
    218   async PCacheStorage(Namespace aNamespace, PrincipalInfo aPrincipalInfo);
    219 
    220   async PMessagePort(nsID uuid, nsID destinationUuid, uint32_t sequenceId);
    221 
    222   async MessagePortForceClose(nsID uuid, nsID destinationUuid, uint32_t sequenceId);
    223 
    224   async PQuota();
    225 
    226   async ShutdownQuotaManager();
    227 
    228   async ShutdownBackgroundSessionStorageManagers();
    229 
    230   async PropagateBackgroundSessionStorageManager(uint64_t currentTopContextId, uint64_t targetTopContextId);
    231 
    232   async RemoveBackgroundSessionStorageManager(uint64_t topContextId);
    233 
    234   async GetSessionStorageManagerData(
    235       uint64_t aTopContextId, uint32_t aSizeLimit, bool aCancelSessionStoreTimer)
    236       returns(SSCacheCopy[] aCacheCopy);
    237 
    238   async LoadSessionStorageManagerData(uint64_t aTopContextId, SSCacheCopy[] aOriginCacheCopy);
    239 
    240   async PFileSystemRequest(FileSystemParams params);
    241 
    242   async PGamepadEventChannel();
    243 
    244   async PGamepadTestChannel();
    245 
    246   async PHttpBackgroundChannel(uint64_t channelId);
    247 
    248   async PSharedWorker(RemoteWorkerData data,
    249                       uint64_t windowID,
    250                       MessagePortIdentifier portIdentifier);
    251 
    252   async PTemporaryIPCBlob();
    253 
    254   async PFileCreator(nsString aFullPath, nsString aType, nsString aName,
    255                      int64_t? lastModified, bool aExistenceCheck,
    256                      bool aIsFromNsIFile);
    257 
    258   async PClientManager();
    259 
    260   async CreateBoundStorageKeyParent(
    261     Endpoint<PBoundStorageKeyParent> aEndPoint,
    262     Namespace aNamespace,
    263     PrincipalInfo aPrincipalInfo);
    264 
    265   async CreateMIDIManager(Endpoint<PMIDIManagerParent> aEndpoint);
    266   async CreateMIDIPort(Endpoint<PMIDIPortParent> aEndpoint,
    267                        MIDIPortInfo portInfo, bool sysexEnabled);
    268   async HasMIDIDevice() returns (bool hasDevice);
    269 
    270   async CreateMLSTransaction(Endpoint<PMLSTransactionParent> aEndpoint, nsIPrincipal aPrincipal);
    271 
    272   // This method is used to propagate storage activities from the child actor
    273   // to the parent actor. See StorageActivityService.
    274   async StorageActivity(PrincipalInfo principalInfo);
    275 
    276   async PServiceWorker(IPCServiceWorkerDescriptor aDescriptor);
    277 
    278   async PRemoteWorkerController(RemoteWorkerData aData);
    279 
    280   async PServiceWorkerContainer();
    281 
    282   // Allows a global to listen for updates to a ServiceWorkerRegistration given
    283   // receipt of a (static) snapshot via the descriptor.  `aForClient` identifies
    284   // the global subscribing; in the future this will be mooted by Bug 1853706
    285   // having this actor managed by an actor explicitly tied to a global.
    286   async PServiceWorkerRegistration(IPCServiceWorkerRegistrationDescriptor aDescriptor,
    287                                    IPCClientInfo aForClient);
    288 
    289   async PEndpointForReport(nsString aGroupName, PrincipalInfo aPrincipalInfo);
    290 
    291   async RemoveEndpoint(nsString aGroupName, nsCString aEndpointURL,
    292                        PrincipalInfo aPrincipalInfo);
    293 
    294   async PIdleScheduler();
    295 
    296   async EnsureRDDProcessAndCreateBridge()
    297       returns (nsresult rv, Endpoint<PRemoteMediaManagerChild> aEndpoint);
    298 
    299   async EnsureUtilityProcessAndCreateBridge(RemoteMediaIn aLocation)
    300       returns (nsresult rv, Endpoint<PRemoteMediaManagerChild> aEndpoint);
    301 
    302   async PLockManager(nsIPrincipal aPrincipalInfo, nsID? aClientId);
    303 
    304   async PFetch();
    305 
    306   async RequestCameraAccess(bool aAllowPermissionRequest) returns (CamerasAccessStatus rv);
    307 
    308 child:
    309   async PCache();
    310   async PCacheStreamControl();
    311 };
    312 
    313 } // namespace ipc
    314 } // namespace mozilla