Creating a new RNG and replacing rand().
[ Merge of http://go/wvgerrit/84607 ] [ Merge of http://go/wvgerrit/84608 ] The primary goal is to replace the use of `rand()` with the random number generators provided with the C++11 standard. This simplified generator wraps some of the technical aspects of the <random> library and provides an interface for uniformly distributed integers. As part of the `rand()` purge in the CDM, all uses of the C random int function in `core()` have been removed. Places that previously used `rand()` now use `CdmRandom` facilities. Test: Linux unittest and Android unittest Bug: 130680365 Change-Id: Ica383870536ed462dbb80e630c2d66845e38b937
This commit is contained in:
@@ -392,8 +392,6 @@ class CdmEngine {
|
||||
Clock clock_;
|
||||
std::string spoid_;
|
||||
|
||||
static bool seeded_;
|
||||
|
||||
// usage related variables
|
||||
std::unique_ptr<CdmSession> usage_session_;
|
||||
std::unique_ptr<UsagePropertySet> usage_property_set_;
|
||||
|
||||
@@ -83,10 +83,6 @@ class UsageTableHeader {
|
||||
// for the objects that DeleteEntry depends on.
|
||||
void DeleteEntryForTest(uint32_t usage_entry_number);
|
||||
|
||||
// TODO(rfrias): Move to utility class
|
||||
static int64_t GetRandomInRange(size_t upper_bound_exclusive);
|
||||
static int64_t GetRandomInRangeWithExclusion(size_t upper_bound_exclusive,
|
||||
size_t exclude);
|
||||
size_t size() { return usage_entry_info_.size(); }
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user