|
Lines 34-87
a/Source/WebCore/html/CueIndex.cpp_sec1
|
| 34 |
|
34 |
|
| 35 |
namespace WebCore { |
35 |
namespace WebCore { |
| 36 |
|
36 |
|
| 37 |
CueSet CueSet::difference(const CueSet&) const |
37 |
CueSet CueSet::difference(const CueSet& other) const |
| 38 |
{ |
38 |
{ |
| 39 |
// FIXME(62883): Implement. |
39 |
CueSet newSet; |
| 40 |
return CueSet(); |
40 |
for (CueSet::Iterator it = other.m_set.begin(); it != other.m_set.end(); ++it) { |
|
|
41 |
TextTrackCue* cue = *it; |
| 42 |
if (!m_set.contains(cue)) |
| 43 |
newSet.add(*cue); |
| 44 |
} |
| 45 |
return newSet; |
| 41 |
} |
46 |
} |
| 42 |
|
47 |
|
| 43 |
CueSet CueSet::unionSet(const CueSet&) const |
48 |
CueSet CueSet::unionSet(const CueSet& other) const |
| 44 |
{ |
49 |
{ |
| 45 |
// FIXME(62883): Implement. |
50 |
CueSet newSet; |
| 46 |
return CueSet(); |
51 |
for (CueSet::Iterator it = other.m_set.begin(); it != other.m_set.end(); ++it) { |
|
|
52 |
TextTrackCue* cue = *it; |
| 53 |
newSet.add(*cue); |
| 54 |
} |
| 55 |
for (CueSet::Iterator it = m_set.begin(); it != m_set.end(); ++it) { |
| 56 |
TextTrackCue* cue = *it; |
| 57 |
newSet.add(*cue); |
| 58 |
} |
| 59 |
return newSet; |
| 47 |
} |
60 |
} |
| 48 |
|
61 |
|
| 49 |
void CueSet::add(const TextTrackCue&) |
62 |
void CueSet::add(const TextTrackCue& cue) |
| 50 |
{ |
63 |
{ |
| 51 |
// FIXME(62883): Implement. |
64 |
m_set.add(const_cast<TextTrackCue*>(&cue)); |
| 52 |
} |
65 |
} |
| 53 |
|
66 |
|
| 54 |
bool CueSet::contains(const TextTrackCue&) const |
67 |
bool CueSet::contains(const TextTrackCue& cue) const |
| 55 |
{ |
68 |
{ |
| 56 |
// FIXME(62883): Implement. |
69 |
return m_set.contains(const_cast<TextTrackCue*>(&cue)); |
| 57 |
return false; |
|
|
| 58 |
} |
70 |
} |
| 59 |
|
71 |
|
| 60 |
void CueSet::remove(const TextTrackCue&) |
72 |
void CueSet::remove(const TextTrackCue& cue) |
| 61 |
{ |
73 |
{ |
| 62 |
// FIXME(62883): Implement. |
74 |
m_set.remove(const_cast<TextTrackCue*>(&cue)); |
|
|
75 |
} |
| 76 |
|
| 77 |
void CueSet::clear() |
| 78 |
{ |
| 79 |
m_set.clear(); |
| 63 |
} |
80 |
} |
| 64 |
|
81 |
|
| 65 |
bool CueSet::isEmpty() const |
82 |
bool CueSet::isEmpty() const |
| 66 |
{ |
83 |
{ |
| 67 |
// FIXME(62883): Implement. |
84 |
return m_set.isEmpty(); |
| 68 |
return false; |
|
|
| 69 |
} |
85 |
} |
| 70 |
|
86 |
|
| 71 |
int CueSet::size() const |
87 |
int CueSet::size() const |
| 72 |
{ |
88 |
{ |
| 73 |
// FIXME(62883): Implement. |
89 |
return m_set.size(); |
| 74 |
return 0; |
90 |
} |
|
|
91 |
|
| 92 |
CueSet::Iterator CueSet::begin() const |
| 93 |
{ |
| 94 |
return m_set.begin(); |
| 95 |
} |
| 96 |
|
| 97 |
CueSet::Iterator CueSet::end() const |
| 98 |
{ |
| 99 |
return m_set.end(); |
| 75 |
} |
100 |
} |
| 76 |
|
101 |
|
| 77 |
void CueIndex::fetchNewCuesFromLoader(CueLoader*) |
102 |
void CueIndex::fetchNewCuesFromLoader(CueLoader* loader) |
| 78 |
{ |
103 |
{ |
| 79 |
// FIXME(62883): Implement. |
104 |
Vector<TextTrackCue*> newCues; |
|
|
105 |
loader->fetchNewestCues(newCues); |
| 106 |
for (size_t i = 0; i < newCues.size(); ++i) |
| 107 |
add(newCues[i]); |
| 80 |
} |
108 |
} |
| 81 |
|
109 |
|
| 82 |
void CueIndex::removeCuesFromIndex(const TextTrackCueList*) |
110 |
void CueIndex::removeCuesFromIndex(const TextTrackCueList* cueList) |
| 83 |
{ |
111 |
{ |
| 84 |
// FIXME(62883): Implement. |
112 |
for (size_t i = 0; i < cueList->length(); ++i) |
|
|
113 |
remove(cueList->item(i)); |
| 85 |
} |
114 |
} |
| 86 |
|
115 |
|
| 87 |
CueSet CueIndex::visibleCuesAtTime(double) const |
116 |
CueSet CueIndex::visibleCuesAtTime(double) const |
|
Lines 90-103
CueSet CueIndex::visibleCuesAtTime(double) const
a/Source/WebCore/html/CueIndex.cpp_sec2
|
| 90 |
return CueSet(); |
119 |
return CueSet(); |
| 91 |
} |
120 |
} |
| 92 |
|
121 |
|
| 93 |
void CueIndex::add(TextTrackCue*) |
122 |
void CueIndex::add(TextTrackCue* cue) |
|
|
123 |
{ |
| 124 |
add(cue, 0, m_cuesByStartTime.size()); |
| 125 |
} |
| 126 |
|
| 127 |
void CueIndex::add(TextTrackCue* cue, size_t start, size_t end) |
| 94 |
{ |
128 |
{ |
| 95 |
// FIXME(62890): Implement. |
129 |
if (start == end) { |
|
|
130 |
m_cuesByStartTime.insert(start, cue); |
| 131 |
return; |
| 132 |
} |
| 133 |
|
| 134 |
size_t index = (start + end) / 2; |
| 135 |
if (cue->startTime() < m_cuesByStartTime[index]->startTime() |
| 136 |
|| (cue->startTime() == m_cuesByStartTime[index]->startTime() |
| 137 |
&& cue->endTime() < m_cuesByStartTime[index]->endTime())) |
| 138 |
add(cue, start, index); |
| 139 |
else |
| 140 |
add(cue, index + 1, end); |
| 96 |
} |
141 |
} |
| 97 |
|
142 |
|
| 98 |
void CueIndex::remove(TextTrackCue*) |
143 |
void CueIndex::remove(TextTrackCue* cue) |
| 99 |
{ |
144 |
{ |
| 100 |
// FIXME(62890): Implement. |
145 |
size_t index = m_cuesByStartTime.find(cue); |
|
|
146 |
if (index != notFound) |
| 147 |
m_cuesByStartTime.remove(index); |
| 101 |
} |
148 |
} |
| 102 |
|
149 |
|
| 103 |
} // namespace WebCore |
150 |
} // namespace WebCore |