2017-10-27 01:08:41 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2015-06-17 13:44:27 +03:00
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_MessagePortChild_h
|
|
|
|
#define mozilla_dom_MessagePortChild_h
|
|
|
|
|
|
|
|
#include "mozilla/Assertions.h"
|
|
|
|
#include "mozilla/dom/PMessagePortChild.h"
|
|
|
|
#include "nsISupportsImpl.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class MessagePort;
|
|
|
|
|
|
|
|
class MessagePortChild final : public PMessagePortChild {
|
2019-02-06 18:57:37 +03:00
|
|
|
friend class PMessagePortChild;
|
|
|
|
|
2015-06-17 13:44:27 +03:00
|
|
|
public:
|
|
|
|
NS_INLINE_DECL_REFCOUNTING(MessagePortChild)
|
|
|
|
|
2017-07-21 01:45:30 +03:00
|
|
|
MessagePortChild();
|
2015-06-17 13:44:27 +03:00
|
|
|
|
|
|
|
void SetPort(MessagePort* aPort) { mPort = aPort; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
~MessagePortChild() { MOZ_ASSERT(!mPort); }
|
|
|
|
|
2020-01-24 10:58:21 +03:00
|
|
|
mozilla::ipc::IPCResult RecvEntangled(nsTArray<MessageData>&& aMessages);
|
2015-06-17 13:44:27 +03:00
|
|
|
|
2020-01-24 10:58:21 +03:00
|
|
|
mozilla::ipc::IPCResult RecvReceiveData(nsTArray<MessageData>&& aMessages);
|
2015-06-17 13:44:27 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvStopSendingDataConfirmed();
|
2015-06-17 13:44:27 +03:00
|
|
|
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
|
|
|
|
|
|
|
// This is a raw pointer because this child is owned by this MessagePort.
|
|
|
|
MessagePort* mPort;
|
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2015-06-17 13:44:27 +03:00
|
|
|
|
|
|
|
#endif // mozilla_dom_MessagePortChild_h
|