mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 881512 - Add start (and rename end) time helper to TimeRanges. r=cajbir
This commit is contained in:
parent
10f5ba6bb9
commit
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();
|
||||
|
Loading…
Reference in New Issue
Block a user