Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 :
6 : #ifndef DecryptorProxyCallback_h_
7 : #define DecryptorProxyCallback_h_
8 :
9 : #include "mozilla/dom/MediaKeyStatusMapBinding.h" // For MediaKeyStatus
10 : #include "mozilla/dom/MediaKeyMessageEventBinding.h" // For MediaKeyMessageType
11 : #include "mozilla/CDMProxy.h"
12 :
13 0 : class DecryptorProxyCallback {
14 : public:
15 :
16 0 : virtual ~DecryptorProxyCallback() {}
17 :
18 : virtual void SetDecryptorId(uint32_t aId) = 0;
19 :
20 : virtual void SetSessionId(uint32_t aCreateSessionId,
21 : const nsCString& aSessionId) = 0;
22 :
23 : virtual void ResolveLoadSessionPromise(uint32_t aPromiseId,
24 : bool aSuccess) = 0;
25 :
26 : virtual void ResolvePromise(uint32_t aPromiseId) = 0;
27 :
28 : virtual void RejectPromise(uint32_t aPromiseId,
29 : nsresult aException,
30 : const nsCString& aSessionId) = 0;
31 :
32 : virtual void SessionMessage(const nsCString& aSessionId,
33 : mozilla::dom::MediaKeyMessageType aMessageType,
34 : const nsTArray<uint8_t>& aMessage) = 0;
35 :
36 : virtual void ExpirationChange(const nsCString& aSessionId,
37 : mozilla::UnixTime aExpiryTime) = 0;
38 :
39 : virtual void SessionClosed(const nsCString& aSessionId) = 0;
40 :
41 : virtual void SessionError(const nsCString& aSessionId,
42 : nsresult aException,
43 : uint32_t aSystemCode,
44 : const nsCString& aMessage) = 0;
45 :
46 : virtual void Decrypted(uint32_t aId,
47 : mozilla::DecryptStatus aResult,
48 : const nsTArray<uint8_t>& aDecryptedData) = 0;
49 :
50 : virtual void BatchedKeyStatusChanged(const nsCString& aSessionId,
51 : const nsTArray<mozilla::CDMKeyInfo>& aKeyInfos) = 0;
52 : };
53 :
54 : #endif
|