Bug 1523562 [wpt PR 15079] - Pass the full path to the flake8 config files, a=testonly
[gecko.git] / dom / messagechannel / SharedMessagePortMessage.h
blob8b668425488e610a3f86dd78a7957947cac6c947
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_dom_SharedMessagePortMessage_h
8 #define mozilla_dom_SharedMessagePortMessage_h
10 #include "mozilla/dom/ipc/StructuredCloneData.h"
12 namespace mozilla {
13 namespace dom {
15 class MessagePortChild;
16 class MessagePortMessage;
17 class MessagePortParent;
19 class SharedMessagePortMessage final : public ipc::StructuredCloneData {
20 public:
21 NS_INLINE_DECL_REFCOUNTING(SharedMessagePortMessage)
23 SharedMessagePortMessage() : ipc::StructuredCloneData() {}
25 // Note that the populated ClonedMessageData borrows the underlying
26 // JSStructuredCloneData from the SharedMessagePortMessage, so the caller is
27 // required to ensure that the ClonedMessageData instances are destroyed prior
28 // to the SharedMessagePortMessage instances.
29 static void FromSharedToMessagesChild(
30 MessagePortChild* aActor,
31 const nsTArray<RefPtr<SharedMessagePortMessage>>& aData,
32 nsTArray<ClonedMessageData>& aArray);
34 static bool FromMessagesToSharedChild(
35 nsTArray<ClonedMessageData>& aArray,
36 FallibleTArray<RefPtr<SharedMessagePortMessage>>& aData);
38 // Note that the populated ClonedMessageData borrows the underlying
39 // JSStructuredCloneData from the SharedMessagePortMessage, so the caller is
40 // required to ensure that the ClonedMessageData instances are destroyed prior
41 // to the SharedMessagePortMessage instances.
42 static bool FromSharedToMessagesParent(
43 MessagePortParent* aActor,
44 const nsTArray<RefPtr<SharedMessagePortMessage>>& aData,
45 FallibleTArray<ClonedMessageData>& aArray);
47 static bool FromMessagesToSharedParent(
48 nsTArray<ClonedMessageData>& aArray,
49 FallibleTArray<RefPtr<SharedMessagePortMessage>>& aData);
51 private:
52 ~SharedMessagePortMessage() {}
55 } // namespace dom
56 } // namespace mozilla
58 #endif // mozilla_dom_SharedMessagePortMessage_h