2014-07-28 03:20:34 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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 GMPDecryptorProxy_h_
|
|
|
|
#define GMPDecryptorProxy_h_
|
|
|
|
|
2016-08-01 12:37:18 +03:00
|
|
|
#include "mozilla/DecryptorProxyCallback.h"
|
2014-07-28 03:20:34 +04:00
|
|
|
#include "GMPCallbackBase.h"
|
2014-07-30 10:53:28 +04:00
|
|
|
#include "gmp-decryption.h"
|
2014-10-21 10:16:19 +04:00
|
|
|
#include "nsString.h"
|
2014-07-28 03:20:34 +04:00
|
|
|
|
2015-04-09 14:14:55 +03:00
|
|
|
namespace mozilla {
|
2014-07-28 03:20:34 +04:00
|
|
|
class CryptoSample;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace mozilla
|
2014-07-28 03:20:34 +04:00
|
|
|
|
2016-08-01 12:37:18 +03:00
|
|
|
class GMPDecryptorProxyCallback : public DecryptorProxyCallback,
|
|
|
|
public GMPCallbackBase {
|
2014-07-28 03:20:34 +04:00
|
|
|
public:
|
2016-08-01 12:37:18 +03:00
|
|
|
virtual ~GMPDecryptorProxyCallback() {}
|
2014-07-28 03:20:34 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class GMPDecryptorProxy {
|
|
|
|
public:
|
|
|
|
~GMPDecryptorProxy() {}
|
|
|
|
|
2016-01-08 02:43:37 +03:00
|
|
|
virtual uint32_t GetPluginId() const = 0;
|
2015-03-26 09:55:30 +03:00
|
|
|
|
2016-07-07 08:26:15 +03:00
|
|
|
virtual nsresult Init(GMPDecryptorProxyCallback* aCallback,
|
|
|
|
bool aDistinctiveIdentifierRequired,
|
|
|
|
bool aPersistentStateRequired) = 0;
|
2014-07-28 03:20:34 +04:00
|
|
|
|
2015-01-09 04:30:07 +03:00
|
|
|
virtual void CreateSession(uint32_t aCreateSessionToken,
|
|
|
|
uint32_t aPromiseId,
|
2014-07-28 03:20:34 +04:00
|
|
|
const nsCString& aInitDataType,
|
|
|
|
const nsTArray<uint8_t>& aInitData,
|
|
|
|
GMPSessionType aSessionType) = 0;
|
|
|
|
|
|
|
|
virtual void LoadSession(uint32_t aPromiseId,
|
|
|
|
const nsCString& aSessionId) = 0;
|
|
|
|
|
|
|
|
virtual void UpdateSession(uint32_t aPromiseId,
|
|
|
|
const nsCString& aSessionId,
|
|
|
|
const nsTArray<uint8_t>& aResponse) = 0;
|
|
|
|
|
|
|
|
virtual void CloseSession(uint32_t aPromiseId,
|
|
|
|
const nsCString& aSessionId) = 0;
|
|
|
|
|
|
|
|
virtual void RemoveSession(uint32_t aPromiseId,
|
|
|
|
const nsCString& aSessionId) = 0;
|
|
|
|
|
|
|
|
virtual void SetServerCertificate(uint32_t aPromiseId,
|
|
|
|
const nsTArray<uint8_t>& aServerCert) = 0;
|
|
|
|
|
|
|
|
virtual void Decrypt(uint32_t aId,
|
2015-04-09 14:14:55 +03:00
|
|
|
const mozilla::CryptoSample& aCrypto,
|
2017-02-27 03:58:27 +03:00
|
|
|
const nsTArray<uint8_t>& aBuffer) = 0;
|
2014-07-28 03:20:34 +04:00
|
|
|
|
|
|
|
virtual void Close() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GMPDecryptorProxy_h_
|