| Index: media/base/ranges.h
|
| diff --git a/media/base/ranges.h b/media/base/ranges.h
|
| index 1117ae58b8db86321df815f07f1646d996f3a299..82bf7a074742681cebafa997543fbaf4b16bc085 100644
|
| --- a/media/base/ranges.h
|
| +++ b/media/base/ranges.h
|
| @@ -11,6 +11,7 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/logging.h"
|
| +#include "base/time.h"
|
| #include "media/base/media_export.h"
|
|
|
| namespace media {
|
| @@ -41,6 +42,9 @@ class Ranges {
|
| Ranges<T> IntersectionWith(const Ranges<T>& other);
|
|
|
| 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_;
|
| };
|
| @@ -54,7 +58,7 @@ size_t Ranges<T>::Add(T start, T end) {
|
| 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.
|
| @@ -99,6 +103,15 @@ size_t Ranges<T>::Add(T start, T end) {
|
| 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();
|
|
|