This patch introduces:
- a second nsICancelable out param in nsBaseChannel::BeginAsyncRead, which is meant to be non-null
when the subclass is unable to set the nsIRequest out param right away (e.g because there is
some async work needed before the subclass is able to get an nsIRequest instance).
The nsICancelable does only allow the channel to cancel the underlying request (and stream pump),
but it doesn't allow the channel to be suspended and resumed, but that was already the case
for the subclasses that were already not returning an nsIRequest instance (e.g. like the
ExtensionProtocolHandler was doing when it is asynchrously retriving a stream from the parent
process).
- require NotNull<nsCOMPtr<...>> in the SimpleChannel's BeginAsyncRead callback signature, to make harder
to overlook the requirement of returning an nsIRequest or nsICancelable.
- a diagnostic assertion (from SimpleChannel's BeginAsyncRead method) to more visible fail if we still end
up with neither an nsIRequest or nsICancelable result as SimpleChannel callback result.
- changes to ExtensionProtocolHandler, PageThumbProtocolHandler and nsAnnoProtocolHandler to adapt them
to the new nsBaseChannel::BeginAsyncRead signature.
Differential Revision: https://phabricator.services.mozilla.com/D125545
This was done automatically replacing:
s/mozilla::Move/std::move/
s/ Move(/ std::move(/
s/(Move(/(std::move(/
Removing the 'using mozilla::Move;' lines.
And then with a few manual fixups, see the bug for the split series..
MozReview-Commit-ID: Jxze3adipUh
This allows MOZ_TRY and MOZ_TRY_VAR to be transparently used in XPCOM methods
when compatible Result types are used.
Also removes a compatibility macro in SimpleChannel.cpp, and an identical
specialization in AddonManagerStartup, which are no longer necessary after
this change.
MozReview-Commit-ID: 94iNrPDJEnN
This helper class allows us to create simple channels that open an underlying
input stream when the channel is first opened, using a closure function,
without having to expose the nsBaseChannel class to non-necko code.
MozReview-Commit-ID: 6jiImdMXUp0