/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */
// For cases where multiple streams are serialized for a single list // then the control will get passed multiple times. This is ok, but // it should be the same control each time. if (mStreamControl) {
MOZ_DIAGNOSTIC_ASSERT(aStreamControl == mStreamControl); return;
}
for (uint32_t i = 0; i < mList.Length(); ++i) {
mManager->AddRefBodyId(mList[i].mId);
}
}
void StreamList::Add(const nsID& aId, nsCOMPtr<nsIInputStream>&& aStream) { // All streams should be added on IO thread before we set the stream // control on the owning IPC thread.
MOZ_DIAGNOSTIC_ASSERT(!mStreamControl);
// Removal of the stream will be triggered when the stream is closed, // which happens only once, so let's ensure nobody adds us twice.
MOZ_ASSERT_DEBUG_OR_FUZZING(
std::find_if(mList.begin(), mList.end(), MatchById(aId)) == mList.end());
if (mStreamControl && mStreamControl->CanSend()) { // CloseAll will kick off everything needed for shutdown. // mStreamControl may go away immediately or async.
mStreamControl->CloseAll();
} else { // We cannot interact with the child, let's just clear our lists of // streams to unblock shutdown. if (NS_WARN_IF(mStreamControl)) { // TODO: Check if this case is actually possible. We might see a late // delivery of the CSCP::ActorDestroy? What would that mean for CanSend?
mStreamControl->LostIPCCleanup(SafeRefPtrFromThis());
mStreamControl = nullptr;
} else {
NoteClosedAll();
}
}
}
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.