Source release v3.5.0
This commit is contained in:
@@ -18,6 +18,8 @@ class TestHost : public widevine::Cdm::IStorage,
|
||||
void ElapseTime(int64_t milliseconds);
|
||||
int NumTimers() const;
|
||||
|
||||
void SaveProvisioningInformation() { save_device_cert_ = true; }
|
||||
|
||||
virtual bool read(const std::string& name,
|
||||
std::string* data) OVERRIDE;
|
||||
virtual bool write(const std::string& name,
|
||||
@@ -36,23 +38,31 @@ class TestHost : public widevine::Cdm::IStorage,
|
||||
|
||||
private:
|
||||
struct Timer {
|
||||
Timer(int64_t expiry_time_, IClient* client_, void* context_)
|
||||
: expiry_time(expiry_time_), client(client_), context(context_) {}
|
||||
Timer(int64_t expiry_time, IClient* client, void* context)
|
||||
: expiry_time_(expiry_time), client_(client), context_(context) {}
|
||||
|
||||
bool operator<(const Timer& other) const {
|
||||
// We want to reverse the order so that the smallest expiry times go to
|
||||
// the top of the priority queue.
|
||||
return expiry_time > other.expiry_time;
|
||||
return expiry_time_ > other.expiry_time_;
|
||||
}
|
||||
|
||||
int64_t expiry_time;
|
||||
IClient* client;
|
||||
void* context;
|
||||
int64_t expiry_time() { return expiry_time_; }
|
||||
IClient* client() { return client_; }
|
||||
void* context() { return context_; }
|
||||
|
||||
private:
|
||||
int64_t expiry_time_;
|
||||
IClient* client_;
|
||||
void* context_;
|
||||
};
|
||||
|
||||
int64_t now_;
|
||||
std::priority_queue<Timer> timers_;
|
||||
|
||||
std::string device_cert_;
|
||||
bool save_device_cert_;
|
||||
|
||||
typedef std::map<std::string, std::string> StorageMap;
|
||||
StorageMap files_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user