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 dom_base_MessageManagerCallback_h__
8 #define dom_base_MessageManagerCallback_h__
11 #include "nsStringFwd.h"
12 #include "nsTArrayForwardDeclare.h"
20 class ClonedMessageData
;
23 class ProcessMessageManager
;
27 class StructuredCloneData
;
29 class MessageManagerCallback
{
31 virtual ~MessageManagerCallback() = default;
33 virtual bool DoLoadMessageManagerScript(const nsAString
& aURL
,
34 bool aRunInGlobalScope
) {
38 virtual bool DoSendBlockingMessage(const nsAString
& aMessage
,
39 StructuredCloneData
& aData
,
40 nsTArray
<StructuredCloneData
>* aRetVal
) {
44 virtual nsresult
DoSendAsyncMessage(const nsAString
& aMessage
,
45 StructuredCloneData
& aData
) {
49 virtual mozilla::dom::ProcessMessageManager
* GetProcessMessageManager()
54 virtual void DoGetRemoteType(nsACString
& aRemoteType
,
55 ErrorResult
& aError
) const;
58 bool BuildClonedMessageData(StructuredCloneData
& aData
,
59 ClonedMessageData
& aClonedData
);
62 void UnpackClonedMessageData(const ClonedMessageData
& aClonedData
,
63 StructuredCloneData
& aData
);
67 } // namespace mozilla