dom/media/MediaPermissionGonk.h
author Ryan VanderMeulen <ryanvm@gmail.com>
Thu, 10 Jul 2014 21:43:04 -0400
changeset 215438 70f3b01cb736ea9f21d692e537058ad3859a9c69
parent 214637 4d276769e9ddc88d2dd2912f448116c9efba042e
child 285938 91d6e262b662a0b4e47358665e222d3927337af9
permissions -rw-r--r--
Backed out 5 changesets (bug 1020760, bug 1035653, bug 1020090) for leaks on a CLOSED TREE. Backed out changeset f0b20e3db93c (bug 1020760) Backed out changeset 412b654e5cd2 (bug 1035653) Backed out changeset 01ba0892af29 (bug 1020760) Backed out changeset c7de1f4b078f (bug 1020760) Backed out changeset 96aa9d33a1f5 (bug 1020090)

/* 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 DOM_MEDIA_MEDIAPERMISSIONGONK_H
#define DOM_MEDIA_MEDIAPERMISSIONGONK_H

#include "nsError.h"
#include "nsIObserver.h"
#include "nsISupportsImpl.h"
#include "GetUserMediaRequest.h"

namespace mozilla {

/**
 * The observer to create the MediaPermissionMgr. This is the entry point of
 * permission request on b2g.
 */
class MediaPermissionManager : public nsIObserver
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIOBSERVER

  static MediaPermissionManager* GetInstance();

protected:
  virtual ~MediaPermissionManager();

private:
  MediaPermissionManager();
  nsresult Deinit();
  nsresult HandleRequest(nsRefPtr<dom::GetUserMediaRequest> &req);
};

} // namespace mozilla
#endif // DOM_MEDIA_MEDIAPERMISSIONGONK_H