Bug 1891340 - Part 1: Add parameters to customize the before and after icon tints...
[gecko.git] / ipc / glue / RandomAccessStreamUtils.h
blob3ca79537eb4487c12d5de9793b376dfe29dea52a
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_ipc_RandomAccessStreamUtils_h
8 #define mozilla_ipc_RandomAccessStreamUtils_h
10 template <class T>
11 class nsCOMPtr;
13 class nsIInterfaceRequestor;
14 class nsIRandomAccessStream;
16 namespace mozilla {
18 template <class T>
19 class Maybe;
21 template <typename T>
22 class MovingNotNull;
24 template <typename V, typename E>
25 class Result;
27 namespace ipc {
29 class RandomAccessStreamParams;
31 // Serialize an nsIRandomAccessStream to be sent over IPC infallibly.
32 RandomAccessStreamParams SerializeRandomAccessStream(
33 MovingNotNull<nsCOMPtr<nsIRandomAccessStream>> aStream,
34 nsIInterfaceRequestor* aCallbacks);
36 Maybe<RandomAccessStreamParams> SerializeRandomAccessStream(
37 nsCOMPtr<nsIRandomAccessStream> aStream, nsIInterfaceRequestor* aCallbacks);
39 // Deserialize an nsIRandomAccessStream received from an actor call. These
40 // methods work in both the child and parent.
41 Result<MovingNotNull<nsCOMPtr<nsIRandomAccessStream>>, bool>
42 DeserializeRandomAccessStream(RandomAccessStreamParams& aStreamParams);
44 Result<nsCOMPtr<nsIRandomAccessStream>, bool> DeserializeRandomAccessStream(
45 Maybe<RandomAccessStreamParams>& aStreamParams);
47 } // namespace ipc
48 } // namespace mozilla
50 #endif // mozilla_ipc_RandomAccessStreamUtils_h