Report change in session expiration
Bug: 19771612 Merged from Widevine CDM repo: https://widevine-internal-review.googlesource.com/#/c/13885/ Change-Id: I754f06a7ed9476554f9e1da3fe23f4563f9fc07e
This commit is contained in:
@@ -63,8 +63,12 @@ class PolicyEngine {
|
||||
|
||||
virtual const LicenseIdentification& license_id() { return license_id_; }
|
||||
|
||||
bool IsLicenseDurationExpired(int64_t current_time);
|
||||
bool IsPlaybackDurationExpired(int64_t current_time);
|
||||
bool IsLicenseDurationExpired(int64_t current_time) {
|
||||
return GetLicenseExpiryTime() <= current_time;
|
||||
}
|
||||
bool IsPlaybackDurationExpired(int64_t current_time) {
|
||||
return GetPlaybackExpiryTime() <= current_time;
|
||||
}
|
||||
|
||||
bool GetSecondsSinceStarted(int64_t* seconds_since_started);
|
||||
bool GetSecondsSinceLastPlayed(int64_t* seconds_since_started);
|
||||
@@ -89,6 +93,9 @@ class PolicyEngine {
|
||||
kLicenseStateExpired
|
||||
} LicenseState;
|
||||
|
||||
int64_t GetLicenseExpiryTime();
|
||||
int64_t GetPlaybackExpiryTime();
|
||||
|
||||
int64_t GetLicenseDurationRemaining(int64_t current_time);
|
||||
int64_t GetPlaybackDurationRemaining(int64_t current_time);
|
||||
|
||||
@@ -98,6 +105,10 @@ class PolicyEngine {
|
||||
|
||||
void UpdateRenewalRequest(int64_t current_time);
|
||||
|
||||
// Notifies updates in expiry time and fire OnExpirationUpdate event if
|
||||
// expiry time changes.
|
||||
void NotifyExpirationUpdate();
|
||||
|
||||
// These setters are for testing only. Takes ownership of the pointers.
|
||||
void set_clock(Clock* clock);
|
||||
|
||||
@@ -119,6 +130,7 @@ class PolicyEngine {
|
||||
int64_t license_start_time_;
|
||||
int64_t playback_start_time_;
|
||||
int64_t last_playback_time_;
|
||||
int64_t last_expiry_time_;
|
||||
|
||||
// This is used as a reference point for policy management. This value
|
||||
// represents an offset from license_start_time_. This is used to
|
||||
|
||||
@@ -15,6 +15,8 @@ class WvCdmEventListener {
|
||||
|
||||
virtual void OnSessionRenewalNeeded(const CdmSessionId& session_id) = 0;
|
||||
virtual void OnSessionExpiration(const CdmSessionId& session_id) = 0;
|
||||
virtual void OnExpirationUpdate(const CdmSessionId& session_id,
|
||||
int64_t new_expiry_time) = 0;
|
||||
|
||||
private:
|
||||
CORE_DISALLOW_COPY_AND_ASSIGN(WvCdmEventListener);
|
||||
|
||||
Reference in New Issue
Block a user