Currently, if users enabled COEP:Credentialless by Origin-Trial,
it won't put the document into an isolated process, this patch
fixes.
Though the caveat is this only works for enabling Origin-Trial
in the response header, setting it via <meta> still won't work.
Differential Revision: https://phabricator.services.mozilla.com/D158684
When a network load needs to be intercepted by ServiceWorker, we extract the Request from the InterceptedHttpChannel, and propagate the Request through FetchEvent.request.
However, some needed information is not extracted or is modified during the Request propagation, so getting the wrong result when using the Request to fetch resources in the ServiceWorker script.
Differential Revision: https://phabricator.services.mozilla.com/D145969
See bug 1787319. Before this change, IPCChannelInfo consisted solely of
`nsCString securityInfo`. Now, instead of using IPCChannelInfo,
nsITransportSecurityInfo is used directly.
Differential Revision: https://phabricator.services.mozilla.com/D156607
Set the Content-Type to an empty string for an blob when the type was not
given. Ensure that the channel Content-Type is not overriden in the case
that it was previously set and the blob type is not valid.
Depends on D147568
Differential Revision: https://phabricator.services.mozilla.com/D147481
Since https://github.com/w3c/FileAPI/issues/43 is still open, it is unclear how body.type should work.
The current wpts expect some behavior which isn't in the specifications.
So, since the situation is very messy in the specifications, the patch is doing a
spot fix for boundary handling. It is ugly, but shouldn't change other behavior.
Differential Revision: https://phabricator.services.mozilla.com/D150018
Spec: https://fetch.spec.whatwg.org/#ref-for-cross-origin-resource-policy-internal-check
This purpose of this patch is just to implement the spec.
One noticeable thing I did in the patch is I made `CacheResponse` to
include the `credentials mode` of the initial request. Consider the
below scenario:
1. Create a fetch request with a URL and a specific credential_mode, and put it into cache
2. Call cache.match by using a URL, but without credential_mode
3. cache.match() result should be filtered according to the initial request's credential_mode
When applying the `response’s request-includes-credentials is true`
check, the initial request's `credential_mode` is needed because
`request-includes-credentials` is judged by the `credential_mode`.
The rest of the changes are just normal spec alignments.
Differential Revision: https://phabricator.services.mozilla.com/D147803
Spec: https://fetch.spec.whatwg.org/#ref-for-cross-origin-resource-policy-internal-check
This purpose of this patch is just to implement the spec.
One noticeable thing I did in the patch is I made `CacheResponse` to
include the `credentials mode` of the initial request. Consider the
below scenario:
1. Create a fetch request with a URL and a specific credential_mode, and put it into cache
2. Call cache.match by using a URL, but without credential_mode
3. cache.match() result should be filtered according to the initial request's credential_mode
When applying the `response’s request-includes-credentials is true`
check, the initial request's `credential_mode` is needed because
`request-includes-credentials` is judged by the `credential_mode`.
The rest of the changes are just normal spec alignments.
Differential Revision: https://phabricator.services.mozilla.com/D147803
Spec: https://fetch.spec.whatwg.org/#ref-for-cross-origin-resource-policy-internal-check
This purpose of this patch is just to implement the spec.
One noticeable thing I did in the patch is I made `CacheResponse` to
include the `credentials mode` of the initial request. Consider the
below scenario:
1. Create a fetch request with a URL and a specific credential_mode, and put it into cache
2. Call cache.match by using a URL, but without credential_mode
3. cache.match() result should be filtered according to the initial request's credential_mode
When applying the `response’s request-includes-credentials is true`
check, the initial request's `credential_mode` is needed because
`request-includes-credentials` is judged by the `credential_mode`.
The rest of the changes are just normal spec alignments.
Differential Revision: https://phabricator.services.mozilla.com/D147803
This patch is more conservative for requests initiated by add-on and prefers
to send no Origin header instead of Origin: null.
Differential Revision: https://phabricator.services.mozilla.com/D147091
As serializing IPCStream no longer requires a manager or FileDescriptor array,
the arguments are no longer necessary, and can be removed. The AutoIPCStream
helper can also be removed, as managed actors are no longer used for
serialization, so a delayed start callback is not necessary.
The delayed start parameter is also removed from nsIIPCSerializableInputStream
instances, but is still present as `aAllowLazy` on the toplevel serialization
methods.
Differential Revision: https://phabricator.services.mozilla.com/D141048
This is a complete rewrite of RemoteLazyInputStream to run off of its own
toplevel protocol, rather than being managed by other protocols like
PBackground or PContent. This should improve performance thanks to no longer
needing to operate on a main or worker thread, and due to no longer needing the
migration step for the stream actor.
This also acts as a step towards no longer requiring a manager actor to
serialize input streams, as the type is now actor-agnostic, and should support
being sent over IPC between any pair of processes.
Differential Revision: https://phabricator.services.mozilla.com/D141040
In the previous implementation, FetchEvent.preloadResponse is resolved when the response fetching finishes.
However, ServiceWorker responding letency could be increased since waiting for preloadResponse finishes.
The patch resolves FetchEvent.preloadResponse earlier when the response is available.
The basic idea is to resolve the preload response when FetchInstance::OnResponseAvailableInternal() is called.
Then propagating the response from the parent process main thread to the content process worker thread. This is achieved by IPC PFetchEventOp::Send/RecvPreloadResponse -> PFetchEventOpProxy::Send/RecvPreloadResponse.
Since we can only get the response's ResourceTiming when FetchInstance::OnResponseEnd() is called. This patch introduces a new IPC method to propagate the ResourceTiming information from the parent process main thread to the content process worker thread.
PFetchEventOp::Send/RecvPreloadResponseEnd -> PFetchEventOpProxy->Send/RecvPreloadResponseEnd.
The tricky of this patch is we must extend the life cycle of FetchEventOp object if preloadResponse is set into FetchEvent.
That because ServiceWorker could resolve FetchEvent.respondWith() by using FetchEvent.preloadResponse.
In that case, FetchEventOp will get into a finish state and try to call FetchEventOpProxyChild::Senddelete with the operation result.
However, the ResponseEnd could not be called at the moment, and we need to wait for the corresponding timing information and its end reason.
To extend the life cycle of FetchEventOp, this patch cached the operation result while we get FetchEventOp::Callback is called. Then call FetchEventOpProxyChile::Senddelete() in FetchEventOpProxyChild::RecvPreloadResponseEnd() to close IPC. Or Senddelete() will be called while ActorDestroy() caused by shutdown.
Differential Revision: https://phabricator.services.mozilla.com/D145338
As serializing IPCStream no longer requires a manager or FileDescriptor array,
the arguments are no longer necessary, and can be removed. The AutoIPCStream
helper can also be removed, as managed actors are no longer used for
serialization, so a delayed start callback is not necessary.
The delayed start parameter is also removed from nsIIPCSerializableInputStream
instances, but is still present as `aAllowLazy` on the toplevel serialization
methods.
Differential Revision: https://phabricator.services.mozilla.com/D141048
This is a complete rewrite of RemoteLazyInputStream to run off of its own
toplevel protocol, rather than being managed by other protocols like
PBackground or PContent. This should improve performance thanks to no longer
needing to operate on a main or worker thread, and due to no longer needing the
migration step for the stream actor.
This also acts as a step towards no longer requiring a manager actor to
serialize input streams, as the type is now actor-agnostic, and should support
being sent over IPC between any pair of processes.
Differential Revision: https://phabricator.services.mozilla.com/D141040