/* 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/. */
namespace dom { class BrowserParent;
} // namespace dom
namespace net {
class HttpBackgroundChannelParent; class ParentChannelListener; class ChannelEventQueue;
class HttpChannelParent final : public nsIInterfaceRequestor, public PHttpChannelParent, public nsIParentRedirectingChannel, public nsIProgressEventSink, public HttpChannelSecurityWarningReporter, public nsIAsyncVerifyRedirectReadyCallback, public nsIChannelEventSink, public nsIRedirectResultListener, public nsIMultiPartChannelListener { virtual ~HttpChannelParent();
// Callbacks for each asynchronous tasks required in AsyncOpen // procedure, will call InvokeAsyncOpen when all the expected // tasks is finished successfully or when any failure happened. // @see mAsyncOpenBarrier. void TryInvokeAsyncOpen(nsresult aRv);
// Calls SendSetPriority if mIPCClosed is false. void DoSendSetPriority(int16_t aValue);
// Callback while background channel is ready. void OnBackgroundParentReady(HttpBackgroundChannelParent* aBgParent); // Callback while background channel is destroyed. void OnBackgroundParentDestroyed();
base::ProcessId OtherPid() const;
// Inform the child actor that our referrer info was modified late during // BeginConnect. void OverrideReferrerInfoDuringBeginConnect(nsIReferrerInfo* aReferrerInfo);
// Set the cookie strings, which will be informed to the child actor during // PHttpBackgroundChannel::OnStartRequest. Note that CookieService also sends // the information to all actors via PContent, a main thread IPC, which could // be slower than background IPC PHttpBackgroundChannel::OnStartRequest. // Therefore, another cookie notification via PBackground is needed to // guarantee the listener in child has the necessary cookies before // OnStartRequest. void SetCookieHeaders(const nsTArray<nsCString>& aCookieHeaders);
// Should only be called from EarlyHintPreloader. mChannel should be null at // the point of calling. Sets mChannel to aChannel. Used by the // EarlyHintPreloader to redirect the channel to this parent as soon as the // final channel becomes available after all http redirects. void SetHttpChannelFromEarlyHintPreloader(HttpBaseChannel* aChannel);
protected: // used to connect redirected-to channel in parent with just created // ChildChannel. Used during redirects.
[[nodiscard]] bool ConnectChannel(const uint32_t& registrarId);
// Calls SendDeleteSelf and sets mIPCClosed to true because we should not // send any more messages after that. Bug 1274886
[[nodiscard]] bool DoSendDeleteSelf(); // Called to notify the parent channel to not send any more IPC messages. virtual mozilla::ipc::IPCResult RecvDeletingChannel() override;
// final step for Redirect2Verify procedure, will be invoked while both // redirecting and redirected channel are ready or any error happened. // OnRedirectVerifyCallback will be invoked for finishing the async // redirect verification procedure. void ContinueRedirect2Verify(const nsresult& aResult);
void AsyncOpenFailed(nsresult aRv);
// Request to pair with a HttpBackgroundChannelParent with the same channel // id, a promise will be returned so the caller can append callbacks on it. // If called multiple times before mBgParent is available, the same promise // will be returned and the callbacks will be invoked in order.
[[nodiscard]] RefPtr<GenericNonExclusivePromise> WaitForBgParent(
uint64_t aChannelId);
// Remove the association with background channel after main-thread IPC // is about to be destroyed or no further event is going to be sent, i.e., // DocumentChannelCleanup. void CleanupBackgroundChannel();
// Check if the channel needs to enable the flow control on the IPC channel. // That is, we may suspend the channel if the ODA-s to child process are not // consumed quickly enough. Otherwise, memory explosion could happen. bool NeedFlowControl();
// To calculate the delay caused by the e10s back-pressure suspension
TimeStamp mResumedTimestamp;
Atomic<bool> mIPCClosed; // PHttpChannel actor has been Closed()
// Corresponding redirect channel registrar Id. 0 means redirection is not // started.
uint64_t mRedirectChannelId = 0;
PBOverrideStatus mPBOverride;
// Set to the canceled status value if the main channel was canceled.
nsresult mStatus;
// The referrer info, set during nsHttpChannel::BeginConnect, to override the // original one. This info will be sent in OnStartRequest.
nsCOMPtr<nsIReferrerInfo> mOverrideReferrerInfo;
// The cookie string in Set-Cookie header. This info will be sent in // OnStartRequest.
nsTArray<nsCString> mCookieHeaders;
// OnStatus is always called before OnProgress. // Set true in OnStatus if next OnProgress can be ignored // since the information can be recontructed from ODA.
uint8_t mIgnoreProgress : 1;
uint8_t mHasSuspendedByBackPressure : 1;
// Set if we get the result of and cache |mNeedFlowControl|
uint8_t mCacheNeedFlowControlInitialized : 1;
uint8_t mNeedFlowControl : 1;
uint8_t mSuspendedForFlowControl : 1;
// Defaults to false. Is set to true at the begining of OnStartRequest. // Used to ensure methods can't be called before OnStartRequest.
uint8_t mAfterOnStartRequestBegun : 1;
// Number of events to wait before actually invoking AsyncOpen on the main // channel. For each asynchronous step required before InvokeAsyncOpen, should // increase 1 to mAsyncOpenBarrier and invoke TryInvokeAsyncOpen after // finished. This attribute is main thread only.
uint8_t mAsyncOpenBarrier = 0;
// When true, ODAs are sent from the socket process to the child process // directly.
uint8_t mDataSentToChildProcess : 1;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.