summaryrefslogtreecommitdiffstats
path: root/netwerk/ipc/PNecko.ipdl
blob: 9eb9b5ca27f2b3883dc375de6bbbe0a6027cbf39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PContent;
include protocol PHttpChannel;
include protocol PCookieService;
include protocol PBrowser;
#ifdef MOZ_WIDGET_GTK
include protocol PGIOChannel;
#endif
include protocol PWebSocket;
include protocol PWebSocketEventListener;
include protocol PTCPSocket;
include protocol PTCPServerSocket;
include protocol PUDPSocket;
include protocol PDNSRequest;
include protocol PDataChannel;
include protocol PSimpleChannel;
include protocol PTransportProvider;
include protocol PStunAddrsRequest;
include protocol PFileChannel;
include protocol PWebrtcTCPSocket;
include protocol PSocketProcessBridge;
include protocol PDocumentChannel;

include IPCStream;
include NeckoChannelParams;
include protocol PAltDataOutputStream;

include "mozilla/dom/PermissionMessageUtils.h";

using mozilla::dom::MaybeDiscardedBrowsingContext from "mozilla/dom/BrowsingContext.h";
using class IPC::SerializedLoadContext from "SerializedLoadContext.h";
using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
using nsIDNSService::DNSFlags from "nsIDNSService.h";
[RefCounted] using class nsIInputStream from "mozilla/ipc/IPCStreamUtils.h";
[RefCounted] using class nsIURI from "mozilla/ipc/URIUtils.h";
[RefCounted] using class nsIPrincipal from "nsIPrincipal.h";


namespace mozilla {
namespace net {

//-------------------------------------------------------------------
[NestedUpTo=inside_cpow] sync protocol PNecko
{
  manager PContent;
  manages PHttpChannel;
  manages PCookieService;
  manages PWebSocket;
  manages PWebSocketEventListener;
  manages PTCPSocket;
  manages PTCPServerSocket;
  manages PUDPSocket;
  manages PDNSRequest;
  manages PDataChannel;
#ifdef MOZ_WIDGET_GTK
  manages PGIOChannel;
#endif
  manages PSimpleChannel;
  manages PFileChannel;
  manages PTransportProvider;
  manages PAltDataOutputStream;
  manages PStunAddrsRequest;
  manages PWebrtcTCPSocket;
  manages PDocumentChannel;

parent:
  async __delete__();

  [Nested=inside_cpow] async PCookieService();
  async PHttpChannel(nullable PBrowser browser,
                     SerializedLoadContext loadContext,
                     HttpChannelCreationArgs args);

  async PWebSocket(nullable PBrowser browser, SerializedLoadContext loadContext,
                   uint32_t aSerialID);
  async PTCPServerSocket(uint16_t localPort, uint16_t backlog, bool useArrayBuffers);
  async PUDPSocket(nullable nsIPrincipal principal, nsCString filter);

  async PDNSRequest(nsCString hostName, nsCString trrServer, int32_t port,
                    uint16_t type, OriginAttributes originAttributes,
                    DNSFlags flags);

  async PDocumentChannel(MaybeDiscardedBrowsingContext browsingContext,
                         DocumentChannelCreationArgs args);

  async PWebSocketEventListener(uint64_t aInnerWindowID);

  /* Predictor Methods */
  async PredPredict(nullable nsIURI targetURI, nullable nsIURI sourceURI,
                    uint32_t reason, OriginAttributes originAttributes,
                    bool hasVerifier);
  async PredLearn(nullable nsIURI targetURI, nullable nsIURI sourceURI,
                  uint32_t reason, OriginAttributes originAttributes);
  async PredReset();

  async SpeculativeConnect(nullable nsIURI uri,
                           nullable nsIPrincipal principal,
                           OriginAttributes? originAttributes,
                           bool anonymous);
  async HTMLDNSPrefetch(nsString hostname, bool isHttps,
                        OriginAttributes originAttributes, DNSFlags flags);
  async CancelHTMLDNSPrefetch(nsString hostname, bool isHttps,
                              OriginAttributes originAttributes,
                              DNSFlags flags, nsresult reason);

  /**
   * channelId is used to establish a connection between redirect channels in
   * the parent and the child when we're redirecting to a data: URI.
   */
  async PDataChannel(uint32_t channelId);
#ifdef MOZ_WIDGET_GTK
  async PGIOChannel(nullable PBrowser browser, SerializedLoadContext loadContext, GIOChannelCreationArgs args);
#endif
  async PSimpleChannel(uint32_t channelId);
  async PFileChannel(uint32_t channelId);

  async RequestContextLoadBegin(uint64_t rcid);
  async RequestContextAfterDOMContentLoaded(uint64_t rcid);
  async RemoveRequestContext(uint64_t rcid);

  async PAltDataOutputStream(nsCString type, int64_t predictedSize, PHttpChannel channel);

  async PStunAddrsRequest();

  /* tabId is only required for web-proxy support, which isn't always needed */
  async PWebrtcTCPSocket(TabId? tabId);

  /**
   * WebExtension-specific remote resource loading
   */
  async GetExtensionStream(nullable nsIURI uri) returns (nullable nsIInputStream stream);
  async GetExtensionFD(nullable nsIURI uri) returns (FileDescriptor fd);

  async InitSocketProcessBridge()
    returns (Endpoint<PSocketProcessBridgeChild> endpoint);
  async ResetSocketProcessBridge();

  async EnsureHSTSData()
    returns (bool result);

  /**
   * Page thumbnails remote resource loading
   */
  async GetPageThumbStream(nullable nsIURI uri, LoadInfoArgs loadInfo) returns (RemoteStreamInfo? info);
  async GetPageIconStream(nullable nsIURI uri, LoadInfoArgs loadInfo) returns (RemoteStreamInfo? info);

child:
  /* Predictor Methods */
  async PredOnPredictPrefetch(nullable nsIURI uri, uint32_t httpStatus);
  async PredOnPredictPreconnect(nullable nsIURI uri);
  async PredOnPredictDNS(nullable nsIURI uri);

  async SpeculativeConnectRequest();

  // Using medium high priority to deliver this notification possibly sooner than we
  // enter poll() on the child process with infinite timeout.
  [Priority=mediumhigh] async NetworkChangeNotification(nsCString type);

  async PTransportProvider();

  async SetTRRDomain(nsCString domain);

both:
  // Actually we need PTCPSocket() for parent. But ipdl disallows us having different
  // signatures on parent and child. So when constructing the parent side object, we just
  // leave host/port unused.
  async PTCPSocket(nsString host, uint16_t port);
};


} // namespace net
} // namespace mozilla