tor-browser

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

PNecko.ipdl (6478B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
      3 
      4 /* This Source Code Form is subject to the terms of the Mozilla Public
      5  * License, v. 2.0. If a copy of the MPL was not distributed with this
      6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      7 
      8 include protocol PContent;
      9 include protocol PHttpChannel;
     10 include protocol PCacheEntryWriteHandle;
     11 include protocol PCookieService;
     12 include protocol PBrowser;
     13 #ifdef MOZ_WIDGET_GTK
     14 include protocol PGIOChannel;
     15 #endif
     16 #ifdef MOZ_WIDGET_ANDROID
     17 include protocol PGeckoViewContentChannel;
     18 #endif
     19 include protocol PWebSocket;
     20 include protocol PWebSocketEventListener;
     21 include protocol PTCPSocket;
     22 include protocol PTCPServerSocket;
     23 include protocol PUDPSocket;
     24 include protocol PDNSRequest;
     25 include protocol PTransportProvider;
     26 include protocol PStunAddrsRequest;
     27 include protocol PWebrtcTCPSocket;
     28 include protocol PSocketProcessBridge;
     29 include protocol PDocumentChannel;
     30 
     31 include IPCStream;
     32 include NeckoChannelParams;
     33 include protocol PAltDataOutputStream;
     34 
     35 include "mozilla/dom/PermissionMessageUtils.h";
     36 
     37 using mozilla::dom::MaybeDiscardedBrowsingContext from "mozilla/dom/BrowsingContext.h";
     38 using class IPC::SerializedLoadContext from "SerializedLoadContext.h";
     39 using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
     40 using nsIDNSService::DNSFlags from "nsIDNSService.h";
     41 [RefCounted] using class nsIInputStream from "mozilla/ipc/IPCStreamUtils.h";
     42 [RefCounted] using class nsIURI from "mozilla/ipc/URIUtils.h";
     43 [RefCounted] using class nsIPrincipal from "nsIPrincipal.h";
     44 
     45 
     46 namespace mozilla {
     47 namespace net {
     48 
     49 //-------------------------------------------------------------------
     50 [NestedUpTo=inside_cpow] sync protocol PNecko
     51 {
     52   manager PContent;
     53   manages PHttpChannel;
     54   manages PCacheEntryWriteHandle;
     55   manages PCookieService;
     56   manages PWebSocket;
     57   manages PWebSocketEventListener;
     58   manages PTCPSocket;
     59   manages PTCPServerSocket;
     60   manages PUDPSocket;
     61   manages PDNSRequest;
     62 #ifdef MOZ_WIDGET_GTK
     63   manages PGIOChannel;
     64 #endif
     65 #ifdef MOZ_WIDGET_ANDROID
     66   manages PGeckoViewContentChannel;
     67 #endif
     68   manages PTransportProvider;
     69   manages PAltDataOutputStream;
     70   manages PStunAddrsRequest;
     71   manages PWebrtcTCPSocket;
     72   manages PDocumentChannel;
     73 
     74 parent:
     75   async __delete__();
     76 
     77   [Nested=inside_cpow] async PCookieService();
     78   async PHttpChannel(nullable PBrowser browser,
     79                      SerializedLoadContext loadContext,
     80                      HttpChannelCreationArgs args);
     81 
     82   async PWebSocket(nullable PBrowser browser, SerializedLoadContext loadContext,
     83                    uint32_t aSerialID);
     84   async PTCPServerSocket(uint16_t localPort, uint16_t backlog, bool useArrayBuffers);
     85   async PUDPSocket(nullable nsIPrincipal principal, nsCString filter);
     86 
     87   async PDNSRequest(nsCString hostName, nsCString trrServer, int32_t port,
     88                     uint16_t type, OriginAttributes originAttributes,
     89                     DNSFlags flags);
     90 
     91   async PDocumentChannel(MaybeDiscardedBrowsingContext browsingContext,
     92                          DocumentChannelCreationArgs args);
     93 
     94   async PWebSocketEventListener(uint64_t aInnerWindowID);
     95 
     96   async SpeculativeConnect(nullable nsIURI uri,
     97                            nullable nsIPrincipal principal,
     98                            OriginAttributes? originAttributes,
     99                            bool anonymous);
    100   async HTMLDNSPrefetch(nsString hostname, bool isHttps,
    101                         OriginAttributes originAttributes, DNSFlags flags);
    102   async CancelHTMLDNSPrefetch(nsString hostname, bool isHttps,
    103                               OriginAttributes originAttributes,
    104                               DNSFlags flags, nsresult reason);
    105 
    106   /**
    107    * Establish a connection between generic redirect channels which do not need
    108    * specialized nsIParentChannel handling.
    109    */
    110   async ConnectBaseChannel(uint32_t channelId);
    111 
    112 #ifdef MOZ_WIDGET_GTK
    113   async PGIOChannel(nullable PBrowser browser, SerializedLoadContext loadContext, GIOChannelCreationArgs args);
    114 #endif
    115 
    116 #ifdef MOZ_WIDGET_ANDROID
    117   async PGeckoViewContentChannel(nullable PBrowser browser,
    118                                  SerializedLoadContext loadContext,
    119                                  GeckoViewContentChannelArgs args);
    120 #endif
    121 
    122   /**
    123    * When a nsFileChannel is opened within the content process, we notify
    124    * "file-channel-opened" in the parent process using this IPC message.
    125    */
    126   async NotifyFileChannelOpened(FileChannelInfo info);
    127 
    128   async RequestContextLoadBegin(uint64_t rcid);
    129   async RequestContextAfterDOMContentLoaded(uint64_t rcid);
    130   async RemoveRequestContext(uint64_t rcid);
    131 
    132   async PCacheEntryWriteHandle(PHttpChannel channel);
    133 
    134   async PAltDataOutputStream(nsCString type, int64_t predictedSize, PHttpChannel? channel, PCacheEntryWriteHandle? handle);
    135 
    136 
    137   async PStunAddrsRequest();
    138 
    139   /* tabId is only required for web-proxy support, which isn't always needed */
    140   async PWebrtcTCPSocket(TabId? tabId);
    141 
    142   /**
    143    * WebExtension-specific remote resource loading
    144    */
    145   async GetExtensionStream(nullable nsIURI uri) returns (nullable nsIInputStream stream);
    146   async GetExtensionFD(nullable nsIURI uri) returns (FileDescriptor fd);
    147 
    148   async InitSocketProcessBridge()
    149     returns (Endpoint<PSocketProcessBridgeChild> endpoint);
    150   async ResetSocketProcessBridge();
    151 
    152   async EnsureHSTSData()
    153     returns (bool result);
    154 
    155   /**
    156    * Page thumbnails remote resource loading
    157    */
    158   async GetPageThumbStream(nullable nsIURI uri, LoadInfoArgs loadInfo) returns (RemoteStreamInfo? info);
    159   async GetPageIconStream(nullable nsIURI uri, LoadInfoArgs loadInfo) returns (RemoteStreamInfo? info);
    160 
    161   /**
    162    * New Tab wallpaper remote resource loading
    163    */
    164   async GetMozNewTabWallpaperStream(nullable nsIURI uri, LoadInfoArgs loadInfo) returns (RemoteStreamInfo? info);
    165 
    166 child:
    167   async SpeculativeConnectRequest();
    168 
    169   // Using medium high priority to deliver this notification possibly sooner than we
    170   // enter poll() on the child process with infinite timeout.
    171   [Priority=mediumhigh] async NetworkChangeNotification(nsCString type);
    172 
    173   async PTransportProvider();
    174 
    175   async SetTRRDomain(nsCString domain);
    176 
    177 both:
    178   // Actually we need PTCPSocket() for parent. But ipdl disallows us having different
    179   // signatures on parent and child. So when constructing the parent side object, we just
    180   // leave host/port unused.
    181   async PTCPSocket(nsString host, uint16_t port);
    182 };
    183 
    184 
    185 } // namespace net
    186 } // namespace mozilla