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/. */
6 #ifndef DecryptorProxyCallback_h_
7 #define DecryptorProxyCallback_h_
9 #include "mozilla/dom/MediaKeyStatusMapBinding.h" // For MediaKeyStatus
10 #include "mozilla/dom/MediaKeyMessageEventBinding.h" // For MediaKeyMessageType
11 #include "mozilla/CDMProxy.h"
17 class DecryptorProxyCallback
{
19 virtual ~DecryptorProxyCallback() {}
21 virtual void SetSessionId(uint32_t aCreateSessionId
,
22 const nsCString
& aSessionId
) = 0;
24 virtual void ResolveLoadSessionPromise(uint32_t aPromiseId
,
27 virtual void ResolvePromise(uint32_t aPromiseId
) = 0;
29 virtual void RejectPromise(uint32_t aPromiseId
,
30 mozilla::ErrorResult
&& aException
,
31 const nsCString
& aSessionId
) = 0;
33 virtual void SessionMessage(const nsCString
& aSessionId
,
34 mozilla::dom::MediaKeyMessageType aMessageType
,
35 const nsTArray
<uint8_t>& aMessage
) = 0;
37 virtual void ExpirationChange(const nsCString
& aSessionId
,
38 mozilla::UnixTime aExpiryTime
) = 0;
40 virtual void SessionClosed(const nsCString
& aSessionId
) = 0;
42 virtual void SessionError(const nsCString
& aSessionId
, nsresult aException
,
44 const nsCString
& aMessage
) = 0;
46 virtual void Decrypted(uint32_t aId
, mozilla::DecryptStatus aResult
,
47 const nsTArray
<uint8_t>& aDecryptedData
) = 0;
49 virtual void BatchedKeyStatusChanged(
50 const nsCString
& aSessionId
,
51 const nsTArray
<mozilla::CDMKeyInfo
>& aKeyInfos
) = 0;