| Index: media/base/ranges.h
|
| ===================================================================
|
| --- media/base/ranges.h (revision 145933)
|
| +++ media/base/ranges.h (working copy)
|
| @@ -10,6 +10,7 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/logging.h"
|
| +#include "base/time.h"
|
| #include "media/base/media_export.h"
|
|
|
| namespace media {
|
| @@ -37,6 +38,9 @@
|
| void clear();
|
|
|
| private:
|
| + // Wrapper around DCHECK_LT allowing comparisons of operator<<'able T's.
|
| + void DCheckLT(const T& lhs, const T& rhs) const;
|
| +
|
| // Disjoint, in increasing order of start.
|
| std::vector<std::pair<T, T> > ranges_;
|
| };
|
| @@ -50,7 +54,7 @@
|
| if (start == end) // Nothing to be done with empty ranges.
|
| return ranges_.size();
|
|
|
| - DCHECK(start < end);
|
| + DCheckLT(start, end);
|
| size_t i;
|
| // Walk along the array of ranges until |start| is no longer larger than the
|
| // current interval's end.
|
| @@ -95,7 +99,16 @@
|
| return ranges_.size();
|
| }
|
|
|
| +template<>
|
| +void Ranges<base::TimeDelta>::DCheckLT(const base::TimeDelta& lhs,
|
| + const base::TimeDelta& rhs) const;
|
| +
|
| template<class T>
|
| +void Ranges<T>::DCheckLT(const T& lhs, const T& rhs) const {
|
| + DCHECK_LT(lhs, rhs);
|
| +}
|
| +
|
| +template<class T>
|
| size_t Ranges<T>::size() const {
|
| return ranges_.size();
|
| }
|
|
|