зеркало из https://github.com/mozilla/gecko-dev.git
Bug 881512 - Add start (and rename end) time helper to TimeRanges. r=cajbir
This commit is contained in:
Родитель
10f5ba6bb9
Коммит
c3621f0329
|
@ -80,13 +80,21 @@ TimeRanges::Add(double aStart, double aEnd)
|
|||
}
|
||||
|
||||
double
|
||||
TimeRanges::GetFinalEndTime()
|
||||
TimeRanges::GetStartTime()
|
||||
{
|
||||
if (mRanges.IsEmpty()) {
|
||||
return -1.0;
|
||||
}
|
||||
uint32_t finalIndex = mRanges.Length() - 1;
|
||||
return mRanges[finalIndex].mEnd;
|
||||
return mRanges[0].mStart;
|
||||
}
|
||||
|
||||
double
|
||||
TimeRanges::GetEndTime()
|
||||
{
|
||||
if (mRanges.IsEmpty()) {
|
||||
return -1.0;
|
||||
}
|
||||
return mRanges[mRanges.Length() - 1].mEnd;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -30,8 +30,11 @@ public:
|
|||
|
||||
void Add(double aStart, double aEnd);
|
||||
|
||||
// Returns the end time of the last range, or -1 if no ranges added.
|
||||
double GetFinalEndTime();
|
||||
// Returns the start time of the first range, or -1 if no ranges exist.
|
||||
double GetStartTime();
|
||||
|
||||
// Returns the end time of the last range, or -1 if no ranges exist.
|
||||
double GetEndTime();
|
||||
|
||||
// See http://www.whatwg.org/html/#normalized-timeranges-object
|
||||
void Normalize();
|
||||
|
|
Загрузка…
Ссылка в новой задаче