/* 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/. */
// HttpLog.h should generally be included first #include"HttpLog.h"
for (constauto& event : runnables) { // Note: these runnables call Recv* methods on HttpBackgroundChannelChild // but not the Process* methods on HttpChannelChild.
event->Run();
}
// Ensure no new message is enqueued.
MOZ_ASSERT(mQueuedRunnables.IsEmpty());
}
// The HttpTransactionChild in socket process may not know that this // request is cancelled or failed due to the IPC delay. In this case, we // should not forward ODA to HttpChannelChild.
nsresult channelStatus;
self->mChannelChild->GetStatus(&channelStatus); if (NS_FAILED(channelStatus)) { return;
}
// Bug 1641336: Race only happens if the data is from socket process. if (IsWaitingOnStartRequest()) {
LOG((" > pending until OnStartRequest [offset=%" PRIu64 " count=%" PRIu32 "]\n",
aOffset, aCount));
// It's enough to set this from (just before) OnStopRequest notification, // since we don't need this value sooner than a channel was done loading - // everything this timestamp affects takes place only after a channel's // OnStopRequest.
nsHttp::SetLastActiveTabLoadOptimizationHit(aLastActiveTabOptHit);
if (NS_WARN_IF(!mChannelChild)) { return IPC_OK();
}
if (IsWaitingOnStartRequest()) {
LOG((" > pending until OnStartRequest [status=%" PRIx32 "]\n", static_cast<uint32_t>(aChannelStatus)));
if (NS_WARN_IF(!mChannelChild)) { return IPC_OK();
}
// NotifyClassificationFlags has no order dependency to OnStartRequest. // It this be handled as soon as possible
mChannelChild->ProcessNotifyClassificationFlags(aClassificationFlags,
aIsThirdParty);
if (NS_WARN_IF(!mChannelChild)) { return IPC_OK();
}
// SetClassifierMatchedInfo has no order dependency to OnStartRequest. // It this be handled as soon as possible
mChannelChild->ProcessSetClassifierMatchedInfo(info.list(), info.provider(),
info.fullhash());
if (NS_WARN_IF(!mChannelChild)) { return IPC_OK();
}
// SetClassifierMatchedTrackingInfo has no order dependency to // OnStartRequest. It this be handled as soon as possible
mChannelChild->ProcessSetClassifierMatchedTrackingInfo(info.list(),
info.fullhash());
void HttpBackgroundChannelChild::ActorDestroy(ActorDestroyReason aWhy) {
LOG(("HttpBackgroundChannelChild::ActorDestroy[this=%p]\n", this)); // This function might be called during shutdown phase, so OnSocketThread() // might return false even on STS thread. Use IsOnCurrentThreadInfallible() // to get correct information.
MOZ_ASSERT(gSocketTransportService);
MOZ_ASSERT(gSocketTransportService->IsOnCurrentThreadInfallible());
// Ensure all IPC messages received before ActorDestroy can be // handled correctly. If there is any pending IPC message, destroyed // mChannelChild until those messages are flushed. // If background channel is not closed by normal IPDL actor deletion, // remove the HttpChannelChild reference and notify background channel // destroyed immediately. if (aWhy == Deletion && !mQueuedRunnables.IsEmpty()) {
LOG((" > pending until queued messages are flushed\n"));
RefPtr<HttpBackgroundChannelChild> self = this;
mQueuedRunnables.AppendElement(NS_NewRunnableFunction( "HttpBackgroundChannelChild::ActorDestroy", [self]() {
MOZ_ASSERT(OnSocketThread());
RefPtr<HttpChannelChild> channelChild =
std::move(self->mChannelChild);
if (channelChild) {
channelChild->OnBackgroundChildDestroyed(self);
}
})); return;
}
if (mChannelChild) {
RefPtr<HttpChannelChild> channelChild = std::move(mChannelChild);
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.