Source release 16.3.0

This commit is contained in:
John W. Bruce
2020-07-24 14:30:03 -07:00
parent b830b1d1fb
commit 160df9f57a
74 changed files with 4632 additions and 2561 deletions

View File

@@ -13,7 +13,7 @@ using namespace widevine;
namespace {
const std::string kCertificateFilename = "cert.bin";
constexpr char kCertificateFilename[] = "cert.bin";
} // namespace
@@ -33,7 +33,7 @@ void TestHost::Reset() {
}
files_.clear();
files_[kCertificateFilename.c_str()] =
files_[kCertificateFilename] =
(device_cert_.size() > 0)
? device_cert_
: std::string((const char*)kDeviceCert, kDeviceCertSize);
@@ -46,10 +46,14 @@ void TestHost::ElapseTime(int64_t milliseconds) {
now_ = goal_time;
} else {
Timer t = timers_.top();
timers_.pop();
ASSERT_GE(t.expiry_time(), now_);
now_ = t.expiry_time();
t.client()->onTimerExpired(t.context());
if (t.expiry_time() <= goal_time) {
timers_.pop();
now_ = t.expiry_time();
t.client()->onTimerExpired(t.context());
} else {
now_ = goal_time;
}
}
}
}
@@ -68,7 +72,7 @@ bool TestHost::read(const std::string& name, std::string* data) {
bool TestHost::write(const std::string& name, const std::string& data) {
LOGV("write file: %s", name.c_str());
files_[name] = data;
if (save_device_cert_ && kCertificateFilename.compare(name) == 0) {
if (save_device_cert_ && name.compare(kCertificateFilename) == 0) {
device_cert_ = data;
save_device_cert_ = false;
}
@@ -87,10 +91,10 @@ bool TestHost::remove(const std::string& name) {
if (name.empty()) {
// If no name, delete all files (see DeviceFiles::DeleteAllFiles())
files_.clear();
} else {
files_.erase(name);
return true;
}
return true;
return files_.erase(name) > 0;
}
int32_t TestHost::size(const std::string& name) {