Merge of usage reporting and license changes from WV CDM repo

* CdmSession unittest and license request time changes
  b/15914199
  Merge of https://widevine-internal-review.googlesource.com/#/c/10597/

* Specify OEMCrypto API version in client capabilities
  b/15388863
  Merge of https://widevine-internal-review.googlesource.com/#/c/10616/

* Report start and last play time in license request
  b/15995227
  Merge of https://widevine-internal-review.googlesource.com/#/c/10617/

* Respect can_play flag
  b/15330338
  Merge of https://widevine-internal-review.googlesource.com/#/c/10619/

* Restore offline session information
  b/16009274
  Merge of https://widevine-internal-review.googlesource.com/#/c/10641/

Change-Id: I17fdc309efbc1d44385a86a368df11b1349b29c2
This commit is contained in:
Rahul Frias
2014-07-02 13:03:09 -07:00
parent 9b4da994ec
commit 7a933ee48e
18 changed files with 1308 additions and 692 deletions

View File

@@ -6,6 +6,7 @@
#include <set>
#include "initialization_data.h"
#include "scoped_ptr.h"
#include "wv_cdm_types.h"
namespace video_widevine_server {
@@ -16,14 +17,15 @@ class SignedMessage;
namespace wvcdm {
class Clock;
class CryptoSession;
class PolicyEngine;
class CdmLicense {
public:
CdmLicense() : session_(NULL), initialized_(false) {}
virtual ~CdmLicense() {}
CdmLicense();
virtual ~CdmLicense();
virtual bool Init(const std::string& token, CryptoSession* session,
PolicyEngine* policy_engine);
@@ -42,7 +44,9 @@ class CdmLicense {
virtual bool RestoreOfflineLicense(const CdmKeyMessage& license_request,
const CdmKeyResponse& license_response,
const CdmKeyResponse& license_renewal_response);
const CdmKeyResponse& license_renewal_response,
int64_t playback_start_time,
int64_t last_playback_time);
virtual bool RestoreUsageLicense(const CdmKeyMessage& license_request,
const CdmKeyResponse& license_response);
virtual bool HasInitData() { return !stored_init_data_.empty(); }
@@ -76,6 +80,14 @@ class CdmLicense {
// Used for certificate based licensing
CdmKeyMessage key_request_;
scoped_ptr<Clock> clock_;
// For testing
CdmLicense(Clock* clock);
#if defined(UNIT_TEST)
friend class CdmLicenseTest;
#endif
CORE_DISALLOW_COPY_AND_ASSIGN(CdmLicense);
};