Backed out 6 changesets (bug 1876574, bug 1876575) for causing multiple failures...
[gecko.git] / dom / workers / remoteworkers / RemoteWorkerTypes.ipdlh
blob8894450b72ba6f8e017666bfd23c96b24e7d245e
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 file,
3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 include ClientIPCTypes;
6 include IPCServiceWorkerDescriptor;
7 include IPCServiceWorkerRegistrationDescriptor;
8 include PBackgroundSharedTypes;
9 include URIParams;
10 include DOMTypes;
11 include NeckoChannelParams;
12 include ProtocolTypes;
14 include "mozilla/dom/ClientIPCUtils.h";
15 include "mozilla/dom/ReferrerInfoUtils.h";
16 include "mozilla/dom/WorkerIPCUtils.h";
18 using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";
19 using mozilla::dom::RequestCredentials from "mozilla/dom/RequestBinding.h";
20 using mozilla::StorageAccess from "mozilla/StorageAccess.h";
21 using mozilla::OriginTrials from "mozilla/OriginTrialsIPCUtils.h";
22 using mozilla::dom::WorkerType from "mozilla/dom/WorkerBinding.h";
24 namespace mozilla {
25 namespace dom {
27 struct ServiceWorkerData {
28   IPCServiceWorkerDescriptor descriptor;
29   IPCServiceWorkerRegistrationDescriptor registrationDescriptor;
30   nsString cacheName;
31   uint32_t loadFlags;
32   nsString id;
35 union OptionalServiceWorkerData {
36   void_t;
37   ServiceWorkerData;
40 struct RemoteWorkerData
42   // This should only be used for devtools.
43   nsString originalScriptURL;
45   // It is important to pass these as URIParams instead of strings for blob
46   // URLs: they carry an additional bit of state with them (mIsRevoked) that
47   // gives us a chance to use them, even after they've been revoked. Because
48   // we're asynchronously calling into the parent process before potentially
49   // loading the worker, it is important to keep this state. Note that this
50   // isn't a panacea: once the URL has been revoked, it'll give the worker 5
51   // seconds to actually load it; so it's possible to still fail to load the
52   // blob URL if it takes too long to do the round trip.
53   URIParams baseScriptURL;
54   URIParams resolvedScriptURL;
56   nsString name;
57   WorkerType type;
58   RequestCredentials credentials;
60   PrincipalInfo loadingPrincipalInfo;
61   PrincipalInfo principalInfo;
62   PrincipalInfo partitionedPrincipalInfo;
64   bool useRegularPrincipal;
65   bool usingStorageAccess;
67   CookieJarSettingsArgs cookieJarSettings;
69   nsCString domain;
71   bool isSecureContext;
73   IPCClientInfo? clientInfo;
75   nullable nsIReferrerInfo referrerInfo;
77   StorageAccess storageAccess;
79   bool isThirdPartyContextToTopWindow;
81   bool shouldResistFingerprinting;
83   uint64_t? overriddenFingerprintingSettings;
85   OriginTrials originTrials;
87   OptionalServiceWorkerData serviceWorkerData;
89   nsID agentClusterId;
91   // Child process remote type where the worker should only run on.
92   nsCString remoteType;
95 // ErrorData/ErrorDataNote correspond to WorkerErrorReport/WorkerErrorNote
96 // which in turn correspond to JSErrorReport/JSErrorNotes which allows JS to
97 // report complicated errors such as redeclarations that involve multiple
98 // distinct lines.  For more generic error-propagation IPC structures, see bug
99 // 1357463 on making ErrorResult usable over IPC.
101 struct ErrorDataNote {
102   uint32_t lineNumber;
103   uint32_t columnNumber;
104   nsString message;
105   nsString filename;
108 struct ErrorData {
109   bool isWarning;
110   uint32_t lineNumber;
111   uint32_t columnNumber;
112   nsString message;
113   nsString filename;
114   nsString line;
115   ErrorDataNote[] notes;
118 struct CSPViolation {
119   nsString json;
122 union ErrorValue {
123   nsresult;
124   ErrorData;
125   CSPViolation;
126   void_t;
129 } // namespace dom
130 } // namespace mozilla