Bug 891986 - Keep the source ArrayBuffer to a decodeAudioData call alive until the...
[gecko.git] / dom / base / nsContentPermissionHelper.h
blob1260fde123743dd9935e235490cf5d94f95b8d5d
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsContentPermissionHelper_h
6 #define nsContentPermissionHelper_h
8 #include "base/basictypes.h"
10 #include "nsIContentPermissionPrompt.h"
11 #include "nsString.h"
12 #include "nsIDOMElement.h"
14 #include "mozilla/dom/PermissionMessageUtils.h"
15 #include "mozilla/dom/PContentPermissionRequestParent.h"
17 class nsContentPermissionRequestProxy;
19 namespace mozilla {
20 namespace dom {
22 class ContentPermissionRequestParent : public PContentPermissionRequestParent
24 public:
25 ContentPermissionRequestParent(const nsACString& type, const nsACString& access, nsIDOMElement *element, const IPC::Principal& principal);
26 virtual ~ContentPermissionRequestParent();
28 nsCOMPtr<nsIPrincipal> mPrincipal;
29 nsCOMPtr<nsIDOMElement> mElement;
30 nsCOMPtr<nsContentPermissionRequestProxy> mProxy;
31 nsCString mType;
32 nsCString mAccess;
34 private:
35 virtual bool Recvprompt();
36 virtual void ActorDestroy(ActorDestroyReason why);
39 } // namespace dom
40 } // namespace mozilla
42 class nsContentPermissionRequestProxy : public nsIContentPermissionRequest
44 public:
45 nsContentPermissionRequestProxy();
46 virtual ~nsContentPermissionRequestProxy();
48 nsresult Init(const nsACString& type, const nsACString& access, mozilla::dom::ContentPermissionRequestParent* parent);
49 void OnParentDestroyed();
51 NS_DECL_ISUPPORTS
52 NS_DECL_NSICONTENTPERMISSIONREQUEST
54 private:
55 // Non-owning pointer to the ContentPermissionRequestParent object which owns this proxy.
56 mozilla::dom::ContentPermissionRequestParent* mParent;
57 nsCString mType;
58 nsCString mAccess;
60 #endif // nsContentPermissionHelper_h