Source release 18.1.0

This commit is contained in:
John "Juce" Bruce
2023-06-23 15:45:08 -07:00
parent 2baa7c6e2b
commit b2c35151ad
2074 changed files with 196004 additions and 427059 deletions

View File

@@ -43,68 +43,10 @@ class PolicyTimersV16 : public PolicyTimers {
// Call this on first decrypt to set the start of playback.
void BeginDecryption(int64_t current_time) override;
// This is a legacy field for offline licenses. Since no grace period is
// supported return a default value.
int64_t GetGracePeriodEndTime() override { return 0; }
// For offline save and restore.
void RestorePlaybackTimes(int64_t current_time, int64_t playback_start_time,
int64_t last_playback_time,
int64_t grace_period_end_time) override;
bool HasPlaybackStarted(int64_t /* current_time */) override {
return playback_start_time_ != 0;
}
// For licenses that support core messages, evaluation of only rental and
// playback durations are needed.
bool HasLicenseOrRentalOrPlaybackDurationExpired(
int64_t current_time) override {
return HasRentalOrPlaybackDurationExpired(current_time);
}
bool HasPassedGracePeriod(int64_t /* current_time */) override {
return true;
}
// This returns
// * before playback begins: the time remaining on |rental_duration_seconds|
// * after playback begins:
// - |soft_enforce_playback_duration| is true: the time remaining on
// |playback_duration_seconds|
// - |soft_enforce_playback_duration| is false: the minimum
// of the time remaining on |rental_duration_seconds| or
// |playback_duration_seconds|
//
// |license_duration_seconds| is ignored with the introduction of core
// messages
int64_t GetLicenseOrRentalOrPlaybackDurationRemaining(
int64_t current_time) override;
// This is only used in Query. This should return the time remaining on
// |rental_duration_seconds|.
int64_t GetLicenseOrRentalDurationRemaining(int64_t current_time) override {
return GetRentalDurationRemaining(current_time);
};
// Renewal related methods
bool HasRenewalDelayExpired(int64_t current_time) override;
protected:
// Gets the clock time that the license expires based on whether we have
// started playing. This takes into account GetHardLicenseExpiryTime.
int64_t GetExpiryTime(int64_t current_time,
bool ignore_soft_enforce_playback_duration) override;
int64_t GetRenewalStartTime() override { return renewal_start_time_; }
private:
// Gets the clock time that the rental duration or playback will expire.
int64_t GetRentalExpiryTime(int64_t current_time);
int64_t GetPlaybackExpiryTime(int64_t current_time,
bool ignore_soft_enforce_playback_duration);
bool HasRentalOrPlaybackDurationExpired(int64_t current_time);
int64_t GetRentalDurationRemaining(int64_t current_time);
int64_t renewal_start_time_ = 0;
CORE_DISALLOW_COPY_AND_ASSIGN(PolicyTimersV16);
};