Commit 5b49db69 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Add more checks around CDM renewal logic

Bug: 690696

Change-Id: I0ea4ad248a47ff29238344fdea6d1e7beb906743
Reviewed-on: https://chromium-review.googlesource.com/944050Reviewed-by: default avatarJohn Rummell <jrummell@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540345}
parent 252e46d2
......@@ -505,6 +505,13 @@ void ClearKeyCdm::OnUpdateSuccess(uint32_t promise_id,
expiration = 3153600000.0; // 100 * 365 * 24 * 60 * 60;
if (!has_set_renewal_timer_) {
// Make sure the CDM can get time and sleep if necessary.
constexpr auto kSleepDuration = base::TimeDelta::FromSeconds(1);
auto start_time = base::Time::Now();
base::PlatformThread::Sleep(kSleepDuration);
auto time_elapsed = base::Time::Now() - start_time;
CHECK_GE(time_elapsed, kSleepDuration);
ScheduleNextRenewal();
has_set_renewal_timer_ = true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment