dom/messagechannel/MessagePortChild.cpp
author Gerald Squelart <gsquelart@mozilla.com>
Fri, 11 Nov 2016 11:25:52 +1100
changeset 367314 680467d99ed63d1b3a37e5c61d3c4302f5181418
parent 292746 6411f2fcd3ec3dfbb219681eb4512610c237143c
child 369870 39ac4382a2c019178604b90acd816753fe142908
permissions -rw-r--r--
Bug 1316524 - Use 'media.wmf.skip-blacklist' to set some gfxVars - r=mattwoodrow Reversing bug 1313343, as MediaPrefs are not available from the UI process. Instead media.wmf.skip-blacklist is used when setting D3D-blacklisting gfxVars, leaving them empty if we want to skip these blacklists. MozReview-Commit-ID: JYED4ovC0jq

/* -*- 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 {

bool
MessagePortChild::RecvStopSendingDataConfirmed()
{
  MOZ_ASSERT(mPort);
  mPort->StopSendingDataConfirmed();
  MOZ_ASSERT(!mPort);
  return true;
}

bool
MessagePortChild::RecvEntangled(nsTArray<MessagePortMessage>&& aMessages)
{
  if (mPort) {
    mPort->Entangled(aMessages);
  }
  return true;
}

bool
MessagePortChild::RecvReceiveData(nsTArray<MessagePortMessage>&& aMessages)
{
  if (mPort) {
    mPort->MessagesReceived(aMessages);
  }
  return true;
}

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

} // namespace dom
} // namespace mozilla