dom/messagechannel/MessagePortChild.cpp
author Gijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 11 Jul 2017 16:33:10 +0100
changeset 418487 eadb66a18addce2862b1269fa10d288ee6ca4333
parent 368570 1eb14c93e19767628f50051ade4362941f8c85d8
child 418888 4e853e81c2be70c041fbae19e4e30dc7e97e86c2
permissions -rw-r--r--
Bug 1354086 - fix fonts in overflow menu, combined buttons overflowing in customize mode, r=mikedeboer MozReview-Commit-ID: Ck2Za6FUbeo

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */

#include "MessagePortChild.h"
#include "MessagePort.h"
#include "mozilla/dom/MessageEvent.h"
#include "mozilla/ipc/PBackgroundChild.h"

namespace mozilla {
namespace dom {

mozilla::ipc::IPCResult
MessagePortChild::RecvStopSendingDataConfirmed()
{
  MOZ_ASSERT(mPort);
  mPort->StopSendingDataConfirmed();
  MOZ_ASSERT(!mPort);
  return IPC_OK();
}

mozilla::ipc::IPCResult
MessagePortChild::RecvEntangled(nsTArray<ClonedMessageData>&& aMessages)
{
  if (mPort) {
    mPort->Entangled(aMessages);
  }
  return IPC_OK();
}

mozilla::ipc::IPCResult
MessagePortChild::RecvReceiveData(nsTArray<ClonedMessageData>&& aMessages)
{
  if (mPort) {
    mPort->MessagesReceived(aMessages);
  }
  return IPC_OK();
}

void
MessagePortChild::ActorDestroy(ActorDestroyReason aWhy)
{
  if (mPort) {
    mPort->Closed();
    MOZ_ASSERT(!mPort);
  }
}

} // namespace dom
} // namespace mozilla