Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(856)

Unified Diff: media/base/ranges.h

Issue 10698134: Merge 143765 - Ensure media's buffered ranges always have a range that includes currentTime. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/pipeline_unittest.cc ('k') | media/base/ranges.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « media/base/pipeline_unittest.cc ('k') | media/base/ranges.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698