/* -*- 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/. */
nsCOMPtr<nsIIPCSerializableInputStream> serializable =
do_QueryInterface(aInputStream); if (!serializable) {
MOZ_CRASH("Input stream is not serializable!");
}
nsCOMPtr<nsIIPCSerializableInputStream> serializable =
do_QueryInterface(aInputStream); if (!serializable) {
MOZ_CRASH("Input stream is not serializable!");
}
// Let's try to take the length using InputStreamLengthHelper. If the length // cannot be taken synchronously, and its length is needed, the stream needs // to be fully copied in memory on the deserialization side.
int64_t length; if (!InputStreamLengthHelper::GetSyncLength(aInputStream, &length)) {
length = -1;
}
// If the RemoteLazyInputStream already has an internal stream, unwrap it. // This is required as some code unfortunately depends on the precise // topology of received streams, and cannot handle being passed a // `RemoteLazyInputStream` in the parent process.
nsCOMPtr<nsIInputStream> innerStream; if (XRE_IsParentProcess() &&
NS_SUCCEEDED(
params.stream()->TakeInternalStream(getter_AddRefs(innerStream)))) { return innerStream.forget();
} return do_AddRef(params.stream().get());
}
case InputStreamParams::TSlicedInputStreamParams:
serializable = new SlicedInputStream(); break;
case InputStreamParams::TInputStreamLengthWrapperParams:
serializable = new InputStreamLengthWrapper(); break;
case InputStreamParams::TEncryptedFileInputStreamParams:
serializable = new dom::quota::DecryptingInputStream<
dom::quota::IPCStreamCipherStrategy>(); break;
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.