IPCTransferable.ipdlh (2296B)
1 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ 2 /* vim: set sw=4 ts=8 et tw=80 ft=cpp : */ 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/. */ 6 7 include "mozilla/GfxMessageUtils.h"; 8 include "mozilla/dom/PermissionMessageUtils.h"; 9 10 include DOMTypes; 11 include IPCBlob; 12 include NeckoChannelParams; 13 14 using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h"; 15 [RefCounted] using class nsIPrincipal from "nsIPrincipal.h"; 16 [RefCounted] using class nsIReferrerInfo from "nsIReferrerInfo.h"; 17 [MoveOnly] using class mozilla::ipc::BigBuffer from "mozilla/ipc/BigBuffer.h"; 18 19 namespace mozilla { 20 namespace dom { 21 22 struct IPCTransferableDataString 23 { 24 BigBuffer data; 25 }; 26 27 struct IPCTransferableDataCString 28 { 29 BigBuffer data; 30 }; 31 32 struct IPCTransferableDataInputStream 33 { 34 // NOTE: Editor currently relies on these input streams being synchronous, so 35 // we can't safely serialize them using IPCStream (see bug 1778565). Instead, 36 // they're serialized as a `BigBuffer`, and converted to a nsStringInputStream 37 // on the receiving side. If we are able to use async streams reliably in the 38 // future, we could consider switching the code which adds `nsIInputStream`s 39 // to the transferable to use `BlobImpl` instead, for more consistency between 40 // image formats. 41 BigBuffer data; 42 }; 43 44 struct IPCTransferableDataImageContainer 45 { 46 IPCImage image; 47 }; 48 49 struct IPCTransferableDataBlob 50 { 51 IPCBlob blob; 52 }; 53 54 union IPCTransferableDataType 55 { 56 IPCTransferableDataString; 57 IPCTransferableDataCString; 58 IPCTransferableDataInputStream; 59 IPCTransferableDataImageContainer; 60 IPCTransferableDataBlob; 61 }; 62 63 struct IPCTransferableDataItem 64 { 65 nsCString flavor; 66 IPCTransferableDataType data; 67 }; 68 69 struct IPCTransferableData 70 { 71 IPCTransferableDataItem[] items; 72 }; 73 74 union IPCTransferableDataOrError { 75 IPCTransferableData; 76 nsresult; 77 }; 78 79 struct IPCTransferable 80 { 81 IPCTransferableData data; 82 bool isPrivateData; 83 nullable nsIPrincipal dataPrincipal; 84 CookieJarSettingsArgs? cookieJarSettings; 85 nsContentPolicyType contentPolicyType; 86 nullable nsIReferrerInfo referrerInfo; 87 }; 88 89 } // namespace dom 90 } // namespace mozilla