/* 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/. */
class PBackgroundDataBridgeChild; class BackgroundDataBridgeChild; class HttpChannelChild;
class HttpBackgroundChannelChild final : public PHttpBackgroundChannelChild { friendclass BackgroundChannelCreateCallback; friendclass PHttpBackgroundChannelChild; friendclass HttpChannelChild; friendclass BackgroundDataBridgeChild;
// Associate this background channel with a HttpChannelChild and // initiate the createion of the PBackground IPC channel.
nsresult Init(HttpChannelChild* aChannelChild);
// Callback while the associated HttpChannelChild is not going to // handle any incoming messages over background channel. void OnChannelClosed();
// Return true if OnChannelClosed has been called. bool ChannelClosed();
// Callback when OnStartRequest is received and handled by HttpChannelChild. // Enqueued messages in background channel will be flushed. void OnStartRequestReceived(Maybe<uint32_t> aMultiPartID);
// Initiate the creation of the PBckground IPC channel. // Return false if failed. bool CreateBackgroundChannel();
// Check OnStartRequest is sent by parent process over main thread IPC // but not yet received on child process. // return true before RecvOnStartRequestSent is invoked. // return false if RecvOnStartRequestSent is invoked but not // OnStartRequestReceived. // return true after both RecvOnStartRequestSend and OnStartRequestReceived // are invoked. bool IsWaitingOnStartRequest();
// Associated HttpChannelChild for handling the channel events. // Will be removed while failed to create background channel, // destruction of the background channel, or explicitly dissociation // via OnChannelClosed callback.
RefPtr<HttpChannelChild> mChannelChild;
// True if OnStartRequest is received by HttpChannelChild. // Should only access on STS thread. bool mStartReceived = false;
// Store pending messages that require to be handled after OnStartRequest. // Should be flushed after OnStartRequest is received and handled. // Should only access on STS thread.
nsTArray<nsCOMPtr<nsIRunnable>> mQueuedRunnables;
enum ODASource {
ODA_PENDING = 0, // ODA is pending
ODA_FROM_PARENT = 1, // ODA from parent process.
ODA_FROM_SOCKET = 2 // response coming from the network
}; // We need to know the first ODA will be from socket process or parent // process. This information is from OnStartRequest message from parent // process.
ODASource mFirstODASource;
// Indicate whether HttpChannelChild::ProcessOnStopRequest is called. bool mOnStopRequestCalled = false;
// This is used when we receive the console report from parent process, but // still not get the OnStopRequest from socket process.
std::function<void()> mConsoleReportTask;
};
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.