OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 void add(double start, double end); | 107 void add(double start, double end); |
108 | 108 |
109 bool contain(double time) const; | 109 bool contain(double time) const; |
110 | 110 |
111 double nearest(double newPlaybackPosition, double currentPlaybackPosition) c
onst; | 111 double nearest(double newPlaybackPosition, double currentPlaybackPosition) c
onst; |
112 | 112 |
113 DEFINE_INLINE_TRACE() { } | 113 DEFINE_INLINE_TRACE() { } |
114 | 114 |
115 private: | 115 private: |
| 116 friend bool operator==(const TimeRanges&, const TimeRanges&); |
| 117 |
116 TimeRanges() { } | 118 TimeRanges() { } |
117 | 119 |
118 TimeRanges(double start, double end); | 120 TimeRanges(double start, double end); |
119 | 121 |
120 void invert(); | 122 void invert(); |
121 | 123 |
122 Vector<Range> m_ranges; | 124 Vector<Range> m_ranges; |
123 }; | 125 }; |
124 | 126 |
| 127 inline bool operator==(const TimeRanges::Range& a, const TimeRanges::Range& b) {
return a.m_start == b.m_start && a.m_end == b.m_end; } |
| 128 inline bool operator!=(const TimeRanges::Range& a, const TimeRanges::Range& b) {
return !(a == b); } |
| 129 inline bool operator==(const TimeRanges& a, const TimeRanges& b) { return a.m_ra
nges == b.m_ranges; } |
| 130 inline bool operator!=(const TimeRanges& a, const TimeRanges& b) { return !(a ==
b); } |
| 131 |
125 } // namespace blink | 132 } // namespace blink |
126 | 133 |
127 #endif // TimeRanges_h | 134 #endif // TimeRanges_h |
OLD | NEW |