This issue is triggered by off-main-thread ODA listener that return error cause from OnDataAvailable callback.
A CancelEvent will be prepend to event queue and trigger race condition between CompleteResume and EndForceEnqueueing.
The `mFlushing` is checked and set in separate critical sections, therefore two threads that executing MayFlushQueue
might both pass the `mFlushing` check and trying to call FlushQueue simultaneously.
The solution is to check and set `mFlushing` in single critical section, so we can guarantee that only one FlushQueue
can be executed at anytime.
In addition, resumption is postponed until no AutoEventEnqueuer is activated. Therefore, CompleteResume will only be
triggered while all the suspension requests and auto enqueue requests are finished.
MozReview-Commit-ID: HpxzgUqYm8C
--HG--
extra : rebase_source : 9be0d37bb4475a0817dafb6270585263160a9da1
The SyntheticDiversionListener needs to handle the case where the IPC
connection is gone. This patch avoids calling Send* methods which will
crash the content process if the actor has already been destroyed.
Additionally, OnDataAvailable will return an error in such a case so
that the caller can properly handle the error rather than continuing to
attempt to send data to a listener that doesn't care. This latter
change is an artifact of a previous hack attempt to fix a related
diversion issue that is probably not required for this stack, but makes
sense as a fix, so I've left it in.
--HG--
extra : rebase_source : 824d4ab64e92ebb04d8d1ecd4df6d03a2cb37d2f
The diversion mechanism never expected to be dealing with data sourced
from the content process, but that's exactly what happens with
ServiceWorker-intercepted channels with the current child-intercept
situation (which is being fixed).
In order to allow timely cancellation of diverted intercepted
channels, there needs to be a way to relay to the HttpChannelChild
that it needs to be canceled so that the synthesized pump can be
canceled and diversion can be marked as complete. This patch adds
such a mechanism to ADivertableParentChannel and PHttpChannel for the
exclusive use of InterceptedHttpChannel and then uses it.
--HG--
extra : rebase_source : 59d3aa5e541d2a404c6320ae9fce03e7c9cd8b81
Diversion for intercepted channels with a synthesized response is a
special case. It is not appropriate to send DivertComplete when
mEventQ has been drained, because we are not dealing with the usual
mEventQ-enqueued OnDataAvailable payloads that had been received over
the network and sent down to the child. In this case, all the data
originates in the child and does not go through mEventQ. As such,
the correct place to send DivertComplete is at OnStopComplete for the
synthesized response.
--HG--
extra : rebase_source : 2209c25ad6f2b5655728d8dc07ef7f8b64df6ea6
The aim of this patch is to send trailers to child process via SendOnStopRequest.
--HG--
extra : rebase_source : 1a5e16e140ef20cfe2e723c3800d7feeebd9a5af
This patch includes:
1. Save http trailers in the header array in chunk decoder.
2. Take trailers from chunk decoder in OnStopRequest().
3. Add serverTiming attribute in nsITimedChannel.
4. Parse server timing header when GetServerTiming() is called.
--HG--
extra : rebase_source : 77c92b8a31d3d7eebb33aea266888f944af33327
1. Add a helper function Tokenize() which is able to handle quoted-string and quoted-pair.
2. Modify ParsedHeaderValueListList
- Use Tokenize() to split string by ','.
3. Modify ParsedHeaderValueList
- Use Tokenize() to split string by ';'.
- Function ParseNameAndValue() is for getting name and value from the string containing '='.
4. Handle backslash escapes for quoted string.
5. Reuse ParsedHeaderValueListList to parse server-timing header.
--HG--
extra : rebase_source : 7802a1ae9a6410c4ea992b1197018c5a3f994fa0
1. Create a new telemetry scalar SW_ALTERNATIVE_BODY_USED_COUNT to count the
number of the alternative body used in service worker synthesized channels.
2. To report values of fetching related time of InterceptChannel according to
the detail subresource type. Now subresource/script, subresource/other,
subresource/image and subresource/stylesheet are provided, and keep using
subresource for other types.
If UnknowDecoder is involved and the received content is short we will know whether we need to divert to parent only after OnStartRequest of the listener chain is called. Therefore do not do cleanup if we detect diversion.
This test is aimed to check whether the order that http server gets requests is the same as the order in the client's pending queue.
However, even if the transactions are dispatched according to the order in pending queue, it doesn't mean the server can get the request in the same order.
This is because the transaction is really dispatched to a connection when nsHalfOpenSocket::OnOutputStreamReady() is called. The order may not be always the same as the pending queue.
Hence, this patch processes the dummy http request once at the time when the previous request's OnStopRequest() is called. This can force the client dispatch only one transaction at the time and make the behavior of this test more predictable.
--HG--
extra : rebase_source : 5f4631ecabdf1f36352a80fbe1939b54348ab682
Initialize in advance all security services whose initialization on background thread could cause a deadlock.
--HG--
extra : rebase_source : 399f9acf736f9a06665d45a71b354076c1b85fa6
In our test script we set the unload handler on the inner iframe earlier than the page is loaded, therefore it pass the origin check since the contentWindow object is for about:blank.
Security error will raise if the OnStartRequest for that iframe is received beforehand.
Use about:blank can guarantee to have same-origin window on the inner iframe.
MozReview-Commit-ID: 8AiwGIfoF4
--HG--
extra : rebase_source : cfad1803a61719470f8240700ac917c4931e3dfe
* adds MOZ_MUST_USE to C++ methods and [must_use] to idl interfaces
* Rearranges the code so it's more readable, and it fits within 80 chars
* Fixes indentation in BaseURIMutator
MozReview-Commit-ID: 3vG5eVaOC9U
--HG--
extra : rebase_source : df3b1120ba71a83adb41852e9003ef08af98b662
* nsResolveHostCallback extends nsISupports (for addref-ing and because nsDNSAsyncRequest implements nsICancelable)
* nsResolveHostCallback extends LinkedListElement<RefPtr<nsResolveHostCallback>> so the list can properly manage references
* nsDNSAsyncRequest and nsDNSSyncRequest properly implement nsISupports and use RefPtr to manage lifetimes
MozReview-Commit-ID: 5NvBcWZzfyN
--HG--
extra : rebase_source : d8c5c89c35e455c5d8e6556a140a0ef119b95e86