dom/media/systemservices/MediaParent.h
author Jan-Ivar Bruaroey <jib@mozilla.com>
Sat, 28 Mar 2015 19:02:46 -0400
changeset 265275 13068deb21935c908bc336764e8e3044972db61e
parent 265264 9e3ecca831d87c957a7ae8e7e5fe758d7385a785
child 280550 53063473eb54c1b4cd701be4d54eead966a51603
permissions -rw-r--r--
Bug 1046245 - IO on STS thread + cleanup BackgroundChild on shutdown. r=jesup

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et ft=cpp : */
/* 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_MediaParent_h
#define mozilla_MediaParent_h

#include "MediaChild.h"

#include "mozilla/dom/ContentParent.h"
#include "mozilla/media/PMediaParent.h"

namespace mozilla {
namespace media {

// media::Parent implements the chrome-process side of ipc for media::Child APIs

class ParentSingleton;

class Parent : public PMediaParent
{
  NS_INLINE_DECL_REFCOUNTING(Parent)
public:
  virtual bool RecvGetOriginKey(const uint32_t& aRequestId,
                                const nsCString& aOrigin,
                                const bool& aPrivateBrowsing) override;
  virtual bool RecvSanitizeOriginKeys(const uint64_t& aSinceWhen) override;
  virtual void ActorDestroy(ActorDestroyReason aWhy) override;

  Parent();
private:
  virtual ~Parent();

  nsRefPtr<ParentSingleton> mSingleton;
  bool mDestroyed;
};

PMediaParent* AllocPMediaParent();
bool DeallocPMediaParent(PMediaParent *aActor);

} // namespace media
} // namespace mozilla

#endif  // mozilla_MediaParent_h