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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 "InternalRequest.h"
#include "InternalResponse.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/FetchTypes.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/WorkerCommon.h"
#include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/RemoteLazyInputStreamChild.h"
#include "nsIContentPolicy.h"
#include "nsStreamUtils.h"
namespace mozilla::dom {
// The global is used to extract the principal.
SafeRefPtr<InternalRequest> InternalRequest::GetRequestConstructorCopy(
nsIGlobalObject* aGlobal, ErrorResult& aRv) const {
MOZ_RELEASE_ASSERT(!mURLList.IsEmpty(),
"Internal Request's urlList should not be empty when "
"copied from constructor.");
auto copy =
MakeSafeRefPtr<InternalRequest>(mURLList.LastElement(), mFragment);
copy->SetMethod(mMethod);
copy->mHeaders = new InternalHeaders(*mHeaders);
copy->SetUnsafeRequest();
copy->mBodyStream = mBodyStream;
copy->mBodyLength = mBodyLength;
// The "client" is not stored in our implementation. Fetch API users should
// use the appropriate window/document/principal and other Gecko security
// mechanisms as appropriate.
copy->mReferrer = mReferrer;
copy->mReferrerPolicy = mReferrerPolicy;
copy->mEnvironmentReferrerPolicy = mEnvironmentReferrerPolicy;
copy->mIntegrity = mIntegrity;
copy->mMozErrors = mMozErrors;
copy->mContentPolicyType = mContentPolicyTypeOverridden
? mContentPolicyType
: nsIContentPolicy::TYPE_FETCH;
copy->mMode = mMode;
copy->mCredentialsMode = mCredentialsMode;
copy->mCacheMode = mCacheMode;
copy->mRedirectMode = mRedirectMode;
copy->mPriorityMode = mPriorityMode;
copy->mContentPolicyTypeOverridden = mContentPolicyTypeOverridden;
copy->mPreferredAlternativeDataType = mPreferredAlternativeDataType;
copy->mSkipWasmCaching = mSkipWasmCaching;
copy->mEmbedderPolicy = mEmbedderPolicy;
return copy;
}
SafeRefPtr<InternalRequest> InternalRequest::Clone() {
auto clone = MakeSafeRefPtr<InternalRequest>(*this, ConstructorGuard{});
if (!mBodyStream) {
return clone;
}
nsCOMPtr<nsIInputStream> clonedBody;
nsCOMPtr<nsIInputStream> replacementBody;
nsresult rv = NS_CloneInputStream(mBodyStream, getter_AddRefs(clonedBody),
getter_AddRefs(replacementBody));
if (NS_WARN_IF(NS_FAILED(rv))) {
return nullptr;
}
clone->mBodyStream.swap(clonedBody);
if (replacementBody) {
mBodyStream.swap(replacementBody);
}
return clone;
}
InternalRequest::InternalRequest(const nsACString& aURL,
const nsACString& aFragment)
: mMethod("GET"),
mHeaders(new InternalHeaders(HeadersGuardEnum::None)),
mBodyLength(InternalResponse::UNKNOWN_BODY_SIZE),
mContentPolicyType(nsIContentPolicy::TYPE_FETCH),
mReferrer(NS_LITERAL_STRING_FROM_CSTRING(kFETCH_CLIENT_REFERRER_STR)),
mReferrerPolicy(ReferrerPolicy::_empty),
mEnvironmentReferrerPolicy(ReferrerPolicy::_empty),
mMode(RequestMode::No_cors),
mCredentialsMode(RequestCredentials::Omit),
mCacheMode(RequestCache::Default),
mRedirectMode(RequestRedirect::Follow),
mPriorityMode(RequestPriority::Auto) {
MOZ_ASSERT(!aURL.IsEmpty());
AddURL(aURL, aFragment);
}
InternalRequest::InternalRequest(
const nsACString& aURL, const nsACString& aFragment,
const nsACString& aMethod, already_AddRefed<InternalHeaders> aHeaders,
RequestCache aCacheMode, RequestMode aMode,
RequestRedirect aRequestRedirect, RequestCredentials aRequestCredentials,
const nsAString& aReferrer, ReferrerPolicy aReferrerPolicy,
RequestPriority aPriority, nsContentPolicyType aContentPolicyType,
const nsAString& aIntegrity)
: mMethod(aMethod),
mHeaders(aHeaders),
mBodyLength(InternalResponse::UNKNOWN_BODY_SIZE),
mContentPolicyType(aContentPolicyType),
mReferrer(aReferrer),
mReferrerPolicy(aReferrerPolicy),
mEnvironmentReferrerPolicy(ReferrerPolicy::_empty),
mMode(aMode),
mCredentialsMode(aRequestCredentials),
mCacheMode(aCacheMode),
mRedirectMode(aRequestRedirect),
mPriorityMode(aPriority),
mIntegrity(aIntegrity) {
MOZ_ASSERT(!aURL.IsEmpty());
AddURL(aURL, aFragment);
}
InternalRequest::InternalRequest(const InternalRequest& aOther,
ConstructorGuard)
: mMethod(aOther.mMethod),
mURLList(aOther.mURLList.Clone()),
mHeaders(new InternalHeaders(*aOther.mHeaders)),
mBodyLength(InternalResponse::UNKNOWN_BODY_SIZE),
mContentPolicyType(aOther.mContentPolicyType),
mReferrer(aOther.mReferrer),
mReferrerPolicy(aOther.mReferrerPolicy),
mEnvironmentReferrerPolicy(aOther.mEnvironmentReferrerPolicy),
mMode(aOther.mMode),
mCredentialsMode(aOther.mCredentialsMode),
mResponseTainting(aOther.mResponseTainting),
mCacheMode(aOther.mCacheMode),
mRedirectMode(aOther.mRedirectMode),
mPriorityMode(aOther.mPriorityMode),
mIntegrity(aOther.mIntegrity),
mMozErrors(aOther.mMozErrors),
mFragment(aOther.mFragment),
mSkipServiceWorker(aOther.mSkipServiceWorker),
mSkipWasmCaching(aOther.mSkipWasmCaching),
mSynchronous(aOther.mSynchronous),
mUnsafeRequest(aOther.mUnsafeRequest),
mUseURLCredentials(aOther.mUseURLCredentials),
mContentPolicyTypeOverridden(aOther.mContentPolicyTypeOverridden),
mEmbedderPolicy(aOther.mEmbedderPolicy),
mInterceptionContentPolicyType(aOther.mInterceptionContentPolicyType),
mInterceptionRedirectChain(aOther.mInterceptionRedirectChain),
mInterceptionFromThirdParty(aOther.mInterceptionFromThirdParty) {
// NOTE: does not copy body stream... use the fallible Clone() for that
if (aOther.GetInterceptionTriggeringPrincipalInfo()) {
mInterceptionTriggeringPrincipalInfo =
MakeUnique<mozilla::ipc::PrincipalInfo>(
*(aOther.GetInterceptionTriggeringPrincipalInfo().get()));
}
}
InternalRequest::InternalRequest(const IPCInternalRequest& aIPCRequest)
: mMethod(aIPCRequest.method()),
mURLList(aIPCRequest.urlList().Clone()),
mHeaders(new InternalHeaders(aIPCRequest.headers(),
aIPCRequest.headersGuard())),
mBodyLength(aIPCRequest.bodySize()),
mPreferredAlternativeDataType(aIPCRequest.preferredAlternativeDataType()),
mContentPolicyType(
static_cast<nsContentPolicyType>(aIPCRequest.contentPolicyType())),
mReferrer(aIPCRequest.referrer()),
mReferrerPolicy(aIPCRequest.referrerPolicy()),
mEnvironmentReferrerPolicy(aIPCRequest.environmentReferrerPolicy()),
mMode(aIPCRequest.requestMode()),
mCredentialsMode(aIPCRequest.requestCredentials()),
mCacheMode(aIPCRequest.cacheMode()),
mRedirectMode(aIPCRequest.requestRedirect()),
mIntegrity(aIPCRequest.integrity()),
mFragment(aIPCRequest.fragment()),
mEmbedderPolicy(aIPCRequest.embedderPolicy()),
mInterceptionContentPolicyType(static_cast<nsContentPolicyType>(
aIPCRequest.interceptionContentPolicyType())),
mInterceptionRedirectChain(aIPCRequest.interceptionRedirectChain()),
mInterceptionFromThirdParty(aIPCRequest.interceptionFromThirdParty()) {
if (aIPCRequest.principalInfo()) {
mPrincipalInfo = MakeUnique<mozilla::ipc::PrincipalInfo>(
aIPCRequest.principalInfo().ref());
}
if (aIPCRequest.interceptionTriggeringPrincipalInfo()) {
mInterceptionTriggeringPrincipalInfo =
MakeUnique<mozilla::ipc::PrincipalInfo>(
aIPCRequest.interceptionTriggeringPrincipalInfo().ref());
}
const Maybe<BodyStreamVariant>& body = aIPCRequest.body();
if (body) {
if (body->type() == BodyStreamVariant::TParentToChildStream) {
mBodyStream = body->get_ParentToChildStream().get_RemoteLazyInputStream();
}
if (body->type() == BodyStreamVariant::TChildToParentStream) {
mBodyStream =
DeserializeIPCStream(body->get_ChildToParentStream().stream());
}
}
}
void InternalRequest::ToIPCInternalRequest(
IPCInternalRequest* aIPCRequest, mozilla::ipc::PBackgroundChild* aManager) {
aIPCRequest->method() = mMethod;
for (const auto& url : mURLList) {
aIPCRequest->urlList().AppendElement(url);
}
mHeaders->ToIPC(aIPCRequest->headers(), aIPCRequest->headersGuard());
aIPCRequest->bodySize() = mBodyLength;
aIPCRequest->preferredAlternativeDataType() = mPreferredAlternativeDataType;
aIPCRequest->contentPolicyType() = mContentPolicyType;
aIPCRequest->referrer() = mReferrer;
aIPCRequest->referrerPolicy() = mReferrerPolicy;
aIPCRequest->environmentReferrerPolicy() = mEnvironmentReferrerPolicy;
aIPCRequest->requestMode() = mMode;
aIPCRequest->requestCredentials() = mCredentialsMode;
aIPCRequest->cacheMode() = mCacheMode;
aIPCRequest->requestRedirect() = mRedirectMode;
aIPCRequest->integrity() = mIntegrity;
aIPCRequest->fragment() = mFragment;
aIPCRequest->embedderPolicy() = mEmbedderPolicy;
if (mPrincipalInfo) {
aIPCRequest->principalInfo() = Some(*mPrincipalInfo);
}
if (mBodyStream) {
nsCOMPtr<nsIInputStream> body = mBodyStream;
aIPCRequest->body().emplace(ChildToParentStream());
DebugOnly<bool> ok = mozilla::ipc::SerializeIPCStream(
body.forget(), aIPCRequest->body()->get_ChildToParentStream().stream(),
/* aAllowLazy */ false);
MOZ_ASSERT(ok);
}
}
InternalRequest::~InternalRequest() = default;
void InternalRequest::SetContentPolicyType(
nsContentPolicyType aContentPolicyType) {
mContentPolicyType = aContentPolicyType;
}
void InternalRequest::OverrideContentPolicyType(
nsContentPolicyType aContentPolicyType) {
SetContentPolicyType(aContentPolicyType);
mContentPolicyTypeOverridden = true;
}
void InternalRequest::SetInterceptionContentPolicyType(
nsContentPolicyType aContentPolicyType) {
mInterceptionContentPolicyType = aContentPolicyType;
}
/* static */
RequestDestination InternalRequest::MapContentPolicyTypeToRequestDestination(
nsContentPolicyType aContentPolicyType) {
switch (aContentPolicyType) {
case nsIContentPolicy::TYPE_OTHER:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_INTERNAL_SCRIPT:
case nsIContentPolicy::TYPE_INTERNAL_SCRIPT_PRELOAD:
case nsIContentPolicy::TYPE_INTERNAL_MODULE:
case nsIContentPolicy::TYPE_INTERNAL_MODULE_PRELOAD:
case nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER:
case nsIContentPolicy::TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS:
case nsIContentPolicy::TYPE_INTERNAL_CHROMEUTILS_COMPILED_SCRIPT:
case nsIContentPolicy::TYPE_INTERNAL_FRAME_MESSAGEMANAGER_SCRIPT:
case nsIContentPolicy::TYPE_SCRIPT:
return RequestDestination::Script;
case nsIContentPolicy::TYPE_INTERNAL_WORKER:
case nsIContentPolicy::TYPE_INTERNAL_WORKER_STATIC_MODULE:
return RequestDestination::Worker;
case nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER:
return RequestDestination::Sharedworker;
case nsIContentPolicy::TYPE_IMAGESET:
case nsIContentPolicy::TYPE_INTERNAL_IMAGE:
case nsIContentPolicy::TYPE_INTERNAL_IMAGE_PRELOAD:
case nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON:
case nsIContentPolicy::TYPE_IMAGE:
return RequestDestination::Image;
case nsIContentPolicy::TYPE_STYLESHEET:
case nsIContentPolicy::TYPE_INTERNAL_STYLESHEET:
case nsIContentPolicy::TYPE_INTERNAL_STYLESHEET_PRELOAD:
return RequestDestination::Style;
case nsIContentPolicy::TYPE_OBJECT:
case nsIContentPolicy::TYPE_INTERNAL_OBJECT:
return RequestDestination::Object;
case nsIContentPolicy::TYPE_INTERNAL_EMBED:
return RequestDestination::Embed;
case nsIContentPolicy::TYPE_DOCUMENT:
return RequestDestination::Document;
case nsIContentPolicy::TYPE_SUBDOCUMENT:
case nsIContentPolicy::TYPE_INTERNAL_IFRAME:
return RequestDestination::Iframe;
case nsIContentPolicy::TYPE_INTERNAL_FRAME:
return RequestDestination::Frame;
case nsIContentPolicy::TYPE_PING:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_XMLHTTPREQUEST:
case nsIContentPolicy::TYPE_INTERNAL_XMLHTTPREQUEST:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_INTERNAL_EVENTSOURCE:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_OBJECT_SUBREQUEST:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_DTD:
case nsIContentPolicy::TYPE_INTERNAL_DTD:
case nsIContentPolicy::TYPE_INTERNAL_FORCE_ALLOWED_DTD:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_FONT:
case nsIContentPolicy::TYPE_INTERNAL_FONT_PRELOAD:
case nsIContentPolicy::TYPE_UA_FONT:
return RequestDestination::Font;
case nsIContentPolicy::TYPE_MEDIA:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_INTERNAL_AUDIO:
return RequestDestination::Audio;
case nsIContentPolicy::TYPE_INTERNAL_VIDEO:
return RequestDestination::Video;
case nsIContentPolicy::TYPE_INTERNAL_TRACK:
return RequestDestination::Track;
case nsIContentPolicy::TYPE_WEBSOCKET:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_CSP_REPORT:
return RequestDestination::Report;
case nsIContentPolicy::TYPE_XSLT:
return RequestDestination::Xslt;
case nsIContentPolicy::TYPE_BEACON:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_FETCH:
case nsIContentPolicy::TYPE_INTERNAL_FETCH_PRELOAD:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_WEB_MANIFEST:
return RequestDestination::Manifest;
case nsIContentPolicy::TYPE_SAVEAS_DOWNLOAD:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_SPECULATIVE:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_INTERNAL_AUDIOWORKLET:
return RequestDestination::Audioworklet;
case nsIContentPolicy::TYPE_INTERNAL_PAINTWORKLET:
return RequestDestination::Paintworklet;
case nsIContentPolicy::TYPE_PROXIED_WEBRTC_MEDIA:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_WEB_IDENTITY:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_WEB_TRANSPORT:
return RequestDestination::_empty;
case nsIContentPolicy::TYPE_INVALID:
case nsIContentPolicy::TYPE_END:
break;
// Do not add default: so that compilers can catch the missing case.
}
MOZ_ASSERT(false, "Unhandled nsContentPolicyType value");
return RequestDestination::_empty;
}
// static
bool InternalRequest::IsNavigationContentPolicy(
nsContentPolicyType aContentPolicyType) {
// https://fetch.spec.whatwg.org/#navigation-request-context
//
// A navigation request context is one of "form", "frame", "hyperlink",
// "iframe", "internal" (as long as context frame type is not "none"),
// "location", "metarefresh", and "prerender".
//
// Note, all of these request types are effectively initiated by nsDocShell.
return aContentPolicyType == nsIContentPolicy::TYPE_DOCUMENT ||
aContentPolicyType == nsIContentPolicy::TYPE_SUBDOCUMENT ||
aContentPolicyType == nsIContentPolicy::TYPE_INTERNAL_FRAME ||
aContentPolicyType == nsIContentPolicy::TYPE_INTERNAL_IFRAME;
}
// static
bool InternalRequest::IsWorkerContentPolicy(
nsContentPolicyType aContentPolicyType) {
// https://fetch.spec.whatwg.org/#worker-request-context
//
// A worker request context is one of "serviceworker", "sharedworker", and
// "worker".
//
// Note, service workers are not included here because currently there is
// no way to generate a Request with a "serviceworker" RequestDestination.
// ServiceWorker scripts cannot be intercepted.
return aContentPolicyType == nsIContentPolicy::TYPE_INTERNAL_WORKER ||
aContentPolicyType == nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER;
}
bool InternalRequest::IsNavigationRequest() const {
return IsNavigationContentPolicy(mContentPolicyType);
}
bool InternalRequest::IsWorkerRequest() const {
return IsWorkerContentPolicy(mContentPolicyType);
}
bool InternalRequest::IsClientRequest() const {
return IsNavigationRequest() || IsWorkerRequest();
}
// static
RequestMode InternalRequest::MapChannelToRequestMode(nsIChannel* aChannel) {
MOZ_ASSERT(aChannel);
nsCOMPtr<nsILoadInfo> loadInfo = aChannel->LoadInfo();
nsContentPolicyType contentPolicy = loadInfo->InternalContentPolicyType();
if (IsNavigationContentPolicy(contentPolicy)) {
return RequestMode::Navigate;
}
// TODO: remove the worker override once securityMode is fully implemented
// (bug 1189945)
if (IsWorkerContentPolicy(contentPolicy)) {
return RequestMode::Same_origin;
}
uint32_t securityMode = loadInfo->GetSecurityMode();
switch (securityMode) {
case nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_INHERITS_SEC_CONTEXT:
case nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED:
return RequestMode::Same_origin;
case nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_INHERITS_SEC_CONTEXT:
case nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL:
return RequestMode::No_cors;
case nsILoadInfo::SEC_REQUIRE_CORS_INHERITS_SEC_CONTEXT:
// TODO: Check additional flag force-preflight after bug 1199693 (bug
// 1189945)
return RequestMode::Cors;
default:
MOZ_ASSERT_UNREACHABLE("Unexpected security mode!");
return RequestMode::Same_origin;
}
}
// static
RequestCredentials InternalRequest::MapChannelToRequestCredentials(
nsIChannel* aChannel) {
MOZ_ASSERT(aChannel);
nsCOMPtr<nsILoadInfo> loadInfo = aChannel->LoadInfo();
uint32_t cookiePolicy = loadInfo->GetCookiePolicy();
if (cookiePolicy == nsILoadInfo::SEC_COOKIES_INCLUDE) {
return RequestCredentials::Include;
} else if (cookiePolicy == nsILoadInfo::SEC_COOKIES_OMIT) {
return RequestCredentials::Omit;
} else if (cookiePolicy == nsILoadInfo::SEC_COOKIES_SAME_ORIGIN) {
return RequestCredentials::Same_origin;
}
MOZ_ASSERT_UNREACHABLE("Unexpected cookie policy!");
return RequestCredentials::Same_origin;
}
void InternalRequest::MaybeSkipCacheIfPerformingRevalidation() {
if (mCacheMode == RequestCache::Default &&
mHeaders->HasRevalidationHeaders()) {
mCacheMode = RequestCache::No_store;
}
}
void InternalRequest::SetPrincipalInfo(
UniquePtr<mozilla::ipc::PrincipalInfo> aPrincipalInfo) {
mPrincipalInfo = std::move(aPrincipalInfo);
}
void InternalRequest::SetInterceptionTriggeringPrincipalInfo(
UniquePtr<mozilla::ipc::PrincipalInfo> aPrincipalInfo) {
mInterceptionTriggeringPrincipalInfo = std::move(aPrincipalInfo);
}
} // namespace mozilla::dom
|